{
  "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/dayjs/dayjs.min.js", "../../../node_modules/dayjs/plugin/relativeTime.js", "../../../node_modules/dayjs/plugin/updateLocale.js", "../../../node_modules/etjs/et.js", "../../../node_modules/slim-select/dist/slimselect.umd.js", "../../../node_modules/cropperjs/dist/cropper.js", "../../../node_modules/string-natural-compare/natural-compare.js", "../../../node_modules/list.js/src/utils/get-by-class.js", "../../../node_modules/list.js/src/utils/extend.js", "../../../node_modules/list.js/src/utils/index-of.js", "../../../node_modules/list.js/src/utils/to-array.js", "../../../node_modules/list.js/src/utils/events.js", "../../../node_modules/list.js/src/utils/to-string.js", "../../../node_modules/list.js/src/utils/classes.js", "../../../node_modules/list.js/src/utils/get-attribute.js", "../../../node_modules/list.js/src/item.js", "../../../node_modules/list.js/src/add-async.js", "../../../node_modules/list.js/src/pagination.js", "../../../node_modules/list.js/src/parse.js", "../../../node_modules/list.js/src/templater.js", "../../../node_modules/list.js/src/search.js", "../../../node_modules/list.js/src/filter.js", "../../../node_modules/list.js/src/sort.js", "../../../node_modules/list.js/src/utils/fuzzy.js", "../../../node_modules/list.js/src/fuzzy-search.js", "../../../node_modules/list.js/src/index.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/cable_stream_source_element.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../javascript/controllers/activity_controller.js", "../../javascript/controllers/alert_controller.js", "../../javascript/controllers/analytics_controller.js", "../../javascript/controllers/autocomplete_controller.js", "../../../node_modules/chart.js/dist/chunks/helpers.segment.js", "../../../node_modules/chart.js/dist/chart.esm.js", "../../javascript/controllers/charts_controller.js", "../../javascript/controllers/dashboard_controller.js", "../../../node_modules/sortablejs/modular/sortable.esm.js", "../../javascript/controllers/draggable_controller.js", "../../javascript/controllers/favorite_controller.js", "../../../node_modules/@firebase/util/src/constants.ts", "../../../node_modules/@firebase/util/src/assert.ts", "../../../node_modules/@firebase/util/src/crypt.ts", "../../../node_modules/@firebase/util/src/deepCopy.ts", "../../../node_modules/@firebase/util/src/deferred.ts", "../../../node_modules/@firebase/util/src/emulator.ts", "../../../node_modules/@firebase/util/src/environment.ts", "../../../node_modules/@firebase/util/src/errors.ts", "../../../node_modules/@firebase/util/src/json.ts", "../../../node_modules/@firebase/util/src/jwt.ts", "../../../node_modules/@firebase/util/src/obj.ts", "../../../node_modules/@firebase/util/src/query.ts", "../../../node_modules/@firebase/util/src/sha1.ts", "../../../node_modules/@firebase/util/src/subscribe.ts", "../../../node_modules/@firebase/util/src/validation.ts", "../../../node_modules/@firebase/util/src/utf8.ts", "../../../node_modules/@firebase/util/src/exponential_backoff.ts", "../../../node_modules/@firebase/util/src/formatters.ts", "../../../node_modules/@firebase/util/src/compat.ts", "../../../node_modules/@firebase/util/src/indexeddb.ts", "../../../node_modules/@firebase/component/src/component.ts", "../../../node_modules/@firebase/component/src/constants.ts", "../../../node_modules/@firebase/component/src/provider.ts", "../../../node_modules/@firebase/component/src/component_container.ts", "../../../node_modules/@firebase/logger/src/logger.ts", "../../../node_modules/@firebase/app/src/platformLoggerService.ts", "../../../node_modules/@firebase/app/src/logger.ts", "../../../node_modules/@firebase/app/src/constants.ts", "../../../node_modules/@firebase/app/src/internal.ts", "../../../node_modules/@firebase/app/src/errors.ts", "../../../node_modules/@firebase/app/src/firebaseApp.ts", "../../../node_modules/@firebase/app/src/api.ts", "../../../node_modules/@firebase/app/src/indexeddb.ts", "../../../node_modules/@firebase/app/src/heartbeatService.ts", "../../../node_modules/@firebase/app/src/registerCoreComponents.ts", "../../../node_modules/@firebase/app/src/index.ts", "../../../node_modules/firebase/app/index.ts", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/base.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/disposable/disposable.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/array/array.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/xhrio.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/string/internal.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/useragent/util.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/object/object.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/reflect/reflect.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/useragent/useragent.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/useragent/browser.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/useragent/engine.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/browserfeature.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/event.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/browserevent.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/eventtype.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/listenable.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/listenablekey.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/listener.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/listenermap.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/events.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/eventtarget.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/json/json.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/async/workqueue.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/async/run.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/async/freelist.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/async/throwexception.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/timer/timer.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/async/throttle.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/events/eventhandler.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchanneldebug.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/requeststats.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/errorcode.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/eventtype.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/xmlhttpfactory.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/xmlhttp.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/channelrequest.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/environment.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchannelbase.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/uri/uri.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/string/string.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/disposable/dispose.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/wirev8.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/forwardchannelrequestpool.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/structs/structs.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/structs/map.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/uri/utils.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/wire.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/json/nativejsonprocessor.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/netutils.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/fetchxmlhttpfactory.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/functions/functions.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/json/hybrid.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/httpstatus.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/net/rpc/httpcors.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchanneltransport.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchannelbasetransport.js", "../../../node_modules/@firebase/webchannel-wrapper/dist/temp/src/index.js", "../../../node_modules/@firebase/webchannel-wrapper/node_modules/google-closure-library/closure/goog/labs/net/webchanneltransportfactory.js", "../../../node_modules/@firebase/firestore/dist/index.esm2017.js", "../../javascript/controllers/firebase_controller.js", "../../javascript/controllers/form_controller.js", "../../javascript/controllers/geocoder_controller.js", "../../javascript/controllers/image_controller.js", "../../javascript/controllers/list_controller.js", "../../javascript/controllers/listing_controller.js", "../../javascript/controllers/map_controller.js", "../../javascript/controllers/menu_controller.js", "../../javascript/controllers/modal_controller.js", "../../javascript/controllers/navigation_controller.js", "../../javascript/controllers/spinner_controller.js", "../../javascript/controllers/theme_controller.js", "../../javascript/controllers/index.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  },\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      logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${protocols}`)\n      if (this.webSocket) { this.uninstallEventHandlers() }\n      this.webSocket = new adapters.WebSocket(this.consumer.url, protocols)\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    if (this.isActive()) {\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  // 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        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        return this.subscriptions.notify(identifier, \"connected\")\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  }\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\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", "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",f=\"month\",h=\"quarter\",c=\"year\",d=\"date\",$=\"Invalid Date\",l=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},v=\"en\",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g=\"set\"+(this.$u?\"UTC\":\"\");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+\"Hours\",0);case u:return l(g+\"Minutes\",1);case s:return l(g+\"Seconds\",2);case i:return l(g+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h=\"set\"+(this.$u?\"UTC\":\"\"),$=(n={},n[a]=h+\"Date\",n[d]=h+\"Date\",n[f]=h+\"Month\",n[c]=h+\"FullYear\",n[u]=h+\"Hours\",n[s]=h+\"Minutes\",n[i]=h+\"Seconds\",n[r]=h+\"Milliseconds\",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,\"0\")},d=n.meridiem||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,\"0\"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,\"0\"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,\"0\"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,\"0\"),s:String(this.$s),ss:O.s(this.$s,2,\"0\"),SSS:O.s(this.$ms,3,\"0\"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",f],[\"$y\",c],[\"$D\",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));", "!function(r,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(r=\"undefined\"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e()}(this,(function(){\"use strict\";return function(r,e,t){r=r||{};var n=e.prototype,o={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:\"s\",r:44,d:\"second\"},{l:\"m\",r:89},{l:\"mm\",r:44,d:\"minute\"},{l:\"h\",r:89},{l:\"hh\",r:21,d:\"hour\"},{l:\"d\",r:35},{l:\"dd\",r:25,d:\"day\"},{l:\"M\",r:45},{l:\"MM\",r:10,d:\"month\"},{l:\"y\",r:17},{l:\"yy\",d:\"year\"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(\"\"+p)),a=\"string\"==typeof v?v.replace(\"%d\",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return\"function\"==typeof M?M(a):M.replace(\"%s\",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}}));", "!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_updateLocale=n()}(this,(function(){\"use strict\";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach((function(e){o[e]=n[e]})),o}}}));", "/*!\n * et.js 1.4.1\n */\n\n// Set default etjs options\nvar defaultEtjsOptions = {\n  isProduction: true,\n  gaCode: false,\n  alexaCode: false,\n  listHubCode: false,\n  domain: window.location.host,\n  suppressWarnings: false,\n  productionHostname: false,\n  debugger: false,\n  fireWithTrackPage: function() {\n    return false;\n  },\n  fireWithTrackEvent: function() {\n    return false;\n  },\n  usingGA: false,\n  usingAtrk: false,\n  usingListHub: false,\n  pageOpts: {\n    memberToken: false,\n    listingPostalCode: false,\n    listingID: false,\n    listingCountry: false,\n    listingStateProvince: false,\n    listingCity: false,\n    listingAgentToken: [],\n    listHubKey: false\n  }\n};\n\nvar etjs = {\n\n  options: {},\n\n  init: function(setupOpts) {\n    window.onload = function() {\n      if (typeof setupOpts !== 'undefined') {\n        var optionsObject = [defaultEtjsOptions, setupOpts];\n        etjs.options = optionsObject.reduce(function (r, o) {\n          Object.keys(o).forEach(function (k) {\n            r[k] = o[k];\n          });\n          return r;\n        }, {});\n        etjs.setupGoogleAnalytics(etjs.options.pageOpts);\n        etjs.setupAlexa();\n        etjs.setupListHub();\n        etjs.trackPage(etjs.options.pageOpts);\n      } else {\n        etjs.isNotSetup();\n      }\n    }\n  },\n\n  turbolinksInit: function(setupOpts) {\n    if (typeof setupOpts !== 'undefined') {\n      var optionsObject = [defaultEtjsOptions, setupOpts];\n      etjs.options = optionsObject.reduce(function (r, o) {\n        Object.keys(o).forEach(function (k) {\n          r[k] = o[k];\n        });\n        return r;\n      }, {});\n      etjs.setupGoogleAnalytics(etjs.options.pageOpts);\n      etjs.setupAlexa();\n      etjs.setupListHub();\n      etjs.trackPage(etjs.options.pageOpts);\n    } else {\n      etjs.isNotSetup();\n    }\n  },\n\n  // Setup Google Analytics\n  setupGoogleAnalytics: function(pageOpts) {\n    // Include Google analytics script\n    if (etjs.options.gaCode) {\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n      m=s.getElementsByTagName(o)[0];a.async=1;a.id='ga_trk';a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n      if (Array.isArray(etjs.options.gaCode)) {\n        etjs.options.gaCode.forEach(function(tracker) {\n          ga('create', tracker.code, 'auto', {name: tracker.name});\n        });\n      } else {\n        ga('create', etjs.options.gaCode, 'auto');\n      }\n\n      // anonymize IPs\n      ga('set', 'anonymizeIp', true);\n\n      // Set custom dimensions object once\n      if (pageOpts.memberToken) {\n        ga('set', 'dimension1', pageOpts.memberToken);\n      }\n      if (pageOpts.listingPostalCode) {\n        ga('set', 'dimension2', pageOpts.listingPostalCode);\n      }\n      if (pageOpts.listingID) {\n        ga('set', 'dimension3', pageOpts.listingID);\n      }\n      if (pageOpts.listingCountry) {\n        ga('set', 'dimension4', pageOpts.listingCountry);\n      }\n      if (pageOpts.listingStateProvince) {\n        ga('set', 'dimension5', pageOpts.listingStateProvince);\n      }\n      if (pageOpts.listingCity) {\n        ga('set', 'dimension6', pageOpts.listingCity);\n      }\n      if (pageOpts.listingAgentToken && pageOpts.listingAgentToken.length) {\n        pageOpts.listingAgentToken.forEach(function(opt) {\n          ga('set', 'dimension7', opt);\n        })\n      }\n      etjs.options.usingGA = true;\n    }\n  },\n\n  // Setup Alexa\n  setupAlexa: function() {\n    // Include Alexa tracking script\n    if (etjs.options.alexaCode) { // If alexaCode option is present use it\n      _atrk_opts = { atrk_acct: etjs.options.alexaCode, domain: etjs.options.domain, dynamic: true};\n      (function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = 'https://d31qbv1cthcecs.cloudfront.net/atrk.js'; as.id = 'a_trk'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();\n      etjs.options.usingAtrk = true;\n    } else { // If alexaCode is not present, then check for alexa noscript tracker gif\n      var re = /atrk.gif[?]account=[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*/;\n      var ns = document.getElementsByTagName('noscript');\n      for (var i=0; i<ns.length; i++) { // Look through any noscript tags for atrk gif\n        var nsImg = ns[i].firstChild.textContent;\n        var gifCode = nsImg.match(re);\n      }\n      if (typeof gifCode !== 'undefined' && gifCode.length > 0) { // If atrk gif found, setup Alexa script\n        etjs.options.alexaCode = gifCode[0].replace(\"atrk.gif?account=\", \"\");\n        _atrk_opts = { atrk_acct: etjs.options.alexaCode, domain: etjs.options.domain, dynamic: true};\n        (function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = 'https://d31qbv1cthcecs.cloudfront.net/atrk.js'; as.id = 'a_trk'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();\n        etjs.options.usingAtrk = true;\n      }\n    }\n  },\n\n  // Setup ListHub\n  setupListHub: function() {\n    if (etjs.options.listHubCode) {\n      (function(l,i,s,t,h,u,b){l['ListHubAnalyticsObject']=h;l[h]=l[h]||function(){\n        (l[h].q=l[h].q||[]).push(arguments)},l[h].d=1*new Date();u=i.createElement(s),\n        b=i.getElementsByTagName(s)[0];u.async=1;u.src=t;b.parentNode.insertBefore(u,b)\n      })(window,document,'script','//tracking.listhub.net/la.min.js','lh');\n\n      etjs.options.usingListHub = true;\n    }\n  },\n\n  trackPage: function(pageOpts) {\n\n    if (etjs.options) {\n\n      // Google Analytics\n      if (etjs.options.usingGA) {\n\n        if (etjs.isProduction()) {\n\n          // In Production track pageview\n          var page = window.location.pathname + window.location.search + window.location.hash;\n          if (Array.isArray(etjs.options.gaCode)) {\n            etjs.options.gaCode.forEach(function(tracker) {\n              ga(tracker.name + '.send', 'pageview', page);\n            });\n          } else {\n            ga('send', 'pageview', page);\n          }\n\n        } else {\n          // If not production, just simulate the tracking and log a message for easy testing\n          etjs.fancyLog.google('analytics would track pageview in production', 'log', etjs.options.pageOpts);\n        }\n      }\n\n      // Alexa\n      if (etjs.options.usingAtrk) {\n        etjs.scriptIsLoaded('a_trk', function() {\n          if (typeof window.atrk !== 'undefined') {\n            if (etjs.isProduction()) {\n              window._atrk_fired = false;\n              atrk();\n            } else {\n              etjs.fancyLog.alexa('would track pageview in production');\n            }\n          } else {\n            if (!etjs.options.suppressWarnings) {\n              etjs.fancyLog.alexa('script not loaded', 'warn');\n            }\n          }\n        });\n      }\n\n      // Custom function\n      etjs.options.fireWithTrackPage();\n\n    } else {\n      etjs.isNotSetup();\n    }\n  },\n\n  trackImpression: function(listHubKey) {\n    if (lh) {\n      lh('submit', 'DETAIL_PAGE_VIEWED', {lkey: listHubKey});\n    }\n  },\n\n  trackSearchResults: function(listHubResults) {\n    if (lh) {\n      lh('submit', 'SEARCH_DISPLAY', listHubResults);\n    }\n  },\n\n  trackEvent: function(eventOpts) {\n\n    var eventTypes = [\"view\", \"lead\", \"share\", \"gallery\", \"favorite\",  \"vTour\"];\n    if (etjs.options) {\n\n      if (eventOpts.name && eventOpts.action) {\n        if (etjs.isProduction()) {\n\n          // Google analytics\n          if (Array.isArray(etjs.options.gaCode)) {\n            etjs.options.gaCode.forEach(function(tracker) {\n              ga(tracker.name + '.send', 'event', eventOpts.name, eventOpts.action);\n            });\n          } else {\n            ga('send', 'event', eventOpts.name, eventOpts.action);\n          }\n\n        } else {\n          if (etjs.options.usingGA) {\n            etjs.fancyLog.google('analytics would record ' + eventOpts.name + ' event in production');\n          }\n        }\n\n        // Custom function\n        etjs.options.fireWithTrackEvent();\n\n      } else if (etjs.options.debugger) {\n        console.warn(\"name & action must be declared\");\n      }\n    } else {\n      etjs.isNotSetup();\n    }\n  },\n\n  trackLead: function(listhubListingKey) {\n\n    if (etjs.options.usingListHub && listhubListingKey) {\n      lh('submit', \"OFFICE_EMAIL_SENT\", {lkey: listhubListingKey})\n      lh('submit', \"AGENT_EMAIL_SENT\", {lkey: listhubListingKey})\n    }\n\n  },\n\n  scriptIsLoaded: function(id, callback) {\n    document.getElementById(id).addEventListener('load', callback);\n  },\n\n  isNotSetup: function() {\n    if (etjs.options.debugger) {\n      console.warn('No etjs options found.');\n    }\n  },\n\n  isProduction: function() {\n    if (etjs.options.productionHostname) {\n      if (window.location.hostname === etjs.options.productionHostname) {\n        return true;\n      } else {\n        return false;\n      }\n    } else {\n      return etjs.options.isProduction;\n    }\n  },\n\n  fancyLog: {\n    google: function(msg, type, data) {\n      if (etjs.options.debugger) {\n        if (type == 'warn') {\n          if (data) {\n            console.warn('%c G'+'%co'+'%co'+'%cg'+'%cl'+'%ce ' + '%c ' + msg, 'background:#eeeeee;font-size:18px;color:#0266C8;border-radius:5px 0 0 5px;', 'background:#eeeeee;font-size:18px;color:#F90101', 'background:#eeeeee;font-size:18px;color:#F2B50F', 'background:#eeeeee;font-size:18px;color:#0266C8;', 'background:#eeeeee;font-size:18px;color:#00933B', 'background:#eeeeee;font-size:18px;color:#F90101;border-radius:0 5px 5px 0;', 'font-size:18px;color: black', data);\n          } else {\n            console.warn('%c G'+'%co'+'%co'+'%cg'+'%cl'+'%ce ' + '%c ' + msg, 'background:#eeeeee;font-size:18px;color:#0266C8;border-radius:5px 0 0 5px;', 'background:#eeeeee;font-size:18px;color:#F90101', 'background:#eeeeee;font-size:18px;color:#F2B50F', 'background:#eeeeee;font-size:18px;color:#0266C8;', 'background:#eeeeee;font-size:18px;color:#00933B', 'background:#eeeeee;font-size:18px;color:#F90101;border-radius:0 5px 5px 0;', 'font-size:18px;color: black');\n          }\n        } else {\n          if (data) {\n            console.log('%c G'+'%co'+'%co'+'%cg'+'%cl'+'%ce ' + '%c ' + msg, 'background:#eeeeee;font-size:18px;color:#0266C8;border-radius:5px 0 0 5px;', 'background:#eeeeee;font-size:18px;color:#F90101', 'background:#eeeeee;font-size:18px;color:#F2B50F', 'background:#eeeeee;font-size:18px;color:#0266C8;', 'background:#eeeeee;font-size:18px;color:#00933B', 'background:#eeeeee;font-size:18px;color:#F90101;border-radius:0 5px 5px 0;', 'font-size:18px;color: black', data);\n          } else {\n            console.log('%c G'+'%co'+'%co'+'%cg'+'%cl'+'%ce ' + '%c ' + msg, 'background:#eeeeee;font-size:18px;color:#0266C8;border-radius:5px 0 0 5px;', 'background:#eeeeee;font-size:18px;color:#F90101', 'background:#eeeeee;font-size:18px;color:#F2B50F', 'background:#eeeeee;font-size:18px;color:#0266C8;', 'background:#eeeeee;font-size:18px;color:#00933B', 'background:#eeeeee;font-size:18px;color:#F90101;border-radius:0 5px 5px 0;', 'font-size:18px;color: black');\n          }\n        }\n      }\n    },\n    alexa: function(msg, type) {\n      if (etjs.options.debugger) {\n        if (type == 'warn') {\n          console.warn('%c Alexa '+'%c ' + msg, 'background-color:#1B334B;color:white;font-size:18px;border-radius:5px', 'color:black;font-size:18px;');\n        } else {\n          console.log('%c Alexa '+'%c ' + msg, 'background-color:#1B334B;color:white;font-size:18px;border-radius:5px', 'color:black;font-size:18px;');\n        }\n      }\n    }\n  }\n\n};\n\nmodule.exports = etjs;\n// export default etjs;\n", "(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SlimSelect = factory());\n})(this, (function () { 'use strict';\n\n    function generateID() {\n        return Math.random().toString(36).substring(2, 10);\n    }\n    function hasClassInTree(element, className) {\n        function hasClass(e, c) {\n            if (c && e && e.classList && e.classList.contains(c)) {\n                return e;\n            }\n            if (c && e && e.dataset && e.dataset.id && e.dataset.id === className) {\n                return e;\n            }\n            return null;\n        }\n        function parentByClass(e, c) {\n            if (!e || e === document) {\n                return null;\n            }\n            else if (hasClass(e, c)) {\n                return e;\n            }\n            else {\n                return parentByClass(e.parentNode, c);\n            }\n        }\n        return hasClass(element, className) || parentByClass(element, className);\n    }\n    function debounce(func, wait = 50, immediate = false) {\n        let timeout;\n        return function (...args) {\n            const context = self;\n            const later = () => {\n                timeout = null;\n                if (!immediate) {\n                    func.apply(context, args);\n                }\n            };\n            const callNow = immediate && !timeout;\n            clearTimeout(timeout);\n            timeout = setTimeout(later, wait);\n            if (callNow) {\n                func.apply(context, args);\n            }\n        };\n    }\n    function isEqual(a, b) {\n        return JSON.stringify(a) === JSON.stringify(b);\n    }\n    function kebabCase(str) {\n        const result = str.replace(/[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g, (match) => '-' + match.toLowerCase());\n        return str[0] === str[0].toUpperCase() ? result.substring(1) : result;\n    }\n\n    class Settings {\n        constructor(settings) {\n            this.id = '';\n            this.style = '';\n            this.class = [];\n            this.isMultiple = false;\n            this.isOpen = false;\n            this.triggerFocus = true;\n            this.intervalMove = null;\n            if (!settings) {\n                settings = {};\n            }\n            this.id = 'ss-' + generateID();\n            this.style = settings.style || '';\n            this.class = settings.class || [];\n            this.disabled = settings.disabled !== undefined ? settings.disabled : false;\n            this.alwaysOpen = settings.alwaysOpen !== undefined ? settings.alwaysOpen : false;\n            this.showSearch = settings.showSearch !== undefined ? settings.showSearch : true;\n            this.searchPlaceholder = settings.searchPlaceholder || 'Search';\n            this.searchText = settings.searchText || 'No Results';\n            this.searchingText = settings.searchingText || 'Searching...';\n            this.searchHighlight = settings.searchHighlight !== undefined ? settings.searchHighlight : false;\n            this.closeOnSelect = settings.closeOnSelect !== undefined ? settings.closeOnSelect : true;\n            this.contentLocation = settings.contentLocation || document.body;\n            this.contentPosition = settings.contentPosition || 'absolute';\n            this.openPosition = settings.openPosition || 'auto';\n            this.placeholderText = settings.placeholderText || 'Select Value';\n            this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;\n            this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;\n            this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;\n            this.minSelected = settings.minSelected || 0;\n            this.maxSelected = settings.maxSelected || 1000;\n            this.timeoutDelay = settings.timeoutDelay || 200;\n            this.maxValuesShown = settings.maxValuesShown || 20;\n            this.maxValuesMessage = settings.maxValuesMessage || '{number} selected';\n        }\n    }\n\n    class Optgroup {\n        constructor(optgroup) {\n            this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;\n            this.label = optgroup.label || '';\n            this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;\n            this.closable = optgroup.closable || 'off';\n            this.options = [];\n            if (optgroup.options) {\n                for (const o of optgroup.options) {\n                    this.options.push(new Option(o));\n                }\n            }\n        }\n    }\n    class Option {\n        constructor(option) {\n            this.id = !option.id || option.id === '' ? generateID() : option.id;\n            this.value = option.value === undefined ? option.text : option.value;\n            this.text = option.text || '';\n            this.html = option.html || '';\n            this.selected = option.selected !== undefined ? option.selected : false;\n            this.display = option.display !== undefined ? option.display : true;\n            this.disabled = option.disabled !== undefined ? option.disabled : false;\n            this.mandatory = option.mandatory !== undefined ? option.mandatory : false;\n            this.placeholder = option.placeholder !== undefined ? option.placeholder : false;\n            this.class = option.class || '';\n            this.style = option.style || '';\n            this.data = option.data || {};\n        }\n    }\n    class Store {\n        constructor(type, data) {\n            this.selectType = 'single';\n            this.data = [];\n            this.selectType = type;\n            this.setData(data);\n        }\n        validateDataArray(data) {\n            if (!Array.isArray(data)) {\n                return new Error('Data must be an array');\n            }\n            for (let dataObj of data) {\n                if (dataObj instanceof Optgroup || 'label' in dataObj) {\n                    if (!('label' in dataObj)) {\n                        return new Error('Optgroup must have a label');\n                    }\n                    if ('options' in dataObj && dataObj.options) {\n                        for (let option of dataObj.options) {\n                            return this.validateOption(option);\n                        }\n                    }\n                }\n                else if (dataObj instanceof Option || 'text' in dataObj) {\n                    return this.validateOption(dataObj);\n                }\n                else {\n                    return new Error('Data object must be a valid optgroup or option');\n                }\n            }\n            return null;\n        }\n        validateOption(option) {\n            if (!('text' in option)) {\n                return new Error('Option must have a text');\n            }\n            return null;\n        }\n        partialToFullData(data) {\n            let dataFinal = [];\n            data.forEach((dataObj) => {\n                if (dataObj instanceof Optgroup || 'label' in dataObj) {\n                    let optOptions = [];\n                    if ('options' in dataObj && dataObj.options) {\n                        dataObj.options.forEach((option) => {\n                            optOptions.push(new Option(option));\n                        });\n                    }\n                    if (optOptions.length > 0) {\n                        dataFinal.push(new Optgroup(dataObj));\n                    }\n                }\n                if (dataObj instanceof Option || 'text' in dataObj) {\n                    dataFinal.push(new Option(dataObj));\n                }\n            });\n            return dataFinal;\n        }\n        setData(data) {\n            this.data = this.partialToFullData(data);\n            if (this.selectType === 'single') {\n                this.setSelectedBy('value', this.getSelected());\n            }\n        }\n        getData() {\n            return this.filter(null, true);\n        }\n        getDataOptions() {\n            return this.filter(null, false);\n        }\n        addOption(option) {\n            this.setData(this.getData().concat(new Option(option)));\n        }\n        setSelectedBy(selectedType, selectedValues) {\n            let firstOption = null;\n            let hasSelected = false;\n            for (let dataObj of this.data) {\n                if (dataObj instanceof Optgroup) {\n                    for (let option of dataObj.options) {\n                        if (!firstOption) {\n                            firstOption = option;\n                        }\n                        option.selected = hasSelected ? false : selectedValues.includes(option[selectedType]);\n                        if (option.selected && this.selectType === 'single') {\n                            hasSelected = true;\n                        }\n                    }\n                }\n                if (dataObj instanceof Option) {\n                    if (!firstOption) {\n                        firstOption = dataObj;\n                    }\n                    dataObj.selected = hasSelected ? false : selectedValues.includes(dataObj[selectedType]);\n                    if (dataObj.selected && this.selectType === 'single') {\n                        hasSelected = true;\n                    }\n                }\n            }\n            if (this.selectType === 'single' && firstOption && !hasSelected) {\n                firstOption.selected = true;\n            }\n        }\n        getSelected() {\n            let selectedOptions = this.getSelectedOptions();\n            let selectedValues = [];\n            selectedOptions.forEach((option) => {\n                selectedValues.push(option.value);\n            });\n            return selectedValues;\n        }\n        getSelectedOptions() {\n            return this.filter((opt) => {\n                return opt.selected;\n            }, false);\n        }\n        getSelectedIDs() {\n            let selectedOptions = this.getSelectedOptions();\n            let selectedIDs = [];\n            selectedOptions.forEach((op) => {\n                selectedIDs.push(op.id);\n            });\n            return selectedIDs;\n        }\n        getOptgroupByID(id) {\n            for (let dataObj of this.data) {\n                if (dataObj instanceof Optgroup && dataObj.id === id) {\n                    return dataObj;\n                }\n            }\n            return null;\n        }\n        getOptionByID(id) {\n            let options = this.filter((opt) => {\n                return opt.id === id;\n            }, false);\n            return options.length ? options[0] : null;\n        }\n        search(search, searchFilter) {\n            search = search.trim();\n            if (search === '') {\n                return this.getData();\n            }\n            return this.filter((opt) => {\n                return searchFilter(opt, search);\n            }, true);\n        }\n        filter(filter, includeOptgroup) {\n            const dataSearch = [];\n            this.data.forEach((dataObj) => {\n                if (dataObj instanceof Optgroup) {\n                    let optOptions = [];\n                    dataObj.options.forEach((option) => {\n                        if (!filter || filter(option)) {\n                            if (!includeOptgroup) {\n                                dataSearch.push(new Option(option));\n                            }\n                            else {\n                                optOptions.push(new Option(option));\n                            }\n                        }\n                    });\n                    if (optOptions.length > 0) {\n                        let optgroup = new Optgroup(dataObj);\n                        optgroup.options = optOptions;\n                        dataSearch.push(optgroup);\n                    }\n                }\n                if (dataObj instanceof Option) {\n                    if (!filter || filter(dataObj)) {\n                        dataSearch.push(new Option(dataObj));\n                    }\n                }\n            });\n            return dataSearch;\n        }\n    }\n\n    class Render {\n        constructor(settings, store, callbacks) {\n            this.classes = {\n                main: 'ss-main',\n                placeholder: 'ss-placeholder',\n                values: 'ss-values',\n                single: 'ss-single',\n                max: 'ss-max',\n                value: 'ss-value',\n                valueText: 'ss-value-text',\n                valueDelete: 'ss-value-delete',\n                valueOut: 'ss-value-out',\n                deselect: 'ss-deselect',\n                deselectPath: 'M10,10 L90,90 M10,90 L90,10',\n                arrow: 'ss-arrow',\n                arrowClose: 'M10,30 L50,70 L90,30',\n                arrowOpen: 'M10,70 L50,30 L90,70',\n                content: 'ss-content',\n                openAbove: 'ss-open-above',\n                openBelow: 'ss-open-below',\n                search: 'ss-search',\n                searchHighlighter: 'ss-search-highlight',\n                searching: 'ss-searching',\n                addable: 'ss-addable',\n                addablePath: 'M50,10 L50,90 M10,50 L90,50',\n                list: 'ss-list',\n                optgroup: 'ss-optgroup',\n                optgroupLabel: 'ss-optgroup-label',\n                optgroupLabelText: 'ss-optgroup-label-text',\n                optgroupActions: 'ss-optgroup-actions',\n                optgroupSelectAll: 'ss-selectall',\n                optgroupSelectAllBox: 'M60,10 L10,10 L10,90 L90,90 L90,50',\n                optgroupSelectAllCheck: 'M30,45 L50,70 L90,10',\n                optgroupClosable: 'ss-closable',\n                option: 'ss-option',\n                optionDelete: 'M10,10 L90,90 M10,90 L90,10',\n                highlighted: 'ss-highlighted',\n                open: 'ss-open',\n                close: 'ss-close',\n                selected: 'ss-selected',\n                error: 'ss-error',\n                disabled: 'ss-disabled',\n                hide: 'ss-hide',\n            };\n            this.store = store;\n            this.settings = settings;\n            this.callbacks = callbacks;\n            this.main = this.mainDiv();\n            this.content = this.contentDiv();\n            this.settings.contentLocation.appendChild(this.content.main);\n        }\n        enable() {\n            this.main.main.classList.remove(this.classes.disabled);\n            this.content.search.input.disabled = false;\n        }\n        disable() {\n            this.main.main.classList.add(this.classes.disabled);\n            this.content.search.input.disabled = true;\n        }\n        open() {\n            this.main.arrow.path.setAttribute('d', this.classes.arrowOpen);\n            this.main.main.classList.add(this.settings.openPosition === 'up' ? this.classes.openAbove : this.classes.openBelow);\n            this.moveContent();\n            this.renderOptions(this.store.getData());\n            this.moveContent();\n            const selectedOptions = this.store.getSelectedOptions();\n            if (selectedOptions.length) {\n                const selectedId = selectedOptions[selectedOptions.length - 1].id;\n                const selectedOption = this.content.list.querySelector('[data-id=\"' + selectedId + '\"]');\n                if (selectedOption) {\n                    this.ensureElementInView(this.content.list, selectedOption);\n                }\n            }\n        }\n        close() {\n            this.main.main.classList.remove(this.classes.openAbove);\n            this.main.main.classList.remove(this.classes.openBelow);\n            this.content.main.classList.remove(this.classes.openAbove);\n            this.content.main.classList.remove(this.classes.openBelow);\n            this.main.arrow.path.setAttribute('d', this.classes.arrowClose);\n        }\n        mainDiv() {\n            const main = document.createElement('div');\n            main.tabIndex = 0;\n            main.style.cssText = this.settings.style !== '' ? this.settings.style : '';\n            main.className = '';\n            main.classList.add(this.settings.id);\n            main.classList.add(this.classes.main);\n            if (this.settings.class) {\n                for (const c of this.settings.class) {\n                    if (c.trim() !== '') {\n                        main.classList.add(c.trim());\n                    }\n                }\n            }\n            main.onfocus = () => {\n                if (this.settings.triggerFocus) {\n                    this.callbacks.open();\n                }\n            };\n            main.onkeydown = (e) => {\n                switch (e.key) {\n                    case 'ArrowUp':\n                    case 'ArrowDown':\n                        this.callbacks.open();\n                        e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n                        return false;\n                    case 'Tab':\n                        this.callbacks.close();\n                        return true;\n                    case 'Enter':\n                        const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n                        if (highlighted) {\n                            highlighted.click();\n                        }\n                        return false;\n                    case 'Escape':\n                        this.callbacks.close();\n                        return false;\n                }\n            };\n            main.onclick = (e) => {\n                if (this.settings.disabled) {\n                    return;\n                }\n                this.settings.isOpen ? this.callbacks.close() : this.callbacks.open();\n            };\n            const values = document.createElement('div');\n            values.classList.add(this.classes.values);\n            main.appendChild(values);\n            const deselect = document.createElement('div');\n            deselect.classList.add(this.classes.deselect);\n            if (!this.settings.allowDeselect || this.settings.isMultiple) {\n                deselect.classList.add(this.classes.hide);\n            }\n            deselect.onclick = (e) => {\n                e.stopPropagation();\n                if (this.settings.disabled) {\n                    return;\n                }\n                let shouldDelete = true;\n                const before = this.store.getSelectedOptions();\n                const after = [];\n                if (this.callbacks.beforeChange) {\n                    shouldDelete = this.callbacks.beforeChange(after, before) === true;\n                }\n                if (shouldDelete) {\n                    this.callbacks.setSelected(['']);\n                    if (this.settings.closeOnSelect) {\n                        this.callbacks.close();\n                    }\n                    if (this.callbacks.afterChange) {\n                        this.callbacks.afterChange(after);\n                    }\n                }\n            };\n            const deselectSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n            deselectSvg.setAttribute('viewBox', '0 0 100 100');\n            const deselectPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n            deselectPath.setAttribute('d', this.classes.deselectPath);\n            deselectSvg.appendChild(deselectPath);\n            deselect.appendChild(deselectSvg);\n            main.appendChild(deselect);\n            const arrow = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n            arrow.classList.add(this.classes.arrow);\n            arrow.setAttribute('viewBox', '0 0 100 100');\n            const arrowPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n            arrowPath.setAttribute('d', this.classes.arrowClose);\n            if (this.settings.alwaysOpen) {\n                arrow.classList.add(this.classes.hide);\n            }\n            arrow.appendChild(arrowPath);\n            main.appendChild(arrow);\n            return {\n                main: main,\n                values: values,\n                deselect: {\n                    main: deselect,\n                    svg: deselectSvg,\n                    path: deselectPath,\n                },\n                arrow: {\n                    main: arrow,\n                    path: arrowPath,\n                },\n            };\n        }\n        mainFocus(trigger) {\n            if (!trigger) {\n                this.settings.triggerFocus = false;\n            }\n            this.main.main.focus({ preventScroll: true });\n            this.settings.triggerFocus = true;\n        }\n        placeholder() {\n            const placeholderOption = this.store.filter((o) => o.placeholder, false);\n            let placeholderText = this.settings.placeholderText;\n            if (placeholderOption.length) {\n                if (placeholderOption[0].html !== '') {\n                    placeholderText = placeholderOption[0].html;\n                }\n                else if (placeholderOption[0].text !== '') {\n                    placeholderText = placeholderOption[0].text;\n                }\n            }\n            const placeholder = document.createElement('div');\n            placeholder.classList.add(this.classes.placeholder);\n            placeholder.innerHTML = placeholderText;\n            return placeholder;\n        }\n        renderValues() {\n            if (!this.settings.isMultiple) {\n                this.renderSingleValue();\n                return;\n            }\n            this.renderMultipleValues();\n        }\n        renderSingleValue() {\n            const selected = this.store.filter((o) => {\n                return o.selected && !o.placeholder;\n            }, false);\n            const selectedSingle = selected.length > 0 ? selected[0] : null;\n            if (!selectedSingle) {\n                this.main.values.innerHTML = this.placeholder().outerHTML;\n            }\n            else {\n                const singleValue = document.createElement('div');\n                singleValue.classList.add(this.classes.single);\n                singleValue.innerHTML = selectedSingle.html ? selectedSingle.html : selectedSingle.text;\n                this.main.values.innerHTML = singleValue.outerHTML;\n            }\n            if (!this.settings.allowDeselect || !selected.length) {\n                this.main.deselect.main.classList.add(this.classes.hide);\n            }\n            else {\n                this.main.deselect.main.classList.remove(this.classes.hide);\n            }\n        }\n        renderMultipleValues() {\n            let currentNodes = this.main.values.childNodes;\n            let selectedOptions = this.store.filter((opt) => {\n                return opt.selected && opt.display;\n            }, false);\n            if (selectedOptions.length === 0) {\n                this.main.values.innerHTML = this.placeholder().outerHTML;\n                return;\n            }\n            else {\n                const placeholder = this.main.values.querySelector('.' + this.classes.placeholder);\n                if (placeholder) {\n                    placeholder.remove();\n                }\n            }\n            if (selectedOptions.length > this.settings.maxValuesShown) {\n                const singleValue = document.createElement('div');\n                singleValue.classList.add(this.classes.max);\n                singleValue.textContent = this.settings.maxValuesMessage.replace('{number}', selectedOptions.length.toString());\n                this.main.values.innerHTML = singleValue.outerHTML;\n                return;\n            }\n            else {\n                const maxValuesMessage = this.main.values.querySelector('.' + this.classes.max);\n                if (maxValuesMessage) {\n                    maxValuesMessage.remove();\n                }\n            }\n            let removeNodes = [];\n            for (let i = 0; i < currentNodes.length; i++) {\n                const node = currentNodes[i];\n                const id = node.getAttribute('data-id');\n                if (id) {\n                    const found = selectedOptions.filter((opt) => {\n                        return opt.id === id;\n                    }, false);\n                    if (!found.length) {\n                        removeNodes.push(node);\n                    }\n                }\n            }\n            for (const n of removeNodes) {\n                n.classList.add(this.classes.valueOut);\n                setTimeout(() => {\n                    this.main.values.removeChild(n);\n                }, 100);\n            }\n            currentNodes = this.main.values.childNodes;\n            for (let d = 0; d < selectedOptions.length; d++) {\n                let shouldAdd = true;\n                for (let i = 0; i < currentNodes.length; i++) {\n                    if (selectedOptions[d].id === String(currentNodes[i].dataset.id)) {\n                        shouldAdd = false;\n                    }\n                }\n                if (shouldAdd) {\n                    if (currentNodes.length === 0) {\n                        this.main.values.appendChild(this.multipleValue(selectedOptions[d]));\n                    }\n                    else if (d === 0) {\n                        this.main.values.insertBefore(this.multipleValue(selectedOptions[d]), currentNodes[d]);\n                    }\n                    else {\n                        currentNodes[d - 1].insertAdjacentElement('afterend', this.multipleValue(selectedOptions[d]));\n                    }\n                }\n            }\n        }\n        multipleValue(option) {\n            const value = document.createElement('div');\n            value.classList.add(this.classes.value);\n            value.dataset.id = option.id;\n            const text = document.createElement('div');\n            text.classList.add(this.classes.valueText);\n            text.innerHTML = option.text;\n            value.appendChild(text);\n            if (!option.mandatory) {\n                const deleteDiv = document.createElement('div');\n                deleteDiv.classList.add(this.classes.valueDelete);\n                deleteDiv.onclick = (e) => {\n                    e.preventDefault();\n                    e.stopPropagation();\n                    if (this.settings.disabled) {\n                        return;\n                    }\n                    let shouldDelete = true;\n                    const before = this.store.getSelectedOptions();\n                    const after = before.filter((o) => {\n                        return o.selected && o.id !== option.id;\n                    }, true);\n                    if (this.settings.minSelected && after.length < this.settings.minSelected) {\n                        return;\n                    }\n                    if (this.callbacks.beforeChange) {\n                        shouldDelete = this.callbacks.beforeChange(after, before) === true;\n                    }\n                    if (shouldDelete) {\n                        let selectedValues = [];\n                        for (const o of after) {\n                            if (o instanceof Optgroup) {\n                                for (const c of o.options) {\n                                    selectedValues.push(c.value);\n                                }\n                            }\n                            if (o instanceof Option) {\n                                selectedValues.push(o.value);\n                            }\n                        }\n                        this.callbacks.setSelected(selectedValues);\n                        if (this.settings.closeOnSelect) {\n                            this.callbacks.close();\n                        }\n                        if (this.callbacks.afterChange) {\n                            this.callbacks.afterChange(after);\n                        }\n                    }\n                };\n                const deleteSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n                deleteSvg.setAttribute('viewBox', '0 0 100 100');\n                const deletePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n                deletePath.setAttribute('d', this.classes.optionDelete);\n                deleteSvg.appendChild(deletePath);\n                deleteDiv.appendChild(deleteSvg);\n                value.appendChild(deleteDiv);\n            }\n            return value;\n        }\n        contentDiv() {\n            const main = document.createElement('div');\n            main.classList.add(this.classes.content);\n            main.dataset.id = this.settings.id;\n            if (this.settings.style !== '') {\n                main.style.cssText = this.settings.style;\n            }\n            if (this.settings.contentPosition === 'relative') {\n                main.classList.add('ss-' + this.settings.contentPosition);\n            }\n            if (this.settings.class.length) {\n                for (const c of this.settings.class) {\n                    if (c.trim() !== '') {\n                        main.classList.add(c.trim());\n                    }\n                }\n            }\n            const search = this.searchDiv();\n            main.appendChild(search.main);\n            const list = this.listDiv();\n            main.appendChild(list);\n            return {\n                main: main,\n                search: search,\n                list: list,\n            };\n        }\n        moveContent() {\n            if (this.settings.contentPosition === 'relative') {\n                this.moveContentBelow();\n                return;\n            }\n            if (this.settings.openPosition === 'down') {\n                this.moveContentBelow();\n                return;\n            }\n            else if (this.settings.openPosition === 'up') {\n                this.moveContentAbove();\n                return;\n            }\n            if (this.putContent() === 'up') {\n                this.moveContentAbove();\n            }\n            else {\n                this.moveContentBelow();\n            }\n        }\n        searchDiv() {\n            const main = document.createElement('div');\n            const input = document.createElement('input');\n            const addable = document.createElement('div');\n            main.classList.add(this.classes.search);\n            const searchReturn = {\n                main,\n                input,\n            };\n            if (!this.settings.showSearch) {\n                main.classList.add(this.classes.hide);\n                input.readOnly = true;\n            }\n            input.type = 'search';\n            input.placeholder = this.settings.searchPlaceholder;\n            input.tabIndex = -1;\n            input.setAttribute('aria-label', this.settings.searchPlaceholder);\n            input.setAttribute('autocapitalize', 'off');\n            input.setAttribute('autocomplete', 'off');\n            input.setAttribute('autocorrect', 'off');\n            input.oninput = debounce((e) => {\n                this.callbacks.search(e.target.value);\n            }, 100);\n            input.onkeydown = (e) => {\n                switch (e.key) {\n                    case 'ArrowUp':\n                    case 'ArrowDown':\n                        this.callbacks.open();\n                        e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n                        return false;\n                    case 'Tab':\n                        this.callbacks.close();\n                        return true;\n                    case 'Escape':\n                        this.callbacks.close();\n                        return false;\n                    case 'Enter':\n                        if (this.callbacks.addable && e.ctrlKey) {\n                            addable.click();\n                        }\n                        else {\n                            const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n                            if (highlighted) {\n                                highlighted.click();\n                            }\n                        }\n                        return false;\n                }\n            };\n            input.onfocus = () => {\n                if (this.settings.isOpen) {\n                    return;\n                }\n                this.callbacks.open();\n            };\n            main.appendChild(input);\n            if (this.callbacks.addable) {\n                addable.classList.add(this.classes.addable);\n                const plus = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n                plus.setAttribute('viewBox', '0 0 100 100');\n                const plusPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n                plusPath.setAttribute('d', this.classes.addablePath);\n                plus.appendChild(plusPath);\n                addable.appendChild(plus);\n                addable.onclick = (e) => {\n                    e.preventDefault();\n                    e.stopPropagation();\n                    if (!this.callbacks.addable) {\n                        return;\n                    }\n                    const inputValue = this.content.search.input.value.trim();\n                    if (inputValue === '') {\n                        this.content.search.input.focus();\n                        return;\n                    }\n                    const runFinish = (oo) => {\n                        let newOption = new Option(oo);\n                        this.callbacks.addOption(newOption);\n                        if (this.settings.isMultiple) {\n                            let values = this.store.getSelected();\n                            values.push(newOption.value);\n                            this.callbacks.setSelected(values);\n                        }\n                        else {\n                            this.callbacks.setSelected([newOption.value]);\n                        }\n                        this.callbacks.search('');\n                        if (this.settings.closeOnSelect) {\n                            setTimeout(() => {\n                                this.callbacks.close();\n                            }, 100);\n                        }\n                    };\n                    const addableValue = this.callbacks.addable(inputValue);\n                    if (addableValue instanceof Promise) {\n                        addableValue.then((value) => {\n                            if (typeof value === 'string') {\n                                runFinish({\n                                    text: value,\n                                    value: value,\n                                });\n                            }\n                            else {\n                                runFinish(value);\n                            }\n                        });\n                    }\n                    else if (typeof addableValue === 'string') {\n                        runFinish({\n                            text: addableValue,\n                            value: addableValue,\n                        });\n                    }\n                    else {\n                        runFinish(addableValue);\n                    }\n                    return;\n                };\n                main.appendChild(addable);\n                searchReturn.addable = {\n                    main: addable,\n                    svg: plus,\n                    path: plusPath,\n                };\n            }\n            return searchReturn;\n        }\n        searchFocus(trigger) {\n            if (!trigger) {\n                this.settings.triggerFocus = false;\n            }\n            this.content.search.input.focus();\n            this.settings.triggerFocus = true;\n        }\n        getOptions(notPlaceholder = false, notDisabled = false, notHidden = false) {\n            let query = '.' + this.classes.option;\n            if (notPlaceholder) {\n                query += ':not(.' + this.classes.placeholder + ')';\n            }\n            if (notDisabled) {\n                query += ':not(.' + this.classes.disabled + ')';\n            }\n            if (notHidden) {\n                query += ':not(.' + this.classes.hide + ')';\n            }\n            return Array.from(this.content.list.querySelectorAll(query));\n        }\n        highlight(dir) {\n            const options = this.getOptions(true, true, true);\n            if (options.length === 0) {\n                return;\n            }\n            if (options.length === 1) {\n                if (!options[0].classList.contains(this.classes.highlighted)) {\n                    options[0].classList.add(this.classes.highlighted);\n                    return;\n                }\n            }\n            for (let i = 0; i < options.length; i++) {\n                if (options[i].classList.contains(this.classes.highlighted)) {\n                    const prevOption = options[i];\n                    prevOption.classList.remove(this.classes.highlighted);\n                    const prevParent = prevOption.parentElement;\n                    if (prevParent && prevParent.classList.contains(this.classes.open)) {\n                        const optgroupLabel = prevParent.querySelector('.' + this.classes.optgroupLabel);\n                        if (optgroupLabel) {\n                            optgroupLabel.click();\n                        }\n                    }\n                    let selectOption = options[dir === 'down' ? (i + 1 < options.length ? i + 1 : 0) : i - 1 >= 0 ? i - 1 : options.length - 1];\n                    selectOption.classList.add(this.classes.highlighted);\n                    this.ensureElementInView(this.content.list, selectOption);\n                    const selectParent = selectOption.parentElement;\n                    if (selectParent && selectParent.classList.contains(this.classes.close)) {\n                        const optgroupLabel = selectParent.querySelector('.' + this.classes.optgroupLabel);\n                        if (optgroupLabel) {\n                            optgroupLabel.click();\n                        }\n                    }\n                    return;\n                }\n            }\n            options[dir === 'down' ? 0 : options.length - 1].classList.add(this.classes.highlighted);\n            this.ensureElementInView(this.content.list, options[dir === 'down' ? 0 : options.length - 1]);\n        }\n        listDiv() {\n            const options = document.createElement('div');\n            options.classList.add(this.classes.list);\n            options.setAttribute('role', 'listbox');\n            return options;\n        }\n        renderError(error) {\n            this.content.list.innerHTML = '';\n            const errorDiv = document.createElement('div');\n            errorDiv.classList.add(this.classes.error);\n            errorDiv.textContent = error;\n            this.content.list.appendChild(errorDiv);\n        }\n        renderSearching() {\n            this.content.list.innerHTML = '';\n            const searchingDiv = document.createElement('div');\n            searchingDiv.classList.add(this.classes.searching);\n            searchingDiv.textContent = this.settings.searchingText;\n            this.content.list.appendChild(searchingDiv);\n        }\n        renderOptions(data) {\n            this.content.list.innerHTML = '';\n            if (data.length === 0) {\n                const noResults = document.createElement('div');\n                noResults.classList.add(this.classes.search);\n                noResults.innerHTML = this.settings.searchText;\n                this.content.list.appendChild(noResults);\n                return;\n            }\n            for (const d of data) {\n                if (d instanceof Optgroup) {\n                    const optgroupEl = document.createElement('div');\n                    optgroupEl.classList.add(this.classes.optgroup);\n                    const optgroupLabel = document.createElement('div');\n                    optgroupLabel.classList.add(this.classes.optgroupLabel);\n                    optgroupEl.appendChild(optgroupLabel);\n                    const optgroupLabelText = document.createElement('div');\n                    optgroupLabelText.classList.add(this.classes.optgroupLabelText);\n                    optgroupLabelText.textContent = d.label;\n                    optgroupLabel.appendChild(optgroupLabelText);\n                    const optgroupActions = document.createElement('div');\n                    optgroupActions.classList.add(this.classes.optgroupActions);\n                    optgroupLabel.appendChild(optgroupActions);\n                    if (this.settings.isMultiple && d.selectAll) {\n                        const selectAll = document.createElement('div');\n                        selectAll.classList.add(this.classes.optgroupSelectAll);\n                        let allSelected = true;\n                        for (const o of d.options) {\n                            if (!o.selected) {\n                                allSelected = false;\n                                break;\n                            }\n                        }\n                        if (allSelected) {\n                            selectAll.classList.add(this.classes.selected);\n                        }\n                        const selectAllText = document.createElement('span');\n                        selectAllText.textContent = 'Select All';\n                        selectAll.appendChild(selectAllText);\n                        const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n                        selectAllSvg.setAttribute('viewBox', '0 0 100 100');\n                        selectAll.appendChild(selectAllSvg);\n                        const selectAllBox = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n                        selectAllBox.setAttribute('d', this.classes.optgroupSelectAllBox);\n                        selectAllSvg.appendChild(selectAllBox);\n                        const selectAllCheck = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n                        selectAllCheck.setAttribute('d', this.classes.optgroupSelectAllCheck);\n                        selectAllSvg.appendChild(selectAllCheck);\n                        selectAll.addEventListener('click', (e) => {\n                            e.preventDefault();\n                            e.stopPropagation();\n                            const currentSelected = this.store.getSelected();\n                            if (allSelected) {\n                                const newSelected = currentSelected.filter((s) => {\n                                    for (const o of d.options) {\n                                        if (s === o.value) {\n                                            return false;\n                                        }\n                                    }\n                                    return true;\n                                });\n                                this.callbacks.setSelected(newSelected);\n                                return;\n                            }\n                            else {\n                                const newSelected = currentSelected.concat(d.options.map((o) => o.value));\n                                this.callbacks.setSelected(newSelected);\n                            }\n                        });\n                        optgroupActions.appendChild(selectAll);\n                    }\n                    if (d.closable !== 'off') {\n                        const optgroupClosable = document.createElement('div');\n                        optgroupClosable.classList.add(this.classes.optgroupClosable);\n                        const optgroupClosableSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n                        optgroupClosableSvg.setAttribute('viewBox', '0 0 100 100');\n                        optgroupClosableSvg.classList.add(this.classes.arrow);\n                        optgroupClosable.appendChild(optgroupClosableSvg);\n                        const optgroupClosableArrow = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n                        optgroupClosableSvg.appendChild(optgroupClosableArrow);\n                        if (d.options.some((o) => o.selected) || this.content.search.input.value.trim() !== '') {\n                            optgroupClosable.classList.add(this.classes.open);\n                            optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n                        }\n                        else if (d.closable === 'open') {\n                            optgroupEl.classList.add(this.classes.open);\n                            optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n                        }\n                        else if (d.closable === 'close') {\n                            optgroupEl.classList.add(this.classes.close);\n                            optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n                        }\n                        optgroupLabel.addEventListener('click', (e) => {\n                            e.preventDefault();\n                            e.stopPropagation();\n                            if (optgroupEl.classList.contains(this.classes.close)) {\n                                optgroupEl.classList.remove(this.classes.close);\n                                optgroupEl.classList.add(this.classes.open);\n                                optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n                            }\n                            else {\n                                optgroupEl.classList.remove(this.classes.open);\n                                optgroupEl.classList.add(this.classes.close);\n                                optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n                            }\n                        });\n                        optgroupActions.appendChild(optgroupClosable);\n                    }\n                    optgroupEl.appendChild(optgroupLabel);\n                    for (const o of d.options) {\n                        optgroupEl.appendChild(this.option(o));\n                    }\n                    this.content.list.appendChild(optgroupEl);\n                }\n                if (d instanceof Option) {\n                    this.content.list.appendChild(this.option(d));\n                }\n            }\n        }\n        option(option) {\n            if (option.placeholder) {\n                const placeholder = document.createElement('div');\n                placeholder.classList.add(this.classes.option);\n                placeholder.classList.add(this.classes.hide);\n                return placeholder;\n            }\n            const optionEl = document.createElement('div');\n            optionEl.dataset.id = option.id;\n            optionEl.classList.add(this.classes.option);\n            optionEl.setAttribute('role', 'option');\n            if (option.class) {\n                option.class.split(' ').forEach((dataClass) => {\n                    optionEl.classList.add(dataClass);\n                });\n            }\n            if (option.style) {\n                optionEl.style.cssText = option.style;\n            }\n            if (this.settings.searchHighlight && this.content.search.input.value.trim() !== '') {\n                optionEl.innerHTML = this.highlightText(option.html !== '' ? option.html : option.text, this.content.search.input.value, this.classes.searchHighlighter);\n            }\n            else if (option.html !== '') {\n                optionEl.innerHTML = option.html;\n            }\n            else {\n                optionEl.textContent = option.text;\n            }\n            if (this.settings.showOptionTooltips && optionEl.textContent) {\n                optionEl.setAttribute('title', optionEl.textContent);\n            }\n            if (option.disabled) {\n                optionEl.classList.add(this.classes.disabled);\n            }\n            if (option.selected && this.settings.hideSelected) {\n                optionEl.classList.add(this.classes.hide);\n            }\n            if (option.selected) {\n                optionEl.classList.add(this.classes.selected);\n            }\n            else {\n                optionEl.classList.remove(this.classes.selected);\n            }\n            optionEl.addEventListener('click', (e) => {\n                e.preventDefault();\n                e.stopPropagation();\n                const selectedOptions = this.store.getSelected();\n                const element = e.currentTarget;\n                const elementID = String(element.dataset.id);\n                if (option.disabled || (option.selected && !this.settings.allowDeselect)) {\n                    return;\n                }\n                if ((this.settings.isMultiple && this.settings.maxSelected <= selectedOptions.length && !option.selected) ||\n                    (this.settings.isMultiple && this.settings.minSelected >= selectedOptions.length && option.selected)) {\n                    return;\n                }\n                let shouldUpdate = false;\n                const before = this.store.getSelectedOptions();\n                let after = [];\n                if (this.settings.isMultiple) {\n                    if (option.selected) {\n                        after = before.filter((o) => o.id !== elementID);\n                    }\n                    else {\n                        after = before.concat(option);\n                    }\n                }\n                if (!this.settings.isMultiple) {\n                    if (option.selected) {\n                        after = [];\n                    }\n                    else {\n                        after = [option];\n                    }\n                }\n                if (!this.callbacks.beforeChange) {\n                    shouldUpdate = true;\n                }\n                if (this.callbacks.beforeChange) {\n                    if (this.callbacks.beforeChange(after, before) === false) {\n                        shouldUpdate = false;\n                    }\n                    else {\n                        shouldUpdate = true;\n                    }\n                }\n                if (shouldUpdate) {\n                    if (!this.store.getOptionByID(elementID)) {\n                        this.callbacks.addOption(option);\n                    }\n                    this.callbacks.setSelected(after.map((o) => o.value));\n                    if (this.settings.closeOnSelect) {\n                        this.callbacks.close();\n                    }\n                    if (this.callbacks.afterChange) {\n                        this.callbacks.afterChange(after);\n                    }\n                }\n            });\n            return optionEl;\n        }\n        destroy() {\n            this.main.main.remove();\n            this.content.main.remove();\n        }\n        highlightText(str, search, className) {\n            let completedString = str;\n            const regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*</)', 'i');\n            if (!str.match(regex)) {\n                return str;\n            }\n            const matchStartPosition = str.match(regex).index;\n            const matchEndPosition = matchStartPosition + str.match(regex)[0].toString().length;\n            const originalTextFoundByRegex = str.substring(matchStartPosition, matchEndPosition);\n            completedString = completedString.replace(regex, `<mark class=\"${className}\">${originalTextFoundByRegex}</mark>`);\n            return completedString;\n        }\n        moveContentAbove() {\n            const mainHeight = this.main.main.offsetHeight;\n            const contentHeight = this.content.main.offsetHeight;\n            this.main.main.classList.remove(this.classes.openBelow);\n            this.main.main.classList.add(this.classes.openAbove);\n            this.content.main.classList.remove(this.classes.openBelow);\n            this.content.main.classList.add(this.classes.openAbove);\n            const containerRect = this.main.main.getBoundingClientRect();\n            this.content.main.style.margin = '-' + (mainHeight + contentHeight - 1) + 'px 0px 0px 0px';\n            this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n            this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n            this.content.main.style.width = containerRect.width + 'px';\n        }\n        moveContentBelow() {\n            this.main.main.classList.remove(this.classes.openAbove);\n            this.main.main.classList.add(this.classes.openBelow);\n            this.content.main.classList.remove(this.classes.openAbove);\n            this.content.main.classList.add(this.classes.openBelow);\n            const containerRect = this.main.main.getBoundingClientRect();\n            this.content.main.style.margin = '-1px 0px 0px 0px';\n            if (this.settings.contentPosition !== 'relative') {\n                this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n                this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n                this.content.main.style.width = containerRect.width + 'px';\n            }\n        }\n        ensureElementInView(container, element) {\n            const cTop = container.scrollTop + container.offsetTop;\n            const cBottom = cTop + container.clientHeight;\n            const eTop = element.offsetTop;\n            const eBottom = eTop + element.clientHeight;\n            if (eTop < cTop) {\n                container.scrollTop -= cTop - eTop;\n            }\n            else if (eBottom > cBottom) {\n                container.scrollTop += eBottom - cBottom;\n            }\n        }\n        putContent() {\n            const mainHeight = this.main.main.offsetHeight;\n            const mainRect = this.main.main.getBoundingClientRect();\n            const contentHeight = this.content.main.offsetHeight;\n            const spaceBelow = window.innerHeight - (mainRect.top + mainHeight);\n            if (spaceBelow <= contentHeight) {\n                if (mainRect.top > contentHeight) {\n                    return 'up';\n                }\n                else {\n                    return 'down';\n                }\n            }\n            return 'down';\n        }\n    }\n\n    class Select {\n        constructor(select) {\n            this.listen = false;\n            this.observer = null;\n            this.select = select;\n            this.select.addEventListener('change', this.valueChange.bind(this), {\n                passive: true,\n            });\n            this.observer = new MutationObserver(this.observeCall.bind(this));\n            this.changeListen(true);\n        }\n        enable() {\n            this.select.disabled = false;\n        }\n        disable() {\n            this.select.disabled = true;\n        }\n        hideUI() {\n            this.select.tabIndex = -1;\n            this.select.style.display = 'none';\n            this.select.setAttribute('aria-hidden', 'true');\n        }\n        showUI() {\n            this.select.removeAttribute('tabindex');\n            this.select.style.display = '';\n            this.select.removeAttribute('aria-hidden');\n        }\n        changeListen(listen) {\n            this.listen = listen;\n            if (listen) {\n                if (this.observer) {\n                    this.observer.observe(this.select, {\n                        subtree: true,\n                        childList: true,\n                        attributes: true,\n                    });\n                }\n            }\n            if (!listen) {\n                if (this.observer) {\n                    this.observer.disconnect();\n                }\n            }\n        }\n        valueChange(ev) {\n            if (this.listen && this.onValueChange) {\n                this.onValueChange(this.getSelectedValues());\n            }\n            return true;\n        }\n        observeCall(mutations) {\n            if (!this.listen) {\n                return;\n            }\n            let disabledChanged = false;\n            let optgroupOptionChanged = false;\n            for (const m of mutations) {\n                if (m.target === this.select) {\n                    if (m.attributeName === 'disabled') {\n                        disabledChanged = true;\n                    }\n                }\n                if (m.target.nodeName === 'OPTGROUP' || m.target.nodeName === 'OPTION') {\n                    optgroupOptionChanged = true;\n                }\n            }\n            if (disabledChanged && this.onDisabledChange) {\n                this.changeListen(false);\n                this.onDisabledChange(this.select.disabled);\n                this.changeListen(true);\n            }\n            if (optgroupOptionChanged && this.onOptionsChange) {\n                this.changeListen(false);\n                this.onOptionsChange(this.getData());\n                this.changeListen(true);\n            }\n        }\n        getData() {\n            let data = [];\n            const nodes = this.select.childNodes;\n            for (const n of nodes) {\n                if (n.nodeName === 'OPTGROUP') {\n                    data.push(this.getDataFromOptgroup(n));\n                }\n                if (n.nodeName === 'OPTION') {\n                    data.push(this.getDataFromOption(n));\n                }\n            }\n            return data;\n        }\n        getDataFromOptgroup(optgroup) {\n            let data = {\n                id: optgroup.id,\n                label: optgroup.label,\n                selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,\n                closable: optgroup.dataset ? optgroup.dataset.closable : 'off',\n                options: [],\n            };\n            const options = optgroup.childNodes;\n            for (const o of options) {\n                if (o.nodeName === 'OPTION') {\n                    data.options.push(this.getDataFromOption(o));\n                }\n            }\n            return data;\n        }\n        getDataFromOption(option) {\n            return {\n                id: option.id,\n                value: option.value,\n                text: option.text,\n                html: option.dataset && option.dataset.html ? option.dataset.html : '',\n                selected: option.selected,\n                display: option.style.display === 'none' ? false : true,\n                disabled: option.disabled,\n                mandatory: option.dataset ? option.dataset.mandatory === 'true' : false,\n                placeholder: option.dataset.placeholder === 'true',\n                class: option.className,\n                style: option.style.cssText,\n                data: option.dataset,\n            };\n        }\n        getSelectedValues() {\n            let values = [];\n            const options = this.select.childNodes;\n            for (const o of options) {\n                if (o.nodeName === 'OPTGROUP') {\n                    const optgroupOptions = o.childNodes;\n                    for (const oo of optgroupOptions) {\n                        if (oo.nodeName === 'OPTION') {\n                            const option = oo;\n                            if (option.selected) {\n                                values.push(option.value);\n                            }\n                        }\n                    }\n                }\n                if (o.nodeName === 'OPTION') {\n                    const option = o;\n                    if (option.selected) {\n                        values.push(option.value);\n                    }\n                }\n            }\n            return values;\n        }\n        setSelected(value) {\n            this.changeListen(false);\n            const options = this.select.childNodes;\n            for (const o of options) {\n                if (o.nodeName === 'OPTGROUP') {\n                    const optgroup = o;\n                    const optgroupOptions = optgroup.childNodes;\n                    for (const oo of optgroupOptions) {\n                        if (oo.nodeName === 'OPTION') {\n                            const option = oo;\n                            option.selected = value.includes(option.value);\n                        }\n                    }\n                }\n                if (o.nodeName === 'OPTION') {\n                    const option = o;\n                    option.selected = value.includes(option.value);\n                }\n            }\n            this.changeListen(true);\n        }\n        updateSelect(id, style, classes) {\n            this.changeListen(false);\n            if (id) {\n                this.select.id = id;\n            }\n            if (style) {\n                this.select.style.cssText = style;\n            }\n            if (classes) {\n                this.select.className = '';\n                classes.forEach((c) => {\n                    if (c.trim() !== '') {\n                        this.select.classList.add(c.trim());\n                    }\n                });\n            }\n            this.changeListen(true);\n        }\n        updateOptions(data) {\n            this.changeListen(false);\n            this.select.innerHTML = '';\n            for (const d of data) {\n                if (d instanceof Optgroup) {\n                    this.select.appendChild(this.createOptgroup(d));\n                }\n                if (d instanceof Option) {\n                    this.select.appendChild(this.createOption(d));\n                }\n            }\n            this.select.dispatchEvent(new Event('change'));\n            this.changeListen(true);\n        }\n        createOptgroup(optgroup) {\n            const optgroupEl = document.createElement('optgroup');\n            optgroupEl.id = optgroup.id;\n            optgroupEl.label = optgroup.label;\n            if (optgroup.selectAll) {\n                optgroupEl.dataset.selectAll = 'true';\n            }\n            if (optgroup.closable !== 'off') {\n                optgroupEl.dataset.closable = optgroup.closable;\n            }\n            if (optgroup.options) {\n                for (const o of optgroup.options) {\n                    optgroupEl.appendChild(this.createOption(o));\n                }\n            }\n            return optgroupEl;\n        }\n        createOption(info) {\n            const optionEl = document.createElement('option');\n            optionEl.id = info.id;\n            optionEl.value = info.value;\n            optionEl.innerHTML = info.text;\n            if (info.html !== '') {\n                optionEl.setAttribute('data-html', info.html);\n            }\n            if (info.selected) {\n                optionEl.selected = info.selected;\n            }\n            if (info.disabled) {\n                optionEl.disabled = true;\n            }\n            if (info.display === false) {\n                optionEl.style.display = 'none';\n            }\n            if (info.placeholder) {\n                optionEl.setAttribute('data-placeholder', 'true');\n            }\n            if (info.mandatory) {\n                optionEl.setAttribute('data-mandatory', 'true');\n            }\n            if (info.class) {\n                info.class.split(' ').forEach((optionClass) => {\n                    optionEl.classList.add(optionClass);\n                });\n            }\n            if (info.data && typeof info.data === 'object') {\n                Object.keys(info.data).forEach((key) => {\n                    optionEl.setAttribute('data-' + kebabCase(key), info.data[key]);\n                });\n            }\n            return optionEl;\n        }\n        destroy() {\n            this.changeListen(false);\n            this.select.removeEventListener('change', this.valueChange.bind(this));\n            if (this.observer) {\n                this.observer.disconnect();\n                this.observer = null;\n            }\n            this.showUI();\n        }\n    }\n\n    class SlimSelect {\n        constructor(config) {\n            var _a;\n            this.events = {\n                search: undefined,\n                searchFilter: (opt, search) => {\n                    return opt.text.toLowerCase().indexOf(search.toLowerCase()) !== -1;\n                },\n                addable: undefined,\n                beforeChange: undefined,\n                afterChange: undefined,\n                beforeOpen: undefined,\n                afterOpen: undefined,\n                beforeClose: undefined,\n                afterClose: undefined,\n            };\n            this.windowResize = debounce(() => {\n                if (!this.settings.isOpen) {\n                    return;\n                }\n                this.render.moveContent();\n            });\n            this.windowScroll = debounce(() => {\n                if (!this.settings.isOpen) {\n                    return;\n                }\n                this.render.moveContent();\n            });\n            this.documentClick = (e) => {\n                if (!this.settings.isOpen) {\n                    return;\n                }\n                if (e.target && !hasClassInTree(e.target, this.settings.id)) {\n                    this.close();\n                }\n            };\n            this.selectEl = (typeof config.select === 'string' ? document.querySelector(config.select) : config.select);\n            if (!this.selectEl) {\n                if (config.events && config.events.error) {\n                    config.events.error(new Error('Could not find select element'));\n                }\n                return;\n            }\n            if (this.selectEl.tagName !== 'SELECT') {\n                if (config.events && config.events.error) {\n                    config.events.error(new Error('Element isnt of type select'));\n                }\n                return;\n            }\n            if (this.selectEl.dataset.ssid) {\n                this.destroy();\n            }\n            this.settings = new Settings(config.settings);\n            for (const key in config.events) {\n                if (config.events.hasOwnProperty(key)) {\n                    this.events[key] = config.events[key];\n                }\n            }\n            this.settings.disabled = ((_a = config.settings) === null || _a === void 0 ? void 0 : _a.disabled) ? config.settings.disabled : this.selectEl.disabled;\n            this.settings.isMultiple = this.selectEl.multiple;\n            this.settings.style = this.selectEl.style.cssText;\n            this.settings.class = this.selectEl.className.split(' ');\n            this.select = new Select(this.selectEl);\n            this.select.updateSelect(this.settings.id, this.settings.style, this.settings.class);\n            this.select.hideUI();\n            this.select.onValueChange = (values) => {\n                this.setSelected(values);\n            };\n            this.select.onDisabledChange = (disabled) => {\n                if (disabled) {\n                    this.disable();\n                }\n                else {\n                    this.enable();\n                }\n            };\n            this.select.onOptionsChange = (data) => {\n                this.setData(data);\n            };\n            this.store = new Store(this.settings.isMultiple ? 'multiple' : 'single', config.data ? config.data : this.select.getData());\n            if (config.data) {\n                this.select.updateOptions(this.store.getData());\n            }\n            const callbacks = {\n                open: this.open.bind(this),\n                close: this.close.bind(this),\n                addable: this.events.addable ? this.events.addable : undefined,\n                setSelected: this.setSelected.bind(this),\n                addOption: this.addOption.bind(this),\n                search: this.search.bind(this),\n                beforeChange: this.events.beforeChange,\n                afterChange: this.events.afterChange,\n            };\n            this.render = new Render(this.settings, this.store, callbacks);\n            this.render.renderValues();\n            this.render.renderOptions(this.store.getData());\n            if (this.selectEl.parentNode) {\n                this.selectEl.parentNode.insertBefore(this.render.main.main, this.selectEl.nextSibling);\n            }\n            document.addEventListener('click', this.documentClick);\n            window.addEventListener('resize', this.windowResize, false);\n            if (this.settings.openPosition === 'auto') {\n                window.addEventListener('scroll', this.windowScroll, false);\n            }\n            if (this.settings.disabled) {\n                this.disable();\n            }\n            if (this.settings.alwaysOpen) {\n                this.open();\n            }\n            this.selectEl.slim = this;\n        }\n        enable() {\n            this.settings.disabled = false;\n            this.select.enable();\n            this.render.enable();\n        }\n        disable() {\n            this.settings.disabled = true;\n            this.select.disable();\n            this.render.disable();\n        }\n        getData() {\n            return this.store.getData();\n        }\n        setData(data) {\n            const selected = this.store.getSelected();\n            const err = this.store.validateDataArray(data);\n            if (err) {\n                if (this.events.error) {\n                    this.events.error(err);\n                }\n                return;\n            }\n            this.store.setData(data);\n            const dataClean = this.store.getData();\n            this.select.updateOptions(dataClean);\n            this.render.renderValues();\n            this.render.renderOptions(dataClean);\n            if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n                this.events.afterChange(this.store.getSelectedOptions());\n            }\n        }\n        getSelected() {\n            return this.store.getSelected();\n        }\n        setSelected(value) {\n            const selected = this.store.getSelected();\n            this.store.setSelectedBy('value', Array.isArray(value) ? value : [value]);\n            const data = this.store.getData();\n            this.select.updateOptions(data);\n            this.render.renderValues();\n            if (this.render.content.search.input.value !== '') {\n                this.search(this.render.content.search.input.value);\n            }\n            else {\n                this.render.renderOptions(data);\n            }\n            if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n                this.events.afterChange(this.store.getSelectedOptions());\n            }\n        }\n        addOption(option) {\n            const selected = this.store.getSelected();\n            this.store.addOption(option);\n            const data = this.store.getData();\n            this.select.updateOptions(data);\n            this.render.renderValues();\n            this.render.renderOptions(data);\n            if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n                this.events.afterChange(this.store.getSelectedOptions());\n            }\n        }\n        open() {\n            if (this.settings.disabled || this.settings.isOpen) {\n                return;\n            }\n            if (this.events.beforeOpen) {\n                this.events.beforeOpen();\n            }\n            this.render.open();\n            if (this.settings.showSearch) {\n                this.render.searchFocus(false);\n            }\n            setTimeout(() => {\n                if (this.events.afterOpen) {\n                    this.events.afterOpen();\n                }\n                this.settings.isOpen = true;\n            }, this.settings.timeoutDelay);\n            if (this.settings.contentPosition === 'absolute') {\n                if (this.settings.intervalMove) {\n                    clearInterval(this.settings.intervalMove);\n                }\n                this.settings.intervalMove = setInterval(this.render.moveContent.bind(this.render), 500);\n            }\n        }\n        close() {\n            if (!this.settings.isOpen || this.settings.alwaysOpen) {\n                return;\n            }\n            if (this.events.beforeClose) {\n                this.events.beforeClose();\n            }\n            this.render.close();\n            this.search('');\n            this.render.mainFocus(false);\n            setTimeout(() => {\n                if (this.events.afterClose) {\n                    this.events.afterClose();\n                }\n                this.settings.isOpen = false;\n            }, this.settings.timeoutDelay);\n            if (this.settings.intervalMove) {\n                clearInterval(this.settings.intervalMove);\n            }\n        }\n        search(value) {\n            if (this.render.content.search.input.value !== value) {\n                this.render.content.search.input.value = value;\n            }\n            if (!this.events.search) {\n                this.render.renderOptions(value === '' ? this.store.getData() : this.store.search(value, this.events.searchFilter));\n                return;\n            }\n            this.render.renderSearching();\n            const searchResp = this.events.search(value, this.store.getSelectedOptions());\n            if (searchResp instanceof Promise) {\n                searchResp\n                    .then((data) => {\n                    this.render.renderOptions(this.store.partialToFullData(data));\n                })\n                    .catch((err) => {\n                    this.render.renderError(typeof err === 'string' ? err : err.message);\n                });\n                return;\n            }\n            else if (Array.isArray(searchResp)) {\n                this.render.renderOptions(this.store.partialToFullData(searchResp));\n            }\n            else {\n                this.render.renderError('Search event must return a promise or an array of data');\n            }\n        }\n        destroy() {\n            document.removeEventListener('click', this.documentClick);\n            window.removeEventListener('resize', this.windowResize, false);\n            if (this.settings.openPosition === 'auto') {\n                window.removeEventListener('scroll', this.windowScroll, false);\n            }\n            this.store.setData([]);\n            this.render.destroy();\n            this.select.destroy();\n        }\n    }\n\n    return SlimSelect;\n\n}));\n", "/*!\n * Cropper.js v1.6.1\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2023-09-17T03:44:19.860Z\n */\n\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory());\n})(this, (function () { 'use strict';\n\n  function 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  }\n  function _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  }\n  function _typeof(o) {\n    \"@babel/helpers - typeof\";\n\n    return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n      return typeof o;\n    } : function (o) {\n      return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n    }, _typeof(o);\n  }\n  function _classCallCheck(instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError(\"Cannot call a class as a function\");\n    }\n  }\n  function _defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n    }\n  }\n  function _createClass(Constructor, protoProps, staticProps) {\n    if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) _defineProperties(Constructor, staticProps);\n    Object.defineProperty(Constructor, \"prototype\", {\n      writable: false\n    });\n    return Constructor;\n  }\n  function _defineProperty(obj, key, value) {\n    key = _toPropertyKey(key);\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n    return obj;\n  }\n  function _toConsumableArray(arr) {\n    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n  }\n  function _arrayWithoutHoles(arr) {\n    if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n  }\n  function _iterableToArray(iter) {\n    if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n  }\n  function _unsupportedIterableToArray(o, minLen) {\n    if (!o) return;\n    if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n    var n = Object.prototype.toString.call(o).slice(8, -1);\n    if (n === \"Object\" && o.constructor) n = o.constructor.name;\n    if (n === \"Map\" || n === \"Set\") return Array.from(o);\n    if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n  }\n  function _arrayLikeToArray(arr, len) {\n    if (len == null || len > arr.length) len = arr.length;\n    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n    return arr2;\n  }\n  function _nonIterableSpread() {\n    throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n  function _toPrimitive(input, hint) {\n    if (typeof input !== \"object\" || input === null) return input;\n    var prim = input[Symbol.toPrimitive];\n    if (prim !== undefined) {\n      var res = prim.call(input, hint || \"default\");\n      if (typeof res !== \"object\") return res;\n      throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n    }\n    return (hint === \"string\" ? String : Number)(input);\n  }\n  function _toPropertyKey(arg) {\n    var key = _toPrimitive(arg, \"string\");\n    return typeof key === \"symbol\" ? key : String(key);\n  }\n\n  var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n  var WINDOW = IS_BROWSER ? window : {};\n  var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;\n  var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;\n  var NAMESPACE = 'cropper';\n\n  // Actions\n  var ACTION_ALL = 'all';\n  var ACTION_CROP = 'crop';\n  var ACTION_MOVE = 'move';\n  var ACTION_ZOOM = 'zoom';\n  var ACTION_EAST = 'e';\n  var ACTION_WEST = 'w';\n  var ACTION_SOUTH = 's';\n  var ACTION_NORTH = 'n';\n  var ACTION_NORTH_EAST = 'ne';\n  var ACTION_NORTH_WEST = 'nw';\n  var ACTION_SOUTH_EAST = 'se';\n  var ACTION_SOUTH_WEST = 'sw';\n\n  // Classes\n  var CLASS_CROP = \"\".concat(NAMESPACE, \"-crop\");\n  var CLASS_DISABLED = \"\".concat(NAMESPACE, \"-disabled\");\n  var CLASS_HIDDEN = \"\".concat(NAMESPACE, \"-hidden\");\n  var CLASS_HIDE = \"\".concat(NAMESPACE, \"-hide\");\n  var CLASS_INVISIBLE = \"\".concat(NAMESPACE, \"-invisible\");\n  var CLASS_MODAL = \"\".concat(NAMESPACE, \"-modal\");\n  var CLASS_MOVE = \"\".concat(NAMESPACE, \"-move\");\n\n  // Data keys\n  var DATA_ACTION = \"\".concat(NAMESPACE, \"Action\");\n  var DATA_PREVIEW = \"\".concat(NAMESPACE, \"Preview\");\n\n  // Drag modes\n  var DRAG_MODE_CROP = 'crop';\n  var DRAG_MODE_MOVE = 'move';\n  var DRAG_MODE_NONE = 'none';\n\n  // Events\n  var EVENT_CROP = 'crop';\n  var EVENT_CROP_END = 'cropend';\n  var EVENT_CROP_MOVE = 'cropmove';\n  var EVENT_CROP_START = 'cropstart';\n  var EVENT_DBLCLICK = 'dblclick';\n  var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';\n  var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';\n  var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';\n  var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;\n  var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;\n  var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;\n  var EVENT_READY = 'ready';\n  var EVENT_RESIZE = 'resize';\n  var EVENT_WHEEL = 'wheel';\n  var EVENT_ZOOM = 'zoom';\n\n  // Mime types\n  var MIME_TYPE_JPEG = 'image/jpeg';\n\n  // RegExps\n  var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;\n  var REGEXP_DATA_URL = /^data:/;\n  var REGEXP_DATA_URL_JPEG = /^data:image\\/jpeg;base64,/;\n  var REGEXP_TAG_NAME = /^img|canvas$/i;\n\n  // Misc\n  // Inspired by the default width and height of a canvas element.\n  var MIN_CONTAINER_WIDTH = 200;\n  var MIN_CONTAINER_HEIGHT = 100;\n\n  var DEFAULTS = {\n    // Define the view mode of the cropper\n    viewMode: 0,\n    // 0, 1, 2, 3\n\n    // Define the dragging mode of the cropper\n    dragMode: DRAG_MODE_CROP,\n    // 'crop', 'move' or 'none'\n\n    // Define the initial aspect ratio of the crop box\n    initialAspectRatio: NaN,\n    // Define the aspect ratio of the crop box\n    aspectRatio: NaN,\n    // An object with the previous cropping result data\n    data: null,\n    // A selector for adding extra containers to preview\n    preview: '',\n    // Re-render the cropper when resize the window\n    responsive: true,\n    // Restore the cropped area after resize the window\n    restore: true,\n    // Check if the current image is a cross-origin image\n    checkCrossOrigin: true,\n    // Check the current image's Exif Orientation information\n    checkOrientation: true,\n    // Show the black modal\n    modal: true,\n    // Show the dashed lines for guiding\n    guides: true,\n    // Show the center indicator for guiding\n    center: true,\n    // Show the white modal to highlight the crop box\n    highlight: true,\n    // Show the grid background\n    background: true,\n    // Enable to crop the image automatically when initialize\n    autoCrop: true,\n    // Define the percentage of automatic cropping area when initializes\n    autoCropArea: 0.8,\n    // Enable to move the image\n    movable: true,\n    // Enable to rotate the image\n    rotatable: true,\n    // Enable to scale the image\n    scalable: true,\n    // Enable to zoom the image\n    zoomable: true,\n    // Enable to zoom the image by dragging touch\n    zoomOnTouch: true,\n    // Enable to zoom the image by wheeling mouse\n    zoomOnWheel: true,\n    // Define zoom ratio when zoom the image by wheeling mouse\n    wheelZoomRatio: 0.1,\n    // Enable to move the crop box\n    cropBoxMovable: true,\n    // Enable to resize the crop box\n    cropBoxResizable: true,\n    // Toggle drag mode between \"crop\" and \"move\" when click twice on the cropper\n    toggleDragModeOnDblclick: true,\n    // Size limitation\n    minCanvasWidth: 0,\n    minCanvasHeight: 0,\n    minCropBoxWidth: 0,\n    minCropBoxHeight: 0,\n    minContainerWidth: MIN_CONTAINER_WIDTH,\n    minContainerHeight: MIN_CONTAINER_HEIGHT,\n    // Shortcuts of events\n    ready: null,\n    cropstart: null,\n    cropmove: null,\n    cropend: null,\n    crop: null,\n    zoom: null\n  };\n\n  var TEMPLATE = '<div class=\"cropper-container\" touch-action=\"none\">' + '<div class=\"cropper-wrap-box\">' + '<div class=\"cropper-canvas\"></div>' + '</div>' + '<div class=\"cropper-drag-box\"></div>' + '<div class=\"cropper-crop-box\">' + '<span class=\"cropper-view-box\"></span>' + '<span class=\"cropper-dashed dashed-h\"></span>' + '<span class=\"cropper-dashed dashed-v\"></span>' + '<span class=\"cropper-center\"></span>' + '<span class=\"cropper-face\"></span>' + '<span class=\"cropper-line line-e\" data-cropper-action=\"e\"></span>' + '<span class=\"cropper-line line-n\" data-cropper-action=\"n\"></span>' + '<span class=\"cropper-line line-w\" data-cropper-action=\"w\"></span>' + '<span class=\"cropper-line line-s\" data-cropper-action=\"s\"></span>' + '<span class=\"cropper-point point-e\" data-cropper-action=\"e\"></span>' + '<span class=\"cropper-point point-n\" data-cropper-action=\"n\"></span>' + '<span class=\"cropper-point point-w\" data-cropper-action=\"w\"></span>' + '<span class=\"cropper-point point-s\" data-cropper-action=\"s\"></span>' + '<span class=\"cropper-point point-ne\" data-cropper-action=\"ne\"></span>' + '<span class=\"cropper-point point-nw\" data-cropper-action=\"nw\"></span>' + '<span class=\"cropper-point point-sw\" data-cropper-action=\"sw\"></span>' + '<span class=\"cropper-point point-se\" data-cropper-action=\"se\"></span>' + '</div>' + '</div>';\n\n  /**\n   * Check if the given value is not a number.\n   */\n  var isNaN = Number.isNaN || WINDOW.isNaN;\n\n  /**\n   * Check if the given value is a number.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is a number, else `false`.\n   */\n  function isNumber(value) {\n    return typeof value === 'number' && !isNaN(value);\n  }\n\n  /**\n   * Check if the given value is a positive number.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.\n   */\n  var isPositiveNumber = function isPositiveNumber(value) {\n    return value > 0 && value < Infinity;\n  };\n\n  /**\n   * Check if the given value is undefined.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is undefined, else `false`.\n   */\n  function isUndefined(value) {\n    return typeof value === 'undefined';\n  }\n\n  /**\n   * Check if the given value is an object.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is an object, else `false`.\n   */\n  function isObject(value) {\n    return _typeof(value) === 'object' && value !== null;\n  }\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n  /**\n   * Check if the given value is a plain object.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.\n   */\n  function isPlainObject(value) {\n    if (!isObject(value)) {\n      return false;\n    }\n    try {\n      var _constructor = value.constructor;\n      var prototype = _constructor.prototype;\n      return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');\n    } catch (error) {\n      return false;\n    }\n  }\n\n  /**\n   * Check if the given value is a function.\n   * @param {*} value - The value to check.\n   * @returns {boolean} Returns `true` if the given value is a function, else `false`.\n   */\n  function isFunction(value) {\n    return typeof value === 'function';\n  }\n  var slice = Array.prototype.slice;\n\n  /**\n   * Convert array-like or iterable object to an array.\n   * @param {*} value - The value to convert.\n   * @returns {Array} Returns a new array.\n   */\n  function toArray(value) {\n    return Array.from ? Array.from(value) : slice.call(value);\n  }\n\n  /**\n   * Iterate the given data.\n   * @param {*} data - The data to iterate.\n   * @param {Function} callback - The process function for each element.\n   * @returns {*} The original data.\n   */\n  function forEach(data, callback) {\n    if (data && isFunction(callback)) {\n      if (Array.isArray(data) || isNumber(data.length) /* array-like */) {\n        toArray(data).forEach(function (value, key) {\n          callback.call(data, value, key, data);\n        });\n      } else if (isObject(data)) {\n        Object.keys(data).forEach(function (key) {\n          callback.call(data, data[key], key, data);\n        });\n      }\n    }\n    return data;\n  }\n\n  /**\n   * Extend the given object.\n   * @param {*} target - The target object to extend.\n   * @param {*} args - The rest objects for merging to the target object.\n   * @returns {Object} The extended object.\n   */\n  var assign = Object.assign || function assign(target) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    if (isObject(target) && args.length > 0) {\n      args.forEach(function (arg) {\n        if (isObject(arg)) {\n          Object.keys(arg).forEach(function (key) {\n            target[key] = arg[key];\n          });\n        }\n      });\n    }\n    return target;\n  };\n  var REGEXP_DECIMALS = /\\.\\d*(?:0|9){12}\\d*$/;\n\n  /**\n   * Normalize decimal number.\n   * Check out {@link https://0.30000000000000004.com/}\n   * @param {number} value - The value to normalize.\n   * @param {number} [times=100000000000] - The times for normalizing.\n   * @returns {number} Returns the normalized number.\n   */\n  function normalizeDecimalNumber(value) {\n    var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;\n    return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;\n  }\n  var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;\n\n  /**\n   * Apply styles to the given element.\n   * @param {Element} element - The target element.\n   * @param {Object} styles - The styles for applying.\n   */\n  function setStyle(element, styles) {\n    var style = element.style;\n    forEach(styles, function (value, property) {\n      if (REGEXP_SUFFIX.test(property) && isNumber(value)) {\n        value = \"\".concat(value, \"px\");\n      }\n      style[property] = value;\n    });\n  }\n\n  /**\n   * Check if the given element has a special class.\n   * @param {Element} element - The element to check.\n   * @param {string} value - The class to search.\n   * @returns {boolean} Returns `true` if the special class was found.\n   */\n  function hasClass(element, value) {\n    return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;\n  }\n\n  /**\n   * Add classes to the given element.\n   * @param {Element} element - The target element.\n   * @param {string} value - The classes to be added.\n   */\n  function addClass(element, value) {\n    if (!value) {\n      return;\n    }\n    if (isNumber(element.length)) {\n      forEach(element, function (elem) {\n        addClass(elem, value);\n      });\n      return;\n    }\n    if (element.classList) {\n      element.classList.add(value);\n      return;\n    }\n    var className = element.className.trim();\n    if (!className) {\n      element.className = value;\n    } else if (className.indexOf(value) < 0) {\n      element.className = \"\".concat(className, \" \").concat(value);\n    }\n  }\n\n  /**\n   * Remove classes from the given element.\n   * @param {Element} element - The target element.\n   * @param {string} value - The classes to be removed.\n   */\n  function removeClass(element, value) {\n    if (!value) {\n      return;\n    }\n    if (isNumber(element.length)) {\n      forEach(element, function (elem) {\n        removeClass(elem, value);\n      });\n      return;\n    }\n    if (element.classList) {\n      element.classList.remove(value);\n      return;\n    }\n    if (element.className.indexOf(value) >= 0) {\n      element.className = element.className.replace(value, '');\n    }\n  }\n\n  /**\n   * Add or remove classes from the given element.\n   * @param {Element} element - The target element.\n   * @param {string} value - The classes to be toggled.\n   * @param {boolean} added - Add only.\n   */\n  function toggleClass(element, value, added) {\n    if (!value) {\n      return;\n    }\n    if (isNumber(element.length)) {\n      forEach(element, function (elem) {\n        toggleClass(elem, value, added);\n      });\n      return;\n    }\n\n    // IE10-11 doesn't support the second parameter of `classList.toggle`\n    if (added) {\n      addClass(element, value);\n    } else {\n      removeClass(element, value);\n    }\n  }\n  var REGEXP_CAMEL_CASE = /([a-z\\d])([A-Z])/g;\n\n  /**\n   * Transform the given string from camelCase to kebab-case\n   * @param {string} value - The value to transform.\n   * @returns {string} The transformed value.\n   */\n  function toParamCase(value) {\n    return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();\n  }\n\n  /**\n   * Get data from the given element.\n   * @param {Element} element - The target element.\n   * @param {string} name - The data key to get.\n   * @returns {string} The data value.\n   */\n  function getData(element, name) {\n    if (isObject(element[name])) {\n      return element[name];\n    }\n    if (element.dataset) {\n      return element.dataset[name];\n    }\n    return element.getAttribute(\"data-\".concat(toParamCase(name)));\n  }\n\n  /**\n   * Set data to the given element.\n   * @param {Element} element - The target element.\n   * @param {string} name - The data key to set.\n   * @param {string} data - The data value.\n   */\n  function setData(element, name, data) {\n    if (isObject(data)) {\n      element[name] = data;\n    } else if (element.dataset) {\n      element.dataset[name] = data;\n    } else {\n      element.setAttribute(\"data-\".concat(toParamCase(name)), data);\n    }\n  }\n\n  /**\n   * Remove data from the given element.\n   * @param {Element} element - The target element.\n   * @param {string} name - The data key to remove.\n   */\n  function removeData(element, name) {\n    if (isObject(element[name])) {\n      try {\n        delete element[name];\n      } catch (error) {\n        element[name] = undefined;\n      }\n    } else if (element.dataset) {\n      // #128 Safari not allows to delete dataset property\n      try {\n        delete element.dataset[name];\n      } catch (error) {\n        element.dataset[name] = undefined;\n      }\n    } else {\n      element.removeAttribute(\"data-\".concat(toParamCase(name)));\n    }\n  }\n  var REGEXP_SPACES = /\\s\\s*/;\n  var onceSupported = function () {\n    var supported = false;\n    if (IS_BROWSER) {\n      var once = false;\n      var listener = function listener() {};\n      var options = Object.defineProperty({}, 'once', {\n        get: function get() {\n          supported = true;\n          return once;\n        },\n        /**\n         * This setter can fix a `TypeError` in strict mode\n         * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}\n         * @param {boolean} value - The value to set\n         */\n        set: function set(value) {\n          once = value;\n        }\n      });\n      WINDOW.addEventListener('test', listener, options);\n      WINDOW.removeEventListener('test', listener, options);\n    }\n    return supported;\n  }();\n\n  /**\n   * Remove event listener from the target element.\n   * @param {Element} element - The event target.\n   * @param {string} type - The event type(s).\n   * @param {Function} listener - The event listener.\n   * @param {Object} options - The event options.\n   */\n  function removeListener(element, type, listener) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n    var handler = listener;\n    type.trim().split(REGEXP_SPACES).forEach(function (event) {\n      if (!onceSupported) {\n        var listeners = element.listeners;\n        if (listeners && listeners[event] && listeners[event][listener]) {\n          handler = listeners[event][listener];\n          delete listeners[event][listener];\n          if (Object.keys(listeners[event]).length === 0) {\n            delete listeners[event];\n          }\n          if (Object.keys(listeners).length === 0) {\n            delete element.listeners;\n          }\n        }\n      }\n      element.removeEventListener(event, handler, options);\n    });\n  }\n\n  /**\n   * Add event listener to the target element.\n   * @param {Element} element - The event target.\n   * @param {string} type - The event type(s).\n   * @param {Function} listener - The event listener.\n   * @param {Object} options - The event options.\n   */\n  function addListener(element, type, listener) {\n    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n    var _handler = listener;\n    type.trim().split(REGEXP_SPACES).forEach(function (event) {\n      if (options.once && !onceSupported) {\n        var _element$listeners = element.listeners,\n          listeners = _element$listeners === void 0 ? {} : _element$listeners;\n        _handler = function handler() {\n          delete listeners[event][listener];\n          element.removeEventListener(event, _handler, options);\n          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n            args[_key2] = arguments[_key2];\n          }\n          listener.apply(element, args);\n        };\n        if (!listeners[event]) {\n          listeners[event] = {};\n        }\n        if (listeners[event][listener]) {\n          element.removeEventListener(event, listeners[event][listener], options);\n        }\n        listeners[event][listener] = _handler;\n        element.listeners = listeners;\n      }\n      element.addEventListener(event, _handler, options);\n    });\n  }\n\n  /**\n   * Dispatch event on the target element.\n   * @param {Element} element - The event target.\n   * @param {string} type - The event type(s).\n   * @param {Object} data - The additional event data.\n   * @returns {boolean} Indicate if the event is default prevented or not.\n   */\n  function dispatchEvent(element, type, data) {\n    var event;\n\n    // Event and CustomEvent on IE9-11 are global objects, not constructors\n    if (isFunction(Event) && isFunction(CustomEvent)) {\n      event = new CustomEvent(type, {\n        detail: data,\n        bubbles: true,\n        cancelable: true\n      });\n    } else {\n      event = document.createEvent('CustomEvent');\n      event.initCustomEvent(type, true, true, data);\n    }\n    return element.dispatchEvent(event);\n  }\n\n  /**\n   * Get the offset base on the document.\n   * @param {Element} element - The target element.\n   * @returns {Object} The offset data.\n   */\n  function getOffset(element) {\n    var box = element.getBoundingClientRect();\n    return {\n      left: box.left + (window.pageXOffset - document.documentElement.clientLeft),\n      top: box.top + (window.pageYOffset - document.documentElement.clientTop)\n    };\n  }\n  var location = WINDOW.location;\n  var REGEXP_ORIGINS = /^(\\w+:)\\/\\/([^:/?#]*):?(\\d*)/i;\n\n  /**\n   * Check if the given URL is a cross origin URL.\n   * @param {string} url - The target URL.\n   * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.\n   */\n  function isCrossOriginURL(url) {\n    var parts = url.match(REGEXP_ORIGINS);\n    return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);\n  }\n\n  /**\n   * Add timestamp to the given URL.\n   * @param {string} url - The target URL.\n   * @returns {string} The result URL.\n   */\n  function addTimestamp(url) {\n    var timestamp = \"timestamp=\".concat(new Date().getTime());\n    return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;\n  }\n\n  /**\n   * Get transforms base on the given object.\n   * @param {Object} obj - The target object.\n   * @returns {string} A string contains transform values.\n   */\n  function getTransforms(_ref) {\n    var rotate = _ref.rotate,\n      scaleX = _ref.scaleX,\n      scaleY = _ref.scaleY,\n      translateX = _ref.translateX,\n      translateY = _ref.translateY;\n    var values = [];\n    if (isNumber(translateX) && translateX !== 0) {\n      values.push(\"translateX(\".concat(translateX, \"px)\"));\n    }\n    if (isNumber(translateY) && translateY !== 0) {\n      values.push(\"translateY(\".concat(translateY, \"px)\"));\n    }\n\n    // Rotate should come first before scale to match orientation transform\n    if (isNumber(rotate) && rotate !== 0) {\n      values.push(\"rotate(\".concat(rotate, \"deg)\"));\n    }\n    if (isNumber(scaleX) && scaleX !== 1) {\n      values.push(\"scaleX(\".concat(scaleX, \")\"));\n    }\n    if (isNumber(scaleY) && scaleY !== 1) {\n      values.push(\"scaleY(\".concat(scaleY, \")\"));\n    }\n    var transform = values.length ? values.join(' ') : 'none';\n    return {\n      WebkitTransform: transform,\n      msTransform: transform,\n      transform: transform\n    };\n  }\n\n  /**\n   * Get the max ratio of a group of pointers.\n   * @param {string} pointers - The target pointers.\n   * @returns {number} The result ratio.\n   */\n  function getMaxZoomRatio(pointers) {\n    var pointers2 = _objectSpread2({}, pointers);\n    var maxRatio = 0;\n    forEach(pointers, function (pointer, pointerId) {\n      delete pointers2[pointerId];\n      forEach(pointers2, function (pointer2) {\n        var x1 = Math.abs(pointer.startX - pointer2.startX);\n        var y1 = Math.abs(pointer.startY - pointer2.startY);\n        var x2 = Math.abs(pointer.endX - pointer2.endX);\n        var y2 = Math.abs(pointer.endY - pointer2.endY);\n        var z1 = Math.sqrt(x1 * x1 + y1 * y1);\n        var z2 = Math.sqrt(x2 * x2 + y2 * y2);\n        var ratio = (z2 - z1) / z1;\n        if (Math.abs(ratio) > Math.abs(maxRatio)) {\n          maxRatio = ratio;\n        }\n      });\n    });\n    return maxRatio;\n  }\n\n  /**\n   * Get a pointer from an event object.\n   * @param {Object} event - The target event object.\n   * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.\n   * @returns {Object} The result pointer contains start and/or end point coordinates.\n   */\n  function getPointer(_ref2, endOnly) {\n    var pageX = _ref2.pageX,\n      pageY = _ref2.pageY;\n    var end = {\n      endX: pageX,\n      endY: pageY\n    };\n    return endOnly ? end : _objectSpread2({\n      startX: pageX,\n      startY: pageY\n    }, end);\n  }\n\n  /**\n   * Get the center point coordinate of a group of pointers.\n   * @param {Object} pointers - The target pointers.\n   * @returns {Object} The center point coordinate.\n   */\n  function getPointersCenter(pointers) {\n    var pageX = 0;\n    var pageY = 0;\n    var count = 0;\n    forEach(pointers, function (_ref3) {\n      var startX = _ref3.startX,\n        startY = _ref3.startY;\n      pageX += startX;\n      pageY += startY;\n      count += 1;\n    });\n    pageX /= count;\n    pageY /= count;\n    return {\n      pageX: pageX,\n      pageY: pageY\n    };\n  }\n\n  /**\n   * Get the max sizes in a rectangle under the given aspect ratio.\n   * @param {Object} data - The original sizes.\n   * @param {string} [type='contain'] - The adjust type.\n   * @returns {Object} The result sizes.\n   */\n  function getAdjustedSizes(_ref4) {\n    var aspectRatio = _ref4.aspectRatio,\n      height = _ref4.height,\n      width = _ref4.width;\n    var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';\n    var isValidWidth = isPositiveNumber(width);\n    var isValidHeight = isPositiveNumber(height);\n    if (isValidWidth && isValidHeight) {\n      var adjustedWidth = height * aspectRatio;\n      if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {\n        height = width / aspectRatio;\n      } else {\n        width = height * aspectRatio;\n      }\n    } else if (isValidWidth) {\n      height = width / aspectRatio;\n    } else if (isValidHeight) {\n      width = height * aspectRatio;\n    }\n    return {\n      width: width,\n      height: height\n    };\n  }\n\n  /**\n   * Get the new sizes of a rectangle after rotated.\n   * @param {Object} data - The original sizes.\n   * @returns {Object} The result sizes.\n   */\n  function getRotatedSizes(_ref5) {\n    var width = _ref5.width,\n      height = _ref5.height,\n      degree = _ref5.degree;\n    degree = Math.abs(degree) % 180;\n    if (degree === 90) {\n      return {\n        width: height,\n        height: width\n      };\n    }\n    var arc = degree % 90 * Math.PI / 180;\n    var sinArc = Math.sin(arc);\n    var cosArc = Math.cos(arc);\n    var newWidth = width * cosArc + height * sinArc;\n    var newHeight = width * sinArc + height * cosArc;\n    return degree > 90 ? {\n      width: newHeight,\n      height: newWidth\n    } : {\n      width: newWidth,\n      height: newHeight\n    };\n  }\n\n  /**\n   * Get a canvas which drew the given image.\n   * @param {HTMLImageElement} image - The image for drawing.\n   * @param {Object} imageData - The image data.\n   * @param {Object} canvasData - The canvas data.\n   * @param {Object} options - The options.\n   * @returns {HTMLCanvasElement} The result canvas.\n   */\n  function getSourceCanvas(image, _ref6, _ref7, _ref8) {\n    var imageAspectRatio = _ref6.aspectRatio,\n      imageNaturalWidth = _ref6.naturalWidth,\n      imageNaturalHeight = _ref6.naturalHeight,\n      _ref6$rotate = _ref6.rotate,\n      rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,\n      _ref6$scaleX = _ref6.scaleX,\n      scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,\n      _ref6$scaleY = _ref6.scaleY,\n      scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;\n    var aspectRatio = _ref7.aspectRatio,\n      naturalWidth = _ref7.naturalWidth,\n      naturalHeight = _ref7.naturalHeight;\n    var _ref8$fillColor = _ref8.fillColor,\n      fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,\n      _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,\n      imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,\n      _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,\n      imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,\n      _ref8$maxWidth = _ref8.maxWidth,\n      maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,\n      _ref8$maxHeight = _ref8.maxHeight,\n      maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,\n      _ref8$minWidth = _ref8.minWidth,\n      minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,\n      _ref8$minHeight = _ref8.minHeight,\n      minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;\n    var canvas = document.createElement('canvas');\n    var context = canvas.getContext('2d');\n    var maxSizes = getAdjustedSizes({\n      aspectRatio: aspectRatio,\n      width: maxWidth,\n      height: maxHeight\n    });\n    var minSizes = getAdjustedSizes({\n      aspectRatio: aspectRatio,\n      width: minWidth,\n      height: minHeight\n    }, 'cover');\n    var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));\n    var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));\n\n    // Note: should always use image's natural sizes for drawing as\n    // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90\n    var destMaxSizes = getAdjustedSizes({\n      aspectRatio: imageAspectRatio,\n      width: maxWidth,\n      height: maxHeight\n    });\n    var destMinSizes = getAdjustedSizes({\n      aspectRatio: imageAspectRatio,\n      width: minWidth,\n      height: minHeight\n    }, 'cover');\n    var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));\n    var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));\n    var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];\n    canvas.width = normalizeDecimalNumber(width);\n    canvas.height = normalizeDecimalNumber(height);\n    context.fillStyle = fillColor;\n    context.fillRect(0, 0, width, height);\n    context.save();\n    context.translate(width / 2, height / 2);\n    context.rotate(rotate * Math.PI / 180);\n    context.scale(scaleX, scaleY);\n    context.imageSmoothingEnabled = imageSmoothingEnabled;\n    context.imageSmoothingQuality = imageSmoothingQuality;\n    context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {\n      return Math.floor(normalizeDecimalNumber(param));\n    }))));\n    context.restore();\n    return canvas;\n  }\n  var fromCharCode = String.fromCharCode;\n\n  /**\n   * Get string from char code in data view.\n   * @param {DataView} dataView - The data view for read.\n   * @param {number} start - The start index.\n   * @param {number} length - The read length.\n   * @returns {string} The read result.\n   */\n  function getStringFromCharCode(dataView, start, length) {\n    var str = '';\n    length += start;\n    for (var i = start; i < length; i += 1) {\n      str += fromCharCode(dataView.getUint8(i));\n    }\n    return str;\n  }\n  var REGEXP_DATA_URL_HEAD = /^data:.*,/;\n\n  /**\n   * Transform Data URL to array buffer.\n   * @param {string} dataURL - The Data URL to transform.\n   * @returns {ArrayBuffer} The result array buffer.\n   */\n  function dataURLToArrayBuffer(dataURL) {\n    var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');\n    var binary = atob(base64);\n    var arrayBuffer = new ArrayBuffer(binary.length);\n    var uint8 = new Uint8Array(arrayBuffer);\n    forEach(uint8, function (value, i) {\n      uint8[i] = binary.charCodeAt(i);\n    });\n    return arrayBuffer;\n  }\n\n  /**\n   * Transform array buffer to Data URL.\n   * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n   * @param {string} mimeType - The mime type of the Data URL.\n   * @returns {string} The result Data URL.\n   */\n  function arrayBufferToDataURL(arrayBuffer, mimeType) {\n    var chunks = [];\n\n    // Chunk Typed Array for better performance (#435)\n    var chunkSize = 8192;\n    var uint8 = new Uint8Array(arrayBuffer);\n    while (uint8.length > 0) {\n      // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9\n      // eslint-disable-next-line prefer-spread\n      chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));\n      uint8 = uint8.subarray(chunkSize);\n    }\n    return \"data:\".concat(mimeType, \";base64,\").concat(btoa(chunks.join('')));\n  }\n\n  /**\n   * Get orientation value from given array buffer.\n   * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n   * @returns {number} The read orientation value.\n   */\n  function resetAndGetOrientation(arrayBuffer) {\n    var dataView = new DataView(arrayBuffer);\n    var orientation;\n\n    // Ignores range error when the image does not have correct Exif information\n    try {\n      var littleEndian;\n      var app1Start;\n      var ifdStart;\n\n      // Only handle JPEG image (start by 0xFFD8)\n      if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {\n        var length = dataView.byteLength;\n        var offset = 2;\n        while (offset + 1 < length) {\n          if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {\n            app1Start = offset;\n            break;\n          }\n          offset += 1;\n        }\n      }\n      if (app1Start) {\n        var exifIDCode = app1Start + 4;\n        var tiffOffset = app1Start + 10;\n        if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {\n          var endianness = dataView.getUint16(tiffOffset);\n          littleEndian = endianness === 0x4949;\n          if (littleEndian || endianness === 0x4D4D /* bigEndian */) {\n            if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {\n              var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);\n              if (firstIFDOffset >= 0x00000008) {\n                ifdStart = tiffOffset + firstIFDOffset;\n              }\n            }\n          }\n        }\n      }\n      if (ifdStart) {\n        var _length = dataView.getUint16(ifdStart, littleEndian);\n        var _offset;\n        var i;\n        for (i = 0; i < _length; i += 1) {\n          _offset = ifdStart + i * 12 + 2;\n          if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {\n            // 8 is the offset of the current tag's value\n            _offset += 8;\n\n            // Get the original orientation value\n            orientation = dataView.getUint16(_offset, littleEndian);\n\n            // Override the orientation with its default value\n            dataView.setUint16(_offset, 1, littleEndian);\n            break;\n          }\n        }\n      }\n    } catch (error) {\n      orientation = 1;\n    }\n    return orientation;\n  }\n\n  /**\n   * Parse Exif Orientation value.\n   * @param {number} orientation - The orientation to parse.\n   * @returns {Object} The parsed result.\n   */\n  function parseOrientation(orientation) {\n    var rotate = 0;\n    var scaleX = 1;\n    var scaleY = 1;\n    switch (orientation) {\n      // Flip horizontal\n      case 2:\n        scaleX = -1;\n        break;\n\n      // Rotate left 180\u00B0\n      case 3:\n        rotate = -180;\n        break;\n\n      // Flip vertical\n      case 4:\n        scaleY = -1;\n        break;\n\n      // Flip vertical and rotate right 90\u00B0\n      case 5:\n        rotate = 90;\n        scaleY = -1;\n        break;\n\n      // Rotate right 90\u00B0\n      case 6:\n        rotate = 90;\n        break;\n\n      // Flip horizontal and rotate right 90\u00B0\n      case 7:\n        rotate = 90;\n        scaleX = -1;\n        break;\n\n      // Rotate left 90\u00B0\n      case 8:\n        rotate = -90;\n        break;\n    }\n    return {\n      rotate: rotate,\n      scaleX: scaleX,\n      scaleY: scaleY\n    };\n  }\n\n  var render = {\n    render: function render() {\n      this.initContainer();\n      this.initCanvas();\n      this.initCropBox();\n      this.renderCanvas();\n      if (this.cropped) {\n        this.renderCropBox();\n      }\n    },\n    initContainer: function initContainer() {\n      var element = this.element,\n        options = this.options,\n        container = this.container,\n        cropper = this.cropper;\n      var minWidth = Number(options.minContainerWidth);\n      var minHeight = Number(options.minContainerHeight);\n      addClass(cropper, CLASS_HIDDEN);\n      removeClass(element, CLASS_HIDDEN);\n      var containerData = {\n        width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),\n        height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)\n      };\n      this.containerData = containerData;\n      setStyle(cropper, {\n        width: containerData.width,\n        height: containerData.height\n      });\n      addClass(element, CLASS_HIDDEN);\n      removeClass(cropper, CLASS_HIDDEN);\n    },\n    // Canvas (image wrapper)\n    initCanvas: function initCanvas() {\n      var containerData = this.containerData,\n        imageData = this.imageData;\n      var viewMode = this.options.viewMode;\n      var rotated = Math.abs(imageData.rotate) % 180 === 90;\n      var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;\n      var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;\n      var aspectRatio = naturalWidth / naturalHeight;\n      var canvasWidth = containerData.width;\n      var canvasHeight = containerData.height;\n      if (containerData.height * aspectRatio > containerData.width) {\n        if (viewMode === 3) {\n          canvasWidth = containerData.height * aspectRatio;\n        } else {\n          canvasHeight = containerData.width / aspectRatio;\n        }\n      } else if (viewMode === 3) {\n        canvasHeight = containerData.width / aspectRatio;\n      } else {\n        canvasWidth = containerData.height * aspectRatio;\n      }\n      var canvasData = {\n        aspectRatio: aspectRatio,\n        naturalWidth: naturalWidth,\n        naturalHeight: naturalHeight,\n        width: canvasWidth,\n        height: canvasHeight\n      };\n      this.canvasData = canvasData;\n      this.limited = viewMode === 1 || viewMode === 2;\n      this.limitCanvas(true, true);\n      canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n      canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n      canvasData.left = (containerData.width - canvasData.width) / 2;\n      canvasData.top = (containerData.height - canvasData.height) / 2;\n      canvasData.oldLeft = canvasData.left;\n      canvasData.oldTop = canvasData.top;\n      this.initialCanvasData = assign({}, canvasData);\n    },\n    limitCanvas: function limitCanvas(sizeLimited, positionLimited) {\n      var options = this.options,\n        containerData = this.containerData,\n        canvasData = this.canvasData,\n        cropBoxData = this.cropBoxData;\n      var viewMode = options.viewMode;\n      var aspectRatio = canvasData.aspectRatio;\n      var cropped = this.cropped && cropBoxData;\n      if (sizeLimited) {\n        var minCanvasWidth = Number(options.minCanvasWidth) || 0;\n        var minCanvasHeight = Number(options.minCanvasHeight) || 0;\n        if (viewMode > 1) {\n          minCanvasWidth = Math.max(minCanvasWidth, containerData.width);\n          minCanvasHeight = Math.max(minCanvasHeight, containerData.height);\n          if (viewMode === 3) {\n            if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n              minCanvasWidth = minCanvasHeight * aspectRatio;\n            } else {\n              minCanvasHeight = minCanvasWidth / aspectRatio;\n            }\n          }\n        } else if (viewMode > 0) {\n          if (minCanvasWidth) {\n            minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);\n          } else if (minCanvasHeight) {\n            minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);\n          } else if (cropped) {\n            minCanvasWidth = cropBoxData.width;\n            minCanvasHeight = cropBoxData.height;\n            if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n              minCanvasWidth = minCanvasHeight * aspectRatio;\n            } else {\n              minCanvasHeight = minCanvasWidth / aspectRatio;\n            }\n          }\n        }\n        var _getAdjustedSizes = getAdjustedSizes({\n          aspectRatio: aspectRatio,\n          width: minCanvasWidth,\n          height: minCanvasHeight\n        });\n        minCanvasWidth = _getAdjustedSizes.width;\n        minCanvasHeight = _getAdjustedSizes.height;\n        canvasData.minWidth = minCanvasWidth;\n        canvasData.minHeight = minCanvasHeight;\n        canvasData.maxWidth = Infinity;\n        canvasData.maxHeight = Infinity;\n      }\n      if (positionLimited) {\n        if (viewMode > (cropped ? 0 : 1)) {\n          var newCanvasLeft = containerData.width - canvasData.width;\n          var newCanvasTop = containerData.height - canvasData.height;\n          canvasData.minLeft = Math.min(0, newCanvasLeft);\n          canvasData.minTop = Math.min(0, newCanvasTop);\n          canvasData.maxLeft = Math.max(0, newCanvasLeft);\n          canvasData.maxTop = Math.max(0, newCanvasTop);\n          if (cropped && this.limited) {\n            canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));\n            canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));\n            canvasData.maxLeft = cropBoxData.left;\n            canvasData.maxTop = cropBoxData.top;\n            if (viewMode === 2) {\n              if (canvasData.width >= containerData.width) {\n                canvasData.minLeft = Math.min(0, newCanvasLeft);\n                canvasData.maxLeft = Math.max(0, newCanvasLeft);\n              }\n              if (canvasData.height >= containerData.height) {\n                canvasData.minTop = Math.min(0, newCanvasTop);\n                canvasData.maxTop = Math.max(0, newCanvasTop);\n              }\n            }\n          }\n        } else {\n          canvasData.minLeft = -canvasData.width;\n          canvasData.minTop = -canvasData.height;\n          canvasData.maxLeft = containerData.width;\n          canvasData.maxTop = containerData.height;\n        }\n      }\n    },\n    renderCanvas: function renderCanvas(changed, transformed) {\n      var canvasData = this.canvasData,\n        imageData = this.imageData;\n      if (transformed) {\n        var _getRotatedSizes = getRotatedSizes({\n            width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),\n            height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),\n            degree: imageData.rotate || 0\n          }),\n          naturalWidth = _getRotatedSizes.width,\n          naturalHeight = _getRotatedSizes.height;\n        var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);\n        var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);\n        canvasData.left -= (width - canvasData.width) / 2;\n        canvasData.top -= (height - canvasData.height) / 2;\n        canvasData.width = width;\n        canvasData.height = height;\n        canvasData.aspectRatio = naturalWidth / naturalHeight;\n        canvasData.naturalWidth = naturalWidth;\n        canvasData.naturalHeight = naturalHeight;\n        this.limitCanvas(true, false);\n      }\n      if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {\n        canvasData.left = canvasData.oldLeft;\n      }\n      if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {\n        canvasData.top = canvasData.oldTop;\n      }\n      canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n      canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n      this.limitCanvas(false, true);\n      canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);\n      canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);\n      canvasData.oldLeft = canvasData.left;\n      canvasData.oldTop = canvasData.top;\n      setStyle(this.canvas, assign({\n        width: canvasData.width,\n        height: canvasData.height\n      }, getTransforms({\n        translateX: canvasData.left,\n        translateY: canvasData.top\n      })));\n      this.renderImage(changed);\n      if (this.cropped && this.limited) {\n        this.limitCropBox(true, true);\n      }\n    },\n    renderImage: function renderImage(changed) {\n      var canvasData = this.canvasData,\n        imageData = this.imageData;\n      var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);\n      var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);\n      assign(imageData, {\n        width: width,\n        height: height,\n        left: (canvasData.width - width) / 2,\n        top: (canvasData.height - height) / 2\n      });\n      setStyle(this.image, assign({\n        width: imageData.width,\n        height: imageData.height\n      }, getTransforms(assign({\n        translateX: imageData.left,\n        translateY: imageData.top\n      }, imageData))));\n      if (changed) {\n        this.output();\n      }\n    },\n    initCropBox: function initCropBox() {\n      var options = this.options,\n        canvasData = this.canvasData;\n      var aspectRatio = options.aspectRatio || options.initialAspectRatio;\n      var autoCropArea = Number(options.autoCropArea) || 0.8;\n      var cropBoxData = {\n        width: canvasData.width,\n        height: canvasData.height\n      };\n      if (aspectRatio) {\n        if (canvasData.height * aspectRatio > canvasData.width) {\n          cropBoxData.height = cropBoxData.width / aspectRatio;\n        } else {\n          cropBoxData.width = cropBoxData.height * aspectRatio;\n        }\n      }\n      this.cropBoxData = cropBoxData;\n      this.limitCropBox(true, true);\n\n      // Initialize auto crop area\n      cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n      cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);\n\n      // The width/height of auto crop area must large than \"minWidth/Height\"\n      cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);\n      cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);\n      cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;\n      cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;\n      cropBoxData.oldLeft = cropBoxData.left;\n      cropBoxData.oldTop = cropBoxData.top;\n      this.initialCropBoxData = assign({}, cropBoxData);\n    },\n    limitCropBox: function limitCropBox(sizeLimited, positionLimited) {\n      var options = this.options,\n        containerData = this.containerData,\n        canvasData = this.canvasData,\n        cropBoxData = this.cropBoxData,\n        limited = this.limited;\n      var aspectRatio = options.aspectRatio;\n      if (sizeLimited) {\n        var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;\n        var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;\n        var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;\n        var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height;\n\n        // The min/maxCropBoxWidth/Height must be less than container's width/height\n        minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);\n        minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);\n        if (aspectRatio) {\n          if (minCropBoxWidth && minCropBoxHeight) {\n            if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {\n              minCropBoxHeight = minCropBoxWidth / aspectRatio;\n            } else {\n              minCropBoxWidth = minCropBoxHeight * aspectRatio;\n            }\n          } else if (minCropBoxWidth) {\n            minCropBoxHeight = minCropBoxWidth / aspectRatio;\n          } else if (minCropBoxHeight) {\n            minCropBoxWidth = minCropBoxHeight * aspectRatio;\n          }\n          if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {\n            maxCropBoxHeight = maxCropBoxWidth / aspectRatio;\n          } else {\n            maxCropBoxWidth = maxCropBoxHeight * aspectRatio;\n          }\n        }\n\n        // The minWidth/Height must be less than maxWidth/Height\n        cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);\n        cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);\n        cropBoxData.maxWidth = maxCropBoxWidth;\n        cropBoxData.maxHeight = maxCropBoxHeight;\n      }\n      if (positionLimited) {\n        if (limited) {\n          cropBoxData.minLeft = Math.max(0, canvasData.left);\n          cropBoxData.minTop = Math.max(0, canvasData.top);\n          cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;\n          cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;\n        } else {\n          cropBoxData.minLeft = 0;\n          cropBoxData.minTop = 0;\n          cropBoxData.maxLeft = containerData.width - cropBoxData.width;\n          cropBoxData.maxTop = containerData.height - cropBoxData.height;\n        }\n      }\n    },\n    renderCropBox: function renderCropBox() {\n      var options = this.options,\n        containerData = this.containerData,\n        cropBoxData = this.cropBoxData;\n      if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {\n        cropBoxData.left = cropBoxData.oldLeft;\n      }\n      if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {\n        cropBoxData.top = cropBoxData.oldTop;\n      }\n      cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n      cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);\n      this.limitCropBox(false, true);\n      cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);\n      cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);\n      cropBoxData.oldLeft = cropBoxData.left;\n      cropBoxData.oldTop = cropBoxData.top;\n      if (options.movable && options.cropBoxMovable) {\n        // Turn to move the canvas when the crop box is equal to the container\n        setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);\n      }\n      setStyle(this.cropBox, assign({\n        width: cropBoxData.width,\n        height: cropBoxData.height\n      }, getTransforms({\n        translateX: cropBoxData.left,\n        translateY: cropBoxData.top\n      })));\n      if (this.cropped && this.limited) {\n        this.limitCanvas(true, true);\n      }\n      if (!this.disabled) {\n        this.output();\n      }\n    },\n    output: function output() {\n      this.preview();\n      dispatchEvent(this.element, EVENT_CROP, this.getData());\n    }\n  };\n\n  var preview = {\n    initPreview: function initPreview() {\n      var element = this.element,\n        crossOrigin = this.crossOrigin;\n      var preview = this.options.preview;\n      var url = crossOrigin ? this.crossOriginUrl : this.url;\n      var alt = element.alt || 'The image to preview';\n      var image = document.createElement('img');\n      if (crossOrigin) {\n        image.crossOrigin = crossOrigin;\n      }\n      image.src = url;\n      image.alt = alt;\n      this.viewBox.appendChild(image);\n      this.viewBoxImage = image;\n      if (!preview) {\n        return;\n      }\n      var previews = preview;\n      if (typeof preview === 'string') {\n        previews = element.ownerDocument.querySelectorAll(preview);\n      } else if (preview.querySelector) {\n        previews = [preview];\n      }\n      this.previews = previews;\n      forEach(previews, function (el) {\n        var img = document.createElement('img');\n\n        // Save the original size for recover\n        setData(el, DATA_PREVIEW, {\n          width: el.offsetWidth,\n          height: el.offsetHeight,\n          html: el.innerHTML\n        });\n        if (crossOrigin) {\n          img.crossOrigin = crossOrigin;\n        }\n        img.src = url;\n        img.alt = alt;\n\n        /**\n         * Override img element styles\n         * Add `display:block` to avoid margin top issue\n         * Add `height:auto` to override `height` attribute on IE8\n         * (Occur only when margin-top <= -height)\n         */\n        img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;\"';\n        el.innerHTML = '';\n        el.appendChild(img);\n      });\n    },\n    resetPreview: function resetPreview() {\n      forEach(this.previews, function (element) {\n        var data = getData(element, DATA_PREVIEW);\n        setStyle(element, {\n          width: data.width,\n          height: data.height\n        });\n        element.innerHTML = data.html;\n        removeData(element, DATA_PREVIEW);\n      });\n    },\n    preview: function preview() {\n      var imageData = this.imageData,\n        canvasData = this.canvasData,\n        cropBoxData = this.cropBoxData;\n      var cropBoxWidth = cropBoxData.width,\n        cropBoxHeight = cropBoxData.height;\n      var width = imageData.width,\n        height = imageData.height;\n      var left = cropBoxData.left - canvasData.left - imageData.left;\n      var top = cropBoxData.top - canvasData.top - imageData.top;\n      if (!this.cropped || this.disabled) {\n        return;\n      }\n      setStyle(this.viewBoxImage, assign({\n        width: width,\n        height: height\n      }, getTransforms(assign({\n        translateX: -left,\n        translateY: -top\n      }, imageData))));\n      forEach(this.previews, function (element) {\n        var data = getData(element, DATA_PREVIEW);\n        var originalWidth = data.width;\n        var originalHeight = data.height;\n        var newWidth = originalWidth;\n        var newHeight = originalHeight;\n        var ratio = 1;\n        if (cropBoxWidth) {\n          ratio = originalWidth / cropBoxWidth;\n          newHeight = cropBoxHeight * ratio;\n        }\n        if (cropBoxHeight && newHeight > originalHeight) {\n          ratio = originalHeight / cropBoxHeight;\n          newWidth = cropBoxWidth * ratio;\n          newHeight = originalHeight;\n        }\n        setStyle(element, {\n          width: newWidth,\n          height: newHeight\n        });\n        setStyle(element.getElementsByTagName('img')[0], assign({\n          width: width * ratio,\n          height: height * ratio\n        }, getTransforms(assign({\n          translateX: -left * ratio,\n          translateY: -top * ratio\n        }, imageData))));\n      });\n    }\n  };\n\n  var events = {\n    bind: function bind() {\n      var element = this.element,\n        options = this.options,\n        cropper = this.cropper;\n      if (isFunction(options.cropstart)) {\n        addListener(element, EVENT_CROP_START, options.cropstart);\n      }\n      if (isFunction(options.cropmove)) {\n        addListener(element, EVENT_CROP_MOVE, options.cropmove);\n      }\n      if (isFunction(options.cropend)) {\n        addListener(element, EVENT_CROP_END, options.cropend);\n      }\n      if (isFunction(options.crop)) {\n        addListener(element, EVENT_CROP, options.crop);\n      }\n      if (isFunction(options.zoom)) {\n        addListener(element, EVENT_ZOOM, options.zoom);\n      }\n      addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));\n      if (options.zoomable && options.zoomOnWheel) {\n        addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {\n          passive: false,\n          capture: true\n        });\n      }\n      if (options.toggleDragModeOnDblclick) {\n        addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));\n      }\n      addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));\n      addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));\n      if (options.responsive) {\n        addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));\n      }\n    },\n    unbind: function unbind() {\n      var element = this.element,\n        options = this.options,\n        cropper = this.cropper;\n      if (isFunction(options.cropstart)) {\n        removeListener(element, EVENT_CROP_START, options.cropstart);\n      }\n      if (isFunction(options.cropmove)) {\n        removeListener(element, EVENT_CROP_MOVE, options.cropmove);\n      }\n      if (isFunction(options.cropend)) {\n        removeListener(element, EVENT_CROP_END, options.cropend);\n      }\n      if (isFunction(options.crop)) {\n        removeListener(element, EVENT_CROP, options.crop);\n      }\n      if (isFunction(options.zoom)) {\n        removeListener(element, EVENT_ZOOM, options.zoom);\n      }\n      removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);\n      if (options.zoomable && options.zoomOnWheel) {\n        removeListener(cropper, EVENT_WHEEL, this.onWheel, {\n          passive: false,\n          capture: true\n        });\n      }\n      if (options.toggleDragModeOnDblclick) {\n        removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);\n      }\n      removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);\n      removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);\n      if (options.responsive) {\n        removeListener(window, EVENT_RESIZE, this.onResize);\n      }\n    }\n  };\n\n  var handlers = {\n    resize: function resize() {\n      if (this.disabled) {\n        return;\n      }\n      var options = this.options,\n        container = this.container,\n        containerData = this.containerData;\n      var ratioX = container.offsetWidth / containerData.width;\n      var ratioY = container.offsetHeight / containerData.height;\n      var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY;\n\n      // Resize when width changed or height changed\n      if (ratio !== 1) {\n        var canvasData;\n        var cropBoxData;\n        if (options.restore) {\n          canvasData = this.getCanvasData();\n          cropBoxData = this.getCropBoxData();\n        }\n        this.render();\n        if (options.restore) {\n          this.setCanvasData(forEach(canvasData, function (n, i) {\n            canvasData[i] = n * ratio;\n          }));\n          this.setCropBoxData(forEach(cropBoxData, function (n, i) {\n            cropBoxData[i] = n * ratio;\n          }));\n        }\n      }\n    },\n    dblclick: function dblclick() {\n      if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {\n        return;\n      }\n      this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);\n    },\n    wheel: function wheel(event) {\n      var _this = this;\n      var ratio = Number(this.options.wheelZoomRatio) || 0.1;\n      var delta = 1;\n      if (this.disabled) {\n        return;\n      }\n      event.preventDefault();\n\n      // Limit wheel speed to prevent zoom too fast (#21)\n      if (this.wheeling) {\n        return;\n      }\n      this.wheeling = true;\n      setTimeout(function () {\n        _this.wheeling = false;\n      }, 50);\n      if (event.deltaY) {\n        delta = event.deltaY > 0 ? 1 : -1;\n      } else if (event.wheelDelta) {\n        delta = -event.wheelDelta / 120;\n      } else if (event.detail) {\n        delta = event.detail > 0 ? 1 : -1;\n      }\n      this.zoom(-delta * ratio, event);\n    },\n    cropStart: function cropStart(event) {\n      var buttons = event.buttons,\n        button = event.button;\n      if (this.disabled\n\n      // Handle mouse event and pointer event and ignore touch event\n      || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && (\n      // No primary button (Usually the left button)\n      isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0\n\n      // Open context menu\n      || event.ctrlKey)) {\n        return;\n      }\n      var options = this.options,\n        pointers = this.pointers;\n      var action;\n      if (event.changedTouches) {\n        // Handle touch event\n        forEach(event.changedTouches, function (touch) {\n          pointers[touch.identifier] = getPointer(touch);\n        });\n      } else {\n        // Handle mouse event and pointer event\n        pointers[event.pointerId || 0] = getPointer(event);\n      }\n      if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {\n        action = ACTION_ZOOM;\n      } else {\n        action = getData(event.target, DATA_ACTION);\n      }\n      if (!REGEXP_ACTIONS.test(action)) {\n        return;\n      }\n      if (dispatchEvent(this.element, EVENT_CROP_START, {\n        originalEvent: event,\n        action: action\n      }) === false) {\n        return;\n      }\n\n      // This line is required for preventing page zooming in iOS browsers\n      event.preventDefault();\n      this.action = action;\n      this.cropping = false;\n      if (action === ACTION_CROP) {\n        this.cropping = true;\n        addClass(this.dragBox, CLASS_MODAL);\n      }\n    },\n    cropMove: function cropMove(event) {\n      var action = this.action;\n      if (this.disabled || !action) {\n        return;\n      }\n      var pointers = this.pointers;\n      event.preventDefault();\n      if (dispatchEvent(this.element, EVENT_CROP_MOVE, {\n        originalEvent: event,\n        action: action\n      }) === false) {\n        return;\n      }\n      if (event.changedTouches) {\n        forEach(event.changedTouches, function (touch) {\n          // The first parameter should not be undefined (#432)\n          assign(pointers[touch.identifier] || {}, getPointer(touch, true));\n        });\n      } else {\n        assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));\n      }\n      this.change(event);\n    },\n    cropEnd: function cropEnd(event) {\n      if (this.disabled) {\n        return;\n      }\n      var action = this.action,\n        pointers = this.pointers;\n      if (event.changedTouches) {\n        forEach(event.changedTouches, function (touch) {\n          delete pointers[touch.identifier];\n        });\n      } else {\n        delete pointers[event.pointerId || 0];\n      }\n      if (!action) {\n        return;\n      }\n      event.preventDefault();\n      if (!Object.keys(pointers).length) {\n        this.action = '';\n      }\n      if (this.cropping) {\n        this.cropping = false;\n        toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);\n      }\n      dispatchEvent(this.element, EVENT_CROP_END, {\n        originalEvent: event,\n        action: action\n      });\n    }\n  };\n\n  var change = {\n    change: function change(event) {\n      var options = this.options,\n        canvasData = this.canvasData,\n        containerData = this.containerData,\n        cropBoxData = this.cropBoxData,\n        pointers = this.pointers;\n      var action = this.action;\n      var aspectRatio = options.aspectRatio;\n      var left = cropBoxData.left,\n        top = cropBoxData.top,\n        width = cropBoxData.width,\n        height = cropBoxData.height;\n      var right = left + width;\n      var bottom = top + height;\n      var minLeft = 0;\n      var minTop = 0;\n      var maxWidth = containerData.width;\n      var maxHeight = containerData.height;\n      var renderable = true;\n      var offset;\n\n      // Locking aspect ratio in \"free mode\" by holding shift key\n      if (!aspectRatio && event.shiftKey) {\n        aspectRatio = width && height ? width / height : 1;\n      }\n      if (this.limited) {\n        minLeft = cropBoxData.minLeft;\n        minTop = cropBoxData.minTop;\n        maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);\n        maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);\n      }\n      var pointer = pointers[Object.keys(pointers)[0]];\n      var range = {\n        x: pointer.endX - pointer.startX,\n        y: pointer.endY - pointer.startY\n      };\n      var check = function check(side) {\n        switch (side) {\n          case ACTION_EAST:\n            if (right + range.x > maxWidth) {\n              range.x = maxWidth - right;\n            }\n            break;\n          case ACTION_WEST:\n            if (left + range.x < minLeft) {\n              range.x = minLeft - left;\n            }\n            break;\n          case ACTION_NORTH:\n            if (top + range.y < minTop) {\n              range.y = minTop - top;\n            }\n            break;\n          case ACTION_SOUTH:\n            if (bottom + range.y > maxHeight) {\n              range.y = maxHeight - bottom;\n            }\n            break;\n        }\n      };\n      switch (action) {\n        // Move crop box\n        case ACTION_ALL:\n          left += range.x;\n          top += range.y;\n          break;\n\n        // Resize crop box\n        case ACTION_EAST:\n          if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n            renderable = false;\n            break;\n          }\n          check(ACTION_EAST);\n          width += range.x;\n          if (width < 0) {\n            action = ACTION_WEST;\n            width = -width;\n            left -= width;\n          }\n          if (aspectRatio) {\n            height = width / aspectRatio;\n            top += (cropBoxData.height - height) / 2;\n          }\n          break;\n        case ACTION_NORTH:\n          if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n            renderable = false;\n            break;\n          }\n          check(ACTION_NORTH);\n          height -= range.y;\n          top += range.y;\n          if (height < 0) {\n            action = ACTION_SOUTH;\n            height = -height;\n            top -= height;\n          }\n          if (aspectRatio) {\n            width = height * aspectRatio;\n            left += (cropBoxData.width - width) / 2;\n          }\n          break;\n        case ACTION_WEST:\n          if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n            renderable = false;\n            break;\n          }\n          check(ACTION_WEST);\n          width -= range.x;\n          left += range.x;\n          if (width < 0) {\n            action = ACTION_EAST;\n            width = -width;\n            left -= width;\n          }\n          if (aspectRatio) {\n            height = width / aspectRatio;\n            top += (cropBoxData.height - height) / 2;\n          }\n          break;\n        case ACTION_SOUTH:\n          if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n            renderable = false;\n            break;\n          }\n          check(ACTION_SOUTH);\n          height += range.y;\n          if (height < 0) {\n            action = ACTION_NORTH;\n            height = -height;\n            top -= height;\n          }\n          if (aspectRatio) {\n            width = height * aspectRatio;\n            left += (cropBoxData.width - width) / 2;\n          }\n          break;\n        case ACTION_NORTH_EAST:\n          if (aspectRatio) {\n            if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {\n              renderable = false;\n              break;\n            }\n            check(ACTION_NORTH);\n            height -= range.y;\n            top += range.y;\n            width = height * aspectRatio;\n          } else {\n            check(ACTION_NORTH);\n            check(ACTION_EAST);\n            if (range.x >= 0) {\n              if (right < maxWidth) {\n                width += range.x;\n              } else if (range.y <= 0 && top <= minTop) {\n                renderable = false;\n              }\n            } else {\n              width += range.x;\n            }\n            if (range.y <= 0) {\n              if (top > minTop) {\n                height -= range.y;\n                top += range.y;\n              }\n            } else {\n              height -= range.y;\n              top += range.y;\n            }\n          }\n          if (width < 0 && height < 0) {\n            action = ACTION_SOUTH_WEST;\n            height = -height;\n            width = -width;\n            top -= height;\n            left -= width;\n          } else if (width < 0) {\n            action = ACTION_NORTH_WEST;\n            width = -width;\n            left -= width;\n          } else if (height < 0) {\n            action = ACTION_SOUTH_EAST;\n            height = -height;\n            top -= height;\n          }\n          break;\n        case ACTION_NORTH_WEST:\n          if (aspectRatio) {\n            if (range.y <= 0 && (top <= minTop || left <= minLeft)) {\n              renderable = false;\n              break;\n            }\n            check(ACTION_NORTH);\n            height -= range.y;\n            top += range.y;\n            width = height * aspectRatio;\n            left += cropBoxData.width - width;\n          } else {\n            check(ACTION_NORTH);\n            check(ACTION_WEST);\n            if (range.x <= 0) {\n              if (left > minLeft) {\n                width -= range.x;\n                left += range.x;\n              } else if (range.y <= 0 && top <= minTop) {\n                renderable = false;\n              }\n            } else {\n              width -= range.x;\n              left += range.x;\n            }\n            if (range.y <= 0) {\n              if (top > minTop) {\n                height -= range.y;\n                top += range.y;\n              }\n            } else {\n              height -= range.y;\n              top += range.y;\n            }\n          }\n          if (width < 0 && height < 0) {\n            action = ACTION_SOUTH_EAST;\n            height = -height;\n            width = -width;\n            top -= height;\n            left -= width;\n          } else if (width < 0) {\n            action = ACTION_NORTH_EAST;\n            width = -width;\n            left -= width;\n          } else if (height < 0) {\n            action = ACTION_SOUTH_WEST;\n            height = -height;\n            top -= height;\n          }\n          break;\n        case ACTION_SOUTH_WEST:\n          if (aspectRatio) {\n            if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {\n              renderable = false;\n              break;\n            }\n            check(ACTION_WEST);\n            width -= range.x;\n            left += range.x;\n            height = width / aspectRatio;\n          } else {\n            check(ACTION_SOUTH);\n            check(ACTION_WEST);\n            if (range.x <= 0) {\n              if (left > minLeft) {\n                width -= range.x;\n                left += range.x;\n              } else if (range.y >= 0 && bottom >= maxHeight) {\n                renderable = false;\n              }\n            } else {\n              width -= range.x;\n              left += range.x;\n            }\n            if (range.y >= 0) {\n              if (bottom < maxHeight) {\n                height += range.y;\n              }\n            } else {\n              height += range.y;\n            }\n          }\n          if (width < 0 && height < 0) {\n            action = ACTION_NORTH_EAST;\n            height = -height;\n            width = -width;\n            top -= height;\n            left -= width;\n          } else if (width < 0) {\n            action = ACTION_SOUTH_EAST;\n            width = -width;\n            left -= width;\n          } else if (height < 0) {\n            action = ACTION_NORTH_WEST;\n            height = -height;\n            top -= height;\n          }\n          break;\n        case ACTION_SOUTH_EAST:\n          if (aspectRatio) {\n            if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {\n              renderable = false;\n              break;\n            }\n            check(ACTION_EAST);\n            width += range.x;\n            height = width / aspectRatio;\n          } else {\n            check(ACTION_SOUTH);\n            check(ACTION_EAST);\n            if (range.x >= 0) {\n              if (right < maxWidth) {\n                width += range.x;\n              } else if (range.y >= 0 && bottom >= maxHeight) {\n                renderable = false;\n              }\n            } else {\n              width += range.x;\n            }\n            if (range.y >= 0) {\n              if (bottom < maxHeight) {\n                height += range.y;\n              }\n            } else {\n              height += range.y;\n            }\n          }\n          if (width < 0 && height < 0) {\n            action = ACTION_NORTH_WEST;\n            height = -height;\n            width = -width;\n            top -= height;\n            left -= width;\n          } else if (width < 0) {\n            action = ACTION_SOUTH_WEST;\n            width = -width;\n            left -= width;\n          } else if (height < 0) {\n            action = ACTION_NORTH_EAST;\n            height = -height;\n            top -= height;\n          }\n          break;\n\n        // Move canvas\n        case ACTION_MOVE:\n          this.move(range.x, range.y);\n          renderable = false;\n          break;\n\n        // Zoom canvas\n        case ACTION_ZOOM:\n          this.zoom(getMaxZoomRatio(pointers), event);\n          renderable = false;\n          break;\n\n        // Create crop box\n        case ACTION_CROP:\n          if (!range.x || !range.y) {\n            renderable = false;\n            break;\n          }\n          offset = getOffset(this.cropper);\n          left = pointer.startX - offset.left;\n          top = pointer.startY - offset.top;\n          width = cropBoxData.minWidth;\n          height = cropBoxData.minHeight;\n          if (range.x > 0) {\n            action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;\n          } else if (range.x < 0) {\n            left -= width;\n            action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;\n          }\n          if (range.y < 0) {\n            top -= height;\n          }\n\n          // Show the crop box if is hidden\n          if (!this.cropped) {\n            removeClass(this.cropBox, CLASS_HIDDEN);\n            this.cropped = true;\n            if (this.limited) {\n              this.limitCropBox(true, true);\n            }\n          }\n          break;\n      }\n      if (renderable) {\n        cropBoxData.width = width;\n        cropBoxData.height = height;\n        cropBoxData.left = left;\n        cropBoxData.top = top;\n        this.action = action;\n        this.renderCropBox();\n      }\n\n      // Override\n      forEach(pointers, function (p) {\n        p.startX = p.endX;\n        p.startY = p.endY;\n      });\n    }\n  };\n\n  var methods = {\n    // Show the crop box manually\n    crop: function crop() {\n      if (this.ready && !this.cropped && !this.disabled) {\n        this.cropped = true;\n        this.limitCropBox(true, true);\n        if (this.options.modal) {\n          addClass(this.dragBox, CLASS_MODAL);\n        }\n        removeClass(this.cropBox, CLASS_HIDDEN);\n        this.setCropBoxData(this.initialCropBoxData);\n      }\n      return this;\n    },\n    // Reset the image and crop box to their initial states\n    reset: function reset() {\n      if (this.ready && !this.disabled) {\n        this.imageData = assign({}, this.initialImageData);\n        this.canvasData = assign({}, this.initialCanvasData);\n        this.cropBoxData = assign({}, this.initialCropBoxData);\n        this.renderCanvas();\n        if (this.cropped) {\n          this.renderCropBox();\n        }\n      }\n      return this;\n    },\n    // Clear the crop box\n    clear: function clear() {\n      if (this.cropped && !this.disabled) {\n        assign(this.cropBoxData, {\n          left: 0,\n          top: 0,\n          width: 0,\n          height: 0\n        });\n        this.cropped = false;\n        this.renderCropBox();\n        this.limitCanvas(true, true);\n\n        // Render canvas after crop box rendered\n        this.renderCanvas();\n        removeClass(this.dragBox, CLASS_MODAL);\n        addClass(this.cropBox, CLASS_HIDDEN);\n      }\n      return this;\n    },\n    /**\n     * Replace the image's src and rebuild the cropper\n     * @param {string} url - The new URL.\n     * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.\n     * @returns {Cropper} this\n     */\n    replace: function replace(url) {\n      var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n      if (!this.disabled && url) {\n        if (this.isImg) {\n          this.element.src = url;\n        }\n        if (hasSameSize) {\n          this.url = url;\n          this.image.src = url;\n          if (this.ready) {\n            this.viewBoxImage.src = url;\n            forEach(this.previews, function (element) {\n              element.getElementsByTagName('img')[0].src = url;\n            });\n          }\n        } else {\n          if (this.isImg) {\n            this.replaced = true;\n          }\n          this.options.data = null;\n          this.uncreate();\n          this.load(url);\n        }\n      }\n      return this;\n    },\n    // Enable (unfreeze) the cropper\n    enable: function enable() {\n      if (this.ready && this.disabled) {\n        this.disabled = false;\n        removeClass(this.cropper, CLASS_DISABLED);\n      }\n      return this;\n    },\n    // Disable (freeze) the cropper\n    disable: function disable() {\n      if (this.ready && !this.disabled) {\n        this.disabled = true;\n        addClass(this.cropper, CLASS_DISABLED);\n      }\n      return this;\n    },\n    /**\n     * Destroy the cropper and remove the instance from the image\n     * @returns {Cropper} this\n     */\n    destroy: function destroy() {\n      var element = this.element;\n      if (!element[NAMESPACE]) {\n        return this;\n      }\n      element[NAMESPACE] = undefined;\n      if (this.isImg && this.replaced) {\n        element.src = this.originalUrl;\n      }\n      this.uncreate();\n      return this;\n    },\n    /**\n     * Move the canvas with relative offsets\n     * @param {number} offsetX - The relative offset distance on the x-axis.\n     * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.\n     * @returns {Cropper} this\n     */\n    move: function move(offsetX) {\n      var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;\n      var _this$canvasData = this.canvasData,\n        left = _this$canvasData.left,\n        top = _this$canvasData.top;\n      return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));\n    },\n    /**\n     * Move the canvas to an absolute point\n     * @param {number} x - The x-axis coordinate.\n     * @param {number} [y=x] - The y-axis coordinate.\n     * @returns {Cropper} this\n     */\n    moveTo: function moveTo(x) {\n      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;\n      var canvasData = this.canvasData;\n      var changed = false;\n      x = Number(x);\n      y = Number(y);\n      if (this.ready && !this.disabled && this.options.movable) {\n        if (isNumber(x)) {\n          canvasData.left = x;\n          changed = true;\n        }\n        if (isNumber(y)) {\n          canvasData.top = y;\n          changed = true;\n        }\n        if (changed) {\n          this.renderCanvas(true);\n        }\n      }\n      return this;\n    },\n    /**\n     * Zoom the canvas with a relative ratio\n     * @param {number} ratio - The target ratio.\n     * @param {Event} _originalEvent - The original event if any.\n     * @returns {Cropper} this\n     */\n    zoom: function zoom(ratio, _originalEvent) {\n      var canvasData = this.canvasData;\n      ratio = Number(ratio);\n      if (ratio < 0) {\n        ratio = 1 / (1 - ratio);\n      } else {\n        ratio = 1 + ratio;\n      }\n      return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);\n    },\n    /**\n     * Zoom the canvas to an absolute ratio\n     * @param {number} ratio - The target ratio.\n     * @param {Object} pivot - The zoom pivot point coordinate.\n     * @param {Event} _originalEvent - The original event if any.\n     * @returns {Cropper} this\n     */\n    zoomTo: function zoomTo(ratio, pivot, _originalEvent) {\n      var options = this.options,\n        canvasData = this.canvasData;\n      var width = canvasData.width,\n        height = canvasData.height,\n        naturalWidth = canvasData.naturalWidth,\n        naturalHeight = canvasData.naturalHeight;\n      ratio = Number(ratio);\n      if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {\n        var newWidth = naturalWidth * ratio;\n        var newHeight = naturalHeight * ratio;\n        if (dispatchEvent(this.element, EVENT_ZOOM, {\n          ratio: ratio,\n          oldRatio: width / naturalWidth,\n          originalEvent: _originalEvent\n        }) === false) {\n          return this;\n        }\n        if (_originalEvent) {\n          var pointers = this.pointers;\n          var offset = getOffset(this.cropper);\n          var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {\n            pageX: _originalEvent.pageX,\n            pageY: _originalEvent.pageY\n          };\n\n          // Zoom from the triggering point of the event\n          canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);\n          canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);\n        } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {\n          canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);\n          canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);\n        } else {\n          // Zoom from the center of the canvas\n          canvasData.left -= (newWidth - width) / 2;\n          canvasData.top -= (newHeight - height) / 2;\n        }\n        canvasData.width = newWidth;\n        canvasData.height = newHeight;\n        this.renderCanvas(true);\n      }\n      return this;\n    },\n    /**\n     * Rotate the canvas with a relative degree\n     * @param {number} degree - The rotate degree.\n     * @returns {Cropper} this\n     */\n    rotate: function rotate(degree) {\n      return this.rotateTo((this.imageData.rotate || 0) + Number(degree));\n    },\n    /**\n     * Rotate the canvas to an absolute degree\n     * @param {number} degree - The rotate degree.\n     * @returns {Cropper} this\n     */\n    rotateTo: function rotateTo(degree) {\n      degree = Number(degree);\n      if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {\n        this.imageData.rotate = degree % 360;\n        this.renderCanvas(true, true);\n      }\n      return this;\n    },\n    /**\n     * Scale the image on the x-axis.\n     * @param {number} scaleX - The scale ratio on the x-axis.\n     * @returns {Cropper} this\n     */\n    scaleX: function scaleX(_scaleX) {\n      var scaleY = this.imageData.scaleY;\n      return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);\n    },\n    /**\n     * Scale the image on the y-axis.\n     * @param {number} scaleY - The scale ratio on the y-axis.\n     * @returns {Cropper} this\n     */\n    scaleY: function scaleY(_scaleY) {\n      var scaleX = this.imageData.scaleX;\n      return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);\n    },\n    /**\n     * Scale the image\n     * @param {number} scaleX - The scale ratio on the x-axis.\n     * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.\n     * @returns {Cropper} this\n     */\n    scale: function scale(scaleX) {\n      var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;\n      var imageData = this.imageData;\n      var transformed = false;\n      scaleX = Number(scaleX);\n      scaleY = Number(scaleY);\n      if (this.ready && !this.disabled && this.options.scalable) {\n        if (isNumber(scaleX)) {\n          imageData.scaleX = scaleX;\n          transformed = true;\n        }\n        if (isNumber(scaleY)) {\n          imageData.scaleY = scaleY;\n          transformed = true;\n        }\n        if (transformed) {\n          this.renderCanvas(true, true);\n        }\n      }\n      return this;\n    },\n    /**\n     * Get the cropped area position and size data (base on the original image)\n     * @param {boolean} [rounded=false] - Indicate if round the data values or not.\n     * @returns {Object} The result cropped data.\n     */\n    getData: function getData() {\n      var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n      var options = this.options,\n        imageData = this.imageData,\n        canvasData = this.canvasData,\n        cropBoxData = this.cropBoxData;\n      var data;\n      if (this.ready && this.cropped) {\n        data = {\n          x: cropBoxData.left - canvasData.left,\n          y: cropBoxData.top - canvasData.top,\n          width: cropBoxData.width,\n          height: cropBoxData.height\n        };\n        var ratio = imageData.width / imageData.naturalWidth;\n        forEach(data, function (n, i) {\n          data[i] = n / ratio;\n        });\n        if (rounded) {\n          // In case rounding off leads to extra 1px in right or bottom border\n          // we should round the top-left corner and the dimension (#343).\n          var bottom = Math.round(data.y + data.height);\n          var right = Math.round(data.x + data.width);\n          data.x = Math.round(data.x);\n          data.y = Math.round(data.y);\n          data.width = right - data.x;\n          data.height = bottom - data.y;\n        }\n      } else {\n        data = {\n          x: 0,\n          y: 0,\n          width: 0,\n          height: 0\n        };\n      }\n      if (options.rotatable) {\n        data.rotate = imageData.rotate || 0;\n      }\n      if (options.scalable) {\n        data.scaleX = imageData.scaleX || 1;\n        data.scaleY = imageData.scaleY || 1;\n      }\n      return data;\n    },\n    /**\n     * Set the cropped area position and size with new data\n     * @param {Object} data - The new data.\n     * @returns {Cropper} this\n     */\n    setData: function setData(data) {\n      var options = this.options,\n        imageData = this.imageData,\n        canvasData = this.canvasData;\n      var cropBoxData = {};\n      if (this.ready && !this.disabled && isPlainObject(data)) {\n        var transformed = false;\n        if (options.rotatable) {\n          if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {\n            imageData.rotate = data.rotate;\n            transformed = true;\n          }\n        }\n        if (options.scalable) {\n          if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {\n            imageData.scaleX = data.scaleX;\n            transformed = true;\n          }\n          if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {\n            imageData.scaleY = data.scaleY;\n            transformed = true;\n          }\n        }\n        if (transformed) {\n          this.renderCanvas(true, true);\n        }\n        var ratio = imageData.width / imageData.naturalWidth;\n        if (isNumber(data.x)) {\n          cropBoxData.left = data.x * ratio + canvasData.left;\n        }\n        if (isNumber(data.y)) {\n          cropBoxData.top = data.y * ratio + canvasData.top;\n        }\n        if (isNumber(data.width)) {\n          cropBoxData.width = data.width * ratio;\n        }\n        if (isNumber(data.height)) {\n          cropBoxData.height = data.height * ratio;\n        }\n        this.setCropBoxData(cropBoxData);\n      }\n      return this;\n    },\n    /**\n     * Get the container size data.\n     * @returns {Object} The result container data.\n     */\n    getContainerData: function getContainerData() {\n      return this.ready ? assign({}, this.containerData) : {};\n    },\n    /**\n     * Get the image position and size data.\n     * @returns {Object} The result image data.\n     */\n    getImageData: function getImageData() {\n      return this.sized ? assign({}, this.imageData) : {};\n    },\n    /**\n     * Get the canvas position and size data.\n     * @returns {Object} The result canvas data.\n     */\n    getCanvasData: function getCanvasData() {\n      var canvasData = this.canvasData;\n      var data = {};\n      if (this.ready) {\n        forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {\n          data[n] = canvasData[n];\n        });\n      }\n      return data;\n    },\n    /**\n     * Set the canvas position and size with new data.\n     * @param {Object} data - The new canvas data.\n     * @returns {Cropper} this\n     */\n    setCanvasData: function setCanvasData(data) {\n      var canvasData = this.canvasData;\n      var aspectRatio = canvasData.aspectRatio;\n      if (this.ready && !this.disabled && isPlainObject(data)) {\n        if (isNumber(data.left)) {\n          canvasData.left = data.left;\n        }\n        if (isNumber(data.top)) {\n          canvasData.top = data.top;\n        }\n        if (isNumber(data.width)) {\n          canvasData.width = data.width;\n          canvasData.height = data.width / aspectRatio;\n        } else if (isNumber(data.height)) {\n          canvasData.height = data.height;\n          canvasData.width = data.height * aspectRatio;\n        }\n        this.renderCanvas(true);\n      }\n      return this;\n    },\n    /**\n     * Get the crop box position and size data.\n     * @returns {Object} The result crop box data.\n     */\n    getCropBoxData: function getCropBoxData() {\n      var cropBoxData = this.cropBoxData;\n      var data;\n      if (this.ready && this.cropped) {\n        data = {\n          left: cropBoxData.left,\n          top: cropBoxData.top,\n          width: cropBoxData.width,\n          height: cropBoxData.height\n        };\n      }\n      return data || {};\n    },\n    /**\n     * Set the crop box position and size with new data.\n     * @param {Object} data - The new crop box data.\n     * @returns {Cropper} this\n     */\n    setCropBoxData: function setCropBoxData(data) {\n      var cropBoxData = this.cropBoxData;\n      var aspectRatio = this.options.aspectRatio;\n      var widthChanged;\n      var heightChanged;\n      if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {\n        if (isNumber(data.left)) {\n          cropBoxData.left = data.left;\n        }\n        if (isNumber(data.top)) {\n          cropBoxData.top = data.top;\n        }\n        if (isNumber(data.width) && data.width !== cropBoxData.width) {\n          widthChanged = true;\n          cropBoxData.width = data.width;\n        }\n        if (isNumber(data.height) && data.height !== cropBoxData.height) {\n          heightChanged = true;\n          cropBoxData.height = data.height;\n        }\n        if (aspectRatio) {\n          if (widthChanged) {\n            cropBoxData.height = cropBoxData.width / aspectRatio;\n          } else if (heightChanged) {\n            cropBoxData.width = cropBoxData.height * aspectRatio;\n          }\n        }\n        this.renderCropBox();\n      }\n      return this;\n    },\n    /**\n     * Get a canvas drawn the cropped image.\n     * @param {Object} [options={}] - The config options.\n     * @returns {HTMLCanvasElement} - The result canvas.\n     */\n    getCroppedCanvas: function getCroppedCanvas() {\n      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      if (!this.ready || !window.HTMLCanvasElement) {\n        return null;\n      }\n      var canvasData = this.canvasData;\n      var source = getSourceCanvas(this.image, this.imageData, canvasData, options);\n\n      // Returns the source canvas if it is not cropped.\n      if (!this.cropped) {\n        return source;\n      }\n      var _this$getData = this.getData(options.rounded),\n        initialX = _this$getData.x,\n        initialY = _this$getData.y,\n        initialWidth = _this$getData.width,\n        initialHeight = _this$getData.height;\n      var ratio = source.width / Math.floor(canvasData.naturalWidth);\n      if (ratio !== 1) {\n        initialX *= ratio;\n        initialY *= ratio;\n        initialWidth *= ratio;\n        initialHeight *= ratio;\n      }\n      var aspectRatio = initialWidth / initialHeight;\n      var maxSizes = getAdjustedSizes({\n        aspectRatio: aspectRatio,\n        width: options.maxWidth || Infinity,\n        height: options.maxHeight || Infinity\n      });\n      var minSizes = getAdjustedSizes({\n        aspectRatio: aspectRatio,\n        width: options.minWidth || 0,\n        height: options.minHeight || 0\n      }, 'cover');\n      var _getAdjustedSizes = getAdjustedSizes({\n          aspectRatio: aspectRatio,\n          width: options.width || (ratio !== 1 ? source.width : initialWidth),\n          height: options.height || (ratio !== 1 ? source.height : initialHeight)\n        }),\n        width = _getAdjustedSizes.width,\n        height = _getAdjustedSizes.height;\n      width = Math.min(maxSizes.width, Math.max(minSizes.width, width));\n      height = Math.min(maxSizes.height, Math.max(minSizes.height, height));\n      var canvas = document.createElement('canvas');\n      var context = canvas.getContext('2d');\n      canvas.width = normalizeDecimalNumber(width);\n      canvas.height = normalizeDecimalNumber(height);\n      context.fillStyle = options.fillColor || 'transparent';\n      context.fillRect(0, 0, width, height);\n      var _options$imageSmoothi = options.imageSmoothingEnabled,\n        imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,\n        imageSmoothingQuality = options.imageSmoothingQuality;\n      context.imageSmoothingEnabled = imageSmoothingEnabled;\n      if (imageSmoothingQuality) {\n        context.imageSmoothingQuality = imageSmoothingQuality;\n      }\n\n      // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage\n      var sourceWidth = source.width;\n      var sourceHeight = source.height;\n\n      // Source canvas parameters\n      var srcX = initialX;\n      var srcY = initialY;\n      var srcWidth;\n      var srcHeight;\n\n      // Destination canvas parameters\n      var dstX;\n      var dstY;\n      var dstWidth;\n      var dstHeight;\n      if (srcX <= -initialWidth || srcX > sourceWidth) {\n        srcX = 0;\n        srcWidth = 0;\n        dstX = 0;\n        dstWidth = 0;\n      } else if (srcX <= 0) {\n        dstX = -srcX;\n        srcX = 0;\n        srcWidth = Math.min(sourceWidth, initialWidth + srcX);\n        dstWidth = srcWidth;\n      } else if (srcX <= sourceWidth) {\n        dstX = 0;\n        srcWidth = Math.min(initialWidth, sourceWidth - srcX);\n        dstWidth = srcWidth;\n      }\n      if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {\n        srcY = 0;\n        srcHeight = 0;\n        dstY = 0;\n        dstHeight = 0;\n      } else if (srcY <= 0) {\n        dstY = -srcY;\n        srcY = 0;\n        srcHeight = Math.min(sourceHeight, initialHeight + srcY);\n        dstHeight = srcHeight;\n      } else if (srcY <= sourceHeight) {\n        dstY = 0;\n        srcHeight = Math.min(initialHeight, sourceHeight - srcY);\n        dstHeight = srcHeight;\n      }\n      var params = [srcX, srcY, srcWidth, srcHeight];\n\n      // Avoid \"IndexSizeError\"\n      if (dstWidth > 0 && dstHeight > 0) {\n        var scale = width / initialWidth;\n        params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);\n      }\n\n      // All the numerical parameters should be integer for `drawImage`\n      // https://github.com/fengyuanchen/cropper/issues/476\n      context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {\n        return Math.floor(normalizeDecimalNumber(param));\n      }))));\n      return canvas;\n    },\n    /**\n     * Change the aspect ratio of the crop box.\n     * @param {number} aspectRatio - The new aspect ratio.\n     * @returns {Cropper} this\n     */\n    setAspectRatio: function setAspectRatio(aspectRatio) {\n      var options = this.options;\n      if (!this.disabled && !isUndefined(aspectRatio)) {\n        // 0 -> NaN\n        options.aspectRatio = Math.max(0, aspectRatio) || NaN;\n        if (this.ready) {\n          this.initCropBox();\n          if (this.cropped) {\n            this.renderCropBox();\n          }\n        }\n      }\n      return this;\n    },\n    /**\n     * Change the drag mode.\n     * @param {string} mode - The new drag mode.\n     * @returns {Cropper} this\n     */\n    setDragMode: function setDragMode(mode) {\n      var options = this.options,\n        dragBox = this.dragBox,\n        face = this.face;\n      if (this.ready && !this.disabled) {\n        var croppable = mode === DRAG_MODE_CROP;\n        var movable = options.movable && mode === DRAG_MODE_MOVE;\n        mode = croppable || movable ? mode : DRAG_MODE_NONE;\n        options.dragMode = mode;\n        setData(dragBox, DATA_ACTION, mode);\n        toggleClass(dragBox, CLASS_CROP, croppable);\n        toggleClass(dragBox, CLASS_MOVE, movable);\n        if (!options.cropBoxMovable) {\n          // Sync drag mode to crop box when it is not movable\n          setData(face, DATA_ACTION, mode);\n          toggleClass(face, CLASS_CROP, croppable);\n          toggleClass(face, CLASS_MOVE, movable);\n        }\n      }\n      return this;\n    }\n  };\n\n  var AnotherCropper = WINDOW.Cropper;\n  var Cropper = /*#__PURE__*/function () {\n    /**\n     * Create a new Cropper.\n     * @param {Element} element - The target element for cropping.\n     * @param {Object} [options={}] - The configuration options.\n     */\n    function Cropper(element) {\n      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n      _classCallCheck(this, Cropper);\n      if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {\n        throw new Error('The first argument is required and must be an <img> or <canvas> element.');\n      }\n      this.element = element;\n      this.options = assign({}, DEFAULTS, isPlainObject(options) && options);\n      this.cropped = false;\n      this.disabled = false;\n      this.pointers = {};\n      this.ready = false;\n      this.reloading = false;\n      this.replaced = false;\n      this.sized = false;\n      this.sizing = false;\n      this.init();\n    }\n    _createClass(Cropper, [{\n      key: \"init\",\n      value: function init() {\n        var element = this.element;\n        var tagName = element.tagName.toLowerCase();\n        var url;\n        if (element[NAMESPACE]) {\n          return;\n        }\n        element[NAMESPACE] = this;\n        if (tagName === 'img') {\n          this.isImg = true;\n\n          // e.g.: \"img/picture.jpg\"\n          url = element.getAttribute('src') || '';\n          this.originalUrl = url;\n\n          // Stop when it's a blank image\n          if (!url) {\n            return;\n          }\n\n          // e.g.: \"https://example.com/img/picture.jpg\"\n          url = element.src;\n        } else if (tagName === 'canvas' && window.HTMLCanvasElement) {\n          url = element.toDataURL();\n        }\n        this.load(url);\n      }\n    }, {\n      key: \"load\",\n      value: function load(url) {\n        var _this = this;\n        if (!url) {\n          return;\n        }\n        this.url = url;\n        this.imageData = {};\n        var element = this.element,\n          options = this.options;\n        if (!options.rotatable && !options.scalable) {\n          options.checkOrientation = false;\n        }\n\n        // Only IE10+ supports Typed Arrays\n        if (!options.checkOrientation || !window.ArrayBuffer) {\n          this.clone();\n          return;\n        }\n\n        // Detect the mime type of the image directly if it is a Data URL\n        if (REGEXP_DATA_URL.test(url)) {\n          // Read ArrayBuffer from Data URL of JPEG images directly for better performance\n          if (REGEXP_DATA_URL_JPEG.test(url)) {\n            this.read(dataURLToArrayBuffer(url));\n          } else {\n            // Only a JPEG image may contains Exif Orientation information,\n            // the rest types of Data URLs are not necessary to check orientation at all.\n            this.clone();\n          }\n          return;\n        }\n\n        // 1. Detect the mime type of the image by a XMLHttpRequest.\n        // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.\n        var xhr = new XMLHttpRequest();\n        var clone = this.clone.bind(this);\n        this.reloading = true;\n        this.xhr = xhr;\n\n        // 1. Cross origin requests are only supported for protocol schemes:\n        // http, https, data, chrome, chrome-extension.\n        // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy\n        // in some browsers as IE11 and Safari.\n        xhr.onabort = clone;\n        xhr.onerror = clone;\n        xhr.ontimeout = clone;\n        xhr.onprogress = function () {\n          // Abort the request directly if it not a JPEG image for better performance\n          if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {\n            xhr.abort();\n          }\n        };\n        xhr.onload = function () {\n          _this.read(xhr.response);\n        };\n        xhr.onloadend = function () {\n          _this.reloading = false;\n          _this.xhr = null;\n        };\n\n        // Bust cache when there is a \"crossOrigin\" property to avoid browser cache error\n        if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {\n          url = addTimestamp(url);\n        }\n\n        // The third parameter is required for avoiding side-effect (#682)\n        xhr.open('GET', url, true);\n        xhr.responseType = 'arraybuffer';\n        xhr.withCredentials = element.crossOrigin === 'use-credentials';\n        xhr.send();\n      }\n    }, {\n      key: \"read\",\n      value: function read(arrayBuffer) {\n        var options = this.options,\n          imageData = this.imageData;\n\n        // Reset the orientation value to its default value 1\n        // as some iOS browsers will render image with its orientation\n        var orientation = resetAndGetOrientation(arrayBuffer);\n        var rotate = 0;\n        var scaleX = 1;\n        var scaleY = 1;\n        if (orientation > 1) {\n          // Generate a new URL which has the default orientation value\n          this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);\n          var _parseOrientation = parseOrientation(orientation);\n          rotate = _parseOrientation.rotate;\n          scaleX = _parseOrientation.scaleX;\n          scaleY = _parseOrientation.scaleY;\n        }\n        if (options.rotatable) {\n          imageData.rotate = rotate;\n        }\n        if (options.scalable) {\n          imageData.scaleX = scaleX;\n          imageData.scaleY = scaleY;\n        }\n        this.clone();\n      }\n    }, {\n      key: \"clone\",\n      value: function clone() {\n        var element = this.element,\n          url = this.url;\n        var crossOrigin = element.crossOrigin;\n        var crossOriginUrl = url;\n        if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {\n          if (!crossOrigin) {\n            crossOrigin = 'anonymous';\n          }\n\n          // Bust cache when there is not a \"crossOrigin\" property (#519)\n          crossOriginUrl = addTimestamp(url);\n        }\n        this.crossOrigin = crossOrigin;\n        this.crossOriginUrl = crossOriginUrl;\n        var image = document.createElement('img');\n        if (crossOrigin) {\n          image.crossOrigin = crossOrigin;\n        }\n        image.src = crossOriginUrl || url;\n        image.alt = element.alt || 'The image to crop';\n        this.image = image;\n        image.onload = this.start.bind(this);\n        image.onerror = this.stop.bind(this);\n        addClass(image, CLASS_HIDE);\n        element.parentNode.insertBefore(image, element.nextSibling);\n      }\n    }, {\n      key: \"start\",\n      value: function start() {\n        var _this2 = this;\n        var image = this.image;\n        image.onload = null;\n        image.onerror = null;\n        this.sizing = true;\n\n        // Match all browsers that use WebKit as the layout engine in iOS devices,\n        // such as Safari for iOS, Chrome for iOS, and in-app browsers.\n        var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);\n        var done = function done(naturalWidth, naturalHeight) {\n          assign(_this2.imageData, {\n            naturalWidth: naturalWidth,\n            naturalHeight: naturalHeight,\n            aspectRatio: naturalWidth / naturalHeight\n          });\n          _this2.initialImageData = assign({}, _this2.imageData);\n          _this2.sizing = false;\n          _this2.sized = true;\n          _this2.build();\n        };\n\n        // Most modern browsers (excepts iOS WebKit)\n        if (image.naturalWidth && !isIOSWebKit) {\n          done(image.naturalWidth, image.naturalHeight);\n          return;\n        }\n        var sizingImage = document.createElement('img');\n        var body = document.body || document.documentElement;\n        this.sizingImage = sizingImage;\n        sizingImage.onload = function () {\n          done(sizingImage.width, sizingImage.height);\n          if (!isIOSWebKit) {\n            body.removeChild(sizingImage);\n          }\n        };\n        sizingImage.src = image.src;\n\n        // iOS WebKit will convert the image automatically\n        // with its orientation once append it into DOM (#279)\n        if (!isIOSWebKit) {\n          sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';\n          body.appendChild(sizingImage);\n        }\n      }\n    }, {\n      key: \"stop\",\n      value: function stop() {\n        var image = this.image;\n        image.onload = null;\n        image.onerror = null;\n        image.parentNode.removeChild(image);\n        this.image = null;\n      }\n    }, {\n      key: \"build\",\n      value: function build() {\n        if (!this.sized || this.ready) {\n          return;\n        }\n        var element = this.element,\n          options = this.options,\n          image = this.image;\n\n        // Create cropper elements\n        var container = element.parentNode;\n        var template = document.createElement('div');\n        template.innerHTML = TEMPLATE;\n        var cropper = template.querySelector(\".\".concat(NAMESPACE, \"-container\"));\n        var canvas = cropper.querySelector(\".\".concat(NAMESPACE, \"-canvas\"));\n        var dragBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-drag-box\"));\n        var cropBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-crop-box\"));\n        var face = cropBox.querySelector(\".\".concat(NAMESPACE, \"-face\"));\n        this.container = container;\n        this.cropper = cropper;\n        this.canvas = canvas;\n        this.dragBox = dragBox;\n        this.cropBox = cropBox;\n        this.viewBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-view-box\"));\n        this.face = face;\n        canvas.appendChild(image);\n\n        // Hide the original image\n        addClass(element, CLASS_HIDDEN);\n\n        // Inserts the cropper after to the current image\n        container.insertBefore(cropper, element.nextSibling);\n\n        // Show the hidden image\n        removeClass(image, CLASS_HIDE);\n        this.initPreview();\n        this.bind();\n        options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;\n        options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;\n        options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;\n        addClass(cropBox, CLASS_HIDDEN);\n        if (!options.guides) {\n          addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-dashed\")), CLASS_HIDDEN);\n        }\n        if (!options.center) {\n          addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-center\")), CLASS_HIDDEN);\n        }\n        if (options.background) {\n          addClass(cropper, \"\".concat(NAMESPACE, \"-bg\"));\n        }\n        if (!options.highlight) {\n          addClass(face, CLASS_INVISIBLE);\n        }\n        if (options.cropBoxMovable) {\n          addClass(face, CLASS_MOVE);\n          setData(face, DATA_ACTION, ACTION_ALL);\n        }\n        if (!options.cropBoxResizable) {\n          addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-line\")), CLASS_HIDDEN);\n          addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-point\")), CLASS_HIDDEN);\n        }\n        this.render();\n        this.ready = true;\n        this.setDragMode(options.dragMode);\n        if (options.autoCrop) {\n          this.crop();\n        }\n        this.setData(options.data);\n        if (isFunction(options.ready)) {\n          addListener(element, EVENT_READY, options.ready, {\n            once: true\n          });\n        }\n        dispatchEvent(element, EVENT_READY);\n      }\n    }, {\n      key: \"unbuild\",\n      value: function unbuild() {\n        if (!this.ready) {\n          return;\n        }\n        this.ready = false;\n        this.unbind();\n        this.resetPreview();\n        var parentNode = this.cropper.parentNode;\n        if (parentNode) {\n          parentNode.removeChild(this.cropper);\n        }\n        removeClass(this.element, CLASS_HIDDEN);\n      }\n    }, {\n      key: \"uncreate\",\n      value: function uncreate() {\n        if (this.ready) {\n          this.unbuild();\n          this.ready = false;\n          this.cropped = false;\n        } else if (this.sizing) {\n          this.sizingImage.onload = null;\n          this.sizing = false;\n          this.sized = false;\n        } else if (this.reloading) {\n          this.xhr.onabort = null;\n          this.xhr.abort();\n        } else if (this.image) {\n          this.stop();\n        }\n      }\n\n      /**\n       * Get the no conflict cropper class.\n       * @returns {Cropper} The cropper class.\n       */\n    }], [{\n      key: \"noConflict\",\n      value: function noConflict() {\n        window.Cropper = AnotherCropper;\n        return Cropper;\n      }\n\n      /**\n       * Change the default options.\n       * @param {Object} options - The new default options.\n       */\n    }, {\n      key: \"setDefaults\",\n      value: function setDefaults(options) {\n        assign(DEFAULTS, isPlainObject(options) && options);\n      }\n    }]);\n    return Cropper;\n  }();\n  assign(Cropper.prototype, render, preview, events, handlers, change, methods);\n\n  return Cropper;\n\n}));\n", "'use strict';\n\nvar alphabet;\nvar alphabetIndexMap;\nvar alphabetIndexMapLength = 0;\n\nfunction isNumberCode(code) {\n  return code >= 48 && code <= 57;\n}\n\nfunction naturalCompare(a, b) {\n  var lengthA = (a += '').length;\n  var lengthB = (b += '').length;\n  var aIndex = 0;\n  var bIndex = 0;\n\n  while (aIndex < lengthA && bIndex < lengthB) {\n    var charCodeA = a.charCodeAt(aIndex);\n    var charCodeB = b.charCodeAt(bIndex);\n\n    if (isNumberCode(charCodeA)) {\n      if (!isNumberCode(charCodeB)) {\n        return charCodeA - charCodeB;\n      }\n\n      var numStartA = aIndex;\n      var numStartB = bIndex;\n\n      while (charCodeA === 48 && ++numStartA < lengthA) {\n        charCodeA = a.charCodeAt(numStartA);\n      }\n      while (charCodeB === 48 && ++numStartB < lengthB) {\n        charCodeB = b.charCodeAt(numStartB);\n      }\n\n      var numEndA = numStartA;\n      var numEndB = numStartB;\n\n      while (numEndA < lengthA && isNumberCode(a.charCodeAt(numEndA))) {\n        ++numEndA;\n      }\n      while (numEndB < lengthB && isNumberCode(b.charCodeAt(numEndB))) {\n        ++numEndB;\n      }\n\n      var difference = numEndA - numStartA - numEndB + numStartB; // numA length - numB length\n      if (difference) {\n        return difference;\n      }\n\n      while (numStartA < numEndA) {\n        difference = a.charCodeAt(numStartA++) - b.charCodeAt(numStartB++);\n        if (difference) {\n          return difference;\n        }\n      }\n\n      aIndex = numEndA;\n      bIndex = numEndB;\n      continue;\n    }\n\n    if (charCodeA !== charCodeB) {\n      if (\n        charCodeA < alphabetIndexMapLength &&\n        charCodeB < alphabetIndexMapLength &&\n        alphabetIndexMap[charCodeA] !== -1 &&\n        alphabetIndexMap[charCodeB] !== -1\n      ) {\n        return alphabetIndexMap[charCodeA] - alphabetIndexMap[charCodeB];\n      }\n\n      return charCodeA - charCodeB;\n    }\n\n    ++aIndex;\n    ++bIndex;\n  }\n\n  if (aIndex >= lengthA && bIndex < lengthB && lengthA >= lengthB) {\n    return -1;\n  }\n\n  if (bIndex >= lengthB && aIndex < lengthA && lengthB >= lengthA) {\n    return 1;\n  }\n\n  return lengthA - lengthB;\n}\n\nnaturalCompare.caseInsensitive = naturalCompare.i = function(a, b) {\n  return naturalCompare(('' + a).toLowerCase(), ('' + b).toLowerCase());\n};\n\nObject.defineProperties(naturalCompare, {\n  alphabet: {\n    get: function() {\n      return alphabet;\n    },\n\n    set: function(value) {\n      alphabet = value;\n      alphabetIndexMap = [];\n\n      var i = 0;\n\n      if (alphabet) {\n        for (; i < alphabet.length; i++) {\n          alphabetIndexMap[alphabet.charCodeAt(i)] = i;\n        }\n      }\n\n      alphabetIndexMapLength = alphabetIndexMap.length;\n\n      for (i = 0; i < alphabetIndexMapLength; i++) {\n        if (alphabetIndexMap[i] === undefined) {\n          alphabetIndexMap[i] = -1;\n        }\n      }\n    },\n  },\n});\n\nmodule.exports = naturalCompare;\n", "/**\n * A cross-browser implementation of getElementsByClass.\n * Heavily based on Dustin Diaz's function: http://dustindiaz.com/getelementsbyclass.\n *\n * Find all elements with class `className` inside `container`.\n * Use `single = true` to increase performance in older browsers\n * when only one element is needed.\n *\n * @param {String} className\n * @param {Element} container\n * @param {Boolean} single\n * @api public\n */\n\nvar getElementsByClassName = function (container, className, single) {\n  if (single) {\n    return container.getElementsByClassName(className)[0]\n  } else {\n    return container.getElementsByClassName(className)\n  }\n}\n\nvar querySelector = function (container, className, single) {\n  className = '.' + className\n  if (single) {\n    return container.querySelector(className)\n  } else {\n    return container.querySelectorAll(className)\n  }\n}\n\nvar polyfill = function (container, className, single) {\n  var classElements = [],\n    tag = '*'\n\n  var els = container.getElementsByTagName(tag)\n  var elsLen = els.length\n  var pattern = new RegExp('(^|\\\\s)' + className + '(\\\\s|$)')\n  for (var i = 0, j = 0; i < elsLen; i++) {\n    if (pattern.test(els[i].className)) {\n      if (single) {\n        return els[i]\n      } else {\n        classElements[j] = els[i]\n        j++\n      }\n    }\n  }\n  return classElements\n}\n\nmodule.exports = (function () {\n  return function (container, className, single, options) {\n    options = options || {}\n    if ((options.test && options.getElementsByClassName) || (!options.test && document.getElementsByClassName)) {\n      return getElementsByClassName(container, className, single)\n    } else if ((options.test && options.querySelector) || (!options.test && document.querySelector)) {\n      return querySelector(container, className, single)\n    } else {\n      return polyfill(container, className, single)\n    }\n  }\n})()\n", "/*\n * Source: https://github.com/segmentio/extend\n */\n\nmodule.exports = function extend(object) {\n  // Takes an unlimited number of extenders.\n  var args = Array.prototype.slice.call(arguments, 1)\n\n  // For each extender, copy their properties on our object.\n  for (var i = 0, source; (source = args[i]); i++) {\n    if (!source) continue\n    for (var property in source) {\n      object[property] = source[property]\n    }\n  }\n\n  return object\n}\n", "var indexOf = [].indexOf\n\nmodule.exports = function(arr, obj){\n  if (indexOf) return arr.indexOf(obj);\n  for (var i = 0, il = arr.length; i < il; ++i) {\n    if (arr[i] === obj) return i;\n  }\n  return -1\n}\n", "/**\n * Source: https://github.com/timoxley/to-array\n *\n * Convert an array-like object into an `Array`.\n * If `collection` is already an `Array`, then will return a clone of `collection`.\n *\n * @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`\n * @return {Array} Naive conversion of `collection` to a new `Array`.\n * @api public\n */\n\nmodule.exports = function toArray(collection) {\n  if (typeof collection === 'undefined') return []\n  if (collection === null) return [null]\n  if (collection === window) return [window]\n  if (typeof collection === 'string') return [collection]\n  if (isArray(collection)) return collection\n  if (typeof collection.length != 'number') return [collection]\n  if (typeof collection === 'function' && collection instanceof Function) return [collection]\n\n  var arr = [];\n  for (var i = 0, il = collection.length; i < il; i++) {\n    if (Object.prototype.hasOwnProperty.call(collection, i) || i in collection) {\n      arr.push(collection[i])\n    }\n  }\n  if (!arr.length) return []\n  return arr\n}\n\nfunction isArray(arr) {\n  return Object.prototype.toString.call(arr) === '[object Array]'\n}\n", "var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n  unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n  prefix = bind !== 'addEventListener' ? 'on' : '',\n  toArray = require('./to-array')\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el, NodeList, HTMLCollection or Array\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.bind = function (el, type, fn, capture) {\n  el = toArray(el)\n  for (var i = 0, il = el.length; i < il; i++) {\n    el[i][bind](prefix + type, fn, capture || false)\n  }\n}\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el, NodeList, HTMLCollection or Array\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function (el, type, fn, capture) {\n  el = toArray(el)\n  for (var i = 0, il = el.length; i < il; i++) {\n    el[i][unbind](prefix + type, fn, capture || false)\n  }\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * `wait` milliseconds. If `immediate` is true, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {Function} fn\n * @param {Integer} wait\n * @param {Boolean} immediate\n * @api public\n */\n\nexports.debounce = function (fn, wait, immediate) {\n  var timeout\n  return wait\n    ? function () {\n        var context = this,\n          args = arguments\n        var later = function () {\n          timeout = null\n          if (!immediate) fn.apply(context, args)\n        }\n        var callNow = immediate && !timeout\n        clearTimeout(timeout)\n        timeout = setTimeout(later, wait)\n        if (callNow) fn.apply(context, args)\n      }\n    : fn\n}\n", "module.exports = function (s) {\n  s = s === undefined ? '' : s\n  s = s === null ? '' : s\n  s = s.toString()\n  return s\n}\n", "/**\n * Module dependencies.\n */\n\nvar index = require('./index-of')\n\n/**\n * Whitespace regexp.\n */\n\nvar re = /\\s+/\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function (el) {\n  return new ClassList(el)\n}\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n  if (!el || !el.nodeType) {\n    throw new Error('A DOM element reference is required')\n  }\n  this.el = el\n  this.list = el.classList\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function (name) {\n  // classList\n  if (this.list) {\n    this.list.add(name)\n    return this\n  }\n\n  // fallback\n  var arr = this.array()\n  var i = index(arr, name)\n  if (!~i) arr.push(name)\n  this.el.className = arr.join(' ')\n  return this\n}\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function (name) {\n  // classList\n  if (this.list) {\n    this.list.remove(name)\n    return this\n  }\n\n  // fallback\n  var arr = this.array()\n  var i = index(arr, name)\n  if (~i) arr.splice(i, 1)\n  this.el.className = arr.join(' ')\n  return this\n}\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function (name, force) {\n  // classList\n  if (this.list) {\n    if ('undefined' !== typeof force) {\n      if (force !== this.list.toggle(name, force)) {\n        this.list.toggle(name) // toggle again to correct\n      }\n    } else {\n      this.list.toggle(name)\n    }\n    return this\n  }\n\n  // fallback\n  if ('undefined' !== typeof force) {\n    if (!force) {\n      this.remove(name)\n    } else {\n      this.add(name)\n    }\n  } else {\n    if (this.has(name)) {\n      this.remove(name)\n    } else {\n      this.add(name)\n    }\n  }\n\n  return this\n}\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function () {\n  var className = this.el.getAttribute('class') || ''\n  var str = className.replace(/^\\s+|\\s+$/g, '')\n  var arr = str.split(re)\n  if ('' === arr[0]) arr.shift()\n  return arr\n}\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has = ClassList.prototype.contains = function (name) {\n  return this.list ? this.list.contains(name) : !!~index(this.array(), name)\n}\n", "/**\n * A cross-browser implementation of getAttribute.\n * Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath\n *\n * Return the value for `attr` at `element`.\n *\n * @param {Element} el\n * @param {String} attr\n * @api public\n */\n\nmodule.exports = function (el, attr) {\n  var result = (el.getAttribute && el.getAttribute(attr)) || null\n  if (!result) {\n    var attrs = el.attributes\n    var length = attrs.length\n    for (var i = 0; i < length; i++) {\n      if (attrs[i] !== undefined) {\n        if (attrs[i].nodeName === attr) {\n          result = attrs[i].nodeValue\n        }\n      }\n    }\n  }\n  return result\n}\n", "module.exports = function (list) {\n  return function (initValues, element, notCreate) {\n    var item = this\n\n    this._values = {}\n\n    this.found = false // Show if list.searched == true and this.found == true\n    this.filtered = false // Show if list.filtered == true and this.filtered == true\n\n    var init = function (initValues, element, notCreate) {\n      if (element === undefined) {\n        if (notCreate) {\n          item.values(initValues, notCreate)\n        } else {\n          item.values(initValues)\n        }\n      } else {\n        item.elm = element\n        var values = list.templater.get(item, initValues)\n        item.values(values)\n      }\n    }\n\n    this.values = function (newValues, notCreate) {\n      if (newValues !== undefined) {\n        for (var name in newValues) {\n          item._values[name] = newValues[name]\n        }\n        if (notCreate !== true) {\n          list.templater.set(item, item.values())\n        }\n      } else {\n        return item._values\n      }\n    }\n\n    this.show = function () {\n      list.templater.show(item)\n    }\n\n    this.hide = function () {\n      list.templater.hide(item)\n    }\n\n    this.matching = function () {\n      return (\n        (list.filtered && list.searched && item.found && item.filtered) ||\n        (list.filtered && !list.searched && item.filtered) ||\n        (!list.filtered && list.searched && item.found) ||\n        (!list.filtered && !list.searched)\n      )\n    }\n\n    this.visible = function () {\n      return item.elm && item.elm.parentNode == list.list ? true : false\n    }\n\n    init(initValues, element, notCreate)\n  }\n}\n", "module.exports = function (list) {\n  var addAsync = function (values, callback, items) {\n    var valuesToAdd = values.splice(0, 50)\n    items = items || []\n    items = items.concat(list.add(valuesToAdd))\n    if (values.length > 0) {\n      setTimeout(function () {\n        addAsync(values, callback, items)\n      }, 1)\n    } else {\n      list.update()\n      callback(items)\n    }\n  }\n  return addAsync\n}\n", "var classes = require('./utils/classes'),\n  events = require('./utils/events'),\n  List = require('./index')\n\nmodule.exports = function (list) {\n  var isHidden = false\n\n  var refresh = function (pagingList, options) {\n    if (list.page < 1) {\n      list.listContainer.style.display = 'none'\n      isHidden = true\n      return\n    } else if (isHidden) {\n      list.listContainer.style.display = 'block'\n    }\n\n    var item,\n      l = list.matchingItems.length,\n      index = list.i,\n      page = list.page,\n      pages = Math.ceil(l / page),\n      currentPage = Math.ceil(index / page),\n      innerWindow = options.innerWindow || 2,\n      left = options.left || options.outerWindow || 0,\n      right = options.right || options.outerWindow || 0,\n      includeDirectionLinks = options.includeDirectionLinks || false,\n      leftDirectionText = options.leftDirectionText || '&laquo;',\n      rightDirectionText = options.rightDirectionText || '&raquo;';\n\n    right = pages - right\n    pagingList.clear()\n    if (includeDirectionLinks) {\n      // Include previous link\n      item = pagingList.add({\n          page: leftDirectionText,\n          dotted: false\n      })[0];\n      classes(item.elm).add(\"prev\");\n      if (currentPage - 1 > 0) {\n        item.elm.firstChild.setAttribute('data-i', currentPage - 1)\n        item.elm.firstChild.setAttribute('data-page', page)\n      } else {\n        classes(item.elm).add(\"disabled\");\n      }\n    }\n    for (var i = 1; i <= pages; i++) {\n      var className = currentPage === i ? 'active' : ''\n\n      //console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className);\n\n      if (is.number(i, left, right, currentPage, innerWindow)) {\n        item = pagingList.add({\n          page: i,\n          dotted: false,\n        })[0]\n        if (className) {\n          classes(item.elm).add(className)\n        }\n        item.elm.firstChild.setAttribute('data-i', i)\n        item.elm.firstChild.setAttribute('data-page', page)\n      } else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) {\n        item = pagingList.add({\n          page: '...',\n          dotted: true,\n        })[0]\n        classes(item.elm).add('disabled')\n      }\n    }\n    if (includeDirectionLinks) {\n      // Include next link\n      item = pagingList.add({\n          page: rightDirectionText,\n          dotted: false\n      })[0];\n      classes(item.elm).add(\"next\");\n      if (currentPage + 1 <= pages) {\n        item.elm.firstChild.setAttribute('data-i', currentPage + 1)\n        item.elm.firstChild.setAttribute('data-page', page)\n      } else {\n        classes(item.elm).add(\"disabled\");\n      }\n    }\n  }\n\n  var is = {\n    number: function (i, left, right, currentPage, innerWindow) {\n      return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow)\n    },\n    left: function (i, left) {\n      return i <= left\n    },\n    right: function (i, right) {\n      return i > right\n    },\n    innerWindow: function (i, currentPage, innerWindow) {\n      return i >= currentPage - innerWindow && i <= currentPage + innerWindow\n    },\n    dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {\n      return (\n        this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) ||\n        this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem)\n      )\n    },\n    dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) {\n      return i == left + 1 && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)\n    },\n    dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {\n      if (pagingList.items[currentPageItem - 1].values().dotted) {\n        return false\n      } else {\n        return i == right && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)\n      }\n    },\n  }\n\n  return function (options) {\n    var pagingList = new List(list.listContainer.id, {\n      listClass: options.paginationClass || 'pagination',\n      item: options.item || \"<li><a class='page' href='#'></a></li>\",\n      valueNames: ['page', 'dotted'],\n      searchClass: 'pagination-search-that-is-not-supposed-to-exist',\n      sortClass: 'pagination-sort-that-is-not-supposed-to-exist',\n    })\n\n    events.bind(pagingList.listContainer, 'click', function (e) {\n      var target = e.target || e.srcElement,\n        page = list.utils.getAttribute(target, 'data-page'),\n        i = list.utils.getAttribute(target, 'data-i')\n      if (i) {\n        list.show((i - 1) * page + 1, page)\n      }\n    })\n\n    list.on('updated', function () {\n      refresh(pagingList, options)\n    })\n    refresh(pagingList, options)\n  }\n}\n", "module.exports = function (list) {\n  var Item = require('./item')(list)\n\n  var getChildren = function (parent) {\n    var nodes = parent.childNodes,\n      items = []\n    for (var i = 0, il = nodes.length; i < il; i++) {\n      // Only textnodes have a data attribute\n      if (nodes[i].data === undefined) {\n        items.push(nodes[i])\n      }\n    }\n    return items\n  }\n\n  var parse = function (itemElements, valueNames) {\n    for (var i = 0, il = itemElements.length; i < il; i++) {\n      list.items.push(new Item(valueNames, itemElements[i]))\n    }\n  }\n  var parseAsync = function (itemElements, valueNames) {\n    var itemsToIndex = itemElements.splice(0, 50) // TODO: If < 100 items, what happens in IE etc?\n    parse(itemsToIndex, valueNames)\n    if (itemElements.length > 0) {\n      setTimeout(function () {\n        parseAsync(itemElements, valueNames)\n      }, 1)\n    } else {\n      list.update()\n      list.trigger('parseComplete')\n    }\n  }\n\n  list.handlers.parseComplete = list.handlers.parseComplete || []\n\n  return function () {\n    var itemsToIndex = getChildren(list.list),\n      valueNames = list.valueNames\n\n    if (list.indexAsync) {\n      parseAsync(itemsToIndex, valueNames)\n    } else {\n      parse(itemsToIndex, valueNames)\n    }\n  }\n}\n", "var Templater = function (list) {\n  var createItem,\n    templater = this\n\n  var init = function () {\n    var itemSource\n\n    if (typeof list.item === 'function') {\n      createItem = function (values) {\n        var item = list.item(values)\n        return getItemSource(item)\n      }\n      return\n    }\n\n    if (typeof list.item === 'string') {\n      if (list.item.indexOf('<') === -1) {\n        itemSource = document.getElementById(list.item)\n      } else {\n        itemSource = getItemSource(list.item)\n      }\n    } else {\n      /* If item source does not exists, use the first item in list as\n      source for new items */\n      itemSource = getFirstListItem()\n    }\n\n    if (!itemSource) {\n      throw new Error(\"The list needs to have at least one item on init otherwise you'll have to add a template.\")\n    }\n\n    itemSource = createCleanTemplateItem(itemSource, list.valueNames)\n\n    createItem = function () {\n      return itemSource.cloneNode(true)\n    }\n  }\n\n  var createCleanTemplateItem = function (templateNode, valueNames) {\n    var el = templateNode.cloneNode(true)\n    el.removeAttribute('id')\n\n    for (var i = 0, il = valueNames.length; i < il; i++) {\n      var elm = undefined,\n        valueName = valueNames[i]\n      if (valueName.data) {\n        for (var j = 0, jl = valueName.data.length; j < jl; j++) {\n          el.setAttribute('data-' + valueName.data[j], '')\n        }\n      } else if (valueName.attr && valueName.name) {\n        elm = list.utils.getByClass(el, valueName.name, true)\n        if (elm) {\n          elm.setAttribute(valueName.attr, '')\n        }\n      } else {\n        elm = list.utils.getByClass(el, valueName, true)\n        if (elm) {\n          elm.innerHTML = ''\n        }\n      }\n    }\n    return el\n  }\n\n  var getFirstListItem = function () {\n    var nodes = list.list.childNodes\n\n    for (var i = 0, il = nodes.length; i < il; i++) {\n      // Only textnodes have a data attribute\n      if (nodes[i].data === undefined) {\n        return nodes[i].cloneNode(true)\n      }\n    }\n    return undefined\n  }\n\n  var getItemSource = function (itemHTML) {\n    if (typeof itemHTML !== 'string') return undefined\n    if (/<tr[\\s>]/g.exec(itemHTML)) {\n      var tbody = document.createElement('tbody')\n      tbody.innerHTML = itemHTML\n      return tbody.firstElementChild\n    } else if (itemHTML.indexOf('<') !== -1) {\n      var div = document.createElement('div')\n      div.innerHTML = itemHTML\n      return div.firstElementChild\n    }\n    return undefined\n  }\n\n  var getValueName = function (name) {\n    for (var i = 0, il = list.valueNames.length; i < il; i++) {\n      var valueName = list.valueNames[i]\n      if (valueName.data) {\n        var data = valueName.data\n        for (var j = 0, jl = data.length; j < jl; j++) {\n          if (data[j] === name) {\n            return { data: name }\n          }\n        }\n      } else if (valueName.attr && valueName.name && valueName.name == name) {\n        return valueName\n      } else if (valueName === name) {\n        return name\n      }\n    }\n  }\n\n  var setValue = function (item, name, value) {\n    var elm = undefined,\n      valueName = getValueName(name)\n    if (!valueName) return\n    if (valueName.data) {\n      item.elm.setAttribute('data-' + valueName.data, value)\n    } else if (valueName.attr && valueName.name) {\n      elm = list.utils.getByClass(item.elm, valueName.name, true)\n      if (elm) {\n        elm.setAttribute(valueName.attr, value)\n      }\n    } else {\n      elm = list.utils.getByClass(item.elm, valueName, true)\n      if (elm) {\n        elm.innerHTML = value\n      }\n    }\n  }\n\n  this.get = function (item, valueNames) {\n    templater.create(item)\n    var values = {}\n    for (var i = 0, il = valueNames.length; i < il; i++) {\n      var elm = undefined,\n        valueName = valueNames[i]\n      if (valueName.data) {\n        for (var j = 0, jl = valueName.data.length; j < jl; j++) {\n          values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j])\n        }\n      } else if (valueName.attr && valueName.name) {\n        elm = list.utils.getByClass(item.elm, valueName.name, true)\n        values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : ''\n      } else {\n        elm = list.utils.getByClass(item.elm, valueName, true)\n        values[valueName] = elm ? elm.innerHTML : ''\n      }\n    }\n    return values\n  }\n\n  this.set = function (item, values) {\n    if (!templater.create(item)) {\n      for (var v in values) {\n        if (values.hasOwnProperty(v)) {\n          setValue(item, v, values[v])\n        }\n      }\n    }\n  }\n\n  this.create = function (item) {\n    if (item.elm !== undefined) {\n      return false\n    }\n    item.elm = createItem(item.values())\n    templater.set(item, item.values())\n    return true\n  }\n  this.remove = function (item) {\n    if (item.elm.parentNode === list.list) {\n      list.list.removeChild(item.elm)\n    }\n  }\n  this.show = function (item) {\n    templater.create(item)\n    list.list.appendChild(item.elm)\n  }\n  this.hide = function (item) {\n    if (item.elm !== undefined && item.elm.parentNode === list.list) {\n      list.list.removeChild(item.elm)\n    }\n  }\n  this.clear = function () {\n    /* .innerHTML = ''; fucks up IE */\n    if (list.list.hasChildNodes()) {\n      while (list.list.childNodes.length >= 1) {\n        list.list.removeChild(list.list.firstChild)\n      }\n    }\n  }\n\n  init()\n}\n\nmodule.exports = function (list) {\n  return new Templater(list)\n}\n", "module.exports = function (list) {\n  var item, text, columns, searchString, customSearch\n\n  var prepare = {\n    resetList: function () {\n      list.i = 1\n      list.templater.clear()\n      customSearch = undefined\n    },\n    setOptions: function (args) {\n      if (args.length == 2 && args[1] instanceof Array) {\n        columns = args[1]\n      } else if (args.length == 2 && typeof args[1] == 'function') {\n        columns = undefined\n        customSearch = args[1]\n      } else if (args.length == 3) {\n        columns = args[1]\n        customSearch = args[2]\n      } else {\n        columns = undefined\n      }\n    },\n    setColumns: function () {\n      if (list.items.length === 0) return\n      if (columns === undefined) {\n        columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns\n      }\n    },\n    setSearchString: function (s) {\n      s = list.utils.toString(s).toLowerCase()\n      s = s.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, '\\\\$&') // Escape regular expression characters\n      searchString = s\n    },\n    toArray: function (values) {\n      var tmpColumn = []\n      for (var name in values) {\n        tmpColumn.push(name)\n      }\n      return tmpColumn\n    },\n  }\n  var search = {\n    list: function () {\n      // Extract quoted phrases \"word1 word2\" from original searchString\n      // searchString is converted to lowercase by List.js\n      var words = [],\n        phrase,\n        ss = searchString\n      while ((phrase = ss.match(/\"([^\"]+)\"/)) !== null) {\n        words.push(phrase[1])\n        ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length)\n      }\n      // Get remaining space-separated words (if any)\n      ss = ss.trim()\n      if (ss.length) words = words.concat(ss.split(/\\s+/))\n      for (var k = 0, kl = list.items.length; k < kl; k++) {\n        var item = list.items[k]\n        item.found = false\n        if (!words.length) continue\n        for (var i = 0, il = words.length; i < il; i++) {\n          var word_found = false\n          for (var j = 0, jl = columns.length; j < jl; j++) {\n            var values = item.values(),\n              column = columns[j]\n            if (values.hasOwnProperty(column) && values[column] !== undefined && values[column] !== null) {\n              var text = typeof values[column] !== 'string' ? values[column].toString() : values[column]\n              if (text.toLowerCase().indexOf(words[i]) !== -1) {\n                // word found, so no need to check it against any other columns\n                word_found = true\n                break\n              }\n            }\n          }\n          // this word not found? no need to check any other words, the item cannot match\n          if (!word_found) break\n        }\n        item.found = word_found\n      }\n    },\n    // Removed search.item() and search.values()\n    reset: function () {\n      list.reset.search()\n      list.searched = false\n    },\n  }\n\n  var searchMethod = function (str) {\n    list.trigger('searchStart')\n\n    prepare.resetList()\n    prepare.setSearchString(str)\n    prepare.setOptions(arguments) // str, cols|searchFunction, searchFunction\n    prepare.setColumns()\n\n    if (searchString === '') {\n      search.reset()\n    } else {\n      list.searched = true\n      if (customSearch) {\n        customSearch(searchString, columns)\n      } else {\n        search.list()\n      }\n    }\n\n    list.update()\n    list.trigger('searchComplete')\n    return list.visibleItems\n  }\n\n  list.handlers.searchStart = list.handlers.searchStart || []\n  list.handlers.searchComplete = list.handlers.searchComplete || []\n\n  list.utils.events.bind(\n    list.utils.getByClass(list.listContainer, list.searchClass),\n    'keyup',\n    list.utils.events.debounce(function (e) {\n      var target = e.target || e.srcElement, // IE have srcElement\n        alreadyCleared = target.value === '' && !list.searched\n      if (!alreadyCleared) {\n        // If oninput already have resetted the list, do nothing\n        searchMethod(target.value)\n      }\n    }, list.searchDelay)\n  )\n\n  // Used to detect click on HTML5 clear button\n  list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function (e) {\n    var target = e.target || e.srcElement\n    if (target.value === '') {\n      searchMethod('')\n    }\n  })\n\n  return searchMethod\n}\n", "module.exports = function (list) {\n  // Add handlers\n  list.handlers.filterStart = list.handlers.filterStart || []\n  list.handlers.filterComplete = list.handlers.filterComplete || []\n\n  return function (filterFunction) {\n    list.trigger('filterStart')\n    list.i = 1 // Reset paging\n    list.reset.filter()\n    if (filterFunction === undefined) {\n      list.filtered = false\n    } else {\n      list.filtered = true\n      var is = list.items\n      for (var i = 0, il = is.length; i < il; i++) {\n        var item = is[i]\n        if (filterFunction(item)) {\n          item.filtered = true\n        } else {\n          item.filtered = false\n        }\n      }\n    }\n    list.update()\n    list.trigger('filterComplete')\n    return list.visibleItems\n  }\n}\n", "module.exports = function (list) {\n  var buttons = {\n    els: undefined,\n    clear: function () {\n      for (var i = 0, il = buttons.els.length; i < il; i++) {\n        list.utils.classes(buttons.els[i]).remove('asc')\n        list.utils.classes(buttons.els[i]).remove('desc')\n      }\n    },\n    getOrder: function (btn) {\n      var predefinedOrder = list.utils.getAttribute(btn, 'data-order')\n      if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {\n        return predefinedOrder\n      } else if (list.utils.classes(btn).has('desc')) {\n        return 'asc'\n      } else if (list.utils.classes(btn).has('asc')) {\n        return 'desc'\n      } else {\n        return 'asc'\n      }\n    },\n    getInSensitive: function (btn, options) {\n      var insensitive = list.utils.getAttribute(btn, 'data-insensitive')\n      if (insensitive === 'false') {\n        options.insensitive = false\n      } else {\n        options.insensitive = true\n      }\n    },\n    setOrder: function (options) {\n      for (var i = 0, il = buttons.els.length; i < il; i++) {\n        var btn = buttons.els[i]\n        if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) {\n          continue\n        }\n        var predefinedOrder = list.utils.getAttribute(btn, 'data-order')\n        if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {\n          if (predefinedOrder == options.order) {\n            list.utils.classes(btn).add(options.order)\n          }\n        } else {\n          list.utils.classes(btn).add(options.order)\n        }\n      }\n    },\n  }\n\n  var sort = function () {\n    list.trigger('sortStart')\n    var options = {}\n\n    var target = arguments[0].currentTarget || arguments[0].srcElement || undefined\n\n    if (target) {\n      options.valueName = list.utils.getAttribute(target, 'data-sort')\n      buttons.getInSensitive(target, options)\n      options.order = buttons.getOrder(target)\n    } else {\n      options = arguments[1] || options\n      options.valueName = arguments[0]\n      options.order = options.order || 'asc'\n      options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive\n    }\n\n    buttons.clear()\n    buttons.setOrder(options)\n\n    // caseInsensitive\n    // alphabet\n    var customSortFunction = options.sortFunction || list.sortFunction || null,\n      multi = options.order === 'desc' ? -1 : 1,\n      sortFunction\n\n    if (customSortFunction) {\n      sortFunction = function (itemA, itemB) {\n        return customSortFunction(itemA, itemB, options) * multi\n      }\n    } else {\n      sortFunction = function (itemA, itemB) {\n        var sort = list.utils.naturalSort\n        sort.alphabet = list.alphabet || options.alphabet || undefined\n        if (!sort.alphabet && options.insensitive) {\n          sort = list.utils.naturalSort.caseInsensitive\n        }\n        return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi\n      }\n    }\n\n    list.items.sort(sortFunction)\n    list.update()\n    list.trigger('sortComplete')\n  }\n\n  // Add handlers\n  list.handlers.sortStart = list.handlers.sortStart || []\n  list.handlers.sortComplete = list.handlers.sortComplete || []\n\n  buttons.els = list.utils.getByClass(list.listContainer, list.sortClass)\n  list.utils.events.bind(buttons.els, 'click', sort)\n  list.on('searchStart', buttons.clear)\n  list.on('filterStart', buttons.clear)\n\n  return sort\n}\n", "module.exports = function (text, pattern, options) {\n  // Aproximately where in the text is the pattern expected to be found?\n  var Match_Location = options.location || 0\n\n  //Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n  var Match_Distance = options.distance || 100\n\n  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.\n  var Match_Threshold = options.threshold || 0.4\n\n  if (pattern === text) return true // Exact match\n  if (pattern.length > 32) return false // This algorithm cannot be used\n\n  // Set starting location at beginning text and initialise the alphabet.\n  var loc = Match_Location,\n    s = (function () {\n      var q = {},\n        i\n\n      for (i = 0; i < pattern.length; i++) {\n        q[pattern.charAt(i)] = 0\n      }\n\n      for (i = 0; i < pattern.length; i++) {\n        q[pattern.charAt(i)] |= 1 << (pattern.length - i - 1)\n      }\n\n      return q\n    })()\n\n  // Compute and return the score for a match with e errors and x location.\n  // Accesses loc and pattern through being a closure.\n\n  function match_bitapScore_(e, x) {\n    var accuracy = e / pattern.length,\n      proximity = Math.abs(loc - x)\n\n    if (!Match_Distance) {\n      // Dodge divide by zero error.\n      return proximity ? 1.0 : accuracy\n    }\n    return accuracy + proximity / Match_Distance\n  }\n\n  var score_threshold = Match_Threshold, // Highest score beyond which we give up.\n    best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup)\n\n  if (best_loc != -1) {\n    score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)\n    // What about in the other direction? (speedup)\n    best_loc = text.lastIndexOf(pattern, loc + pattern.length)\n\n    if (best_loc != -1) {\n      score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)\n    }\n  }\n\n  // Initialise the bit arrays.\n  var matchmask = 1 << (pattern.length - 1)\n  best_loc = -1\n\n  var bin_min, bin_mid\n  var bin_max = pattern.length + text.length\n  var last_rd\n  for (var d = 0; d < pattern.length; d++) {\n    // Scan for the best match; each iteration allows for one more error.\n    // Run a binary search to determine how far from 'loc' we can stray at this\n    // error level.\n    bin_min = 0\n    bin_mid = bin_max\n    while (bin_min < bin_mid) {\n      if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n        bin_min = bin_mid\n      } else {\n        bin_max = bin_mid\n      }\n      bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min)\n    }\n    // Use the result from this iteration as the maximum for the next.\n    bin_max = bin_mid\n    var start = Math.max(1, loc - bin_mid + 1)\n    var finish = Math.min(loc + bin_mid, text.length) + pattern.length\n\n    var rd = Array(finish + 2)\n    rd[finish + 1] = (1 << d) - 1\n    for (var j = finish; j >= start; j--) {\n      // The alphabet (s) is a sparse hash, so the following line generates\n      // warnings.\n      var charMatch = s[text.charAt(j - 1)]\n      if (d === 0) {\n        // First pass: exact match.\n        rd[j] = ((rd[j + 1] << 1) | 1) & charMatch\n      } else {\n        // Subsequent passes: fuzzy match.\n        rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1]\n      }\n      if (rd[j] & matchmask) {\n        var score = match_bitapScore_(d, j - 1)\n        // This match will almost certainly be better than any existing match.\n        // But check anyway.\n        if (score <= score_threshold) {\n          // Told you so.\n          score_threshold = score\n          best_loc = j - 1\n          if (best_loc > loc) {\n            // When passing loc, don't exceed our current distance from loc.\n            start = Math.max(1, 2 * loc - best_loc)\n          } else {\n            // Already passed loc, downhill from here on in.\n            break\n          }\n        }\n      }\n    }\n    // No hope for a (better) match at greater error levels.\n    if (match_bitapScore_(d + 1, loc) > score_threshold) {\n      break\n    }\n    last_rd = rd\n  }\n\n  return best_loc < 0 ? false : true\n}\n", "var classes = require('./utils/classes'),\n  events = require('./utils/events'),\n  extend = require('./utils/extend'),\n  toString = require('./utils/to-string'),\n  getByClass = require('./utils/get-by-class'),\n  fuzzy = require('./utils/fuzzy')\n\nmodule.exports = function (list, options) {\n  options = options || {}\n\n  options = extend(\n    {\n      location: 0,\n      distance: 100,\n      threshold: 0.4,\n      multiSearch: true,\n      searchClass: 'fuzzy-search',\n    },\n    options\n  )\n\n  var fuzzySearch = {\n    search: function (searchString, columns) {\n      // Substract arguments from the searchString or put searchString as only argument\n      var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString]\n\n      for (var k = 0, kl = list.items.length; k < kl; k++) {\n        fuzzySearch.item(list.items[k], columns, searchArguments)\n      }\n    },\n    item: function (item, columns, searchArguments) {\n      var found = true\n      for (var i = 0; i < searchArguments.length; i++) {\n        var foundArgument = false\n        for (var j = 0, jl = columns.length; j < jl; j++) {\n          if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) {\n            foundArgument = true\n          }\n        }\n        if (!foundArgument) {\n          found = false\n        }\n      }\n      item.found = found\n    },\n    values: function (values, value, searchArgument) {\n      if (values.hasOwnProperty(value)) {\n        var text = toString(values[value]).toLowerCase()\n\n        if (fuzzy(text, searchArgument, options)) {\n          return true\n        }\n      }\n      return false\n    },\n  }\n\n  events.bind(\n    getByClass(list.listContainer, options.searchClass),\n    'keyup',\n    list.utils.events.debounce(function (e) {\n      var target = e.target || e.srcElement // IE have srcElement\n      list.search(target.value, fuzzySearch.search)\n    }, list.searchDelay)\n  )\n\n  return function (str, columns) {\n    list.search(str, columns, fuzzySearch.search)\n  }\n}\n", "var naturalSort = require('string-natural-compare'),\n  getByClass = require('./utils/get-by-class'),\n  extend = require('./utils/extend'),\n  indexOf = require('./utils/index-of'),\n  events = require('./utils/events'),\n  toString = require('./utils/to-string'),\n  classes = require('./utils/classes'),\n  getAttribute = require('./utils/get-attribute'),\n  toArray = require('./utils/to-array')\n\nmodule.exports = function (id, options, values) {\n  var self = this,\n    init,\n    Item = require('./item')(self),\n    addAsync = require('./add-async')(self),\n    initPagination = require('./pagination')(self)\n\n  init = {\n    start: function () {\n      self.listClass = 'list'\n      self.searchClass = 'search'\n      self.sortClass = 'sort'\n      self.page = 10000\n      self.i = 1\n      self.items = []\n      self.visibleItems = []\n      self.matchingItems = []\n      self.searched = false\n      self.filtered = false\n      self.searchColumns = undefined\n      self.searchDelay = 0\n      self.handlers = { updated: [] }\n      self.valueNames = []\n      self.utils = {\n        getByClass: getByClass,\n        extend: extend,\n        indexOf: indexOf,\n        events: events,\n        toString: toString,\n        naturalSort: naturalSort,\n        classes: classes,\n        getAttribute: getAttribute,\n        toArray: toArray,\n      }\n\n      self.utils.extend(self, options)\n\n      self.listContainer = typeof id === 'string' ? document.getElementById(id) : id\n      if (!self.listContainer) {\n        return\n      }\n      self.list = getByClass(self.listContainer, self.listClass, true)\n\n      self.parse = require('./parse')(self)\n      self.templater = require('./templater')(self)\n      self.search = require('./search')(self)\n      self.filter = require('./filter')(self)\n      self.sort = require('./sort')(self)\n      self.fuzzySearch = require('./fuzzy-search')(self, options.fuzzySearch)\n\n      this.handlers()\n      this.items()\n      this.pagination()\n\n      self.update()\n    },\n    handlers: function () {\n      for (var handler in self.handlers) {\n        if (self[handler] && self.handlers.hasOwnProperty(handler)) {\n          self.on(handler, self[handler])\n        }\n      }\n    },\n    items: function () {\n      self.parse(self.list)\n      if (values !== undefined) {\n        self.add(values)\n      }\n    },\n    pagination: function () {\n      if (options.pagination !== undefined) {\n        if (options.pagination === true) {\n          options.pagination = [{}]\n        }\n        if (options.pagination[0] === undefined) {\n          options.pagination = [options.pagination]\n        }\n        for (var i = 0, il = options.pagination.length; i < il; i++) {\n          initPagination(options.pagination[i])\n        }\n      }\n    },\n  }\n\n  /*\n   * Re-parse the List, use if html have changed\n   */\n  this.reIndex = function () {\n    self.items = []\n    self.visibleItems = []\n    self.matchingItems = []\n    self.searched = false\n    self.filtered = false\n    self.parse(self.list)\n  }\n\n  this.toJSON = function () {\n    var json = []\n    for (var i = 0, il = self.items.length; i < il; i++) {\n      json.push(self.items[i].values())\n    }\n    return json\n  }\n\n  /*\n   * Add object to list\n   */\n  this.add = function (values, callback) {\n    if (values.length === 0) {\n      return\n    }\n    if (callback) {\n      addAsync(values.slice(0), callback)\n      return\n    }\n    var added = [],\n      notCreate = false\n    if (values[0] === undefined) {\n      values = [values]\n    }\n    for (var i = 0, il = values.length; i < il; i++) {\n      var item = null\n      notCreate = self.items.length > self.page ? true : false\n      item = new Item(values[i], undefined, notCreate)\n      self.items.push(item)\n      added.push(item)\n    }\n    self.update()\n    return added\n  }\n\n  this.show = function (i, page) {\n    this.i = i\n    this.page = page\n    self.update()\n    return self\n  }\n\n  /* Removes object from list.\n   * Loops through the list and removes objects where\n   * property \"valuename\" === value\n   */\n  this.remove = function (valueName, value, options) {\n    var found = 0\n    for (var i = 0, il = self.items.length; i < il; i++) {\n      if (self.items[i].values()[valueName] == value) {\n        self.templater.remove(self.items[i], options)\n        self.items.splice(i, 1)\n        il--\n        i--\n        found++\n      }\n    }\n    self.update()\n    return found\n  }\n\n  /* Gets the objects in the list which\n   * property \"valueName\" === value\n   */\n  this.get = function (valueName, value) {\n    var matchedItems = []\n    for (var i = 0, il = self.items.length; i < il; i++) {\n      var item = self.items[i]\n      if (item.values()[valueName] == value) {\n        matchedItems.push(item)\n      }\n    }\n    return matchedItems\n  }\n\n  /*\n   * Get size of the list\n   */\n  this.size = function () {\n    return self.items.length\n  }\n\n  /*\n   * Removes all items from the list\n   */\n  this.clear = function () {\n    self.templater.clear()\n    self.items = []\n    return self\n  }\n\n  this.on = function (event, callback) {\n    self.handlers[event].push(callback)\n    return self\n  }\n\n  this.off = function (event, callback) {\n    var e = self.handlers[event]\n    var index = indexOf(e, callback)\n    if (index > -1) {\n      e.splice(index, 1)\n    }\n    return self\n  }\n\n  this.trigger = function (event) {\n    var i = self.handlers[event].length\n    while (i--) {\n      self.handlers[event][i](self)\n    }\n    return self\n  }\n\n  this.reset = {\n    filter: function () {\n      var is = self.items,\n        il = is.length\n      while (il--) {\n        is[il].filtered = false\n      }\n      return self\n    },\n    search: function () {\n      var is = self.items,\n        il = is.length\n      while (il--) {\n        is[il].found = false\n      }\n      return self\n    },\n  }\n\n  this.update = function () {\n    var is = self.items,\n      il = is.length\n\n    self.visibleItems = []\n    self.matchingItems = []\n    self.templater.clear()\n    for (var i = 0; i < il; i++) {\n      if (is[i].matching() && self.matchingItems.length + 1 >= self.i && self.visibleItems.length < self.page) {\n        is[i].show()\n        self.visibleItems.push(is[i])\n        self.matchingItems.push(is[i])\n      } else if (is[i].matching()) {\n        self.matchingItems.push(is[i])\n        is[i].hide()\n      } else {\n        is[i].hide()\n      }\n    }\n    self.trigger('updated')\n    return self\n  }\n\n  init.start()\n}\n", "/*\nTurbo 7.1.0\nCopyright \u00A9 2021 Basecamp, LLC\n */\n(function () {\n    if (window.Reflect === undefined || 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 =\n        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;\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    else {\n        prototype = window.Event.prototype;\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    constructor() {\n        super();\n        this.loaded = Promise.resolve();\n        this.delegate = new FrameElement.delegateConstructor(this);\n    }\n    static get observedAttributes() {\n        return [\"disabled\", \"loading\", \"src\"];\n    }\n    connectedCallback() {\n        this.delegate.connect();\n    }\n    disconnectedCallback() {\n        this.delegate.disconnect();\n    }\n    reload() {\n        const { src } = this;\n        this.src = null;\n        this.src = src;\n    }\n    attributeChangedCallback(name) {\n        if (name == \"loading\") {\n            this.delegate.loadingStyleChanged();\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\": return FrameLoadingStyle.lazy;\n        default: 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))$/);\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\n        ? url.href.slice(0, -(anchor.length + 1))\n        : 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 dispatch(eventName, { target, cancelable, detail } = {}) {\n    const event = new CustomEvent(eventName, { cancelable, bubbles: true, detail });\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.apply(null, { length: 36 }).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    }).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 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}\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\": return FetchMethod.get;\n        case \"post\": return FetchMethod.post;\n        case \"put\": return FetchMethod.put;\n        case \"patch\": return FetchMethod.patch;\n        case \"delete\": 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        var _a, _b;\n        const { fetchOptions } = this;\n        (_b = (_a = this.delegate).prepareHeadersForRequest) === null || _b === void 0 ? void 0 : _b.call(_a, this.headers, 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                this.delegate.requestErrored(this, error);\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\", { cancelable: true, detail: { fetchResponse }, target: this.target });\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.isIdempotent ? 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 isIdempotent() {\n        return this.method == FetchMethod.get;\n    }\n    get abortSignal() {\n        return this.abortController.signal;\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}\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    constructor(html) {\n        this.templateElement = document.createElement(\"template\");\n        this.templateElement.innerHTML = html;\n    }\n    static wrap(message) {\n        if (typeof message == \"string\") {\n            return new this(message);\n        }\n        else {\n            return message;\n        }\n    }\n    get fragment() {\n        const fragment = document.createDocumentFragment();\n        for (const element of this.foreignElements) {\n            fragment.appendChild(document.importNode(element, true));\n        }\n        return fragment;\n    }\n    get foreignElements() {\n        return this.templateChildren.reduce((streamElements, child) => {\n            if (child.tagName.toLowerCase() == \"turbo-stream\") {\n                return [...streamElements, child];\n            }\n            else {\n                return streamElements;\n            }\n        }, []);\n    }\n    get templateChildren() {\n        return Array.from(this.templateElement.content.children);\n    }\n}\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\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: return FormEnctype.multipart;\n        case FormEnctype.plain: return FormEnctype.plain;\n        default: return FormEnctype.urlEncoded;\n    }\n}\nclass FormSubmission {\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    static confirmMethod(message, element) {\n        return confirm(message);\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        return ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formaction\")) || this.formElement.getAttribute(\"action\") || formElementAction || \"\";\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 isIdempotent() {\n        return this.fetchRequest.isIdempotent;\n    }\n    get stringFormData() {\n        return [...this.formData].reduce((entries, [name, value]) => {\n            return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n        }, []);\n    }\n    get confirmationMessage() {\n        return this.formElement.getAttribute(\"data-turbo-confirm\");\n    }\n    get needsConfirmation() {\n        return this.confirmationMessage !== null;\n    }\n    async start() {\n        const { initialized, requesting } = FormSubmissionState;\n        if (this.needsConfirmation) {\n            const answer = FormSubmission.confirmMethod(this.confirmationMessage, this.formElement);\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    prepareHeadersForRequest(headers, request) {\n        if (!request.isIdempotent) {\n            const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n            if (token) {\n                headers[\"X-CSRF-Token\"] = token;\n            }\n            headers[\"Accept\"] = [StreamMessage.contentType, headers[\"Accept\"]].join(\", \");\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        dispatch(\"turbo:submit-start\", { target: this.formElement, detail: { formSubmission: this } });\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        dispatch(\"turbo:submit-end\", { target: this.formElement, detail: Object.assign({ formSubmission: this }, this.result) });\n        this.delegate.formSubmissionFinished(this);\n    }\n    requestMustRedirect(request) {\n        return !request.isIdempotent && this.mustRedirect;\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 && value != null && formData.get(name) != value) {\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 getMetaContent(name) {\n    const element = document.querySelector(`meta[name=\"${name}\"]`);\n    return element && element.content;\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 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        return this.element.querySelector(\"[autofocus]\");\n    }\n    get permanentElements() {\n        return [...this.element.querySelectorAll(\"[id][data-turbo-permanent]\")];\n    }\n    getPermanentElementById(id) {\n        return this.element.querySelector(`#${id}[data-turbo-permanent]`);\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}\n\nclass FormInterceptor {\n    constructor(delegate, element) {\n        this.submitBubbled = ((event) => {\n            const form = event.target;\n            if (!event.defaultPrevented && form instanceof HTMLFormElement && form.closest(\"turbo-frame, html\") == this.element) {\n                const submitter = event.submitter || undefined;\n                const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.method;\n                if (method != \"dialog\" && this.delegate.shouldInterceptFormSubmission(form, submitter)) {\n                    event.preventDefault();\n                    event.stopImmediatePropagation();\n                    this.delegate.formSubmissionIntercepted(form, submitter);\n                }\n            }\n        });\n        this.delegate = delegate;\n        this.element = element;\n    }\n    start() {\n        this.element.addEventListener(\"submit\", this.submitBubbled);\n    }\n    stop() {\n        this.element.removeEventListener(\"submit\", this.submitBubbled);\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                this.prepareToRenderSnapshot(renderer);\n                const renderInterception = new Promise(resolve => this.resolveInterceptionPromise = resolve);\n                const immediateRender = this.delegate.allowsImmediateRender(snapshot, this.resolveInterceptionPromise);\n                if (!immediateRender)\n                    await renderInterception;\n                await this.renderSnapshot(renderer);\n                this.delegate.viewRenderedSnapshot(snapshot, isPreview);\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();\n        }\n    }\n    invalidate() {\n        this.delegate.viewInvalidated();\n    }\n    prepareToRenderSnapshot(renderer) {\n        this.markAsPreview(renderer.isPreview);\n        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    invalidate() {\n        this.element.innerHTML = \"\";\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)) {\n                    this.clickEvent.preventDefault();\n                    event.preventDefault();\n                    this.delegate.linkClickIntercepted(event.target, event.detail.url);\n                }\n            }\n            delete this.clickEvent;\n        });\n        this.willVisit = () => {\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\n            ? target\n            : target instanceof Node\n                ? target.parentElement\n                : null;\n        return element && element.closest(\"turbo-frame, html\") == this.element;\n    }\n}\n\nclass Bardo {\n    constructor(permanentElementMap) {\n        this.permanentElementMap = permanentElementMap;\n    }\n    static preservingPermanentElements(permanentElementMap, callback) {\n        const bardo = new this(permanentElementMap);\n        bardo.enter();\n        callback();\n        bardo.leave();\n    }\n    enter() {\n        for (const id in this.permanentElementMap) {\n            const [, newPermanentElement] = this.permanentElementMap[id];\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        }\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, isPreview, willRender = true) {\n        this.currentSnapshot = currentSnapshot;\n        this.newSnapshot = newSnapshot;\n        this.isPreview = isPreview;\n        this.willRender = willRender;\n        this.promise = new Promise((resolve, reject) => this.resolvingFunctions = { resolve, reject });\n    }\n    get shouldRender() {\n        return true;\n    }\n    prepareToRender() {\n        return;\n    }\n    finishRendering() {\n        if (this.resolvingFunctions) {\n            this.resolvingFunctions.resolve();\n            delete this.resolvingFunctions;\n        }\n    }\n    createScriptElement(element) {\n        if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n            return element;\n        }\n        else {\n            const createdScriptElement = document.createElement(\"script\");\n            if (this.cspNonce) {\n                createdScriptElement.nonce = this.cspNonce;\n            }\n            createdScriptElement.textContent = element.textContent;\n            createdScriptElement.async = false;\n            copyElementAttributes(createdScriptElement, element);\n            return createdScriptElement;\n        }\n    }\n    preservingPermanentElements(callback) {\n        Bardo.preservingPermanentElements(this.permanentElementMap, callback);\n    }\n    focusFirstAutofocusableElement() {\n        const element = this.connectedSnapshot.firstAutofocusableElement;\n        if (elementIsFocusable(element)) {\n            element.focus();\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    get cspNonce() {\n        var _a;\n        return (_a = document.head.querySelector('meta[name=\"csp-nonce\"]')) === null || _a === void 0 ? void 0 : _a.getAttribute(\"content\");\n    }\n}\nfunction copyElementAttributes(destinationElement, sourceElement) {\n    for (const { name, value } of [...sourceElement.attributes]) {\n        destinationElement.setAttribute(name, value);\n    }\n}\nfunction elementIsFocusable(element) {\n    return element && typeof element.focus == \"function\";\n}\n\nclass FrameRenderer extends Renderer {\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        var _a;\n        const destinationRange = document.createRange();\n        destinationRange.selectNodeContents(this.currentElement);\n        destinationRange.deleteContents();\n        const frameElement = this.newElement;\n        const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n        if (sourceRange) {\n            sourceRange.selectNodeContents(frameElement);\n            this.currentElement.appendChild(sourceRange.extractContents());\n        }\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            if (element) {\n                element.scrollIntoView({ block });\n                return true;\n            }\n        }\n        return false;\n    }\n    activateScriptElements() {\n        for (const inertScriptElement of this.newScriptElements) {\n            const activatedScriptElement = this.createScriptElement(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}\n\nclass ProgressBar {\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    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: 9999;\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    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        return element;\n    }\n    createProgressElement() {\n        const element = document.createElement(\"div\");\n        element.className = \"turbo-progress-bar\";\n        return element;\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\n            ? element.getAttribute(\"content\")\n            : 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.tagName.toLowerCase();\n    return tagName == \"script\";\n}\nfunction elementIsNoscript(element) {\n    const tagName = element.tagName.toLowerCase();\n    return tagName == \"noscript\";\n}\nfunction elementIsStylesheet(element) {\n    const tagName = element.tagName.toLowerCase();\n    return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\");\n}\nfunction elementIsMetaElementWithName(element, name) {\n    const tagName = element.tagName.toLowerCase();\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    constructor(element, headSnapshot) {\n        super(element);\n        this.headSnapshot = headSnapshot;\n    }\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    clone() {\n        return new PageSnapshot(this.element.cloneNode(true), 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};\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.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, snapshotHTML, response, visitCachedSnapshot, willRender } = Object.assign(Object.assign({}, defaultOptions), options);\n        this.action = action;\n        this.historyChanged = historyChanged;\n        this.referrer = referrer;\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.scrolled = !willRender;\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.adapter.visitCompleted(this);\n            this.delegate.visitCompleted(this);\n            this.followRedirect();\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) {\n            const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? \"replace\" : this.action;\n            const method = this.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                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);\n                    this.adapter.visitRendered(this);\n                    this.complete();\n                }\n                else {\n                    await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML));\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);\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            });\n            this.followedRedirect = true;\n        }\n    }\n    goToSamePageAnchor() {\n        if (this.isSamePage) {\n            this.render(async () => {\n                this.cacheSnapshot();\n                this.adapter.visitRendered(this);\n            });\n        }\n    }\n    requestStarted() {\n        this.startRequest();\n    }\n    requestPreventedHandlingResponse(request, response) {\n    }\n    async requestSucceededWithResponse(request, response) {\n        const responseHTML = await response.responseHTML;\n        const { redirected, statusCode } = response;\n        if (responseHTML == undefined) {\n            this.recordResponse({ statusCode: SystemStatusCode.contentTypeMismatch, redirected });\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({ statusCode: SystemStatusCode.contentTypeMismatch, redirected });\n        }\n        else {\n            this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n        }\n    }\n    requestErrored(request, error) {\n        this.recordResponse({ statusCode: SystemStatusCode.networkFailure, redirected: false });\n    }\n    requestFinished() {\n        this.finishRequest();\n    }\n    performScroll() {\n        if (!this.scrolled) {\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\": return history.replaceState;\n            case \"advance\":\n            case \"restore\": 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().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        this.performScroll();\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, uuid(), options);\n    }\n    visitStarted(visit) {\n        visit.loadCachedSnapshot();\n        visit.issueRequest();\n        visit.changeHistory();\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            default:\n                return visit.loadResponse();\n        }\n    }\n    visitRequestFinished(visit) {\n        this.progressBar.setValue(1);\n        this.hideVisitProgressBar();\n    }\n    visitCompleted(visit) {\n    }\n    pageInvalidated() {\n        this.reload();\n    }\n    visitFailed(visit) {\n    }\n    visitRendered(visit) {\n    }\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() {\n        window.location.reload();\n    }\n    get navigator() {\n        return this.session.navigator;\n    }\n}\n\nclass CacheObserver {\n    constructor() {\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            addEventListener(\"turbo:before-cache\", this.removeStaleElements, false);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            removeEventListener(\"turbo:before-cache\", this.removeStaleElements, false);\n        }\n    }\n    removeStaleElements() {\n        const staleElements = [...document.querySelectorAll('[data-turbo-cache=\"false\"]')];\n        for (const element of staleElements) {\n            element.remove();\n        }\n    }\n}\n\nclass FormSubmitObserver {\n    constructor(delegate) {\n        this.started = false;\n        this.submitCaptured = () => {\n            removeEventListener(\"submit\", this.submitBubbled, false);\n            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                    const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n                    if (method != \"dialog\" && this.delegate.willSubmitForm(form, submitter)) {\n                        event.preventDefault();\n                        this.delegate.formSubmitted(form, submitter);\n                    }\n                }\n            }\n        });\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"submit\", this.submitCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            removeEventListener(\"submit\", this.submitCaptured, true);\n            this.started = false;\n        }\n    }\n}\n\nclass FrameRedirector {\n    constructor(element) {\n        this.element = element;\n        this.linkInterceptor = new LinkInterceptor(this, element);\n        this.formInterceptor = new FormInterceptor(this, element);\n    }\n    start() {\n        this.linkInterceptor.start();\n        this.formInterceptor.start();\n    }\n    stop() {\n        this.linkInterceptor.stop();\n        this.formInterceptor.stop();\n    }\n    shouldInterceptLinkClick(element, url) {\n        return this.shouldRedirect(element);\n    }\n    linkClickIntercepted(element, url) {\n        const frame = this.findFrameElement(element);\n        if (frame) {\n            frame.delegate.linkClickIntercepted(element, url);\n        }\n    }\n    shouldInterceptFormSubmission(element, submitter) {\n        return this.shouldSubmit(element, submitter);\n    }\n    formSubmissionIntercepted(element, submitter) {\n        const frame = this.findFrameElement(element, submitter);\n        if (frame) {\n            frame.removeAttribute(\"reloadable\");\n            frame.delegate.formSubmissionIntercepted(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 frame = this.findFrameElement(element, submitter);\n        return frame ? frame != element.closest(\"turbo-frame\") : false;\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 LinkClickObserver {\n    constructor(delegate) {\n        this.started = false;\n        this.clickCaptured = () => {\n            removeEventListener(\"click\", this.clickBubbled, false);\n            addEventListener(\"click\", this.clickBubbled, false);\n        };\n        this.clickBubbled = (event) => {\n            if (this.clickEventIsSignificant(event)) {\n                const target = (event.composedPath && event.composedPath()[0]) || event.target;\n                const link = this.findLinkFromClickTarget(target);\n                if (link) {\n                    const location = this.getLocationForLink(link);\n                    if (this.delegate.willFollowLinkToLocation(link, location)) {\n                        event.preventDefault();\n                        this.delegate.followedLinkToLocation(link, location);\n                    }\n                }\n            }\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"click\", this.clickCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            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        if (target instanceof Element) {\n            return target.closest(\"a[href]:not([target^=_]):not([download])\");\n        }\n    }\n    getLocationForLink(link) {\n        return expandURL(link.getAttribute(\"href\") || \"\");\n    }\n}\n\nfunction isAction(action) {\n    return action == \"advance\" || action == \"replace\" || action == \"restore\";\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                if (formSubmission.method != FetchMethod.get) {\n                    this.view.clearSnapshotCache();\n                }\n                const { statusCode, redirected } = fetchResponse;\n                const action = this.getActionForFormSubmission(formSubmission);\n                const visitOptions = { action, response: { statusCode, responseHTML, redirected } };\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);\n            }\n            else {\n                await this.view.renderPage(snapshot);\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(formSubmission) {\n        const { formElement, submitter } = formSubmission;\n        const action = getAttribute(\"data-turbo-action\", submitter, formElement);\n        return isAction(action) ? action : \"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 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(new StreamMessage(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    async render() {\n        this.replaceHeadAndBody();\n        this.activateScriptElements();\n    }\n    replaceHeadAndBody() {\n        const { documentElement, head, body } = document;\n        documentElement.replaceChild(this.newHead, head);\n        documentElement.replaceChild(this.newElement, body);\n    }\n    activateScriptElements() {\n        for (const replaceableElement of this.scriptElements) {\n            const parentNode = replaceableElement.parentNode;\n            if (parentNode) {\n                const element = this.createScriptElement(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    get shouldRender() {\n        return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n    }\n    prepareToRender() {\n        this.mergeHead();\n    }\n    async render() {\n        if (this.willRender) {\n            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    mergeHead() {\n        this.copyNewHeadStylesheetElements();\n        this.copyNewHeadScriptElements();\n        this.removeCurrentHeadProvisionalElements();\n        this.copyNewHeadProvisionalElements();\n    }\n    replaceBody() {\n        this.preservingPermanentElements(() => {\n            this.activateNewBody();\n            this.assignNewBody();\n        });\n    }\n    get trackedElementsAreIdentical() {\n        return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n    }\n    copyNewHeadStylesheetElements() {\n        for (const element of this.newHeadStylesheetElements) {\n            document.head.appendChild(element);\n        }\n    }\n    copyNewHeadScriptElements() {\n        for (const element of this.newHeadScriptElements) {\n            document.head.appendChild(this.createScriptElement(element));\n        }\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 = this.createScriptElement(inertScriptElement);\n            inertScriptElement.replaceWith(activatedScriptElement);\n        }\n    }\n    assignNewBody() {\n        if (document.body && this.newElement instanceof HTMLBodyElement) {\n            document.body.replaceWith(this.newElement);\n        }\n        else {\n            document.documentElement.appendChild(this.newElement);\n        }\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    }\n    renderPage(snapshot, isPreview = false, willRender = true) {\n        const renderer = new PageRenderer(this.snapshot, snapshot, isPreview, willRender);\n        return this.render(renderer);\n    }\n    renderError(snapshot) {\n        const renderer = new ErrorRenderer(this.snapshot, snapshot, false);\n        return this.render(renderer);\n    }\n    clearSnapshotCache() {\n        this.snapshotCache.clear();\n    }\n    async cacheSnapshot() {\n        if (this.shouldCacheSnapshot) {\n            this.delegate.viewWillCacheSnapshot();\n            const { snapshot, 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    get shouldCacheSnapshot() {\n        return this.snapshot.isCacheable;\n    }\n}\n\nclass Session {\n    constructor() {\n        this.navigator = new Navigator(this);\n        this.history = new History(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);\n        this.formSubmitObserver = new FormSubmitObserver(this);\n        this.scrollObserver = new ScrollObserver(this);\n        this.streamObserver = new StreamObserver(this);\n        this.frameRedirector = new FrameRedirector(document.documentElement);\n        this.drive = true;\n        this.enabled = true;\n        this.progressBarDelay = 500;\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.pageObserver.start();\n            this.cacheObserver.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.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.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        this.navigator.proposeVisit(expandURL(location), options);\n    }\n    connectStreamSource(source) {\n        this.streamObserver.connectStreamSource(source);\n    }\n    disconnectStreamSource(source) {\n        this.streamObserver.disconnectStreamSource(source);\n    }\n    renderStreamMessage(message) {\n        document.documentElement.appendChild(StreamMessage.wrap(message).fragment);\n    }\n    clearCache() {\n        this.view.clearSnapshotCache();\n    }\n    setProgressBarDelay(delay) {\n        this.progressBarDelay = delay;\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, { action: \"restore\", historyChanged: true });\n        }\n        else {\n            this.adapter.pageInvalidated();\n        }\n    }\n    scrollPositionChanged(position) {\n        this.history.updateRestorationData({ scrollPosition: position });\n    }\n    willFollowLinkToLocation(link, location) {\n        return this.elementDriveEnabled(link)\n            && locationIsVisitable(location, this.snapshot.rootLocation)\n            && this.applicationAllowsFollowingLinkToLocation(link, location);\n    }\n    followedLinkToLocation(link, location) {\n        const action = this.getActionForLink(link);\n        this.convertLinkWithMethodClickToFormSubmission(link) || this.visit(location.href, { action });\n    }\n    convertLinkWithMethodClickToFormSubmission(link) {\n        const linkMethod = link.getAttribute(\"data-turbo-method\");\n        if (linkMethod) {\n            const form = document.createElement(\"form\");\n            form.method = linkMethod;\n            form.action = link.getAttribute(\"href\") || \"undefined\";\n            form.hidden = true;\n            if (link.hasAttribute(\"data-turbo-confirm\")) {\n                form.setAttribute(\"data-turbo-confirm\", link.getAttribute(\"data-turbo-confirm\"));\n            }\n            const frame = this.getTargetFrameForLink(link);\n            if (frame) {\n                form.setAttribute(\"data-turbo-frame\", frame);\n                form.addEventListener(\"turbo:submit-start\", () => form.remove());\n            }\n            else {\n                form.addEventListener(\"submit\", () => form.remove());\n            }\n            document.body.appendChild(form);\n            return dispatch(\"submit\", { cancelable: true, target: form });\n        }\n        else {\n            return false;\n        }\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        extendURLWithDeprecatedProperties(visit.location);\n        if (!visit.silent) {\n            this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n        }\n    }\n    visitCompleted(visit) {\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.elementDriveEnabled(form)\n            && (!submitter || this.elementDriveEnabled(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 }, resume) {\n        const event = this.notifyApplicationBeforeRender(element, resume);\n        return !event.defaultPrevented;\n    }\n    viewRenderedSnapshot(snapshot, isPreview) {\n        this.view.lastRenderedLocation = this.history.location;\n        this.notifyApplicationAfterRender();\n    }\n    viewInvalidated() {\n        this.adapter.pageInvalidated();\n    }\n    frameLoaded(frame) {\n        this.notifyApplicationAfterFrameLoad(frame);\n    }\n    frameRendered(fetchResponse, frame) {\n        this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n    }\n    applicationAllowsFollowingLinkToLocation(link, location) {\n        const event = this.notifyApplicationAfterClickingLinkToLocation(link, location);\n        return !event.defaultPrevented;\n    }\n    applicationAllowsVisitingLocation(location) {\n        const event = this.notifyApplicationBeforeVisitingLocation(location);\n        return !event.defaultPrevented;\n    }\n    notifyApplicationAfterClickingLinkToLocation(link, location) {\n        return dispatch(\"turbo:click\", { target: link, detail: { url: location.href }, cancelable: true });\n    }\n    notifyApplicationBeforeVisitingLocation(location) {\n        return dispatch(\"turbo:before-visit\", { detail: { url: location.href }, cancelable: true });\n    }\n    notifyApplicationAfterVisitingLocation(location, action) {\n        markAsBusy(document.documentElement);\n        return dispatch(\"turbo:visit\", { detail: { url: location.href, action } });\n    }\n    notifyApplicationBeforeCachingSnapshot() {\n        return dispatch(\"turbo:before-cache\");\n    }\n    notifyApplicationBeforeRender(newBody, resume) {\n        return dispatch(\"turbo:before-render\", { detail: { newBody, resume }, cancelable: true });\n    }\n    notifyApplicationAfterRender() {\n        return dispatch(\"turbo:render\");\n    }\n    notifyApplicationAfterPageLoad(timing = {}) {\n        clearBusyState(document.documentElement);\n        return dispatch(\"turbo:load\", { detail: { url: this.location.href, timing } });\n    }\n    notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n        dispatchEvent(new HashChangeEvent(\"hashchange\", { oldURL: oldURL.toString(), newURL: newURL.toString() }));\n    }\n    notifyApplicationAfterFrameLoad(frame) {\n        return dispatch(\"turbo:frame-load\", { target: frame });\n    }\n    notifyApplicationAfterFrameRender(fetchResponse, frame) {\n        return dispatch(\"turbo:frame-render\", { detail: { fetchResponse }, target: frame, cancelable: true });\n    }\n    elementDriveEnabled(element) {\n        const container = element === null || element === void 0 ? void 0 : element.closest(\"[data-turbo]\");\n        if (this.drive) {\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        const action = link.getAttribute(\"data-turbo-action\");\n        return isAction(action) ? action : \"advance\";\n    }\n    getTargetFrameForLink(link) {\n        const frame = link.getAttribute(\"data-turbo-frame\");\n        if (frame) {\n            return frame;\n        }\n        else {\n            const container = link.closest(\"turbo-frame\");\n            if (container) {\n                return container.id;\n            }\n        }\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\nconst session = new 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    session.clearCache();\n}\nfunction setProgressBarDelay(delay) {\n    session.setProgressBarDelay(delay);\n}\nfunction setConfirmMethod(confirmMethod) {\n    FormSubmission.confirmMethod = confirmMethod;\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    navigator: navigator$1,\n    session: session,\n    PageRenderer: PageRenderer,\n    PageSnapshot: PageSnapshot,\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});\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.settingSourceURL = false;\n        this.element = element;\n        this.view = new FrameView(this, this.element);\n        this.appearanceObserver = new AppearanceObserver(this, this.element);\n        this.linkInterceptor = new LinkInterceptor(this, this.element);\n        this.formInterceptor = new FormInterceptor(this, this.element);\n    }\n    connect() {\n        if (!this.connected) {\n            this.connected = true;\n            this.reloadable = false;\n            if (this.loadingStyle == FrameLoadingStyle.lazy) {\n                this.appearanceObserver.start();\n            }\n            this.linkInterceptor.start();\n            this.formInterceptor.start();\n            this.sourceURLChanged();\n        }\n    }\n    disconnect() {\n        if (this.connected) {\n            this.connected = false;\n            this.appearanceObserver.stop();\n            this.linkInterceptor.stop();\n            this.formInterceptor.stop();\n        }\n    }\n    disabledChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.eager) {\n            this.loadSourceURL();\n        }\n    }\n    sourceURLChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n            this.loadSourceURL();\n        }\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.settingSourceURL && this.enabled && this.isActive && (this.reloadable || this.sourceURL != this.currentURL)) {\n            const previousURL = this.currentURL;\n            this.currentURL = this.sourceURL;\n            if (this.sourceURL) {\n                try {\n                    this.element.loaded = this.visit(expandURL(this.sourceURL));\n                    this.appearanceObserver.stop();\n                    await this.element.loaded;\n                    this.hasBeenLoaded = true;\n                }\n                catch (error) {\n                    this.currentURL = previousURL;\n                    throw error;\n                }\n            }\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 { body } = parseHTMLDocument(html);\n                const snapshot = new Snapshot(await this.extractForeignFrameElement(body));\n                const renderer = new FrameRenderer(this.view.snapshot, snapshot, false, false);\n                if (this.view.renderPromise)\n                    await this.view.renderPromise;\n                await this.view.render(renderer);\n                session.frameRendered(fetchResponse, this.element);\n                session.frameLoaded(this.element);\n                this.fetchResponseLoaded(fetchResponse);\n            }\n        }\n        catch (error) {\n            console.error(error);\n            this.view.invalidate();\n        }\n        finally {\n            this.fetchResponseLoaded = () => { };\n        }\n    }\n    elementAppearedInViewport(element) {\n        this.loadSourceURL();\n    }\n    shouldInterceptLinkClick(element, url) {\n        if (element.hasAttribute(\"data-turbo-method\")) {\n            return false;\n        }\n        else {\n            return this.shouldInterceptNavigation(element);\n        }\n    }\n    linkClickIntercepted(element, url) {\n        this.reloadable = true;\n        this.navigateFrame(element, url);\n    }\n    shouldInterceptFormSubmission(element, submitter) {\n        return this.shouldInterceptNavigation(element, submitter);\n    }\n    formSubmissionIntercepted(element, submitter) {\n        if (this.formSubmission) {\n            this.formSubmission.stop();\n        }\n        this.reloadable = false;\n        this.formSubmission = new FormSubmission(this, element, submitter);\n        const { fetchRequest } = this.formSubmission;\n        this.prepareHeadersForRequest(fetchRequest.headers, fetchRequest);\n        this.formSubmission.start();\n    }\n    prepareHeadersForRequest(headers, request) {\n        headers[\"Turbo-Frame\"] = this.id;\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    requestFailedWithResponse(request, response) {\n        console.error(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        this.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n        frame.delegate.loadResponse(response);\n    }\n    formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n        this.element.delegate.loadResponse(fetchResponse);\n    }\n    formSubmissionErrored(formSubmission, error) {\n        console.error(error);\n    }\n    formSubmissionFinished({ formElement }) {\n        clearBusyState(formElement, this.findFrameElement(formElement));\n    }\n    allowsImmediateRender(snapshot, resume) {\n        return true;\n    }\n    viewRenderedSnapshot(snapshot, isPreview) {\n    }\n    viewInvalidated() {\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        this.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n        frame.setAttribute(\"reloadable\", \"\");\n        frame.src = url;\n    }\n    proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n        const action = getAttribute(\"data-turbo-action\", submitter, element, frame);\n        if (isAction(action)) {\n            const { visitCachedSnapshot } = new SnapshotSubstitution(frame);\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                    session.visit(frame.src, { action, response, visitCachedSnapshot, willRender: false });\n                }\n            };\n        }\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            if (element = activateElement(container.querySelector(`turbo-frame#${id}`), this.currentURL)) {\n                return element;\n            }\n            if (element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.currentURL)) {\n                await element.loaded;\n                return await this.extractForeignFrameElement(element);\n            }\n            console.error(`Response has no matching <turbo-frame id=\"${id}\"> element`);\n        }\n        catch (error) {\n            console.error(error);\n        }\n        return new FrameElement();\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.elementDriveEnabled(element)) {\n            return false;\n        }\n        if (submitter && !session.elementDriveEnabled(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    get reloadable() {\n        const frame = this.findFrameElement(this.element);\n        return frame.hasAttribute(\"reloadable\");\n    }\n    set reloadable(value) {\n        const frame = this.findFrameElement(this.element);\n        if (value) {\n            frame.setAttribute(\"reloadable\", \"\");\n        }\n        else {\n            frame.removeAttribute(\"reloadable\");\n        }\n    }\n    set sourceURL(sourceURL) {\n        this.settingSourceURL = true;\n        this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n        this.currentURL = this.element.src;\n        this.settingSourceURL = false;\n    }\n    get loadingStyle() {\n        return this.element.loading;\n    }\n    get isLoading() {\n        return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\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}\nclass SnapshotSubstitution {\n    constructor(element) {\n        this.visitCachedSnapshot = ({ element }) => {\n            var _a;\n            const { id, clone } = this;\n            (_a = element.querySelector(\"#\" + id)) === null || _a === void 0 ? void 0 : _a.replaceWith(clone);\n        };\n        this.clone = element.cloneNode(true);\n        this.id = element.id;\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\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(e => {\n            e.innerHTML = \"\";\n            e.append(this.templateContent);\n        });\n    }\n};\n\nclass StreamElement extends HTMLElement {\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            if (this.dispatchEvent(this.beforeRenderEvent)) {\n                await nextAnimationFrame();\n                this.performAction();\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 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\", { bubbles: true, cancelable: true });\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\nFrameElement.delegateConstructor = FrameController;\ncustomElements.define(\"turbo-frame\", FrameElement);\ncustomElements.define(\"turbo-stream\", StreamElement);\n\n(() => {\n    let element = document.currentScript;\n    if (!element)\n        return;\n    if (element.hasAttribute(\"data-turbo-suppress-warning\"))\n        return;\n    while (element = element.parentElement) {\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    }\n})();\n\nwindow.Turbo = Turbo;\nstart();\n\nexport { PageRenderer, PageSnapshot, clearCache, connectStreamSource, disconnectStreamSource, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, 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", "import { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\"\nimport { subscribeTo } from \"./cable\"\n\nclass TurboCableStreamSourceElement extends HTMLElement {\n  async connectedCallback() {\n    connectStreamSource(this)\n    this.subscription = await subscribeTo(this.channel, { received: this.dispatchMessageEvent.bind(this) })\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  get channel() {\n    const channel = this.getAttribute(\"channel\")\n    const signed_stream_name = this.getAttribute(\"signed-stream-name\")\n    return { channel, signed_stream_name }\n  }\n}\n\ncustomElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement)\n", "/*\nStimulus 3.2.1\nCopyright \u00A9 2023 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    hasBindings() {\n        return this.unorderedBindings.size > 0;\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()).reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n    }\n    bindingConnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n    }\n    bindingDisconnected(binding, clearEventListeners = false) {\n        this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n        if (clearEventListeners)\n            this.clearEventListenersForBinding(binding);\n    }\n    handleError(error, message, detail = {}) {\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    clearEventListenersForBinding(binding) {\n        const eventListener = this.fetchEventListenerForBinding(binding);\n        if (!eventListener.hasBindings()) {\n            eventListener.disconnect();\n            this.removeMappedEventListenerFor(binding);\n        }\n    }\n    removeMappedEventListenerFor(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        eventListenerMap.delete(cacheKey);\n        if (eventListenerMap.size == 0)\n            this.eventListenerMaps.delete(eventTarget);\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)\n            .sort()\n            .forEach((key) => {\n            parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n        });\n        return parts.join(\":\");\n    }\n}\n\nconst defaultActionDescriptorFilters = {\n    stop({ event, value }) {\n        if (value)\n            event.stopPropagation();\n        return true;\n    },\n    prevent({ event, value }) {\n        if (value)\n            event.preventDefault();\n        return true;\n    },\n    self({ event, value, element }) {\n        if (value) {\n            return element === event.target;\n        }\n        else {\n            return true;\n        }\n    },\n};\nconst descriptorPattern = /^(?:(?:([^.]+?)\\+)?(.+?)(?:\\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n    const source = descriptorString.trim();\n    const matches = source.match(descriptorPattern) || [];\n    let eventName = matches[2];\n    let keyFilter = matches[3];\n    if (keyFilter && ![\"keydown\", \"keyup\", \"keypress\"].includes(eventName)) {\n        eventName += `.${keyFilter}`;\n        keyFilter = \"\";\n    }\n    return {\n        eventTarget: parseEventTarget(matches[4]),\n        eventName,\n        eventOptions: matches[7] ? parseEventOptions(matches[7]) : {},\n        identifier: matches[5],\n        methodName: matches[6],\n        keyFilter: matches[1] || keyFilter,\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\n        .split(\":\")\n        .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 namespaceCamelize(value) {\n    return camelize(value.replace(/--/g, \"-\").replace(/__/g, \"_\"));\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\nfunction isSomething(object) {\n    return object !== null && object !== undefined;\n}\nfunction hasProperty(object, property) {\n    return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nconst allModifiers = [\"meta\", \"ctrl\", \"alt\", \"shift\"];\nclass Action {\n    constructor(element, index, descriptor, schema) {\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        this.keyFilter = descriptor.keyFilter || \"\";\n        this.schema = schema;\n    }\n    static forToken(token, schema) {\n        return new this(token.element, token.index, parseActionDescriptorString(token.content), schema);\n    }\n    toString() {\n        const eventFilter = this.keyFilter ? `.${this.keyFilter}` : \"\";\n        const eventTarget = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n        return `${this.eventName}${eventFilter}${eventTarget}->${this.identifier}#${this.methodName}`;\n    }\n    shouldIgnoreKeyboardEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = this.keyFilter.split(\"+\");\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        const standardFilter = filters.filter((key) => !allModifiers.includes(key))[0];\n        if (!standardFilter) {\n            return false;\n        }\n        if (!hasProperty(this.keyMappings, standardFilter)) {\n            error(`contains unknown key filter: ${this.keyFilter}`);\n        }\n        return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();\n    }\n    shouldIgnoreMouseEvent(event) {\n        if (!this.keyFilter) {\n            return false;\n        }\n        const filters = [this.keyFilter];\n        if (this.keyFilterDissatisfied(event, filters)) {\n            return true;\n        }\n        return false;\n    }\n    get params() {\n        const params = {};\n        const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`, \"i\");\n        for (const { name, value } of Array.from(this.element.attributes)) {\n            const match = name.match(pattern);\n            const key = match && match[1];\n            if (key) {\n                params[camelize(key)] = typecast(value);\n            }\n        }\n        return params;\n    }\n    get eventTargetName() {\n        return stringifyEventTarget(this.eventTarget);\n    }\n    get keyMappings() {\n        return this.schema.keyMappings;\n    }\n    keyFilterDissatisfied(event, filters) {\n        const [meta, ctrl, alt, shift] = allModifiers.map((modifier) => filters.includes(modifier));\n        return event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== alt || event.shiftKey !== shift;\n    }\n}\nconst defaultEventNames = {\n    a: () => \"click\",\n    button: () => \"click\",\n    form: () => \"submit\",\n    details: () => \"toggle\",\n    input: (e) => (e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\"),\n    select: () => \"change\",\n    textarea: () => \"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        const actionEvent = this.prepareActionEvent(event);\n        if (this.willBeInvokedByEvent(event) && this.applyEventModifiers(actionEvent)) {\n            this.invokeWithEvent(actionEvent);\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    applyEventModifiers(event) {\n        const { element } = this.action;\n        const { actionDescriptorFilters } = this.context.application;\n        const { controller } = this.context;\n        let passes = true;\n        for (const [name, value] of Object.entries(this.eventOptions)) {\n            if (name in actionDescriptorFilters) {\n                const filter = actionDescriptorFilters[name];\n                passes = passes && filter({ name, value, event, element, controller });\n            }\n            else {\n                continue;\n            }\n        }\n        return passes;\n    }\n    prepareActionEvent(event) {\n        return Object.assign(event, { params: this.action.params });\n    }\n    invokeWithEvent(event) {\n        const { target, currentTarget } = event;\n        try {\n            this.method.call(this.controller, event);\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 (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {\n            return false;\n        }\n        if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {\n            return false;\n        }\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(element, attributeName) {\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\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 SelectorObserver {\n    constructor(element, selector, delegate, details) {\n        this._selector = selector;\n        this.details = details;\n        this.elementObserver = new ElementObserver(element, this);\n        this.delegate = delegate;\n        this.matchesByElement = new Multimap();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    get selector() {\n        return this._selector;\n    }\n    set selector(selector) {\n        this._selector = selector;\n        this.refresh();\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 element() {\n        return this.elementObserver.element;\n    }\n    matchElement(element) {\n        const { selector } = this;\n        if (selector) {\n            const matches = element.matches(selector);\n            if (this.delegate.selectorMatchElement) {\n                return matches && this.delegate.selectorMatchElement(element, this.details);\n            }\n            return matches;\n        }\n        else {\n            return false;\n        }\n    }\n    matchElementsInTree(tree) {\n        const { selector } = this;\n        if (selector) {\n            const match = this.matchElement(tree) ? [tree] : [];\n            const matches = Array.from(tree.querySelectorAll(selector)).filter((match) => this.matchElement(match));\n            return match.concat(matches);\n        }\n        else {\n            return [];\n        }\n    }\n    elementMatched(element) {\n        const { selector } = this;\n        if (selector) {\n            this.selectorMatched(element, selector);\n        }\n    }\n    elementUnmatched(element) {\n        const selectors = this.matchesByElement.getKeysForValue(element);\n        for (const selector of selectors) {\n            this.selectorUnmatched(element, selector);\n        }\n    }\n    elementAttributeChanged(element, _attributeName) {\n        const { selector } = this;\n        if (selector) {\n            const matches = this.matchElement(element);\n            const matchedBefore = this.matchesByElement.has(selector, element);\n            if (matches && !matchedBefore) {\n                this.selectorMatched(element, selector);\n            }\n            else if (!matches && matchedBefore) {\n                this.selectorUnmatched(element, selector);\n            }\n        }\n    }\n    selectorMatched(element, selector) {\n        this.delegate.selectorMatched(element, selector, this.details);\n        this.matchesByElement.add(selector, element);\n    }\n    selectorUnmatched(element, selector) {\n        this.delegate.selectorUnmatched(element, selector, this.details);\n        this.matchesByElement.delete(selector, element);\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\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).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\n        .trim()\n        .split(/\\s+/)\n        .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, true));\n        this.bindingsByAction.clear();\n    }\n    parseValueForToken(token) {\n        const action = Action.forToken(token, this.schema);\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    }\n    start() {\n        this.stringMapObserver.start();\n        this.invokeChangedCallbacksForDefaultValues();\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            try {\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            catch (error) {\n                if (error instanceof TypeError) {\n                    error.message = `Stimulus Value \"${this.context.identifier}.${descriptor.name}\" - ${error.message}`;\n                }\n                throw error;\n            }\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\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\nclass OutletObserver {\n    constructor(context, delegate) {\n        this.started = false;\n        this.context = context;\n        this.delegate = delegate;\n        this.outletsByName = new Multimap();\n        this.outletElementsByName = new Multimap();\n        this.selectorObserverMap = new Map();\n        this.attributeObserverMap = new Map();\n    }\n    start() {\n        if (!this.started) {\n            this.outletDefinitions.forEach((outletName) => {\n                this.setupSelectorObserverForOutlet(outletName);\n                this.setupAttributeObserverForOutlet(outletName);\n            });\n            this.started = true;\n            this.dependentContexts.forEach((context) => context.refresh());\n        }\n    }\n    refresh() {\n        this.selectorObserverMap.forEach((observer) => observer.refresh());\n        this.attributeObserverMap.forEach((observer) => observer.refresh());\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.disconnectAllOutlets();\n            this.stopSelectorObservers();\n            this.stopAttributeObservers();\n        }\n    }\n    stopSelectorObservers() {\n        if (this.selectorObserverMap.size > 0) {\n            this.selectorObserverMap.forEach((observer) => observer.stop());\n            this.selectorObserverMap.clear();\n        }\n    }\n    stopAttributeObservers() {\n        if (this.attributeObserverMap.size > 0) {\n            this.attributeObserverMap.forEach((observer) => observer.stop());\n            this.attributeObserverMap.clear();\n        }\n    }\n    selectorMatched(element, _selector, { outletName }) {\n        const outlet = this.getOutlet(element, outletName);\n        if (outlet) {\n            this.connectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorUnmatched(element, _selector, { outletName }) {\n        const outlet = this.getOutletFromMap(element, outletName);\n        if (outlet) {\n            this.disconnectOutlet(outlet, element, outletName);\n        }\n    }\n    selectorMatchElement(element, { outletName }) {\n        const selector = this.selector(outletName);\n        const hasOutlet = this.hasOutlet(element, outletName);\n        const hasOutletController = element.matches(`[${this.schema.controllerAttribute}~=${outletName}]`);\n        if (selector) {\n            return hasOutlet && hasOutletController && element.matches(selector);\n        }\n        else {\n            return false;\n        }\n    }\n    elementMatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementAttributeValueChanged(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    elementUnmatchedAttribute(_element, attributeName) {\n        const outletName = this.getOutletNameFromOutletAttributeName(attributeName);\n        if (outletName) {\n            this.updateSelectorObserverForOutlet(outletName);\n        }\n    }\n    connectOutlet(outlet, element, outletName) {\n        var _a;\n        if (!this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.add(outletName, outlet);\n            this.outletElementsByName.add(outletName, element);\n            (_a = this.selectorObserverMap.get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletConnected(outlet, element, outletName));\n        }\n    }\n    disconnectOutlet(outlet, element, outletName) {\n        var _a;\n        if (this.outletElementsByName.has(outletName, element)) {\n            this.outletsByName.delete(outletName, outlet);\n            this.outletElementsByName.delete(outletName, element);\n            (_a = this.selectorObserverMap\n                .get(outletName)) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.outletDisconnected(outlet, element, outletName));\n        }\n    }\n    disconnectAllOutlets() {\n        for (const outletName of this.outletElementsByName.keys) {\n            for (const element of this.outletElementsByName.getValuesForKey(outletName)) {\n                for (const outlet of this.outletsByName.getValuesForKey(outletName)) {\n                    this.disconnectOutlet(outlet, element, outletName);\n                }\n            }\n        }\n    }\n    updateSelectorObserverForOutlet(outletName) {\n        const observer = this.selectorObserverMap.get(outletName);\n        if (observer) {\n            observer.selector = this.selector(outletName);\n        }\n    }\n    setupSelectorObserverForOutlet(outletName) {\n        const selector = this.selector(outletName);\n        const selectorObserver = new SelectorObserver(document.body, selector, this, { outletName });\n        this.selectorObserverMap.set(outletName, selectorObserver);\n        selectorObserver.start();\n    }\n    setupAttributeObserverForOutlet(outletName) {\n        const attributeName = this.attributeNameForOutletName(outletName);\n        const attributeObserver = new AttributeObserver(this.scope.element, attributeName, this);\n        this.attributeObserverMap.set(outletName, attributeObserver);\n        attributeObserver.start();\n    }\n    selector(outletName) {\n        return this.scope.outlets.getSelectorForOutletName(outletName);\n    }\n    attributeNameForOutletName(outletName) {\n        return this.scope.schema.outletAttributeForScope(this.identifier, outletName);\n    }\n    getOutletNameFromOutletAttributeName(attributeName) {\n        return this.outletDefinitions.find((outletName) => this.attributeNameForOutletName(outletName) === attributeName);\n    }\n    get outletDependencies() {\n        const dependencies = new Multimap();\n        this.router.modules.forEach((module) => {\n            const constructor = module.definition.controllerConstructor;\n            const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n            outlets.forEach((outlet) => dependencies.add(outlet, module.identifier));\n        });\n        return dependencies;\n    }\n    get outletDefinitions() {\n        return this.outletDependencies.getKeysForValue(this.identifier);\n    }\n    get dependentControllerIdentifiers() {\n        return this.outletDependencies.getValuesForKey(this.identifier);\n    }\n    get dependentContexts() {\n        const identifiers = this.dependentControllerIdentifiers;\n        return this.router.contexts.filter((context) => identifiers.includes(context.identifier));\n    }\n    hasOutlet(element, outletName) {\n        return !!this.getOutlet(element, outletName) || !!this.getOutletFromMap(element, outletName);\n    }\n    getOutlet(element, outletName) {\n        return this.application.getControllerForElementAndIdentifier(element, outletName);\n    }\n    getOutletFromMap(element, outletName) {\n        return this.outletsByName.getValuesForKey(outletName).find((outlet) => outlet.element === element);\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get router() {\n        return this.application.router;\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        this.outletObserver = new OutletObserver(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        this.outletObserver.start();\n        try {\n            this.controller.connect();\n            this.logDebugActivity(\"connect\");\n        }\n        catch (error) {\n            this.handleError(error, \"connecting controller\");\n        }\n    }\n    refresh() {\n        this.outletObserver.refresh();\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.outletObserver.stop();\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    outletConnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletConnected`, outlet, element);\n    }\n    outletDisconnected(outlet, element, name) {\n        this.invokeControllerMethod(`${namespaceCamelize(name)}OutletDisconnected`, outlet, 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 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) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];\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 () {\n            this.a.call(this);\n        };\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 || this.findTarget(targetName) || 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 OutletSet {\n    constructor(scope, controllerElement) {\n        this.scope = scope;\n        this.controllerElement = controllerElement;\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(outletName) {\n        return this.find(outletName) != null;\n    }\n    find(...outletNames) {\n        return outletNames.reduce((outlet, outletName) => outlet || this.findOutlet(outletName), undefined);\n    }\n    findAll(...outletNames) {\n        return outletNames.reduce((outlets, outletName) => [...outlets, ...this.findAllOutlets(outletName)], []);\n    }\n    getSelectorForOutletName(outletName) {\n        const attributeName = this.schema.outletAttributeForScope(this.identifier, outletName);\n        return this.controllerElement.getAttribute(attributeName);\n    }\n    findOutlet(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        if (selector)\n            return this.findElement(selector, outletName);\n    }\n    findAllOutlets(outletName) {\n        const selector = this.getSelectorForOutletName(outletName);\n        return selector ? this.findAllElements(selector, outletName) : [];\n    }\n    findElement(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName))[0];\n    }\n    findAllElements(selector, outletName) {\n        const elements = this.scope.queryElements(selector);\n        return elements.filter((element) => this.matchesElement(element, selector, outletName));\n    }\n    matchesElement(element, selector, outletName) {\n        const controllerAttribute = element.getAttribute(this.scope.schema.controllerAttribute) || \"\";\n        return element.matches(selector) && controllerAttribute.split(\" \").includes(outletName);\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        this.outlets = new OutletSet(this.documentScope, element);\n    }\n    findElement(selector) {\n        return this.element.matches(selector) ? this.element : 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    get isDocumentScope() {\n        return this.element === document.documentElement;\n    }\n    get documentScope() {\n        return this.isDocumentScope\n            ? this\n            : new Scope(this.schema, document.documentElement, this.identifier, this.guide.logger);\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        return this.parseValueForElementAndIdentifier(element, identifier);\n    }\n    parseValueForElementAndIdentifier(element, identifier) {\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        const afterLoad = definition.controllerConstructor.afterLoad;\n        if (afterLoad) {\n            afterLoad.call(definition.controllerConstructor, definition.identifier, this.application);\n        }\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    proposeToConnectScopeForElementAndIdentifier(element, identifier) {\n        const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier);\n        if (scope) {\n            this.scopeObserver.elementMatchedValue(scope.element, scope);\n        }\n        else {\n            console.error(`Couldn't find or create scope for identifier: \"${identifier}\" and 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    outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,\n    keyMappings: Object.assign(Object.assign({ enter: \"Enter\", tab: \"Tab\", esc: \"Escape\", space: \" \", up: \"ArrowUp\", down: \"ArrowDown\", left: \"ArrowLeft\", right: \"ArrowRight\", home: \"Home\", end: \"End\", page_up: \"PageUp\", page_down: \"PageDown\" }, objectFromEntries(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((c) => [c, c]))), objectFromEntries(\"0123456789\".split(\"\").map((n) => [n, n]))),\n};\nfunction objectFromEntries(array) {\n    return array.reduce((memo, [k, v]) => (Object.assign(Object.assign({}, memo), { [k]: v })), {});\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        this.actionDescriptorFilters = Object.assign({}, defaultActionDescriptorFilters);\n    }\n    static start(element, schema) {\n        const application = new this(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        this.load({ identifier, controllerConstructor });\n    }\n    registerActionOption(name, filter) {\n        this.actionDescriptorFilters[name] = filter;\n    }\n    load(head, ...rest) {\n        const definitions = Array.isArray(head) ? head : [head, ...rest];\n        definitions.forEach((definition) => {\n            if (definition.controllerConstructor.shouldLoad) {\n                this.router.loadDefinition(definition);\n            }\n        });\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 OutletPropertiesBlessing(constructor) {\n    const outlets = readInheritableStaticArrayValues(constructor, \"outlets\");\n    return outlets.reduce((properties, outletDefinition) => {\n        return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));\n    }, {});\n}\nfunction getOutletController(controller, element, identifier) {\n    return controller.application.getControllerForElementAndIdentifier(element, identifier);\n}\nfunction getControllerAndEnsureConnectedScope(controller, element, outletName) {\n    let outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n    controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);\n    outletController = getOutletController(controller, element, outletName);\n    if (outletController)\n        return outletController;\n}\nfunction propertiesForOutletDefinition(name) {\n    const camelizedName = namespaceCamelize(name);\n    return {\n        [`${camelizedName}Outlet`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                    if (outletController)\n                        return outletController;\n                    throw new Error(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`);\n                }\n                throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n            },\n        },\n        [`${camelizedName}Outlets`]: {\n            get() {\n                const outlets = this.outlets.findAll(name);\n                if (outlets.length > 0) {\n                    return outlets\n                        .map((outletElement) => {\n                        const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);\n                        if (outletController)\n                            return outletController;\n                        console.warn(`The provided outlet element is missing an outlet controller \"${name}\" instance for host controller \"${this.identifier}\"`, outletElement);\n                    })\n                        .filter((controller) => controller);\n                }\n                return [];\n            },\n        },\n        [`${camelizedName}OutletElement`]: {\n            get() {\n                const outletElement = this.outlets.find(name);\n                const selector = this.outlets.getSelectorForOutletName(name);\n                if (outletElement) {\n                    return outletElement;\n                }\n                else {\n                    throw new Error(`Missing outlet element \"${name}\" for host controller \"${this.identifier}\". Stimulus couldn't find a matching outlet element using selector \"${selector}\".`);\n                }\n            },\n        },\n        [`${camelizedName}OutletElements`]: {\n            get() {\n                return this.outlets.findAll(name);\n            },\n        },\n        [`has${capitalize(camelizedName)}Outlet`]: {\n            get() {\n                return this.outlets.has(name);\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, this.identifier);\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, controller) {\n    const definition = parseValueDefinitionPair(valueDefinitionPair, controller);\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], controller) {\n    return valueDescriptorForTokenAndTypeDefinition({\n        controller,\n        token,\n        typeDefinition,\n    });\n}\nfunction parseValueTypeConstant(constant) {\n    switch (constant) {\n        case Array:\n            return \"array\";\n        case Boolean:\n            return \"boolean\";\n        case Number:\n            return \"number\";\n        case Object:\n            return \"object\";\n        case String:\n            return \"string\";\n    }\n}\nfunction parseValueTypeDefault(defaultValue) {\n    switch (typeof defaultValue) {\n        case \"boolean\":\n            return \"boolean\";\n        case \"number\":\n            return \"number\";\n        case \"string\":\n            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(payload) {\n    const { controller, token, typeObject } = payload;\n    const hasType = isSomething(typeObject.type);\n    const hasDefault = isSomething(typeObject.default);\n    const fullObject = hasType && hasDefault;\n    const onlyType = hasType && !hasDefault;\n    const onlyDefault = !hasType && hasDefault;\n    const typeFromObject = parseValueTypeConstant(typeObject.type);\n    const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);\n    if (onlyType)\n        return typeFromObject;\n    if (onlyDefault)\n        return typeFromDefaultValue;\n    if (typeFromObject !== typeFromDefaultValue) {\n        const propertyPath = controller ? `${controller}.${token}` : token;\n        throw new Error(`The specified default value for the Stimulus Value \"${propertyPath}\" must match the defined type \"${typeFromObject}\". The provided default value of \"${typeObject.default}\" is of type \"${typeFromDefaultValue}\".`);\n    }\n    if (fullObject)\n        return typeFromObject;\n}\nfunction parseValueTypeDefinition(payload) {\n    const { controller, token, typeDefinition } = payload;\n    const typeObject = { controller, token, typeObject: typeDefinition };\n    const typeFromObject = parseValueTypeObject(typeObject);\n    const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n    const typeFromConstant = parseValueTypeConstant(typeDefinition);\n    const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n    if (type)\n        return type;\n    const propertyPath = controller ? `${controller}.${typeDefinition}` : token;\n    throw new Error(`Unknown value type \"${propertyPath}\" for \"${token}\" value`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n    const constant = parseValueTypeConstant(typeDefinition);\n    if (constant)\n        return defaultValuesByType[constant];\n    const hasDefault = hasProperty(typeDefinition, \"default\");\n    const hasType = hasProperty(typeDefinition, \"type\");\n    const typeObject = typeDefinition;\n    if (hasDefault)\n        return typeObject.default;\n    if (hasType) {\n        const { type } = typeObject;\n        const constantFromType = parseValueTypeConstant(type);\n        if (constantFromType)\n            return defaultValuesByType[constantFromType];\n    }\n    return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(payload) {\n    const { token, typeDefinition } = payload;\n    const key = `${dasherize(token)}-value`;\n    const type = parseValueTypeDefinition(payload);\n    return {\n        type,\n        key,\n        name: camelize(key),\n        get defaultValue() {\n            return defaultValueForDefinition(typeDefinition);\n        },\n        get hasCustomDefaultValue() {\n            return parseValueTypeDefault(typeDefinition) !== undefined;\n        },\n        reader: readers[type],\n        writer: writers[type] || writers.default,\n    };\n}\nconst defaultValuesByType = {\n    get array() {\n        return [];\n    },\n    boolean: false,\n    number: 0,\n    get object() {\n        return {};\n    },\n    string: \"\",\n};\nconst readers = {\n    array(value) {\n        const array = JSON.parse(value);\n        if (!Array.isArray(array)) {\n            throw new TypeError(`expected value of type \"array\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(array)}\"`);\n        }\n        return array;\n    },\n    boolean(value) {\n        return !(value == \"0\" || String(value).toLowerCase() == \"false\");\n    },\n    number(value) {\n        return Number(value.replace(/_/g, \"\"));\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 value of type \"object\" but instead got value \"${value}\" of type \"${parseValueTypeDefault(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    static afterLoad(_identifier, _application) {\n        return;\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 outlets() {\n        return this.scope.outlets;\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 = [\n    ClassPropertiesBlessing,\n    TargetPropertiesBlessing,\n    ValuePropertiesBlessing,\n    OutletPropertiesBlessing,\n];\nController.targets = [];\nController.outlets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, SelectorObserver, 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", "import dayjs from 'dayjs' // ES 2015\nlet relativeTime = require('dayjs/plugin/relativeTime')\nlet updateLocale = require('dayjs/plugin/updateLocale')\ndayjs.extend(relativeTime)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('en', {\n  relativeTime: {\n    future: \"in %s\",\n    past: \"%s ago\",\n    s: \"A few seconds\",\n    m: \"A minute\",\n    mm: \"%d minutes\",\n    h: \"An hour\",\n    hh: \"%d hours\",\n    d: \"A day\",\n    dd: \"%d days\",\n    M: \"A month\",\n    MM: \"%d months\",\n    y: \"A year\",\n    yy: \"%d years\"\n  }\n})\n\nlet intervId;\n\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"activity\"\nexport default class extends Controller {\n\n  static targets = ['accountToggle', 'networkToggle', 'list']\n\n  connect() {\n    if (!intervId) {\n      intervId = setInterval(updateDayjsTimes, 60000); // Update activity times once a minute if they are newer then\n    }\n  }\n\n  disconnect() {\n    clearInterval(intervId);\n  }\n\n  feedItemTemplate(item, options = {'initialLoad': true, 'returnChild': false}) {\n    var type = item.context == 'recentBlogPost' ? 'blog-post' : 'content-post';\n    const createdAt = new Date(item.createdAt.seconds * 1000);\n    switch (item.activity_type) {\n      case 'custom':\n        return this.customFeedItemTemplate(item, createdAt, options);\n      case 'ticket_purchase':\n        return this.ticketPurchasedFeedItemTemplate(item, createdAt, options);\n      case 'purchase':\n        return this.purchaseFeedItemTemplate(item, createdAt, options);\n      case 'blog_comment':\n        return this.blogCommentFeedItemTemplate(item, createdAt, options);\n      case 'blog_post':\n        return this.blogPostFeedItemTemplate(item, createdAt, options);\n      case 'inquiry_received':\n        return this.inquiryReceivedFeedItemTemplate(item, createdAt, options);\n      case 'listing_saved':\n      case 'vacation_rental_saved':\n      case 'development_saved':\n      case 'vacation_rental_emailed_to_friend':\n        return this.listingFeedItemTemplate(item, createdAt, options);\n      default:\n        return this.defaultFeedItemTemplate(item, createdAt, options);\n    }\n\n  }\n\n  populateAccountActivity() {\n    this.firebaseController.populateActivityStream();\n    this.accountToggleTarget.classList.add('active');\n    this.networkToggleTarget.classList.remove('active');\n  }\n\n  populateNetworkActivity() {\n    this.firebaseController.populateActivityStream(false);\n    this.networkToggleTarget.classList.add('active');\n    this.accountToggleTarget.classList.remove('active');\n  }\n\n  toggleAccountActivity() {\n    this.firebaseController.networkActivityFeedTargets.forEach(function(networkActivityFeed) {\n      networkActivityFeed.classList.add('hidden');\n    });\n\n    this.firebaseController.accountActivityFeedTargets.forEach(function(accountActivityFeed) {\n      accountActivityFeed.classList.remove('hidden');\n    });\n\n    let accountToggles = document.querySelectorAll('.toggle-button.account');\n    let networkToggles = document.querySelectorAll('.toggle-button.network');\n\n    [].forEach.call(accountToggles, function(accountToggle) {\n      accountToggle.classList.add('active');\n    });\n\n    [].forEach.call(networkToggles, function(networkToggle) {\n      networkToggle.classList.remove('active');\n    });\n  }\n\n  toggleNetworkActivity() {\n    this.firebaseController.networkActivityFeedTargets.forEach(function(networkActivityFeed) {\n      networkActivityFeed.classList.remove('hidden');\n    });\n\n    this.firebaseController.accountActivityFeedTargets.forEach(function(accountActivityFeed) {\n      accountActivityFeed.classList.add('hidden');\n    });\n\n    let accountToggles = document.querySelectorAll('.toggle-button.account');\n    let networkToggles = document.querySelectorAll('.toggle-button.network');\n\n    [].forEach.call(accountToggles, function(accountToggle) {\n      accountToggle.classList.remove('active');\n    });\n\n    [].forEach.call(networkToggles, function(networkToggle) {\n      networkToggle.classList.add('active');\n    });\n  }\n\n\n  feedItemElement(content, item, createdAt, options) {\n\n    if (options.returnChild) {\n      return this.feedItemElementChild(content, item, createdAt);\n    } else {\n      let initalClass = options.initialLoad ? 'initialLoad' : '';\n      // let creation = item.createdAt.seconds;\n      return `<li id=\"activity-${item.id}\" class=\"activity-item ${initalClass}\" data-item-id=\"${item.id}\">\n        ${this.feedItemElementChild(content, item, createdAt)}\n      </li>`;\n    }\n  }\n\n  feedItemElementChild(content, item, createdAt) {\n    return `<div class=\"relative pb-8\">\n      <span class=\"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200 dark:bg-gray-700 connector\" aria-hidden=\"true\"></span>\n      <div class=\"relative flex space-x-3\">\n        ${this.profileImage(item.profile)}\n        <div class=\"min-w-0 flex-1 flex justify-between flex-col\">\n          ${content}\n          ${this.relativeTime(createdAt)}\n        </div>\n      </div>\n    </div>`;\n  }\n\n  customFeedItemTemplate(item, createdAt, options) {\n    var attachment;\n    if (item.attachment) {\n      attachment = `<p class=\"text-xs text-gray-500 dark:text-gray-400\"><a href=\"${item.attachment.url}\" target=\"_blank\">${item.attachment.name}</a></p>`;\n    } else {\n      attachment = ``;\n    }\n    let content = `<div>\n              <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.message}</p>\n              ${attachment}\n            </div>\n            `;\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  blogPostFeedItemTemplate(item, createdAt, options) {\n    let postLink = `<a href=\"${this.blogPostLink(item.blog_post)}\" target=\"_blank\">${item.blog_post.name}</a> `;\n    let content = `<div>\n              ${this.profileLink(item.profile)}\n              <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content.replace(\"{{link}}\", postLink)}</p>\n            </div>\n            `;\n\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  blogCommentFeedItemTemplate(item, createdAt, options) {\n    let postLink = `<a href=\"${this.blogPostLink(item.blog_post)}\">${item.blog_post.name}</a>.`;\n    let content = `<div>\n                    ${this.profileLink(item.profile)}\n                    <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content.replace(\"{{link}}\", postLink)}</p>\n                  </div>`;\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  listingFeedItemTemplate(item, createdAt, options) {\n    let listing = item.development ? item.development : item.listing;\n    let listingLink = `<a href=\"${listing.link}\" target=\"_blank\">${listingTitle(listing)}</a>`;\n    let content = `<div>\n            ${this.profileLink(item.profile)}\n            <a href=\"${listing.link}\" target=\"_blank\"><img src=\"${this.imageVersion(listing.image.version_base, 'w300h200_s')}\"></a>\n            <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content.replace(\"{{link}}\", listingLink).replace(\"was saved\", \"was favorited\")}</p>\n          </div>\n          `;\n  return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  inquiryReceivedFeedItemTemplate(item, createdAt, options) {\n    let content = `<div>\n              ${this.profileLink(item.profile)}\n              <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content}</p>\n            </div>`;\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  ticketPurchasedFeedItemTemplate(item, createdAt, options) {\n    let eventLink = item.hasOwnProperty('event') ? `<a href=\"${item.event.link}\" target=\"_blank\">${item.event.name}</a>` : 'an event';\n    let content = `<div>\n                    ${this.profileLink(item.profile)}\n                    <p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content.replace(\"{{link}}\", eventLink)}</p>\n                  </div>\n                  `;\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  purchaseFeedItemTemplate(item, createdAt, options) {\n    let categoryGroupPurpose = item.product?.category?.group?.purpose && item.product?.category?.name ? `<p class=\"text-xs text-gray-500 dark:text-gray-400 pb-1\">${item.product?.category?.group?.purpose}:</p>` : '';\n    let categoryName = item.product?.category?.name && item.product?.category?.group?.purpose ? `<p class=\"text-xs text-gray-500 dark:text-gray-400 pb-1\"><a href=\"https://lounge.luxuryrealestate.com/services/categories/${item.product?.category?.id}\">${item.product?.category?.name}</a></p>` : '';\n    let activityText = item.product?.category?.activity_stream_text;\n    let productLink = item.product.enabled ? `<a href=\"https://lounge.luxuryrealestate.com/services/${item.product.id}\" target=\"_blank\">${item.product.name}</a>` : item.product.name;\n    let descriptionText = \"\";\n\n    if (typeof item.product?.category?.name == 'undefined' || typeof item.product?.category?.group?.purpose == 'undefined') {\n      descriptionText = (activityText && activityText !== undefined) ? `<p class=\"text-xs text-gray-500 dark:text-gray-400\">${activityText}</p>` : `<p class=\"text-xs text-gray-500 dark:text-gray-400\">${item.activity_stream_content.replace(\"{{link}}\", productLink)}</p>`;\n    }\n\n    let content = `<div>\n                    ${this.profileLink(item.profile)}\n                    ${categoryGroupPurpose}\n                    ${categoryName}\n                    ${descriptionText}\n                  </div>`;\n\n    return this.feedItemElement(content, item, createdAt, options);\n  }\n\n  defaultFeedItemTemplate(item, createdAt, options) {\n\n    let text = '';\n\n    if ( item.activity_stream_content != null ) {\n      text = item.activity_stream_content;\n    } else if (item.content != null) {\n      text = item.content;\n    }\n\n    var activityItemLink = '';\n    var activityItemLinkTarget = '';\n\n    if (typeof item.link != 'undefined' && typeof item.link.url != 'undefined' && typeof item.link.title != 'undefined' && item.link.url != null && item.link.title != null) {\n\n      if (!item.link.url.includes(\"lounge.luxuryrealestate.com\")) {\n        activityItemLinkTarget = `target=\"_blank\"`;\n      }\n      activityItemLink = `<p class=\"text-xs text-gray-500 dark:text-gray-400 pb-1\"><a href=\"${item.link.url}\" ${activityItemLinkTarget}>${item.link.title}</a></p>`;\n    }\n\n    if (item.hasOwnProperty('attachment') && item.attachment != null && item.attachment.url != null) {\n\n      var attachmentTypeClass = 'default-file';\n\n      switch (item.attachment.content_type) {\n        case 'image/png':\n        case 'image/jpg':\n        case 'image/jpeg':\n          attachmentTypeClass = 'image-file';\n          break;\n        case 'application/pdf':\n          attachmentTypeClass = 'pdf-file';\n          break;\n        case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n          attachmentTypeClass = 'word-file';\n          break;\n        default:\n          attachmentTypeClass = 'default-file';\n      }\n\n      let itemAttachmentTitle = item.attachment.title != null ? item.attachment.title : 'Download';\n      var activityItemAttachment = `<p class=\"text-xs text-gray-500 dark:text-gray-400 py-1\">\n          <a href=\"${item.attachment.url}\" class=\"file-icon ${attachmentTypeClass}\" target=\"_blank\">${itemAttachmentTitle}</a>\n        </p>`;\n    } else {\n      var activityItemAttachment = '';\n    }\n\n    var linkAndAttachment = '';\n    let showLinkAndAttachment = item.context.includes('a' + this.firebaseController.accountidValue) || item.context.includes('p' + this.firebaseController.profileidValue) || item.context.includes(0);\n\n    if (showLinkAndAttachment) {\n      linkAndAttachment = `${activityItemLink}${activityItemAttachment}`;\n    }\n\n    let content = `<div>\n              ${this.profileLink(item.profile)}\n              <p class=\"text-xs text-gray-500 dark:text-gray-400 pb-1\">${text.replace(\"was saved\", \"was favorited\")}</p>\n              ${linkAndAttachment}\n            </div>\n            `;\n\n    if (text != '') {\n      return this.feedItemElement(content, item, createdAt, options);\n    } else {\n      return ''\n    }\n  }\n\n  profileImage(profile) {\n    // let imageSize = profile.type == 'Agent' ? 'w70h70' : 'w70h70_nc';\n    // let classes = profile.type == 'Agent' ? 'rounded-full' : 'rounded';\n    let imageSize = 'w70h70';\n    let classes = 'rounded-full profile-img';\n    if (profile.is_on_lre) {\n      return `<div>\n        <span class=\"h-8 ${classes} bg-gray-400 flex items-center justify-center ring-4 ring-white dark:ring-gray-700\">\n          <a href=\"${this.profileLink(profile, true)}\" data-turbo=\"false\">\n            <img src=\"${profile.image.version_base.replace('size', imageSize)}\" class=\"${classes} h-8\">\n          </a>\n        </span>\n      </div>`;\n    } else {\n      return `<div>\n        <span class=\"h-8 ${classes} bg-gray-400 flex items-center justify-center ring-4 ring-white dark:ring-gray-700\">\n          <img src=\"${profile.image.version_base.replace('size', imageSize)}\" class=\"${classes} h-8\">\n        </span>\n      </div>`;\n    }\n\n  }\n\n  emptyTemplate() {\n    return `<div id=\"no-recent-activity\">\n      <p class=\"text-xs text-gray-500 dark:text-gray-400\">No recent activity</p>\n    </div>`;\n  }\n\n  profileLink(profile, urlOnly = false) {\n    var profileLinkUrl;\n\n    if (profile.type == \"Agent\" || profile.type == \"Staff\") {\n      profileLinkUrl = profile.link ? profile.link : `https://lounge.luxuryrealestate.com/directory/${profile.id}`;\n    } else {\n      profileLinkUrl = profile.link ? profile.link : (profile.is_on_lre ? `https://www.luxuryrealestate.com/profiles/${profile.id}` : `https://lounge.luxuryrealestate.com/directory/${profile.id}`);\n    }\n\n    if (urlOnly) {\n      return profileLinkUrl;\n    } else {\n      return `<a href=\"${profileLinkUrl}\" class=\"profile-link\" data-turbo=\"false\">${profile.name}</a>`\n    }\n  }\n\n  relativeTime(createdAt) {\n    let creationDate = dayjs(createdAt);\n    return `<div class=\"text-xs whitespace-nowrap text-gray-400 dark:text-gray-500 text-[0.7rem] italic mt-1.5\">\n              <time class=\"dayjs\" datetime=\"${creationDate.format('YYYY-MM-DD HH:mm:ss')}\">${creationDate.fromNow()}</time>\n            </div>`\n  }\n\n  blogPostLink(post) {\n    return 'https://www.luxuryrealestate.com' + post.link;\n  }\n\n  imageVersion(base, version) {\n    return base.replace('size', version);\n  }\n\n  get firebaseController() {\n    var firebaseElement = document.getElementById('firebase')\n    return this.application.getControllerForElementAndIdentifier(firebaseElement, 'firebase');\n  }\n\n}\n\nfunction updateDayjsTimes() {\n  let times = document.querySelectorAll('time.dayjs');\n\n  [].forEach.call(times, (time) => {\n    let creationDate = dayjs(time.getAttribute('datetime'));\n    let newTime = creationDate.fromNow();\n    time.innerHTML = newTime;\n  });\n}\n\n\nfunction listingTitle(listing) {\n  var listingTitle = \"A listing\";\n  if (listing.address_one) {\n    listingTitle = listing.address_one;\n  }\n\n  return listingTitle;\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"alert\"\nexport default class extends Controller {\n\n  static targets = ['alert']\n  \n  alertTargetConnected() {\n    this.alertTargets.forEach((target) => {\n      this.display(target);\n      setTimeout(() => {\n        this.dismiss(target);\n      }, 5000);\n    })\n  }\n  \n  close(e) {\n    if (e.srcElement.nodeName == 'svg' || e.srcElement.nodeName == 'BUTTON' || e.srcElement.nodeName == 'path') {\n      this.dismiss(e.currentTarget);\n    }\n  }\n\n  dismiss(element) {\n    element.classList.replace('ease-out', 'ease-in');\n    element.classList.replace('duration-300', 'duration-100');\n    element.classList.replace('opacity-100', 'opacity-0');\n    element.classList.add('max-h-28');\n    setTimeout(() => {\n      element.classList.replace('max-h-28', 'hidden');\n    }, 200);\n    \n  }\n  \n  display(element) {    \n    element.classList.replace('translate-y-2', 'translate-y-0');\n    element.classList.replace('opacity-0', 'opacity-100');\n    element.classList.replace('sm:translate-x-2', 'sm:translate-x-0');\n    element.classList.add('sm:translate-y-0');\n  }\n  \n  \n  \n\n}\n", "import etjs from \"etjs\"\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"analytics\"\nexport default class extends Controller {\n  \n  static targets = [ \"et\" ]\n  \n  static values = {\n    isproduction: Boolean\n  }\n  \n  etTargetConnected() {\n    etjs.init({\n        gaCode: 'UA-1965509-2',\n        gaV4Code: 'G-RRXL4BBBM4',\n        isProduction: this.isproductionValue,\n        suppressWarnings: this.isproductionValue,\n        debugger: !this.isproductionValue,\n    });\n    \n  }\n}", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"predictive-search\"\nexport default class extends Controller {\n\n  static targets = ['autoCompleteField']\n\n  static values = {\n    endpoint: String,\n    params: Object\n  }\n\n  async autoCompleteFieldTargetConnected(element) {\n\n    var autoCompleteArray = await this.getData(this.endpointValue);\n    let that = this;\n\n    if (autoCompleteArray != 'undefined') {\n      that.autoComplete(element, autoCompleteArray);\n    }\n  }\n\n  async getData(endpoint) {\n    var data = [];\n\n    let queryUrl = endpoint + '?' + this.urlParams();\n\n    try {\n      const response = await fetch(queryUrl);\n      if (!response.ok) {\n        throw new Error(`Response status: ${response.status}`);\n      }\n      const json = await response.json();\n      return json;\n\n    } catch (error) {\n      console.error(error.message);\n    }\n  }\n\n  urlParams(param = null) {\n    let paramsValuesObj = this.paramsValue;\n    let params = new URLSearchParams(this.paramsValue);\n    if (param) {\n      var result = params.get(param);\n      if (result == 'undefined') {\n        return '';\n      } else {\n        return '' + result;\n      }\n    } else {\n      return params.toString();\n    }\n\n  }\n\n  autoComplete(input, array = []) {\n    let that = this;\n    let currentFocus;\n    let resultCountLimit = 10;\n    var resultCount = 0;\n    let selectedLocation = this.urlParams('locations');\n\n    input.addEventListener(\"input\", function() {\n        let div, item, val = this.value;\n\n        closeAllLists();\n        if (!val) return false;\n        currentFocus = -1;\n\n        div = document.createElement(\"DIV\");\n        div.setAttribute(\"id\", this.id + \"autocomplete-list\");\n        div.setAttribute(\"class\", \"autocomplete-items\");\n        this.parentNode.appendChild(div);\n\n        array.sort((a, b) => b.count - a.count).forEach((arrayItem) => {\n\n          if (arrayItem.name.substr(0, val.length).toUpperCase() === val.toUpperCase() && resultCount <= resultCountLimit && !that.urlParams('locations').includes(arrayItem.value)) {\n              resultCount += 1;\n              item = document.createElement(\"DIV\");\n              item.classList.add('location-suggestion');\n              item.innerHTML = \"<i class='fa-solid fa-circle-plus add'></i>\";\n              item.innerHTML += \"<strong>\" + arrayItem.name.substr(0, val.length) + \"</strong>\";\n              item.innerHTML += [arrayItem.name.substr(val.length), arrayItem.state, arrayItem.country].filter((x) => x != null).join(', ');\n              item.innerHTML += ' (' + arrayItem.count.toLocaleString(\"en-US\") + ')';\n\n              item.addEventListener(\"click\", function() {\n                  var input = document.querySelector('input[name=locations]');\n                  var currentVal = input.value;\n                  input.value = (currentVal == null || currentVal == '') ? arrayItem.value : [currentVal, arrayItem.value].join(',');\n                  input.form.dispatchEvent(new CustomEvent('submit', { bubbles: true }));\n                  closeAllLists();\n              });\n              div.appendChild(item);\n          }\n        });\n    });\n\n    input.addEventListener(\"keydown\", function(e) {\n        resultCount = 0;\n        let list = document.getElementById(this.id + \"autocomplete-list\");\n        if (list) list = list.getElementsByTagName(\"div\");\n        if (e.keyCode === 40) {\n            currentFocus++;\n            addActive(list);\n        } else if (e.keyCode === 38) {\n            currentFocus--;\n            addActive(list);\n        } else if (e.keyCode === 13) {\n            e.preventDefault();\n            if (currentFocus > -1) {\n                if (list) list[currentFocus].click();\n            }\n        }\n    });\n\n    function addActive(list) {\n        if (!list) return false;\n        removeActive(list);\n        if (currentFocus >= list.length) currentFocus = 0;\n        if (currentFocus < 0) currentFocus = (list.length - 1);\n        list[currentFocus].classList.add(\"autocomplete-active\");\n    }\n\n    function removeActive(list) {\n        for (let i = 0; i < list.length; i++) {\n            list[i].classList.remove(\"autocomplete-active\");\n        }\n    }\n\n    function closeAllLists(elmnt) {\n        const items = document.getElementsByClassName(\"autocomplete-items\");\n        for (let i = 0; i < items.length; i++) {\n            if (elmnt !== items[i] && elmnt !== input) {\n                items[i].parentNode.removeChild(items[i]);\n            }\n        }\n    }\n\n    document.addEventListener(\"click\", function(e) {\n        closeAllLists(e.target);\n    });\n  }\n\n\n}\n\n\n", "/*!\n * Chart.js v3.8.0\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n  return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\nconst requestAnimFrame = (function() {\n  if (typeof window === 'undefined') {\n    return function(callback) {\n      return callback();\n    };\n  }\n  return window.requestAnimationFrame;\n}());\nfunction throttled(fn, thisArg, updateFn) {\n  const updateArgs = updateFn || ((args) => Array.prototype.slice.call(args));\n  let ticking = false;\n  let args = [];\n  return function(...rest) {\n    args = updateArgs(rest);\n    if (!ticking) {\n      ticking = true;\n      requestAnimFrame.call(window, () => {\n        ticking = false;\n        fn.apply(thisArg, args);\n      });\n    }\n  };\n}\nfunction debounce(fn, delay) {\n  let timeout;\n  return function(...args) {\n    if (delay) {\n      clearTimeout(timeout);\n      timeout = setTimeout(fn, delay, args);\n    } else {\n      fn.apply(this, args);\n    }\n    return delay;\n  };\n}\nconst _toLeftRightCenter = (align) => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\nconst _alignStartEnd = (align, start, end) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\nconst _textX = (align, left, right, rtl) => {\n  const check = rtl ? 'left' : 'right';\n  return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\nfunction noop() {}\nconst uid = (function() {\n  let id = 0;\n  return function() {\n    return id++;\n  };\n}());\nfunction isNullOrUndef(value) {\n  return value === null || typeof value === 'undefined';\n}\nfunction isArray(value) {\n  if (Array.isArray && Array.isArray(value)) {\n    return true;\n  }\n  const type = Object.prototype.toString.call(value);\n  if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n    return true;\n  }\n  return false;\n}\nfunction isObject(value) {\n  return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\nconst isNumberFinite = (value) => (typeof value === 'number' || value instanceof Number) && isFinite(+value);\nfunction finiteOrDefault(value, defaultValue) {\n  return isNumberFinite(value) ? value : defaultValue;\n}\nfunction valueOrDefault(value, defaultValue) {\n  return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension) =>\n  typeof value === 'string' && value.endsWith('%') ?\n    parseFloat(value) / 100\n    : value / dimension;\nconst toDimension = (value, dimension) =>\n  typeof value === 'string' && value.endsWith('%') ?\n    parseFloat(value) / 100 * dimension\n    : +value;\nfunction callback(fn, args, thisArg) {\n  if (fn && typeof fn.call === 'function') {\n    return fn.apply(thisArg, args);\n  }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n  let i, len, keys;\n  if (isArray(loopable)) {\n    len = loopable.length;\n    if (reverse) {\n      for (i = len - 1; i >= 0; i--) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    } else {\n      for (i = 0; i < len; i++) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    }\n  } else if (isObject(loopable)) {\n    keys = Object.keys(loopable);\n    len = keys.length;\n    for (i = 0; i < len; i++) {\n      fn.call(thisArg, loopable[keys[i]], keys[i]);\n    }\n  }\n}\nfunction _elementsEqual(a0, a1) {\n  let i, ilen, v0, v1;\n  if (!a0 || !a1 || a0.length !== a1.length) {\n    return false;\n  }\n  for (i = 0, ilen = a0.length; i < ilen; ++i) {\n    v0 = a0[i];\n    v1 = a1[i];\n    if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction clone$1(source) {\n  if (isArray(source)) {\n    return source.map(clone$1);\n  }\n  if (isObject(source)) {\n    const target = Object.create(null);\n    const keys = Object.keys(source);\n    const klen = keys.length;\n    let k = 0;\n    for (; k < klen; ++k) {\n      target[keys[k]] = clone$1(source[keys[k]]);\n    }\n    return target;\n  }\n  return source;\n}\nfunction isValidKey(key) {\n  return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\nfunction _merger(key, target, source, options) {\n  if (!isValidKey(key)) {\n    return;\n  }\n  const tval = target[key];\n  const sval = source[key];\n  if (isObject(tval) && isObject(sval)) {\n    merge(tval, sval, options);\n  } else {\n    target[key] = clone$1(sval);\n  }\n}\nfunction merge(target, source, options) {\n  const sources = isArray(source) ? source : [source];\n  const ilen = sources.length;\n  if (!isObject(target)) {\n    return target;\n  }\n  options = options || {};\n  const merger = options.merger || _merger;\n  for (let i = 0; i < ilen; ++i) {\n    source = sources[i];\n    if (!isObject(source)) {\n      continue;\n    }\n    const keys = Object.keys(source);\n    for (let k = 0, klen = keys.length; k < klen; ++k) {\n      merger(keys[k], target, source, options);\n    }\n  }\n  return target;\n}\nfunction mergeIf(target, source) {\n  return merge(target, source, {merger: _mergerIf});\n}\nfunction _mergerIf(key, target, source) {\n  if (!isValidKey(key)) {\n    return;\n  }\n  const tval = target[key];\n  const sval = source[key];\n  if (isObject(tval) && isObject(sval)) {\n    mergeIf(tval, sval);\n  } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n    target[key] = clone$1(sval);\n  }\n}\nfunction _deprecated(scope, value, previous, current) {\n  if (value !== undefined) {\n    console.warn(scope + ': \"' + previous +\n\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\n  }\n}\nconst emptyString = '';\nconst dot = '.';\nfunction indexOfDotOrLength(key, start) {\n  const idx = key.indexOf(dot, start);\n  return idx === -1 ? key.length : idx;\n}\nfunction resolveObjectKey(obj, key) {\n  if (key === emptyString) {\n    return obj;\n  }\n  let pos = 0;\n  let idx = indexOfDotOrLength(key, pos);\n  while (obj && idx > pos) {\n    obj = obj[key.slice(pos, idx)];\n    pos = idx + 1;\n    idx = indexOfDotOrLength(key, pos);\n  }\n  return obj;\n}\nfunction _capitalize(str) {\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value) => typeof value !== 'undefined';\nconst isFunction = (value) => typeof value === 'function';\nconst setsEqual = (a, b) => {\n  if (a.size !== b.size) {\n    return false;\n  }\n  for (const item of a) {\n    if (!b.has(item)) {\n      return false;\n    }\n  }\n  return true;\n};\nfunction _isClickEvent(e) {\n  return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\nconst PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction niceNum(range) {\n  const roundedRange = Math.round(range);\n  range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n  const niceRange = Math.pow(10, Math.floor(log10(range)));\n  const fraction = range / niceRange;\n  const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n  return niceFraction * niceRange;\n}\nfunction _factorize(value) {\n  const result = [];\n  const sqrt = Math.sqrt(value);\n  let i;\n  for (i = 1; i < sqrt; i++) {\n    if (value % i === 0) {\n      result.push(i);\n      result.push(value / i);\n    }\n  }\n  if (sqrt === (sqrt | 0)) {\n    result.push(sqrt);\n  }\n  result.sort((a, b) => a - b).pop();\n  return result;\n}\nfunction isNumber(n) {\n  return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostEquals(x, y, epsilon) {\n  return Math.abs(x - y) < epsilon;\n}\nfunction almostWhole(x, epsilon) {\n  const rounded = Math.round(x);\n  return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\nfunction _setMinAndMaxByKey(array, target, property) {\n  let i, ilen, value;\n  for (i = 0, ilen = array.length; i < ilen; i++) {\n    value = array[i][property];\n    if (!isNaN(value)) {\n      target.min = Math.min(target.min, value);\n      target.max = Math.max(target.max, value);\n    }\n  }\n}\nfunction toRadians(degrees) {\n  return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n  return radians * (180 / PI);\n}\nfunction _decimalPlaces(x) {\n  if (!isNumberFinite(x)) {\n    return;\n  }\n  let e = 1;\n  let p = 0;\n  while (Math.round(x * e) / e !== x) {\n    e *= 10;\n    p++;\n  }\n  return p;\n}\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n  const distanceFromXCenter = anglePoint.x - centrePoint.x;\n  const distanceFromYCenter = anglePoint.y - centrePoint.y;\n  const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n  let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n  if (angle < (-0.5 * PI)) {\n    angle += TAU;\n  }\n  return {\n    angle,\n    distance: radialDistanceFromCenter\n  };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n  return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\nfunction _angleDiff(a, b) {\n  return (a - b + PITAU) % TAU - PI;\n}\nfunction _normalizeAngle(a) {\n  return (a % TAU + TAU) % TAU;\n}\nfunction _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n  const a = _normalizeAngle(angle);\n  const s = _normalizeAngle(start);\n  const e = _normalizeAngle(end);\n  const angleToStart = _normalizeAngle(s - a);\n  const angleToEnd = _normalizeAngle(e - a);\n  const startToAngle = _normalizeAngle(a - s);\n  const endToAngle = _normalizeAngle(a - e);\n  return a === s || a === e || (sameAngleIsFullCircle && s === e)\n    || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\nfunction _limitValue(value, min, max) {\n  return Math.max(min, Math.min(max, value));\n}\nfunction _int16Range(value) {\n  return _limitValue(value, -32768, 32767);\n}\nfunction _isBetween(value, start, end, epsilon = 1e-6) {\n  return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nconst atEdge = (t) => t === 0 || t === 1;\nconst elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\nconst effects = {\n  linear: t => t,\n  easeInQuad: t => t * t,\n  easeOutQuad: t => -t * (t - 2),\n  easeInOutQuad: t => ((t /= 0.5) < 1)\n    ? 0.5 * t * t\n    : -0.5 * ((--t) * (t - 2) - 1),\n  easeInCubic: t => t * t * t,\n  easeOutCubic: t => (t -= 1) * t * t + 1,\n  easeInOutCubic: t => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t\n    : 0.5 * ((t -= 2) * t * t + 2),\n  easeInQuart: t => t * t * t * t,\n  easeOutQuart: t => -((t -= 1) * t * t * t - 1),\n  easeInOutQuart: t => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t * t\n    : -0.5 * ((t -= 2) * t * t * t - 2),\n  easeInQuint: t => t * t * t * t * t,\n  easeOutQuint: t => (t -= 1) * t * t * t * t + 1,\n  easeInOutQuint: t => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t * t * t\n    : 0.5 * ((t -= 2) * t * t * t * t + 2),\n  easeInSine: t => -Math.cos(t * HALF_PI) + 1,\n  easeOutSine: t => Math.sin(t * HALF_PI),\n  easeInOutSine: t => -0.5 * (Math.cos(PI * t) - 1),\n  easeInExpo: t => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n  easeOutExpo: t => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n  easeInOutExpo: t => atEdge(t) ? t : t < 0.5\n    ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n    : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n  easeInCirc: t => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n  easeOutCirc: t => Math.sqrt(1 - (t -= 1) * t),\n  easeInOutCirc: t => ((t /= 0.5) < 1)\n    ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n    : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n  easeInElastic: t => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n  easeOutElastic: t => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n  easeInOutElastic(t) {\n    const s = 0.1125;\n    const p = 0.45;\n    return atEdge(t) ? t :\n      t < 0.5\n        ? 0.5 * elasticIn(t * 2, s, p)\n        : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n  },\n  easeInBack(t) {\n    const s = 1.70158;\n    return t * t * ((s + 1) * t - s);\n  },\n  easeOutBack(t) {\n    const s = 1.70158;\n    return (t -= 1) * t * ((s + 1) * t + s) + 1;\n  },\n  easeInOutBack(t) {\n    let s = 1.70158;\n    if ((t /= 0.5) < 1) {\n      return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n    }\n    return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n  },\n  easeInBounce: t => 1 - effects.easeOutBounce(1 - t),\n  easeOutBounce(t) {\n    const m = 7.5625;\n    const d = 2.75;\n    if (t < (1 / d)) {\n      return m * t * t;\n    }\n    if (t < (2 / d)) {\n      return m * (t -= (1.5 / d)) * t + 0.75;\n    }\n    if (t < (2.5 / d)) {\n      return m * (t -= (2.25 / d)) * t + 0.9375;\n    }\n    return m * (t -= (2.625 / d)) * t + 0.984375;\n  },\n  easeInOutBounce: t => (t < 0.5)\n    ? effects.easeInBounce(t * 2) * 0.5\n    : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n};\n\n/*!\n * @kurkle/color v0.2.1\n * https://github.com/kurkle/color#readme\n * (c) 2022 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n  return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n  return lim(round(v * 2.55), 0, 255);\n}\nfunction n2b(v) {\n  return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n  return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n  return lim(round(v * 100), 0, 100);\n}\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n  var len = str.length;\n  var ret;\n  if (str[0] === '#') {\n    if (len === 4 || len === 5) {\n      ret = {\n        r: 255 & map$1[str[1]] * 17,\n        g: 255 & map$1[str[2]] * 17,\n        b: 255 & map$1[str[3]] * 17,\n        a: len === 5 ? map$1[str[4]] * 17 : 255\n      };\n    } else if (len === 7 || len === 9) {\n      ret = {\n        r: map$1[str[1]] << 4 | map$1[str[2]],\n        g: map$1[str[3]] << 4 | map$1[str[4]],\n        b: map$1[str[5]] << 4 | map$1[str[6]],\n        a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n      };\n    }\n  }\n  return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n  var f = isShort(v) ? h1 : h2;\n  return v\n    ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n    : undefined;\n}\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n  const a = s * Math.min(l, 1 - l);\n  const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n  return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n  const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n  return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n  const rgb = hsl2rgbn(h, 1, 0.5);\n  let i;\n  if (w + b > 1) {\n    i = 1 / (w + b);\n    w *= i;\n    b *= i;\n  }\n  for (i = 0; i < 3; i++) {\n    rgb[i] *= 1 - w - b;\n    rgb[i] += w;\n  }\n  return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n  if (r === max) {\n    return ((g - b) / d) + (g < b ? 6 : 0);\n  }\n  if (g === max) {\n    return (b - r) / d + 2;\n  }\n  return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n  const range = 255;\n  const r = v.r / range;\n  const g = v.g / range;\n  const b = v.b / range;\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const l = (max + min) / 2;\n  let h, s, d;\n  if (max !== min) {\n    d = max - min;\n    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n    h = hueValue(r, g, b, d, max);\n    h = h * 60 + 0.5;\n  }\n  return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n  return (\n    Array.isArray(a)\n      ? f(a[0], a[1], a[2])\n      : f(a, b, c)\n  ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n  return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n  return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n  return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n  return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n  const m = HUE_RE.exec(str);\n  let a = 255;\n  let v;\n  if (!m) {\n    return;\n  }\n  if (m[5] !== v) {\n    a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n  }\n  const h = hue(+m[2]);\n  const p1 = +m[3] / 100;\n  const p2 = +m[4] / 100;\n  if (m[1] === 'hwb') {\n    v = hwb2rgb(h, p1, p2);\n  } else if (m[1] === 'hsv') {\n    v = hsv2rgb(h, p1, p2);\n  } else {\n    v = hsl2rgb(h, p1, p2);\n  }\n  return {\n    r: v[0],\n    g: v[1],\n    b: v[2],\n    a: a\n  };\n}\nfunction rotate(v, deg) {\n  var h = rgb2hsl(v);\n  h[0] = hue(h[0] + deg);\n  h = hsl2rgb(h);\n  v.r = h[0];\n  v.g = h[1];\n  v.b = h[2];\n}\nfunction hslString(v) {\n  if (!v) {\n    return;\n  }\n  const a = rgb2hsl(v);\n  const h = a[0];\n  const s = n2p(a[1]);\n  const l = n2p(a[2]);\n  return v.a < 255\n    ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n    : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst map = {\n  x: 'dark',\n  Z: 'light',\n  Y: 're',\n  X: 'blu',\n  W: 'gr',\n  V: 'medium',\n  U: 'slate',\n  A: 'ee',\n  T: 'ol',\n  S: 'or',\n  B: 'ra',\n  C: 'lateg',\n  D: 'ights',\n  R: 'in',\n  Q: 'turquois',\n  E: 'hi',\n  P: 'ro',\n  O: 'al',\n  N: 'le',\n  M: 'de',\n  L: 'yello',\n  F: 'en',\n  K: 'ch',\n  G: 'arks',\n  H: 'ea',\n  I: 'ightg',\n  J: 'wh'\n};\nconst names$1 = {\n  OiceXe: 'f0f8ff',\n  antiquewEte: 'faebd7',\n  aqua: 'ffff',\n  aquamarRe: '7fffd4',\n  azuY: 'f0ffff',\n  beige: 'f5f5dc',\n  bisque: 'ffe4c4',\n  black: '0',\n  blanKedOmond: 'ffebcd',\n  Xe: 'ff',\n  XeviTet: '8a2be2',\n  bPwn: 'a52a2a',\n  burlywood: 'deb887',\n  caMtXe: '5f9ea0',\n  KartYuse: '7fff00',\n  KocTate: 'd2691e',\n  cSO: 'ff7f50',\n  cSnflowerXe: '6495ed',\n  cSnsilk: 'fff8dc',\n  crimson: 'dc143c',\n  cyan: 'ffff',\n  xXe: '8b',\n  xcyan: '8b8b',\n  xgTMnPd: 'b8860b',\n  xWay: 'a9a9a9',\n  xgYF: '6400',\n  xgYy: 'a9a9a9',\n  xkhaki: 'bdb76b',\n  xmagFta: '8b008b',\n  xTivegYF: '556b2f',\n  xSange: 'ff8c00',\n  xScEd: '9932cc',\n  xYd: '8b0000',\n  xsOmon: 'e9967a',\n  xsHgYF: '8fbc8f',\n  xUXe: '483d8b',\n  xUWay: '2f4f4f',\n  xUgYy: '2f4f4f',\n  xQe: 'ced1',\n  xviTet: '9400d3',\n  dAppRk: 'ff1493',\n  dApskyXe: 'bfff',\n  dimWay: '696969',\n  dimgYy: '696969',\n  dodgerXe: '1e90ff',\n  fiYbrick: 'b22222',\n  flSOwEte: 'fffaf0',\n  foYstWAn: '228b22',\n  fuKsia: 'ff00ff',\n  gaRsbSo: 'dcdcdc',\n  ghostwEte: 'f8f8ff',\n  gTd: 'ffd700',\n  gTMnPd: 'daa520',\n  Way: '808080',\n  gYF: '8000',\n  gYFLw: 'adff2f',\n  gYy: '808080',\n  honeyMw: 'f0fff0',\n  hotpRk: 'ff69b4',\n  RdianYd: 'cd5c5c',\n  Rdigo: '4b0082',\n  ivSy: 'fffff0',\n  khaki: 'f0e68c',\n  lavFMr: 'e6e6fa',\n  lavFMrXsh: 'fff0f5',\n  lawngYF: '7cfc00',\n  NmoncEffon: 'fffacd',\n  ZXe: 'add8e6',\n  ZcSO: 'f08080',\n  Zcyan: 'e0ffff',\n  ZgTMnPdLw: 'fafad2',\n  ZWay: 'd3d3d3',\n  ZgYF: '90ee90',\n  ZgYy: 'd3d3d3',\n  ZpRk: 'ffb6c1',\n  ZsOmon: 'ffa07a',\n  ZsHgYF: '20b2aa',\n  ZskyXe: '87cefa',\n  ZUWay: '778899',\n  ZUgYy: '778899',\n  ZstAlXe: 'b0c4de',\n  ZLw: 'ffffe0',\n  lime: 'ff00',\n  limegYF: '32cd32',\n  lRF: 'faf0e6',\n  magFta: 'ff00ff',\n  maPon: '800000',\n  VaquamarRe: '66cdaa',\n  VXe: 'cd',\n  VScEd: 'ba55d3',\n  VpurpN: '9370db',\n  VsHgYF: '3cb371',\n  VUXe: '7b68ee',\n  VsprRggYF: 'fa9a',\n  VQe: '48d1cc',\n  VviTetYd: 'c71585',\n  midnightXe: '191970',\n  mRtcYam: 'f5fffa',\n  mistyPse: 'ffe4e1',\n  moccasR: 'ffe4b5',\n  navajowEte: 'ffdead',\n  navy: '80',\n  Tdlace: 'fdf5e6',\n  Tive: '808000',\n  TivedBb: '6b8e23',\n  Sange: 'ffa500',\n  SangeYd: 'ff4500',\n  ScEd: 'da70d6',\n  pOegTMnPd: 'eee8aa',\n  pOegYF: '98fb98',\n  pOeQe: 'afeeee',\n  pOeviTetYd: 'db7093',\n  papayawEp: 'ffefd5',\n  pHKpuff: 'ffdab9',\n  peru: 'cd853f',\n  pRk: 'ffc0cb',\n  plum: 'dda0dd',\n  powMrXe: 'b0e0e6',\n  purpN: '800080',\n  YbeccapurpN: '663399',\n  Yd: 'ff0000',\n  Psybrown: 'bc8f8f',\n  PyOXe: '4169e1',\n  saddNbPwn: '8b4513',\n  sOmon: 'fa8072',\n  sandybPwn: 'f4a460',\n  sHgYF: '2e8b57',\n  sHshell: 'fff5ee',\n  siFna: 'a0522d',\n  silver: 'c0c0c0',\n  skyXe: '87ceeb',\n  UXe: '6a5acd',\n  UWay: '708090',\n  UgYy: '708090',\n  snow: 'fffafa',\n  sprRggYF: 'ff7f',\n  stAlXe: '4682b4',\n  tan: 'd2b48c',\n  teO: '8080',\n  tEstN: 'd8bfd8',\n  tomato: 'ff6347',\n  Qe: '40e0d0',\n  viTet: 'ee82ee',\n  JHt: 'f5deb3',\n  wEte: 'ffffff',\n  wEtesmoke: 'f5f5f5',\n  Lw: 'ffff00',\n  LwgYF: '9acd32'\n};\nfunction unpack() {\n  const unpacked = {};\n  const keys = Object.keys(names$1);\n  const tkeys = Object.keys(map);\n  let i, j, k, ok, nk;\n  for (i = 0; i < keys.length; i++) {\n    ok = nk = keys[i];\n    for (j = 0; j < tkeys.length; j++) {\n      k = tkeys[j];\n      nk = nk.replace(k, map[k]);\n    }\n    k = parseInt(names$1[ok], 16);\n    unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n  }\n  return unpacked;\n}\nlet names;\nfunction nameParse(str) {\n  if (!names) {\n    names = unpack();\n    names.transparent = [0, 0, 0, 0];\n  }\n  const a = names[str.toLowerCase()];\n  return a && {\n    r: a[0],\n    g: a[1],\n    b: a[2],\n    a: a.length === 4 ? a[3] : 255\n  };\n}\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n  const m = RGB_RE.exec(str);\n  let a = 255;\n  let r, g, b;\n  if (!m) {\n    return;\n  }\n  if (m[7] !== r) {\n    const v = +m[7];\n    a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n  }\n  r = +m[1];\n  g = +m[3];\n  b = +m[5];\n  r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n  g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n  b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n  return {\n    r: r,\n    g: g,\n    b: b,\n    a: a\n  };\n}\nfunction rgbString(v) {\n  return v && (\n    v.a < 255\n      ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n      : `rgb(${v.r}, ${v.g}, ${v.b})`\n  );\n}\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n  const r = from(b2n(rgb1.r));\n  const g = from(b2n(rgb1.g));\n  const b = from(b2n(rgb1.b));\n  return {\n    r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n    g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n    b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n    a: rgb1.a + t * (rgb2.a - rgb1.a)\n  };\n}\nfunction modHSL(v, i, ratio) {\n  if (v) {\n    let tmp = rgb2hsl(v);\n    tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n    tmp = hsl2rgb(tmp);\n    v.r = tmp[0];\n    v.g = tmp[1];\n    v.b = tmp[2];\n  }\n}\nfunction clone(v, proto) {\n  return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n  var v = {r: 0, g: 0, b: 0, a: 255};\n  if (Array.isArray(input)) {\n    if (input.length >= 3) {\n      v = {r: input[0], g: input[1], b: input[2], a: 255};\n      if (input.length > 3) {\n        v.a = n2b(input[3]);\n      }\n    }\n  } else {\n    v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n    v.a = n2b(v.a);\n  }\n  return v;\n}\nfunction functionParse(str) {\n  if (str.charAt(0) === 'r') {\n    return rgbParse(str);\n  }\n  return hueParse(str);\n}\nclass Color {\n  constructor(input) {\n    if (input instanceof Color) {\n      return input;\n    }\n    const type = typeof input;\n    let v;\n    if (type === 'object') {\n      v = fromObject(input);\n    } else if (type === 'string') {\n      v = hexParse(input) || nameParse(input) || functionParse(input);\n    }\n    this._rgb = v;\n    this._valid = !!v;\n  }\n  get valid() {\n    return this._valid;\n  }\n  get rgb() {\n    var v = clone(this._rgb);\n    if (v) {\n      v.a = b2n(v.a);\n    }\n    return v;\n  }\n  set rgb(obj) {\n    this._rgb = fromObject(obj);\n  }\n  rgbString() {\n    return this._valid ? rgbString(this._rgb) : undefined;\n  }\n  hexString() {\n    return this._valid ? hexString(this._rgb) : undefined;\n  }\n  hslString() {\n    return this._valid ? hslString(this._rgb) : undefined;\n  }\n  mix(color, weight) {\n    if (color) {\n      const c1 = this.rgb;\n      const c2 = color.rgb;\n      let w2;\n      const p = weight === w2 ? 0.5 : weight;\n      const w = 2 * p - 1;\n      const a = c1.a - c2.a;\n      const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n      w2 = 1 - w1;\n      c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n      c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n      c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n      c1.a = p * c1.a + (1 - p) * c2.a;\n      this.rgb = c1;\n    }\n    return this;\n  }\n  interpolate(color, t) {\n    if (color) {\n      this._rgb = interpolate(this._rgb, color._rgb, t);\n    }\n    return this;\n  }\n  clone() {\n    return new Color(this.rgb);\n  }\n  alpha(a) {\n    this._rgb.a = n2b(a);\n    return this;\n  }\n  clearer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 - ratio;\n    return this;\n  }\n  greyscale() {\n    const rgb = this._rgb;\n    const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n    rgb.r = rgb.g = rgb.b = val;\n    return this;\n  }\n  opaquer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 + ratio;\n    return this;\n  }\n  negate() {\n    const v = this._rgb;\n    v.r = 255 - v.r;\n    v.g = 255 - v.g;\n    v.b = 255 - v.b;\n    return this;\n  }\n  lighten(ratio) {\n    modHSL(this._rgb, 2, ratio);\n    return this;\n  }\n  darken(ratio) {\n    modHSL(this._rgb, 2, -ratio);\n    return this;\n  }\n  saturate(ratio) {\n    modHSL(this._rgb, 1, ratio);\n    return this;\n  }\n  desaturate(ratio) {\n    modHSL(this._rgb, 1, -ratio);\n    return this;\n  }\n  rotate(deg) {\n    rotate(this._rgb, deg);\n    return this;\n  }\n}\nfunction index_esm(input) {\n  return new Color(input);\n}\n\nfunction isPatternOrGradient(value) {\n  if (value && typeof value === 'object') {\n    const type = value.toString();\n    return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n  }\n  return false;\n}\nfunction color(value) {\n  return isPatternOrGradient(value) ? value : index_esm(value);\n}\nfunction getHoverColor(value) {\n  return isPatternOrGradient(value)\n    ? value\n    : index_esm(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\nfunction getScope$1(node, key) {\n  if (!key) {\n    return node;\n  }\n  const keys = key.split('.');\n  for (let i = 0, n = keys.length; i < n; ++i) {\n    const k = keys[i];\n    node = node[k] || (node[k] = Object.create(null));\n  }\n  return node;\n}\nfunction set(root, scope, values) {\n  if (typeof scope === 'string') {\n    return merge(getScope$1(root, scope), values);\n  }\n  return merge(getScope$1(root, ''), scope);\n}\nclass Defaults {\n  constructor(_descriptors) {\n    this.animation = undefined;\n    this.backgroundColor = 'rgba(0,0,0,0.1)';\n    this.borderColor = 'rgba(0,0,0,0.1)';\n    this.color = '#666';\n    this.datasets = {};\n    this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n    this.elements = {};\n    this.events = [\n      'mousemove',\n      'mouseout',\n      'click',\n      'touchstart',\n      'touchmove'\n    ];\n    this.font = {\n      family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n      size: 12,\n      style: 'normal',\n      lineHeight: 1.2,\n      weight: null\n    };\n    this.hover = {};\n    this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n    this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n    this.hoverColor = (ctx, options) => getHoverColor(options.color);\n    this.indexAxis = 'x';\n    this.interaction = {\n      mode: 'nearest',\n      intersect: true,\n      includeInvisible: false\n    };\n    this.maintainAspectRatio = true;\n    this.onHover = null;\n    this.onClick = null;\n    this.parsing = true;\n    this.plugins = {};\n    this.responsive = true;\n    this.scale = undefined;\n    this.scales = {};\n    this.showLine = true;\n    this.drawActiveElementsOnTop = true;\n    this.describe(_descriptors);\n  }\n  set(scope, values) {\n    return set(this, scope, values);\n  }\n  get(scope) {\n    return getScope$1(this, scope);\n  }\n  describe(scope, values) {\n    return set(descriptors, scope, values);\n  }\n  override(scope, values) {\n    return set(overrides, scope, values);\n  }\n  route(scope, name, targetScope, targetName) {\n    const scopeObject = getScope$1(this, scope);\n    const targetScopeObject = getScope$1(this, targetScope);\n    const privateName = '_' + name;\n    Object.defineProperties(scopeObject, {\n      [privateName]: {\n        value: scopeObject[name],\n        writable: true\n      },\n      [name]: {\n        enumerable: true,\n        get() {\n          const local = this[privateName];\n          const target = targetScopeObject[targetName];\n          if (isObject(local)) {\n            return Object.assign({}, target, local);\n          }\n          return valueOrDefault(local, target);\n        },\n        set(value) {\n          this[privateName] = value;\n        }\n      }\n    });\n  }\n}\nvar defaults = new Defaults({\n  _scriptable: (name) => !name.startsWith('on'),\n  _indexable: (name) => name !== 'events',\n  hover: {\n    _fallback: 'interaction'\n  },\n  interaction: {\n    _scriptable: false,\n    _indexable: false,\n  }\n});\n\nfunction toFontString(font) {\n  if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n    return null;\n  }\n  return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\nfunction _measureText(ctx, data, gc, longest, string) {\n  let textWidth = data[string];\n  if (!textWidth) {\n    textWidth = data[string] = ctx.measureText(string).width;\n    gc.push(string);\n  }\n  if (textWidth > longest) {\n    longest = textWidth;\n  }\n  return longest;\n}\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n  cache = cache || {};\n  let data = cache.data = cache.data || {};\n  let gc = cache.garbageCollect = cache.garbageCollect || [];\n  if (cache.font !== font) {\n    data = cache.data = {};\n    gc = cache.garbageCollect = [];\n    cache.font = font;\n  }\n  ctx.save();\n  ctx.font = font;\n  let longest = 0;\n  const ilen = arrayOfThings.length;\n  let i, j, jlen, thing, nestedThing;\n  for (i = 0; i < ilen; i++) {\n    thing = arrayOfThings[i];\n    if (thing !== undefined && thing !== null && isArray(thing) !== true) {\n      longest = _measureText(ctx, data, gc, longest, thing);\n    } else if (isArray(thing)) {\n      for (j = 0, jlen = thing.length; j < jlen; j++) {\n        nestedThing = thing[j];\n        if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n          longest = _measureText(ctx, data, gc, longest, nestedThing);\n        }\n      }\n    }\n  }\n  ctx.restore();\n  const gcLen = gc.length / 2;\n  if (gcLen > arrayOfThings.length) {\n    for (i = 0; i < gcLen; i++) {\n      delete data[gc[i]];\n    }\n    gc.splice(0, gcLen);\n  }\n  return longest;\n}\nfunction _alignPixel(chart, pixel, width) {\n  const devicePixelRatio = chart.currentDevicePixelRatio;\n  const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n  return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\nfunction clearCanvas(canvas, ctx) {\n  ctx = ctx || canvas.getContext('2d');\n  ctx.save();\n  ctx.resetTransform();\n  ctx.clearRect(0, 0, canvas.width, canvas.height);\n  ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n  let type, xOffset, yOffset, size, cornerRadius;\n  const style = options.pointStyle;\n  const rotation = options.rotation;\n  const radius = options.radius;\n  let rad = (rotation || 0) * RAD_PER_DEG;\n  if (style && typeof style === 'object') {\n    type = style.toString();\n    if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n      ctx.save();\n      ctx.translate(x, y);\n      ctx.rotate(rad);\n      ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n      ctx.restore();\n      return;\n    }\n  }\n  if (isNaN(radius) || radius <= 0) {\n    return;\n  }\n  ctx.beginPath();\n  switch (style) {\n  default:\n    ctx.arc(x, y, radius, 0, TAU);\n    ctx.closePath();\n    break;\n  case 'triangle':\n    ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    rad += TWO_THIRDS_PI;\n    ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    rad += TWO_THIRDS_PI;\n    ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    ctx.closePath();\n    break;\n  case 'rectRounded':\n    cornerRadius = radius * 0.516;\n    size = radius - cornerRadius;\n    xOffset = Math.cos(rad + QUARTER_PI) * size;\n    yOffset = Math.sin(rad + QUARTER_PI) * size;\n    ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n    ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n    ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n    ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n    ctx.closePath();\n    break;\n  case 'rect':\n    if (!rotation) {\n      size = Math.SQRT1_2 * radius;\n      ctx.rect(x - size, y - size, 2 * size, 2 * size);\n      break;\n    }\n    rad += QUARTER_PI;\n  case 'rectRot':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    ctx.closePath();\n    break;\n  case 'crossRot':\n    rad += QUARTER_PI;\n  case 'cross':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    break;\n  case 'star':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    rad += QUARTER_PI;\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    break;\n  case 'line':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    break;\n  case 'dash':\n    ctx.moveTo(x, y);\n    ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\n    break;\n  }\n  ctx.fill();\n  if (options.borderWidth > 0) {\n    ctx.stroke();\n  }\n}\nfunction _isPointInArea(point, area, margin) {\n  margin = margin || 0.5;\n  return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\nfunction clipArea(ctx, area) {\n  ctx.save();\n  ctx.beginPath();\n  ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n  ctx.clip();\n}\nfunction unclipArea(ctx) {\n  ctx.restore();\n}\nfunction _steppedLineTo(ctx, previous, target, flip, mode) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  if (mode === 'middle') {\n    const midpoint = (previous.x + target.x) / 2.0;\n    ctx.lineTo(midpoint, previous.y);\n    ctx.lineTo(midpoint, target.y);\n  } else if (mode === 'after' !== !!flip) {\n    ctx.lineTo(previous.x, target.y);\n  } else {\n    ctx.lineTo(target.x, previous.y);\n  }\n  ctx.lineTo(target.x, target.y);\n}\nfunction _bezierCurveTo(ctx, previous, target, flip) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  ctx.bezierCurveTo(\n    flip ? previous.cp1x : previous.cp2x,\n    flip ? previous.cp1y : previous.cp2y,\n    flip ? target.cp2x : target.cp1x,\n    flip ? target.cp2y : target.cp1y,\n    target.x,\n    target.y);\n}\nfunction renderText(ctx, text, x, y, font, opts = {}) {\n  const lines = isArray(text) ? text : [text];\n  const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n  let i, line;\n  ctx.save();\n  ctx.font = font.string;\n  setRenderOpts(ctx, opts);\n  for (i = 0; i < lines.length; ++i) {\n    line = lines[i];\n    if (stroke) {\n      if (opts.strokeColor) {\n        ctx.strokeStyle = opts.strokeColor;\n      }\n      if (!isNullOrUndef(opts.strokeWidth)) {\n        ctx.lineWidth = opts.strokeWidth;\n      }\n      ctx.strokeText(line, x, y, opts.maxWidth);\n    }\n    ctx.fillText(line, x, y, opts.maxWidth);\n    decorateText(ctx, x, y, line, opts);\n    y += font.lineHeight;\n  }\n  ctx.restore();\n}\nfunction setRenderOpts(ctx, opts) {\n  if (opts.translation) {\n    ctx.translate(opts.translation[0], opts.translation[1]);\n  }\n  if (!isNullOrUndef(opts.rotation)) {\n    ctx.rotate(opts.rotation);\n  }\n  if (opts.color) {\n    ctx.fillStyle = opts.color;\n  }\n  if (opts.textAlign) {\n    ctx.textAlign = opts.textAlign;\n  }\n  if (opts.textBaseline) {\n    ctx.textBaseline = opts.textBaseline;\n  }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n  if (opts.strikethrough || opts.underline) {\n    const metrics = ctx.measureText(line);\n    const left = x - metrics.actualBoundingBoxLeft;\n    const right = x + metrics.actualBoundingBoxRight;\n    const top = y - metrics.actualBoundingBoxAscent;\n    const bottom = y + metrics.actualBoundingBoxDescent;\n    const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n    ctx.strokeStyle = ctx.fillStyle;\n    ctx.beginPath();\n    ctx.lineWidth = opts.decorationWidth || 2;\n    ctx.moveTo(left, yDecoration);\n    ctx.lineTo(right, yDecoration);\n    ctx.stroke();\n  }\n}\nfunction addRoundedRectPath(ctx, rect) {\n  const {x, y, w, h, radius} = rect;\n  ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);\n  ctx.lineTo(x, y + h - radius.bottomLeft);\n  ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n  ctx.lineTo(x + w - radius.bottomRight, y + h);\n  ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n  ctx.lineTo(x + w, y + radius.topRight);\n  ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n  ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = new RegExp(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\nconst FONT_STYLE = new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);\nfunction toLineHeight(value, size) {\n  const matches = ('' + value).match(LINE_HEIGHT);\n  if (!matches || matches[1] === 'normal') {\n    return size * 1.2;\n  }\n  value = +matches[2];\n  switch (matches[3]) {\n  case 'px':\n    return value;\n  case '%':\n    value /= 100;\n    break;\n  }\n  return size * value;\n}\nconst numberOrZero = v => +v || 0;\nfunction _readValueToProps(value, props) {\n  const ret = {};\n  const objProps = isObject(props);\n  const keys = objProps ? Object.keys(props) : props;\n  const read = isObject(value)\n    ? objProps\n      ? prop => valueOrDefault(value[prop], value[props[prop]])\n      : prop => value[prop]\n    : () => value;\n  for (const prop of keys) {\n    ret[prop] = numberOrZero(read(prop));\n  }\n  return ret;\n}\nfunction toTRBL(value) {\n  return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\nfunction toTRBLCorners(value) {\n  return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\nfunction toPadding(value) {\n  const obj = toTRBL(value);\n  obj.width = obj.left + obj.right;\n  obj.height = obj.top + obj.bottom;\n  return obj;\n}\nfunction toFont(options, fallback) {\n  options = options || {};\n  fallback = fallback || defaults.font;\n  let size = valueOrDefault(options.size, fallback.size);\n  if (typeof size === 'string') {\n    size = parseInt(size, 10);\n  }\n  let style = valueOrDefault(options.style, fallback.style);\n  if (style && !('' + style).match(FONT_STYLE)) {\n    console.warn('Invalid font style specified: \"' + style + '\"');\n    style = '';\n  }\n  const font = {\n    family: valueOrDefault(options.family, fallback.family),\n    lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n    size,\n    style,\n    weight: valueOrDefault(options.weight, fallback.weight),\n    string: ''\n  };\n  font.string = toFontString(font);\n  return font;\n}\nfunction resolve(inputs, context, index, info) {\n  let cacheable = true;\n  let i, ilen, value;\n  for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n    value = inputs[i];\n    if (value === undefined) {\n      continue;\n    }\n    if (context !== undefined && typeof value === 'function') {\n      value = value(context);\n      cacheable = false;\n    }\n    if (index !== undefined && isArray(value)) {\n      value = value[index % value.length];\n      cacheable = false;\n    }\n    if (value !== undefined) {\n      if (info && !cacheable) {\n        info.cacheable = false;\n      }\n      return value;\n    }\n  }\n}\nfunction _addGrace(minmax, grace, beginAtZero) {\n  const {min, max} = minmax;\n  const change = toDimension(grace, (max - min) / 2);\n  const keepZero = (value, add) => beginAtZero && value === 0 ? 0 : value + add;\n  return {\n    min: keepZero(min, -Math.abs(change)),\n    max: keepZero(max, change)\n  };\n}\nfunction createContext(parentContext, context) {\n  return Object.assign(Object.create(parentContext), context);\n}\n\nfunction _lookup(table, value, cmp) {\n  cmp = cmp || ((index) => table[index] < value);\n  let hi = table.length - 1;\n  let lo = 0;\n  let mid;\n  while (hi - lo > 1) {\n    mid = (lo + hi) >> 1;\n    if (cmp(mid)) {\n      lo = mid;\n    } else {\n      hi = mid;\n    }\n  }\n  return {lo, hi};\n}\nconst _lookupByKey = (table, key, value) =>\n  _lookup(table, value, index => table[index][key] < value);\nconst _rlookupByKey = (table, key, value) =>\n  _lookup(table, value, index => table[index][key] >= value);\nfunction _filterBetween(values, min, max) {\n  let start = 0;\n  let end = values.length;\n  while (start < end && values[start] < min) {\n    start++;\n  }\n  while (end > start && values[end - 1] > max) {\n    end--;\n  }\n  return start > 0 || end < values.length\n    ? values.slice(start, end)\n    : values;\n}\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\nfunction listenArrayEvents(array, listener) {\n  if (array._chartjs) {\n    array._chartjs.listeners.push(listener);\n    return;\n  }\n  Object.defineProperty(array, '_chartjs', {\n    configurable: true,\n    enumerable: false,\n    value: {\n      listeners: [listener]\n    }\n  });\n  arrayEvents.forEach((key) => {\n    const method = '_onData' + _capitalize(key);\n    const base = array[key];\n    Object.defineProperty(array, key, {\n      configurable: true,\n      enumerable: false,\n      value(...args) {\n        const res = base.apply(this, args);\n        array._chartjs.listeners.forEach((object) => {\n          if (typeof object[method] === 'function') {\n            object[method](...args);\n          }\n        });\n        return res;\n      }\n    });\n  });\n}\nfunction unlistenArrayEvents(array, listener) {\n  const stub = array._chartjs;\n  if (!stub) {\n    return;\n  }\n  const listeners = stub.listeners;\n  const index = listeners.indexOf(listener);\n  if (index !== -1) {\n    listeners.splice(index, 1);\n  }\n  if (listeners.length > 0) {\n    return;\n  }\n  arrayEvents.forEach((key) => {\n    delete array[key];\n  });\n  delete array._chartjs;\n}\nfunction _arrayUnique(items) {\n  const set = new Set();\n  let i, ilen;\n  for (i = 0, ilen = items.length; i < ilen; ++i) {\n    set.add(items[i]);\n  }\n  if (set.size === ilen) {\n    return items;\n  }\n  return Array.from(set);\n}\n\nfunction _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {\n  if (!defined(fallback)) {\n    fallback = _resolve('_fallback', scopes);\n  }\n  const cache = {\n    [Symbol.toStringTag]: 'Object',\n    _cacheable: true,\n    _scopes: scopes,\n    _rootScopes: rootScopes,\n    _fallback: fallback,\n    _getTarget: getTarget,\n    override: (scope) => _createResolver([scope, ...scopes], prefixes, rootScopes, fallback),\n  };\n  return new Proxy(cache, {\n    deleteProperty(target, prop) {\n      delete target[prop];\n      delete target._keys;\n      delete scopes[0][prop];\n      return true;\n    },\n    get(target, prop) {\n      return _cached(target, prop,\n        () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n    },\n    getOwnPropertyDescriptor(target, prop) {\n      return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n    },\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(scopes[0]);\n    },\n    has(target, prop) {\n      return getKeysFromAllScopes(target).includes(prop);\n    },\n    ownKeys(target) {\n      return getKeysFromAllScopes(target);\n    },\n    set(target, prop, value) {\n      const storage = target._storage || (target._storage = getTarget());\n      target[prop] = storage[prop] = value;\n      delete target._keys;\n      return true;\n    }\n  });\n}\nfunction _attachContext(proxy, context, subProxy, descriptorDefaults) {\n  const cache = {\n    _cacheable: false,\n    _proxy: proxy,\n    _context: context,\n    _subProxy: subProxy,\n    _stack: new Set(),\n    _descriptors: _descriptors(proxy, descriptorDefaults),\n    setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n    override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n  };\n  return new Proxy(cache, {\n    deleteProperty(target, prop) {\n      delete target[prop];\n      delete proxy[prop];\n      return true;\n    },\n    get(target, prop, receiver) {\n      return _cached(target, prop,\n        () => _resolveWithContext(target, prop, receiver));\n    },\n    getOwnPropertyDescriptor(target, prop) {\n      return target._descriptors.allKeys\n        ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n        : Reflect.getOwnPropertyDescriptor(proxy, prop);\n    },\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(proxy);\n    },\n    has(target, prop) {\n      return Reflect.has(proxy, prop);\n    },\n    ownKeys() {\n      return Reflect.ownKeys(proxy);\n    },\n    set(target, prop, value) {\n      proxy[prop] = value;\n      delete target[prop];\n      return true;\n    }\n  });\n}\nfunction _descriptors(proxy, defaults = {scriptable: true, indexable: true}) {\n  const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n  return {\n    allKeys: _allKeys,\n    scriptable: _scriptable,\n    indexable: _indexable,\n    isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n    isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n  };\n}\nconst readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value) => isObject(value) && prop !== 'adapters' &&\n  (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n  if (Object.prototype.hasOwnProperty.call(target, prop)) {\n    return target[prop];\n  }\n  const value = resolve();\n  target[prop] = value;\n  return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n  const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n  let value = _proxy[prop];\n  if (isFunction(value) && descriptors.isScriptable(prop)) {\n    value = _resolveScriptable(prop, value, target, receiver);\n  }\n  if (isArray(value) && value.length) {\n    value = _resolveArray(prop, value, target, descriptors.isIndexable);\n  }\n  if (needsSubResolver(prop, value)) {\n    value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n  }\n  return value;\n}\nfunction _resolveScriptable(prop, value, target, receiver) {\n  const {_proxy, _context, _subProxy, _stack} = target;\n  if (_stack.has(prop)) {\n    throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n  }\n  _stack.add(prop);\n  value = value(_context, _subProxy || receiver);\n  _stack.delete(prop);\n  if (needsSubResolver(prop, value)) {\n    value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n  }\n  return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n  const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n  if (defined(_context.index) && isIndexable(prop)) {\n    value = value[_context.index % value.length];\n  } else if (isObject(value[0])) {\n    const arr = value;\n    const scopes = _proxy._scopes.filter(s => s !== arr);\n    value = [];\n    for (const item of arr) {\n      const resolver = createSubResolver(scopes, _proxy, prop, item);\n      value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n    }\n  }\n  return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n  return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent) => key === true ? parent\n  : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n  for (const parent of parentScopes) {\n    const scope = getScope(key, parent);\n    if (scope) {\n      set.add(scope);\n      const fallback = resolveFallback(scope._fallback, key, value);\n      if (defined(fallback) && fallback !== key && fallback !== parentFallback) {\n        return fallback;\n      }\n    } else if (scope === false && defined(parentFallback) && key !== parentFallback) {\n      return null;\n    }\n  }\n  return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n  const rootScopes = resolver._rootScopes;\n  const fallback = resolveFallback(resolver._fallback, prop, value);\n  const allScopes = [...parentScopes, ...rootScopes];\n  const set = new Set();\n  set.add(value);\n  let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n  if (key === null) {\n    return false;\n  }\n  if (defined(fallback) && fallback !== prop) {\n    key = addScopesFromKey(set, allScopes, fallback, key, value);\n    if (key === null) {\n      return false;\n    }\n  }\n  return _createResolver(Array.from(set), [''], rootScopes, fallback,\n    () => subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n  while (key) {\n    key = addScopes(set, allScopes, key, fallback, item);\n  }\n  return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n  const parent = resolver._getTarget();\n  if (!(prop in parent)) {\n    parent[prop] = {};\n  }\n  const target = parent[prop];\n  if (isArray(target) && isObject(value)) {\n    return value;\n  }\n  return target;\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n  let value;\n  for (const prefix of prefixes) {\n    value = _resolve(readKey(prefix, prop), scopes);\n    if (defined(value)) {\n      return needsSubResolver(prop, value)\n        ? createSubResolver(scopes, proxy, prop, value)\n        : value;\n    }\n  }\n}\nfunction _resolve(key, scopes) {\n  for (const scope of scopes) {\n    if (!scope) {\n      continue;\n    }\n    const value = scope[key];\n    if (defined(value)) {\n      return value;\n    }\n  }\n}\nfunction getKeysFromAllScopes(target) {\n  let keys = target._keys;\n  if (!keys) {\n    keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n  }\n  return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n  const set = new Set();\n  for (const scope of scopes) {\n    for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n      set.add(key);\n    }\n  }\n  return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n  const {iScale} = meta;\n  const {key = 'r'} = this._parsing;\n  const parsed = new Array(count);\n  let i, ilen, index, item;\n  for (i = 0, ilen = count; i < ilen; ++i) {\n    index = i + start;\n    item = data[index];\n    parsed[i] = {\n      r: iScale.parse(resolveObjectKey(item, key), index)\n    };\n  }\n  return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i) => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis) => indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n  const previous = firstPoint.skip ? middlePoint : firstPoint;\n  const current = middlePoint;\n  const next = afterPoint.skip ? middlePoint : afterPoint;\n  const d01 = distanceBetweenPoints(current, previous);\n  const d12 = distanceBetweenPoints(next, current);\n  let s01 = d01 / (d01 + d12);\n  let s12 = d12 / (d01 + d12);\n  s01 = isNaN(s01) ? 0 : s01;\n  s12 = isNaN(s12) ? 0 : s12;\n  const fa = t * s01;\n  const fb = t * s12;\n  return {\n    previous: {\n      x: current.x - fa * (next.x - previous.x),\n      y: current.y - fa * (next.y - previous.y)\n    },\n    next: {\n      x: current.x + fb * (next.x - previous.x),\n      y: current.y + fb * (next.y - previous.y)\n    }\n  };\n}\nfunction monotoneAdjust(points, deltaK, mK) {\n  const pointsLen = points.length;\n  let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (let i = 0; i < pointsLen - 1; ++i) {\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent || !pointAfter) {\n      continue;\n    }\n    if (almostEquals(deltaK[i], 0, EPSILON)) {\n      mK[i] = mK[i + 1] = 0;\n      continue;\n    }\n    alphaK = mK[i] / deltaK[i];\n    betaK = mK[i + 1] / deltaK[i];\n    squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n    if (squaredMagnitude <= 9) {\n      continue;\n    }\n    tauK = 3 / Math.sqrt(squaredMagnitude);\n    mK[i] = alphaK * tauK * deltaK[i];\n    mK[i + 1] = betaK * tauK * deltaK[i];\n  }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  let delta, pointBefore, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (let i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n    const iPixel = pointCurrent[indexAxis];\n    const vPixel = pointCurrent[valueAxis];\n    if (pointBefore) {\n      delta = (iPixel - pointBefore[indexAxis]) / 3;\n      pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n      pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n    }\n    if (pointAfter) {\n      delta = (pointAfter[indexAxis] - iPixel) / 3;\n      pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n      pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n    }\n  }\n}\nfunction splineCurveMonotone(points, indexAxis = 'x') {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  const deltaK = Array(pointsLen).fill(0);\n  const mK = Array(pointsLen);\n  let i, pointBefore, pointCurrent;\n  let pointAfter = getPoint(points, 0);\n  for (i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n    if (pointAfter) {\n      const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n      deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n    }\n    mK[i] = !pointBefore ? deltaK[i]\n      : !pointAfter ? deltaK[i - 1]\n      : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n      : (deltaK[i - 1] + deltaK[i]) / 2;\n  }\n  monotoneAdjust(points, deltaK, mK);\n  monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n  return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n  let i, ilen, point, inArea, inAreaPrev;\n  let inAreaNext = _isPointInArea(points[0], area);\n  for (i = 0, ilen = points.length; i < ilen; ++i) {\n    inAreaPrev = inArea;\n    inArea = inAreaNext;\n    inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n    if (!inArea) {\n      continue;\n    }\n    point = points[i];\n    if (inAreaPrev) {\n      point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n      point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n    }\n    if (inAreaNext) {\n      point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n      point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n    }\n  }\n}\nfunction _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n  let i, ilen, point, controlPoints;\n  if (options.spanGaps) {\n    points = points.filter((pt) => !pt.skip);\n  }\n  if (options.cubicInterpolationMode === 'monotone') {\n    splineCurveMonotone(points, indexAxis);\n  } else {\n    let prev = loop ? points[points.length - 1] : points[0];\n    for (i = 0, ilen = points.length; i < ilen; ++i) {\n      point = points[i];\n      controlPoints = splineCurve(\n        prev,\n        point,\n        points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n        options.tension\n      );\n      point.cp1x = controlPoints.previous.x;\n      point.cp1y = controlPoints.previous.y;\n      point.cp2x = controlPoints.next.x;\n      point.cp2y = controlPoints.next.y;\n      prev = point;\n    }\n  }\n  if (options.capBezierPoints) {\n    capBezierPoints(points, area);\n  }\n}\n\nfunction _isDomSupported() {\n  return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\nfunction _getParentNode(domNode) {\n  let parent = domNode.parentNode;\n  if (parent && parent.toString() === '[object ShadowRoot]') {\n    parent = parent.host;\n  }\n  return parent;\n}\nfunction parseMaxStyle(styleValue, node, parentProperty) {\n  let valueInPixels;\n  if (typeof styleValue === 'string') {\n    valueInPixels = parseInt(styleValue, 10);\n    if (styleValue.indexOf('%') !== -1) {\n      valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n    }\n  } else {\n    valueInPixels = styleValue;\n  }\n  return valueInPixels;\n}\nconst getComputedStyle = (element) => window.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n  return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles, style, suffix) {\n  const result = {};\n  suffix = suffix ? '-' + suffix : '';\n  for (let i = 0; i < 4; i++) {\n    const pos = positions[i];\n    result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n  }\n  result.width = result.left + result.right;\n  result.height = result.top + result.bottom;\n  return result;\n}\nconst useOffsetPos = (x, y, target) => (x > 0 || y > 0) && (!target || !target.shadowRoot);\nfunction getCanvasPosition(e, canvas) {\n  const touches = e.touches;\n  const source = touches && touches.length ? touches[0] : e;\n  const {offsetX, offsetY} = source;\n  let box = false;\n  let x, y;\n  if (useOffsetPos(offsetX, offsetY, e.target)) {\n    x = offsetX;\n    y = offsetY;\n  } else {\n    const rect = canvas.getBoundingClientRect();\n    x = source.clientX - rect.left;\n    y = source.clientY - rect.top;\n    box = true;\n  }\n  return {x, y, box};\n}\nfunction getRelativePosition(evt, chart) {\n  if ('native' in evt) {\n    return evt;\n  }\n  const {canvas, currentDevicePixelRatio} = chart;\n  const style = getComputedStyle(canvas);\n  const borderBox = style.boxSizing === 'border-box';\n  const paddings = getPositionedStyle(style, 'padding');\n  const borders = getPositionedStyle(style, 'border', 'width');\n  const {x, y, box} = getCanvasPosition(evt, canvas);\n  const xOffset = paddings.left + (box && borders.left);\n  const yOffset = paddings.top + (box && borders.top);\n  let {width, height} = chart;\n  if (borderBox) {\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  return {\n    x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n    y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n  };\n}\nfunction getContainerSize(canvas, width, height) {\n  let maxWidth, maxHeight;\n  if (width === undefined || height === undefined) {\n    const container = _getParentNode(canvas);\n    if (!container) {\n      width = canvas.clientWidth;\n      height = canvas.clientHeight;\n    } else {\n      const rect = container.getBoundingClientRect();\n      const containerStyle = getComputedStyle(container);\n      const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n      const containerPadding = getPositionedStyle(containerStyle, 'padding');\n      width = rect.width - containerPadding.width - containerBorder.width;\n      height = rect.height - containerPadding.height - containerBorder.height;\n      maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n      maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n    }\n  }\n  return {\n    width,\n    height,\n    maxWidth: maxWidth || INFINITY,\n    maxHeight: maxHeight || INFINITY\n  };\n}\nconst round1 = v => Math.round(v * 10) / 10;\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n  const style = getComputedStyle(canvas);\n  const margins = getPositionedStyle(style, 'margin');\n  const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n  const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n  const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n  let {width, height} = containerSize;\n  if (style.boxSizing === 'content-box') {\n    const borders = getPositionedStyle(style, 'border', 'width');\n    const paddings = getPositionedStyle(style, 'padding');\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  width = Math.max(0, width - margins.width);\n  height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);\n  width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n  height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n  if (width && !height) {\n    height = round1(width / 2);\n  }\n  return {\n    width,\n    height\n  };\n}\nfunction retinaScale(chart, forceRatio, forceStyle) {\n  const pixelRatio = forceRatio || 1;\n  const deviceHeight = Math.floor(chart.height * pixelRatio);\n  const deviceWidth = Math.floor(chart.width * pixelRatio);\n  chart.height = deviceHeight / pixelRatio;\n  chart.width = deviceWidth / pixelRatio;\n  const canvas = chart.canvas;\n  if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n    canvas.style.height = `${chart.height}px`;\n    canvas.style.width = `${chart.width}px`;\n  }\n  if (chart.currentDevicePixelRatio !== pixelRatio\n      || canvas.height !== deviceHeight\n      || canvas.width !== deviceWidth) {\n    chart.currentDevicePixelRatio = pixelRatio;\n    canvas.height = deviceHeight;\n    canvas.width = deviceWidth;\n    chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n    return true;\n  }\n  return false;\n}\nconst supportsEventListenerOptions = (function() {\n  let passiveSupported = false;\n  try {\n    const options = {\n      get passive() {\n        passiveSupported = true;\n        return false;\n      }\n    };\n    window.addEventListener('test', null, options);\n    window.removeEventListener('test', null, options);\n  } catch (e) {\n  }\n  return passiveSupported;\n}());\nfunction readUsedSize(element, property) {\n  const value = getStyle(element, property);\n  const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n  return matches ? +matches[1] : undefined;\n}\n\nfunction _pointInLine(p1, p2, t, mode) {\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: p1.y + t * (p2.y - p1.y)\n  };\n}\nfunction _steppedInterpolation(p1, p2, t, mode) {\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n    : mode === 'after' ? t < 1 ? p1.y : p2.y\n    : t > 0 ? p2.y : p1.y\n  };\n}\nfunction _bezierInterpolation(p1, p2, t, mode) {\n  const cp1 = {x: p1.cp2x, y: p1.cp2y};\n  const cp2 = {x: p2.cp1x, y: p2.cp1y};\n  const a = _pointInLine(p1, cp1, t);\n  const b = _pointInLine(cp1, cp2, t);\n  const c = _pointInLine(cp2, p2, t);\n  const d = _pointInLine(a, b, t);\n  const e = _pointInLine(b, c, t);\n  return _pointInLine(d, e, t);\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n  options = options || {};\n  const cacheKey = locale + JSON.stringify(options);\n  let formatter = intlCache.get(cacheKey);\n  if (!formatter) {\n    formatter = new Intl.NumberFormat(locale, options);\n    intlCache.set(cacheKey, formatter);\n  }\n  return formatter;\n}\nfunction formatNumber(num, locale, options) {\n  return getNumberFormat(locale, options).format(num);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n  return {\n    x(x) {\n      return rectX + rectX + width - x;\n    },\n    setWidth(w) {\n      width = w;\n    },\n    textAlign(align) {\n      if (align === 'center') {\n        return align;\n      }\n      return align === 'right' ? 'left' : 'right';\n    },\n    xPlus(x, value) {\n      return x - value;\n    },\n    leftForLtr(x, itemWidth) {\n      return x - itemWidth;\n    },\n  };\n};\nconst getLeftToRightAdapter = function() {\n  return {\n    x(x) {\n      return x;\n    },\n    setWidth(w) {\n    },\n    textAlign(align) {\n      return align;\n    },\n    xPlus(x, value) {\n      return x + value;\n    },\n    leftForLtr(x, _itemWidth) {\n      return x;\n    },\n  };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n  return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n  let style, original;\n  if (direction === 'ltr' || direction === 'rtl') {\n    style = ctx.canvas.style;\n    original = [\n      style.getPropertyValue('direction'),\n      style.getPropertyPriority('direction'),\n    ];\n    style.setProperty('direction', direction, 'important');\n    ctx.prevTextDirection = original;\n  }\n}\nfunction restoreTextDirection(ctx, original) {\n  if (original !== undefined) {\n    delete ctx.prevTextDirection;\n    ctx.canvas.style.setProperty('direction', original[0], original[1]);\n  }\n}\n\nfunction propertyFn(property) {\n  if (property === 'angle') {\n    return {\n      between: _angleBetween,\n      compare: _angleDiff,\n      normalize: _normalizeAngle,\n    };\n  }\n  return {\n    between: _isBetween,\n    compare: (a, b) => a - b,\n    normalize: x => x\n  };\n}\nfunction normalizeSegment({start, end, count, loop, style}) {\n  return {\n    start: start % count,\n    end: end % count,\n    loop: loop && (end - start + 1) % count === 0,\n    style\n  };\n}\nfunction getSegment(segment, points, bounds) {\n  const {property, start: startBound, end: endBound} = bounds;\n  const {between, normalize} = propertyFn(property);\n  const count = points.length;\n  let {start, end, loop} = segment;\n  let i, ilen;\n  if (loop) {\n    start += count;\n    end += count;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n        break;\n      }\n      start--;\n      end--;\n    }\n    start %= count;\n    end %= count;\n  }\n  if (end < start) {\n    end += count;\n  }\n  return {start, end, loop, style: segment.style};\n}\nfunction _boundSegment(segment, points, bounds) {\n  if (!bounds) {\n    return [segment];\n  }\n  const {property, start: startBound, end: endBound} = bounds;\n  const count = points.length;\n  const {compare, between, normalize} = propertyFn(property);\n  const {start, end, loop, style} = getSegment(segment, points, bounds);\n  const result = [];\n  let inside = false;\n  let subStart = null;\n  let value, point, prevValue;\n  const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n  const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n  const shouldStart = () => inside || startIsBefore();\n  const shouldStop = () => !inside || endIsBefore();\n  for (let i = start, prev = start; i <= end; ++i) {\n    point = points[i % count];\n    if (point.skip) {\n      continue;\n    }\n    value = normalize(point[property]);\n    if (value === prevValue) {\n      continue;\n    }\n    inside = between(value, startBound, endBound);\n    if (subStart === null && shouldStart()) {\n      subStart = compare(value, startBound) === 0 ? i : prev;\n    }\n    if (subStart !== null && shouldStop()) {\n      result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n      subStart = null;\n    }\n    prev = i;\n    prevValue = value;\n  }\n  if (subStart !== null) {\n    result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n  }\n  return result;\n}\nfunction _boundSegments(line, bounds) {\n  const result = [];\n  const segments = line.segments;\n  for (let i = 0; i < segments.length; i++) {\n    const sub = _boundSegment(segments[i], line.points, bounds);\n    if (sub.length) {\n      result.push(...sub);\n    }\n  }\n  return result;\n}\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n  let start = 0;\n  let end = count - 1;\n  if (loop && !spanGaps) {\n    while (start < count && !points[start].skip) {\n      start++;\n    }\n  }\n  while (start < count && points[start].skip) {\n    start++;\n  }\n  start %= count;\n  if (loop) {\n    end += start;\n  }\n  while (end > start && points[end % count].skip) {\n    end--;\n  }\n  end %= count;\n  return {start, end};\n}\nfunction solidSegments(points, start, max, loop) {\n  const count = points.length;\n  const result = [];\n  let last = start;\n  let prev = points[start];\n  let end;\n  for (end = start + 1; end <= max; ++end) {\n    const cur = points[end % count];\n    if (cur.skip || cur.stop) {\n      if (!prev.skip) {\n        loop = false;\n        result.push({start: start % count, end: (end - 1) % count, loop});\n        start = last = cur.stop ? end : null;\n      }\n    } else {\n      last = end;\n      if (prev.skip) {\n        start = end;\n      }\n    }\n    prev = cur;\n  }\n  if (last !== null) {\n    result.push({start: start % count, end: last % count, loop});\n  }\n  return result;\n}\nfunction _computeSegments(line, segmentOptions) {\n  const points = line.points;\n  const spanGaps = line.options.spanGaps;\n  const count = points.length;\n  if (!count) {\n    return [];\n  }\n  const loop = !!line._loop;\n  const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n  if (spanGaps === true) {\n    return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n  }\n  const max = end < start ? end + count : end;\n  const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n  return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction splitByStyles(line, segments, points, segmentOptions) {\n  if (!segmentOptions || !segmentOptions.setContext || !points) {\n    return segments;\n  }\n  return doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n  const chartContext = line._chart.getContext();\n  const baseStyle = readStyle(line.options);\n  const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n  const count = points.length;\n  const result = [];\n  let prevStyle = baseStyle;\n  let start = segments[0].start;\n  let i = start;\n  function addStyle(s, e, l, st) {\n    const dir = spanGaps ? -1 : 1;\n    if (s === e) {\n      return;\n    }\n    s += count;\n    while (points[s % count].skip) {\n      s -= dir;\n    }\n    while (points[e % count].skip) {\n      e += dir;\n    }\n    if (s % count !== e % count) {\n      result.push({start: s % count, end: e % count, loop: l, style: st});\n      prevStyle = st;\n      start = e % count;\n    }\n  }\n  for (const segment of segments) {\n    start = spanGaps ? start : segment.start;\n    let prev = points[start % count];\n    let style;\n    for (i = start + 1; i <= segment.end; i++) {\n      const pt = points[i % count];\n      style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n        type: 'segment',\n        p0: prev,\n        p1: pt,\n        p0DataIndex: (i - 1) % count,\n        p1DataIndex: i % count,\n        datasetIndex\n      })));\n      if (styleChanged(style, prevStyle)) {\n        addStyle(start, i - 1, segment.loop, prevStyle);\n      }\n      prev = pt;\n      prevStyle = style;\n    }\n    if (start < i - 1) {\n      addStyle(start, i - 1, segment.loop, prevStyle);\n    }\n  }\n  return result;\n}\nfunction readStyle(options) {\n  return {\n    backgroundColor: options.backgroundColor,\n    borderCapStyle: options.borderCapStyle,\n    borderDash: options.borderDash,\n    borderDashOffset: options.borderDashOffset,\n    borderJoinStyle: options.borderJoinStyle,\n    borderWidth: options.borderWidth,\n    borderColor: options.borderColor\n  };\n}\nfunction styleChanged(style, prevStyle) {\n  return prevStyle && JSON.stringify(style) !== JSON.stringify(prevStyle);\n}\n\nexport { toFont as $, _rlookupByKey as A, _isPointInArea as B, getAngleFromPoint as C, toPadding as D, each as E, getMaximumSize as F, _getParentNode as G, HALF_PI as H, readUsedSize as I, throttled as J, supportsEventListenerOptions as K, _isDomSupported as L, log10 as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, toDegrees as S, TAU as T, _measureText as U, _int16Range as V, _alignPixel as W, clipArea as X, renderText as Y, unclipArea as Z, _arrayUnique as _, resolve as a, QUARTER_PI as a$, _toLeftRightCenter as a0, _alignStartEnd as a1, overrides as a2, merge as a3, _capitalize as a4, descriptors as a5, isFunction as a6, _attachContext as a7, _createResolver as a8, _descriptors as a9, _textX as aA, restoreTextDirection as aB, noop as aC, distanceBetweenPoints as aD, _setMinAndMaxByKey as aE, niceNum as aF, almostWhole as aG, almostEquals as aH, _decimalPlaces as aI, _longestText as aJ, _filterBetween as aK, _lookup as aL, isPatternOrGradient as aM, getHoverColor as aN, clone$1 as aO, _merger as aP, _mergerIf as aQ, _deprecated as aR, toFontString as aS, splineCurve as aT, splineCurveMonotone as aU, getStyle as aV, fontString as aW, toLineHeight as aX, PITAU as aY, INFINITY as aZ, RAD_PER_DEG as a_, mergeIf as aa, uid as ab, debounce as ac, retinaScale as ad, clearCanvas as ae, setsEqual as af, _elementsEqual as ag, _isClickEvent as ah, _isBetween as ai, _readValueToProps as aj, _updateBezierControlPoints as ak, _computeSegments as al, _boundSegments as am, _steppedInterpolation as an, _bezierInterpolation as ao, _pointInLine as ap, _steppedLineTo as aq, _bezierCurveTo as ar, drawPoint as as, addRoundedRectPath as at, toTRBL as au, toTRBLCorners as av, _boundSegment as aw, _normalizeAngle as ax, getRtlAdapter as ay, overrideTextDirection as az, isArray as b, TWO_THIRDS_PI as b0, _angleDiff as b1, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, createContext as h, isObject as i, defined as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, isNumber as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _limitValue as w, _lookupByKey as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n", "/*!\n * Chart.js v3.8.0\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, d as defaults, i as isObject, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as createContext, j as defined, s as sign, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as isNumber, w as _limitValue, x as _lookupByKey, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _isPointInArea, C as getAngleFromPoint, D as toPadding, E as each, F as getMaximumSize, G as _getParentNode, I as readUsedSize, J as throttled, K as supportsEventListenerOptions, L as _isDomSupported, M as log10, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as toDegrees, U as _measureText, V as _int16Range, W as _alignPixel, X as clipArea, Y as renderText, Z as unclipArea, $ as toFont, a0 as _toLeftRightCenter, a1 as _alignStartEnd, a2 as overrides, a3 as merge, a4 as _capitalize, a5 as descriptors, a6 as isFunction, a7 as _attachContext, a8 as _createResolver, a9 as _descriptors, aa as mergeIf, ab as uid, ac as debounce, ad as retinaScale, ae as clearCanvas, af as setsEqual, ag as _elementsEqual, ah as _isClickEvent, ai as _isBetween, aj as _readValueToProps, ak as _updateBezierControlPoints, al as _computeSegments, am as _boundSegments, an as _steppedInterpolation, ao as _bezierInterpolation, ap as _pointInLine, aq as _steppedLineTo, ar as _bezierCurveTo, as as drawPoint, at as addRoundedRectPath, au as toTRBL, av as toTRBLCorners, aw as _boundSegment, ax as _normalizeAngle, ay as getRtlAdapter, az as overrideTextDirection, aA as _textX, aB as restoreTextDirection, aC as noop, aD as distanceBetweenPoints, aE as _setMinAndMaxByKey, aF as niceNum, aG as almostWhole, aH as almostEquals, aI as _decimalPlaces, aJ as _longestText, aK as _filterBetween, aL as _lookup } from './chunks/helpers.segment.js';\nexport { d as defaults } from './chunks/helpers.segment.js';\n\nclass Animator {\n  constructor() {\n    this._request = null;\n    this._charts = new Map();\n    this._running = false;\n    this._lastDate = undefined;\n  }\n  _notify(chart, anims, date, type) {\n    const callbacks = anims.listeners[type];\n    const numSteps = anims.duration;\n    callbacks.forEach(fn => fn({\n      chart,\n      initial: anims.initial,\n      numSteps,\n      currentStep: Math.min(date - anims.start, numSteps)\n    }));\n  }\n  _refresh() {\n    if (this._request) {\n      return;\n    }\n    this._running = true;\n    this._request = requestAnimFrame.call(window, () => {\n      this._update();\n      this._request = null;\n      if (this._running) {\n        this._refresh();\n      }\n    });\n  }\n  _update(date = Date.now()) {\n    let remaining = 0;\n    this._charts.forEach((anims, chart) => {\n      if (!anims.running || !anims.items.length) {\n        return;\n      }\n      const items = anims.items;\n      let i = items.length - 1;\n      let draw = false;\n      let item;\n      for (; i >= 0; --i) {\n        item = items[i];\n        if (item._active) {\n          if (item._total > anims.duration) {\n            anims.duration = item._total;\n          }\n          item.tick(date);\n          draw = true;\n        } else {\n          items[i] = items[items.length - 1];\n          items.pop();\n        }\n      }\n      if (draw) {\n        chart.draw();\n        this._notify(chart, anims, date, 'progress');\n      }\n      if (!items.length) {\n        anims.running = false;\n        this._notify(chart, anims, date, 'complete');\n        anims.initial = false;\n      }\n      remaining += items.length;\n    });\n    this._lastDate = date;\n    if (remaining === 0) {\n      this._running = false;\n    }\n  }\n  _getAnims(chart) {\n    const charts = this._charts;\n    let anims = charts.get(chart);\n    if (!anims) {\n      anims = {\n        running: false,\n        initial: true,\n        items: [],\n        listeners: {\n          complete: [],\n          progress: []\n        }\n      };\n      charts.set(chart, anims);\n    }\n    return anims;\n  }\n  listen(chart, event, cb) {\n    this._getAnims(chart).listeners[event].push(cb);\n  }\n  add(chart, items) {\n    if (!items || !items.length) {\n      return;\n    }\n    this._getAnims(chart).items.push(...items);\n  }\n  has(chart) {\n    return this._getAnims(chart).items.length > 0;\n  }\n  start(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims) {\n      return;\n    }\n    anims.running = true;\n    anims.start = Date.now();\n    anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n    this._refresh();\n  }\n  running(chart) {\n    if (!this._running) {\n      return false;\n    }\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.running || !anims.items.length) {\n      return false;\n    }\n    return true;\n  }\n  stop(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.items.length) {\n      return;\n    }\n    const items = anims.items;\n    let i = items.length - 1;\n    for (; i >= 0; --i) {\n      items[i].cancel();\n    }\n    anims.items = [];\n    this._notify(chart, anims, Date.now(), 'complete');\n  }\n  remove(chart) {\n    return this._charts.delete(chart);\n  }\n}\nvar animator = new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n  boolean(from, to, factor) {\n    return factor > 0.5 ? to : from;\n  },\n  color(from, to, factor) {\n    const c0 = color(from || transparent);\n    const c1 = c0.valid && color(to || transparent);\n    return c1 && c1.valid\n      ? c1.mix(c0, factor).hexString()\n      : to;\n  },\n  number(from, to, factor) {\n    return from + (to - from) * factor;\n  }\n};\nclass Animation {\n  constructor(cfg, target, prop, to) {\n    const currentValue = target[prop];\n    to = resolve([cfg.to, to, currentValue, cfg.from]);\n    const from = resolve([cfg.from, currentValue, to]);\n    this._active = true;\n    this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n    this._easing = effects[cfg.easing] || effects.linear;\n    this._start = Math.floor(Date.now() + (cfg.delay || 0));\n    this._duration = this._total = Math.floor(cfg.duration);\n    this._loop = !!cfg.loop;\n    this._target = target;\n    this._prop = prop;\n    this._from = from;\n    this._to = to;\n    this._promises = undefined;\n  }\n  active() {\n    return this._active;\n  }\n  update(cfg, to, date) {\n    if (this._active) {\n      this._notify(false);\n      const currentValue = this._target[this._prop];\n      const elapsed = date - this._start;\n      const remain = this._duration - elapsed;\n      this._start = date;\n      this._duration = Math.floor(Math.max(remain, cfg.duration));\n      this._total += elapsed;\n      this._loop = !!cfg.loop;\n      this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n      this._from = resolve([cfg.from, currentValue, to]);\n    }\n  }\n  cancel() {\n    if (this._active) {\n      this.tick(Date.now());\n      this._active = false;\n      this._notify(false);\n    }\n  }\n  tick(date) {\n    const elapsed = date - this._start;\n    const duration = this._duration;\n    const prop = this._prop;\n    const from = this._from;\n    const loop = this._loop;\n    const to = this._to;\n    let factor;\n    this._active = from !== to && (loop || (elapsed < duration));\n    if (!this._active) {\n      this._target[prop] = to;\n      this._notify(true);\n      return;\n    }\n    if (elapsed < 0) {\n      this._target[prop] = from;\n      return;\n    }\n    factor = (elapsed / duration) % 2;\n    factor = loop && factor > 1 ? 2 - factor : factor;\n    factor = this._easing(Math.min(1, Math.max(0, factor)));\n    this._target[prop] = this._fn(from, to, factor);\n  }\n  wait() {\n    const promises = this._promises || (this._promises = []);\n    return new Promise((res, rej) => {\n      promises.push({res, rej});\n    });\n  }\n  _notify(resolved) {\n    const method = resolved ? 'res' : 'rej';\n    const promises = this._promises || [];\n    for (let i = 0; i < promises.length; i++) {\n      promises[i][method]();\n    }\n  }\n}\n\nconst numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\ndefaults.set('animation', {\n  delay: undefined,\n  duration: 1000,\n  easing: 'easeOutQuart',\n  fn: undefined,\n  from: undefined,\n  loop: undefined,\n  to: undefined,\n  type: undefined,\n});\nconst animationOptions = Object.keys(defaults.animation);\ndefaults.describe('animation', {\n  _fallback: false,\n  _indexable: false,\n  _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n});\ndefaults.set('animations', {\n  colors: {\n    type: 'color',\n    properties: colors\n  },\n  numbers: {\n    type: 'number',\n    properties: numbers\n  },\n});\ndefaults.describe('animations', {\n  _fallback: 'animation',\n});\ndefaults.set('transitions', {\n  active: {\n    animation: {\n      duration: 400\n    }\n  },\n  resize: {\n    animation: {\n      duration: 0\n    }\n  },\n  show: {\n    animations: {\n      colors: {\n        from: 'transparent'\n      },\n      visible: {\n        type: 'boolean',\n        duration: 0\n      },\n    }\n  },\n  hide: {\n    animations: {\n      colors: {\n        to: 'transparent'\n      },\n      visible: {\n        type: 'boolean',\n        easing: 'linear',\n        fn: v => v | 0\n      },\n    }\n  }\n});\nclass Animations {\n  constructor(chart, config) {\n    this._chart = chart;\n    this._properties = new Map();\n    this.configure(config);\n  }\n  configure(config) {\n    if (!isObject(config)) {\n      return;\n    }\n    const animatedProps = this._properties;\n    Object.getOwnPropertyNames(config).forEach(key => {\n      const cfg = config[key];\n      if (!isObject(cfg)) {\n        return;\n      }\n      const resolved = {};\n      for (const option of animationOptions) {\n        resolved[option] = cfg[option];\n      }\n      (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n        if (prop === key || !animatedProps.has(prop)) {\n          animatedProps.set(prop, resolved);\n        }\n      });\n    });\n  }\n  _animateOptions(target, values) {\n    const newOptions = values.options;\n    const options = resolveTargetOptions(target, newOptions);\n    if (!options) {\n      return [];\n    }\n    const animations = this._createAnimations(options, newOptions);\n    if (newOptions.$shared) {\n      awaitAll(target.options.$animations, newOptions).then(() => {\n        target.options = newOptions;\n      }, () => {\n      });\n    }\n    return animations;\n  }\n  _createAnimations(target, values) {\n    const animatedProps = this._properties;\n    const animations = [];\n    const running = target.$animations || (target.$animations = {});\n    const props = Object.keys(values);\n    const date = Date.now();\n    let i;\n    for (i = props.length - 1; i >= 0; --i) {\n      const prop = props[i];\n      if (prop.charAt(0) === '$') {\n        continue;\n      }\n      if (prop === 'options') {\n        animations.push(...this._animateOptions(target, values));\n        continue;\n      }\n      const value = values[prop];\n      let animation = running[prop];\n      const cfg = animatedProps.get(prop);\n      if (animation) {\n        if (cfg && animation.active()) {\n          animation.update(cfg, value, date);\n          continue;\n        } else {\n          animation.cancel();\n        }\n      }\n      if (!cfg || !cfg.duration) {\n        target[prop] = value;\n        continue;\n      }\n      running[prop] = animation = new Animation(cfg, target, prop, value);\n      animations.push(animation);\n    }\n    return animations;\n  }\n  update(target, values) {\n    if (this._properties.size === 0) {\n      Object.assign(target, values);\n      return;\n    }\n    const animations = this._createAnimations(target, values);\n    if (animations.length) {\n      animator.add(this._chart, animations);\n      return true;\n    }\n  }\n}\nfunction awaitAll(animations, properties) {\n  const running = [];\n  const keys = Object.keys(properties);\n  for (let i = 0; i < keys.length; i++) {\n    const anim = animations[keys[i]];\n    if (anim && anim.active()) {\n      running.push(anim.wait());\n    }\n  }\n  return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n  if (!newOptions) {\n    return;\n  }\n  let options = target.options;\n  if (!options) {\n    target.options = newOptions;\n    return;\n  }\n  if (options.$shared) {\n    target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n  }\n  return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n  const opts = scale && scale.options || {};\n  const reverse = opts.reverse;\n  const min = opts.min === undefined ? allowedOverflow : 0;\n  const max = opts.max === undefined ? allowedOverflow : 0;\n  return {\n    start: reverse ? max : min,\n    end: reverse ? min : max\n  };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n  if (allowedOverflow === false) {\n    return false;\n  }\n  const x = scaleClip(xScale, allowedOverflow);\n  const y = scaleClip(yScale, allowedOverflow);\n  return {\n    top: y.end,\n    right: x.end,\n    bottom: y.start,\n    left: x.start\n  };\n}\nfunction toClip(value) {\n  let t, r, b, l;\n  if (isObject(value)) {\n    t = value.top;\n    r = value.right;\n    b = value.bottom;\n    l = value.left;\n  } else {\n    t = r = b = l = value;\n  }\n  return {\n    top: t,\n    right: r,\n    bottom: b,\n    left: l,\n    disabled: value === false\n  };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n  const keys = [];\n  const metasets = chart._getSortedDatasetMetas(filterVisible);\n  let i, ilen;\n  for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n    keys.push(metasets[i].index);\n  }\n  return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n  const keys = stack.keys;\n  const singleMode = options.mode === 'single';\n  let i, ilen, datasetIndex, otherValue;\n  if (value === null) {\n    return;\n  }\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    datasetIndex = +keys[i];\n    if (datasetIndex === dsIndex) {\n      if (options.all) {\n        continue;\n      }\n      break;\n    }\n    otherValue = stack.values[datasetIndex];\n    if (isNumberFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n      value += otherValue;\n    }\n  }\n  return value;\n}\nfunction convertObjectDataToArray(data) {\n  const keys = Object.keys(data);\n  const adata = new Array(keys.length);\n  let i, ilen, key;\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    key = keys[i];\n    adata[i] = {\n      x: key,\n      y: data[key]\n    };\n  }\n  return adata;\n}\nfunction isStacked(scale, meta) {\n  const stacked = scale && scale.options.stacked;\n  return stacked || (stacked === undefined && meta.stack !== undefined);\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n  return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n  const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n  return {\n    min: minDefined ? min : Number.NEGATIVE_INFINITY,\n    max: maxDefined ? max : Number.POSITIVE_INFINITY\n  };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n  const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n  return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n  for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n    const value = stack[meta.index];\n    if ((positive && value > 0) || (!positive && value < 0)) {\n      return meta.index;\n    }\n  }\n  return null;\n}\nfunction updateStacks(controller, parsed) {\n  const {chart, _cachedMeta: meta} = controller;\n  const stacks = chart._stacks || (chart._stacks = {});\n  const {iScale, vScale, index: datasetIndex} = meta;\n  const iAxis = iScale.axis;\n  const vAxis = vScale.axis;\n  const key = getStackKey(iScale, vScale, meta);\n  const ilen = parsed.length;\n  let stack;\n  for (let i = 0; i < ilen; ++i) {\n    const item = parsed[i];\n    const {[iAxis]: index, [vAxis]: value} = item;\n    const itemStacks = item._stacks || (item._stacks = {});\n    stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n    stack[datasetIndex] = value;\n    stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n    stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n  }\n}\nfunction getFirstScaleId(chart, axis) {\n  const scales = chart.scales;\n  return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n  return createContext(parent,\n    {\n      active: false,\n      dataset: undefined,\n      datasetIndex: index,\n      index,\n      mode: 'default',\n      type: 'dataset'\n    }\n  );\n}\nfunction createDataContext(parent, index, element) {\n  return createContext(parent, {\n    active: false,\n    dataIndex: index,\n    parsed: undefined,\n    raw: undefined,\n    element,\n    index,\n    mode: 'default',\n    type: 'data'\n  });\n}\nfunction clearStacks(meta, items) {\n  const datasetIndex = meta.controller.index;\n  const axis = meta.vScale && meta.vScale.axis;\n  if (!axis) {\n    return;\n  }\n  items = items || meta._parsed;\n  for (const parsed of items) {\n    const stacks = parsed._stacks;\n    if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n      return;\n    }\n    delete stacks[axis][datasetIndex];\n  }\n}\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n  && {keys: getSortedDatasetIndices(chart, true), values: null};\nclass DatasetController {\n  constructor(chart, datasetIndex) {\n    this.chart = chart;\n    this._ctx = chart.ctx;\n    this.index = datasetIndex;\n    this._cachedDataOpts = {};\n    this._cachedMeta = this.getMeta();\n    this._type = this._cachedMeta.type;\n    this.options = undefined;\n    this._parsing = false;\n    this._data = undefined;\n    this._objectData = undefined;\n    this._sharedOptions = undefined;\n    this._drawStart = undefined;\n    this._drawCount = undefined;\n    this.enableOptionSharing = false;\n    this.supportsDecimation = false;\n    this.$context = undefined;\n    this._syncList = [];\n    this.initialize();\n  }\n  initialize() {\n    const meta = this._cachedMeta;\n    this.configure();\n    this.linkScales();\n    meta._stacked = isStacked(meta.vScale, meta);\n    this.addElements();\n  }\n  updateIndex(datasetIndex) {\n    if (this.index !== datasetIndex) {\n      clearStacks(this._cachedMeta);\n    }\n    this.index = datasetIndex;\n  }\n  linkScales() {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n    const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n    const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n    const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n    const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n    const indexAxis = meta.indexAxis;\n    const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n    const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n    meta.xScale = this.getScaleForId(xid);\n    meta.yScale = this.getScaleForId(yid);\n    meta.rScale = this.getScaleForId(rid);\n    meta.iScale = this.getScaleForId(iid);\n    meta.vScale = this.getScaleForId(vid);\n  }\n  getDataset() {\n    return this.chart.data.datasets[this.index];\n  }\n  getMeta() {\n    return this.chart.getDatasetMeta(this.index);\n  }\n  getScaleForId(scaleID) {\n    return this.chart.scales[scaleID];\n  }\n  _getOtherScale(scale) {\n    const meta = this._cachedMeta;\n    return scale === meta.iScale\n      ? meta.vScale\n      : meta.iScale;\n  }\n  reset() {\n    this._update('reset');\n  }\n  _destroy() {\n    const meta = this._cachedMeta;\n    if (this._data) {\n      unlistenArrayEvents(this._data, this);\n    }\n    if (meta._stacked) {\n      clearStacks(meta);\n    }\n  }\n  _dataCheck() {\n    const dataset = this.getDataset();\n    const data = dataset.data || (dataset.data = []);\n    const _data = this._data;\n    if (isObject(data)) {\n      this._data = convertObjectDataToArray(data);\n    } else if (_data !== data) {\n      if (_data) {\n        unlistenArrayEvents(_data, this);\n        const meta = this._cachedMeta;\n        clearStacks(meta);\n        meta._parsed = [];\n      }\n      if (data && Object.isExtensible(data)) {\n        listenArrayEvents(data, this);\n      }\n      this._syncList = [];\n      this._data = data;\n    }\n  }\n  addElements() {\n    const meta = this._cachedMeta;\n    this._dataCheck();\n    if (this.datasetElementType) {\n      meta.dataset = new this.datasetElementType();\n    }\n  }\n  buildOrUpdateElements(resetNewElements) {\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n    let stackChanged = false;\n    this._dataCheck();\n    const oldStacked = meta._stacked;\n    meta._stacked = isStacked(meta.vScale, meta);\n    if (meta.stack !== dataset.stack) {\n      stackChanged = true;\n      clearStacks(meta);\n      meta.stack = dataset.stack;\n    }\n    this._resyncElements(resetNewElements);\n    if (stackChanged || oldStacked !== meta._stacked) {\n      updateStacks(this, meta._parsed);\n    }\n  }\n  configure() {\n    const config = this.chart.config;\n    const scopeKeys = config.datasetScopeKeys(this._type);\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n    this.options = config.createResolver(scopes, this.getContext());\n    this._parsing = this.options.parsing;\n    this._cachedDataOpts = {};\n  }\n  parse(start, count) {\n    const {_cachedMeta: meta, _data: data} = this;\n    const {iScale, _stacked} = meta;\n    const iAxis = iScale.axis;\n    let sorted = start === 0 && count === data.length ? true : meta._sorted;\n    let prev = start > 0 && meta._parsed[start - 1];\n    let i, cur, parsed;\n    if (this._parsing === false) {\n      meta._parsed = data;\n      meta._sorted = true;\n      parsed = data;\n    } else {\n      if (isArray(data[start])) {\n        parsed = this.parseArrayData(meta, data, start, count);\n      } else if (isObject(data[start])) {\n        parsed = this.parseObjectData(meta, data, start, count);\n      } else {\n        parsed = this.parsePrimitiveData(meta, data, start, count);\n      }\n      const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n      for (i = 0; i < count; ++i) {\n        meta._parsed[i + start] = cur = parsed[i];\n        if (sorted) {\n          if (isNotInOrderComparedToPrev()) {\n            sorted = false;\n          }\n          prev = cur;\n        }\n      }\n      meta._sorted = sorted;\n    }\n    if (_stacked) {\n      updateStacks(this, parsed);\n    }\n  }\n  parsePrimitiveData(meta, data, start, count) {\n    const {iScale, vScale} = meta;\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const labels = iScale.getLabels();\n    const singleScale = iScale === vScale;\n    const parsed = new Array(count);\n    let i, ilen, index;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      parsed[i] = {\n        [iAxis]: singleScale || iScale.parse(labels[index], index),\n        [vAxis]: vScale.parse(data[index], index)\n      };\n    }\n    return parsed;\n  }\n  parseArrayData(meta, data, start, count) {\n    const {xScale, yScale} = meta;\n    const parsed = new Array(count);\n    let i, ilen, index, item;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      item = data[index];\n      parsed[i] = {\n        x: xScale.parse(item[0], index),\n        y: yScale.parse(item[1], index)\n      };\n    }\n    return parsed;\n  }\n  parseObjectData(meta, data, start, count) {\n    const {xScale, yScale} = meta;\n    const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n    const parsed = new Array(count);\n    let i, ilen, index, item;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      item = data[index];\n      parsed[i] = {\n        x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n        y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n      };\n    }\n    return parsed;\n  }\n  getParsed(index) {\n    return this._cachedMeta._parsed[index];\n  }\n  getDataElement(index) {\n    return this._cachedMeta.data[index];\n  }\n  applyStack(scale, parsed, mode) {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const value = parsed[scale.axis];\n    const stack = {\n      keys: getSortedDatasetIndices(chart, true),\n      values: parsed._stacks[scale.axis]\n    };\n    return applyStack(stack, value, meta.index, {mode});\n  }\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    const parsedValue = parsed[scale.axis];\n    let value = parsedValue === null ? NaN : parsedValue;\n    const values = stack && parsed._stacks[scale.axis];\n    if (stack && values) {\n      stack.values = values;\n      value = applyStack(stack, parsedValue, this._cachedMeta.index);\n    }\n    range.min = Math.min(range.min, value);\n    range.max = Math.max(range.max, value);\n  }\n  getMinMax(scale, canStack) {\n    const meta = this._cachedMeta;\n    const _parsed = meta._parsed;\n    const sorted = meta._sorted && scale === meta.iScale;\n    const ilen = _parsed.length;\n    const otherScale = this._getOtherScale(scale);\n    const stack = createStack(canStack, meta, this.chart);\n    const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n    const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n    let i, parsed;\n    function _skip() {\n      parsed = _parsed[i];\n      const otherValue = parsed[otherScale.axis];\n      return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n    }\n    for (i = 0; i < ilen; ++i) {\n      if (_skip()) {\n        continue;\n      }\n      this.updateRangeFromParsed(range, scale, parsed, stack);\n      if (sorted) {\n        break;\n      }\n    }\n    if (sorted) {\n      for (i = ilen - 1; i >= 0; --i) {\n        if (_skip()) {\n          continue;\n        }\n        this.updateRangeFromParsed(range, scale, parsed, stack);\n        break;\n      }\n    }\n    return range;\n  }\n  getAllParsedValues(scale) {\n    const parsed = this._cachedMeta._parsed;\n    const values = [];\n    let i, ilen, value;\n    for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n      value = parsed[i][scale.axis];\n      if (isNumberFinite(value)) {\n        values.push(value);\n      }\n    }\n    return values;\n  }\n  getMaxOverflow() {\n    return false;\n  }\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const vScale = meta.vScale;\n    const parsed = this.getParsed(index);\n    return {\n      label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n      value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n    };\n  }\n  _update(mode) {\n    const meta = this._cachedMeta;\n    this.update(mode || 'default');\n    meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n  }\n  update(mode) {}\n  draw() {\n    const ctx = this._ctx;\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const elements = meta.data || [];\n    const area = chart.chartArea;\n    const active = [];\n    const start = this._drawStart || 0;\n    const count = this._drawCount || (elements.length - start);\n    const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n    let i;\n    if (meta.dataset) {\n      meta.dataset.draw(ctx, area, start, count);\n    }\n    for (i = start; i < start + count; ++i) {\n      const element = elements[i];\n      if (element.hidden) {\n        continue;\n      }\n      if (element.active && drawActiveElementsOnTop) {\n        active.push(element);\n      } else {\n        element.draw(ctx, area);\n      }\n    }\n    for (i = 0; i < active.length; ++i) {\n      active[i].draw(ctx, area);\n    }\n  }\n  getStyle(index, active) {\n    const mode = active ? 'active' : 'default';\n    return index === undefined && this._cachedMeta.dataset\n      ? this.resolveDatasetElementOptions(mode)\n      : this.resolveDataElementOptions(index || 0, mode);\n  }\n  getContext(index, active, mode) {\n    const dataset = this.getDataset();\n    let context;\n    if (index >= 0 && index < this._cachedMeta.data.length) {\n      const element = this._cachedMeta.data[index];\n      context = element.$context ||\n        (element.$context = createDataContext(this.getContext(), index, element));\n      context.parsed = this.getParsed(index);\n      context.raw = dataset.data[index];\n      context.index = context.dataIndex = index;\n    } else {\n      context = this.$context ||\n        (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n      context.dataset = dataset;\n      context.index = context.datasetIndex = this.index;\n    }\n    context.active = !!active;\n    context.mode = mode;\n    return context;\n  }\n  resolveDatasetElementOptions(mode) {\n    return this._resolveElementOptions(this.datasetElementType.id, mode);\n  }\n  resolveDataElementOptions(index, mode) {\n    return this._resolveElementOptions(this.dataElementType.id, mode, index);\n  }\n  _resolveElementOptions(elementType, mode = 'default', index) {\n    const active = mode === 'active';\n    const cache = this._cachedDataOpts;\n    const cacheKey = elementType + '-' + mode;\n    const cached = cache[cacheKey];\n    const sharing = this.enableOptionSharing && defined(index);\n    if (cached) {\n      return cloneIfNotShared(cached, sharing);\n    }\n    const config = this.chart.config;\n    const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n    const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n    const names = Object.keys(defaults.elements[elementType]);\n    const context = () => this.getContext(index, active);\n    const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n    if (values.$shared) {\n      values.$shared = sharing;\n      cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n    }\n    return values;\n  }\n  _resolveAnimations(index, transition, active) {\n    const chart = this.chart;\n    const cache = this._cachedDataOpts;\n    const cacheKey = `animation-${transition}`;\n    const cached = cache[cacheKey];\n    if (cached) {\n      return cached;\n    }\n    let options;\n    if (chart.options.animation !== false) {\n      const config = this.chart.config;\n      const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n      const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n      options = config.createResolver(scopes, this.getContext(index, active, transition));\n    }\n    const animations = new Animations(chart, options && options.animations);\n    if (options && options._cacheable) {\n      cache[cacheKey] = Object.freeze(animations);\n    }\n    return animations;\n  }\n  getSharedOptions(options) {\n    if (!options.$shared) {\n      return;\n    }\n    return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n  }\n  includeOptions(mode, sharedOptions) {\n    return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n  }\n  updateElement(element, index, properties, mode) {\n    if (isDirectUpdateMode(mode)) {\n      Object.assign(element, properties);\n    } else {\n      this._resolveAnimations(index, mode).update(element, properties);\n    }\n  }\n  updateSharedOptions(sharedOptions, mode, newOptions) {\n    if (sharedOptions && !isDirectUpdateMode(mode)) {\n      this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n    }\n  }\n  _setStyle(element, index, mode, active) {\n    element.active = active;\n    const options = this.getStyle(index, active);\n    this._resolveAnimations(index, mode, active).update(element, {\n      options: (!active && this.getSharedOptions(options)) || options\n    });\n  }\n  removeHoverStyle(element, datasetIndex, index) {\n    this._setStyle(element, index, 'active', false);\n  }\n  setHoverStyle(element, datasetIndex, index) {\n    this._setStyle(element, index, 'active', true);\n  }\n  _removeDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n    if (element) {\n      this._setStyle(element, undefined, 'active', false);\n    }\n  }\n  _setDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n    if (element) {\n      this._setStyle(element, undefined, 'active', true);\n    }\n  }\n  _resyncElements(resetNewElements) {\n    const data = this._data;\n    const elements = this._cachedMeta.data;\n    for (const [method, arg1, arg2] of this._syncList) {\n      this[method](arg1, arg2);\n    }\n    this._syncList = [];\n    const numMeta = elements.length;\n    const numData = data.length;\n    const count = Math.min(numData, numMeta);\n    if (count) {\n      this.parse(0, count);\n    }\n    if (numData > numMeta) {\n      this._insertElements(numMeta, numData - numMeta, resetNewElements);\n    } else if (numData < numMeta) {\n      this._removeElements(numData, numMeta - numData);\n    }\n  }\n  _insertElements(start, count, resetNewElements = true) {\n    const meta = this._cachedMeta;\n    const data = meta.data;\n    const end = start + count;\n    let i;\n    const move = (arr) => {\n      arr.length += count;\n      for (i = arr.length - 1; i >= end; i--) {\n        arr[i] = arr[i - count];\n      }\n    };\n    move(data);\n    for (i = start; i < end; ++i) {\n      data[i] = new this.dataElementType();\n    }\n    if (this._parsing) {\n      move(meta._parsed);\n    }\n    this.parse(start, count);\n    if (resetNewElements) {\n      this.updateElements(data, start, count, 'reset');\n    }\n  }\n  updateElements(element, start, count, mode) {}\n  _removeElements(start, count) {\n    const meta = this._cachedMeta;\n    if (this._parsing) {\n      const removed = meta._parsed.splice(start, count);\n      if (meta._stacked) {\n        clearStacks(meta, removed);\n      }\n    }\n    meta.data.splice(start, count);\n  }\n  _sync(args) {\n    if (this._parsing) {\n      this._syncList.push(args);\n    } else {\n      const [method, arg1, arg2] = args;\n      this[method](arg1, arg2);\n    }\n    this.chart._dataChanges.push([this.index, ...args]);\n  }\n  _onDataPush() {\n    const count = arguments.length;\n    this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n  }\n  _onDataPop() {\n    this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n  }\n  _onDataShift() {\n    this._sync(['_removeElements', 0, 1]);\n  }\n  _onDataSplice(start, count) {\n    if (count) {\n      this._sync(['_removeElements', start, count]);\n    }\n    const newCount = arguments.length - 2;\n    if (newCount) {\n      this._sync(['_insertElements', start, newCount]);\n    }\n  }\n  _onDataUnshift() {\n    this._sync(['_insertElements', 0, arguments.length]);\n  }\n}\nDatasetController.defaults = {};\nDatasetController.prototype.datasetElementType = null;\nDatasetController.prototype.dataElementType = null;\n\nfunction getAllScaleValues(scale, type) {\n  if (!scale._cache.$bar) {\n    const visibleMetas = scale.getMatchingVisibleMetas(type);\n    let values = [];\n    for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n      values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n    }\n    scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n  }\n  return scale._cache.$bar;\n}\nfunction computeMinSampleSize(meta) {\n  const scale = meta.iScale;\n  const values = getAllScaleValues(scale, meta.type);\n  let min = scale._length;\n  let i, ilen, curr, prev;\n  const updateMinAndPrev = () => {\n    if (curr === 32767 || curr === -32768) {\n      return;\n    }\n    if (defined(prev)) {\n      min = Math.min(min, Math.abs(curr - prev) || min);\n    }\n    prev = curr;\n  };\n  for (i = 0, ilen = values.length; i < ilen; ++i) {\n    curr = scale.getPixelForValue(values[i]);\n    updateMinAndPrev();\n  }\n  prev = undefined;\n  for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n    curr = scale.getPixelForTick(i);\n    updateMinAndPrev();\n  }\n  return min;\n}\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n  const thickness = options.barThickness;\n  let size, ratio;\n  if (isNullOrUndef(thickness)) {\n    size = ruler.min * options.categoryPercentage;\n    ratio = options.barPercentage;\n  } else {\n    size = thickness * stackCount;\n    ratio = 1;\n  }\n  return {\n    chunk: size / stackCount,\n    ratio,\n    start: ruler.pixels[index] - (size / 2)\n  };\n}\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n  const pixels = ruler.pixels;\n  const curr = pixels[index];\n  let prev = index > 0 ? pixels[index - 1] : null;\n  let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n  const percent = options.categoryPercentage;\n  if (prev === null) {\n    prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n  }\n  if (next === null) {\n    next = curr + curr - prev;\n  }\n  const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n  const size = Math.abs(next - prev) / 2 * percent;\n  return {\n    chunk: size / stackCount,\n    ratio: options.barPercentage,\n    start\n  };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n  const startValue = vScale.parse(entry[0], i);\n  const endValue = vScale.parse(entry[1], i);\n  const min = Math.min(startValue, endValue);\n  const max = Math.max(startValue, endValue);\n  let barStart = min;\n  let barEnd = max;\n  if (Math.abs(min) > Math.abs(max)) {\n    barStart = max;\n    barEnd = min;\n  }\n  item[vScale.axis] = barEnd;\n  item._custom = {\n    barStart,\n    barEnd,\n    start: startValue,\n    end: endValue,\n    min,\n    max\n  };\n}\nfunction parseValue(entry, item, vScale, i) {\n  if (isArray(entry)) {\n    parseFloatBar(entry, item, vScale, i);\n  } else {\n    item[vScale.axis] = vScale.parse(entry, i);\n  }\n  return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n  const iScale = meta.iScale;\n  const vScale = meta.vScale;\n  const labels = iScale.getLabels();\n  const singleScale = iScale === vScale;\n  const parsed = [];\n  let i, ilen, item, entry;\n  for (i = start, ilen = start + count; i < ilen; ++i) {\n    entry = data[i];\n    item = {};\n    item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n    parsed.push(parseValue(entry, item, vScale, i));\n  }\n  return parsed;\n}\nfunction isFloatBar(custom) {\n  return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n  if (size !== 0) {\n    return sign(size);\n  }\n  return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n  let reverse, start, end, top, bottom;\n  if (properties.horizontal) {\n    reverse = properties.base > properties.x;\n    start = 'left';\n    end = 'right';\n  } else {\n    reverse = properties.base < properties.y;\n    start = 'bottom';\n    end = 'top';\n  }\n  if (reverse) {\n    top = 'end';\n    bottom = 'start';\n  } else {\n    top = 'start';\n    bottom = 'end';\n  }\n  return {start, end, reverse, top, bottom};\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n  let edge = options.borderSkipped;\n  const res = {};\n  if (!edge) {\n    properties.borderSkipped = res;\n    return;\n  }\n  const {start, end, reverse, top, bottom} = borderProps(properties);\n  if (edge === 'middle' && stack) {\n    properties.enableBorderRadius = true;\n    if ((stack._top || 0) === index) {\n      edge = top;\n    } else if ((stack._bottom || 0) === index) {\n      edge = bottom;\n    } else {\n      res[parseEdge(bottom, start, end, reverse)] = true;\n      edge = top;\n    }\n  }\n  res[parseEdge(edge, start, end, reverse)] = true;\n  properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n  if (reverse) {\n    edge = swap(edge, a, b);\n    edge = startEnd(edge, b, a);\n  } else {\n    edge = startEnd(edge, a, b);\n  }\n  return edge;\n}\nfunction swap(orig, v1, v2) {\n  return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n  return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n  properties.inflateAmount = inflateAmount === 'auto'\n    ? ratio === 1 ? 0.33 : 0\n    : inflateAmount;\n}\nclass BarController extends DatasetController {\n  parsePrimitiveData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n  parseArrayData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n  parseObjectData(meta, data, start, count) {\n    const {iScale, vScale} = meta;\n    const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n    const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n    const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n    const parsed = [];\n    let i, ilen, item, obj;\n    for (i = start, ilen = start + count; i < ilen; ++i) {\n      obj = data[i];\n      item = {};\n      item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n      parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n    }\n    return parsed;\n  }\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    super.updateRangeFromParsed(range, scale, parsed, stack);\n    const custom = parsed._custom;\n    if (custom && scale === this._cachedMeta.vScale) {\n      range.min = Math.min(range.min, custom.min);\n      range.max = Math.max(range.max, custom.max);\n    }\n  }\n  getMaxOverflow() {\n    return 0;\n  }\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const {iScale, vScale} = meta;\n    const parsed = this.getParsed(index);\n    const custom = parsed._custom;\n    const value = isFloatBar(custom)\n      ? '[' + custom.start + ', ' + custom.end + ']'\n      : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n    return {\n      label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n      value\n    };\n  }\n  initialize() {\n    this.enableOptionSharing = true;\n    super.initialize();\n    const meta = this._cachedMeta;\n    meta.stack = this.getDataset().stack;\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    this.updateElements(meta.data, 0, meta.data.length, mode);\n  }\n  updateElements(bars, start, count, mode) {\n    const reset = mode === 'reset';\n    const {index, _cachedMeta: {vScale}} = this;\n    const base = vScale.getBasePixel();\n    const horizontal = vScale.isHorizontal();\n    const ruler = this._getRuler();\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n    for (let i = start; i < start + count; i++) {\n      const parsed = this.getParsed(i);\n      const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n      const ipixels = this._calculateBarIndexPixels(i, ruler);\n      const stack = (parsed._stacks || {})[vScale.axis];\n      const properties = {\n        horizontal,\n        base: vpixels.base,\n        enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n        x: horizontal ? vpixels.head : ipixels.center,\n        y: horizontal ? ipixels.center : vpixels.head,\n        height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n        width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n      };\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n      }\n      const options = properties.options || bars[i].options;\n      setBorderSkipped(properties, options, stack, index);\n      setInflateAmount(properties, options, ruler.ratio);\n      this.updateElement(bars[i], i, properties, mode);\n    }\n  }\n  _getStacks(last, dataIndex) {\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const metasets = iScale.getMatchingVisibleMetas(this._type);\n    const stacked = iScale.options.stacked;\n    const ilen = metasets.length;\n    const stacks = [];\n    let i, item;\n    for (i = 0; i < ilen; ++i) {\n      item = metasets[i];\n      if (!item.controller.options.grouped) {\n        continue;\n      }\n      if (typeof dataIndex !== 'undefined') {\n        const val = item.controller.getParsed(dataIndex)[\n          item.controller._cachedMeta.vScale.axis\n        ];\n        if (isNullOrUndef(val) || isNaN(val)) {\n          continue;\n        }\n      }\n      if (stacked === false || stacks.indexOf(item.stack) === -1 ||\n\t\t\t\t(stacked === undefined && item.stack === undefined)) {\n        stacks.push(item.stack);\n      }\n      if (item.index === last) {\n        break;\n      }\n    }\n    if (!stacks.length) {\n      stacks.push(undefined);\n    }\n    return stacks;\n  }\n  _getStackCount(index) {\n    return this._getStacks(undefined, index).length;\n  }\n  _getStackIndex(datasetIndex, name, dataIndex) {\n    const stacks = this._getStacks(datasetIndex, dataIndex);\n    const index = (name !== undefined)\n      ? stacks.indexOf(name)\n      : -1;\n    return (index === -1)\n      ? stacks.length - 1\n      : index;\n  }\n  _getRuler() {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const pixels = [];\n    let i, ilen;\n    for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n      pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n    }\n    const barThickness = opts.barThickness;\n    const min = barThickness || computeMinSampleSize(meta);\n    return {\n      min,\n      pixels,\n      start: iScale._startPixel,\n      end: iScale._endPixel,\n      stackCount: this._getStackCount(),\n      scale: iScale,\n      grouped: opts.grouped,\n      ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n    };\n  }\n  _calculateBarValuePixels(index) {\n    const {_cachedMeta: {vScale, _stacked}, options: {base: baseValue, minBarLength}} = this;\n    const actualBase = baseValue || 0;\n    const parsed = this.getParsed(index);\n    const custom = parsed._custom;\n    const floating = isFloatBar(custom);\n    let value = parsed[vScale.axis];\n    let start = 0;\n    let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n    let head, size;\n    if (length !== value) {\n      start = length - value;\n      length = value;\n    }\n    if (floating) {\n      value = custom.barStart;\n      length = custom.barEnd - custom.barStart;\n      if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n        start = 0;\n      }\n      start += value;\n    }\n    const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n    let base = vScale.getPixelForValue(startValue);\n    if (this.chart.getDataVisibility(index)) {\n      head = vScale.getPixelForValue(start + length);\n    } else {\n      head = base;\n    }\n    size = head - base;\n    if (Math.abs(size) < minBarLength) {\n      size = barSign(size, vScale, actualBase) * minBarLength;\n      if (value === actualBase) {\n        base -= size / 2;\n      }\n      const startPixel = vScale.getPixelForDecimal(0);\n      const endPixel = vScale.getPixelForDecimal(1);\n      const min = Math.min(startPixel, endPixel);\n      const max = Math.max(startPixel, endPixel);\n      base = Math.max(Math.min(base, max), min);\n      head = base + size;\n    }\n    if (base === vScale.getPixelForValue(actualBase)) {\n      const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n      base += halfGrid;\n      size -= halfGrid;\n    }\n    return {\n      size,\n      base,\n      head,\n      center: head + size / 2\n    };\n  }\n  _calculateBarIndexPixels(index, ruler) {\n    const scale = ruler.scale;\n    const options = this.options;\n    const skipNull = options.skipNull;\n    const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n    let center, size;\n    if (ruler.grouped) {\n      const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n      const range = options.barThickness === 'flex'\n        ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n        : computeFitCategoryTraits(index, ruler, options, stackCount);\n      const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n      center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n      size = Math.min(maxBarThickness, range.chunk * range.ratio);\n    } else {\n      center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n      size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n    }\n    return {\n      base: center - size / 2,\n      head: center + size / 2,\n      center,\n      size\n    };\n  }\n  draw() {\n    const meta = this._cachedMeta;\n    const vScale = meta.vScale;\n    const rects = meta.data;\n    const ilen = rects.length;\n    let i = 0;\n    for (; i < ilen; ++i) {\n      if (this.getParsed(i)[vScale.axis] !== null) {\n        rects[i].draw(this._ctx);\n      }\n    }\n  }\n}\nBarController.id = 'bar';\nBarController.defaults = {\n  datasetElementType: false,\n  dataElementType: 'bar',\n  categoryPercentage: 0.8,\n  barPercentage: 0.9,\n  grouped: true,\n  animations: {\n    numbers: {\n      type: 'number',\n      properties: ['x', 'y', 'base', 'width', 'height']\n    }\n  }\n};\nBarController.overrides = {\n  scales: {\n    _index_: {\n      type: 'category',\n      offset: true,\n      grid: {\n        offset: true\n      }\n    },\n    _value_: {\n      type: 'linear',\n      beginAtZero: true,\n    }\n  }\n};\n\nclass BubbleController extends DatasetController {\n  initialize() {\n    this.enableOptionSharing = true;\n    super.initialize();\n  }\n  parsePrimitiveData(meta, data, start, count) {\n    const parsed = super.parsePrimitiveData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n    }\n    return parsed;\n  }\n  parseArrayData(meta, data, start, count) {\n    const parsed = super.parseArrayData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n  parseObjectData(meta, data, start, count) {\n    const parsed = super.parseObjectData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n  getMaxOverflow() {\n    const data = this._cachedMeta.data;\n    let max = 0;\n    for (let i = data.length - 1; i >= 0; --i) {\n      max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n    }\n    return max > 0 && max;\n  }\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const {xScale, yScale} = meta;\n    const parsed = this.getParsed(index);\n    const x = xScale.getLabelForValue(parsed.x);\n    const y = yScale.getLabelForValue(parsed.y);\n    const r = parsed._custom;\n    return {\n      label: meta.label,\n      value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n    };\n  }\n  update(mode) {\n    const points = this._cachedMeta.data;\n    this.updateElements(points, 0, points.length, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const reset = mode === 'reset';\n    const {iScale, vScale} = this._cachedMeta;\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const parsed = !reset && this.getParsed(i);\n      const properties = {};\n      const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n      const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n      properties.skip = isNaN(iPixel) || isNaN(vPixel);\n      if (includeOptions) {\n        properties.options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n        if (reset) {\n          properties.options.radius = 0;\n        }\n      }\n      this.updateElement(point, i, properties, mode);\n    }\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n  }\n  resolveDataElementOptions(index, mode) {\n    const parsed = this.getParsed(index);\n    let values = super.resolveDataElementOptions(index, mode);\n    if (values.$shared) {\n      values = Object.assign({}, values, {$shared: false});\n    }\n    const radius = values.radius;\n    if (mode !== 'active') {\n      values.radius = 0;\n    }\n    values.radius += valueOrDefault(parsed && parsed._custom, radius);\n    return values;\n  }\n}\nBubbleController.id = 'bubble';\nBubbleController.defaults = {\n  datasetElementType: false,\n  dataElementType: 'point',\n  animations: {\n    numbers: {\n      type: 'number',\n      properties: ['x', 'y', 'borderWidth', 'radius']\n    }\n  }\n};\nBubbleController.overrides = {\n  scales: {\n    x: {\n      type: 'linear'\n    },\n    y: {\n      type: 'linear'\n    }\n  },\n  plugins: {\n    tooltip: {\n      callbacks: {\n        title() {\n          return '';\n        }\n      }\n    }\n  }\n};\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n  let ratioX = 1;\n  let ratioY = 1;\n  let offsetX = 0;\n  let offsetY = 0;\n  if (circumference < TAU) {\n    const startAngle = rotation;\n    const endAngle = startAngle + circumference;\n    const startX = Math.cos(startAngle);\n    const startY = Math.sin(startAngle);\n    const endX = Math.cos(endAngle);\n    const endY = Math.sin(endAngle);\n    const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n    const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n    const maxX = calcMax(0, startX, endX);\n    const maxY = calcMax(HALF_PI, startY, endY);\n    const minX = calcMin(PI, startX, endX);\n    const minY = calcMin(PI + HALF_PI, startY, endY);\n    ratioX = (maxX - minX) / 2;\n    ratioY = (maxY - minY) / 2;\n    offsetX = -(maxX + minX) / 2;\n    offsetY = -(maxY + minY) / 2;\n  }\n  return {ratioX, ratioY, offsetX, offsetY};\n}\nclass DoughnutController extends DatasetController {\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n    this.enableOptionSharing = true;\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n    this.offsetX = undefined;\n    this.offsetY = undefined;\n  }\n  linkScales() {}\n  parse(start, count) {\n    const data = this.getDataset().data;\n    const meta = this._cachedMeta;\n    if (this._parsing === false) {\n      meta._parsed = data;\n    } else {\n      let getter = (i) => +data[i];\n      if (isObject(data[start])) {\n        const {key = 'value'} = this._parsing;\n        getter = (i) => +resolveObjectKey(data[i], key);\n      }\n      let i, ilen;\n      for (i = start, ilen = start + count; i < ilen; ++i) {\n        meta._parsed[i] = getter(i);\n      }\n    }\n  }\n  _getRotation() {\n    return toRadians(this.options.rotation - 90);\n  }\n  _getCircumference() {\n    return toRadians(this.options.circumference);\n  }\n  _getRotationExtents() {\n    let min = TAU;\n    let max = -TAU;\n    for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n      if (this.chart.isDatasetVisible(i)) {\n        const controller = this.chart.getDatasetMeta(i).controller;\n        const rotation = controller._getRotation();\n        const circumference = controller._getCircumference();\n        min = Math.min(min, rotation);\n        max = Math.max(max, rotation + circumference);\n      }\n    }\n    return {\n      rotation: min,\n      circumference: max - min,\n    };\n  }\n  update(mode) {\n    const chart = this.chart;\n    const {chartArea} = chart;\n    const meta = this._cachedMeta;\n    const arcs = meta.data;\n    const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n    const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n    const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n    const chartWeight = this._getRingWeight(this.index);\n    const {circumference, rotation} = this._getRotationExtents();\n    const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n    const maxWidth = (chartArea.width - spacing) / ratioX;\n    const maxHeight = (chartArea.height - spacing) / ratioY;\n    const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n    const outerRadius = toDimension(this.options.radius, maxRadius);\n    const innerRadius = Math.max(outerRadius * cutout, 0);\n    const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n    this.offsetX = offsetX * outerRadius;\n    this.offsetY = offsetY * outerRadius;\n    meta.total = this.calculateTotal();\n    this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n    this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n  _circumference(i, reset) {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const circumference = this._getCircumference();\n    if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n      return 0;\n    }\n    return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n  }\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === 'reset';\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const centerX = (chartArea.left + chartArea.right) / 2;\n    const centerY = (chartArea.top + chartArea.bottom) / 2;\n    const animateScale = reset && animationOpts.animateScale;\n    const innerRadius = animateScale ? 0 : this.innerRadius;\n    const outerRadius = animateScale ? 0 : this.outerRadius;\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    let startAngle = this._getRotation();\n    let i;\n    for (i = 0; i < start; ++i) {\n      startAngle += this._circumference(i, reset);\n    }\n    for (i = start; i < start + count; ++i) {\n      const circumference = this._circumference(i, reset);\n      const arc = arcs[i];\n      const properties = {\n        x: centerX + this.offsetX,\n        y: centerY + this.offsetY,\n        startAngle,\n        endAngle: startAngle + circumference,\n        circumference,\n        outerRadius,\n        innerRadius\n      };\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n      }\n      startAngle += circumference;\n      this.updateElement(arc, i, properties, mode);\n    }\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n  }\n  calculateTotal() {\n    const meta = this._cachedMeta;\n    const metaData = meta.data;\n    let total = 0;\n    let i;\n    for (i = 0; i < metaData.length; i++) {\n      const value = meta._parsed[i];\n      if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n        total += Math.abs(value);\n      }\n    }\n    return total;\n  }\n  calculateCircumference(value) {\n    const total = this._cachedMeta.total;\n    if (total > 0 && !isNaN(value)) {\n      return TAU * (Math.abs(value) / total);\n    }\n    return 0;\n  }\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index], chart.options.locale);\n    return {\n      label: labels[index] || '',\n      value,\n    };\n  }\n  getMaxBorderWidth(arcs) {\n    let max = 0;\n    const chart = this.chart;\n    let i, ilen, meta, controller, options;\n    if (!arcs) {\n      for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n        if (chart.isDatasetVisible(i)) {\n          meta = chart.getDatasetMeta(i);\n          arcs = meta.data;\n          controller = meta.controller;\n          break;\n        }\n      }\n    }\n    if (!arcs) {\n      return 0;\n    }\n    for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n      options = controller.resolveDataElementOptions(i);\n      if (options.borderAlign !== 'inner') {\n        max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n      }\n    }\n    return max;\n  }\n  getMaxOffset(arcs) {\n    let max = 0;\n    for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n      const options = this.resolveDataElementOptions(i);\n      max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n    }\n    return max;\n  }\n  _getRingWeightOffset(datasetIndex) {\n    let ringWeightOffset = 0;\n    for (let i = 0; i < datasetIndex; ++i) {\n      if (this.chart.isDatasetVisible(i)) {\n        ringWeightOffset += this._getRingWeight(i);\n      }\n    }\n    return ringWeightOffset;\n  }\n  _getRingWeight(datasetIndex) {\n    return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n  }\n  _getVisibleDatasetWeightTotal() {\n    return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n  }\n}\nDoughnutController.id = 'doughnut';\nDoughnutController.defaults = {\n  datasetElementType: false,\n  dataElementType: 'arc',\n  animation: {\n    animateRotate: true,\n    animateScale: false\n  },\n  animations: {\n    numbers: {\n      type: 'number',\n      properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n    },\n  },\n  cutout: '50%',\n  rotation: 0,\n  circumference: 360,\n  radius: '100%',\n  spacing: 0,\n  indexAxis: 'r',\n};\nDoughnutController.descriptors = {\n  _scriptable: (name) => name !== 'spacing',\n  _indexable: (name) => name !== 'spacing',\n};\nDoughnutController.overrides = {\n  aspectRatio: 1,\n  plugins: {\n    legend: {\n      labels: {\n        generateLabels(chart) {\n          const data = chart.data;\n          if (data.labels.length && data.datasets.length) {\n            const {labels: {pointStyle}} = chart.legend.options;\n            return data.labels.map((label, i) => {\n              const meta = chart.getDatasetMeta(0);\n              const style = meta.controller.getStyle(i);\n              return {\n                text: label,\n                fillStyle: style.backgroundColor,\n                strokeStyle: style.borderColor,\n                lineWidth: style.borderWidth,\n                pointStyle: pointStyle,\n                hidden: !chart.getDataVisibility(i),\n                index: i\n              };\n            });\n          }\n          return [];\n        }\n      },\n      onClick(e, legendItem, legend) {\n        legend.chart.toggleDataVisibility(legendItem.index);\n        legend.chart.update();\n      }\n    },\n    tooltip: {\n      callbacks: {\n        title() {\n          return '';\n        },\n        label(tooltipItem) {\n          let dataLabel = tooltipItem.label;\n          const value = ': ' + tooltipItem.formattedValue;\n          if (isArray(dataLabel)) {\n            dataLabel = dataLabel.slice();\n            dataLabel[0] += value;\n          } else {\n            dataLabel += value;\n          }\n          return dataLabel;\n        }\n      }\n    }\n  }\n};\n\nclass LineController extends DatasetController {\n  initialize() {\n    this.enableOptionSharing = true;\n    this.supportsDecimation = true;\n    super.initialize();\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    const {dataset: line, data: points = [], _dataset} = meta;\n    const animationsDisabled = this.chart._animationsDisabled;\n    let {start, count} = getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n    this._drawStart = start;\n    this._drawCount = count;\n    if (scaleRangesChanged(meta)) {\n      start = 0;\n      count = points.length;\n    }\n    line._chart = this.chart;\n    line._datasetIndex = this.index;\n    line._decimated = !!_dataset._decimated;\n    line.points = points;\n    const options = this.resolveDatasetElementOptions(mode);\n    if (!this.options.showLine) {\n      options.borderWidth = 0;\n    }\n    options.segment = this.options.segment;\n    this.updateElement(line, undefined, {\n      animated: !animationsDisabled,\n      options\n    }, mode);\n    this.updateElements(points, start, count, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const reset = mode === 'reset';\n    const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const {spanGaps, segment} = this.options;\n    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n    const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n    let prevParsed = start > 0 && this.getParsed(start - 1);\n    for (let i = start; i < start + count; ++i) {\n      const point = points[i];\n      const parsed = this.getParsed(i);\n      const properties = directUpdate ? point : {};\n      const nullData = isNullOrUndef(parsed[vAxis]);\n      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n      properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n      if (segment) {\n        properties.parsed = parsed;\n        properties.raw = _dataset.data[i];\n      }\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n      }\n      if (!directUpdate) {\n        this.updateElement(point, i, properties, mode);\n      }\n      prevParsed = parsed;\n    }\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n  }\n  getMaxOverflow() {\n    const meta = this._cachedMeta;\n    const dataset = meta.dataset;\n    const border = dataset.options && dataset.options.borderWidth || 0;\n    const data = meta.data || [];\n    if (!data.length) {\n      return border;\n    }\n    const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n    return Math.max(border, firstPoint, lastPoint) / 2;\n  }\n  draw() {\n    const meta = this._cachedMeta;\n    meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n    super.draw();\n  }\n}\nLineController.id = 'line';\nLineController.defaults = {\n  datasetElementType: 'line',\n  dataElementType: 'point',\n  showLine: true,\n  spanGaps: false,\n};\nLineController.overrides = {\n  scales: {\n    _index_: {\n      type: 'category',\n    },\n    _value_: {\n      type: 'linear',\n    },\n  }\n};\nfunction getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n  const pointCount = points.length;\n  let start = 0;\n  let count = pointCount;\n  if (meta._sorted) {\n    const {iScale, _parsed} = meta;\n    const axis = iScale.axis;\n    const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n    if (minDefined) {\n      start = _limitValue(Math.min(\n        _lookupByKey(_parsed, iScale.axis, min).lo,\n        animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n      0, pointCount - 1);\n    }\n    if (maxDefined) {\n      count = _limitValue(Math.max(\n        _lookupByKey(_parsed, iScale.axis, max).hi + 1,\n        animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max)).hi + 1),\n      start, pointCount) - start;\n    } else {\n      count = pointCount - start;\n    }\n  }\n  return {start, count};\n}\nfunction scaleRangesChanged(meta) {\n  const {xScale, yScale, _scaleRanges} = meta;\n  const newRanges = {\n    xmin: xScale.min,\n    xmax: xScale.max,\n    ymin: yScale.min,\n    ymax: yScale.max\n  };\n  if (!_scaleRanges) {\n    meta._scaleRanges = newRanges;\n    return true;\n  }\n  const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n  Object.assign(_scaleRanges, newRanges);\n  return changed;\n}\n\nclass PolarAreaController extends DatasetController {\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n  }\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n    return {\n      label: labels[index] || '',\n      value,\n    };\n  }\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n  update(mode) {\n    const arcs = this._cachedMeta.data;\n    this._updateRadius();\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n  getMinMax() {\n    const meta = this._cachedMeta;\n    const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n    meta.data.forEach((element, index) => {\n      const parsed = this.getParsed(index).r;\n      if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n        if (parsed < range.min) {\n          range.min = parsed;\n        }\n        if (parsed > range.max) {\n          range.max = parsed;\n        }\n      }\n    });\n    return range;\n  }\n  _updateRadius() {\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n    const outerRadius = Math.max(minSize / 2, 0);\n    const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n    const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n    this.outerRadius = outerRadius - (radiusLength * this.index);\n    this.innerRadius = this.outerRadius - radiusLength;\n  }\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === 'reset';\n    const chart = this.chart;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const scale = this._cachedMeta.rScale;\n    const centerX = scale.xCenter;\n    const centerY = scale.yCenter;\n    const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n    let angle = datasetStartAngle;\n    let i;\n    const defaultAngle = 360 / this.countVisibleElements();\n    for (i = 0; i < start; ++i) {\n      angle += this._computeAngle(i, mode, defaultAngle);\n    }\n    for (i = start; i < start + count; i++) {\n      const arc = arcs[i];\n      let startAngle = angle;\n      let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n      let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n      angle = endAngle;\n      if (reset) {\n        if (animationOpts.animateScale) {\n          outerRadius = 0;\n        }\n        if (animationOpts.animateRotate) {\n          startAngle = endAngle = datasetStartAngle;\n        }\n      }\n      const properties = {\n        x: centerX,\n        y: centerY,\n        innerRadius: 0,\n        outerRadius,\n        startAngle,\n        endAngle,\n        options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n      };\n      this.updateElement(arc, i, properties, mode);\n    }\n  }\n  countVisibleElements() {\n    const meta = this._cachedMeta;\n    let count = 0;\n    meta.data.forEach((element, index) => {\n      if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n        count++;\n      }\n    });\n    return count;\n  }\n  _computeAngle(index, mode, defaultAngle) {\n    return this.chart.getDataVisibility(index)\n      ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n      : 0;\n  }\n}\nPolarAreaController.id = 'polarArea';\nPolarAreaController.defaults = {\n  dataElementType: 'arc',\n  animation: {\n    animateRotate: true,\n    animateScale: true\n  },\n  animations: {\n    numbers: {\n      type: 'number',\n      properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n    },\n  },\n  indexAxis: 'r',\n  startAngle: 0,\n};\nPolarAreaController.overrides = {\n  aspectRatio: 1,\n  plugins: {\n    legend: {\n      labels: {\n        generateLabels(chart) {\n          const data = chart.data;\n          if (data.labels.length && data.datasets.length) {\n            const {labels: {pointStyle}} = chart.legend.options;\n            return data.labels.map((label, i) => {\n              const meta = chart.getDatasetMeta(0);\n              const style = meta.controller.getStyle(i);\n              return {\n                text: label,\n                fillStyle: style.backgroundColor,\n                strokeStyle: style.borderColor,\n                lineWidth: style.borderWidth,\n                pointStyle: pointStyle,\n                hidden: !chart.getDataVisibility(i),\n                index: i\n              };\n            });\n          }\n          return [];\n        }\n      },\n      onClick(e, legendItem, legend) {\n        legend.chart.toggleDataVisibility(legendItem.index);\n        legend.chart.update();\n      }\n    },\n    tooltip: {\n      callbacks: {\n        title() {\n          return '';\n        },\n        label(context) {\n          return context.chart.data.labels[context.dataIndex] + ': ' + context.formattedValue;\n        }\n      }\n    }\n  },\n  scales: {\n    r: {\n      type: 'radialLinear',\n      angleLines: {\n        display: false\n      },\n      beginAtZero: true,\n      grid: {\n        circular: true\n      },\n      pointLabels: {\n        display: false\n      },\n      startAngle: 0\n    }\n  }\n};\n\nclass PieController extends DoughnutController {\n}\nPieController.id = 'pie';\nPieController.defaults = {\n  cutout: 0,\n  rotation: 0,\n  circumference: 360,\n  radius: '100%'\n};\n\nclass RadarController extends DatasetController {\n  getLabelAndValue(index) {\n    const vScale = this._cachedMeta.vScale;\n    const parsed = this.getParsed(index);\n    return {\n      label: vScale.getLabels()[index],\n      value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n    };\n  }\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n  update(mode) {\n    const meta = this._cachedMeta;\n    const line = meta.dataset;\n    const points = meta.data || [];\n    const labels = meta.iScale.getLabels();\n    line.points = points;\n    if (mode !== 'resize') {\n      const options = this.resolveDatasetElementOptions(mode);\n      if (!this.options.showLine) {\n        options.borderWidth = 0;\n      }\n      const properties = {\n        _loop: true,\n        _fullLoop: labels.length === points.length,\n        options\n      };\n      this.updateElement(line, undefined, properties, mode);\n    }\n    this.updateElements(points, 0, points.length, mode);\n  }\n  updateElements(points, start, count, mode) {\n    const scale = this._cachedMeta.rScale;\n    const reset = mode === 'reset';\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n      const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n      const x = reset ? scale.xCenter : pointPosition.x;\n      const y = reset ? scale.yCenter : pointPosition.y;\n      const properties = {\n        x,\n        y,\n        angle: pointPosition.angle,\n        skip: isNaN(x) || isNaN(y),\n        options\n      };\n      this.updateElement(point, i, properties, mode);\n    }\n  }\n}\nRadarController.id = 'radar';\nRadarController.defaults = {\n  datasetElementType: 'line',\n  dataElementType: 'point',\n  indexAxis: 'r',\n  showLine: true,\n  elements: {\n    line: {\n      fill: 'start'\n    }\n  },\n};\nRadarController.overrides = {\n  aspectRatio: 1,\n  scales: {\n    r: {\n      type: 'radialLinear',\n    }\n  }\n};\n\nclass ScatterController extends LineController {\n}\nScatterController.id = 'scatter';\nScatterController.defaults = {\n  showLine: false,\n  fill: false\n};\nScatterController.overrides = {\n  interaction: {\n    mode: 'point'\n  },\n  plugins: {\n    tooltip: {\n      callbacks: {\n        title() {\n          return '';\n        },\n        label(item) {\n          return '(' + item.label + ', ' + item.formattedValue + ')';\n        }\n      }\n    }\n  },\n  scales: {\n    x: {\n      type: 'linear'\n    },\n    y: {\n      type: 'linear'\n    }\n  }\n};\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPolarAreaController: PolarAreaController,\nPieController: PieController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\nfunction abstract() {\n  throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\nclass DateAdapter {\n  constructor(options) {\n    this.options = options || {};\n  }\n  formats() {\n    return abstract();\n  }\n  parse(value, format) {\n    return abstract();\n  }\n  format(timestamp, format) {\n    return abstract();\n  }\n  add(timestamp, amount, unit) {\n    return abstract();\n  }\n  diff(a, b, unit) {\n    return abstract();\n  }\n  startOf(timestamp, unit, weekday) {\n    return abstract();\n  }\n  endOf(timestamp, unit) {\n    return abstract();\n  }\n}\nDateAdapter.override = function(members) {\n  Object.assign(DateAdapter.prototype, members);\n};\nvar adapters = {\n  _date: DateAdapter\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n  const {controller, data, _sorted} = metaset;\n  const iScale = controller._cachedMeta.iScale;\n  if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n    const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n    if (!intersect) {\n      return lookupMethod(data, axis, value);\n    } else if (controller._sharedOptions) {\n      const el = data[0];\n      const range = typeof el.getRange === 'function' && el.getRange(axis);\n      if (range) {\n        const start = lookupMethod(data, axis, value - range);\n        const end = lookupMethod(data, axis, value + range);\n        return {lo: start.lo, hi: end.hi};\n      }\n    }\n  }\n  return {lo: 0, hi: data.length - 1};\n}\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n  const metasets = chart.getSortedVisibleDatasetMetas();\n  const value = position[axis];\n  for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n    const {index, data} = metasets[i];\n    const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n    for (let j = lo; j <= hi; ++j) {\n      const element = data[j];\n      if (!element.skip) {\n        handler(element, index, j);\n      }\n    }\n  }\n}\nfunction getDistanceMetricForAxis(axis) {\n  const useX = axis.indexOf('x') !== -1;\n  const useY = axis.indexOf('y') !== -1;\n  return function(pt1, pt2) {\n    const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n    const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n    return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n  };\n}\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n  const items = [];\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return items;\n  }\n  const evaluationFunc = function(element, datasetIndex, index) {\n    if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n      return;\n    }\n    if (element.inRange(position.x, position.y, useFinalPosition)) {\n      items.push({element, datasetIndex, index});\n    }\n  };\n  evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n  return items;\n}\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n  let items = [];\n  function evaluationFunc(element, datasetIndex, index) {\n    const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n    const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n    if (_angleBetween(angle, startAngle, endAngle)) {\n      items.push({element, datasetIndex, index});\n    }\n  }\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  let items = [];\n  const distanceMetric = getDistanceMetricForAxis(axis);\n  let minDistance = Number.POSITIVE_INFINITY;\n  function evaluationFunc(element, datasetIndex, index) {\n    const inRange = element.inRange(position.x, position.y, useFinalPosition);\n    if (intersect && !inRange) {\n      return;\n    }\n    const center = element.getCenterPoint(useFinalPosition);\n    const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n    if (!pointInArea && !inRange) {\n      return;\n    }\n    const distance = distanceMetric(position, center);\n    if (distance < minDistance) {\n      items = [{element, datasetIndex, index}];\n      minDistance = distance;\n    } else if (distance === minDistance) {\n      items.push({element, datasetIndex, index});\n    }\n  }\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return [];\n  }\n  return axis === 'r' && !intersect\n    ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n    : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n  const items = [];\n  const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n  let intersectsItem = false;\n  evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n    if (element[rangeMethod](position[axis], useFinalPosition)) {\n      items.push({element, datasetIndex, index});\n      intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n    }\n  });\n  if (intersect && !intersectsItem) {\n    return [];\n  }\n  return items;\n}\nvar Interaction = {\n  evaluateInteractionItems,\n  modes: {\n    index(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'x';\n      const includeInvisible = options.includeInvisible || false;\n      const items = options.intersect\n        ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n        : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n      const elements = [];\n      if (!items.length) {\n        return [];\n      }\n      chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n        const index = items[0].index;\n        const element = meta.data[index];\n        if (element && !element.skip) {\n          elements.push({element, datasetIndex: meta.index, index});\n        }\n      });\n      return elements;\n    },\n    dataset(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      let items = options.intersect\n        ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n        getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n      if (items.length > 0) {\n        const datasetIndex = items[0].datasetIndex;\n        const data = chart.getDatasetMeta(datasetIndex).data;\n        items = [];\n        for (let i = 0; i < data.length; ++i) {\n          items.push({element: data[i], datasetIndex, index: i});\n        }\n      }\n      return items;\n    },\n    point(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n    },\n    nearest(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n    },\n    x(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n    },\n    y(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n    }\n  }\n};\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\nfunction filterByPosition(array, position) {\n  return array.filter(v => v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n  return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n  return array.sort((a, b) => {\n    const v0 = reverse ? b : a;\n    const v1 = reverse ? a : b;\n    return v0.weight === v1.weight ?\n      v0.index - v1.index :\n      v0.weight - v1.weight;\n  });\n}\nfunction wrapBoxes(boxes) {\n  const layoutBoxes = [];\n  let i, ilen, box, pos, stack, stackWeight;\n  for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n    box = boxes[i];\n    ({position: pos, options: {stack, stackWeight = 1}} = box);\n    layoutBoxes.push({\n      index: i,\n      box,\n      pos,\n      horizontal: box.isHorizontal(),\n      weight: box.weight,\n      stack: stack && (pos + stack),\n      stackWeight\n    });\n  }\n  return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n  const stacks = {};\n  for (const wrap of layouts) {\n    const {stack, pos, stackWeight} = wrap;\n    if (!stack || !STATIC_POSITIONS.includes(pos)) {\n      continue;\n    }\n    const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n    _stack.count++;\n    _stack.weight += stackWeight;\n  }\n  return stacks;\n}\nfunction setLayoutDims(layouts, params) {\n  const stacks = buildStacks(layouts);\n  const {vBoxMaxWidth, hBoxMaxHeight} = params;\n  let i, ilen, layout;\n  for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n    layout = layouts[i];\n    const {fullSize} = layout.box;\n    const stack = stacks[layout.stack];\n    const factor = stack && layout.stackWeight / stack.weight;\n    if (layout.horizontal) {\n      layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n      layout.height = hBoxMaxHeight;\n    } else {\n      layout.width = vBoxMaxWidth;\n      layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n    }\n  }\n  return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n  const layoutBoxes = wrapBoxes(boxes);\n  const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n  const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n  const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n  const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n  const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n  const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n  const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n  return {\n    fullSize,\n    leftAndTop: left.concat(top),\n    rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n    chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n    vertical: left.concat(right).concat(centerVertical),\n    horizontal: top.concat(bottom).concat(centerHorizontal)\n  };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n  return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n  maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n  maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n  maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n  maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n  const {pos, box} = layout;\n  const maxPadding = chartArea.maxPadding;\n  if (!isObject(pos)) {\n    if (layout.size) {\n      chartArea[pos] -= layout.size;\n    }\n    const stack = stacks[layout.stack] || {size: 0, count: 1};\n    stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n    layout.size = stack.size / stack.count;\n    chartArea[pos] += layout.size;\n  }\n  if (box.getPadding) {\n    updateMaxPadding(maxPadding, box.getPadding());\n  }\n  const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n  const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n  const widthChanged = newWidth !== chartArea.w;\n  const heightChanged = newHeight !== chartArea.h;\n  chartArea.w = newWidth;\n  chartArea.h = newHeight;\n  return layout.horizontal\n    ? {same: widthChanged, other: heightChanged}\n    : {same: heightChanged, other: widthChanged};\n}\nfunction handleMaxPadding(chartArea) {\n  const maxPadding = chartArea.maxPadding;\n  function updatePos(pos) {\n    const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n    chartArea[pos] += change;\n    return change;\n  }\n  chartArea.y += updatePos('top');\n  chartArea.x += updatePos('left');\n  updatePos('right');\n  updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n  const maxPadding = chartArea.maxPadding;\n  function marginForPositions(positions) {\n    const margin = {left: 0, top: 0, right: 0, bottom: 0};\n    positions.forEach((pos) => {\n      margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n    });\n    return margin;\n  }\n  return horizontal\n    ? marginForPositions(['left', 'right'])\n    : marginForPositions(['top', 'bottom']);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n  const refitBoxes = [];\n  let i, ilen, layout, box, refit, changed;\n  for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n    layout = boxes[i];\n    box = layout.box;\n    box.update(\n      layout.width || chartArea.w,\n      layout.height || chartArea.h,\n      getMargins(layout.horizontal, chartArea)\n    );\n    const {same, other} = updateDims(chartArea, params, layout, stacks);\n    refit |= same && refitBoxes.length;\n    changed = changed || other;\n    if (!box.fullSize) {\n      refitBoxes.push(layout);\n    }\n  }\n  return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n  box.top = top;\n  box.left = left;\n  box.right = left + width;\n  box.bottom = top + height;\n  box.width = width;\n  box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n  const userPadding = params.padding;\n  let {x, y} = chartArea;\n  for (const layout of boxes) {\n    const box = layout.box;\n    const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n    const weight = (layout.stackWeight / stack.weight) || 1;\n    if (layout.horizontal) {\n      const width = chartArea.w * weight;\n      const height = stack.size || box.height;\n      if (defined(stack.start)) {\n        y = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n      } else {\n        setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n      }\n      stack.start = y;\n      stack.placed += width;\n      y = box.bottom;\n    } else {\n      const height = chartArea.h * weight;\n      const width = stack.size || box.width;\n      if (defined(stack.start)) {\n        x = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n      } else {\n        setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n      }\n      stack.start = x;\n      stack.placed += height;\n      x = box.right;\n    }\n  }\n  chartArea.x = x;\n  chartArea.y = y;\n}\ndefaults.set('layout', {\n  autoPadding: true,\n  padding: {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  }\n});\nvar layouts = {\n  addBox(chart, item) {\n    if (!chart.boxes) {\n      chart.boxes = [];\n    }\n    item.fullSize = item.fullSize || false;\n    item.position = item.position || 'top';\n    item.weight = item.weight || 0;\n    item._layers = item._layers || function() {\n      return [{\n        z: 0,\n        draw(chartArea) {\n          item.draw(chartArea);\n        }\n      }];\n    };\n    chart.boxes.push(item);\n  },\n  removeBox(chart, layoutItem) {\n    const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n    if (index !== -1) {\n      chart.boxes.splice(index, 1);\n    }\n  },\n  configure(chart, item, options) {\n    item.fullSize = options.fullSize;\n    item.position = options.position;\n    item.weight = options.weight;\n  },\n  update(chart, width, height, minPadding) {\n    if (!chart) {\n      return;\n    }\n    const padding = toPadding(chart.options.layout.padding);\n    const availableWidth = Math.max(width - padding.width, 0);\n    const availableHeight = Math.max(height - padding.height, 0);\n    const boxes = buildLayoutBoxes(chart.boxes);\n    const verticalBoxes = boxes.vertical;\n    const horizontalBoxes = boxes.horizontal;\n    each(chart.boxes, box => {\n      if (typeof box.beforeLayout === 'function') {\n        box.beforeLayout();\n      }\n    });\n    const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n      wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n    const params = Object.freeze({\n      outerWidth: width,\n      outerHeight: height,\n      padding,\n      availableWidth,\n      availableHeight,\n      vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n      hBoxMaxHeight: availableHeight / 2\n    });\n    const maxPadding = Object.assign({}, padding);\n    updateMaxPadding(maxPadding, toPadding(minPadding));\n    const chartArea = Object.assign({\n      maxPadding,\n      w: availableWidth,\n      h: availableHeight,\n      x: padding.left,\n      y: padding.top\n    }, padding);\n    const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n    fitBoxes(boxes.fullSize, chartArea, params, stacks);\n    fitBoxes(verticalBoxes, chartArea, params, stacks);\n    if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n      fitBoxes(verticalBoxes, chartArea, params, stacks);\n    }\n    handleMaxPadding(chartArea);\n    placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n    chartArea.x += chartArea.w;\n    chartArea.y += chartArea.h;\n    placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n    chart.chartArea = {\n      left: chartArea.left,\n      top: chartArea.top,\n      right: chartArea.left + chartArea.w,\n      bottom: chartArea.top + chartArea.h,\n      height: chartArea.h,\n      width: chartArea.w,\n    };\n    each(boxes.chartArea, (layout) => {\n      const box = layout.box;\n      Object.assign(box, chart.chartArea);\n      box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n    });\n  }\n};\n\nclass BasePlatform {\n  acquireContext(canvas, aspectRatio) {}\n  releaseContext(context) {\n    return false;\n  }\n  addEventListener(chart, type, listener) {}\n  removeEventListener(chart, type, listener) {}\n  getDevicePixelRatio() {\n    return 1;\n  }\n  getMaximumSize(element, width, height, aspectRatio) {\n    width = Math.max(0, width || element.width);\n    height = height || element.height;\n    return {\n      width,\n      height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n    };\n  }\n  isAttached(canvas) {\n    return true;\n  }\n  updateConfig(config) {\n  }\n}\n\nclass BasicPlatform extends BasePlatform {\n  acquireContext(item) {\n    return item && item.getContext && item.getContext('2d') || null;\n  }\n  updateConfig(config) {\n    config.options.animation = false;\n  }\n}\n\nconst EXPANDO_KEY = '$chartjs';\nconst EVENT_TYPES = {\n  touchstart: 'mousedown',\n  touchmove: 'mousemove',\n  touchend: 'mouseup',\n  pointerenter: 'mouseenter',\n  pointerdown: 'mousedown',\n  pointermove: 'mousemove',\n  pointerup: 'mouseup',\n  pointerleave: 'mouseout',\n  pointerout: 'mouseout'\n};\nconst isNullOrEmpty = value => value === null || value === '';\nfunction initCanvas(canvas, aspectRatio) {\n  const style = canvas.style;\n  const renderHeight = canvas.getAttribute('height');\n  const renderWidth = canvas.getAttribute('width');\n  canvas[EXPANDO_KEY] = {\n    initial: {\n      height: renderHeight,\n      width: renderWidth,\n      style: {\n        display: style.display,\n        height: style.height,\n        width: style.width\n      }\n    }\n  };\n  style.display = style.display || 'block';\n  style.boxSizing = style.boxSizing || 'border-box';\n  if (isNullOrEmpty(renderWidth)) {\n    const displayWidth = readUsedSize(canvas, 'width');\n    if (displayWidth !== undefined) {\n      canvas.width = displayWidth;\n    }\n  }\n  if (isNullOrEmpty(renderHeight)) {\n    if (canvas.style.height === '') {\n      canvas.height = canvas.width / (aspectRatio || 2);\n    } else {\n      const displayHeight = readUsedSize(canvas, 'height');\n      if (displayHeight !== undefined) {\n        canvas.height = displayHeight;\n      }\n    }\n  }\n  return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\nfunction addListener(node, type, listener) {\n  node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n  chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n  const type = EVENT_TYPES[event.type] || event.type;\n  const {x, y} = getRelativePosition(event, chart);\n  return {\n    type,\n    chart,\n    native: event,\n    x: x !== undefined ? x : null,\n    y: y !== undefined ? y : null,\n  };\n}\nfunction nodeListContains(nodeList, canvas) {\n  for (const node of nodeList) {\n    if (node === canvas || node.contains(canvas)) {\n      return true;\n    }\n  }\n}\nfunction createAttachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver(entries => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {childList: true, subtree: true});\n  return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver(entries => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {childList: true, subtree: true});\n  return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n  const dpr = window.devicePixelRatio;\n  if (dpr === oldDevicePixelRatio) {\n    return;\n  }\n  oldDevicePixelRatio = dpr;\n  drpListeningCharts.forEach((resize, chart) => {\n    if (chart.currentDevicePixelRatio !== dpr) {\n      resize();\n    }\n  });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n  if (!drpListeningCharts.size) {\n    window.addEventListener('resize', onWindowResize);\n  }\n  drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n  drpListeningCharts.delete(chart);\n  if (!drpListeningCharts.size) {\n    window.removeEventListener('resize', onWindowResize);\n  }\n}\nfunction createResizeObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const container = canvas && _getParentNode(canvas);\n  if (!container) {\n    return;\n  }\n  const resize = throttled((width, height) => {\n    const w = container.clientWidth;\n    listener(width, height);\n    if (w < container.clientWidth) {\n      listener();\n    }\n  }, window);\n  const observer = new ResizeObserver(entries => {\n    const entry = entries[0];\n    const width = entry.contentRect.width;\n    const height = entry.contentRect.height;\n    if (width === 0 && height === 0) {\n      return;\n    }\n    resize(width, height);\n  });\n  observer.observe(container);\n  listenDevicePixelRatioChanges(chart, resize);\n  return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n  if (observer) {\n    observer.disconnect();\n  }\n  if (type === 'resize') {\n    unlistenDevicePixelRatioChanges(chart);\n  }\n}\nfunction createProxyAndListen(chart, type, listener) {\n  const canvas = chart.canvas;\n  const proxy = throttled((event) => {\n    if (chart.ctx !== null) {\n      listener(fromNativeEvent(event, chart));\n    }\n  }, chart, (args) => {\n    const event = args[0];\n    return [event, event.offsetX, event.offsetY];\n  });\n  addListener(canvas, type, proxy);\n  return proxy;\n}\nclass DomPlatform extends BasePlatform {\n  acquireContext(canvas, aspectRatio) {\n    const context = canvas && canvas.getContext && canvas.getContext('2d');\n    if (context && context.canvas === canvas) {\n      initCanvas(canvas, aspectRatio);\n      return context;\n    }\n    return null;\n  }\n  releaseContext(context) {\n    const canvas = context.canvas;\n    if (!canvas[EXPANDO_KEY]) {\n      return false;\n    }\n    const initial = canvas[EXPANDO_KEY].initial;\n    ['height', 'width'].forEach((prop) => {\n      const value = initial[prop];\n      if (isNullOrUndef(value)) {\n        canvas.removeAttribute(prop);\n      } else {\n        canvas.setAttribute(prop, value);\n      }\n    });\n    const style = initial.style || {};\n    Object.keys(style).forEach((key) => {\n      canvas.style[key] = style[key];\n    });\n    canvas.width = canvas.width;\n    delete canvas[EXPANDO_KEY];\n    return true;\n  }\n  addEventListener(chart, type, listener) {\n    this.removeEventListener(chart, type);\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const handlers = {\n      attach: createAttachObserver,\n      detach: createDetachObserver,\n      resize: createResizeObserver\n    };\n    const handler = handlers[type] || createProxyAndListen;\n    proxies[type] = handler(chart, type, listener);\n  }\n  removeEventListener(chart, type) {\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const proxy = proxies[type];\n    if (!proxy) {\n      return;\n    }\n    const handlers = {\n      attach: releaseObserver,\n      detach: releaseObserver,\n      resize: releaseObserver\n    };\n    const handler = handlers[type] || removeListener;\n    handler(chart, type, proxy);\n    proxies[type] = undefined;\n  }\n  getDevicePixelRatio() {\n    return window.devicePixelRatio;\n  }\n  getMaximumSize(canvas, width, height, aspectRatio) {\n    return getMaximumSize(canvas, width, height, aspectRatio);\n  }\n  isAttached(canvas) {\n    const container = _getParentNode(canvas);\n    return !!(container && container.isConnected);\n  }\n}\n\nfunction _detectPlatform(canvas) {\n  if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n    return BasicPlatform;\n  }\n  return DomPlatform;\n}\n\nclass Element {\n  constructor() {\n    this.x = undefined;\n    this.y = undefined;\n    this.active = false;\n    this.options = undefined;\n    this.$animations = undefined;\n  }\n  tooltipPosition(useFinalPosition) {\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return {x, y};\n  }\n  hasValue() {\n    return isNumber(this.x) && isNumber(this.y);\n  }\n  getProps(props, final) {\n    const anims = this.$animations;\n    if (!final || !anims) {\n      return this;\n    }\n    const ret = {};\n    props.forEach(prop => {\n      ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n    });\n    return ret;\n  }\n}\nElement.defaults = {};\nElement.defaultRoutes = undefined;\n\nconst formatters = {\n  values(value) {\n    return isArray(value) ? value : '' + value;\n  },\n  numeric(tickValue, index, ticks) {\n    if (tickValue === 0) {\n      return '0';\n    }\n    const locale = this.chart.options.locale;\n    let notation;\n    let delta = tickValue;\n    if (ticks.length > 1) {\n      const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n      if (maxTick < 1e-4 || maxTick > 1e+15) {\n        notation = 'scientific';\n      }\n      delta = calculateDelta(tickValue, ticks);\n    }\n    const logDelta = log10(Math.abs(delta));\n    const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n    const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n    Object.assign(options, this.options.ticks.format);\n    return formatNumber(tickValue, locale, options);\n  },\n  logarithmic(tickValue, index, ticks) {\n    if (tickValue === 0) {\n      return '0';\n    }\n    const remain = tickValue / (Math.pow(10, Math.floor(log10(tickValue))));\n    if (remain === 1 || remain === 2 || remain === 5) {\n      return formatters.numeric.call(this, tickValue, index, ticks);\n    }\n    return '';\n  }\n};\nfunction calculateDelta(tickValue, ticks) {\n  let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n  if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n    delta = tickValue - Math.floor(tickValue);\n  }\n  return delta;\n}\nvar Ticks = {formatters};\n\ndefaults.set('scale', {\n  display: true,\n  offset: false,\n  reverse: false,\n  beginAtZero: false,\n  bounds: 'ticks',\n  grace: 0,\n  grid: {\n    display: true,\n    lineWidth: 1,\n    drawBorder: true,\n    drawOnChartArea: true,\n    drawTicks: true,\n    tickLength: 8,\n    tickWidth: (_ctx, options) => options.lineWidth,\n    tickColor: (_ctx, options) => options.color,\n    offset: false,\n    borderDash: [],\n    borderDashOffset: 0.0,\n    borderWidth: 1\n  },\n  title: {\n    display: false,\n    text: '',\n    padding: {\n      top: 4,\n      bottom: 4\n    }\n  },\n  ticks: {\n    minRotation: 0,\n    maxRotation: 50,\n    mirror: false,\n    textStrokeWidth: 0,\n    textStrokeColor: '',\n    padding: 3,\n    display: true,\n    autoSkip: true,\n    autoSkipPadding: 3,\n    labelOffset: 0,\n    callback: Ticks.formatters.values,\n    minor: {},\n    major: {},\n    align: 'center',\n    crossAlign: 'near',\n    showLabelBackdrop: false,\n    backdropColor: 'rgba(255, 255, 255, 0.75)',\n    backdropPadding: 2,\n  }\n});\ndefaults.route('scale.ticks', 'color', '', 'color');\ndefaults.route('scale.grid', 'color', '', 'borderColor');\ndefaults.route('scale.grid', 'borderColor', '', 'borderColor');\ndefaults.route('scale.title', 'color', '', 'color');\ndefaults.describe('scale', {\n  _fallback: false,\n  _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n  _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash',\n});\ndefaults.describe('scales', {\n  _fallback: 'scale',\n});\ndefaults.describe('scale.ticks', {\n  _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n  _indexable: (name) => name !== 'backdropPadding',\n});\n\nfunction autoSkip(scale, ticks) {\n  const tickOpts = scale.options.ticks;\n  const ticksLimit = tickOpts.maxTicksLimit || determineMaxTicks(scale);\n  const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n  const numMajorIndices = majorIndices.length;\n  const first = majorIndices[0];\n  const last = majorIndices[numMajorIndices - 1];\n  const newTicks = [];\n  if (numMajorIndices > ticksLimit) {\n    skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n    return newTicks;\n  }\n  const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n  if (numMajorIndices > 0) {\n    let i, ilen;\n    const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n    skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n    for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n      skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n    }\n    skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n    return newTicks;\n  }\n  skip(ticks, newTicks, spacing);\n  return newTicks;\n}\nfunction determineMaxTicks(scale) {\n  const offset = scale.options.offset;\n  const tickLength = scale._tickSize();\n  const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n  const maxChart = scale._maxLength / tickLength;\n  return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n  const evenMajorSpacing = getEvenSpacing(majorIndices);\n  const spacing = ticks.length / ticksLimit;\n  if (!evenMajorSpacing) {\n    return Math.max(spacing, 1);\n  }\n  const factors = _factorize(evenMajorSpacing);\n  for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n    const factor = factors[i];\n    if (factor > spacing) {\n      return factor;\n    }\n  }\n  return Math.max(spacing, 1);\n}\nfunction getMajorIndices(ticks) {\n  const result = [];\n  let i, ilen;\n  for (i = 0, ilen = ticks.length; i < ilen; i++) {\n    if (ticks[i].major) {\n      result.push(i);\n    }\n  }\n  return result;\n}\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n  let count = 0;\n  let next = majorIndices[0];\n  let i;\n  spacing = Math.ceil(spacing);\n  for (i = 0; i < ticks.length; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = majorIndices[count * spacing];\n    }\n  }\n}\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n  const start = valueOrDefault(majorStart, 0);\n  const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n  let count = 0;\n  let length, i, next;\n  spacing = Math.ceil(spacing);\n  if (majorEnd) {\n    length = majorEnd - majorStart;\n    spacing = length / Math.floor(length / spacing);\n  }\n  next = start;\n  while (next < 0) {\n    count++;\n    next = Math.round(start + count * spacing);\n  }\n  for (i = Math.max(start, 0); i < end; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = Math.round(start + count * spacing);\n    }\n  }\n}\nfunction getEvenSpacing(arr) {\n  const len = arr.length;\n  let i, diff;\n  if (len < 2) {\n    return false;\n  }\n  for (diff = arr[0], i = 1; i < len; ++i) {\n    if (arr[i] - arr[i - 1] !== diff) {\n      return false;\n    }\n  }\n  return diff;\n}\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nfunction sample(arr, numItems) {\n  const result = [];\n  const increment = arr.length / numItems;\n  const len = arr.length;\n  let i = 0;\n  for (; i < len; i += increment) {\n    result.push(arr[Math.floor(i)]);\n  }\n  return result;\n}\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n  const length = scale.ticks.length;\n  const validIndex = Math.min(index, length - 1);\n  const start = scale._startPixel;\n  const end = scale._endPixel;\n  const epsilon = 1e-6;\n  let lineValue = scale.getPixelForTick(validIndex);\n  let offset;\n  if (offsetGridLines) {\n    if (length === 1) {\n      offset = Math.max(lineValue - start, end - lineValue);\n    } else if (index === 0) {\n      offset = (scale.getPixelForTick(1) - lineValue) / 2;\n    } else {\n      offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n    }\n    lineValue += validIndex < index ? offset : -offset;\n    if (lineValue < start - epsilon || lineValue > end + epsilon) {\n      return;\n    }\n  }\n  return lineValue;\n}\nfunction garbageCollect(caches, length) {\n  each(caches, (cache) => {\n    const gc = cache.gc;\n    const gcLen = gc.length / 2;\n    let i;\n    if (gcLen > length) {\n      for (i = 0; i < gcLen; ++i) {\n        delete cache.data[gc[i]];\n      }\n      gc.splice(0, gcLen);\n    }\n  });\n}\nfunction getTickMarkLength(options) {\n  return options.drawTicks ? options.tickLength : 0;\n}\nfunction getTitleHeight(options, fallback) {\n  if (!options.display) {\n    return 0;\n  }\n  const font = toFont(options.font, fallback);\n  const padding = toPadding(options.padding);\n  const lines = isArray(options.text) ? options.text.length : 1;\n  return (lines * font.lineHeight) + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n  return createContext(parent, {\n    scale,\n    type: 'scale'\n  });\n}\nfunction createTickContext(parent, index, tick) {\n  return createContext(parent, {\n    tick,\n    index,\n    type: 'tick'\n  });\n}\nfunction titleAlign(align, position, reverse) {\n  let ret = _toLeftRightCenter(align);\n  if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n    ret = reverseAlign(ret);\n  }\n  return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n  const {top, left, bottom, right, chart} = scale;\n  const {chartArea, scales} = chart;\n  let rotation = 0;\n  let maxWidth, titleX, titleY;\n  const height = bottom - top;\n  const width = right - left;\n  if (scale.isHorizontal()) {\n    titleX = _alignStartEnd(align, left, right);\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n    } else if (position === 'center') {\n      titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n    } else {\n      titleY = offsetFromEdge(scale, position, offset);\n    }\n    maxWidth = right - left;\n  } else {\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n    } else if (position === 'center') {\n      titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n    } else {\n      titleX = offsetFromEdge(scale, position, offset);\n    }\n    titleY = _alignStartEnd(align, bottom, top);\n    rotation = position === 'left' ? -HALF_PI : HALF_PI;\n  }\n  return {titleX, titleY, maxWidth, rotation};\n}\nclass Scale extends Element {\n  constructor(cfg) {\n    super();\n    this.id = cfg.id;\n    this.type = cfg.type;\n    this.options = undefined;\n    this.ctx = cfg.ctx;\n    this.chart = cfg.chart;\n    this.top = undefined;\n    this.bottom = undefined;\n    this.left = undefined;\n    this.right = undefined;\n    this.width = undefined;\n    this.height = undefined;\n    this._margins = {\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    };\n    this.maxWidth = undefined;\n    this.maxHeight = undefined;\n    this.paddingTop = undefined;\n    this.paddingBottom = undefined;\n    this.paddingLeft = undefined;\n    this.paddingRight = undefined;\n    this.axis = undefined;\n    this.labelRotation = undefined;\n    this.min = undefined;\n    this.max = undefined;\n    this._range = undefined;\n    this.ticks = [];\n    this._gridLineItems = null;\n    this._labelItems = null;\n    this._labelSizes = null;\n    this._length = 0;\n    this._maxLength = 0;\n    this._longestTextCache = {};\n    this._startPixel = undefined;\n    this._endPixel = undefined;\n    this._reversePixels = false;\n    this._userMax = undefined;\n    this._userMin = undefined;\n    this._suggestedMax = undefined;\n    this._suggestedMin = undefined;\n    this._ticksLength = 0;\n    this._borderValue = 0;\n    this._cache = {};\n    this._dataLimitsCached = false;\n    this.$context = undefined;\n  }\n  init(options) {\n    this.options = options.setContext(this.getContext());\n    this.axis = options.axis;\n    this._userMin = this.parse(options.min);\n    this._userMax = this.parse(options.max);\n    this._suggestedMin = this.parse(options.suggestedMin);\n    this._suggestedMax = this.parse(options.suggestedMax);\n  }\n  parse(raw, index) {\n    return raw;\n  }\n  getUserBounds() {\n    let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n    _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n    _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n    _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n    _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n    return {\n      min: finiteOrDefault(_userMin, _suggestedMin),\n      max: finiteOrDefault(_userMax, _suggestedMax),\n      minDefined: isNumberFinite(_userMin),\n      maxDefined: isNumberFinite(_userMax)\n    };\n  }\n  getMinMax(canStack) {\n    let {min, max, minDefined, maxDefined} = this.getUserBounds();\n    let range;\n    if (minDefined && maxDefined) {\n      return {min, max};\n    }\n    const metas = this.getMatchingVisibleMetas();\n    for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n      range = metas[i].controller.getMinMax(this, canStack);\n      if (!minDefined) {\n        min = Math.min(min, range.min);\n      }\n      if (!maxDefined) {\n        max = Math.max(max, range.max);\n      }\n    }\n    min = maxDefined && min > max ? max : min;\n    max = minDefined && min > max ? min : max;\n    return {\n      min: finiteOrDefault(min, finiteOrDefault(max, min)),\n      max: finiteOrDefault(max, finiteOrDefault(min, max))\n    };\n  }\n  getPadding() {\n    return {\n      left: this.paddingLeft || 0,\n      top: this.paddingTop || 0,\n      right: this.paddingRight || 0,\n      bottom: this.paddingBottom || 0\n    };\n  }\n  getTicks() {\n    return this.ticks;\n  }\n  getLabels() {\n    const data = this.chart.data;\n    return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n  }\n  beforeLayout() {\n    this._cache = {};\n    this._dataLimitsCached = false;\n  }\n  beforeUpdate() {\n    callback(this.options.beforeUpdate, [this]);\n  }\n  update(maxWidth, maxHeight, margins) {\n    const {beginAtZero, grace, ticks: tickOpts} = this.options;\n    const sampleSize = tickOpts.sampleSize;\n    this.beforeUpdate();\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins = Object.assign({\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    }, margins);\n    this.ticks = null;\n    this._labelSizes = null;\n    this._gridLineItems = null;\n    this._labelItems = null;\n    this.beforeSetDimensions();\n    this.setDimensions();\n    this.afterSetDimensions();\n    this._maxLength = this.isHorizontal()\n      ? this.width + margins.left + margins.right\n      : this.height + margins.top + margins.bottom;\n    if (!this._dataLimitsCached) {\n      this.beforeDataLimits();\n      this.determineDataLimits();\n      this.afterDataLimits();\n      this._range = _addGrace(this, grace, beginAtZero);\n      this._dataLimitsCached = true;\n    }\n    this.beforeBuildTicks();\n    this.ticks = this.buildTicks() || [];\n    this.afterBuildTicks();\n    const samplingEnabled = sampleSize < this.ticks.length;\n    this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n    this.configure();\n    this.beforeCalculateLabelRotation();\n    this.calculateLabelRotation();\n    this.afterCalculateLabelRotation();\n    if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n      this.ticks = autoSkip(this, this.ticks);\n      this._labelSizes = null;\n      this.afterAutoSkip();\n    }\n    if (samplingEnabled) {\n      this._convertTicksToLabels(this.ticks);\n    }\n    this.beforeFit();\n    this.fit();\n    this.afterFit();\n    this.afterUpdate();\n  }\n  configure() {\n    let reversePixels = this.options.reverse;\n    let startPixel, endPixel;\n    if (this.isHorizontal()) {\n      startPixel = this.left;\n      endPixel = this.right;\n    } else {\n      startPixel = this.top;\n      endPixel = this.bottom;\n      reversePixels = !reversePixels;\n    }\n    this._startPixel = startPixel;\n    this._endPixel = endPixel;\n    this._reversePixels = reversePixels;\n    this._length = endPixel - startPixel;\n    this._alignToPixels = this.options.alignToPixels;\n  }\n  afterUpdate() {\n    callback(this.options.afterUpdate, [this]);\n  }\n  beforeSetDimensions() {\n    callback(this.options.beforeSetDimensions, [this]);\n  }\n  setDimensions() {\n    if (this.isHorizontal()) {\n      this.width = this.maxWidth;\n      this.left = 0;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n      this.top = 0;\n      this.bottom = this.height;\n    }\n    this.paddingLeft = 0;\n    this.paddingTop = 0;\n    this.paddingRight = 0;\n    this.paddingBottom = 0;\n  }\n  afterSetDimensions() {\n    callback(this.options.afterSetDimensions, [this]);\n  }\n  _callHooks(name) {\n    this.chart.notifyPlugins(name, this.getContext());\n    callback(this.options[name], [this]);\n  }\n  beforeDataLimits() {\n    this._callHooks('beforeDataLimits');\n  }\n  determineDataLimits() {}\n  afterDataLimits() {\n    this._callHooks('afterDataLimits');\n  }\n  beforeBuildTicks() {\n    this._callHooks('beforeBuildTicks');\n  }\n  buildTicks() {\n    return [];\n  }\n  afterBuildTicks() {\n    this._callHooks('afterBuildTicks');\n  }\n  beforeTickToLabelConversion() {\n    callback(this.options.beforeTickToLabelConversion, [this]);\n  }\n  generateTickLabels(ticks) {\n    const tickOpts = this.options.ticks;\n    let i, ilen, tick;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      tick = ticks[i];\n      tick.label = callback(tickOpts.callback, [tick.value, i, ticks], this);\n    }\n  }\n  afterTickToLabelConversion() {\n    callback(this.options.afterTickToLabelConversion, [this]);\n  }\n  beforeCalculateLabelRotation() {\n    callback(this.options.beforeCalculateLabelRotation, [this]);\n  }\n  calculateLabelRotation() {\n    const options = this.options;\n    const tickOpts = options.ticks;\n    const numTicks = this.ticks.length;\n    const minRotation = tickOpts.minRotation || 0;\n    const maxRotation = tickOpts.maxRotation;\n    let labelRotation = minRotation;\n    let tickWidth, maxHeight, maxLabelDiagonal;\n    if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n      this.labelRotation = minRotation;\n      return;\n    }\n    const labelSizes = this._getLabelSizes();\n    const maxLabelWidth = labelSizes.widest.width;\n    const maxLabelHeight = labelSizes.highest.height;\n    const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n    tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n    if (maxLabelWidth + 6 > tickWidth) {\n      tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n      maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n      maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n      labelRotation = toDegrees(Math.min(\n        Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n        Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n      ));\n      labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n    }\n    this.labelRotation = labelRotation;\n  }\n  afterCalculateLabelRotation() {\n    callback(this.options.afterCalculateLabelRotation, [this]);\n  }\n  afterAutoSkip() {}\n  beforeFit() {\n    callback(this.options.beforeFit, [this]);\n  }\n  fit() {\n    const minSize = {\n      width: 0,\n      height: 0\n    };\n    const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n    const display = this._isVisible();\n    const isHorizontal = this.isHorizontal();\n    if (display) {\n      const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n      if (isHorizontal) {\n        minSize.width = this.maxWidth;\n        minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n      } else {\n        minSize.height = this.maxHeight;\n        minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n      }\n      if (tickOpts.display && this.ticks.length) {\n        const {first, last, widest, highest} = this._getLabelSizes();\n        const tickPadding = tickOpts.padding * 2;\n        const angleRadians = toRadians(this.labelRotation);\n        const cos = Math.cos(angleRadians);\n        const sin = Math.sin(angleRadians);\n        if (isHorizontal) {\n          const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n          minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n        } else {\n          const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n          minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n        }\n        this._calculatePadding(first, last, sin, cos);\n      }\n    }\n    this._handleMargins();\n    if (isHorizontal) {\n      this.width = this._length = chart.width - this._margins.left - this._margins.right;\n      this.height = minSize.height;\n    } else {\n      this.width = minSize.width;\n      this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n    }\n  }\n  _calculatePadding(first, last, sin, cos) {\n    const {ticks: {align, padding}, position} = this.options;\n    const isRotated = this.labelRotation !== 0;\n    const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n    if (this.isHorizontal()) {\n      const offsetLeft = this.getPixelForTick(0) - this.left;\n      const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n      let paddingLeft = 0;\n      let paddingRight = 0;\n      if (isRotated) {\n        if (labelsBelowTicks) {\n          paddingLeft = cos * first.width;\n          paddingRight = sin * last.height;\n        } else {\n          paddingLeft = sin * first.height;\n          paddingRight = cos * last.width;\n        }\n      } else if (align === 'start') {\n        paddingRight = last.width;\n      } else if (align === 'end') {\n        paddingLeft = first.width;\n      } else if (align !== 'inner') {\n        paddingLeft = first.width / 2;\n        paddingRight = last.width / 2;\n      }\n      this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n      this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n    } else {\n      let paddingTop = last.height / 2;\n      let paddingBottom = first.height / 2;\n      if (align === 'start') {\n        paddingTop = 0;\n        paddingBottom = first.height;\n      } else if (align === 'end') {\n        paddingTop = last.height;\n        paddingBottom = 0;\n      }\n      this.paddingTop = paddingTop + padding;\n      this.paddingBottom = paddingBottom + padding;\n    }\n  }\n  _handleMargins() {\n    if (this._margins) {\n      this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n      this._margins.top = Math.max(this.paddingTop, this._margins.top);\n      this._margins.right = Math.max(this.paddingRight, this._margins.right);\n      this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n    }\n  }\n  afterFit() {\n    callback(this.options.afterFit, [this]);\n  }\n  isHorizontal() {\n    const {axis, position} = this.options;\n    return position === 'top' || position === 'bottom' || axis === 'x';\n  }\n  isFullSize() {\n    return this.options.fullSize;\n  }\n  _convertTicksToLabels(ticks) {\n    this.beforeTickToLabelConversion();\n    this.generateTickLabels(ticks);\n    let i, ilen;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      if (isNullOrUndef(ticks[i].label)) {\n        ticks.splice(i, 1);\n        ilen--;\n        i--;\n      }\n    }\n    this.afterTickToLabelConversion();\n  }\n  _getLabelSizes() {\n    let labelSizes = this._labelSizes;\n    if (!labelSizes) {\n      const sampleSize = this.options.ticks.sampleSize;\n      let ticks = this.ticks;\n      if (sampleSize < ticks.length) {\n        ticks = sample(ticks, sampleSize);\n      }\n      this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);\n    }\n    return labelSizes;\n  }\n  _computeLabelSizes(ticks, length) {\n    const {ctx, _longestTextCache: caches} = this;\n    const widths = [];\n    const heights = [];\n    let widestLabelSize = 0;\n    let highestLabelSize = 0;\n    let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n    for (i = 0; i < length; ++i) {\n      label = ticks[i].label;\n      tickFont = this._resolveTickFontOptions(i);\n      ctx.font = fontString = tickFont.string;\n      cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n      lineHeight = tickFont.lineHeight;\n      width = height = 0;\n      if (!isNullOrUndef(label) && !isArray(label)) {\n        width = _measureText(ctx, cache.data, cache.gc, width, label);\n        height = lineHeight;\n      } else if (isArray(label)) {\n        for (j = 0, jlen = label.length; j < jlen; ++j) {\n          nestedLabel = label[j];\n          if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n            width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n            height += lineHeight;\n          }\n        }\n      }\n      widths.push(width);\n      heights.push(height);\n      widestLabelSize = Math.max(width, widestLabelSize);\n      highestLabelSize = Math.max(height, highestLabelSize);\n    }\n    garbageCollect(caches, length);\n    const widest = widths.indexOf(widestLabelSize);\n    const highest = heights.indexOf(highestLabelSize);\n    const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n    return {\n      first: valueAt(0),\n      last: valueAt(length - 1),\n      widest: valueAt(widest),\n      highest: valueAt(highest),\n      widths,\n      heights,\n    };\n  }\n  getLabelForValue(value) {\n    return value;\n  }\n  getPixelForValue(value, index) {\n    return NaN;\n  }\n  getValueForPixel(pixel) {}\n  getPixelForTick(index) {\n    const ticks = this.ticks;\n    if (index < 0 || index > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index].value);\n  }\n  getPixelForDecimal(decimal) {\n    if (this._reversePixels) {\n      decimal = 1 - decimal;\n    }\n    const pixel = this._startPixel + decimal * this._length;\n    return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n  }\n  getDecimalForPixel(pixel) {\n    const decimal = (pixel - this._startPixel) / this._length;\n    return this._reversePixels ? 1 - decimal : decimal;\n  }\n  getBasePixel() {\n    return this.getPixelForValue(this.getBaseValue());\n  }\n  getBaseValue() {\n    const {min, max} = this;\n    return min < 0 && max < 0 ? max :\n      min > 0 && max > 0 ? min :\n      0;\n  }\n  getContext(index) {\n    const ticks = this.ticks || [];\n    if (index >= 0 && index < ticks.length) {\n      const tick = ticks[index];\n      return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n    }\n    return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n  }\n  _tickSize() {\n    const optionTicks = this.options.ticks;\n    const rot = toRadians(this.labelRotation);\n    const cos = Math.abs(Math.cos(rot));\n    const sin = Math.abs(Math.sin(rot));\n    const labelSizes = this._getLabelSizes();\n    const padding = optionTicks.autoSkipPadding || 0;\n    const w = labelSizes ? labelSizes.widest.width + padding : 0;\n    const h = labelSizes ? labelSizes.highest.height + padding : 0;\n    return this.isHorizontal()\n      ? h * cos > w * sin ? w / cos : h / sin\n      : h * sin < w * cos ? h / cos : w / sin;\n  }\n  _isVisible() {\n    const display = this.options.display;\n    if (display !== 'auto') {\n      return !!display;\n    }\n    return this.getMatchingVisibleMetas().length > 0;\n  }\n  _computeGridLineItems(chartArea) {\n    const axis = this.axis;\n    const chart = this.chart;\n    const options = this.options;\n    const {grid, position} = options;\n    const offset = grid.offset;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const ticksLength = ticks.length + (offset ? 1 : 0);\n    const tl = getTickMarkLength(grid);\n    const items = [];\n    const borderOpts = grid.setContext(this.getContext());\n    const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;\n    const axisHalfWidth = axisWidth / 2;\n    const alignBorderValue = function(pixel) {\n      return _alignPixel(chart, pixel, axisWidth);\n    };\n    let borderValue, i, lineValue, alignedLineValue;\n    let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n    if (position === 'top') {\n      borderValue = alignBorderValue(this.bottom);\n      ty1 = this.bottom - tl;\n      ty2 = borderValue - axisHalfWidth;\n      y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n      y2 = chartArea.bottom;\n    } else if (position === 'bottom') {\n      borderValue = alignBorderValue(this.top);\n      y1 = chartArea.top;\n      y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = this.top + tl;\n    } else if (position === 'left') {\n      borderValue = alignBorderValue(this.right);\n      tx1 = this.right - tl;\n      tx2 = borderValue - axisHalfWidth;\n      x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n      x2 = chartArea.right;\n    } else if (position === 'right') {\n      borderValue = alignBorderValue(this.left);\n      x1 = chartArea.left;\n      x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n      tx1 = borderValue + axisHalfWidth;\n      tx2 = this.left + tl;\n    } else if (axis === 'x') {\n      if (position === 'center') {\n        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n      y1 = chartArea.top;\n      y2 = chartArea.bottom;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = ty1 + tl;\n    } else if (axis === 'y') {\n      if (position === 'center') {\n        borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n      tx1 = borderValue - axisHalfWidth;\n      tx2 = tx1 - tl;\n      x1 = chartArea.left;\n      x2 = chartArea.right;\n    }\n    const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n    const step = Math.max(1, Math.ceil(ticksLength / limit));\n    for (i = 0; i < ticksLength; i += step) {\n      const optsAtIndex = grid.setContext(this.getContext(i));\n      const lineWidth = optsAtIndex.lineWidth;\n      const lineColor = optsAtIndex.color;\n      const borderDash = grid.borderDash || [];\n      const borderDashOffset = optsAtIndex.borderDashOffset;\n      const tickWidth = optsAtIndex.tickWidth;\n      const tickColor = optsAtIndex.tickColor;\n      const tickBorderDash = optsAtIndex.tickBorderDash || [];\n      const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n      lineValue = getPixelForGridLine(this, i, offset);\n      if (lineValue === undefined) {\n        continue;\n      }\n      alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n      if (isHorizontal) {\n        tx1 = tx2 = x1 = x2 = alignedLineValue;\n      } else {\n        ty1 = ty2 = y1 = y2 = alignedLineValue;\n      }\n      items.push({\n        tx1,\n        ty1,\n        tx2,\n        ty2,\n        x1,\n        y1,\n        x2,\n        y2,\n        width: lineWidth,\n        color: lineColor,\n        borderDash,\n        borderDashOffset,\n        tickWidth,\n        tickColor,\n        tickBorderDash,\n        tickBorderDashOffset,\n      });\n    }\n    this._ticksLength = ticksLength;\n    this._borderValue = borderValue;\n    return items;\n  }\n  _computeLabelItems(chartArea) {\n    const axis = this.axis;\n    const options = this.options;\n    const {position, ticks: optionTicks} = options;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const {align, crossAlign, padding, mirror} = optionTicks;\n    const tl = getTickMarkLength(options.grid);\n    const tickAndPadding = tl + padding;\n    const hTickAndPadding = mirror ? -padding : tickAndPadding;\n    const rotation = -toRadians(this.labelRotation);\n    const items = [];\n    let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n    let textBaseline = 'middle';\n    if (position === 'top') {\n      y = this.bottom - hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === 'bottom') {\n      y = this.top + hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === 'left') {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (position === 'right') {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (axis === 'x') {\n      if (position === 'center') {\n        y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n      }\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (axis === 'y') {\n      if (position === 'center') {\n        x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        x = this.chart.scales[positionAxisID].getPixelForValue(value);\n      }\n      textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n    }\n    if (axis === 'y') {\n      if (align === 'start') {\n        textBaseline = 'top';\n      } else if (align === 'end') {\n        textBaseline = 'bottom';\n      }\n    }\n    const labelSizes = this._getLabelSizes();\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      label = tick.label;\n      const optsAtIndex = optionTicks.setContext(this.getContext(i));\n      pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n      font = this._resolveTickFontOptions(i);\n      lineHeight = font.lineHeight;\n      lineCount = isArray(label) ? label.length : 1;\n      const halfCount = lineCount / 2;\n      const color = optsAtIndex.color;\n      const strokeColor = optsAtIndex.textStrokeColor;\n      const strokeWidth = optsAtIndex.textStrokeWidth;\n      let tickTextAlign = textAlign;\n      if (isHorizontal) {\n        x = pixel;\n        if (textAlign === 'inner') {\n          if (i === ilen - 1) {\n            tickTextAlign = !this.options.reverse ? 'right' : 'left';\n          } else if (i === 0) {\n            tickTextAlign = !this.options.reverse ? 'left' : 'right';\n          } else {\n            tickTextAlign = 'center';\n          }\n        }\n        if (position === 'top') {\n          if (crossAlign === 'near' || rotation !== 0) {\n            textOffset = -lineCount * lineHeight + lineHeight / 2;\n          } else if (crossAlign === 'center') {\n            textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n          } else {\n            textOffset = -labelSizes.highest.height + lineHeight / 2;\n          }\n        } else {\n          if (crossAlign === 'near' || rotation !== 0) {\n            textOffset = lineHeight / 2;\n          } else if (crossAlign === 'center') {\n            textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n          } else {\n            textOffset = labelSizes.highest.height - lineCount * lineHeight;\n          }\n        }\n        if (mirror) {\n          textOffset *= -1;\n        }\n      } else {\n        y = pixel;\n        textOffset = (1 - lineCount) * lineHeight / 2;\n      }\n      let backdrop;\n      if (optsAtIndex.showLabelBackdrop) {\n        const labelPadding = toPadding(optsAtIndex.backdropPadding);\n        const height = labelSizes.heights[i];\n        const width = labelSizes.widths[i];\n        let top = y + textOffset - labelPadding.top;\n        let left = x - labelPadding.left;\n        switch (textBaseline) {\n        case 'middle':\n          top -= height / 2;\n          break;\n        case 'bottom':\n          top -= height;\n          break;\n        }\n        switch (textAlign) {\n        case 'center':\n          left -= width / 2;\n          break;\n        case 'right':\n          left -= width;\n          break;\n        }\n        backdrop = {\n          left,\n          top,\n          width: width + labelPadding.width,\n          height: height + labelPadding.height,\n          color: optsAtIndex.backdropColor,\n        };\n      }\n      items.push({\n        rotation,\n        label,\n        font,\n        color,\n        strokeColor,\n        strokeWidth,\n        textOffset,\n        textAlign: tickTextAlign,\n        textBaseline,\n        translation: [x, y],\n        backdrop,\n      });\n    }\n    return items;\n  }\n  _getXAxisLabelAlignment() {\n    const {position, ticks} = this.options;\n    const rotation = -toRadians(this.labelRotation);\n    if (rotation) {\n      return position === 'top' ? 'left' : 'right';\n    }\n    let align = 'center';\n    if (ticks.align === 'start') {\n      align = 'left';\n    } else if (ticks.align === 'end') {\n      align = 'right';\n    } else if (ticks.align === 'inner') {\n      align = 'inner';\n    }\n    return align;\n  }\n  _getYAxisLabelAlignment(tl) {\n    const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n    const labelSizes = this._getLabelSizes();\n    const tickAndPadding = tl + padding;\n    const widest = labelSizes.widest.width;\n    let textAlign;\n    let x;\n    if (position === 'left') {\n      if (mirror) {\n        x = this.right + padding;\n        if (crossAlign === 'near') {\n          textAlign = 'left';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x += (widest / 2);\n        } else {\n          textAlign = 'right';\n          x += widest;\n        }\n      } else {\n        x = this.right - tickAndPadding;\n        if (crossAlign === 'near') {\n          textAlign = 'right';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x -= (widest / 2);\n        } else {\n          textAlign = 'left';\n          x = this.left;\n        }\n      }\n    } else if (position === 'right') {\n      if (mirror) {\n        x = this.left + padding;\n        if (crossAlign === 'near') {\n          textAlign = 'right';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x -= (widest / 2);\n        } else {\n          textAlign = 'left';\n          x -= widest;\n        }\n      } else {\n        x = this.left + tickAndPadding;\n        if (crossAlign === 'near') {\n          textAlign = 'left';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x += widest / 2;\n        } else {\n          textAlign = 'right';\n          x = this.right;\n        }\n      }\n    } else {\n      textAlign = 'right';\n    }\n    return {textAlign, x};\n  }\n  _computeLabelArea() {\n    if (this.options.ticks.mirror) {\n      return;\n    }\n    const chart = this.chart;\n    const position = this.options.position;\n    if (position === 'left' || position === 'right') {\n      return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n    } if (position === 'top' || position === 'bottom') {\n      return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n    }\n  }\n  drawBackground() {\n    const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n    if (backgroundColor) {\n      ctx.save();\n      ctx.fillStyle = backgroundColor;\n      ctx.fillRect(left, top, width, height);\n      ctx.restore();\n    }\n  }\n  getLineWidthForValue(value) {\n    const grid = this.options.grid;\n    if (!this._isVisible() || !grid.display) {\n      return 0;\n    }\n    const ticks = this.ticks;\n    const index = ticks.findIndex(t => t.value === value);\n    if (index >= 0) {\n      const opts = grid.setContext(this.getContext(index));\n      return opts.lineWidth;\n    }\n    return 0;\n  }\n  drawGrid(chartArea) {\n    const grid = this.options.grid;\n    const ctx = this.ctx;\n    const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n    let i, ilen;\n    const drawLine = (p1, p2, style) => {\n      if (!style.width || !style.color) {\n        return;\n      }\n      ctx.save();\n      ctx.lineWidth = style.width;\n      ctx.strokeStyle = style.color;\n      ctx.setLineDash(style.borderDash || []);\n      ctx.lineDashOffset = style.borderDashOffset;\n      ctx.beginPath();\n      ctx.moveTo(p1.x, p1.y);\n      ctx.lineTo(p2.x, p2.y);\n      ctx.stroke();\n      ctx.restore();\n    };\n    if (grid.display) {\n      for (i = 0, ilen = items.length; i < ilen; ++i) {\n        const item = items[i];\n        if (grid.drawOnChartArea) {\n          drawLine(\n            {x: item.x1, y: item.y1},\n            {x: item.x2, y: item.y2},\n            item\n          );\n        }\n        if (grid.drawTicks) {\n          drawLine(\n            {x: item.tx1, y: item.ty1},\n            {x: item.tx2, y: item.ty2},\n            {\n              color: item.tickColor,\n              width: item.tickWidth,\n              borderDash: item.tickBorderDash,\n              borderDashOffset: item.tickBorderDashOffset\n            }\n          );\n        }\n      }\n    }\n  }\n  drawBorder() {\n    const {chart, ctx, options: {grid}} = this;\n    const borderOpts = grid.setContext(this.getContext());\n    const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;\n    if (!axisWidth) {\n      return;\n    }\n    const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n    const borderValue = this._borderValue;\n    let x1, x2, y1, y2;\n    if (this.isHorizontal()) {\n      x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n      x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n      y1 = y2 = borderValue;\n    } else {\n      y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n      y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n      x1 = x2 = borderValue;\n    }\n    ctx.save();\n    ctx.lineWidth = borderOpts.borderWidth;\n    ctx.strokeStyle = borderOpts.borderColor;\n    ctx.beginPath();\n    ctx.moveTo(x1, y1);\n    ctx.lineTo(x2, y2);\n    ctx.stroke();\n    ctx.restore();\n  }\n  drawLabels(chartArea) {\n    const optionTicks = this.options.ticks;\n    if (!optionTicks.display) {\n      return;\n    }\n    const ctx = this.ctx;\n    const area = this._computeLabelArea();\n    if (area) {\n      clipArea(ctx, area);\n    }\n    const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n    let i, ilen;\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      const item = items[i];\n      const tickFont = item.font;\n      const label = item.label;\n      if (item.backdrop) {\n        ctx.fillStyle = item.backdrop.color;\n        ctx.fillRect(item.backdrop.left, item.backdrop.top, item.backdrop.width, item.backdrop.height);\n      }\n      let y = item.textOffset;\n      renderText(ctx, label, 0, y, tickFont, item);\n    }\n    if (area) {\n      unclipArea(ctx);\n    }\n  }\n  drawTitle() {\n    const {ctx, options: {position, title, reverse}} = this;\n    if (!title.display) {\n      return;\n    }\n    const font = toFont(title.font);\n    const padding = toPadding(title.padding);\n    const align = title.align;\n    let offset = font.lineHeight / 2;\n    if (position === 'bottom' || position === 'center' || isObject(position)) {\n      offset += padding.bottom;\n      if (isArray(title.text)) {\n        offset += font.lineHeight * (title.text.length - 1);\n      }\n    } else {\n      offset += padding.top;\n    }\n    const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n    renderText(ctx, title.text, 0, 0, font, {\n      color: title.color,\n      maxWidth,\n      rotation,\n      textAlign: titleAlign(align, position, reverse),\n      textBaseline: 'middle',\n      translation: [titleX, titleY],\n    });\n  }\n  draw(chartArea) {\n    if (!this._isVisible()) {\n      return;\n    }\n    this.drawBackground();\n    this.drawGrid(chartArea);\n    this.drawBorder();\n    this.drawTitle();\n    this.drawLabels(chartArea);\n  }\n  _layers() {\n    const opts = this.options;\n    const tz = opts.ticks && opts.ticks.z || 0;\n    const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n    if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n      return [{\n        z: tz,\n        draw: (chartArea) => {\n          this.draw(chartArea);\n        }\n      }];\n    }\n    return [{\n      z: gz,\n      draw: (chartArea) => {\n        this.drawBackground();\n        this.drawGrid(chartArea);\n        this.drawTitle();\n      }\n    }, {\n      z: gz + 1,\n      draw: () => {\n        this.drawBorder();\n      }\n    }, {\n      z: tz,\n      draw: (chartArea) => {\n        this.drawLabels(chartArea);\n      }\n    }];\n  }\n  getMatchingVisibleMetas(type) {\n    const metas = this.chart.getSortedVisibleDatasetMetas();\n    const axisID = this.axis + 'AxisID';\n    const result = [];\n    let i, ilen;\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      const meta = metas[i];\n      if (meta[axisID] === this.id && (!type || meta.type === type)) {\n        result.push(meta);\n      }\n    }\n    return result;\n  }\n  _resolveTickFontOptions(index) {\n    const opts = this.options.ticks.setContext(this.getContext(index));\n    return toFont(opts.font);\n  }\n  _maxDigits() {\n    const fontSize = this._resolveTickFontOptions(0).lineHeight;\n    return (this.isHorizontal() ? this.width : this.height) / fontSize;\n  }\n}\n\nclass TypedRegistry {\n  constructor(type, scope, override) {\n    this.type = type;\n    this.scope = scope;\n    this.override = override;\n    this.items = Object.create(null);\n  }\n  isForType(type) {\n    return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n  }\n  register(item) {\n    const proto = Object.getPrototypeOf(item);\n    let parentScope;\n    if (isIChartComponent(proto)) {\n      parentScope = this.register(proto);\n    }\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope + '.' + id;\n    if (!id) {\n      throw new Error('class does not have id: ' + item);\n    }\n    if (id in items) {\n      return scope;\n    }\n    items[id] = item;\n    registerDefaults(item, scope, parentScope);\n    if (this.override) {\n      defaults.override(item.id, item.overrides);\n    }\n    return scope;\n  }\n  get(id) {\n    return this.items[id];\n  }\n  unregister(item) {\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope;\n    if (id in items) {\n      delete items[id];\n    }\n    if (scope && id in defaults[scope]) {\n      delete defaults[scope][id];\n      if (this.override) {\n        delete overrides[id];\n      }\n    }\n  }\n}\nfunction registerDefaults(item, scope, parentScope) {\n  const itemDefaults = merge(Object.create(null), [\n    parentScope ? defaults.get(parentScope) : {},\n    defaults.get(scope),\n    item.defaults\n  ]);\n  defaults.set(scope, itemDefaults);\n  if (item.defaultRoutes) {\n    routeDefaults(scope, item.defaultRoutes);\n  }\n  if (item.descriptors) {\n    defaults.describe(scope, item.descriptors);\n  }\n}\nfunction routeDefaults(scope, routes) {\n  Object.keys(routes).forEach(property => {\n    const propertyParts = property.split('.');\n    const sourceName = propertyParts.pop();\n    const sourceScope = [scope].concat(propertyParts).join('.');\n    const parts = routes[property].split('.');\n    const targetName = parts.pop();\n    const targetScope = parts.join('.');\n    defaults.route(sourceScope, sourceName, targetScope, targetName);\n  });\n}\nfunction isIChartComponent(proto) {\n  return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n  constructor() {\n    this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n    this.elements = new TypedRegistry(Element, 'elements');\n    this.plugins = new TypedRegistry(Object, 'plugins');\n    this.scales = new TypedRegistry(Scale, 'scales');\n    this._typedRegistries = [this.controllers, this.scales, this.elements];\n  }\n  add(...args) {\n    this._each('register', args);\n  }\n  remove(...args) {\n    this._each('unregister', args);\n  }\n  addControllers(...args) {\n    this._each('register', args, this.controllers);\n  }\n  addElements(...args) {\n    this._each('register', args, this.elements);\n  }\n  addPlugins(...args) {\n    this._each('register', args, this.plugins);\n  }\n  addScales(...args) {\n    this._each('register', args, this.scales);\n  }\n  getController(id) {\n    return this._get(id, this.controllers, 'controller');\n  }\n  getElement(id) {\n    return this._get(id, this.elements, 'element');\n  }\n  getPlugin(id) {\n    return this._get(id, this.plugins, 'plugin');\n  }\n  getScale(id) {\n    return this._get(id, this.scales, 'scale');\n  }\n  removeControllers(...args) {\n    this._each('unregister', args, this.controllers);\n  }\n  removeElements(...args) {\n    this._each('unregister', args, this.elements);\n  }\n  removePlugins(...args) {\n    this._each('unregister', args, this.plugins);\n  }\n  removeScales(...args) {\n    this._each('unregister', args, this.scales);\n  }\n  _each(method, args, typedRegistry) {\n    [...args].forEach(arg => {\n      const reg = typedRegistry || this._getRegistryForType(arg);\n      if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n        this._exec(method, reg, arg);\n      } else {\n        each(arg, item => {\n          const itemReg = typedRegistry || this._getRegistryForType(item);\n          this._exec(method, itemReg, item);\n        });\n      }\n    });\n  }\n  _exec(method, registry, component) {\n    const camelMethod = _capitalize(method);\n    callback(component['before' + camelMethod], [], component);\n    registry[method](component);\n    callback(component['after' + camelMethod], [], component);\n  }\n  _getRegistryForType(type) {\n    for (let i = 0; i < this._typedRegistries.length; i++) {\n      const reg = this._typedRegistries[i];\n      if (reg.isForType(type)) {\n        return reg;\n      }\n    }\n    return this.plugins;\n  }\n  _get(id, typedRegistry, type) {\n    const item = typedRegistry.get(id);\n    if (item === undefined) {\n      throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n    }\n    return item;\n  }\n}\nvar registry = new Registry();\n\nclass PluginService {\n  constructor() {\n    this._init = [];\n  }\n  notify(chart, hook, args, filter) {\n    if (hook === 'beforeInit') {\n      this._init = this._createDescriptors(chart, true);\n      this._notify(this._init, chart, 'install');\n    }\n    const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n    const result = this._notify(descriptors, chart, hook, args);\n    if (hook === 'afterDestroy') {\n      this._notify(descriptors, chart, 'stop');\n      this._notify(this._init, chart, 'uninstall');\n    }\n    return result;\n  }\n  _notify(descriptors, chart, hook, args) {\n    args = args || {};\n    for (const descriptor of descriptors) {\n      const plugin = descriptor.plugin;\n      const method = plugin[hook];\n      const params = [chart, args, descriptor.options];\n      if (callback(method, params, plugin) === false && args.cancelable) {\n        return false;\n      }\n    }\n    return true;\n  }\n  invalidate() {\n    if (!isNullOrUndef(this._cache)) {\n      this._oldCache = this._cache;\n      this._cache = undefined;\n    }\n  }\n  _descriptors(chart) {\n    if (this._cache) {\n      return this._cache;\n    }\n    const descriptors = this._cache = this._createDescriptors(chart);\n    this._notifyStateChanges(chart);\n    return descriptors;\n  }\n  _createDescriptors(chart, all) {\n    const config = chart && chart.config;\n    const options = valueOrDefault(config.options && config.options.plugins, {});\n    const plugins = allPlugins(config);\n    return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n  }\n  _notifyStateChanges(chart) {\n    const previousDescriptors = this._oldCache || [];\n    const descriptors = this._cache;\n    const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n    this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n    this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n  }\n}\nfunction allPlugins(config) {\n  const plugins = [];\n  const keys = Object.keys(registry.plugins.items);\n  for (let i = 0; i < keys.length; i++) {\n    plugins.push(registry.getPlugin(keys[i]));\n  }\n  const local = config.plugins || [];\n  for (let i = 0; i < local.length; i++) {\n    const plugin = local[i];\n    if (plugins.indexOf(plugin) === -1) {\n      plugins.push(plugin);\n    }\n  }\n  return plugins;\n}\nfunction getOpts(options, all) {\n  if (!all && options === false) {\n    return null;\n  }\n  if (options === true) {\n    return {};\n  }\n  return options;\n}\nfunction createDescriptors(chart, plugins, options, all) {\n  const result = [];\n  const context = chart.getContext();\n  for (let i = 0; i < plugins.length; i++) {\n    const plugin = plugins[i];\n    const id = plugin.id;\n    const opts = getOpts(options[id], all);\n    if (opts === null) {\n      continue;\n    }\n    result.push({\n      plugin,\n      options: pluginOpts(chart.config, plugin, opts, context)\n    });\n  }\n  return result;\n}\nfunction pluginOpts(config, plugin, opts, context) {\n  const keys = config.pluginScopeKeys(plugin);\n  const scopes = config.getOptionScopes(opts, keys);\n  return config.createResolver(scopes, context, [''], {scriptable: false, indexable: false, allKeys: true});\n}\n\nfunction getIndexAxis(type, options) {\n  const datasetDefaults = defaults.datasets[type] || {};\n  const datasetOptions = (options.datasets || {})[type] || {};\n  return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n  let axis = id;\n  if (id === '_index_') {\n    axis = indexAxis;\n  } else if (id === '_value_') {\n    axis = indexAxis === 'x' ? 'y' : 'x';\n  }\n  return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n  return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction axisFromPosition(position) {\n  if (position === 'top' || position === 'bottom') {\n    return 'x';\n  }\n  if (position === 'left' || position === 'right') {\n    return 'y';\n  }\n}\nfunction determineAxis(id, scaleOptions) {\n  if (id === 'x' || id === 'y') {\n    return id;\n  }\n  return scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.charAt(0).toLowerCase();\n}\nfunction mergeScaleConfig(config, options) {\n  const chartDefaults = overrides[config.type] || {scales: {}};\n  const configScales = options.scales || {};\n  const chartIndexAxis = getIndexAxis(config.type, options);\n  const firstIDs = Object.create(null);\n  const scales = Object.create(null);\n  Object.keys(configScales).forEach(id => {\n    const scaleConf = configScales[id];\n    if (!isObject(scaleConf)) {\n      return console.error(`Invalid scale configuration for scale: ${id}`);\n    }\n    if (scaleConf._proxy) {\n      return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n    }\n    const axis = determineAxis(id, scaleConf);\n    const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n    const defaultScaleOptions = chartDefaults.scales || {};\n    firstIDs[axis] = firstIDs[axis] || id;\n    scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n  });\n  config.data.datasets.forEach(dataset => {\n    const type = dataset.type || config.type;\n    const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n    const datasetDefaults = overrides[type] || {};\n    const defaultScaleOptions = datasetDefaults.scales || {};\n    Object.keys(defaultScaleOptions).forEach(defaultID => {\n      const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n      const id = dataset[axis + 'AxisID'] || firstIDs[axis] || axis;\n      scales[id] = scales[id] || Object.create(null);\n      mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n    });\n  });\n  Object.keys(scales).forEach(key => {\n    const scale = scales[key];\n    mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n  });\n  return scales;\n}\nfunction initOptions(config) {\n  const options = config.options || (config.options = {});\n  options.plugins = valueOrDefault(options.plugins, {});\n  options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n  data = data || {};\n  data.datasets = data.datasets || [];\n  data.labels = data.labels || [];\n  return data;\n}\nfunction initConfig(config) {\n  config = config || {};\n  config.data = initData(config.data);\n  initOptions(config);\n  return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n  let keys = keyCache.get(cacheKey);\n  if (!keys) {\n    keys = generate();\n    keyCache.set(cacheKey, keys);\n    keysCached.add(keys);\n  }\n  return keys;\n}\nconst addIfFound = (set, obj, key) => {\n  const opts = resolveObjectKey(obj, key);\n  if (opts !== undefined) {\n    set.add(opts);\n  }\n};\nclass Config {\n  constructor(config) {\n    this._config = initConfig(config);\n    this._scopeCache = new Map();\n    this._resolverCache = new Map();\n  }\n  get platform() {\n    return this._config.platform;\n  }\n  get type() {\n    return this._config.type;\n  }\n  set type(type) {\n    this._config.type = type;\n  }\n  get data() {\n    return this._config.data;\n  }\n  set data(data) {\n    this._config.data = initData(data);\n  }\n  get options() {\n    return this._config.options;\n  }\n  set options(options) {\n    this._config.options = options;\n  }\n  get plugins() {\n    return this._config.plugins;\n  }\n  update() {\n    const config = this._config;\n    this.clearCache();\n    initOptions(config);\n  }\n  clearCache() {\n    this._scopeCache.clear();\n    this._resolverCache.clear();\n  }\n  datasetScopeKeys(datasetType) {\n    return cachedKeys(datasetType,\n      () => [[\n        `datasets.${datasetType}`,\n        ''\n      ]]);\n  }\n  datasetAnimationScopeKeys(datasetType, transition) {\n    return cachedKeys(`${datasetType}.transition.${transition}`,\n      () => [\n        [\n          `datasets.${datasetType}.transitions.${transition}`,\n          `transitions.${transition}`,\n        ],\n        [\n          `datasets.${datasetType}`,\n          ''\n        ]\n      ]);\n  }\n  datasetElementScopeKeys(datasetType, elementType) {\n    return cachedKeys(`${datasetType}-${elementType}`,\n      () => [[\n        `datasets.${datasetType}.elements.${elementType}`,\n        `datasets.${datasetType}`,\n        `elements.${elementType}`,\n        ''\n      ]]);\n  }\n  pluginScopeKeys(plugin) {\n    const id = plugin.id;\n    const type = this.type;\n    return cachedKeys(`${type}-plugin-${id}`,\n      () => [[\n        `plugins.${id}`,\n        ...plugin.additionalOptionScopes || [],\n      ]]);\n  }\n  _cachedScopes(mainScope, resetCache) {\n    const _scopeCache = this._scopeCache;\n    let cache = _scopeCache.get(mainScope);\n    if (!cache || resetCache) {\n      cache = new Map();\n      _scopeCache.set(mainScope, cache);\n    }\n    return cache;\n  }\n  getOptionScopes(mainScope, keyLists, resetCache) {\n    const {options, type} = this;\n    const cache = this._cachedScopes(mainScope, resetCache);\n    const cached = cache.get(keyLists);\n    if (cached) {\n      return cached;\n    }\n    const scopes = new Set();\n    keyLists.forEach(keys => {\n      if (mainScope) {\n        scopes.add(mainScope);\n        keys.forEach(key => addIfFound(scopes, mainScope, key));\n      }\n      keys.forEach(key => addIfFound(scopes, options, key));\n      keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n      keys.forEach(key => addIfFound(scopes, defaults, key));\n      keys.forEach(key => addIfFound(scopes, descriptors, key));\n    });\n    const array = Array.from(scopes);\n    if (array.length === 0) {\n      array.push(Object.create(null));\n    }\n    if (keysCached.has(keyLists)) {\n      cache.set(keyLists, array);\n    }\n    return array;\n  }\n  chartOptionScopes() {\n    const {options, type} = this;\n    return [\n      options,\n      overrides[type] || {},\n      defaults.datasets[type] || {},\n      {type},\n      defaults,\n      descriptors\n    ];\n  }\n  resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n    const result = {$shared: true};\n    const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n    let options = resolver;\n    if (needContext(resolver, names)) {\n      result.$shared = false;\n      context = isFunction(context) ? context() : context;\n      const subResolver = this.createResolver(scopes, context, subPrefixes);\n      options = _attachContext(resolver, context, subResolver);\n    }\n    for (const prop of names) {\n      result[prop] = options[prop];\n    }\n    return result;\n  }\n  createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n    const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n    return isObject(context)\n      ? _attachContext(resolver, context, undefined, descriptorDefaults)\n      : resolver;\n  }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n  let cache = resolverCache.get(scopes);\n  if (!cache) {\n    cache = new Map();\n    resolverCache.set(scopes, cache);\n  }\n  const cacheKey = prefixes.join();\n  let cached = cache.get(cacheKey);\n  if (!cached) {\n    const resolver = _createResolver(scopes, prefixes);\n    cached = {\n      resolver,\n      subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n    };\n    cache.set(cacheKey, cached);\n  }\n  return cached;\n}\nconst hasFunction = value => isObject(value)\n  && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n  const {isScriptable, isIndexable} = _descriptors(proxy);\n  for (const prop of names) {\n    const scriptable = isScriptable(prop);\n    const indexable = isIndexable(prop);\n    const value = (indexable || scriptable) && proxy[prop];\n    if ((scriptable && (isFunction(value) || hasFunction(value)))\n      || (indexable && isArray(value))) {\n      return true;\n    }\n  }\n  return false;\n}\n\nvar version = \"3.8.0\";\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n  return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\nfunction compare2Level(l1, l2) {\n  return function(a, b) {\n    return a[l1] === b[l1]\n      ? a[l2] - b[l2]\n      : a[l1] - b[l1];\n  };\n}\nfunction onAnimationsComplete(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n  chart.notifyPlugins('afterRender');\n  callback(animationOptions && animationOptions.onComplete, [context], chart);\n}\nfunction onAnimationProgress(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n  callback(animationOptions && animationOptions.onProgress, [context], chart);\n}\nfunction getCanvas(item) {\n  if (_isDomSupported() && typeof item === 'string') {\n    item = document.getElementById(item);\n  } else if (item && item.length) {\n    item = item[0];\n  }\n  if (item && item.canvas) {\n    item = item.canvas;\n  }\n  return item;\n}\nconst instances = {};\nconst getChart = (key) => {\n  const canvas = getCanvas(key);\n  return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n  const keys = Object.keys(obj);\n  for (const key of keys) {\n    const intKey = +key;\n    if (intKey >= start) {\n      const value = obj[key];\n      delete obj[key];\n      if (move > 0 || intKey > start) {\n        obj[intKey + move] = value;\n      }\n    }\n  }\n}\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n  if (!inChartArea || e.type === 'mouseout') {\n    return null;\n  }\n  if (isClick) {\n    return lastEvent;\n  }\n  return e;\n}\nclass Chart {\n  constructor(item, userConfig) {\n    const config = this.config = new Config(userConfig);\n    const initialCanvas = getCanvas(item);\n    const existingChart = getChart(initialCanvas);\n    if (existingChart) {\n      throw new Error(\n        'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas can be reused.'\n      );\n    }\n    const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n    this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n    this.platform.updateConfig(config);\n    const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n    const canvas = context && context.canvas;\n    const height = canvas && canvas.height;\n    const width = canvas && canvas.width;\n    this.id = uid();\n    this.ctx = context;\n    this.canvas = canvas;\n    this.width = width;\n    this.height = height;\n    this._options = options;\n    this._aspectRatio = this.aspectRatio;\n    this._layers = [];\n    this._metasets = [];\n    this._stacks = undefined;\n    this.boxes = [];\n    this.currentDevicePixelRatio = undefined;\n    this.chartArea = undefined;\n    this._active = [];\n    this._lastEvent = undefined;\n    this._listeners = {};\n    this._responsiveListeners = undefined;\n    this._sortedMetasets = [];\n    this.scales = {};\n    this._plugins = new PluginService();\n    this.$proxies = {};\n    this._hiddenIndices = {};\n    this.attached = false;\n    this._animationsDisabled = undefined;\n    this.$context = undefined;\n    this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n    this._dataChanges = [];\n    instances[this.id] = this;\n    if (!context || !canvas) {\n      console.error(\"Failed to create chart: can't acquire context from the given item\");\n      return;\n    }\n    animator.listen(this, 'complete', onAnimationsComplete);\n    animator.listen(this, 'progress', onAnimationProgress);\n    this._initialize();\n    if (this.attached) {\n      this.update();\n    }\n  }\n  get aspectRatio() {\n    const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n    if (!isNullOrUndef(aspectRatio)) {\n      return aspectRatio;\n    }\n    if (maintainAspectRatio && _aspectRatio) {\n      return _aspectRatio;\n    }\n    return height ? width / height : null;\n  }\n  get data() {\n    return this.config.data;\n  }\n  set data(data) {\n    this.config.data = data;\n  }\n  get options() {\n    return this._options;\n  }\n  set options(options) {\n    this.config.options = options;\n  }\n  _initialize() {\n    this.notifyPlugins('beforeInit');\n    if (this.options.responsive) {\n      this.resize();\n    } else {\n      retinaScale(this, this.options.devicePixelRatio);\n    }\n    this.bindEvents();\n    this.notifyPlugins('afterInit');\n    return this;\n  }\n  clear() {\n    clearCanvas(this.canvas, this.ctx);\n    return this;\n  }\n  stop() {\n    animator.stop(this);\n    return this;\n  }\n  resize(width, height) {\n    if (!animator.running(this)) {\n      this._resize(width, height);\n    } else {\n      this._resizeBeforeDraw = {width, height};\n    }\n  }\n  _resize(width, height) {\n    const options = this.options;\n    const canvas = this.canvas;\n    const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n    const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n    const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n    const mode = this.width ? 'resize' : 'attach';\n    this.width = newSize.width;\n    this.height = newSize.height;\n    this._aspectRatio = this.aspectRatio;\n    if (!retinaScale(this, newRatio, true)) {\n      return;\n    }\n    this.notifyPlugins('resize', {size: newSize});\n    callback(options.onResize, [this, newSize], this);\n    if (this.attached) {\n      if (this._doResize(mode)) {\n        this.render();\n      }\n    }\n  }\n  ensureScalesHaveIDs() {\n    const options = this.options;\n    const scalesOptions = options.scales || {};\n    each(scalesOptions, (axisOptions, axisID) => {\n      axisOptions.id = axisID;\n    });\n  }\n  buildOrUpdateScales() {\n    const options = this.options;\n    const scaleOpts = options.scales;\n    const scales = this.scales;\n    const updated = Object.keys(scales).reduce((obj, id) => {\n      obj[id] = false;\n      return obj;\n    }, {});\n    let items = [];\n    if (scaleOpts) {\n      items = items.concat(\n        Object.keys(scaleOpts).map((id) => {\n          const scaleOptions = scaleOpts[id];\n          const axis = determineAxis(id, scaleOptions);\n          const isRadial = axis === 'r';\n          const isHorizontal = axis === 'x';\n          return {\n            options: scaleOptions,\n            dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n            dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n          };\n        })\n      );\n    }\n    each(items, (item) => {\n      const scaleOptions = item.options;\n      const id = scaleOptions.id;\n      const axis = determineAxis(id, scaleOptions);\n      const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n      if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n        scaleOptions.position = item.dposition;\n      }\n      updated[id] = true;\n      let scale = null;\n      if (id in scales && scales[id].type === scaleType) {\n        scale = scales[id];\n      } else {\n        const scaleClass = registry.getScale(scaleType);\n        scale = new scaleClass({\n          id,\n          type: scaleType,\n          ctx: this.ctx,\n          chart: this\n        });\n        scales[scale.id] = scale;\n      }\n      scale.init(scaleOptions, options);\n    });\n    each(updated, (hasUpdated, id) => {\n      if (!hasUpdated) {\n        delete scales[id];\n      }\n    });\n    each(scales, (scale) => {\n      layouts.configure(this, scale, scale.options);\n      layouts.addBox(this, scale);\n    });\n  }\n  _updateMetasets() {\n    const metasets = this._metasets;\n    const numData = this.data.datasets.length;\n    const numMeta = metasets.length;\n    metasets.sort((a, b) => a.index - b.index);\n    if (numMeta > numData) {\n      for (let i = numData; i < numMeta; ++i) {\n        this._destroyDatasetMeta(i);\n      }\n      metasets.splice(numData, numMeta - numData);\n    }\n    this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n  }\n  _removeUnreferencedMetasets() {\n    const {_metasets: metasets, data: {datasets}} = this;\n    if (metasets.length > datasets.length) {\n      delete this._stacks;\n    }\n    metasets.forEach((meta, index) => {\n      if (datasets.filter(x => x === meta._dataset).length === 0) {\n        this._destroyDatasetMeta(index);\n      }\n    });\n  }\n  buildOrUpdateControllers() {\n    const newControllers = [];\n    const datasets = this.data.datasets;\n    let i, ilen;\n    this._removeUnreferencedMetasets();\n    for (i = 0, ilen = datasets.length; i < ilen; i++) {\n      const dataset = datasets[i];\n      let meta = this.getDatasetMeta(i);\n      const type = dataset.type || this.config.type;\n      if (meta.type && meta.type !== type) {\n        this._destroyDatasetMeta(i);\n        meta = this.getDatasetMeta(i);\n      }\n      meta.type = type;\n      meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n      meta.order = dataset.order || 0;\n      meta.index = i;\n      meta.label = '' + dataset.label;\n      meta.visible = this.isDatasetVisible(i);\n      if (meta.controller) {\n        meta.controller.updateIndex(i);\n        meta.controller.linkScales();\n      } else {\n        const ControllerClass = registry.getController(type);\n        const {datasetElementType, dataElementType} = defaults.datasets[type];\n        Object.assign(ControllerClass.prototype, {\n          dataElementType: registry.getElement(dataElementType),\n          datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n        });\n        meta.controller = new ControllerClass(this, i);\n        newControllers.push(meta.controller);\n      }\n    }\n    this._updateMetasets();\n    return newControllers;\n  }\n  _resetElements() {\n    each(this.data.datasets, (dataset, datasetIndex) => {\n      this.getDatasetMeta(datasetIndex).controller.reset();\n    }, this);\n  }\n  reset() {\n    this._resetElements();\n    this.notifyPlugins('reset');\n  }\n  update(mode) {\n    const config = this.config;\n    config.update();\n    const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n    const animsDisabled = this._animationsDisabled = !options.animation;\n    this._updateScales();\n    this._checkEventBindings();\n    this._updateHiddenIndices();\n    this._plugins.invalidate();\n    if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n      return;\n    }\n    const newControllers = this.buildOrUpdateControllers();\n    this.notifyPlugins('beforeElementsUpdate');\n    let minPadding = 0;\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n      const {controller} = this.getDatasetMeta(i);\n      const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n      controller.buildOrUpdateElements(reset);\n      minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n    }\n    minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n    this._updateLayout(minPadding);\n    if (!animsDisabled) {\n      each(newControllers, (controller) => {\n        controller.reset();\n      });\n    }\n    this._updateDatasets(mode);\n    this.notifyPlugins('afterUpdate', {mode});\n    this._layers.sort(compare2Level('z', '_idx'));\n    const {_active, _lastEvent} = this;\n    if (_lastEvent) {\n      this._eventHandler(_lastEvent, true);\n    } else if (_active.length) {\n      this._updateHoverStyles(_active, _active, true);\n    }\n    this.render();\n  }\n  _updateScales() {\n    each(this.scales, (scale) => {\n      layouts.removeBox(this, scale);\n    });\n    this.ensureScalesHaveIDs();\n    this.buildOrUpdateScales();\n  }\n  _checkEventBindings() {\n    const options = this.options;\n    const existingEvents = new Set(Object.keys(this._listeners));\n    const newEvents = new Set(options.events);\n    if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n      this.unbindEvents();\n      this.bindEvents();\n    }\n  }\n  _updateHiddenIndices() {\n    const {_hiddenIndices} = this;\n    const changes = this._getUniformDataChanges() || [];\n    for (const {method, start, count} of changes) {\n      const move = method === '_removeElements' ? -count : count;\n      moveNumericKeys(_hiddenIndices, start, move);\n    }\n  }\n  _getUniformDataChanges() {\n    const _dataChanges = this._dataChanges;\n    if (!_dataChanges || !_dataChanges.length) {\n      return;\n    }\n    this._dataChanges = [];\n    const datasetCount = this.data.datasets.length;\n    const makeSet = (idx) => new Set(\n      _dataChanges\n        .filter(c => c[0] === idx)\n        .map((c, i) => i + ',' + c.splice(1).join(','))\n    );\n    const changeSet = makeSet(0);\n    for (let i = 1; i < datasetCount; i++) {\n      if (!setsEqual(changeSet, makeSet(i))) {\n        return;\n      }\n    }\n    return Array.from(changeSet)\n      .map(c => c.split(','))\n      .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n  }\n  _updateLayout(minPadding) {\n    if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n      return;\n    }\n    layouts.update(this, this.width, this.height, minPadding);\n    const area = this.chartArea;\n    const noArea = area.width <= 0 || area.height <= 0;\n    this._layers = [];\n    each(this.boxes, (box) => {\n      if (noArea && box.position === 'chartArea') {\n        return;\n      }\n      if (box.configure) {\n        box.configure();\n      }\n      this._layers.push(...box._layers());\n    }, this);\n    this._layers.forEach((item, index) => {\n      item._idx = index;\n    });\n    this.notifyPlugins('afterLayout');\n  }\n  _updateDatasets(mode) {\n    if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n      return;\n    }\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this.getDatasetMeta(i).controller.configure();\n    }\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n    }\n    this.notifyPlugins('afterDatasetsUpdate', {mode});\n  }\n  _updateDataset(index, mode) {\n    const meta = this.getDatasetMeta(index);\n    const args = {meta, index, mode, cancelable: true};\n    if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n      return;\n    }\n    meta.controller._update(mode);\n    args.cancelable = false;\n    this.notifyPlugins('afterDatasetUpdate', args);\n  }\n  render() {\n    if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n      return;\n    }\n    if (animator.has(this)) {\n      if (this.attached && !animator.running(this)) {\n        animator.start(this);\n      }\n    } else {\n      this.draw();\n      onAnimationsComplete({chart: this});\n    }\n  }\n  draw() {\n    let i;\n    if (this._resizeBeforeDraw) {\n      const {width, height} = this._resizeBeforeDraw;\n      this._resize(width, height);\n      this._resizeBeforeDraw = null;\n    }\n    this.clear();\n    if (this.width <= 0 || this.height <= 0) {\n      return;\n    }\n    if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n      return;\n    }\n    const layers = this._layers;\n    for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n    this._drawDatasets();\n    for (; i < layers.length; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n    this.notifyPlugins('afterDraw');\n  }\n  _getSortedDatasetMetas(filterVisible) {\n    const metasets = this._sortedMetasets;\n    const result = [];\n    let i, ilen;\n    for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n      const meta = metasets[i];\n      if (!filterVisible || meta.visible) {\n        result.push(meta);\n      }\n    }\n    return result;\n  }\n  getSortedVisibleDatasetMetas() {\n    return this._getSortedDatasetMetas(true);\n  }\n  _drawDatasets() {\n    if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n      return;\n    }\n    const metasets = this.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      this._drawDataset(metasets[i]);\n    }\n    this.notifyPlugins('afterDatasetsDraw');\n  }\n  _drawDataset(meta) {\n    const ctx = this.ctx;\n    const clip = meta._clip;\n    const useClip = !clip.disabled;\n    const area = this.chartArea;\n    const args = {\n      meta,\n      index: meta.index,\n      cancelable: true\n    };\n    if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n      return;\n    }\n    if (useClip) {\n      clipArea(ctx, {\n        left: clip.left === false ? 0 : area.left - clip.left,\n        right: clip.right === false ? this.width : area.right + clip.right,\n        top: clip.top === false ? 0 : area.top - clip.top,\n        bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n      });\n    }\n    meta.controller.draw();\n    if (useClip) {\n      unclipArea(ctx);\n    }\n    args.cancelable = false;\n    this.notifyPlugins('afterDatasetDraw', args);\n  }\n  isPointInArea(point) {\n    return _isPointInArea(point, this.chartArea, this._minPadding);\n  }\n  getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n    const method = Interaction.modes[mode];\n    if (typeof method === 'function') {\n      return method(this, e, options, useFinalPosition);\n    }\n    return [];\n  }\n  getDatasetMeta(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    const metasets = this._metasets;\n    let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n    if (!meta) {\n      meta = {\n        type: null,\n        data: [],\n        dataset: null,\n        controller: null,\n        hidden: null,\n        xAxisID: null,\n        yAxisID: null,\n        order: dataset && dataset.order || 0,\n        index: datasetIndex,\n        _dataset: dataset,\n        _parsed: [],\n        _sorted: false\n      };\n      metasets.push(meta);\n    }\n    return meta;\n  }\n  getContext() {\n    return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n  }\n  getVisibleDatasetCount() {\n    return this.getSortedVisibleDatasetMetas().length;\n  }\n  isDatasetVisible(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    if (!dataset) {\n      return false;\n    }\n    const meta = this.getDatasetMeta(datasetIndex);\n    return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n  }\n  setDatasetVisibility(datasetIndex, visible) {\n    const meta = this.getDatasetMeta(datasetIndex);\n    meta.hidden = !visible;\n  }\n  toggleDataVisibility(index) {\n    this._hiddenIndices[index] = !this._hiddenIndices[index];\n  }\n  getDataVisibility(index) {\n    return !this._hiddenIndices[index];\n  }\n  _updateVisibility(datasetIndex, dataIndex, visible) {\n    const mode = visible ? 'show' : 'hide';\n    const meta = this.getDatasetMeta(datasetIndex);\n    const anims = meta.controller._resolveAnimations(undefined, mode);\n    if (defined(dataIndex)) {\n      meta.data[dataIndex].hidden = !visible;\n      this.update();\n    } else {\n      this.setDatasetVisibility(datasetIndex, visible);\n      anims.update(meta, {visible});\n      this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n    }\n  }\n  hide(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, false);\n  }\n  show(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, true);\n  }\n  _destroyDatasetMeta(datasetIndex) {\n    const meta = this._metasets[datasetIndex];\n    if (meta && meta.controller) {\n      meta.controller._destroy();\n    }\n    delete this._metasets[datasetIndex];\n  }\n  _stop() {\n    let i, ilen;\n    this.stop();\n    animator.remove(this);\n    for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._destroyDatasetMeta(i);\n    }\n  }\n  destroy() {\n    this.notifyPlugins('beforeDestroy');\n    const {canvas, ctx} = this;\n    this._stop();\n    this.config.clearCache();\n    if (canvas) {\n      this.unbindEvents();\n      clearCanvas(canvas, ctx);\n      this.platform.releaseContext(ctx);\n      this.canvas = null;\n      this.ctx = null;\n    }\n    this.notifyPlugins('destroy');\n    delete instances[this.id];\n    this.notifyPlugins('afterDestroy');\n  }\n  toBase64Image(...args) {\n    return this.canvas.toDataURL(...args);\n  }\n  bindEvents() {\n    this.bindUserEvents();\n    if (this.options.responsive) {\n      this.bindResponsiveEvents();\n    } else {\n      this.attached = true;\n    }\n  }\n  bindUserEvents() {\n    const listeners = this._listeners;\n    const platform = this.platform;\n    const _add = (type, listener) => {\n      platform.addEventListener(this, type, listener);\n      listeners[type] = listener;\n    };\n    const listener = (e, x, y) => {\n      e.offsetX = x;\n      e.offsetY = y;\n      this._eventHandler(e);\n    };\n    each(this.options.events, (type) => _add(type, listener));\n  }\n  bindResponsiveEvents() {\n    if (!this._responsiveListeners) {\n      this._responsiveListeners = {};\n    }\n    const listeners = this._responsiveListeners;\n    const platform = this.platform;\n    const _add = (type, listener) => {\n      platform.addEventListener(this, type, listener);\n      listeners[type] = listener;\n    };\n    const _remove = (type, listener) => {\n      if (listeners[type]) {\n        platform.removeEventListener(this, type, listener);\n        delete listeners[type];\n      }\n    };\n    const listener = (width, height) => {\n      if (this.canvas) {\n        this.resize(width, height);\n      }\n    };\n    let detached;\n    const attached = () => {\n      _remove('attach', attached);\n      this.attached = true;\n      this.resize();\n      _add('resize', listener);\n      _add('detach', detached);\n    };\n    detached = () => {\n      this.attached = false;\n      _remove('resize', listener);\n      this._stop();\n      this._resize(0, 0);\n      _add('attach', attached);\n    };\n    if (platform.isAttached(this.canvas)) {\n      attached();\n    } else {\n      detached();\n    }\n  }\n  unbindEvents() {\n    each(this._listeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._listeners = {};\n    each(this._responsiveListeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._responsiveListeners = undefined;\n  }\n  updateHoverStyle(items, mode, enabled) {\n    const prefix = enabled ? 'set' : 'remove';\n    let meta, item, i, ilen;\n    if (mode === 'dataset') {\n      meta = this.getDatasetMeta(items[0].datasetIndex);\n      meta.controller['_' + prefix + 'DatasetHoverStyle']();\n    }\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      item = items[i];\n      const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n      if (controller) {\n        controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n      }\n    }\n  }\n  getActiveElements() {\n    return this._active || [];\n  }\n  setActiveElements(activeElements) {\n    const lastActive = this._active || [];\n    const active = activeElements.map(({datasetIndex, index}) => {\n      const meta = this.getDatasetMeta(datasetIndex);\n      if (!meta) {\n        throw new Error('No dataset found at index ' + datasetIndex);\n      }\n      return {\n        datasetIndex,\n        element: meta.data[index],\n        index,\n      };\n    });\n    const changed = !_elementsEqual(active, lastActive);\n    if (changed) {\n      this._active = active;\n      this._lastEvent = null;\n      this._updateHoverStyles(active, lastActive);\n    }\n  }\n  notifyPlugins(hook, args, filter) {\n    return this._plugins.notify(this, hook, args, filter);\n  }\n  _updateHoverStyles(active, lastActive, replay) {\n    const hoverOptions = this.options.hover;\n    const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n    const deactivated = diff(lastActive, active);\n    const activated = replay ? active : diff(active, lastActive);\n    if (deactivated.length) {\n      this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n    }\n    if (activated.length && hoverOptions.mode) {\n      this.updateHoverStyle(activated, hoverOptions.mode, true);\n    }\n  }\n  _eventHandler(e, replay) {\n    const args = {\n      event: e,\n      replay,\n      cancelable: true,\n      inChartArea: this.isPointInArea(e)\n    };\n    const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n    if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n      return;\n    }\n    const changed = this._handleEvent(e, replay, args.inChartArea);\n    args.cancelable = false;\n    this.notifyPlugins('afterEvent', args, eventFilter);\n    if (changed || args.changed) {\n      this.render();\n    }\n    return this;\n  }\n  _handleEvent(e, replay, inChartArea) {\n    const {_active: lastActive = [], options} = this;\n    const useFinalPosition = replay;\n    const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n    const isClick = _isClickEvent(e);\n    const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n    if (inChartArea) {\n      this._lastEvent = null;\n      callback(options.onHover, [e, active, this], this);\n      if (isClick) {\n        callback(options.onClick, [e, active, this], this);\n      }\n    }\n    const changed = !_elementsEqual(active, lastActive);\n    if (changed || replay) {\n      this._active = active;\n      this._updateHoverStyles(active, lastActive, replay);\n    }\n    this._lastEvent = lastEvent;\n    return changed;\n  }\n  _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n    if (e.type === 'mouseout') {\n      return [];\n    }\n    if (!inChartArea) {\n      return lastActive;\n    }\n    const hoverOptions = this.options.hover;\n    return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n  }\n}\nconst invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate());\nconst enumerable = true;\nObject.defineProperties(Chart, {\n  defaults: {\n    enumerable,\n    value: defaults\n  },\n  instances: {\n    enumerable,\n    value: instances\n  },\n  overrides: {\n    enumerable,\n    value: overrides\n  },\n  registry: {\n    enumerable,\n    value: registry\n  },\n  version: {\n    enumerable,\n    value: version\n  },\n  getChart: {\n    enumerable,\n    value: getChart\n  },\n  register: {\n    enumerable,\n    value: (...items) => {\n      registry.add(...items);\n      invalidatePlugins();\n    }\n  },\n  unregister: {\n    enumerable,\n    value: (...items) => {\n      registry.remove(...items);\n      invalidatePlugins();\n    }\n  }\n});\n\nfunction clipArc(ctx, element, endAngle) {\n  const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n  let angleMargin = pixelMargin / outerRadius;\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n  if (innerRadius > pixelMargin) {\n    angleMargin = pixelMargin / innerRadius;\n    ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n  } else {\n    ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n  }\n  ctx.closePath();\n  ctx.clip();\n}\nfunction toRadiusCorners(value) {\n  return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\nfunction parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n  const o = toRadiusCorners(arc.options.borderRadius);\n  const halfThickness = (outerRadius - innerRadius) / 2;\n  const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n  const computeOuterLimit = (val) => {\n    const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n    return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n  };\n  return {\n    outerStart: computeOuterLimit(o.outerStart),\n    outerEnd: computeOuterLimit(o.outerEnd),\n    innerStart: _limitValue(o.innerStart, 0, innerLimit),\n    innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n  };\n}\nfunction rThetaToXY(r, theta, x, y) {\n  return {\n    x: x + r * Math.cos(theta),\n    y: y + r * Math.sin(theta),\n  };\n}\nfunction pathArc(ctx, element, offset, spacing, end) {\n  const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n  const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n  const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n  let spacingOffset = 0;\n  const alpha = end - start;\n  if (spacing) {\n    const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n    const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n    const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n    const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n    spacingOffset = (alpha - adjustedAngle) / 2;\n  }\n  const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n  const angleOffset = (alpha - beta) / 2;\n  const startAngle = start + angleOffset + spacingOffset;\n  const endAngle = end - angleOffset - spacingOffset;\n  const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n  const outerStartAdjustedRadius = outerRadius - outerStart;\n  const outerEndAdjustedRadius = outerRadius - outerEnd;\n  const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n  const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n  const innerStartAdjustedRadius = innerRadius + innerStart;\n  const innerEndAdjustedRadius = innerRadius + innerEnd;\n  const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n  const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerEndAdjustedAngle);\n  if (outerEnd > 0) {\n    const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n    ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n  }\n  const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n  ctx.lineTo(p4.x, p4.y);\n  if (innerEnd > 0) {\n    const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n    ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n  }\n  ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), startAngle + (innerStart / innerRadius), true);\n  if (innerStart > 0) {\n    const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n    ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n  }\n  const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n  ctx.lineTo(p8.x, p8.y);\n  if (outerStart > 0) {\n    const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n    ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n  }\n  ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing) {\n  const {fullCircles, startAngle, circumference} = element;\n  let endAngle = element.endAngle;\n  if (fullCircles) {\n    pathArc(ctx, element, offset, spacing, startAngle + TAU);\n    for (let i = 0; i < fullCircles; ++i) {\n      ctx.fill();\n    }\n    if (!isNaN(circumference)) {\n      endAngle = startAngle + circumference % TAU;\n      if (circumference % TAU === 0) {\n        endAngle += TAU;\n      }\n    }\n  }\n  pathArc(ctx, element, offset, spacing, endAngle);\n  ctx.fill();\n  return endAngle;\n}\nfunction drawFullCircleBorders(ctx, element, inner) {\n  const {x, y, startAngle, pixelMargin, fullCircles} = element;\n  const outerRadius = Math.max(element.outerRadius - pixelMargin, 0);\n  const innerRadius = element.innerRadius + pixelMargin;\n  let i;\n  if (inner) {\n    clipArc(ctx, element, startAngle + TAU);\n  }\n  ctx.beginPath();\n  ctx.arc(x, y, innerRadius, startAngle + TAU, startAngle, true);\n  for (i = 0; i < fullCircles; ++i) {\n    ctx.stroke();\n  }\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius, startAngle, startAngle + TAU);\n  for (i = 0; i < fullCircles; ++i) {\n    ctx.stroke();\n  }\n}\nfunction drawBorder(ctx, element, offset, spacing, endAngle) {\n  const {options} = element;\n  const {borderWidth, borderJoinStyle} = options;\n  const inner = options.borderAlign === 'inner';\n  if (!borderWidth) {\n    return;\n  }\n  if (inner) {\n    ctx.lineWidth = borderWidth * 2;\n    ctx.lineJoin = borderJoinStyle || 'round';\n  } else {\n    ctx.lineWidth = borderWidth;\n    ctx.lineJoin = borderJoinStyle || 'bevel';\n  }\n  if (element.fullCircles) {\n    drawFullCircleBorders(ctx, element, inner);\n  }\n  if (inner) {\n    clipArc(ctx, element, endAngle);\n  }\n  pathArc(ctx, element, offset, spacing, endAngle);\n  ctx.stroke();\n}\nclass ArcElement extends Element {\n  constructor(cfg) {\n    super();\n    this.options = undefined;\n    this.circumference = undefined;\n    this.startAngle = undefined;\n    this.endAngle = undefined;\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n    this.pixelMargin = 0;\n    this.fullCircles = 0;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  inRange(chartX, chartY, useFinalPosition) {\n    const point = this.getProps(['x', 'y'], useFinalPosition);\n    const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n    const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n      'startAngle',\n      'endAngle',\n      'innerRadius',\n      'outerRadius',\n      'circumference'\n    ], useFinalPosition);\n    const rAdjust = this.options.spacing / 2;\n    const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n    const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n    const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n    return (betweenAngles && withinRadius);\n  }\n  getCenterPoint(useFinalPosition) {\n    const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n      'x',\n      'y',\n      'startAngle',\n      'endAngle',\n      'innerRadius',\n      'outerRadius',\n      'circumference',\n    ], useFinalPosition);\n    const {offset, spacing} = this.options;\n    const halfAngle = (startAngle + endAngle) / 2;\n    const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n    return {\n      x: x + Math.cos(halfAngle) * halfRadius,\n      y: y + Math.sin(halfAngle) * halfRadius\n    };\n  }\n  tooltipPosition(useFinalPosition) {\n    return this.getCenterPoint(useFinalPosition);\n  }\n  draw(ctx) {\n    const {options, circumference} = this;\n    const offset = (options.offset || 0) / 2;\n    const spacing = (options.spacing || 0) / 2;\n    this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n    this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n    if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n      return;\n    }\n    ctx.save();\n    let radiusOffset = 0;\n    if (offset) {\n      radiusOffset = offset / 2;\n      const halfAngle = (this.startAngle + this.endAngle) / 2;\n      ctx.translate(Math.cos(halfAngle) * radiusOffset, Math.sin(halfAngle) * radiusOffset);\n      if (this.circumference >= PI) {\n        radiusOffset = offset;\n      }\n    }\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n    const endAngle = drawArc(ctx, this, radiusOffset, spacing);\n    drawBorder(ctx, this, radiusOffset, spacing, endAngle);\n    ctx.restore();\n  }\n}\nArcElement.id = 'arc';\nArcElement.defaults = {\n  borderAlign: 'center',\n  borderColor: '#fff',\n  borderJoinStyle: undefined,\n  borderRadius: 0,\n  borderWidth: 2,\n  offset: 0,\n  spacing: 0,\n  angle: undefined,\n};\nArcElement.defaultRoutes = {\n  backgroundColor: 'backgroundColor'\n};\n\nfunction setStyle(ctx, options, style = options) {\n  ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n  ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n  ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n  ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n  ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n  ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n  ctx.lineTo(target.x, target.y);\n}\nfunction getLineMethod(options) {\n  if (options.stepped) {\n    return _steppedLineTo;\n  }\n  if (options.tension || options.cubicInterpolationMode === 'monotone') {\n    return _bezierCurveTo;\n  }\n  return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n  const count = points.length;\n  const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n  const {start: segmentStart, end: segmentEnd} = segment;\n  const start = Math.max(paramsStart, segmentStart);\n  const end = Math.min(paramsEnd, segmentEnd);\n  const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n  return {\n    count,\n    start,\n    loop: segment.loop,\n    ilen: end < start && !outside ? count + end - start : end - start\n  };\n}\nfunction pathSegment(ctx, line, segment, params) {\n  const {points, options} = line;\n  const {count, start, loop, ilen} = pathVars(points, segment, params);\n  const lineMethod = getLineMethod(options);\n  let {move = true, reverse} = params || {};\n  let i, point, prev;\n  for (i = 0; i <= ilen; ++i) {\n    point = points[(start + (reverse ? ilen - i : i)) % count];\n    if (point.skip) {\n      continue;\n    } else if (move) {\n      ctx.moveTo(point.x, point.y);\n      move = false;\n    } else {\n      lineMethod(ctx, prev, point, reverse, options.stepped);\n    }\n    prev = point;\n  }\n  if (loop) {\n    point = points[(start + (reverse ? ilen : 0)) % count];\n    lineMethod(ctx, prev, point, reverse, options.stepped);\n  }\n  return !!loop;\n}\nfunction fastPathSegment(ctx, line, segment, params) {\n  const points = line.points;\n  const {count, start, ilen} = pathVars(points, segment, params);\n  const {move = true, reverse} = params || {};\n  let avgX = 0;\n  let countX = 0;\n  let i, point, prevX, minY, maxY, lastY;\n  const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n  const drawX = () => {\n    if (minY !== maxY) {\n      ctx.lineTo(avgX, maxY);\n      ctx.lineTo(avgX, minY);\n      ctx.lineTo(avgX, lastY);\n    }\n  };\n  if (move) {\n    point = points[pointIndex(0)];\n    ctx.moveTo(point.x, point.y);\n  }\n  for (i = 0; i <= ilen; ++i) {\n    point = points[pointIndex(i)];\n    if (point.skip) {\n      continue;\n    }\n    const x = point.x;\n    const y = point.y;\n    const truncX = x | 0;\n    if (truncX === prevX) {\n      if (y < minY) {\n        minY = y;\n      } else if (y > maxY) {\n        maxY = y;\n      }\n      avgX = (countX * avgX + x) / ++countX;\n    } else {\n      drawX();\n      ctx.lineTo(x, y);\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n    }\n    lastY = y;\n  }\n  drawX();\n}\nfunction _getSegmentMethod(line) {\n  const opts = line.options;\n  const borderDash = opts.borderDash && opts.borderDash.length;\n  const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n  return useFastPath ? fastPathSegment : pathSegment;\n}\nfunction _getInterpolationMethod(options) {\n  if (options.stepped) {\n    return _steppedInterpolation;\n  }\n  if (options.tension || options.cubicInterpolationMode === 'monotone') {\n    return _bezierInterpolation;\n  }\n  return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n  let path = line._path;\n  if (!path) {\n    path = line._path = new Path2D();\n    if (line.path(path, start, count)) {\n      path.closePath();\n    }\n  }\n  setStyle(ctx, line.options);\n  ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n  const {segments, options} = line;\n  const segmentMethod = _getSegmentMethod(line);\n  for (const segment of segments) {\n    setStyle(ctx, options, segment.style);\n    ctx.beginPath();\n    if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n      ctx.closePath();\n    }\n    ctx.stroke();\n  }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n  if (usePath2D && !line.options.segment) {\n    strokePathWithCache(ctx, line, start, count);\n  } else {\n    strokePathDirect(ctx, line, start, count);\n  }\n}\nclass LineElement extends Element {\n  constructor(cfg) {\n    super();\n    this.animated = true;\n    this.options = undefined;\n    this._chart = undefined;\n    this._loop = undefined;\n    this._fullLoop = undefined;\n    this._path = undefined;\n    this._points = undefined;\n    this._segments = undefined;\n    this._decimated = false;\n    this._pointsUpdated = false;\n    this._datasetIndex = undefined;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  updateControlPoints(chartArea, indexAxis) {\n    const options = this.options;\n    if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n      const loop = options.spanGaps ? this._loop : this._fullLoop;\n      _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n      this._pointsUpdated = true;\n    }\n  }\n  set points(points) {\n    this._points = points;\n    delete this._segments;\n    delete this._path;\n    this._pointsUpdated = false;\n  }\n  get points() {\n    return this._points;\n  }\n  get segments() {\n    return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n  }\n  first() {\n    const segments = this.segments;\n    const points = this.points;\n    return segments.length && points[segments[0].start];\n  }\n  last() {\n    const segments = this.segments;\n    const points = this.points;\n    const count = segments.length;\n    return count && points[segments[count - 1].end];\n  }\n  interpolate(point, property) {\n    const options = this.options;\n    const value = point[property];\n    const points = this.points;\n    const segments = _boundSegments(this, {property, start: value, end: value});\n    if (!segments.length) {\n      return;\n    }\n    const result = [];\n    const _interpolate = _getInterpolationMethod(options);\n    let i, ilen;\n    for (i = 0, ilen = segments.length; i < ilen; ++i) {\n      const {start, end} = segments[i];\n      const p1 = points[start];\n      const p2 = points[end];\n      if (p1 === p2) {\n        result.push(p1);\n        continue;\n      }\n      const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n      const interpolated = _interpolate(p1, p2, t, options.stepped);\n      interpolated[property] = point[property];\n      result.push(interpolated);\n    }\n    return result.length === 1 ? result[0] : result;\n  }\n  pathSegment(ctx, segment, params) {\n    const segmentMethod = _getSegmentMethod(this);\n    return segmentMethod(ctx, this, segment, params);\n  }\n  path(ctx, start, count) {\n    const segments = this.segments;\n    const segmentMethod = _getSegmentMethod(this);\n    let loop = this._loop;\n    start = start || 0;\n    count = count || (this.points.length - start);\n    for (const segment of segments) {\n      loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n    }\n    return !!loop;\n  }\n  draw(ctx, chartArea, start, count) {\n    const options = this.options || {};\n    const points = this.points || [];\n    if (points.length && options.borderWidth) {\n      ctx.save();\n      draw(ctx, this, start, count);\n      ctx.restore();\n    }\n    if (this.animated) {\n      this._pointsUpdated = false;\n      this._path = undefined;\n    }\n  }\n}\nLineElement.id = 'line';\nLineElement.defaults = {\n  borderCapStyle: 'butt',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: 'miter',\n  borderWidth: 3,\n  capBezierPoints: true,\n  cubicInterpolationMode: 'default',\n  fill: false,\n  spanGaps: false,\n  stepped: false,\n  tension: 0,\n};\nLineElement.defaultRoutes = {\n  backgroundColor: 'backgroundColor',\n  borderColor: 'borderColor'\n};\nLineElement.descriptors = {\n  _scriptable: true,\n  _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n};\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n  const options = el.options;\n  const {[axis]: value} = el.getProps([axis], useFinalPosition);\n  return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\nclass PointElement extends Element {\n  constructor(cfg) {\n    super();\n    this.options = undefined;\n    this.parsed = undefined;\n    this.skip = undefined;\n    this.stop = undefined;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  inRange(mouseX, mouseY, useFinalPosition) {\n    const options = this.options;\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n  }\n  inXRange(mouseX, useFinalPosition) {\n    return inRange$1(this, mouseX, 'x', useFinalPosition);\n  }\n  inYRange(mouseY, useFinalPosition) {\n    return inRange$1(this, mouseY, 'y', useFinalPosition);\n  }\n  getCenterPoint(useFinalPosition) {\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return {x, y};\n  }\n  size(options) {\n    options = options || this.options || {};\n    let radius = options.radius || 0;\n    radius = Math.max(radius, radius && options.hoverRadius || 0);\n    const borderWidth = radius && options.borderWidth || 0;\n    return (radius + borderWidth) * 2;\n  }\n  draw(ctx, area) {\n    const options = this.options;\n    if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n      return;\n    }\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n    ctx.fillStyle = options.backgroundColor;\n    drawPoint(ctx, options, this.x, this.y);\n  }\n  getRange() {\n    const options = this.options || {};\n    return options.radius + options.hitRadius;\n  }\n}\nPointElement.id = 'point';\nPointElement.defaults = {\n  borderWidth: 1,\n  hitRadius: 1,\n  hoverBorderWidth: 1,\n  hoverRadius: 4,\n  pointStyle: 'circle',\n  radius: 3,\n  rotation: 0\n};\nPointElement.defaultRoutes = {\n  backgroundColor: 'backgroundColor',\n  borderColor: 'borderColor'\n};\n\nfunction getBarBounds(bar, useFinalPosition) {\n  const {x, y, base, width, height} = bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition);\n  let left, right, top, bottom, half;\n  if (bar.horizontal) {\n    half = height / 2;\n    left = Math.min(x, base);\n    right = Math.max(x, base);\n    top = y - half;\n    bottom = y + half;\n  } else {\n    half = width / 2;\n    left = x - half;\n    right = x + half;\n    top = Math.min(y, base);\n    bottom = Math.max(y, base);\n  }\n  return {left, top, right, bottom};\n}\nfunction skipOrLimit(skip, value, min, max) {\n  return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n  const value = bar.options.borderWidth;\n  const skip = bar.borderSkipped;\n  const o = toTRBL(value);\n  return {\n    t: skipOrLimit(skip.top, o.top, 0, maxH),\n    r: skipOrLimit(skip.right, o.right, 0, maxW),\n    b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n    l: skipOrLimit(skip.left, o.left, 0, maxW)\n  };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n  const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n  const value = bar.options.borderRadius;\n  const o = toTRBLCorners(value);\n  const maxR = Math.min(maxW, maxH);\n  const skip = bar.borderSkipped;\n  const enableBorder = enableBorderRadius || isObject(value);\n  return {\n    topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n    topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n    bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n    bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n  };\n}\nfunction boundingRects(bar) {\n  const bounds = getBarBounds(bar);\n  const width = bounds.right - bounds.left;\n  const height = bounds.bottom - bounds.top;\n  const border = parseBorderWidth(bar, width / 2, height / 2);\n  const radius = parseBorderRadius(bar, width / 2, height / 2);\n  return {\n    outer: {\n      x: bounds.left,\n      y: bounds.top,\n      w: width,\n      h: height,\n      radius\n    },\n    inner: {\n      x: bounds.left + border.l,\n      y: bounds.top + border.t,\n      w: width - border.l - border.r,\n      h: height - border.t - border.b,\n      radius: {\n        topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n        topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n        bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n        bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n      }\n    }\n  };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n  const skipX = x === null;\n  const skipY = y === null;\n  const skipBoth = skipX && skipY;\n  const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n  return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n  return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction addNormalRectPath(ctx, rect) {\n  ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n  const x = rect.x !== refRect.x ? -amount : 0;\n  const y = rect.y !== refRect.y ? -amount : 0;\n  const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n  const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n  return {\n    x: rect.x + x,\n    y: rect.y + y,\n    w: rect.w + w,\n    h: rect.h + h,\n    radius: rect.radius\n  };\n}\nclass BarElement extends Element {\n  constructor(cfg) {\n    super();\n    this.options = undefined;\n    this.horizontal = undefined;\n    this.base = undefined;\n    this.width = undefined;\n    this.height = undefined;\n    this.inflateAmount = undefined;\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n  draw(ctx) {\n    const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n    const {inner, outer} = boundingRects(this);\n    const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n    ctx.save();\n    if (outer.w !== inner.w || outer.h !== inner.h) {\n      ctx.beginPath();\n      addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n      ctx.clip();\n      addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n      ctx.fillStyle = borderColor;\n      ctx.fill('evenodd');\n    }\n    ctx.beginPath();\n    addRectPath(ctx, inflateRect(inner, inflateAmount));\n    ctx.fillStyle = backgroundColor;\n    ctx.fill();\n    ctx.restore();\n  }\n  inRange(mouseX, mouseY, useFinalPosition) {\n    return inRange(this, mouseX, mouseY, useFinalPosition);\n  }\n  inXRange(mouseX, useFinalPosition) {\n    return inRange(this, mouseX, null, useFinalPosition);\n  }\n  inYRange(mouseY, useFinalPosition) {\n    return inRange(this, null, mouseY, useFinalPosition);\n  }\n  getCenterPoint(useFinalPosition) {\n    const {x, y, base, horizontal} = this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition);\n    return {\n      x: horizontal ? (x + base) / 2 : x,\n      y: horizontal ? y : (y + base) / 2\n    };\n  }\n  getRange(axis) {\n    return axis === 'x' ? this.width / 2 : this.height / 2;\n  }\n}\nBarElement.id = 'bar';\nBarElement.defaults = {\n  borderSkipped: 'start',\n  borderWidth: 0,\n  borderRadius: 0,\n  inflateAmount: 'auto',\n  pointStyle: undefined\n};\nBarElement.defaultRoutes = {\n  backgroundColor: 'backgroundColor',\n  borderColor: 'borderColor'\n};\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nLineElement: LineElement,\nPointElement: PointElement,\nBarElement: BarElement\n});\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n  const samples = options.samples || availableWidth;\n  if (samples >= count) {\n    return data.slice(start, start + count);\n  }\n  const decimated = [];\n  const bucketWidth = (count - 2) / (samples - 2);\n  let sampledIndex = 0;\n  const endIndex = start + count - 1;\n  let a = start;\n  let i, maxAreaPoint, maxArea, area, nextA;\n  decimated[sampledIndex++] = data[a];\n  for (i = 0; i < samples - 2; i++) {\n    let avgX = 0;\n    let avgY = 0;\n    let j;\n    const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n    const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n    const avgRangeLength = avgRangeEnd - avgRangeStart;\n    for (j = avgRangeStart; j < avgRangeEnd; j++) {\n      avgX += data[j].x;\n      avgY += data[j].y;\n    }\n    avgX /= avgRangeLength;\n    avgY /= avgRangeLength;\n    const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n    const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n    const {x: pointAx, y: pointAy} = data[a];\n    maxArea = area = -1;\n    for (j = rangeOffs; j < rangeTo; j++) {\n      area = 0.5 * Math.abs(\n        (pointAx - avgX) * (data[j].y - pointAy) -\n        (pointAx - data[j].x) * (avgY - pointAy)\n      );\n      if (area > maxArea) {\n        maxArea = area;\n        maxAreaPoint = data[j];\n        nextA = j;\n      }\n    }\n    decimated[sampledIndex++] = maxAreaPoint;\n    a = nextA;\n  }\n  decimated[sampledIndex++] = data[endIndex];\n  return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n  let avgX = 0;\n  let countX = 0;\n  let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n  const decimated = [];\n  const endIndex = start + count - 1;\n  const xMin = data[start].x;\n  const xMax = data[endIndex].x;\n  const dx = xMax - xMin;\n  for (i = start; i < start + count; ++i) {\n    point = data[i];\n    x = (point.x - xMin) / dx * availableWidth;\n    y = point.y;\n    const truncX = x | 0;\n    if (truncX === prevX) {\n      if (y < minY) {\n        minY = y;\n        minIndex = i;\n      } else if (y > maxY) {\n        maxY = y;\n        maxIndex = i;\n      }\n      avgX = (countX * avgX + point.x) / ++countX;\n    } else {\n      const lastIndex = i - 1;\n      if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n        const intermediateIndex1 = Math.min(minIndex, maxIndex);\n        const intermediateIndex2 = Math.max(minIndex, maxIndex);\n        if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex1],\n            x: avgX,\n          });\n        }\n        if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex2],\n            x: avgX\n          });\n        }\n      }\n      if (i > 0 && lastIndex !== startIndex) {\n        decimated.push(data[lastIndex]);\n      }\n      decimated.push(point);\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n      minIndex = maxIndex = startIndex = i;\n    }\n  }\n  return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n  if (dataset._decimated) {\n    const data = dataset._data;\n    delete dataset._decimated;\n    delete dataset._data;\n    Object.defineProperty(dataset, 'data', {value: data});\n  }\n}\nfunction cleanDecimatedData(chart) {\n  chart.data.datasets.forEach((dataset) => {\n    cleanDecimatedDataset(dataset);\n  });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n  const pointCount = points.length;\n  let start = 0;\n  let count;\n  const {iScale} = meta;\n  const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n  if (minDefined) {\n    start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n  }\n  if (maxDefined) {\n    count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n  } else {\n    count = pointCount - start;\n  }\n  return {start, count};\n}\nvar plugin_decimation = {\n  id: 'decimation',\n  defaults: {\n    algorithm: 'min-max',\n    enabled: false,\n  },\n  beforeElementsUpdate: (chart, args, options) => {\n    if (!options.enabled) {\n      cleanDecimatedData(chart);\n      return;\n    }\n    const availableWidth = chart.width;\n    chart.data.datasets.forEach((dataset, datasetIndex) => {\n      const {_data, indexAxis} = dataset;\n      const meta = chart.getDatasetMeta(datasetIndex);\n      const data = _data || dataset.data;\n      if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n        return;\n      }\n      if (!meta.controller.supportsDecimation) {\n        return;\n      }\n      const xAxis = chart.scales[meta.xAxisID];\n      if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n        return;\n      }\n      if (chart.options.parsing) {\n        return;\n      }\n      let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n      const threshold = options.threshold || 4 * availableWidth;\n      if (count <= threshold) {\n        cleanDecimatedDataset(dataset);\n        return;\n      }\n      if (isNullOrUndef(_data)) {\n        dataset._data = data;\n        delete dataset.data;\n        Object.defineProperty(dataset, 'data', {\n          configurable: true,\n          enumerable: true,\n          get: function() {\n            return this._decimated;\n          },\n          set: function(d) {\n            this._data = d;\n          }\n        });\n      }\n      let decimated;\n      switch (options.algorithm) {\n      case 'lttb':\n        decimated = lttbDecimation(data, start, count, availableWidth, options);\n        break;\n      case 'min-max':\n        decimated = minMaxDecimation(data, start, count, availableWidth);\n        break;\n      default:\n        throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n      }\n      dataset._decimated = decimated;\n    });\n  },\n  destroy(chart) {\n    cleanDecimatedData(chart);\n  }\n};\n\nfunction _segments(line, target, property) {\n  const segments = line.segments;\n  const points = line.points;\n  const tpoints = target.points;\n  const parts = [];\n  for (const segment of segments) {\n    let {start, end} = segment;\n    end = _findSegmentEnd(start, end, points);\n    const bounds = _getBounds(property, points[start], points[end], segment.loop);\n    if (!target.segments) {\n      parts.push({\n        source: segment,\n        target: bounds,\n        start: points[start],\n        end: points[end]\n      });\n      continue;\n    }\n    const targetSegments = _boundSegments(target, bounds);\n    for (const tgt of targetSegments) {\n      const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n      const fillSources = _boundSegment(segment, points, subBounds);\n      for (const fillSource of fillSources) {\n        parts.push({\n          source: fillSource,\n          target: tgt,\n          start: {\n            [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n          },\n          end: {\n            [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n          }\n        });\n      }\n    }\n  }\n  return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n  if (loop) {\n    return;\n  }\n  let start = first[property];\n  let end = last[property];\n  if (property === 'angle') {\n    start = _normalizeAngle(start);\n    end = _normalizeAngle(end);\n  }\n  return {property, start, end};\n}\nfunction _pointsFromSegments(boundary, line) {\n  const {x = null, y = null} = boundary || {};\n  const linePoints = line.points;\n  const points = [];\n  line.segments.forEach(({start, end}) => {\n    end = _findSegmentEnd(start, end, linePoints);\n    const first = linePoints[start];\n    const last = linePoints[end];\n    if (y !== null) {\n      points.push({x: first.x, y});\n      points.push({x: last.x, y});\n    } else if (x !== null) {\n      points.push({x, y: first.y});\n      points.push({x, y: last.y});\n    }\n  });\n  return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n  for (;end > start; end--) {\n    const point = points[end];\n    if (!isNaN(point.x) && !isNaN(point.y)) {\n      break;\n    }\n  }\n  return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n  if (a && b) {\n    return fn(a[prop], b[prop]);\n  }\n  return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n  let points = [];\n  let _loop = false;\n  if (isArray(boundary)) {\n    _loop = true;\n    points = boundary;\n  } else {\n    points = _pointsFromSegments(boundary, line);\n  }\n  return points.length ? new LineElement({\n    points,\n    options: {tension: 0},\n    _loop,\n    _fullLoop: _loop\n  }) : null;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n  const source = sources[index];\n  let fill = source.fill;\n  const visited = [index];\n  let target;\n  if (!propagate) {\n    return fill;\n  }\n  while (fill !== false && visited.indexOf(fill) === -1) {\n    if (!isNumberFinite(fill)) {\n      return fill;\n    }\n    target = sources[fill];\n    if (!target) {\n      return false;\n    }\n    if (target.visible) {\n      return fill;\n    }\n    visited.push(fill);\n    fill = target.fill;\n  }\n  return false;\n}\nfunction _decodeFill(line, index, count) {\n  const fill = parseFillOption(line);\n  if (isObject(fill)) {\n    return isNaN(fill.value) ? false : fill;\n  }\n  let target = parseFloat(fill);\n  if (isNumberFinite(target) && Math.floor(target) === target) {\n    return decodeTargetIndex(fill[0], index, target, count);\n  }\n  return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n  if (firstCh === '-' || firstCh === '+') {\n    target = index + target;\n  }\n  if (target === index || target < 0 || target >= count) {\n    return false;\n  }\n  return target;\n}\nfunction _getTargetPixel(fill, scale) {\n  let pixel = null;\n  if (fill === 'start') {\n    pixel = scale.bottom;\n  } else if (fill === 'end') {\n    pixel = scale.top;\n  } else if (isObject(fill)) {\n    pixel = scale.getPixelForValue(fill.value);\n  } else if (scale.getBasePixel) {\n    pixel = scale.getBasePixel();\n  }\n  return pixel;\n}\nfunction _getTargetValue(fill, scale, startValue) {\n  let value;\n  if (fill === 'start') {\n    value = startValue;\n  } else if (fill === 'end') {\n    value = scale.options.reverse ? scale.min : scale.max;\n  } else if (isObject(fill)) {\n    value = fill.value;\n  } else {\n    value = scale.getBaseValue();\n  }\n  return value;\n}\nfunction parseFillOption(line) {\n  const options = line.options;\n  const fillOption = options.fill;\n  let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n  if (fill === undefined) {\n    fill = !!options.backgroundColor;\n  }\n  if (fill === false || fill === null) {\n    return false;\n  }\n  if (fill === true) {\n    return 'origin';\n  }\n  return fill;\n}\n\nfunction _buildStackLine(source) {\n  const {scale, index, line} = source;\n  const points = [];\n  const segments = line.segments;\n  const sourcePoints = line.points;\n  const linesBelow = getLinesBelow(scale, index);\n  linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    for (let j = segment.start; j <= segment.end; j++) {\n      addPointsBelow(points, sourcePoints[j], linesBelow);\n    }\n  }\n  return new LineElement({points, options: {}});\n}\nfunction getLinesBelow(scale, index) {\n  const below = [];\n  const metas = scale.getMatchingVisibleMetas('line');\n  for (let i = 0; i < metas.length; i++) {\n    const meta = metas[i];\n    if (meta.index === index) {\n      break;\n    }\n    if (!meta.hidden) {\n      below.unshift(meta.dataset);\n    }\n  }\n  return below;\n}\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n  const postponed = [];\n  for (let j = 0; j < linesBelow.length; j++) {\n    const line = linesBelow[j];\n    const {first, last, point} = findPoint(line, sourcePoint, 'x');\n    if (!point || (first && last)) {\n      continue;\n    }\n    if (first) {\n      postponed.unshift(point);\n    } else {\n      points.push(point);\n      if (!last) {\n        break;\n      }\n    }\n  }\n  points.push(...postponed);\n}\nfunction findPoint(line, sourcePoint, property) {\n  const point = line.interpolate(sourcePoint, property);\n  if (!point) {\n    return {};\n  }\n  const pointValue = point[property];\n  const segments = line.segments;\n  const linePoints = line.points;\n  let first = false;\n  let last = false;\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    const firstValue = linePoints[segment.start][property];\n    const lastValue = linePoints[segment.end][property];\n    if (_isBetween(pointValue, firstValue, lastValue)) {\n      first = pointValue === firstValue;\n      last = pointValue === lastValue;\n      break;\n    }\n  }\n  return {first, last, point};\n}\n\nclass simpleArc {\n  constructor(opts) {\n    this.x = opts.x;\n    this.y = opts.y;\n    this.radius = opts.radius;\n  }\n  pathSegment(ctx, bounds, opts) {\n    const {x, y, radius} = this;\n    bounds = bounds || {start: 0, end: TAU};\n    ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n    return !opts.bounds;\n  }\n  interpolate(point) {\n    const {x, y, radius} = this;\n    const angle = point.angle;\n    return {\n      x: x + Math.cos(angle) * radius,\n      y: y + Math.sin(angle) * radius,\n      angle\n    };\n  }\n}\n\nfunction _getTarget(source) {\n  const {chart, fill, line} = source;\n  if (isNumberFinite(fill)) {\n    return getLineByIndex(chart, fill);\n  }\n  if (fill === 'stack') {\n    return _buildStackLine(source);\n  }\n  if (fill === 'shape') {\n    return true;\n  }\n  const boundary = computeBoundary(source);\n  if (boundary instanceof simpleArc) {\n    return boundary;\n  }\n  return _createBoundaryLine(boundary, line);\n}\nfunction getLineByIndex(chart, index) {\n  const meta = chart.getDatasetMeta(index);\n  const visible = meta && chart.isDatasetVisible(index);\n  return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n  const scale = source.scale || {};\n  if (scale.getPointPositionForValue) {\n    return computeCircularBoundary(source);\n  }\n  return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n  const {scale = {}, fill} = source;\n  const pixel = _getTargetPixel(fill, scale);\n  if (isNumberFinite(pixel)) {\n    const horizontal = scale.isHorizontal();\n    return {\n      x: horizontal ? pixel : null,\n      y: horizontal ? null : pixel\n    };\n  }\n  return null;\n}\nfunction computeCircularBoundary(source) {\n  const {scale, fill} = source;\n  const options = scale.options;\n  const length = scale.getLabels().length;\n  const start = options.reverse ? scale.max : scale.min;\n  const value = _getTargetValue(fill, scale, start);\n  const target = [];\n  if (options.grid.circular) {\n    const center = scale.getPointPositionForValue(0, start);\n    return new simpleArc({\n      x: center.x,\n      y: center.y,\n      radius: scale.getDistanceFromCenterForValue(value)\n    });\n  }\n  for (let i = 0; i < length; ++i) {\n    target.push(scale.getPointPositionForValue(i, value));\n  }\n  return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n  const target = _getTarget(source);\n  const {line, scale, axis} = source;\n  const lineOpts = line.options;\n  const fillOption = lineOpts.fill;\n  const color = lineOpts.backgroundColor;\n  const {above = color, below = color} = fillOption || {};\n  if (target && line.points.length) {\n    clipArea(ctx, area);\n    doFill(ctx, {line, target, above, below, area, scale, axis});\n    unclipArea(ctx);\n  }\n}\nfunction doFill(ctx, cfg) {\n  const {line, target, above, below, area, scale} = cfg;\n  const property = line._loop ? 'angle' : cfg.axis;\n  ctx.save();\n  if (property === 'x' && below !== above) {\n    clipVertical(ctx, target, area.top);\n    fill(ctx, {line, target, color: above, scale, property});\n    ctx.restore();\n    ctx.save();\n    clipVertical(ctx, target, area.bottom);\n  }\n  fill(ctx, {line, target, color: below, scale, property});\n  ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n  const {segments, points} = target;\n  let first = true;\n  let lineLoop = false;\n  ctx.beginPath();\n  for (const segment of segments) {\n    const {start, end} = segment;\n    const firstPoint = points[start];\n    const lastPoint = points[_findSegmentEnd(start, end, points)];\n    if (first) {\n      ctx.moveTo(firstPoint.x, firstPoint.y);\n      first = false;\n    } else {\n      ctx.lineTo(firstPoint.x, clipY);\n      ctx.lineTo(firstPoint.x, firstPoint.y);\n    }\n    lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n    if (lineLoop) {\n      ctx.closePath();\n    } else {\n      ctx.lineTo(lastPoint.x, clipY);\n    }\n  }\n  ctx.lineTo(target.first().x, clipY);\n  ctx.closePath();\n  ctx.clip();\n}\nfunction fill(ctx, cfg) {\n  const {line, target, property, color, scale} = cfg;\n  const segments = _segments(line, target, property);\n  for (const {source: src, target: tgt, start, end} of segments) {\n    const {style: {backgroundColor = color} = {}} = src;\n    const notShape = target !== true;\n    ctx.save();\n    ctx.fillStyle = backgroundColor;\n    clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n    ctx.beginPath();\n    const lineLoop = !!line.pathSegment(ctx, src);\n    let loop;\n    if (notShape) {\n      if (lineLoop) {\n        ctx.closePath();\n      } else {\n        interpolatedLineTo(ctx, target, end, property);\n      }\n      const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n      loop = lineLoop && targetLoop;\n      if (!loop) {\n        interpolatedLineTo(ctx, target, start, property);\n      }\n    }\n    ctx.closePath();\n    ctx.fill(loop ? 'evenodd' : 'nonzero');\n    ctx.restore();\n  }\n}\nfunction clipBounds(ctx, scale, bounds) {\n  const {top, bottom} = scale.chart.chartArea;\n  const {property, start, end} = bounds || {};\n  if (property === 'x') {\n    ctx.beginPath();\n    ctx.rect(start, top, end - start, bottom - top);\n    ctx.clip();\n  }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n  const interpolatedPoint = target.interpolate(point, property);\n  if (interpolatedPoint) {\n    ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n  }\n}\n\nvar index = {\n  id: 'filler',\n  afterDatasetsUpdate(chart, _args, options) {\n    const count = (chart.data.datasets || []).length;\n    const sources = [];\n    let meta, i, line, source;\n    for (i = 0; i < count; ++i) {\n      meta = chart.getDatasetMeta(i);\n      line = meta.dataset;\n      source = null;\n      if (line && line.options && line instanceof LineElement) {\n        source = {\n          visible: chart.isDatasetVisible(i),\n          index: i,\n          fill: _decodeFill(line, i, count),\n          chart,\n          axis: meta.controller.options.indexAxis,\n          scale: meta.vScale,\n          line,\n        };\n      }\n      meta.$filler = source;\n      sources.push(source);\n    }\n    for (i = 0; i < count; ++i) {\n      source = sources[i];\n      if (!source || source.fill === false) {\n        continue;\n      }\n      source.fill = _resolveTarget(sources, i, options.propagate);\n    }\n  },\n  beforeDraw(chart, _args, options) {\n    const draw = options.drawTime === 'beforeDraw';\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    const area = chart.chartArea;\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n      if (!source) {\n        continue;\n      }\n      source.line.updateControlPoints(area, source.axis);\n      if (draw) {\n        _drawfill(chart.ctx, source, area);\n      }\n    }\n  },\n  beforeDatasetsDraw(chart, _args, options) {\n    if (options.drawTime !== 'beforeDatasetsDraw') {\n      return;\n    }\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n      if (source) {\n        _drawfill(chart.ctx, source, chart.chartArea);\n      }\n    }\n  },\n  beforeDatasetDraw(chart, args, options) {\n    const source = args.meta.$filler;\n    if (!source || source.fill === false || options.drawTime !== 'beforeDatasetDraw') {\n      return;\n    }\n    _drawfill(chart.ctx, source, chart.chartArea);\n  },\n  defaults: {\n    propagate: true,\n    drawTime: 'beforeDatasetDraw'\n  }\n};\n\nconst getBoxSize = (labelOpts, fontSize) => {\n  let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n  if (labelOpts.usePointStyle) {\n    boxHeight = Math.min(boxHeight, fontSize);\n    boxWidth = Math.min(boxWidth, fontSize);\n  }\n  return {\n    boxWidth,\n    boxHeight,\n    itemHeight: Math.max(fontSize, boxHeight)\n  };\n};\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n  constructor(config) {\n    super();\n    this._added = false;\n    this.legendHitBoxes = [];\n    this._hoveredItem = null;\n    this.doughnutMode = false;\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this.legendItems = undefined;\n    this.columnSizes = undefined;\n    this.lineWidths = undefined;\n    this.maxHeight = undefined;\n    this.maxWidth = undefined;\n    this.top = undefined;\n    this.bottom = undefined;\n    this.left = undefined;\n    this.right = undefined;\n    this.height = undefined;\n    this.width = undefined;\n    this._margins = undefined;\n    this.position = undefined;\n    this.weight = undefined;\n    this.fullSize = undefined;\n  }\n  update(maxWidth, maxHeight, margins) {\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins;\n    this.setDimensions();\n    this.buildLabels();\n    this.fit();\n  }\n  setDimensions() {\n    if (this.isHorizontal()) {\n      this.width = this.maxWidth;\n      this.left = this._margins.left;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n      this.top = this._margins.top;\n      this.bottom = this.height;\n    }\n  }\n  buildLabels() {\n    const labelOpts = this.options.labels || {};\n    let legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];\n    if (labelOpts.filter) {\n      legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n    }\n    if (labelOpts.sort) {\n      legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n    }\n    if (this.options.reverse) {\n      legendItems.reverse();\n    }\n    this.legendItems = legendItems;\n  }\n  fit() {\n    const {options, ctx} = this;\n    if (!options.display) {\n      this.width = this.height = 0;\n      return;\n    }\n    const labelOpts = options.labels;\n    const labelFont = toFont(labelOpts.font);\n    const fontSize = labelFont.size;\n    const titleHeight = this._computeTitleHeight();\n    const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n    let width, height;\n    ctx.font = labelFont.string;\n    if (this.isHorizontal()) {\n      width = this.maxWidth;\n      height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n    } else {\n      height = this.maxHeight;\n      width = this._fitCols(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n    }\n    this.width = Math.min(width, options.maxWidth || this.maxWidth);\n    this.height = Math.min(height, options.maxHeight || this.maxHeight);\n  }\n  _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n    const {ctx, maxWidth, options: {labels: {padding}}} = this;\n    const hitboxes = this.legendHitBoxes = [];\n    const lineWidths = this.lineWidths = [0];\n    const lineHeight = itemHeight + padding;\n    let totalHeight = titleHeight;\n    ctx.textAlign = 'left';\n    ctx.textBaseline = 'middle';\n    let row = -1;\n    let top = -lineHeight;\n    this.legendItems.forEach((legendItem, i) => {\n      const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n      if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n        totalHeight += lineHeight;\n        lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n        top += lineHeight;\n        row++;\n      }\n      hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n      lineWidths[lineWidths.length - 1] += itemWidth + padding;\n    });\n    return totalHeight;\n  }\n  _fitCols(titleHeight, fontSize, boxWidth, itemHeight) {\n    const {ctx, maxHeight, options: {labels: {padding}}} = this;\n    const hitboxes = this.legendHitBoxes = [];\n    const columnSizes = this.columnSizes = [];\n    const heightLimit = maxHeight - titleHeight;\n    let totalWidth = padding;\n    let currentColWidth = 0;\n    let currentColHeight = 0;\n    let left = 0;\n    let col = 0;\n    this.legendItems.forEach((legendItem, i) => {\n      const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n      if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n        totalWidth += currentColWidth + padding;\n        columnSizes.push({width: currentColWidth, height: currentColHeight});\n        left += currentColWidth + padding;\n        col++;\n        currentColWidth = currentColHeight = 0;\n      }\n      hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n      currentColWidth = Math.max(currentColWidth, itemWidth);\n      currentColHeight += itemHeight + padding;\n    });\n    totalWidth += currentColWidth;\n    columnSizes.push({width: currentColWidth, height: currentColHeight});\n    return totalWidth;\n  }\n  adjustHitBoxes() {\n    if (!this.options.display) {\n      return;\n    }\n    const titleHeight = this._computeTitleHeight();\n    const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n    const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n    if (this.isHorizontal()) {\n      let row = 0;\n      let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n      for (const hitbox of hitboxes) {\n        if (row !== hitbox.row) {\n          row = hitbox.row;\n          left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n        }\n        hitbox.top += this.top + titleHeight + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n        left += hitbox.width + padding;\n      }\n    } else {\n      let col = 0;\n      let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n      for (const hitbox of hitboxes) {\n        if (hitbox.col !== col) {\n          col = hitbox.col;\n          top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n        }\n        hitbox.top = top;\n        hitbox.left += this.left + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n        top += hitbox.height + padding;\n      }\n    }\n  }\n  isHorizontal() {\n    return this.options.position === 'top' || this.options.position === 'bottom';\n  }\n  draw() {\n    if (this.options.display) {\n      const ctx = this.ctx;\n      clipArea(ctx, this);\n      this._draw();\n      unclipArea(ctx);\n    }\n  }\n  _draw() {\n    const {options: opts, columnSizes, lineWidths, ctx} = this;\n    const {align, labels: labelOpts} = opts;\n    const defaultColor = defaults.color;\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const labelFont = toFont(labelOpts.font);\n    const {color: fontColor, padding} = labelOpts;\n    const fontSize = labelFont.size;\n    const halfFontSize = fontSize / 2;\n    let cursor;\n    this.drawTitle();\n    ctx.textAlign = rtlHelper.textAlign('left');\n    ctx.textBaseline = 'middle';\n    ctx.lineWidth = 0.5;\n    ctx.font = labelFont.string;\n    const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n    const drawLegendBox = function(x, y, legendItem) {\n      if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n        return;\n      }\n      ctx.save();\n      const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n      ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n      ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n      ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n      ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n      ctx.lineWidth = lineWidth;\n      ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n      ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n      if (labelOpts.usePointStyle) {\n        const drawOptions = {\n          radius: boxWidth * Math.SQRT2 / 2,\n          pointStyle: legendItem.pointStyle,\n          rotation: legendItem.rotation,\n          borderWidth: lineWidth\n        };\n        const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n        const centerY = y + halfFontSize;\n        drawPoint(ctx, drawOptions, centerX, centerY);\n      } else {\n        const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n        const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n        const borderRadius = toTRBLCorners(legendItem.borderRadius);\n        ctx.beginPath();\n        if (Object.values(borderRadius).some(v => v !== 0)) {\n          addRoundedRectPath(ctx, {\n            x: xBoxLeft,\n            y: yBoxTop,\n            w: boxWidth,\n            h: boxHeight,\n            radius: borderRadius,\n          });\n        } else {\n          ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n        }\n        ctx.fill();\n        if (lineWidth !== 0) {\n          ctx.stroke();\n        }\n      }\n      ctx.restore();\n    };\n    const fillText = function(x, y, legendItem) {\n      renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n        strikethrough: legendItem.hidden,\n        textAlign: rtlHelper.textAlign(legendItem.textAlign)\n      });\n    };\n    const isHorizontal = this.isHorizontal();\n    const titleHeight = this._computeTitleHeight();\n    if (isHorizontal) {\n      cursor = {\n        x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n        y: this.top + padding + titleHeight,\n        line: 0\n      };\n    } else {\n      cursor = {\n        x: this.left + padding,\n        y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n        line: 0\n      };\n    }\n    overrideTextDirection(this.ctx, opts.textDirection);\n    const lineHeight = itemHeight + padding;\n    this.legendItems.forEach((legendItem, i) => {\n      ctx.strokeStyle = legendItem.fontColor || fontColor;\n      ctx.fillStyle = legendItem.fontColor || fontColor;\n      const textWidth = ctx.measureText(legendItem.text).width;\n      const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n      const width = boxWidth + halfFontSize + textWidth;\n      let x = cursor.x;\n      let y = cursor.y;\n      rtlHelper.setWidth(this.width);\n      if (isHorizontal) {\n        if (i > 0 && x + width + padding > this.right) {\n          y = cursor.y += lineHeight;\n          cursor.line++;\n          x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n        }\n      } else if (i > 0 && y + lineHeight > this.bottom) {\n        x = cursor.x = x + columnSizes[cursor.line].width + padding;\n        cursor.line++;\n        y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n      }\n      const realX = rtlHelper.x(x);\n      drawLegendBox(realX, y, legendItem);\n      x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n      fillText(rtlHelper.x(x), y, legendItem);\n      if (isHorizontal) {\n        cursor.x += width + padding;\n      } else {\n        cursor.y += lineHeight;\n      }\n    });\n    restoreTextDirection(this.ctx, opts.textDirection);\n  }\n  drawTitle() {\n    const opts = this.options;\n    const titleOpts = opts.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n    if (!titleOpts.display) {\n      return;\n    }\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const ctx = this.ctx;\n    const position = titleOpts.position;\n    const halfFontSize = titleFont.size / 2;\n    const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n    let y;\n    let left = this.left;\n    let maxWidth = this.width;\n    if (this.isHorizontal()) {\n      maxWidth = Math.max(...this.lineWidths);\n      y = this.top + topPaddingPlusHalfFontSize;\n      left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n    } else {\n      const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n      y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n    }\n    const x = _alignStartEnd(position, left, left + maxWidth);\n    ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n    ctx.textBaseline = 'middle';\n    ctx.strokeStyle = titleOpts.color;\n    ctx.fillStyle = titleOpts.color;\n    ctx.font = titleFont.string;\n    renderText(ctx, titleOpts.text, x, y, titleFont);\n  }\n  _computeTitleHeight() {\n    const titleOpts = this.options.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n    return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n  }\n  _getLegendItemAt(x, y) {\n    let i, hitBox, lh;\n    if (_isBetween(x, this.left, this.right)\n      && _isBetween(y, this.top, this.bottom)) {\n      lh = this.legendHitBoxes;\n      for (i = 0; i < lh.length; ++i) {\n        hitBox = lh[i];\n        if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n          && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n          return this.legendItems[i];\n        }\n      }\n    }\n    return null;\n  }\n  handleEvent(e) {\n    const opts = this.options;\n    if (!isListened(e.type, opts)) {\n      return;\n    }\n    const hoveredItem = this._getLegendItemAt(e.x, e.y);\n    if (e.type === 'mousemove' || e.type === 'mouseout') {\n      const previous = this._hoveredItem;\n      const sameItem = itemsEqual(previous, hoveredItem);\n      if (previous && !sameItem) {\n        callback(opts.onLeave, [e, previous, this], this);\n      }\n      this._hoveredItem = hoveredItem;\n      if (hoveredItem && !sameItem) {\n        callback(opts.onHover, [e, hoveredItem, this], this);\n      }\n    } else if (hoveredItem) {\n      callback(opts.onClick, [e, hoveredItem, this], this);\n    }\n  }\n}\nfunction isListened(type, opts) {\n  if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n    return true;\n  }\n  if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n    return true;\n  }\n  return false;\n}\nvar plugin_legend = {\n  id: 'legend',\n  _element: Legend,\n  start(chart, _args, options) {\n    const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n    layouts.configure(chart, legend, options);\n    layouts.addBox(chart, legend);\n  },\n  stop(chart) {\n    layouts.removeBox(chart, chart.legend);\n    delete chart.legend;\n  },\n  beforeUpdate(chart, _args, options) {\n    const legend = chart.legend;\n    layouts.configure(chart, legend, options);\n    legend.options = options;\n  },\n  afterUpdate(chart) {\n    const legend = chart.legend;\n    legend.buildLabels();\n    legend.adjustHitBoxes();\n  },\n  afterEvent(chart, args) {\n    if (!args.replay) {\n      chart.legend.handleEvent(args.event);\n    }\n  },\n  defaults: {\n    display: true,\n    position: 'top',\n    align: 'center',\n    fullSize: true,\n    reverse: false,\n    weight: 1000,\n    onClick(e, legendItem, legend) {\n      const index = legendItem.datasetIndex;\n      const ci = legend.chart;\n      if (ci.isDatasetVisible(index)) {\n        ci.hide(index);\n        legendItem.hidden = true;\n      } else {\n        ci.show(index);\n        legendItem.hidden = false;\n      }\n    },\n    onHover: null,\n    onLeave: null,\n    labels: {\n      color: (ctx) => ctx.chart.options.color,\n      boxWidth: 40,\n      padding: 10,\n      generateLabels(chart) {\n        const datasets = chart.data.datasets;\n        const {labels: {usePointStyle, pointStyle, textAlign, color}} = chart.legend.options;\n        return chart._getSortedDatasetMetas().map((meta) => {\n          const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n          const borderWidth = toPadding(style.borderWidth);\n          return {\n            text: datasets[meta.index].label,\n            fillStyle: style.backgroundColor,\n            fontColor: color,\n            hidden: !meta.visible,\n            lineCap: style.borderCapStyle,\n            lineDash: style.borderDash,\n            lineDashOffset: style.borderDashOffset,\n            lineJoin: style.borderJoinStyle,\n            lineWidth: (borderWidth.width + borderWidth.height) / 4,\n            strokeStyle: style.borderColor,\n            pointStyle: pointStyle || style.pointStyle,\n            rotation: style.rotation,\n            textAlign: textAlign || style.textAlign,\n            borderRadius: 0,\n            datasetIndex: meta.index\n          };\n        }, this);\n      }\n    },\n    title: {\n      color: (ctx) => ctx.chart.options.color,\n      display: false,\n      position: 'center',\n      text: '',\n    }\n  },\n  descriptors: {\n    _scriptable: (name) => !name.startsWith('on'),\n    labels: {\n      _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n    }\n  },\n};\n\nclass Title extends Element {\n  constructor(config) {\n    super();\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this._padding = undefined;\n    this.top = undefined;\n    this.bottom = undefined;\n    this.left = undefined;\n    this.right = undefined;\n    this.width = undefined;\n    this.height = undefined;\n    this.position = undefined;\n    this.weight = undefined;\n    this.fullSize = undefined;\n  }\n  update(maxWidth, maxHeight) {\n    const opts = this.options;\n    this.left = 0;\n    this.top = 0;\n    if (!opts.display) {\n      this.width = this.height = this.right = this.bottom = 0;\n      return;\n    }\n    this.width = this.right = maxWidth;\n    this.height = this.bottom = maxHeight;\n    const lineCount = isArray(opts.text) ? opts.text.length : 1;\n    this._padding = toPadding(opts.padding);\n    const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n    if (this.isHorizontal()) {\n      this.height = textSize;\n    } else {\n      this.width = textSize;\n    }\n  }\n  isHorizontal() {\n    const pos = this.options.position;\n    return pos === 'top' || pos === 'bottom';\n  }\n  _drawArgs(offset) {\n    const {top, left, bottom, right, options} = this;\n    const align = options.align;\n    let rotation = 0;\n    let maxWidth, titleX, titleY;\n    if (this.isHorizontal()) {\n      titleX = _alignStartEnd(align, left, right);\n      titleY = top + offset;\n      maxWidth = right - left;\n    } else {\n      if (options.position === 'left') {\n        titleX = left + offset;\n        titleY = _alignStartEnd(align, bottom, top);\n        rotation = PI * -0.5;\n      } else {\n        titleX = right - offset;\n        titleY = _alignStartEnd(align, top, bottom);\n        rotation = PI * 0.5;\n      }\n      maxWidth = bottom - top;\n    }\n    return {titleX, titleY, maxWidth, rotation};\n  }\n  draw() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    if (!opts.display) {\n      return;\n    }\n    const fontOpts = toFont(opts.font);\n    const lineHeight = fontOpts.lineHeight;\n    const offset = lineHeight / 2 + this._padding.top;\n    const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n    renderText(ctx, opts.text, 0, 0, fontOpts, {\n      color: opts.color,\n      maxWidth,\n      rotation,\n      textAlign: _toLeftRightCenter(opts.align),\n      textBaseline: 'middle',\n      translation: [titleX, titleY],\n    });\n  }\n}\nfunction createTitle(chart, titleOpts) {\n  const title = new Title({\n    ctx: chart.ctx,\n    options: titleOpts,\n    chart\n  });\n  layouts.configure(chart, title, titleOpts);\n  layouts.addBox(chart, title);\n  chart.titleBlock = title;\n}\nvar plugin_title = {\n  id: 'title',\n  _element: Title,\n  start(chart, _args, options) {\n    createTitle(chart, options);\n  },\n  stop(chart) {\n    const titleBlock = chart.titleBlock;\n    layouts.removeBox(chart, titleBlock);\n    delete chart.titleBlock;\n  },\n  beforeUpdate(chart, _args, options) {\n    const title = chart.titleBlock;\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n  defaults: {\n    align: 'center',\n    display: false,\n    font: {\n      weight: 'bold',\n    },\n    fullSize: true,\n    padding: 10,\n    position: 'top',\n    text: '',\n    weight: 2000\n  },\n  defaultRoutes: {\n    color: 'color'\n  },\n  descriptors: {\n    _scriptable: true,\n    _indexable: false,\n  },\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n  id: 'subtitle',\n  start(chart, _args, options) {\n    const title = new Title({\n      ctx: chart.ctx,\n      options,\n      chart\n    });\n    layouts.configure(chart, title, options);\n    layouts.addBox(chart, title);\n    map.set(chart, title);\n  },\n  stop(chart) {\n    layouts.removeBox(chart, map.get(chart));\n    map.delete(chart);\n  },\n  beforeUpdate(chart, _args, options) {\n    const title = map.get(chart);\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n  defaults: {\n    align: 'center',\n    display: false,\n    font: {\n      weight: 'normal',\n    },\n    fullSize: true,\n    padding: 0,\n    position: 'top',\n    text: '',\n    weight: 1500\n  },\n  defaultRoutes: {\n    color: 'color'\n  },\n  descriptors: {\n    _scriptable: true,\n    _indexable: false,\n  },\n};\n\nconst positioners = {\n  average(items) {\n    if (!items.length) {\n      return false;\n    }\n    let i, len;\n    let x = 0;\n    let y = 0;\n    let count = 0;\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const pos = el.tooltipPosition();\n        x += pos.x;\n        y += pos.y;\n        ++count;\n      }\n    }\n    return {\n      x: x / count,\n      y: y / count\n    };\n  },\n  nearest(items, eventPosition) {\n    if (!items.length) {\n      return false;\n    }\n    let x = eventPosition.x;\n    let y = eventPosition.y;\n    let minDistance = Number.POSITIVE_INFINITY;\n    let i, len, nearestElement;\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const center = el.getCenterPoint();\n        const d = distanceBetweenPoints(eventPosition, center);\n        if (d < minDistance) {\n          minDistance = d;\n          nearestElement = el;\n        }\n      }\n    }\n    if (nearestElement) {\n      const tp = nearestElement.tooltipPosition();\n      x = tp.x;\n      y = tp.y;\n    }\n    return {\n      x,\n      y\n    };\n  }\n};\nfunction pushOrConcat(base, toPush) {\n  if (toPush) {\n    if (isArray(toPush)) {\n      Array.prototype.push.apply(base, toPush);\n    } else {\n      base.push(toPush);\n    }\n  }\n  return base;\n}\nfunction splitNewlines(str) {\n  if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n    return str.split('\\n');\n  }\n  return str;\n}\nfunction createTooltipItem(chart, item) {\n  const {element, datasetIndex, index} = item;\n  const controller = chart.getDatasetMeta(datasetIndex).controller;\n  const {label, value} = controller.getLabelAndValue(index);\n  return {\n    chart,\n    label,\n    parsed: controller.getParsed(index),\n    raw: chart.data.datasets[datasetIndex].data[index],\n    formattedValue: value,\n    dataset: controller.getDataset(),\n    dataIndex: index,\n    datasetIndex,\n    element\n  };\n}\nfunction getTooltipSize(tooltip, options) {\n  const ctx = tooltip.chart.ctx;\n  const {body, footer, title} = tooltip;\n  const {boxWidth, boxHeight} = options;\n  const bodyFont = toFont(options.bodyFont);\n  const titleFont = toFont(options.titleFont);\n  const footerFont = toFont(options.footerFont);\n  const titleLineCount = title.length;\n  const footerLineCount = footer.length;\n  const bodyLineItemCount = body.length;\n  const padding = toPadding(options.padding);\n  let height = padding.height;\n  let width = 0;\n  let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n  combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n  if (titleLineCount) {\n    height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n  }\n  if (combinedBodyLength) {\n    const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n    height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n  }\n  if (footerLineCount) {\n    height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n  }\n  let widthPadding = 0;\n  const maxLineWidth = function(line) {\n    width = Math.max(width, ctx.measureText(line).width + widthPadding);\n  };\n  ctx.save();\n  ctx.font = titleFont.string;\n  each(tooltip.title, maxLineWidth);\n  ctx.font = bodyFont.string;\n  each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n  widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n  each(body, (bodyItem) => {\n    each(bodyItem.before, maxLineWidth);\n    each(bodyItem.lines, maxLineWidth);\n    each(bodyItem.after, maxLineWidth);\n  });\n  widthPadding = 0;\n  ctx.font = footerFont.string;\n  each(tooltip.footer, maxLineWidth);\n  ctx.restore();\n  width += padding.width;\n  return {width, height};\n}\nfunction determineYAlign(chart, size) {\n  const {y, height} = size;\n  if (y < height / 2) {\n    return 'top';\n  } else if (y > (chart.height - height / 2)) {\n    return 'bottom';\n  }\n  return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n  const {x, width} = size;\n  const caret = options.caretSize + options.caretPadding;\n  if (xAlign === 'left' && x + width + caret > chart.width) {\n    return true;\n  }\n  if (xAlign === 'right' && x - width - caret < 0) {\n    return true;\n  }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n  const {x, width} = size;\n  const {width: chartWidth, chartArea: {left, right}} = chart;\n  let xAlign = 'center';\n  if (yAlign === 'center') {\n    xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n  } else if (x <= width / 2) {\n    xAlign = 'left';\n  } else if (x >= chartWidth - width / 2) {\n    xAlign = 'right';\n  }\n  if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n    xAlign = 'center';\n  }\n  return xAlign;\n}\nfunction determineAlignment(chart, options, size) {\n  const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n  return {\n    xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n    yAlign\n  };\n}\nfunction alignX(size, xAlign) {\n  let {x, width} = size;\n  if (xAlign === 'right') {\n    x -= width;\n  } else if (xAlign === 'center') {\n    x -= (width / 2);\n  }\n  return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n  let {y, height} = size;\n  if (yAlign === 'top') {\n    y += paddingAndSize;\n  } else if (yAlign === 'bottom') {\n    y -= height + paddingAndSize;\n  } else {\n    y -= (height / 2);\n  }\n  return y;\n}\nfunction getBackgroundPoint(options, size, alignment, chart) {\n  const {caretSize, caretPadding, cornerRadius} = options;\n  const {xAlign, yAlign} = alignment;\n  const paddingAndSize = caretSize + caretPadding;\n  const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n  let x = alignX(size, xAlign);\n  const y = alignY(size, yAlign, paddingAndSize);\n  if (yAlign === 'center') {\n    if (xAlign === 'left') {\n      x += paddingAndSize;\n    } else if (xAlign === 'right') {\n      x -= paddingAndSize;\n    }\n  } else if (xAlign === 'left') {\n    x -= Math.max(topLeft, bottomLeft) + caretSize;\n  } else if (xAlign === 'right') {\n    x += Math.max(topRight, bottomRight) + caretSize;\n  }\n  return {\n    x: _limitValue(x, 0, chart.width - size.width),\n    y: _limitValue(y, 0, chart.height - size.height)\n  };\n}\nfunction getAlignedX(tooltip, align, options) {\n  const padding = toPadding(options.padding);\n  return align === 'center'\n    ? tooltip.x + tooltip.width / 2\n    : align === 'right'\n      ? tooltip.x + tooltip.width - padding.right\n      : tooltip.x + padding.left;\n}\nfunction getBeforeAfterBodyLines(callback) {\n  return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n  return createContext(parent, {\n    tooltip,\n    tooltipItems,\n    type: 'tooltip'\n  });\n}\nfunction overrideCallbacks(callbacks, context) {\n  const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n  return override ? callbacks.override(override) : callbacks;\n}\nclass Tooltip extends Element {\n  constructor(config) {\n    super();\n    this.opacity = 0;\n    this._active = [];\n    this._eventPosition = undefined;\n    this._size = undefined;\n    this._cachedAnimations = undefined;\n    this._tooltipItems = [];\n    this.$animations = undefined;\n    this.$context = undefined;\n    this.chart = config.chart || config._chart;\n    this._chart = this.chart;\n    this.options = config.options;\n    this.dataPoints = undefined;\n    this.title = undefined;\n    this.beforeBody = undefined;\n    this.body = undefined;\n    this.afterBody = undefined;\n    this.footer = undefined;\n    this.xAlign = undefined;\n    this.yAlign = undefined;\n    this.x = undefined;\n    this.y = undefined;\n    this.height = undefined;\n    this.width = undefined;\n    this.caretX = undefined;\n    this.caretY = undefined;\n    this.labelColors = undefined;\n    this.labelPointStyles = undefined;\n    this.labelTextColors = undefined;\n  }\n  initialize(options) {\n    this.options = options;\n    this._cachedAnimations = undefined;\n    this.$context = undefined;\n  }\n  _resolveAnimations() {\n    const cached = this._cachedAnimations;\n    if (cached) {\n      return cached;\n    }\n    const chart = this.chart;\n    const options = this.options.setContext(this.getContext());\n    const opts = options.enabled && chart.options.animation && options.animations;\n    const animations = new Animations(this.chart, opts);\n    if (opts._cacheable) {\n      this._cachedAnimations = Object.freeze(animations);\n    }\n    return animations;\n  }\n  getContext() {\n    return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n  }\n  getTitle(context, options) {\n    const {callbacks} = options;\n    const beforeTitle = callbacks.beforeTitle.apply(this, [context]);\n    const title = callbacks.title.apply(this, [context]);\n    const afterTitle = callbacks.afterTitle.apply(this, [context]);\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n    lines = pushOrConcat(lines, splitNewlines(title));\n    lines = pushOrConcat(lines, splitNewlines(afterTitle));\n    return lines;\n  }\n  getBeforeBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this, [tooltipItems]));\n  }\n  getBody(tooltipItems, options) {\n    const {callbacks} = options;\n    const bodyItems = [];\n    each(tooltipItems, (context) => {\n      const bodyItem = {\n        before: [],\n        lines: [],\n        after: []\n      };\n      const scoped = overrideCallbacks(callbacks, context);\n      pushOrConcat(bodyItem.before, splitNewlines(scoped.beforeLabel.call(this, context)));\n      pushOrConcat(bodyItem.lines, scoped.label.call(this, context));\n      pushOrConcat(bodyItem.after, splitNewlines(scoped.afterLabel.call(this, context)));\n      bodyItems.push(bodyItem);\n    });\n    return bodyItems;\n  }\n  getAfterBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this, [tooltipItems]));\n  }\n  getFooter(tooltipItems, options) {\n    const {callbacks} = options;\n    const beforeFooter = callbacks.beforeFooter.apply(this, [tooltipItems]);\n    const footer = callbacks.footer.apply(this, [tooltipItems]);\n    const afterFooter = callbacks.afterFooter.apply(this, [tooltipItems]);\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n    lines = pushOrConcat(lines, splitNewlines(footer));\n    lines = pushOrConcat(lines, splitNewlines(afterFooter));\n    return lines;\n  }\n  _createItems(options) {\n    const active = this._active;\n    const data = this.chart.data;\n    const labelColors = [];\n    const labelPointStyles = [];\n    const labelTextColors = [];\n    let tooltipItems = [];\n    let i, len;\n    for (i = 0, len = active.length; i < len; ++i) {\n      tooltipItems.push(createTooltipItem(this.chart, active[i]));\n    }\n    if (options.filter) {\n      tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n    }\n    if (options.itemSort) {\n      tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n    }\n    each(tooltipItems, (context) => {\n      const scoped = overrideCallbacks(options.callbacks, context);\n      labelColors.push(scoped.labelColor.call(this, context));\n      labelPointStyles.push(scoped.labelPointStyle.call(this, context));\n      labelTextColors.push(scoped.labelTextColor.call(this, context));\n    });\n    this.labelColors = labelColors;\n    this.labelPointStyles = labelPointStyles;\n    this.labelTextColors = labelTextColors;\n    this.dataPoints = tooltipItems;\n    return tooltipItems;\n  }\n  update(changed, replay) {\n    const options = this.options.setContext(this.getContext());\n    const active = this._active;\n    let properties;\n    let tooltipItems = [];\n    if (!active.length) {\n      if (this.opacity !== 0) {\n        properties = {\n          opacity: 0\n        };\n      }\n    } else {\n      const position = positioners[options.position].call(this, active, this._eventPosition);\n      tooltipItems = this._createItems(options);\n      this.title = this.getTitle(tooltipItems, options);\n      this.beforeBody = this.getBeforeBody(tooltipItems, options);\n      this.body = this.getBody(tooltipItems, options);\n      this.afterBody = this.getAfterBody(tooltipItems, options);\n      this.footer = this.getFooter(tooltipItems, options);\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, size);\n      const alignment = determineAlignment(this.chart, options, positionAndSize);\n      const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n      this.xAlign = alignment.xAlign;\n      this.yAlign = alignment.yAlign;\n      properties = {\n        opacity: 1,\n        x: backgroundPoint.x,\n        y: backgroundPoint.y,\n        width: size.width,\n        height: size.height,\n        caretX: position.x,\n        caretY: position.y\n      };\n    }\n    this._tooltipItems = tooltipItems;\n    this.$context = undefined;\n    if (properties) {\n      this._resolveAnimations().update(this, properties);\n    }\n    if (changed && options.external) {\n      options.external.call(this, {chart: this.chart, tooltip: this, replay});\n    }\n  }\n  drawCaret(tooltipPoint, ctx, size, options) {\n    const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n    ctx.lineTo(caretPosition.x1, caretPosition.y1);\n    ctx.lineTo(caretPosition.x2, caretPosition.y2);\n    ctx.lineTo(caretPosition.x3, caretPosition.y3);\n  }\n  getCaretPosition(tooltipPoint, size, options) {\n    const {xAlign, yAlign} = this;\n    const {caretSize, cornerRadius} = options;\n    const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n    const {x: ptX, y: ptY} = tooltipPoint;\n    const {width, height} = size;\n    let x1, x2, x3, y1, y2, y3;\n    if (yAlign === 'center') {\n      y2 = ptY + (height / 2);\n      if (xAlign === 'left') {\n        x1 = ptX;\n        x2 = x1 - caretSize;\n        y1 = y2 + caretSize;\n        y3 = y2 - caretSize;\n      } else {\n        x1 = ptX + width;\n        x2 = x1 + caretSize;\n        y1 = y2 - caretSize;\n        y3 = y2 + caretSize;\n      }\n      x3 = x1;\n    } else {\n      if (xAlign === 'left') {\n        x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n      } else if (xAlign === 'right') {\n        x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n      } else {\n        x2 = this.caretX;\n      }\n      if (yAlign === 'top') {\n        y1 = ptY;\n        y2 = y1 - caretSize;\n        x1 = x2 - caretSize;\n        x3 = x2 + caretSize;\n      } else {\n        y1 = ptY + height;\n        y2 = y1 + caretSize;\n        x1 = x2 + caretSize;\n        x3 = x2 - caretSize;\n      }\n      y3 = y1;\n    }\n    return {x1, x2, x3, y1, y2, y3};\n  }\n  drawTitle(pt, ctx, options) {\n    const title = this.title;\n    const length = title.length;\n    let titleFont, titleSpacing, i;\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n      pt.x = getAlignedX(this, options.titleAlign, options);\n      ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n      ctx.textBaseline = 'middle';\n      titleFont = toFont(options.titleFont);\n      titleSpacing = options.titleSpacing;\n      ctx.fillStyle = options.titleColor;\n      ctx.font = titleFont.string;\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n        pt.y += titleFont.lineHeight + titleSpacing;\n        if (i + 1 === length) {\n          pt.y += options.titleMarginBottom - titleSpacing;\n        }\n      }\n    }\n  }\n  _drawColorBox(ctx, pt, i, rtlHelper, options) {\n    const labelColors = this.labelColors[i];\n    const labelPointStyle = this.labelPointStyles[i];\n    const {boxHeight, boxWidth, boxPadding} = options;\n    const bodyFont = toFont(options.bodyFont);\n    const colorX = getAlignedX(this, 'left', options);\n    const rtlColorX = rtlHelper.x(colorX);\n    const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n    const colorY = pt.y + yOffSet;\n    if (options.usePointStyle) {\n      const drawOptions = {\n        radius: Math.min(boxWidth, boxHeight) / 2,\n        pointStyle: labelPointStyle.pointStyle,\n        rotation: labelPointStyle.rotation,\n        borderWidth: 1\n      };\n      const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n      const centerY = colorY + boxHeight / 2;\n      ctx.strokeStyle = options.multiKeyBackground;\n      ctx.fillStyle = options.multiKeyBackground;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n      ctx.strokeStyle = labelColors.borderColor;\n      ctx.fillStyle = labelColors.backgroundColor;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n    } else {\n      ctx.lineWidth = labelColors.borderWidth || 1;\n      ctx.strokeStyle = labelColors.borderColor;\n      ctx.setLineDash(labelColors.borderDash || []);\n      ctx.lineDashOffset = labelColors.borderDashOffset || 0;\n      const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);\n      const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);\n      const borderRadius = toTRBLCorners(labelColors.borderRadius);\n      if (Object.values(borderRadius).some(v => v !== 0)) {\n        ctx.beginPath();\n        ctx.fillStyle = options.multiKeyBackground;\n        addRoundedRectPath(ctx, {\n          x: outerX,\n          y: colorY,\n          w: boxWidth,\n          h: boxHeight,\n          radius: borderRadius,\n        });\n        ctx.fill();\n        ctx.stroke();\n        ctx.fillStyle = labelColors.backgroundColor;\n        ctx.beginPath();\n        addRoundedRectPath(ctx, {\n          x: innerX,\n          y: colorY + 1,\n          w: boxWidth - 2,\n          h: boxHeight - 2,\n          radius: borderRadius,\n        });\n        ctx.fill();\n      } else {\n        ctx.fillStyle = options.multiKeyBackground;\n        ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n        ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n        ctx.fillStyle = labelColors.backgroundColor;\n        ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n      }\n    }\n    ctx.fillStyle = this.labelTextColors[i];\n  }\n  drawBody(pt, ctx, options) {\n    const {body} = this;\n    const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n    const bodyFont = toFont(options.bodyFont);\n    let bodyLineHeight = bodyFont.lineHeight;\n    let xLinePadding = 0;\n    const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n    const fillLineOfText = function(line) {\n      ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n      pt.y += bodyLineHeight + bodySpacing;\n    };\n    const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n    let bodyItem, textColor, lines, i, j, ilen, jlen;\n    ctx.textAlign = bodyAlign;\n    ctx.textBaseline = 'middle';\n    ctx.font = bodyFont.string;\n    pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n    ctx.fillStyle = options.bodyColor;\n    each(this.beforeBody, fillLineOfText);\n    xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n      ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n      : 0;\n    for (i = 0, ilen = body.length; i < ilen; ++i) {\n      bodyItem = body[i];\n      textColor = this.labelTextColors[i];\n      ctx.fillStyle = textColor;\n      each(bodyItem.before, fillLineOfText);\n      lines = bodyItem.lines;\n      if (displayColors && lines.length) {\n        this._drawColorBox(ctx, pt, i, rtlHelper, options);\n        bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n      }\n      for (j = 0, jlen = lines.length; j < jlen; ++j) {\n        fillLineOfText(lines[j]);\n        bodyLineHeight = bodyFont.lineHeight;\n      }\n      each(bodyItem.after, fillLineOfText);\n    }\n    xLinePadding = 0;\n    bodyLineHeight = bodyFont.lineHeight;\n    each(this.afterBody, fillLineOfText);\n    pt.y -= bodySpacing;\n  }\n  drawFooter(pt, ctx, options) {\n    const footer = this.footer;\n    const length = footer.length;\n    let footerFont, i;\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n      pt.x = getAlignedX(this, options.footerAlign, options);\n      pt.y += options.footerMarginTop;\n      ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n      ctx.textBaseline = 'middle';\n      footerFont = toFont(options.footerFont);\n      ctx.fillStyle = options.footerColor;\n      ctx.font = footerFont.string;\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n        pt.y += footerFont.lineHeight + options.footerSpacing;\n      }\n    }\n  }\n  drawBackground(pt, ctx, tooltipSize, options) {\n    const {xAlign, yAlign} = this;\n    const {x, y} = pt;\n    const {width, height} = tooltipSize;\n    const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n    ctx.beginPath();\n    ctx.moveTo(x + topLeft, y);\n    if (yAlign === 'top') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width - topRight, y);\n    ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n    if (yAlign === 'center' && xAlign === 'right') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width, y + height - bottomRight);\n    ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n    if (yAlign === 'bottom') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + bottomLeft, y + height);\n    ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n    if (yAlign === 'center' && xAlign === 'left') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x, y + topLeft);\n    ctx.quadraticCurveTo(x, y, x + topLeft, y);\n    ctx.closePath();\n    ctx.fill();\n    if (options.borderWidth > 0) {\n      ctx.stroke();\n    }\n  }\n  _updateAnimationTarget(options) {\n    const chart = this.chart;\n    const anims = this.$animations;\n    const animX = anims && anims.x;\n    const animY = anims && anims.y;\n    if (animX || animY) {\n      const position = positioners[options.position].call(this, this._active, this._eventPosition);\n      if (!position) {\n        return;\n      }\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, this._size);\n      const alignment = determineAlignment(chart, options, positionAndSize);\n      const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n      if (animX._to !== point.x || animY._to !== point.y) {\n        this.xAlign = alignment.xAlign;\n        this.yAlign = alignment.yAlign;\n        this.width = size.width;\n        this.height = size.height;\n        this.caretX = position.x;\n        this.caretY = position.y;\n        this._resolveAnimations().update(this, point);\n      }\n    }\n  }\n  _willRender() {\n    return !!this.opacity;\n  }\n  draw(ctx) {\n    const options = this.options.setContext(this.getContext());\n    let opacity = this.opacity;\n    if (!opacity) {\n      return;\n    }\n    this._updateAnimationTarget(options);\n    const tooltipSize = {\n      width: this.width,\n      height: this.height\n    };\n    const pt = {\n      x: this.x,\n      y: this.y\n    };\n    opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n    const padding = toPadding(options.padding);\n    const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n    if (options.enabled && hasTooltipContent) {\n      ctx.save();\n      ctx.globalAlpha = opacity;\n      this.drawBackground(pt, ctx, tooltipSize, options);\n      overrideTextDirection(ctx, options.textDirection);\n      pt.y += padding.top;\n      this.drawTitle(pt, ctx, options);\n      this.drawBody(pt, ctx, options);\n      this.drawFooter(pt, ctx, options);\n      restoreTextDirection(ctx, options.textDirection);\n      ctx.restore();\n    }\n  }\n  getActiveElements() {\n    return this._active || [];\n  }\n  setActiveElements(activeElements, eventPosition) {\n    const lastActive = this._active;\n    const active = activeElements.map(({datasetIndex, index}) => {\n      const meta = this.chart.getDatasetMeta(datasetIndex);\n      if (!meta) {\n        throw new Error('Cannot find a dataset at index ' + datasetIndex);\n      }\n      return {\n        datasetIndex,\n        element: meta.data[index],\n        index,\n      };\n    });\n    const changed = !_elementsEqual(lastActive, active);\n    const positionChanged = this._positionChanged(active, eventPosition);\n    if (changed || positionChanged) {\n      this._active = active;\n      this._eventPosition = eventPosition;\n      this._ignoreReplayEvents = true;\n      this.update(true);\n    }\n  }\n  handleEvent(e, replay, inChartArea = true) {\n    if (replay && this._ignoreReplayEvents) {\n      return false;\n    }\n    this._ignoreReplayEvents = false;\n    const options = this.options;\n    const lastActive = this._active || [];\n    const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n    const positionChanged = this._positionChanged(active, e);\n    const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n    if (changed) {\n      this._active = active;\n      if (options.enabled || options.external) {\n        this._eventPosition = {\n          x: e.x,\n          y: e.y\n        };\n        this.update(true, replay);\n      }\n    }\n    return changed;\n  }\n  _getActiveElements(e, lastActive, replay, inChartArea) {\n    const options = this.options;\n    if (e.type === 'mouseout') {\n      return [];\n    }\n    if (!inChartArea) {\n      return lastActive;\n    }\n    const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n    if (options.reverse) {\n      active.reverse();\n    }\n    return active;\n  }\n  _positionChanged(active, e) {\n    const {caretX, caretY, options} = this;\n    const position = positioners[options.position].call(this, active, e);\n    return position !== false && (caretX !== position.x || caretY !== position.y);\n  }\n}\nTooltip.positioners = positioners;\nvar plugin_tooltip = {\n  id: 'tooltip',\n  _element: Tooltip,\n  positioners,\n  afterInit(chart, _args, options) {\n    if (options) {\n      chart.tooltip = new Tooltip({chart, options});\n    }\n  },\n  beforeUpdate(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n  reset(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n  afterDraw(chart) {\n    const tooltip = chart.tooltip;\n    if (tooltip && tooltip._willRender()) {\n      const args = {\n        tooltip\n      };\n      if (chart.notifyPlugins('beforeTooltipDraw', args) === false) {\n        return;\n      }\n      tooltip.draw(chart.ctx);\n      chart.notifyPlugins('afterTooltipDraw', args);\n    }\n  },\n  afterEvent(chart, args) {\n    if (chart.tooltip) {\n      const useFinalPosition = args.replay;\n      if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n        args.changed = true;\n      }\n    }\n  },\n  defaults: {\n    enabled: true,\n    external: null,\n    position: 'average',\n    backgroundColor: 'rgba(0,0,0,0.8)',\n    titleColor: '#fff',\n    titleFont: {\n      weight: 'bold',\n    },\n    titleSpacing: 2,\n    titleMarginBottom: 6,\n    titleAlign: 'left',\n    bodyColor: '#fff',\n    bodySpacing: 2,\n    bodyFont: {\n    },\n    bodyAlign: 'left',\n    footerColor: '#fff',\n    footerSpacing: 2,\n    footerMarginTop: 6,\n    footerFont: {\n      weight: 'bold',\n    },\n    footerAlign: 'left',\n    padding: 6,\n    caretPadding: 2,\n    caretSize: 5,\n    cornerRadius: 6,\n    boxHeight: (ctx, opts) => opts.bodyFont.size,\n    boxWidth: (ctx, opts) => opts.bodyFont.size,\n    multiKeyBackground: '#fff',\n    displayColors: true,\n    boxPadding: 0,\n    borderColor: 'rgba(0,0,0,0)',\n    borderWidth: 0,\n    animation: {\n      duration: 400,\n      easing: 'easeOutQuart',\n    },\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n      },\n      opacity: {\n        easing: 'linear',\n        duration: 200\n      }\n    },\n    callbacks: {\n      beforeTitle: noop,\n      title(tooltipItems) {\n        if (tooltipItems.length > 0) {\n          const item = tooltipItems[0];\n          const labels = item.chart.data.labels;\n          const labelCount = labels ? labels.length : 0;\n          if (this && this.options && this.options.mode === 'dataset') {\n            return item.dataset.label || '';\n          } else if (item.label) {\n            return item.label;\n          } else if (labelCount > 0 && item.dataIndex < labelCount) {\n            return labels[item.dataIndex];\n          }\n        }\n        return '';\n      },\n      afterTitle: noop,\n      beforeBody: noop,\n      beforeLabel: noop,\n      label(tooltipItem) {\n        if (this && this.options && this.options.mode === 'dataset') {\n          return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n        }\n        let label = tooltipItem.dataset.label || '';\n        if (label) {\n          label += ': ';\n        }\n        const value = tooltipItem.formattedValue;\n        if (!isNullOrUndef(value)) {\n          label += value;\n        }\n        return label;\n      },\n      labelColor(tooltipItem) {\n        const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n        const options = meta.controller.getStyle(tooltipItem.dataIndex);\n        return {\n          borderColor: options.borderColor,\n          backgroundColor: options.backgroundColor,\n          borderWidth: options.borderWidth,\n          borderDash: options.borderDash,\n          borderDashOffset: options.borderDashOffset,\n          borderRadius: 0,\n        };\n      },\n      labelTextColor() {\n        return this.options.bodyColor;\n      },\n      labelPointStyle(tooltipItem) {\n        const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n        const options = meta.controller.getStyle(tooltipItem.dataIndex);\n        return {\n          pointStyle: options.pointStyle,\n          rotation: options.rotation,\n        };\n      },\n      afterLabel: noop,\n      afterBody: noop,\n      beforeFooter: noop,\n      footer: noop,\n      afterFooter: noop\n    }\n  },\n  defaultRoutes: {\n    bodyFont: 'font',\n    footerFont: 'font',\n    titleFont: 'font'\n  },\n  descriptors: {\n    _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n    _indexable: false,\n    callbacks: {\n      _scriptable: false,\n      _indexable: false,\n    },\n    animation: {\n      _fallback: false\n    },\n    animations: {\n      _fallback: 'animation'\n    }\n  },\n  additionalOptionScopes: ['interaction']\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n  if (typeof raw === 'string') {\n    index = labels.push(raw) - 1;\n    addedLabels.unshift({index, label: raw});\n  } else if (isNaN(raw)) {\n    index = null;\n  }\n  return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n  const first = labels.indexOf(raw);\n  if (first === -1) {\n    return addIfString(labels, raw, index, addedLabels);\n  }\n  const last = labels.lastIndexOf(raw);\n  return first !== last ? index : first;\n}\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\nclass CategoryScale extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this._startValue = undefined;\n    this._valueRange = 0;\n    this._addedLabels = [];\n  }\n  init(scaleOptions) {\n    const added = this._addedLabels;\n    if (added.length) {\n      const labels = this.getLabels();\n      for (const {index, label} of added) {\n        if (labels[index] === label) {\n          labels.splice(index, 1);\n        }\n      }\n      this._addedLabels = [];\n    }\n    super.init(scaleOptions);\n  }\n  parse(raw, index) {\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    const labels = this.getLabels();\n    index = isFinite(index) && labels[index] === raw ? index\n      : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n    return validIndex(index, labels.length - 1);\n  }\n  determineDataLimits() {\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let {min, max} = this.getMinMax(true);\n    if (this.options.bounds === 'ticks') {\n      if (!minDefined) {\n        min = 0;\n      }\n      if (!maxDefined) {\n        max = this.getLabels().length - 1;\n      }\n    }\n    this.min = min;\n    this.max = max;\n  }\n  buildTicks() {\n    const min = this.min;\n    const max = this.max;\n    const offset = this.options.offset;\n    const ticks = [];\n    let labels = this.getLabels();\n    labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n    this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n    this._startValue = this.min - (offset ? 0.5 : 0);\n    for (let value = min; value <= max; value++) {\n      ticks.push({value});\n    }\n    return ticks;\n  }\n  getLabelForValue(value) {\n    const labels = this.getLabels();\n    if (value >= 0 && value < labels.length) {\n      return labels[value];\n    }\n    return value;\n  }\n  configure() {\n    super.configure();\n    if (!this.isHorizontal()) {\n      this._reversePixels = !this._reversePixels;\n    }\n  }\n  getPixelForValue(value) {\n    if (typeof value !== 'number') {\n      value = this.parse(value);\n    }\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n  getPixelForTick(index) {\n    const ticks = this.ticks;\n    if (index < 0 || index > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index].value);\n  }\n  getValueForPixel(pixel) {\n    return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n  }\n  getBasePixel() {\n    return this.bottom;\n  }\n}\nCategoryScale.id = 'category';\nCategoryScale.defaults = {\n  ticks: {\n    callback: CategoryScale.prototype.getLabelForValue\n  }\n};\n\nfunction generateTicks$1(generationOptions, dataRange) {\n  const ticks = [];\n  const MIN_SPACING = 1e-14;\n  const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n  const unit = step || 1;\n  const maxSpaces = maxTicks - 1;\n  const {min: rmin, max: rmax} = dataRange;\n  const minDefined = !isNullOrUndef(min);\n  const maxDefined = !isNullOrUndef(max);\n  const countDefined = !isNullOrUndef(count);\n  const minSpacing = (rmax - rmin) / (maxDigits + 1);\n  let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n  let factor, niceMin, niceMax, numSpaces;\n  if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n    return [{value: rmin}, {value: rmax}];\n  }\n  numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n  if (numSpaces > maxSpaces) {\n    spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n  }\n  if (!isNullOrUndef(precision)) {\n    factor = Math.pow(10, precision);\n    spacing = Math.ceil(spacing * factor) / factor;\n  }\n  if (bounds === 'ticks') {\n    niceMin = Math.floor(rmin / spacing) * spacing;\n    niceMax = Math.ceil(rmax / spacing) * spacing;\n  } else {\n    niceMin = rmin;\n    niceMax = rmax;\n  }\n  if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n    numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n    spacing = (max - min) / numSpaces;\n    niceMin = min;\n    niceMax = max;\n  } else if (countDefined) {\n    niceMin = minDefined ? min : niceMin;\n    niceMax = maxDefined ? max : niceMax;\n    numSpaces = count - 1;\n    spacing = (niceMax - niceMin) / numSpaces;\n  } else {\n    numSpaces = (niceMax - niceMin) / spacing;\n    if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n      numSpaces = Math.round(numSpaces);\n    } else {\n      numSpaces = Math.ceil(numSpaces);\n    }\n  }\n  const decimalPlaces = Math.max(\n    _decimalPlaces(spacing),\n    _decimalPlaces(niceMin)\n  );\n  factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n  niceMin = Math.round(niceMin * factor) / factor;\n  niceMax = Math.round(niceMax * factor) / factor;\n  let j = 0;\n  if (minDefined) {\n    if (includeBounds && niceMin !== min) {\n      ticks.push({value: min});\n      if (niceMin < min) {\n        j++;\n      }\n      if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n        j++;\n      }\n    } else if (niceMin < min) {\n      j++;\n    }\n  }\n  for (; j < numSpaces; ++j) {\n    ticks.push({value: Math.round((niceMin + j * spacing) * factor) / factor});\n  }\n  if (maxDefined && includeBounds && niceMax !== max) {\n    if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n      ticks[ticks.length - 1].value = max;\n    } else {\n      ticks.push({value: max});\n    }\n  } else if (!maxDefined || niceMax === max) {\n    ticks.push({value: niceMax});\n  }\n  return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n  const rad = toRadians(minRotation);\n  const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n  const length = 0.75 * minSpacing * ('' + value).length;\n  return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this.start = undefined;\n    this.end = undefined;\n    this._startValue = undefined;\n    this._endValue = undefined;\n    this._valueRange = 0;\n  }\n  parse(raw, index) {\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n      return null;\n    }\n    return +raw;\n  }\n  handleTickRangeOptions() {\n    const {beginAtZero} = this.options;\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let {min, max} = this;\n    const setMin = v => (min = minDefined ? min : v);\n    const setMax = v => (max = maxDefined ? max : v);\n    if (beginAtZero) {\n      const minSign = sign(min);\n      const maxSign = sign(max);\n      if (minSign < 0 && maxSign < 0) {\n        setMax(0);\n      } else if (minSign > 0 && maxSign > 0) {\n        setMin(0);\n      }\n    }\n    if (min === max) {\n      let offset = 1;\n      if (max >= Number.MAX_SAFE_INTEGER || min <= Number.MIN_SAFE_INTEGER) {\n        offset = Math.abs(max * 0.05);\n      }\n      setMax(max + offset);\n      if (!beginAtZero) {\n        setMin(min - offset);\n      }\n    }\n    this.min = min;\n    this.max = max;\n  }\n  getTickLimit() {\n    const tickOpts = this.options.ticks;\n    let {maxTicksLimit, stepSize} = tickOpts;\n    let maxTicks;\n    if (stepSize) {\n      maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n      if (maxTicks > 1000) {\n        console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n        maxTicks = 1000;\n      }\n    } else {\n      maxTicks = this.computeTickLimit();\n      maxTicksLimit = maxTicksLimit || 11;\n    }\n    if (maxTicksLimit) {\n      maxTicks = Math.min(maxTicksLimit, maxTicks);\n    }\n    return maxTicks;\n  }\n  computeTickLimit() {\n    return Number.POSITIVE_INFINITY;\n  }\n  buildTicks() {\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n    let maxTicks = this.getTickLimit();\n    maxTicks = Math.max(2, maxTicks);\n    const numericGeneratorOptions = {\n      maxTicks,\n      bounds: opts.bounds,\n      min: opts.min,\n      max: opts.max,\n      precision: tickOpts.precision,\n      step: tickOpts.stepSize,\n      count: tickOpts.count,\n      maxDigits: this._maxDigits(),\n      horizontal: this.isHorizontal(),\n      minRotation: tickOpts.minRotation || 0,\n      includeBounds: tickOpts.includeBounds !== false\n    };\n    const dataRange = this._range || this;\n    const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n    if (opts.bounds === 'ticks') {\n      _setMinAndMaxByKey(ticks, this, 'value');\n    }\n    if (opts.reverse) {\n      ticks.reverse();\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n    return ticks;\n  }\n  configure() {\n    const ticks = this.ticks;\n    let start = this.min;\n    let end = this.max;\n    super.configure();\n    if (this.options.offset && ticks.length) {\n      const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n      start -= offset;\n      end += offset;\n    }\n    this._startValue = start;\n    this._endValue = end;\n    this._valueRange = end - start;\n  }\n  getLabelForValue(value) {\n    return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n}\n\nclass LinearScale extends LinearScaleBase {\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(true);\n    this.min = isNumberFinite(min) ? min : 0;\n    this.max = isNumberFinite(max) ? max : 1;\n    this.handleTickRangeOptions();\n  }\n  computeTickLimit() {\n    const horizontal = this.isHorizontal();\n    const length = horizontal ? this.width : this.height;\n    const minRotation = toRadians(this.options.ticks.minRotation);\n    const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n    const tickFont = this._resolveTickFontOptions(0);\n    return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n  }\n  getPixelForValue(value) {\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n  getValueForPixel(pixel) {\n    return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n  }\n}\nLinearScale.id = 'linear';\nLinearScale.defaults = {\n  ticks: {\n    callback: Ticks.formatters.numeric\n  }\n};\n\nfunction isMajor(tickVal) {\n  const remain = tickVal / (Math.pow(10, Math.floor(log10(tickVal))));\n  return remain === 1;\n}\nfunction generateTicks(generationOptions, dataRange) {\n  const endExp = Math.floor(log10(dataRange.max));\n  const endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n  const ticks = [];\n  let tickVal = finiteOrDefault(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));\n  let exp = Math.floor(log10(tickVal));\n  let significand = Math.floor(tickVal / Math.pow(10, exp));\n  let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n  do {\n    ticks.push({value: tickVal, major: isMajor(tickVal)});\n    ++significand;\n    if (significand === 10) {\n      significand = 1;\n      ++exp;\n      precision = exp >= 0 ? 1 : precision;\n    }\n    tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\n  } while (exp < endExp || (exp === endExp && significand < endSignificand));\n  const lastTick = finiteOrDefault(generationOptions.max, tickVal);\n  ticks.push({value: lastTick, major: isMajor(tickVal)});\n  return ticks;\n}\nclass LogarithmicScale extends Scale {\n  constructor(cfg) {\n    super(cfg);\n    this.start = undefined;\n    this.end = undefined;\n    this._startValue = undefined;\n    this._valueRange = 0;\n  }\n  parse(raw, index) {\n    const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n    if (value === 0) {\n      this._zero = true;\n      return undefined;\n    }\n    return isNumberFinite(value) && value > 0 ? value : null;\n  }\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(true);\n    this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n    this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n    if (this.options.beginAtZero) {\n      this._zero = true;\n    }\n    this.handleTickRangeOptions();\n  }\n  handleTickRangeOptions() {\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let min = this.min;\n    let max = this.max;\n    const setMin = v => (min = minDefined ? min : v);\n    const setMax = v => (max = maxDefined ? max : v);\n    const exp = (v, m) => Math.pow(10, Math.floor(log10(v)) + m);\n    if (min === max) {\n      if (min <= 0) {\n        setMin(1);\n        setMax(10);\n      } else {\n        setMin(exp(min, -1));\n        setMax(exp(max, +1));\n      }\n    }\n    if (min <= 0) {\n      setMin(exp(max, -1));\n    }\n    if (max <= 0) {\n      setMax(exp(min, +1));\n    }\n    if (this._zero && this.min !== this._suggestedMin && min === exp(this.min, 0)) {\n      setMin(exp(min, -1));\n    }\n    this.min = min;\n    this.max = max;\n  }\n  buildTicks() {\n    const opts = this.options;\n    const generationOptions = {\n      min: this._userMin,\n      max: this._userMax\n    };\n    const ticks = generateTicks(generationOptions, this);\n    if (opts.bounds === 'ticks') {\n      _setMinAndMaxByKey(ticks, this, 'value');\n    }\n    if (opts.reverse) {\n      ticks.reverse();\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n    return ticks;\n  }\n  getLabelForValue(value) {\n    return value === undefined\n      ? '0'\n      : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n  configure() {\n    const start = this.min;\n    super.configure();\n    this._startValue = log10(start);\n    this._valueRange = log10(this.max) - log10(start);\n  }\n  getPixelForValue(value) {\n    if (value === undefined || value === 0) {\n      value = this.min;\n    }\n    if (value === null || isNaN(value)) {\n      return NaN;\n    }\n    return this.getPixelForDecimal(value === this.min\n      ? 0\n      : (log10(value) - this._startValue) / this._valueRange);\n  }\n  getValueForPixel(pixel) {\n    const decimal = this.getDecimalForPixel(pixel);\n    return Math.pow(10, this._startValue + decimal * this._valueRange);\n  }\n}\nLogarithmicScale.id = 'logarithmic';\nLogarithmicScale.defaults = {\n  ticks: {\n    callback: Ticks.formatters.logarithmic,\n    major: {\n      enabled: true\n    }\n  }\n};\n\nfunction getTickBackdropHeight(opts) {\n  const tickOpts = opts.ticks;\n  if (tickOpts.display && opts.display) {\n    const padding = toPadding(tickOpts.backdropPadding);\n    return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n  }\n  return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n  label = isArray(label) ? label : [label];\n  return {\n    w: _longestText(ctx, font.string, label),\n    h: label.length * font.lineHeight\n  };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n  if (angle === min || angle === max) {\n    return {\n      start: pos - (size / 2),\n      end: pos + (size / 2)\n    };\n  } else if (angle < min || angle > max) {\n    return {\n      start: pos - size,\n      end: pos\n    };\n  }\n  return {\n    start: pos,\n    end: pos + size\n  };\n}\nfunction fitWithPointLabels(scale) {\n  const orig = {\n    l: scale.left + scale._padding.left,\n    r: scale.right - scale._padding.right,\n    t: scale.top + scale._padding.top,\n    b: scale.bottom - scale._padding.bottom\n  };\n  const limits = Object.assign({}, orig);\n  const labelSizes = [];\n  const padding = [];\n  const valueCount = scale._pointLabels.length;\n  const pointLabelOpts = scale.options.pointLabels;\n  const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n  for (let i = 0; i < valueCount; i++) {\n    const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n    padding[i] = opts.padding;\n    const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n    const plFont = toFont(opts.font);\n    const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n    labelSizes[i] = textSize;\n    const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n    const angle = Math.round(toDegrees(angleRadians));\n    const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n    const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n    updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n  }\n  scale.setCenterPoint(\n    orig.l - limits.l,\n    limits.r - orig.r,\n    orig.t - limits.t,\n    limits.b - orig.b\n  );\n  scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n  const sin = Math.abs(Math.sin(angle));\n  const cos = Math.abs(Math.cos(angle));\n  let x = 0;\n  let y = 0;\n  if (hLimits.start < orig.l) {\n    x = (orig.l - hLimits.start) / sin;\n    limits.l = Math.min(limits.l, orig.l - x);\n  } else if (hLimits.end > orig.r) {\n    x = (hLimits.end - orig.r) / sin;\n    limits.r = Math.max(limits.r, orig.r + x);\n  }\n  if (vLimits.start < orig.t) {\n    y = (orig.t - vLimits.start) / cos;\n    limits.t = Math.min(limits.t, orig.t - y);\n  } else if (vLimits.end > orig.b) {\n    y = (vLimits.end - orig.b) / cos;\n    limits.b = Math.max(limits.b, orig.b + y);\n  }\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n  const items = [];\n  const valueCount = scale._pointLabels.length;\n  const opts = scale.options;\n  const extra = getTickBackdropHeight(opts) / 2;\n  const outerDistance = scale.drawingArea;\n  const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;\n  for (let i = 0; i < valueCount; i++) {\n    const pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + padding[i], additionalAngle);\n    const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n    const size = labelSizes[i];\n    const y = yForAngle(pointLabelPosition.y, size.h, angle);\n    const textAlign = getTextAlignForAngle(angle);\n    const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n    items.push({\n      x: pointLabelPosition.x,\n      y,\n      textAlign,\n      left,\n      top: y,\n      right: left + size.w,\n      bottom: y + size.h\n    });\n  }\n  return items;\n}\nfunction getTextAlignForAngle(angle) {\n  if (angle === 0 || angle === 180) {\n    return 'center';\n  } else if (angle < 180) {\n    return 'left';\n  }\n  return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n  if (align === 'right') {\n    x -= w;\n  } else if (align === 'center') {\n    x -= (w / 2);\n  }\n  return x;\n}\nfunction yForAngle(y, h, angle) {\n  if (angle === 90 || angle === 270) {\n    y -= (h / 2);\n  } else if (angle > 270 || angle < 90) {\n    y -= h;\n  }\n  return y;\n}\nfunction drawPointLabels(scale, labelCount) {\n  const {ctx, options: {pointLabels}} = scale;\n  for (let i = labelCount - 1; i >= 0; i--) {\n    const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n    const plFont = toFont(optsAtIndex.font);\n    const {x, y, textAlign, left, top, right, bottom} = scale._pointLabelItems[i];\n    const {backdropColor} = optsAtIndex;\n    if (!isNullOrUndef(backdropColor)) {\n      const borderRadius = toTRBLCorners(optsAtIndex.borderRadius);\n      const padding = toPadding(optsAtIndex.backdropPadding);\n      ctx.fillStyle = backdropColor;\n      const backdropLeft = left - padding.left;\n      const backdropTop = top - padding.top;\n      const backdropWidth = right - left + padding.width;\n      const backdropHeight = bottom - top + padding.height;\n      if (Object.values(borderRadius).some(v => v !== 0)) {\n        ctx.beginPath();\n        addRoundedRectPath(ctx, {\n          x: backdropLeft,\n          y: backdropTop,\n          w: backdropWidth,\n          h: backdropHeight,\n          radius: borderRadius,\n        });\n        ctx.fill();\n      } else {\n        ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n      }\n    }\n    renderText(\n      ctx,\n      scale._pointLabels[i],\n      x,\n      y + (plFont.lineHeight / 2),\n      plFont,\n      {\n        color: optsAtIndex.color,\n        textAlign: textAlign,\n        textBaseline: 'middle'\n      }\n    );\n  }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n  const {ctx} = scale;\n  if (circular) {\n    ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n  } else {\n    let pointPosition = scale.getPointPosition(0, radius);\n    ctx.moveTo(pointPosition.x, pointPosition.y);\n    for (let i = 1; i < labelCount; i++) {\n      pointPosition = scale.getPointPosition(i, radius);\n      ctx.lineTo(pointPosition.x, pointPosition.y);\n    }\n  }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount) {\n  const ctx = scale.ctx;\n  const circular = gridLineOpts.circular;\n  const {color, lineWidth} = gridLineOpts;\n  if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n    return;\n  }\n  ctx.save();\n  ctx.strokeStyle = color;\n  ctx.lineWidth = lineWidth;\n  ctx.setLineDash(gridLineOpts.borderDash);\n  ctx.lineDashOffset = gridLineOpts.borderDashOffset;\n  ctx.beginPath();\n  pathRadiusLine(scale, radius, circular, labelCount);\n  ctx.closePath();\n  ctx.stroke();\n  ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n  return createContext(parent, {\n    label,\n    index,\n    type: 'pointLabel'\n  });\n}\nclass RadialLinearScale extends LinearScaleBase {\n  constructor(cfg) {\n    super(cfg);\n    this.xCenter = undefined;\n    this.yCenter = undefined;\n    this.drawingArea = undefined;\n    this._pointLabels = [];\n    this._pointLabelItems = [];\n  }\n  setDimensions() {\n    const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n    const w = this.width = this.maxWidth - padding.width;\n    const h = this.height = this.maxHeight - padding.height;\n    this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n    this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n    this.drawingArea = Math.floor(Math.min(w, h) / 2);\n  }\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(false);\n    this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n    this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n    this.handleTickRangeOptions();\n  }\n  computeTickLimit() {\n    return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n  }\n  generateTickLabels(ticks) {\n    LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n    this._pointLabels = this.getLabels()\n      .map((value, index) => {\n        const label = callback(this.options.pointLabels.callback, [value, index], this);\n        return label || label === 0 ? label : '';\n      })\n      .filter((v, i) => this.chart.getDataVisibility(i));\n  }\n  fit() {\n    const opts = this.options;\n    if (opts.display && opts.pointLabels.display) {\n      fitWithPointLabels(this);\n    } else {\n      this.setCenterPoint(0, 0, 0, 0);\n    }\n  }\n  setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n    this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n    this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n    this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n  }\n  getIndexAngle(index) {\n    const angleMultiplier = TAU / (this._pointLabels.length || 1);\n    const startAngle = this.options.startAngle || 0;\n    return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n  }\n  getDistanceFromCenterForValue(value) {\n    if (isNullOrUndef(value)) {\n      return NaN;\n    }\n    const scalingFactor = this.drawingArea / (this.max - this.min);\n    if (this.options.reverse) {\n      return (this.max - value) * scalingFactor;\n    }\n    return (value - this.min) * scalingFactor;\n  }\n  getValueForDistanceFromCenter(distance) {\n    if (isNullOrUndef(distance)) {\n      return NaN;\n    }\n    const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n    return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n  }\n  getPointLabelContext(index) {\n    const pointLabels = this._pointLabels || [];\n    if (index >= 0 && index < pointLabels.length) {\n      const pointLabel = pointLabels[index];\n      return createPointLabelContext(this.getContext(), index, pointLabel);\n    }\n  }\n  getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n    const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n    return {\n      x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n      y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n      angle\n    };\n  }\n  getPointPositionForValue(index, value) {\n    return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n  }\n  getBasePosition(index) {\n    return this.getPointPositionForValue(index || 0, this.getBaseValue());\n  }\n  getPointLabelPosition(index) {\n    const {left, top, right, bottom} = this._pointLabelItems[index];\n    return {\n      left,\n      top,\n      right,\n      bottom,\n    };\n  }\n  drawBackground() {\n    const {backgroundColor, grid: {circular}} = this.options;\n    if (backgroundColor) {\n      const ctx = this.ctx;\n      ctx.save();\n      ctx.beginPath();\n      pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n      ctx.closePath();\n      ctx.fillStyle = backgroundColor;\n      ctx.fill();\n      ctx.restore();\n    }\n  }\n  drawGrid() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const {angleLines, grid} = opts;\n    const labelCount = this._pointLabels.length;\n    let i, offset, position;\n    if (opts.pointLabels.display) {\n      drawPointLabels(this, labelCount);\n    }\n    if (grid.display) {\n      this.ticks.forEach((tick, index) => {\n        if (index !== 0) {\n          offset = this.getDistanceFromCenterForValue(tick.value);\n          const optsAtIndex = grid.setContext(this.getContext(index - 1));\n          drawRadiusLine(this, optsAtIndex, offset, labelCount);\n        }\n      });\n    }\n    if (angleLines.display) {\n      ctx.save();\n      for (i = labelCount - 1; i >= 0; i--) {\n        const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n        const {color, lineWidth} = optsAtIndex;\n        if (!lineWidth || !color) {\n          continue;\n        }\n        ctx.lineWidth = lineWidth;\n        ctx.strokeStyle = color;\n        ctx.setLineDash(optsAtIndex.borderDash);\n        ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n        offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n        position = this.getPointPosition(i, offset);\n        ctx.beginPath();\n        ctx.moveTo(this.xCenter, this.yCenter);\n        ctx.lineTo(position.x, position.y);\n        ctx.stroke();\n      }\n      ctx.restore();\n    }\n  }\n  drawBorder() {}\n  drawLabels() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n    if (!tickOpts.display) {\n      return;\n    }\n    const startAngle = this.getIndexAngle(0);\n    let offset, width;\n    ctx.save();\n    ctx.translate(this.xCenter, this.yCenter);\n    ctx.rotate(startAngle);\n    ctx.textAlign = 'center';\n    ctx.textBaseline = 'middle';\n    this.ticks.forEach((tick, index) => {\n      if (index === 0 && !opts.reverse) {\n        return;\n      }\n      const optsAtIndex = tickOpts.setContext(this.getContext(index));\n      const tickFont = toFont(optsAtIndex.font);\n      offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n      if (optsAtIndex.showLabelBackdrop) {\n        ctx.font = tickFont.string;\n        width = ctx.measureText(tick.label).width;\n        ctx.fillStyle = optsAtIndex.backdropColor;\n        const padding = toPadding(optsAtIndex.backdropPadding);\n        ctx.fillRect(\n          -width / 2 - padding.left,\n          -offset - tickFont.size / 2 - padding.top,\n          width + padding.width,\n          tickFont.size + padding.height\n        );\n      }\n      renderText(ctx, tick.label, 0, -offset, tickFont, {\n        color: optsAtIndex.color,\n      });\n    });\n    ctx.restore();\n  }\n  drawTitle() {}\n}\nRadialLinearScale.id = 'radialLinear';\nRadialLinearScale.defaults = {\n  display: true,\n  animate: true,\n  position: 'chartArea',\n  angleLines: {\n    display: true,\n    lineWidth: 1,\n    borderDash: [],\n    borderDashOffset: 0.0\n  },\n  grid: {\n    circular: false\n  },\n  startAngle: 0,\n  ticks: {\n    showLabelBackdrop: true,\n    callback: Ticks.formatters.numeric\n  },\n  pointLabels: {\n    backdropColor: undefined,\n    backdropPadding: 2,\n    display: true,\n    font: {\n      size: 10\n    },\n    callback(label) {\n      return label;\n    },\n    padding: 5,\n    centerPointLabels: false\n  }\n};\nRadialLinearScale.defaultRoutes = {\n  'angleLines.color': 'borderColor',\n  'pointLabels.color': 'color',\n  'ticks.color': 'color'\n};\nRadialLinearScale.descriptors = {\n  angleLines: {\n    _fallback: 'grid'\n  }\n};\n\nconst INTERVALS = {\n  millisecond: {common: true, size: 1, steps: 1000},\n  second: {common: true, size: 1000, steps: 60},\n  minute: {common: true, size: 60000, steps: 60},\n  hour: {common: true, size: 3600000, steps: 24},\n  day: {common: true, size: 86400000, steps: 30},\n  week: {common: false, size: 604800000, steps: 4},\n  month: {common: true, size: 2.628e9, steps: 12},\n  quarter: {common: false, size: 7.884e9, steps: 4},\n  year: {common: true, size: 3.154e10}\n};\nconst UNITS = (Object.keys(INTERVALS));\nfunction sorter(a, b) {\n  return a - b;\n}\nfunction parse(scale, input) {\n  if (isNullOrUndef(input)) {\n    return null;\n  }\n  const adapter = scale._adapter;\n  const {parser, round, isoWeekday} = scale._parseOpts;\n  let value = input;\n  if (typeof parser === 'function') {\n    value = parser(value);\n  }\n  if (!isNumberFinite(value)) {\n    value = typeof parser === 'string'\n      ? adapter.parse(value, parser)\n      : adapter.parse(value);\n  }\n  if (value === null) {\n    return null;\n  }\n  if (round) {\n    value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n      ? adapter.startOf(value, 'isoWeek', isoWeekday)\n      : adapter.startOf(value, round);\n  }\n  return +value;\n}\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n  const ilen = UNITS.length;\n  for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n    const interval = INTERVALS[UNITS[i]];\n    const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n    if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n      return UNITS[i];\n    }\n  }\n  return UNITS[ilen - 1];\n}\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n  for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n    const unit = UNITS[i];\n    if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n      return unit;\n    }\n  }\n  return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\nfunction determineMajorUnit(unit) {\n  for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n    if (INTERVALS[UNITS[i]].common) {\n      return UNITS[i];\n    }\n  }\n}\nfunction addTick(ticks, time, timestamps) {\n  if (!timestamps) {\n    ticks[time] = true;\n  } else if (timestamps.length) {\n    const {lo, hi} = _lookup(timestamps, time);\n    const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n    ticks[timestamp] = true;\n  }\n}\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n  const adapter = scale._adapter;\n  const first = +adapter.startOf(ticks[0].value, majorUnit);\n  const last = ticks[ticks.length - 1].value;\n  let major, index;\n  for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n    index = map[major];\n    if (index >= 0) {\n      ticks[index].major = true;\n    }\n  }\n  return ticks;\n}\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n  const ticks = [];\n  const map = {};\n  const ilen = values.length;\n  let i, value;\n  for (i = 0; i < ilen; ++i) {\n    value = values[i];\n    map[value] = i;\n    ticks.push({\n      value,\n      major: false\n    });\n  }\n  return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n  constructor(props) {\n    super(props);\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n    this._unit = 'day';\n    this._majorUnit = undefined;\n    this._offsets = {};\n    this._normalized = false;\n    this._parseOpts = undefined;\n  }\n  init(scaleOpts, opts) {\n    const time = scaleOpts.time || (scaleOpts.time = {});\n    const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n    mergeIf(time.displayFormats, adapter.formats());\n    this._parseOpts = {\n      parser: time.parser,\n      round: time.round,\n      isoWeekday: time.isoWeekday\n    };\n    super.init(scaleOpts);\n    this._normalized = opts.normalized;\n  }\n  parse(raw, index) {\n    if (raw === undefined) {\n      return null;\n    }\n    return parse(this, raw);\n  }\n  beforeLayout() {\n    super.beforeLayout();\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n  }\n  determineDataLimits() {\n    const options = this.options;\n    const adapter = this._adapter;\n    const unit = options.time.unit || 'day';\n    let {min, max, minDefined, maxDefined} = this.getUserBounds();\n    function _applyBounds(bounds) {\n      if (!minDefined && !isNaN(bounds.min)) {\n        min = Math.min(min, bounds.min);\n      }\n      if (!maxDefined && !isNaN(bounds.max)) {\n        max = Math.max(max, bounds.max);\n      }\n    }\n    if (!minDefined || !maxDefined) {\n      _applyBounds(this._getLabelBounds());\n      if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n        _applyBounds(this.getMinMax(false));\n      }\n    }\n    min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n    max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n    this.min = Math.min(min, max - 1);\n    this.max = Math.max(min + 1, max);\n  }\n  _getLabelBounds() {\n    const arr = this.getLabelTimestamps();\n    let min = Number.POSITIVE_INFINITY;\n    let max = Number.NEGATIVE_INFINITY;\n    if (arr.length) {\n      min = arr[0];\n      max = arr[arr.length - 1];\n    }\n    return {min, max};\n  }\n  buildTicks() {\n    const options = this.options;\n    const timeOpts = options.time;\n    const tickOpts = options.ticks;\n    const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n    if (options.bounds === 'ticks' && timestamps.length) {\n      this.min = this._userMin || timestamps[0];\n      this.max = this._userMax || timestamps[timestamps.length - 1];\n    }\n    const min = this.min;\n    const max = this.max;\n    const ticks = _filterBetween(timestamps, min, max);\n    this._unit = timeOpts.unit || (tickOpts.autoSkip\n      ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n      : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n    this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n      : determineMajorUnit(this._unit);\n    this.initOffsets(timestamps);\n    if (options.reverse) {\n      ticks.reverse();\n    }\n    return ticksFromTimestamps(this, ticks, this._majorUnit);\n  }\n  afterAutoSkip() {\n    if (this.options.offsetAfterAutoskip) {\n      this.initOffsets(this.ticks.map(tick => +tick.value));\n    }\n  }\n  initOffsets(timestamps) {\n    let start = 0;\n    let end = 0;\n    let first, last;\n    if (this.options.offset && timestamps.length) {\n      first = this.getDecimalForValue(timestamps[0]);\n      if (timestamps.length === 1) {\n        start = 1 - first;\n      } else {\n        start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n      }\n      last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n      if (timestamps.length === 1) {\n        end = last;\n      } else {\n        end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n      }\n    }\n    const limit = timestamps.length < 3 ? 0.5 : 0.25;\n    start = _limitValue(start, 0, limit);\n    end = _limitValue(end, 0, limit);\n    this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n  }\n  _generate() {\n    const adapter = this._adapter;\n    const min = this.min;\n    const max = this.max;\n    const options = this.options;\n    const timeOpts = options.time;\n    const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n    const stepSize = valueOrDefault(timeOpts.stepSize, 1);\n    const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n    const hasWeekday = isNumber(weekday) || weekday === true;\n    const ticks = {};\n    let first = min;\n    let time, count;\n    if (hasWeekday) {\n      first = +adapter.startOf(first, 'isoWeek', weekday);\n    }\n    first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n    if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n      throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n    }\n    const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n    for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n      addTick(ticks, time, timestamps);\n    }\n    if (time === max || options.bounds === 'ticks' || count === 1) {\n      addTick(ticks, time, timestamps);\n    }\n    return Object.keys(ticks).sort((a, b) => a - b).map(x => +x);\n  }\n  getLabelForValue(value) {\n    const adapter = this._adapter;\n    const timeOpts = this.options.time;\n    if (timeOpts.tooltipFormat) {\n      return adapter.format(value, timeOpts.tooltipFormat);\n    }\n    return adapter.format(value, timeOpts.displayFormats.datetime);\n  }\n  _tickFormatFunction(time, index, ticks, format) {\n    const options = this.options;\n    const formats = options.time.displayFormats;\n    const unit = this._unit;\n    const majorUnit = this._majorUnit;\n    const minorFormat = unit && formats[unit];\n    const majorFormat = majorUnit && formats[majorUnit];\n    const tick = ticks[index];\n    const major = majorUnit && majorFormat && tick && tick.major;\n    const label = this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n    const formatter = options.ticks.callback;\n    return formatter ? callback(formatter, [label, index, ticks], this) : label;\n  }\n  generateTickLabels(ticks) {\n    let i, ilen, tick;\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      tick.label = this._tickFormatFunction(tick.value, i, ticks);\n    }\n  }\n  getDecimalForValue(value) {\n    return value === null ? NaN : (value - this.min) / (this.max - this.min);\n  }\n  getPixelForValue(value) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForValue(value);\n    return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n  }\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return this.min + pos * (this.max - this.min);\n  }\n  _getLabelSize(label) {\n    const ticksOpts = this.options.ticks;\n    const tickLabelWidth = this.ctx.measureText(label).width;\n    const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n    const cosRotation = Math.cos(angle);\n    const sinRotation = Math.sin(angle);\n    const tickFontSize = this._resolveTickFontOptions(0).size;\n    return {\n      w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n      h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n    };\n  }\n  _getLabelCapacity(exampleTime) {\n    const timeOpts = this.options.time;\n    const displayFormats = timeOpts.displayFormats;\n    const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n    const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n    const size = this._getLabelSize(exampleLabel);\n    const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n    return capacity > 0 ? capacity : 1;\n  }\n  getDataTimestamps() {\n    let timestamps = this._cache.data || [];\n    let i, ilen;\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const metas = this.getMatchingVisibleMetas();\n    if (this._normalized && metas.length) {\n      return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n    }\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n    }\n    return (this._cache.data = this.normalize(timestamps));\n  }\n  getLabelTimestamps() {\n    const timestamps = this._cache.labels || [];\n    let i, ilen;\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const labels = this.getLabels();\n    for (i = 0, ilen = labels.length; i < ilen; ++i) {\n      timestamps.push(parse(this, labels[i]));\n    }\n    return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n  }\n  normalize(values) {\n    return _arrayUnique(values.sort(sorter));\n  }\n}\nTimeScale.id = 'time';\nTimeScale.defaults = {\n  bounds: 'data',\n  adapters: {},\n  time: {\n    parser: false,\n    unit: false,\n    round: false,\n    isoWeekday: false,\n    minUnit: 'millisecond',\n    displayFormats: {}\n  },\n  ticks: {\n    source: 'auto',\n    major: {\n      enabled: false\n    }\n  }\n};\n\nfunction interpolate(table, val, reverse) {\n  let lo = 0;\n  let hi = table.length - 1;\n  let prevSource, nextSource, prevTarget, nextTarget;\n  if (reverse) {\n    if (val >= table[lo].pos && val <= table[hi].pos) {\n      ({lo, hi} = _lookupByKey(table, 'pos', val));\n    }\n    ({pos: prevSource, time: prevTarget} = table[lo]);\n    ({pos: nextSource, time: nextTarget} = table[hi]);\n  } else {\n    if (val >= table[lo].time && val <= table[hi].time) {\n      ({lo, hi} = _lookupByKey(table, 'time', val));\n    }\n    ({time: prevSource, pos: prevTarget} = table[lo]);\n    ({time: nextSource, pos: nextTarget} = table[hi]);\n  }\n  const span = nextSource - prevSource;\n  return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n  constructor(props) {\n    super(props);\n    this._table = [];\n    this._minPos = undefined;\n    this._tableRange = undefined;\n  }\n  initOffsets() {\n    const timestamps = this._getTimestampsForTable();\n    const table = this._table = this.buildLookupTable(timestamps);\n    this._minPos = interpolate(table, this.min);\n    this._tableRange = interpolate(table, this.max) - this._minPos;\n    super.initOffsets(timestamps);\n  }\n  buildLookupTable(timestamps) {\n    const {min, max} = this;\n    const items = [];\n    const table = [];\n    let i, ilen, prev, curr, next;\n    for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n      curr = timestamps[i];\n      if (curr >= min && curr <= max) {\n        items.push(curr);\n      }\n    }\n    if (items.length < 2) {\n      return [\n        {time: min, pos: 0},\n        {time: max, pos: 1}\n      ];\n    }\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      next = items[i + 1];\n      prev = items[i - 1];\n      curr = items[i];\n      if (Math.round((next + prev) / 2) !== curr) {\n        table.push({time: curr, pos: i / (ilen - 1)});\n      }\n    }\n    return table;\n  }\n  _getTimestampsForTable() {\n    let timestamps = this._cache.all || [];\n    if (timestamps.length) {\n      return timestamps;\n    }\n    const data = this.getDataTimestamps();\n    const label = this.getLabelTimestamps();\n    if (data.length && label.length) {\n      timestamps = this.normalize(data.concat(label));\n    } else {\n      timestamps = data.length ? data : label;\n    }\n    timestamps = this._cache.all = timestamps;\n    return timestamps;\n  }\n  getDecimalForValue(value) {\n    return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n  }\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n  }\n}\nTimeSeriesScale.id = 'timeseries';\nTimeSeriesScale.defaults = TimeScale.defaults;\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n  controllers,\n  elements,\n  plugins,\n  scales,\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, elements, layouts, plugins, registerables, registry, scales };\n", "import {  Chart, ArcElement, BarElement, BarController, CategoryScale, LinearScale, PieController, Legend, Title, Tooltip, SubTitle } from 'chart.js';\nChart.register( ArcElement, BarElement, BarController, CategoryScale, LinearScale, PieController, Legend, Title, Tooltip, SubTitle );\n\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"charts\"\nexport default class extends Controller {\n  \n  initPieChart( values, canvasId, legendElementId = false ) {\n    \n    var chartData = {\n      labels: [],\n      datasets: [{\n        data: [],\n        backgroundColor: [\n          '#0f5879',\n          '#177fae',\n          '#469dc4',\n          '#8ecae5',\n          '#c8eeff',\n          '#eeeeee',\n        ],\n        hoverOffset: 0\n      }]\n    };\n    \n    for (const item in sortObjectByKeys(values)) {\n      chartData.labels.push(item);\n      chartData.datasets[0].data.push(values[item]);\n    }\n    \n    const config = {\n      type: 'pie',\n      data: chartData,\n      options: {\n        responsive: true,\n        maintainAspectRatio: true,\n        borderColor: 'transparent',\n        plugins: {\n          htmlLegend: {\n            containerID: legendElementId\n          },\n          legend: {\n            display: false,\n          },\n          tooltip: {\n            backgroundColor: '#292929',\n            borderColor: '#cdcdcd',\n            borderWidth: 1,\n            padding: 3,\n            cornerRadius: 3,\n            caretSize: 0,\n            callbacks: {\n              label: function(item) {\n                return ' ' + item.label.replace(/^\\w/, (c) => c.toUpperCase())\n              },\n              footer: function(item) {\n                return item[0].formattedValue + '%'\n              }\n            }\n          }\n        }\n      },\n      plugins: [htmlLegendPlugin],\n    };\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    const pieChart = new Chart(ctx, config);\n    \n  }\n  \n  initBarChart( values, canvasId ) {\n    \n    var chartData = {\n      labels: [],\n      datasets: [{\n        \n        data: [],\n        backgroundColor: [\n          '#0f5879',\n          '#177fae',\n          '#469dc4',\n          '#8ecae5',\n          '#c8eeff',\n          '#eeeeee',\n        ]\n      }]\n    };\n    \n    \n    for (const item in sortObjectByKeys(values)) {\n      chartData.labels.push(item);\n      chartData.datasets[0].data.push(values[item]);\n    }\n    \n    let isDarkMode = document.documentElement.classList.contains('dark');\n    let textColor = isDarkMode ? 'rgb(209, 213, 219)' : 'rgb(107, 114, 128)';\n    \n    const config = {\n      type: 'bar',\n      data: chartData,\n      options: {\n        responsive: true,\n        maintainAspectRatio: true,\n        aspectRatio: 1.5,\n        plugins: {\n          legend: {\n            display: false,\n          },\n          tooltip: {\n            backgroundColor: '#292929',\n            borderColor: '#cdcdcd',\n            borderWidth: 1,\n            padding: 3,\n            cornerRadius: 3,\n            caretSize: 0,\n            callbacks: {\n              label: function(item) {\n                return ' ' + item.formattedValue + '%';\n              }\n            }\n          }\n        },\n        scales: {\n          x: {\n            grid: {\n              borderColor: 'rgba(156, 163, 175, 0.6)',\n              color: 'rgba(156, 163, 175, 0.6)'\n            },\n            ticks: {\n              color: textColor\n            }\n          },\n          y: {\n            grid: {\n              borderColor: 'rgba(156, 163, 175, 0.6)',\n              color: 'rgba(156, 163, 175, 0.6)'\n            },\n            ticks: {\n              color: isDarkMode ? 'rgb(209, 213, 219)' : 'rgb(107, 114, 128)',\n              callback: function(tick) {\n                return tick.toString() + '%';\n              }\n            }\n          }\n        }\n      },\n    };\n    \n    const ctx = document.getElementById(canvasId).getContext('2d');\n    const barChart = new Chart(ctx, config);\n    \n    document.addEventListener('themeChange', function(e) {\n      isDarkMode = document.documentElement.classList.contains('dark');\n      let textColor = isDarkMode ? 'rgb(209, 213, 219)' : 'rgb(107, 114, 128)';\n      barChart.options.scales.y.ticks.color = isDarkMode ? 'rgb(209, 213, 219)' : 'rgb(107, 114, 128)';\n      barChart.options.scales.x.ticks.color = isDarkMode ? 'rgb(209, 213, 219)' : 'rgb(107, 114, 128)';\n      barChart.update();\n    })\n  }\n}\n\n\n// Chart Plugin\nconst getOrCreateLegendList = (chart, id) => {\n  const legendContainer = document.getElementById(id);\n  let listContainer = legendContainer.querySelector('ul');\n\n  if (!listContainer) {\n    listContainer = document.createElement('ul');\n    listContainer.style.display = 'flex';\n    listContainer.style.flexDirection = 'column';\n    listContainer.style.margin = 0;\n    listContainer.style.padding = 0;\n\n    legendContainer.appendChild(listContainer);\n  }\n\n  return listContainer;\n};\n\nconst htmlLegendPlugin = {\n  id: 'htmlLegend',\n  afterUpdate(chart, args, options) {\n    const ul = getOrCreateLegendList(chart, options.containerID);\n\n    // Remove old legend items\n    while (ul.firstChild) {\n      ul.firstChild.remove();\n    }\n\n    // Reuse the built-in legendItems generator\n    const items = chart.options.plugins.legend.labels.generateLabels(chart);\n\n    items.forEach(item => {\n      const li = document.createElement('li');\n      li.style.alignItems = 'center';\n      li.style.cursor = 'pointer';\n      li.style.display = 'flex';\n      li.style.flexDirection = 'row';\n      li.style.marginLeft = '10px';\n\n      li.onclick = () => {\n        const {type} = chart.config;\n        if (type === 'pie' || type === 'doughnut') {\n          // Pie and doughnut charts only have a single dataset and visibility is per item\n          chart.toggleDataVisibility(item.index);\n        } else {\n          chart.setDatasetVisibility(item.datasetIndex, !chart.isDatasetVisible(item.datasetIndex));\n        }\n        chart.update();\n      };\n\n      // Color box\n      const boxSpan = document.createElement('span');\n      boxSpan.style.background = item.fillStyle;\n      // boxSpan.style.borderColor = item.strokeStyle;\n      // boxSpan.style.borderWidth = item.lineWidth + 'px';\n      boxSpan.style.display = 'inline-block';\n      boxSpan.style.height = '20px';\n      boxSpan.style.marginRight = '10px';\n      boxSpan.style.width = '20px';\n\n      // Text\n      const textContainer = document.createElement('p');\n      textContainer.style.color = item.fontColor;\n      textContainer.style.margin = 0;\n      textContainer.style.padding = 0;\n      textContainer.style.textDecoration = item.hidden ? 'line-through' : '';\n\n      const text = document.createTextNode(item.text);\n      textContainer.appendChild(text);\n\n      li.appendChild(boxSpan);\n      li.appendChild(textContainer);\n      ul.appendChild(li);\n    });\n  }\n};\n\nconst sortObjectByKeys = (object) => Object.fromEntries(\n  Object.entries(object).sort(([k1], [k2]) => k1 < k2 ? -1 : 1)\n)", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"dashboard\"\nexport default class extends Controller {\n  \n  static targets = ['activityFeed', 'activeUsersCount', 'demographicsAgeChart', 'demographicsGenderChart', 'totalViews', 'totalVisitors']\n  \n  \n  demographicsAgeChartTargetConnected() {\n    let that = this;\n    let demographicsAgeChartDataPromise = this.firebaseController.analyticsDataLast30Days();\n    demographicsAgeChartDataPromise.then(function(results) {\n      \n      if (results.demographics.age) {\n        let values = {}\n        for (const item in results.demographics.age) {\n          values[item] = results.demographics.age[item];\n        }\n        \n        that.chartController.initBarChart( values, 'demographicsAge', 'ageLegend');\n      }\n      \n    }, failureCallback);\n  }  \n  \n  demographicsGenderChartTargetConnected() {\n    let that = this;\n    let demographicsGenderChartDataPromise = this.firebaseController.analyticsDataLast30Days();\n    demographicsGenderChartDataPromise.then(function(results) {\n      \n      if (results.demographics.gender) {\n        let values = {}\n        for (const item in results.demographics.gender) {\n          values[item] = results.demographics.gender[item];\n        }\n        \n        that.chartController.initPieChart( values, 'demographicsGender', 'genderLegend');\n      }\n      \n    }, failureCallback);\n  }\n  \n  totalViewsTargetConnected() {\n    let that = this;\n    let totalViewsDataPromise = this.firebaseController.analyticsDataLast30Days();\n    totalViewsDataPromise.then(function(results) {\n      if (results.views) {\n        that.totalViewsTarget.innerHTML = results.views.toLocaleString();\n      }\n    }, failureCallback);\n  }  \n  \n  totalVisitorsTargetConnected() {\n    let that = this;\n    let totalVisitorsDataPromise = this.firebaseController.analyticsDataLast30Days();\n    totalVisitorsDataPromise.then(function(results) {\n      if (results.visits) {\n        that.totalVisitorsTarget.innerHTML = results.visits.toLocaleString();\n      }\n    }, failureCallback);\n  }\n  \n  get firebaseController() {\n    var activityFeedElement = document.getElementById('firebase')\n    return this.application.getControllerForElementAndIdentifier(activityFeedElement, 'firebase');\n  }  \n  \n  get chartController() {\n    var chartElement = document.getElementById('charts')\n    return this.application.getControllerForElementAndIdentifier(chartElement, 'charts');\n  }\n  \n}\n\nfunction failureCallback(err) {\n  console.log(\"An error occured: \" + err);\n}", "/**!\n * Sortable 1.15.0\n * @author\tRubaXa   <trash@rubaxa.org>\n * @author\towenm    <owen23355@gmail.com>\n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n  var keys = Object.keys(object);\n\n  if (Object.getOwnPropertySymbols) {\n    var symbols = Object.getOwnPropertySymbols(object);\n\n    if (enumerableOnly) {\n      symbols = symbols.filter(function (sym) {\n        return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n      });\n    }\n\n    keys.push.apply(keys, symbols);\n  }\n\n  return keys;\n}\n\nfunction _objectSpread2(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n\n    if (i % 2) {\n      ownKeys(Object(source), true).forEach(function (key) {\n        _defineProperty(target, key, source[key]);\n      });\n    } else if (Object.getOwnPropertyDescriptors) {\n      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n    } else {\n      ownKeys(Object(source)).forEach(function (key) {\n        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n      });\n    }\n  }\n\n  return target;\n}\n\nfunction _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n    _typeof = function (obj) {\n      return typeof obj;\n    };\n  } else {\n    _typeof = function (obj) {\n      return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    };\n  }\n\n  return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n\n    return target;\n  };\n\n  return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n  if (source == null) return {};\n  var target = {};\n  var sourceKeys = Object.keys(source);\n  var key, i;\n\n  for (i = 0; i < sourceKeys.length; i++) {\n    key = sourceKeys[i];\n    if (excluded.indexOf(key) >= 0) continue;\n    target[key] = source[key];\n  }\n\n  return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n  if (source == null) return {};\n\n  var target = _objectWithoutPropertiesLoose(source, excluded);\n\n  var key, i;\n\n  if (Object.getOwnPropertySymbols) {\n    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n    for (i = 0; i < sourceSymbolKeys.length; i++) {\n      key = sourceSymbolKeys[i];\n      if (excluded.indexOf(key) >= 0) continue;\n      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n      target[key] = source[key];\n    }\n  }\n\n  return target;\n}\n\nfunction _toConsumableArray(arr) {\n  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n  if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n  return arr2;\n}\n\nfunction _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n  if (typeof window !== 'undefined' && window.navigator) {\n    return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n  }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n  capture: false,\n  passive: false\n};\n\nfunction on(el, event, fn) {\n  el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n  el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n  if (!selector) return;\n  selector[0] === '>' && (selector = selector.substring(1));\n\n  if (el) {\n    try {\n      if (el.matches) {\n        return el.matches(selector);\n      } else if (el.msMatchesSelector) {\n        return el.msMatchesSelector(selector);\n      } else if (el.webkitMatchesSelector) {\n        return el.webkitMatchesSelector(selector);\n      }\n    } catch (_) {\n      return false;\n    }\n  }\n\n  return false;\n}\n\nfunction getParentOrHost(el) {\n  return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n  if (el) {\n    ctx = ctx || document;\n\n    do {\n      if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n        return el;\n      }\n\n      if (el === ctx) break;\n      /* jshint boss:true */\n    } while (el = getParentOrHost(el));\n  }\n\n  return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n  if (el && name) {\n    if (el.classList) {\n      el.classList[state ? 'add' : 'remove'](name);\n    } else {\n      var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n      el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n    }\n  }\n}\n\nfunction css(el, prop, val) {\n  var style = el && el.style;\n\n  if (style) {\n    if (val === void 0) {\n      if (document.defaultView && document.defaultView.getComputedStyle) {\n        val = document.defaultView.getComputedStyle(el, '');\n      } else if (el.currentStyle) {\n        val = el.currentStyle;\n      }\n\n      return prop === void 0 ? val : val[prop];\n    } else {\n      if (!(prop in style) && prop.indexOf('webkit') === -1) {\n        prop = '-webkit-' + prop;\n      }\n\n      style[prop] = val + (typeof val === 'string' ? '' : 'px');\n    }\n  }\n}\n\nfunction matrix(el, selfOnly) {\n  var appliedTransforms = '';\n\n  if (typeof el === 'string') {\n    appliedTransforms = el;\n  } else {\n    do {\n      var transform = css(el, 'transform');\n\n      if (transform && transform !== 'none') {\n        appliedTransforms = transform + ' ' + appliedTransforms;\n      }\n      /* jshint boss:true */\n\n    } while (!selfOnly && (el = el.parentNode));\n  }\n\n  var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n  /*jshint -W056 */\n\n  return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n  if (ctx) {\n    var list = ctx.getElementsByTagName(tagName),\n        i = 0,\n        n = list.length;\n\n    if (iterator) {\n      for (; i < n; i++) {\n        iterator(list[i], i);\n      }\n    }\n\n    return list;\n  }\n\n  return [];\n}\n\nfunction getWindowScrollingElement() {\n  var scrollingElement = document.scrollingElement;\n\n  if (scrollingElement) {\n    return scrollingElement;\n  } else {\n    return document.documentElement;\n  }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param  {HTMLElement} el                       The element whose boundingClientRect is wanted\n * @param  {[Boolean]} relativeToContainingBlock  Whether the rect should be relative to the containing block of (including) the container\n * @param  {[Boolean]} relativeToNonStaticParent  Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param  {[Boolean]} undoScale                  Whether the container's scale() should be undone\n * @param  {[HTMLElement]} container              The parent the element will be placed in\n * @return {Object}                               The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n  if (!el.getBoundingClientRect && el !== window) return;\n  var elRect, top, left, bottom, right, height, width;\n\n  if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n    elRect = el.getBoundingClientRect();\n    top = elRect.top;\n    left = elRect.left;\n    bottom = elRect.bottom;\n    right = elRect.right;\n    height = elRect.height;\n    width = elRect.width;\n  } else {\n    top = 0;\n    left = 0;\n    bottom = window.innerHeight;\n    right = window.innerWidth;\n    height = window.innerHeight;\n    width = window.innerWidth;\n  }\n\n  if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n    // Adjust for translate()\n    container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n    // Not needed on <= IE11\n\n    if (!IE11OrLess) {\n      do {\n        if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n          var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n          top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n          left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n          bottom = top + elRect.height;\n          right = left + elRect.width;\n          break;\n        }\n        /* jshint boss:true */\n\n      } while (container = container.parentNode);\n    }\n  }\n\n  if (undoScale && el !== window) {\n    // Adjust for scale()\n    var elMatrix = matrix(container || el),\n        scaleX = elMatrix && elMatrix.a,\n        scaleY = elMatrix && elMatrix.d;\n\n    if (elMatrix) {\n      top /= scaleY;\n      left /= scaleX;\n      width /= scaleX;\n      height /= scaleY;\n      bottom = top + height;\n      right = left + width;\n    }\n  }\n\n  return {\n    top: top,\n    left: left,\n    bottom: bottom,\n    right: right,\n    width: width,\n    height: height\n  };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param  {HTMLElement}  el           The element who's side being scrolled out of view is in question\n * @param  {String}       elSide       Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param  {String}       parentSide   Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement}               The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n  var parent = getParentAutoScrollElement(el, true),\n      elSideVal = getRect(el)[elSide];\n  /* jshint boss:true */\n\n  while (parent) {\n    var parentSideVal = getRect(parent)[parentSide],\n        visible = void 0;\n\n    if (parentSide === 'top' || parentSide === 'left') {\n      visible = elSideVal >= parentSideVal;\n    } else {\n      visible = elSideVal <= parentSideVal;\n    }\n\n    if (!visible) return parent;\n    if (parent === getWindowScrollingElement()) break;\n    parent = getParentAutoScrollElement(parent, false);\n  }\n\n  return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param  {HTMLElement} el       The parent element\n * @param  {Number} childNum      The index of the child\n * @param  {Object} options       Parent Sortable's options\n * @return {HTMLElement}          The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n  var currentChild = 0,\n      i = 0,\n      children = el.children;\n\n  while (i < children.length) {\n    if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n      if (currentChild === childNum) {\n        return children[i];\n      }\n\n      currentChild++;\n    }\n\n    i++;\n  }\n\n  return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param  {HTMLElement} el       Parent element\n * @param  {selector} selector    Any other elements that should be ignored\n * @return {HTMLElement}          The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n  var last = el.lastElementChild;\n\n  while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n    last = last.previousElementSibling;\n  }\n\n  return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param  {HTMLElement} el\n * @param  {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n  var index = 0;\n\n  if (!el || !el.parentNode) {\n    return -1;\n  }\n  /* jshint boss:true */\n\n\n  while (el = el.previousElementSibling) {\n    if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n      index++;\n    }\n  }\n\n  return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param  {HTMLElement} el\n * @return {Array}             Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n  var offsetLeft = 0,\n      offsetTop = 0,\n      winScroller = getWindowScrollingElement();\n\n  if (el) {\n    do {\n      var elMatrix = matrix(el),\n          scaleX = elMatrix.a,\n          scaleY = elMatrix.d;\n      offsetLeft += el.scrollLeft * scaleX;\n      offsetTop += el.scrollTop * scaleY;\n    } while (el !== winScroller && (el = el.parentNode));\n  }\n\n  return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param  {Array} arr   Array that may or may not hold the object\n * @param  {Object} obj  An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number}      The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n  for (var i in arr) {\n    if (!arr.hasOwnProperty(i)) continue;\n\n    for (var key in obj) {\n      if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n    }\n  }\n\n  return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n  // skip to window\n  if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n  var elem = el;\n  var gotSelf = false;\n\n  do {\n    // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n    if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n      var elemCSS = css(elem);\n\n      if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n        if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n        if (gotSelf || includeSelf) return elem;\n        gotSelf = true;\n      }\n    }\n    /* jshint boss:true */\n\n  } while (elem = elem.parentNode);\n\n  return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n  if (dst && src) {\n    for (var key in src) {\n      if (src.hasOwnProperty(key)) {\n        dst[key] = src[key];\n      }\n    }\n  }\n\n  return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n  return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n  return function () {\n    if (!_throttleTimeout) {\n      var args = arguments,\n          _this = this;\n\n      if (args.length === 1) {\n        callback.call(_this, args[0]);\n      } else {\n        callback.apply(_this, args);\n      }\n\n      _throttleTimeout = setTimeout(function () {\n        _throttleTimeout = void 0;\n      }, ms);\n    }\n  };\n}\n\nfunction cancelThrottle() {\n  clearTimeout(_throttleTimeout);\n  _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n  el.scrollLeft += x;\n  el.scrollTop += y;\n}\n\nfunction clone(el) {\n  var Polymer = window.Polymer;\n  var $ = window.jQuery || window.Zepto;\n\n  if (Polymer && Polymer.dom) {\n    return Polymer.dom(el).cloneNode(true);\n  } else if ($) {\n    return $(el).clone(true)[0];\n  } else {\n    return el.cloneNode(true);\n  }\n}\n\nfunction setRect(el, rect) {\n  css(el, 'position', 'absolute');\n  css(el, 'top', rect.top);\n  css(el, 'left', rect.left);\n  css(el, 'width', rect.width);\n  css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n  css(el, 'position', '');\n  css(el, 'top', '');\n  css(el, 'left', '');\n  css(el, 'width', '');\n  css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n  var animationStates = [],\n      animationCallbackId;\n  return {\n    captureAnimationState: function captureAnimationState() {\n      animationStates = [];\n      if (!this.options.animation) return;\n      var children = [].slice.call(this.el.children);\n      children.forEach(function (child) {\n        if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n        animationStates.push({\n          target: child,\n          rect: getRect(child)\n        });\n\n        var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n        if (child.thisAnimationDuration) {\n          var childMatrix = matrix(child, true);\n\n          if (childMatrix) {\n            fromRect.top -= childMatrix.f;\n            fromRect.left -= childMatrix.e;\n          }\n        }\n\n        child.fromRect = fromRect;\n      });\n    },\n    addAnimationState: function addAnimationState(state) {\n      animationStates.push(state);\n    },\n    removeAnimationState: function removeAnimationState(target) {\n      animationStates.splice(indexOfObject(animationStates, {\n        target: target\n      }), 1);\n    },\n    animateAll: function animateAll(callback) {\n      var _this = this;\n\n      if (!this.options.animation) {\n        clearTimeout(animationCallbackId);\n        if (typeof callback === 'function') callback();\n        return;\n      }\n\n      var animating = false,\n          animationTime = 0;\n      animationStates.forEach(function (state) {\n        var time = 0,\n            target = state.target,\n            fromRect = target.fromRect,\n            toRect = getRect(target),\n            prevFromRect = target.prevFromRect,\n            prevToRect = target.prevToRect,\n            animatingRect = state.rect,\n            targetMatrix = matrix(target, true);\n\n        if (targetMatrix) {\n          // Compensate for current animation\n          toRect.top -= targetMatrix.f;\n          toRect.left -= targetMatrix.e;\n        }\n\n        target.toRect = toRect;\n\n        if (target.thisAnimationDuration) {\n          // Could also check if animatingRect is between fromRect and toRect\n          if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n          (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n            // If returning to same place as started from animation and on same axis\n            time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n          }\n        } // if fromRect != toRect: animate\n\n\n        if (!isRectEqual(toRect, fromRect)) {\n          target.prevFromRect = fromRect;\n          target.prevToRect = toRect;\n\n          if (!time) {\n            time = _this.options.animation;\n          }\n\n          _this.animate(target, animatingRect, toRect, time);\n        }\n\n        if (time) {\n          animating = true;\n          animationTime = Math.max(animationTime, time);\n          clearTimeout(target.animationResetTimer);\n          target.animationResetTimer = setTimeout(function () {\n            target.animationTime = 0;\n            target.prevFromRect = null;\n            target.fromRect = null;\n            target.prevToRect = null;\n            target.thisAnimationDuration = null;\n          }, time);\n          target.thisAnimationDuration = time;\n        }\n      });\n      clearTimeout(animationCallbackId);\n\n      if (!animating) {\n        if (typeof callback === 'function') callback();\n      } else {\n        animationCallbackId = setTimeout(function () {\n          if (typeof callback === 'function') callback();\n        }, animationTime);\n      }\n\n      animationStates = [];\n    },\n    animate: function animate(target, currentRect, toRect, duration) {\n      if (duration) {\n        css(target, 'transition', '');\n        css(target, 'transform', '');\n        var elMatrix = matrix(this.el),\n            scaleX = elMatrix && elMatrix.a,\n            scaleY = elMatrix && elMatrix.d,\n            translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n            translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n        target.animatingX = !!translateX;\n        target.animatingY = !!translateY;\n        css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n        this.forRepaintDummy = repaint(target); // repaint\n\n        css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n        css(target, 'transform', 'translate3d(0,0,0)');\n        typeof target.animated === 'number' && clearTimeout(target.animated);\n        target.animated = setTimeout(function () {\n          css(target, 'transition', '');\n          css(target, 'transform', '');\n          target.animated = false;\n          target.animatingX = false;\n          target.animatingY = false;\n        }, duration);\n      }\n    }\n  };\n}\n\nfunction repaint(target) {\n  return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n  return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n  initializeByDefault: true\n};\nvar PluginManager = {\n  mount: function mount(plugin) {\n    // Set default static properties\n    for (var option in defaults) {\n      if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n        plugin[option] = defaults[option];\n      }\n    }\n\n    plugins.forEach(function (p) {\n      if (p.pluginName === plugin.pluginName) {\n        throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n      }\n    });\n    plugins.push(plugin);\n  },\n  pluginEvent: function pluginEvent(eventName, sortable, evt) {\n    var _this = this;\n\n    this.eventCanceled = false;\n\n    evt.cancel = function () {\n      _this.eventCanceled = true;\n    };\n\n    var eventNameGlobal = eventName + 'Global';\n    plugins.forEach(function (plugin) {\n      if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n      if (sortable[plugin.pluginName][eventNameGlobal]) {\n        sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n          sortable: sortable\n        }, evt));\n      } // Only fire plugin event if plugin is enabled in this sortable,\n      // and plugin has event defined\n\n\n      if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n        sortable[plugin.pluginName][eventName](_objectSpread2({\n          sortable: sortable\n        }, evt));\n      }\n    });\n  },\n  initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n    plugins.forEach(function (plugin) {\n      var pluginName = plugin.pluginName;\n      if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n      var initialized = new plugin(sortable, el, sortable.options);\n      initialized.sortable = sortable;\n      initialized.options = sortable.options;\n      sortable[pluginName] = initialized; // Add default options from plugin\n\n      _extends(defaults, initialized.defaults);\n    });\n\n    for (var option in sortable.options) {\n      if (!sortable.options.hasOwnProperty(option)) continue;\n      var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n      if (typeof modified !== 'undefined') {\n        sortable.options[option] = modified;\n      }\n    }\n  },\n  getEventProperties: function getEventProperties(name, sortable) {\n    var eventProperties = {};\n    plugins.forEach(function (plugin) {\n      if (typeof plugin.eventProperties !== 'function') return;\n\n      _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n    });\n    return eventProperties;\n  },\n  modifyOption: function modifyOption(sortable, name, value) {\n    var modifiedValue;\n    plugins.forEach(function (plugin) {\n      // Plugin must exist on the Sortable\n      if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n      if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n        modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n      }\n    });\n    return modifiedValue;\n  }\n};\n\nfunction dispatchEvent(_ref) {\n  var sortable = _ref.sortable,\n      rootEl = _ref.rootEl,\n      name = _ref.name,\n      targetEl = _ref.targetEl,\n      cloneEl = _ref.cloneEl,\n      toEl = _ref.toEl,\n      fromEl = _ref.fromEl,\n      oldIndex = _ref.oldIndex,\n      newIndex = _ref.newIndex,\n      oldDraggableIndex = _ref.oldDraggableIndex,\n      newDraggableIndex = _ref.newDraggableIndex,\n      originalEvent = _ref.originalEvent,\n      putSortable = _ref.putSortable,\n      extraEventProperties = _ref.extraEventProperties;\n  sortable = sortable || rootEl && rootEl[expando];\n  if (!sortable) return;\n  var evt,\n      options = sortable.options,\n      onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n  if (window.CustomEvent && !IE11OrLess && !Edge) {\n    evt = new CustomEvent(name, {\n      bubbles: true,\n      cancelable: true\n    });\n  } else {\n    evt = document.createEvent('Event');\n    evt.initEvent(name, true, true);\n  }\n\n  evt.to = toEl || rootEl;\n  evt.from = fromEl || rootEl;\n  evt.item = targetEl || rootEl;\n  evt.clone = cloneEl;\n  evt.oldIndex = oldIndex;\n  evt.newIndex = newIndex;\n  evt.oldDraggableIndex = oldDraggableIndex;\n  evt.newDraggableIndex = newDraggableIndex;\n  evt.originalEvent = originalEvent;\n  evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n  var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n  for (var option in allEventProperties) {\n    evt[option] = allEventProperties[option];\n  }\n\n  if (rootEl) {\n    rootEl.dispatchEvent(evt);\n  }\n\n  if (options[onName]) {\n    options[onName].call(sortable, evt);\n  }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n  var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n      originalEvent = _ref.evt,\n      data = _objectWithoutProperties(_ref, _excluded);\n\n  PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n    dragEl: dragEl,\n    parentEl: parentEl,\n    ghostEl: ghostEl,\n    rootEl: rootEl,\n    nextEl: nextEl,\n    lastDownEl: lastDownEl,\n    cloneEl: cloneEl,\n    cloneHidden: cloneHidden,\n    dragStarted: moved,\n    putSortable: putSortable,\n    activeSortable: Sortable.active,\n    originalEvent: originalEvent,\n    oldIndex: oldIndex,\n    oldDraggableIndex: oldDraggableIndex,\n    newIndex: newIndex,\n    newDraggableIndex: newDraggableIndex,\n    hideGhostForTarget: _hideGhostForTarget,\n    unhideGhostForTarget: _unhideGhostForTarget,\n    cloneNowHidden: function cloneNowHidden() {\n      cloneHidden = true;\n    },\n    cloneNowShown: function cloneNowShown() {\n      cloneHidden = false;\n    },\n    dispatchSortableEvent: function dispatchSortableEvent(name) {\n      _dispatchEvent({\n        sortable: sortable,\n        name: name,\n        originalEvent: originalEvent\n      });\n    }\n  }, data));\n};\n\nfunction _dispatchEvent(info) {\n  dispatchEvent(_objectSpread2({\n    putSortable: putSortable,\n    cloneEl: cloneEl,\n    targetEl: dragEl,\n    rootEl: rootEl,\n    oldIndex: oldIndex,\n    oldDraggableIndex: oldDraggableIndex,\n    newIndex: newIndex,\n    newDraggableIndex: newDraggableIndex\n  }, info));\n}\n\nvar dragEl,\n    parentEl,\n    ghostEl,\n    rootEl,\n    nextEl,\n    lastDownEl,\n    cloneEl,\n    cloneHidden,\n    oldIndex,\n    newIndex,\n    oldDraggableIndex,\n    newDraggableIndex,\n    activeGroup,\n    putSortable,\n    awaitingDragStarted = false,\n    ignoreNextClick = false,\n    sortables = [],\n    tapEvt,\n    touchEvt,\n    lastDx,\n    lastDy,\n    tapDistanceLeft,\n    tapDistanceTop,\n    moved,\n    lastTarget,\n    lastDirection,\n    pastFirstInvertThresh = false,\n    isCircumstantialInvert = false,\n    targetMoveDistance,\n    // For positioning ghost absolutely\nghostRelativeParent,\n    ghostRelativeParentInitialScroll = [],\n    // (left, top)\n_silent = false,\n    savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n    PositionGhostAbsolutely = IOS,\n    CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n    // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n    supportCssPointerEvents = function () {\n  if (!documentExists) return; // false when <= IE11\n\n  if (IE11OrLess) {\n    return false;\n  }\n\n  var el = document.createElement('x');\n  el.style.cssText = 'pointer-events:auto';\n  return el.style.pointerEvents === 'auto';\n}(),\n    _detectDirection = function _detectDirection(el, options) {\n  var elCSS = css(el),\n      elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n      child1 = getChild(el, 0, options),\n      child2 = getChild(el, 1, options),\n      firstChildCSS = child1 && css(child1),\n      secondChildCSS = child2 && css(child2),\n      firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n      secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n  if (elCSS.display === 'flex') {\n    return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n  }\n\n  if (elCSS.display === 'grid') {\n    return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n  }\n\n  if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n    var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n    return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n  }\n\n  return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n    _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n  var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n      dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n      dragElOppLength = vertical ? dragRect.width : dragRect.height,\n      targetS1Opp = vertical ? targetRect.left : targetRect.top,\n      targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n      targetOppLength = vertical ? targetRect.width : targetRect.height;\n  return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param  {Number} x      X position\r\n * @param  {Number} y      Y position\r\n * @return {HTMLElement}   Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n  var ret;\n  sortables.some(function (sortable) {\n    var threshold = sortable[expando].options.emptyInsertThreshold;\n    if (!threshold || lastChild(sortable)) return;\n    var rect = getRect(sortable),\n        insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n        insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n    if (insideHorizontally && insideVertically) {\n      return ret = sortable;\n    }\n  });\n  return ret;\n},\n    _prepareGroup = function _prepareGroup(options) {\n  function toFn(value, pull) {\n    return function (to, from, dragEl, evt) {\n      var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n      if (value == null && (pull || sameGroup)) {\n        // Default pull value\n        // Default pull and put value if same group\n        return true;\n      } else if (value == null || value === false) {\n        return false;\n      } else if (pull && value === 'clone') {\n        return value;\n      } else if (typeof value === 'function') {\n        return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n      } else {\n        var otherGroup = (pull ? to : from).options.group.name;\n        return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n      }\n    };\n  }\n\n  var group = {};\n  var originalGroup = options.group;\n\n  if (!originalGroup || _typeof(originalGroup) != 'object') {\n    originalGroup = {\n      name: originalGroup\n    };\n  }\n\n  group.name = originalGroup.name;\n  group.checkPull = toFn(originalGroup.pull, true);\n  group.checkPut = toFn(originalGroup.put);\n  group.revertClone = originalGroup.revertClone;\n  options.group = group;\n},\n    _hideGhostForTarget = function _hideGhostForTarget() {\n  if (!supportCssPointerEvents && ghostEl) {\n    css(ghostEl, 'display', 'none');\n  }\n},\n    _unhideGhostForTarget = function _unhideGhostForTarget() {\n  if (!supportCssPointerEvents && ghostEl) {\n    css(ghostEl, 'display', '');\n  }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n  document.addEventListener('click', function (evt) {\n    if (ignoreNextClick) {\n      evt.preventDefault();\n      evt.stopPropagation && evt.stopPropagation();\n      evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n      ignoreNextClick = false;\n      return false;\n    }\n  }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n  if (dragEl) {\n    evt = evt.touches ? evt.touches[0] : evt;\n\n    var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n    if (nearest) {\n      // Create imitation event\n      var event = {};\n\n      for (var i in evt) {\n        if (evt.hasOwnProperty(i)) {\n          event[i] = evt[i];\n        }\n      }\n\n      event.target = event.rootEl = nearest;\n      event.preventDefault = void 0;\n      event.stopPropagation = void 0;\n\n      nearest[expando]._onDragOver(event);\n    }\n  }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n  if (dragEl) {\n    dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n  }\n};\n/**\r\n * @class  Sortable\r\n * @param  {HTMLElement}  el\r\n * @param  {Object}       [options]\r\n */\n\n\nfunction Sortable(el, options) {\n  if (!(el && el.nodeType && el.nodeType === 1)) {\n    throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n  }\n\n  this.el = el; // root element\n\n  this.options = options = _extends({}, options); // Export instance\n\n  el[expando] = this;\n  var defaults = {\n    group: null,\n    sort: true,\n    disabled: false,\n    store: null,\n    handle: null,\n    draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n    swapThreshold: 1,\n    // percentage; 0 <= x <= 1\n    invertSwap: false,\n    // invert always\n    invertedSwapThreshold: null,\n    // will be set to same as swapThreshold if default\n    removeCloneOnHide: true,\n    direction: function direction() {\n      return _detectDirection(el, this.options);\n    },\n    ghostClass: 'sortable-ghost',\n    chosenClass: 'sortable-chosen',\n    dragClass: 'sortable-drag',\n    ignore: 'a, img',\n    filter: null,\n    preventOnFilter: true,\n    animation: 0,\n    easing: null,\n    setData: function setData(dataTransfer, dragEl) {\n      dataTransfer.setData('Text', dragEl.textContent);\n    },\n    dropBubble: false,\n    dragoverBubble: false,\n    dataIdAttr: 'data-id',\n    delay: 0,\n    delayOnTouchOnly: false,\n    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n    forceFallback: false,\n    fallbackClass: 'sortable-fallback',\n    fallbackOnBody: false,\n    fallbackTolerance: 0,\n    fallbackOffset: {\n      x: 0,\n      y: 0\n    },\n    supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n    emptyInsertThreshold: 5\n  };\n  PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n  for (var name in defaults) {\n    !(name in options) && (options[name] = defaults[name]);\n  }\n\n  _prepareGroup(options); // Bind all private methods\n\n\n  for (var fn in this) {\n    if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n      this[fn] = this[fn].bind(this);\n    }\n  } // Setup drag mode\n\n\n  this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n  if (this.nativeDraggable) {\n    // Touch start threshold cannot be greater than the native dragstart threshold\n    this.options.touchStartThreshold = 1;\n  } // Bind events\n\n\n  if (options.supportPointer) {\n    on(el, 'pointerdown', this._onTapStart);\n  } else {\n    on(el, 'mousedown', this._onTapStart);\n    on(el, 'touchstart', this._onTapStart);\n  }\n\n  if (this.nativeDraggable) {\n    on(el, 'dragover', this);\n    on(el, 'dragenter', this);\n  }\n\n  sortables.push(this.el); // Restore sorting\n\n  options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n  _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n  constructor: Sortable,\n  _isOutsideThisEl: function _isOutsideThisEl(target) {\n    if (!this.el.contains(target) && target !== this.el) {\n      lastTarget = null;\n    }\n  },\n  _getDirection: function _getDirection(evt, target) {\n    return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n  },\n  _onTapStart: function _onTapStart(\n  /** Event|TouchEvent */\n  evt) {\n    if (!evt.cancelable) return;\n\n    var _this = this,\n        el = this.el,\n        options = this.options,\n        preventOnFilter = options.preventOnFilter,\n        type = evt.type,\n        touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n        target = (touch || evt).target,\n        originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n        filter = options.filter;\n\n    _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n    if (dragEl) {\n      return;\n    }\n\n    if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n      return; // only left button and enabled\n    } // cancel dnd if original target is content editable\n\n\n    if (originalTarget.isContentEditable) {\n      return;\n    } // Safari ignores further event handling after mousedown\n\n\n    if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n      return;\n    }\n\n    target = closest(target, options.draggable, el, false);\n\n    if (target && target.animated) {\n      return;\n    }\n\n    if (lastDownEl === target) {\n      // Ignoring duplicate `down`\n      return;\n    } // Get the index of the dragged element within its parent\n\n\n    oldIndex = index(target);\n    oldDraggableIndex = index(target, options.draggable); // Check filter\n\n    if (typeof filter === 'function') {\n      if (filter.call(this, evt, target, this)) {\n        _dispatchEvent({\n          sortable: _this,\n          rootEl: originalTarget,\n          name: 'filter',\n          targetEl: target,\n          toEl: el,\n          fromEl: el\n        });\n\n        pluginEvent('filter', _this, {\n          evt: evt\n        });\n        preventOnFilter && evt.cancelable && evt.preventDefault();\n        return; // cancel dnd\n      }\n    } else if (filter) {\n      filter = filter.split(',').some(function (criteria) {\n        criteria = closest(originalTarget, criteria.trim(), el, false);\n\n        if (criteria) {\n          _dispatchEvent({\n            sortable: _this,\n            rootEl: criteria,\n            name: 'filter',\n            targetEl: target,\n            fromEl: el,\n            toEl: el\n          });\n\n          pluginEvent('filter', _this, {\n            evt: evt\n          });\n          return true;\n        }\n      });\n\n      if (filter) {\n        preventOnFilter && evt.cancelable && evt.preventDefault();\n        return; // cancel dnd\n      }\n    }\n\n    if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n      return;\n    } // Prepare `dragstart`\n\n\n    this._prepareDragStart(evt, touch, target);\n  },\n  _prepareDragStart: function _prepareDragStart(\n  /** Event */\n  evt,\n  /** Touch */\n  touch,\n  /** HTMLElement */\n  target) {\n    var _this = this,\n        el = _this.el,\n        options = _this.options,\n        ownerDocument = el.ownerDocument,\n        dragStartFn;\n\n    if (target && !dragEl && target.parentNode === el) {\n      var dragRect = getRect(target);\n      rootEl = el;\n      dragEl = target;\n      parentEl = dragEl.parentNode;\n      nextEl = dragEl.nextSibling;\n      lastDownEl = target;\n      activeGroup = options.group;\n      Sortable.dragged = dragEl;\n      tapEvt = {\n        target: dragEl,\n        clientX: (touch || evt).clientX,\n        clientY: (touch || evt).clientY\n      };\n      tapDistanceLeft = tapEvt.clientX - dragRect.left;\n      tapDistanceTop = tapEvt.clientY - dragRect.top;\n      this._lastX = (touch || evt).clientX;\n      this._lastY = (touch || evt).clientY;\n      dragEl.style['will-change'] = 'all';\n\n      dragStartFn = function dragStartFn() {\n        pluginEvent('delayEnded', _this, {\n          evt: evt\n        });\n\n        if (Sortable.eventCanceled) {\n          _this._onDrop();\n\n          return;\n        } // Delayed drag has been triggered\n        // we can re-enable the events: touchmove/mousemove\n\n\n        _this._disableDelayedDragEvents();\n\n        if (!FireFox && _this.nativeDraggable) {\n          dragEl.draggable = true;\n        } // Bind the events: dragstart/dragend\n\n\n        _this._triggerDragStart(evt, touch); // Drag start event\n\n\n        _dispatchEvent({\n          sortable: _this,\n          name: 'choose',\n          originalEvent: evt\n        }); // Chosen item\n\n\n        toggleClass(dragEl, options.chosenClass, true);\n      }; // Disable \"draggable\"\n\n\n      options.ignore.split(',').forEach(function (criteria) {\n        find(dragEl, criteria.trim(), _disableDraggable);\n      });\n      on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n      on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n      on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n      on(ownerDocument, 'mouseup', _this._onDrop);\n      on(ownerDocument, 'touchend', _this._onDrop);\n      on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n      if (FireFox && this.nativeDraggable) {\n        this.options.touchStartThreshold = 4;\n        dragEl.draggable = true;\n      }\n\n      pluginEvent('delayStart', this, {\n        evt: evt\n      }); // Delay is impossible for native DnD in Edge or IE\n\n      if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n        if (Sortable.eventCanceled) {\n          this._onDrop();\n\n          return;\n        } // If the user moves the pointer or let go the click or touch\n        // before the delay has been reached:\n        // disable the delayed drag\n\n\n        on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n        on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n        on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n        on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n        on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n        options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n        _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n      } else {\n        dragStartFn();\n      }\n    }\n  },\n  _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n  /** TouchEvent|PointerEvent **/\n  e) {\n    var touch = e.touches ? e.touches[0] : e;\n\n    if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n      this._disableDelayedDrag();\n    }\n  },\n  _disableDelayedDrag: function _disableDelayedDrag() {\n    dragEl && _disableDraggable(dragEl);\n    clearTimeout(this._dragStartTimer);\n\n    this._disableDelayedDragEvents();\n  },\n  _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n    var ownerDocument = this.el.ownerDocument;\n    off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n    off(ownerDocument, 'touchend', this._disableDelayedDrag);\n    off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n    off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n    off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n    off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n  },\n  _triggerDragStart: function _triggerDragStart(\n  /** Event */\n  evt,\n  /** Touch */\n  touch) {\n    touch = touch || evt.pointerType == 'touch' && evt;\n\n    if (!this.nativeDraggable || touch) {\n      if (this.options.supportPointer) {\n        on(document, 'pointermove', this._onTouchMove);\n      } else if (touch) {\n        on(document, 'touchmove', this._onTouchMove);\n      } else {\n        on(document, 'mousemove', this._onTouchMove);\n      }\n    } else {\n      on(dragEl, 'dragend', this);\n      on(rootEl, 'dragstart', this._onDragStart);\n    }\n\n    try {\n      if (document.selection) {\n        // Timeout neccessary for IE9\n        _nextTick(function () {\n          document.selection.empty();\n        });\n      } else {\n        window.getSelection().removeAllRanges();\n      }\n    } catch (err) {}\n  },\n  _dragStarted: function _dragStarted(fallback, evt) {\n\n    awaitingDragStarted = false;\n\n    if (rootEl && dragEl) {\n      pluginEvent('dragStarted', this, {\n        evt: evt\n      });\n\n      if (this.nativeDraggable) {\n        on(document, 'dragover', _checkOutsideTargetEl);\n      }\n\n      var options = this.options; // Apply effect\n\n      !fallback && toggleClass(dragEl, options.dragClass, false);\n      toggleClass(dragEl, options.ghostClass, true);\n      Sortable.active = this;\n      fallback && this._appendGhost(); // Drag start event\n\n      _dispatchEvent({\n        sortable: this,\n        name: 'start',\n        originalEvent: evt\n      });\n    } else {\n      this._nulling();\n    }\n  },\n  _emulateDragOver: function _emulateDragOver() {\n    if (touchEvt) {\n      this._lastX = touchEvt.clientX;\n      this._lastY = touchEvt.clientY;\n\n      _hideGhostForTarget();\n\n      var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n      var parent = target;\n\n      while (target && target.shadowRoot) {\n        target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n        if (target === parent) break;\n        parent = target;\n      }\n\n      dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n      if (parent) {\n        do {\n          if (parent[expando]) {\n            var inserted = void 0;\n            inserted = parent[expando]._onDragOver({\n              clientX: touchEvt.clientX,\n              clientY: touchEvt.clientY,\n              target: target,\n              rootEl: parent\n            });\n\n            if (inserted && !this.options.dragoverBubble) {\n              break;\n            }\n          }\n\n          target = parent; // store last element\n        }\n        /* jshint boss:true */\n        while (parent = parent.parentNode);\n      }\n\n      _unhideGhostForTarget();\n    }\n  },\n  _onTouchMove: function _onTouchMove(\n  /**TouchEvent*/\n  evt) {\n    if (tapEvt) {\n      var options = this.options,\n          fallbackTolerance = options.fallbackTolerance,\n          fallbackOffset = options.fallbackOffset,\n          touch = evt.touches ? evt.touches[0] : evt,\n          ghostMatrix = ghostEl && matrix(ghostEl, true),\n          scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n          scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n          relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n          dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n          dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n      if (!Sortable.active && !awaitingDragStarted) {\n        if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n          return;\n        }\n\n        this._onDragStart(evt, true);\n      }\n\n      if (ghostEl) {\n        if (ghostMatrix) {\n          ghostMatrix.e += dx - (lastDx || 0);\n          ghostMatrix.f += dy - (lastDy || 0);\n        } else {\n          ghostMatrix = {\n            a: 1,\n            b: 0,\n            c: 0,\n            d: 1,\n            e: dx,\n            f: dy\n          };\n        }\n\n        var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n        css(ghostEl, 'webkitTransform', cssMatrix);\n        css(ghostEl, 'mozTransform', cssMatrix);\n        css(ghostEl, 'msTransform', cssMatrix);\n        css(ghostEl, 'transform', cssMatrix);\n        lastDx = dx;\n        lastDy = dy;\n        touchEvt = touch;\n      }\n\n      evt.cancelable && evt.preventDefault();\n    }\n  },\n  _appendGhost: function _appendGhost() {\n    // Bug if using scale(): https://stackoverflow.com/questions/2637058\n    // Not being adjusted for\n    if (!ghostEl) {\n      var container = this.options.fallbackOnBody ? document.body : rootEl,\n          rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n          options = this.options; // Position absolutely\n\n      if (PositionGhostAbsolutely) {\n        // Get relatively positioned parent\n        ghostRelativeParent = container;\n\n        while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n          ghostRelativeParent = ghostRelativeParent.parentNode;\n        }\n\n        if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n          if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n          rect.top += ghostRelativeParent.scrollTop;\n          rect.left += ghostRelativeParent.scrollLeft;\n        } else {\n          ghostRelativeParent = getWindowScrollingElement();\n        }\n\n        ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n      }\n\n      ghostEl = dragEl.cloneNode(true);\n      toggleClass(ghostEl, options.ghostClass, false);\n      toggleClass(ghostEl, options.fallbackClass, true);\n      toggleClass(ghostEl, options.dragClass, true);\n      css(ghostEl, 'transition', '');\n      css(ghostEl, 'transform', '');\n      css(ghostEl, 'box-sizing', 'border-box');\n      css(ghostEl, 'margin', 0);\n      css(ghostEl, 'top', rect.top);\n      css(ghostEl, 'left', rect.left);\n      css(ghostEl, 'width', rect.width);\n      css(ghostEl, 'height', rect.height);\n      css(ghostEl, 'opacity', '0.8');\n      css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n      css(ghostEl, 'zIndex', '100000');\n      css(ghostEl, 'pointerEvents', 'none');\n      Sortable.ghost = ghostEl;\n      container.appendChild(ghostEl); // Set transform-origin\n\n      css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n    }\n  },\n  _onDragStart: function _onDragStart(\n  /**Event*/\n  evt,\n  /**boolean*/\n  fallback) {\n    var _this = this;\n\n    var dataTransfer = evt.dataTransfer;\n    var options = _this.options;\n    pluginEvent('dragStart', this, {\n      evt: evt\n    });\n\n    if (Sortable.eventCanceled) {\n      this._onDrop();\n\n      return;\n    }\n\n    pluginEvent('setupClone', this);\n\n    if (!Sortable.eventCanceled) {\n      cloneEl = clone(dragEl);\n      cloneEl.removeAttribute(\"id\");\n      cloneEl.draggable = false;\n      cloneEl.style['will-change'] = '';\n\n      this._hideClone();\n\n      toggleClass(cloneEl, this.options.chosenClass, false);\n      Sortable.clone = cloneEl;\n    } // #1143: IFrame support workaround\n\n\n    _this.cloneId = _nextTick(function () {\n      pluginEvent('clone', _this);\n      if (Sortable.eventCanceled) return;\n\n      if (!_this.options.removeCloneOnHide) {\n        rootEl.insertBefore(cloneEl, dragEl);\n      }\n\n      _this._hideClone();\n\n      _dispatchEvent({\n        sortable: _this,\n        name: 'clone'\n      });\n    });\n    !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n    if (fallback) {\n      ignoreNextClick = true;\n      _this._loopId = setInterval(_this._emulateDragOver, 50);\n    } else {\n      // Undo what was set in _prepareDragStart before drag started\n      off(document, 'mouseup', _this._onDrop);\n      off(document, 'touchend', _this._onDrop);\n      off(document, 'touchcancel', _this._onDrop);\n\n      if (dataTransfer) {\n        dataTransfer.effectAllowed = 'move';\n        options.setData && options.setData.call(_this, dataTransfer, dragEl);\n      }\n\n      on(document, 'drop', _this); // #1276 fix:\n\n      css(dragEl, 'transform', 'translateZ(0)');\n    }\n\n    awaitingDragStarted = true;\n    _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n    on(document, 'selectstart', _this);\n    moved = true;\n\n    if (Safari) {\n      css(document.body, 'user-select', 'none');\n    }\n  },\n  // Returns true - if no further action is needed (either inserted or another condition)\n  _onDragOver: function _onDragOver(\n  /**Event*/\n  evt) {\n    var el = this.el,\n        target = evt.target,\n        dragRect,\n        targetRect,\n        revert,\n        options = this.options,\n        group = options.group,\n        activeSortable = Sortable.active,\n        isOwner = activeGroup === group,\n        canSort = options.sort,\n        fromSortable = putSortable || activeSortable,\n        vertical,\n        _this = this,\n        completedFired = false;\n\n    if (_silent) return;\n\n    function dragOverEvent(name, extra) {\n      pluginEvent(name, _this, _objectSpread2({\n        evt: evt,\n        isOwner: isOwner,\n        axis: vertical ? 'vertical' : 'horizontal',\n        revert: revert,\n        dragRect: dragRect,\n        targetRect: targetRect,\n        canSort: canSort,\n        fromSortable: fromSortable,\n        target: target,\n        completed: completed,\n        onMove: function onMove(target, after) {\n          return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n        },\n        changed: changed\n      }, extra));\n    } // Capture animation state\n\n\n    function capture() {\n      dragOverEvent('dragOverAnimationCapture');\n\n      _this.captureAnimationState();\n\n      if (_this !== fromSortable) {\n        fromSortable.captureAnimationState();\n      }\n    } // Return invocation when dragEl is inserted (or completed)\n\n\n    function completed(insertion) {\n      dragOverEvent('dragOverCompleted', {\n        insertion: insertion\n      });\n\n      if (insertion) {\n        // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n        if (isOwner) {\n          activeSortable._hideClone();\n        } else {\n          activeSortable._showClone(_this);\n        }\n\n        if (_this !== fromSortable) {\n          // Set ghost class to new sortable's ghost class\n          toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n          toggleClass(dragEl, options.ghostClass, true);\n        }\n\n        if (putSortable !== _this && _this !== Sortable.active) {\n          putSortable = _this;\n        } else if (_this === Sortable.active && putSortable) {\n          putSortable = null;\n        } // Animation\n\n\n        if (fromSortable === _this) {\n          _this._ignoreWhileAnimating = target;\n        }\n\n        _this.animateAll(function () {\n          dragOverEvent('dragOverAnimationComplete');\n          _this._ignoreWhileAnimating = null;\n        });\n\n        if (_this !== fromSortable) {\n          fromSortable.animateAll();\n          fromSortable._ignoreWhileAnimating = null;\n        }\n      } // Null lastTarget if it is not inside a previously swapped element\n\n\n      if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n        lastTarget = null;\n      } // no bubbling and not fallback\n\n\n      if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n        dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n        !insertion && nearestEmptyInsertDetectEvent(evt);\n      }\n\n      !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n      return completedFired = true;\n    } // Call when dragEl has been inserted\n\n\n    function changed() {\n      newIndex = index(dragEl);\n      newDraggableIndex = index(dragEl, options.draggable);\n\n      _dispatchEvent({\n        sortable: _this,\n        name: 'change',\n        toEl: el,\n        newIndex: newIndex,\n        newDraggableIndex: newDraggableIndex,\n        originalEvent: evt\n      });\n    }\n\n    if (evt.preventDefault !== void 0) {\n      evt.cancelable && evt.preventDefault();\n    }\n\n    target = closest(target, options.draggable, el, true);\n    dragOverEvent('dragOver');\n    if (Sortable.eventCanceled) return completedFired;\n\n    if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n      return completed(false);\n    }\n\n    ignoreNextClick = false;\n\n    if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n    : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n      vertical = this._getDirection(evt, target) === 'vertical';\n      dragRect = getRect(dragEl);\n      dragOverEvent('dragOverValid');\n      if (Sortable.eventCanceled) return completedFired;\n\n      if (revert) {\n        parentEl = rootEl; // actualization\n\n        capture();\n\n        this._hideClone();\n\n        dragOverEvent('revert');\n\n        if (!Sortable.eventCanceled) {\n          if (nextEl) {\n            rootEl.insertBefore(dragEl, nextEl);\n          } else {\n            rootEl.appendChild(dragEl);\n          }\n        }\n\n        return completed(true);\n      }\n\n      var elLastChild = lastChild(el, options.draggable);\n\n      if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n        // Insert to end of list\n        // If already at end of list: Do not insert\n        if (elLastChild === dragEl) {\n          return completed(false);\n        } // if there is a last element, it is the target\n\n\n        if (elLastChild && el === evt.target) {\n          target = elLastChild;\n        }\n\n        if (target) {\n          targetRect = getRect(target);\n        }\n\n        if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n          capture();\n\n          if (elLastChild && elLastChild.nextSibling) {\n            // the last draggable element is not the last node\n            el.insertBefore(dragEl, elLastChild.nextSibling);\n          } else {\n            el.appendChild(dragEl);\n          }\n\n          parentEl = el; // actualization\n\n          changed();\n          return completed(true);\n        }\n      } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n        // Insert to start of list\n        var firstChild = getChild(el, 0, options, true);\n\n        if (firstChild === dragEl) {\n          return completed(false);\n        }\n\n        target = firstChild;\n        targetRect = getRect(target);\n\n        if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n          capture();\n          el.insertBefore(dragEl, firstChild);\n          parentEl = el; // actualization\n\n          changed();\n          return completed(true);\n        }\n      } else if (target.parentNode === el) {\n        targetRect = getRect(target);\n        var direction = 0,\n            targetBeforeFirstSwap,\n            differentLevel = dragEl.parentNode !== el,\n            differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n            side1 = vertical ? 'top' : 'left',\n            scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n            scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n        if (lastTarget !== target) {\n          targetBeforeFirstSwap = targetRect[side1];\n          pastFirstInvertThresh = false;\n          isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n        }\n\n        direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n        var sibling;\n\n        if (direction !== 0) {\n          // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n          var dragIndex = index(dragEl);\n\n          do {\n            dragIndex -= direction;\n            sibling = parentEl.children[dragIndex];\n          } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n        } // If dragEl is already beside target: Do not insert\n\n\n        if (direction === 0 || sibling === target) {\n          return completed(false);\n        }\n\n        lastTarget = target;\n        lastDirection = direction;\n        var nextSibling = target.nextElementSibling,\n            after = false;\n        after = direction === 1;\n\n        var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n        if (moveVector !== false) {\n          if (moveVector === 1 || moveVector === -1) {\n            after = moveVector === 1;\n          }\n\n          _silent = true;\n          setTimeout(_unsilent, 30);\n          capture();\n\n          if (after && !nextSibling) {\n            el.appendChild(dragEl);\n          } else {\n            target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n          } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n          if (scrolledPastTop) {\n            scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n          }\n\n          parentEl = dragEl.parentNode; // actualization\n          // must be done before animation\n\n          if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n            targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n          }\n\n          changed();\n          return completed(true);\n        }\n      }\n\n      if (el.contains(dragEl)) {\n        return completed(false);\n      }\n    }\n\n    return false;\n  },\n  _ignoreWhileAnimating: null,\n  _offMoveEvents: function _offMoveEvents() {\n    off(document, 'mousemove', this._onTouchMove);\n    off(document, 'touchmove', this._onTouchMove);\n    off(document, 'pointermove', this._onTouchMove);\n    off(document, 'dragover', nearestEmptyInsertDetectEvent);\n    off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n    off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n  },\n  _offUpEvents: function _offUpEvents() {\n    var ownerDocument = this.el.ownerDocument;\n    off(ownerDocument, 'mouseup', this._onDrop);\n    off(ownerDocument, 'touchend', this._onDrop);\n    off(ownerDocument, 'pointerup', this._onDrop);\n    off(ownerDocument, 'touchcancel', this._onDrop);\n    off(document, 'selectstart', this);\n  },\n  _onDrop: function _onDrop(\n  /**Event*/\n  evt) {\n    var el = this.el,\n        options = this.options; // Get the index of the dragged element within its parent\n\n    newIndex = index(dragEl);\n    newDraggableIndex = index(dragEl, options.draggable);\n    pluginEvent('drop', this, {\n      evt: evt\n    });\n    parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n    newIndex = index(dragEl);\n    newDraggableIndex = index(dragEl, options.draggable);\n\n    if (Sortable.eventCanceled) {\n      this._nulling();\n\n      return;\n    }\n\n    awaitingDragStarted = false;\n    isCircumstantialInvert = false;\n    pastFirstInvertThresh = false;\n    clearInterval(this._loopId);\n    clearTimeout(this._dragStartTimer);\n\n    _cancelNextTick(this.cloneId);\n\n    _cancelNextTick(this._dragStartId); // Unbind events\n\n\n    if (this.nativeDraggable) {\n      off(document, 'drop', this);\n      off(el, 'dragstart', this._onDragStart);\n    }\n\n    this._offMoveEvents();\n\n    this._offUpEvents();\n\n    if (Safari) {\n      css(document.body, 'user-select', '');\n    }\n\n    css(dragEl, 'transform', '');\n\n    if (evt) {\n      if (moved) {\n        evt.cancelable && evt.preventDefault();\n        !options.dropBubble && evt.stopPropagation();\n      }\n\n      ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n      if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n        // Remove clone(s)\n        cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n      }\n\n      if (dragEl) {\n        if (this.nativeDraggable) {\n          off(dragEl, 'dragend', this);\n        }\n\n        _disableDraggable(dragEl);\n\n        dragEl.style['will-change'] = ''; // Remove classes\n        // ghostClass is added in dragStarted\n\n        if (moved && !awaitingDragStarted) {\n          toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n        }\n\n        toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n        _dispatchEvent({\n          sortable: this,\n          name: 'unchoose',\n          toEl: parentEl,\n          newIndex: null,\n          newDraggableIndex: null,\n          originalEvent: evt\n        });\n\n        if (rootEl !== parentEl) {\n          if (newIndex >= 0) {\n            // Add event\n            _dispatchEvent({\n              rootEl: parentEl,\n              name: 'add',\n              toEl: parentEl,\n              fromEl: rootEl,\n              originalEvent: evt\n            }); // Remove event\n\n\n            _dispatchEvent({\n              sortable: this,\n              name: 'remove',\n              toEl: parentEl,\n              originalEvent: evt\n            }); // drag from one list and drop into another\n\n\n            _dispatchEvent({\n              rootEl: parentEl,\n              name: 'sort',\n              toEl: parentEl,\n              fromEl: rootEl,\n              originalEvent: evt\n            });\n\n            _dispatchEvent({\n              sortable: this,\n              name: 'sort',\n              toEl: parentEl,\n              originalEvent: evt\n            });\n          }\n\n          putSortable && putSortable.save();\n        } else {\n          if (newIndex !== oldIndex) {\n            if (newIndex >= 0) {\n              // drag & drop within the same list\n              _dispatchEvent({\n                sortable: this,\n                name: 'update',\n                toEl: parentEl,\n                originalEvent: evt\n              });\n\n              _dispatchEvent({\n                sortable: this,\n                name: 'sort',\n                toEl: parentEl,\n                originalEvent: evt\n              });\n            }\n          }\n        }\n\n        if (Sortable.active) {\n          /* jshint eqnull:true */\n          if (newIndex == null || newIndex === -1) {\n            newIndex = oldIndex;\n            newDraggableIndex = oldDraggableIndex;\n          }\n\n          _dispatchEvent({\n            sortable: this,\n            name: 'end',\n            toEl: parentEl,\n            originalEvent: evt\n          }); // Save sorting\n\n\n          this.save();\n        }\n      }\n    }\n\n    this._nulling();\n  },\n  _nulling: function _nulling() {\n    pluginEvent('nulling', this);\n    rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n    savedInputChecked.forEach(function (el) {\n      el.checked = true;\n    });\n    savedInputChecked.length = lastDx = lastDy = 0;\n  },\n  handleEvent: function handleEvent(\n  /**Event*/\n  evt) {\n    switch (evt.type) {\n      case 'drop':\n      case 'dragend':\n        this._onDrop(evt);\n\n        break;\n\n      case 'dragenter':\n      case 'dragover':\n        if (dragEl) {\n          this._onDragOver(evt);\n\n          _globalDragOver(evt);\n        }\n\n        break;\n\n      case 'selectstart':\n        evt.preventDefault();\n        break;\n    }\n  },\n\n  /**\r\n   * Serializes the item into an array of string.\r\n   * @returns {String[]}\r\n   */\n  toArray: function toArray() {\n    var order = [],\n        el,\n        children = this.el.children,\n        i = 0,\n        n = children.length,\n        options = this.options;\n\n    for (; i < n; i++) {\n      el = children[i];\n\n      if (closest(el, options.draggable, this.el, false)) {\n        order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n      }\n    }\n\n    return order;\n  },\n\n  /**\r\n   * Sorts the elements according to the array.\r\n   * @param  {String[]}  order  order of the items\r\n   */\n  sort: function sort(order, useAnimation) {\n    var items = {},\n        rootEl = this.el;\n    this.toArray().forEach(function (id, i) {\n      var el = rootEl.children[i];\n\n      if (closest(el, this.options.draggable, rootEl, false)) {\n        items[id] = el;\n      }\n    }, this);\n    useAnimation && this.captureAnimationState();\n    order.forEach(function (id) {\n      if (items[id]) {\n        rootEl.removeChild(items[id]);\n        rootEl.appendChild(items[id]);\n      }\n    });\n    useAnimation && this.animateAll();\n  },\n\n  /**\r\n   * Save the current sorting\r\n   */\n  save: function save() {\n    var store = this.options.store;\n    store && store.set && store.set(this);\n  },\n\n  /**\r\n   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n   * @param   {HTMLElement}  el\r\n   * @param   {String}       [selector]  default: `options.draggable`\r\n   * @returns {HTMLElement|null}\r\n   */\n  closest: function closest$1(el, selector) {\n    return closest(el, selector || this.options.draggable, this.el, false);\n  },\n\n  /**\r\n   * Set/get option\r\n   * @param   {string} name\r\n   * @param   {*}      [value]\r\n   * @returns {*}\r\n   */\n  option: function option(name, value) {\n    var options = this.options;\n\n    if (value === void 0) {\n      return options[name];\n    } else {\n      var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n      if (typeof modifiedValue !== 'undefined') {\n        options[name] = modifiedValue;\n      } else {\n        options[name] = value;\n      }\n\n      if (name === 'group') {\n        _prepareGroup(options);\n      }\n    }\n  },\n\n  /**\r\n   * Destroy\r\n   */\n  destroy: function destroy() {\n    pluginEvent('destroy', this);\n    var el = this.el;\n    el[expando] = null;\n    off(el, 'mousedown', this._onTapStart);\n    off(el, 'touchstart', this._onTapStart);\n    off(el, 'pointerdown', this._onTapStart);\n\n    if (this.nativeDraggable) {\n      off(el, 'dragover', this);\n      off(el, 'dragenter', this);\n    } // Remove draggable attributes\n\n\n    Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n      el.removeAttribute('draggable');\n    });\n\n    this._onDrop();\n\n    this._disableDelayedDragEvents();\n\n    sortables.splice(sortables.indexOf(this.el), 1);\n    this.el = el = null;\n  },\n  _hideClone: function _hideClone() {\n    if (!cloneHidden) {\n      pluginEvent('hideClone', this);\n      if (Sortable.eventCanceled) return;\n      css(cloneEl, 'display', 'none');\n\n      if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n        cloneEl.parentNode.removeChild(cloneEl);\n      }\n\n      cloneHidden = true;\n    }\n  },\n  _showClone: function _showClone(putSortable) {\n    if (putSortable.lastPutMode !== 'clone') {\n      this._hideClone();\n\n      return;\n    }\n\n    if (cloneHidden) {\n      pluginEvent('showClone', this);\n      if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n      if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n        rootEl.insertBefore(cloneEl, dragEl);\n      } else if (nextEl) {\n        rootEl.insertBefore(cloneEl, nextEl);\n      } else {\n        rootEl.appendChild(cloneEl);\n      }\n\n      if (this.options.group.revertClone) {\n        this.animate(dragEl, cloneEl);\n      }\n\n      css(cloneEl, 'display', '');\n      cloneHidden = false;\n    }\n  }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n  if (evt.dataTransfer) {\n    evt.dataTransfer.dropEffect = 'move';\n  }\n\n  evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n  var evt,\n      sortable = fromEl[expando],\n      onMoveFn = sortable.options.onMove,\n      retVal; // Support for new CustomEvent feature\n\n  if (window.CustomEvent && !IE11OrLess && !Edge) {\n    evt = new CustomEvent('move', {\n      bubbles: true,\n      cancelable: true\n    });\n  } else {\n    evt = document.createEvent('Event');\n    evt.initEvent('move', true, true);\n  }\n\n  evt.to = toEl;\n  evt.from = fromEl;\n  evt.dragged = dragEl;\n  evt.draggedRect = dragRect;\n  evt.related = targetEl || toEl;\n  evt.relatedRect = targetRect || getRect(toEl);\n  evt.willInsertAfter = willInsertAfter;\n  evt.originalEvent = originalEvent;\n  fromEl.dispatchEvent(evt);\n\n  if (onMoveFn) {\n    retVal = onMoveFn.call(sortable, evt, originalEvent);\n  }\n\n  return retVal;\n}\n\nfunction _disableDraggable(el) {\n  el.draggable = false;\n}\n\nfunction _unsilent() {\n  _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n  var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n  var spacer = 10;\n  return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n  var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n  var spacer = 10;\n  return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n  var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n      targetLength = vertical ? targetRect.height : targetRect.width,\n      targetS1 = vertical ? targetRect.top : targetRect.left,\n      targetS2 = vertical ? targetRect.bottom : targetRect.right,\n      invert = false;\n\n  if (!invertSwap) {\n    // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n    if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n      // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n      // check if past first invert threshold on side opposite of lastDirection\n      if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n        // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n        pastFirstInvertThresh = true;\n      }\n\n      if (!pastFirstInvertThresh) {\n        // dragEl shadow (target move distance shadow)\n        if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n        : mouseOnAxis > targetS2 - targetMoveDistance) {\n          return -lastDirection;\n        }\n      } else {\n        invert = true;\n      }\n    } else {\n      // Regular\n      if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n        return _getInsertDirection(target);\n      }\n    }\n  }\n\n  invert = invert || invertSwap;\n\n  if (invert) {\n    // Invert of regular\n    if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n      return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n    }\n  }\n\n  return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param  {HTMLElement} target       The target whose position dragEl is being inserted at\r\n * @return {Number}                   Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n  if (index(dragEl) < index(target)) {\n    return 1;\n  } else {\n    return -1;\n  }\n}\n/**\r\n * Generate id\r\n * @param   {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n  var str = el.tagName + el.className + el.src + el.href + el.textContent,\n      i = str.length,\n      sum = 0;\n\n  while (i--) {\n    sum += str.charCodeAt(i);\n  }\n\n  return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n  savedInputChecked.length = 0;\n  var inputs = root.getElementsByTagName('input');\n  var idx = inputs.length;\n\n  while (idx--) {\n    var el = inputs[idx];\n    el.checked && savedInputChecked.push(el);\n  }\n}\n\nfunction _nextTick(fn) {\n  return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n  return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n  on(document, 'touchmove', function (evt) {\n    if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n      evt.preventDefault();\n    }\n  });\n} // Export utils\n\n\nSortable.utils = {\n  on: on,\n  off: off,\n  css: css,\n  find: find,\n  is: function is(el, selector) {\n    return !!closest(el, selector, el, false);\n  },\n  extend: extend,\n  throttle: throttle,\n  closest: closest,\n  toggleClass: toggleClass,\n  clone: clone,\n  index: index,\n  nextTick: _nextTick,\n  cancelNextTick: _cancelNextTick,\n  detectDirection: _detectDirection,\n  getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param  {HTMLElement} element The element\r\n * @return {Sortable|undefined}         The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n  return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param  {...SortablePlugin|SortablePlugin[]} plugins       Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n  for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n    plugins[_key] = arguments[_key];\n  }\n\n  if (plugins[0].constructor === Array) plugins = plugins[0];\n  plugins.forEach(function (plugin) {\n    if (!plugin.prototype || !plugin.prototype.constructor) {\n      throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n    }\n\n    if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n    PluginManager.mount(plugin);\n  });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement}  el\r\n * @param {Object}      [options]\r\n */\n\n\nSortable.create = function (el, options) {\n  return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n    scrollEl,\n    scrollRootEl,\n    scrolling = false,\n    lastAutoScrollX,\n    lastAutoScrollY,\n    touchEvt$1,\n    pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n  function AutoScroll() {\n    this.defaults = {\n      scroll: true,\n      forceAutoScrollFallback: false,\n      scrollSensitivity: 30,\n      scrollSpeed: 10,\n      bubbleScroll: true\n    }; // Bind all private methods\n\n    for (var fn in this) {\n      if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n        this[fn] = this[fn].bind(this);\n      }\n    }\n  }\n\n  AutoScroll.prototype = {\n    dragStarted: function dragStarted(_ref) {\n      var originalEvent = _ref.originalEvent;\n\n      if (this.sortable.nativeDraggable) {\n        on(document, 'dragover', this._handleAutoScroll);\n      } else {\n        if (this.options.supportPointer) {\n          on(document, 'pointermove', this._handleFallbackAutoScroll);\n        } else if (originalEvent.touches) {\n          on(document, 'touchmove', this._handleFallbackAutoScroll);\n        } else {\n          on(document, 'mousemove', this._handleFallbackAutoScroll);\n        }\n      }\n    },\n    dragOverCompleted: function dragOverCompleted(_ref2) {\n      var originalEvent = _ref2.originalEvent;\n\n      // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n      if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n        this._handleAutoScroll(originalEvent);\n      }\n    },\n    drop: function drop() {\n      if (this.sortable.nativeDraggable) {\n        off(document, 'dragover', this._handleAutoScroll);\n      } else {\n        off(document, 'pointermove', this._handleFallbackAutoScroll);\n        off(document, 'touchmove', this._handleFallbackAutoScroll);\n        off(document, 'mousemove', this._handleFallbackAutoScroll);\n      }\n\n      clearPointerElemChangedInterval();\n      clearAutoScrolls();\n      cancelThrottle();\n    },\n    nulling: function nulling() {\n      touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n      autoScrolls.length = 0;\n    },\n    _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n      this._handleAutoScroll(evt, true);\n    },\n    _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n      var _this = this;\n\n      var x = (evt.touches ? evt.touches[0] : evt).clientX,\n          y = (evt.touches ? evt.touches[0] : evt).clientY,\n          elem = document.elementFromPoint(x, y);\n      touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n      // Edge's autoscroll seems too conditional,\n      // MACOS Safari does not have autoscroll,\n      // Firefox and Chrome are good\n\n      if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n        autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n        var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n        if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n          pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n          pointerElemChangedInterval = setInterval(function () {\n            var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n            if (newElem !== ogElemScroller) {\n              ogElemScroller = newElem;\n              clearAutoScrolls();\n            }\n\n            autoScroll(evt, _this.options, newElem, fallback);\n          }, 10);\n          lastAutoScrollX = x;\n          lastAutoScrollY = y;\n        }\n      } else {\n        // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n        if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n          clearAutoScrolls();\n          return;\n        }\n\n        autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n      }\n    }\n  };\n  return _extends(AutoScroll, {\n    pluginName: 'scroll',\n    initializeByDefault: true\n  });\n}\n\nfunction clearAutoScrolls() {\n  autoScrolls.forEach(function (autoScroll) {\n    clearInterval(autoScroll.pid);\n  });\n  autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n  clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n  // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n  if (!options.scroll) return;\n  var x = (evt.touches ? evt.touches[0] : evt).clientX,\n      y = (evt.touches ? evt.touches[0] : evt).clientY,\n      sens = options.scrollSensitivity,\n      speed = options.scrollSpeed,\n      winScroller = getWindowScrollingElement();\n  var scrollThisInstance = false,\n      scrollCustomFn; // New scroll root, set scrollEl\n\n  if (scrollRootEl !== rootEl) {\n    scrollRootEl = rootEl;\n    clearAutoScrolls();\n    scrollEl = options.scroll;\n    scrollCustomFn = options.scrollFn;\n\n    if (scrollEl === true) {\n      scrollEl = getParentAutoScrollElement(rootEl, true);\n    }\n  }\n\n  var layersOut = 0;\n  var currentParent = scrollEl;\n\n  do {\n    var el = currentParent,\n        rect = getRect(el),\n        top = rect.top,\n        bottom = rect.bottom,\n        left = rect.left,\n        right = rect.right,\n        width = rect.width,\n        height = rect.height,\n        canScrollX = void 0,\n        canScrollY = void 0,\n        scrollWidth = el.scrollWidth,\n        scrollHeight = el.scrollHeight,\n        elCSS = css(el),\n        scrollPosX = el.scrollLeft,\n        scrollPosY = el.scrollTop;\n\n    if (el === winScroller) {\n      canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n      canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n    } else {\n      canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n      canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n    }\n\n    var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n    var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n    if (!autoScrolls[layersOut]) {\n      for (var i = 0; i <= layersOut; i++) {\n        if (!autoScrolls[i]) {\n          autoScrolls[i] = {};\n        }\n      }\n    }\n\n    if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n      autoScrolls[layersOut].el = el;\n      autoScrolls[layersOut].vx = vx;\n      autoScrolls[layersOut].vy = vy;\n      clearInterval(autoScrolls[layersOut].pid);\n\n      if (vx != 0 || vy != 0) {\n        scrollThisInstance = true;\n        /* jshint loopfunc:true */\n\n        autoScrolls[layersOut].pid = setInterval(function () {\n          // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n          if (isFallback && this.layer === 0) {\n            Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n          }\n\n          var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n          var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n          if (typeof scrollCustomFn === 'function') {\n            if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n              return;\n            }\n          }\n\n          scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n        }.bind({\n          layer: layersOut\n        }), 24);\n      }\n    }\n\n    layersOut++;\n  } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n  scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n  var originalEvent = _ref.originalEvent,\n      putSortable = _ref.putSortable,\n      dragEl = _ref.dragEl,\n      activeSortable = _ref.activeSortable,\n      dispatchSortableEvent = _ref.dispatchSortableEvent,\n      hideGhostForTarget = _ref.hideGhostForTarget,\n      unhideGhostForTarget = _ref.unhideGhostForTarget;\n  if (!originalEvent) return;\n  var toSortable = putSortable || activeSortable;\n  hideGhostForTarget();\n  var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n  var target = document.elementFromPoint(touch.clientX, touch.clientY);\n  unhideGhostForTarget();\n\n  if (toSortable && !toSortable.el.contains(target)) {\n    dispatchSortableEvent('spill');\n    this.onSpill({\n      dragEl: dragEl,\n      putSortable: putSortable\n    });\n  }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n  startIndex: null,\n  dragStart: function dragStart(_ref2) {\n    var oldDraggableIndex = _ref2.oldDraggableIndex;\n    this.startIndex = oldDraggableIndex;\n  },\n  onSpill: function onSpill(_ref3) {\n    var dragEl = _ref3.dragEl,\n        putSortable = _ref3.putSortable;\n    this.sortable.captureAnimationState();\n\n    if (putSortable) {\n      putSortable.captureAnimationState();\n    }\n\n    var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n    if (nextSibling) {\n      this.sortable.el.insertBefore(dragEl, nextSibling);\n    } else {\n      this.sortable.el.appendChild(dragEl);\n    }\n\n    this.sortable.animateAll();\n\n    if (putSortable) {\n      putSortable.animateAll();\n    }\n  },\n  drop: drop\n};\n\n_extends(Revert, {\n  pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n  onSpill: function onSpill(_ref4) {\n    var dragEl = _ref4.dragEl,\n        putSortable = _ref4.putSortable;\n    var parentSortable = putSortable || this.sortable;\n    parentSortable.captureAnimationState();\n    dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n    parentSortable.animateAll();\n  },\n  drop: drop\n};\n\n_extends(Remove, {\n  pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n  function Swap() {\n    this.defaults = {\n      swapClass: 'sortable-swap-highlight'\n    };\n  }\n\n  Swap.prototype = {\n    dragStart: function dragStart(_ref) {\n      var dragEl = _ref.dragEl;\n      lastSwapEl = dragEl;\n    },\n    dragOverValid: function dragOverValid(_ref2) {\n      var completed = _ref2.completed,\n          target = _ref2.target,\n          onMove = _ref2.onMove,\n          activeSortable = _ref2.activeSortable,\n          changed = _ref2.changed,\n          cancel = _ref2.cancel;\n      if (!activeSortable.options.swap) return;\n      var el = this.sortable.el,\n          options = this.options;\n\n      if (target && target !== el) {\n        var prevSwapEl = lastSwapEl;\n\n        if (onMove(target) !== false) {\n          toggleClass(target, options.swapClass, true);\n          lastSwapEl = target;\n        } else {\n          lastSwapEl = null;\n        }\n\n        if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n          toggleClass(prevSwapEl, options.swapClass, false);\n        }\n      }\n\n      changed();\n      completed(true);\n      cancel();\n    },\n    drop: function drop(_ref3) {\n      var activeSortable = _ref3.activeSortable,\n          putSortable = _ref3.putSortable,\n          dragEl = _ref3.dragEl;\n      var toSortable = putSortable || this.sortable;\n      var options = this.options;\n      lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n      if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n        if (dragEl !== lastSwapEl) {\n          toSortable.captureAnimationState();\n          if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n          swapNodes(dragEl, lastSwapEl);\n          toSortable.animateAll();\n          if (toSortable !== activeSortable) activeSortable.animateAll();\n        }\n      }\n    },\n    nulling: function nulling() {\n      lastSwapEl = null;\n    }\n  };\n  return _extends(Swap, {\n    pluginName: 'swap',\n    eventProperties: function eventProperties() {\n      return {\n        swapItem: lastSwapEl\n      };\n    }\n  });\n}\n\nfunction swapNodes(n1, n2) {\n  var p1 = n1.parentNode,\n      p2 = n2.parentNode,\n      i1,\n      i2;\n  if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n  i1 = index(n1);\n  i2 = index(n2);\n\n  if (p1.isEqualNode(p2) && i1 < i2) {\n    i2++;\n  }\n\n  p1.insertBefore(n2, p1.children[i1]);\n  p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n    multiDragClones = [],\n    lastMultiDragSelect,\n    // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n    initialFolding = false,\n    // Initial multi-drag fold when drag started\nfolding = false,\n    // Folding any other time\ndragStarted = false,\n    dragEl$1,\n    clonesFromRect,\n    clonesHidden;\n\nfunction MultiDragPlugin() {\n  function MultiDrag(sortable) {\n    // Bind all private methods\n    for (var fn in this) {\n      if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n        this[fn] = this[fn].bind(this);\n      }\n    }\n\n    if (!sortable.options.avoidImplicitDeselect) {\n      if (sortable.options.supportPointer) {\n        on(document, 'pointerup', this._deselectMultiDrag);\n      } else {\n        on(document, 'mouseup', this._deselectMultiDrag);\n        on(document, 'touchend', this._deselectMultiDrag);\n      }\n    }\n\n    on(document, 'keydown', this._checkKeyDown);\n    on(document, 'keyup', this._checkKeyUp);\n    this.defaults = {\n      selectedClass: 'sortable-selected',\n      multiDragKey: null,\n      avoidImplicitDeselect: false,\n      setData: function setData(dataTransfer, dragEl) {\n        var data = '';\n\n        if (multiDragElements.length && multiDragSortable === sortable) {\n          multiDragElements.forEach(function (multiDragElement, i) {\n            data += (!i ? '' : ', ') + multiDragElement.textContent;\n          });\n        } else {\n          data = dragEl.textContent;\n        }\n\n        dataTransfer.setData('Text', data);\n      }\n    };\n  }\n\n  MultiDrag.prototype = {\n    multiDragKeyDown: false,\n    isMultiDrag: false,\n    delayStartGlobal: function delayStartGlobal(_ref) {\n      var dragged = _ref.dragEl;\n      dragEl$1 = dragged;\n    },\n    delayEnded: function delayEnded() {\n      this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n    },\n    setupClone: function setupClone(_ref2) {\n      var sortable = _ref2.sortable,\n          cancel = _ref2.cancel;\n      if (!this.isMultiDrag) return;\n\n      for (var i = 0; i < multiDragElements.length; i++) {\n        multiDragClones.push(clone(multiDragElements[i]));\n        multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n        multiDragClones[i].draggable = false;\n        multiDragClones[i].style['will-change'] = '';\n        toggleClass(multiDragClones[i], this.options.selectedClass, false);\n        multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n      }\n\n      sortable._hideClone();\n\n      cancel();\n    },\n    clone: function clone(_ref3) {\n      var sortable = _ref3.sortable,\n          rootEl = _ref3.rootEl,\n          dispatchSortableEvent = _ref3.dispatchSortableEvent,\n          cancel = _ref3.cancel;\n      if (!this.isMultiDrag) return;\n\n      if (!this.options.removeCloneOnHide) {\n        if (multiDragElements.length && multiDragSortable === sortable) {\n          insertMultiDragClones(true, rootEl);\n          dispatchSortableEvent('clone');\n          cancel();\n        }\n      }\n    },\n    showClone: function showClone(_ref4) {\n      var cloneNowShown = _ref4.cloneNowShown,\n          rootEl = _ref4.rootEl,\n          cancel = _ref4.cancel;\n      if (!this.isMultiDrag) return;\n      insertMultiDragClones(false, rootEl);\n      multiDragClones.forEach(function (clone) {\n        css(clone, 'display', '');\n      });\n      cloneNowShown();\n      clonesHidden = false;\n      cancel();\n    },\n    hideClone: function hideClone(_ref5) {\n      var _this = this;\n\n      var sortable = _ref5.sortable,\n          cloneNowHidden = _ref5.cloneNowHidden,\n          cancel = _ref5.cancel;\n      if (!this.isMultiDrag) return;\n      multiDragClones.forEach(function (clone) {\n        css(clone, 'display', 'none');\n\n        if (_this.options.removeCloneOnHide && clone.parentNode) {\n          clone.parentNode.removeChild(clone);\n        }\n      });\n      cloneNowHidden();\n      clonesHidden = true;\n      cancel();\n    },\n    dragStartGlobal: function dragStartGlobal(_ref6) {\n      var sortable = _ref6.sortable;\n\n      if (!this.isMultiDrag && multiDragSortable) {\n        multiDragSortable.multiDrag._deselectMultiDrag();\n      }\n\n      multiDragElements.forEach(function (multiDragElement) {\n        multiDragElement.sortableIndex = index(multiDragElement);\n      }); // Sort multi-drag elements\n\n      multiDragElements = multiDragElements.sort(function (a, b) {\n        return a.sortableIndex - b.sortableIndex;\n      });\n      dragStarted = true;\n    },\n    dragStarted: function dragStarted(_ref7) {\n      var _this2 = this;\n\n      var sortable = _ref7.sortable;\n      if (!this.isMultiDrag) return;\n\n      if (this.options.sort) {\n        // Capture rects,\n        // hide multi drag elements (by positioning them absolute),\n        // set multi drag elements rects to dragRect,\n        // show multi drag elements,\n        // animate to rects,\n        // unset rects & remove from DOM\n        sortable.captureAnimationState();\n\n        if (this.options.animation) {\n          multiDragElements.forEach(function (multiDragElement) {\n            if (multiDragElement === dragEl$1) return;\n            css(multiDragElement, 'position', 'absolute');\n          });\n          var dragRect = getRect(dragEl$1, false, true, true);\n          multiDragElements.forEach(function (multiDragElement) {\n            if (multiDragElement === dragEl$1) return;\n            setRect(multiDragElement, dragRect);\n          });\n          folding = true;\n          initialFolding = true;\n        }\n      }\n\n      sortable.animateAll(function () {\n        folding = false;\n        initialFolding = false;\n\n        if (_this2.options.animation) {\n          multiDragElements.forEach(function (multiDragElement) {\n            unsetRect(multiDragElement);\n          });\n        } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n        if (_this2.options.sort) {\n          removeMultiDragElements();\n        }\n      });\n    },\n    dragOver: function dragOver(_ref8) {\n      var target = _ref8.target,\n          completed = _ref8.completed,\n          cancel = _ref8.cancel;\n\n      if (folding && ~multiDragElements.indexOf(target)) {\n        completed(false);\n        cancel();\n      }\n    },\n    revert: function revert(_ref9) {\n      var fromSortable = _ref9.fromSortable,\n          rootEl = _ref9.rootEl,\n          sortable = _ref9.sortable,\n          dragRect = _ref9.dragRect;\n\n      if (multiDragElements.length > 1) {\n        // Setup unfold animation\n        multiDragElements.forEach(function (multiDragElement) {\n          sortable.addAnimationState({\n            target: multiDragElement,\n            rect: folding ? getRect(multiDragElement) : dragRect\n          });\n          unsetRect(multiDragElement);\n          multiDragElement.fromRect = dragRect;\n          fromSortable.removeAnimationState(multiDragElement);\n        });\n        folding = false;\n        insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n      }\n    },\n    dragOverCompleted: function dragOverCompleted(_ref10) {\n      var sortable = _ref10.sortable,\n          isOwner = _ref10.isOwner,\n          insertion = _ref10.insertion,\n          activeSortable = _ref10.activeSortable,\n          parentEl = _ref10.parentEl,\n          putSortable = _ref10.putSortable;\n      var options = this.options;\n\n      if (insertion) {\n        // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n        if (isOwner) {\n          activeSortable._hideClone();\n        }\n\n        initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n        if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n          // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n          var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n          multiDragElements.forEach(function (multiDragElement) {\n            if (multiDragElement === dragEl$1) return;\n            setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n            // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n            parentEl.appendChild(multiDragElement);\n          });\n          folding = true;\n        } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n        if (!isOwner) {\n          // Only remove if not folding (folding will remove them anyways)\n          if (!folding) {\n            removeMultiDragElements();\n          }\n\n          if (multiDragElements.length > 1) {\n            var clonesHiddenBefore = clonesHidden;\n\n            activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n            if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n              multiDragClones.forEach(function (clone) {\n                activeSortable.addAnimationState({\n                  target: clone,\n                  rect: clonesFromRect\n                });\n                clone.fromRect = clonesFromRect;\n                clone.thisAnimationDuration = null;\n              });\n            }\n          } else {\n            activeSortable._showClone(sortable);\n          }\n        }\n      }\n    },\n    dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n      var dragRect = _ref11.dragRect,\n          isOwner = _ref11.isOwner,\n          activeSortable = _ref11.activeSortable;\n      multiDragElements.forEach(function (multiDragElement) {\n        multiDragElement.thisAnimationDuration = null;\n      });\n\n      if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n        clonesFromRect = _extends({}, dragRect);\n        var dragMatrix = matrix(dragEl$1, true);\n        clonesFromRect.top -= dragMatrix.f;\n        clonesFromRect.left -= dragMatrix.e;\n      }\n    },\n    dragOverAnimationComplete: function dragOverAnimationComplete() {\n      if (folding) {\n        folding = false;\n        removeMultiDragElements();\n      }\n    },\n    drop: function drop(_ref12) {\n      var evt = _ref12.originalEvent,\n          rootEl = _ref12.rootEl,\n          parentEl = _ref12.parentEl,\n          sortable = _ref12.sortable,\n          dispatchSortableEvent = _ref12.dispatchSortableEvent,\n          oldIndex = _ref12.oldIndex,\n          putSortable = _ref12.putSortable;\n      var toSortable = putSortable || this.sortable;\n      if (!evt) return;\n      var options = this.options,\n          children = parentEl.children; // Multi-drag selection\n\n      if (!dragStarted) {\n        if (options.multiDragKey && !this.multiDragKeyDown) {\n          this._deselectMultiDrag();\n        }\n\n        toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n        if (!~multiDragElements.indexOf(dragEl$1)) {\n          multiDragElements.push(dragEl$1);\n          dispatchEvent({\n            sortable: sortable,\n            rootEl: rootEl,\n            name: 'select',\n            targetEl: dragEl$1,\n            originalEvent: evt\n          }); // Modifier activated, select from last to dragEl\n\n          if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n            var lastIndex = index(lastMultiDragSelect),\n                currentIndex = index(dragEl$1);\n\n            if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n              // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n              // (but previous selection existed)\n              var n, i;\n\n              if (currentIndex > lastIndex) {\n                i = lastIndex;\n                n = currentIndex;\n              } else {\n                i = currentIndex;\n                n = lastIndex + 1;\n              }\n\n              for (; i < n; i++) {\n                if (~multiDragElements.indexOf(children[i])) continue;\n                toggleClass(children[i], options.selectedClass, true);\n                multiDragElements.push(children[i]);\n                dispatchEvent({\n                  sortable: sortable,\n                  rootEl: rootEl,\n                  name: 'select',\n                  targetEl: children[i],\n                  originalEvent: evt\n                });\n              }\n            }\n          } else {\n            lastMultiDragSelect = dragEl$1;\n          }\n\n          multiDragSortable = toSortable;\n        } else {\n          multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n          lastMultiDragSelect = null;\n          dispatchEvent({\n            sortable: sortable,\n            rootEl: rootEl,\n            name: 'deselect',\n            targetEl: dragEl$1,\n            originalEvent: evt\n          });\n        }\n      } // Multi-drag drop\n\n\n      if (dragStarted && this.isMultiDrag) {\n        folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n        if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n          var dragRect = getRect(dragEl$1),\n              multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n          if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n          toSortable.captureAnimationState();\n\n          if (!initialFolding) {\n            if (options.animation) {\n              dragEl$1.fromRect = dragRect;\n              multiDragElements.forEach(function (multiDragElement) {\n                multiDragElement.thisAnimationDuration = null;\n\n                if (multiDragElement !== dragEl$1) {\n                  var rect = folding ? getRect(multiDragElement) : dragRect;\n                  multiDragElement.fromRect = rect; // Prepare unfold animation\n\n                  toSortable.addAnimationState({\n                    target: multiDragElement,\n                    rect: rect\n                  });\n                }\n              });\n            } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n            // properly they must all be removed\n\n\n            removeMultiDragElements();\n            multiDragElements.forEach(function (multiDragElement) {\n              if (children[multiDragIndex]) {\n                parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n              } else {\n                parentEl.appendChild(multiDragElement);\n              }\n\n              multiDragIndex++;\n            }); // If initial folding is done, the elements may have changed position because they are now\n            // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n            // must be fired here as Sortable will not.\n\n            if (oldIndex === index(dragEl$1)) {\n              var update = false;\n              multiDragElements.forEach(function (multiDragElement) {\n                if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n                  update = true;\n                  return;\n                }\n              });\n\n              if (update) {\n                dispatchSortableEvent('update');\n              }\n            }\n          } // Must be done after capturing individual rects (scroll bar)\n\n\n          multiDragElements.forEach(function (multiDragElement) {\n            unsetRect(multiDragElement);\n          });\n          toSortable.animateAll();\n        }\n\n        multiDragSortable = toSortable;\n      } // Remove clones if necessary\n\n\n      if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n        multiDragClones.forEach(function (clone) {\n          clone.parentNode && clone.parentNode.removeChild(clone);\n        });\n      }\n    },\n    nullingGlobal: function nullingGlobal() {\n      this.isMultiDrag = dragStarted = false;\n      multiDragClones.length = 0;\n    },\n    destroyGlobal: function destroyGlobal() {\n      this._deselectMultiDrag();\n\n      off(document, 'pointerup', this._deselectMultiDrag);\n      off(document, 'mouseup', this._deselectMultiDrag);\n      off(document, 'touchend', this._deselectMultiDrag);\n      off(document, 'keydown', this._checkKeyDown);\n      off(document, 'keyup', this._checkKeyUp);\n    },\n    _deselectMultiDrag: function _deselectMultiDrag(evt) {\n      if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n      if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n      if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n      if (evt && evt.button !== 0) return;\n\n      while (multiDragElements.length) {\n        var el = multiDragElements[0];\n        toggleClass(el, this.options.selectedClass, false);\n        multiDragElements.shift();\n        dispatchEvent({\n          sortable: this.sortable,\n          rootEl: this.sortable.el,\n          name: 'deselect',\n          targetEl: el,\n          originalEvent: evt\n        });\n      }\n    },\n    _checkKeyDown: function _checkKeyDown(evt) {\n      if (evt.key === this.options.multiDragKey) {\n        this.multiDragKeyDown = true;\n      }\n    },\n    _checkKeyUp: function _checkKeyUp(evt) {\n      if (evt.key === this.options.multiDragKey) {\n        this.multiDragKeyDown = false;\n      }\n    }\n  };\n  return _extends(MultiDrag, {\n    // Static methods & properties\n    pluginName: 'multiDrag',\n    utils: {\n      /**\r\n       * Selects the provided multi-drag item\r\n       * @param  {HTMLElement} el    The element to be selected\r\n       */\n      select: function select(el) {\n        var sortable = el.parentNode[expando];\n        if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n        if (multiDragSortable && multiDragSortable !== sortable) {\n          multiDragSortable.multiDrag._deselectMultiDrag();\n\n          multiDragSortable = sortable;\n        }\n\n        toggleClass(el, sortable.options.selectedClass, true);\n        multiDragElements.push(el);\n      },\n\n      /**\r\n       * Deselects the provided multi-drag item\r\n       * @param  {HTMLElement} el    The element to be deselected\r\n       */\n      deselect: function deselect(el) {\n        var sortable = el.parentNode[expando],\n            index = multiDragElements.indexOf(el);\n        if (!sortable || !sortable.options.multiDrag || !~index) return;\n        toggleClass(el, sortable.options.selectedClass, false);\n        multiDragElements.splice(index, 1);\n      }\n    },\n    eventProperties: function eventProperties() {\n      var _this3 = this;\n\n      var oldIndicies = [],\n          newIndicies = [];\n      multiDragElements.forEach(function (multiDragElement) {\n        oldIndicies.push({\n          multiDragElement: multiDragElement,\n          index: multiDragElement.sortableIndex\n        }); // multiDragElements will already be sorted if folding\n\n        var newIndex;\n\n        if (folding && multiDragElement !== dragEl$1) {\n          newIndex = -1;\n        } else if (folding) {\n          newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n        } else {\n          newIndex = index(multiDragElement);\n        }\n\n        newIndicies.push({\n          multiDragElement: multiDragElement,\n          index: newIndex\n        });\n      });\n      return {\n        items: _toConsumableArray(multiDragElements),\n        clones: [].concat(multiDragClones),\n        oldIndicies: oldIndicies,\n        newIndicies: newIndicies\n      };\n    },\n    optionListeners: {\n      multiDragKey: function multiDragKey(key) {\n        key = key.toLowerCase();\n\n        if (key === 'ctrl') {\n          key = 'Control';\n        } else if (key.length > 1) {\n          key = key.charAt(0).toUpperCase() + key.substr(1);\n        }\n\n        return key;\n      }\n    }\n  });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n  multiDragElements.forEach(function (multiDragElement, i) {\n    var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n    if (target) {\n      rootEl.insertBefore(multiDragElement, target);\n    } else {\n      rootEl.appendChild(multiDragElement);\n    }\n  });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param  {[Boolean]} elementsInserted  Whether the multi-drag elements are inserted\r\n * @param  {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n  multiDragClones.forEach(function (clone, i) {\n    var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n    if (target) {\n      rootEl.insertBefore(clone, target);\n    } else {\n      rootEl.appendChild(clone);\n    }\n  });\n}\n\nfunction removeMultiDragElements() {\n  multiDragElements.forEach(function (multiDragElement) {\n    if (multiDragElement === dragEl$1) return;\n    multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n  });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n", "import Sortable from 'sortablejs'\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"draggable\"\nexport default class extends Controller {\n  \n  static targets = ['linkList', 'testimonialList', 'profileFeaturedListingsList']\n  \n  static values = {\n    linkUrl: String,\n    testimonialUrl: String,\n    profileFeaturedListingsUrl: String\n\n  }\n  \n  linkListTargetConnected(element) {\n    let url = this.linkUrlValue\n    \n    var sortable = Sortable.create(element, {\n      handle: \".handle\",\n      onEnd: function(event) {\n        var order = sortable.toArray();\n        var str = JSON.stringify(order);\n        const newOrder = JSON.stringify(JSON.parse(\"{\\\"order\\\":\" + str + \"}\"));\n        \n        fetch(url, {\n            method: 'PUT',\n            body: newOrder,\n            headers: {\n               'Content-type': 'application/json; charset=UTF-8'\n            }\n         });\n        \n      }\n    });\n    \n  }\n  \n  testimonialListTargetConnected(element) {\n    let url = this.testimonialUrlValue\n    \n    var sortable = Sortable.create(element, {\n      handle: \".handle\",\n      onEnd: function(event) {\n        var order = sortable.toArray();\n        var str = JSON.stringify(order);\n        const newOrder = JSON.stringify(JSON.parse(\"{\\\"order\\\":\" + str + \"}\"));\n        \n        fetch(url, {\n            method: 'PUT',\n            body: newOrder,\n            headers: {\n               'Content-type': 'application/json; charset=UTF-8'\n            }\n         });\n        \n      }\n    });\n    \n  }\n\n  \n  profileFeaturedListingsListTargetConnected(element) {\n    let url = this.profileFeaturedListingsUrlValue\n    \n    var sortable = Sortable.create(element, {\n      handle: \".handle\",\n      onEnd: function(event) {\n        var order = sortable.toArray();\n        const newOrder = JSON.stringify(order)\n        \n        fetch(url, {\n            method: 'PUT',\n            body: newOrder,\n            headers: {\n               'Content-type': 'application/json; charset=UTF-8'\n            }\n         });\n        \n      }\n    });\n    \n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"favorite\"\nexport default class extends Controller {\n\n  static values = {\n    item: String,\n    addUrl: String,\n    removeUrl: String,\n    favorited: Boolean\n  }\n\n  toggle(e) {\n    var favoriteButton = e.target;\n    var id = this.itemValue;\n    var url;\n    var that = this;\n\n    favoriteButton.classList.toggle('favorited');\n\n    if (this.favoritedValue) {\n      url = this.removeUrlValue;\n    } else {\n      url = this.addUrlValue;\n    }\n\n    fetch(url, {\n      method: \"put\",\n      headers: {\n        'Accept': 'application/json',\n        'Content-Type': 'application/json',\n        'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')\n      }\n    })\n    .then( (response) => {\n      let frameElement = document.getElementById('item-' + that.itemValue);\n      let alertFrameElement = document.getElementById('flash');\n      frameElement.src = location;\n      alertFrameElement.src = location;\n      frameElement.reload();\n      alertFrameElement.reload();\n    });\n  }\n\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\n */\n\nexport const CONSTANTS = {\n  /**\n   * @define {boolean} Whether this is the client Node.js SDK.\n   */\n  NODE_CLIENT: false,\n  /**\n   * @define {boolean} Whether this is the Admin Node.js SDK.\n   */\n  NODE_ADMIN: false,\n\n  /**\n   * Firebase SDK Version\n   */\n  SDK_VERSION: '${JSCORE_VERSION}'\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CONSTANTS } from './constants';\n\n/**\n * Throws an error if the provided assertion is falsy\n */\nexport const assert = function (assertion: unknown, message: string): void {\n  if (!assertion) {\n    throw assertionError(message);\n  }\n};\n\n/**\n * Returns an Error object suitable for throwing.\n */\nexport const assertionError = function (message: string): Error {\n  return new Error(\n    'Firebase Database (' +\n      CONSTANTS.SDK_VERSION +\n      ') INTERNAL ASSERT FAILED: ' +\n      message\n  );\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst stringToByteArray = function (str: string): number[] {\n  // TODO(user): Use native implementations if/when available\n  const out: number[] = [];\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    let c = str.charCodeAt(i);\n    if (c < 128) {\n      out[p++] = c;\n    } else if (c < 2048) {\n      out[p++] = (c >> 6) | 192;\n      out[p++] = (c & 63) | 128;\n    } else if (\n      (c & 0xfc00) === 0xd800 &&\n      i + 1 < str.length &&\n      (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00\n    ) {\n      // Surrogate Pair\n      c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\n      out[p++] = (c >> 18) | 240;\n      out[p++] = ((c >> 12) & 63) | 128;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    } else {\n      out[p++] = (c >> 12) | 224;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    }\n  }\n  return out;\n};\n\n/**\n * Turns an array of numbers into the string given by the concatenation of the\n * characters to which the numbers correspond.\n * @param bytes Array of numbers representing characters.\n * @return Stringification of the array.\n */\nconst byteArrayToString = function (bytes: number[]): string {\n  // TODO(user): Use native implementations if/when available\n  const out: string[] = [];\n  let pos = 0,\n    c = 0;\n  while (pos < bytes.length) {\n    const c1 = bytes[pos++];\n    if (c1 < 128) {\n      out[c++] = String.fromCharCode(c1);\n    } else if (c1 > 191 && c1 < 224) {\n      const c2 = bytes[pos++];\n      out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n    } else if (c1 > 239 && c1 < 365) {\n      // Surrogate Pair\n      const c2 = bytes[pos++];\n      const c3 = bytes[pos++];\n      const c4 = bytes[pos++];\n      const u =\n        (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\n        0x10000;\n      out[c++] = String.fromCharCode(0xd800 + (u >> 10));\n      out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\n    } else {\n      const c2 = bytes[pos++];\n      const c3 = bytes[pos++];\n      out[c++] = String.fromCharCode(\n        ((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)\n      );\n    }\n  }\n  return out.join('');\n};\n\ninterface Base64 {\n  byteToCharMap_: { [key: number]: string } | null;\n  charToByteMap_: { [key: string]: number } | null;\n  byteToCharMapWebSafe_: { [key: number]: string } | null;\n  charToByteMapWebSafe_: { [key: string]: number } | null;\n  ENCODED_VALS_BASE: string;\n  readonly ENCODED_VALS: string;\n  readonly ENCODED_VALS_WEBSAFE: string;\n  HAS_NATIVE_SUPPORT: boolean;\n  encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string;\n  encodeString(input: string, webSafe?: boolean): string;\n  decodeString(input: string, webSafe: boolean): string;\n  decodeStringToByteArray(input: string, webSafe: boolean): number[];\n  init_(): void;\n}\n\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\n// Static lookup maps, lazily populated by init_()\nexport const base64: Base64 = {\n  /**\n   * Maps bytes to characters.\n   */\n  byteToCharMap_: null,\n\n  /**\n   * Maps characters to bytes.\n   */\n  charToByteMap_: null,\n\n  /**\n   * Maps bytes to websafe characters.\n   * @private\n   */\n  byteToCharMapWebSafe_: null,\n\n  /**\n   * Maps websafe characters to bytes.\n   * @private\n   */\n  charToByteMapWebSafe_: null,\n\n  /**\n   * Our default alphabet, shared between\n   * ENCODED_VALS and ENCODED_VALS_WEBSAFE\n   */\n  ENCODED_VALS_BASE:\n    'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\n\n  /**\n   * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\n   */\n  get ENCODED_VALS() {\n    return this.ENCODED_VALS_BASE + '+/=';\n  },\n\n  /**\n   * Our websafe alphabet.\n   */\n  get ENCODED_VALS_WEBSAFE() {\n    return this.ENCODED_VALS_BASE + '-_.';\n  },\n\n  /**\n   * Whether this browser supports the atob and btoa functions. This extension\n   * started at Mozilla but is now implemented by many browsers. We use the\n   * ASSUME_* variables to avoid pulling in the full useragent detection library\n   * but still allowing the standard per-browser compilations.\n   *\n   */\n  HAS_NATIVE_SUPPORT: typeof atob === 'function',\n\n  /**\n   * Base64-encode an array of bytes.\n   *\n   * @param input An array of bytes (numbers with\n   *     value in [0, 255]) to encode.\n   * @param webSafe Boolean indicating we should use the\n   *     alternative alphabet.\n   * @return The base64 encoded string.\n   */\n  encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string {\n    if (!Array.isArray(input)) {\n      throw Error('encodeByteArray takes an array as a parameter');\n    }\n\n    this.init_();\n\n    const byteToCharMap = webSafe\n      ? this.byteToCharMapWebSafe_!\n      : this.byteToCharMap_!;\n\n    const output = [];\n\n    for (let i = 0; i < input.length; i += 3) {\n      const byte1 = input[i];\n      const haveByte2 = i + 1 < input.length;\n      const byte2 = haveByte2 ? input[i + 1] : 0;\n      const haveByte3 = i + 2 < input.length;\n      const byte3 = haveByte3 ? input[i + 2] : 0;\n\n      const outByte1 = byte1 >> 2;\n      const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\n      let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\n      let outByte4 = byte3 & 0x3f;\n\n      if (!haveByte3) {\n        outByte4 = 64;\n\n        if (!haveByte2) {\n          outByte3 = 64;\n        }\n      }\n\n      output.push(\n        byteToCharMap[outByte1],\n        byteToCharMap[outByte2],\n        byteToCharMap[outByte3],\n        byteToCharMap[outByte4]\n      );\n    }\n\n    return output.join('');\n  },\n\n  /**\n   * Base64-encode a string.\n   *\n   * @param input A string to encode.\n   * @param webSafe If true, we should use the\n   *     alternative alphabet.\n   * @return The base64 encoded string.\n   */\n  encodeString(input: string, webSafe?: boolean): string {\n    // Shortcut for Mozilla browsers that implement\n    // a native base64 encoder in the form of \"btoa/atob\"\n    if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n      return btoa(input);\n    }\n    return this.encodeByteArray(stringToByteArray(input), webSafe);\n  },\n\n  /**\n   * Base64-decode a string.\n   *\n   * @param input to decode.\n   * @param webSafe True if we should use the\n   *     alternative alphabet.\n   * @return string representing the decoded value.\n   */\n  decodeString(input: string, webSafe: boolean): string {\n    // Shortcut for Mozilla browsers that implement\n    // a native base64 encoder in the form of \"btoa/atob\"\n    if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n      return atob(input);\n    }\n    return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\n  },\n\n  /**\n   * Base64-decode a string.\n   *\n   * In base-64 decoding, groups of four characters are converted into three\n   * bytes.  If the encoder did not apply padding, the input length may not\n   * be a multiple of 4.\n   *\n   * In this case, the last group will have fewer than 4 characters, and\n   * padding will be inferred.  If the group has one or two characters, it decodes\n   * to one byte.  If the group has three characters, it decodes to two bytes.\n   *\n   * @param input Input to decode.\n   * @param webSafe True if we should use the web-safe alphabet.\n   * @return bytes representing the decoded value.\n   */\n  decodeStringToByteArray(input: string, webSafe: boolean): number[] {\n    this.init_();\n\n    const charToByteMap = webSafe\n      ? this.charToByteMapWebSafe_!\n      : this.charToByteMap_!;\n\n    const output: number[] = [];\n\n    for (let i = 0; i < input.length; ) {\n      const byte1 = charToByteMap[input.charAt(i++)];\n\n      const haveByte2 = i < input.length;\n      const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\n      ++i;\n\n      const haveByte3 = i < input.length;\n      const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\n      ++i;\n\n      const haveByte4 = i < input.length;\n      const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\n      ++i;\n\n      if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\n        throw Error();\n      }\n\n      const outByte1 = (byte1 << 2) | (byte2 >> 4);\n      output.push(outByte1);\n\n      if (byte3 !== 64) {\n        const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\n        output.push(outByte2);\n\n        if (byte4 !== 64) {\n          const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\n          output.push(outByte3);\n        }\n      }\n    }\n\n    return output;\n  },\n\n  /**\n   * Lazy static initialization function. Called before\n   * accessing any of the static map variables.\n   * @private\n   */\n  init_() {\n    if (!this.byteToCharMap_) {\n      this.byteToCharMap_ = {};\n      this.charToByteMap_ = {};\n      this.byteToCharMapWebSafe_ = {};\n      this.charToByteMapWebSafe_ = {};\n\n      // We want quick mappings back and forth, so we precompute two maps.\n      for (let i = 0; i < this.ENCODED_VALS.length; i++) {\n        this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\n        this.charToByteMap_[this.byteToCharMap_[i]] = i;\n        this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\n        this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\n\n        // Be forgiving when decoding and correctly decode both encodings.\n        if (i >= this.ENCODED_VALS_BASE.length) {\n          this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\n          this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\n        }\n      }\n    }\n  }\n};\n\n/**\n * URL-safe base64 encoding\n */\nexport const base64Encode = function (str: string): string {\n  const utf8Bytes = stringToByteArray(str);\n  return base64.encodeByteArray(utf8Bytes, true);\n};\n\n/**\n * URL-safe base64 encoding (without \".\" padding in the end).\n * e.g. Used in JSON Web Token (JWT) parts.\n */\nexport const base64urlEncodeWithoutPadding = function (str: string): string {\n  // Use base64url encoding and remove padding in the end (dot characters).\n  return base64Encode(str).replace(/\\./g, '');\n};\n\n/**\n * URL-safe base64 decoding\n *\n * NOTE: DO NOT use the global atob() function - it does NOT support the\n * base64Url variant encoding.\n *\n * @param str To be decoded\n * @return Decoded result, if possible\n */\nexport const base64Decode = function (str: string): string | null {\n  try {\n    return base64.decodeString(str, true);\n  } catch (e) {\n    console.error('base64Decode failed: ', e);\n  }\n  return null;\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Do a deep-copy of basic JavaScript Objects or Arrays.\n */\nexport function deepCopy<T>(value: T): T {\n  return deepExtend(undefined, value) as T;\n}\n\n/**\n * Copy properties from source to target (recursively allows extension\n * of Objects and Arrays).  Scalar values in the target are over-written.\n * If target is undefined, an object of the appropriate type will be created\n * (and returned).\n *\n * We recursively copy all child properties of plain Objects in the source- so\n * that namespace- like dictionaries are merged.\n *\n * Note that the target can be a function, in which case the properties in\n * the source Object are copied onto it as static properties of the Function.\n *\n * Note: we don't merge __proto__ to prevent prototype pollution\n */\nexport function deepExtend(target: unknown, source: unknown): unknown {\n  if (!(source instanceof Object)) {\n    return source;\n  }\n\n  switch (source.constructor) {\n    case Date:\n      // Treat Dates like scalars; if the target date object had any child\n      // properties - they will be lost!\n      const dateValue = source as Date;\n      return new Date(dateValue.getTime());\n\n    case Object:\n      if (target === undefined) {\n        target = {};\n      }\n      break;\n    case Array:\n      // Always copy the array source and overwrite the target.\n      target = [];\n      break;\n\n    default:\n      // Not a plain Object - treat it as a scalar.\n      return source;\n  }\n\n  for (const prop in source) {\n    // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\n    if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\n      continue;\n    }\n    (target as Record<string, unknown>)[prop] = deepExtend(\n      (target as Record<string, unknown>)[prop],\n      (source as Record<string, unknown>)[prop]\n    );\n  }\n\n  return target;\n}\n\nfunction isValidKey(key: string): boolean {\n  return key !== '__proto__';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class Deferred<R> {\n  promise: Promise<R>;\n  reject: (value?: unknown) => void = () => {};\n  resolve: (value?: unknown) => void = () => {};\n  constructor() {\n    this.promise = new Promise((resolve, reject) => {\n      this.resolve = resolve as (value?: unknown) => void;\n      this.reject = reject as (value?: unknown) => void;\n    });\n  }\n\n  /**\n   * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\n   * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\n   * and returns a node-style callback which will resolve or reject the Deferred's promise.\n   */\n  wrapCallback(\n    callback?: (error?: unknown, value?: unknown) => void\n  ): (error: unknown, value?: unknown) => void {\n    return (error, value?) => {\n      if (error) {\n        this.reject(error);\n      } else {\n        this.resolve(value);\n      }\n      if (typeof callback === 'function') {\n        // Attaching noop handler just in case developer wasn't expecting\n        // promises\n        this.promise.catch(() => {});\n\n        // Some of our callbacks don't expect a value and our own tests\n        // assert that the parameter length is 1\n        if (callback.length === 1) {\n          callback(error);\n        } else {\n          callback(error, value);\n        }\n      }\n    };\n  }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { base64urlEncodeWithoutPadding } from './crypt';\n\n// Firebase Auth tokens contain snake_case claims following the JWT standard / convention.\n/* eslint-disable camelcase */\n\nexport type FirebaseSignInProvider =\n  | 'custom'\n  | 'email'\n  | 'password'\n  | 'phone'\n  | 'anonymous'\n  | 'google.com'\n  | 'facebook.com'\n  | 'github.com'\n  | 'twitter.com'\n  | 'microsoft.com'\n  | 'apple.com';\n\ninterface FirebaseIdToken {\n  // Always set to https://securetoken.google.com/PROJECT_ID\n  iss: string;\n\n  // Always set to PROJECT_ID\n  aud: string;\n\n  // The user's unique ID\n  sub: string;\n\n  // The token issue time, in seconds since epoch\n  iat: number;\n\n  // The token expiry time, normally 'iat' + 3600\n  exp: number;\n\n  // The user's unique ID. Must be equal to 'sub'\n  user_id: string;\n\n  // The time the user authenticated, normally 'iat'\n  auth_time: number;\n\n  // The sign in provider, only set when the provider is 'anonymous'\n  provider_id?: 'anonymous';\n\n  // The user's primary email\n  email?: string;\n\n  // The user's email verification status\n  email_verified?: boolean;\n\n  // The user's primary phone number\n  phone_number?: string;\n\n  // The user's display name\n  name?: string;\n\n  // The user's profile photo URL\n  picture?: string;\n\n  // Information on all identities linked to this user\n  firebase: {\n    // The primary sign-in provider\n    sign_in_provider: FirebaseSignInProvider;\n\n    // A map of providers to the user's list of unique identifiers from\n    // each provider\n    identities?: { [provider in FirebaseSignInProvider]?: string[] };\n  };\n\n  // Custom claims set by the developer\n  [claim: string]: unknown;\n\n  uid?: never; // Try to catch a common mistake of \"uid\" (should be \"sub\" instead).\n}\n\nexport type EmulatorMockTokenOptions = ({ user_id: string } | { sub: string }) &\n  Partial<FirebaseIdToken>;\n\nexport function createMockUserToken(\n  token: EmulatorMockTokenOptions,\n  projectId?: string\n): string {\n  if (token.uid) {\n    throw new Error(\n      'The \"uid\" field is no longer supported by mockUserToken. Please use \"sub\" instead for Firebase Auth User ID.'\n    );\n  }\n  // Unsecured JWTs use \"none\" as the algorithm.\n  const header = {\n    alg: 'none',\n    type: 'JWT'\n  };\n\n  const project = projectId || 'demo-project';\n  const iat = token.iat || 0;\n  const sub = token.sub || token.user_id;\n  if (!sub) {\n    throw new Error(\"mockUserToken must contain 'sub' or 'user_id' field!\");\n  }\n\n  const payload: FirebaseIdToken = {\n    // Set all required fields to decent defaults\n    iss: `https://securetoken.google.com/${project}`,\n    aud: project,\n    iat,\n    exp: iat + 3600,\n    auth_time: iat,\n    sub,\n    user_id: sub,\n    firebase: {\n      sign_in_provider: 'custom',\n      identities: {}\n    },\n\n    // Override with user options\n    ...token\n  };\n\n  // Unsecured JWTs use the empty string as a signature.\n  const signature = '';\n  return [\n    base64urlEncodeWithoutPadding(JSON.stringify(header)),\n    base64urlEncodeWithoutPadding(JSON.stringify(payload)),\n    signature\n  ].join('.');\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CONSTANTS } from './constants';\n\n/**\n * Returns navigator.userAgent string or '' if it's not defined.\n * @return user agent string\n */\nexport function getUA(): string {\n  if (\n    typeof navigator !== 'undefined' &&\n    typeof navigator['userAgent'] === 'string'\n  ) {\n    return navigator['userAgent'];\n  } else {\n    return '';\n  }\n}\n\n/**\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\n *\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\n * wait for a callback.\n */\nexport function isMobileCordova(): boolean {\n  return (\n    typeof window !== 'undefined' &&\n    // @ts-ignore Setting up an broadly applicable index signature for Window\n    // just to deal with this case would probably be a bad idea.\n    !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\n    /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())\n  );\n}\n\n/**\n * Detect Node.js.\n *\n * @return true if Node.js environment is detected.\n */\n// Node detection logic from: https://github.com/iliakan/detect-node/\nexport function isNode(): boolean {\n  try {\n    return (\n      Object.prototype.toString.call(global.process) === '[object process]'\n    );\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Detect Browser Environment\n */\nexport function isBrowser(): boolean {\n  return typeof self === 'object' && self.self === self;\n}\n\n/**\n * Detect browser extensions (Chrome and Firefox at least).\n */\ninterface BrowserRuntime {\n  id?: unknown;\n}\ndeclare const chrome: { runtime?: BrowserRuntime };\ndeclare const browser: { runtime?: BrowserRuntime };\nexport function isBrowserExtension(): boolean {\n  const runtime =\n    typeof chrome === 'object'\n      ? chrome.runtime\n      : typeof browser === 'object'\n      ? browser.runtime\n      : undefined;\n  return typeof runtime === 'object' && runtime.id !== undefined;\n}\n\n/**\n * Detect React Native.\n *\n * @return true if ReactNative environment is detected.\n */\nexport function isReactNative(): boolean {\n  return (\n    typeof navigator === 'object' && navigator['product'] === 'ReactNative'\n  );\n}\n\n/** Detects Electron apps. */\nexport function isElectron(): boolean {\n  return getUA().indexOf('Electron/') >= 0;\n}\n\n/** Detects Internet Explorer. */\nexport function isIE(): boolean {\n  const ua = getUA();\n  return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\n}\n\n/** Detects Universal Windows Platform apps. */\nexport function isUWP(): boolean {\n  return getUA().indexOf('MSAppHost/') >= 0;\n}\n\n/**\n * Detect whether the current SDK build is the Node version.\n *\n * @return true if it's the Node SDK build.\n */\nexport function isNodeSdk(): boolean {\n  return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\n}\n\n/** Returns true if we are running in Safari. */\nexport function isSafari(): boolean {\n  return (\n    !isNode() &&\n    navigator.userAgent.includes('Safari') &&\n    !navigator.userAgent.includes('Chrome')\n  );\n}\n\n/**\n * This method checks if indexedDB is supported by current browser/service worker context\n * @return true if indexedDB is supported by current browser/service worker context\n */\nexport function isIndexedDBAvailable(): boolean {\n  return typeof indexedDB === 'object';\n}\n\n/**\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\n * if errors occur during the database open operation.\n *\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\n * private browsing)\n */\nexport function validateIndexedDBOpenable(): Promise<boolean> {\n  return new Promise((resolve, reject) => {\n    try {\n      let preExist: boolean = true;\n      const DB_CHECK_NAME =\n        'validate-browser-context-for-indexeddb-analytics-module';\n      const request = self.indexedDB.open(DB_CHECK_NAME);\n      request.onsuccess = () => {\n        request.result.close();\n        // delete database only when it doesn't pre-exist\n        if (!preExist) {\n          self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n        }\n        resolve(true);\n      };\n      request.onupgradeneeded = () => {\n        preExist = false;\n      };\n\n      request.onerror = () => {\n        reject(request.error?.message || '');\n      };\n    } catch (error) {\n      reject(error);\n    }\n  });\n}\n\n/**\n *\n * This method checks whether cookie is enabled within current browser\n * @return true if cookie is enabled within current browser\n */\nexport function areCookiesEnabled(): boolean {\n  if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Polyfill for `globalThis` object.\n * @returns the `globalThis` object for the given environment.\n */\nexport function getGlobal(): typeof globalThis {\n  if (typeof self !== 'undefined') {\n    return self;\n  }\n  if (typeof window !== 'undefined') {\n    return window;\n  }\n  if (typeof global !== 'undefined') {\n    return global;\n  }\n  throw new Error('Unable to locate global object.');\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview Standardized Firebase Error.\n *\n * Usage:\n *\n *   // Typescript string literals for type-safe codes\n *   type Err =\n *     'unknown' |\n *     'object-not-found'\n *     ;\n *\n *   // Closure enum for type-safe error codes\n *   // at-enum {string}\n *   var Err = {\n *     UNKNOWN: 'unknown',\n *     OBJECT_NOT_FOUND: 'object-not-found',\n *   }\n *\n *   let errors: Map<Err, string> = {\n *     'generic-error': \"Unknown error\",\n *     'file-not-found': \"Could not find file: {$file}\",\n *   };\n *\n *   // Type-safe function - must pass a valid error code as param.\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\n *\n *   ...\n *   throw error.create(Err.GENERIC);\n *   ...\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\n *   ...\n *   // Service: Could not file file: foo.txt (service/file-not-found).\n *\n *   catch (e) {\n *     assert(e.message === \"Could not find file: foo.txt.\");\n *     if (e.code === 'service/file-not-found') {\n *       console.log(\"Could not read file: \" + e['file']);\n *     }\n *   }\n */\n\nexport type ErrorMap<ErrorCode extends string> = {\n  readonly [K in ErrorCode]: string;\n};\n\nconst ERROR_NAME = 'FirebaseError';\n\nexport interface StringLike {\n  toString(): string;\n}\n\nexport interface ErrorData {\n  [key: string]: unknown;\n}\n\n// Based on code from:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\nexport class FirebaseError extends Error {\n  /** The custom name for all FirebaseErrors. */\n  readonly name: string = ERROR_NAME;\n\n  constructor(\n    /** The error code for this error. */\n    readonly code: string,\n    message: string,\n    /** Custom data for this error. */\n    public customData?: Record<string, unknown>\n  ) {\n    super(message);\n\n    // Fix For ES5\n    // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n    Object.setPrototypeOf(this, FirebaseError.prototype);\n\n    // Maintains proper stack trace for where our error was thrown.\n    // Only available on V8.\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, ErrorFactory.prototype.create);\n    }\n  }\n}\n\nexport class ErrorFactory<\n  ErrorCode extends string,\n  ErrorParams extends { readonly [K in ErrorCode]?: ErrorData } = {}\n> {\n  constructor(\n    private readonly service: string,\n    private readonly serviceName: string,\n    private readonly errors: ErrorMap<ErrorCode>\n  ) {}\n\n  create<K extends ErrorCode>(\n    code: K,\n    ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []\n  ): FirebaseError {\n    const customData = (data[0] as ErrorData) || {};\n    const fullCode = `${this.service}/${code}`;\n    const template = this.errors[code];\n\n    const message = template ? replaceTemplate(template, customData) : 'Error';\n    // Service Name: Error message (service/code).\n    const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\n\n    const error = new FirebaseError(fullCode, fullMessage, customData);\n\n    return error;\n  }\n}\n\nfunction replaceTemplate(template: string, data: ErrorData): string {\n  return template.replace(PATTERN, (_, key) => {\n    const value = data[key];\n    return value != null ? String(value) : `<${key}?>`;\n  });\n}\n\nconst PATTERN = /\\{\\$([^}]+)}/g;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Evaluates a JSON string into a javascript object.\n *\n * @param {string} str A string containing JSON.\n * @return {*} The javascript object representing the specified JSON.\n */\nexport function jsonEval(str: string): unknown {\n  return JSON.parse(str);\n}\n\n/**\n * Returns JSON representing a javascript object.\n * @param {*} data Javascript object to be stringified.\n * @return {string} The JSON contents of the object.\n */\nexport function stringify(data: unknown): string {\n  return JSON.stringify(data);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { base64Decode } from './crypt';\nimport { jsonEval } from './json';\n\ninterface Claims {\n  [key: string]: {};\n}\n\ninterface DecodedToken {\n  header: object;\n  claims: Claims;\n  data: object;\n  signature: string;\n}\n\n/**\n * Decodes a Firebase auth. token into constituent parts.\n *\n * Notes:\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const decode = function (token: string): DecodedToken {\n  let header = {},\n    claims: Claims = {},\n    data = {},\n    signature = '';\n\n  try {\n    const parts = token.split('.');\n    header = jsonEval(base64Decode(parts[0]) || '') as object;\n    claims = jsonEval(base64Decode(parts[1]) || '') as Claims;\n    signature = parts[2];\n    data = claims['d'] || {};\n    delete claims['d'];\n  } catch (e) {}\n\n  return {\n    header,\n    claims,\n    data,\n    signature\n  };\n};\n\ninterface DecodedToken {\n  header: object;\n  claims: Claims;\n  data: object;\n  signature: string;\n}\n\n/**\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isValidTimestamp = function (token: string): boolean {\n  const claims: Claims = decode(token).claims;\n  const now: number = Math.floor(new Date().getTime() / 1000);\n  let validSince: number = 0,\n    validUntil: number = 0;\n\n  if (typeof claims === 'object') {\n    if (claims.hasOwnProperty('nbf')) {\n      validSince = claims['nbf'] as number;\n    } else if (claims.hasOwnProperty('iat')) {\n      validSince = claims['iat'] as number;\n    }\n\n    if (claims.hasOwnProperty('exp')) {\n      validUntil = claims['exp'] as number;\n    } else {\n      // token will expire after 24h by default\n      validUntil = validSince + 86400;\n    }\n  }\n\n  return (\n    !!now &&\n    !!validSince &&\n    !!validUntil &&\n    now >= validSince &&\n    now <= validUntil\n  );\n};\n\n/**\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\n *\n * Notes:\n * - May return null if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const issuedAtTime = function (token: string): number | null {\n  const claims: Claims = decode(token).claims;\n  if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\n    return claims['iat'] as number;\n  }\n  return null;\n};\n\n/**\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isValidFormat = function (token: string): boolean {\n  const decoded = decode(token),\n    claims = decoded.claims;\n\n  return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\n};\n\n/**\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isAdmin = function (token: string): boolean {\n  const claims: Claims = decode(token).claims;\n  return typeof claims === 'object' && claims['admin'] === true;\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function contains<T extends object>(obj: T, key: string): boolean {\n  return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport function safeGet<T extends object, K extends keyof T>(\n  obj: T,\n  key: K\n): T[K] | undefined {\n  if (Object.prototype.hasOwnProperty.call(obj, key)) {\n    return obj[key];\n  } else {\n    return undefined;\n  }\n}\n\nexport function isEmpty(obj: object): obj is {} {\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexport function map<K extends string, V, U>(\n  obj: { [key in K]: V },\n  fn: (value: V, key: K, obj: { [key in K]: V }) => U,\n  contextObj?: unknown\n): { [key in K]: U } {\n  const res: Partial<{ [key in K]: U }> = {};\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      res[key] = fn.call(contextObj, obj[key], key, obj);\n    }\n  }\n  return res as { [key in K]: U };\n}\n\n/**\n * Deep equal two objects. Support Arrays and Objects.\n */\nexport function deepEqual(a: object, b: object): boolean {\n  if (a === b) {\n    return true;\n  }\n\n  const aKeys = Object.keys(a);\n  const bKeys = Object.keys(b);\n  for (const k of aKeys) {\n    if (!bKeys.includes(k)) {\n      return false;\n    }\n\n    const aProp = (a as Record<string, unknown>)[k];\n    const bProp = (b as Record<string, unknown>)[k];\n    if (isObject(aProp) && isObject(bProp)) {\n      if (!deepEqual(aProp, bProp)) {\n        return false;\n      }\n    } else if (aProp !== bProp) {\n      return false;\n    }\n  }\n\n  for (const k of bKeys) {\n    if (!aKeys.includes(k)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction isObject(thing: unknown): thing is object {\n  return thing !== null && typeof thing === 'object';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\n * params object (e.g. {arg: 'val', arg2: 'val2'})\n * Note: You must prepend it with ? when adding it to a URL.\n */\nexport function querystring(querystringParams: {\n  [key: string]: string | number;\n}): string {\n  const params = [];\n  for (const [key, value] of Object.entries(querystringParams)) {\n    if (Array.isArray(value)) {\n      value.forEach(arrayVal => {\n        params.push(\n          encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)\n        );\n      });\n    } else {\n      params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n    }\n  }\n  return params.length ? '&' + params.join('&') : '';\n}\n\n/**\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\n * (e.g. {arg: 'val', arg2: 'val2'})\n */\nexport function querystringDecode(querystring: string): Record<string, string> {\n  const obj: Record<string, string> = {};\n  const tokens = querystring.replace(/^\\?/, '').split('&');\n\n  tokens.forEach(token => {\n    if (token) {\n      const [key, value] = token.split('=');\n      obj[decodeURIComponent(key)] = decodeURIComponent(value);\n    }\n  });\n  return obj;\n}\n\n/**\n * Extract the query string part of a URL, including the leading question mark (if present).\n */\nexport function extractQuerystring(url: string): string {\n  const queryStart = url.indexOf('?');\n  if (!queryStart) {\n    return '';\n  }\n  const fragmentStart = url.indexOf('#', queryStart);\n  return url.substring(\n    queryStart,\n    fragmentStart > 0 ? fragmentStart : undefined\n  );\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview SHA-1 cryptographic hash.\n * Variable names follow the notation in FIPS PUB 180-3:\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\n *\n * Usage:\n *   var sha1 = new sha1();\n *   sha1.update(bytes);\n *   var hash = sha1.digest();\n *\n * Performance:\n *   Chrome 23:   ~400 Mbit/s\n *   Firefox 16:  ~250 Mbit/s\n *\n */\n\n/**\n * SHA-1 cryptographic hash constructor.\n *\n * The properties declared here are discussed in the above algorithm document.\n * @constructor\n * @final\n * @struct\n */\nexport class Sha1 {\n  /**\n   * Holds the previous values of accumulated variables a-e in the compress_\n   * function.\n   * @private\n   */\n  private chain_: number[] = [];\n\n  /**\n   * A buffer holding the partially computed hash result.\n   * @private\n   */\n  private buf_: number[] = [];\n\n  /**\n   * An array of 80 bytes, each a part of the message to be hashed.  Referred to\n   * as the message schedule in the docs.\n   * @private\n   */\n  private W_: number[] = [];\n\n  /**\n   * Contains data needed to pad messages less than 64 bytes.\n   * @private\n   */\n  private pad_: number[] = [];\n\n  /**\n   * @private {number}\n   */\n  private inbuf_: number = 0;\n\n  /**\n   * @private {number}\n   */\n  private total_: number = 0;\n\n  blockSize: number;\n\n  constructor() {\n    this.blockSize = 512 / 8;\n\n    this.pad_[0] = 128;\n    for (let i = 1; i < this.blockSize; ++i) {\n      this.pad_[i] = 0;\n    }\n\n    this.reset();\n  }\n\n  reset(): void {\n    this.chain_[0] = 0x67452301;\n    this.chain_[1] = 0xefcdab89;\n    this.chain_[2] = 0x98badcfe;\n    this.chain_[3] = 0x10325476;\n    this.chain_[4] = 0xc3d2e1f0;\n\n    this.inbuf_ = 0;\n    this.total_ = 0;\n  }\n\n  /**\n   * Internal compress helper function.\n   * @param buf Block to compress.\n   * @param offset Offset of the block in the buffer.\n   * @private\n   */\n  compress_(buf: number[] | Uint8Array | string, offset?: number): void {\n    if (!offset) {\n      offset = 0;\n    }\n\n    const W = this.W_;\n\n    // get 16 big endian words\n    if (typeof buf === 'string') {\n      for (let i = 0; i < 16; i++) {\n        // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\n        // have a bug that turns the post-increment ++ operator into pre-increment\n        // during JIT compilation.  We have code that depends heavily on SHA-1 for\n        // correctness and which is affected by this bug, so I've removed all uses\n        // of post-increment ++ in which the result value is used.  We can revert\n        // this change once the Safari bug\n        // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\n        // most clients have been updated.\n        W[i] =\n          (buf.charCodeAt(offset) << 24) |\n          (buf.charCodeAt(offset + 1) << 16) |\n          (buf.charCodeAt(offset + 2) << 8) |\n          buf.charCodeAt(offset + 3);\n        offset += 4;\n      }\n    } else {\n      for (let i = 0; i < 16; i++) {\n        W[i] =\n          (buf[offset] << 24) |\n          (buf[offset + 1] << 16) |\n          (buf[offset + 2] << 8) |\n          buf[offset + 3];\n        offset += 4;\n      }\n    }\n\n    // expand to 80 words\n    for (let i = 16; i < 80; i++) {\n      const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n      W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\n    }\n\n    let a = this.chain_[0];\n    let b = this.chain_[1];\n    let c = this.chain_[2];\n    let d = this.chain_[3];\n    let e = this.chain_[4];\n    let f, k;\n\n    // TODO(user): Try to unroll this loop to speed up the computation.\n    for (let i = 0; i < 80; i++) {\n      if (i < 40) {\n        if (i < 20) {\n          f = d ^ (b & (c ^ d));\n          k = 0x5a827999;\n        } else {\n          f = b ^ c ^ d;\n          k = 0x6ed9eba1;\n        }\n      } else {\n        if (i < 60) {\n          f = (b & c) | (d & (b | c));\n          k = 0x8f1bbcdc;\n        } else {\n          f = b ^ c ^ d;\n          k = 0xca62c1d6;\n        }\n      }\n\n      const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\n      e = d;\n      d = c;\n      c = ((b << 30) | (b >>> 2)) & 0xffffffff;\n      b = a;\n      a = t;\n    }\n\n    this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\n    this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\n    this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\n    this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\n    this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\n  }\n\n  update(bytes?: number[] | Uint8Array | string, length?: number): void {\n    // TODO(johnlenz): tighten the function signature and remove this check\n    if (bytes == null) {\n      return;\n    }\n\n    if (length === undefined) {\n      length = bytes.length;\n    }\n\n    const lengthMinusBlock = length - this.blockSize;\n    let n = 0;\n    // Using local instead of member variables gives ~5% speedup on Firefox 16.\n    const buf = this.buf_;\n    let inbuf = this.inbuf_;\n\n    // The outer while loop should execute at most twice.\n    while (n < length) {\n      // When we have no data in the block to top up, we can directly process the\n      // input buffer (assuming it contains sufficient data). This gives ~25%\n      // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\n      // the data is provided in large chunks (or in multiples of 64 bytes).\n      if (inbuf === 0) {\n        while (n <= lengthMinusBlock) {\n          this.compress_(bytes, n);\n          n += this.blockSize;\n        }\n      }\n\n      if (typeof bytes === 'string') {\n        while (n < length) {\n          buf[inbuf] = bytes.charCodeAt(n);\n          ++inbuf;\n          ++n;\n          if (inbuf === this.blockSize) {\n            this.compress_(buf);\n            inbuf = 0;\n            // Jump to the outer loop so we use the full-block optimization.\n            break;\n          }\n        }\n      } else {\n        while (n < length) {\n          buf[inbuf] = bytes[n];\n          ++inbuf;\n          ++n;\n          if (inbuf === this.blockSize) {\n            this.compress_(buf);\n            inbuf = 0;\n            // Jump to the outer loop so we use the full-block optimization.\n            break;\n          }\n        }\n      }\n    }\n\n    this.inbuf_ = inbuf;\n    this.total_ += length;\n  }\n\n  /** @override */\n  digest(): number[] {\n    const digest: number[] = [];\n    let totalBits = this.total_ * 8;\n\n    // Add pad 0x80 0x00*.\n    if (this.inbuf_ < 56) {\n      this.update(this.pad_, 56 - this.inbuf_);\n    } else {\n      this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\n    }\n\n    // Add # bits.\n    for (let i = this.blockSize - 1; i >= 56; i--) {\n      this.buf_[i] = totalBits & 255;\n      totalBits /= 256; // Don't use bit-shifting here!\n    }\n\n    this.compress_(this.buf_);\n\n    let n = 0;\n    for (let i = 0; i < 5; i++) {\n      for (let j = 24; j >= 0; j -= 8) {\n        digest[n] = (this.chain_[i] >> j) & 255;\n        ++n;\n      }\n    }\n    return digest;\n  }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport type NextFn<T> = (value: T) => void;\nexport type ErrorFn = (error: Error) => void;\nexport type CompleteFn = () => void;\n\nexport interface Observer<T> {\n  // Called once for each value in a stream of values.\n  next: NextFn<T>;\n\n  // A stream terminates by a single call to EITHER error() or complete().\n  error: ErrorFn;\n\n  // No events will be sent to next() once complete() is called.\n  complete: CompleteFn;\n}\n\nexport type PartialObserver<T> = Partial<Observer<T>>;\n\n// TODO: Support also Unsubscribe.unsubscribe?\nexport type Unsubscribe = () => void;\n\n/**\n * The Subscribe interface has two forms - passing the inline function\n * callbacks, or a object interface with callback properties.\n */\nexport interface Subscribe<T> {\n  (next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;\n  (observer: PartialObserver<T>): Unsubscribe;\n}\n\nexport interface Observable<T> {\n  // Subscribe method\n  subscribe: Subscribe<T>;\n}\n\nexport type Executor<T> = (observer: Observer<T>) => void;\n\n/**\n * Helper to make a Subscribe function (just like Promise helps make a\n * Thenable).\n *\n * @param executor Function which can make calls to a single Observer\n *     as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\nexport function createSubscribe<T>(\n  executor: Executor<T>,\n  onNoObservers?: Executor<T>\n): Subscribe<T> {\n  const proxy = new ObserverProxy<T>(executor, onNoObservers);\n  return proxy.subscribe.bind(proxy);\n}\n\n/**\n * Implement fan-out for any number of Observers attached via a subscribe\n * function.\n */\nclass ObserverProxy<T> implements Observer<T> {\n  private observers: Array<Observer<T>> | undefined = [];\n  private unsubscribes: Unsubscribe[] = [];\n  private onNoObservers: Executor<T> | undefined;\n  private observerCount = 0;\n  // Micro-task scheduling by calling task.then().\n  private task = Promise.resolve();\n  private finalized = false;\n  private finalError?: Error;\n\n  /**\n   * @param executor Function which can make calls to a single Observer\n   *     as a proxy.\n   * @param onNoObservers Callback when count of Observers goes to zero.\n   */\n  constructor(executor: Executor<T>, onNoObservers?: Executor<T>) {\n    this.onNoObservers = onNoObservers;\n    // Call the executor asynchronously so subscribers that are called\n    // synchronously after the creation of the subscribe function\n    // can still receive the very first value generated in the executor.\n    this.task\n      .then(() => {\n        executor(this);\n      })\n      .catch(e => {\n        this.error(e);\n      });\n  }\n\n  next(value: T): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.next(value);\n    });\n  }\n\n  error(error: Error): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.error(error);\n    });\n    this.close(error);\n  }\n\n  complete(): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.complete();\n    });\n    this.close();\n  }\n\n  /**\n   * Subscribe function that can be used to add an Observer to the fan-out list.\n   *\n   * - We require that no event is sent to a subscriber sychronously to their\n   *   call to subscribe().\n   */\n  subscribe(\n    nextOrObserver?: NextFn<T> | PartialObserver<T>,\n    error?: ErrorFn,\n    complete?: CompleteFn\n  ): Unsubscribe {\n    let observer: Observer<T>;\n\n    if (\n      nextOrObserver === undefined &&\n      error === undefined &&\n      complete === undefined\n    ) {\n      throw new Error('Missing Observer.');\n    }\n\n    // Assemble an Observer object when passed as callback functions.\n    if (\n      implementsAnyMethods(nextOrObserver as { [key: string]: unknown }, [\n        'next',\n        'error',\n        'complete'\n      ])\n    ) {\n      observer = nextOrObserver as Observer<T>;\n    } else {\n      observer = {\n        next: nextOrObserver as NextFn<T>,\n        error,\n        complete\n      } as Observer<T>;\n    }\n\n    if (observer.next === undefined) {\n      observer.next = noop as NextFn<T>;\n    }\n    if (observer.error === undefined) {\n      observer.error = noop as ErrorFn;\n    }\n    if (observer.complete === undefined) {\n      observer.complete = noop as CompleteFn;\n    }\n\n    const unsub = this.unsubscribeOne.bind(this, this.observers!.length);\n\n    // Attempt to subscribe to a terminated Observable - we\n    // just respond to the Observer with the final error or complete\n    // event.\n    if (this.finalized) {\n      // eslint-disable-next-line @typescript-eslint/no-floating-promises\n      this.task.then(() => {\n        try {\n          if (this.finalError) {\n            observer.error(this.finalError);\n          } else {\n            observer.complete();\n          }\n        } catch (e) {\n          // nothing\n        }\n        return;\n      });\n    }\n\n    this.observers!.push(observer as Observer<T>);\n\n    return unsub;\n  }\n\n  // Unsubscribe is synchronous - we guarantee that no events are sent to\n  // any unsubscribed Observer.\n  private unsubscribeOne(i: number): void {\n    if (this.observers === undefined || this.observers[i] === undefined) {\n      return;\n    }\n\n    delete this.observers[i];\n\n    this.observerCount -= 1;\n    if (this.observerCount === 0 && this.onNoObservers !== undefined) {\n      this.onNoObservers(this);\n    }\n  }\n\n  private forEachObserver(fn: (observer: Observer<T>) => void): void {\n    if (this.finalized) {\n      // Already closed by previous event....just eat the additional values.\n      return;\n    }\n\n    // Since sendOne calls asynchronously - there is no chance that\n    // this.observers will become undefined.\n    for (let i = 0; i < this.observers!.length; i++) {\n      this.sendOne(i, fn);\n    }\n  }\n\n  // Call the Observer via one of it's callback function. We are careful to\n  // confirm that the observe has not been unsubscribed since this asynchronous\n  // function had been queued.\n  private sendOne(i: number, fn: (observer: Observer<T>) => void): void {\n    // Execute the callback asynchronously\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.task.then(() => {\n      if (this.observers !== undefined && this.observers[i] !== undefined) {\n        try {\n          fn(this.observers[i]);\n        } catch (e) {\n          // Ignore exceptions raised in Observers or missing methods of an\n          // Observer.\n          // Log error to console. b/31404806\n          if (typeof console !== 'undefined' && console.error) {\n            console.error(e);\n          }\n        }\n      }\n    });\n  }\n\n  private close(err?: Error): void {\n    if (this.finalized) {\n      return;\n    }\n    this.finalized = true;\n    if (err !== undefined) {\n      this.finalError = err;\n    }\n    // Proxy is no longer needed - garbage collect references\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.task.then(() => {\n      this.observers = undefined;\n      this.onNoObservers = undefined;\n    });\n  }\n}\n\n/** Turn synchronous function into one called asynchronously. */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function async(fn: Function, onError?: ErrorFn): Function {\n  return (...args: unknown[]) => {\n    Promise.resolve(true)\n      .then(() => {\n        fn(...args);\n      })\n      .catch((error: Error) => {\n        if (onError) {\n          onError(error);\n        }\n      });\n  };\n}\n\n/**\n * Return true if the object passed in implements any of the named methods.\n */\nfunction implementsAnyMethods(\n  obj: { [key: string]: unknown },\n  methods: string[]\n): boolean {\n  if (typeof obj !== 'object' || obj === null) {\n    return false;\n  }\n\n  for (const method of methods) {\n    if (method in obj && typeof obj[method] === 'function') {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction noop(): void {\n  // do nothing\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Check to make sure the appropriate number of arguments are provided for a public function.\n * Throws an error if it fails.\n *\n * @param fnName The function name\n * @param minCount The minimum number of arguments to allow for the function call\n * @param maxCount The maximum number of argument to allow for the function call\n * @param argCount The actual number of arguments provided.\n */\nexport const validateArgCount = function (\n  fnName: string,\n  minCount: number,\n  maxCount: number,\n  argCount: number\n): void {\n  let argError;\n  if (argCount < minCount) {\n    argError = 'at least ' + minCount;\n  } else if (argCount > maxCount) {\n    argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\n  }\n  if (argError) {\n    const error =\n      fnName +\n      ' failed: Was called with ' +\n      argCount +\n      (argCount === 1 ? ' argument.' : ' arguments.') +\n      ' Expects ' +\n      argError +\n      '.';\n    throw new Error(error);\n  }\n};\n\n/**\n * Generates a string to prefix an error message about failed argument validation\n *\n * @param fnName The function name\n * @param argName The name of the argument\n * @return The prefix to add to the error thrown for validation.\n */\nexport function errorPrefix(fnName: string, argName: string): string {\n  return `${fnName} failed: ${argName} argument `;\n}\n\n/**\n * @param fnName\n * @param argumentNumber\n * @param namespace\n * @param optional\n */\nexport function validateNamespace(\n  fnName: string,\n  namespace: string,\n  optional: boolean\n): void {\n  if (optional && !namespace) {\n    return;\n  }\n  if (typeof namespace !== 'string') {\n    //TODO: I should do more validation here. We only allow certain chars in namespaces.\n    throw new Error(\n      errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'\n    );\n  }\n}\n\nexport function validateCallback(\n  fnName: string,\n  argumentName: string,\n  // eslint-disable-next-line @typescript-eslint/ban-types\n  callback: Function,\n  optional: boolean\n): void {\n  if (optional && !callback) {\n    return;\n  }\n  if (typeof callback !== 'function') {\n    throw new Error(\n      errorPrefix(fnName, argumentName) + 'must be a valid function.'\n    );\n  }\n}\n\nexport function validateContextObject(\n  fnName: string,\n  argumentName: string,\n  context: unknown,\n  optional: boolean\n): void {\n  if (optional && !context) {\n    return;\n  }\n  if (typeof context !== 'object' || context === null) {\n    throw new Error(\n      errorPrefix(fnName, argumentName) + 'must be a valid context object.'\n    );\n  }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert } from './assert';\n\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\n// so it's been modified.\n\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\n// pair).\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\n\n/**\n * @param {string} str\n * @return {Array}\n */\nexport const stringToByteArray = function (str: string): number[] {\n  const out: number[] = [];\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    let c = str.charCodeAt(i);\n\n    // Is this the lead surrogate in a surrogate pair?\n    if (c >= 0xd800 && c <= 0xdbff) {\n      const high = c - 0xd800; // the high 10 bits.\n      i++;\n      assert(i < str.length, 'Surrogate pair missing trail surrogate.');\n      const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\n      c = 0x10000 + (high << 10) + low;\n    }\n\n    if (c < 128) {\n      out[p++] = c;\n    } else if (c < 2048) {\n      out[p++] = (c >> 6) | 192;\n      out[p++] = (c & 63) | 128;\n    } else if (c < 65536) {\n      out[p++] = (c >> 12) | 224;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    } else {\n      out[p++] = (c >> 18) | 240;\n      out[p++] = ((c >> 12) & 63) | 128;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    }\n  }\n  return out;\n};\n\n/**\n * Calculate length without actually converting; useful for doing cheaper validation.\n * @param {string} str\n * @return {number}\n */\nexport const stringLength = function (str: string): number {\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    const c = str.charCodeAt(i);\n    if (c < 128) {\n      p++;\n    } else if (c < 2048) {\n      p += 2;\n    } else if (c >= 0xd800 && c <= 0xdbff) {\n      // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\n      p += 4;\n      i++; // skip trail surrogate.\n    } else {\n      p += 3;\n    }\n  }\n  return p;\n};\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The amount of milliseconds to exponentially increase.\n */\nconst DEFAULT_INTERVAL_MILLIS = 1000;\n\n/**\n * The factor to backoff by.\n * Should be a number greater than 1.\n */\nconst DEFAULT_BACKOFF_FACTOR = 2;\n\n/**\n * The maximum milliseconds to increase to.\n *\n * <p>Visible for testing\n */\nexport const MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\n\n/**\n * The percentage of backoff time to randomize by.\n * See\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\n * for context.\n *\n * <p>Visible for testing\n */\nexport const RANDOM_FACTOR = 0.5;\n\n/**\n * Based on the backoff method from\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\n */\nexport function calculateBackoffMillis(\n  backoffCount: number,\n  intervalMillis: number = DEFAULT_INTERVAL_MILLIS,\n  backoffFactor: number = DEFAULT_BACKOFF_FACTOR\n): number {\n  // Calculates an exponentially increasing value.\n  // Deviation: calculates value from count and a constant interval, so we only need to save value\n  // and count to restore state.\n  const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\n\n  // A random \"fuzz\" to avoid waves of retries.\n  // Deviation: randomFactor is required.\n  const randomWait = Math.round(\n    // A fraction of the backoff value to add/subtract.\n    // Deviation: changes multiplication order to improve readability.\n    RANDOM_FACTOR *\n      currBaseValue *\n      // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\n      // if we add or subtract.\n      (Math.random() - 0.5) *\n      2\n  );\n\n  // Limits backoff to max to avoid effectively permanent backoff.\n  return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Provide English ordinal letters after a number\n */\nexport function ordinal(i: number): string {\n  if (!Number.isFinite(i)) {\n    return `${i}`;\n  }\n  return i + indicator(i);\n}\n\nfunction indicator(i: number): string {\n  i = Math.abs(i);\n  const cent = i % 100;\n  if (cent >= 10 && cent <= 20) {\n    return 'th';\n  }\n  const dec = i % 10;\n  if (dec === 1) {\n    return 'st';\n  }\n  if (dec === 2) {\n    return 'nd';\n  }\n  if (dec === 3) {\n    return 'rd';\n  }\n  return 'th';\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Compat<T> {\n  _delegate: T;\n}\n\nexport function getModularInstance<ExpService>(\n  service: Compat<ExpService> | ExpService\n): ExpService {\n  if (service && (service as Compat<ExpService>)._delegate) {\n    return (service as Compat<ExpService>)._delegate;\n  } else {\n    return service as ExpService;\n  }\n}\n", "/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nfunction promisifyRequest(\n  request: IDBRequest,\n  errorMessage: string\n): Promise<unknown> {\n  return new Promise((resolve, reject) => {\n    request.onsuccess = event => {\n      resolve((event.target as IDBRequest).result);\n    };\n    request.onerror = event => {\n      reject(`${errorMessage}: ${(event.target as IDBRequest).error?.message}`);\n    };\n  });\n}\n\nexport class DBWrapper {\n  objectStoreNames: DOMStringList;\n  constructor(private _db: IDBDatabase) {\n    this.objectStoreNames = this._db.objectStoreNames;\n  }\n  transaction(\n    storeNames: string[] | string,\n    mode?: IDBTransactionMode\n  ): TransactionWrapper {\n    return new TransactionWrapper(\n      this._db.transaction.call(this._db, storeNames, mode)\n    );\n  }\n  createObjectStore(\n    storeName: string,\n    options?: IDBObjectStoreParameters\n  ): ObjectStoreWrapper {\n    return new ObjectStoreWrapper(\n      this._db.createObjectStore(storeName, options)\n    );\n  }\n  close(): void {\n    this._db.close();\n  }\n}\n\nclass TransactionWrapper {\n  complete: Promise<void>;\n  constructor(private _transaction: IDBTransaction) {\n    this.complete = new Promise((resolve, reject) => {\n      this._transaction.oncomplete = function () {\n        resolve();\n      };\n      this._transaction.onerror = () => {\n        reject(this._transaction.error);\n      };\n      this._transaction.onabort = () => {\n        reject(this._transaction.error);\n      };\n    });\n  }\n  objectStore(storeName: string): ObjectStoreWrapper {\n    return new ObjectStoreWrapper(this._transaction.objectStore(storeName));\n  }\n}\n\nclass ObjectStoreWrapper {\n  constructor(private _store: IDBObjectStore) {}\n  index(name: string): IndexWrapper {\n    return new IndexWrapper(this._store.index(name));\n  }\n  createIndex(\n    name: string,\n    keypath: string,\n    options: IDBIndexParameters\n  ): IndexWrapper {\n    return new IndexWrapper(this._store.createIndex(name, keypath, options));\n  }\n  get(key: string): Promise<unknown> {\n    const request = this._store.get(key);\n    return promisifyRequest(request, 'Error reading from IndexedDB');\n  }\n  put(value: unknown, key?: string): Promise<unknown> {\n    const request = this._store.put(value, key);\n    return promisifyRequest(request, 'Error writing to IndexedDB');\n  }\n  delete(key: string): Promise<unknown> {\n    const request = this._store.delete(key);\n    return promisifyRequest(request, 'Error deleting from IndexedDB');\n  }\n  clear(): Promise<unknown> {\n    const request = this._store.clear();\n    return promisifyRequest(request, 'Error clearing IndexedDB object store');\n  }\n}\n\nclass IndexWrapper {\n  constructor(private _index: IDBIndex) {}\n  get(key: string): Promise<unknown> {\n    const request = this._index.get(key);\n    return promisifyRequest(request, 'Error reading from IndexedDB');\n  }\n}\n\nexport function openDB(\n  dbName: string,\n  dbVersion: number,\n  upgradeCallback: (\n    db: DBWrapper,\n    oldVersion: number,\n    newVersion: number | null,\n    transaction: TransactionWrapper\n  ) => void\n): Promise<DBWrapper> {\n  return new Promise((resolve, reject) => {\n    try {\n      const request = indexedDB.open(dbName, dbVersion);\n\n      request.onsuccess = event => {\n        resolve(new DBWrapper((event.target as IDBOpenDBRequest).result));\n      };\n\n      request.onerror = event => {\n        reject(\n          `Error opening indexedDB: ${\n            (event.target as IDBRequest).error?.message\n          }`\n        );\n      };\n\n      request.onupgradeneeded = event => {\n        upgradeCallback(\n          new DBWrapper(request.result),\n          event.oldVersion,\n          event.newVersion,\n          new TransactionWrapper(request.transaction!)\n        );\n      };\n    } catch (e) {\n      reject(`Error opening indexedDB: ${e.message}`);\n    }\n  });\n}\n\nexport async function deleteDB(dbName: string): Promise<void> {\n  return new Promise((resolve, reject) => {\n    try {\n      const request = indexedDB.deleteDatabase(dbName);\n      request.onsuccess = () => {\n        resolve();\n      };\n      request.onerror = event => {\n        reject(\n          `Error deleting indexedDB database \"${dbName}\": ${\n            (event.target as IDBRequest).error?.message\n          }`\n        );\n      };\n    } catch (e) {\n      reject(`Error deleting indexedDB database \"${dbName}\": ${e.message}`);\n    }\n  });\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n  InstantiationMode,\n  InstanceFactory,\n  ComponentType,\n  Dictionary,\n  Name,\n  onInstanceCreatedCallback\n} from './types';\n\n/**\n * Component for service name T, e.g. `auth`, `auth-internal`\n */\nexport class Component<T extends Name = Name> {\n  multipleInstances = false;\n  /**\n   * Properties to be added to the service namespace\n   */\n  serviceProps: Dictionary = {};\n\n  instantiationMode = InstantiationMode.LAZY;\n\n  onInstanceCreated: onInstanceCreatedCallback<T> | null = null;\n\n  /**\n   *\n   * @param name The public service name, e.g. app, auth, firestore, database\n   * @param instanceFactory Service factory responsible for creating the public interface\n   * @param type whether the service provided by the component is public or private\n   */\n  constructor(\n    readonly name: T,\n    readonly instanceFactory: InstanceFactory<T>,\n    readonly type: ComponentType\n  ) {}\n\n  setInstantiationMode(mode: InstantiationMode): this {\n    this.instantiationMode = mode;\n    return this;\n  }\n\n  setMultipleInstances(multipleInstances: boolean): this {\n    this.multipleInstances = multipleInstances;\n    return this;\n  }\n\n  setServiceProps(props: Dictionary): this {\n    this.serviceProps = props;\n    return this;\n  }\n\n  setInstanceCreatedCallback(callback: onInstanceCreatedCallback<T>): this {\n    this.onInstanceCreated = callback;\n    return this;\n  }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Deferred } from '@firebase/util';\nimport { ComponentContainer } from './component_container';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport {\n  InitializeOptions,\n  InstantiationMode,\n  Name,\n  NameServiceMapping,\n  OnInitCallBack\n} from './types';\nimport { Component } from './component';\n\n/**\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\n * NameServiceMapping[T] is an alias for the type of the instance\n */\nexport class Provider<T extends Name> {\n  private component: Component<T> | null = null;\n  private readonly instances: Map<string, NameServiceMapping[T]> = new Map();\n  private readonly instancesDeferred: Map<\n    string,\n    Deferred<NameServiceMapping[T]>\n  > = new Map();\n  private readonly instancesOptions: Map<string, Record<string, unknown>> =\n    new Map();\n  private onInitCallbacks: Map<string, Set<OnInitCallBack<T>>> = new Map();\n\n  constructor(\n    private readonly name: T,\n    private readonly container: ComponentContainer\n  ) {}\n\n  /**\n   * @param identifier A provider can provide mulitple instances of a service\n   * if this.component.multipleInstances is true.\n   */\n  get(identifier?: string): Promise<NameServiceMapping[T]> {\n    // if multipleInstances is not supported, use the default name\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n\n    if (!this.instancesDeferred.has(normalizedIdentifier)) {\n      const deferred = new Deferred<NameServiceMapping[T]>();\n      this.instancesDeferred.set(normalizedIdentifier, deferred);\n\n      if (\n        this.isInitialized(normalizedIdentifier) ||\n        this.shouldAutoInitialize()\n      ) {\n        // initialize the service if it can be auto-initialized\n        try {\n          const instance = this.getOrInitializeService({\n            instanceIdentifier: normalizedIdentifier\n          });\n          if (instance) {\n            deferred.resolve(instance);\n          }\n        } catch (e) {\n          // when the instance factory throws an exception during get(), it should not cause\n          // a fatal error. We just return the unresolved promise in this case.\n        }\n      }\n    }\n\n    return this.instancesDeferred.get(normalizedIdentifier)!.promise;\n  }\n\n  /**\n   *\n   * @param options.identifier A provider can provide mulitple instances of a service\n   * if this.component.multipleInstances is true.\n   * @param options.optional If optional is false or not provided, the method throws an error when\n   * the service is not immediately available.\n   * If optional is true, the method returns null if the service is not immediately available.\n   */\n  getImmediate(options: {\n    identifier?: string;\n    optional: true;\n  }): NameServiceMapping[T] | null;\n  getImmediate(options?: {\n    identifier?: string;\n    optional?: false;\n  }): NameServiceMapping[T];\n  getImmediate(options?: {\n    identifier?: string;\n    optional?: boolean;\n  }): NameServiceMapping[T] | null {\n    // if multipleInstances is not supported, use the default name\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(\n      options?.identifier\n    );\n    const optional = options?.optional ?? false;\n\n    if (\n      this.isInitialized(normalizedIdentifier) ||\n      this.shouldAutoInitialize()\n    ) {\n      try {\n        return this.getOrInitializeService({\n          instanceIdentifier: normalizedIdentifier\n        });\n      } catch (e) {\n        if (optional) {\n          return null;\n        } else {\n          throw e;\n        }\n      }\n    } else {\n      // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\n      if (optional) {\n        return null;\n      } else {\n        throw Error(`Service ${this.name} is not available`);\n      }\n    }\n  }\n\n  getComponent(): Component<T> | null {\n    return this.component;\n  }\n\n  setComponent(component: Component<T>): void {\n    if (component.name !== this.name) {\n      throw Error(\n        `Mismatching Component ${component.name} for Provider ${this.name}.`\n      );\n    }\n\n    if (this.component) {\n      throw Error(`Component for ${this.name} has already been provided`);\n    }\n\n    this.component = component;\n\n    // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\n    if (!this.shouldAutoInitialize()) {\n      return;\n    }\n\n    // if the service is eager, initialize the default instance\n    if (isComponentEager(component)) {\n      try {\n        this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\n      } catch (e) {\n        // when the instance factory for an eager Component throws an exception during the eager\n        // initialization, it should not cause a fatal error.\n        // TODO: Investigate if we need to make it configurable, because some component may want to cause\n        // a fatal error in this case?\n      }\n    }\n\n    // Create service instances for the pending promises and resolve them\n    // NOTE: if this.multipleInstances is false, only the default instance will be created\n    // and all promises with resolve with it regardless of the identifier.\n    for (const [\n      instanceIdentifier,\n      instanceDeferred\n    ] of this.instancesDeferred.entries()) {\n      const normalizedIdentifier =\n        this.normalizeInstanceIdentifier(instanceIdentifier);\n\n      try {\n        // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\n        const instance = this.getOrInitializeService({\n          instanceIdentifier: normalizedIdentifier\n        })!;\n        instanceDeferred.resolve(instance);\n      } catch (e) {\n        // when the instance factory throws an exception, it should not cause\n        // a fatal error. We just leave the promise unresolved.\n      }\n    }\n  }\n\n  clearInstance(identifier: string = DEFAULT_ENTRY_NAME): void {\n    this.instancesDeferred.delete(identifier);\n    this.instancesOptions.delete(identifier);\n    this.instances.delete(identifier);\n  }\n\n  // app.delete() will call this method on every provider to delete the services\n  // TODO: should we mark the provider as deleted?\n  async delete(): Promise<void> {\n    const services = Array.from(this.instances.values());\n\n    await Promise.all([\n      ...services\n        .filter(service => 'INTERNAL' in service) // legacy services\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        .map(service => (service as any).INTERNAL!.delete()),\n      ...services\n        .filter(service => '_delete' in service) // modularized services\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        .map(service => (service as any)._delete())\n    ]);\n  }\n\n  isComponentSet(): boolean {\n    return this.component != null;\n  }\n\n  isInitialized(identifier: string = DEFAULT_ENTRY_NAME): boolean {\n    return this.instances.has(identifier);\n  }\n\n  getOptions(identifier: string = DEFAULT_ENTRY_NAME): Record<string, unknown> {\n    return this.instancesOptions.get(identifier) || {};\n  }\n\n  initialize(opts: InitializeOptions = {}): NameServiceMapping[T] {\n    const { options = {} } = opts;\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(\n      opts.instanceIdentifier\n    );\n    if (this.isInitialized(normalizedIdentifier)) {\n      throw Error(\n        `${this.name}(${normalizedIdentifier}) has already been initialized`\n      );\n    }\n\n    if (!this.isComponentSet()) {\n      throw Error(`Component ${this.name} has not been registered yet`);\n    }\n\n    const instance = this.getOrInitializeService({\n      instanceIdentifier: normalizedIdentifier,\n      options\n    })!;\n\n    // resolve any pending promise waiting for the service instance\n    for (const [\n      instanceIdentifier,\n      instanceDeferred\n    ] of this.instancesDeferred.entries()) {\n      const normalizedDeferredIdentifier =\n        this.normalizeInstanceIdentifier(instanceIdentifier);\n      if (normalizedIdentifier === normalizedDeferredIdentifier) {\n        instanceDeferred.resolve(instance);\n      }\n    }\n\n    return instance;\n  }\n\n  /**\n   *\n   * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\n   * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\n   *\n   * @param identifier An optional instance identifier\n   * @returns a function to unregister the callback\n   */\n  onInit(callback: OnInitCallBack<T>, identifier?: string): () => void {\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n    const existingCallbacks =\n      this.onInitCallbacks.get(normalizedIdentifier) ??\n      new Set<OnInitCallBack<T>>();\n    existingCallbacks.add(callback);\n    this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\n\n    const existingInstance = this.instances.get(normalizedIdentifier);\n    if (existingInstance) {\n      callback(existingInstance, normalizedIdentifier);\n    }\n\n    return () => {\n      existingCallbacks.delete(callback);\n    };\n  }\n\n  /**\n   * Invoke onInit callbacks synchronously\n   * @param instance the service instance`\n   */\n  private invokeOnInitCallbacks(\n    instance: NameServiceMapping[T],\n    identifier: string\n  ): void {\n    const callbacks = this.onInitCallbacks.get(identifier);\n    if (!callbacks) {\n      return;\n    }\n    for (const callback of callbacks) {\n      try {\n        callback(instance, identifier);\n      } catch {\n        // ignore errors in the onInit callback\n      }\n    }\n  }\n\n  private getOrInitializeService({\n    instanceIdentifier,\n    options = {}\n  }: {\n    instanceIdentifier: string;\n    options?: Record<string, unknown>;\n  }): NameServiceMapping[T] | null {\n    let instance = this.instances.get(instanceIdentifier);\n    if (!instance && this.component) {\n      instance = this.component.instanceFactory(this.container, {\n        instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\n        options\n      });\n      this.instances.set(instanceIdentifier, instance);\n      this.instancesOptions.set(instanceIdentifier, options);\n\n      /**\n       * Invoke onInit listeners.\n       * Note this.component.onInstanceCreated is different, which is used by the component creator,\n       * while onInit listeners are registered by consumers of the provider.\n       */\n      this.invokeOnInitCallbacks(instance, instanceIdentifier);\n\n      /**\n       * Order is important\n       * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\n       * makes `isInitialized()` return true.\n       */\n      if (this.component.onInstanceCreated) {\n        try {\n          this.component.onInstanceCreated(\n            this.container,\n            instanceIdentifier,\n            instance\n          );\n        } catch {\n          // ignore errors in the onInstanceCreatedCallback\n        }\n      }\n    }\n\n    return instance || null;\n  }\n\n  private normalizeInstanceIdentifier(\n    identifier: string = DEFAULT_ENTRY_NAME\n  ): string {\n    if (this.component) {\n      return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\n    } else {\n      return identifier; // assume multiple instances are supported before the component is provided.\n    }\n  }\n\n  private shouldAutoInitialize(): boolean {\n    return (\n      !!this.component &&\n      this.component.instantiationMode !== InstantiationMode.EXPLICIT\n    );\n  }\n}\n\n// undefined should be passed to the service factory for the default instance\nfunction normalizeIdentifierForFactory(identifier: string): string | undefined {\n  return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\n}\n\nfunction isComponentEager<T extends Name>(component: Component<T>): boolean {\n  return component.instantiationMode === InstantiationMode.EAGER;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Provider } from './provider';\nimport { Component } from './component';\nimport { Name } from './types';\n\n/**\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\n */\nexport class ComponentContainer {\n  private readonly providers = new Map<string, Provider<Name>>();\n\n  constructor(private readonly name: string) {}\n\n  /**\n   *\n   * @param component Component being added\n   * @param overwrite When a component with the same name has already been registered,\n   * if overwrite is true: overwrite the existing component with the new component and create a new\n   * provider with the new component. It can be useful in tests where you want to use different mocks\n   * for different tests.\n   * if overwrite is false: throw an exception\n   */\n  addComponent<T extends Name>(component: Component<T>): void {\n    const provider = this.getProvider(component.name);\n    if (provider.isComponentSet()) {\n      throw new Error(\n        `Component ${component.name} has already been registered with ${this.name}`\n      );\n    }\n\n    provider.setComponent(component);\n  }\n\n  addOrOverwriteComponent<T extends Name>(component: Component<T>): void {\n    const provider = this.getProvider(component.name);\n    if (provider.isComponentSet()) {\n      // delete the existing provider from the container, so we can register the new component\n      this.providers.delete(component.name);\n    }\n\n    this.addComponent(component);\n  }\n\n  /**\n   * getProvider provides a type safe interface where it can only be called with a field name\n   * present in NameServiceMapping interface.\n   *\n   * Firebase SDKs providing services should extend NameServiceMapping interface to register\n   * themselves.\n   */\n  getProvider<T extends Name>(name: T): Provider<T> {\n    if (this.providers.has(name)) {\n      return this.providers.get(name) as unknown as Provider<T>;\n    }\n\n    // create a Provider for a service that hasn't registered with Firebase\n    const provider = new Provider<T>(name, this);\n    this.providers.set(name, provider as unknown as Provider<Name>);\n\n    return provider as Provider<T>;\n  }\n\n  getProviders(): Array<Provider<Name>> {\n    return Array.from(this.providers.values());\n  }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type LogLevelString =\n  | 'debug'\n  | 'verbose'\n  | 'info'\n  | 'warn'\n  | 'error'\n  | 'silent';\n\nexport interface LogOptions {\n  level: LogLevelString;\n}\n\nexport type LogCallback = (callbackParams: LogCallbackParams) => void;\n\nexport interface LogCallbackParams {\n  level: LogLevelString;\n  message: string;\n  args: unknown[];\n  type: string;\n}\n\n/**\n * A container for all of the Logger instances\n */\nexport const instances: Logger[] = [];\n\n/**\n * The JS SDK supports 5 log levels and also allows a user the ability to\n * silence the logs altogether.\n *\n * The order is a follows:\n * DEBUG < VERBOSE < INFO < WARN < ERROR\n *\n * All of the log types above the current log level will be captured (i.e. if\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\n * `VERBOSE` logs will not)\n */\nexport enum LogLevel {\n  DEBUG,\n  VERBOSE,\n  INFO,\n  WARN,\n  ERROR,\n  SILENT\n}\n\nconst levelStringToEnum: { [key in LogLevelString]: LogLevel } = {\n  'debug': LogLevel.DEBUG,\n  'verbose': LogLevel.VERBOSE,\n  'info': LogLevel.INFO,\n  'warn': LogLevel.WARN,\n  'error': LogLevel.ERROR,\n  'silent': LogLevel.SILENT\n};\n\n/**\n * The default log level\n */\nconst defaultLogLevel: LogLevel = LogLevel.INFO;\n\n/**\n * We allow users the ability to pass their own log handler. We will pass the\n * type of log, the current log level, and any other arguments passed (i.e. the\n * messages that the user wants to log) to this function.\n */\nexport type LogHandler = (\n  loggerInstance: Logger,\n  logType: LogLevel,\n  ...args: unknown[]\n) => void;\n\n/**\n * By default, `console.debug` is not displayed in the developer console (in\n * chrome). To avoid forcing users to have to opt-in to these logs twice\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\n * logs to the `console.log` function.\n */\nconst ConsoleMethod = {\n  [LogLevel.DEBUG]: 'log',\n  [LogLevel.VERBOSE]: 'log',\n  [LogLevel.INFO]: 'info',\n  [LogLevel.WARN]: 'warn',\n  [LogLevel.ERROR]: 'error'\n};\n\n/**\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\n * messages on to their corresponding console counterparts (if the log method\n * is supported by the current log level)\n */\nconst defaultLogHandler: LogHandler = (instance, logType, ...args): void => {\n  if (logType < instance.logLevel) {\n    return;\n  }\n  const now = new Date().toISOString();\n  const method = ConsoleMethod[logType as keyof typeof ConsoleMethod];\n  if (method) {\n    console[method as 'log' | 'info' | 'warn' | 'error'](\n      `[${now}]  ${instance.name}:`,\n      ...args\n    );\n  } else {\n    throw new Error(\n      `Attempted to log a message with an invalid logType (value: ${logType})`\n    );\n  }\n};\n\nexport class Logger {\n  /**\n   * Gives you an instance of a Logger to capture messages according to\n   * Firebase's logging scheme.\n   *\n   * @param name The name that the logs will be associated with\n   */\n  constructor(public name: string) {\n    /**\n     * Capture the current instance for later use\n     */\n    instances.push(this);\n  }\n\n  /**\n   * The log level of the given Logger instance.\n   */\n  private _logLevel = defaultLogLevel;\n\n  get logLevel(): LogLevel {\n    return this._logLevel;\n  }\n\n  set logLevel(val: LogLevel) {\n    if (!(val in LogLevel)) {\n      throw new TypeError(`Invalid value \"${val}\" assigned to \\`logLevel\\``);\n    }\n    this._logLevel = val;\n  }\n\n  // Workaround for setter/getter having to be the same type.\n  setLogLevel(val: LogLevel | LogLevelString): void {\n    this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\n  }\n\n  /**\n   * The main (internal) log handler for the Logger instance.\n   * Can be set to a new function in internal package code but not by user.\n   */\n  private _logHandler: LogHandler = defaultLogHandler;\n  get logHandler(): LogHandler {\n    return this._logHandler;\n  }\n  set logHandler(val: LogHandler) {\n    if (typeof val !== 'function') {\n      throw new TypeError('Value assigned to `logHandler` must be a function');\n    }\n    this._logHandler = val;\n  }\n\n  /**\n   * The optional, additional, user-defined log handler for the Logger instance.\n   */\n  private _userLogHandler: LogHandler | null = null;\n  get userLogHandler(): LogHandler | null {\n    return this._userLogHandler;\n  }\n  set userLogHandler(val: LogHandler | null) {\n    this._userLogHandler = val;\n  }\n\n  /**\n   * The functions below are all based on the `console` interface\n   */\n\n  debug(...args: unknown[]): void {\n    this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\n    this._logHandler(this, LogLevel.DEBUG, ...args);\n  }\n  log(...args: unknown[]): void {\n    this._userLogHandler &&\n      this._userLogHandler(this, LogLevel.VERBOSE, ...args);\n    this._logHandler(this, LogLevel.VERBOSE, ...args);\n  }\n  info(...args: unknown[]): void {\n    this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\n    this._logHandler(this, LogLevel.INFO, ...args);\n  }\n  warn(...args: unknown[]): void {\n    this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\n    this._logHandler(this, LogLevel.WARN, ...args);\n  }\n  error(...args: unknown[]): void {\n    this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\n    this._logHandler(this, LogLevel.ERROR, ...args);\n  }\n}\n\nexport function setLogLevel(level: LogLevelString | LogLevel): void {\n  instances.forEach(inst => {\n    inst.setLogLevel(level);\n  });\n}\n\nexport function setUserLogHandler(\n  logCallback: LogCallback | null,\n  options?: LogOptions\n): void {\n  for (const instance of instances) {\n    let customLogLevel: LogLevel | null = null;\n    if (options && options.level) {\n      customLogLevel = levelStringToEnum[options.level];\n    }\n    if (logCallback === null) {\n      instance.userLogHandler = null;\n    } else {\n      instance.userLogHandler = (\n        instance: Logger,\n        level: LogLevel,\n        ...args: unknown[]\n      ) => {\n        const message = args\n          .map(arg => {\n            if (arg == null) {\n              return null;\n            } else if (typeof arg === 'string') {\n              return arg;\n            } else if (typeof arg === 'number' || typeof arg === 'boolean') {\n              return arg.toString();\n            } else if (arg instanceof Error) {\n              return arg.message;\n            } else {\n              try {\n                return JSON.stringify(arg);\n              } catch (ignored) {\n                return null;\n              }\n            }\n          })\n          .filter(arg => arg)\n          .join(' ');\n        if (level >= (customLogLevel ?? instance.logLevel)) {\n          logCallback({\n            level: LogLevel[level].toLowerCase() as LogLevelString,\n            message,\n            args,\n            type: instance.name\n          });\n        }\n      };\n    }\n  }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ComponentContainer,\n  ComponentType,\n  Provider,\n  Name\n} from '@firebase/component';\nimport { PlatformLoggerService, VersionService } from './types';\n\nexport class PlatformLoggerServiceImpl implements PlatformLoggerService {\n  constructor(private readonly container: ComponentContainer) {}\n  // In initial implementation, this will be called by installations on\n  // auth token refresh, and installations will send this string.\n  getPlatformInfoString(): string {\n    const providers = this.container.getProviders();\n    // Loop through providers and get library/version pairs from any that are\n    // version components.\n    return providers\n      .map(provider => {\n        if (isVersionServiceProvider(provider)) {\n          const service = provider.getImmediate() as VersionService;\n          return `${service.library}/${service.version}`;\n        } else {\n          return null;\n        }\n      })\n      .filter(logString => logString)\n      .join(' ');\n  }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(provider: Provider<Name>): boolean {\n  const component = provider.getComponent();\n  return component?.type === ComponentType.VERSION;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app');\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { name as appName } from '../package.json';\nimport { name as appCompatName } from '../../app-compat/package.json';\nimport { name as analyticsCompatName } from '../../../packages/analytics-compat/package.json';\nimport { name as analyticsName } from '../../../packages/analytics/package.json';\nimport { name as appCheckCompatName } from '../../../packages/app-check-compat/package.json';\nimport { name as appCheckName } from '../../../packages/app-check/package.json';\nimport { name as authName } from '../../../packages/auth/package.json';\nimport { name as authCompatName } from '../../../packages/auth-compat/package.json';\nimport { name as databaseName } from '../../../packages/database/package.json';\nimport { name as databaseCompatName } from '../../../packages/database-compat/package.json';\nimport { name as functionsName } from '../../../packages/functions/package.json';\nimport { name as functionsCompatName } from '../../../packages/functions-compat/package.json';\nimport { name as installationsName } from '../../../packages/installations/package.json';\nimport { name as installationsCompatName } from '../../../packages/installations-compat/package.json';\nimport { name as messagingName } from '../../../packages/messaging/package.json';\nimport { name as messagingCompatName } from '../../../packages/messaging-compat/package.json';\nimport { name as performanceName } from '../../../packages/performance/package.json';\nimport { name as performanceCompatName } from '../../../packages/performance-compat/package.json';\nimport { name as remoteConfigName } from '../../../packages/remote-config/package.json';\nimport { name as remoteConfigCompatName } from '../../../packages/remote-config-compat/package.json';\nimport { name as storageName } from '../../../packages/storage/package.json';\nimport { name as storageCompatName } from '../../../packages/storage-compat/package.json';\nimport { name as firestoreName } from '../../../packages/firestore/package.json';\nimport { name as firestoreCompatName } from '../../../packages/firestore-compat/package.json';\nimport { name as packageName } from '../../../packages/firebase/package.json';\n\n/**\n * The default app name\n *\n * @internal\n */\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\nexport const PLATFORM_LOG_STRING = {\n  [appName]: 'fire-core',\n  [appCompatName]: 'fire-core-compat',\n  [analyticsName]: 'fire-analytics',\n  [analyticsCompatName]: 'fire-analytics-compat',\n  [appCheckName]: 'fire-app-check',\n  [appCheckCompatName]: 'fire-app-check-compat',\n  [authName]: 'fire-auth',\n  [authCompatName]: 'fire-auth-compat',\n  [databaseName]: 'fire-rtdb',\n  [databaseCompatName]: 'fire-rtdb-compat',\n  [functionsName]: 'fire-fn',\n  [functionsCompatName]: 'fire-fn-compat',\n  [installationsName]: 'fire-iid',\n  [installationsCompatName]: 'fire-iid-compat',\n  [messagingName]: 'fire-fcm',\n  [messagingCompatName]: 'fire-fcm-compat',\n  [performanceName]: 'fire-perf',\n  [performanceCompatName]: 'fire-perf-compat',\n  [remoteConfigName]: 'fire-rc',\n  [remoteConfigCompatName]: 'fire-rc-compat',\n  [storageName]: 'fire-gcs',\n  [storageCompatName]: 'fire-gcs-compat',\n  [firestoreName]: 'fire-fst',\n  [firestoreCompatName]: 'fire-fst-compat',\n  'fire-js': 'fire-js', // Platform identifier for JS SDK.\n  [packageName]: 'fire-js-all'\n} as const;\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp } from './public-types';\nimport { Component, Provider, Name } from '@firebase/component';\nimport { logger } from './logger';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { FirebaseAppImpl } from './firebaseApp';\n\n/**\n * @internal\n */\nexport const _apps = new Map<string, FirebaseApp>();\n\n/**\n * Registered components.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const _components = new Map<string, Component<any>>();\n\n/**\n * @param component - the component being added to this app's container\n *\n * @internal\n */\nexport function _addComponent<T extends Name>(\n  app: FirebaseApp,\n  component: Component<T>\n): void {\n  try {\n    (app as FirebaseAppImpl).container.addComponent(component);\n  } catch (e) {\n    logger.debug(\n      `Component ${component.name} failed to register with FirebaseApp ${app.name}`,\n      e\n    );\n  }\n}\n\n/**\n *\n * @internal\n */\nexport function _addOrOverwriteComponent(\n  app: FirebaseApp,\n  component: Component\n): void {\n  (app as FirebaseAppImpl).container.addOrOverwriteComponent(component);\n}\n\n/**\n *\n * @param component - the component to register\n * @returns whether or not the component is registered successfully\n *\n * @internal\n */\nexport function _registerComponent<T extends Name>(\n  component: Component<T>\n): boolean {\n  const componentName = component.name;\n  if (_components.has(componentName)) {\n    logger.debug(\n      `There were multiple attempts to register component ${componentName}.`\n    );\n\n    return false;\n  }\n\n  _components.set(componentName, component);\n\n  // add the component to existing app instances\n  for (const app of _apps.values()) {\n    _addComponent(app as FirebaseAppImpl, component);\n  }\n\n  return true;\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n *\n * @returns the provider for the service with the matching name\n *\n * @internal\n */\nexport function _getProvider<T extends Name>(\n  app: FirebaseApp,\n  name: T\n): Provider<T> {\n  const heartbeatController = (app as FirebaseAppImpl).container\n    .getProvider('heartbeat')\n    .getImmediate({ optional: true });\n  if (heartbeatController) {\n    void heartbeatController.triggerHeartbeat();\n  }\n  return (app as FirebaseAppImpl).container.getProvider(name);\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\n *\n * @internal\n */\nexport function _removeServiceInstance<T extends Name>(\n  app: FirebaseApp,\n  name: T,\n  instanceIdentifier: string = DEFAULT_ENTRY_NAME\n): void {\n  _getProvider(app, name).clearInstance(instanceIdentifier);\n}\n\n/**\n * Test only\n *\n * @internal\n */\nexport function _clearComponents(): void {\n  _components.clear();\n}\n\n/**\n * Exported in order to be used in app-compat package\n */\nexport { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n  NO_APP = 'no-app',\n  BAD_APP_NAME = 'bad-app-name',\n  DUPLICATE_APP = 'duplicate-app',\n  APP_DELETED = 'app-deleted',\n  INVALID_APP_ARGUMENT = 'invalid-app-argument',\n  INVALID_LOG_ARGUMENT = 'invalid-log-argument',\n  STORAGE_OPEN = 'storage-open',\n  STORAGE_GET = 'storage-get',\n  STORAGE_WRITE = 'storage-set',\n  STORAGE_DELETE = 'storage-delete'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n  [AppError.NO_APP]:\n    \"No Firebase App '{$appName}' has been created - \" +\n    'call Firebase App.initializeApp()',\n  [AppError.BAD_APP_NAME]: \"Illegal App name: '{$appName}\",\n  [AppError.DUPLICATE_APP]:\n    \"Firebase App named '{$appName}' already exists with different options or config\",\n  [AppError.APP_DELETED]: \"Firebase App named '{$appName}' already deleted\",\n  [AppError.INVALID_APP_ARGUMENT]:\n    'firebase.{$appName}() takes either no argument or a ' +\n    'Firebase App instance.',\n  [AppError.INVALID_LOG_ARGUMENT]:\n    'First argument to `onLog` must be null or a function.',\n  [AppError.STORAGE_OPEN]:\n    'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\n  [AppError.STORAGE_GET]:\n    'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\n  [AppError.STORAGE_WRITE]:\n    'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\n  [AppError.STORAGE_DELETE]:\n    'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\n};\n\ninterface ErrorParams {\n  [AppError.NO_APP]: { appName: string };\n  [AppError.BAD_APP_NAME]: { appName: string };\n  [AppError.DUPLICATE_APP]: { appName: string };\n  [AppError.APP_DELETED]: { appName: string };\n  [AppError.INVALID_APP_ARGUMENT]: { appName: string };\n  [AppError.STORAGE_OPEN]: { originalErrorMessage?: string };\n  [AppError.STORAGE_GET]: { originalErrorMessage?: string };\n  [AppError.STORAGE_WRITE]: { originalErrorMessage?: string };\n  [AppError.STORAGE_DELETE]: { originalErrorMessage?: string };\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n  'app',\n  'Firebase',\n  ERRORS\n);\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseApp,\n  FirebaseOptions,\n  FirebaseAppSettings\n} from './public-types';\nimport {\n  ComponentContainer,\n  Component,\n  ComponentType\n} from '@firebase/component';\nimport { ERROR_FACTORY, AppError } from './errors';\n\nexport class FirebaseAppImpl implements FirebaseApp {\n  private readonly _options: FirebaseOptions;\n  private readonly _name: string;\n  /**\n   * Original config values passed in as a constructor parameter.\n   * It is only used to compare with another config object to support idempotent initializeApp().\n   *\n   * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.\n   */\n  private readonly _config: Required<FirebaseAppSettings>;\n  private _automaticDataCollectionEnabled: boolean;\n  private _isDeleted = false;\n  private readonly _container: ComponentContainer;\n\n  constructor(\n    options: FirebaseOptions,\n    config: Required<FirebaseAppSettings>,\n    container: ComponentContainer\n  ) {\n    this._options = { ...options };\n    this._config = { ...config };\n    this._name = config.name;\n    this._automaticDataCollectionEnabled =\n      config.automaticDataCollectionEnabled;\n    this._container = container;\n    this.container.addComponent(\n      new Component('app', () => this, ComponentType.PUBLIC)\n    );\n  }\n\n  get automaticDataCollectionEnabled(): boolean {\n    this.checkDestroyed();\n    return this._automaticDataCollectionEnabled;\n  }\n\n  set automaticDataCollectionEnabled(val: boolean) {\n    this.checkDestroyed();\n    this._automaticDataCollectionEnabled = val;\n  }\n\n  get name(): string {\n    this.checkDestroyed();\n    return this._name;\n  }\n\n  get options(): FirebaseOptions {\n    this.checkDestroyed();\n    return this._options;\n  }\n\n  get config(): Required<FirebaseAppSettings> {\n    this.checkDestroyed();\n    return this._config;\n  }\n\n  get container(): ComponentContainer {\n    return this._container;\n  }\n\n  get isDeleted(): boolean {\n    return this._isDeleted;\n  }\n\n  set isDeleted(val: boolean) {\n    this._isDeleted = val;\n  }\n\n  /**\n   * This function will throw an Error if the App has already been deleted -\n   * use before performing API actions on the App.\n   */\n  private checkDestroyed(): void {\n    if (this.isDeleted) {\n      throw ERROR_FACTORY.create(AppError.APP_DELETED, { appName: this._name });\n    }\n  }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseApp,\n  FirebaseOptions,\n  FirebaseAppSettings\n} from './public-types';\nimport { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport {\n  ComponentContainer,\n  Component,\n  Name,\n  ComponentType\n} from '@firebase/component';\nimport { version } from '../../firebase/package.json';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { _apps, _components, _registerComponent } from './internal';\nimport { logger } from './logger';\nimport {\n  LogLevelString,\n  setLogLevel as setLogLevelImpl,\n  LogCallback,\n  LogOptions,\n  setUserLogHandler\n} from '@firebase/logger';\nimport { deepEqual } from '@firebase/util';\n\nexport { FirebaseError } from '@firebase/util';\n\n/**\n * The current SDK version.\n *\n * @public\n */\nexport const SDK_VERSION = version;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.\n *\n * See\n * {@link\n *   https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n *   | Add Firebase to your app} and\n * {@link\n *   https://firebase.google.com/docs/web/setup#multiple-projects\n *   | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize default app\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeApp({\n *   apiKey: \"AIza....\",                             // Auth / General Use\n *   authDomain: \"YOUR_APP.firebaseapp.com\",         // Auth with popup/redirect\n *   databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n *   storageBucket: \"YOUR_APP.appspot.com\",          // Storage\n *   messagingSenderId: \"123456789\"                  // Cloud Messaging\n * });\n * ```\n *\n * @example\n * ```javascript\n *\n * // Initialize another app\n * const otherApp = initializeApp({\n *   databaseURL: \"https://<OTHER_DATABASE_NAME>.firebaseio.com\",\n *   storageBucket: \"<OTHER_STORAGE_BUCKET>.appspot.com\"\n * }, \"otherApp\");\n * ```\n *\n * @param options - Options to configure the app's services.\n * @param name - Optional name of the app to initialize. If no name\n *   is provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The initialized app.\n *\n * @public\n */\nexport function initializeApp(\n  options: FirebaseOptions,\n  name?: string\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @param options - Options to configure the app's services.\n * @param config - FirebaseApp Configuration\n *\n * @public\n */\nexport function initializeApp(\n  options: FirebaseOptions,\n  config?: FirebaseAppSettings\n): FirebaseApp;\nexport function initializeApp(\n  options: FirebaseOptions,\n  rawConfig = {}\n): FirebaseApp {\n  if (typeof rawConfig !== 'object') {\n    const name = rawConfig;\n    rawConfig = { name };\n  }\n\n  const config: Required<FirebaseAppSettings> = {\n    name: DEFAULT_ENTRY_NAME,\n    automaticDataCollectionEnabled: false,\n    ...rawConfig\n  };\n  const name = config.name;\n\n  if (typeof name !== 'string' || !name) {\n    throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {\n      appName: String(name)\n    });\n  }\n\n  const existingApp = _apps.get(name) as FirebaseAppImpl;\n  if (existingApp) {\n    // return the existing app if options and config deep equal the ones in the existing app.\n    if (\n      deepEqual(options, existingApp.options) &&\n      deepEqual(config, existingApp.config)\n    ) {\n      return existingApp;\n    } else {\n      throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });\n    }\n  }\n\n  const container = new ComponentContainer(name);\n  for (const component of _components.values()) {\n    container.addComponent(component);\n  }\n\n  const newApp = new FirebaseAppImpl(options, config, container);\n\n  _apps.set(name, newApp);\n\n  return newApp;\n}\n\n/**\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\n *\n * When called with no arguments, the default app is returned. When an app name\n * is provided, the app corresponding to that name is returned.\n *\n * An exception is thrown if the app being retrieved has not yet been\n * initialized.\n *\n * @example\n * ```javascript\n * // Return the default app\n * const app = getApp();\n * ```\n *\n * @example\n * ```javascript\n * // Return a named app\n * const otherApp = getApp(\"otherApp\");\n * ```\n *\n * @param name - Optional name of the app to return. If no name is\n *   provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The app corresponding to the provided app name.\n *   If no app name is provided, the default app is returned.\n *\n * @public\n */\nexport function getApp(name: string = DEFAULT_ENTRY_NAME): FirebaseApp {\n  const app = _apps.get(name);\n  if (!app) {\n    throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n  }\n\n  return app;\n}\n\n/**\n * A (read-only) array of all initialized apps.\n * @public\n */\nexport function getApps(): FirebaseApp[] {\n  return Array.from(_apps.values());\n}\n\n/**\n * Renders this app unusable and frees the resources of all associated\n * services.\n *\n * @example\n * ```javascript\n * deleteApp(app)\n *   .then(function() {\n *     console.log(\"App deleted successfully\");\n *   })\n *   .catch(function(error) {\n *     console.log(\"Error deleting app:\", error);\n *   });\n * ```\n *\n * @public\n */\nexport async function deleteApp(app: FirebaseApp): Promise<void> {\n  const name = app.name;\n  if (_apps.has(name)) {\n    _apps.delete(name);\n    await Promise.all(\n      (app as FirebaseAppImpl).container\n        .getProviders()\n        .map(provider => provider.delete())\n    );\n    (app as FirebaseAppImpl).isDeleted = true;\n  }\n}\n\n/**\n * Registers a library's name and version for platform logging purposes.\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\n * @param version - Current version of that library.\n * @param variant - Bundle variant, e.g., node, rn, etc.\n *\n * @public\n */\nexport function registerVersion(\n  libraryKeyOrName: string,\n  version: string,\n  variant?: string\n): void {\n  // TODO: We can use this check to whitelist strings when/if we set up\n  // a good whitelist system.\n  let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;\n  if (variant) {\n    library += `-${variant}`;\n  }\n  const libraryMismatch = library.match(/\\s|\\//);\n  const versionMismatch = version.match(/\\s|\\//);\n  if (libraryMismatch || versionMismatch) {\n    const warning = [\n      `Unable to register library \"${library}\" with version \"${version}\":`\n    ];\n    if (libraryMismatch) {\n      warning.push(\n        `library name \"${library}\" contains illegal characters (whitespace or \"/\")`\n      );\n    }\n    if (libraryMismatch && versionMismatch) {\n      warning.push('and');\n    }\n    if (versionMismatch) {\n      warning.push(\n        `version name \"${version}\" contains illegal characters (whitespace or \"/\")`\n      );\n    }\n    logger.warn(warning.join(' '));\n    return;\n  }\n  _registerComponent(\n    new Component(\n      `${library}-version` as Name,\n      () => ({ library, version }),\n      ComponentType.VERSION\n    )\n  );\n}\n\n/**\n * Sets log handler for all Firebase SDKs.\n * @param logCallback - An optional custom log handler that executes user code whenever\n * the Firebase SDK makes a logging call.\n *\n * @public\n */\nexport function onLog(\n  logCallback: LogCallback | null,\n  options?: LogOptions\n): void {\n  if (logCallback !== null && typeof logCallback !== 'function') {\n    throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT);\n  }\n  setUserLogHandler(logCallback, options);\n}\n\n/**\n * Sets log level for all Firebase SDKs.\n *\n * All of the log types above the current log level are captured (i.e. if\n * you set the log level to `info`, errors are logged, but `debug` and\n * `verbose` logs are not).\n *\n * @public\n */\nexport function setLogLevel(logLevel: LogLevelString): void {\n  setLogLevelImpl(logLevel);\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DBWrapper, openDB } from '@firebase/util';\nimport { AppError, ERROR_FACTORY } from './errors';\nimport { FirebaseApp } from './public-types';\nimport { HeartbeatsInIndexedDB } from './types';\nconst DB_NAME = 'firebase-heartbeat-database';\nconst DB_VERSION = 1;\nconst STORE_NAME = 'firebase-heartbeat-store';\n\nlet dbPromise: Promise<DBWrapper> | null = null;\nfunction getDbPromise(): Promise<DBWrapper> {\n  if (!dbPromise) {\n    dbPromise = openDB(DB_NAME, DB_VERSION, (db, oldVersion) => {\n      // We don't use 'break' in this switch statement, the fall-through\n      // behavior is what we want, because if there are multiple versions between\n      // the old version and the current version, we want ALL the migrations\n      // that correspond to those versions to run, not only the last one.\n      // eslint-disable-next-line default-case\n      switch (oldVersion) {\n        case 0:\n          db.createObjectStore(STORE_NAME);\n      }\n    }).catch(e => {\n      throw ERROR_FACTORY.create(AppError.STORAGE_OPEN, {\n        originalErrorMessage: e.message\n      });\n    });\n  }\n  return dbPromise;\n}\n\nexport async function readHeartbeatsFromIndexedDB(\n  app: FirebaseApp\n): Promise<HeartbeatsInIndexedDB | undefined> {\n  try {\n    const db = await getDbPromise();\n    return db\n      .transaction(STORE_NAME)\n      .objectStore(STORE_NAME)\n      .get(computeKey(app)) as Promise<HeartbeatsInIndexedDB | undefined>;\n  } catch (e) {\n    throw ERROR_FACTORY.create(AppError.STORAGE_GET, {\n      originalErrorMessage: e.message\n    });\n  }\n}\n\nexport async function writeHeartbeatsToIndexedDB(\n  app: FirebaseApp,\n  heartbeatObject: HeartbeatsInIndexedDB\n): Promise<void> {\n  try {\n    const db = await getDbPromise();\n    const tx = db.transaction(STORE_NAME, 'readwrite');\n    const objectStore = tx.objectStore(STORE_NAME);\n    await objectStore.put(heartbeatObject, computeKey(app));\n    return tx.complete;\n  } catch (e) {\n    throw ERROR_FACTORY.create(AppError.STORAGE_WRITE, {\n      originalErrorMessage: e.message\n    });\n  }\n}\n\nfunction computeKey(app: FirebaseApp): string {\n  return `${app.name}!${app.options.appId}`;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentContainer } from '@firebase/component';\nimport {\n  base64urlEncodeWithoutPadding,\n  isIndexedDBAvailable,\n  validateIndexedDBOpenable\n} from '@firebase/util';\nimport {\n  readHeartbeatsFromIndexedDB,\n  writeHeartbeatsToIndexedDB\n} from './indexeddb';\nimport { FirebaseApp } from './public-types';\nimport {\n  HeartbeatsByUserAgent,\n  HeartbeatService,\n  HeartbeatsInIndexedDB,\n  HeartbeatStorage,\n  SingleDateHeartbeat\n} from './types';\n\nconst MAX_HEADER_BYTES = 1024;\n// 30 days\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\n\nexport class HeartbeatServiceImpl implements HeartbeatService {\n  /**\n   * The persistence layer for heartbeats\n   * Leave public for easier testing.\n   */\n  _storage: HeartbeatStorageImpl;\n\n  /**\n   * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\n   * the header string.\n   * Stores one record per date. This will be consolidated into the standard\n   * format of one record per user agent string before being sent as a header.\n   * Populated from indexedDB when the controller is instantiated and should\n   * be kept in sync with indexedDB.\n   * Leave public for easier testing.\n   */\n  _heartbeatsCache: HeartbeatsInIndexedDB | null = null;\n\n  /**\n   * the initialization promise for populating heartbeatCache.\n   * If getHeartbeatsHeader() is called before the promise resolves\n   * (hearbeatsCache == null), it should wait for this promise\n   * Leave public for easier testing.\n   */\n  _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;\n  constructor(private readonly container: ComponentContainer) {\n    const app = this.container.getProvider('app').getImmediate();\n    this._storage = new HeartbeatStorageImpl(app);\n    this._heartbeatsCachePromise = this._storage.read().then(result => {\n      this._heartbeatsCache = result;\n      return result;\n    });\n  }\n\n  /**\n   * Called to report a heartbeat. The function will generate\n   * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\n   * to IndexedDB.\n   * Note that we only store one heartbeat per day. So if a heartbeat for today is\n   * already logged, subsequent calls to this function in the same day will be ignored.\n   */\n  async triggerHeartbeat(): Promise<void> {\n    const platformLogger = this.container\n      .getProvider('platform-logger')\n      .getImmediate();\n\n    // This is the \"Firebase user agent\" string from the platform logger\n    // service, not the browser user agent.\n    const agent = platformLogger.getPlatformInfoString();\n    const date = getUTCDateString();\n    if (this._heartbeatsCache === null) {\n      this._heartbeatsCache = await this._heartbeatsCachePromise;\n    }\n    // Do not store a heartbeat if one is already stored for this day\n    // or if a header has already been sent today.\n    if (\n      this._heartbeatsCache.lastSentHeartbeatDate === date ||\n      this._heartbeatsCache.heartbeats.some(\n        singleDateHeartbeat => singleDateHeartbeat.date === date\n      )\n    ) {\n      return;\n    } else {\n      // There is no entry for this date. Create one.\n      this._heartbeatsCache.heartbeats.push({ date, agent });\n    }\n    // Remove entries older than 30 days.\n    this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(\n      singleDateHeartbeat => {\n        const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\n        const now = Date.now();\n        return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\n      }\n    );\n    return this._storage.overwrite(this._heartbeatsCache);\n  }\n\n  /**\n   * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\n   * It also clears all heartbeats from memory as well as in IndexedDB.\n   *\n   * NOTE: Consuming product SDKs should not send the header if this method\n   * returns an empty string.\n   */\n  async getHeartbeatsHeader(): Promise<string> {\n    if (this._heartbeatsCache === null) {\n      await this._heartbeatsCachePromise;\n    }\n    // If it's still null or the array is empty, there is no data to send.\n    if (\n      this._heartbeatsCache === null ||\n      this._heartbeatsCache.heartbeats.length === 0\n    ) {\n      return '';\n    }\n    const date = getUTCDateString();\n    // Extract as many heartbeats from the cache as will fit under the size limit.\n    const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(\n      this._heartbeatsCache.heartbeats\n    );\n    const headerString = base64urlEncodeWithoutPadding(\n      JSON.stringify({ version: 2, heartbeats: heartbeatsToSend })\n    );\n    // Store last sent date to prevent another being logged/sent for the same day.\n    this._heartbeatsCache.lastSentHeartbeatDate = date;\n    if (unsentEntries.length > 0) {\n      // Store any unsent entries if they exist.\n      this._heartbeatsCache.heartbeats = unsentEntries;\n      // This seems more likely than emptying the array (below) to lead to some odd state\n      // since the cache isn't empty and this will be called again on the next request,\n      // and is probably safest if we await it.\n      await this._storage.overwrite(this._heartbeatsCache);\n    } else {\n      this._heartbeatsCache.heartbeats = [];\n      // Do not wait for this, to reduce latency.\n      void this._storage.overwrite(this._heartbeatsCache);\n    }\n    return headerString;\n  }\n}\n\nfunction getUTCDateString(): string {\n  const today = new Date();\n  // Returns date format 'YYYY-MM-DD'\n  return today.toISOString().substring(0, 10);\n}\n\nexport function extractHeartbeatsForHeader(\n  heartbeatsCache: SingleDateHeartbeat[],\n  maxSize = MAX_HEADER_BYTES\n): {\n  heartbeatsToSend: HeartbeatsByUserAgent[];\n  unsentEntries: SingleDateHeartbeat[];\n} {\n  // Heartbeats grouped by user agent in the standard format to be sent in\n  // the header.\n  const heartbeatsToSend: HeartbeatsByUserAgent[] = [];\n  // Single date format heartbeats that are not sent.\n  let unsentEntries = heartbeatsCache.slice();\n  for (const singleDateHeartbeat of heartbeatsCache) {\n    // Look for an existing entry with the same user agent.\n    const heartbeatEntry = heartbeatsToSend.find(\n      hb => hb.agent === singleDateHeartbeat.agent\n    );\n    if (!heartbeatEntry) {\n      // If no entry for this user agent exists, create one.\n      heartbeatsToSend.push({\n        agent: singleDateHeartbeat.agent,\n        dates: [singleDateHeartbeat.date]\n      });\n      if (countBytes(heartbeatsToSend) > maxSize) {\n        // If the header would exceed max size, remove the added heartbeat\n        // entry and stop adding to the header.\n        heartbeatsToSend.pop();\n        break;\n      }\n    } else {\n      heartbeatEntry.dates.push(singleDateHeartbeat.date);\n      // If the header would exceed max size, remove the added date\n      // and stop adding to the header.\n      if (countBytes(heartbeatsToSend) > maxSize) {\n        heartbeatEntry.dates.pop();\n        break;\n      }\n    }\n    // Pop unsent entry from queue. (Skipped if adding the entry exceeded\n    // quota and the loop breaks early.)\n    unsentEntries = unsentEntries.slice(1);\n  }\n  return {\n    heartbeatsToSend,\n    unsentEntries\n  };\n}\n\nexport class HeartbeatStorageImpl implements HeartbeatStorage {\n  private _canUseIndexedDBPromise: Promise<boolean>;\n  constructor(public app: FirebaseApp) {\n    this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\n  }\n  async runIndexedDBEnvironmentCheck(): Promise<boolean> {\n    if (!isIndexedDBAvailable()) {\n      return false;\n    } else {\n      return validateIndexedDBOpenable()\n        .then(() => true)\n        .catch(() => false);\n    }\n  }\n  /**\n   * Read all heartbeats.\n   */\n  async read(): Promise<HeartbeatsInIndexedDB> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return { heartbeats: [] };\n    } else {\n      const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\n      return idbHeartbeatObject || { heartbeats: [] };\n    }\n  }\n  // overwrite the storage with the provided heartbeats\n  async overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return;\n    } else {\n      const existingHeartbeatsObject = await this.read();\n      return writeHeartbeatsToIndexedDB(this.app, {\n        lastSentHeartbeatDate:\n          heartbeatsObject.lastSentHeartbeatDate ??\n          existingHeartbeatsObject.lastSentHeartbeatDate,\n        heartbeats: heartbeatsObject.heartbeats\n      });\n    }\n  }\n  // add heartbeats\n  async add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return;\n    } else {\n      const existingHeartbeatsObject = await this.read();\n      return writeHeartbeatsToIndexedDB(this.app, {\n        lastSentHeartbeatDate:\n          heartbeatsObject.lastSentHeartbeatDate ??\n          existingHeartbeatsObject.lastSentHeartbeatDate,\n        heartbeats: [\n          ...existingHeartbeatsObject.heartbeats,\n          ...heartbeatsObject.heartbeats\n        ]\n      });\n    }\n  }\n}\n\n/**\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\n * in a platform logging header JSON object, stringified, and converted\n * to base 64.\n */\nexport function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number {\n  // base64 has a restricted set of characters, all of which should be 1 byte.\n  return base64urlEncodeWithoutPadding(\n    // heartbeatsCache wrapper properties\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })\n  ).length;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, ComponentType } from '@firebase/component';\nimport { PlatformLoggerServiceImpl } from './platformLoggerService';\nimport { name, version } from '../package.json';\nimport { _registerComponent } from './internal';\nimport { registerVersion } from './api';\nimport { HeartbeatServiceImpl } from './heartbeatService';\n\nexport function registerCoreComponents(variant?: string): void {\n  _registerComponent(\n    new Component(\n      'platform-logger',\n      container => new PlatformLoggerServiceImpl(container),\n      ComponentType.PRIVATE\n    )\n  );\n  _registerComponent(\n    new Component(\n      'heartbeat',\n      container => new HeartbeatServiceImpl(container),\n      ComponentType.PRIVATE\n    )\n  );\n\n  // Register `app` package.\n  registerVersion(name, version, variant);\n  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n  registerVersion(name, version, '__BUILD_TARGET__');\n  // Register platform SDK identifier (no version).\n  registerVersion('fire-js', '');\n}\n", "/**\n * Firebase App\n *\n * @remarks This package coordinates the communication between the different Firebase components\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerCoreComponents } from './registerCoreComponents';\n\nexport * from './api';\nexport * from './internal';\nexport * from './public-types';\n\nregisterCoreComponents('__RUNTIME_ENV__');\n", "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { registerVersion } from '@firebase/app';\nimport { name, version } from '../package.json';\n\nregisterVersion(name, version, 'app');\nexport * from '@firebase/app';\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will attempt to load Closure's deps file, unless\n * the global <code>CLOSURE_NO_DEPS</code> is set to true.  This allows projects\n * to include their own deps file(s) from different locations.\n *\n * Avoid including base.js more than once. This is strictly discouraged and not\n * supported. goog.require(...) won't work properly in that case.\n *\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library.  Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n/**\n * Reference to the global object.\n * https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object\n *\n * More info on this implementation here:\n * https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI/edit\n *\n * @const\n * @suppress {undefinedVars} self won't be referenced unless `this` is falsy.\n * @type {!Global}\n */\ngoog.global =\n    // Check `this` first for backwards compatibility.\n    // Valid unless running as an ES module or in a function wrapper called\n    //   without setting `this` properly.\n    // Note that base.js can't usefully be imported as an ES module, but it may\n    // be compiled into bundles that are loadable as ES modules.\n    this ||\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/self\n    // For in-page browser environments and workers.\n    self;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, `CLOSURE_UNCOMPILED_DEFINES` may be defined before\n * loading base.js.  If a key is defined in `CLOSURE_UNCOMPILED_DEFINES`,\n * `goog.define` will use the value instead of the default value.  This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code.  In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n *   var CLOSURE_DEFINES = {'goog.DEBUG': false} ;\n * </pre>\n *\n * @type {Object<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name The name of the object that this file defines.\n * @param {*=} object The object to expose at the end of the path.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether object should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @param {?Object=} objectToExportTo The object to add the path to; if this\n *     field is not specified, its value defaults to `goog.global`.\n * @private\n */\ngoog.exportPath_ = function(name, object, overwriteImplicit, objectToExportTo) {\n  var parts = name.split('.');\n  var cur = objectToExportTo || goog.global;\n\n  // Internet Explorer exhibits strange behavior when throwing errors from\n  // methods externed in this manner.  See the testExportSymbolExceptions in\n  // base_test.html for an example.\n  if (!(parts[0] in cur) && typeof cur.execScript != 'undefined') {\n    cur.execScript('var ' + parts[0]);\n  }\n\n  for (var part; parts.length && (part = parts.shift());) {\n    if (!parts.length && object !== undefined) {\n      if (!overwriteImplicit && goog.isObject(object) &&\n          goog.isObject(cur[part])) {\n        // Merge properties on object (the input parameter) with the existing\n        // implicitly defined namespace, so as to not clobber previously\n        // defined child namespaces.\n        for (var prop in object) {\n          if (object.hasOwnProperty(prop)) {\n            cur[part][prop] = object[prop];\n          }\n        }\n      } else {\n        // Either there is no existing implicit namespace, or overwriteImplicit\n        // is set to true, so directly assign object (the input parameter) to\n        // the namespace.\n        cur[part] = object;\n      }\n    } else if (cur[part] && cur[part] !== Object.prototype[part]) {\n      cur = cur[part];\n    } else {\n      cur = cur[part] = {};\n    }\n  }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retrieved from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled the default can be overridden using the compiler options or the\n * value set in the CLOSURE_DEFINES object. Returns the defined value so that it\n * can be used safely in modules. Note that the value type MUST be either\n * boolean, number, or string.\n *\n * @param {string} name The distinguished name to provide.\n * @param {T} defaultValue\n * @return {T} The defined value.\n * @template T\n */\ngoog.define = function(name, defaultValue) {\n  var value = defaultValue;\n  if (!COMPILED) {\n    var uncompiledDefines = goog.global.CLOSURE_UNCOMPILED_DEFINES;\n    var defines = goog.global.CLOSURE_DEFINES;\n    if (uncompiledDefines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (uncompiledDefines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(uncompiledDefines, name)) {\n      value = uncompiledDefines[name];\n    } else if (\n        defines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (defines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(defines, name)) {\n      value = defines[name];\n    }\n  }\n  return value;\n};\n\n\n/**\n * @define {number} Integer year indicating the set of browser features that are\n * guaranteed to be present.  This is defined to include exactly features that\n * work correctly on all \"modern\" browsers that are stable on January 1 of the\n * specified year.  For example,\n * ```js\n * if (goog.FEATURESET_YEAR >= 2019) {\n *   // use APIs known to be available on all major stable browsers Jan 1, 2019\n * } else {\n *   // polyfill for older browsers\n * }\n * ```\n * This is intended to be the primary define for removing\n * unnecessary browser compatibility code (such as ponyfills and workarounds),\n * and should inform the default value for most other defines:\n * ```js\n * const ASSUME_NATIVE_PROMISE =\n *     goog.define('ASSUME_NATIVE_PROMISE', goog.FEATURESET_YEAR >= 2016);\n * ```\n *\n * The default assumption is that IE9 is the lowest supported browser, which was\n * first available Jan 1, 2012.\n *\n * TODO(user): Reference more thorough documentation when it's available.\n */\ngoog.FEATURESET_YEAR = goog.define('goog.FEATURESET_YEAR', 2012);\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production. It can be easily stripped\n * by specifying --define goog.DEBUG=false to the Closure Compiler aka\n * JSCompiler. For example, most toString() methods should be declared inside an\n * \"if (goog.DEBUG)\" conditional because they are generally used for debugging\n * purposes and it is difficult for the JSCompiler to statically determine\n * whether they are used.\n */\ngoog.DEBUG = goog.define('goog.DEBUG', true);\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as a compiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he).\n *\n */\ngoog.LOCALE = goog.define('goog.LOCALE', 'en');  // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the compiler.\n */\ngoog.TRUSTED_SITE = goog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether code that calls {@link goog.setTestOnly} should\n *     be disallowed in the compilation unit.\n */\ngoog.DISALLOW_TEST_ONLY_CODE =\n    goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG);\n\n\n/**\n * @define {boolean} Whether to use a Chrome app CSP-compliant method for\n *     loading scripts via goog.require. @see appendScriptSrcNode_.\n */\ngoog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING =\n    goog.define('goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING', false);\n\n\n/**\n * Defines a namespace in Closure.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * The presence of one or more goog.provide() calls in a file indicates\n * that the file defines the given objects/namespaces.\n * Provided symbols must not be null or undefined.\n *\n * In addition, goog.provide() creates the object stubs for a namespace\n * (for example, goog.provide(\"goog.foo.bar\") will create the object\n * goog.foo.bar if it does not already exist).\n *\n * Build tools also scan for provide/require/module statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n *\n * @see goog.require\n * @see goog.module\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * deprecated Use goog.module (see b/159289405)\n */\ngoog.provide = function(name) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.provide cannot be used within a module.');\n  }\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n  }\n\n  goog.constructNamespace_(name);\n};\n\n\n/**\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * @param {?Object=} object The object to embed in the namespace.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether opt_obj should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @private\n */\ngoog.constructNamespace_ = function(name, object, overwriteImplicit) {\n  if (!COMPILED) {\n    delete goog.implicitNamespaces_[name];\n\n    var namespace = name;\n    while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n      if (goog.getObjectByName(namespace)) {\n        break;\n      }\n      goog.implicitNamespaces_[namespace] = true;\n    }\n  }\n\n  goog.exportPath_(name, object, overwriteImplicit);\n};\n\n\n/**\n * Returns CSP nonce, if set for any script tag.\n * @param {?Window=} opt_window The window context used to retrieve the nonce.\n *     Defaults to global context.\n * @return {string} CSP nonce or empty string if no nonce is present.\n */\ngoog.getScriptNonce = function(opt_window) {\n  if (opt_window && opt_window != goog.global) {\n    return goog.getScriptNonce_(opt_window.document);\n  }\n  if (goog.cspNonce_ === null) {\n    goog.cspNonce_ = goog.getScriptNonce_(goog.global.document);\n  }\n  return goog.cspNonce_;\n};\n\n\n/**\n * According to the CSP3 spec a nonce must be a valid base64 string.\n * @see https://www.w3.org/TR/CSP3/#grammardef-base64-value\n * @private @const\n */\ngoog.NONCE_PATTERN_ = /^[\\w+/_-]+[=]{0,2}$/;\n\n\n/**\n * @private {?string}\n */\ngoog.cspNonce_ = null;\n\n\n/**\n * Returns CSP nonce, if set for any script tag.\n * @param {!Document} doc\n * @return {string} CSP nonce or empty string if no nonce is present.\n * @private\n */\ngoog.getScriptNonce_ = function(doc) {\n  var script = doc.querySelector && doc.querySelector('script[nonce]');\n  if (script) {\n    // Try to get the nonce from the IDL property first, because browsers that\n    // implement additional nonce protection features (currently only Chrome) to\n    // prevent nonce stealing via CSS do not expose the nonce via attributes.\n    // See https://github.com/whatwg/html/issues/2369\n    var nonce = script['nonce'] || script.getAttribute('nonce');\n    if (nonce && goog.NONCE_PATTERN_.test(nonce)) {\n      return nonce;\n    }\n  }\n  return '';\n};\n\n\n/**\n * Module identifier validation regexp.\n * Note: This is a conservative check, it is very possible to be more lenient,\n *   the primary exclusion here is \"/\" and \"\\\" and a leading \".\", these\n *   restrictions are intended to leave the door open for using goog.require\n *   with relative file paths rather than module identifiers.\n * @private\n */\ngoog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;\n\n\n/**\n * Defines a module in Closure.\n *\n * Marks that this file must be loaded as a module and claims the namespace.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * goog.module() has three requirements:\n * - goog.module may not be used in the same file as goog.provide.\n * - goog.module must be the first statement in the file.\n * - only one goog.module is allowed per file.\n *\n * When a goog.module annotated file is loaded, it is enclosed in\n * a strict function closure. This means that:\n * - any variables declared in a goog.module file are private to the file\n * (not global), though the compiler is expected to inline the module.\n * - The code must obey all the rules of \"strict\" JavaScript.\n * - the file will be marked as \"use strict\"\n *\n * NOTE: unlike goog.provide, goog.module does not declare any symbols by\n * itself. If declared symbols are desired, use\n * goog.module.declareLegacyNamespace().\n *\n *\n * See the public goog.module proposal: http://goo.gl/Va1hin\n *\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\", is expected but not required.\n * @return {void}\n */\ngoog.module = function(name) {\n  if (typeof name !== 'string' || !name ||\n      name.search(goog.VALID_MODULE_RE_) == -1) {\n    throw new Error('Invalid module identifier');\n  }\n  if (!goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'Module ' + name + ' has been loaded incorrectly. Note, ' +\n        'modules cannot be loaded as normal scripts. They require some kind of ' +\n        'pre-processing step. You\\'re likely trying to load a module via a ' +\n        'script tag or as a part of a concatenated bundle without rewriting the ' +\n        'module. For more info see: ' +\n        'https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.');\n  }\n  if (goog.moduleLoaderState_.moduleName) {\n    throw new Error('goog.module may only be called once per module.');\n  }\n\n  // Store the module name for the loader.\n  goog.moduleLoaderState_.moduleName = name;\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n    delete goog.implicitNamespaces_[name];\n  }\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * Note: This is not an alternative to goog.require, it does not\n * indicate a hard dependency, instead it is used to indicate\n * an optional dependency or to access the exports of a module\n * that has already been loaded.\n * @suppress {missingProvide}\n */\ngoog.module.get = function(name) {\n  return goog.module.getInternal_(name);\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n * @private\n */\ngoog.module.getInternal_ = function(name) {\n  if (!COMPILED) {\n    if (name in goog.loadedModules_) {\n      return goog.loadedModules_[name].exports;\n    } else if (!goog.implicitNamespaces_[name]) {\n      var ns = goog.getObjectByName(name);\n      return ns != null ? ns : null;\n    }\n  }\n  return null;\n};\n\n\n/**\n * Types of modules the debug loader can load.\n * @enum {string}\n */\ngoog.ModuleType = {\n  ES6: 'es6',\n  GOOG: 'goog'\n};\n\n\n/**\n * @private {?{\n *   moduleName: (string|undefined),\n *   declareLegacyNamespace:boolean,\n *   type: ?goog.ModuleType\n * }}\n */\ngoog.moduleLoaderState_ = null;\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module or an es6 module is currently being\n *     initialized.\n */\ngoog.isInModuleLoader_ = function() {\n  return goog.isInGoogModuleLoader_() || goog.isInEs6ModuleLoader_();\n};\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module is currently being initialized.\n */\ngoog.isInGoogModuleLoader_ = function() {\n  return !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.GOOG;\n};\n\n\n/**\n * @private\n * @return {boolean} Whether an es6 module is currently being initialized.\n */\ngoog.isInEs6ModuleLoader_ = function() {\n  var inLoader = !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.ES6;\n\n  if (inLoader) {\n    return true;\n  }\n\n  var jscomp = goog.global['$jscomp'];\n\n  if (jscomp) {\n    // jscomp may not have getCurrentModulePath if this is a compiled bundle\n    // that has some of the runtime, but not all of it. This can happen if\n    // optimizations are turned on so the unused runtime is removed but renaming\n    // and Closure pass are off (so $jscomp is still named $jscomp and the\n    // goog.provide/require calls still exist).\n    if (typeof jscomp.getCurrentModulePath != 'function') {\n      return false;\n    }\n\n    // Bundled ES6 module.\n    return !!jscomp.getCurrentModulePath();\n  }\n\n  return false;\n};\n\n\n/**\n * Provide the module's exports as a globally accessible object under the\n * module's declared name.  This is intended to ease migration to goog.module\n * for files that have existing usages.\n * @suppress {missingProvide}\n */\ngoog.module.declareLegacyNamespace = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.declareLegacyNamespace must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.declareLegacyNamespace.');\n  }\n  goog.moduleLoaderState_.declareLegacyNamespace = true;\n};\n\n\n/**\n * Associates an ES6 module with a Closure module ID so that is available via\n * goog.require. The associated ID  acts like a goog.module ID - it does not\n * create any global names, it is merely available via goog.require /\n * goog.module.get / goog.forwardDeclare / goog.requireType. goog.require and\n * goog.module.get will return the entire module as if it was import *'d. This\n * allows Closure files to reference ES6 modules for the sake of migration.\n *\n * @param {string} namespace\n * @suppress {missingProvide}\n */\ngoog.declareModuleId = function(namespace) {\n  if (!COMPILED) {\n    if (!goog.isInEs6ModuleLoader_()) {\n      throw new Error(\n          'goog.declareModuleId may only be called from ' +\n          'within an ES6 module');\n    }\n    if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) {\n      throw new Error(\n          'goog.declareModuleId may only be called once per module.');\n    }\n    if (namespace in goog.loadedModules_) {\n      throw new Error(\n          'Module with namespace \"' + namespace + '\" already exists.');\n    }\n  }\n  if (goog.moduleLoaderState_) {\n    // Not bundled - debug loading.\n    goog.moduleLoaderState_.moduleName = namespace;\n  } else {\n    // Bundled - not debug loading, no module loader state.\n    var jscomp = goog.global['$jscomp'];\n    if (!jscomp || typeof jscomp.getCurrentModulePath != 'function') {\n      throw new Error(\n          'Module with namespace \"' + namespace +\n          '\" has been loaded incorrectly.');\n    }\n    var exports = jscomp.require(jscomp.getCurrentModulePath());\n    goog.loadedModules_[namespace] = {\n      exports: exports,\n      type: goog.ModuleType.ES6,\n      moduleId: namespace\n    };\n  }\n};\n\n\n/**\n * Marks that the current file should only be used for testing, and never for\n * live code in production.\n *\n * In the case of unit tests, the message may optionally be an exact namespace\n * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra\n * provide (if not explicitly defined in the code).\n *\n * @param {string=} opt_message Optional message to add to the error that's\n *     raised when used in production code.\n */\ngoog.setTestOnly = function(opt_message) {\n  if (goog.DISALLOW_TEST_ONLY_CODE) {\n    opt_message = opt_message || '';\n    throw new Error(\n        'Importing test-only code into non-debug environment' +\n        (opt_message ? ': ' + opt_message : '.'));\n  }\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n * Before using goog.forwardDeclare, please read the documentation at\n * https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation to\n * understand the options and tradeoffs when working with forward declarations.\n *\n * @param {string} name The namespace to forward declare in the form of\n *     \"goog.package.part\".\n * @deprecated See go/noforwarddeclaration, Use `goog.requireType` instead.\n */\ngoog.forwardDeclare = function(name) {};\n\n\n/**\n * Forward declare type information. Used to assign types to goog.global\n * referenced object that would otherwise result in unknown type references\n * and thus block property disambiguation.\n */\ngoog.forwardDeclare('Document');\ngoog.forwardDeclare('HTMLScriptElement');\ngoog.forwardDeclare('XMLHttpRequest');\n\n\nif (!COMPILED) {\n  /**\n   * Check if the given name has been goog.provided. This will return false for\n   * names that are available only as implicit namespaces.\n   * @param {string} name name of the object to look for.\n   * @return {boolean} Whether the name has been provided.\n   * @private\n   */\n  goog.isProvided_ = function(name) {\n    return (name in goog.loadedModules_) ||\n        (!goog.implicitNamespaces_[name] && goog.getObjectByName(name) != null);\n  };\n\n  /**\n   * Namespaces implicitly defined by goog.provide. For example,\n   * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n   * 'goog.events' must be namespaces.\n   *\n   * @type {!Object<string, (boolean|undefined)>}\n   * @private\n   */\n  goog.implicitNamespaces_ = {'goog.module': true};\n\n  // NOTE: We add goog.module as an implicit namespace as goog.module is defined\n  // here and because the existing module package has not been moved yet out of\n  // the goog.module namespace. This satisifies both the debug loader and\n  // ahead-of-time dependency management.\n}\n\n\n/**\n * Returns an object based on its fully qualified external name.  The object\n * is not found if null or undefined.  If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n *     |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n  var parts = name.split('.');\n  var cur = opt_obj || goog.global;\n  for (var i = 0; i < parts.length; i++) {\n    cur = cur[parts[i]];\n    if (cur == null) {\n      return null;\n    }\n  }\n  return cur;\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {!Array<string>} provides An array of strings with\n *     the names of the objects this file provides.\n * @param {!Array<string>} requires An array of strings with\n *     the names of the objects this file requires.\n * @param {boolean|!Object<string>=} opt_loadFlags Parameters indicating\n *     how the file must be loaded.  The boolean 'true' is equivalent\n *     to {'module': 'goog'} for backwards-compatibility.  Valid properties\n *     and values include {'module': 'goog'} and {'lang': 'es6'}.\n */\ngoog.addDependency = function(relPath, provides, requires, opt_loadFlags) {\n  if (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n    goog.debugLoader_.addDependency(relPath, provides, requires, opt_loadFlags);\n  }\n};\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development.  The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script.  If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n//\n// User-defined namespaces may need their own deps file. For a reference on\n// creating a deps file, see:\n// Externally: https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js.  Work was done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.ENABLE_DEBUG_LOADER = goog.define('goog.ENABLE_DEBUG_LOADER', true);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n  if (goog.global.console) {\n    goog.global.console['error'](msg);\n  }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system.\n *\n * Note that all calls to goog.require will be stripped by the compiler.\n *\n * @see goog.provide\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?} If called within a goog.module or ES6 module file, the associated\n *     namespace or module otherwise null.\n */\ngoog.require = function(namespace) {\n  if (!COMPILED) {\n    // Might need to lazy load on old IE.\n    if (goog.ENABLE_DEBUG_LOADER) {\n      goog.debugLoader_.requested(namespace);\n    }\n\n    // If the object already exists we do not need to do anything.\n    if (goog.isProvided_(namespace)) {\n      if (goog.isInModuleLoader_()) {\n        return goog.module.getInternal_(namespace);\n      }\n    } else if (goog.ENABLE_DEBUG_LOADER) {\n      var moduleLoaderState = goog.moduleLoaderState_;\n      goog.moduleLoaderState_ = null;\n      try {\n        goog.debugLoader_.load_(namespace);\n      } finally {\n        goog.moduleLoaderState_ = moduleLoaderState;\n      }\n    }\n\n    return null;\n  }\n};\n\n\n/**\n * Requires a symbol for its type information. This is an indication to the\n * compiler that the symbol may appear in type annotations, yet it is not\n * referenced at runtime.\n *\n * When called within a goog.module or ES6 module file, the return value may be\n * assigned to or destructured into a variable, but it may not be otherwise used\n * in code outside of a type annotation.\n *\n * Note that all calls to goog.requireType will be stripped by the compiler.\n *\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?}\n */\ngoog.requireType = function(namespace) {\n  // Return an empty object so that single-level destructuring of the return\n  // value doesn't crash at runtime when using the debug loader. Multi-level\n  // destructuring isn't supported.\n  return {};\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to attempt to load Closure's deps file. By default, when uncompiled,\n * deps files will attempt to be loaded.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The first parameter the script source, which is a relative URI. The second,\n * optional parameter is the script contents, in the event the script needed\n * transformation. It should return true if the script was imported, false\n * otherwise.\n * @type {(function(string, string=): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * Null function used for default values of callbacks, etc.\n * @return {void} Nothing.\n * @deprecated use '()=>{}' or 'function(){}' instead.\n */\ngoog.nullFunction = function() {};\n\n\n/**\n * When defining a class Foo with an abstract method bar(), you can do:\n * Foo.prototype.bar = goog.abstractMethod\n *\n * Now if a subclass of Foo fails to override bar(), an error will be thrown\n * when bar() is invoked.\n *\n * @type {!Function}\n * @throws {Error} when invoked to indicate the method should be overridden.\n * @deprecated Use \"@abstract\" annotation instead of goog.abstractMethod in new\n *     code. See\n *     https://github.com/google/closure-compiler/wiki/@abstract-classes-and-methods\n */\ngoog.abstractMethod = function() {\n  throw new Error('unimplemented abstract method');\n};\n\n\n/**\n * Adds a `getInstance` static method that always returns the same\n * instance object.\n * @param {!Function} ctor The constructor for the class to add the static\n *     method to.\n * @suppress {missingProperties} 'instance_' isn't a property on 'Function'\n *     but we don't have a better type to use here.\n */\ngoog.addSingletonGetter = function(ctor) {\n  // instance_ is immediately set to prevent issues with sealed constructors\n  // such as are encountered when a constructor is returned as the export object\n  // of a goog.module in unoptimized code.\n  // Delcare type to avoid conformance violations that ctor.instance_ is unknown\n  /** @type {undefined|!Object} @suppress {underscore} */\n  ctor.instance_ = undefined;\n  ctor.getInstance = function() {\n    if (ctor.instance_) {\n      return ctor.instance_;\n    }\n    if (goog.DEBUG) {\n      // NOTE: JSCompiler can't optimize away Array#push.\n      goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor;\n    }\n    // Cast to avoid conformance violations that ctor.instance_ is unknown\n    return /** @type {!Object|undefined} */ (ctor.instance_) = new ctor;\n  };\n};\n\n\n/**\n * All singleton classes that have been instantiated, for testing. Don't read\n * it directly, use the `goog.testing.singleton` module. The compiler\n * removes this variable if unused.\n * @type {!Array<!Function>}\n * @private\n */\ngoog.instantiatedSingletons_ = [];\n\n\n/**\n * @define {boolean} Whether to load goog.modules using `eval` when using\n * the debug loader.  This provides a better debugging experience as the\n * source is unmodified and can be edited using Chrome Workspaces or similar.\n * However in some environments the use of `eval` is banned\n * so we provide an alternative.\n */\ngoog.LOAD_MODULE_USING_EVAL = goog.define('goog.LOAD_MODULE_USING_EVAL', true);\n\n\n/**\n * @define {boolean} Whether the exports of goog.modules should be sealed when\n * possible.\n */\ngoog.SEAL_MODULE_EXPORTS = goog.define('goog.SEAL_MODULE_EXPORTS', goog.DEBUG);\n\n\n/**\n * The registry of initialized modules:\n * The module identifier or path to module exports map.\n * @private @const {!Object<string, {exports:?,type:string,moduleId:string}>}\n */\ngoog.loadedModules_ = {};\n\n\n/**\n * True if the debug loader enabled and used.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\n/**\n * @define {string} How to decide whether to transpile.  Valid values\n * are 'always', 'never', and 'detect'.  The default ('detect') is to\n * use feature detection to determine which language levels need\n * transpilation.\n */\n// NOTE(sdh): we could expand this to accept a language level to bypass\n// detection: e.g. goog.TRANSPILE == 'es5' would transpile ES6 files but\n// would leave ES3 and ES5 files alone.\ngoog.TRANSPILE = goog.define('goog.TRANSPILE', 'detect');\n\n/**\n * @define {boolean} If true assume that ES modules have already been\n * transpiled by the jscompiler (in the same way that transpile.js would\n * transpile them - to jscomp modules). Useful only for servers that wish to use\n * the debug loader and transpile server side. Thus this is only respected if\n * goog.TRANSPILE is \"never\".\n */\ngoog.ASSUME_ES_MODULES_TRANSPILED =\n    goog.define('goog.ASSUME_ES_MODULES_TRANSPILED', false);\n\n\n/**\n * @define {string} If a file needs to be transpiled what the output language\n * should be. By default this is the highest language level this file detects\n * the current environment supports. Generally this flag should not be set, but\n * it could be useful to override. Example: If the current environment supports\n * ES6 then by default ES7+ files will be transpiled to ES6, unless this is\n * overridden.\n *\n * Valid values include: es3, es5, es6, es7, and es8. Anything not recognized\n * is treated as es3.\n *\n * Note that setting this value does not force transpilation. Just if\n * transpilation occurs this will be the output. So this is most useful when\n * goog.TRANSPILE is set to 'always' and then forcing the language level to be\n * something lower than what the environment detects.\n */\ngoog.TRANSPILE_TO_LANGUAGE = goog.define('goog.TRANSPILE_TO_LANGUAGE', '');\n\n\n/**\n * @define {string} Path to the transpiler.  Executing the script at this\n * path (relative to base.js) should define a function $jscomp.transpile.\n */\ngoog.TRANSPILER = goog.define('goog.TRANSPILER', 'transpile.js');\n\n\n/**\n * @define {string} Trusted Types policy name. If non-empty then Closure will\n * use Trusted Types.\n */\ngoog.TRUSTED_TYPES_POLICY_NAME =\n    goog.define('goog.TRUSTED_TYPES_POLICY_NAME', 'goog');\n\n\n/**\n * @package {?boolean}\n * Visible for testing.\n */\ngoog.hasBadLetScoping = null;\n\n\n/**\n * @param {function(?):?|string} moduleDef The module definition.\n */\ngoog.loadModule = function(moduleDef) {\n  // NOTE: we allow function definitions to be either in the from\n  // of a string to eval (which keeps the original source intact) or\n  // in a eval forbidden environment (CSP) we allow a function definition\n  // which in its body must call `goog.module`, and return the exports\n  // of the module.\n  var previousState = goog.moduleLoaderState_;\n  try {\n    goog.moduleLoaderState_ = {\n      moduleName: '',\n      declareLegacyNamespace: false,\n      type: goog.ModuleType.GOOG\n    };\n    var origExports = {};\n    var exports = origExports;\n    if (typeof moduleDef === 'function') {\n      exports = moduleDef.call(undefined, exports);\n    } else if (typeof moduleDef === 'string') {\n      exports = goog.loadModuleFromSource_.call(undefined, exports, moduleDef);\n    } else {\n      throw new Error('Invalid module definition');\n    }\n\n    var moduleName = goog.moduleLoaderState_.moduleName;\n    if (typeof moduleName === 'string' && moduleName) {\n      // Don't seal legacy namespaces as they may be used as a parent of\n      // another namespace\n      if (goog.moduleLoaderState_.declareLegacyNamespace) {\n        // Whether exports was overwritten via default export assignment.\n        // This is important for legacy namespaces as it dictates whether\n        // previously a previously loaded implicit namespace should be clobbered\n        // or not.\n        var isDefaultExport = origExports !== exports;\n        goog.constructNamespace_(moduleName, exports, isDefaultExport);\n      } else if (\n          goog.SEAL_MODULE_EXPORTS && Object.seal &&\n          typeof exports == 'object' && exports != null) {\n        Object.seal(exports);\n      }\n\n      var data = {\n        exports: exports,\n        type: goog.ModuleType.GOOG,\n        moduleId: goog.moduleLoaderState_.moduleName\n      };\n      goog.loadedModules_[moduleName] = data;\n    } else {\n      throw new Error('Invalid module name \\\"' + moduleName + '\\\"');\n    }\n  } finally {\n    goog.moduleLoaderState_ = previousState;\n  }\n};\n\n\n/**\n * @private @const\n */\ngoog.loadModuleFromSource_ =\n    /** @type {function(!Object, string):?} */ (function(exports) {\n      // NOTE: we avoid declaring parameters or local variables here to avoid\n      // masking globals or leaking values into the module definition.\n      'use strict';\n      eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(arguments[1]));\n      return exports;\n    });\n\n\n/**\n * Normalize a file path by removing redundant \"..\" and extraneous \".\" file\n * path components.\n * @param {string} path\n * @return {string}\n * @private\n */\ngoog.normalizePath_ = function(path) {\n  var components = path.split('/');\n  var i = 0;\n  while (i < components.length) {\n    if (components[i] == '.') {\n      components.splice(i, 1);\n    } else if (\n        i && components[i] == '..' && components[i - 1] &&\n        components[i - 1] != '..') {\n      components.splice(--i, 2);\n    } else {\n      i++;\n    }\n  }\n  return components.join('/');\n};\n\n\n/**\n * Provides a hook for loading a file when using Closure's goog.require() API\n * with goog.modules.  In particular this hook is provided to support Node.js.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_LOAD_FILE_SYNC;\n\n\n/**\n * Loads file by synchronous XHR. Should not be used in production environments.\n * @param {string} src Source URL.\n * @return {?string} File contents, or null if load failed.\n * @private\n */\ngoog.loadFileSync_ = function(src) {\n  if (goog.global.CLOSURE_LOAD_FILE_SYNC) {\n    return goog.global.CLOSURE_LOAD_FILE_SYNC(src);\n  } else {\n    try {\n      /** @type {XMLHttpRequest} */\n      var xhr = new goog.global['XMLHttpRequest']();\n      xhr.open('get', src, false);\n      xhr.send();\n      // NOTE: Successful http: requests have a status of 200, but successful\n      // file: requests may have a status of zero.  Any other status, or a\n      // thrown exception (particularly in case of file: requests) indicates\n      // some sort of error, which we treat as a missing or unavailable file.\n      return xhr.status == 0 || xhr.status == 200 ? xhr.responseText : null;\n    } catch (err) {\n      // No need to rethrow or log, since errors should show up on their own.\n      return null;\n    }\n  }\n};\n\n\n/**\n * Lazily retrieves the transpiler and applies it to the source.\n * @param {string} code JS code.\n * @param {string} path Path to the code.\n * @param {string} target Language level output.\n * @return {string} The transpiled code.\n * @private\n */\ngoog.transpile_ = function(code, path, target) {\n  var jscomp = goog.global['$jscomp'];\n  if (!jscomp) {\n    goog.global['$jscomp'] = jscomp = {};\n  }\n  var transpile = jscomp.transpile;\n  if (!transpile) {\n    var transpilerPath = goog.basePath + goog.TRANSPILER;\n    var transpilerCode = goog.loadFileSync_(transpilerPath);\n    if (transpilerCode) {\n      // This must be executed synchronously, since by the time we know we\n      // need it, we're about to load and write the ES6 code synchronously,\n      // so a normal script-tag load will be too slow. Wrapped in a function\n      // so that code is eval'd in the global scope.\n      (function() {\n        (0, eval)(transpilerCode + '\\n//# sourceURL=' + transpilerPath);\n      }).call(goog.global);\n      // Even though the transpiler is optional, if $gwtExport is found, it's\n      // a sign the transpiler was loaded and the $jscomp.transpile *should*\n      // be there.\n      if (goog.global['$gwtExport'] && goog.global['$gwtExport']['$jscomp'] &&\n          !goog.global['$gwtExport']['$jscomp']['transpile']) {\n        throw new Error(\n            'The transpiler did not properly export the \"transpile\" ' +\n            'method. $gwtExport: ' + JSON.stringify(goog.global['$gwtExport']));\n      }\n      // transpile.js only exports a single $jscomp function, transpile. We\n      // grab just that and add it to the existing definition of $jscomp which\n      // contains the polyfills.\n      goog.global['$jscomp'].transpile =\n          goog.global['$gwtExport']['$jscomp']['transpile'];\n      jscomp = goog.global['$jscomp'];\n      transpile = jscomp.transpile;\n    }\n  }\n  if (!transpile) {\n    // The transpiler is an optional component.  If it's not available then\n    // replace it with a pass-through function that simply logs.\n    var suffix = ' requires transpilation but no transpiler was found.';\n    transpile = jscomp.transpile = function(code, path) {\n      // TODO(sdh): figure out some way to get this error to show up\n      // in test results, noting that the failure may occur in many\n      // different ways, including in loadModule() before the test\n      // runner even comes up.\n      goog.logToConsole_(path + suffix);\n      return code;\n    };\n  }\n  // Note: any transpilation errors/warnings will be logged to the console.\n  return transpile(code, path, target);\n};\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * This is a \"fixed\" version of the typeof operator.  It differs from the typeof\n * operator in such a way that null returns 'null' and arrays return 'array'.\n * @param {?} value The value to get the type of.\n * @return {string} The name of the type.\n */\ngoog.typeOf = function(value) {\n  var s = typeof value;\n\n  if (s != 'object') {\n    return s;\n  }\n\n  if (!value) {\n    return 'null';\n  }\n\n  if (Array.isArray(value)) {\n    return 'array';\n  }\n  return s;\n};\n\n\n/**\n * Returns true if the object looks like an array. To qualify as array like\n * the value needs to be either a NodeList or an object with a Number length\n * property. Note that for this function neither strings nor functions are\n * considered \"array-like\".\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an array.\n */\ngoog.isArrayLike = function(val) {\n  var type = goog.typeOf(val);\n  // We do not use goog.isObject here in order to exclude function values.\n  return type == 'array' || type == 'object' && typeof val.length == 'number';\n};\n\n\n/**\n * Returns true if the object looks like a Date. To qualify as Date-like the\n * value needs to be an object and have a getFullYear() function.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a like a Date.\n */\ngoog.isDateLike = function(val) {\n  return goog.isObject(val) && typeof val.getFullYear == 'function';\n};\n\n\n/**\n * Returns true if the specified value is an object.  This includes arrays and\n * functions.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an object.\n */\ngoog.isObject = function(val) {\n  var type = typeof val;\n  return type == 'object' && val != null || type == 'function';\n  // return Object(val) === val also works, but is slower, especially if val is\n  // not an object.\n};\n\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. The unique ID is\n * guaranteed to be unique across the current session amongst objects that are\n * passed into `getUid`. There is no guarantee that the ID is unique or\n * consistent across sessions. It is unsafe to generate unique ID for function\n * prototypes.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {number} The unique ID for the object.\n */\ngoog.getUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n  return Object.prototype.hasOwnProperty.call(obj, goog.UID_PROPERTY_) &&\n      obj[goog.UID_PROPERTY_] ||\n      (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);\n};\n\n\n/**\n * Whether the given object is already assigned a unique ID.\n *\n * This does not modify the object.\n *\n * @param {!Object} obj The object to check.\n * @return {boolean} Whether there is an assigned unique id for the object.\n */\ngoog.hasUid = function(obj) {\n  return !!obj[goog.UID_PROPERTY_];\n};\n\n\n/**\n * Removes the unique ID from an object. This is useful if the object was\n * previously mutated using `goog.getUid` in which case the mutation is\n * undone.\n * @param {Object} obj The object to remove the unique ID field from.\n */\ngoog.removeUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n\n  // In IE, DOM nodes are not instances of Object and throw an exception if we\n  // try to delete.  Instead we try to use removeAttribute.\n  if (obj !== null && 'removeAttribute' in obj) {\n    obj.removeAttribute(goog.UID_PROPERTY_);\n  }\n\n  try {\n    delete obj[goog.UID_PROPERTY_];\n  } catch (ex) {\n  }\n};\n\n\n/**\n * Name for unique ID property. Initialized in a way to help avoid collisions\n * with other closure JavaScript on the same page.\n * @type {string}\n * @private\n */\ngoog.UID_PROPERTY_ = 'closure_uid_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * Counter for UID.\n * @type {number}\n * @private\n */\ngoog.uidCounter_ = 0;\n\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n *\n * WARNINGS:\n * <code>goog.cloneObject</code> does not detect reference loops. Objects that\n * refer to themselves will cause infinite recursion.\n *\n * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies\n * UIDs created by <code>getUid</code> into cloned results.\n *\n * @param {*} obj The value to clone.\n * @return {*} A clone of the input value.\n * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.\n */\ngoog.cloneObject = function(obj) {\n  var type = goog.typeOf(obj);\n  if (type == 'object' || type == 'array') {\n    if (typeof obj.clone === 'function') {\n      return obj.clone();\n    }\n    var clone = type == 'array' ? [] : {};\n    for (var key in obj) {\n      clone[key] = goog.cloneObject(obj[key]);\n    }\n    return clone;\n  }\n\n  return obj;\n};\n\n\n/**\n * A native implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindNative_ = function(fn, selfObj, var_args) {\n  return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));\n};\n\n\n/**\n * A pure-JS implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindJs_ = function(fn, selfObj, var_args) {\n  if (!fn) {\n    throw new Error();\n  }\n\n  if (arguments.length > 2) {\n    var boundArgs = Array.prototype.slice.call(arguments, 2);\n    return function() {\n      // Prepend the bound arguments to the current arguments.\n      var newArgs = Array.prototype.slice.call(arguments);\n      Array.prototype.unshift.apply(newArgs, boundArgs);\n      return fn.apply(selfObj, newArgs);\n    };\n\n  } else {\n    return function() {\n      return fn.apply(selfObj, arguments);\n    };\n  }\n};\n\n\n/**\n * Partially applies this function to a particular 'this object' and zero or\n * more arguments. The result is a new function with some arguments of the first\n * function pre-filled and the value of this 'pre-specified'.\n *\n * Remaining arguments specified at call-time are appended to the pre-specified\n * ones.\n *\n * Also see: {@link #partial}.\n *\n * Usage:\n * <pre>var barMethBound = goog.bind(myFunction, myObj, 'arg1', 'arg2');\n * barMethBound('arg3', 'arg4');</pre>\n *\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @suppress {deprecated} See above.\n * @deprecated use `=> {}` or Function.prototype.bind instead.\n */\ngoog.bind = function(fn, selfObj, var_args) {\n  // TODO(nicksantos): narrow the type signature.\n  if (Function.prototype.bind &&\n      // NOTE(nicksantos): Somebody pulled base.js into the default Chrome\n      // extension environment. This means that for Chrome extensions, they get\n      // the implementation of Function.prototype.bind that calls goog.bind\n      // instead of the native one. Even worse, we don't want to introduce a\n      // circular dependency between goog.bind and Function.prototype.bind, so\n      // we have to hack this to make sure it works correctly.\n      Function.prototype.bind.toString().indexOf('native code') != -1) {\n    goog.bind = goog.bindNative_;\n  } else {\n    goog.bind = goog.bindJs_;\n  }\n  return goog.bind.apply(null, arguments);\n};\n\n\n/**\n * Like goog.bind(), except that a 'this object' is not required. Useful when\n * the target function is already bound.\n *\n * Usage:\n * var g = goog.partial(f, arg1, arg2);\n * g(arg3, arg4);\n *\n * @param {Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.partial = function(fn, var_args) {\n  var args = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    // Clone the array (with slice()) and append additional arguments\n    // to the existing arguments.\n    var newArgs = args.slice();\n    newArgs.push.apply(newArgs, arguments);\n    return fn.apply(/** @type {?} */ (this), newArgs);\n  };\n};\n\n\n/**\n * Copies all the members of a source object to a target object. This method\n * does not work on all browsers for all objects that contain keys such as\n * toString or hasOwnProperty. Use goog.object.extend for this purpose.\n *\n * NOTE: Some have advocated for the use of goog.mixin to setup classes\n * with multiple inheritence (traits, mixins, etc).  However, as it simply\n * uses \"for in\", this is not compatible with ES6 classes whose methods are\n * non-enumerable.  Changing this, would break cases where non-enumerable\n * properties are not expected.\n *\n * @param {Object} target Target.\n * @param {Object} source Source.\n * @deprecated Prefer Object.assign\n */\ngoog.mixin = function(target, source) {\n  for (var x in source) {\n    target[x] = source[x];\n  }\n\n  // For IE7 or lower, the for-in-loop does not contain any properties that are\n  // not enumerable on the prototype object (for example, isPrototypeOf from\n  // Object.prototype) but also it will not include 'replace' on objects that\n  // extend String and change 'replace' (not that it is common for anyone to\n  // extend anything except Object).\n};\n\n\n/**\n * @return {number} An integer value representing the number of milliseconds\n *     between midnight, January 1, 1970 and the current time.\n * @deprecated Use Date.now\n */\ngoog.now = function() {\n  return Date.now();\n};\n\n\n/**\n * Evals JavaScript in the global scope.\n *\n * Throws an exception if neither execScript or eval is defined.\n * @param {string|!TrustedScript} script JavaScript string.\n */\ngoog.globalEval = function(script) {\n  (0, eval)(script);\n};\n\n\n/**\n * Optional map of CSS class names to obfuscated names used with\n * goog.getCssName().\n * @private {!Object<string, string>|undefined}\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMapping_;\n\n\n/**\n * Optional obfuscation style for CSS class names. Should be set to either\n * 'BY_WHOLE' or 'BY_PART' if defined.\n * @type {string|undefined}\n * @private\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMappingStyle_;\n\n\n\n/**\n * A hook for modifying the default behavior goog.getCssName. The function\n * if present, will receive the standard output of the goog.getCssName as\n * its input.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAP_FN;\n\n\n/**\n * Handles strings that are intended to be used as CSS class names.\n *\n * This function works in tandem with @see goog.setCssNameMapping.\n *\n * Without any mapping set, the arguments are simple joined with a hyphen and\n * passed through unaltered.\n *\n * When there is a mapping, there are two possible styles in which these\n * mappings are used. In the BY_PART style, each part (i.e. in between hyphens)\n * of the passed in css name is rewritten according to the map. In the BY_WHOLE\n * style, the full css name is looked up in the map directly. If a rewrite is\n * not specified by the map, the compiler will output a warning.\n *\n * When the mapping is passed to the compiler, it will replace calls to\n * goog.getCssName with the strings from the mapping, e.g.\n *     var x = goog.getCssName('foo');\n *     var y = goog.getCssName(this.baseClass, 'active');\n *  becomes:\n *     var x = 'foo';\n *     var y = this.baseClass + '-active';\n *\n * If one argument is passed it will be processed, if two are passed only the\n * modifier will be processed, as it is assumed the first argument was generated\n * as a result of calling goog.getCssName.\n *\n * @param {string} className The class name.\n * @param {string=} opt_modifier A modifier to be appended to the class name.\n * @return {string} The class name or the concatenation of the class name and\n *     the modifier.\n */\ngoog.getCssName = function(className, opt_modifier) {\n  // String() is used for compatibility with compiled soy where the passed\n  // className can be non-string objects.\n  if (String(className).charAt(0) == '.') {\n    throw new Error(\n        'className passed in goog.getCssName must not start with \".\".' +\n        ' You passed: ' + className);\n  }\n\n  var getMapping = function(cssName) {\n    return goog.cssNameMapping_[cssName] || cssName;\n  };\n\n  var renameByParts = function(cssName) {\n    // Remap all the parts individually.\n    var parts = cssName.split('-');\n    var mapped = [];\n    for (var i = 0; i < parts.length; i++) {\n      mapped.push(getMapping(parts[i]));\n    }\n    return mapped.join('-');\n  };\n\n  var rename;\n  if (goog.cssNameMapping_) {\n    rename =\n        goog.cssNameMappingStyle_ == 'BY_WHOLE' ? getMapping : renameByParts;\n  } else {\n    rename = function(a) {\n      return a;\n    };\n  }\n\n  var result =\n      opt_modifier ? className + '-' + rename(opt_modifier) : rename(className);\n\n  // The special CLOSURE_CSS_NAME_MAP_FN allows users to specify further\n  // processing of the class name.\n  if (goog.global.CLOSURE_CSS_NAME_MAP_FN) {\n    return goog.global.CLOSURE_CSS_NAME_MAP_FN(result);\n  }\n\n  return result;\n};\n\n\n/**\n * Sets the map to check when returning a value from goog.getCssName(). Example:\n * <pre>\n * goog.setCssNameMapping({\n *   \"goog\": \"a\",\n *   \"disabled\": \"b\",\n * });\n *\n * var x = goog.getCssName('goog');\n * // The following evaluates to: \"a a-b\".\n * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')\n * </pre>\n * When declared as a map of string literals to string literals, the JSCompiler\n * will replace all calls to goog.getCssName() using the supplied map if the\n * --process_closure_primitives flag is set.\n *\n * @param {!Object} mapping A map of strings to strings where keys are possible\n *     arguments to goog.getCssName() and values are the corresponding values\n *     that should be returned.\n * @param {string=} opt_style The style of css name mapping. There are two valid\n *     options: 'BY_PART', and 'BY_WHOLE'.\n * @see goog.getCssName for a description.\n */\ngoog.setCssNameMapping = function(mapping, opt_style) {\n  goog.cssNameMapping_ = mapping;\n  goog.cssNameMappingStyle_ = opt_style;\n};\n\n\n/**\n * To use CSS renaming in compiled mode, one of the input files should have a\n * call to goog.setCssNameMapping() with an object literal that the JSCompiler\n * can extract and use to replace all calls to goog.getCssName(). In uncompiled\n * mode, JavaScript code should be loaded before this base.js file that declares\n * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is\n * to ensure that the mapping is loaded before any calls to goog.getCssName()\n * are made in uncompiled mode.\n *\n * A hook for overriding the CSS name mapping.\n * @type {!Object<string, string>|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAPPING;\n\n\nif (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {\n  // This does not call goog.setCssNameMapping() because the JSCompiler\n  // requires that goog.setCssNameMapping() be called with an object literal.\n  goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;\n}\n\n\n/**\n * Gets a localized message.\n *\n * This function is a compiler primitive. If you give the compiler a localized\n * message bundle, it will replace the string at compile-time with a localized\n * version, and expand goog.getMsg call to a concatenated string.\n *\n * Messages must be initialized in the form:\n * <code>\n * var MSG_NAME = goog.getMsg('Hello {$placeholder}', {'placeholder': 'world'});\n * </code>\n *\n * This function produces a string which should be treated as plain text. Use\n * {@link goog.html.SafeHtmlFormatter} in conjunction with goog.getMsg to\n * produce SafeHtml.\n *\n * @param {string} str Translatable string, places holders in the form {$foo}.\n * @param {Object<string, string>=} opt_values Maps place holder name to value.\n * @param {{html: (boolean|undefined),\n *         unescapeHtmlEntities: (boolean|undefined)}=} opt_options Options:\n *     html: Escape '<' in str to '&lt;'. Used by Closure Templates where the\n *     generated code size and performance is critical which is why {@link\n *     goog.html.SafeHtmlFormatter} is not used. The value must be literal true\n *     or false.\n *     unescapeHtmlEntities: Unescape common html entities: &gt;, &lt;, &apos;,\n *     &quot; and &amp;. Used for messages not in HTML context, such as with\n *     `textContent` property.\n * @return {string} message with placeholders filled.\n */\ngoog.getMsg = function(str, opt_values, opt_options) {\n  if (opt_options && opt_options.html) {\n    // Note that '&' is not replaced because the translation can contain HTML\n    // entities.\n    str = str.replace(/</g, '&lt;');\n  }\n  if (opt_options && opt_options.unescapeHtmlEntities) {\n    // Note that \"&amp;\" must be the last to avoid \"creating\" new entities.\n    str = str.replace(/&lt;/g, '<')\n              .replace(/&gt;/g, '>')\n              .replace(/&apos;/g, '\\'')\n              .replace(/&quot;/g, '\"')\n              .replace(/&amp;/g, '&');\n  }\n  if (opt_values) {\n    str = str.replace(/\\{\\$([^}]+)}/g, function(match, key) {\n      return (opt_values != null && key in opt_values) ? opt_values[key] :\n                                                         match;\n    });\n  }\n  return str;\n};\n\n\n/**\n * Gets a localized message. If the message does not have a translation, gives a\n * fallback message.\n *\n * This is useful when introducing a new message that has not yet been\n * translated into all languages.\n *\n * This function is a compiler primitive. Must be used in the form:\n * <code>var x = goog.getMsgWithFallback(MSG_A, MSG_B);</code>\n * where MSG_A and MSG_B were initialized with goog.getMsg.\n *\n * @param {string} a The preferred message.\n * @param {string} b The fallback message.\n * @return {string} The best translated message.\n */\ngoog.getMsgWithFallback = function(a, b) {\n  return a;\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n *     public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n *                       Foo.prototype.myMethod);\n *     new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {?Object=} objectToExportTo The object to add the path to; default\n *     is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, objectToExportTo) {\n  goog.exportPath_(\n      publicPath, object, /* overwriteImplicit= */ true, objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n  object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n *   ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {!Function} childCtor Child class.\n * @param {!Function} parentCtor Parent class.\n * @suppress {strictMissingProperties} superClass_ and base is not defined on\n *    Function.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n  /** @constructor */\n  function tempCtor() {}\n  tempCtor.prototype = parentCtor.prototype;\n  childCtor.superClass_ = parentCtor.prototype;\n  childCtor.prototype = new tempCtor();\n  /** @override */\n  childCtor.prototype.constructor = childCtor;\n\n  /**\n   * Calls superclass constructor/method.\n   *\n   * This function is only available if you use goog.inherits to\n   * express inheritance relationships between classes.\n   *\n   * NOTE: This is a replacement for goog.base and for superClass_\n   * property defined in childCtor.\n   *\n   * @param {!Object} me Should always be \"this\".\n   * @param {string} methodName The method name to call. Calling\n   *     superclass constructor can be done with the special string\n   *     'constructor'.\n   * @param {...*} var_args The arguments to pass to superclass\n   *     method/constructor.\n   * @return {*} The return value of the superclass method/constructor.\n   */\n  childCtor.base = function(me, methodName, var_args) {\n    // Copying using loop to avoid deop due to passing arguments object to\n    // function. This is faster in many JS engines as of late 2014.\n    var args = new Array(arguments.length - 2);\n    for (var i = 2; i < arguments.length; i++) {\n      args[i - 2] = arguments[i];\n    }\n    return parentCtor.prototype[methodName].apply(me, args);\n  };\n};\n\n\n/**\n * Allow for aliasing within scope functions.  This function exists for\n * uncompiled code - in compiled code the calls will be inlined and the aliases\n * applied.  In uncompiled code the function is simply run since the aliases as\n * written are valid JavaScript.\n *\n *\n * @param {function()} fn Function to call.  This function can contain aliases\n *     to namespaces (e.g. \"var dom = goog.dom\") or classes\n *     (e.g. \"var Timer = goog.Timer\").\n * @deprecated Use goog.module instead.\n */\ngoog.scope = function(fn) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.scope is not supported within a module.');\n  }\n  fn.call(goog.global);\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n *    eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n  goog.global['COMPILED'] = COMPILED;\n}\n\n\n//==============================================================================\n// goog.defineClass implementation\n//==============================================================================\n\n\n/**\n * Creates a restricted form of a Closure \"class\":\n *   - from the compiler's perspective, the instance returned from the\n *     constructor is sealed (no new properties may be added).  This enables\n *     better checks.\n *   - the compiler will rewrite this definition to a form that is optimal\n *     for type checking and optimization (initially this will be a more\n *     traditional form).\n *\n * @param {Function} superClass The superclass, Object or null.\n * @param {goog.defineClass.ClassDescriptor} def\n *     An object literal describing\n *     the class.  It may have the following properties:\n *     \"constructor\": the constructor function\n *     \"statics\": an object literal containing methods to add to the constructor\n *        as \"static\" methods or a function that will receive the constructor\n *        function as its only parameter to which static properties can\n *        be added.\n *     all other properties are added to the prototype.\n * @return {!Function} The class constructor.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.defineClass = function(superClass, def) {\n  // TODO(johnlenz): consider making the superClass an optional parameter.\n  var constructor = def.constructor;\n  var statics = def.statics;\n  // Wrap the constructor prior to setting up the prototype and static methods.\n  if (!constructor || constructor == Object.prototype.constructor) {\n    constructor = function() {\n      throw new Error(\n          'cannot instantiate an interface (no constructor defined).');\n    };\n  }\n\n  var cls = goog.defineClass.createSealingConstructor_(constructor, superClass);\n  if (superClass) {\n    goog.inherits(cls, superClass);\n  }\n\n  // Remove all the properties that should not be copied to the prototype.\n  delete def.constructor;\n  delete def.statics;\n\n  goog.defineClass.applyProperties_(cls.prototype, def);\n  if (statics != null) {\n    if (statics instanceof Function) {\n      statics(cls);\n    } else {\n      goog.defineClass.applyProperties_(cls, statics);\n    }\n  }\n\n  return cls;\n};\n\n\n/**\n * @typedef {{\n *   constructor: (!Function|undefined),\n *   statics: (Object|undefined|function(Function):void)\n * }}\n */\ngoog.defineClass.ClassDescriptor;\n\n\n/**\n * @define {boolean} Whether the instances returned by goog.defineClass should\n *     be sealed when possible.\n *\n * When sealing is disabled the constructor function will not be wrapped by\n * goog.defineClass, making it incompatible with ES6 class methods.\n */\ngoog.defineClass.SEAL_CLASS_INSTANCES =\n    goog.define('goog.defineClass.SEAL_CLASS_INSTANCES', goog.DEBUG);\n\n\n/**\n * If goog.defineClass.SEAL_CLASS_INSTANCES is enabled and Object.seal is\n * defined, this function will wrap the constructor in a function that seals the\n * results of the provided constructor function.\n *\n * @param {!Function} ctr The constructor whose results maybe be sealed.\n * @param {Function} superClass The superclass constructor.\n * @return {!Function} The replacement constructor.\n * @private\n */\ngoog.defineClass.createSealingConstructor_ = function(ctr, superClass) {\n  if (!goog.defineClass.SEAL_CLASS_INSTANCES) {\n    // Do now wrap the constructor when sealing is disabled. Angular code\n    // depends on this for injection to work properly.\n    return ctr;\n  }\n\n  // NOTE: The sealing behavior has been removed\n\n  /**\n   * @this {Object}\n   * @return {?}\n   */\n  var wrappedCtr = function() {\n    // Don't seal an instance of a subclass when it calls the constructor of\n    // its super class as there is most likely still setup to do.\n    var instance = ctr.apply(this, arguments) || this;\n    instance[goog.UID_PROPERTY_] = instance[goog.UID_PROPERTY_];\n\n    return instance;\n  };\n\n  return wrappedCtr;\n};\n\n\n\n// TODO(johnlenz): share these values with the goog.object\n/**\n * The names of the fields that are defined on Object.prototype.\n * @type {!Array<string>}\n * @private\n * @const\n */\ngoog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = [\n  'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',\n  'toLocaleString', 'toString', 'valueOf'\n];\n\n\n// TODO(johnlenz): share this function with the goog.object\n/**\n * @param {!Object} target The object to add properties to.\n * @param {!Object} source The object to copy properties from.\n * @private\n */\ngoog.defineClass.applyProperties_ = function(target, source) {\n  // TODO(johnlenz): update this to support ES5 getters/setters\n\n  var key;\n  for (key in source) {\n    if (Object.prototype.hasOwnProperty.call(source, key)) {\n      target[key] = source[key];\n    }\n  }\n\n  // For IE the for-in-loop does not contain any properties that are not\n  // enumerable on the prototype object (for example isPrototypeOf from\n  // Object.prototype) and it will also not include 'replace' on objects that\n  // extend String and change 'replace' (not that it is common for anyone to\n  // extend anything except Object).\n  for (var i = 0; i < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length; i++) {\n    key = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[i];\n    if (Object.prototype.hasOwnProperty.call(source, key)) {\n      target[key] = source[key];\n    }\n  }\n};\n\n/**\n * Returns the parameter.\n * @param {string} s\n * @return {string}\n * @private\n */\ngoog.identity_ = function(s) {\n  return s;\n};\n\n\n/**\n * Creates Trusted Types policy if Trusted Types are supported by the browser.\n * The policy just blesses any string as a Trusted Type. It is not visibility\n * restricted because anyone can also call trustedTypes.createPolicy directly.\n * However, the allowed names should be restricted by a HTTP header and the\n * reference to the created policy should be visibility restricted.\n * @param {string} name\n * @return {?TrustedTypePolicy}\n */\ngoog.createTrustedTypesPolicy = function(name) {\n  var policy = null;\n  var policyFactory = goog.global.trustedTypes;\n  if (!policyFactory || !policyFactory.createPolicy) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws if called with a name that is already\n  // registered, even in report-only mode. Until the API changes, catch the\n  // error not to break the applications functionally. In such case, the code\n  // will fall back to using regular Safe Types.\n  // TODO(koto): Remove catching once createPolicy API stops throwing.\n  try {\n    policy = policyFactory.createPolicy(name, {\n      createHTML: goog.identity_,\n      createScript: goog.identity_,\n      createScriptURL: goog.identity_\n    });\n  } catch (e) {\n    goog.logToConsole_(e.message);\n  }\n  return policy;\n};\n\n// There's a bug in the compiler where without collapse properties the\n// Closure namespace defines do not guard code correctly. To help reduce code\n// size also check for !COMPILED even though it redundant until this is fixed.\nif (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n\n\n  /**\n   * Tries to detect whether the current browser is Edge, based on the user\n   * agent. This matches only pre-Chromium Edge.\n   * @see https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-string\n   * @return {boolean} True if the current browser is Edge.\n   * @private\n   */\n  goog.isEdge_ = function() {\n    var userAgent = goog.global.navigator && goog.global.navigator.userAgent ?\n        goog.global.navigator.userAgent :\n        '';\n    var edgeRe = /Edge\\/(\\d+)(\\.\\d)*/i;\n    return !!userAgent.match(edgeRe);\n  };\n\n\n  /**\n   * Tries to detect whether is in the context of an HTML document.\n   * @return {boolean} True if it looks like HTML document.\n   * @private\n   */\n  goog.inHtmlDocument_ = function() {\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    return doc != null && 'write' in doc;  // XULDocument misses write.\n  };\n\n\n  /**\n   * We'd like to check for if the document readyState is 'loading'; however\n   * there are bugs on IE 10 and below where the readyState being anything other\n   * than 'complete' is not reliable.\n   * @return {boolean}\n   * @private\n   */\n  goog.isDocumentLoading_ = function() {\n    // attachEvent is available on IE 6 thru 10 only, and thus can be used to\n    // detect those browsers.\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n    return doc.attachEvent ? doc.readyState != 'complete' :\n                             doc.readyState == 'loading';\n  };\n\n\n  /**\n   * Tries to detect the base path of base.js script that bootstraps Closure.\n   * @private\n   */\n  goog.findBasePath_ = function() {\n    if (goog.global.CLOSURE_BASE_PATH != undefined &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        typeof goog.global.CLOSURE_BASE_PATH === 'string') {\n      goog.basePath = goog.global.CLOSURE_BASE_PATH;\n      return;\n    } else if (!goog.inHtmlDocument_()) {\n      return;\n    }\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    // If we have a currentScript available, use it exclusively.\n    var currentScript = doc.currentScript;\n    if (currentScript) {\n      var scripts = [currentScript];\n    } else {\n      var scripts = doc.getElementsByTagName('SCRIPT');\n    }\n    // Search backwards since the current script is in almost all cases the one\n    // that has base.js.\n    for (var i = scripts.length - 1; i >= 0; --i) {\n      var script = /** @type {!HTMLScriptElement} */ (scripts[i]);\n      var src = script.src;\n      var qmark = src.lastIndexOf('?');\n      var l = qmark == -1 ? src.length : qmark;\n      if (src.substr(l - 7, 7) == 'base.js') {\n        goog.basePath = src.substr(0, l - 7);\n        return;\n      }\n    }\n  };\n\n  goog.findBasePath_();\n\n  /** @struct @constructor @final */\n  goog.Transpiler = function() {\n    /** @private {?Object<string, boolean>} */\n    this.requiresTranspilation_ = null;\n    /** @private {string} */\n    this.transpilationTarget_ = goog.TRANSPILE_TO_LANGUAGE;\n  };\n  /**\n   * Returns a newly created map from language mode string to a boolean\n   * indicating whether transpilation should be done for that mode as well as\n   * the highest level language that this environment supports.\n   *\n   * Guaranteed invariant:\n   * For any two modes, l1 and l2 where l2 is a newer mode than l1,\n   * `map[l1] == true` implies that `map[l2] == true`.\n   *\n   * Note this method is extracted and used elsewhere, so it cannot rely on\n   * anything external (it should easily be able to be transformed into a\n   * standalone, top level function).\n   *\n   * @private\n   * @return {{\n   *   target: string,\n   *   map: !Object<string, boolean>\n   * }}\n   */\n  goog.Transpiler.prototype.createRequiresTranspilation_ = function() {\n    var transpilationTarget = 'es3';\n    var /** !Object<string, boolean> */ requiresTranspilation = {'es3': false};\n    var transpilationRequiredForAllLaterModes = false;\n\n    /**\n     * Adds an entry to requiresTranspliation for the given language mode.\n     *\n     * IMPORTANT: Calls must be made in order from oldest to newest language\n     * mode.\n     * @param {string} modeName\n     * @param {function(): boolean} isSupported Returns true if the JS engine\n     *     supports the given mode.\n     */\n    function addNewerLanguageTranspilationCheck(modeName, isSupported) {\n      if (transpilationRequiredForAllLaterModes) {\n        requiresTranspilation[modeName] = true;\n      } else if (isSupported()) {\n        transpilationTarget = modeName;\n        requiresTranspilation[modeName] = false;\n      } else {\n        requiresTranspilation[modeName] = true;\n        transpilationRequiredForAllLaterModes = true;\n      }\n    }\n\n    /**\n     * Does the given code evaluate without syntax errors and return a truthy\n     * result?\n     */\n    function /** boolean */ evalCheck(/** string */ code) {\n      try {\n        return !!eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(code));\n      } catch (ignored) {\n        return false;\n      }\n    }\n\n    // Identify ES3-only browsers by their incorrect treatment of commas.\n    addNewerLanguageTranspilationCheck('es5', function() {\n      return evalCheck('[1,].length==1');\n    });\n    addNewerLanguageTranspilationCheck('es6', function() {\n      // Edge has a non-deterministic (i.e., not reproducible) bug with ES6:\n      // https://github.com/Microsoft/ChakraCore/issues/1496.\n      if (goog.isEdge_()) {\n        // The Reflect.construct test below is flaky on Edge. It can sometimes\n        // pass or fail on 40 15.15063, so just exit early for Edge and treat\n        // it as ES5. Until we're on a more up to date version just always use\n        // ES5. See https://github.com/Microsoft/ChakraCore/issues/3217.\n        return false;\n      }\n      // Test es6: [FF50 (?), Edge 14 (?), Chrome 50]\n      //   (a) default params (specifically shadowing locals),\n      //   (b) destructuring, (c) block-scoped functions,\n      //   (d) for-of (const), (e) new.target/Reflect.construct\n      var es6fullTest =\n          'class X{constructor(){if(new.target!=String)throw 1;this.x=42}}' +\n          'let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof ' +\n          'String))throw 1;for(const a of[2,3]){if(a==2)continue;function ' +\n          'f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()' +\n          '==3}';\n\n      return evalCheck('(()=>{\"use strict\";' + es6fullTest + '})()');\n    });\n    // ** and **= are the only new features in 'es7'\n    addNewerLanguageTranspilationCheck('es7', function() {\n      return evalCheck('2**3==8');\n    });\n    // async functions are the only new features in 'es8'\n    addNewerLanguageTranspilationCheck('es8', function() {\n      return evalCheck('async()=>1,1');\n    });\n    addNewerLanguageTranspilationCheck('es9', function() {\n      return evalCheck('({...rest}={}),1');\n    });\n    // optional catch binding, unescaped unicode paragraph separator in strings\n    addNewerLanguageTranspilationCheck('es_2019', function() {\n      return evalCheck('let r;try{throw 0}catch{r=\"\\u2029\"};r');\n    });\n    // optional chaining, nullish coalescing\n    // untested/unsupported: bigint, import meta\n    addNewerLanguageTranspilationCheck('es_2020', function() {\n      return evalCheck('null?.x??1');\n    });\n    addNewerLanguageTranspilationCheck('es_next', function() {\n      return false;  // assume it always need to transpile\n    });\n    return {target: transpilationTarget, map: requiresTranspilation};\n  };\n\n\n  /**\n   * Determines whether the given language needs to be transpiled.\n   * @param {string} lang\n   * @param {string|undefined} module\n   * @return {boolean}\n   */\n  goog.Transpiler.prototype.needsTranspile = function(lang, module) {\n    if (goog.TRANSPILE == 'always') {\n      return true;\n    } else if (goog.TRANSPILE == 'never') {\n      return false;\n    } else if (!this.requiresTranspilation_) {\n      var obj = this.createRequiresTranspilation_();\n      this.requiresTranspilation_ = obj.map;\n      this.transpilationTarget_ = this.transpilationTarget_ || obj.target;\n    }\n    if (lang in this.requiresTranspilation_) {\n      if (this.requiresTranspilation_[lang]) {\n        return true;\n      } else if (\n          goog.inHtmlDocument_() && module == 'es6' &&\n          !('noModule' in goog.global.document.createElement('script'))) {\n        return true;\n      } else {\n        return false;\n      }\n    } else {\n      throw new Error('Unknown language mode: ' + lang);\n    }\n  };\n\n\n  /**\n   * Lazily retrieves the transpiler and applies it to the source.\n   * @param {string} code JS code.\n   * @param {string} path Path to the code.\n   * @return {string} The transpiled code.\n   */\n  goog.Transpiler.prototype.transpile = function(code, path) {\n    // TODO(johnplaisted): We should delete goog.transpile_ and just have this\n    // function. But there's some compile error atm where goog.global is being\n    // stripped incorrectly without this.\n    return goog.transpile_(code, path, this.transpilationTarget_);\n  };\n\n\n  /** @private @final {!goog.Transpiler} */\n  goog.transpiler_ = new goog.Transpiler();\n\n  /**\n   * Rewrites closing script tags in input to avoid ending an enclosing script\n   * tag.\n   *\n   * @param {string} str\n   * @return {string}\n   * @private\n   */\n  goog.protectScriptTag_ = function(str) {\n    return str.replace(/<\\/(SCRIPT)/ig, '\\\\x3c/$1');\n  };\n\n\n  /**\n   * A debug loader is responsible for downloading and executing javascript\n   * files in an unbundled, uncompiled environment.\n   *\n   * This can be custimized via the setDependencyFactory method, or by\n   * CLOSURE_IMPORT_SCRIPT/CLOSURE_LOAD_FILE_SYNC.\n   *\n   * @struct @constructor @final @private\n   */\n  goog.DebugLoader_ = function() {\n    /** @private @const {!Object<string, !goog.Dependency>} */\n    this.dependencies_ = {};\n    /** @private @const {!Object<string, string>} */\n    this.idToPath_ = {};\n    /** @private @const {!Object<string, boolean>} */\n    this.written_ = {};\n    /** @private @const {!Array<!goog.Dependency>} */\n    this.loadingDeps_ = [];\n    /** @private {!Array<!goog.Dependency>} */\n    this.depsToLoad_ = [];\n    /** @private {boolean} */\n    this.paused_ = false;\n    /** @private {!goog.DependencyFactory} */\n    this.factory_ = new goog.DependencyFactory(goog.transpiler_);\n    /** @private @const {!Object<string, !Function>} */\n    this.deferredCallbacks_ = {};\n    /** @private @const {!Array<string>} */\n    this.deferredQueue_ = [];\n  };\n\n  /**\n   * @param {!Array<string>} namespaces\n   * @param {function(): undefined} callback Function to call once all the\n   *     namespaces have loaded.\n   */\n  goog.DebugLoader_.prototype.bootstrap = function(namespaces, callback) {\n    var cb = callback;\n    function resolve() {\n      if (cb) {\n        goog.global.setTimeout(cb, 0);\n        cb = null;\n      }\n    }\n\n    if (!namespaces.length) {\n      resolve();\n      return;\n    }\n\n    var deps = [];\n    for (var i = 0; i < namespaces.length; i++) {\n      var path = this.getPathFromDeps_(namespaces[i]);\n      if (!path) {\n        throw new Error('Unregonized namespace: ' + namespaces[i]);\n      }\n      deps.push(this.dependencies_[path]);\n    }\n\n    var require = goog.require;\n    var loaded = 0;\n    for (var i = 0; i < namespaces.length; i++) {\n      require(namespaces[i]);\n      deps[i].onLoad(function() {\n        if (++loaded == namespaces.length) {\n          resolve();\n        }\n      });\n    }\n  };\n\n\n  /**\n   * Loads the Closure Dependency file.\n   *\n   * Exposed a public function so CLOSURE_NO_DEPS can be set to false, base\n   * loaded, setDependencyFactory called, and then this called. i.e. allows\n   * custom loading of the deps file.\n   */\n  goog.DebugLoader_.prototype.loadClosureDeps = function() {\n    // Circumvent addDependency, which would try to transpile deps.js if\n    // transpile is set to always.\n    var relPath = 'deps.js';\n    this.depsToLoad_.push(this.factory_.createDependency(\n        goog.normalizePath_(goog.basePath + relPath), relPath, [], [], {},\n        false));\n    this.loadDeps_();\n  };\n\n\n  /**\n   * Notifies the debug loader when a dependency has been requested.\n   *\n   * @param {string} absPathOrId Path of the dependency or goog id.\n   * @param {boolean=} opt_force\n   */\n  goog.DebugLoader_.prototype.requested = function(absPathOrId, opt_force) {\n    var path = this.getPathFromDeps_(absPathOrId);\n    if (path &&\n        (opt_force || this.areDepsLoaded_(this.dependencies_[path].requires))) {\n      var callback = this.deferredCallbacks_[path];\n      if (callback) {\n        delete this.deferredCallbacks_[path];\n        callback();\n      }\n    }\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.DebugLoader_.prototype.setDependencyFactory = function(factory) {\n    this.factory_ = factory;\n  };\n\n\n  /**\n   * Travserses the dependency graph and queues the given dependency, and all of\n   * its transitive dependencies, for loading and then starts loading if not\n   * paused.\n   *\n   * @param {string} namespace\n   * @private\n   */\n  goog.DebugLoader_.prototype.load_ = function(namespace) {\n    if (!this.getPathFromDeps_(namespace)) {\n      var errorMessage = 'goog.require could not find: ' + namespace;\n      goog.logToConsole_(errorMessage);\n    } else {\n      var loader = this;\n\n      var deps = [];\n\n      /** @param {string} namespace */\n      var visit = function(namespace) {\n        var path = loader.getPathFromDeps_(namespace);\n\n        if (!path) {\n          throw new Error('Bad dependency path or symbol: ' + namespace);\n        }\n\n        if (loader.written_[path]) {\n          return;\n        }\n\n        loader.written_[path] = true;\n\n        var dep = loader.dependencies_[path];\n        for (var i = 0; i < dep.requires.length; i++) {\n          if (!goog.isProvided_(dep.requires[i])) {\n            visit(dep.requires[i]);\n          }\n        }\n\n        deps.push(dep);\n      };\n\n      visit(namespace);\n\n      var wasLoading = !!this.depsToLoad_.length;\n      this.depsToLoad_ = this.depsToLoad_.concat(deps);\n\n      if (!this.paused_ && !wasLoading) {\n        this.loadDeps_();\n      }\n    }\n  };\n\n\n  /**\n   * Loads any queued dependencies until they are all loaded or paused.\n   *\n   * @private\n   */\n  goog.DebugLoader_.prototype.loadDeps_ = function() {\n    var loader = this;\n    var paused = this.paused_;\n\n    while (this.depsToLoad_.length && !paused) {\n      (function() {\n        var loadCallDone = false;\n        var dep = loader.depsToLoad_.shift();\n\n        var loaded = false;\n        loader.loading_(dep);\n\n        var controller = {\n          pause: function() {\n            if (loadCallDone) {\n              throw new Error('Cannot call pause after the call to load.');\n            } else {\n              paused = true;\n            }\n          },\n          resume: function() {\n            if (loadCallDone) {\n              loader.resume_();\n            } else {\n              // Some dep called pause and then resume in the same load call.\n              // Just keep running this same loop.\n              paused = false;\n            }\n          },\n          loaded: function() {\n            if (loaded) {\n              throw new Error('Double call to loaded.');\n            }\n\n            loaded = true;\n            loader.loaded_(dep);\n          },\n          pending: function() {\n            // Defensive copy.\n            var pending = [];\n            for (var i = 0; i < loader.loadingDeps_.length; i++) {\n              pending.push(loader.loadingDeps_[i]);\n            }\n            return pending;\n          },\n          /**\n           * @param {goog.ModuleType} type\n           */\n          setModuleState: function(type) {\n            goog.moduleLoaderState_ = {\n              type: type,\n              moduleName: '',\n              declareLegacyNamespace: false\n            };\n          },\n          /** @type {function(string, string, string=)} */\n          registerEs6ModuleExports: function(\n              path, exports, opt_closureNamespace) {\n            if (opt_closureNamespace) {\n              goog.loadedModules_[opt_closureNamespace] = {\n                exports: exports,\n                type: goog.ModuleType.ES6,\n                moduleId: opt_closureNamespace || ''\n              };\n            }\n          },\n          /** @type {function(string, ?)} */\n          registerGoogModuleExports: function(moduleId, exports) {\n            goog.loadedModules_[moduleId] = {\n              exports: exports,\n              type: goog.ModuleType.GOOG,\n              moduleId: moduleId\n            };\n          },\n          clearModuleState: function() {\n            goog.moduleLoaderState_ = null;\n          },\n          defer: function(callback) {\n            if (loadCallDone) {\n              throw new Error(\n                  'Cannot register with defer after the call to load.');\n            }\n            loader.defer_(dep, callback);\n          },\n          areDepsLoaded: function() {\n            return loader.areDepsLoaded_(dep.requires);\n          }\n        };\n\n        try {\n          dep.load(controller);\n        } finally {\n          loadCallDone = true;\n        }\n      })();\n    }\n\n    if (paused) {\n      this.pause_();\n    }\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.pause_ = function() {\n    this.paused_ = true;\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.resume_ = function() {\n    if (this.paused_) {\n      this.paused_ = false;\n      this.loadDeps_();\n    }\n  };\n\n\n  /**\n   * Marks the given dependency as loading (load has been called but it has not\n   * yet marked itself as finished). Useful for dependencies that want to know\n   * what else is loading. Example: goog.modules cannot eval if there are\n   * loading dependencies.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loading_ = function(dep) {\n    this.loadingDeps_.push(dep);\n  };\n\n\n  /**\n   * Marks the given dependency as having finished loading and being available\n   * for require.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loaded_ = function(dep) {\n    for (var i = 0; i < this.loadingDeps_.length; i++) {\n      if (this.loadingDeps_[i] == dep) {\n        this.loadingDeps_.splice(i, 1);\n        break;\n      }\n    }\n\n    for (var i = 0; i < this.deferredQueue_.length; i++) {\n      if (this.deferredQueue_[i] == dep.path) {\n        this.deferredQueue_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (this.loadingDeps_.length == this.deferredQueue_.length &&\n        !this.depsToLoad_.length) {\n      // Something has asked to load these, but they may not be directly\n      // required again later, so load them now that we know we're done loading\n      // everything else. e.g. a goog module entry point.\n      while (this.deferredQueue_.length) {\n        this.requested(this.deferredQueue_.shift(), true);\n      }\n    }\n\n    dep.loaded();\n  };\n\n\n  /**\n   * @param {!Array<string>} pathsOrIds\n   * @return {boolean}\n   * @private\n   */\n  goog.DebugLoader_.prototype.areDepsLoaded_ = function(pathsOrIds) {\n    for (var i = 0; i < pathsOrIds.length; i++) {\n      var path = this.getPathFromDeps_(pathsOrIds[i]);\n      if (!path ||\n          (!(path in this.deferredCallbacks_) &&\n           !goog.isProvided_(pathsOrIds[i]))) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n\n  /**\n   * @param {string} absPathOrId\n   * @return {?string}\n   * @private\n   */\n  goog.DebugLoader_.prototype.getPathFromDeps_ = function(absPathOrId) {\n    if (absPathOrId in this.idToPath_) {\n      return this.idToPath_[absPathOrId];\n    } else if (absPathOrId in this.dependencies_) {\n      return absPathOrId;\n    } else {\n      return null;\n    }\n  };\n\n\n  /**\n   * @param {!goog.Dependency} dependency\n   * @param {!Function} callback\n   * @private\n   */\n  goog.DebugLoader_.prototype.defer_ = function(dependency, callback) {\n    this.deferredCallbacks_[dependency.path] = callback;\n    this.deferredQueue_.push(dependency.path);\n  };\n\n\n  /**\n   * Interface for goog.Dependency implementations to have some control over\n   * loading of dependencies.\n   *\n   * @record\n   */\n  goog.LoadController = function() {};\n\n\n  /**\n   * Tells the controller to halt loading of more dependencies.\n   */\n  goog.LoadController.prototype.pause = function() {};\n\n\n  /**\n   * Tells the controller to resume loading of more dependencies if paused.\n   */\n  goog.LoadController.prototype.resume = function() {};\n\n\n  /**\n   * Tells the controller that this dependency has finished loading.\n   *\n   * This causes this to be removed from pending() and any load callbacks to\n   * fire.\n   */\n  goog.LoadController.prototype.loaded = function() {};\n\n\n  /**\n   * List of dependencies on which load has been called but which have not\n   * called loaded on their controller. This includes the current dependency.\n   *\n   * @return {!Array<!goog.Dependency>}\n   */\n  goog.LoadController.prototype.pending = function() {};\n\n\n  /**\n   * Registers an object as an ES6 module's exports so that goog.modules may\n   * require it by path.\n   *\n   * @param {string} path Full path of the module.\n   * @param {?} exports\n   * @param {string=} opt_closureNamespace Closure namespace to associate with\n   *     this module.\n   */\n  goog.LoadController.prototype.registerEs6ModuleExports = function(\n      path, exports, opt_closureNamespace) {};\n\n\n  /**\n   * Sets the current module state.\n   *\n   * @param {goog.ModuleType} type Type of module.\n   */\n  goog.LoadController.prototype.setModuleState = function(type) {};\n\n\n  /**\n   * Clears the current module state.\n   */\n  goog.LoadController.prototype.clearModuleState = function() {};\n\n\n  /**\n   * Registers a callback to call once the dependency is actually requested\n   * via goog.require + all of the immediate dependencies have been loaded or\n   * all other files have been loaded. Allows for lazy loading until\n   * require'd without pausing dependency loading, which is needed on old IE.\n   *\n   * @param {!Function} callback\n   */\n  goog.LoadController.prototype.defer = function(callback) {};\n\n\n  /**\n   * @return {boolean}\n   */\n  goog.LoadController.prototype.areDepsLoaded = function() {};\n\n\n  /**\n   * Basic super class for all dependencies Closure Library can load.\n   *\n   * This default implementation is designed to load untranspiled, non-module\n   * scripts in a web broswer.\n   *\n   * For transpiled non-goog.module files {@see goog.TranspiledDependency}.\n   * For goog.modules see {@see goog.GoogModuleDependency}.\n   * For untranspiled ES6 modules {@see goog.Es6ModuleDependency}.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   */\n  goog.Dependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    /** @const */\n    this.path = path;\n    /** @const */\n    this.relativePath = relativePath;\n    /** @const */\n    this.provides = provides;\n    /** @const */\n    this.requires = requires;\n    /** @const */\n    this.loadFlags = loadFlags;\n    /** @private {boolean} */\n    this.loaded_ = false;\n    /** @private {!Array<function()>} */\n    this.loadCallbacks_ = [];\n  };\n\n\n  /**\n   * @return {string} The pathname part of this dependency's path if it is a\n   *     URI.\n   */\n  goog.Dependency.prototype.getPathName = function() {\n    var pathName = this.path;\n    var protocolIndex = pathName.indexOf('://');\n    if (protocolIndex >= 0) {\n      pathName = pathName.substring(protocolIndex + 3);\n      var slashIndex = pathName.indexOf('/');\n      if (slashIndex >= 0) {\n        pathName = pathName.substring(slashIndex + 1);\n      }\n    }\n    return pathName;\n  };\n\n\n  /**\n   * @param {function()} callback Callback to fire as soon as this has loaded.\n   * @final\n   */\n  goog.Dependency.prototype.onLoad = function(callback) {\n    if (this.loaded_) {\n      callback();\n    } else {\n      this.loadCallbacks_.push(callback);\n    }\n  };\n\n\n  /**\n   * Marks this dependency as loaded and fires any callbacks registered with\n   * onLoad.\n   * @final\n   */\n  goog.Dependency.prototype.loaded = function() {\n    this.loaded_ = true;\n    var callbacks = this.loadCallbacks_;\n    this.loadCallbacks_ = [];\n    for (var i = 0; i < callbacks.length; i++) {\n      callbacks[i]();\n    }\n  };\n\n\n  /**\n   * Whether or not document.written / appended script tags should be deferred.\n   *\n   * @private {boolean}\n   */\n  goog.Dependency.defer_ = false;\n\n\n  /**\n   * Map of script ready / state change callbacks. Old IE cannot handle putting\n   * these properties on goog.global.\n   *\n   * @private @const {!Object<string, function(?):undefined>}\n   */\n  goog.Dependency.callbackMap_ = {};\n\n\n  /**\n   * @param {function(...?):?} callback\n   * @return {string}\n   * @private\n   */\n  goog.Dependency.registerCallback_ = function(callback) {\n    var key = Math.random().toString(32);\n    goog.Dependency.callbackMap_[key] = callback;\n    return key;\n  };\n\n\n  /**\n   * @param {string} key\n   * @private\n   */\n  goog.Dependency.unregisterCallback_ = function(key) {\n    delete goog.Dependency.callbackMap_[key];\n  };\n\n\n  /**\n   * @param {string} key\n   * @param {...?} var_args\n   * @private\n   * @suppress {unusedPrivateMembers}\n   */\n  goog.Dependency.callback_ = function(key, var_args) {\n    if (key in goog.Dependency.callbackMap_) {\n      var callback = goog.Dependency.callbackMap_[key];\n      var args = [];\n      for (var i = 1; i < arguments.length; i++) {\n        args.push(arguments[i]);\n      }\n      callback.apply(undefined, args);\n    } else {\n      var errorMessage = 'Callback key ' + key +\n          ' does not exist (was base.js loaded more than once?).';\n      throw Error(errorMessage);\n    }\n  };\n\n\n  /**\n   * Starts loading this dependency. This dependency can pause loading if it\n   * needs to and resume it later via the controller interface.\n   *\n   * When this is loaded it should call controller.loaded(). Note that this will\n   * end up calling the loaded method of this dependency; there is no need to\n   * call it explicitly.\n   *\n   * @param {!goog.LoadController} controller\n   */\n  goog.Dependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      if (this.relativePath == 'deps.js') {\n        // Some old code is relying on base.js auto loading deps.js failing with\n        // no error before later setting CLOSURE_IMPORT_SCRIPT.\n        // CLOSURE_IMPORT_SCRIPT should be set *before* base.js is loaded, or\n        // CLOSURE_NO_DEPS set to true.\n        goog.logToConsole_(\n            'Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, ' +\n            'or setting CLOSURE_NO_DEPS to true.');\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    // If the user tries to require a new symbol after document load,\n    // something has gone terribly wrong. Doing a document.write would\n    // wipe out the page. This does not apply to the CSP-compliant method\n    // of writing script tags.\n    if (doc.readyState == 'complete' &&\n        !goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING) {\n      // Certain test frameworks load base.js multiple times, which tries\n      // to write deps.js each time. If that happens, just fail silently.\n      // These frameworks wipe the page between each load of base.js, so this\n      // is OK.\n      var isDeps = /\\bdeps.js$/.test(this.path);\n      if (isDeps) {\n        controller.loaded();\n        return;\n      } else {\n        throw Error('Cannot write \"' + this.path + '\" after document load');\n      }\n    }\n\n    var nonce = goog.getScriptNonce();\n    if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n        goog.isDocumentLoading_()) {\n      var key;\n      var callback = function(script) {\n        if (script.readyState && script.readyState != 'complete') {\n          script.onload = callback;\n          return;\n        }\n        goog.Dependency.unregisterCallback_(key);\n        controller.loaded();\n      };\n      key = goog.Dependency.registerCallback_(callback);\n\n      var defer = goog.Dependency.defer_ ? ' defer' : '';\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script src=\"' + this.path + '\"' + nonceAttr + defer +\n          ' id=\"script-' + key + '\"><\\/script>';\n\n      script += '<script' + nonceAttr + '>';\n\n      if (goog.Dependency.defer_) {\n        script += 'document.getElementById(\\'script-' + key +\n            '\\').onload = function() {\\n' +\n            '  goog.Dependency.callback_(\\'' + key + '\\', this);\\n' +\n            '};\\n';\n      } else {\n        script += 'goog.Dependency.callback_(\\'' + key +\n            '\\', document.getElementById(\\'script-' + key + '\\'));';\n      }\n\n      script += '<\\/script>';\n\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    } else {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = goog.Dependency.defer_;\n      scriptEl.async = false;\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      if (goog.DebugLoader_.IS_OLD_IE_) {\n        // Execution order is not guaranteed on old IE, halt loading and write\n        // these scripts one at a time, after each loads.\n        controller.pause();\n        scriptEl.onreadystatechange = function() {\n          if (scriptEl.readyState == 'loaded' ||\n              scriptEl.readyState == 'complete') {\n            controller.loaded();\n            controller.resume();\n          }\n        };\n      } else {\n        scriptEl.onload = function() {\n          scriptEl.onload = null;\n          controller.loaded();\n        };\n      }\n\n      scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n          goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path) :\n          this.path;\n      doc.head.appendChild(scriptEl);\n    }\n  };\n\n\n  /**\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides Should be an empty array.\n   *     TODO(johnplaisted) add support for adding closure namespaces to ES6\n   *     modules for interop purposes.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.Dependency}\n   */\n  goog.Es6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.Es6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.Es6ModuleDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.Es6ModuleDependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      controller.pause();\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    var dep = this;\n\n    // TODO(johnplaisted): Does document.writing really speed up anything? Any\n    // difference between this and just waiting for interactive mode and then\n    // appending?\n    function write(src, contents) {\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (contents) {\n        var script = '<script type=\"module\" crossorigin' + nonceAttr + '>' +\n            contents + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script type=\"module\" crossorigin src=\"' + src + '\"' +\n            nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n    }\n\n    function append(src, contents) {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = true;\n      scriptEl.async = false;\n      scriptEl.type = 'module';\n      scriptEl.setAttribute('crossorigin', true);\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      var nonce = goog.getScriptNonce();\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      if (contents) {\n        scriptEl.text = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScript(contents) :\n            contents;\n      } else {\n        scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScriptURL(src) :\n            src;\n      }\n\n      doc.head.appendChild(scriptEl);\n    }\n\n    var create;\n\n    if (goog.isDocumentLoading_()) {\n      create = write;\n      // We can ONLY call document.write if we are guaranteed that any\n      // non-module script tags document.written after this are deferred.\n      // Small optimization, in theory document.writing is faster.\n      goog.Dependency.defer_ = true;\n    } else {\n      create = append;\n    }\n\n    // Write 4 separate tags here:\n    // 1) Sets the module state at the correct time (just before execution).\n    // 2) A src node for this, which just hopefully lets the browser load it a\n    //    little early (no need to parse #3).\n    // 3) Import the module and register it.\n    // 4) Clear the module state at the correct time. Guaranteed to run even\n    //    if there is an error in the module (#3 will not run if there is an\n    //    error in the module).\n    var beforeKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(beforeKey);\n      controller.setModuleState(goog.ModuleType.ES6);\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + beforeKey + '\")');\n\n    // TODO(johnplaisted): Does this really speed up anything?\n    create(this.path, undefined);\n\n    var registerKey = goog.Dependency.registerCallback_(function(exports) {\n      goog.Dependency.unregisterCallback_(registerKey);\n      controller.registerEs6ModuleExports(\n          dep.path, exports, goog.moduleLoaderState_.moduleName);\n    });\n    create(\n        undefined,\n        'import * as m from \"' + this.path + '\"; goog.Dependency.callback_(\"' +\n            registerKey + '\", m)');\n\n    var afterKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(afterKey);\n      controller.clearModuleState();\n      controller.loaded();\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + afterKey + '\")');\n  };\n\n\n  /**\n   * Superclass of any dependency that needs to be loaded into memory,\n   * transformed, and then eval'd (goog.modules and transpiled files).\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor @abstract\n   * @extends {goog.Dependency}\n   */\n  goog.TransformedDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.TransformedDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @private {?string} */\n    this.contents_ = null;\n\n    /**\n     * Whether to lazily make the synchronous XHR (when goog.require'd) or make\n     * the synchronous XHR when initially loading. On FireFox 61 there is a bug\n     * where an ES6 module cannot make a synchronous XHR (rather, it can, but if\n     * it does then no other ES6 modules will load after).\n     *\n     * tl;dr we lazy load due to bugs on older browsers and eager load due to\n     * bugs on newer ones.\n     *\n     * https://bugzilla.mozilla.org/show_bug.cgi?id=1477090\n     *\n     * @private @const {boolean}\n     */\n    this.lazyFetch_ = !goog.inHtmlDocument_() ||\n        !('noModule' in goog.global.document.createElement('script'));\n  };\n  goog.inherits(goog.TransformedDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.TransformedDependency.prototype.load = function(controller) {\n    var dep = this;\n\n    function fetch() {\n      dep.contents_ = goog.loadFileSync_(dep.path);\n\n      if (dep.contents_) {\n        dep.contents_ = dep.transform(dep.contents_);\n        if (dep.contents_) {\n          dep.contents_ += '\\n//# sourceURL=' + dep.path;\n        }\n      }\n    }\n\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      fetch();\n      if (this.contents_ &&\n          goog.global.CLOSURE_IMPORT_SCRIPT('', this.contents_)) {\n        this.contents_ = null;\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n\n    var isEs6 = this.loadFlags['module'] == goog.ModuleType.ES6;\n\n    if (!this.lazyFetch_) {\n      fetch();\n    }\n\n    function load() {\n      if (dep.lazyFetch_) {\n        fetch();\n      }\n\n      if (!dep.contents_) {\n        // loadFileSync_ or transform are responsible. Assume they logged an\n        // error.\n        return;\n      }\n\n      if (isEs6) {\n        controller.setModuleState(goog.ModuleType.ES6);\n      }\n\n      var namespace;\n\n      try {\n        var contents = dep.contents_;\n        dep.contents_ = null;\n        goog.globalEval(goog.CLOSURE_EVAL_PREFILTER_.createScript(contents));\n        if (isEs6) {\n          namespace = goog.moduleLoaderState_.moduleName;\n        }\n      } finally {\n        if (isEs6) {\n          controller.clearModuleState();\n        }\n      }\n\n      if (isEs6) {\n        // Due to circular dependencies this may not be available for require\n        // right now.\n        goog.global['$jscomp']['require']['ensure'](\n            [dep.getPathName()], function() {\n              controller.registerEs6ModuleExports(\n                  dep.path,\n                  goog.global['$jscomp']['require'](dep.getPathName()),\n                  namespace);\n            });\n      }\n\n      controller.loaded();\n    }\n\n    // Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all\n    // events. If we fetched now and then document.write'd the contents the\n    // document.write would be an eval and would execute too soon! Instead write\n    // a script tag to fetch and eval synchronously at the correct time.\n    function fetchInOwnScriptThenLoad() {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      var key = goog.Dependency.registerCallback_(function() {\n        goog.Dependency.unregisterCallback_(key);\n        load();\n      });\n\n      var nonce = goog.getScriptNonce();\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script' + nonceAttr + '>' +\n          goog.protectScriptTag_('goog.Dependency.callback_(\"' + key + '\");') +\n          '</' +\n          'script>';\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    }\n\n    // If one thing is pending it is this.\n    var anythingElsePending = controller.pending().length > 1;\n\n    // If anything else is loading we need to lazy load due to bugs in old IE.\n    // Specifically script tags with src and script tags with contents could\n    // execute out of order if document.write is used, so we cannot use\n    // document.write. Do not pause here; it breaks old IE as well.\n    var useOldIeWorkAround =\n        anythingElsePending && goog.DebugLoader_.IS_OLD_IE_;\n\n    // Additionally if we are meant to defer scripts but the page is still\n    // loading (e.g. an ES6 module is loading) then also defer. Or if we are\n    // meant to defer and anything else is pending then defer (those may be\n    // scripts that did not need transformation and are just script tags with\n    // defer set to true, and we need to evaluate after that deferred script).\n    var needsAsyncLoading = goog.Dependency.defer_ &&\n        (anythingElsePending || goog.isDocumentLoading_());\n\n    if (useOldIeWorkAround || needsAsyncLoading) {\n      // Note that we only defer when we have to rather than 100% of the time.\n      // Always defering would work, but then in theory the order of\n      // goog.require calls would then matter. We want to enforce that most of\n      // the time the order of the require calls does not matter.\n      controller.defer(function() {\n        load();\n      });\n      return;\n    }\n    // TODO(johnplaisted): Externs are missing onreadystatechange for\n    // HTMLDocument.\n    /** @type {?} */\n    var doc = goog.global.document;\n\n    var isInternetExplorerOrEdge = goog.inHtmlDocument_() &&\n        ('ActiveXObject' in goog.global || goog.isEdge_());\n\n    // Don't delay in any version of IE or pre-Chromium Edge. There's a bug\n    // around this that will cause out of order script execution. This means\n    // that on older IE ES6 modules will load too early (while the document is\n    // still loading + the dom is not available). The other option is to load\n    // too late (when the document is complete and the onload even will never\n    // fire). This seems to be the lesser of two evils as scripts already act\n    // like the former.\n    if (isEs6 && goog.inHtmlDocument_() && goog.isDocumentLoading_() &&\n        !isInternetExplorerOrEdge) {\n      goog.Dependency.defer_ = true;\n      // Transpiled ES6 modules still need to load like regular ES6 modules,\n      // aka only after the document is interactive.\n      controller.pause();\n      var oldCallback = doc.onreadystatechange;\n      doc.onreadystatechange = function() {\n        if (doc.readyState == 'interactive') {\n          doc.onreadystatechange = oldCallback;\n          load();\n          controller.resume();\n        }\n        if (typeof oldCallback === 'function') {\n          oldCallback.apply(undefined, arguments);\n        }\n      };\n    } else {\n      // Always eval on old IE.\n      if (goog.DebugLoader_.IS_OLD_IE_ || !goog.inHtmlDocument_() ||\n          !goog.isDocumentLoading_()) {\n        load();\n      } else {\n        fetchInOwnScriptThenLoad();\n      }\n    }\n  };\n\n\n  /**\n   * @param {string} contents\n   * @return {string}\n   * @abstract\n   */\n  goog.TransformedDependency.prototype.transform = function(contents) {};\n\n\n  /**\n   * Any non-goog.module dependency which needs to be transpiled before eval.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @param {!goog.Transpiler} transpiler\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.TranspiledDependency = function(\n      path, relativePath, provides, requires, loadFlags, transpiler) {\n    goog.TranspiledDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @protected @const*/\n    this.transpiler = transpiler;\n  };\n  goog.inherits(goog.TranspiledDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.TranspiledDependency.prototype.transform = function(contents) {\n    // Transpile with the pathname so that ES6 modules are domain agnostic.\n    return this.transpiler.transpile(contents, this.getPathName());\n  };\n\n\n  /**\n   * An ES6 module dependency that was transpiled to a jscomp module outside\n   * of the debug loader, e.g. server side.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.PreTranspiledEs6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.PreTranspiledEs6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(\n      goog.PreTranspiledEs6ModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.PreTranspiledEs6ModuleDependency.prototype.transform = function(\n      contents) {\n    return contents;\n  };\n\n\n  /**\n   * A goog.module, transpiled or not. Will always perform some minimal\n   * transformation even when not transpiled to wrap in a goog.loadModule\n   * statement.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @param {boolean} needsTranspile\n   * @param {!goog.Transpiler} transpiler\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.GoogModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags, needsTranspile,\n      transpiler) {\n    goog.GoogModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @private @const */\n    this.needsTranspile_ = needsTranspile;\n    /** @private @const */\n    this.transpiler_ = transpiler;\n  };\n  goog.inherits(goog.GoogModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.GoogModuleDependency.prototype.transform = function(contents) {\n    if (this.needsTranspile_) {\n      contents = this.transpiler_.transpile(contents, this.getPathName());\n    }\n\n    if (!goog.LOAD_MODULE_USING_EVAL || goog.global.JSON === undefined) {\n      return '' +\n          'goog.loadModule(function(exports) {' +\n          '\"use strict\";' + contents +\n          '\\n' +  // terminate any trailing single line comment.\n          ';return exports' +\n          '});' +\n          '\\n//# sourceURL=' + this.path + '\\n';\n    } else {\n      return '' +\n          'goog.loadModule(' +\n          goog.global.JSON.stringify(\n              contents + '\\n//# sourceURL=' + this.path + '\\n') +\n          ');';\n    }\n  };\n\n\n  /**\n   * Whether the browser is IE9 or earlier, which needs special handling\n   * for deferred modules.\n   * @const @private {boolean}\n   */\n  goog.DebugLoader_.IS_OLD_IE_ = !!(\n      !goog.global.atob && goog.global.document && goog.global.document['all']);\n\n\n  /**\n   * @param {string} relPath\n   * @param {!Array<string>|undefined} provides\n   * @param {!Array<string>} requires\n   * @param {boolean|!Object<string>=} opt_loadFlags\n   * @see goog.addDependency\n   */\n  goog.DebugLoader_.prototype.addDependency = function(\n      relPath, provides, requires, opt_loadFlags) {\n    provides = provides || [];\n    relPath = relPath.replace(/\\\\/g, '/');\n    var path = goog.normalizePath_(goog.basePath + relPath);\n    if (!opt_loadFlags || typeof opt_loadFlags === 'boolean') {\n      opt_loadFlags = opt_loadFlags ? {'module': goog.ModuleType.GOOG} : {};\n    }\n    var dep = this.factory_.createDependency(\n        path, relPath, provides, requires, opt_loadFlags,\n        goog.transpiler_.needsTranspile(\n            opt_loadFlags['lang'] || 'es3', opt_loadFlags['module']));\n    this.dependencies_[path] = dep;\n    for (var i = 0; i < provides.length; i++) {\n      this.idToPath_[provides[i]] = path;\n    }\n    this.idToPath_[relPath] = path;\n  };\n\n\n  /**\n   * Creates goog.Dependency instances for the debug loader to load.\n   *\n   * Should be overridden to have the debug loader use custom subclasses of\n   * goog.Dependency.\n   *\n   * @param {!goog.Transpiler} transpiler\n   * @struct @constructor\n   */\n  goog.DependencyFactory = function(transpiler) {\n    /** @protected @const */\n    this.transpiler = transpiler;\n  };\n\n\n  /**\n   * @param {string} path Absolute path of the file.\n   * @param {string} relativePath Path relative to closure\u2019s base.js.\n   * @param {!Array<string>} provides Array of provided goog.provide/module ids.\n   * @param {!Array<string>} requires Array of required goog.provide/module /\n   *     relative ES6 module paths.\n   * @param {!Object<string, string>} loadFlags\n   * @param {boolean} needsTranspile True if the file needs to be transpiled\n   *     per the goog.Transpiler.\n   * @return {!goog.Dependency}\n   */\n  goog.DependencyFactory.prototype.createDependency = function(\n      path, relativePath, provides, requires, loadFlags, needsTranspile) {\n\n    if (loadFlags['module'] == goog.ModuleType.GOOG) {\n      return new goog.GoogModuleDependency(\n          path, relativePath, provides, requires, loadFlags, needsTranspile,\n          this.transpiler);\n    } else if (needsTranspile) {\n      return new goog.TranspiledDependency(\n          path, relativePath, provides, requires, loadFlags, this.transpiler);\n    } else {\n      if (loadFlags['module'] == goog.ModuleType.ES6) {\n        if (goog.TRANSPILE == 'never' && goog.ASSUME_ES_MODULES_TRANSPILED) {\n          return new goog.PreTranspiledEs6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        } else {\n          return new goog.Es6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        }\n      } else {\n        return new goog.Dependency(\n            path, relativePath, provides, requires, loadFlags);\n      }\n    }\n  };\n\n\n  /** @private @const */\n  goog.debugLoader_ = new goog.DebugLoader_();\n\n\n  /**\n   * Loads the Closure Dependency file.\n   *\n   * Exposed a public function so CLOSURE_NO_DEPS can be set to false, base\n   * loaded, setDependencyFactory called, and then this called. i.e. allows\n   * custom loading of the deps file.\n   */\n  goog.loadClosureDeps = function() {\n    goog.debugLoader_.loadClosureDeps();\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * Note: if you wish to call this function and provide your own implemnetation\n   * it is a wise idea to set CLOSURE_NO_DEPS to true, otherwise the dependency\n   * file and all of its goog.addDependency calls will use the default factory.\n   * You can call goog.loadClosureDeps to load the Closure dependency file\n   * later, after your factory is injected.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.setDependencyFactory = function(factory) {\n    goog.debugLoader_.setDependencyFactory(factory);\n  };\n\n\n  /**\n   * Trusted Types policy for the debug loader.\n   * @private @const {?TrustedTypePolicy}\n   */\n  goog.TRUSTED_TYPES_POLICY_ = goog.TRUSTED_TYPES_POLICY_NAME ?\n      goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME + '#base') :\n      null;\n\n  if (!goog.global.CLOSURE_NO_DEPS) {\n    goog.debugLoader_.loadClosureDeps();\n  }\n\n\n  /**\n   * Bootstraps the given namespaces and calls the callback once they are\n   * available either via goog.require. This is a replacement for using\n   * `goog.require` to bootstrap Closure JavaScript. Previously a `goog.require`\n   * in an HTML file would guarantee that the require'd namespace was available\n   * in the next immediate script tag. With ES6 modules this no longer a\n   * guarantee.\n   *\n   * @param {!Array<string>} namespaces\n   * @param {function(): ?} callback Function to call once all the namespaces\n   *     have loaded. Always called asynchronously.\n   */\n  goog.bootstrap = function(namespaces, callback) {\n    goog.debugLoader_.bootstrap(namespaces, callback);\n  };\n}\n\n\nif (!COMPILED) {\n  var isChrome87 = false;\n  // Cannot run check for Chrome <87 bug in case of strict CSP environments.\n  // TODO(user): Remove once Chrome <87 bug is no longer a problem.\n  try {\n    isChrome87 = eval(goog.global.trustedTypes.emptyScript) !==\n        goog.global.trustedTypes.emptyScript;\n  } catch (err) {\n  }\n\n  /**\n   * Trusted Types for running dev servers.\n   *\n   * @private @const\n   */\n  goog.CLOSURE_EVAL_PREFILTER_ =\n      // Detect Chrome <87 bug with TT and eval.\n      goog.global.trustedTypes && isChrome87 &&\n          goog.createTrustedTypesPolicy('goog#base#devonly#eval') ||\n      {createScript: goog.identity_};\n}\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implements the disposable interface.\n */\n\ngoog.provide('goog.Disposable');\n\ngoog.require('goog.disposable.IDisposable');\ngoog.require('goog.dispose');\n/**\n * TODO(user): Remove this require.\n * @suppress {extraRequire}\n */\ngoog.require('goog.disposeAll');\n\n/**\n * Class that provides the basic implementation for disposable objects. If your\n * class holds references or resources that can't be collected by standard GC,\n * it should extend this class or implement the disposable interface (defined\n * in goog.disposable.IDisposable). See description of\n * goog.disposable.IDisposable for examples of cleanup.\n * @constructor\n * @implements {goog.disposable.IDisposable}\n */\ngoog.Disposable = function() {\n  'use strict';\n  /**\n   * If monitoring the goog.Disposable instances is enabled, stores the creation\n   * stack trace of the Disposable instance.\n   * @type {string|undefined}\n   */\n  this.creationStack;\n\n  if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n    if (goog.Disposable.INCLUDE_STACK_ON_CREATION) {\n      this.creationStack = new Error().stack;\n    }\n    goog.Disposable.instances_[goog.getUid(this)] = this;\n  }\n  // Support sealing\n  this.disposed_ = this.disposed_;\n  this.onDisposeCallbacks_ = this.onDisposeCallbacks_;\n};\n\n\n/**\n * @enum {number} Different monitoring modes for Disposable.\n */\ngoog.Disposable.MonitoringMode = {\n  /**\n   * No monitoring.\n   */\n  OFF: 0,\n  /**\n   * Creating and disposing the goog.Disposable instances is monitored. All\n   * disposable objects need to call the `goog.Disposable` base\n   * constructor. The PERMANENT mode must be switched on before creating any\n   * goog.Disposable instances.\n   */\n  PERMANENT: 1,\n  /**\n   * INTERACTIVE mode can be switched on and off on the fly without producing\n   * errors. It also doesn't warn if the disposable objects don't call the\n   * `goog.Disposable` base constructor.\n   */\n  INTERACTIVE: 2\n};\n\n\n/**\n * @define {number} The monitoring mode of the goog.Disposable\n *     instances. Default is OFF. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\ngoog.Disposable.MONITORING_MODE =\n    goog.define('goog.Disposable.MONITORING_MODE', 0);\n\n\n/**\n * @define {boolean} Whether to attach creation stack to each created disposable\n *     instance; This is only relevant for when MonitoringMode != OFF.\n */\ngoog.Disposable.INCLUDE_STACK_ON_CREATION =\n    goog.define('goog.Disposable.INCLUDE_STACK_ON_CREATION', true);\n\n\n/**\n * Maps the unique ID of every undisposed `goog.Disposable` object to\n * the object itself.\n * @type {!Object<number, !goog.Disposable>}\n * @private\n */\ngoog.Disposable.instances_ = {};\n\n\n/**\n * @return {!Array<!goog.Disposable>} All `goog.Disposable` objects that\n *     haven't been disposed of.\n */\ngoog.Disposable.getUndisposedObjects = function() {\n  'use strict';\n  var ret = [];\n  for (var id in goog.Disposable.instances_) {\n    if (goog.Disposable.instances_.hasOwnProperty(id)) {\n      ret.push(goog.Disposable.instances_[Number(id)]);\n    }\n  }\n  return ret;\n};\n\n\n/**\n * Clears the registry of undisposed objects but doesn't dispose of them.\n */\ngoog.Disposable.clearUndisposedObjects = function() {\n  'use strict';\n  goog.Disposable.instances_ = {};\n};\n\n\n/**\n * Whether the object has been disposed of.\n * @type {boolean}\n * @private\n */\ngoog.Disposable.prototype.disposed_ = false;\n\n\n/**\n * Callbacks to invoke when this object is disposed.\n * @type {Array<!Function>}\n * @private\n */\ngoog.Disposable.prototype.onDisposeCallbacks_;\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @override\n */\ngoog.Disposable.prototype.isDisposed = function() {\n  'use strict';\n  return this.disposed_;\n};\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @deprecated Use {@link #isDisposed} instead.\n */\ngoog.Disposable.prototype.getDisposed = goog.Disposable.prototype.isDisposed;\n\n\n/**\n * Disposes of the object. If the object hasn't already been disposed of, calls\n * {@link #disposeInternal}. Classes that extend `goog.Disposable` should\n * override {@link #disposeInternal} in order to cleanup references, resources\n * and other disposable objects. Reentrant.\n *\n * @return {void} Nothing.\n * @override\n */\ngoog.Disposable.prototype.dispose = function() {\n  'use strict';\n  if (!this.disposed_) {\n    // Set disposed_ to true first, in case during the chain of disposal this\n    // gets disposed recursively.\n    this.disposed_ = true;\n    this.disposeInternal();\n    if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n      var uid = goog.getUid(this);\n      if (goog.Disposable.MONITORING_MODE ==\n              goog.Disposable.MonitoringMode.PERMANENT &&\n          !goog.Disposable.instances_.hasOwnProperty(uid)) {\n        throw new Error(\n            this + ' did not call the goog.Disposable base ' +\n            'constructor or was disposed of after a clearUndisposedObjects ' +\n            'call');\n      }\n      if (goog.Disposable.MONITORING_MODE !=\n              goog.Disposable.MonitoringMode.OFF &&\n          this.onDisposeCallbacks_ && this.onDisposeCallbacks_.length > 0) {\n        throw new Error(\n            this + ' did not empty its onDisposeCallbacks queue. This ' +\n            'probably means it overrode dispose() or disposeInternal() ' +\n            'without calling the superclass\\' method.');\n      }\n      delete goog.Disposable.instances_[uid];\n    }\n  }\n};\n\n\n/**\n * Associates a disposable object with this object so that they will be disposed\n * together.\n * @param {goog.disposable.IDisposable} disposable that will be disposed when\n *     this object is disposed.\n */\ngoog.Disposable.prototype.registerDisposable = function(disposable) {\n  'use strict';\n  this.addOnDisposeCallback(goog.partial(goog.dispose, disposable));\n};\n\n\n/**\n * Invokes a callback function when this object is disposed. Callbacks are\n * invoked in the order in which they were added. If a callback is added to\n * an already disposed Disposable, it will be called immediately.\n * @param {function(this:T):?} callback The callback function.\n * @param {T=} opt_scope An optional scope to call the callback in.\n * @template T\n */\ngoog.Disposable.prototype.addOnDisposeCallback = function(callback, opt_scope) {\n  'use strict';\n  if (this.disposed_) {\n    opt_scope !== undefined ? callback.call(opt_scope) : callback();\n    return;\n  }\n  if (!this.onDisposeCallbacks_) {\n    this.onDisposeCallbacks_ = [];\n  }\n\n  this.onDisposeCallbacks_.push(\n      opt_scope !== undefined ? goog.bind(callback, opt_scope) : callback);\n};\n\n\n/**\n * Performs appropriate cleanup. See description of goog.disposable.IDisposable\n * for examples. Classes that extend `goog.Disposable` should override this\n * method. Not reentrant. To avoid calling it twice, it must only be called from\n * the subclass' `disposeInternal` method. Everywhere else the public `dispose`\n * method must be used. For example:\n *\n * <pre>\n * mypackage.MyClass = function() {\n * mypackage.MyClass.base(this, 'constructor');\n *     // Constructor logic specific to MyClass.\n *     ...\n *   };\n *   goog.inherits(mypackage.MyClass, goog.Disposable);\n *\n *   mypackage.MyClass.prototype.disposeInternal = function() {\n *     // Dispose logic specific to MyClass.\n *     ...\n *     // Call superclass's disposeInternal at the end of the subclass's, like\n *     // in C++, to avoid hard-to-catch issues.\n *     mypackage.MyClass.base(this, 'disposeInternal');\n *   };\n * </pre>\n *\n * @protected\n */\ngoog.Disposable.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.onDisposeCallbacks_) {\n    while (this.onDisposeCallbacks_.length) {\n      this.onDisposeCallbacks_.shift()();\n    }\n  }\n};\n\n\n/**\n * Returns True if we can verify the object is disposed.\n * Calls `isDisposed` on the argument if it supports it.  If obj\n * is not an object with an isDisposed() method, return false.\n * @param {*} obj The object to investigate.\n * @return {boolean} True if we can verify the object is disposed.\n */\ngoog.Disposable.isDisposed = function(obj) {\n  'use strict';\n  if (obj && typeof obj.isDisposed == 'function') {\n    return obj.isDisposed();\n  }\n  return false;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating arrays.\n */\n\n\ngoog.module('goog.array');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\n\n\n/**\n * @define {boolean} NATIVE_ARRAY_PROTOTYPES indicates whether the code should\n * rely on Array.prototype functions, if available.\n *\n * The Array.prototype functions can be defined by external libraries like\n * Prototype and setting this flag to false forces closure to use its own\n * goog.array implementation.\n *\n * If your javascript can be loaded by a third party site and you are wary about\n * relying on the prototype functions, specify\n * \"--define goog.NATIVE_ARRAY_PROTOTYPES=false\" to the JSCompiler.\n *\n * Setting goog.TRUSTED_SITE to false will automatically set\n * NATIVE_ARRAY_PROTOTYPES to false.\n */\ngoog.NATIVE_ARRAY_PROTOTYPES =\n    goog.define('goog.NATIVE_ARRAY_PROTOTYPES', goog.TRUSTED_SITE);\n\n\n/**\n * @define {boolean} If true, JSCompiler will use the native implementation of\n * array functions where appropriate (e.g., `Array#filter`) and remove the\n * unused pure JS implementation.\n */\nconst ASSUME_NATIVE_FUNCTIONS = goog.define(\n    'goog.array.ASSUME_NATIVE_FUNCTIONS', goog.FEATURESET_YEAR > 2012);\nexports.ASSUME_NATIVE_FUNCTIONS = ASSUME_NATIVE_FUNCTIONS;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.last}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nfunction peek(array) {\n  return array[array.length - 1];\n}\nexports.peek = peek;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.peek}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nexports.last = peek;\n\n// NOTE(arv): Since most of the array functions are generic it allows you to\n// pass an array-like object. Strings have a length and are considered array-\n// like. However, the 'in' operator does not work on strings so we cannot just\n// use the array path even if the browser supports indexing into strings. We\n// therefore end up splitting the string.\n\n\n/**\n * Returns the index of the first element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-indexof}\n *\n * @param {IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at index 0.\n * @return {number} The index of the first matching array element.\n * @template T\n */\nconst indexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.indexOf.call(arr, obj, opt_fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      const fromIndex = opt_fromIndex == null ?\n          0 :\n          (opt_fromIndex < 0 ? Math.max(0, arr.length + opt_fromIndex) :\n                               opt_fromIndex);\n\n      if (typeof arr === 'string') {\n        // Array.prototype.indexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.indexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i < arr.length; i++) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.indexOf = indexOf;\n\n\n/**\n * Returns the index of the last element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-lastindexof}\n *\n * @param {!IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {?number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at the end of the array.\n * @return {number} The index of the last matching array element.\n * @template T\n */\nconst lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      // Firefox treats undefined and null as 0 in the fromIndex argument which\n      // leads it to always return -1\n      const fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n      return Array.prototype.lastIndexOf.call(arr, obj, fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      let fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n\n      if (fromIndex < 0) {\n        fromIndex = Math.max(0, arr.length + fromIndex);\n      }\n\n      if (typeof arr === 'string') {\n        // Array.prototype.lastIndexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.lastIndexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i >= 0; i--) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.lastIndexOf = lastIndexOf;\n\n\n/**\n * Calls a function for each element in an array. Skips holes in the array.\n * See {@link http://tinyurl.com/developer-mozilla-org-array-foreach}\n *\n * @param {IArrayLike<T>|string} arr Array or array like object over\n *     which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function takes 3 arguments (the element, the index and the\n *     array). The return value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @template T,S\n */\nconst forEach = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      Array.prototype.forEach.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n    };\nexports.forEach = forEach;\n\n\n/**\n * Calls a function for each element in an array, starting from the last\n * element rather than the first.\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function\n *     takes 3 arguments (the element, the index and the array). The return\n *     value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @template T,S\n */\nfunction forEachRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; --i) {\n    if (i in arr2) {\n      f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n    }\n  }\n}\nexports.forEachRight = forEachRight;\n\n\n/**\n * Calls a function for each element in an array, and if the function returns\n * true adds the element to a new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-filter}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?):boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and must\n *     return a Boolean. If the return value is true the element is added to the\n *     result array. If it is false the element is not included.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {!Array<T>} a new array in which only elements that passed the test\n *     are present.\n * @template T,S\n */\nconst filter = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.filter.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = [];\n      let resLength = 0;\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          const val = arr2[i];  // in case f mutates arr2\n          if (f.call(/** @type {?} */ (opt_obj), val, i, arr)) {\n            res[resLength++] = val;\n          }\n        }\n      }\n      return res;\n    };\nexports.filter = filter;\n\n\n/**\n * Calls a function for each element in an array and inserts the result into a\n * new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-map}\n *\n * @param {IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): RESULT} f The function to call\n *     for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return something. The result will be\n *     inserted into a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the results from f.\n * @template THIS, VALUE, RESULT\n */\nconst map = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.map.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = new Array(l);\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          res[i] = f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n      return res;\n    };\nexports.map = map;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduce}\n * Note that this implementation differs from the native Array.prototype.reduce\n * in that the initial value is assumed to be defined (the MDN docs linked above\n * recommend not omitting this parameter, although it is technically optional).\n *\n * For example:\n * var a = [1, 2, 3, 4];\n * reduce(a, function(r, v, i, arr) {return r + v;}, 0);\n * returns 10\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {R} Result of evaluating f repeatedly across the values of the array.\n * @template T,S,R\n */\nconst reduce = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      if (opt_obj) {\n        f = goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduce.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEach(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduce = reduce;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result,\n * starting from the last element and working towards the first.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduceright}\n *\n * For example:\n * var a = ['a', 'b', 'c'];\n * reduceRight(a, function(r, v, i, arr) {return r + v;}, '');\n * returns 'cba'\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {R} Object returned as a result of evaluating f repeatedly across the\n *     values of the array.\n * @template T,S,R\n */\nconst reduceRight = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      asserts.assert(f != null);\n      if (opt_obj) {\n        f = goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduceRight.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEachRight(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduceRight = reduceRight;\n\n\n/**\n * Calls f for each element of an array. If any call returns true, some()\n * returns true (without checking the remaining elements). If all calls\n * return false, some() returns false.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-some}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} true if any element passes the test.\n * @template T,S\n */\nconst some = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.some.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return true;\n        }\n      }\n      return false;\n    };\nexports.some = some;\n\n\n/**\n * Call f for each element of an array. If all calls return true, every()\n * returns true. If any call returns false, every() returns false and\n * does not continue to check the remaining elements.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-every}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} false if any element fails the test.\n * @template T,S\n */\nconst every = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.every.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && !f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return false;\n        }\n      }\n      return true;\n    };\nexports.every = every;\n\n\n/**\n * Counts the array elements that fulfill the predicate, i.e. for which the\n * callback function returns true. Skips holes in the array.\n *\n * @param {!IArrayLike<T>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this: S, T, number, ?): boolean} f The function to call for\n *     every element. Takes 3 arguments (the element, the index and the array).\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @return {number} The number of the matching elements.\n * @template T,S\n */\nfunction count(arr, f, opt_obj) {\n  let count = 0;\n  forEach(arr, function(element, index, arr) {\n    if (f.call(/** @type {?} */ (opt_obj), element, index, arr)) {\n      ++count;\n    }\n  }, opt_obj);\n  return count;\n}\nexports.count = count;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The first array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction find(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.find = find;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the first array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndex(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = 0; i < l; i++) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndex = findIndex;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The last array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction findRight(arr, f, opt_obj) {\n  const i = findIndexRight(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.findRight = findRight;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the last array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndexRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; i--) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndexRight = findIndexRight;\n\n\n/**\n * Whether the array contains the given object.\n * @param {IArrayLike<?>|string} arr The array to test for the presence of the\n *     element.\n * @param {*} obj The object for which to test.\n * @return {boolean} true if obj is present.\n */\nfunction contains(arr, obj) {\n  return indexOf(arr, obj) >= 0;\n}\nexports.contains = contains;\n\n\n/**\n * Whether the array is empty.\n * @param {IArrayLike<?>|string} arr The array to test.\n * @return {boolean} true if empty.\n */\nfunction isEmpty(arr) {\n  return arr.length == 0;\n}\nexports.isEmpty = isEmpty;\n\n\n/**\n * Clears the array.\n * @param {IArrayLike<?>} arr Array or array like object to clear.\n */\nfunction clear(arr) {\n  // For non real arrays we don't have the magic length so we delete the\n  // indices.\n  if (!Array.isArray(arr)) {\n    for (let i = arr.length - 1; i >= 0; i--) {\n      delete arr[i];\n    }\n  }\n  arr.length = 0;\n}\nexports.clear = clear;\n\n\n/**\n * Pushes an item into an array, if it's not already in the array.\n * @param {Array<T>} arr Array into which to insert the item.\n * @param {T} obj Value to add.\n * @template T\n */\nfunction insert(arr, obj) {\n  if (!contains(arr, obj)) {\n    arr.push(obj);\n  }\n}\nexports.insert = insert;\n\n\n/**\n * Inserts an object at the given index of the array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {*} obj The object to insert.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertAt(arr, obj, opt_i) {\n  splice(arr, opt_i, 0, obj);\n}\nexports.insertAt = insertAt;\n\n\n/**\n * Inserts at the given index of the array, all elements of another array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {IArrayLike<?>} elementsToAdd The array of elements to add.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertArrayAt(arr, elementsToAdd, opt_i) {\n  goog.partial(splice, arr, opt_i, 0).apply(null, elementsToAdd);\n}\nexports.insertArrayAt = insertArrayAt;\n\n\n/**\n * Inserts an object into an array before a specified object.\n * @param {Array<T>} arr The array to modify.\n * @param {T} obj The object to insert.\n * @param {T=} opt_obj2 The object before which obj should be inserted. If obj2\n *     is omitted or not found, obj is inserted at the end of the array.\n * @template T\n */\nfunction insertBefore(arr, obj, opt_obj2) {\n  let i;\n  if (arguments.length == 2 || (i = indexOf(arr, opt_obj2)) < 0) {\n    arr.push(obj);\n  } else {\n    insertAt(arr, obj, i);\n  }\n}\nexports.insertBefore = insertBefore;\n\n\n/**\n * Removes the first occurrence of a particular value from an array.\n * @param {IArrayLike<T>} arr Array from which to remove\n *     value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction remove(arr, obj) {\n  const i = indexOf(arr, obj);\n  let rv;\n  if ((rv = i >= 0)) {\n    removeAt(arr, i);\n  }\n  return rv;\n}\nexports.remove = remove;\n\n\n/**\n * Removes the last occurrence of a particular value from an array.\n * @param {!IArrayLike<T>} arr Array from which to remove value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction removeLast(arr, obj) {\n  const i = lastIndexOf(arr, obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeLast = removeLast;\n\n\n/**\n * Removes from an array the element at index i\n * @param {IArrayLike<?>} arr Array or array like object from which to\n *     remove value.\n * @param {number} i The index to remove.\n * @return {boolean} True if an element was removed.\n */\nfunction removeAt(arr, i) {\n  asserts.assert(arr.length != null);\n\n  // use generic form of splice\n  // splice returns the removed items and if successful the length of that\n  // will be 1\n  return Array.prototype.splice.call(arr, i, 1).length == 1;\n}\nexports.removeAt = removeAt;\n\n\n/**\n * Removes the first value that satisfies the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {boolean} True if an element was removed.\n * @template T,S\n */\nfunction removeIf(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeIf = removeIf;\n\n\n/**\n * Removes all values that satisfy the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The number of items removed\n * @template T,S\n */\nfunction removeAllIf(arr, f, opt_obj) {\n  let removedCount = 0;\n  forEachRight(arr, function(val, index) {\n    if (f.call(/** @type {?} */ (opt_obj), val, index, arr)) {\n      if (removeAt(arr, index)) {\n        removedCount++;\n      }\n    }\n  });\n  return removedCount;\n}\nexports.removeAllIf = removeAllIf;\n\n\n/**\n * Returns a new array that is the result of joining the arguments.  If arrays\n * are passed then their items are added, however, if non-arrays are passed they\n * will be added to the return array as is.\n *\n * Note that ArrayLike objects will be added as is, rather than having their\n * items added.\n *\n * concat([1, 2], [3, 4]) -> [1, 2, 3, 4]\n * concat(0, [1, 2]) -> [0, 1, 2]\n * concat([1, 2], null) -> [1, 2, null]\n *\n * There is bug in all current versions of IE (6, 7 and 8) where arrays created\n * in an iframe become corrupted soon (not immediately) after the iframe is\n * destroyed. This is common if loading data via goog.net.IframeIo, for example.\n * This corruption only affects the concat method which will start throwing\n * Catastrophic Errors (#-2147418113).\n *\n * See http://endoflow.com/scratch/corrupted-arrays.html for a test case.\n *\n * Internally goog.array should use this, so that all methods will continue to\n * work on these broken array objects.\n *\n * @param {...*} var_args Items to concatenate.  Arrays will have each item\n *     added, while primitives and objects will be added as is.\n * @return {!Array<?>} The new resultant array.\n */\nfunction concat(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.concat = concat;\n\n\n/**\n * Returns a new array that contains the contents of all the arrays passed.\n * @param {...!Array<T>} var_args\n * @return {!Array<T>}\n * @template T\n */\nfunction join(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.join = join;\n\n\n/**\n * Converts an object to an array.\n * @param {IArrayLike<T>|string} object  The object to convert to an\n *     array.\n * @return {!Array<T>} The object converted into an array. If object has a\n *     length property, every property indexed with a non-negative number\n *     less than length will be included in the result. If object does not\n *     have a length property, an empty array will be returned.\n * @template T\n */\nfunction toArray(object) {\n  const length = object.length;\n\n  // If length is not a number the following is false. This case is kept for\n  // backwards compatibility since there are callers that pass objects that are\n  // not array like.\n  if (length > 0) {\n    const rv = new Array(length);\n    for (let i = 0; i < length; i++) {\n      rv[i] = object[i];\n    }\n    return rv;\n  }\n  return [];\n}\nexports.toArray = toArray;\n\n\n/**\n * Does a shallow copy of an array.\n * @param {IArrayLike<T>|string} arr  Array or array-like object to\n *     clone.\n * @return {!Array<T>} Clone of the input array.\n * @template T\n */\nconst clone = toArray;\nexports.clone = clone;\n\n\n/**\n * Extends an array with another array, element, or \"array like\" object.\n * This function operates 'in-place', it does not create a new Array.\n *\n * Example:\n * var a = [];\n * extend(a, [0, 1]);\n * a; // [0, 1]\n * extend(a, 2);\n * a; // [0, 1, 2]\n *\n * @param {Array<VALUE>} arr1  The array to modify.\n * @param {...(IArrayLike<VALUE>|VALUE)} var_args The elements or arrays of\n *     elements to add to arr1.\n * @template VALUE\n */\nfunction extend(arr1, var_args) {\n  for (let i = 1; i < arguments.length; i++) {\n    const arr2 = arguments[i];\n    if (goog.isArrayLike(arr2)) {\n      const len1 = arr1.length || 0;\n      const len2 = arr2.length || 0;\n      arr1.length = len1 + len2;\n      for (let j = 0; j < len2; j++) {\n        arr1[len1 + j] = arr2[j];\n      }\n    } else {\n      arr1.push(arr2);\n    }\n  }\n}\nexports.extend = extend;\n\n\n/**\n * Adds or removes elements from an array. This is a generic version of Array\n * splice. This means that it might work on other objects similar to arrays,\n * such as the arguments object.\n *\n * @param {IArrayLike<T>} arr The array to modify.\n * @param {number|undefined} index The index at which to start changing the\n *     array. If not defined, treated as 0.\n * @param {number} howMany How many elements to remove (0 means no removal. A\n *     value below 0 is treated as zero and so is any other non number. Numbers\n *     are floored).\n * @param {...T} var_args Optional, additional elements to insert into the\n *     array.\n * @return {!Array<T>} the removed elements.\n * @template T\n */\nfunction splice(arr, index, howMany, var_args) {\n  asserts.assert(arr.length != null);\n\n  return Array.prototype.splice.apply(arr, slice(arguments, 1));\n}\nexports.splice = splice;\n\n\n/**\n * Returns a new array from a segment of an array. This is a generic version of\n * Array slice. This means that it might work on other objects similar to\n * arrays, such as the arguments object.\n *\n * @param {IArrayLike<T>|string} arr The array from\n * which to copy a segment.\n * @param {number} start The index of the first element to copy.\n * @param {number=} opt_end The index after the last element to copy.\n * @return {!Array<T>} A new array containing the specified segment of the\n *     original array.\n * @template T\n */\nfunction slice(arr, start, opt_end) {\n  asserts.assert(arr.length != null);\n\n  // passing 1 arg to slice is not the same as passing 2 where the second is\n  // null or undefined (in that case the second argument is treated as 0).\n  // we could use slice on the arguments object and then use apply instead of\n  // testing the length\n  if (arguments.length <= 2) {\n    return Array.prototype.slice.call(arr, start);\n  } else {\n    return Array.prototype.slice.call(arr, start, opt_end);\n  }\n}\nexports.slice = slice;\n\n\n/**\n * Removes all duplicates from an array (retaining only the first\n * occurrence of each array element).  This function modifies the\n * array in place and doesn't change the order of the non-duplicate items.\n *\n * For objects, duplicates are identified as having the same unique ID as\n * defined by {@link goog.getUid}.\n *\n * Alternatively you can specify a custom hash function that returns a unique\n * value for each item in the array it should consider unique.\n *\n * Runtime: N,\n * Worstcase space: 2N (no dupes)\n *\n * @param {IArrayLike<T>} arr The array from which to remove\n *     duplicates.\n * @param {Array=} opt_rv An optional array in which to return the results,\n *     instead of performing the removal inplace.  If specified, the original\n *     array will remain unchanged.\n * @param {function(T):string=} opt_hashFn An optional function to use to\n *     apply to every item in the array. This function should return a unique\n *     value for each item in the array it should consider unique.\n * @template T\n */\nfunction removeDuplicates(arr, opt_rv, opt_hashFn) {\n  const returnArray = opt_rv || arr;\n  const defaultHashFn = function(item) {\n    // Prefix each type with a single character representing the type to\n    // prevent conflicting keys (e.g. true and 'true').\n    return goog.isObject(item) ? 'o' + goog.getUid(item) :\n                                 (typeof item).charAt(0) + item;\n  };\n  const hashFn = opt_hashFn || defaultHashFn;\n\n  let cursorInsert = 0;\n  let cursorRead = 0;\n  const seen = {};\n\n  while (cursorRead < arr.length) {\n    const current = arr[cursorRead++];\n    const key = hashFn(current);\n    if (!Object.prototype.hasOwnProperty.call(seen, key)) {\n      seen[key] = true;\n      returnArray[cursorInsert++] = current;\n    }\n  }\n  returnArray.length = cursorInsert;\n}\nexports.removeDuplicates = removeDuplicates;\n\n\n/**\n * Searches the specified array for the specified target using the binary\n * search algorithm.  If no opt_compareFn is specified, elements are compared\n * using <code>defaultCompare</code>, which compares the elements\n * using the built in < and > operators.  This will produce the expected\n * behavior for homogeneous arrays of String(s) and Number(s). The array\n * specified <b>must</b> be sorted in ascending order (as defined by the\n * comparison function).  If the array is not sorted, results are undefined.\n * If the array contains multiple instances of the specified target value, the\n * left-most instance will be found.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {TARGET} target The sought value.\n * @param {function(TARGET, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, the target value and an element from your array, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @template TARGET, VALUE\n */\nfunction binarySearch(arr, target, opt_compareFn) {\n  return binarySearch_(\n      arr, opt_compareFn || defaultCompare, false /* isEvaluator */, target);\n}\nexports.binarySearch = binarySearch;\n\n\n/**\n * Selects an index in the specified array using the binary search algorithm.\n * The evaluator receives an element and determines whether the desired index\n * is before, at, or after it.  The evaluator must be consistent (formally,\n * map(map(arr, evaluator, opt_obj), goog.math.sign)\n * must be monotonically non-increasing).\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {function(this:THIS, VALUE, number, ?): number} evaluator\n *     Evaluator function that receives 3 arguments (the element, the index and\n *     the array). Should return a negative number, zero, or a positive number\n *     depending on whether the desired index is before, at, or after the\n *     element passed to it.\n * @param {THIS=} opt_obj The object to be used as the value of 'this'\n *     within evaluator.\n * @return {number} Index of the leftmost element matched by the evaluator, if\n *     such exists; otherwise (-(insertion point) - 1). The insertion point is\n *     the index of the first element for which the evaluator returns negative,\n *     or arr.length if no such element exists. The return value is non-negative\n *     iff a match is found.\n * @template THIS, VALUE\n */\nfunction binarySelect(arr, evaluator, opt_obj) {\n  return binarySearch_(\n      arr, evaluator, true /* isEvaluator */, undefined /* opt_target */,\n      opt_obj);\n}\nexports.binarySelect = binarySelect;\n\n\n/**\n * Implementation of a binary search algorithm which knows how to use both\n * comparison functions and evaluators. If an evaluator is provided, will call\n * the evaluator with the given optional data object, conforming to the\n * interface defined in binarySelect. Otherwise, if a comparison function is\n * provided, will call the comparison function against the given data object.\n *\n * This implementation purposefully does not use goog.bind or goog.partial for\n * performance reasons.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<?>} arr The array to be searched.\n * @param {function(?, ?, ?): number | function(?, ?): number} compareFn\n *     Either an evaluator or a comparison function, as defined by binarySearch\n *     and binarySelect above.\n * @param {boolean} isEvaluator Whether the function is an evaluator or a\n *     comparison function.\n * @param {?=} opt_target If the function is a comparison function, then\n *     this is the target to binary search for.\n * @param {Object=} opt_selfObj If the function is an evaluator, this is an\n *     optional this object for the evaluator.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @private\n */\nfunction binarySearch_(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {\n  let left = 0;            // inclusive\n  let right = arr.length;  // exclusive\n  let found;\n  while (left < right) {\n    const middle = left + ((right - left) >>> 1);\n    let compareResult;\n    if (isEvaluator) {\n      compareResult = compareFn.call(opt_selfObj, arr[middle], middle, arr);\n    } else {\n      // NOTE(dimvar): To avoid this cast, we'd have to use function overloading\n      // for the type of binarySearch_, which the type system can't express yet.\n      compareResult = /** @type {function(?, ?): number} */ (compareFn)(\n          opt_target, arr[middle]);\n    }\n    if (compareResult > 0) {\n      left = middle + 1;\n    } else {\n      right = middle;\n      // We are looking for the lowest index so we can't return immediately.\n      found = !compareResult;\n    }\n  }\n  // left is the index if found, or the insertion point otherwise.\n  // Avoiding bitwise not operator, as that causes a loss in precision for array\n  // indexes outside the bounds of a 32-bit signed integer.  Array indexes have\n  // a maximum value of 2^32-2 https://tc39.es/ecma262/#array-index\n  return found ? left : -left - 1;\n}\n\n\n/**\n * Sorts the specified array into ascending order.  If no opt_compareFn is\n * specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s), unlike the native sort,\n * but will give unpredictable results for heterogeneous lists of strings and\n * numbers with different numbers of digits.\n *\n * This sort is not guaranteed to be stable.\n *\n * Runtime: Same as `Array.prototype.sort`\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T,T):number=} opt_compareFn Optional comparison\n *     function by which the\n *     array is to be ordered. Should take 2 arguments to compare, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @template T\n */\nfunction sort(arr, opt_compareFn) {\n  // TODO(arv): Update type annotation since null is not accepted.\n  arr.sort(opt_compareFn || defaultCompare);\n}\nexports.sort = sort;\n\n\n/**\n * Sorts the specified array into ascending order in a stable way.  If no\n * opt_compareFn is specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s).\n *\n * Runtime: Same as `Array.prototype.sort`, plus an additional\n * O(n) overhead of copying the array twice.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T, T): number=} opt_compareFn Optional comparison function\n *     by which the array is to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T\n */\nfunction stableSort(arr, opt_compareFn) {\n  const compArr = new Array(arr.length);\n  for (let i = 0; i < arr.length; i++) {\n    compArr[i] = {index: i, value: arr[i]};\n  }\n  const valueCompareFn = opt_compareFn || defaultCompare;\n  function stableCompareFn(obj1, obj2) {\n    return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index;\n  }\n  sort(compArr, stableCompareFn);\n  for (let i = 0; i < arr.length; i++) {\n    arr[i] = compArr[i].value;\n  }\n}\nexports.stableSort = stableSort;\n\n\n/**\n * Sort the specified array into ascending order based on item keys\n * returned by the specified key function.\n * If no opt_compareFn is specified, the keys are compared in ascending order\n * using <code>defaultCompare</code>.\n *\n * Runtime: O(S(f(n)), where S is runtime of <code>sort</code>\n * and f(n) is runtime of the key function.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {function(T): K} keyFn Function taking array element and returning\n *     a key used for sorting this element.\n * @param {?function(K, K): number=} opt_compareFn Optional comparison function\n *     by which the keys are to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T,K\n */\nfunction sortByKey(arr, keyFn, opt_compareFn) {\n  const keyCompareFn = opt_compareFn || defaultCompare;\n  sort(arr, function(a, b) {\n    return keyCompareFn(keyFn(a), keyFn(b));\n  });\n}\nexports.sortByKey = sortByKey;\n\n\n/**\n * Sorts an array of objects by the specified object key and compare\n * function. If no compare function is provided, the key values are\n * compared in ascending order using <code>defaultCompare</code>.\n * This won't work for keys that get renamed by the compiler. So use\n * {'foo': 1, 'bar': 2} rather than {foo: 1, bar: 2}.\n * @param {Array<Object>} arr An array of objects to sort.\n * @param {string} key The object key to sort by.\n * @param {Function=} opt_compareFn The function to use to compare key\n *     values.\n */\nfunction sortObjectsByKey(arr, key, opt_compareFn) {\n  sortByKey(arr, function(obj) {\n    return obj[key];\n  }, opt_compareFn);\n}\nexports.sortObjectsByKey = sortObjectsByKey;\n\n\n/**\n * Tells if the array is sorted.\n * @param {!IArrayLike<T>} arr The array.\n * @param {?function(T,T):number=} opt_compareFn Function to compare the\n *     array elements.\n *     Should take 2 arguments to compare, and return a negative number, zero,\n *     or a positive number depending on whether the first argument is less\n *     than, equal to, or greater than the second.\n * @param {boolean=} opt_strict If true no equal elements are allowed.\n * @return {boolean} Whether the array is sorted.\n * @template T\n */\nfunction isSorted(arr, opt_compareFn, opt_strict) {\n  const compare = opt_compareFn || defaultCompare;\n  for (let i = 1; i < arr.length; i++) {\n    const compareResult = compare(arr[i - 1], arr[i]);\n    if (compareResult > 0 || compareResult == 0 && opt_strict) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.isSorted = isSorted;\n\n\n/**\n * Compares two arrays for equality. Two arrays are considered equal if they\n * have the same length and their corresponding elements are equal according to\n * the comparison function.\n *\n * @param {IArrayLike<A>} arr1 The first array to compare.\n * @param {IArrayLike<B>} arr2 The second array to compare.\n * @param {?function(A,B):boolean=} opt_equalsFn Optional comparison function.\n *     Should take 2 arguments to compare, and return true if the arguments\n *     are equal. Defaults to {@link goog.array.defaultCompareEquality} which\n *     compares the elements using the built-in '===' operator.\n * @return {boolean} Whether the two arrays are equal.\n * @template A\n * @template B\n */\nfunction equals(arr1, arr2, opt_equalsFn) {\n  if (!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) ||\n      arr1.length != arr2.length) {\n    return false;\n  }\n  const l = arr1.length;\n  const equalsFn = opt_equalsFn || defaultCompareEquality;\n  for (let i = 0; i < l; i++) {\n    if (!equalsFn(arr1[i], arr2[i])) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.equals = equals;\n\n\n/**\n * 3-way array compare function.\n * @param {!IArrayLike<VALUE>} arr1 The first array to\n *     compare.\n * @param {!IArrayLike<VALUE>} arr2 The second array to\n *     compare.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is to be ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {number} Negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template VALUE\n */\nfunction compare3(arr1, arr2, opt_compareFn) {\n  const compare = opt_compareFn || defaultCompare;\n  const l = Math.min(arr1.length, arr2.length);\n  for (let i = 0; i < l; i++) {\n    const result = compare(arr1[i], arr2[i]);\n    if (result != 0) {\n      return result;\n    }\n  }\n  return defaultCompare(arr1.length, arr2.length);\n}\nexports.compare3 = compare3;\n\n\n/**\n * Compares its two arguments for order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is less than, equal to, or greater than the second,\n *     respectively.\n * @template VALUE\n */\nfunction defaultCompare(a, b) {\n  return a > b ? 1 : a < b ? -1 : 0;\n}\nexports.defaultCompare = defaultCompare;\n\n\n/**\n * Compares its two arguments for inverse order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is greater than, equal to, or less than the second,\n *     respectively.\n * @template VALUE\n */\nfunction inverseDefaultCompare(a, b) {\n  return -defaultCompare(a, b);\n}\nexports.inverseDefaultCompare = inverseDefaultCompare;\n\n\n/**\n * Compares its two arguments for equality, using the built in === operator.\n * @param {*} a The first object to compare.\n * @param {*} b The second object to compare.\n * @return {boolean} True if the two arguments are equal, false otherwise.\n */\nfunction defaultCompareEquality(a, b) {\n  return a === b;\n}\nexports.defaultCompareEquality = defaultCompareEquality;\n\n\n/**\n * Inserts a value into a sorted array. The array is not modified if the\n * value is already present.\n * @param {IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to insert.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was inserted.\n * @template VALUE\n */\nfunction binaryInsert(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  if (index < 0) {\n    insertAt(array, value, -(index + 1));\n    return true;\n  }\n  return false;\n}\nexports.binaryInsert = binaryInsert;\n\n\n/**\n * Removes a value from a sorted array.\n * @param {!IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to remove.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was removed.\n * @template VALUE\n */\nfunction binaryRemove(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  return (index >= 0) ? removeAt(array, index) : false;\n}\nexports.binaryRemove = binaryRemove;\n\n\n/**\n * Splits an array into disjoint buckets according to a splitting function.\n * @param {IArrayLike<T>} array The array.\n * @param {function(this:S, T, number, !IArrayLike<T>):?} sorter Function to\n *     call for every element.  This takes 3 arguments (the element, the index\n *     and the array) and must return a valid object key (a string, number,\n *     etc), or undefined, if that object should not be placed in a bucket.\n * @param {S=} opt_obj The object to be used as the value of 'this' within\n *     sorter.\n * @return {!Object<!Array<T>>} An object, with keys being all of the unique\n *     return values of sorter, and values being arrays containing the items for\n *     which the splitter returned that key.\n * @template T,S\n */\nfunction bucket(array, sorter, opt_obj) {\n  const buckets = {};\n\n  for (let i = 0; i < array.length; i++) {\n    const value = array[i];\n    const key = sorter.call(/** @type {?} */ (opt_obj), value, i, array);\n    if (key !== undefined) {\n      // Push the value to the right bucket, creating it if necessary.\n      const bucket = buckets[key] || (buckets[key] = []);\n      bucket.push(value);\n    }\n  }\n\n  return buckets;\n}\nexports.bucket = bucket;\n\n\n/**\n * Creates a new object built from the provided array and the key-generation\n * function.\n * @param {IArrayLike<T>} arr Array or array like object over\n *     which to iterate whose elements will be the values in the new object.\n * @param {?function(this:S, T, number, ?) : string} keyFunc The function to\n *     call for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a string that will be used as the\n *     key for the element in the new object. If the function returns the same\n *     key for more than one element, the value for that key is\n *     implementation-defined.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within keyFunc.\n * @return {!Object<T>} The new object.\n * @template T,S\n */\nfunction toObject(arr, keyFunc, opt_obj) {\n  const ret = {};\n  forEach(arr, function(element, index) {\n    ret[keyFunc.call(/** @type {?} */ (opt_obj), element, index, arr)] =\n        element;\n  });\n  return ret;\n}\nexports.toObject = toObject;\n\n\n/**\n * Creates a range of numbers in an arithmetic progression.\n *\n * Range takes 1, 2, or 3 arguments:\n * <pre>\n * range(5) is the same as range(0, 5, 1) and produces [0, 1, 2, 3, 4]\n * range(2, 5) is the same as range(2, 5, 1) and produces [2, 3, 4]\n * range(-2, -5, -1) produces [-2, -3, -4]\n * range(-2, -5, 1) produces [], since stepping by 1 wouldn't ever reach -5.\n * </pre>\n *\n * @param {number} startOrEnd The starting value of the range if an end argument\n *     is provided. Otherwise, the start value is 0, and this is the end value.\n * @param {number=} opt_end The optional end value of the range.\n * @param {number=} opt_step The step size between range values. Defaults to 1\n *     if opt_step is undefined or 0.\n * @return {!Array<number>} An array of numbers for the requested range. May be\n *     an empty array if adding the step would not converge toward the end\n *     value.\n */\nfunction range(startOrEnd, opt_end, opt_step) {\n  const array = [];\n  let start = 0;\n  let end = startOrEnd;\n  const step = opt_step || 1;\n  if (opt_end !== undefined) {\n    start = startOrEnd;\n    end = opt_end;\n  }\n\n  if (step * (end - start) < 0) {\n    // Sign mismatch: start + step will never reach the end value.\n    return [];\n  }\n\n  if (step > 0) {\n    for (let i = start; i < end; i += step) {\n      array.push(i);\n    }\n  } else {\n    for (let i = start; i > end; i += step) {\n      array.push(i);\n    }\n  }\n  return array;\n}\nexports.range = range;\n\n\n/**\n * Returns an array consisting of the given value repeated N times.\n *\n * @param {VALUE} value The value to repeat.\n * @param {number} n The repeat count.\n * @return {!Array<VALUE>} An array with the repeated value.\n * @template VALUE\n */\nfunction repeat(value, n) {\n  const array = [];\n  for (let i = 0; i < n; i++) {\n    array[i] = value;\n  }\n  return array;\n}\nexports.repeat = repeat;\n\n\n/**\n * Returns an array consisting of every argument with all arrays\n * expanded in-place recursively.\n *\n * @param {...*} var_args The values to flatten.\n * @return {!Array<?>} An array containing the flattened values.\n */\nfunction flatten(var_args) {\n  const CHUNK_SIZE = 8192;\n\n  const result = [];\n  for (let i = 0; i < arguments.length; i++) {\n    const element = arguments[i];\n    if (Array.isArray(element)) {\n      for (let c = 0; c < element.length; c += CHUNK_SIZE) {\n        const chunk = slice(element, c, c + CHUNK_SIZE);\n        const recurseResult = flatten.apply(null, chunk);\n        for (let r = 0; r < recurseResult.length; r++) {\n          result.push(recurseResult[r]);\n        }\n      }\n    } else {\n      result.push(element);\n    }\n  }\n  return result;\n}\nexports.flatten = flatten;\n\n\n/**\n * Rotates an array in-place. After calling this method, the element at\n * index i will be the element previously at index (i - n) %\n * array.length, for all values of i between 0 and array.length - 1,\n * inclusive.\n *\n * For example, suppose list comprises [t, a, n, k, s]. After invoking\n * rotate(array, 1) (or rotate(array, -4)), array will comprise [s, t, a, n, k].\n *\n * @param {!Array<T>} array The array to rotate.\n * @param {number} n The amount to rotate.\n * @return {!Array<T>} The array.\n * @template T\n */\nfunction rotate(array, n) {\n  asserts.assert(array.length != null);\n\n  if (array.length) {\n    n %= array.length;\n    if (n > 0) {\n      Array.prototype.unshift.apply(array, array.splice(-n, n));\n    } else if (n < 0) {\n      Array.prototype.push.apply(array, array.splice(0, -n));\n    }\n  }\n  return array;\n}\nexports.rotate = rotate;\n\n\n/**\n * Moves one item of an array to a new position keeping the order of the rest\n * of the items. Example use case: keeping a list of JavaScript objects\n * synchronized with the corresponding list of DOM elements after one of the\n * elements has been dragged to a new position.\n * @param {!IArrayLike<?>} arr The array to modify.\n * @param {number} fromIndex Index of the item to move between 0 and\n *     `arr.length - 1`.\n * @param {number} toIndex Target index between 0 and `arr.length - 1`.\n */\nfunction moveItem(arr, fromIndex, toIndex) {\n  asserts.assert(fromIndex >= 0 && fromIndex < arr.length);\n  asserts.assert(toIndex >= 0 && toIndex < arr.length);\n  // Remove 1 item at fromIndex.\n  const removedItems = Array.prototype.splice.call(arr, fromIndex, 1);\n  // Insert the removed item at toIndex.\n  Array.prototype.splice.call(arr, toIndex, 0, removedItems[0]);\n  // We don't use goog.array.insertAt and goog.array.removeAt, because they're\n  // significantly slower than splice.\n}\nexports.moveItem = moveItem;\n\n\n/**\n * Creates a new array for which the element at position i is an array of the\n * ith element of the provided arrays.  The returned array will only be as long\n * as the shortest array provided; additional values are ignored.  For example,\n * the result of zipping [1, 2] and [3, 4, 5] is [[1,3], [2, 4]].\n *\n * This is similar to the zip() function in Python.  See {@link\n * http://docs.python.org/library/functions.html#zip}\n *\n * @param {...!IArrayLike<?>} var_args Arrays to be combined.\n * @return {!Array<!Array<?>>} A new array of arrays created from\n *     provided arrays.\n */\nfunction zip(var_args) {\n  if (!arguments.length) {\n    return [];\n  }\n  const result = [];\n  let minLen = arguments[0].length;\n  for (let i = 1; i < arguments.length; i++) {\n    if (arguments[i].length < minLen) {\n      minLen = arguments[i].length;\n    }\n  }\n  for (let i = 0; i < minLen; i++) {\n    const value = [];\n    for (let j = 0; j < arguments.length; j++) {\n      value.push(arguments[j][i]);\n    }\n    result.push(value);\n  }\n  return result;\n}\nexports.zip = zip;\n\n\n/**\n * Shuffles the values in the specified array using the Fisher-Yates in-place\n * shuffle (also known as the Knuth Shuffle). By default, calls Math.random()\n * and so resets the state of that random number generator. Similarly, may reset\n * the state of any other specified random number generator.\n *\n * Runtime: O(n)\n *\n * @param {!Array<?>} arr The array to be shuffled.\n * @param {function():number=} opt_randFn Optional random function to use for\n *     shuffling.\n *     Takes no arguments, and returns a random number on the interval [0, 1).\n *     Defaults to Math.random() using JavaScript's built-in Math library.\n */\nfunction shuffle(arr, opt_randFn) {\n  const randFn = opt_randFn || Math.random;\n\n  for (let i = arr.length - 1; i > 0; i--) {\n    // Choose a random array index in [0, i] (inclusive with i).\n    const j = Math.floor(randFn() * (i + 1));\n\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n  }\n}\nexports.shuffle = shuffle;\n\n\n/**\n * Returns a new array of elements from arr, based on the indexes of elements\n * provided by index_arr. For example, the result of index copying\n * ['a', 'b', 'c'] with index_arr [1,0,0,2] is ['b', 'a', 'a', 'c'].\n *\n * @param {!IArrayLike<T>} arr The array to get a indexed copy from.\n * @param {!IArrayLike<number>} index_arr An array of indexes to get from arr.\n * @return {!Array<T>} A new array of elements from arr in index_arr order.\n * @template T\n */\nfunction copyByIndex(arr, index_arr) {\n  const result = [];\n  forEach(index_arr, function(index) {\n    result.push(arr[index]);\n  });\n  return result;\n}\nexports.copyByIndex = copyByIndex;\n\n\n/**\n * Maps each element of the input array into zero or more elements of the output\n * array.\n *\n * @param {!IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): !Array<RESULT>} f The function\n *     to call for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return an array. The result will be\n *     used to extend a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the concatenation of all arrays\n *     returned from f.\n * @template THIS, VALUE, RESULT\n */\nfunction concatMap(arr, f, opt_obj) {\n  return concat.apply([], map(arr, f, opt_obj));\n}\nexports.concatMap = concatMap;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Wrapper class for handling XmlHttpRequests.\n *\n * One off requests can be sent through goog.net.XhrIo.send() or an\n * instance can be created to send multiple requests.  Each request uses its\n * own XmlHttpRequest object and handles clearing of the event callback to\n * ensure no leaks.\n *\n * XhrIo is event based, it dispatches events on success, failure, finishing,\n * ready-state change, or progress (download and upload).\n *\n * The ready-state or timeout event fires first, followed by\n * a generic completed event. Then the abort, error, or success event\n * is fired as appropriate. Progress events are fired as they are\n * received. Lastly, the ready event will fire to indicate that the\n * object may be used to make another request.\n *\n * The error event may also be called before completed and\n * ready-state-change if the XmlHttpRequest.open() or .send() methods throw.\n *\n * This class does not support multiple requests, queuing, or prioritization.\n *\n * When progress events are supported by the browser, and progress is\n * enabled via .setProgressEventsEnabled(true), the\n * goog.net.EventType.PROGRESS event will be the re-dispatched browser\n * progress event. Additionally, a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event\n * will be fired for download and upload progress respectively.\n */\n\n\ngoog.provide('goog.net.XhrIo');\ngoog.provide('goog.net.XhrIo.ResponseType');\n\ngoog.require('goog.Timer');\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.json.hybrid');\ngoog.require('goog.log');\ngoog.require('goog.net.ErrorCode');\ngoog.require('goog.net.EventType');\ngoog.require('goog.net.HttpStatus');\ngoog.require('goog.net.XmlHttp');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.structs');\ngoog.require('goog.structs.Map');\ngoog.require('goog.uri.utils');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.net.XhrLike');\ngoog.requireType('goog.net.XmlHttpFactory');\n\ngoog.scope(function() {\n\n'use strict';\n/**\n * Basic class for handling XMLHttpRequests.\n * @param {goog.net.XmlHttpFactory=} opt_xmlHttpFactory Factory to use when\n *     creating XMLHttpRequest objects.\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ngoog.net.XhrIo = function(opt_xmlHttpFactory) {\n  'use strict';\n  XhrIo.base(this, 'constructor');\n\n  /**\n   * Map of default headers to add to every request, use:\n   * XhrIo.headers.set(name, value)\n   * @type {!goog.structs.Map}\n   */\n  this.headers = new goog.structs.Map();\n\n  /**\n   * Optional XmlHttpFactory\n   * @private {goog.net.XmlHttpFactory}\n   */\n  this.xmlHttpFactory_ = opt_xmlHttpFactory || null;\n\n  /**\n   * Whether XMLHttpRequest is active.  A request is active from the time send()\n   * is called until onReadyStateChange() is complete, or error() or abort()\n   * is called.\n   * @private {boolean}\n   */\n  this.active_ = false;\n\n  /**\n   * The XMLHttpRequest object that is being used for the transfer.\n   * @private {?goog.net.XhrLike.OrNative}\n   */\n  this.xhr_ = null;\n\n  /**\n   * The options to use with the current XMLHttpRequest object.\n   * @private {?Object}\n   */\n  this.xhrOptions_ = null;\n\n  /**\n   * Last URL that was requested.\n   * @private {string|goog.Uri}\n   */\n  this.lastUri_ = '';\n\n  /**\n   * Method for the last request.\n   * @private {string}\n   */\n  this.lastMethod_ = '';\n\n  /**\n   * Last error code.\n   * @private {!goog.net.ErrorCode}\n   */\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n\n  /**\n   * Last error message.\n   * @private {Error|string}\n   */\n  this.lastError_ = '';\n\n  /**\n   * Used to ensure that we don't dispatch an multiple ERROR events. This can\n   * happen in IE when it does a synchronous load and one error is handled in\n   * the ready state change and one is handled due to send() throwing an\n   * exception.\n   * @private {boolean}\n   */\n  this.errorDispatched_ = false;\n\n  /**\n   * Used to make sure we don't fire the complete event from inside a send call.\n   * @private {boolean}\n   */\n  this.inSend_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.open.\n   * @private {boolean}\n   */\n  this.inOpen_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.abort.\n   * @private {boolean}\n   */\n  this.inAbort_ = false;\n\n  /**\n   * Number of milliseconds after which an incomplete request will be aborted\n   * and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no timeout\n   * is set.\n   * @private {number}\n   */\n  this.timeoutInterval_ = 0;\n\n  /**\n   * Timer to track request timeout.\n   * @private {?number}\n   */\n  this.timeoutId_ = null;\n\n  /**\n   * The requested type for the response. The empty string means use the default\n   * XHR behavior.\n   * @private {goog.net.XhrIo.ResponseType}\n   */\n  this.responseType_ = ResponseType.DEFAULT;\n\n  /**\n   * Whether a \"credentialed\" request is to be sent (one that is aware of\n   * cookies and authentication). This is applicable only for cross-domain\n   * requests and more recent browsers that support this part of the HTTP Access\n   * Control standard.\n   *\n   * @see http://www.w3.org/TR/XMLHttpRequest/#the-withcredentials-attribute\n   *\n   * @private {boolean}\n   */\n  this.withCredentials_ = false;\n\n  /**\n   * Whether progress events are enabled for this request. This is\n   * disabled by default because setting a progress event handler\n   * causes pre-flight OPTIONS requests to be sent for CORS requests,\n   * even in cases where a pre-flight request would not otherwise be\n   * sent.\n   *\n   * @see http://xhr.spec.whatwg.org/#security-considerations\n   *\n   * Note that this can cause problems for Firefox 22 and below, as an\n   * older \"LSProgressEvent\" will be dispatched by the browser. That\n   * progress event is no longer supported, and can lead to failures,\n   * including throwing exceptions.\n   *\n   * @see http://bugzilla.mozilla.org/show_bug.cgi?id=845631\n   * @see b/23469793\n   *\n   * @private {boolean}\n   */\n  this.progressEventsEnabled_ = false;\n\n  /**\n   * True if we can use XMLHttpRequest's timeout directly.\n   * @private {boolean}\n   */\n  this.useXhr2Timeout_ = false;\n\n  /**\n   * Specification for Trust Token operations (issuance, signing, and\n   * redemption).\n   * @private {?TrustTokenAttributeType}\n   */\n  this.trustToken_ = null;\n};\ngoog.inherits(goog.net.XhrIo, goog.events.EventTarget);\n\nconst XhrIo = goog.net.XhrIo;\n\n/**\n * Response types that may be requested for XMLHttpRequests.\n * @enum {string}\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute\n */\ngoog.net.XhrIo.ResponseType = {\n  DEFAULT: '',\n  TEXT: 'text',\n  DOCUMENT: 'document',\n  // Not supported as of Chrome 10.0.612.1 dev\n  BLOB: 'blob',\n  ARRAY_BUFFER: 'arraybuffer',\n};\n\nconst ResponseType = goog.net.XhrIo.ResponseType;\n\n\n/**\n * A reference to the XhrIo logger\n * @private {?goog.log.Logger}\n * @const\n */\ngoog.net.XhrIo.prototype.logger_ = goog.log.getLogger('goog.net.XhrIo');\n\n\n/**\n * The Content-Type HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TYPE_HEADER = 'Content-Type';\n\n\n/**\n * The Content-Transfer-Encoding HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TRANSFER_ENCODING = 'Content-Transfer-Encoding';\n\n\n/**\n * The pattern matching the 'http' and 'https' URI schemes\n * @type {!RegExp}\n */\ngoog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i;\n\nconst HTTP_SCHEME_PATTERN = goog.net.XhrIo.HTTP_SCHEME_PATTERN;\n\n\n/**\n * The methods that typically come along with form data.  We set different\n * headers depending on whether the HTTP action is one of these.\n * @type {!Array<string>}\n */\ngoog.net.XhrIo.METHODS_WITH_FORM_DATA = ['POST', 'PUT'];\n\n\n/**\n * The Content-Type HTTP header value for a url-encoded form\n * @type {string}\n */\ngoog.net.XhrIo.FORM_CONTENT_TYPE =\n    'application/x-www-form-urlencoded;charset=utf-8';\n\n\n/**\n * The XMLHttpRequest Level two timeout delay ms property name.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n *\n * @private {string}\n * @const\n */\ngoog.net.XhrIo.XHR2_TIMEOUT_ = 'timeout';\n\n\n/**\n * The XMLHttpRequest Level two ontimeout handler property name.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n *\n * @private {string}\n * @const\n */\ngoog.net.XhrIo.XHR2_ON_TIMEOUT_ = 'ontimeout';\n\n\n/**\n * All non-disposed instances of goog.net.XhrIo created\n * by {@link goog.net.XhrIo.send} are in this Array.\n * @see goog.net.XhrIo.cleanup\n * @private {!Array<!goog.net.XhrIo>}\n */\ngoog.net.XhrIo.sendInstances_ = [];\n\n\n/**\n * Static send that creates a short lived instance of XhrIo to send the\n * request.\n * @see goog.net.XhrIo.cleanup\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {?function(this:goog.net.XhrIo, ?)=} opt_callback Callback function\n *     for when request is complete.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {Object|goog.structs.Map=} opt_headers Map of headers to add to the\n *     request.\n * @param {number=} opt_timeoutInterval Number of milliseconds after which an\n *     incomplete request will be aborted; 0 means no timeout is set.\n * @param {boolean=} opt_withCredentials Whether to send credentials with the\n *     request. Default to false. See {@link goog.net.XhrIo#setWithCredentials}.\n * @return {!goog.net.XhrIo} The sent XhrIo.\n */\ngoog.net.XhrIo.send = function(\n    url, opt_callback, opt_method, opt_content, opt_headers,\n    opt_timeoutInterval, opt_withCredentials) {\n  'use strict';\n  const x = new goog.net.XhrIo();\n  goog.net.XhrIo.sendInstances_.push(x);\n  if (opt_callback) {\n    x.listen(goog.net.EventType.COMPLETE, opt_callback);\n  }\n  x.listenOnce(goog.net.EventType.READY, x.cleanupSend_);\n  if (opt_timeoutInterval) {\n    x.setTimeoutInterval(opt_timeoutInterval);\n  }\n  if (opt_withCredentials) {\n    x.setWithCredentials(opt_withCredentials);\n  }\n  x.send(url, opt_method, opt_content, opt_headers);\n  return x;\n};\n\n\n/**\n * Disposes all non-disposed instances of goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send}.\n * {@link goog.net.XhrIo.send} cleans up the goog.net.XhrIo instance\n * it creates when the request completes or fails.  However, if\n * the request never completes, then the goog.net.XhrIo is not disposed.\n * This can occur if the window is unloaded before the request completes.\n * We could have {@link goog.net.XhrIo.send} return the goog.net.XhrIo\n * it creates and make the client of {@link goog.net.XhrIo.send} be\n * responsible for disposing it in this case.  However, this makes things\n * significantly more complicated for the client, and the whole point\n * of {@link goog.net.XhrIo.send} is that it's simple and easy to use.\n * Clients of {@link goog.net.XhrIo.send} should call\n * {@link goog.net.XhrIo.cleanup} when doing final\n * cleanup on window unload.\n */\ngoog.net.XhrIo.cleanup = function() {\n  'use strict';\n  const instances = goog.net.XhrIo.sendInstances_;\n  while (instances.length) {\n    instances.pop().dispose();\n  }\n};\n\n\n/**\n * Installs exception protection for all entry point introduced by\n * goog.net.XhrIo instances which are not protected by\n * {@link goog.debug.ErrorHandler#protectWindowSetTimeout},\n * {@link goog.debug.ErrorHandler#protectWindowSetInterval}, or\n * {@link goog.events.protectBrowserEventEntryPoint}.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point(s).\n */\ngoog.net.XhrIo.protectEntryPoints = function(errorHandler) {\n  'use strict';\n  goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n      errorHandler.protectEntryPoint(\n          goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n};\n\n\n/**\n * Disposes of the specified goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send} and removes it from\n * {@link goog.net.XhrIo.pendingStaticSendInstances_}.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanupSend_ = function() {\n  'use strict';\n  this.dispose();\n  goog.array.remove(goog.net.XhrIo.sendInstances_, this);\n};\n\n\n/**\n * Returns the number of milliseconds after which an incomplete request will be\n * aborted, or 0 if no timeout is set.\n * @return {number} Timeout interval in milliseconds.\n */\ngoog.net.XhrIo.prototype.getTimeoutInterval = function() {\n  'use strict';\n  return this.timeoutInterval_;\n};\n\n\n/**\n * Sets the number of milliseconds after which an incomplete request will be\n * aborted and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no\n * timeout is set.\n * @param {number} ms Timeout interval in milliseconds; 0 means none.\n */\ngoog.net.XhrIo.prototype.setTimeoutInterval = function(ms) {\n  'use strict';\n  this.timeoutInterval_ = Math.max(0, ms);\n};\n\n\n/**\n * Sets the desired type for the response. At time of writing, this is only\n * supported in very recent versions of WebKit (10.0.612.1 dev and later).\n *\n * If this is used, the response may only be accessed via {@link #getResponse}.\n *\n * @param {goog.net.XhrIo.ResponseType} type The desired type for the response.\n */\ngoog.net.XhrIo.prototype.setResponseType = function(type) {\n  'use strict';\n  this.responseType_ = type;\n};\n\n\n/**\n * Gets the desired type for the response.\n * @return {goog.net.XhrIo.ResponseType} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getResponseType = function() {\n  'use strict';\n  return this.responseType_;\n};\n\n\n/**\n * Sets whether a \"credentialed\" request that is aware of cookie and\n * authentication information should be made. This option is only supported by\n * browsers that support HTTP Access Control. As of this writing, this option\n * is not supported in IE.\n *\n * @param {boolean} withCredentials Whether this should be a \"credentialed\"\n *     request.\n */\ngoog.net.XhrIo.prototype.setWithCredentials = function(withCredentials) {\n  'use strict';\n  this.withCredentials_ = withCredentials;\n};\n\n\n/**\n * Gets whether a \"credentialed\" request is to be sent.\n * @return {boolean} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getWithCredentials = function() {\n  'use strict';\n  return this.withCredentials_;\n};\n\n\n/**\n * Sets whether progress events are enabled for this request. Note\n * that progress events require pre-flight OPTIONS request handling\n * for CORS requests, and may cause trouble with older browsers. See\n * progressEventsEnabled_ for details.\n * @param {boolean} enabled Whether progress events should be enabled.\n */\ngoog.net.XhrIo.prototype.setProgressEventsEnabled = function(enabled) {\n  'use strict';\n  this.progressEventsEnabled_ = enabled;\n};\n\n\n/**\n * Gets whether progress events are enabled.\n * @return {boolean} Whether progress events are enabled for this request.\n */\ngoog.net.XhrIo.prototype.getProgressEventsEnabled = function() {\n  'use strict';\n  return this.progressEventsEnabled_;\n};\n\n/**\n * Specify a Trust Tokens operation to execute alongside the request.\n * @param {!TrustTokenAttributeType} trustToken a Trust Tokens operation to\n *     execute.\n */\ngoog.net.XhrIo.prototype.setTrustToken = function(trustToken) {\n  'use strict';\n  this.trustToken_ = trustToken;\n};\n\n/**\n * Instance send that actually uses XMLHttpRequest to make a server call.\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {Object|goog.structs.Map=} opt_headers Map of headers to add to the\n *     request.\n * @suppress {deprecated} Use deprecated goog.structs.forEach to allow different\n * types of parameters for opt_headers.\n */\ngoog.net.XhrIo.prototype.send = function(\n    url, opt_method, opt_content, opt_headers) {\n  'use strict';\n  if (this.xhr_) {\n    throw new Error(\n        '[goog.net.XhrIo] Object is active with another request=' +\n        this.lastUri_ + '; newUri=' + url);\n  }\n\n  const method = opt_method ? opt_method.toUpperCase() : 'GET';\n\n  this.lastUri_ = url;\n  this.lastError_ = '';\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n  this.lastMethod_ = method;\n  this.errorDispatched_ = false;\n  this.active_ = true;\n\n  // Use the factory to create the XHR object and options\n  this.xhr_ = this.createXhr();\n  this.xhrOptions_ = this.xmlHttpFactory_ ? this.xmlHttpFactory_.getOptions() :\n                                            goog.net.XmlHttp.getOptions();\n\n  // Set up the onreadystatechange callback\n  this.xhr_.onreadystatechange = goog.bind(this.onReadyStateChange_, this);\n\n  // Set up upload/download progress events, if progress events are supported.\n  if (this.getProgressEventsEnabled() && 'onprogress' in this.xhr_) {\n    this.xhr_.onprogress = goog.bind(function(e) {\n      'use strict';\n      this.onProgressHandler_(e, true);\n    }, this);\n    if (this.xhr_.upload) {\n      this.xhr_.upload.onprogress = goog.bind(this.onProgressHandler_, this);\n    }\n  }\n\n  /**\n   * Try to open the XMLHttpRequest (always async), if an error occurs here it\n   * is generally permission denied\n   */\n  try {\n    goog.log.fine(this.logger_, this.formatMsg_('Opening Xhr'));\n    this.inOpen_ = true;\n    this.xhr_.open(method, String(url), true);  // Always async!\n    this.inOpen_ = false;\n  } catch (err) {\n    goog.log.fine(\n        this.logger_, this.formatMsg_('Error opening Xhr: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n    return;\n  }\n\n  // We can't use null since this won't allow requests with form data to have a\n  // content length specified which will cause some proxies to return a 411\n  // error.\n  const content = opt_content || '';\n\n  const headers = this.headers.clone();\n\n  // Add headers specific to this request\n  if (opt_headers) {\n    goog.structs.forEach(opt_headers, function(value, key) {\n      'use strict';\n      headers.set(key, value);\n    });\n  }\n\n  // Find whether a content type header is set, ignoring case.\n  // HTTP header names are case-insensitive.  See:\n  // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n  const contentTypeKey =\n      goog.array.find(headers.getKeys(), goog.net.XhrIo.isContentTypeHeader_);\n\n  const contentIsFormData =\n      (goog.global['FormData'] && (content instanceof goog.global['FormData']));\n  if (goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA, method) &&\n      !contentTypeKey && !contentIsFormData) {\n    // For requests typically with form data, default to the url-encoded form\n    // content type unless this is a FormData request.  For FormData,\n    // the browser will automatically add a multipart/form-data content type\n    // with an appropriate multipart boundary.\n    headers.set(\n        goog.net.XhrIo.CONTENT_TYPE_HEADER, goog.net.XhrIo.FORM_CONTENT_TYPE);\n  }\n\n  // Add the headers to the Xhr object\n  headers.forEach(function(value, key) {\n    'use strict';\n    this.xhr_.setRequestHeader(key, value);\n  }, this);\n\n  if (this.responseType_) {\n    this.xhr_.responseType = this.responseType_;\n  }\n  // Set xhr_.withCredentials only when the value is different, or else in\n  // synchronous XMLHtppRequest.open Firefox will throw an exception.\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=736340\n  if ('withCredentials' in this.xhr_ &&\n      this.xhr_.withCredentials !== this.withCredentials_) {\n    this.xhr_.withCredentials = this.withCredentials_;\n  }\n\n  if ('setTrustToken' in this.xhr_ && this.trustToken_) {\n    try {\n      this.xhr_.setTrustToken(this.trustToken_);\n    } catch (err) {\n      goog.log.fine(\n          this.logger_, this.formatMsg_('Error SetTrustToken: ' + err.message));\n    }\n  }\n  /**\n   * Try to send the request, or other wise report an error (404 not found).\n   */\n  try {\n    this.cleanUpTimeoutTimer_();  // Paranoid, should never be running.\n    if (this.timeoutInterval_ > 0) {\n      this.useXhr2Timeout_ = goog.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_);\n      goog.log.fine(\n          this.logger_, this.formatMsg_(\n                            'Will abort after ' + this.timeoutInterval_ +\n                            'ms if incomplete, xhr2 ' + this.useXhr2Timeout_));\n      if (this.useXhr2Timeout_) {\n        this.xhr_[goog.net.XhrIo.XHR2_TIMEOUT_] = this.timeoutInterval_;\n        this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] =\n            goog.bind(this.timeout_, this);\n      } else {\n        this.timeoutId_ =\n            goog.Timer.callOnce(this.timeout_, this.timeoutInterval_, this);\n      }\n    }\n    goog.log.fine(this.logger_, this.formatMsg_('Sending request'));\n    this.inSend_ = true;\n    this.xhr_.send(content);\n    this.inSend_ = false;\n\n  } catch (err) {\n    goog.log.fine(this.logger_, this.formatMsg_('Send error: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n  }\n};\n\n\n/**\n * Determines if the argument is an XMLHttpRequest that supports the level 2\n * timeout value and event.\n *\n * Currently, FF 21.0 OS X has the fields but won't actually call the timeout\n * handler.  Perhaps the confusion in the bug referenced below hasn't\n * entirely been resolved.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=525816\n *\n * @param {!goog.net.XhrLike.OrNative} xhr The request.\n * @return {boolean} True if the request supports level 2 timeout.\n * @private\n */\ngoog.net.XhrIo.shouldUseXhr2Timeout_ = function(xhr) {\n  'use strict';\n  return goog.userAgent.IE && goog.userAgent.isVersionOrHigher(9) &&\n      typeof xhr[goog.net.XhrIo.XHR2_TIMEOUT_] === 'number' &&\n      xhr[goog.net.XhrIo.XHR2_ON_TIMEOUT_] !== undefined;\n};\n\n\n/**\n * @param {string} header An HTTP header key.\n * @return {boolean} Whether the key is a content type header (ignoring\n *     case.\n * @private\n */\ngoog.net.XhrIo.isContentTypeHeader_ = function(header) {\n  'use strict';\n  return goog.string.caseInsensitiveEquals(\n      goog.net.XhrIo.CONTENT_TYPE_HEADER, header);\n};\n\n\n/**\n * Creates a new XHR object.\n * @return {!goog.net.XhrLike.OrNative} The newly created XHR object.\n * @protected\n */\ngoog.net.XhrIo.prototype.createXhr = function() {\n  'use strict';\n  return this.xmlHttpFactory_ ? this.xmlHttpFactory_.createInstance() :\n                                goog.net.XmlHttp();\n};\n\n\n/**\n * The request didn't complete after {@link goog.net.XhrIo#timeoutInterval_}\n * milliseconds; raises a {@link goog.net.EventType.TIMEOUT} event and aborts\n * the request.\n * @private\n */\ngoog.net.XhrIo.prototype.timeout_ = function() {\n  'use strict';\n  if (typeof goog == 'undefined') {\n    // If goog is undefined then the callback has occurred as the application\n    // is unloading and will error.  Thus we let it silently fail.\n  } else if (this.xhr_) {\n    this.lastError_ =\n        'Timed out after ' + this.timeoutInterval_ + 'ms, aborting';\n    this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT;\n    goog.log.fine(this.logger_, this.formatMsg_(this.lastError_));\n    this.dispatchEvent(goog.net.EventType.TIMEOUT);\n    this.abort(goog.net.ErrorCode.TIMEOUT);\n  }\n};\n\n\n/**\n * Something errorred, so inactivate, fire error callback and clean up\n * @param {goog.net.ErrorCode} errorCode The error code.\n * @param {Error} err The error object.\n * @private\n */\ngoog.net.XhrIo.prototype.error_ = function(errorCode, err) {\n  'use strict';\n  this.active_ = false;\n  if (this.xhr_) {\n    this.inAbort_ = true;\n    this.xhr_.abort();  // Ensures XHR isn't hung (FF)\n    this.inAbort_ = false;\n  }\n  this.lastError_ = err;\n  this.lastErrorCode_ = errorCode;\n  this.dispatchErrors_();\n  this.cleanUpXhr_();\n};\n\n\n/**\n * Dispatches COMPLETE and ERROR in case of an error. This ensures that we do\n * not dispatch multiple error events.\n * @private\n */\ngoog.net.XhrIo.prototype.dispatchErrors_ = function() {\n  'use strict';\n  if (!this.errorDispatched_) {\n    this.errorDispatched_ = true;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ERROR);\n  }\n};\n\n\n/**\n * Abort the current XMLHttpRequest\n * @param {goog.net.ErrorCode=} opt_failureCode Optional error code to use -\n *     defaults to ABORT.\n */\ngoog.net.XhrIo.prototype.abort = function(opt_failureCode) {\n  'use strict';\n  if (this.xhr_ && this.active_) {\n    goog.log.fine(this.logger_, this.formatMsg_('Aborting'));\n    this.active_ = false;\n    this.inAbort_ = true;\n    this.xhr_.abort();\n    this.inAbort_ = false;\n    this.lastErrorCode_ = opt_failureCode || goog.net.ErrorCode.ABORT;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ABORT);\n    this.cleanUpXhr_();\n  }\n};\n\n\n/**\n * Nullifies all callbacks to reduce risks of leaks.\n * @override\n * @protected\n */\ngoog.net.XhrIo.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.xhr_) {\n    // We explicitly do not call xhr_.abort() unless active_ is still true.\n    // This is to avoid unnecessarily aborting a successful request when\n    // dispose() is called in a callback triggered by a complete response, but\n    // in which browser cleanup has not yet finished.\n    // (See http://b/issue?id=1684217.)\n    if (this.active_) {\n      this.active_ = false;\n      this.inAbort_ = true;\n      this.xhr_.abort();\n      this.inAbort_ = false;\n    }\n    this.cleanUpXhr_(true);\n  }\n\n  XhrIo.base(this, 'disposeInternal');\n};\n\n\n/**\n * Internal handler for the XHR object's readystatechange event.  This method\n * checks the status and the readystate and fires the correct callbacks.\n * If the request has ended, the handlers are cleaned up and the XHR object is\n * nullified.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChange_ = function() {\n  'use strict';\n  if (this.isDisposed()) {\n    // This method is the target of an untracked goog.Timer.callOnce().\n    return;\n  }\n  if (!this.inOpen_ && !this.inSend_ && !this.inAbort_) {\n    // Were not being called from within a call to this.xhr_.send\n    // this.xhr_.abort, or this.xhr_.open, so this is an entry point\n    this.onReadyStateChangeEntryPoint_();\n  } else {\n    this.onReadyStateChangeHelper_();\n  }\n};\n\n\n/**\n * Used to protect the onreadystatechange handler entry point.  Necessary\n * as {#onReadyStateChange_} maybe called from within send or abort, this\n * method is only called when {#onReadyStateChange_} is called as an\n * entry point.\n * {@see #protectEntryPoints}\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() {\n  'use strict';\n  this.onReadyStateChangeHelper_();\n};\n\n\n/**\n * Helper for {@link #onReadyStateChange_}.  This is used so that\n * entry point calls to {@link #onReadyStateChange_} can be routed through\n * {@link #onReadyStateChangeEntryPoint_}.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() {\n  'use strict';\n  if (!this.active_) {\n    // can get called inside abort call\n    return;\n  }\n\n  if (typeof goog == 'undefined') {\n    // NOTE(user): If goog is undefined then the callback has occurred as the\n    // application is unloading and will error.  Thus we let it silently fail.\n\n  } else if (\n      this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] &&\n      this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      this.getStatus() == 2) {\n    // NOTE(user): In IE if send() errors on a *local* request the readystate\n    // is still changed to COMPLETE.  We need to ignore it and allow the\n    // try/catch around send() to pick up the error.\n    goog.log.fine(\n        this.logger_,\n        this.formatMsg_('Local request error detected and ignored'));\n\n  } else {\n    // In IE when the response has been cached we sometimes get the callback\n    // from inside the send call and this usually breaks code that assumes that\n    // XhrIo is asynchronous.  If that is the case we delay the callback\n    // using a timer.\n    if (this.inSend_ &&\n        this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) {\n      goog.Timer.callOnce(this.onReadyStateChange_, 0, this);\n      return;\n    }\n\n    this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE);\n\n    // readyState indicates the transfer has finished\n    if (this.isComplete()) {\n      goog.log.fine(this.logger_, this.formatMsg_('Request complete'));\n\n      this.active_ = false;\n\n      try {\n        // Call the specific callbacks for success or failure. Only call the\n        // success if the status is 200 (HTTP_OK) or 304 (HTTP_CACHED)\n        if (this.isSuccess()) {\n          this.dispatchEvent(goog.net.EventType.COMPLETE);\n          this.dispatchEvent(goog.net.EventType.SUCCESS);\n        } else {\n          this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR;\n          this.lastError_ =\n              this.getStatusText() + ' [' + this.getStatus() + ']';\n          this.dispatchErrors_();\n        }\n      } finally {\n        this.cleanUpXhr_();\n      }\n    }\n  }\n};\n\n\n/**\n * Internal handler for the XHR object's onprogress event. Fires both a generic\n * PROGRESS event and either a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event to\n * allow specific binding for each XHR progress event.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {boolean=} opt_isDownload Whether the current progress event is from a\n *     download. Used to determine whether DOWNLOAD_PROGRESS or UPLOAD_PROGRESS\n *     event should be dispatched.\n * @private\n */\ngoog.net.XhrIo.prototype.onProgressHandler_ = function(e, opt_isDownload) {\n  'use strict';\n  goog.asserts.assert(\n      e.type === goog.net.EventType.PROGRESS,\n      'goog.net.EventType.PROGRESS is of the same type as raw XHR progress.');\n  this.dispatchEvent(\n      goog.net.XhrIo.buildProgressEvent_(e, goog.net.EventType.PROGRESS));\n  this.dispatchEvent(\n      goog.net.XhrIo.buildProgressEvent_(\n          e, opt_isDownload ? goog.net.EventType.DOWNLOAD_PROGRESS :\n                              goog.net.EventType.UPLOAD_PROGRESS));\n};\n\n\n/**\n * Creates a representation of the native ProgressEvent. IE doesn't support\n * constructing ProgressEvent via \"new\", and the alternatives (e.g.,\n * ProgressEvent.initProgressEvent) are non-standard or deprecated.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {!goog.net.EventType} eventType The type of the event.\n * @return {!ProgressEvent} The progress event.\n * @private\n */\ngoog.net.XhrIo.buildProgressEvent_ = function(e, eventType) {\n  'use strict';\n  return /** @type {!ProgressEvent} */ ({\n    type: eventType,\n    lengthComputable: e.lengthComputable,\n    loaded: e.loaded,\n    total: e.total,\n  });\n};\n\n\n/**\n * Remove the listener to protect against leaks, and nullify the XMLHttpRequest\n * object.\n * @param {boolean=} opt_fromDispose If this is from the dispose (don't want to\n *     fire any events).\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpXhr_ = function(opt_fromDispose) {\n  'use strict';\n  if (this.xhr_) {\n    // Cancel any pending timeout event handler.\n    this.cleanUpTimeoutTimer_();\n\n    // Save reference so we can mark it as closed after the READY event.  The\n    // READY event may trigger another request, thus we must nullify this.xhr_\n    const xhr = this.xhr_;\n    const clearedOnReadyStateChange =\n        this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] ?\n        goog.nullFunction :\n        null;\n    this.xhr_ = null;\n    this.xhrOptions_ = null;\n\n    if (!opt_fromDispose) {\n      this.dispatchEvent(goog.net.EventType.READY);\n    }\n\n    try {\n      // NOTE(user): Not nullifying in FireFox can still leak if the callbacks\n      // are defined in the same scope as the instance of XhrIo. But, IE doesn't\n      // allow you to set the onreadystatechange to NULL so nullFunction is\n      // used.\n      xhr.onreadystatechange = clearedOnReadyStateChange;\n    } catch (e) {\n      // This seems to occur with a Gears HTTP request. Delayed the setting of\n      // this onreadystatechange until after READY is sent out and catching the\n      // error to see if we can track down the problem.\n      goog.log.error(\n          this.logger_,\n          'Problem encountered resetting onreadystatechange: ' + e.message);\n    }\n  }\n};\n\n\n/**\n * Make sure the timeout timer isn't running.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpTimeoutTimer_ = function() {\n  'use strict';\n  if (this.xhr_ && this.useXhr2Timeout_) {\n    this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = null;\n  }\n  if (this.timeoutId_) {\n    goog.Timer.clear(this.timeoutId_);\n    this.timeoutId_ = null;\n  }\n};\n\n\n/**\n * @return {boolean} Whether there is an active request.\n */\ngoog.net.XhrIo.prototype.isActive = function() {\n  'use strict';\n  return !!this.xhr_;\n};\n\n\n/**\n * @return {boolean} Whether the request has completed.\n */\ngoog.net.XhrIo.prototype.isComplete = function() {\n  'use strict';\n  return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;\n};\n\n\n/**\n * @return {boolean} Whether the request completed with a success.\n */\ngoog.net.XhrIo.prototype.isSuccess = function() {\n  'use strict';\n  const status = this.getStatus();\n  // A zero status code is considered successful for local files.\n  return goog.net.HttpStatus.isSuccess(status) ||\n      status === 0 && !this.isLastUriEffectiveSchemeHttp_();\n};\n\n\n/**\n * @return {boolean} whether the effective scheme of the last URI that was\n *     fetched was 'http' or 'https'.\n * @private\n */\ngoog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() {\n  'use strict';\n  const scheme = goog.uri.utils.getEffectiveScheme(String(this.lastUri_));\n  return HTTP_SCHEME_PATTERN.test(scheme);\n};\n\n\n/**\n * Get the readystate from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {goog.net.XmlHttp.ReadyState} goog.net.XmlHttp.ReadyState.*.\n */\ngoog.net.XhrIo.prototype.getReadyState = function() {\n  'use strict';\n  return this.xhr_ ?\n      /** @type {goog.net.XmlHttp.ReadyState} */ (this.xhr_.readyState) :\n      goog.net.XmlHttp.ReadyState.UNINITIALIZED;\n};\n\n\n/**\n * Get the status from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {number} Http status.\n */\ngoog.net.XhrIo.prototype.getStatus = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.status :\n        -1;\n  } catch (e) {\n    return -1;\n  }\n};\n\n\n/**\n * Get the status text from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {string} Status text.\n */\ngoog.net.XhrIo.prototype.getStatusText = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.statusText :\n        '';\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get status: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the last Uri that was requested\n * @return {string} Last Uri.\n */\ngoog.net.XhrIo.prototype.getLastUri = function() {\n  'use strict';\n  return String(this.lastUri_);\n};\n\n\n/**\n * Get the response text from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {string} Result from the server, or '' if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseText = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseText : '';\n  } catch (e) {\n    // http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute\n    // states that responseText should return '' (and responseXML null)\n    // when the state is not LOADING or DONE. Instead, IE can\n    // throw unexpected exceptions, for example when a request is aborted\n    // or no data is available yet.\n    goog.log.fine(this.logger_, 'Can not get responseText: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the response body from the Xhr object. This property is only available\n * in IE since version 7 according to MSDN:\n * http://msdn.microsoft.com/en-us/library/ie/ms534368(v=vs.85).aspx\n * Will only return correct result when called from the context of a callback.\n *\n * One option is to construct a VBArray from the returned object and convert\n * it to a JavaScript array using the toArray method:\n * `(new window['VBArray'](xhrIo.getResponseBody())).toArray()`\n * This will result in an array of numbers in the range of [0..255]\n *\n * Another option is to use the VBScript CStr method to convert it into a\n * string as outlined in http://stackoverflow.com/questions/1919972\n *\n * @return {Object} Binary result from the server or null if not available.\n */\ngoog.net.XhrIo.prototype.getResponseBody = function() {\n  'use strict';\n  try {\n    if (this.xhr_ && 'responseBody' in this.xhr_) {\n      return this.xhr_['responseBody'];\n    }\n  } catch (e) {\n    // IE can throw unexpected exceptions, for example when a request is aborted\n    // or no data is yet available.\n    goog.log.fine(this.logger_, 'Can not get responseBody: ' + e.message);\n  }\n  return null;\n};\n\n\n/**\n * Get the response XML from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {Document} The DOM Document representing the XML file, or null\n * if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseXml = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseXML : null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get responseXML: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the response and evaluates it as JSON from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @param {string=} opt_xssiPrefix Optional XSSI prefix string to use for\n *     stripping of the response before parsing. This needs to be set only if\n *     your backend server prepends the same prefix string to the JSON response.\n * @throws Error if the response text is invalid JSON.\n * @return {Object|undefined} JavaScript object.\n */\ngoog.net.XhrIo.prototype.getResponseJson = function(opt_xssiPrefix) {\n  'use strict';\n  if (!this.xhr_) {\n    return undefined;\n  }\n\n  let responseText = this.xhr_.responseText;\n  if (opt_xssiPrefix && responseText.indexOf(opt_xssiPrefix) == 0) {\n    responseText = responseText.substring(opt_xssiPrefix.length);\n  }\n\n  return goog.json.hybrid.parse(responseText);\n};\n\n\n/**\n * Get the response as the type specificed by {@link #setResponseType}. At time\n * of writing, this is only directly supported in very recent versions of WebKit\n * (10.0.612.1 dev and later). If the field is not supported directly, we will\n * try to emulate it.\n *\n * Emulating the response means following the rules laid out at\n * http://www.w3.org/TR/XMLHttpRequest/#the-response-attribute\n *\n * On browsers with no support for this (Chrome < 10, Firefox < 4, etc), only\n * response types of DEFAULT or TEXT may be used, and the response returned will\n * be the text response.\n *\n * On browsers with Mozilla's draft support for array buffers (Firefox 4, 5),\n * only response types of DEFAULT, TEXT, and ARRAY_BUFFER may be used, and the\n * response returned will be either the text response or the Mozilla\n * implementation of the array buffer response.\n *\n * On browsers will full support, any valid response type supported by the\n * browser may be used, and the response provided by the browser will be\n * returned.\n *\n * @return {*} The response.\n */\ngoog.net.XhrIo.prototype.getResponse = function() {\n  'use strict';\n  try {\n    if (!this.xhr_) {\n      return null;\n    }\n    if ('response' in this.xhr_) {\n      return this.xhr_.response;\n    }\n    switch (this.responseType_) {\n      case ResponseType.DEFAULT:\n      case ResponseType.TEXT:\n        return this.xhr_.responseText;\n      // DOCUMENT and BLOB don't need to be handled here because they are\n      // introduced in the same spec that adds the .response field, and would\n      // have been caught above.\n      // ARRAY_BUFFER needs an implementation for Firefox 4, where it was\n      // implemented using a draft spec rather than the final spec.\n      case ResponseType.ARRAY_BUFFER:\n        if ('mozResponseArrayBuffer' in this.xhr_) {\n          return this.xhr_.mozResponseArrayBuffer;\n        }\n    }\n    // Fell through to a response type that is not supported on this browser.\n    goog.log.error(\n        this.logger_, 'Response type ' + this.responseType_ + ' is not ' +\n            'supported on this browser');\n    return null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get response: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object\n * Will only return correct result when called from the context of a callback\n * and the request has completed\n * @param {string} key The name of the response-header to retrieve.\n * @return {string|undefined} The value of the response-header named key.\n */\ngoog.net.XhrIo.prototype.getResponseHeader = function(key) {\n  'use strict';\n  if (!this.xhr_ || !this.isComplete()) {\n    return undefined;\n  }\n\n  const value = this.xhr_.getResponseHeader(key);\n  return value === null ? undefined : value;\n};\n\n\n/**\n * Gets the text of all the headers in the response.\n * Will only return correct result when called from the context of a callback\n * and the request has completed.\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllResponseHeaders = function() {\n  'use strict';\n  // getAllResponseHeaders can return null if no response has been received,\n  // ensure we always return an empty string.\n  return this.xhr_ && this.isComplete() ?\n      (this.xhr_.getAllResponseHeaders() || '') :\n      '';\n};\n\n\n/**\n * Returns all response headers as a key-value map.\n * Multiple values for the same header key can be combined into one,\n * separated by a comma and a space.\n * Note that the native getResponseHeader method for retrieving a single header\n * does a case insensitive match on the header name. This method does not\n * include any case normalization logic, it will just return a key-value\n * representation of the headers.\n * See: http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method\n * @return {!Object<string, string>} An object with the header keys as keys\n *     and header values as values.\n */\ngoog.net.XhrIo.prototype.getResponseHeaders = function() {\n  'use strict';\n  // TODO(user): Make this function parse headers as per the spec\n  // (https://tools.ietf.org/html/rfc2616#section-4.2).\n\n  const headersObject = {};\n  const headersArray = this.getAllResponseHeaders().split('\\r\\n');\n  for (let i = 0; i < headersArray.length; i++) {\n    if (goog.string.isEmptyOrWhitespace(headersArray[i])) {\n      continue;\n    }\n    const keyValue =\n        goog.string.splitLimit(headersArray[i], ':', /* maxSplitCount= */ 1);\n    const key = keyValue[0];\n    let value = keyValue[1];\n\n    if (typeof value !== 'string') {\n      // There must be a value but it can be the empty string.\n      continue;\n    }\n\n    // Whitespace at the start and end of the value is meaningless.\n    value = value.trim();\n    // The key should not contain whitespace but we currently ignore that.\n\n    const values = headersObject[key] || [];\n    headersObject[key] = values;\n    values.push(value);\n  }\n\n  return goog.object.map(headersObject, function(values) {\n    'use strict';\n    return values.join(', ');\n  });\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object.\n * As opposed to {@link #getResponseHeader}, this method does not require that\n * the request has completed.\n * @param {string} key The name of the response-header to retrieve.\n * @return {?string} The value of the response-header, or null if it is\n *     unavailable.\n */\ngoog.net.XhrIo.prototype.getStreamingResponseHeader = function(key) {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getResponseHeader(key) : null;\n};\n\n\n/**\n * Gets the text of all the headers in the response. As opposed to\n * {@link #getAllResponseHeaders}, this method does not require that the request\n * has completed.\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllStreamingResponseHeaders = function() {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getAllResponseHeaders() : '';\n};\n\n\n/**\n * Get the last error message\n * @return {!goog.net.ErrorCode} Last error code.\n */\ngoog.net.XhrIo.prototype.getLastErrorCode = function() {\n  'use strict';\n  return this.lastErrorCode_;\n};\n\n\n/**\n * Get the last error message\n * @return {string} Last error message.\n */\ngoog.net.XhrIo.prototype.getLastError = function() {\n  'use strict';\n  return typeof this.lastError_ === 'string' ? this.lastError_ :\n                                               String(this.lastError_);\n};\n\n\n/**\n * Adds the last method, status and URI to the message.  This is used to add\n * this information to the logging calls.\n * @param {string} msg The message text that we want to add the extra text to.\n * @return {string} The message with the extra text appended.\n * @private\n */\ngoog.net.XhrIo.prototype.formatMsg_ = function(msg) {\n  'use strict';\n  return msg + ' [' + this.lastMethod_ + ' ' + this.lastUri_ + ' ' +\n      this.getStatus() + ']';\n};\n\n\n// Register the xhr handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n          transformer(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n    });\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview String functions called from Closure packages that couldn't\n * depend on each other. Outside Closure, use goog.string function which\n * delegate to these.\n */\n\n\ngoog.provide('goog.string.internal');\n\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n * @see goog.string.startsWith\n */\ngoog.string.internal.startsWith = function(str, prefix) {\n  'use strict';\n  return str.lastIndexOf(prefix, 0) == 0;\n};\n\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n * @see goog.string.endsWith\n */\ngoog.string.internal.endsWith = function(str, suffix) {\n  'use strict';\n  const l = str.length - suffix.length;\n  return l >= 0 && str.indexOf(suffix, l) == l;\n};\n\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix  A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveStartsWith\n */\ngoog.string.internal.caseInsensitiveStartsWith = function(str, prefix) {\n  'use strict';\n  return goog.string.internal.caseInsensitiveCompare(\n             prefix, str.substr(0, prefix.length)) == 0;\n};\n\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveEndsWith\n */\ngoog.string.internal.caseInsensitiveEndsWith = function(str, suffix) {\n  'use strict';\n  return (\n      goog.string.internal.caseInsensitiveCompare(\n          suffix, str.substr(str.length - suffix.length, suffix.length)) == 0);\n};\n\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n *     ignoring case.\n * @see goog.string.caseInsensitiveEquals\n */\ngoog.string.internal.caseInsensitiveEquals = function(str1, str2) {\n  'use strict';\n  return str1.toLowerCase() == str2.toLowerCase();\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @see goog.string.isEmptyOrWhitespace\n */\ngoog.string.internal.isEmptyOrWhitespace = function(str) {\n  'use strict';\n  // testing length == 0 first is actually slower in all browsers (about the\n  // same in Opera).\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return /^[\\s\\xa0]*$/.test(str);\n};\n\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.internal.trim =\n    (goog.TRUSTED_SITE && String.prototype.trim) ? function(str) {\n      'use strict';\n      return str.trim();\n    } : function(str) {\n      'use strict';\n      // Since IE doesn't include non-breaking-space (0xa0) in their \\s\n      // character class (as required by section 7.2 of the ECMAScript spec),\n      // we explicitly include it in the regexp to enforce consistent\n      // cross-browser behavior.\n      // NOTE: We don't use String#replace because it might have side effects\n      // causing this function to not compile to 0 bytes.\n      return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(str)[1];\n    };\n\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n *  0 = str1 equals str2\n *  1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n * @see goog.string.caseInsensitiveCompare\n */\ngoog.string.internal.caseInsensitiveCompare = function(str1, str2) {\n  'use strict';\n  const test1 = String(str1).toLowerCase();\n  const test2 = String(str2).toLowerCase();\n\n  if (test1 < test2) {\n    return -1;\n  } else if (test1 == test2) {\n    return 0;\n  } else {\n    return 1;\n  }\n};\n\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n * @see goog.string.newLineToBr\n */\ngoog.string.internal.newLineToBr = function(str, opt_xml) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)/g, opt_xml ? '<br />' : '<br>');\n};\n\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars\n * @return {string} An escaped copy of `str`.\n * @see goog.string.htmlEscape\n */\ngoog.string.internal.htmlEscape = function(\n    str, opt_isLikelyToContainHtmlChars) {\n  'use strict';\n  if (opt_isLikelyToContainHtmlChars) {\n    str = str.replace(goog.string.internal.AMP_RE_, '&amp;')\n              .replace(goog.string.internal.LT_RE_, '&lt;')\n              .replace(goog.string.internal.GT_RE_, '&gt;')\n              .replace(goog.string.internal.QUOT_RE_, '&quot;')\n              .replace(goog.string.internal.SINGLE_QUOTE_RE_, '&#39;')\n              .replace(goog.string.internal.NULL_RE_, '&#0;');\n    return str;\n\n  } else {\n    // quick test helps in the case when there are no chars to replace, in\n    // worst case this makes barely a difference to the time taken\n    if (!goog.string.internal.ALL_RE_.test(str)) return str;\n\n    // str.indexOf is faster than regex.test in this case\n    if (str.indexOf('&') != -1) {\n      str = str.replace(goog.string.internal.AMP_RE_, '&amp;');\n    }\n    if (str.indexOf('<') != -1) {\n      str = str.replace(goog.string.internal.LT_RE_, '&lt;');\n    }\n    if (str.indexOf('>') != -1) {\n      str = str.replace(goog.string.internal.GT_RE_, '&gt;');\n    }\n    if (str.indexOf('\"') != -1) {\n      str = str.replace(goog.string.internal.QUOT_RE_, '&quot;');\n    }\n    if (str.indexOf('\\'') != -1) {\n      str = str.replace(goog.string.internal.SINGLE_QUOTE_RE_, '&#39;');\n    }\n    if (str.indexOf('\\x00') != -1) {\n      str = str.replace(goog.string.internal.NULL_RE_, '&#0;');\n    }\n    return str;\n  }\n};\n\n\n/**\n * Regular expression that matches an ampersand, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.AMP_RE_ = /&/g;\n\n\n/**\n * Regular expression that matches a less than sign, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.LT_RE_ = /</g;\n\n\n/**\n * Regular expression that matches a greater than sign, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.GT_RE_ = />/g;\n\n\n/**\n * Regular expression that matches a double quote, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.QUOT_RE_ = /\"/g;\n\n\n/**\n * Regular expression that matches a single quote, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.SINGLE_QUOTE_RE_ = /'/g;\n\n\n/**\n * Regular expression that matches null character, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.NULL_RE_ = /\\x00/g;\n\n\n/**\n * Regular expression that matches any character that needs to be escaped.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.ALL_RE_ = /[\\x00&<>\"']/;\n\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n * @see goog.string.whitespaceEscape\n */\ngoog.string.internal.whitespaceEscape = function(str, opt_xml) {\n  'use strict';\n  // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n  return goog.string.internal.newLineToBr(\n      str.replace(/  /g, ' &#160;'), opt_xml);\n};\n\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.contains\n */\ngoog.string.internal.contains = function(str, subString) {\n  'use strict';\n  return str.indexOf(subString) != -1;\n};\n\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.caseInsensitiveContains\n */\ngoog.string.internal.caseInsensitiveContains = function(str, subString) {\n  'use strict';\n  return goog.string.internal.contains(\n      str.toLowerCase(), subString.toLowerCase());\n};\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number}  1 if `version1` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `version2` is higher.\n * @see goog.string.compareVersions\n */\ngoog.string.internal.compareVersions = function(version1, version2) {\n  'use strict';\n  let order = 0;\n  // Trim leading and trailing whitespace and split the versions into\n  // subversions.\n  const v1Subs = goog.string.internal.trim(String(version1)).split('.');\n  const v2Subs = goog.string.internal.trim(String(version2)).split('.');\n  const subCount = Math.max(v1Subs.length, v2Subs.length);\n\n  // Iterate over the subversions, as long as they appear to be equivalent.\n  for (let subIdx = 0; order == 0 && subIdx < subCount; subIdx++) {\n    let v1Sub = v1Subs[subIdx] || '';\n    let v2Sub = v2Subs[subIdx] || '';\n\n    do {\n      // Split the subversions into pairs of numbers and qualifiers (like 'b').\n      // Two different RegExp objects are use to make it clear the code\n      // is side-effect free\n      const v1Comp = /(\\d*)(\\D*)(.*)/.exec(v1Sub) || ['', '', '', ''];\n      const v2Comp = /(\\d*)(\\D*)(.*)/.exec(v2Sub) || ['', '', '', ''];\n      // Break if there are no more matches.\n      if (v1Comp[0].length == 0 && v2Comp[0].length == 0) {\n        break;\n      }\n\n      // Parse the numeric part of the subversion. A missing number is\n      // equivalent to 0.\n      const v1CompNum = v1Comp[1].length == 0 ? 0 : parseInt(v1Comp[1], 10);\n      const v2CompNum = v2Comp[1].length == 0 ? 0 : parseInt(v2Comp[1], 10);\n\n      // Compare the subversion components. The number has the highest\n      // precedence. Next, if the numbers are equal, a subversion without any\n      // qualifier is always higher than a subversion with any qualifier. Next,\n      // the qualifiers are compared as strings.\n      order = goog.string.internal.compareElements_(v1CompNum, v2CompNum) ||\n          goog.string.internal.compareElements_(\n              v1Comp[2].length == 0, v2Comp[2].length == 0) ||\n          goog.string.internal.compareElements_(v1Comp[2], v2Comp[2]);\n      // Stop as soon as an inequality is discovered.\n\n      v1Sub = v1Comp[3];\n      v2Sub = v2Comp[3];\n    } while (order == 0);\n  }\n\n  return order;\n};\n\n\n/**\n * Compares elements of a version number.\n *\n * @param {string|number|boolean} left An element from a version number.\n * @param {string|number|boolean} right An element from a version number.\n *\n * @return {number}  1 if `left` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `right` is higher.\n * @private\n */\ngoog.string.internal.compareElements_ = function(left, right) {\n  'use strict';\n  if (left < right) {\n    return -1;\n  } else if (left > right) {\n    return 1;\n  }\n  return 0;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities used by goog.labs.userAgent tools. These functions\n * should not be used outside of goog.labs.userAgent.*.\n *\n */\n\ngoog.provide('goog.labs.userAgent.util');\n\ngoog.require('goog.string.internal');\n\n\n/**\n * Gets the native userAgent string from navigator if it exists.\n * If navigator or navigator.userAgent string is missing, returns an empty\n * string.\n * @return {string}\n * @private\n */\ngoog.labs.userAgent.util.getNativeUserAgentString_ = function() {\n  'use strict';\n  var navigator = goog.labs.userAgent.util.getNavigator_();\n  if (navigator) {\n    var userAgent = navigator.userAgent;\n    if (userAgent) {\n      return userAgent;\n    }\n  }\n  return '';\n};\n\n\n/**\n * Getter for the native navigator.\n * This is a separate function so it can be stubbed out in testing.\n * @return {!Navigator}\n * @private\n */\ngoog.labs.userAgent.util.getNavigator_ = function() {\n  'use strict';\n  return goog.global.navigator;\n};\n\n\n/**\n * A possible override for applications which wish to not check\n * navigator.userAgent but use a specified value for detection instead.\n * @private {string}\n */\ngoog.labs.userAgent.util.userAgent_ =\n    goog.labs.userAgent.util.getNativeUserAgentString_();\n\n\n/**\n * Applications may override browser detection on the built in\n * navigator.userAgent object by setting this string. Set to null to use the\n * browser object instead.\n * @param {?string=} opt_userAgent The User-Agent override.\n * @return {void}\n */\ngoog.labs.userAgent.util.setUserAgent = function(opt_userAgent) {\n  'use strict';\n  goog.labs.userAgent.util.userAgent_ =\n      opt_userAgent || goog.labs.userAgent.util.getNativeUserAgentString_();\n};\n\n\n/**\n * @return {string} The user agent string.\n */\ngoog.labs.userAgent.util.getUserAgent = function() {\n  'use strict';\n  return goog.labs.userAgent.util.userAgent_;\n};\n\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string.\n */\ngoog.labs.userAgent.util.matchUserAgent = function(str) {\n  'use strict';\n  var userAgent = goog.labs.userAgent.util.getUserAgent();\n  return goog.string.internal.contains(userAgent, str);\n};\n\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string, ignoring\n *     case.\n */\ngoog.labs.userAgent.util.matchUserAgentIgnoreCase = function(str) {\n  'use strict';\n  var userAgent = goog.labs.userAgent.util.getUserAgent();\n  return goog.string.internal.caseInsensitiveContains(userAgent, str);\n};\n\n\n/**\n * Parses the user agent into tuples for each section.\n * @param {string} userAgent\n * @return {!Array<!Array<string>>} Tuples of key, version, and the contents\n *     of the parenthetical.\n */\ngoog.labs.userAgent.util.extractVersionTuples = function(userAgent) {\n  'use strict';\n  // Matches each section of a user agent string.\n  // Example UA:\n  // Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)\n  // AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405\n  // This has three version tuples: Mozilla, AppleWebKit, and Mobile.\n\n  var versionRegExp = new RegExp(\n      // Key. Note that a key may have a space.\n      // (i.e. 'Mobile Safari' in 'Mobile Safari/5.0')\n      '(\\\\w[\\\\w ]+)' +\n\n          '/' +                // slash\n          '([^\\\\s]+)' +        // version (i.e. '5.0b')\n          '\\\\s*' +             // whitespace\n          '(?:\\\\((.*?)\\\\))?',  // parenthetical info. parentheses not matched.\n      'g');\n\n  var data = [];\n  var match;\n\n  // Iterate and collect the version tuples.  Each iteration will be the\n  // next regex match.\n  while (match = versionRegExp.exec(userAgent)) {\n    data.push([\n      match[1],  // key\n      match[2],  // value\n      // || undefined as this is not undefined in IE7 and IE8\n      match[3] || undefined  // info\n    ]);\n  }\n\n  return data;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating objects/maps/hashes.\n */\n\ngoog.provide('goog.object');\n\n\n/**\n * Calls a function for each element in an object/map/hash.\n *\n * @param {Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,Object<K,V>):?} f The function to call\n *     for every element. This function takes 3 arguments (the value, the\n *     key and the object) and the return value is ignored.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {void}\n * @template T,K,V\n */\ngoog.object.forEach = function(obj, f, opt_obj) {\n  'use strict';\n  for (const key in obj) {\n    f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n};\n\n\n/**\n * Calls a function for each element in an object/map/hash. If that call returns\n * true, adds the element to a new object.\n *\n * @param {Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,Object<K,V>):boolean} f The function to call\n *     for every element. This\n *     function takes 3 arguments (the value, the key and the object)\n *     and should return a boolean. If the return value is true the\n *     element is added to the result object. If it is false the\n *     element is not included.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,V>} a new object in which only elements that passed the\n *     test are present.\n * @template T,K,V\n */\ngoog.object.filter = function(obj, f, opt_obj) {\n  'use strict';\n  const res = {};\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      res[key] = obj[key];\n    }\n  }\n  return res;\n};\n\n\n/**\n * For every element in an object/map/hash calls a function and inserts the\n * result into a new object.\n *\n * @param {Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,Object<K,V>):R} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the value, the key and the object)\n *     and should return something. The result will be inserted\n *     into a new object.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,R>} a new object with the results from f.\n * @template T,K,V,R\n */\ngoog.object.map = function(obj, f, opt_obj) {\n  'use strict';\n  const res = {};\n  for (const key in obj) {\n    res[key] = f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n  return res;\n};\n\n\n/**\n * Calls a function for each element in an object/map/hash. If any\n * call returns true, returns true (without checking the rest). If\n * all calls return false, returns false.\n *\n * @param {Object<K,V>} obj The object to check.\n * @param {function(this:T,V,?,Object<K,V>):boolean} f The function to\n *     call for every element. This function\n *     takes 3 arguments (the value, the key and the object) and should\n *     return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} true if any element passes the test.\n * @template T,K,V\n */\ngoog.object.some = function(obj, f, opt_obj) {\n  'use strict';\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return true;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Calls a function for each element in an object/map/hash. If\n * all calls return true, returns true. If any call returns false, returns\n * false at this point and does not continue to check the remaining elements.\n *\n * @param {Object<K,V>} obj The object to check.\n * @param {?function(this:T,V,?,Object<K,V>):boolean} f The function to\n *     call for every element. This function\n *     takes 3 arguments (the value, the key and the object) and should\n *     return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} false if any element fails the test.\n * @template T,K,V\n */\ngoog.object.every = function(obj, f, opt_obj) {\n  'use strict';\n  for (const key in obj) {\n    if (!f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/**\n * Returns the number of key-value pairs in the object map.\n *\n * @param {Object} obj The object for which to get the number of key-value\n *     pairs.\n * @return {number} The number of key-value pairs in the object map.\n */\ngoog.object.getCount = function(obj) {\n  'use strict';\n  let rv = 0;\n  for (const key in obj) {\n    rv++;\n  }\n  return rv;\n};\n\n\n/**\n * Returns one key from the object map, if any exists.\n * For map literals the returned key will be the first one in most of the\n * browsers (a know exception is Konqueror).\n *\n * @param {Object} obj The object to pick a key from.\n * @return {string|undefined} The key or undefined if the object is empty.\n */\ngoog.object.getAnyKey = function(obj) {\n  'use strict';\n  for (const key in obj) {\n    return key;\n  }\n};\n\n\n/**\n * Returns one value from the object map, if any exists.\n * For map literals the returned value will be the first one in most of the\n * browsers (a know exception is Konqueror).\n *\n * @param {Object<K,V>} obj The object to pick a value from.\n * @return {V|undefined} The value or undefined if the object is empty.\n * @template K,V\n */\ngoog.object.getAnyValue = function(obj) {\n  'use strict';\n  for (const key in obj) {\n    return obj[key];\n  }\n};\n\n\n/**\n * Whether the object/hash/map contains the given object as a value.\n * An alias for goog.object.containsValue(obj, val).\n *\n * @param {Object<K,V>} obj The object in which to look for val.\n * @param {V} val The object for which to check.\n * @return {boolean} true if val is present.\n * @template K,V\n */\ngoog.object.contains = function(obj, val) {\n  'use strict';\n  return goog.object.containsValue(obj, val);\n};\n\n\n/**\n * Returns the values of the object/map/hash.\n *\n * @param {Object<K,V>} obj The object from which to get the values.\n * @return {!Array<V>} The values in the object/map/hash.\n * @template K,V\n */\ngoog.object.getValues = function(obj) {\n  'use strict';\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = obj[key];\n  }\n  return res;\n};\n\n\n/**\n * Returns the keys of the object/map/hash.\n *\n * @param {Object} obj The object from which to get the keys.\n * @return {!Array<string>} Array of property keys.\n */\ngoog.object.getKeys = function(obj) {\n  'use strict';\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = key;\n  }\n  return res;\n};\n\n\n/**\n * Get a value from an object multiple levels deep.  This is useful for\n * pulling values from deeply nested objects, such as JSON responses.\n * Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)\n *\n * @param {!Object} obj An object to get the value from.  Can be array-like.\n * @param {...(string|number|!IArrayLike<number|string>)}\n *     var_args A number of keys\n *     (as strings, or numbers, for array-like objects).  Can also be\n *     specified as a single array of keys.\n * @return {*} The resulting value.  If, at any point, the value for a key\n *     in the current object is null or undefined, returns undefined.\n */\ngoog.object.getValueByKeys = function(obj, var_args) {\n  'use strict';\n  const isArrayLike = goog.isArrayLike(var_args);\n  const keys = isArrayLike ?\n      /** @type {!IArrayLike<number|string>} */ (var_args) :\n      arguments;\n\n  // Start with the 2nd parameter for the variable parameters syntax.\n  for (let i = isArrayLike ? 0 : 1; i < keys.length; i++) {\n    if (obj == null) return undefined;\n    obj = obj[keys[i]];\n  }\n\n  return obj;\n};\n\n\n/**\n * Whether the object/map/hash contains the given key.\n *\n * @param {Object} obj The object in which to look for key.\n * @param {?} key The key for which to check.\n * @return {boolean} true If the map contains the key.\n */\ngoog.object.containsKey = function(obj, key) {\n  'use strict';\n  return obj !== null && key in obj;\n};\n\n\n/**\n * Whether the object/map/hash contains the given value. This is O(n).\n *\n * @param {Object<K,V>} obj The object in which to look for val.\n * @param {V} val The value for which to check.\n * @return {boolean} true If the map contains the value.\n * @template K,V\n */\ngoog.object.containsValue = function(obj, val) {\n  'use strict';\n  for (const key in obj) {\n    if (obj[key] == val) {\n      return true;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its key.\n * @param {Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,Object<K,V>):boolean} f The\n *      function to call for every element. Takes 3 arguments (the value,\n *     the key and the object) and should return a boolean.\n * @param {T=} opt_this An optional \"this\" context for the function.\n * @return {string|undefined} The key of an element for which the function\n *     returns true or undefined if no such element is found.\n * @template T,K,V\n */\ngoog.object.findKey = function(obj, f, opt_this) {\n  'use strict';\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_this), obj[key], key, obj)) {\n      return key;\n    }\n  }\n  return undefined;\n};\n\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its value.\n * @param {Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,Object<K,V>):boolean} f The function\n *     to call for every element. Takes 3 arguments (the value, the key\n *     and the object) and should return a boolean.\n * @param {T=} opt_this An optional \"this\" context for the function.\n * @return {V} The value of an element for which the function returns true or\n *     undefined if no such element is found.\n * @template T,K,V\n */\ngoog.object.findValue = function(obj, f, opt_this) {\n  'use strict';\n  const key = goog.object.findKey(obj, f, opt_this);\n  return key && obj[key];\n};\n\n\n/**\n * Whether the object/map/hash is empty.\n *\n * @param {Object} obj The object to test.\n * @return {boolean} true if obj is empty.\n */\ngoog.object.isEmpty = function(obj) {\n  'use strict';\n  for (const key in obj) {\n    return false;\n  }\n  return true;\n};\n\n\n/**\n * Removes all key value pairs from the object/map/hash.\n *\n * @param {Object} obj The object to clear.\n * @return {void}\n */\ngoog.object.clear = function(obj) {\n  'use strict';\n  for (const i in obj) {\n    delete obj[i];\n  }\n};\n\n\n/**\n * Removes a key-value pair based on the key.\n *\n * @param {Object} obj The object from which to remove the key.\n * @param {?} key The key to remove.\n * @return {boolean} Whether an element was removed.\n */\ngoog.object.remove = function(obj, key) {\n  'use strict';\n  let rv;\n  if (rv = key in /** @type {!Object} */ (obj)) {\n    delete obj[key];\n  }\n  return rv;\n};\n\n\n/**\n * Adds a key-value pair to the object. Throws an exception if the key is\n * already in use. Use set if you want to change an existing pair.\n *\n * @param {Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} val The value to add.\n * @return {void}\n * @template K,V\n */\ngoog.object.add = function(obj, key, val) {\n  'use strict';\n  if (obj !== null && key in obj) {\n    throw new Error('The object already contains the key \"' + key + '\"');\n  }\n  goog.object.set(obj, key, val);\n};\n\n\n/**\n * Returns the value for the given key.\n *\n * @param {Object<K,V>} obj The object from which to get the value.\n * @param {string} key The key for which to get the value.\n * @param {R=} opt_val The value to return if no item is found for the given\n *     key (default is undefined).\n * @return {V|R|undefined} The value for the given key.\n * @template K,V,R\n */\ngoog.object.get = function(obj, key, opt_val) {\n  'use strict';\n  if (obj !== null && key in obj) {\n    return obj[key];\n  }\n  return opt_val;\n};\n\n\n/**\n * Adds a key-value pair to the object/map/hash.\n *\n * @param {Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add.\n * @template K,V\n * @return {void}\n */\ngoog.object.set = function(obj, key, value) {\n  'use strict';\n  obj[key] = value;\n};\n\n\n/**\n * Adds a key-value pair to the object/map/hash if it doesn't exist yet.\n *\n * @param {Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\ngoog.object.setIfUndefined = function(obj, key, value) {\n  'use strict';\n  return key in /** @type {!Object} */ (obj) ? obj[key] : (obj[key] = value);\n};\n\n\n/**\n * Sets a key and value to an object if the key is not set. The value will be\n * the return value of the given function. If the key already exists, the\n * object will not be changed and the function will not be called (the function\n * will be lazily evaluated -- only called if necessary).\n *\n * This function is particularly useful when used with an `Object` which is\n * acting as a cache.\n *\n * @param {!Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {function():V} f The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\ngoog.object.setWithReturnValueIfNotSet = function(obj, key, f) {\n  'use strict';\n  if (key in obj) {\n    return obj[key];\n  }\n\n  const val = f();\n  obj[key] = val;\n  return val;\n};\n\n\n/**\n * Compares two objects for equality using === on the values.\n *\n * @param {!Object<K,V>} a\n * @param {!Object<K,V>} b\n * @return {boolean}\n * @template K,V\n */\ngoog.object.equals = function(a, b) {\n  'use strict';\n  for (const k in a) {\n    if (!(k in b) || a[k] !== b[k]) {\n      return false;\n    }\n  }\n  for (const k in b) {\n    if (!(k in a)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/**\n * Returns a shallow clone of the object.\n *\n * @param {Object<K,V>} obj Object to clone.\n * @return {!Object<K,V>} Clone of the input object.\n * @template K,V\n */\ngoog.object.clone = function(obj) {\n  'use strict';\n  const res = {};\n  for (const key in obj) {\n    res[key] = obj[key];\n  }\n  return res;\n};\n\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n *\n * WARNINGS:\n * <code>goog.object.unsafeClone</code> does not detect reference loops. Objects\n * that refer to themselves will cause infinite recursion.\n *\n * <code>goog.object.unsafeClone</code> is unaware of unique identifiers, and\n * copies UIDs created by <code>getUid</code> into cloned results.\n *\n * @param {T} obj The value to clone.\n * @return {T} A clone of the input value.\n * @template T\n */\ngoog.object.unsafeClone = function(obj) {\n  'use strict';\n  if (!obj || typeof obj !== 'object') return obj;\n  if (typeof obj.clone === 'function') return obj.clone();\n  const clone = Array.isArray(obj) ? [] :\n      typeof ArrayBuffer === 'function' &&\n          typeof ArrayBuffer.isView === 'function' && ArrayBuffer.isView(obj) &&\n          !(obj instanceof DataView) ?\n                                     new obj.constructor(obj.length) :\n                                     {};\n  for (const key in obj) {\n    clone[key] = goog.object.unsafeClone(obj[key]);\n  }\n  return clone;\n};\n\n\n/**\n * Returns a new object in which all the keys and values are interchanged\n * (keys become values and values become keys). If multiple keys map to the\n * same value, the chosen transposed value is implementation-dependent.\n *\n * @param {Object} obj The object to transpose.\n * @return {!Object} The transposed object.\n */\ngoog.object.transpose = function(obj) {\n  'use strict';\n  const transposed = {};\n  for (const key in obj) {\n    transposed[obj[key]] = key;\n  }\n  return transposed;\n};\n\n\n/**\n * The names of the fields that are defined on Object.prototype.\n * @type {Array<string>}\n * @private\n */\ngoog.object.PROTOTYPE_FIELDS_ = [\n  'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',\n  'toLocaleString', 'toString', 'valueOf'\n];\n\n\n/**\n * Extends an object with another object.\n * This operates 'in-place'; it does not create a new Object.\n *\n * Example:\n * var o = {};\n * goog.object.extend(o, {a: 0, b: 1});\n * o; // {a: 0, b: 1}\n * goog.object.extend(o, {b: 2, c: 3});\n * o; // {a: 0, b: 2, c: 3}\n *\n * @param {Object} target The object to modify. Existing properties will be\n *     overwritten if they are also present in one of the objects in\n *     `var_args`.\n * @param {...(Object|null|undefined)} var_args The objects from which values\n *     will be copied.\n * @return {void}\n * @deprecated Prefer Object.assign\n */\ngoog.object.extend = function(target, var_args) {\n  'use strict';\n  let key;\n  let source;\n  for (let i = 1; i < arguments.length; i++) {\n    source = arguments[i];\n    for (key in source) {\n      target[key] = source[key];\n    }\n\n    // For IE the for-in-loop does not contain any properties that are not\n    // enumerable on the prototype object (for example isPrototypeOf from\n    // Object.prototype) and it will also not include 'replace' on objects that\n    // extend String and change 'replace' (not that it is common for anyone to\n    // extend anything except Object).\n\n    for (let j = 0; j < goog.object.PROTOTYPE_FIELDS_.length; j++) {\n      key = goog.object.PROTOTYPE_FIELDS_[j];\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n};\n\n\n/**\n * Creates a new object built from the key-value pairs provided as arguments.\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise even arguments are used as\n *     the property names and odd arguments are used as the property values.\n * @return {!Object} The new object.\n * @throws {Error} If there are uneven number of arguments or there is only one\n *     non array argument.\n */\ngoog.object.create = function(var_args) {\n  'use strict';\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return goog.object.create.apply(null, arguments[0]);\n  }\n\n  if (argLength % 2) {\n    throw new Error('Uneven number of arguments');\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i += 2) {\n    rv[arguments[i]] = arguments[i + 1];\n  }\n  return rv;\n};\n\n\n/**\n * Creates a new object where the property names come from the arguments but\n * the value is always set to true\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise the arguments are used\n *     as the property names.\n * @return {!Object} The new object.\n */\ngoog.object.createSet = function(var_args) {\n  'use strict';\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return goog.object.createSet.apply(null, arguments[0]);\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i++) {\n    rv[arguments[i]] = true;\n  }\n  return rv;\n};\n\n\n/**\n * Creates an immutable view of the underlying object, if the browser\n * supports immutable objects.\n *\n * In default mode, writes to this view will fail silently. In strict mode,\n * they will throw an error.\n *\n * @param {!Object<K,V>} obj An object.\n * @return {!Object<K,V>} An immutable view of that object, or the\n *     original object if this browser does not support immutables.\n * @template K,V\n */\ngoog.object.createImmutableView = function(obj) {\n  'use strict';\n  let result = obj;\n  if (Object.isFrozen && !Object.isFrozen(obj)) {\n    result = Object.create(obj);\n    Object.freeze(result);\n  }\n  return result;\n};\n\n\n/**\n * @param {!Object} obj An object.\n * @return {boolean} Whether this is an immutable view of the object.\n */\ngoog.object.isImmutableView = function(obj) {\n  'use strict';\n  return !!Object.isFrozen && Object.isFrozen(obj);\n};\n\n\n/**\n * Get all properties names on a given Object regardless of enumerability.\n *\n * <p> If the browser does not support `Object.getOwnPropertyNames` nor\n * `Object.getPrototypeOf` then this is equivalent to using\n * `goog.object.getKeys`\n *\n * @param {?Object} obj The object to get the properties of.\n * @param {boolean=} opt_includeObjectPrototype Whether properties defined on\n *     `Object.prototype` should be included in the result.\n * @param {boolean=} opt_includeFunctionPrototype Whether properties defined on\n *     `Function.prototype` should be included in the result.\n * @return {!Array<string>}\n * @public\n */\ngoog.object.getAllPropertyNames = function(\n    obj, opt_includeObjectPrototype, opt_includeFunctionPrototype) {\n  'use strict';\n  if (!obj) {\n    return [];\n  }\n\n  // Naively use a for..in loop to get the property names if the browser doesn't\n  // support any other APIs for getting it.\n  if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {\n    return goog.object.getKeys(obj);\n  }\n\n  const visitedSet = {};\n\n  // Traverse the prototype chain and add all properties to the visited set.\n  let proto = obj;\n  while (proto &&\n         (proto !== Object.prototype || !!opt_includeObjectPrototype) &&\n         (proto !== Function.prototype || !!opt_includeFunctionPrototype)) {\n    const names = Object.getOwnPropertyNames(proto);\n    for (let i = 0; i < names.length; i++) {\n      visitedSet[names[i]] = true;\n    }\n    proto = Object.getPrototypeOf(proto);\n  }\n\n  return goog.object.getKeys(visitedSet);\n};\n\n\n/**\n * Given a ES5 or ES6 class reference, return its super class / super\n * constructor.\n *\n * This should be used in rare cases where you need to walk up the inheritance\n * tree (this is generally a bad idea). But this work with ES5 and ES6 classes,\n * unlike relying on the superClass_ property.\n *\n * Note: To start walking up the hierarchy from an instance call this with its\n * `constructor` property; e.g. `getSuperClass(instance.constructor)`.\n *\n * @param {function(new: ?)} constructor\n * @return {?Object}\n */\ngoog.object.getSuperClass = function(constructor) {\n  'use strict';\n  var proto = Object.getPrototypeOf(constructor.prototype);\n  return proto && proto.constructor;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Useful compiler idioms.\n */\n\ngoog.provide('goog.reflect');\n\n\n/**\n * Syntax for object literal casts.\n * @see http://go/jscompiler-renaming\n * @see https://goo.gl/CRs09P\n *\n * Use this if you have an object literal whose keys need to have the same names\n * as the properties of some class even after they are renamed by the compiler.\n *\n * @param {!Function} type Type to cast to.\n * @param {Object} object Object literal to cast.\n * @return {Object} The object literal.\n */\ngoog.reflect.object = function(type, object) {\n  'use strict';\n  return object;\n};\n\n/**\n * Syntax for renaming property strings.\n * @see http://go/jscompiler-renaming\n * @see https://goo.gl/CRs09P\n *\n * Use this if you have an need to access a property as a string, but want\n * to also have the property renamed by the compiler. In contrast to\n * goog.reflect.object, this method takes an instance of an object.\n *\n * Properties must be simple names (not qualified names).\n *\n * @param {string} prop Name of the property\n * @param {!Object} object Instance of the object whose type will be used\n *     for renaming\n * @return {string} The renamed property.\n */\ngoog.reflect.objectProperty = function(prop, object) {\n  'use strict';\n  return prop;\n};\n\n/**\n * To assert to the compiler that an operation is needed when it would\n * otherwise be stripped. For example:\n * <code>\n *     // Force a layout\n *     goog.reflect.sinkValue(dialog.offsetHeight);\n * </code>\n * @param {T} x\n * @return {T}\n * @template T\n */\ngoog.reflect.sinkValue = function(x) {\n  'use strict';\n  goog.reflect.sinkValue[' '](x);\n  return x;\n};\n\n\n/**\n * The compiler should optimize this function away iff no one ever uses\n * goog.reflect.sinkValue.\n */\ngoog.reflect.sinkValue[' '] = goog.nullFunction;\n\n\n/**\n * Check if a property can be accessed without throwing an exception.\n * @param {Object} obj The owner of the property.\n * @param {string} prop The property name.\n * @return {boolean} Whether the property is accessible. Will also return true\n *     if obj is null.\n */\ngoog.reflect.canAccessProperty = function(obj, prop) {\n  'use strict';\n  try {\n    goog.reflect.sinkValue(obj[prop]);\n    return true;\n  } catch (e) {\n  }\n  return false;\n};\n\n\n/**\n * Retrieves a value from a cache given a key. The compiler provides special\n * consideration for this call such that it is generally considered side-effect\n * free. However, if the `opt_keyFn` or `valueFn` have side-effects\n * then the entire call is considered to have side-effects.\n *\n * Conventionally storing the value on the cache would be considered a\n * side-effect and preclude unused calls from being pruned, ie. even if\n * the value was never used, it would still always be stored in the cache.\n *\n * Providing a side-effect free `valueFn` and `opt_keyFn`\n * allows unused calls to `goog.reflect.cache` to be pruned.\n *\n * @param {!Object<K, V>} cacheObj The object that contains the cached values.\n * @param {?} key The key to lookup in the cache. If it is not string or number\n *     then a `opt_keyFn` should be provided. The key is also used as the\n *     parameter to the `valueFn`.\n * @param {function(?):V} valueFn The value provider to use to calculate the\n *     value to store in the cache. This function should be side-effect free\n *     to take advantage of the optimization.\n * @param {function(?):K=} opt_keyFn The key provider to determine the cache\n *     map key. This should be used if the given key is not a string or number.\n *     If not provided then the given key is used. This function should be\n *     side-effect free to take advantage of the optimization.\n * @return {V} The cached or calculated value.\n * @template K\n * @template V\n */\ngoog.reflect.cache = function(cacheObj, key, valueFn, opt_keyFn) {\n  'use strict';\n  const storedKey = opt_keyFn ? opt_keyFn(key) : key;\n\n  if (Object.prototype.hasOwnProperty.call(cacheObj, storedKey)) {\n    return cacheObj[storedKey];\n  }\n\n  return (cacheObj[storedKey] = valueFn(key));\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Rendering engine detection.\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For information on the browser brand (such as Safari versus Chrome), see\n * goog.userAgent.product.\n * @see ../demos/useragent.html\n */\n\ngoog.provide('goog.userAgent');\n\ngoog.require('goog.labs.userAgent.browser');\ngoog.require('goog.labs.userAgent.engine');\ngoog.require('goog.labs.userAgent.platform');\ngoog.require('goog.labs.userAgent.util');\ngoog.require('goog.reflect');\ngoog.require('goog.string');\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is IE.\n */\ngoog.userAgent.ASSUME_IE = goog.define('goog.userAgent.ASSUME_IE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is EDGE,\n * referring to EdgeHTML based Edge.\n */\ngoog.userAgent.ASSUME_EDGE = goog.define('goog.userAgent.ASSUME_EDGE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is GECKO.\n */\ngoog.userAgent.ASSUME_GECKO = goog.define('goog.userAgent.ASSUME_GECKO', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is WEBKIT.\n */\ngoog.userAgent.ASSUME_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is a\n *     mobile device running WebKit e.g. iPhone or Android.\n */\ngoog.userAgent.ASSUME_MOBILE_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_MOBILE_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is OPERA,\n * referring to Presto-based Opera.\n */\ngoog.userAgent.ASSUME_OPERA = goog.define('goog.userAgent.ASSUME_OPERA', false);\n\n\n/**\n * @define {boolean} Whether the\n *     `goog.userAgent.isVersionOrHigher`\n *     function will return true for any version.\n */\ngoog.userAgent.ASSUME_ANY_VERSION =\n    goog.define('goog.userAgent.ASSUME_ANY_VERSION', false);\n\n\n/**\n * Whether we know the browser engine at compile-time.\n * @type {boolean}\n * @private\n */\ngoog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE ||\n    goog.userAgent.ASSUME_EDGE || goog.userAgent.ASSUME_GECKO ||\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT ||\n    goog.userAgent.ASSUME_OPERA;\n\n\n/**\n * Returns the userAgent string for the current browser.\n *\n * @return {string} The userAgent string.\n */\ngoog.userAgent.getUserAgentString = function() {\n  'use strict';\n  return goog.labs.userAgent.util.getUserAgent();\n};\n\n\n/**\n * @return {?Navigator} The native navigator object.\n */\ngoog.userAgent.getNavigatorTyped = function() {\n  'use strict';\n  // Need a local navigator reference instead of using the global one,\n  // to avoid the rare case where they reference different objects.\n  // (in a WorkerPool, for example).\n  return goog.global['navigator'] || null;\n};\n\n\n/**\n * TODO(nnaze): Change type to \"Navigator\" and update compilation targets.\n * @return {?Object} The native navigator object.\n */\ngoog.userAgent.getNavigator = function() {\n  'use strict';\n  return goog.userAgent.getNavigatorTyped();\n};\n\n\n/**\n * Whether the user agent is Presto-based Opera.\n * @type {boolean}\n */\ngoog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_OPERA :\n    goog.labs.userAgent.browser.isOpera();\n\n\n/**\n * Whether the user agent is Internet Explorer.\n * @type {boolean}\n */\ngoog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_IE :\n    goog.labs.userAgent.browser.isIE();\n\n\n/**\n * Whether the user agent is Microsoft Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_EDGE :\n    goog.labs.userAgent.engine.isEdge();\n\n\n/**\n * Whether the user agent is MS Internet Explorer or MS Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE;\n\n\n/**\n * Whether the user agent is Gecko. Gecko is the rendering engine used by\n * Mozilla, Firefox, and others.\n * @type {boolean}\n */\ngoog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_GECKO :\n    goog.labs.userAgent.engine.isGecko();\n\n\n/**\n * Whether the user agent is WebKit. WebKit is the rendering engine that\n * Safari, Edge Chromium, Opera Chromium, Android and others use.\n * @type {boolean}\n */\ngoog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT :\n    goog.labs.userAgent.engine.isWebKit();\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * This is a separate function so that the logic can be tested.\n *\n * TODO(nnaze): Investigate swapping in goog.labs.userAgent.device.isMobile().\n *\n * @return {boolean} Whether the user agent is running on a mobile device.\n * @private\n */\ngoog.userAgent.isMobile_ = function() {\n  'use strict';\n  return goog.userAgent.WEBKIT &&\n      goog.labs.userAgent.util.matchUserAgent('Mobile');\n};\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * TODO(nnaze): Consider deprecating MOBILE when labs.userAgent\n *   is promoted as the gecko/webkit logic is likely inaccurate.\n *\n * @type {boolean}\n */\ngoog.userAgent.MOBILE =\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_();\n\n\n/**\n * Used while transitioning code to use WEBKIT instead.\n * @type {boolean}\n * @deprecated Use {@link goog.userAgent.product.SAFARI} instead.\n * TODO(nicksantos): Delete this from goog.userAgent.\n */\ngoog.userAgent.SAFARI = goog.userAgent.WEBKIT;\n\n\n/**\n * @return {string} the platform (operating system) the user agent is running\n *     on. Default to empty string because navigator.platform may not be defined\n *     (on Rhino, for example).\n * @private\n */\ngoog.userAgent.determinePlatform_ = function() {\n  'use strict';\n  var navigator = goog.userAgent.getNavigatorTyped();\n  return navigator && navigator.platform || '';\n};\n\n\n/**\n * The platform (operating system) the user agent is running on. Default to\n * empty string because navigator.platform may not be defined (on Rhino, for\n * example).\n * @type {string}\n */\ngoog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Macintosh operating\n *     system.\n */\ngoog.userAgent.ASSUME_MAC = goog.define('goog.userAgent.ASSUME_MAC', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Windows operating\n *     system.\n */\ngoog.userAgent.ASSUME_WINDOWS =\n    goog.define('goog.userAgent.ASSUME_WINDOWS', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Linux operating\n *     system.\n */\ngoog.userAgent.ASSUME_LINUX = goog.define('goog.userAgent.ASSUME_LINUX', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a X11 windowing\n *     system.\n */\ngoog.userAgent.ASSUME_X11 = goog.define('goog.userAgent.ASSUME_X11', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on Android.\n */\ngoog.userAgent.ASSUME_ANDROID =\n    goog.define('goog.userAgent.ASSUME_ANDROID', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPhone.\n */\ngoog.userAgent.ASSUME_IPHONE =\n    goog.define('goog.userAgent.ASSUME_IPHONE', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPad.\n */\ngoog.userAgent.ASSUME_IPAD = goog.define('goog.userAgent.ASSUME_IPAD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPod.\n */\ngoog.userAgent.ASSUME_IPOD = goog.define('goog.userAgent.ASSUME_IPOD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on KaiOS.\n */\ngoog.userAgent.ASSUME_KAIOS = goog.define('goog.userAgent.ASSUME_KAIOS', false);\n\n\n/**\n * @type {boolean}\n * @private\n */\ngoog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC ||\n    goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX ||\n    goog.userAgent.ASSUME_X11 || goog.userAgent.ASSUME_ANDROID ||\n    goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||\n    goog.userAgent.ASSUME_IPOD;\n\n\n/**\n * Whether the user agent is running on a Macintosh operating system.\n * @type {boolean}\n */\ngoog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_MAC :\n    goog.labs.userAgent.platform.isMacintosh();\n\n\n/**\n * Whether the user agent is running on a Windows operating system.\n * @type {boolean}\n */\ngoog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_WINDOWS :\n    goog.labs.userAgent.platform.isWindows();\n\n\n/**\n * Whether the user agent is Linux per the legacy behavior of\n * goog.userAgent.LINUX, which considered ChromeOS to also be\n * Linux.\n * @return {boolean}\n * @private\n */\ngoog.userAgent.isLegacyLinux_ = function() {\n  'use strict';\n  return goog.labs.userAgent.platform.isLinux() ||\n      goog.labs.userAgent.platform.isChromeOS();\n};\n\n\n/**\n * Whether the user agent is running on a Linux operating system.\n *\n * Note that goog.userAgent.LINUX considers ChromeOS to be Linux,\n * while goog.labs.userAgent.platform considers ChromeOS and\n * Linux to be different OSes.\n *\n * @type {boolean}\n */\ngoog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_LINUX :\n    goog.userAgent.isLegacyLinux_();\n\n\n/**\n * @return {boolean} Whether the user agent is an X11 windowing system.\n * @private\n */\ngoog.userAgent.isX11_ = function() {\n  'use strict';\n  var navigator = goog.userAgent.getNavigatorTyped();\n  return !!navigator &&\n      goog.string.contains(navigator['appVersion'] || '', 'X11');\n};\n\n\n/**\n * Whether the user agent is running on a X11 windowing system.\n * @type {boolean}\n */\ngoog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_X11 :\n    goog.userAgent.isX11_();\n\n\n/**\n * Whether the user agent is running on Android.\n * @type {boolean}\n */\ngoog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_ANDROID :\n    goog.labs.userAgent.platform.isAndroid();\n\n\n/**\n * Whether the user agent is running on an iPhone.\n * @type {boolean}\n */\ngoog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPHONE :\n    goog.labs.userAgent.platform.isIphone();\n\n\n/**\n * Whether the user agent is running on an iPad.\n * @type {boolean}\n */\ngoog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPAD :\n    goog.labs.userAgent.platform.isIpad();\n\n\n/**\n * Whether the user agent is running on an iPod.\n * @type {boolean}\n */\ngoog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPOD :\n    goog.labs.userAgent.platform.isIpod();\n\n\n/**\n * Whether the user agent is running on iOS.\n * @type {boolean}\n */\ngoog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    (goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||\n     goog.userAgent.ASSUME_IPOD) :\n    goog.labs.userAgent.platform.isIos();\n\n/**\n * Whether the user agent is running on KaiOS.\n * @type {boolean}\n */\ngoog.userAgent.KAIOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_KAIOS :\n    goog.labs.userAgent.platform.isKaiOS();\n\n\n/**\n * @return {string} The string that describes the version number of the user\n *     agent.\n * @private\n */\ngoog.userAgent.determineVersion_ = function() {\n  'use strict';\n  // All browsers have different ways to detect the version and they all have\n  // different naming schemes.\n  // version is a string rather than a number because it may contain 'b', 'a',\n  // and so on.\n  var version = '';\n  var arr = goog.userAgent.getVersionRegexResult_();\n  if (arr) {\n    version = arr ? arr[1] : '';\n  }\n\n  if (goog.userAgent.IE) {\n    // IE9 can be in document mode 9 but be reporting an inconsistent user agent\n    // version.  If it is identifying as a version lower than 9 we take the\n    // documentMode as the version instead.  IE8 has similar behavior.\n    // It is recommended to set the X-UA-Compatible header to ensure that IE9\n    // uses documentMode 9.\n    var docMode = goog.userAgent.getDocumentMode_();\n    if (docMode != null && docMode > parseFloat(version)) {\n      return String(docMode);\n    }\n  }\n\n  return version;\n};\n\n\n/**\n * @return {?IArrayLike<string>|undefined} The version regex matches from\n *     parsing the user\n *     agent string. These regex statements must be executed inline so they can\n *     be compiled out by the closure compiler with the rest of the useragent\n *     detection logic when ASSUME_* is specified.\n * @private\n */\ngoog.userAgent.getVersionRegexResult_ = function() {\n  'use strict';\n  var userAgent = goog.userAgent.getUserAgentString();\n  if (goog.userAgent.GECKO) {\n    return /rv\\:([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.EDGE) {\n    return /Edge\\/([\\d\\.]+)/.exec(userAgent);\n  }\n  if (goog.userAgent.IE) {\n    return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.WEBKIT) {\n    // WebKit/125.4\n    return /WebKit\\/(\\S+)/.exec(userAgent);\n  }\n  if (goog.userAgent.OPERA) {\n    // If none of the above browsers were detected but the browser is Opera, the\n    // only string that is of interest is 'Version/<number>'.\n    return /(?:Version)[ \\/]?(\\S+)/.exec(userAgent);\n  }\n  return undefined;\n};\n\n\n/**\n * @return {number|undefined} Returns the document mode (for testing).\n * @private\n */\ngoog.userAgent.getDocumentMode_ = function() {\n  'use strict';\n  // NOTE(user): goog.userAgent may be used in context where there is no DOM.\n  var doc = goog.global['document'];\n  return doc ? doc['documentMode'] : undefined;\n};\n\n\n/**\n * The version of the user agent. This is a string because it might contain\n * 'b' (as in beta) as well as multiple dots.\n * @type {string}\n */\ngoog.userAgent.VERSION = goog.userAgent.determineVersion_();\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string} v1 Version of first item.\n * @param {string} v2 Version of second item.\n *\n * @return {number}  1 if first argument is higher\n *                   0 if arguments are equal\n *                  -1 if second argument is higher.\n * @deprecated Use goog.string.compareVersions.\n */\ngoog.userAgent.compare = function(v1, v2) {\n  'use strict';\n  return goog.string.compareVersions(v1, v2);\n};\n\n\n/**\n * Cache for {@link goog.userAgent.isVersionOrHigher}.\n * Calls to compareVersions are surprisingly expensive and, as a browser's\n * version number is unlikely to change during a session, we cache the results.\n * @const\n * @private\n */\ngoog.userAgent.isVersionOrHigherCache_ = {};\n\n\n/**\n * Whether the user agent version is higher or the same as the given version.\n * NOTE: When checking the version numbers for Firefox and Safari, be sure to\n * use the engine's version, not the browser's version number.  For example,\n * Firefox 3.0 corresponds to Gecko 1.9 and Safari 3.0 to Webkit 522.11.\n * Opera and Internet Explorer versions match the product release number.<br>\n * @see <a href=\"http://en.wikipedia.org/wiki/Safari_version_history\">\n *     Webkit</a>\n * @see <a href=\"http://en.wikipedia.org/wiki/Gecko_engine\">Gecko</a>\n *\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the user agent version is higher or the same as\n *     the given version.\n */\ngoog.userAgent.isVersionOrHigher = function(version) {\n  'use strict';\n  return goog.userAgent.ASSUME_ANY_VERSION ||\n      goog.reflect.cache(\n          goog.userAgent.isVersionOrHigherCache_, version, function() {\n            'use strict';\n            return goog.string.compareVersions(\n                       goog.userAgent.VERSION, version) >= 0;\n          });\n};\n\n\n/**\n * Deprecated alias to `goog.userAgent.isVersionOrHigher`.\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the user agent version is higher or the same as\n *     the given version.\n * @deprecated Use goog.userAgent.isVersionOrHigher().\n */\ngoog.userAgent.isVersion = goog.userAgent.isVersionOrHigher;\n\n\n/**\n * Whether the IE effective document mode is higher or the same as the given\n * document mode version.\n * NOTE: Only for IE, return false for another browser.\n *\n * @param {number} documentMode The document mode version to check.\n * @return {boolean} Whether the IE effective document mode is higher or the\n *     same as the given version.\n */\ngoog.userAgent.isDocumentModeOrHigher = function(documentMode) {\n  'use strict';\n  return Number(goog.userAgent.DOCUMENT_MODE) >= documentMode;\n};\n\n\n/**\n * Deprecated alias to `goog.userAgent.isDocumentModeOrHigher`.\n * @param {number} version The version to check.\n * @return {boolean} Whether the IE effective document mode is higher or the\n *      same as the given version.\n * @deprecated Use goog.userAgent.isDocumentModeOrHigher().\n */\ngoog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher;\n\n\n/**\n * For IE version < 7, documentMode is undefined, so attempt to use the\n * CSS1Compat property to see if we are in standards mode. If we are in\n * standards mode, treat the browser version as the document mode. Otherwise,\n * IE is emulating version 5.\n *\n * NOTE(user): Support for IE < 7 is long gone, so this is now simplified.\n * It returns document.documentMode for IE and undefined for everything else.\n *\n * @type {number|undefined}\n * @const\n */\ngoog.userAgent.DOCUMENT_MODE = (function() {\n  'use strict';\n  var doc = goog.global['document'];\n  if (!doc || !goog.userAgent.IE) return undefined;\n  // This must be an IE user agent.\n  var documentMode = goog.userAgent.getDocumentMode_();\n  if (documentMode) return documentMode;\n  // The user agent version string begins with the major version.\n  // Parse the major version and truncate anything following.\n  var ieVersion = parseInt(goog.userAgent.VERSION, 10);\n  return ieVersion || undefined;\n})();\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection (Browser).\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For more information on rendering engine, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent, goog.labs.userAgent.platform,\n * goog.labs.userAgent.device respectively.)\n */\n\ngoog.provide('goog.labs.userAgent.browser');\n\ngoog.require('goog.array');\ngoog.require('goog.labs.userAgent.util');\ngoog.require('goog.object');\ngoog.require('goog.string.internal');\n\n\n// TODO(nnaze): Refactor to remove excessive exclusion logic in matching\n// functions.\n\n\n/**\n * @return {boolean} Whether the user's browser is Opera.  Note: Chromium\n *     based Opera (Opera 15+) is detected as Chrome to avoid unnecessary\n *     special casing.\n * @private\n */\ngoog.labs.userAgent.browser.matchOpera_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Opera');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is IE.\n * @private\n */\ngoog.labs.userAgent.browser.matchIE_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Trident') ||\n      goog.labs.userAgent.util.matchUserAgent('MSIE');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Edge. This refers to EdgeHTML\n * based Edge.\n * @private\n */\ngoog.labs.userAgent.browser.matchEdgeHtml_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Edge');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Chromium based Edge.\n * @private\n */\ngoog.labs.userAgent.browser.matchEdgeChromium_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Edg/');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Chromium based Opera.\n * @private\n */\ngoog.labs.userAgent.browser.matchOperaChromium_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('OPR');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Firefox.\n * @private\n */\ngoog.labs.userAgent.browser.matchFirefox_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Firefox') ||\n      goog.labs.userAgent.util.matchUserAgent('FxiOS');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Safari.\n * @private\n */\ngoog.labs.userAgent.browser.matchSafari_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Safari') &&\n      !(goog.labs.userAgent.browser.matchChrome_() ||\n        goog.labs.userAgent.browser.matchCoast_() ||\n        goog.labs.userAgent.browser.matchOpera_() ||\n        goog.labs.userAgent.browser.matchEdgeHtml_() ||\n        goog.labs.userAgent.browser.matchEdgeChromium_() ||\n        goog.labs.userAgent.browser.matchOperaChromium_() ||\n        goog.labs.userAgent.browser.matchFirefox_() ||\n        goog.labs.userAgent.browser.isSilk() ||\n        goog.labs.userAgent.util.matchUserAgent('Android'));\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n *     iOS browser).\n * @private\n */\ngoog.labs.userAgent.browser.matchCoast_ = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Coast');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is iOS Webview.\n * @private\n */\ngoog.labs.userAgent.browser.matchIosWebview_ = function() {\n  'use strict';\n  // iOS Webview does not show up as Chrome or Safari. Also check for Opera's\n  // WebKit-based iOS browser, Coast.\n  return (goog.labs.userAgent.util.matchUserAgent('iPad') ||\n          goog.labs.userAgent.util.matchUserAgent('iPhone')) &&\n      !goog.labs.userAgent.browser.matchSafari_() &&\n      !goog.labs.userAgent.browser.matchChrome_() &&\n      !goog.labs.userAgent.browser.matchCoast_() &&\n      !goog.labs.userAgent.browser.matchFirefox_() &&\n      goog.labs.userAgent.util.matchUserAgent('AppleWebKit');\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium browser. This\n * returns true for Chrome, Opera 15+, and Edge Chromium.\n * @private\n */\ngoog.labs.userAgent.browser.matchChrome_ = function() {\n  'use strict';\n  return (goog.labs.userAgent.util.matchUserAgent('Chrome') ||\n          goog.labs.userAgent.util.matchUserAgent('CriOS')) &&\n      !goog.labs.userAgent.browser.matchEdgeHtml_();\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is the Android browser.\n * @private\n */\ngoog.labs.userAgent.browser.matchAndroidBrowser_ = function() {\n  'use strict';\n  // Android can appear in the user agent string for Chrome on Android.\n  // This is not the Android standalone browser if it does.\n  return goog.labs.userAgent.util.matchUserAgent('Android') &&\n      !(goog.labs.userAgent.browser.isChrome() ||\n        goog.labs.userAgent.browser.isFirefox() ||\n        goog.labs.userAgent.browser.isOpera() ||\n        goog.labs.userAgent.browser.isSilk());\n};\n\n\n/**\n * @return {boolean} Whether the user's browser is Opera.\n */\ngoog.labs.userAgent.browser.isOpera = goog.labs.userAgent.browser.matchOpera_;\n\n\n/**\n * @return {boolean} Whether the user's browser is IE.\n */\ngoog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_;\n\n\n/**\n * @return {boolean} Whether the user's browser is EdgeHTML based Edge.\n */\ngoog.labs.userAgent.browser.isEdge = goog.labs.userAgent.browser.matchEdgeHtml_;\n\n\n/**\n * @return {boolean} Whether the user's browser is Chromium based Edge.\n */\ngoog.labs.userAgent.browser.isEdgeChromium =\n    goog.labs.userAgent.browser.matchEdgeChromium_;\n\n/**\n * @return {boolean} Whether the user's browser is Chromium based Opera.\n */\ngoog.labs.userAgent.browser.isOperaChromium =\n    goog.labs.userAgent.browser.matchOperaChromium_;\n\n/**\n * @return {boolean} Whether the user's browser is Firefox.\n */\ngoog.labs.userAgent.browser.isFirefox =\n    goog.labs.userAgent.browser.matchFirefox_;\n\n\n/**\n * @return {boolean} Whether the user's browser is Safari.\n */\ngoog.labs.userAgent.browser.isSafari = goog.labs.userAgent.browser.matchSafari_;\n\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n *     iOS browser).\n */\ngoog.labs.userAgent.browser.isCoast = goog.labs.userAgent.browser.matchCoast_;\n\n\n/**\n * @return {boolean} Whether the user's browser is iOS Webview.\n */\ngoog.labs.userAgent.browser.isIosWebview =\n    goog.labs.userAgent.browser.matchIosWebview_;\n\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium based browser (\n * Chrome, Blink-based Opera (15+) and Edge Chromium).\n */\ngoog.labs.userAgent.browser.isChrome = goog.labs.userAgent.browser.matchChrome_;\n\n\n/**\n * @return {boolean} Whether the user's browser is the Android browser.\n */\ngoog.labs.userAgent.browser.isAndroidBrowser =\n    goog.labs.userAgent.browser.matchAndroidBrowser_;\n\n\n/**\n * For more information, see:\n * http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html\n * @return {boolean} Whether the user's browser is Silk.\n */\ngoog.labs.userAgent.browser.isSilk = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Silk');\n};\n\n\n/**\n * @return {string} The browser version or empty string if version cannot be\n *     determined. Note that for Internet Explorer, this returns the version of\n *     the browser, not the version of the rendering engine. (IE 8 in\n *     compatibility mode will return 8.0 rather than 7.0. To determine the\n *     rendering engine version, look at document.documentMode instead. See\n *     http://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx for more\n *     details.)\n */\ngoog.labs.userAgent.browser.getVersion = function() {\n  'use strict';\n  var userAgentString = goog.labs.userAgent.util.getUserAgent();\n  // Special case IE since IE's version is inside the parenthesis and\n  // without the '/'.\n  if (goog.labs.userAgent.browser.isIE()) {\n    return goog.labs.userAgent.browser.getIEVersion_(userAgentString);\n  }\n\n  var versionTuples =\n      goog.labs.userAgent.util.extractVersionTuples(userAgentString);\n\n  // Construct a map for easy lookup.\n  var versionMap = {};\n  goog.array.forEach(versionTuples, function(tuple) {\n    'use strict';\n    // Note that the tuple is of length three, but we only care about the\n    // first two.\n    var key = tuple[0];\n    var value = tuple[1];\n    versionMap[key] = value;\n  });\n\n  var versionMapHasKey = goog.partial(goog.object.containsKey, versionMap);\n\n  // Gives the value with the first key it finds, otherwise empty string.\n  function lookUpValueWithKeys(keys) {\n    var key = goog.array.find(keys, versionMapHasKey);\n    return versionMap[key] || '';\n  }\n\n  // Check Opera before Chrome since Opera 15+ has \"Chrome\" in the string.\n  // See\n  // http://my.opera.com/ODIN/blog/2013/07/15/opera-user-agent-strings-opera-15-and-beyond\n  if (goog.labs.userAgent.browser.isOpera()) {\n    // Opera 10 has Version/10.0 but Opera/9.8, so look for \"Version\" first.\n    // Opera uses 'OPR' for more recent UAs.\n    return lookUpValueWithKeys(['Version', 'Opera']);\n  }\n\n  // Check Edge before Chrome since it has Chrome in the string.\n  if (goog.labs.userAgent.browser.isEdge()) {\n    return lookUpValueWithKeys(['Edge']);\n  }\n\n  // Check Chromium Edge before Chrome since it has Chrome in the string.\n  if (goog.labs.userAgent.browser.isEdgeChromium()) {\n    return lookUpValueWithKeys(['Edg']);\n  }\n\n  if (goog.labs.userAgent.browser.isChrome()) {\n    return lookUpValueWithKeys(['Chrome', 'CriOS', 'HeadlessChrome']);\n  }\n\n  // Usually products browser versions are in the third tuple after \"Mozilla\"\n  // and the engine.\n  var tuple = versionTuples[2];\n  return tuple && tuple[1] || '';\n};\n\n\n/**\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the browser version is higher or the same as the\n *     given version.\n */\ngoog.labs.userAgent.browser.isVersionOrHigher = function(version) {\n  'use strict';\n  return goog.string.internal.compareVersions(\n             goog.labs.userAgent.browser.getVersion(), version) >= 0;\n};\n\n\n/**\n * Determines IE version. More information:\n * http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx#uaString\n * http://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx\n * http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx\n * http://blogs.msdn.com/b/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx\n *\n * @param {string} userAgent the User-Agent.\n * @return {string}\n * @private\n */\ngoog.labs.userAgent.browser.getIEVersion_ = function(userAgent) {\n  'use strict';\n  // IE11 may identify itself as MSIE 9.0 or MSIE 10.0 due to an IE 11 upgrade\n  // bug. Example UA:\n  // Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0; rv:11.0)\n  // like Gecko.\n  // See http://www.whatismybrowser.com/developers/unknown-user-agent-fragments.\n  var rv = /rv: *([\\d\\.]*)/.exec(userAgent);\n  if (rv && rv[1]) {\n    return rv[1];\n  }\n\n  var version = '';\n  var msie = /MSIE +([\\d\\.]+)/.exec(userAgent);\n  if (msie && msie[1]) {\n    // IE in compatibility mode usually identifies itself as MSIE 7.0; in this\n    // case, use the Trident version to determine the version of IE. For more\n    // details, see the links above.\n    var tridentVersion = /Trident\\/(\\d.\\d)/.exec(userAgent);\n    if (msie[1] == '7.0') {\n      if (tridentVersion && tridentVersion[1]) {\n        switch (tridentVersion[1]) {\n          case '4.0':\n            version = '8.0';\n            break;\n          case '5.0':\n            version = '9.0';\n            break;\n          case '6.0':\n            version = '10.0';\n            break;\n          case '7.0':\n            version = '11.0';\n            break;\n        }\n      } else {\n        version = '7.0';\n      }\n    } else {\n      version = msie[1];\n    }\n  }\n  return version;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection.\n * @see http://en.wikipedia.org/wiki/User_agent\n * For more information on browser brand, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent (browser, platform, and device).\n */\n\ngoog.provide('goog.labs.userAgent.engine');\n\ngoog.require('goog.array');\ngoog.require('goog.labs.userAgent.util');\ngoog.require('goog.string');\n\n\n/**\n * @return {boolean} Whether the rendering engine is Presto.\n */\ngoog.labs.userAgent.engine.isPresto = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Presto');\n};\n\n\n/**\n * @return {boolean} Whether the rendering engine is Trident.\n */\ngoog.labs.userAgent.engine.isTrident = function() {\n  'use strict';\n  // IE only started including the Trident token in IE8.\n  return goog.labs.userAgent.util.matchUserAgent('Trident') ||\n      goog.labs.userAgent.util.matchUserAgent('MSIE');\n};\n\n\n/**\n * @return {boolean} Whether the rendering engine is EdgeHTML.\n */\ngoog.labs.userAgent.engine.isEdge = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Edge');\n};\n\n\n/**\n * @return {boolean} Whether the rendering engine is WebKit. This will return\n * true for Chrome, Blink-based Opera (15+), Edge Chromium and Safari.\n */\ngoog.labs.userAgent.engine.isWebKit = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgentIgnoreCase('WebKit') &&\n      !goog.labs.userAgent.engine.isEdge();\n};\n\n\n/**\n * @return {boolean} Whether the rendering engine is Gecko.\n */\ngoog.labs.userAgent.engine.isGecko = function() {\n  'use strict';\n  return goog.labs.userAgent.util.matchUserAgent('Gecko') &&\n      !goog.labs.userAgent.engine.isWebKit() &&\n      !goog.labs.userAgent.engine.isTrident() &&\n      !goog.labs.userAgent.engine.isEdge();\n};\n\n\n/**\n * @return {string} The rendering engine's version or empty string if version\n *     can't be determined.\n */\ngoog.labs.userAgent.engine.getVersion = function() {\n  'use strict';\n  var userAgentString = goog.labs.userAgent.util.getUserAgent();\n  if (userAgentString) {\n    var tuples = goog.labs.userAgent.util.extractVersionTuples(userAgentString);\n\n    var engineTuple = goog.labs.userAgent.engine.getEngineTuple_(tuples);\n    if (engineTuple) {\n      // In Gecko, the version string is either in the browser info or the\n      // Firefox version.  See Gecko user agent string reference:\n      // http://goo.gl/mULqa\n      if (engineTuple[0] == 'Gecko') {\n        return goog.labs.userAgent.engine.getVersionForKey_(tuples, 'Firefox');\n      }\n\n      return engineTuple[1];\n    }\n\n    // MSIE has only one version identifier, and the Trident version is\n    // specified in the parenthetical. IE Edge is covered in the engine tuple\n    // detection.\n    var browserTuple = tuples[0];\n    var info;\n    if (browserTuple && (info = browserTuple[2])) {\n      var match = /Trident\\/([^\\s;]+)/.exec(info);\n      if (match) {\n        return match[1];\n      }\n    }\n  }\n  return '';\n};\n\n\n/**\n * @param {!Array<!Array<string>>} tuples Extracted version tuples.\n * @return {!Array<string>|undefined} The engine tuple or undefined if not\n *     found.\n * @private\n */\ngoog.labs.userAgent.engine.getEngineTuple_ = function(tuples) {\n  'use strict';\n  if (!goog.labs.userAgent.engine.isEdge()) {\n    return tuples[1];\n  }\n  for (var i = 0; i < tuples.length; i++) {\n    var tuple = tuples[i];\n    if (tuple[0] == 'Edge') {\n      return tuple;\n    }\n  }\n};\n\n\n/**\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the rendering engine version is higher or the same\n *     as the given version.\n */\ngoog.labs.userAgent.engine.isVersionOrHigher = function(version) {\n  'use strict';\n  return goog.string.compareVersions(\n             goog.labs.userAgent.engine.getVersion(), version) >= 0;\n};\n\n\n/**\n * @param {!Array<!Array<string>>} tuples Version tuples.\n * @param {string} key The key to look for.\n * @return {string} The version string of the given key, if present.\n *     Otherwise, the empty string.\n * @private\n */\ngoog.labs.userAgent.engine.getVersionForKey_ = function(tuples, key) {\n  'use strict';\n  // TODO(nnaze): Move to util if useful elsewhere.\n\n  var pair = goog.array.find(tuples, function(pair) {\n    'use strict';\n    return key == pair[0];\n  });\n\n  return pair && pair[1] || '';\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Browser capability checks for the events package.\n */\n\ngoog.module('goog.events.BrowserFeature');\ngoog.module.declareLegacyNamespace();\n\n\n/**\n * Tricks Closure Compiler into believing that a function is pure.  The compiler\n * assumes that any `valueOf` function is pure, without analyzing its contents.\n *\n * @param {function(): T} fn\n * @return {T}\n * @template T\n */\nconst purify = (fn) => {\n  return ({valueOf: fn}).valueOf();\n};\n\n\n/**\n * Enum of browser capabilities.\n * @enum {boolean}\n */\nexports = {\n  /**\n   * Whether the button attribute of the event is W3C compliant.  False in\n   * Internet Explorer prior to version 9; document-version dependent.\n   */\n  HAS_W3C_BUTTON: true,\n\n  /**\n   * Whether the browser supports full W3C event model.\n   */\n  HAS_W3C_EVENT_SUPPORT: true,\n\n  /**\n   * To prevent default in IE7-8 for certain keydown events we need set the\n   * keyCode to -1.\n   */\n  SET_KEY_CODE_TO_PREVENT_DEFAULT: false,\n\n  /**\n   * Whether the `navigator.onLine` property is supported.\n   */\n  HAS_NAVIGATOR_ONLINE_PROPERTY: true,\n\n  /**\n   * Whether HTML5 network online/offline events are supported.\n   */\n  HAS_HTML5_NETWORK_EVENT_SUPPORT: true,\n\n  /**\n   * Whether HTML5 network events fire on document.body, or otherwise the\n   * window.\n   */\n  HTML5_NETWORK_EVENTS_FIRE_ON_BODY: false,\n\n  /**\n   * Whether touch is enabled in the browser.\n   */\n  TOUCH_ENABLED:\n      ('ontouchstart' in goog.global ||\n       !!(goog.global['document'] && document.documentElement &&\n          'ontouchstart' in document.documentElement) ||\n       // IE10 uses non-standard touch events, so it has a different check.\n       !!(goog.global['navigator'] &&\n          (goog.global['navigator']['maxTouchPoints'] ||\n           goog.global['navigator']['msMaxTouchPoints']))),\n\n  /**\n   * Whether addEventListener supports W3C standard pointer events.\n   * http://www.w3.org/TR/pointerevents/\n   */\n  POINTER_EVENTS: ('PointerEvent' in goog.global),\n\n  /**\n   * Whether addEventListener supports MSPointer events (only used in IE10).\n   * http://msdn.microsoft.com/en-us/library/ie/hh772103(v=vs.85).aspx\n   * http://msdn.microsoft.com/library/hh673557(v=vs.85).aspx\n   */\n  MSPOINTER_EVENTS:\n      ('MSPointerEvent' in goog.global &&\n       !!(goog.global['navigator'] &&\n          goog.global['navigator']['msPointerEnabled'])),\n\n  /**\n   * Whether addEventListener supports {passive: true}.\n   * https://developers.google.com/web/updates/2016/06/passive-event-listeners\n   */\n  PASSIVE_EVENTS: purify(function() {\n    // If we're in a web worker or other custom environment, we can't tell.\n    if (!goog.global.addEventListener || !Object.defineProperty) {  // IE 8\n      return false;\n    }\n\n    var passive = false;\n    var options = Object.defineProperty({}, 'passive', {\n      get: function() {\n        passive = true;\n      }\n    });\n    try {\n      goog.global.addEventListener('test', goog.nullFunction, options);\n      goog.global.removeEventListener('test', goog.nullFunction, options);\n    } catch (e) {\n    }\n\n    return passive;\n  })\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A base class for event objects.\n */\n\n\ngoog.provide('goog.events.Event');\n\n/**\n * goog.events.Event no longer depends on goog.Disposable. Keep requiring\n * goog.Disposable here to not break projects which assume this dependency.\n * @suppress {extraRequire}\n */\ngoog.require('goog.Disposable');\ngoog.require('goog.events.EventId');\n\n\n/**\n * A base class for event objects, so that they can support preventDefault and\n * stopPropagation.\n *\n * @param {string|!goog.events.EventId} type Event Type.\n * @param {Object=} opt_target Reference to the object that is the target of\n *     this event. It has to implement the `EventTarget` interface\n *     declared at {@link http://developer.mozilla.org/en/DOM/EventTarget}.\n * @constructor\n */\ngoog.events.Event = function(type, opt_target) {\n  'use strict';\n  /**\n   * Event type.\n   * @type {string}\n   */\n  this.type = type instanceof goog.events.EventId ? String(type) : type;\n\n  /**\n   * TODO(tbreisacher): The type should probably be\n   * EventTarget|goog.events.EventTarget.\n   *\n   * Target of the event.\n   * @type {Object|undefined}\n   */\n  this.target = opt_target;\n\n  /**\n   * Object that had the listener attached.\n   * @type {Object|undefined}\n   */\n  this.currentTarget = this.target;\n\n  /**\n   * Whether to cancel the event in internal capture/bubble processing for IE.\n   * @type {boolean}\n   * @private\n   */\n  this.propagationStopped_ = false;\n\n  /**\n   * Whether the default action has been prevented.\n   * This is a property to match the W3C specification at\n   * {@link http://www.w3.org/TR/DOM-Level-3-Events/\n   * #events-event-type-defaultPrevented}.\n   * Must be treated as read-only outside the class.\n   * @type {boolean}\n   */\n  this.defaultPrevented = false;\n};\n\n/**\n * @return {boolean} true iff internal propagation has been stopped.\n */\ngoog.events.Event.prototype.hasPropagationStopped = function() {\n  'use strict';\n  return this.propagationStopped_;\n};\n\n/**\n * Stops event propagation.\n * @return {void}\n */\ngoog.events.Event.prototype.stopPropagation = function() {\n  'use strict';\n  this.propagationStopped_ = true;\n};\n\n\n/**\n * Prevents the default action, for example a link redirecting to a url.\n * @return {void}\n */\ngoog.events.Event.prototype.preventDefault = function() {\n  'use strict';\n  this.defaultPrevented = true;\n};\n\n\n/**\n * Stops the propagation of the event. It is equivalent to\n * `e.stopPropagation()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.stopPropagation = function(e) {\n  'use strict';\n  e.stopPropagation();\n};\n\n\n/**\n * Prevents the default action. It is equivalent to\n * `e.preventDefault()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.preventDefault = function(e) {\n  'use strict';\n  e.preventDefault();\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A patched, standardized event object for browser events.\n *\n * <pre>\n * The patched event object contains the following members:\n * - type           {string}    Event type, e.g. 'click'\n * - target         {Object}    The element that actually triggered the event\n * - currentTarget  {Object}    The element the listener is attached to\n * - relatedTarget  {Object}    For mouseover and mouseout, the previous object\n * - offsetX        {number}    X-coordinate relative to target\n * - offsetY        {number}    Y-coordinate relative to target\n * - clientX        {number}    X-coordinate relative to viewport\n * - clientY        {number}    Y-coordinate relative to viewport\n * - screenX        {number}    X-coordinate relative to the edge of the screen\n * - screenY        {number}    Y-coordinate relative to the edge of the screen\n * - button         {number}    Mouse button. Use isButton() to test.\n * - keyCode        {number}    Key-code\n * - ctrlKey        {boolean}   Was ctrl key depressed\n * - altKey         {boolean}   Was alt key depressed\n * - shiftKey       {boolean}   Was shift key depressed\n * - metaKey        {boolean}   Was meta key depressed\n * - pointerId      {number}    Pointer ID\n * - pointerType    {string}    Pointer type, e.g. 'mouse', 'pen', or 'touch'\n * - defaultPrevented {boolean} Whether the default action has been prevented\n * - state          {Object}    History state object\n *\n * NOTE: The keyCode member contains the raw browser keyCode. For normalized\n * key and character code use {@link goog.events.KeyHandler}.\n * </pre>\n * @suppress {missingRequire} TODO(user): this shouldn't be needed\n */\n\ngoog.provide('goog.events.BrowserEvent');\ngoog.provide('goog.events.BrowserEvent.MouseButton');\ngoog.provide('goog.events.BrowserEvent.PointerType');\n\ngoog.require('goog.debug');\ngoog.require('goog.events.BrowserFeature');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.EventType');\ngoog.require('goog.reflect');\ngoog.require('goog.userAgent');\n\n/**\n * @define {boolean} If true, use the layerX and layerY properties of a native\n * browser event over the offsetX and offsetY properties, which cause expensive\n * reflow. If layerX or layerY is not defined, offsetX and offsetY will be used\n * as usual.\n */\ngoog.events.USE_LAYER_XY_AS_OFFSET_XY =\n    goog.define('goog.events.USE_LAYER_XY_AS_OFFSET_XY', false);\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * The content of this object will not be initialized if no event object is\n * provided. If this is the case, init() needs to be invoked separately.\n * @param {Event=} opt_e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.events.BrowserEvent = function(opt_e, opt_currentTarget) {\n  'use strict';\n  goog.events.BrowserEvent.base(this, 'constructor', opt_e ? opt_e.type : '');\n\n  /**\n   * Target that fired the event.\n   * @override\n   * @type {?Node}\n   */\n  this.target = null;\n\n  /**\n   * Node that had the listener attached.\n   * @override\n   * @type {?Node|undefined}\n   */\n  this.currentTarget = null;\n\n  /**\n   * For mouseover and mouseout events, the related object for the event.\n   * @type {?Node}\n   */\n  this.relatedTarget = null;\n\n  /**\n   * X-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetX = 0;\n\n  /**\n   * Y-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetY = 0;\n\n  /**\n   * X-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientX = 0;\n\n  /**\n   * Y-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientY = 0;\n\n  /**\n   * X-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenX = 0;\n\n  /**\n   * Y-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenY = 0;\n\n  /**\n   * Which mouse button was pressed.\n   * @type {number}\n   */\n  this.button = 0;\n\n  /**\n   * Key of key press.\n   * @type {string}\n   */\n  this.key = '';\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.keyCode = 0;\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.charCode = 0;\n\n  /**\n   * Whether control was pressed at time of event.\n   * @type {boolean}\n   */\n  this.ctrlKey = false;\n\n  /**\n   * Whether alt was pressed at time of event.\n   * @type {boolean}\n   */\n  this.altKey = false;\n\n  /**\n   * Whether shift was pressed at time of event.\n   * @type {boolean}\n   */\n  this.shiftKey = false;\n\n  /**\n   * Whether the meta key was pressed at time of event.\n   * @type {boolean}\n   */\n  this.metaKey = false;\n\n  /**\n   * History state object, only set for PopState events where it's a copy of the\n   * state object provided to pushState or replaceState.\n   * @type {?Object}\n   */\n  this.state = null;\n\n  /**\n   * Whether the default platform modifier key was pressed at time of event.\n   * (This is control for all platforms except Mac, where it's Meta.)\n   * @type {boolean}\n   */\n  this.platformModifierKey = false;\n\n  /**\n   * @type {number}\n   */\n  this.pointerId = 0;\n\n  /**\n   * @type {string}\n   */\n  this.pointerType = '';\n\n  /**\n   * The browser event object.\n   * @private {?Event}\n   */\n  this.event_ = null;\n\n  if (opt_e) {\n    this.init(opt_e, opt_currentTarget);\n  }\n};\ngoog.inherits(goog.events.BrowserEvent, goog.events.Event);\n\n\n/**\n * Normalized button constants for the mouse.\n * @enum {number}\n */\ngoog.events.BrowserEvent.MouseButton = {\n  LEFT: 0,\n  MIDDLE: 1,\n  RIGHT: 2\n};\n\n\n/**\n * Normalized pointer type constants for pointer events.\n * @enum {string}\n */\ngoog.events.BrowserEvent.PointerType = {\n  MOUSE: 'mouse',\n  PEN: 'pen',\n  TOUCH: 'touch'\n};\n\n\n/**\n * Static data for mapping mouse buttons.\n * @type {!Array<number>}\n * @deprecated Use `goog.events.BrowserEvent.IE_BUTTON_MAP` instead.\n */\ngoog.events.BrowserEvent.IEButtonMap = goog.debug.freeze([\n  1,  // LEFT\n  4,  // MIDDLE\n  2   // RIGHT\n]);\n\n\n/**\n * Static data for mapping mouse buttons.\n * @const {!Array<number>}\n */\ngoog.events.BrowserEvent.IE_BUTTON_MAP = goog.events.BrowserEvent.IEButtonMap;\n\n\n/**\n * Static data for mapping MSPointerEvent types to PointerEvent types.\n * @const {!Object<number, goog.events.BrowserEvent.PointerType>}\n */\ngoog.events.BrowserEvent.IE_POINTER_TYPE_MAP = goog.debug.freeze({\n  2: goog.events.BrowserEvent.PointerType.TOUCH,\n  3: goog.events.BrowserEvent.PointerType.PEN,\n  4: goog.events.BrowserEvent.PointerType.MOUSE\n});\n\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * @param {Event} e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n */\ngoog.events.BrowserEvent.prototype.init = function(e, opt_currentTarget) {\n  'use strict';\n  var type = this.type = e.type;\n\n  /**\n   * On touch devices use the first \"changed touch\" as the relevant touch.\n   * @type {?Touch}\n   */\n  var relevantTouch =\n      e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : null;\n\n  // TODO(nicksantos): Change this.target to type EventTarget.\n  this.target = /** @type {Node} */ (e.target) || e.srcElement;\n\n  // TODO(nicksantos): Change this.currentTarget to type EventTarget.\n  this.currentTarget = /** @type {Node} */ (opt_currentTarget);\n\n  var relatedTarget = /** @type {Node} */ (e.relatedTarget);\n  if (relatedTarget) {\n    // There's a bug in FireFox where sometimes, relatedTarget will be a\n    // chrome element, and accessing any property of it will get a permission\n    // denied exception. See:\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=497780\n    if (goog.userAgent.GECKO) {\n      if (!goog.reflect.canAccessProperty(relatedTarget, 'nodeName')) {\n        relatedTarget = null;\n      }\n    }\n  } else if (type == goog.events.EventType.MOUSEOVER) {\n    relatedTarget = e.fromElement;\n  } else if (type == goog.events.EventType.MOUSEOUT) {\n    relatedTarget = e.toElement;\n  }\n\n  this.relatedTarget = relatedTarget;\n\n  if (relevantTouch) {\n    this.clientX = relevantTouch.clientX !== undefined ? relevantTouch.clientX :\n                                                         relevantTouch.pageX;\n    this.clientY = relevantTouch.clientY !== undefined ? relevantTouch.clientY :\n                                                         relevantTouch.pageY;\n    this.screenX = relevantTouch.screenX || 0;\n    this.screenY = relevantTouch.screenY || 0;\n  } else {\n    if (goog.events.USE_LAYER_XY_AS_OFFSET_XY) {\n      this.offsetX = (e.layerX !== undefined) ? e.layerX : e.offsetX;\n      this.offsetY = (e.layerY !== undefined) ? e.layerY : e.offsetY;\n    } else {\n      // Webkit emits a lame warning whenever layerX/layerY is accessed.\n      // http://code.google.com/p/chromium/issues/detail?id=101733\n      this.offsetX = (goog.userAgent.WEBKIT || e.offsetX !== undefined) ?\n          e.offsetX :\n          e.layerX;\n      this.offsetY = (goog.userAgent.WEBKIT || e.offsetY !== undefined) ?\n          e.offsetY :\n          e.layerY;\n    }\n    this.clientX = e.clientX !== undefined ? e.clientX : e.pageX;\n    this.clientY = e.clientY !== undefined ? e.clientY : e.pageY;\n    this.screenX = e.screenX || 0;\n    this.screenY = e.screenY || 0;\n  }\n\n  this.button = e.button;\n\n  this.keyCode = e.keyCode || 0;\n  this.key = e.key || '';\n  this.charCode = e.charCode || (type == 'keypress' ? e.keyCode : 0);\n  this.ctrlKey = e.ctrlKey;\n  this.altKey = e.altKey;\n  this.shiftKey = e.shiftKey;\n  this.metaKey = e.metaKey;\n  this.platformModifierKey = goog.userAgent.MAC ? e.metaKey : e.ctrlKey;\n  this.pointerId = e.pointerId || 0;\n  this.pointerType = goog.events.BrowserEvent.getPointerType_(e);\n  this.state = e.state;\n  this.event_ = e;\n  if (e.defaultPrevented) {\n    // Sync native event state to internal state via super class, where default\n    // prevention is implemented and managed.\n    goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  }\n};\n\n\n/**\n * Tests to see which button was pressed during the event. This is really only\n * useful in IE and Gecko browsers. And in IE, it's only useful for\n * mousedown/mouseup events, because click only fires for the left mouse button.\n *\n * Safari 2 only reports the left button being clicked, and uses the value '1'\n * instead of 0. Opera only reports a mousedown event for the middle button, and\n * no mouse events for the right button. Opera has default behavior for left and\n * middle click that can only be overridden via a configuration setting.\n *\n * There's a nice table of this mess at http://www.unixpapa.com/js/mouse.html.\n *\n * @param {goog.events.BrowserEvent.MouseButton} button The button\n *     to test for.\n * @return {boolean} True if button was pressed.\n */\ngoog.events.BrowserEvent.prototype.isButton = function(button) {\n  'use strict';\n  if (!goog.events.BrowserFeature.HAS_W3C_BUTTON) {\n    if (this.type == 'click') {\n      return button == goog.events.BrowserEvent.MouseButton.LEFT;\n    } else {\n      return !!(\n          this.event_.button & goog.events.BrowserEvent.IE_BUTTON_MAP[button]);\n    }\n  } else {\n    return this.event_.button == button;\n  }\n};\n\n\n/**\n * Whether this has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @return {boolean} The result.\n */\ngoog.events.BrowserEvent.prototype.isMouseActionButton = function() {\n  'use strict';\n  // Ctrl+click should never behave like a left-click on mac, regardless of\n  // whether or not the browser will actually ever emit such an event.  If\n  // we see it, treat it like right-click always.\n  return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) &&\n      !(goog.userAgent.MAC && this.ctrlKey);\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.stopPropagation = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.stopPropagation.call(this);\n  if (this.event_.stopPropagation) {\n    this.event_.stopPropagation();\n  } else {\n    this.event_.cancelBubble = true;\n  }\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.preventDefault = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  var be = this.event_;\n  if (!be.preventDefault) {\n    be.returnValue = false;\n    if (goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT) {\n\n      try {\n        // Most keys can be prevented using returnValue. Some special keys\n        // require setting the keyCode to -1 as well:\n        //\n        // In IE7:\n        // F3, F5, F10, F11, Ctrl+P, Crtl+O, Ctrl+F (these are taken from IE6)\n        //\n        // In IE8:\n        // Ctrl+P, Crtl+O, Ctrl+F (F1-F12 cannot be stopped through the event)\n        //\n        // We therefore do this for all function keys as well as when Ctrl key\n        // is pressed.\n        var VK_F1 = 112;\n        var VK_F12 = 123;\n        if (be.ctrlKey || be.keyCode >= VK_F1 && be.keyCode <= VK_F12) {\n          be.keyCode = -1;\n        }\n      } catch (ex) {\n        // IE throws an 'access denied' exception when trying to change\n        // keyCode in some situations (e.g. srcElement is input[type=file],\n        // or srcElement is an anchor tag rewritten by parent's innerHTML).\n        // Do nothing in this case.\n      }\n    }\n  } else {\n    be.preventDefault();\n  }\n};\n\n\n/**\n * @return {Event} The underlying browser event object.\n */\ngoog.events.BrowserEvent.prototype.getBrowserEvent = function() {\n  'use strict';\n  return this.event_;\n};\n\n\n/**\n * Extracts the pointer type from the given event.\n * @param {!Event} e\n * @return {string} The pointer type, e.g. 'mouse', 'pen', or 'touch'.\n * @private\n */\ngoog.events.BrowserEvent.getPointerType_ = function(e) {\n  'use strict';\n  if (typeof (e.pointerType) === 'string') {\n    return e.pointerType;\n  }\n  // IE10 uses integer codes for pointer type.\n  // https://msdn.microsoft.com/en-us/library/hh772359(v=vs.85).aspx\n  return goog.events.BrowserEvent.IE_POINTER_TYPE_MAP[e.pointerType] || '';\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Event Types.\n * @suppress {missingRequire} TODO(user): this shouldn't be needed\n */\n\n\ngoog.provide('goog.events.EventType');\ngoog.provide('goog.events.MouseAsMouseEventType');\ngoog.provide('goog.events.MouseEvents');\ngoog.provide('goog.events.PointerAsMouseEventType');\ngoog.provide('goog.events.PointerAsTouchEventType');\ngoog.provide('goog.events.PointerFallbackEventType');\ngoog.provide('goog.events.PointerTouchFallbackEventType');\n\ngoog.require('goog.events.BrowserFeature');\ngoog.require('goog.userAgent');\n\n\n/**\n * Returns a prefixed event name for the current browser.\n * @param {string} eventName The name of the event.\n * @return {string} The prefixed event name.\n * @private\n */\ngoog.events.getVendorPrefixedName_ = function(eventName) {\n  'use strict';\n  return goog.userAgent.WEBKIT ?\n      'webkit' + eventName :\n      (goog.userAgent.OPERA ? 'o' + eventName.toLowerCase() :\n                              eventName.toLowerCase());\n};\n\n\n/**\n * Constants for event names.\n * @enum {string}\n */\ngoog.events.EventType = {\n  // Mouse events\n  CLICK: 'click',\n  RIGHTCLICK: 'rightclick',\n  DBLCLICK: 'dblclick',\n  AUXCLICK: 'auxclick',\n  MOUSEDOWN: 'mousedown',\n  MOUSEUP: 'mouseup',\n  MOUSEOVER: 'mouseover',\n  MOUSEOUT: 'mouseout',\n  MOUSEMOVE: 'mousemove',\n  MOUSEENTER: 'mouseenter',\n  MOUSELEAVE: 'mouseleave',\n\n  // Non-existent event; will never fire. This exists as a mouse counterpart to\n  // POINTERCANCEL.\n  MOUSECANCEL: 'mousecancel',\n\n  // Selection events.\n  // https://www.w3.org/TR/selection-api/\n  SELECTIONCHANGE: 'selectionchange',\n  SELECTSTART: 'selectstart',  // IE, Safari, Chrome\n\n  // Wheel events\n  // http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n  WHEEL: 'wheel',\n\n  // Key events\n  KEYPRESS: 'keypress',\n  KEYDOWN: 'keydown',\n  KEYUP: 'keyup',\n\n  // Focus\n  BLUR: 'blur',\n  FOCUS: 'focus',\n  DEACTIVATE: 'deactivate',  // IE only\n  FOCUSIN: 'focusin',\n  FOCUSOUT: 'focusout',\n\n  // Forms\n  CHANGE: 'change',\n  RESET: 'reset',\n  SELECT: 'select',\n  SUBMIT: 'submit',\n  INPUT: 'input',\n  PROPERTYCHANGE: 'propertychange',  // IE only\n\n  // Drag and drop\n  DRAGSTART: 'dragstart',\n  DRAG: 'drag',\n  DRAGENTER: 'dragenter',\n  DRAGOVER: 'dragover',\n  DRAGLEAVE: 'dragleave',\n  DROP: 'drop',\n  DRAGEND: 'dragend',\n\n  // Touch events\n  // Note that other touch events exist, but we should follow the W3C list here.\n  // http://www.w3.org/TR/touch-events/#list-of-touchevent-types\n  TOUCHSTART: 'touchstart',\n  TOUCHMOVE: 'touchmove',\n  TOUCHEND: 'touchend',\n  TOUCHCANCEL: 'touchcancel',\n\n  // Misc\n  BEFOREUNLOAD: 'beforeunload',\n  CONSOLEMESSAGE: 'consolemessage',\n  CONTEXTMENU: 'contextmenu',\n  DEVICECHANGE: 'devicechange',\n  DEVICEMOTION: 'devicemotion',\n  DEVICEORIENTATION: 'deviceorientation',\n  DOMCONTENTLOADED: 'DOMContentLoaded',\n  ERROR: 'error',\n  HELP: 'help',\n  LOAD: 'load',\n  LOSECAPTURE: 'losecapture',\n  ORIENTATIONCHANGE: 'orientationchange',\n  READYSTATECHANGE: 'readystatechange',\n  RESIZE: 'resize',\n  SCROLL: 'scroll',\n  UNLOAD: 'unload',\n\n  // Media events\n  CANPLAY: 'canplay',\n  CANPLAYTHROUGH: 'canplaythrough',\n  DURATIONCHANGE: 'durationchange',\n  EMPTIED: 'emptied',\n  ENDED: 'ended',\n  LOADEDDATA: 'loadeddata',\n  LOADEDMETADATA: 'loadedmetadata',\n  PAUSE: 'pause',\n  PLAY: 'play',\n  PLAYING: 'playing',\n  PROGRESS: 'progress',\n  RATECHANGE: 'ratechange',\n  SEEKED: 'seeked',\n  SEEKING: 'seeking',\n  STALLED: 'stalled',\n  SUSPEND: 'suspend',\n  TIMEUPDATE: 'timeupdate',\n  VOLUMECHANGE: 'volumechange',\n  WAITING: 'waiting',\n\n  // Media Source Extensions events\n  // https://www.w3.org/TR/media-source/#mediasource-events\n  SOURCEOPEN: 'sourceopen',\n  SOURCEENDED: 'sourceended',\n  SOURCECLOSED: 'sourceclosed',\n  // https://www.w3.org/TR/media-source/#sourcebuffer-events\n  ABORT: 'abort',\n  UPDATE: 'update',\n  UPDATESTART: 'updatestart',\n  UPDATEEND: 'updateend',\n\n  // HTML 5 History events\n  // See http://www.w3.org/TR/html5/browsers.html#event-definitions-0\n  HASHCHANGE: 'hashchange',\n  PAGEHIDE: 'pagehide',\n  PAGESHOW: 'pageshow',\n  POPSTATE: 'popstate',\n\n  // Copy and Paste\n  // Support is limited. Make sure it works on your favorite browser\n  // before using.\n  // http://www.quirksmode.org/dom/events/cutcopypaste.html\n  COPY: 'copy',\n  PASTE: 'paste',\n  CUT: 'cut',\n  BEFORECOPY: 'beforecopy',\n  BEFORECUT: 'beforecut',\n  BEFOREPASTE: 'beforepaste',\n\n  // HTML5 online/offline events.\n  // http://www.w3.org/TR/offline-webapps/#related\n  ONLINE: 'online',\n  OFFLINE: 'offline',\n\n  // HTML 5 worker events\n  MESSAGE: 'message',\n  CONNECT: 'connect',\n\n  // Service Worker Events - ServiceWorkerGlobalScope context\n  // See https://w3c.github.io/ServiceWorker/#execution-context-events\n  // Note: message event defined in worker events section\n  INSTALL: 'install',\n  ACTIVATE: 'activate',\n  FETCH: 'fetch',\n  FOREIGNFETCH: 'foreignfetch',\n  MESSAGEERROR: 'messageerror',\n\n  // Service Worker Events - Document context\n  // See https://w3c.github.io/ServiceWorker/#document-context-events\n  STATECHANGE: 'statechange',\n  UPDATEFOUND: 'updatefound',\n  CONTROLLERCHANGE: 'controllerchange',\n\n  // CSS animation events.\n  ANIMATIONSTART: goog.events.getVendorPrefixedName_('AnimationStart'),\n  ANIMATIONEND: goog.events.getVendorPrefixedName_('AnimationEnd'),\n  ANIMATIONITERATION: goog.events.getVendorPrefixedName_('AnimationIteration'),\n\n  // CSS transition events. Based on the browser support described at:\n  // https://developer.mozilla.org/en/css/css_transitions#Browser_compatibility\n  TRANSITIONEND: goog.events.getVendorPrefixedName_('TransitionEnd'),\n\n  // W3C Pointer Events\n  // http://www.w3.org/TR/pointerevents/\n  POINTERDOWN: 'pointerdown',\n  POINTERUP: 'pointerup',\n  POINTERCANCEL: 'pointercancel',\n  POINTERMOVE: 'pointermove',\n  POINTEROVER: 'pointerover',\n  POINTEROUT: 'pointerout',\n  POINTERENTER: 'pointerenter',\n  POINTERLEAVE: 'pointerleave',\n  GOTPOINTERCAPTURE: 'gotpointercapture',\n  LOSTPOINTERCAPTURE: 'lostpointercapture',\n\n  // IE specific events.\n  // See http://msdn.microsoft.com/en-us/library/ie/hh772103(v=vs.85).aspx\n  // Note: these events will be supplanted in IE11.\n  MSGESTURECHANGE: 'MSGestureChange',\n  MSGESTUREEND: 'MSGestureEnd',\n  MSGESTUREHOLD: 'MSGestureHold',\n  MSGESTURESTART: 'MSGestureStart',\n  MSGESTURETAP: 'MSGestureTap',\n  MSGOTPOINTERCAPTURE: 'MSGotPointerCapture',\n  MSINERTIASTART: 'MSInertiaStart',\n  MSLOSTPOINTERCAPTURE: 'MSLostPointerCapture',\n  MSPOINTERCANCEL: 'MSPointerCancel',\n  MSPOINTERDOWN: 'MSPointerDown',\n  MSPOINTERENTER: 'MSPointerEnter',\n  MSPOINTERHOVER: 'MSPointerHover',\n  MSPOINTERLEAVE: 'MSPointerLeave',\n  MSPOINTERMOVE: 'MSPointerMove',\n  MSPOINTEROUT: 'MSPointerOut',\n  MSPOINTEROVER: 'MSPointerOver',\n  MSPOINTERUP: 'MSPointerUp',\n\n  // Native IMEs/input tools events.\n  TEXT: 'text',\n  // The textInput event is supported in IE9+, but only in lower case. All other\n  // browsers use the camel-case event name.\n  TEXTINPUT: goog.userAgent.IE ? 'textinput' : 'textInput',\n  COMPOSITIONSTART: 'compositionstart',\n  COMPOSITIONUPDATE: 'compositionupdate',\n  COMPOSITIONEND: 'compositionend',\n\n  // The beforeinput event is initially only supported in Safari. See\n  // https://bugs.chromium.org/p/chromium/issues/detail?id=342670 for Chrome\n  // implementation tracking.\n  BEFOREINPUT: 'beforeinput',\n\n  // Webview tag events\n  // See https://developer.chrome.com/apps/tags/webview\n  EXIT: 'exit',\n  LOADABORT: 'loadabort',\n  LOADCOMMIT: 'loadcommit',\n  LOADREDIRECT: 'loadredirect',\n  LOADSTART: 'loadstart',\n  LOADSTOP: 'loadstop',\n  RESPONSIVE: 'responsive',\n  SIZECHANGED: 'sizechanged',\n  UNRESPONSIVE: 'unresponsive',\n\n  // HTML5 Page Visibility API.  See details at\n  // `goog.labs.dom.PageVisibilityMonitor`.\n  VISIBILITYCHANGE: 'visibilitychange',\n\n  // LocalStorage event.\n  STORAGE: 'storage',\n\n  // DOM Level 2 mutation events (deprecated).\n  DOMSUBTREEMODIFIED: 'DOMSubtreeModified',\n  DOMNODEINSERTED: 'DOMNodeInserted',\n  DOMNODEREMOVED: 'DOMNodeRemoved',\n  DOMNODEREMOVEDFROMDOCUMENT: 'DOMNodeRemovedFromDocument',\n  DOMNODEINSERTEDINTODOCUMENT: 'DOMNodeInsertedIntoDocument',\n  DOMATTRMODIFIED: 'DOMAttrModified',\n  DOMCHARACTERDATAMODIFIED: 'DOMCharacterDataModified',\n\n  // Print events.\n  BEFOREPRINT: 'beforeprint',\n  AFTERPRINT: 'afterprint',\n\n  // Web app manifest events.\n  BEFOREINSTALLPROMPT: 'beforeinstallprompt',\n  APPINSTALLED: 'appinstalled'\n};\n\n\n/**\n * Returns one of the given pointer fallback event names in order of preference:\n *   1. pointerEventName\n *   2. msPointerEventName\n *   3. fallbackEventName\n * @param {string} pointerEventName\n * @param {string} msPointerEventName\n * @param {string} fallbackEventName\n * @return {string} The supported pointer or fallback (mouse or touch) event\n *     name.\n * @private\n */\ngoog.events.getPointerFallbackEventName_ = function(\n    pointerEventName, msPointerEventName, fallbackEventName) {\n  'use strict';\n  if (goog.events.BrowserFeature.POINTER_EVENTS) {\n    return pointerEventName;\n  }\n  if (goog.events.BrowserFeature.MSPOINTER_EVENTS) {\n    return msPointerEventName;\n  }\n  return fallbackEventName;\n};\n\n\n/**\n * Constants for pointer event names that fall back to corresponding mouse event\n * names on unsupported platforms. These are intended to be drop-in replacements\n * for corresponding values in `goog.events.EventType`.\n * @enum {string}\n */\ngoog.events.PointerFallbackEventType = {\n  POINTERDOWN: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERDOWN, goog.events.EventType.MSPOINTERDOWN,\n      goog.events.EventType.MOUSEDOWN),\n  POINTERUP: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERUP, goog.events.EventType.MSPOINTERUP,\n      goog.events.EventType.MOUSEUP),\n  POINTERCANCEL: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERCANCEL,\n      goog.events.EventType.MSPOINTERCANCEL,\n      // When falling back to mouse events, there is no MOUSECANCEL equivalent\n      // of POINTERCANCEL. In this case POINTERUP already falls back to MOUSEUP\n      // which represents both UP and CANCEL. POINTERCANCEL does not fall back\n      // to MOUSEUP to prevent listening twice on the same event.\n      goog.events.EventType.MOUSECANCEL),\n  POINTERMOVE: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERMOVE, goog.events.EventType.MSPOINTERMOVE,\n      goog.events.EventType.MOUSEMOVE),\n  POINTEROVER: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTEROVER, goog.events.EventType.MSPOINTEROVER,\n      goog.events.EventType.MOUSEOVER),\n  POINTEROUT: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTEROUT, goog.events.EventType.MSPOINTEROUT,\n      goog.events.EventType.MOUSEOUT),\n  POINTERENTER: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERENTER, goog.events.EventType.MSPOINTERENTER,\n      goog.events.EventType.MOUSEENTER),\n  POINTERLEAVE: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERLEAVE, goog.events.EventType.MSPOINTERLEAVE,\n      goog.events.EventType.MOUSELEAVE)\n};\n\n\n/**\n * Constants for pointer event names that fall back to corresponding touch event\n * names on unsupported platforms. These are intended to be drop-in replacements\n * for corresponding values in `goog.events.EventType`.\n * @enum {string}\n */\ngoog.events.PointerTouchFallbackEventType = {\n  POINTERDOWN: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERDOWN, goog.events.EventType.MSPOINTERDOWN,\n      goog.events.EventType.TOUCHSTART),\n  POINTERUP: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERUP, goog.events.EventType.MSPOINTERUP,\n      goog.events.EventType.TOUCHEND),\n  POINTERCANCEL: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERCANCEL,\n      goog.events.EventType.MSPOINTERCANCEL, goog.events.EventType.TOUCHCANCEL),\n  POINTERMOVE: goog.events.getPointerFallbackEventName_(\n      goog.events.EventType.POINTERMOVE, goog.events.EventType.MSPOINTERMOVE,\n      goog.events.EventType.TOUCHMOVE)\n};\n\n\n/**\n * Mapping of mouse event names to underlying browser event names.\n * @typedef {{\n *     MOUSEDOWN: string,\n *     MOUSEUP: string,\n *     MOUSECANCEL:string,\n *     MOUSEMOVE:string,\n *     MOUSEOVER:string,\n *     MOUSEOUT:string,\n *     MOUSEENTER:string,\n *     MOUSELEAVE: string,\n * }}\n */\ngoog.events.MouseEvents;\n\n\n/**\n * An alias for `goog.events.EventType.MOUSE*` event types that is overridden by\n * corresponding `POINTER*` event types.\n * @const {!goog.events.MouseEvents}\n */\ngoog.events.PointerAsMouseEventType = {\n  MOUSEDOWN: goog.events.PointerFallbackEventType.POINTERDOWN,\n  MOUSEUP: goog.events.PointerFallbackEventType.POINTERUP,\n  MOUSECANCEL: goog.events.PointerFallbackEventType.POINTERCANCEL,\n  MOUSEMOVE: goog.events.PointerFallbackEventType.POINTERMOVE,\n  MOUSEOVER: goog.events.PointerFallbackEventType.POINTEROVER,\n  MOUSEOUT: goog.events.PointerFallbackEventType.POINTEROUT,\n  MOUSEENTER: goog.events.PointerFallbackEventType.POINTERENTER,\n  MOUSELEAVE: goog.events.PointerFallbackEventType.POINTERLEAVE\n};\n\n\n/**\n * An alias for `goog.events.EventType.MOUSE*` event types that continue to use\n * mouse events.\n * @const {!goog.events.MouseEvents}\n */\ngoog.events.MouseAsMouseEventType = {\n  MOUSEDOWN: goog.events.EventType.MOUSEDOWN,\n  MOUSEUP: goog.events.EventType.MOUSEUP,\n  MOUSECANCEL: goog.events.EventType.MOUSECANCEL,\n  MOUSEMOVE: goog.events.EventType.MOUSEMOVE,\n  MOUSEOVER: goog.events.EventType.MOUSEOVER,\n  MOUSEOUT: goog.events.EventType.MOUSEOUT,\n  MOUSEENTER: goog.events.EventType.MOUSEENTER,\n  MOUSELEAVE: goog.events.EventType.MOUSELEAVE\n};\n\n\n/**\n * An alias for `goog.events.EventType.TOUCH*` event types that is overridden by\n * corresponding `POINTER*` event types.\n * @enum {string}\n */\ngoog.events.PointerAsTouchEventType = {\n  TOUCHCANCEL: goog.events.PointerTouchFallbackEventType.POINTERCANCEL,\n  TOUCHEND: goog.events.PointerTouchFallbackEventType.POINTERUP,\n  TOUCHMOVE: goog.events.PointerTouchFallbackEventType.POINTERMOVE,\n  TOUCHSTART: goog.events.PointerTouchFallbackEventType.POINTERDOWN\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface for a listenable JavaScript object.\n */\n\ngoog.provide('goog.events.Listenable');\n\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n/**\n * A listenable interface. A listenable is an object with the ability\n * to dispatch/broadcast events to \"event listeners\" registered via\n * listen/listenOnce.\n *\n * The interface allows for an event propagation mechanism similar\n * to one offered by native browser event targets, such as\n * capture/bubble mechanism, stopping propagation, and preventing\n * default actions. Capture/bubble mechanism depends on the ancestor\n * tree constructed via `#getParentEventTarget`; this tree\n * must be directed acyclic graph. The meaning of default action(s)\n * in preventDefault is specific to a particular use case.\n *\n * Implementations that do not support capture/bubble or can not have\n * a parent listenable can simply not implement any ability to set the\n * parent listenable (and have `#getParentEventTarget` return\n * null).\n *\n * Implementation of this class can be used with or independently from\n * goog.events.\n *\n * Implementation must call `#addImplementation(implClass)`.\n *\n * @interface\n * @see goog.events\n * @see http://www.w3.org/TR/DOM-Level-2-Events/events.html\n */\ngoog.events.Listenable = function() {};\n\n\n/**\n * An expando property to indicate that an object implements\n * goog.events.Listenable.\n *\n * See addImplementation/isImplementedBy.\n *\n * @type {string}\n * @const\n */\ngoog.events.Listenable.IMPLEMENTED_BY_PROP =\n    'closure_listenable_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * Marks a given class (constructor) as an implementation of\n * Listenable, so that we can query that fact at runtime. The class\n * must have already implemented the interface.\n * @param {function(new:goog.events.Listenable,...)} cls The class constructor.\n *     The corresponding class must have already implemented the interface.\n */\ngoog.events.Listenable.addImplementation = function(cls) {\n  'use strict';\n  cls.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP] = true;\n};\n\n\n/**\n * @param {?Object} obj The object to check.\n * @return {boolean} Whether a given instance implements Listenable. The\n *     class/superclass of the instance must call addImplementation.\n */\ngoog.events.Listenable.isImplementedBy = function(obj) {\n  'use strict';\n  return !!(obj && obj[goog.events.Listenable.IMPLEMENTED_BY_PROP]);\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Adds an event listener that is removed automatically after the\n * listener fired once.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() or listenOnce().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n */\ngoog.events.Listenable.prototype.unlistenByKey = function(key) {};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n */\ngoog.events.Listenable.prototype.dispatchEvent = function(e) {};\n\n\n/**\n * Removes all listeners from this listenable. If type is specified,\n * it will only remove listeners of the particular type. otherwise all\n * registered listeners will be removed.\n *\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.Listenable.prototype.removeAllListeners = function(opt_type) {};\n\n\n/**\n * Returns the parent of this event target to use for capture/bubble\n * mechanism.\n *\n * NOTE(chrishenry): The name reflects the original implementation of\n * custom event target (`goog.events.EventTarget`). We decided\n * that changing the name is not worth it.\n *\n * @return {?goog.events.Listenable} The parent EventTarget or null if\n *     there is no parent.\n */\ngoog.events.Listenable.prototype.getParentEventTarget = function() {};\n\n\n/**\n * Fires all registered listeners in this listenable for the given\n * type and capture mode, passing them the given eventObject. This\n * does not perform actual capture/bubble. Only implementors of the\n * interface should be using this.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.fireListeners = function(\n    type, capture, eventObject) {};\n\n\n/**\n * Gets all listeners in this listenable for the given type and\n * capture mode.\n *\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListeners = function(type, capture) {};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {};\n\n\n/**\n * Whether there is any active listeners matching the specified\n * signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.hasListener = function(\n    opt_type, opt_capture) {};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface that describes a single registered listener.\n */\ngoog.provide('goog.events.ListenableKey');\n\ngoog.requireType('goog.events.Listenable');\n\n\n/**\n * An interface that describes a single registered listener.\n * @interface\n */\ngoog.events.ListenableKey = function() {};\n\n\n/**\n * Counter used to create a unique key\n * @type {number}\n * @private\n */\ngoog.events.ListenableKey.counter_ = 0;\n\n\n/**\n * Reserves a key to be used for ListenableKey#key field.\n * @return {number} A number to be used to fill ListenableKey#key\n *     field.\n */\ngoog.events.ListenableKey.reserveKey = function() {\n  'use strict';\n  return ++goog.events.ListenableKey.counter_;\n};\n\n\n/**\n * The source event target.\n * @type {?Object|?goog.events.Listenable}\n */\ngoog.events.ListenableKey.prototype.src;\n\n\n/**\n * The event type the listener is listening to.\n * @type {string}\n */\ngoog.events.ListenableKey.prototype.type;\n\n\n/**\n * The listener function.\n * @type {function(?):?|{handleEvent:function(?):?}|null}\n */\ngoog.events.ListenableKey.prototype.listener;\n\n\n/**\n * Whether the listener works on capture phase.\n * @type {boolean}\n */\ngoog.events.ListenableKey.prototype.capture;\n\n\n/**\n * The 'this' object for the listener function's scope.\n * @type {?Object|undefined}\n */\ngoog.events.ListenableKey.prototype.handler;\n\n\n/**\n * A globally unique number to identify the key.\n * @type {number}\n */\ngoog.events.ListenableKey.prototype.key;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Listener object.\n * @see ../demos/events.html\n */\n\ngoog.provide('goog.events.Listener');\n\ngoog.require('goog.events.ListenableKey');\ngoog.requireType('goog.events.Listenable');\n\n\n\n/**\n * Simple class that stores information about a listener\n * @param {function(?):?} listener Callback function.\n * @param {Function} proxy Wrapper for the listener that patches the event.\n * @param {EventTarget|goog.events.Listenable} src Source object for\n *     the event.\n * @param {string} type Event type.\n * @param {boolean} capture Whether in capture or bubble phase.\n * @param {Object=} opt_handler Object in whose context to execute the callback.\n * @implements {goog.events.ListenableKey}\n * @constructor\n */\ngoog.events.Listener = function(\n    listener, proxy, src, type, capture, opt_handler) {\n  'use strict';\n  if (goog.events.Listener.ENABLE_MONITORING) {\n    this.creationStack = new Error().stack;\n  }\n\n  /** @override */\n  this.listener = listener;\n\n  /**\n   * A wrapper over the original listener. This is used solely to\n   * handle native browser events (it is used to simulate the capture\n   * phase and to patch the event object).\n   * @type {Function}\n   */\n  this.proxy = proxy;\n\n  /**\n   * Object or node that callback is listening to\n   * @type {EventTarget|goog.events.Listenable}\n   */\n  this.src = src;\n\n  /**\n   * The event type.\n   * @const {string}\n   */\n  this.type = type;\n\n  /**\n   * Whether the listener is being called in the capture or bubble phase\n   * @const {boolean}\n   */\n  this.capture = !!capture;\n\n  /**\n   * Optional object whose context to execute the listener in\n   * @type {Object|undefined}\n   */\n  this.handler = opt_handler;\n\n  /**\n   * The key of the listener.\n   * @const {number}\n   * @override\n   */\n  this.key = goog.events.ListenableKey.reserveKey();\n\n  /**\n   * Whether to remove the listener after it has been called.\n   * @type {boolean}\n   */\n  this.callOnce = false;\n\n  /**\n   * Whether the listener has been removed.\n   * @type {boolean}\n   */\n  this.removed = false;\n};\n\n\n/**\n * @define {boolean} Whether to enable the monitoring of the\n *     goog.events.Listener instances. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\ngoog.events.Listener.ENABLE_MONITORING =\n    goog.define('goog.events.Listener.ENABLE_MONITORING', false);\n\n\n/**\n * If monitoring the goog.events.Listener instances is enabled, stores the\n * creation stack trace of the Disposable instance.\n * @type {string}\n */\ngoog.events.Listener.prototype.creationStack;\n\n\n/**\n * Marks this listener as removed. This also remove references held by\n * this listener object (such as listener and event source).\n */\ngoog.events.Listener.prototype.markAsRemoved = function() {\n  'use strict';\n  this.removed = true;\n  this.listener = null;\n  this.proxy = null;\n  this.src = null;\n  this.handler = null;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A map of listeners that provides utility functions to\n * deal with listeners on an event target. Used by\n * `goog.events.EventTarget`.\n *\n * WARNING: Do not use this class from outside goog.events package.\n *\n */\n\ngoog.provide('goog.events.ListenerMap');\n\ngoog.require('goog.array');\ngoog.require('goog.events.Listener');\ngoog.require('goog.object');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.Listenable');\ngoog.requireType('goog.events.ListenableKey');\n\n\n\n/**\n * Creates a new listener map.\n * @param {EventTarget|goog.events.Listenable} src The src object.\n * @constructor\n * @final\n */\ngoog.events.ListenerMap = function(src) {\n  'use strict';\n  /** @type {EventTarget|goog.events.Listenable} */\n  this.src = src;\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @type {!Object<string, !Array<!goog.events.Listener>>}\n   */\n  this.listeners = {};\n\n  /**\n   * The count of types in this map that have registered listeners.\n   * @private {number}\n   */\n  this.typeCount_ = 0;\n};\n\n\n/**\n * @return {number} The count of event types in this map that actually\n *     have registered listeners.\n */\ngoog.events.ListenerMap.prototype.getTypeCount = function() {\n  'use strict';\n  return this.typeCount_;\n};\n\n\n/**\n * @return {number} Total number of registered listeners.\n */\ngoog.events.ListenerMap.prototype.getListenerCount = function() {\n  'use strict';\n  var count = 0;\n  for (var type in this.listeners) {\n    count += this.listeners[type].length;\n  }\n  return count;\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {string|!goog.events.EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n */\ngoog.events.ListenerMap.prototype.add = function(\n    type, listener, callOnce, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  var typeStr = type.toString();\n  var listenerArray = this.listeners[typeStr];\n  if (!listenerArray) {\n    listenerArray = this.listeners[typeStr] = [];\n    this.typeCount_++;\n  }\n\n  var listenerObj;\n  var index = goog.events.ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    listenerObj = listenerArray[index];\n    if (!callOnce) {\n      // Ensure that, if there is an existing callOnce listener, it is no\n      // longer a callOnce listener.\n      listenerObj.callOnce = false;\n    }\n  } else {\n    listenerObj = new goog.events.Listener(\n        listener, null, this.src, typeStr, !!opt_useCapture, opt_listenerScope);\n    listenerObj.callOnce = callOnce;\n    listenerArray.push(listenerObj);\n  }\n  return listenerObj;\n};\n\n\n/**\n * Removes a matching listener.\n * @param {string|!goog.events.EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {boolean} Whether any listener was removed.\n */\ngoog.events.ListenerMap.prototype.remove = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  var typeStr = type.toString();\n  if (!(typeStr in this.listeners)) {\n    return false;\n  }\n\n  var listenerArray = this.listeners[typeStr];\n  var index = goog.events.ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    var listenerObj = listenerArray[index];\n    listenerObj.markAsRemoved();\n    goog.array.removeAt(listenerArray, index);\n    if (listenerArray.length == 0) {\n      delete this.listeners[typeStr];\n      this.typeCount_--;\n    }\n    return true;\n  }\n  return false;\n};\n\n\n/**\n * Removes the given listener object.\n * @param {!goog.events.ListenableKey} listener The listener to remove.\n * @return {boolean} Whether the listener is removed.\n */\ngoog.events.ListenerMap.prototype.removeByKey = function(listener) {\n  'use strict';\n  var type = listener.type;\n  if (!(type in this.listeners)) {\n    return false;\n  }\n\n  var removed = goog.array.remove(this.listeners[type], listener);\n  if (removed) {\n    /** @type {!goog.events.Listener} */ (listener).markAsRemoved();\n    if (this.listeners[type].length == 0) {\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return removed;\n};\n\n\n/**\n * Removes all listeners from this map. If opt_type is provided, only\n * listeners that match the given type are removed.\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove.\n * @return {number} Number of listeners removed.\n */\ngoog.events.ListenerMap.prototype.removeAll = function(opt_type) {\n  'use strict';\n  var typeStr = opt_type && opt_type.toString();\n  var count = 0;\n  for (var type in this.listeners) {\n    if (!typeStr || type == typeStr) {\n      var listenerArray = this.listeners[type];\n      for (var i = 0; i < listenerArray.length; i++) {\n        ++count;\n        listenerArray[i].markAsRemoved();\n      }\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets all listeners that match the given type and capture mode. The\n * returned array is a copy (but the listener objects are not).\n * @param {string|!goog.events.EventId} type The type of the listeners\n *     to retrieve.\n * @param {boolean} capture The capture mode of the listeners to retrieve.\n * @return {!Array<!goog.events.ListenableKey>} An array of matching\n *     listeners.\n */\ngoog.events.ListenerMap.prototype.getListeners = function(type, capture) {\n  'use strict';\n  var listenerArray = this.listeners[type.toString()];\n  var rv = [];\n  if (listenerArray) {\n    for (var i = 0; i < listenerArray.length; ++i) {\n      var listenerObj = listenerArray[i];\n      if (listenerObj.capture == capture) {\n        rv.push(listenerObj);\n      }\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!goog.events.EventId} type The type of the listener\n *     to retrieve.\n * @param {!Function} listener The listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {goog.events.ListenableKey} the found listener or null if not found.\n */\ngoog.events.ListenerMap.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  'use strict';\n  var listenerArray = this.listeners[type.toString()];\n  var i = -1;\n  if (listenerArray) {\n    i = goog.events.ListenerMap.findListenerIndex_(\n        listenerArray, listener, capture, opt_listenerScope);\n  }\n  return i > -1 ? listenerArray[i] : null;\n};\n\n\n/**\n * Whether there is a matching listener. If either the type or capture\n * parameters are unspecified, the function will match on the\n * remaining criteria.\n *\n * @param {string|!goog.events.EventId=} opt_type The type of the listener.\n * @param {boolean=} opt_capture The capture mode of the listener.\n * @return {boolean} Whether there is an active listener matching\n *     the requested type and/or capture phase.\n */\ngoog.events.ListenerMap.prototype.hasListener = function(\n    opt_type, opt_capture) {\n  'use strict';\n  var hasType = (opt_type !== undefined);\n  var typeStr = hasType ? opt_type.toString() : '';\n  var hasCapture = (opt_capture !== undefined);\n\n  return goog.object.some(this.listeners, function(listenerArray, type) {\n    'use strict';\n    for (var i = 0; i < listenerArray.length; ++i) {\n      if ((!hasType || listenerArray[i].type == typeStr) &&\n          (!hasCapture || listenerArray[i].capture == opt_capture)) {\n        return true;\n      }\n    }\n\n    return false;\n  });\n};\n\n\n/**\n * Finds the index of a matching goog.events.Listener in the given\n * listenerArray.\n * @param {!Array<!goog.events.Listener>} listenerArray Array of listener.\n * @param {!Function} listener The listener function.\n * @param {boolean=} opt_useCapture The capture flag for the listener.\n * @param {Object=} opt_listenerScope The listener scope.\n * @return {number} The index of the matching listener within the\n *     listenerArray.\n * @private\n */\ngoog.events.ListenerMap.findListenerIndex_ = function(\n    listenerArray, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  for (var i = 0; i < listenerArray.length; ++i) {\n    var listenerObj = listenerArray[i];\n    if (!listenerObj.removed && listenerObj.listener == listener &&\n        listenerObj.capture == !!opt_useCapture &&\n        listenerObj.handler == opt_listenerScope) {\n      return i;\n    }\n  }\n  return -1;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An event manager for both native browser event\n * targets and custom JavaScript event targets\n * (`goog.events.Listenable`). This provides an abstraction\n * over browsers' event systems.\n *\n * It also provides a simulation of W3C event model's capture phase in\n * Internet Explorer (IE 8 and below). Caveat: the simulation does not\n * interact well with listeners registered directly on the elements\n * (bypassing goog.events) or even with listeners registered via\n * goog.events in a separate JS binary. In these cases, we provide\n * no ordering guarantees.\n *\n * The listeners will receive a \"patched\" event object. Such event object\n * contains normalized values for certain event properties that differs in\n * different browsers.\n *\n * Example usage:\n * <pre>\n * goog.events.listen(myNode, 'click', function(e) { alert('woo') });\n * goog.events.listen(myNode, 'mouseover', mouseHandler, true);\n * goog.events.unlisten(myNode, 'mouseover', mouseHandler, true);\n * goog.events.removeAll(myNode);\n * </pre>\n *\n *                                            in IE and event object patching]\n *\n * @see ../demos/events.html\n * @see ../demos/event-propagation.html\n * @see ../demos/stopevent.html\n */\n\n// IMPLEMENTATION NOTES:\n// goog.events stores an auxiliary data structure on each EventTarget\n// source being listened on. This allows us to take advantage of GC,\n// having the data structure GC'd when the EventTarget is GC'd. This\n// GC behavior is equivalent to using W3C DOM Events directly.\n\ngoog.provide('goog.events');\ngoog.provide('goog.events.CaptureSimulationMode');\ngoog.provide('goog.events.Key');\ngoog.provide('goog.events.ListenableType');\n\ngoog.require('goog.asserts');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.BrowserEvent');\ngoog.require('goog.events.BrowserFeature');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.EventWrapper');\ngoog.requireType('goog.events.ListenableKey');\ngoog.requireType('goog.events.Listener');\n\n\n/**\n * @typedef {number|goog.events.ListenableKey}\n */\ngoog.events.Key;\n\n\n/**\n * @typedef {EventTarget|goog.events.Listenable}\n */\ngoog.events.ListenableType;\n\n\n/**\n * Property name on a native event target for the listener map\n * associated with the event target.\n * @private @const {string}\n */\ngoog.events.LISTENER_MAP_PROP_ = 'closure_lm_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * String used to prepend to IE event types.\n * @const\n * @private\n */\ngoog.events.onString_ = 'on';\n\n\n/**\n * Map of computed \"on<eventname>\" strings for IE event types. Caching\n * this removes an extra object allocation in goog.events.listen which\n * improves IE6 performance.\n * @const\n * @dict\n * @private\n */\ngoog.events.onStringMap_ = {};\n\n\n/**\n * @enum {number} Different capture simulation mode for IE8-.\n */\ngoog.events.CaptureSimulationMode = {\n  /**\n   * Does not perform capture simulation. Will asserts in IE8- when you\n   * add capture listeners.\n   */\n  OFF_AND_FAIL: 0,\n\n  /**\n   * Does not perform capture simulation, silently ignore capture\n   * listeners.\n   */\n  OFF_AND_SILENT: 1,\n\n  /**\n   * Performs capture simulation.\n   */\n  ON: 2\n};\n\n\n/**\n * @define {number} The capture simulation mode for IE8-. By default,\n *     this is ON.\n */\ngoog.events.CAPTURE_SIMULATION_MODE =\n    goog.define('goog.events.CAPTURE_SIMULATION_MODE', 2);\n\n\n/**\n * Estimated count of total native listeners.\n * @private {number}\n */\ngoog.events.listenerCountEstimate_ = 0;\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. A listener can only be added once\n * to an object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method, or an object with a handleEvent function.\n *     WARNING: passing an Object is now softly deprecated.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n */\ngoog.events.listen = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (opt_options && opt_options.once) {\n    return goog.events.listenOnce(\n        src, type, listener, opt_options, opt_handler);\n  }\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.listen(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listen(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ false, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target. A listener can only be added once to an object and if it\n * is added again the key for the listener is returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {EventTarget} src The node to listen to events on.\n * @param {string|?goog.events.EventId<EVENTOBJ>} type Event type.\n * @param {!Function} listener Callback function.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener or otherwise.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} Unique key for the listener.\n * @template EVENTOBJ\n * @private\n */\ngoog.events.listen_ = function(\n    src, type, listener, callOnce, opt_options, opt_handler) {\n  'use strict';\n  if (!type) {\n    throw new Error('Invalid event type');\n  }\n\n  var capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n  if (capture && !goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) {\n    if (goog.events.CAPTURE_SIMULATION_MODE ==\n        goog.events.CaptureSimulationMode.OFF_AND_FAIL) {\n      goog.asserts.fail('Can not register capture listener in IE8-.');\n      return null;\n    } else if (\n        goog.events.CAPTURE_SIMULATION_MODE ==\n        goog.events.CaptureSimulationMode.OFF_AND_SILENT) {\n      return null;\n    }\n  }\n\n  var listenerMap = goog.events.getListenerMap_(src);\n  if (!listenerMap) {\n    src[goog.events.LISTENER_MAP_PROP_] = listenerMap =\n        new goog.events.ListenerMap(src);\n  }\n\n  var listenerObj = /** @type {goog.events.Listener} */ (\n      listenerMap.add(type, listener, callOnce, capture, opt_handler));\n\n  // If the listenerObj already has a proxy, it has been set up\n  // previously. We simply return.\n  if (listenerObj.proxy) {\n    return listenerObj;\n  }\n\n  var proxy = goog.events.getProxy();\n  listenerObj.proxy = proxy;\n\n  proxy.src = src;\n  proxy.listener = listenerObj;\n\n  // Attach the proxy through the browser's API\n  if (src.addEventListener) {\n    // Don't pass an object as `capture` if the browser doesn't support that.\n    if (!goog.events.BrowserFeature.PASSIVE_EVENTS) {\n      opt_options = capture;\n    }\n    // Don't break tests that expect a boolean.\n    if (opt_options === undefined) opt_options = false;\n    src.addEventListener(type.toString(), proxy, opt_options);\n  } else if (src.attachEvent) {\n    // The else if above used to be an unconditional else. It would call\n    // attachEvent come gws or high water. This would sometimes throw an\n    // exception on IE11, spoiling the day of some callers. The previous\n    // incarnation of this code, from 2007, indicates that it replaced an\n    // earlier still version that caused excess allocations on IE6.\n    src.attachEvent(goog.events.getOnString_(type.toString()), proxy);\n  } else if (src.addListener && src.removeListener) {\n    // In IE, MediaQueryList uses addListener() insteadd of addEventListener. In\n    // Safari, there is no global for the MediaQueryList constructor, so we just\n    // check whether the object \"looks like\" MediaQueryList.\n    goog.asserts.assert(\n        type === 'change', 'MediaQueryList only has a change event');\n    src.addListener(proxy);\n  } else {\n    throw new Error('addEventListener and attachEvent are unavailable.');\n  }\n\n  goog.events.listenerCountEstimate_++;\n  return listenerObj;\n};\n\n\n/**\n * Helper function for returning a proxy function.\n * @return {!Function} A new or reused function object.\n */\ngoog.events.getProxy = function() {\n  'use strict';\n  var proxyCallbackFunction = goog.events.handleBrowserEvent_;\n  // Use a local var f to prevent one allocation.\n  var f =\n      goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT ? function(eventObject) {\n        'use strict';\n        return proxyCallbackFunction.call(f.src, f.listener, eventObject);\n      } : function(eventObject) {\n        'use strict';\n        var v = proxyCallbackFunction.call(f.src, f.listener, eventObject);\n        // NOTE(chrishenry): In IE, we hack in a capture phase. However, if\n        // there is inline event handler which tries to prevent default (for\n        // example <a href=\"...\" onclick=\"return false\">...</a>) in a\n        // descendant element, the prevent default will be overridden\n        // by this listener if this listener were to return true. Hence, we\n        // return undefined.\n        if (!v) return v;\n      };\n  return f;\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. After the event has fired the event\n * listener is removed from the target.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n */\ngoog.events.listenOnce = function(\n    src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.listenOnce(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listenOnce(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ true, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.Listenable}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.Listenable} src The target to\n *     listen to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:T, ?):?|{handleEvent:function(?):?}|null} listener\n *     Callback method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @template T\n */\ngoog.events.listenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.listen(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes an event listener which was added with listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types to unlisten to.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {(boolean|!EventListenerOptions)=} opt_options\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {?boolean} indicating whether the listener was there to remove.\n * @template EVENTOBJ\n */\ngoog.events.unlisten = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.unlisten(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n  var capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.unlisten(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return false;\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    var listenerObj = listenerMap.getListener(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n    if (listenerObj) {\n      return goog.events.unlistenByKey(listenerObj);\n    }\n  }\n\n  return false;\n};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {goog.events.Key} key The key returned by listen() for this\n *     event listener.\n * @return {boolean} indicating whether the listener was there to remove.\n */\ngoog.events.unlistenByKey = function(key) {\n  'use strict';\n  // TODO(chrishenry): Remove this check when tests that rely on this\n  // are fixed.\n  if (typeof key === 'number') {\n    return false;\n  }\n\n  var listener = key;\n  if (!listener || listener.removed) {\n    return false;\n  }\n\n  var src = listener.src;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return /** @type {!goog.events.Listenable} */ (src).unlistenByKey(listener);\n  }\n\n  var type = listener.type;\n  var proxy = listener.proxy;\n  if (src.removeEventListener) {\n    src.removeEventListener(type, proxy, listener.capture);\n  } else if (src.detachEvent) {\n    src.detachEvent(goog.events.getOnString_(type), proxy);\n  } else if (src.addListener && src.removeListener) {\n    src.removeListener(proxy);\n  }\n  goog.events.listenerCountEstimate_--;\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  // TODO(chrishenry): Try to remove this conditional and execute the\n  // first branch always. This should be safe.\n  if (listenerMap) {\n    listenerMap.removeByKey(listener);\n    if (listenerMap.getTypeCount() == 0) {\n      // Null the src, just because this is simple to do (and useful\n      // for IE <= 7).\n      listenerMap.src = null;\n      // We don't use delete here because IE does not allow delete\n      // on a window object.\n      src[goog.events.LISTENER_MAP_PROP_] = null;\n    }\n  } else {\n    /** @type {!goog.events.Listener} */ (listener).markAsRemoved();\n  }\n\n  return true;\n};\n\n\n/**\n * Removes an event listener which was added with listenWithWrapper().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n */\ngoog.events.unlistenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.unlisten(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes all listeners from an object. You can also optionally\n * remove listeners of a particular type.\n *\n * @param {Object|undefined} obj Object to remove listeners from. Must be an\n *     EventTarget or a goog.events.Listenable.\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove.\n *     Default is all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.removeAll = function(obj, opt_type) {\n  'use strict';\n  // TODO(chrishenry): Change the type of obj to\n  // (!EventTarget|!goog.events.Listenable).\n\n  if (!obj) {\n    return 0;\n  }\n\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {?} */ (obj).removeAllListeners(opt_type);\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  if (!listenerMap) {\n    return 0;\n  }\n\n  var count = 0;\n  var typeStr = opt_type && opt_type.toString();\n  for (var type in listenerMap.listeners) {\n    if (!typeStr || type == typeStr) {\n      // Clone so that we don't need to worry about unlistenByKey\n      // changing the content of the ListenerMap.\n      var listeners = listenerMap.listeners[type].concat();\n      for (var i = 0; i < listeners.length; ++i) {\n        if (goog.events.unlistenByKey(listeners[i])) {\n          ++count;\n        }\n      }\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets the listeners for a given object, type and capture phase.\n *\n * @param {Object} obj Object to get listeners for.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Capture phase?.\n * @return {!Array<!goog.events.Listener>} Array of listener objects.\n */\ngoog.events.getListeners = function(obj, type, capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).getListeners(\n        type, capture);\n  } else {\n    if (!obj) {\n      // TODO(chrishenry): We should tighten the API to accept\n      // !EventTarget|goog.events.Listenable, and add an assertion here.\n      return [];\n    }\n\n    var listenerMap = goog.events.getListenerMap_(\n        /** @type {!EventTarget} */ (obj));\n    return listenerMap ? listenerMap.getListeners(type, capture) : [];\n  }\n};\n\n\n/**\n * Gets the goog.events.Listener for the event or null if no such listener is\n * in use.\n *\n * @param {EventTarget|goog.events.Listenable} src The target from\n *     which to get listeners.\n * @param {?string|!goog.events.EventId<EVENTOBJ>} type The type of the event.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to get.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *                            whether the listener is fired during the\n *                            capture or bubble phase of the event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} the found listener or null if not found.\n * @template EVENTOBJ\n */\ngoog.events.getListener = function(src, type, listener, opt_capt, opt_handler) {\n  'use strict';\n  // TODO(chrishenry): Change type from ?string to string, or add assertion.\n  type = /** @type {string} */ (type);\n  listener = goog.events.wrapListener(listener);\n  var capture = !!opt_capt;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.getListener(type, listener, capture, opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return null;\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    return listenerMap.getListener(type, listener, capture, opt_handler);\n  }\n  return null;\n};\n\n\n/**\n * Returns whether an event target has any active listeners matching the\n * specified signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {EventTarget|goog.events.Listenable} obj Target to get\n *     listeners for.\n * @param {string|!goog.events.EventId=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble-phase\n *     listeners.\n * @return {boolean} Whether an event target has one or more listeners matching\n *     the requested type and/or capture phase.\n */\ngoog.events.hasListener = function(obj, opt_type, opt_capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return obj.hasListener(opt_type, opt_capture);\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  return !!listenerMap && listenerMap.hasListener(opt_type, opt_capture);\n};\n\n\n/**\n * Provides a nice string showing the normalized event objects public members\n * @param {Object} e Event Object.\n * @return {string} String of the public members of the normalized event object.\n */\ngoog.events.expose = function(e) {\n  'use strict';\n  var str = [];\n  for (var key in e) {\n    if (e[key] && e[key].id) {\n      str.push(key + ' = ' + e[key] + ' (' + e[key].id + ')');\n    } else {\n      str.push(key + ' = ' + e[key]);\n    }\n  }\n  return str.join('\\n');\n};\n\n\n/**\n * Returns a string with on prepended to the specified type. This is used for IE\n * which expects \"on\" to be prepended. This function caches the string in order\n * to avoid extra allocations in steady state.\n * @param {string} type Event type.\n * @return {string} The type string with 'on' prepended.\n * @private\n */\ngoog.events.getOnString_ = function(type) {\n  'use strict';\n  if (type in goog.events.onStringMap_) {\n    return goog.events.onStringMap_[type];\n  }\n  return goog.events.onStringMap_[type] = goog.events.onString_ + type;\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase\n *\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n */\ngoog.events.fireListeners = function(obj, type, capture, eventObject) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).fireListeners(\n        type, capture, eventObject);\n  }\n\n  return goog.events.fireListeners_(obj, type, capture, eventObject);\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase.\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n * @private\n */\ngoog.events.fireListeners_ = function(obj, type, capture, eventObject) {\n  'use strict';\n  /** @type {boolean} */\n  var retval = true;\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {EventTarget} */ (obj));\n  if (listenerMap) {\n    // TODO(chrishenry): Original code avoids array creation when there\n    // is no listener, so we do the same. If this optimization turns\n    // out to be not required, we can replace this with\n    // listenerMap.getListeners(type, capture) instead, which is simpler.\n    var listenerArray = listenerMap.listeners[type.toString()];\n    if (listenerArray) {\n      listenerArray = listenerArray.concat();\n      for (var i = 0; i < listenerArray.length; i++) {\n        var listener = listenerArray[i];\n        // We might not have a listener if the listener was removed.\n        if (listener && listener.capture == capture && !listener.removed) {\n          var result = goog.events.fireListener(listener, eventObject);\n          retval = retval && (result !== false);\n        }\n      }\n    }\n  }\n  return retval;\n};\n\n\n/**\n * Fires a listener with a set of arguments\n *\n * @param {goog.events.Listener} listener The listener object to call.\n * @param {Object} eventObject The event object to pass to the listener.\n * @return {*} Result of listener.\n */\ngoog.events.fireListener = function(listener, eventObject) {\n  'use strict';\n  var listenerFn = listener.listener;\n  var listenerHandler = listener.handler || listener.src;\n\n  if (listener.callOnce) {\n    goog.events.unlistenByKey(listener);\n  }\n  return listenerFn.call(listenerHandler, eventObject);\n};\n\n\n/**\n * Gets the total number of listeners currently in the system.\n * @return {number} Number of listeners.\n * @deprecated This returns estimated count, now that Closure no longer\n * stores a central listener registry. We still return an estimation\n * to keep existing listener-related tests passing. In the near future,\n * this function will be removed.\n */\ngoog.events.getTotalListenerCount = function() {\n  'use strict';\n  return goog.events.listenerCountEstimate_;\n};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {goog.events.Listenable} src The event target.\n * @param {goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the handlers returns false) this will also return false.\n *     If there are no handlers, or if all handlers return true, this returns\n *     true.\n */\ngoog.events.dispatchEvent = function(src, e) {\n  'use strict';\n  goog.asserts.assert(\n      goog.events.Listenable.isImplementedBy(src),\n      'Can not use goog.events.dispatchEvent with ' +\n          'non-goog.events.Listenable instance.');\n  return src.dispatchEvent(e);\n};\n\n\n/**\n * Installs exception protection for the browser event entry point using the\n * given error handler.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point.\n */\ngoog.events.protectBrowserEventEntryPoint = function(errorHandler) {\n  'use strict';\n  goog.events.handleBrowserEvent_ =\n      errorHandler.protectEntryPoint(goog.events.handleBrowserEvent_);\n};\n\n\n/**\n * Handles an event and dispatches it to the correct listeners. This\n * function is a proxy for the real listener the user specified.\n *\n * @param {goog.events.Listener} listener The listener object.\n * @param {Event=} opt_evt Optional event object that gets passed in via the\n *     native event handlers.\n * @return {*} Result of the event handler.\n * @this {EventTarget} The object or Element that fired the event.\n * @private\n */\ngoog.events.handleBrowserEvent_ = function(listener, opt_evt) {\n  'use strict';\n  if (listener.removed) {\n    return true;\n  }\n\n  // Synthesize event propagation if the browser does not support W3C\n  // event model.\n  if (!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) {\n    var ieEvent = opt_evt ||\n        /** @type {Event} */ (goog.getObjectByName('window.event'));\n    var evt = new goog.events.BrowserEvent(ieEvent, this);\n    /** @type {*} */\n    var retval = true;\n\n    if (goog.events.CAPTURE_SIMULATION_MODE ==\n        goog.events.CaptureSimulationMode.ON) {\n      // If we have not marked this event yet, we should perform capture\n      // simulation.\n      if (!goog.events.isMarkedIeEvent_(ieEvent)) {\n        goog.events.markIeEvent_(ieEvent);\n\n        var ancestors = [];\n        for (var parent = evt.currentTarget; parent;\n             parent = parent.parentNode) {\n          ancestors.push(parent);\n        }\n\n        // Fire capture listeners.\n        var type = listener.type;\n        for (var i = ancestors.length - 1;\n             !evt.hasPropagationStopped() && i >= 0; i--) {\n          evt.currentTarget = ancestors[i];\n          var result =\n              goog.events.fireListeners_(ancestors[i], type, true, evt);\n          retval = retval && result;\n        }\n\n        // Fire bubble listeners.\n        //\n        // We can technically rely on IE to perform bubble event\n        // propagation. However, it turns out that IE fires events in\n        // opposite order of attachEvent registration, which broke\n        // some code and tests that rely on the order. (While W3C DOM\n        // Level 2 Events TR leaves the event ordering unspecified,\n        // modern browsers and W3C DOM Level 3 Events Working Draft\n        // actually specify the order as the registration order.)\n        for (var i = 0; !evt.hasPropagationStopped() && i < ancestors.length;\n             i++) {\n          evt.currentTarget = ancestors[i];\n          var result =\n              goog.events.fireListeners_(ancestors[i], type, false, evt);\n          retval = retval && result;\n        }\n      }\n    } else {\n      retval = goog.events.fireListener(listener, evt);\n    }\n    return retval;\n  }\n\n  // Otherwise, simply fire the listener.\n  return goog.events.fireListener(\n      listener, new goog.events.BrowserEvent(opt_evt, this));\n};\n\n\n/**\n * This is used to mark the IE event object so we do not do the Closure pass\n * twice for a bubbling event.\n * @param {Event} e The IE browser event.\n * @private\n */\ngoog.events.markIeEvent_ = function(e) {\n  'use strict';\n  // Only the keyCode and the returnValue can be changed. We use keyCode for\n  // non keyboard events.\n  // event.returnValue is a bit more tricky. It is undefined by default. A\n  // boolean false prevents the default action. In a window.onbeforeunload and\n  // the returnValue is non undefined it will be alerted. However, we will only\n  // modify the returnValue for keyboard events. We can get a problem if non\n  // closure events sets the keyCode or the returnValue\n\n  var useReturnValue = false;\n\n  if (e.keyCode == 0) {\n    // We cannot change the keyCode in case that srcElement is input[type=file].\n    // We could test that that is the case but that would allocate 3 objects.\n    // If we use try/catch we will only allocate extra objects in the case of a\n    // failure.\n\n    try {\n      e.keyCode = -1;\n      return;\n    } catch (ex) {\n      useReturnValue = true;\n    }\n  }\n\n  if (useReturnValue ||\n      /** @type {boolean|undefined} */ (e.returnValue) == undefined) {\n    e.returnValue = true;\n  }\n};\n\n\n/**\n * This is used to check if an IE event has already been handled by the Closure\n * system so we do not do the Closure pass twice for a bubbling event.\n * @param {Event} e  The IE browser event.\n * @return {boolean} True if the event object has been marked.\n * @private\n */\ngoog.events.isMarkedIeEvent_ = function(e) {\n  'use strict';\n  return e.keyCode < 0 || e.returnValue != undefined;\n};\n\n\n/**\n * Counter to create unique event ids.\n * @private {number}\n */\ngoog.events.uniqueIdCounter_ = 0;\n\n\n/**\n * Creates a unique event id.\n *\n * @param {string} identifier The identifier.\n * @return {string} A unique identifier.\n * @idGenerator {unique}\n */\ngoog.events.getUniqueId = function(identifier) {\n  'use strict';\n  return identifier + '_' + goog.events.uniqueIdCounter_++;\n};\n\n\n/**\n * @param {EventTarget} src The source object.\n * @return {goog.events.ListenerMap} A listener map for the given\n *     source object, or null if none exists.\n * @private\n */\ngoog.events.getListenerMap_ = function(src) {\n  'use strict';\n  var listenerMap = src[goog.events.LISTENER_MAP_PROP_];\n  // IE serializes the property as well (e.g. when serializing outer\n  // HTML). So we must check that the value is of the correct type.\n  return listenerMap instanceof goog.events.ListenerMap ? listenerMap : null;\n};\n\n\n/**\n * Expando property for listener function wrapper for Object with\n * handleEvent.\n * @private @const {string}\n */\ngoog.events.LISTENER_WRAPPER_PROP_ =\n    '__closure_events_fn_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * @param {Object|Function} listener The listener function or an\n *     object that contains handleEvent method.\n * @return {!Function} Either the original function or a function that\n *     calls obj.handleEvent. If the same listener is passed to this\n *     function more than once, the same function is guaranteed to be\n *     returned.\n */\ngoog.events.wrapListener = function(listener) {\n  'use strict';\n  goog.asserts.assert(listener, 'Listener can not be null.');\n\n  if (typeof listener === 'function') {\n    return listener;\n  }\n\n  goog.asserts.assert(\n      listener.handleEvent, 'An object listener must have handleEvent method.');\n  if (!listener[goog.events.LISTENER_WRAPPER_PROP_]) {\n    listener[goog.events.LISTENER_WRAPPER_PROP_] = function(e) {\n      'use strict';\n      return /** @type {?} */ (listener).handleEvent(e);\n    };\n  }\n  return listener[goog.events.LISTENER_WRAPPER_PROP_];\n};\n\n\n// Register the browser event handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.events.handleBrowserEvent_ =\n          transformer(goog.events.handleBrowserEvent_);\n    });\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A disposable implementation of a custom\n * listenable/event target. See also: documentation for\n * `goog.events.Listenable`.\n *\n * @see ../demos/eventtarget.html\n * @see goog.events.Listenable\n */\n\ngoog.provide('goog.events.EventTarget');\n\ngoog.require('goog.Disposable');\ngoog.require('goog.asserts');\ngoog.require('goog.events');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.require('goog.object');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n\n/**\n * An implementation of `goog.events.Listenable` with full W3C\n * EventTarget-like support (capture/bubble mechanism, stopping event\n * propagation, preventing default actions).\n *\n * You may subclass this class to turn your class into a Listenable.\n *\n * Unless propagation is stopped, an event dispatched by an\n * EventTarget will bubble to the parent returned by\n * `getParentEventTarget`. To set the parent, call\n * `setParentEventTarget`. Subclasses that don't support\n * changing the parent can override the setter to throw an error.\n *\n * Example usage:\n * <pre>\n *   var source = new goog.events.EventTarget();\n *   function handleEvent(e) {\n *     alert('Type: ' + e.type + '; Target: ' + e.target);\n *   }\n *   source.listen('foo', handleEvent);\n *   // Or: goog.events.listen(source, 'foo', handleEvent);\n *   ...\n *   source.dispatchEvent('foo');  // will call handleEvent\n *   ...\n *   source.unlisten('foo', handleEvent);\n *   // Or: goog.events.unlisten(source, 'foo', handleEvent);\n * </pre>\n *\n * @constructor\n * @extends {goog.Disposable}\n * @implements {goog.events.Listenable}\n */\ngoog.events.EventTarget = function() {\n  'use strict';\n  goog.Disposable.call(this);\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @private {!goog.events.ListenerMap}\n   */\n  this.eventTargetListeners_ = new goog.events.ListenerMap(this);\n\n  /**\n   * The object to use for event.target. Useful when mixing in an\n   * EventTarget to another object.\n   * @private {!Object}\n   */\n  this.actualEventTarget_ = this;\n\n  /**\n   * Parent event target, used during event bubbling.\n   *\n   * TODO(chrishenry): Change this to goog.events.Listenable. This\n   * currently breaks people who expect getParentEventTarget to return\n   * goog.events.EventTarget.\n   *\n   * @private {?goog.events.EventTarget}\n   */\n  this.parentEventTarget_ = null;\n};\ngoog.inherits(goog.events.EventTarget, goog.Disposable);\ngoog.events.Listenable.addImplementation(goog.events.EventTarget);\n\n\n/**\n * An artificial cap on the number of ancestors you can have. This is mainly\n * for loop detection.\n * @const {number}\n * @private\n */\ngoog.events.EventTarget.MAX_ANCESTORS_ = 1000;\n\n\n/**\n * Returns the parent of this event target to use for bubbling.\n *\n * @return {goog.events.EventTarget} The parent EventTarget or null if\n *     there is no parent.\n * @override\n */\ngoog.events.EventTarget.prototype.getParentEventTarget = function() {\n  'use strict';\n  return this.parentEventTarget_;\n};\n\n\n/**\n * Sets the parent of this event target to use for capture/bubble\n * mechanism.\n * @param {goog.events.EventTarget} parent Parent listenable (null if none).\n */\ngoog.events.EventTarget.prototype.setParentEventTarget = function(parent) {\n  'use strict';\n  this.parentEventTarget_ = parent;\n};\n\n\n/**\n * Adds an event listener to the event target. The same handler can only be\n * added once per the type. Even if you add the same handler multiple times\n * using the same type then it will only be called once when the event is\n * dispatched.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `#listen` instead, when possible. Otherwise, use\n *     `goog.events.listen` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.addEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.listen(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * Removes an event listener from the event target. The handler must be the\n * same object as the one added. If the handler has not been added then\n * nothing is done.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `#unlisten` instead, when possible. Otherwise, use\n *     `goog.events.unlisten` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.removeEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.unlisten(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @override\n */\ngoog.events.EventTarget.prototype.dispatchEvent = function(e) {\n  'use strict';\n  this.assertInitialized_();\n\n  var ancestorsTree, ancestor = this.getParentEventTarget();\n  if (ancestor) {\n    ancestorsTree = [];\n    var ancestorCount = 1;\n    for (; ancestor; ancestor = ancestor.getParentEventTarget()) {\n      ancestorsTree.push(ancestor);\n      goog.asserts.assert(\n          (++ancestorCount < goog.events.EventTarget.MAX_ANCESTORS_),\n          'infinite loop');\n    }\n  }\n\n  return goog.events.EventTarget.dispatchEventInternal_(\n      this.actualEventTarget_, e, ancestorsTree);\n};\n\n\n/**\n * Removes listeners from this object.  Classes that extend EventTarget may\n * need to override this method in order to remove references to DOM Elements\n * and additional listeners.\n * @override\n * @protected\n */\ngoog.events.EventTarget.prototype.disposeInternal = function() {\n  'use strict';\n  goog.events.EventTarget.superClass_.disposeInternal.call(this);\n\n  this.removeAllListeners();\n  this.parentEventTarget_ = null;\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  this.assertInitialized_();\n  return this.eventTargetListeners_.add(\n      String(type), listener, false /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.add(\n      String(type), listener, true /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.remove(\n      String(type), listener, opt_useCapture, opt_listenerScope);\n};\n\n\n/**\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n * @override\n */\ngoog.events.EventTarget.prototype.unlistenByKey = function(key) {\n  'use strict';\n  return this.eventTargetListeners_.removeByKey(key);\n};\n\n\n/**\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n * @override\n */\ngoog.events.EventTarget.prototype.removeAllListeners = function(opt_type) {\n  'use strict';\n  // TODO(chrishenry): Previously, removeAllListeners can be called on\n  // uninitialized EventTarget, so we preserve that behavior. We\n  // should remove this when usages that rely on that fact are purged.\n  if (!this.eventTargetListeners_) {\n    return 0;\n  }\n  return this.eventTargetListeners_.removeAll(opt_type);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.fireListeners = function(\n    type, capture, eventObject) {\n  'use strict';\n  // TODO(chrishenry): Original code avoids array creation when there\n  // is no listener, so we do the same. If this optimization turns\n  // out to be not required, we can replace this with\n  // getListeners(type, capture) instead, which is simpler.\n  var listenerArray = this.eventTargetListeners_.listeners[String(type)];\n  if (!listenerArray) {\n    return true;\n  }\n  listenerArray = listenerArray.concat();\n\n  var rv = true;\n  for (var i = 0; i < listenerArray.length; ++i) {\n    var listener = listenerArray[i];\n    // We might not have a listener if the listener was removed.\n    if (listener && !listener.removed && listener.capture == capture) {\n      var listenerFn = listener.listener;\n      var listenerHandler = listener.handler || listener.src;\n\n      if (listener.callOnce) {\n        this.unlistenByKey(listener);\n      }\n      rv = listenerFn.call(listenerHandler, eventObject) !== false && rv;\n    }\n  }\n\n  return rv && !eventObject.defaultPrevented;\n};\n\n\n/**\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListeners = function(type, capture) {\n  'use strict';\n  return this.eventTargetListeners_.getListeners(String(type), capture);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.getListener(\n      String(type), listener, capture, opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.hasListener = function(\n    opt_type, opt_capture) {\n  'use strict';\n  var id = (opt_type !== undefined) ? String(opt_type) : undefined;\n  return this.eventTargetListeners_.hasListener(id, opt_capture);\n};\n\n\n/**\n * Sets the target to be used for `event.target` when firing\n * event. Mainly used for testing. For example, see\n * `goog.testing.events.mixinListenable`.\n * @param {!Object} target The target.\n */\ngoog.events.EventTarget.prototype.setTargetForTesting = function(target) {\n  'use strict';\n  this.actualEventTarget_ = target;\n};\n\n\n/**\n * Asserts that the event target instance is initialized properly.\n * @private\n */\ngoog.events.EventTarget.prototype.assertInitialized_ = function() {\n  'use strict';\n  goog.asserts.assert(\n      this.eventTargetListeners_,\n      'Event target is not initialized. Did you call the superclass ' +\n          '(goog.events.EventTarget) constructor?');\n};\n\n\n/**\n * Dispatches the given event on the ancestorsTree.\n *\n * @param {!Object} target The target to dispatch on.\n * @param {goog.events.Event|Object|string} e The event object.\n * @param {Array<goog.events.Listenable>=} opt_ancestorsTree The ancestors\n *     tree of the target, in reverse order from the closest ancestor\n *     to the root event target. May be null if the target has no ancestor.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @private\n */\ngoog.events.EventTarget.dispatchEventInternal_ = function(\n    target, e, opt_ancestorsTree) {\n  'use strict';\n  /** @suppress {missingProperties} */\n  var type = e.type || /** @type {string} */ (e);\n\n  // If accepting a string or object, create a custom event object so that\n  // preventDefault and stopPropagation work with the event.\n  if (typeof e === 'string') {\n    e = new goog.events.Event(e, target);\n  } else if (!(e instanceof goog.events.Event)) {\n    var oldEvent = e;\n    e = new goog.events.Event(type, target);\n    goog.object.extend(e, oldEvent);\n  } else {\n    e.target = e.target || target;\n  }\n\n  var rv = true, currentTarget;\n\n  // Executes all capture listeners on the ancestors, if any.\n  if (opt_ancestorsTree) {\n    for (var i = opt_ancestorsTree.length - 1;\n         !e.hasPropagationStopped() && i >= 0; i--) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, true, e) && rv;\n    }\n  }\n\n  // Executes capture and bubble listeners on the target.\n  if (!e.hasPropagationStopped()) {\n    currentTarget = /** @type {?} */ (e.currentTarget = target);\n    rv = currentTarget.fireListeners(type, true, e) && rv;\n    if (!e.hasPropagationStopped()) {\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  // Executes all bubble listeners on the ancestors, if any.\n  if (opt_ancestorsTree) {\n    for (i = 0; !e.hasPropagationStopped() && i < opt_ancestorsTree.length;\n         i++) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  return rv;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview JSON utility functions.\n */\n\n\ngoog.provide('goog.json');\ngoog.provide('goog.json.Replacer');\ngoog.provide('goog.json.Reviver');\ngoog.provide('goog.json.Serializer');\n\n\n/**\n * @define {boolean} If true, use the native JSON parsing API.\n * NOTE: The default `goog.json.parse` implementation is able to handle\n * invalid JSON. JSPB used to produce invalid JSON which is not the case\n * anymore so this is safe to enable for parsing JSPB. Using native JSON is\n * faster and safer than the default implementation using `eval`.\n */\ngoog.json.USE_NATIVE_JSON = goog.define('goog.json.USE_NATIVE_JSON', false);\n\n/**\n * @define {boolean} If true, try the native JSON parsing API first. If it\n * fails, log an error and use `eval` instead. This is useful when\n * transitioning to `goog.json.USE_NATIVE_JSON`. The error logger needs to\n * be set by `goog.json.setErrorLogger`. If it is not set then the error\n * is ignored.\n */\ngoog.json.TRY_NATIVE_JSON = goog.define('goog.json.TRY_NATIVE_JSON', true);\n\n\n/**\n * Tests if a string is an invalid JSON string. This only ensures that we are\n * not using any invalid characters\n * @param {string} s The string to test.\n * @return {boolean} True if the input is a valid JSON string.\n */\ngoog.json.isValid = function(s) {\n  'use strict';\n  // All empty whitespace is not valid.\n  if (/^\\s*$/.test(s)) {\n    return false;\n  }\n\n  // This is taken from http://www.json.org/json2.js which is released to the\n  // public domain.\n  // Changes: We dissallow \\u2028 Line separator and \\u2029 Paragraph separator\n  // inside strings.  We also treat \\u2028 and \\u2029 as whitespace which they\n  // are in the RFC but IE and Safari does not match \\s to these so we need to\n  // include them in the reg exps in all places where whitespace is allowed.\n  // We allowed \\x7f inside strings because some tools don't escape it,\n  // e.g. http://www.json.org/java/org/json/JSONObject.java\n\n  // Parsing happens in three stages. In the first stage, we run the text\n  // against regular expressions that look for non-JSON patterns. We are\n  // especially concerned with '()' and 'new' because they can cause invocation,\n  // and '=' because it can cause mutation. But just to be safe, we want to\n  // reject all unexpected forms.\n\n  // We split the first stage into 4 regexp operations in order to work around\n  // crippling inefficiencies in IE's and Safari's regexp engines. First we\n  // replace all backslash pairs with '@' (a non-JSON character). Second, we\n  // replace all simple value tokens with ']' characters, but only when followed\n  // by a colon, comma, closing bracket or end of string. Third, we delete all\n  // open brackets that follow a colon or comma or that begin the text. Finally,\n  // we look to see that the remaining characters are only whitespace or ']' or\n  // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n  // Don't make these static since they have the global flag.\n  const backslashesRe = /\\\\[\"\\\\\\/bfnrtu]/g;\n  const simpleValuesRe =\n      /(?:\"[^\"\\\\\\n\\r\\u2028\\u2029\\x00-\\x08\\x0a-\\x1f]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)[\\s\\u2028\\u2029]*(?=:|,|]|}|$)/g;\n  const openBracketsRe = /(?:^|:|,)(?:[\\s\\u2028\\u2029]*\\[)+/g;\n  const remainderRe = /^[\\],:{}\\s\\u2028\\u2029]*$/;\n\n  return remainderRe.test(\n      s.replace(backslashesRe, '@')\n          .replace(simpleValuesRe, ']')\n          .replace(openBracketsRe, ''));\n};\n\n/**\n * Logs a parsing error in `JSON.parse` solvable by using `eval`\n * if `goog.json.TRY_NATIVE_JSON` is enabled.\n * @private {function(string, !Error)} The first parameter is the error message,\n *     the second is the exception thrown by `JSON.parse`.\n */\ngoog.json.errorLogger_ = goog.nullFunction;\n\n\n/**\n * Sets an error logger to use if there's a recoverable parsing error and\n * `goog.json.TRY_NATIVE_JSON` is enabled.\n * @param {function(string, !Error)} errorLogger The first parameter is the\n *     error message, the second is the exception thrown by `JSON.parse`.\n */\ngoog.json.setErrorLogger = function(errorLogger) {\n  'use strict';\n  goog.json.errorLogger_ = errorLogger;\n};\n\n\n/**\n * Parses a JSON string and returns the result. This throws an exception if\n * the string is an invalid JSON string.\n *\n * Note that this is very slow on large strings. Use JSON.parse if possible.\n *\n * @param {*} s The JSON string to parse.\n * @throws Error if s is invalid JSON.\n * @return {Object} The object generated from the JSON string, or null.\n * @deprecated Use JSON.parse.\n */\ngoog.json.parse = goog.json.USE_NATIVE_JSON ?\n    /** @type {function(*):Object} */ (goog.global['JSON']['parse']) :\n    function(s) {\n      'use strict';\n      let error;\n      if (goog.json.TRY_NATIVE_JSON) {\n        try {\n          return goog.global['JSON']['parse'](s);\n        } catch (ex) {\n          error = ex;\n        }\n      }\n      const o = String(s);\n      if (goog.json.isValid(o)) {\n\n        try {\n          const result = /** @type {?Object} */ (eval('(' + o + ')'));\n          if (error) {\n            goog.json.errorLogger_('Invalid JSON: ' + o, error);\n          }\n          return result;\n        } catch (ex) {\n        }\n      }\n      throw new Error('Invalid JSON string: ' + o);\n    };\n\n\n/**\n * JSON replacer, as defined in Section 15.12.3 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * TODO(nicksantos): Array should also be a valid replacer.\n *\n * @typedef {function(this:Object, string, *): *}\n */\ngoog.json.Replacer;\n\n\n/**\n * JSON reviver, as defined in Section 15.12.2 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * @typedef {function(this:Object, string, *): *}\n */\ngoog.json.Reviver;\n\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @param {?goog.json.Replacer=} opt_replacer A replacer function\n *     called for each (key, value) pair that determines how the value\n *     should be serialized. By defult, this just returns the value\n *     and allows default serialization to kick in.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\ngoog.json.serialize = goog.json.USE_NATIVE_JSON ?\n    /** @type {function(*, ?goog.json.Replacer=):string} */\n    (goog.global['JSON']['stringify']) :\n    function(object, opt_replacer) {\n      'use strict';\n      // NOTE(nicksantos): Currently, we never use JSON.stringify.\n      //\n      // The last time I evaluated this, JSON.stringify had subtle bugs and\n      // behavior differences on all browsers, and the performance win was not\n      // large enough to justify all the issues. This may change in the future\n      // as browser implementations get better.\n      //\n      // assertSerialize in json_test contains if branches for the cases\n      // that fail.\n      return new goog.json.Serializer(opt_replacer).serialize(object);\n    };\n\n\n\n/**\n * Class that is used to serialize JSON objects to a string.\n * @param {?goog.json.Replacer=} opt_replacer Replacer.\n * @constructor\n */\ngoog.json.Serializer = function(opt_replacer) {\n  'use strict';\n  /**\n   * @type {goog.json.Replacer|null|undefined}\n   * @private\n   */\n  this.replacer_ = opt_replacer;\n};\n\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\ngoog.json.Serializer.prototype.serialize = function(object) {\n  'use strict';\n  const sb = [];\n  this.serializeInternal(object, sb);\n  return sb.join('');\n};\n\n\n/**\n * Serializes a generic value to a JSON string\n * @protected\n * @param {*} object The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @throws Error if there are loops in the object graph.\n */\ngoog.json.Serializer.prototype.serializeInternal = function(object, sb) {\n  'use strict';\n  if (object == null) {\n    // undefined == null so this branch covers undefined as well as null\n    sb.push('null');\n    return;\n  }\n\n  if (typeof object == 'object') {\n    if (Array.isArray(object)) {\n      this.serializeArray(object, sb);\n      return;\n    } else if (\n        object instanceof String || object instanceof Number ||\n        object instanceof Boolean) {\n      object = object.valueOf();\n      // Fall through to switch below.\n    } else {\n      this.serializeObject_(/** @type {!Object} */ (object), sb);\n      return;\n    }\n  }\n\n  switch (typeof object) {\n    case 'string':\n      this.serializeString_(object, sb);\n      break;\n    case 'number':\n      this.serializeNumber_(object, sb);\n      break;\n    case 'boolean':\n      sb.push(String(object));\n      break;\n    case 'function':\n      sb.push('null');\n      break;\n    default:\n      throw new Error('Unknown type: ' + typeof object);\n  }\n};\n\n\n/**\n * Character mappings used internally for goog.string.quote\n * @private\n * @type {!Object}\n */\ngoog.json.Serializer.charToJsonCharCache_ = {\n  '\\\"': '\\\\\"',\n  '\\\\': '\\\\\\\\',\n  '/': '\\\\/',\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t',\n\n  '\\x0B': '\\\\u000b'  // '\\v' is not supported in JScript\n};\n\n\n/**\n * Regular expression used to match characters that need to be replaced.\n * The S60 browser has a bug where unicode characters are not matched by\n * regular expressions. The condition below detects such behaviour and\n * adjusts the regular expression accordingly.\n * @private\n * @type {!RegExp}\n */\ngoog.json.Serializer.charsToReplace_ = /\\uffff/.test('\\uffff') ?\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\uffff]/g :\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\xff]/g;\n\n\n/**\n * Serializes a string to a JSON string\n * @private\n * @param {string} s The string to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeString_ = function(s, sb) {\n  'use strict';\n  // The official JSON implementation does not work with international\n  // characters.\n  sb.push('\"', s.replace(goog.json.Serializer.charsToReplace_, function(c) {\n    'use strict';\n    // caching the result improves performance by a factor 2-3\n    let rv = goog.json.Serializer.charToJsonCharCache_[c];\n    if (!rv) {\n      rv = '\\\\u' + (c.charCodeAt(0) | 0x10000).toString(16).substr(1);\n      goog.json.Serializer.charToJsonCharCache_[c] = rv;\n    }\n    return rv;\n  }), '\"');\n};\n\n\n/**\n * Serializes a number to a JSON string\n * @private\n * @param {number} n The number to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeNumber_ = function(n, sb) {\n  'use strict';\n  sb.push(isFinite(n) && !isNaN(n) ? String(n) : 'null');\n};\n\n\n/**\n * Serializes an array to a JSON string\n * @param {Array<string>} arr The array to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @protected\n */\ngoog.json.Serializer.prototype.serializeArray = function(arr, sb) {\n  'use strict';\n  const l = arr.length;\n  sb.push('[');\n  let sep = '';\n  for (let i = 0; i < l; i++) {\n    sb.push(sep);\n\n    const value = arr[i];\n    this.serializeInternal(\n        this.replacer_ ? this.replacer_.call(arr, String(i), value) : value,\n        sb);\n\n    sep = ',';\n  }\n  sb.push(']');\n};\n\n\n/**\n * Serializes an object to a JSON string\n * @private\n * @param {!Object} obj The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeObject_ = function(obj, sb) {\n  'use strict';\n  sb.push('{');\n  let sep = '';\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      const value = obj[key];\n      // Skip functions.\n      if (typeof value != 'function') {\n        sb.push(sep);\n        this.serializeString_(key, sb);\n        sb.push(':');\n\n        this.serializeInternal(\n            this.replacer_ ? this.replacer_.call(obj, key, value) : value, sb);\n\n        sep = ',';\n      }\n    }\n  }\n  sb.push('}');\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.module('goog.async.WorkQueue');\ngoog.module.declareLegacyNamespace();\n\nconst FreeList = goog.require('goog.async.FreeList');\nconst {assert} = goog.require('goog.asserts');\n\n// TODO(johnlenz): generalize the WorkQueue if this is used by more\n// than goog.async.run.\n\n\n/**\n * A low GC workqueue. The key elements of this design:\n *   - avoids the need for goog.bind or equivalent by carrying scope\n *   - avoids the need for array reallocation by using a linked list\n *   - minimizes work entry objects allocation by recycling objects\n * @final\n * @struct\n */\nclass WorkQueue {\n  constructor() {\n    this.workHead_ = null;\n    this.workTail_ = null;\n  }\n\n  /**\n   * @param {function()} fn\n   * @param {Object|null|undefined} scope\n   */\n  add(fn, scope) {\n    const item = this.getUnusedItem_();\n    item.set(fn, scope);\n\n    if (this.workTail_) {\n      this.workTail_.next = item;\n      this.workTail_ = item;\n    } else {\n      assert(!this.workHead_);\n      this.workHead_ = item;\n      this.workTail_ = item;\n    }\n  }\n\n  /**\n   * @return {?WorkItem}\n   */\n  remove() {\n    let item = null;\n\n    if (this.workHead_) {\n      item = this.workHead_;\n      this.workHead_ = this.workHead_.next;\n      if (!this.workHead_) {\n        this.workTail_ = null;\n      }\n      item.next = null;\n    }\n    return item;\n  }\n\n  /**\n   * @param {!WorkItem} item\n   */\n  returnUnused(item) {\n    WorkQueue.freelist_.put(item);\n  }\n\n  /**\n   * @return {!WorkItem}\n   * @private\n   */\n  getUnusedItem_() {\n    return WorkQueue.freelist_.get();\n  }\n}\n\n/** @define {number} The maximum number of entries to keep for recycling. */\nWorkQueue.DEFAULT_MAX_UNUSED =\n    goog.define('goog.async.WorkQueue.DEFAULT_MAX_UNUSED', 100);\n\n/** @const @private {!FreeList<!WorkItem>} */\nWorkQueue.freelist_ = new FreeList(\n    () => new WorkItem(), item => item.reset(), WorkQueue.DEFAULT_MAX_UNUSED);\n\n/**\n * @final\n * @struct\n */\nclass WorkItem {\n  constructor() {\n    /** @type {?function()} */\n    this.fn = null;\n    /** @type {?Object|null|undefined} */\n    this.scope = null;\n    /** @type {?WorkItem} */\n    this.next = null;\n  }\n\n  /**\n   * @param {function()} fn\n   * @param {Object|null|undefined} scope\n   */\n  set(fn, scope) {\n    'use strict';\n    this.fn = fn;\n    this.scope = scope;\n    this.next = null;\n  }\n\n  /** Reset the work item so they don't prevent GC before reuse */\n  reset() {\n    this.fn = null;\n    this.scope = null;\n    this.next = null;\n  }\n}\n\nexports = WorkQueue;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.async.run');\n\ngoog.require('goog.async.WorkQueue');\ngoog.require('goog.async.nextTick');\ngoog.require('goog.async.throwException');\n\n/**\n * @define {boolean} If true, use the global Promise to implement goog.async.run\n * assuming either the native, or polyfill version will be used. Does still\n * permit tests to use forceNextTick.\n */\ngoog.ASSUME_NATIVE_PROMISE = goog.define('goog.ASSUME_NATIVE_PROMISE', false);\n\n/**\n * Fires the provided callback just before the current callstack unwinds, or as\n * soon as possible after the current JS execution context.\n * @param {function(this:THIS)} callback\n * @param {THIS=} opt_context Object to use as the \"this value\" when calling\n *     the provided function.\n * @template THIS\n */\ngoog.async.run = function(callback, opt_context) {\n  'use strict';\n  if (!goog.async.run.schedule_) {\n    goog.async.run.initializeRunner_();\n  }\n  if (!goog.async.run.workQueueScheduled_) {\n    // Nothing is currently scheduled, schedule it now.\n    goog.async.run.schedule_();\n    goog.async.run.workQueueScheduled_ = true;\n  }\n\n  goog.async.run.workQueue_.add(callback, opt_context);\n};\n\n\n/**\n * Initializes the function to use to process the work queue.\n * @private\n */\ngoog.async.run.initializeRunner_ = function() {\n  'use strict';\n  if (goog.ASSUME_NATIVE_PROMISE ||\n      (goog.global.Promise && goog.global.Promise.resolve)) {\n    // Use goog.global.Promise instead of just Promise because the relevant\n    // externs may be missing, and don't alias it because this could confuse the\n    // compiler into thinking the polyfill is required when it should be treated\n    // as optional.\n    var promise = goog.global.Promise.resolve(undefined);\n    goog.async.run.schedule_ = function() {\n      'use strict';\n      promise.then(goog.async.run.processWorkQueue);\n    };\n  } else {\n    goog.async.run.schedule_ = function() {\n      'use strict';\n      goog.async.nextTick(goog.async.run.processWorkQueue);\n    };\n  }\n};\n\n\n/**\n * Forces goog.async.run to use nextTick instead of Promise.\n *\n * This should only be done in unit tests. It's useful because MockClock\n * replaces nextTick, but not the browser Promise implementation, so it allows\n * Promise-based code to be tested with MockClock.\n *\n * However, we also want to run promises if the MockClock is no longer in\n * control so we schedule a backup \"setTimeout\" to the unmocked timeout if\n * provided.\n *\n * @param {function(function())=} opt_realSetTimeout\n */\ngoog.async.run.forceNextTick = function(opt_realSetTimeout) {\n  'use strict';\n  goog.async.run.schedule_ = function() {\n    'use strict';\n    goog.async.nextTick(goog.async.run.processWorkQueue);\n    if (opt_realSetTimeout) {\n      opt_realSetTimeout(goog.async.run.processWorkQueue);\n    }\n  };\n};\n\n\n/**\n * The function used to schedule work asynchronousely.\n * @private {function()}\n */\ngoog.async.run.schedule_;\n\n\n/** @private {boolean} */\ngoog.async.run.workQueueScheduled_ = false;\n\n\n/** @private {!goog.async.WorkQueue} */\ngoog.async.run.workQueue_ = new goog.async.WorkQueue();\n\n\nif (goog.DEBUG) {\n  /**\n   * Reset the work queue. Only available for tests in debug mode.\n   */\n  goog.async.run.resetQueue = function() {\n    'use strict';\n    goog.async.run.workQueueScheduled_ = false;\n    goog.async.run.workQueue_ = new goog.async.WorkQueue();\n  };\n}\n\n\n/**\n * Run any pending goog.async.run work items. This function is not intended\n * for general use, but for use by entry point handlers to run items ahead of\n * goog.async.nextTick.\n */\ngoog.async.run.processWorkQueue = function() {\n  'use strict';\n  // NOTE: additional work queue items may be added while processing.\n  var item = null;\n  while (item = goog.async.run.workQueue_.remove()) {\n    try {\n      item.fn.call(item.scope);\n    } catch (e) {\n      goog.async.throwException(e);\n    }\n    goog.async.run.workQueue_.returnUnused(item);\n  }\n\n  // There are no more work items, allow processing to be scheduled again.\n  goog.async.run.workQueueScheduled_ = false;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Simple freelist.\n *\n * An anterative to goog.structs.SimplePool, it imposes the requirement that the\n * objects in the list contain a \"next\" property that can be used to maintain\n * the pool.\n */\n\ngoog.provide('goog.async.FreeList');\n\n\n/**\n * @template ITEM\n */\ngoog.async.FreeList = class {\n  /**\n   * @param {function():ITEM} create\n   * @param {function(ITEM):void} reset\n   * @param {number} limit\n   */\n  constructor(create, reset, limit) {\n    /** @private @const {number} */\n    this.limit_ = limit;\n    /** @private @const {function()} */\n    this.create_ = create;\n    /** @private @const {function(ITEM):void} */\n    this.reset_ = reset;\n\n    /** @private {number} */\n    this.occupants_ = 0;\n    /** @private {ITEM} */\n    this.head_ = null;\n  }\n\n  /**\n   * @return {ITEM}\n   */\n  get() {\n    let item;\n    if (this.occupants_ > 0) {\n      this.occupants_--;\n      item = this.head_;\n      this.head_ = item.next;\n      item.next = null;\n    } else {\n      item = this.create_();\n    }\n    return item;\n  }\n\n  /**\n   * @param {ITEM} item An item available for possible future reuse.\n   */\n  put(item) {\n    this.reset_(item);\n    if (this.occupants_ < this.limit_) {\n      this.occupants_++;\n      item.next = this.head_;\n      this.head_ = item;\n    }\n  }\n\n  /**\n   * Visible for testing.\n   * @package\n   * @return {number}\n   */\n  occupants() {\n    return this.occupants_;\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a function to throw an error without interrupting\n * the current execution context.\n */\n\ngoog.module('goog.async.throwException');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Throw an item without interrupting the current execution context.  For\n * example, if processing a group of items in a loop, sometimes it is useful\n * to report an error while still allowing the rest of the batch to be\n * processed.\n * @param {*} exception\n */\nfunction throwException(exception) {\n  // Each throw needs to be in its own context.\n  goog.global.setTimeout(() => {\n    throw exception;\n  }, 0);\n}\nexports = throwException;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A timer class to which other classes and objects can listen on.\n * This is only an abstraction above `setInterval`.\n *\n * @see ../demos/timers.html\n */\n\ngoog.provide('goog.Timer');\n\ngoog.require('goog.Promise');\ngoog.require('goog.events.EventTarget');\ngoog.requireType('goog.Thenable');\n\n\n\n/**\n * Class for handling timing events.\n *\n * @param {number=} opt_interval Number of ms between ticks (default: 1ms).\n * @param {Object=} opt_timerObject  An object that has `setTimeout`,\n *     `setInterval`, `clearTimeout` and `clearInterval`\n *     (e.g., `window`).\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ngoog.Timer = function(opt_interval, opt_timerObject) {\n  'use strict';\n  goog.events.EventTarget.call(this);\n\n  /**\n   * Number of ms between ticks\n   * @private {number}\n   */\n  this.interval_ = opt_interval || 1;\n\n  /**\n   * An object that implements `setTimeout`, `setInterval`,\n   * `clearTimeout` and `clearInterval`. We default to the window\n   * object. Changing this on {@link goog.Timer.prototype} changes the object\n   * for all timer instances which can be useful if your environment has some\n   * other implementation of timers than the `window` object.\n   * @private {{setTimeout:!Function, clearTimeout:!Function}}\n   */\n  this.timerObject_ = /** @type {{setTimeout, clearTimeout}} */ (\n      opt_timerObject || goog.Timer.defaultTimerObject);\n\n  /**\n   * Cached `tick_` bound to the object for later use in the timer.\n   * @private {Function}\n   * @const\n   */\n  this.boundTick_ = goog.bind(this.tick_, this);\n\n  /**\n   * Firefox browser often fires the timer event sooner (sometimes MUCH sooner)\n   * than the requested timeout. So we compare the time to when the event was\n   * last fired, and reschedule if appropriate. See also\n   * {@link goog.Timer.intervalScale}.\n   * @private {number}\n   */\n  this.last_ = goog.now();\n};\ngoog.inherits(goog.Timer, goog.events.EventTarget);\n\n\n/**\n * Maximum timeout value.\n *\n * Timeout values too big to fit into a signed 32-bit integer may cause overflow\n * in FF, Safari, and Chrome, resulting in the timeout being scheduled\n * immediately. It makes more sense simply not to schedule these timeouts, since\n * 24.8 days is beyond a reasonable expectation for the browser to stay open.\n *\n * @private {number}\n * @const\n */\ngoog.Timer.MAX_TIMEOUT_ = 2147483647;\n\n\n/**\n * A timer ID that cannot be returned by any known implementation of\n * `window.setTimeout`. Passing this value to `window.clearTimeout`\n * should therefore be a no-op.\n *\n * @private {number}\n * @const\n */\ngoog.Timer.INVALID_TIMEOUT_ID_ = -1;\n\n\n/**\n * Whether this timer is enabled\n * @type {boolean}\n */\ngoog.Timer.prototype.enabled = false;\n\n\n/**\n * An object that implements `setTimeout`, `setInterval`,\n * `clearTimeout` and `clearInterval`. We default to the global\n * object. Changing `goog.Timer.defaultTimerObject` changes the object for\n * all timer instances which can be useful if your environment has some other\n * implementation of timers you'd like to use.\n * @type {{setTimeout, clearTimeout}}\n */\ngoog.Timer.defaultTimerObject = goog.global;\n\n\n/**\n * Variable that controls the timer error correction. If the timer is called\n * before the requested interval times `intervalScale`, which often\n * happens on Mozilla, the timer is rescheduled.\n * @see {@link #last_}\n * @type {number}\n */\ngoog.Timer.intervalScale = 0.8;\n\n\n/**\n * Variable for storing the result of `setInterval`.\n * @private {?number}\n */\ngoog.Timer.prototype.timer_ = null;\n\n\n/**\n * Gets the interval of the timer.\n * @return {number} interval Number of ms between ticks.\n */\ngoog.Timer.prototype.getInterval = function() {\n  'use strict';\n  return this.interval_;\n};\n\n\n/**\n * Sets the interval of the timer.\n * @param {number} interval Number of ms between ticks.\n */\ngoog.Timer.prototype.setInterval = function(interval) {\n  'use strict';\n  this.interval_ = interval;\n  if (this.timer_ && this.enabled) {\n    // Stop and then start the timer to reset the interval.\n    this.stop();\n    this.start();\n  } else if (this.timer_) {\n    this.stop();\n  }\n};\n\n\n/**\n * Callback for the `setTimeout` used by the timer.\n * @private\n */\ngoog.Timer.prototype.tick_ = function() {\n  'use strict';\n  if (this.enabled) {\n    var elapsed = goog.now() - this.last_;\n    if (elapsed > 0 && elapsed < this.interval_ * goog.Timer.intervalScale) {\n      this.timer_ = this.timerObject_.setTimeout(\n          this.boundTick_, this.interval_ - elapsed);\n      return;\n    }\n\n    // Prevents setInterval from registering a duplicate timeout when called\n    // in the timer event handler.\n    if (this.timer_) {\n      this.timerObject_.clearTimeout(this.timer_);\n      this.timer_ = null;\n    }\n\n    this.dispatchTick();\n    // The timer could be stopped in the timer event handler.\n    if (this.enabled) {\n      // Stop and start to ensure there is always only one timeout even if\n      // start is called in the timer event handler.\n      this.stop();\n      this.start();\n    }\n  }\n};\n\n\n/**\n * Dispatches the TICK event. This is its own method so subclasses can override.\n */\ngoog.Timer.prototype.dispatchTick = function() {\n  'use strict';\n  this.dispatchEvent(goog.Timer.TICK);\n};\n\n\n/**\n * Starts the timer.\n */\ngoog.Timer.prototype.start = function() {\n  'use strict';\n  this.enabled = true;\n\n  // If there is no interval already registered, start it now\n  if (!this.timer_) {\n    // IMPORTANT!\n    // window.setInterval in FireFox has a bug - it fires based on\n    // absolute time, rather than on relative time. What this means\n    // is that if a computer is sleeping/hibernating for 24 hours\n    // and the timer interval was configured to fire every 1000ms,\n    // then after the PC wakes up the timer will fire, in rapid\n    // succession, 3600*24 times.\n    // This bug is described here and is already fixed, but it will\n    // take time to propagate, so for now I am switching this over\n    // to setTimeout logic.\n    //     https://bugzilla.mozilla.org/show_bug.cgi?id=376643\n    //\n    this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_);\n    this.last_ = goog.now();\n  }\n};\n\n\n/**\n * Stops the timer.\n */\ngoog.Timer.prototype.stop = function() {\n  'use strict';\n  this.enabled = false;\n  if (this.timer_) {\n    this.timerObject_.clearTimeout(this.timer_);\n    this.timer_ = null;\n  }\n};\n\n\n/** @override */\ngoog.Timer.prototype.disposeInternal = function() {\n  'use strict';\n  goog.Timer.superClass_.disposeInternal.call(this);\n  this.stop();\n  delete this.timerObject_;\n};\n\n\n/**\n * Constant for the timer's event type.\n * @const\n */\ngoog.Timer.TICK = 'tick';\n\n\n/**\n * Calls the given function once, after the optional pause.\n * <p>\n * The function is always called asynchronously, even if the delay is 0. This\n * is a common trick to schedule a function to run after a batch of browser\n * event processing.\n *\n * @param {function(this:SCOPE)|{handleEvent:function()}|null} listener Function\n *     or object that has a handleEvent method.\n * @param {number=} opt_delay Milliseconds to wait; default is 0.\n * @param {SCOPE=} opt_handler Object in whose scope to call the listener.\n * @return {number} A handle to the timer ID.\n * @template SCOPE\n */\ngoog.Timer.callOnce = function(listener, opt_delay, opt_handler) {\n  'use strict';\n  if (typeof listener === 'function') {\n    if (opt_handler) {\n      listener = goog.bind(listener, opt_handler);\n    }\n  } else if (listener && typeof listener.handleEvent == 'function') {\n    // using typeof to prevent strict js warning\n    listener = goog.bind(listener.handleEvent, listener);\n  } else {\n    throw new Error('Invalid listener argument');\n  }\n\n  if (Number(opt_delay) > goog.Timer.MAX_TIMEOUT_) {\n    // Timeouts greater than MAX_INT return immediately due to integer\n    // overflow in many browsers.  Since MAX_INT is 24.8 days, just don't\n    // schedule anything at all.\n    return goog.Timer.INVALID_TIMEOUT_ID_;\n  } else {\n    return goog.Timer.defaultTimerObject.setTimeout(listener, opt_delay || 0);\n  }\n};\n\n\n/**\n * Clears a timeout initiated by {@link #callOnce}.\n * @param {?number} timerId A timer ID.\n */\ngoog.Timer.clear = function(timerId) {\n  'use strict';\n  goog.Timer.defaultTimerObject.clearTimeout(timerId);\n};\n\n\n/**\n * @param {number} delay Milliseconds to wait.\n * @param {(RESULT|goog.Thenable<RESULT>|Thenable)=} opt_result The value\n *     with which the promise will be resolved.\n * @return {!goog.Promise<RESULT>} A promise that will be resolved after\n *     the specified delay, unless it is canceled first.\n * @template RESULT\n */\ngoog.Timer.promise = function(delay, opt_result) {\n  'use strict';\n  var timerKey = null;\n  return new goog\n      .Promise(function(resolve, reject) {\n        'use strict';\n        timerKey = goog.Timer.callOnce(function() {\n          'use strict';\n          resolve(opt_result);\n        }, delay);\n        if (timerKey == goog.Timer.INVALID_TIMEOUT_ID_) {\n          reject(new Error('Failed to schedule timer.'));\n        }\n      })\n      .thenCatch(function(error) {\n        'use strict';\n        // Clear the timer. The most likely reason is \"cancel\" signal.\n        goog.Timer.clear(timerKey);\n        throw error;\n      });\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Definition of the goog.async.Throttle class.\n *\n * @see ../demos/timers.html\n */\n\ngoog.module('goog.async.Throttle');\ngoog.module.declareLegacyNamespace();\n\nconst Disposable = goog.require('goog.Disposable');\nconst Timer = goog.require('goog.Timer');\n\n\n/**\n * Throttle will perform an action that is passed in no more than once\n * per interval (specified in milliseconds). If it gets multiple signals\n * to perform the action while it is waiting, it will only perform the action\n * once at the end of the interval.\n * @final\n * @template T\n */\nclass Throttle extends Disposable {\n  /**\n   * @param {function(this: T, ...?)} listener Function to callback when the\n   *     action is triggered.\n   * @param {number} interval Interval over which to throttle. The listener can\n   *     only be called once per interval.\n   * @param {T=} handler Object in whose scope to call the listener.\n   */\n  constructor(listener, interval, handler) {\n    super();\n    /**\n     * Function to callback\n     * @type {function(this: T, ...?)}\n     * @private\n     */\n    this.listener_ = handler != null ? listener.bind(handler) : listener;\n\n    /**\n     * Interval for the throttle time\n     * @type {number}\n     * @private\n     */\n    this.interval_ = interval;\n\n    /**\n     * The last arguments passed into `fire`, or null if there is no pending\n     * call.\n     * @private {?IArrayLike}\n     */\n    this.args_ = null;\n\n    /**\n     * Indicates that the action is pending and needs to be fired.\n     * @type {boolean}\n     * @private\n     */\n    this.shouldFire_ = false;\n\n    /**\n     * Indicates the count of nested pauses currently in effect on the throttle.\n     * When this count is not zero, fired actions will be postponed until the\n     * throttle is resumed enough times to drop the pause count to zero.\n     * @type {number}\n     * @private\n     */\n    this.pauseCount_ = 0;\n\n    /**\n     * Timer for scheduling the next callback\n     * @type {?number}\n     * @private\n     */\n    this.timer_ = null;\n  }\n\n  /**\n   * Notifies the throttle that the action has happened. It will throttle\n   * the call so that the callback is not called too often according to the\n   * interval parameter passed to the constructor, passing the arguments\n   * from the last call of this function into the throttled function.\n   * @param {...?} var_args Arguments to pass on to the throttled function.\n   */\n  fire(var_args) {\n    this.args_ = arguments;\n    if (!this.timer_ && !this.pauseCount_) {\n      this.doAction_();\n    } else {\n      this.shouldFire_ = true;\n    }\n  }\n\n  /**\n   * Cancels any pending action callback. The throttle can be restarted by\n   * calling {@link #fire}.\n   */\n  stop() {\n    if (this.timer_) {\n      Timer.clear(this.timer_);\n      this.timer_ = null;\n      this.shouldFire_ = false;\n      this.args_ = null;\n    }\n  }\n\n  /**\n   * Pauses the throttle.  All pending and future action callbacks will be\n   * delayed until the throttle is resumed.  Pauses can be nested.\n   */\n  pause() {\n    this.pauseCount_++;\n  }\n\n  /**\n   * Resumes the throttle.  If doing so drops the pausing count to zero,\n   * pending action callbacks will be executed as soon as possible, but\n   * still no sooner than an interval's delay after the previous call.\n   * Future action callbacks will be executed as normal.\n   */\n  resume() {\n    this.pauseCount_--;\n    if (!this.pauseCount_ && this.shouldFire_ && !this.timer_) {\n      this.shouldFire_ = false;\n      this.doAction_();\n    }\n  }\n\n  /** @override */\n  disposeInternal() {\n    super.disposeInternal();\n    this.stop();\n  }\n\n  /**\n   * Handler for the timer to fire the throttle\n   * @private\n   */\n  onTimer_() {\n    this.timer_ = null;\n\n    if (this.shouldFire_ && !this.pauseCount_) {\n      this.shouldFire_ = false;\n      this.doAction_();\n    }\n  }\n\n  /**\n   * Calls the callback\n   * @private\n   */\n  doAction_() {\n    this.timer_ = Timer.callOnce(() => this.onTimer_(), this.interval_);\n    const args = this.args_;\n    // release memory first so it always happens even if listener throws\n    this.args_ = null;\n    this.listener_.apply(null, args);\n  }\n}\n\nexports = Throttle;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Class to create objects which want to handle multiple events\n * and have their listeners easily cleaned up via a dispose method.\n *\n * Example:\n * <pre>\n * function Something() {\n *   Something.base(this);\n *\n *   ... set up object ...\n *\n *   // Add event listeners\n *   this.listen(this.starEl, goog.events.EventType.CLICK, this.handleStar);\n *   this.listen(this.headerEl, goog.events.EventType.CLICK, this.expand);\n *   this.listen(this.collapseEl, goog.events.EventType.CLICK, this.collapse);\n *   this.listen(this.infoEl, goog.events.EventType.MOUSEOVER, this.showHover);\n *   this.listen(this.infoEl, goog.events.EventType.MOUSEOUT, this.hideHover);\n * }\n * goog.inherits(Something, goog.events.EventHandler);\n *\n * Something.prototype.disposeInternal = function() {\n *   Something.base(this, 'disposeInternal');\n *   goog.dom.removeNode(this.container);\n * };\n *\n *\n * // Then elsewhere:\n *\n * var activeSomething = null;\n * function openSomething() {\n *   activeSomething = new Something();\n * }\n *\n * function closeSomething() {\n *   if (activeSomething) {\n *     activeSomething.dispose();  // Remove event listeners\n *     activeSomething = null;\n *   }\n * }\n * </pre>\n */\n\ngoog.provide('goog.events.EventHandler');\n\ngoog.require('goog.Disposable');\ngoog.require('goog.events');\ngoog.require('goog.object');\ngoog.requireType('goog.events.Event');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventTarget');\ngoog.requireType('goog.events.EventWrapper');\n\n\n\n/**\n * Super class for objects that want to easily manage a number of event\n * listeners.  It allows a short cut to listen and also provides a quick way\n * to remove all events listeners belonging to this object.\n * @param {SCOPE=} opt_scope Object in whose scope to call the listeners.\n * @constructor\n * @extends {goog.Disposable}\n * @template SCOPE\n */\ngoog.events.EventHandler = function(opt_scope) {\n  'use strict';\n  goog.Disposable.call(this);\n  // TODO(mknichel): Rename this to this.scope_ and fix the classes in google3\n  // that access this private variable. :(\n  this.handler_ = opt_scope;\n\n  /**\n   * Keys for events that are being listened to.\n   * @type {!Object<!goog.events.Key>}\n   * @private\n   */\n  this.keys_ = {};\n};\ngoog.inherits(goog.events.EventHandler, goog.Disposable);\n\n\n/**\n * Utility array used to unify the cases of listening for an array of types\n * and listening for a single event, without using recursion or allocating\n * an array each time.\n * @type {!Array<string>}\n * @const\n * @private\n */\ngoog.events.EventHandler.typeArray_ = [];\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:SCOPE, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n *     opt_fn Optional callback function to be used as the listener or an object\n *     with handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listen = function(\n    src, type, opt_fn, opt_options) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  return self.listen_(src, type, opt_fn, opt_options);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(this:T, ?):?}|\n *     null|undefined} fn Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|!AddEventListenerOptions|undefined} options\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenWithScope = function(\n    src, type, fn, options, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listen_(src, type, fn, options, scope);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null=} opt_fn\n *     Optional callback function to be used as the listener or an object with\n *     handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listen_ = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (!Array.isArray(type)) {\n    if (type) {\n      goog.events.EventHandler.typeArray_[0] = type.toString();\n    }\n    type = goog.events.EventHandler.typeArray_;\n  }\n  for (var i = 0; i < type.length; i++) {\n    var listenerObj = goog.events.listen(\n        src, type[i], opt_fn || self.handleEvent, opt_options || false,\n        opt_scope || self.handler_ || self);\n\n    if (!listenerObj) {\n      // When goog.events.listen run on OFF_AND_FAIL or OFF_AND_SILENT\n      // (goog.events.CaptureSimulationMode) in IE8-, it will return null\n      // value.\n      return self;\n    }\n\n    var key = listenerObj.key;\n    self.keys_[key] = listenerObj;\n  }\n\n  return self;\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired the\n * event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:SCOPE, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n * opt_fn\n *    Optional callback function to be used as the listener or an object with\n *    handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenOnce = function(\n    src, type, opt_fn, opt_options) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  return self.listenOnce_(src, type, opt_fn, opt_options);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired the\n * event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(this:T, ?):?}|\n *     null|undefined} fn Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|undefined} capture Optional whether to use capture phase.\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenOnceWithScope = function(\n    src, type, fn, capture, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listenOnce_(src, type, fn, capture, scope);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired\n * the event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null=} opt_fn\n *    Optional callback function to be used as the listener or an object with\n *    handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listenOnce_ = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      self.listenOnce_(src, type[i], opt_fn, opt_options, opt_scope);\n    }\n  } else {\n    var listenerObj = goog.events.listenOnce(\n        src, type, opt_fn || self.handleEvent, opt_options,\n        opt_scope || self.handler_ || self);\n    if (!listenerObj) {\n      // When goog.events.listen run on OFF_AND_FAIL or OFF_AND_SILENT\n      // (goog.events.CaptureSimulationMode) in IE8-, it will return null\n      // value.\n      return self;\n    }\n\n    var key = listenerObj.key;\n    self.keys_[key] = listenerObj;\n  }\n\n  return self;\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:SCOPE, ?):?|{handleEvent:function(?):?}|null} listener\n *     Callback method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n */\ngoog.events.EventHandler.prototype.listenWithWrapper = function(\n    src, wrapper, listener, opt_capt) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Remove the opt_scope from this function and then\n  // templatize it.\n  return self.listenWithWrapper_(src, wrapper, listener, opt_capt);\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:T, ?):?|{handleEvent:function(this:T, ?):?}|null}\n *     listener Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|undefined} capture Optional whether to use capture phase.\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, THIS\n */\ngoog.events.EventHandler.prototype.listenWithWrapperAndScope = function(\n    src, wrapper, listener, capture, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listenWithWrapper_(src, wrapper, listener, capture, scope);\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener Callback\n *     method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @param {Object=} opt_scope Element in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listenWithWrapper_ = function(\n    src, wrapper, listener, opt_capt, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  wrapper.listen(\n      src, listener, opt_capt, opt_scope || self.handler_ || self, self);\n  return self;\n};\n\n\n/**\n * @return {number} Number of listeners registered by this handler.\n */\ngoog.events.EventHandler.prototype.getListenerCount = function() {\n  'use strict';\n  var count = 0;\n  for (var key in this.keys_) {\n    if (Object.prototype.hasOwnProperty.call(this.keys_, key)) {\n      count++;\n    }\n  }\n  return count;\n};\n\n\n/**\n * Unlistens on an event.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types to unlisten to.\n * @param {function(this:?, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n *     opt_fn Optional callback function to be used as the listener or an object\n *     with handleEvent function.\n * @param {(boolean|!EventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.unlisten = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      self.unlisten(src, type[i], opt_fn, opt_options, opt_scope);\n    }\n  } else {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    var listener = goog.events.getListener(\n        src, type, opt_fn || self.handleEvent, capture,\n        opt_scope || self.handler_ || self);\n\n    if (listener) {\n      goog.events.unlistenByKey(listener);\n      delete self.keys_[listener.key];\n    }\n  }\n\n  return self;\n};\n\n\n/**\n * Removes an event listener which was added with listenWithWrapper().\n *\n * @param {EventTarget|goog.events.EventTarget} src The target to stop\n *     listening to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_scope Element in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n */\ngoog.events.EventHandler.prototype.unlistenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  wrapper.unlisten(\n      src, listener, opt_capt, opt_scope || self.handler_ || self, self);\n  return self;\n};\n\n\n/**\n * Unlistens to all events.\n */\ngoog.events.EventHandler.prototype.removeAll = function() {\n  'use strict';\n  goog.object.forEach(this.keys_, function(listenerObj, key) {\n    'use strict';\n    if (this.keys_.hasOwnProperty(key)) {\n      goog.events.unlistenByKey(listenerObj);\n    }\n  }, this);\n\n  this.keys_ = {};\n};\n\n\n/**\n * Disposes of this EventHandler and removes all listeners that it registered.\n * @override\n * @protected\n */\ngoog.events.EventHandler.prototype.disposeInternal = function() {\n  'use strict';\n  goog.events.EventHandler.superClass_.disposeInternal.call(this);\n  this.removeAll();\n};\n\n\n/**\n * Default event handler\n * @param {goog.events.Event} e Event object.\n */\ngoog.events.EventHandler.prototype.handleEvent = function(e) {\n  'use strict';\n  throw new Error('EventHandler.handleEvent not implemented');\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a utility for tracing and debugging WebChannel\n *     requests.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WebChannelDebug');\n\ngoog.require('goog.json');\ngoog.require('goog.log');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.net.XmlHttp.ReadyState');\n\n\n\n/**\n * Logs and keeps a buffer of debugging info for the Channel.\n *\n * @constructor\n * @struct\n * @final\n */\ngoog.labs.net.webChannel.WebChannelDebug = function() {\n  'use strict';\n  /**\n   * The logger instance.\n   * @const\n   * @private {?goog.log.Logger}\n   */\n  this.logger_ = goog.log.getLogger('goog.labs.net.webChannel.WebChannelDebug');\n\n  /**\n   * Whether to enable redact. Defaults to true.\n   * @private {boolean}\n   */\n  this.redactEnabled_ = true;\n};\n\n\ngoog.scope(function() {\n'use strict';\nvar WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\n\n\n/**\n * Turns off redact.\n */\nWebChannelDebug.prototype.disableRedact = function() {\n  'use strict';\n  this.redactEnabled_ = false;\n};\n\n\n/**\n * Logs that the browser went offline during the lifetime of a request.\n * @param {goog.Uri} url The URL being requested.\n */\nWebChannelDebug.prototype.browserOfflineResponse = function(url) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'BROWSER_OFFLINE: ' + url;\n  });\n};\n\n\n/**\n * Logs an XmlHttp request..\n * @param {string} verb The request type (GET/POST).\n * @param {goog.Uri} uri The request destination.\n * @param {string|number|undefined} id The request id.\n * @param {number} attempt Which attempt # the request was.\n * @param {?string} postData The data posted in the request.\n */\nWebChannelDebug.prototype.xmlHttpChannelRequest = function(\n    verb, uri, id, attempt, postData) {\n  'use strict';\n  var self = this;\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP REQ (' + id + ') [attempt ' + attempt + ']: ' + verb +\n        '\\n' + uri + '\\n' + self.maybeRedactPostData_(postData);\n  });\n};\n\n\n/**\n * Logs the meta data received from an XmlHttp request.\n * @param {string} verb The request type (GET/POST).\n * @param {goog.Uri} uri The request destination.\n * @param {string|number|undefined} id The request id.\n * @param {number} attempt Which attempt # the request was.\n * @param {goog.net.XmlHttp.ReadyState} readyState The ready state.\n * @param {number} statusCode The HTTP status code.\n */\nWebChannelDebug.prototype.xmlHttpChannelResponseMetaData = function(\n    verb, uri, id, attempt, readyState, statusCode) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP RESP (' + id + ') [ attempt ' + attempt + ']: ' + verb +\n        '\\n' + uri + '\\n' + readyState + ' ' + statusCode;\n  });\n};\n\n\n/**\n * Logs the response data received from an XmlHttp request.\n * @param {string|number|undefined} id The request id.\n * @param {?string} responseText The response text.\n * @param {?string=} opt_desc Optional request description.\n */\nWebChannelDebug.prototype.xmlHttpChannelResponseText = function(\n    id, responseText, opt_desc) {\n  'use strict';\n  var self = this;\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP TEXT (' + id + '): ' + self.redactResponse_(responseText) +\n        (opt_desc ? ' ' + opt_desc : '');\n  });\n};\n\n\n/**\n * Logs a request timeout.\n * @param {goog.Uri} uri The uri that timed out.\n */\nWebChannelDebug.prototype.timeoutResponse = function(uri) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'TIMEOUT: ' + uri;\n  });\n};\n\n\n/**\n * Logs a debug message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.debug = function(text) {\n  'use strict';\n  goog.log.fine(this.logger_, text);\n};\n\n\n/**\n * Logs an exception\n * @param {Error} e The error or error event.\n * @param {goog.log.Loggable=} opt_msg The optional message,\n *     defaults to 'Exception'.\n */\nWebChannelDebug.prototype.dumpException = function(e, opt_msg) {\n  'use strict';\n  goog.log.error(this.logger_, opt_msg || 'Exception', e);\n};\n\n\n/**\n * Logs an info message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.info = function(text) {\n  'use strict';\n  goog.log.info(this.logger_, text);\n};\n\n\n/**\n * Logs a warning message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.warning = function(text) {\n  'use strict';\n  goog.log.warning(this.logger_, text);\n};\n\n\n/**\n * Logs a severe message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.severe = function(text) {\n  'use strict';\n  goog.log.error(this.logger_, text);\n};\n\n\n/**\n * Removes potentially private data from a response so that we don't\n * accidentally save private and personal data to the server logs.\n * @param {?string} responseText A JSON response to clean.\n * @return {?string} The cleaned response.\n * @private\n */\nWebChannelDebug.prototype.redactResponse_ = function(responseText) {\n  'use strict';\n  if (!this.redactEnabled_) {\n    return responseText;\n  }\n\n  if (!responseText) {\n    return null;\n  }\n\n  try {\n    var responseArray = JSON.parse(responseText);\n    if (responseArray) {\n      for (var i = 0; i < responseArray.length; i++) {\n        if (Array.isArray(responseArray[i])) {\n          this.maybeRedactArray_(responseArray[i]);\n        }\n      }\n    }\n\n    return goog.json.serialize(responseArray);\n  } catch (e) {\n    this.debug('Exception parsing expected JS array - probably was not JS');\n    return responseText;\n  }\n};\n\n\n/**\n * Removes data from a response array that may be sensitive.\n * @param {!Array<?>} array The array to clean.\n * @private\n */\nWebChannelDebug.prototype.maybeRedactArray_ = function(array) {\n  'use strict';\n  if (array.length < 2) {\n    return;\n  }\n  var dataPart = array[1];\n  if (!Array.isArray(dataPart)) {\n    return;\n  }\n  if (dataPart.length < 1) {\n    return;\n  }\n\n  var type = dataPart[0];\n  if (type != 'noop' && type != 'stop' && type != 'close') {\n    // redact all fields in the array\n    for (var i = 1; i < dataPart.length; i++) {\n      dataPart[i] = '';\n    }\n  }\n};\n\n\n/**\n * Removes potentially private data from a request POST body so that we don't\n * accidentally save private and personal data to the server logs.\n * @param {?string} data The data string to clean.\n * @return {?string} The data string with sensitive data replaced by 'redacted'.\n * @private\n */\nWebChannelDebug.prototype.maybeRedactPostData_ = function(data) {\n  'use strict';\n  if (!this.redactEnabled_) {\n    return data;\n  }\n\n  if (!data) {\n    return null;\n  }\n  var out = '';\n  var params = data.split('&');\n  for (var i = 0; i < params.length; i++) {\n    var param = params[i];\n    var keyValue = param.split('=');\n    if (keyValue.length > 1) {\n      var key = keyValue[0];\n      var value = keyValue[1];\n\n      var keyParts = key.split('_');\n      if (keyParts.length >= 2 && keyParts[1] == 'type') {\n        out += key + '=' + value + '&';\n      } else {\n        out += key + '=' +\n            'redacted' +\n            '&';\n      }\n    }\n  }\n  return out;\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Static utilities for collecting stats associated with\n * ChannelRequest.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.requestStats');\ngoog.provide('goog.labs.net.webChannel.requestStats.Event');\ngoog.provide('goog.labs.net.webChannel.requestStats.ServerReachability');\ngoog.provide('goog.labs.net.webChannel.requestStats.ServerReachabilityEvent');\ngoog.provide('goog.labs.net.webChannel.requestStats.Stat');\ngoog.provide('goog.labs.net.webChannel.requestStats.StatEvent');\ngoog.provide('goog.labs.net.webChannel.requestStats.TimingEvent');\n\ngoog.require('goog.events.Event');\ngoog.require('goog.events.EventTarget');\n\n\ngoog.scope(function() {\n'use strict';\nconst requestStats = goog.labs.net.webChannel.requestStats;\n\n\n/**\n * Events fired.\n * @const\n */\nrequestStats.Event = {};\n\n\n/**\n * Singleton event target for firing stat events\n * @type {?goog.events.EventTarget}\n * @private\n */\nrequestStats.eventTarget_ = null;\n\n/**\n * Singleton event target for firing stat events\n * @return {!goog.events.EventTarget}\n * @private\n */\nrequestStats.getStatEventTarget_ = function() {\n  'use strict';\n  requestStats.eventTarget_ =\n      requestStats.eventTarget_ || new goog.events.EventTarget();\n  return requestStats.eventTarget_;\n};\n\n/**\n * The type of event that occurs every time some information about how reachable\n * the server is is discovered.\n */\nrequestStats.Event.SERVER_REACHABILITY_EVENT = 'serverreachability';\n\n\n/**\n * Types of events which reveal information about the reachability of the\n * server.\n * @enum {number}\n */\nrequestStats.ServerReachability = {\n  REQUEST_MADE: 1,\n  REQUEST_SUCCEEDED: 2,\n  REQUEST_FAILED: 3,\n  BACK_CHANNEL_ACTIVITY: 4  // any response data received\n};\n\n\n\n/**\n * Event class for SERVER_REACHABILITY_EVENT.\n *\n * @param {goog.events.EventTarget} target The stat event target for\n       the channel.\n * @param {requestStats.ServerReachability} reachabilityType\n *     The reachability event type.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.ServerReachabilityEvent = function(target, reachabilityType) {\n  'use strict';\n  goog.events.Event.call(\n      this, requestStats.Event.SERVER_REACHABILITY_EVENT, target);\n\n  /**\n   * @type {requestStats.ServerReachability}\n   */\n  this.reachabilityType = reachabilityType;\n};\ngoog.inherits(requestStats.ServerReachabilityEvent, goog.events.Event);\n\n\n/**\n * Notify the channel that a particular fine grained network event has occurred.\n * Should be considered package-private.\n * @param {requestStats.ServerReachability} reachabilityType\n *     The reachability event type.\n */\nrequestStats.notifyServerReachabilityEvent = function(reachabilityType) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(\n      new requestStats.ServerReachabilityEvent(target, reachabilityType));\n};\n\n\n/**\n * Stat Event that fires when things of interest happen that may be useful for\n * applications to know about for stats or debugging purposes.\n */\nrequestStats.Event.STAT_EVENT = 'statevent';\n\n\n/**\n * Enum that identifies events for statistics that are interesting to track.\n * @enum {number}\n */\nrequestStats.Stat = {\n  /** Event indicating a new connection attempt. */\n  CONNECT_ATTEMPT: 0,\n\n  /** Event indicating a connection error due to a general network problem. */\n  ERROR_NETWORK: 1,\n\n  /**\n   * Event indicating a connection error that isn't due to a general network\n   * problem.\n   */\n  ERROR_OTHER: 2,\n\n  /** Event indicating the start of test stage one. */\n  TEST_STAGE_ONE_START: 3,\n\n  /** Event indicating the start of test stage two. */\n  TEST_STAGE_TWO_START: 4,\n\n  /** Event indicating the first piece of test data was received. */\n  TEST_STAGE_TWO_DATA_ONE: 5,\n\n  /**\n   * Event indicating that the second piece of test data was received and it was\n   * received separately from the first.\n   */\n  TEST_STAGE_TWO_DATA_TWO: 6,\n\n  /** Event indicating both pieces of test data were received simultaneously. */\n  TEST_STAGE_TWO_DATA_BOTH: 7,\n\n  /** Event indicating stage one of the test request failed. */\n  TEST_STAGE_ONE_FAILED: 8,\n\n  /** Event indicating stage two of the test request failed. */\n  TEST_STAGE_TWO_FAILED: 9,\n\n  /**\n   * Event indicating that a buffering proxy is likely between the client and\n   * the server.\n   */\n  PROXY: 10,\n\n  /**\n   * Event indicating that no buffering proxy is likely between the client and\n   * the server.\n   */\n  NOPROXY: 11,\n\n  /** Event indicating an unknown SID error. */\n  REQUEST_UNKNOWN_SESSION_ID: 12,\n\n  /** Event indicating a bad status code was received. */\n  REQUEST_BAD_STATUS: 13,\n\n  /** Event indicating incomplete data was received */\n  REQUEST_INCOMPLETE_DATA: 14,\n\n  /** Event indicating bad data was received */\n  REQUEST_BAD_DATA: 15,\n\n  /** Event indicating no data was received when data was expected. */\n  REQUEST_NO_DATA: 16,\n\n  /** Event indicating a request timeout. */\n  REQUEST_TIMEOUT: 17,\n\n  /**\n   * Event indicating that the server never received our hanging GET and so it\n   * is being retried.\n   */\n  BACKCHANNEL_MISSING: 18,\n\n  /**\n   * Event indicating that we have determined that our hanging GET is not\n   * receiving data when it should be. Thus it is dead dead and will be retried.\n   */\n  BACKCHANNEL_DEAD: 19,\n\n  /**\n   * The browser declared itself offline during the lifetime of a request, or\n   * was offline when a request was initially made.\n   */\n  BROWSER_OFFLINE: 20\n};\n\n\n\n/**\n * Event class for STAT_EVENT.\n *\n * @param {goog.events.EventTarget} eventTarget The stat event target for\n       the channel.\n * @param {requestStats.Stat} stat The stat.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.StatEvent = function(eventTarget, stat) {\n  'use strict';\n  goog.events.Event.call(this, requestStats.Event.STAT_EVENT, eventTarget);\n\n  /**\n   * The stat\n   * @type {requestStats.Stat}\n   */\n  this.stat = stat;\n};\ngoog.inherits(requestStats.StatEvent, goog.events.Event);\n\n\n/**\n * Returns the singleton event target for stat events.\n * @return {!goog.events.EventTarget} The event target for stat events.\n */\nrequestStats.getStatEventTarget = function() {\n  'use strict';\n  return requestStats.getStatEventTarget_();\n};\n\n\n/**\n * Helper function to call the stat event callback.\n * @param {requestStats.Stat} stat The stat.\n */\nrequestStats.notifyStatEvent = function(stat) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(new requestStats.StatEvent(target, stat));\n};\n\n\n/**\n * An event that fires when POST requests complete successfully, indicating\n * the size of the POST and the round trip time.\n */\nrequestStats.Event.TIMING_EVENT = 'timingevent';\n\n\n\n/**\n * Event class for requestStats.Event.TIMING_EVENT\n *\n * @param {goog.events.EventTarget} target The stat event target for\n       the channel.\n * @param {number} size The number of characters in the POST data.\n * @param {number} rtt The total round trip time from POST to response in MS.\n * @param {number} retries The number of times the POST had to be retried.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.TimingEvent = function(target, size, rtt, retries) {\n  'use strict';\n  goog.events.Event.call(this, requestStats.Event.TIMING_EVENT, target);\n\n  /**\n   * @type {number}\n   */\n  this.size = size;\n\n  /**\n   * @type {number}\n   */\n  this.rtt = rtt;\n\n  /**\n   * @type {number}\n   */\n  this.retries = retries;\n};\ngoog.inherits(requestStats.TimingEvent, goog.events.Event);\n\n\n/**\n * Helper function to notify listeners about POST request performance.\n *\n * @param {number} size Number of characters in the POST data.\n * @param {number} rtt The amount of time from POST start to response.\n * @param {number} retries The number of times the POST had to be retried.\n */\nrequestStats.notifyTimingEvent = function(size, rtt, retries) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(\n      new requestStats.TimingEvent(target, size, rtt, retries));\n};\n\n\n/**\n * Allows the application to set an execution hooks for when a channel\n * starts processing requests. This is useful to track timing or logging\n * special information. The function takes no parameters and return void.\n * @param {Function} startHook  The function for the start hook.\n */\nrequestStats.setStartThreadExecutionHook = function(startHook) {\n  'use strict';\n  requestStats.startExecutionHook_ = startHook;\n};\n\n\n/**\n * Allows the application to set an execution hooks for when a channel\n * stops processing requests. This is useful to track timing or logging\n * special information. The function takes no parameters and return void.\n * @param {Function} endHook  The function for the end hook.\n */\nrequestStats.setEndThreadExecutionHook = function(endHook) {\n  'use strict';\n  requestStats.endExecutionHook_ = endHook;\n};\n\n\n/**\n * Application provided execution hook for the start hook.\n *\n * @type {Function}\n * @private\n */\nrequestStats.startExecutionHook_ = function() {};\n\n\n/**\n * Application provided execution hook for the end hook.\n *\n * @type {Function}\n * @private\n */\nrequestStats.endExecutionHook_ = function() {};\n\n\n/**\n * Helper function to call the start hook\n */\nrequestStats.onStartExecution = function() {\n  'use strict';\n  requestStats.startExecutionHook_();\n};\n\n\n/**\n * Helper function to call the end hook\n */\nrequestStats.onEndExecution = function() {\n  'use strict';\n  requestStats.endExecutionHook_();\n};\n\n\n/**\n * Wrapper around SafeTimeout which calls the start and end execution hooks\n * with a try...finally block.\n * @param {Function} fn The callback function.\n * @param {number} ms The time in MS for the timer.\n * @return {number} The ID of the timer.\n */\nrequestStats.setTimeout = function(fn, ms) {\n  'use strict';\n  if (typeof fn !== 'function') {\n    throw new Error('Fn must not be null and must be a function');\n  }\n  return goog.global.setTimeout(function() {\n    'use strict';\n    requestStats.onStartExecution();\n    try {\n      fn();\n    } finally {\n      requestStats.onEndExecution();\n    }\n  }, ms);\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Error codes shared between goog.net.IframeIo and\n * goog.net.XhrIo.\n */\n\ngoog.provide('goog.net.ErrorCode');\n\n\n/**\n * Error codes\n * @enum {number}\n */\ngoog.net.ErrorCode = {\n\n  /**\n   * There is no error condition.\n   */\n  NO_ERROR: 0,\n\n  /**\n   * The most common error from iframeio, unfortunately, is that the browser\n   * responded with an error page that is classed as a different domain. The\n   * situations, are when a browser error page  is shown -- 404, access denied,\n   * DNS failure, connection reset etc.)\n   *\n   */\n  ACCESS_DENIED: 1,\n\n  /**\n   * Currently the only case where file not found will be caused is when the\n   * code is running on the local file system and a non-IE browser makes a\n   * request to a file that doesn't exist.\n   */\n  FILE_NOT_FOUND: 2,\n\n  /**\n   * If Firefox shows a browser error page, such as a connection reset by\n   * server or access denied, then it will fail silently without the error or\n   * load handlers firing.\n   */\n  FF_SILENT_ERROR: 3,\n\n  /**\n   * Custom error provided by the client through the error check hook.\n   */\n  CUSTOM_ERROR: 4,\n\n  /**\n   * Exception was thrown while processing the request.\n   */\n  EXCEPTION: 5,\n\n  /**\n   * The Http response returned a non-successful http status code.\n   */\n  HTTP_ERROR: 6,\n\n  /**\n   * The request was aborted.\n   */\n  ABORT: 7,\n\n  /**\n   * The request timed out.\n   */\n  TIMEOUT: 8,\n\n  /**\n   * The resource is not available offline.\n   */\n  OFFLINE: 9,\n};\n\n\n/**\n * Returns a friendly error message for an error code. These messages are for\n * debugging and are not localized.\n * @param {goog.net.ErrorCode} errorCode An error code.\n * @return {string} A message for debugging.\n */\ngoog.net.ErrorCode.getDebugMessage = function(errorCode) {\n  'use strict';\n  switch (errorCode) {\n    case goog.net.ErrorCode.NO_ERROR:\n      return 'No Error';\n\n    case goog.net.ErrorCode.ACCESS_DENIED:\n      return 'Access denied to content document';\n\n    case goog.net.ErrorCode.FILE_NOT_FOUND:\n      return 'File not found';\n\n    case goog.net.ErrorCode.FF_SILENT_ERROR:\n      return 'Firefox silently errored';\n\n    case goog.net.ErrorCode.CUSTOM_ERROR:\n      return 'Application custom error';\n\n    case goog.net.ErrorCode.EXCEPTION:\n      return 'An exception occurred';\n\n    case goog.net.ErrorCode.HTTP_ERROR:\n      return 'Http response at 400 or 500 level';\n\n    case goog.net.ErrorCode.ABORT:\n      return 'Request was aborted';\n\n    case goog.net.ErrorCode.TIMEOUT:\n      return 'Request timed out';\n\n    case goog.net.ErrorCode.OFFLINE:\n      return 'The resource is not available offline';\n\n    default:\n      return 'Unrecognized error code';\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Common events for the network classes.\n */\n\n\ngoog.provide('goog.net.EventType');\n\n\n/**\n * Event names for network events\n * @enum {string}\n */\ngoog.net.EventType = {\n  COMPLETE: 'complete',\n  SUCCESS: 'success',\n  ERROR: 'error',\n  ABORT: 'abort',\n  READY: 'ready',\n  READY_STATE_CHANGE: 'readystatechange',\n  TIMEOUT: 'timeout',\n  INCREMENTAL_DATA: 'incrementaldata',\n  PROGRESS: 'progress',\n  // DOWNLOAD_PROGRESS and UPLOAD_PROGRESS are special events dispatched by\n  // goog.net.XhrIo to allow binding listeners specific to each type of\n  // progress.\n  DOWNLOAD_PROGRESS: 'downloadprogress',\n  UPLOAD_PROGRESS: 'uploadprogress',\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Interface for a factory for creating XMLHttpRequest objects\n * and metadata about them.\n */\n\ngoog.provide('goog.net.XmlHttpFactory');\n\n/** @suppress {extraRequire} Typedef. */\ngoog.require('goog.net.XhrLike');\n\n\n\n/**\n * Abstract base class for an XmlHttpRequest factory.\n * @constructor\n */\ngoog.net.XmlHttpFactory = function() {};\n\n\n/**\n * Cache of options - we only actually call internalGetOptions once.\n * @type {?Object}\n * @private\n */\ngoog.net.XmlHttpFactory.prototype.cachedOptions_ = null;\n\n\n/**\n * @return {!goog.net.XhrLike.OrNative} A new XhrLike instance.\n */\ngoog.net.XmlHttpFactory.prototype.createInstance = goog.abstractMethod;\n\n\n/**\n * @return {Object} Options describing how xhr objects obtained from this\n *     factory should be used.\n */\ngoog.net.XmlHttpFactory.prototype.getOptions = function() {\n  'use strict';\n  return this.cachedOptions_ ||\n      (this.cachedOptions_ = this.internalGetOptions());\n};\n\n\n/**\n * Override this method in subclasses to preserve the caching offered by\n * getOptions().\n * @return {Object} Options describing how xhr objects obtained from this\n *     factory should be used.\n * @protected\n */\ngoog.net.XmlHttpFactory.prototype.internalGetOptions = goog.abstractMethod;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview The API spec for the WebChannel messaging library.\n *\n * Similar to HTML5 WebSocket, WebChannel offers an abstraction for\n * point-to-point socket-like communication between a browser client and\n * a remote origin.\n *\n * WebChannels are created via <code>WebChannel</code>. Multiple WebChannels\n * may be multiplexed over the same WebChannelTransport, which represents\n * the underlying physical connectivity over standard wire protocols\n * such as HTTP.\n *\n * A WebChannel in turn represents a logical communication channel between\n * the client and server end point. A WebChannel remains open for as long\n * as the client or server end-point allows.\n *\n * Messages are delivered in-order and reliably over the same WebChannel,\n * and the choice of the underlying wire protocols is completely transparent\n * to the API users.\n *\n * Note that we have no immediate plan to move this API out of labs. While\n * the implementation is production ready, the API is subject to change.\n */\n\ngoog.provide('goog.net.WebChannel');\ngoog.provide('goog.net.WebChannel.Options');\n\ngoog.require('goog.events');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.net.XmlHttpFactory');\n\n\n\n/**\n * A WebChannel represents a logical bi-directional channel over which the\n * client communicates with a remote server that holds the other endpoint\n * of the channel. A WebChannel is always created in the context of a shared\n * {@link WebChannelTransport} instance. It is up to the underlying client-side\n * and server-side implementations to decide how or when multiplexing is\n * to be enabled.\n *\n * @interface\n * @extends {goog.events.Listenable}\n */\ngoog.net.WebChannel = function() {};\n\n\n\n/**\n * This interface defines a pluggable API to allow WebChannel runtime to support\n * customized algorithms in order to recover from transient failures such as\n * those failures caused by network or proxies (intermediaries).\n *\n * The algorithm may also choose to fail-fast, e.g. switch the client to some\n * offline mode.\n *\n * Extra measurements and logging could also be implemented in the custom\n * module, which has the full knowledge of all the state transitions\n * (due to failures).\n *\n * A default algorithm will be provided by the webchannel library itself. Custom\n * algorithms are expected to be tailored to specific client platforms or\n * networking environments, e.g. mobile, cellular network.\n *\n * @interface\n */\ngoog.net.WebChannel.FailureRecovery = function() {};\n\n\n/**\n * Configuration spec for newly created WebChannel instances.\n *\n * WebChannels are configured in the context of the containing\n * {@link WebChannelTransport}. The configuration parameters are specified\n * when a new instance of WebChannel is created via {@link WebChannelTransport}.\n * @record\n */\ngoog.net.WebChannel.Options = function() {};\n\n/**\n * Custom headers to be added to every message sent to the\n * server. This object is mutable, and custom headers may be changed, removed,\n * or added during the runtime after a channel has been\n * opened\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageHeaders;\n\n/**\n * Similar to messageHeaders, but any custom headers will\n * be sent only once when the channel is opened. Typical usage is to send\n * an auth header to the server, which only checks the auth header at the time\n * when the channel is opened.\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.initMessageHeaders;\n\n/**\n * Sent as initMessageHeaders via X-WebChannel-Content-Type,\n * to inform the server the MIME type of WebChannel messages.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageContentType;\n\n/**\n * Custom url query parameters to be added to every message\n * sent to the server. This object is mutable, and custom parameters may be\n * changed, removed or added during the runtime after a channel has been opened.\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageUrlParams;\n\n/**\n * Whether a special header should be added to\n * each message so that the server can dispatch webchannel messages without\n * knowing the URL path prefix. Defaults to false.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.clientProtocolHeaderRequired;\n\n/**\n * The maximum number of in-flight HTTP requests allowed\n * when SPDY is enabled. Currently we only detect SPDY in Chrome.\n * This parameter defaults to 10. When SPDY is not enabled, this parameter\n * will have no effect.\n * @type {number|undefined}\n */\ngoog.net.WebChannel.Options.prototype.concurrentRequestLimit;\n\n/**\n * Setting this to true to allow the use of sub-domains\n * (as configured by the server) to send XHRs with the CORS withCredentials\n * bit set to true.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.supportsCrossDomainXhr;\n\n/**\n * Whether to bypass v8 encoding of client-sent messages.\n * This defaults to false now due to legacy servers. New applications should\n * always configure this option to true.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.sendRawJson;\n\n/**\n * The URL parameter name that contains the session id (for sticky routing of\n * HTTP requests). When this param is specified, a server that supports this\n * option will respond with an opaque session id as part of the initial\n * handshake (via the X-HTTP-Session-Id header); and all the subsequent requests\n * will contain the httpSessionIdParam. This option will take precedence over\n * any duplicated parameter specified with messageUrlParams, whose value will be\n * ignored.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.httpSessionIdParam;\n\n/**\n * The URL parameter name to allow custom HTTP\n * headers to be overwritten as a URL param to bypass CORS preflight.\n * goog.net.rpc.HttpCors is used to encode the HTTP headers.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.httpHeadersOverwriteParam;\n\n/**\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.backgroundChannelTest;\n\n/**\n * Whether to force long-polling from client to server.\n * This defaults to false. Long-polling may be necessary when a (MITM) proxy\n * is buffering data sent by the server.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.forceLongPolling;\n\n/**\n * Whether to enable automatic detection of buffering proxies. In the presence\n * of any buffering proxy, webchannel will use long-polling to send messages\n * from the server to the client. This option defaults to false.\n * Currently when fastHandshake is enabled, this option will be ignored.\n * Compared to \"forceLongPolling\", this option may introduce up to 2-RTT\n * extra latency for delivering messages generated immediately after the\n * handshake.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.detectBufferingProxy;\n\n/**\n * Enable true 0-RTT message delivery, including\n * leveraging QUIC 0-RTT (which requires GET to be used). This option\n * defaults to false. Note it is allowed to send messages before Open event is\n * received, after a channel has been opened. In order to enable 0-RTT,\n * messages will be encoded as part of URL and therefore there needs be a size\n * limit for those initial messages that are sent immediately as part of the\n * GET handshake request. With sendRawJson=true, this limit is currently set\n * to 4K chars and data beyond this limit will be buffered till the handshake\n * (1-RTT) finishes. With sendRawJson=false, it's up to the application\n * to limit the amount of data that is sent as part of the handshake.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.fastHandshake;\n\n/**\n * Enable the blocking RPC semantics for the handshake:\n * 1) the completion of handshake is blocked by the server-side application\n * logic for handling the handshake (HTTP) request; 2) the client application\n * will inspect the handshake (HTTP) response headers as generated\n * by the server application (v.s. by only the webchannel runtime). This option\n * defaults to false.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.blockingHandshake;\n\n/**\n * Whether to disable logging redact. By default, redact is\n * enabled to remove any message payload or user-provided info\n * from closure logs.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.disableRedact;\n\n/**\n * Inform the server about the client profile to enable\n * customized configs that are optimized for certain clients or environments.\n * Currently this information is sent via X-WebChannel-Client-Profile header.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.clientProfile;\n\n/**\n * The internal channel parameter name to allow\n * experimental channel configurations. Supported options include fastfail,\n * baseRetryDelayMs, retryDelaySeedMs, forwardChannelMaxRetries and\n * forwardChannelRequestTimeoutMs. Note that these options are subject to\n * change.\n * @type {!Object<string, boolean|number>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.internalChannelParams;\n\n/**\n * Allows the caller to override the factory used to create\n * XMLHttpRequest objects. This is introduced to disable CORS on firefox OS.\n * @type {!goog.net.XmlHttpFactory|undefined}\n */\ngoog.net.WebChannel.Options.prototype.xmlHttpFactory;\n\n/**\n * Client-side thresholds that decide when to refresh\n * an underlying HTTP request, to limit memory consumption due to XHR buffering\n * or compression context. The client-side thresholds should be significantly\n * smaller than the server-side thresholds. This allows the client to eliminate\n * any latency introduced by request refreshing, i.e. an RTT window during which\n * messages may be buffered on the server-side. Supported params include\n * totalBytesReceived, totalDurationMs.\n * @type {!Object<string, number>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.requestRefreshThresholds;\n\n/**\n * This is an experimental feature to use WHATWG Fetch/streams (when supported)\n * for the backchannel. If a custom 'xmlHttpFactory' is speficied, this option\n * will not be effective. This option defaults to false now and will eventually\n * be turned on by default.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.useFetchStreams;\n\n/**\n * Opt-in to enable Chrome origin trials from the WebChannel client. See\n * https://github.com/GoogleChrome/OriginTrials\n *\n * Origin trial history:\n * - fetch upload (11/2020 - 07/2021)\n * https://developers.chrome.com/origintrials/#/view_trial/3524066708417413121\n *\n * Participating in the origin trials will help Chrome to release new Web\n * platform features sooner, which will in turn help improve WebChannel\n * performance.\n *\n * Origin trials are not expected to interfere with WebChannel wire messages\n * and should not introduce any noticeable overhead.\n *\n * This is enabled by default with any on-going origin-trial.\n *\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.enableOriginTrials;\n\n\n/**\n * Types that are allowed as message data.\n *\n * Note that JS objects (sent by the client) can only have string encoded\n * values due to the limitation of the current wire protocol.\n *\n * Unicode strings (sent by the server) may or may not need be escaped, as\n * decided by the server.\n *\n * @typedef {(!ArrayBuffer|!Blob|!Object<string, !Object|string>|!Array|string)}\n */\ngoog.net.WebChannel.MessageData;\n\n\n/**\n * Open the WebChannel against the URI specified in the constructor.\n */\ngoog.net.WebChannel.prototype.open = goog.abstractMethod;\n\n\n/**\n * Close the WebChannel.\n *\n * This is a full close (shutdown) with no guarantee of FIFO delivery in respect\n * to any in-flight messages sent to the server.\n *\n * If you need such a guarantee, see the Half the halfClose() method.\n */\ngoog.net.WebChannel.prototype.close = goog.abstractMethod;\n\n\n/**\n * Half-close the WebChannel.\n *\n * Half-close semantics:\n * 1. delivered as a regular message in FIFO programming order\n * 2. the server is expected to return a half-close too (with or without\n *    application involved), which will trigger a full close (shutdown)\n *    on the client side\n * 3. for now, the half-close event defined for server-initiated\n *    half-close is not exposed to the client application\n * 4. a client-side half-close may be triggered internally when the client\n *    receives a half-close from the server; and the client is expected to\n *    do a full close after the half-close is acked and delivered\n *    on the server-side.\n * 5. Full close is always a forced one. See the close() method.\n *\n * New messages sent after halfClose() will be dropped.\n *\n * NOTE: This is not yet implemented, and will throw an exception if called.\n */\ngoog.net.WebChannel.prototype.halfClose = goog.abstractMethod;\n\n\n/**\n * Sends a message to the server that maintains the other end point of\n * the WebChannel.\n *\n * O-RTT behavior:\n * 1. messages sent before open() is called will always be delivered as\n *    part of the handshake, i.e. with 0-RTT\n * 2. messages sent after open() is called but before the OPEN event\n *    is received will be delivered as part of the handshake if\n *    send() is called from the same execution context as open().\n * 3. otherwise, those messages will be buffered till the handshake\n *    is completed (which will fire the OPEN event).\n *\n * @param {!goog.net.WebChannel.MessageData} message The message to send.\n */\ngoog.net.WebChannel.prototype.send = goog.abstractMethod;\n\n\n/**\n * Common events fired by WebChannels.\n * @enum {string}\n */\ngoog.net.WebChannel.EventType = {\n  /** Dispatched when the channel is opened. */\n  OPEN: goog.events.getUniqueId('open'),\n\n  /** Dispatched when the channel is closed. */\n  CLOSE: goog.events.getUniqueId('close'),\n\n  /**\n   * Dispatched when the channel is aborted due to errors.\n   *\n   * For backward compatibility reasons, a CLOSE event will also be\n   * dispatched, following the ERROR event, which indicates that the channel\n   * has been completely shutdown .\n   */\n  ERROR: goog.events.getUniqueId('error'),\n\n  /** Dispatched when the channel has received a new message. */\n  MESSAGE: goog.events.getUniqueId('message')\n};\n\n\n\n/**\n * The event interface for the MESSAGE event.\n *\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.net.WebChannel.MessageEvent = function() {\n  'use strict';\n  goog.net.WebChannel.MessageEvent.base(\n      this, 'constructor', goog.net.WebChannel.EventType.MESSAGE);\n};\ngoog.inherits(goog.net.WebChannel.MessageEvent, goog.events.Event);\n\n\n/**\n * The content of the message received from the server.\n *\n * @type {!goog.net.WebChannel.MessageData}\n */\ngoog.net.WebChannel.MessageEvent.prototype.data;\n\n\n/**\n * The metadata key when the MESSAGE event represents a metadata message.\n *\n * @type {string|undefined}\n */\ngoog.net.WebChannel.MessageEvent.prototype.metadataKey;\n\n\n/**\n * WebChannel level error conditions.\n *\n * Summary of error debugging and reporting in WebChannel:\n *\n * Network Error\n * 1. By default the webchannel library will set the error status to\n *    NETWORK_ERROR when a channel has to be aborted or closed. NETWORK_ERROR\n *    may be recovered by the application by retrying and opening a new channel.\n * 2. There may be lost messages (not acked by the server) when a channel is\n *    aborted. Currently we don't have a public API to retrieve messages that\n *    are waiting to be acked on the client side. File a bug if you think it\n *    is useful to expose such an API.\n * 3. Details of why a channel fails are available via closure debug logs,\n *    and stats events (see webchannel/requeststats.js). Those are internal\n *    stats and are subject to change. File a bug if you think it's useful to\n *    version and expose such stats as part of the WebChannel API.\n *\n * Server Error\n * 1. SERVER_ERROR is intended to indicate a non-recoverable condition, e.g.\n *    when auth fails.\n * 2. We don't currently generate any such errors, because most of the time\n *    it's the responsibility of upper-layer frameworks or the application\n *    itself to indicate to the client why a webchannel has been failed\n *    by the server.\n * 3. When a channel is failed by the server explicitly, we still signal\n *    NETWORK_ERROR to the client. Explicit server failure may happen when the\n *    server does a fail-over, or becomes overloaded, or conducts a forced\n *    shutdown etc.\n * 4. We use some heuristic to decide if the network (aka cloud) is down\n *    v.s. the actual server is down.\n *\n *  RuntimeProperties.getLastStatusCode is a useful state that we expose to\n *  the client to indicate the HTTP response status code of the last HTTP\n *  request initiated by the WebChannel client library, for debugging\n *  purposes only.\n *\n *  See WebChannel.Options.backChannelFailureRecovery and\n *  WebChannel.FailureRecovery to install a custom failure-recovery algorithm.\n *\n * @enum {number}\n */\ngoog.net.WebChannel.ErrorStatus = {\n  /** No error has occurred. */\n  OK: 0,\n\n  /** Communication to the server has failed. */\n  NETWORK_ERROR: 1,\n\n  /** The server fails to accept or process the WebChannel. */\n  SERVER_ERROR: 2\n};\n\n\n\n/**\n * The event interface for the ERROR event.\n *\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.net.WebChannel.ErrorEvent = function() {\n  'use strict';\n  goog.net.WebChannel.ErrorEvent.base(\n      this, 'constructor', goog.net.WebChannel.EventType.ERROR);\n};\ngoog.inherits(goog.net.WebChannel.ErrorEvent, goog.events.Event);\n\n\n/**\n * The error status.\n *\n * @type {!goog.net.WebChannel.ErrorStatus}\n */\ngoog.net.WebChannel.ErrorEvent.prototype.status;\n\n\n/**\n * @return {!goog.net.WebChannel.RuntimeProperties} The runtime properties\n * of the WebChannel instance.\n */\ngoog.net.WebChannel.prototype.getRuntimeProperties = goog.abstractMethod;\n\n\n\n/**\n * The runtime properties of the WebChannel instance.\n *\n * This class is defined for debugging and monitoring purposes, as well as for\n * runtime functions that the application may choose to manage by itself.\n *\n * @interface\n */\ngoog.net.WebChannel.RuntimeProperties = function() {};\n\n\n/**\n * @return {number} The effective limit for the number of concurrent HTTP\n * requests that are allowed to be made for sending messages from the client\n * to the server. When SPDY is not enabled, this limit will be one.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getConcurrentRequestLimit =\n    goog.abstractMethod;\n\n\n/**\n * For applications that need support multiple channels (e.g. from\n * different tabs) to the same origin, use this method to decide if SPDY is\n * enabled and therefore it is safe to open multiple channels.\n *\n * If SPDY is disabled, the application may choose to limit the number of active\n * channels to one or use other means such as sub-domains to work around\n * the browser connection limit.\n *\n * @return {boolean} Whether SPDY is enabled for the origin against which\n * the channel is created.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.isSpdyEnabled =\n    goog.abstractMethod;\n\n\n/**\n * @return {number} The number of requests (for sending messages to the server)\n * that are pending. If this number is approaching the value of\n * getConcurrentRequestLimit(), client-to-server message delivery may experience\n * a higher latency.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getPendingRequestCount =\n    goog.abstractMethod;\n\n\n/**\n * For applications to query the current HTTP session id, sent by the server\n * during the initial handshake.\n *\n * @return {?string} the HTTP session id or null if no HTTP session is in use.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getHttpSessionId =\n    goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method generates an in-band commit request to the server, which will\n * ack the commit request as soon as all messages sent prior to this commit\n * request have been committed by the application.\n *\n * Committing a message has a stronger semantics than delivering a message\n * to the application. Detail spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * Timeout or cancellation is not supported and the application is expected to\n * abort the channel if the commit-ack fails to arrive in time.\n *\n * ===\n *\n * This is currently implemented only in the client layer and the commit\n * callback will be invoked after all the pending client-sent messages have been\n * delivered by the server-side webchannel end-point. This semantics is\n * different and weaker than what's required for end-to-end ack which requires\n * the server application to ack the in-order delivery of messages that are sent\n * before the commit request is issued.\n *\n * Commit should only be called after the channel open event is received.\n * Duplicated commits are allowed and only the last callback is guaranteed.\n * Commit called after the channel has been closed will be ignored.\n *\n * @param {function()} callback The callback will be invoked once an\n * ack has been received for the current commit or any newly issued commit.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.commit = goog.abstractMethod;\n\n\n/**\n * This method may be used by the application to recover from a peer failure\n * or to enable sender-initiated flow-control.\n *\n * Detail spec: https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * This is not yet implemented.\n *\n * @return {number} The total number of messages that have not received\n * commit-ack from the server; or if no commit has been issued, the number\n * of messages that have not been delivered to the server application.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * A low water-mark message count to notify the application when the\n * flow-control condition is cleared, that is, when the application is\n * able to send more messages.\n *\n * We expect the application to configure a high water-mark message count,\n * which is checked via getNonAckedMessageCount(). When the high water-mark\n * is exceeded, the application should install a callback via this method\n * to be notified when to start to send new messages.\n *\n * This is not yet implemented.\n *\n * @param {number} count The low water-mark count. It is an error to pass\n * a non-positive value.\n * @param {function()} callback The call back to notify the application\n * when NonAckedMessageCount is below the specified low water-mark count.\n * Any previously registered callback is cleared. This new callback will\n * be cleared once it has been fired, or when the channel is closed or aborted.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.notifyNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method registers a callback to handle the commit request sent\n * by the server. Commit protocol spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * This is not yet implemented.\n *\n * @param {function(!Object)} callback The callback will take an opaque\n * commitId which needs be passed back to the server when an ack-commit\n * response is generated by the client application, via ackCommit().\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.onCommit = goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method is used by the application to generate an ack-commit response\n * for the given commitId. Commit protocol spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * This is not yet implemented.\n *\n * @param {!Object} commitId The commitId which denotes the commit request\n * from the server that needs be ack'ed.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.ackCommit = goog.abstractMethod;\n\n\n/**\n * @return {number} The last HTTP status code received by the channel.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getLastStatusCode =\n    goog.abstractMethod;\n\n\n/**\n * Enum to indicate the current recovery state.\n *\n * @enum {string}\n */\ngoog.net.WebChannel.FailureRecovery.State = {\n  /** Initial state. */\n  INIT: 'init',\n\n  /** Once a failure has been detected. */\n  FAILED: 'failed',\n\n  /**\n   * Once a recovery operation has been issued, e.g. a new request to resume\n   * communication.\n   */\n  RECOVERING: 'recovering',\n\n  /** The channel has been closed.  */\n  CLOSED: 'closed'\n};\n\n\n/**\n * Enum to indicate different failure conditions as detected by the webchannel\n * runtime.\n *\n * This enum is to be used only between the runtime and FailureRecovery module,\n * and new states are expected to be introduced in future.\n *\n * @enum {string}\n */\ngoog.net.WebChannel.FailureRecovery.FailureCondition = {\n  /**\n   * The HTTP response returned a non-successful http status code.\n   */\n  HTTP_ERROR: 'http_error',\n\n  /**\n   * The request was aborted.\n   */\n  ABORT: 'abort',\n\n  /**\n   * The request timed out.\n   */\n  TIMEOUT: 'timeout',\n\n  /**\n   * Exception was thrown while processing the request/response.\n   */\n  EXCEPTION: 'exception'\n};\n\n\n/**\n * @return {!goog.net.WebChannel.FailureRecovery.State} the current state,\n * mainly for debugging use.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.getState = goog.abstractMethod;\n\n\n/**\n * This method is for WebChannel runtime to set the current failure condition\n * and to provide a callback for the algorithm to signal to the runtime\n * when it is time to issue a recovery operation, e.g. a new request to the\n * server.\n *\n * Supported transitions include:\n *   INIT->FAILED\n *   FAILED->FAILED (re-entry ok)\n *   RECOVERY->FAILED.\n *\n * Ignored if state == CLOSED.\n *\n * Advanced implementations are expected to track all the state transitions\n * and their timestamps for monitoring purposes.\n *\n * @param {!goog.net.WebChannel.FailureRecovery.FailureCondition} failure The\n * new failure condition generated by the WebChannel runtime.\n * @param {!Function} operation The callback function to the WebChannel\n * runtime to issue a recovery operation, e.g. a new request. E.g. the default\n * recovery algorithm will issue timeout-based recovery operations.\n * Post-condition for the callback: state transition to RECOVERING.\n *\n * @return {!goog.net.WebChannel.FailureRecovery.State} The updated state\n * as decided by the failure recovery module. Upon a recoverable failure event,\n * the state is transitioned to RECOVERING; or the state is transitioned to\n * FAILED which indicates a fail-fast decision for the runtime to execute.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.setFailure = goog.abstractMethod;\n\n\n/**\n * The Webchannel runtime needs call this method when webchannel is closed or\n * aborted.\n *\n * Once the instance is closed, any access to the instance will be a no-op.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.close = goog.abstractMethod;\n\n\n/**\n * A request header to indicate to the server the messaging protocol\n * each HTTP message is speaking.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_PROTOCOL = 'X-Client-Protocol';\n\n\n/**\n * The value for x-client-protocol when the messaging protocol is WebChannel.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL = 'webchannel';\n\n\n/**\n * A response header for the server to signal the wire-protocol that\n * the browser establishes with the server (or proxy), e.g. \"spdy\" (aka http/2)\n * \"quic\". This information avoids the need to use private APIs to decide if\n * HTTP requests are multiplexed etc.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_WIRE_PROTOCOL = 'X-Client-Wire-Protocol';\n\n\n/**\n * A response header for the server to send back the HTTP session id as part of\n * the initial handshake. The value of the HTTP session id is opaque to the\n * WebChannel protocol.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_HTTP_SESSION_ID = 'X-HTTP-Session-Id';\n\n\n/**\n * A response header for the server to send back any initial response data as a\n * header to avoid any possible buffering by an intermediary, which may\n * be undesired during the handshake.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_HTTP_INITIAL_RESPONSE = 'X-HTTP-Initial-Response';\n\n\n/**\n * A request header for specifying the content-type of WebChannel messages,\n * e.g. application-defined JSON encoding styles. Currently this header\n * is sent by the client via initMessageHeaders when the channel is opened.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE = 'X-WebChannel-Content-Type';\n\n\n/**\n * A request header for specifying the client profile in order to apply\n * customized config params on the server side, e.g. timeouts.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE = 'X-WebChannel-Client-Profile';\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Low level handling of XMLHttpRequest.\n */\n\ngoog.provide('goog.net.DefaultXmlHttpFactory');\ngoog.provide('goog.net.XmlHttp');\ngoog.provide('goog.net.XmlHttp.OptionType');\ngoog.provide('goog.net.XmlHttp.ReadyState');\ngoog.provide('goog.net.XmlHttpDefines');\n\ngoog.require('goog.asserts');\ngoog.require('goog.net.WrapperXmlHttpFactory');\ngoog.require('goog.net.XmlHttpFactory');\ngoog.requireType('goog.net.XhrLike');\n\n\n/**\n * Static class for creating XMLHttpRequest objects.\n * @return {!goog.net.XhrLike.OrNative} A new XMLHttpRequest object.\n */\ngoog.net.XmlHttp = function() {\n  'use strict';\n  return goog.net.XmlHttp.factory_.createInstance();\n};\n\n\n/**\n * @define {boolean} Whether to assume XMLHttpRequest exists. Setting this to\n *     true bypasses the ActiveX probing code.\n * NOTE(ruilopes): Due to the way JSCompiler works, this define *will not* strip\n * out the ActiveX probing code from binaries.  To achieve this, use\n * `goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR` instead.\n * TODO(ruilopes): Collapse both defines.\n */\ngoog.net.XmlHttp.ASSUME_NATIVE_XHR =\n    goog.define('goog.net.XmlHttp.ASSUME_NATIVE_XHR', false);\n\n\n/** @const */\ngoog.net.XmlHttpDefines = {};\n\n\n/**\n * @define {boolean} Whether to assume XMLHttpRequest exists. Setting this to\n *     true eliminates the ActiveX probing code.\n */\ngoog.net.XmlHttpDefines.ASSUME_NATIVE_XHR =\n    goog.define('goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR', false);\n\n\n/**\n * Gets the options to use with the XMLHttpRequest objects obtained using\n * the static methods.\n * @return {Object} The options.\n */\ngoog.net.XmlHttp.getOptions = function() {\n  'use strict';\n  return goog.net.XmlHttp.factory_.getOptions();\n};\n\n\n/**\n * Type of options that an XmlHttp object can have.\n * @enum {number}\n */\ngoog.net.XmlHttp.OptionType = {\n  /**\n   * Whether a goog.nullFunction should be used to clear the onreadystatechange\n   * handler instead of null.\n   */\n  USE_NULL_FUNCTION: 0,\n\n  /**\n   * NOTE(user): In IE if send() errors on a *local* request the readystate\n   * is still changed to COMPLETE.  We need to ignore it and allow the\n   * try/catch around send() to pick up the error.\n   */\n  LOCAL_REQUEST_ERROR: 1,\n};\n\n\n/**\n * Status constants for XMLHTTP, matches:\n * https://msdn.microsoft.com/en-us/library/ms534361(v=vs.85).aspx\n * @enum {number}\n */\ngoog.net.XmlHttp.ReadyState = {\n  /**\n   * Constant for when xmlhttprequest.readyState is uninitialized\n   */\n  UNINITIALIZED: 0,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loading.\n   */\n  LOADING: 1,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loaded.\n   */\n  LOADED: 2,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is in an interactive state.\n   */\n  INTERACTIVE: 3,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is completed\n   */\n  COMPLETE: 4,\n};\n\n\n/**\n * The global factory instance for creating XMLHttpRequest objects.\n * @type {goog.net.XmlHttpFactory}\n * @private\n */\ngoog.net.XmlHttp.factory_;\n\n\n/**\n * Sets the factories for creating XMLHttpRequest objects and their options.\n * @param {Function} factory The factory for XMLHttpRequest objects.\n * @param {Function} optionsFactory The factory for options.\n * @deprecated Use setGlobalFactory instead.\n */\ngoog.net.XmlHttp.setFactory = function(factory, optionsFactory) {\n  'use strict';\n  goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(\n      goog.asserts.assert(factory), goog.asserts.assert(optionsFactory)));\n};\n\n\n/**\n * Sets the global factory object.\n * @param {!goog.net.XmlHttpFactory} factory New global factory object.\n */\ngoog.net.XmlHttp.setGlobalFactory = function(factory) {\n  'use strict';\n  goog.net.XmlHttp.factory_ = factory;\n};\n\n\n\n/**\n * Default factory to use when creating xhr objects.  You probably shouldn't be\n * instantiating this directly, but rather using it via goog.net.XmlHttp.\n * @extends {goog.net.XmlHttpFactory}\n * @constructor\n */\ngoog.net.DefaultXmlHttpFactory = function() {\n  'use strict';\n  goog.net.XmlHttpFactory.call(this);\n};\ngoog.inherits(goog.net.DefaultXmlHttpFactory, goog.net.XmlHttpFactory);\n\n\n/** @override */\ngoog.net.DefaultXmlHttpFactory.prototype.createInstance = function() {\n  'use strict';\n  const progId = this.getProgId_();\n  if (progId) {\n    return new ActiveXObject(progId);\n  } else {\n    return new XMLHttpRequest();\n  }\n};\n\n\n/** @override */\ngoog.net.DefaultXmlHttpFactory.prototype.internalGetOptions = function() {\n  'use strict';\n  const progId = this.getProgId_();\n  const options = {};\n  if (progId) {\n    options[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] = true;\n    options[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] = true;\n  }\n  return options;\n};\n\n\n/**\n * The ActiveX PROG ID string to use to create xhr's in IE. Lazily initialized.\n * @type {string|undefined}\n * @private\n */\ngoog.net.DefaultXmlHttpFactory.prototype.ieProgId_;\n\n\n/**\n * Initialize the private state used by other functions.\n * @return {string} The ActiveX PROG ID string to use to create xhr's in IE.\n * @private\n */\ngoog.net.DefaultXmlHttpFactory.prototype.getProgId_ = function() {\n  'use strict';\n  if (goog.net.XmlHttp.ASSUME_NATIVE_XHR ||\n      goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR) {\n    return '';\n  }\n\n  // The following blog post describes what PROG IDs to use to create the\n  // XMLHTTP object in Internet Explorer:\n  // http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx\n  // However we do not (yet) fully trust that this will be OK for old versions\n  // of IE on Win9x so we therefore keep the last 2.\n  if (!this.ieProgId_ && typeof XMLHttpRequest == 'undefined' &&\n      typeof ActiveXObject != 'undefined') {\n    // Candidate Active X types.\n    const ACTIVE_X_IDENTS = [\n      'MSXML2.XMLHTTP.6.0',\n      'MSXML2.XMLHTTP.3.0',\n      'MSXML2.XMLHTTP',\n      'Microsoft.XMLHTTP',\n    ];\n    for (let i = 0; i < ACTIVE_X_IDENTS.length; i++) {\n      const candidate = ACTIVE_X_IDENTS[i];\n\n      try {\n        new ActiveXObject(candidate);\n        // NOTE(user): cannot assign progid and return candidate in one line\n        // because JSCompiler complaings: BUG 658126\n        this.ieProgId_ = candidate;\n        return candidate;\n      } catch (e) {\n        // do nothing; try next choice\n      }\n    }\n\n    // couldn't find any matches\n    throw new Error(\n        'Could not create ActiveXObject. ActiveX might be disabled,' +\n        ' or MSXML might not be installed');\n  }\n\n  return /** @type {string} */ (this.ieProgId_);\n};\n\n\n// Set the global factory to an instance of the default factory.\ngoog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory());\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Definition of the ChannelRequest class. The request\n * object encapsulates the logic for making a single request, either for the\n * forward channel, back channel, or test channel, to the server. It contains\n * the logic for the two types of transports we use:\n * XMLHTTP and Image request. It provides timeout detection. More transports\n * to be added in future, such as Fetch, WebSocket.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.ChannelRequest');\n\ngoog.require('goog.Timer');\ngoog.require('goog.asserts');\ngoog.require('goog.async.Throttle');\ngoog.require('goog.dispose');\ngoog.require('goog.events.EventHandler');\ngoog.require('goog.labs.net.webChannel.Channel');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\ngoog.require('goog.labs.net.webChannel.environment');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.net.ErrorCode');\ngoog.require('goog.net.EventType');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.XmlHttp');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.events.Event');\ngoog.requireType('goog.labs.net.webChannel.Wire.QueuedMap');\ngoog.requireType('goog.net.XhrIo');\n\n\n\n/**\n * A new ChannelRequest is created for each request to the server.\n *\n * @param {goog.labs.net.webChannel.Channel} channel\n *     The channel that owns this request.\n * @param {goog.labs.net.webChannel.WebChannelDebug} channelDebug A\n *     WebChannelDebug to use for logging.\n * @param {string=} opt_sessionId The session id for the channel.\n * @param {string|number=} opt_requestId The request id for this request.\n * @param {number=} opt_retryId The retry id for this request.\n * @constructor\n * @struct\n * @final\n */\ngoog.labs.net.webChannel.ChannelRequest = function(\n    channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId) {\n  'use strict';\n  /**\n   * The channel object that owns the request.\n   * @private {goog.labs.net.webChannel.Channel}\n   */\n  this.channel_ = channel;\n\n  /**\n   * The channel debug to use for logging\n   * @private {goog.labs.net.webChannel.WebChannelDebug}\n   */\n  this.channelDebug_ = channelDebug;\n\n  /**\n   * The Session ID for the channel.\n   * @private {string|undefined}\n   */\n  this.sid_ = opt_sessionId;\n\n  /**\n   * The RID (request ID) for the request.\n   * @private {string|number|undefined}\n   */\n  this.rid_ = opt_requestId;\n\n  /**\n   * The attempt number of the current request.\n   * @private {number}\n   */\n  this.retryId_ = opt_retryId || 1;\n\n  /**\n   * An object to keep track of the channel request event listeners.\n   * @private {!goog.events.EventHandler<\n   *     !goog.labs.net.webChannel.ChannelRequest>}\n   */\n  this.eventHandler_ = new goog.events.EventHandler(this);\n\n  /**\n   * The timeout in ms before failing the request.\n   * @private {number}\n   */\n  this.timeout_ = goog.labs.net.webChannel.ChannelRequest.TIMEOUT_MS_;\n\n  /**\n   * A timer for polling responseText in browsers that don't fire\n   * onreadystatechange during incremental loading of responseText.\n   * @private {goog.Timer}\n   */\n  this.pollingTimer_ =\n      new goog.Timer(goog.labs.net.webChannel.environment.getPollingInterval());\n\n  /**\n   * Extra HTTP headers to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraHeaders_ = null;\n\n\n  /**\n   * Whether the request was successful. This is only set to true after the\n   * request successfully completes.\n   * @private {boolean}\n   */\n  this.successful_ = false;\n\n\n  /**\n   * The TimerID of the timer used to detect if the request has timed-out.\n   * @type {?number}\n   * @private\n   */\n  this.watchDogTimerId_ = null;\n\n  /**\n   * The time in the future when the request will timeout.\n   * @private {?number}\n   */\n  this.watchDogTimeoutTime_ = null;\n\n  /**\n   * The time the request started.\n   * @private {?number}\n   */\n  this.requestStartTime_ = null;\n\n  /**\n   * The type of request (XMLHTTP, IMG)\n   * @private {?number}\n   */\n  this.type_ = null;\n\n  /**\n   * The base Uri for the request. The includes all the parameters except the\n   * one that indicates the retry number.\n   * @private {?goog.Uri}\n   */\n  this.baseUri_ = null;\n\n  /**\n   * The request Uri that was actually used for the most recent request attempt.\n   * @private {?goog.Uri}\n   */\n  this.requestUri_ = null;\n\n  /**\n   * The post data, if the request is a post.\n   * @private {?string}\n   */\n  this.postData_ = null;\n\n  /**\n   * An array of pending messages that we have either received a non-successful\n   * response for, or no response at all, and which therefore may or may not\n   * have been received by the server.\n   * @private {!Array<goog.labs.net.webChannel.Wire.QueuedMap>}\n   */\n  this.pendingMessages_ = [];\n\n  /**\n   * The XhrLte request if the request is using XMLHTTP\n   * @private {?goog.net.XhrIo}\n   */\n  this.xmlHttp_ = null;\n\n  /**\n   * The position of where the next unprocessed chunk starts in the response\n   * text.\n   * @private {number}\n   */\n  this.xmlHttpChunkStart_ = 0;\n\n  /**\n   * The verb (Get or Post) for the request.\n   * @private {?string}\n   */\n  this.verb_ = null;\n\n  /**\n   * The last error if the request failed.\n   * @private {?goog.labs.net.webChannel.ChannelRequest.Error}\n   */\n  this.lastError_ = null;\n\n  /**\n   * The last status code received.\n   * @private {number}\n   */\n  this.lastStatusCode_ = -1;\n\n  /**\n   * Whether the request has been cancelled due to a call to cancel.\n   * @private {boolean}\n   */\n  this.cancelled_ = false;\n\n  /**\n   * A throttle time in ms for readystatechange events for the backchannel.\n   * Useful for throttling when ready state is INTERACTIVE (partial data).\n   * If set to zero no throttle is used.\n   *\n   * See WebChannelBase.prototype.readyStateChangeThrottleMs_\n   *\n   * @private {number}\n   */\n  this.readyStateChangeThrottleMs_ = 0;\n\n  /**\n   * The throttle for readystatechange events for the current request, or null\n   * if there is none.\n   * @private {?goog.async.Throttle}\n   */\n  this.readyStateChangeThrottle_ = null;\n\n  /**\n   * Whether to the result is expected to be encoded for chunking and thus\n   * requires decoding.\n   * @private {boolean}\n   */\n  this.decodeChunks_ = false;\n\n  /**\n   * Whether to decode x-http-initial-response.\n   * @private {boolean}\n   */\n  this.decodeInitialResponse_ = false;\n\n  /**\n   * Whether x-http-initial-response has been decoded (dispatched).\n   * @private {boolean}\n   */\n  this.initialResponseDecoded_ = false;\n\n  /**\n   * Whether the first byte of response body has arrived, for a successful\n   * response.\n   * @private {boolean}\n   */\n  this.firstByteReceived_ = false;\n\n  /**\n   * The current state of fetch responses if webchannel is using WHATWG\n   * fetch/streams.\n   * @private {!goog.labs.net.webChannel.FetchResponseState}\n   */\n  this.fetchResponseState_ = new goog.labs.net.webChannel.FetchResponseState();\n};\n\n/**\n * A collection of fetch/stream properties.\n * @struct\n * @constructor\n */\ngoog.labs.net.webChannel.FetchResponseState = function() {\n  'use strict';\n  /**\n   * The TextDecoder for decoding Uint8Array responses from fetch request.\n   * @type {?goog.global.TextDecoder}\n   */\n  this.textDecoder = null;\n\n  /**\n   * The unconsumed response text from the fetch requests.\n   * @type {string}\n   */\n  this.responseBuffer = '';\n\n  /**\n   * Whether or not the response body has arrived.\n   * @type {boolean}\n   */\n  this.responseArrivedForFetch = false;\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WebChannel = goog.net.WebChannel;\nconst Channel = goog.labs.net.webChannel.Channel;\nconst ChannelRequest = goog.labs.net.webChannel.ChannelRequest;\nconst FetchResponseState = goog.labs.net.webChannel.FetchResponseState;\nconst requestStats = goog.labs.net.webChannel.requestStats;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\nconst environment = goog.labs.net.webChannel.environment;\n\n/**\n * Default timeout in MS for a request. The server must return data within this\n * time limit for the request to not timeout.\n * @private {number}\n */\nChannelRequest.TIMEOUT_MS_ = 45 * 1000;\n\n\n/**\n * Enum for channel requests type\n * @enum {number}\n * @private\n */\nChannelRequest.Type_ = {\n  /**\n   * XMLHTTP requests.\n   */\n  XML_HTTP: 1,\n\n  /**\n   * IMG requests.\n   */\n  CLOSE_REQUEST: 2\n};\n\n\n/**\n * Enum type for identifying an error.\n * @enum {number}\n */\nChannelRequest.Error = {\n  /**\n   * Errors due to a non-200 status code.\n   */\n  STATUS: 0,\n\n  /**\n   * Errors due to no data being returned.\n   */\n  NO_DATA: 1,\n\n  /**\n   * Errors due to a timeout.\n   */\n  TIMEOUT: 2,\n\n  /**\n   * Errors due to the server returning an unknown.\n   */\n  UNKNOWN_SESSION_ID: 3,\n\n  /**\n   * Errors due to bad data being received.\n   */\n  BAD_DATA: 4,\n\n  /**\n   * Errors due to the handler throwing an exception.\n   */\n  HANDLER_EXCEPTION: 5,\n\n  /**\n   * The browser declared itself offline during the request.\n   */\n  BROWSER_OFFLINE: 6\n};\n\n\n/**\n * Returns a useful error string for debugging based on the specified error\n * code.\n * @param {?ChannelRequest.Error} errorCode The error code.\n * @param {number} statusCode The HTTP status code.\n * @return {string} The error string for the given code combination.\n */\nChannelRequest.errorStringFromCode = function(errorCode, statusCode) {\n  'use strict';\n  switch (errorCode) {\n    case ChannelRequest.Error.STATUS:\n      return 'Non-200 return code (' + statusCode + ')';\n    case ChannelRequest.Error.NO_DATA:\n      return 'XMLHTTP failure (no data)';\n    case ChannelRequest.Error.TIMEOUT:\n      return 'HttpConnection timeout';\n    default:\n      return 'Unknown error';\n  }\n};\n\n\n/**\n * Sentinel value used to indicate an invalid chunk in a multi-chunk response.\n * @private {!Object}\n */\nChannelRequest.INVALID_CHUNK_ = {};\n\n\n/**\n * Sentinel value used to indicate an incomplete chunk in a multi-chunk\n * response.\n * @private {!Object}\n */\nChannelRequest.INCOMPLETE_CHUNK_ = {};\n\n\n/**\n * Returns whether XHR streaming is supported on this browser.\n *\n * @return {boolean} Whether XHR streaming is supported.\n * @see http://code.google.com/p/closure-library/issues/detail?id=346\n */\nChannelRequest.supportsXhrStreaming = function() {\n  'use strict';\n  return !goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(10);\n};\n\n\n/**\n * Sets extra HTTP headers to add to all the requests sent to the server.\n *\n * @param {Object} extraHeaders The HTTP headers.\n */\nChannelRequest.prototype.setExtraHeaders = function(extraHeaders) {\n  'use strict';\n  this.extraHeaders_ = extraHeaders;\n};\n\n\n/**\n * Overrides the default HTTP method.\n *\n * @param {string} verb The HTTP method\n */\nChannelRequest.prototype.setVerb = function(verb) {\n  'use strict';\n  this.verb_ = verb;\n};\n\n\n/**\n * Sets the timeout for a request\n *\n * @param {number} timeout   The timeout in MS for when we fail the request.\n */\nChannelRequest.prototype.setTimeout = function(timeout) {\n  'use strict';\n  this.timeout_ = timeout;\n};\n\n\n/**\n * Sets the throttle for handling onreadystatechange events for the request.\n *\n * @param {number} throttle The throttle in ms.  A value of zero indicates\n *     no throttle.\n */\nChannelRequest.prototype.setReadyStateChangeThrottle = function(throttle) {\n  'use strict';\n  this.readyStateChangeThrottleMs_ = throttle;\n};\n\n\n/**\n * Sets the pending messages that this request is handling.\n *\n * @param {!Array<goog.labs.net.webChannel.Wire.QueuedMap>} pendingMessages\n *     The pending messages for this request.\n */\nChannelRequest.prototype.setPendingMessages = function(pendingMessages) {\n  'use strict';\n  this.pendingMessages_ = pendingMessages;\n};\n\n\n/**\n * Gets the pending messages that this request is handling, in case of a retry.\n *\n * @return {!Array<goog.labs.net.webChannel.Wire.QueuedMap>} The pending\n *     messages for this request.\n */\nChannelRequest.prototype.getPendingMessages = function() {\n  'use strict';\n  return this.pendingMessages_;\n};\n\n\n/**\n * Uses XMLHTTP to send an HTTP POST to the server.\n *\n * @param {goog.Uri} uri  The uri of the request.\n * @param {?string} postData  The data for the post body.\n * @param {boolean} decodeChunks  Whether to the result is expected to be\n *     encoded for chunking and thus requires decoding.\n */\nChannelRequest.prototype.xmlHttpPost = function(uri, postData, decodeChunks) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.XML_HTTP;\n  this.baseUri_ = uri.clone().makeUnique();\n  this.postData_ = postData;\n  this.decodeChunks_ = decodeChunks;\n  this.sendXmlHttp_(null /* hostPrefix */);\n};\n\n\n/**\n * Uses XMLHTTP to send an HTTP GET to the server.\n *\n * @param {goog.Uri} uri  The uri of the request.\n * @param {boolean} decodeChunks  Whether to the result is expected to be\n *     encoded for chunking and thus requires decoding.\n * @param {?string} hostPrefix  The host prefix, if we might be using a\n *     secondary domain.  Note that it should also be in the URL, adding this\n *     won't cause it to be added to the URL.\n */\nChannelRequest.prototype.xmlHttpGet = function(uri, decodeChunks, hostPrefix) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.XML_HTTP;\n  this.baseUri_ = uri.clone().makeUnique();\n  this.postData_ = null;\n  this.decodeChunks_ = decodeChunks;\n\n  this.sendXmlHttp_(hostPrefix);\n};\n\n\n/**\n * Sends a request via XMLHTTP according to the current state of the request\n * object.\n *\n * @param {?string} hostPrefix The host prefix, if we might be using a secondary\n *     domain.\n * @private\n */\nChannelRequest.prototype.sendXmlHttp_ = function(hostPrefix) {\n  'use strict';\n  this.requestStartTime_ = Date.now();\n  this.ensureWatchDogTimer_();\n\n  // clone the base URI to create the request URI. The request uri has the\n  // attempt number as a parameter which helps in debugging.\n  this.requestUri_ = this.baseUri_.clone();\n  this.requestUri_.setParameterValues('t', this.retryId_);\n\n  // send the request either as a POST or GET\n  this.xmlHttpChunkStart_ = 0;\n  const useSecondaryDomains = this.channel_.shouldUseSecondaryDomains();\n  this.fetchResponseState_ = new FetchResponseState();\n  // If the request is a GET request, start a backchannel to transfer streaming\n  // data. Note that WebChannel GET request can also be used for closing the\n  // channel as in method ChannelRequest#sendCloseRequest.\n  // The second parameter of Channel#createXhrIo is JS only.\n  this.xmlHttp_ = this.channel_.createXhrIo(\n      useSecondaryDomains ? hostPrefix : null, !this.postData_);\n\n  if (this.readyStateChangeThrottleMs_ > 0) {\n    this.readyStateChangeThrottle_ = new goog.async.Throttle(\n        goog.bind(this.xmlHttpHandler_, this, this.xmlHttp_),\n        this.readyStateChangeThrottleMs_);\n  }\n\n  this.eventHandler_.listen(\n      this.xmlHttp_, goog.net.EventType.READY_STATE_CHANGE,\n      this.readyStateChangeHandler_);\n\n  const headers =\n      this.extraHeaders_ ? goog.object.clone(this.extraHeaders_) : {};\n  if (this.postData_) {\n    if (!this.verb_) {\n      this.verb_ = 'POST';\n    }\n    headers['Content-Type'] = 'application/x-www-form-urlencoded';\n    this.xmlHttp_.send(this.requestUri_, this.verb_, this.postData_, headers);\n  } else {\n    this.verb_ = 'GET';\n    this.xmlHttp_.send(this.requestUri_, this.verb_, null, headers);\n  }\n  requestStats.notifyServerReachabilityEvent(\n      requestStats.ServerReachability.REQUEST_MADE);\n  this.channelDebug_.xmlHttpChannelRequest(\n      this.verb_, this.requestUri_, this.rid_, this.retryId_, this.postData_);\n};\n\n\n/**\n * Handles a readystatechange event.\n * @param {goog.events.Event} evt The event.\n * @private\n */\nChannelRequest.prototype.readyStateChangeHandler_ = function(evt) {\n  'use strict';\n  const xhr = /** @type {goog.net.XhrIo} */ (evt.target);\n  const throttle = this.readyStateChangeThrottle_;\n  if (throttle &&\n      xhr.getReadyState() == goog.net.XmlHttp.ReadyState.INTERACTIVE) {\n    // Only throttle in the partial data case.\n    this.channelDebug_.debug('Throttling readystatechange.');\n    throttle.fire();\n  } else {\n    // If we haven't throttled, just handle response directly.\n    this.xmlHttpHandler_(xhr);\n  }\n};\n\n\n/**\n * XmlHttp handler\n * @param {goog.net.XhrIo} xmlhttp The XhrIo object for the current request.\n * @private\n */\nChannelRequest.prototype.xmlHttpHandler_ = function(xmlhttp) {\n  'use strict';\n  requestStats.onStartExecution();\n\n  try {\n    if (xmlhttp == this.xmlHttp_) {\n      this.onXmlHttpReadyStateChanged_();\n    } else {\n      this.channelDebug_.warning(\n          'Called back with an ' +\n          'unexpected xmlhttp');\n    }\n  } catch (ex) {\n    this.channelDebug_.debug('Failed call to OnXmlHttpReadyStateChanged_');\n    if (this.hasResponseBody_()) {\n      const channelRequest = this;\n      this.channelDebug_.dumpException(ex, function() {\n        'use strict';\n        return 'ResponseText: ' + channelRequest.xmlHttp_.getResponseText();\n      });\n    } else {\n      this.channelDebug_.dumpException(ex, 'No response text');\n    }\n  } finally {\n    requestStats.onEndExecution();\n  }\n};\n\n\n/**\n * Called by the readystate handler for XMLHTTP requests.\n *\n * @private\n */\nChannelRequest.prototype.onXmlHttpReadyStateChanged_ = function() {\n  'use strict';\n  const readyState = this.xmlHttp_.getReadyState();\n  const errorCode = this.xmlHttp_.getLastErrorCode();\n  const statusCode = this.xmlHttp_.getStatus();\n\n  // we get partial results in browsers that support ready state interactive.\n  // We also make sure that getResponseText is not null in interactive mode\n  // before we continue.\n  if (readyState < goog.net.XmlHttp.ReadyState.INTERACTIVE ||\n      (readyState == goog.net.XmlHttp.ReadyState.INTERACTIVE &&\n       !environment.isPollingRequired() &&  // otherwise, go on to startPolling\n       !this.hasResponseBody_())) {\n    return;  // not yet ready\n  }\n\n  // Dispatch any appropriate network events.\n  if (!this.cancelled_ && readyState == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      errorCode != goog.net.ErrorCode.ABORT) {\n    // Pretty conservative, these are the only known scenarios which we'd\n    // consider indicative of a truly non-functional network connection.\n    if (errorCode == goog.net.ErrorCode.TIMEOUT || statusCode <= 0) {\n      requestStats.notifyServerReachabilityEvent(\n          requestStats.ServerReachability.REQUEST_FAILED);\n    } else {\n      requestStats.notifyServerReachabilityEvent(\n          requestStats.ServerReachability.REQUEST_SUCCEEDED);\n    }\n  }\n\n  // got some data so cancel the watchdog timer\n  this.cancelWatchDogTimer_();\n\n  const status = this.xmlHttp_.getStatus();\n  this.lastStatusCode_ = status;\n  const responseText = this.decodeXmlHttpResponse_();\n\n  if (!this.hasResponseBody_()) {\n    const channelRequest = this;\n    this.channelDebug_.debug(function() {\n      'use strict';\n      return 'No response text for uri ' + channelRequest.requestUri_ +\n          ' status ' + status;\n    });\n  }\n  this.successful_ = (status == 200);\n\n  this.channelDebug_.xmlHttpChannelResponseMetaData(\n      /** @type {string} */ (this.verb_), this.requestUri_, this.rid_,\n      this.retryId_, readyState, status);\n\n  if (!this.successful_) {\n    if (status == 400 && responseText.indexOf('Unknown SID') > 0) {\n      // the server error string will include 'Unknown SID' which indicates the\n      // server doesn't know about the session (maybe it got restarted, maybe\n      // the user got moved to another server, etc.,). Handlers can special\n      // case this error\n      this.lastError_ = ChannelRequest.Error.UNKNOWN_SESSION_ID;\n      requestStats.notifyStatEvent(\n          requestStats.Stat.REQUEST_UNKNOWN_SESSION_ID);\n      this.channelDebug_.warning('XMLHTTP Unknown SID (' + this.rid_ + ')');\n    } else {\n      this.lastError_ = ChannelRequest.Error.STATUS;\n      requestStats.notifyStatEvent(requestStats.Stat.REQUEST_BAD_STATUS);\n      this.channelDebug_.warning(\n          'XMLHTTP Bad status ' + status + ' (' + this.rid_ + ')');\n    }\n    this.cleanup_();\n    this.dispatchFailure_();\n    return;\n  }\n\n  if (this.shouldCheckInitialResponse_()) {\n    const initialResponse = this.getInitialResponse_();\n    if (initialResponse) {\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, initialResponse,\n          'Initial handshake response via ' +\n              WebChannel.X_HTTP_INITIAL_RESPONSE);\n      this.initialResponseDecoded_ = true;\n      this.safeOnRequestData_(initialResponse);\n    } else {\n      this.successful_ = false;\n      this.lastError_ = ChannelRequest.Error.UNKNOWN_SESSION_ID;  // fail-fast\n      requestStats.notifyStatEvent(\n          requestStats.Stat.REQUEST_UNKNOWN_SESSION_ID);\n      this.channelDebug_.warning(\n          'XMLHTTP Missing X_HTTP_INITIAL_RESPONSE' +\n          ' (' + this.rid_ + ')');\n      this.cleanup_();\n      this.dispatchFailure_();\n      return;\n    }\n  }\n\n  if (this.decodeChunks_) {\n    this.decodeNextChunks_(readyState, responseText);\n    if (environment.isPollingRequired() && this.successful_ &&\n        readyState == goog.net.XmlHttp.ReadyState.INTERACTIVE) {\n      this.startPolling_();\n    }\n  } else {\n    this.channelDebug_.xmlHttpChannelResponseText(\n        this.rid_, responseText, null);\n    this.safeOnRequestData_(responseText);\n  }\n\n  if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n    this.cleanup_();\n  }\n\n  if (!this.successful_) {\n    return;\n  }\n\n  if (!this.cancelled_) {\n    if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n      this.channel_.onRequestComplete(this);\n    } else {\n      // The default is false, the result from this callback shouldn't carry\n      // over to the next callback, otherwise the request looks successful if\n      // the watchdog timer gets called\n      this.successful_ = false;\n      this.ensureWatchDogTimer_();\n    }\n  }\n};\n\n\n/**\n * Whether we need check the initial-response header that is sent during the\n * fast handshake.\n *\n * @return {boolean} true if the initial-response header is yet to be processed.\n * @private\n */\nChannelRequest.prototype.shouldCheckInitialResponse_ = function() {\n  'use strict';\n  return this.decodeInitialResponse_ && !this.initialResponseDecoded_;\n};\n\n\n/**\n * Queries the initial response header that is sent during the handshake.\n *\n * @return {?string} The non-empty header value or null.\n * @private\n */\nChannelRequest.prototype.getInitialResponse_ = function() {\n  'use strict';\n  if (this.xmlHttp_) {\n    const value = this.xmlHttp_.getStreamingResponseHeader(\n        WebChannel.X_HTTP_INITIAL_RESPONSE);\n    if (value && !goog.string.isEmptyOrWhitespace(value)) {\n      return value;\n    }\n  }\n\n  return null;\n};\n\n\n/**\n * Check if the initial response header has been handled.\n *\n * @return {boolean} true if X_HTTP_INITIAL_RESPONSE has been handled.\n */\nChannelRequest.prototype.isInitialResponseDecoded = function() {\n  'use strict';\n  return this.initialResponseDecoded_;\n};\n\n\n/**\n * Decodes X_HTTP_INITIAL_RESPONSE if present.\n */\nChannelRequest.prototype.setDecodeInitialResponse = function() {\n  'use strict';\n  this.decodeInitialResponse_ = true;\n};\n\n\n\n/**\n * Decodes the responses from XhrIo object.\n * @returns {string} responseText\n * @private\n */\nChannelRequest.prototype.decodeXmlHttpResponse_ = function() {\n  'use strict';\n  if (!this.useFetchStreamsForResponse_()) {\n    return this.xmlHttp_.getResponseText();\n  }\n  const responseChunks =\n      /** @type {!Array<!Uint8Array>} */ (this.xmlHttp_.getResponse());\n  let responseText = '';\n  const responseLength = responseChunks.length;\n  const requestCompleted =\n      this.xmlHttp_.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;\n  if (!this.fetchResponseState_.textDecoder) {\n    if (typeof TextDecoder === 'undefined') {\n      this.channelDebug_.severe(\n          'TextDecoder is not supported by this browser.');\n      this.cleanup_();\n      this.dispatchFailure_();\n      return '';\n    }\n    this.fetchResponseState_.textDecoder = new goog.global.TextDecoder();\n  }\n  for (let i = 0; i < responseLength; i++) {\n    this.fetchResponseState_.responseArrivedForFetch = true;\n    const isLastChunk = requestCompleted && i == responseLength - 1;\n    responseText += this.fetchResponseState_.textDecoder.decode(\n        responseChunks[i], {stream: isLastChunk});\n  }\n  responseChunks.splice(0, responseLength);\n  this.fetchResponseState_.responseBuffer += responseText;\n  this.xmlHttpChunkStart_ = 0;\n  return this.fetchResponseState_.responseBuffer;\n};\n\n\n/**\n * Whether or not the response has response body.\n * @private\n * @returns {boolean}\n */\nChannelRequest.prototype.hasResponseBody_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return false;\n  }\n  if (this.fetchResponseState_.responseArrivedForFetch) {\n    return true;\n  }\n  return !(!this.xmlHttp_.getResponseText() && !this.xmlHttp_.getResponse());\n};\n\n/**\n * Whether or not the response body is streamed.\n * @private\n * @returns {boolean}\n */\nChannelRequest.prototype.useFetchStreamsForResponse_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return false;\n  }\n  return (\n      this.verb_ == 'GET' && this.type_ != ChannelRequest.Type_.CLOSE_REQUEST &&\n      this.channel_.usesFetchStreams());\n};\n\n\n/**\n * Resets the response buffer if the saved chunk has been processed.\n * @private\n * @param {string|!Object|undefined} chunkText\n */\nChannelRequest.prototype.maybeResetBuffer_ = function(chunkText) {\n  'use strict';\n  if (this.useFetchStreamsForResponse_() &&\n      chunkText != ChannelRequest.INCOMPLETE_CHUNK_ &&\n      chunkText != ChannelRequest.INVALID_CHUNK_) {\n    this.fetchResponseState_.responseBuffer = '';\n    this.xmlHttpChunkStart_ = 0;\n  }\n};\n\n\n/**\n * Decodes the next set of available chunks in the response.\n * @param {number} readyState The value of readyState.\n * @param {string} responseText The value of responseText.\n * @private\n */\nChannelRequest.prototype.decodeNextChunks_ = function(\n    readyState, responseText) {\n  'use strict';\n  let decodeNextChunksSuccessful = true;\n\n  let chunkText;\n  while (!this.cancelled_ && this.xmlHttpChunkStart_ < responseText.length) {\n    chunkText = this.getNextChunk_(responseText);\n    if (chunkText == ChannelRequest.INCOMPLETE_CHUNK_) {\n      if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n        // should have consumed entire response when the request is done\n        this.lastError_ = ChannelRequest.Error.BAD_DATA;\n        requestStats.notifyStatEvent(requestStats.Stat.REQUEST_INCOMPLETE_DATA);\n        decodeNextChunksSuccessful = false;\n      }\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, null, '[Incomplete Response]');\n      break;\n    } else if (chunkText == ChannelRequest.INVALID_CHUNK_) {\n      this.lastError_ = ChannelRequest.Error.BAD_DATA;\n      requestStats.notifyStatEvent(requestStats.Stat.REQUEST_BAD_DATA);\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, responseText, '[Invalid Chunk]');\n      decodeNextChunksSuccessful = false;\n      break;\n    } else {\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, /** @type {string} */ (chunkText), null);\n      this.safeOnRequestData_(/** @type {string} */ (chunkText));\n    }\n  }\n\n  this.maybeResetBuffer_(chunkText);\n\n  if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      responseText.length == 0 &&\n      !this.fetchResponseState_.responseArrivedForFetch) {\n    // also an error if we didn't get any response\n    this.lastError_ = ChannelRequest.Error.NO_DATA;\n    requestStats.notifyStatEvent(requestStats.Stat.REQUEST_NO_DATA);\n    decodeNextChunksSuccessful = false;\n  }\n\n  this.successful_ = this.successful_ && decodeNextChunksSuccessful;\n\n  if (!decodeNextChunksSuccessful) {\n    // malformed response - we make this trigger retry logic\n    this.channelDebug_.xmlHttpChannelResponseText(\n        this.rid_, responseText, '[Invalid Chunked Response]');\n    this.cleanup_();\n    this.dispatchFailure_();\n  } else {\n    if (responseText.length > 0 && !this.firstByteReceived_) {\n      this.firstByteReceived_ = true;\n      this.channel_.onFirstByteReceived(this, responseText);\n    }\n  }\n};\n\n\n/**\n * Polls the response for new data.\n * @private\n */\nChannelRequest.prototype.pollResponse_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return;  // already closed\n  }\n  const readyState = this.xmlHttp_.getReadyState();\n  const responseText = this.xmlHttp_.getResponseText();\n  if (this.xmlHttpChunkStart_ < responseText.length) {\n    this.cancelWatchDogTimer_();\n    this.decodeNextChunks_(readyState, responseText);\n    if (this.successful_ &&\n        readyState != goog.net.XmlHttp.ReadyState.COMPLETE) {\n      this.ensureWatchDogTimer_();\n    }\n  }\n};\n\n\n/**\n * Starts a polling interval for changes to responseText of the\n * XMLHttpRequest, for browsers that don't fire onreadystatechange\n * as data comes in incrementally.  This timer is disabled in\n * cleanup_().\n * @private\n */\nChannelRequest.prototype.startPolling_ = function() {\n  'use strict';\n  this.eventHandler_.listen(\n      this.pollingTimer_, goog.Timer.TICK, this.pollResponse_);\n  this.pollingTimer_.start();\n};\n\n\n/**\n * Returns the next chunk of a chunk-encoded response. This is not standard\n * HTTP chunked encoding because browsers don't expose the chunk boundaries to\n * the application through XMLHTTP. So we have an additional chunk encoding at\n * the application level that lets us tell where the beginning and end of\n * individual responses are so that we can only try to eval a complete JS array.\n *\n * The encoding is the size of the chunk encoded as a decimal string followed\n * by a newline followed by the data.\n *\n * @param {string} responseText The response text from the XMLHTTP response.\n * @return {string|!Object} The next chunk string or a sentinel object\n *                         indicating a special condition.\n * @private\n */\nChannelRequest.prototype.getNextChunk_ = function(responseText) {\n  'use strict';\n  const sizeStartIndex = this.xmlHttpChunkStart_;\n  const sizeEndIndex = responseText.indexOf('\\n', sizeStartIndex);\n  if (sizeEndIndex == -1) {\n    return ChannelRequest.INCOMPLETE_CHUNK_;\n  }\n\n  const sizeAsString = responseText.substring(sizeStartIndex, sizeEndIndex);\n  const size = Number(sizeAsString);\n  if (isNaN(size)) {\n    return ChannelRequest.INVALID_CHUNK_;\n  }\n\n  const chunkStartIndex = sizeEndIndex + 1;\n  if (chunkStartIndex + size > responseText.length) {\n    return ChannelRequest.INCOMPLETE_CHUNK_;\n  }\n\n  const chunkText = responseText.substr(chunkStartIndex, size);\n  this.xmlHttpChunkStart_ = chunkStartIndex + size;\n  return chunkText;\n};\n\n\n/**\n * Uses an IMG tag or navigator.sendBeacon to send an HTTP get to the server.\n *\n * This is only currently used to terminate the connection, as an IMG tag is\n * the most reliable way to send something to the server while the page\n * is getting torn down.\n *\n * Navigator.sendBeacon is available on Chrome and Firefox as a formal\n * solution to ensure delivery without blocking window close. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon\n *\n * For Chrome Apps, sendBeacon is always necessary due to Content Security\n * Policy (CSP) violation of using an IMG tag.\n *\n * For react-native, we use xhr to send the actual close request, and assume\n * there is no page-close issue with react-native.\n *\n * @param {goog.Uri} uri The uri to send a request to.\n */\nChannelRequest.prototype.sendCloseRequest = function(uri) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.CLOSE_REQUEST;\n  this.baseUri_ = uri.clone().makeUnique();\n\n  let requestSent = false;\n\n  if (goog.global.navigator && goog.global.navigator.sendBeacon) {\n    // empty string body to avoid 413 error on chrome < 41\n    requestSent =\n        goog.global.navigator.sendBeacon(this.baseUri_.toString(), '');\n  }\n\n  if (!requestSent && goog.global.Image) {\n    const eltImg = new Image();\n    eltImg.src = this.baseUri_;\n    requestSent = true;\n  }\n\n  if (!requestSent) {\n    // no handler is set to match the sendBeacon/Image behavior\n    this.xmlHttp_ = this.channel_.createXhrIo(null);\n    this.xmlHttp_.send(this.baseUri_);\n  }\n\n  this.requestStartTime_ = Date.now();\n  this.ensureWatchDogTimer_();\n};\n\n\n/**\n * Cancels the request no matter what the underlying transport is.\n */\nChannelRequest.prototype.cancel = function() {\n  'use strict';\n  this.cancelled_ = true;\n  this.cleanup_();\n};\n\n\n/**\n * Resets the timeout.\n *\n * @param {number=} opt_timeout The new timeout\n */\nChannelRequest.prototype.resetTimeout = function(opt_timeout) {\n  'use strict';\n  if (opt_timeout) {\n    this.setTimeout(opt_timeout);\n  }\n  // restart only if a timer is currently set\n  if (this.watchDogTimerId_) {\n    this.cancelWatchDogTimer_();\n    this.ensureWatchDogTimer_();\n  }\n};\n\n\n/**\n * Ensures that there is watchdog timeout which is used to ensure that\n * the connection completes in time.\n *\n * @private\n */\nChannelRequest.prototype.ensureWatchDogTimer_ = function() {\n  'use strict';\n  this.watchDogTimeoutTime_ = Date.now() + this.timeout_;\n  this.startWatchDogTimer_(this.timeout_);\n};\n\n\n/**\n * Starts the watchdog timer which is used to ensure that the connection\n * completes in time.\n * @param {number} time The number of milliseconds to wait.\n * @private\n */\nChannelRequest.prototype.startWatchDogTimer_ = function(time) {\n  'use strict';\n  if (this.watchDogTimerId_ != null) {\n    // assertion\n    throw new Error('WatchDog timer not null');\n  }\n  this.watchDogTimerId_ =\n      requestStats.setTimeout(goog.bind(this.onWatchDogTimeout_, this), time);\n};\n\n\n/**\n * Cancels the watchdog timer if it has been started.\n *\n * @private\n */\nChannelRequest.prototype.cancelWatchDogTimer_ = function() {\n  'use strict';\n  if (this.watchDogTimerId_) {\n    goog.global.clearTimeout(this.watchDogTimerId_);\n    this.watchDogTimerId_ = null;\n  }\n};\n\n\n/**\n * Called when the watchdog timer is triggered. It also handles a case where it\n * is called too early which we suspect may be happening sometimes\n * (not sure why)\n *\n * @private\n */\nChannelRequest.prototype.onWatchDogTimeout_ = function() {\n  'use strict';\n  this.watchDogTimerId_ = null;\n  const now = Date.now();\n  goog.asserts.assert(\n      this.watchDogTimeoutTime_, 'WatchDog timeout time missing?');\n  if (now - this.watchDogTimeoutTime_ >= 0) {\n    this.handleTimeout_();\n  } else {\n    // got called too early for some reason\n    this.channelDebug_.warning('WatchDog timer called too early');\n    this.startWatchDogTimer_(this.watchDogTimeoutTime_ - now);\n  }\n};\n\n\n/**\n * Called when the request has actually timed out. Will cleanup and notify the\n * channel of the failure.\n *\n * @private\n */\nChannelRequest.prototype.handleTimeout_ = function() {\n  'use strict';\n  if (this.successful_) {\n    // Should never happen.\n    this.channelDebug_.severe(\n        'Received watchdog timeout even though request loaded successfully');\n  }\n\n  this.channelDebug_.timeoutResponse(this.requestUri_);\n\n  // IMG or SendBeacon requests never notice if they were successful,\n  // and always 'time out'. This fact says nothing about reachability.\n  if (this.type_ != ChannelRequest.Type_.CLOSE_REQUEST) {\n    requestStats.notifyServerReachabilityEvent(\n        requestStats.ServerReachability.REQUEST_FAILED);\n    requestStats.notifyStatEvent(requestStats.Stat.REQUEST_TIMEOUT);\n  }\n\n  this.cleanup_();\n\n  // Set error and dispatch failure.\n  // This is called for CLOSE_REQUEST too to ensure channel_.onRequestComplete.\n  this.lastError_ = ChannelRequest.Error.TIMEOUT;\n  this.dispatchFailure_();\n};\n\n\n/**\n * Notifies the channel that this request failed.\n * @private\n */\nChannelRequest.prototype.dispatchFailure_ = function() {\n  'use strict';\n  if (this.channel_.isClosed() || this.cancelled_) {\n    return;\n  }\n\n  this.channel_.onRequestComplete(this);\n};\n\n\n/**\n * Cleans up the objects used to make the request. This function is\n * idempotent.\n *\n * @private\n */\nChannelRequest.prototype.cleanup_ = function() {\n  'use strict';\n  this.cancelWatchDogTimer_();\n\n  goog.dispose(this.readyStateChangeThrottle_);\n  this.readyStateChangeThrottle_ = null;\n\n  // Stop the polling timer, if necessary.\n  this.pollingTimer_.stop();\n\n  // Unhook all event handlers.\n  this.eventHandler_.removeAll();\n\n  if (this.xmlHttp_) {\n    // clear out this.xmlHttp_ before aborting so we handle getting reentered\n    // inside abort\n    const xmlhttp = this.xmlHttp_;\n    this.xmlHttp_ = null;\n    xmlhttp.abort();\n    xmlhttp.dispose();\n  }\n};\n\n\n/**\n * Indicates whether the request was successful. Only valid after the handler\n * is called to indicate completion of the request.\n *\n * @return {boolean} True if the request succeeded.\n */\nChannelRequest.prototype.getSuccess = function() {\n  'use strict';\n  return this.successful_;\n};\n\n\n/**\n * If the request was not successful, returns the reason.\n *\n * @return {?ChannelRequest.Error}  The last error.\n */\nChannelRequest.prototype.getLastError = function() {\n  'use strict';\n  return this.lastError_;\n};\n\n\n/**\n * Returns the status code of the last request.\n * @return {number} The status code of the last request.\n */\nChannelRequest.prototype.getLastStatusCode = function() {\n  'use strict';\n  return this.lastStatusCode_;\n};\n\n\n/**\n * Returns the session id for this channel.\n *\n * @return {string|undefined} The session ID.\n */\nChannelRequest.prototype.getSessionId = function() {\n  'use strict';\n  return this.sid_;\n};\n\n\n/**\n * Returns the request id for this request. Each request has a unique request\n * id and the request IDs are a sequential increasing count.\n *\n * @return {string|number|undefined} The request ID.\n */\nChannelRequest.prototype.getRequestId = function() {\n  'use strict';\n  return this.rid_;\n};\n\n\n/**\n * Returns the data for a post, if this request is a post.\n *\n * @return {?string} The POST data provided by the request initiator.\n */\nChannelRequest.prototype.getPostData = function() {\n  'use strict';\n  return this.postData_;\n};\n\n\n/**\n * Returns the XhrIo request object.\n *\n * @return {?goog.net.XhrIo} Any XhrIo request created for this object.\n */\nChannelRequest.prototype.getXhr = function() {\n  'use strict';\n  return this.xmlHttp_;\n};\n\n\n/**\n * Returns the time that the request started, if it has started.\n *\n * @return {?number} The time the request started, as returned by Date.now().\n */\nChannelRequest.prototype.getRequestStartTime = function() {\n  'use strict';\n  return this.requestStartTime_;\n};\n\n\n/**\n * Helper to call the callback's onRequestData, which catches any\n * exception.\n * @param {string} data The request data.\n * @private\n */\nChannelRequest.prototype.safeOnRequestData_ = function(data) {\n  'use strict';\n  try {\n    this.channel_.onRequestData(this, data);\n    const stats = requestStats.ServerReachability;\n    requestStats.notifyServerReachabilityEvent(stats.BACK_CHANNEL_ACTIVITY);\n  } catch (e) {\n    // Dump debug info, but keep going without closing the channel.\n    this.channelDebug_.dumpException(e, 'Error in httprequest callback');\n  }\n};\n\n\n/**\n * Convenience factory method.\n *\n * @param {Channel} channel The channel object that owns this request.\n * @param {WebChannelDebug} channelDebug A WebChannelDebug to use for logging.\n * @param {string=} opt_sessionId  The session id for the channel.\n * @param {string|number=} opt_requestId  The request id for this request.\n * @param {number=} opt_retryId  The retry id for this request.\n * @return {!ChannelRequest} The created channel request.\n */\nChannelRequest.createChannelRequest = function(\n    channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId) {\n  'use strict';\n  return new ChannelRequest(\n      channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId);\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A single module to define user-agent specific environment\n * details.\n *\n */\n\ngoog.module('goog.labs.net.webChannel.environment');\n\ngoog.module.declareLegacyNamespace();\n\nvar userAgent = goog.require('goog.userAgent');\n\n\n/**\n * The default polling interval in millis for Edge.\n *\n * Currently on edge, new-chunk events may be not be fired (at all) if a new\n * chunk arrives within 50ms following the previous chunk. This may be fixed\n * in future, which requires changes to the whatwg spec too.\n *\n * @private @const {number}\n */\nvar EDGE_POLLING_INTERVAL_ = 125;\n\n\n/**\n * History:\n *\n * IE11 is still using Trident, the traditional engine for IE.\n * Edge is using EdgeHTML, a fork of Trident. We are seeing the same issue\n * on IE-11 (reported in 2017), so treat IE the same as Edge for now.\n *\n * We used to do polling for Opera (only) with an 250ms interval, because Opera\n * only fires readyState == INTERACTIVE once. Opera switched to WebKit in 2013,\n * and then to Blink (chrome).\n *\n * TODO(user): check the raw UA string to keep polling for old, mobile operas\n * that may still be affected. For old Opera, double the polling interval\n * to 250ms.\n *\n * @return {boolean} True if polling is required with XHR.\n */\nexports.isPollingRequired = function() {\n  return userAgent.EDGE_OR_IE;\n};\n\n\n/**\n * How often to poll (in MS) for changes to responseText in browsers that don't\n * fire onreadystatechange during incremental loading of the response body.\n *\n * @return {number|undefined} The polling interval (MS) for the current U-A;\n * or undefined if polling is not supposed to be enabled.\n */\nexports.getPollingInterval = function() {\n  if (userAgent.EDGE_OR_IE) {\n    return EDGE_POLLING_INTERVAL_;\n  }\n\n  return undefined;\n};\n\n\n/**\n * For Fetch/upload OT, make three requests against the server endpoint.\n * POST requests contain only dummy payload.\n *\n * https://developers.chrome.com/origintrials/#/view_trial/3524066708417413121\n *\n * 1) google.com token\n *\n * A329ozYiTjUmNz0Eh5wffNLiRjiVtFBptKBulP7UYXxKSuMVVhP3pVnlHnbrBg2ALEPd63boPZArHXg3+WlmagkAAAB/eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IkZldGNoVXBsb2FkU3RyZWFtaW5nIiwiZXhwaXJ5IjoxNjA4OTIzMjA4LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ==\n *\n * 2) googleapis.com token\n *\n * To be registered after 1) is deployed.\n *\n * https://developers.chrome.com/origintrials/#/trials\n *\n * This function is expected to be called from background during the handshake.\n * Exceptions will be logged by the caller.\n *\n * No stats or logs are collected on the client-side. To be disabled once the\n * OT is expired.\n *\n * @param {string} path The base URL path for the requests\n */\nexports.startOriginTrials = function(path) {\n  // NE: may need check if path has already contains query params?\n\n  // 1st req:  path?ot=1\n  // non-streaming upload request\n\n  // 2nd req:  path?ot=2\n  // h2-only streaming upload request\n\n  // 3rd req:  path?ot=3\n  // h1-allowed streaming upload request\n\n  // Example calling a Chrome API:\n  // goog.global.chrome.loadTimes().wasFetchedViaSpdy\n};", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Base WebChannel implementation.\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WebChannelBase');\n\ngoog.require('goog.Uri');\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.async.run');\ngoog.require('goog.json');\ngoog.require('goog.labs.net.webChannel.Channel');\ngoog.require('goog.labs.net.webChannel.ChannelRequest');\ngoog.require('goog.labs.net.webChannel.ConnectionState');\ngoog.require('goog.labs.net.webChannel.ForwardChannelRequestPool');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.labs.net.webChannel.WireV8');\ngoog.require('goog.labs.net.webChannel.environment');\ngoog.require('goog.labs.net.webChannel.netUtils');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.net.FetchXmlHttpFactory');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.XhrIo');\ngoog.require('goog.net.XmlHttpFactory');\ngoog.require('goog.net.rpc.HttpCors');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.structs');\ngoog.requireType('goog.structs.Map');\n\ngoog.scope(function() {\n'use strict';\nconst WebChannel = goog.net.WebChannel;\nconst ChannelRequest = goog.labs.net.webChannel.ChannelRequest;\nconst ConnectionState = goog.labs.net.webChannel.ConnectionState;\nconst ForwardChannelRequestPool =\n    goog.labs.net.webChannel.ForwardChannelRequestPool;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\nconst Wire = goog.labs.net.webChannel.Wire;\nconst WireV8 = goog.labs.net.webChannel.WireV8;\nconst environment = goog.labs.net.webChannel.environment;\nconst netUtils = goog.labs.net.webChannel.netUtils;\nconst requestStats = goog.labs.net.webChannel.requestStats;\n\nconst httpCors = goog.module.get('goog.net.rpc.HttpCors');\n\n/**\n * Gets an internal channel parameter in a type-safe way.\n *\n * @param {string} paramName the key of the parameter to fetch.\n * @param {!T} defaultValue the default value to return\n * @param {!goog.net.WebChannel.Options=} options Configuration for the\n *        WebChannel instance.\n * @return {T}\n * @template T\n */\nfunction getInternalChannelParam(paramName, defaultValue, options) {\n  if (!options || !options.internalChannelParams) {\n    return defaultValue;\n  }\n  return /** @type {T} */ (options.internalChannelParams[paramName]) ||\n      defaultValue;\n}\n\n/**\n * This WebChannel implementation is branched off goog.net.BrowserChannel\n * for now. Ongoing changes to goog.net.BrowserChannel will be back\n * ported to this implementation as needed.\n *\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *        WebChannel instance.\n * @param {number=} opt_clientVersion An application-specific version number\n *        that is sent to the server when connected.\n * @param {!ConnectionState=} opt_conn Previously determined connection\n *        conditions.\n * @constructor\n * @struct\n * @implements {goog.labs.net.webChannel.Channel}\n */\ngoog.labs.net.webChannel.WebChannelBase = function(\n    opt_options, opt_clientVersion, opt_conn) {\n  'use strict';\n  /**\n   * The client library version (capabilities).\n   * @private {number}\n   */\n  this.clientVersion_ = opt_clientVersion || 0;\n\n  /**\n   * The server library version (capabilities).\n   * @private {number}\n   */\n  this.serverVersion_ = 0;\n\n\n  /**\n   * An array of queued maps that need to be sent to the server.\n   * @private {!Array<Wire.QueuedMap>}\n   */\n  this.outgoingMaps_ = [];\n\n  /**\n   * The channel debug used for logging\n   * @private {!WebChannelDebug}\n   */\n  this.channelDebug_ = new WebChannelDebug();\n\n  /**\n   * Connectivity state.\n   * @private {!ConnectionState}\n   */\n  this.connState_ = opt_conn || new ConnectionState();\n\n  /**\n   * Extra HTTP headers to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraHeaders_ = null;\n\n  /**\n   * Extra HTTP headers to add to the init request(s) sent to the server.\n   * @private {?Object}\n   */\n  this.initHeaders_ = null;\n\n  /**\n   * @private {?string} The URL param name to overwrite custom HTTP headers\n   * to bypass CORS preflight.\n   */\n  this.httpHeadersOverwriteParam_ = null;\n\n  /**\n   * Extra parameters to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraParams_ = null;\n\n  /**\n   * Parameter name for the http session id.\n   * @private {?string}\n   */\n  this.httpSessionIdParam_ = null;\n\n  /**\n   * The http session id, to be sent with httpSessionIdParam_ with each\n   * request after the initial handshake.\n   * @private {?string}\n   */\n  this.httpSessionId_ = null;\n\n  /**\n   * The ChannelRequest object for the backchannel.\n   * @private {?ChannelRequest}\n   */\n  this.backChannelRequest_ = null;\n\n  /**\n   * The relative path (in the context of the page hosting the browser channel)\n   * for making requests to the server.\n   * @private {?string}\n   */\n  this.path_ = null;\n\n  /**\n   * The absolute URI for the forwardchannel request.\n   * @private {?goog.Uri}\n   */\n  this.forwardChannelUri_ = null;\n\n  /**\n   * The absolute URI for the backchannel request.\n   * @private {?goog.Uri}\n   */\n  this.backChannelUri_ = null;\n\n  /**\n   * A subdomain prefix for using a subdomain in IE for the backchannel\n   * requests.\n   * @private {?string}\n   */\n  this.hostPrefix_ = null;\n\n  /**\n   * Whether we allow the use of a subdomain in IE for the backchannel requests.\n   * @private {boolean}\n   */\n  this.allowHostPrefix_ = true;\n\n  /**\n   * The next id to use for the RID (request identifier) parameter. This\n   * identifier uniquely identifies the forward channel request.\n   * @private {number}\n   */\n  this.nextRid_ = 0;\n\n  /**\n   * The id to use for the next outgoing map. This identifier uniquely\n   * identifies a sent map.\n   * @private {number}\n   */\n  this.nextMapId_ = 0;\n\n  /**\n   * Whether to fail forward-channel requests after one try or a few tries.\n   * @private {boolean}\n   */\n  this.failFast_ = getInternalChannelParam('failFast', false, opt_options);\n\n  /**\n   * The handler that receive callbacks for state changes and data.\n   * @private {?goog.labs.net.webChannel.WebChannelBase.Handler}\n   */\n  this.handler_ = null;\n\n  /**\n   * Timer identifier for asynchronously making a forward channel request.\n   * This is set to true if the func is scheduled with async.run, which\n   * is equivalent to setTimeout(0).\n   * @private {?number|?boolean}\n   */\n  this.forwardChannelTimerId_ = null;\n\n  /**\n   * Timer identifier for asynchronously making a back channel request.\n   * @private {?number}\n   */\n  this.backChannelTimerId_ = null;\n\n  /**\n   * Timer identifier for the timer that waits for us to retry the backchannel\n   * in the case where it is dead and no longer receiving data.\n   * @private {?number}\n   */\n  this.deadBackChannelTimerId_ = null;\n\n  /**\n   * Whether the client's network conditions can support streamed responses.\n   * @private {?boolean}\n   */\n  this.enableStreaming_ = null;\n\n  /**\n   * Whether streaming mode is allowed. In certain debugging situations, it's\n   * useful to disable this.\n   * @private {boolean}\n   */\n  this.allowStreamingMode_ = true;\n\n  /**\n   * The array identifier of the last array received from the server for the\n   * backchannel request.\n   * @private {number}\n   */\n  this.lastArrayId_ = -1;\n\n  /**\n   * The array id of the last array sent by the server that we know about.\n   * @private {number}\n   */\n  this.lastPostResponseArrayId_ = -1;\n\n  /**\n   * The last status code received.\n   * @private {number}\n   */\n  this.lastStatusCode_ = -1;\n\n  /**\n   * Number of times we have retried the current forward channel request.\n   * @private {number}\n   */\n  this.forwardChannelRetryCount_ = 0;\n\n  /**\n   * Number of times in a row that we have retried the current back channel\n   * request and received no data.\n   * @private {number}\n   */\n  this.backChannelRetryCount_ = 0;\n\n  /**\n   * The attempt id for the current back channel request. Starts at 1 and\n   * increments for each reconnect. The server uses this to log if our\n   * connection is flaky or not.\n   * @private {number}\n   */\n  this.backChannelAttemptId_ = 0;\n\n  /**\n   * The base part of the time before firing next retry request. Default is 5\n   * seconds. Note that a random delay is added (see {@link retryDelaySeedMs_})\n   * for all retries, and linear backoff is applied to the sum for subsequent\n   * retries.\n   * @private {number}\n   */\n  this.baseRetryDelayMs_ =\n      getInternalChannelParam('baseRetryDelayMs', 5 * 1000, opt_options);\n\n  /**\n   * A random time between 0 and this number of MS is added to the\n   * {@link baseRetryDelayMs_}. Default is 10 seconds.\n   * @private {number}\n   */\n  this.retryDelaySeedMs_ =\n      getInternalChannelParam('retryDelaySeedMs', 10 * 1000, opt_options);\n\n  /**\n   * Maximum number of attempts to connect to the server for forward channel\n   * requests. Defaults to 2.\n   * @private {number}\n   */\n  this.forwardChannelMaxRetries_ =\n      getInternalChannelParam('forwardChannelMaxRetries', 2, opt_options);\n\n  /**\n   * The timeout in milliseconds for a forward channel request. Defaults to 20\n   * seconds. Note that part of this timeout can be randomized.\n   * @private {number}\n   */\n  this.forwardChannelRequestTimeoutMs_ = getInternalChannelParam(\n      'forwardChannelRequestTimeoutMs', 20 * 1000, opt_options);\n\n  /**\n   * The custom factory used to create XMLHttpRequest objects.\n   * @private {!goog.net.XmlHttpFactory | undefined}\n   */\n  this.xmlHttpFactory_ =\n      (opt_options && opt_options.xmlHttpFactory) || undefined;\n\n  /**\n   * Whether or not this channel uses WHATWG Fetch/streams.\n   * @private {boolean}\n   */\n  this.usesFetchStreams_ =\n      (opt_options && opt_options.useFetchStreams) || false;\n\n  /**\n   * The timeout in milliseconds for a back channel request. Defaults to using\n   * the timeout configured in ChannelRequest (45s). If server-side\n   * keepaliveInterval is known to the client, set the backchannel request\n   * timeout to 1.5 * keepaliveInterval (ms).\n   *\n   * @private {number|undefined}\n   */\n  this.backChannelRequestTimeoutMs_ = undefined;\n\n  /**\n   * A throttle time in ms for readystatechange events for the backchannel.\n   * Useful for throttling when ready state is INTERACTIVE (partial data).\n   *\n   * This throttle is useful if the server sends large data chunks down the\n   * backchannel.  It prevents examining XHR partial data on every readystate\n   * change event.  This is useful because large chunks can trigger hundreds\n   * of readystatechange events, each of which takes ~5ms or so to handle,\n   * in turn making the UI unresponsive for a significant period.\n   *\n   * If set to zero no throttle is used.\n   * @private {number}\n   */\n  this.readyStateChangeThrottleMs_ = 0;\n\n  /**\n   * Whether cross origin requests are supported for the channel.\n   *\n   * See {@link goog.net.XhrIo#setWithCredentials}.\n   * @private {boolean}\n   */\n  this.supportsCrossDomainXhrs_ =\n      (opt_options && opt_options.supportsCrossDomainXhr) || false;\n\n  /**\n   * The current session id.\n   * @private {string}\n   */\n  this.sid_ = '';\n\n  /**\n   * The current ChannelRequest pool for the forward channel.\n   * @private {!ForwardChannelRequestPool}\n   */\n  this.forwardChannelRequestPool_ = new ForwardChannelRequestPool(\n      opt_options && opt_options.concurrentRequestLimit);\n\n  /**\n   * The V8 codec.\n   * @private {!WireV8}\n   */\n  this.wireCodec_ = new WireV8();\n\n  /**\n   * Whether to turn on the fast handshake behavior.\n   *\n   * @private {boolean}\n   */\n  this.fastHandshake_ = (opt_options && opt_options.fastHandshake) || false;\n\n  /**\n   * Whether to signal to the server to enable blocking handshake.\n   *\n   * @private {boolean}\n   */\n  this.blockingHandshake_ =\n      (opt_options && opt_options.blockingHandshake) || false;\n\n\n  if (opt_options && opt_options.disableRedact) {\n    this.channelDebug_.disableRedact();\n  }\n\n  if (opt_options && opt_options.forceLongPolling) {\n    this.allowStreamingMode_ = false;\n  }\n\n  /**\n   * Whether to detect buffering proxies.\n   *\n   * fastHandshake + detectBufferingProxy are yet to be implemented.\n   *\n   * @private {boolean}\n   */\n  this.detectBufferingProxy_ =\n      (!this.fastHandshake_ && this.allowStreamingMode_ && opt_options &&\n       opt_options.detectBufferingProxy) ||\n      false;\n\n  /**\n   * Callback when all the pending client-sent messages have been flushed.\n   *\n   * @private {function()|undefined}\n   */\n  this.forwardChannelFlushedCallback_ = undefined;\n\n  /**\n   * TODO(user): move all backchannel states to its own class similar to\n   * forwardchannelrequestpool.js and log more stats.\n   *\n   * The estimated handshake RTT (ms) as measured from when the handshake\n   * request is sent and when the handshake response headers are received.\n   * If the value is 0, the RTT is unknown.\n   *\n   * @private {number}\n   */\n  this.handshakeRttMs_ = 0;\n\n  /**\n   * If BP detection is done or still in progress.\n   * Should only be checked when detectBufferingProxy is turned on.\n   * @private {boolean}\n   */\n  this.bpDetectionDone_ = false;\n\n  /**\n   * The timer for detecting buffering proxy. This needs be reset with each\n   * backchannel request. If this is not null, bpDetectionDone_ == false.\n   * @private {?number}\n   */\n  this.bpDetectionTimerId_ = null;\n\n  /***\n   * Whether to attempt Chrome Origin Trials as part of the handshake.\n   * @private {boolean}\n   */\n  this.enableOriginTrials_ =\n      !opt_options || opt_options.enableOriginTrials !== false;\n};\n\nconst WebChannelBase = goog.labs.net.webChannel.WebChannelBase;\n\n\n/**\n * The channel version that we negotiated with the server for this session.\n * Starts out as the version we request, and then is changed to the negotiated\n * version after the initial open.\n * @private {number}\n */\nWebChannelBase.prototype.channelVersion_ = Wire.LATEST_CHANNEL_VERSION;\n\n\n/**\n * Enum type for the channel state machine.\n * @enum {number}\n */\nWebChannelBase.State = {\n  /** The channel is closed. */\n  CLOSED: 0,\n\n  /** The channel has been initialized but hasn't yet initiated a connection. */\n  INIT: 1,\n\n  /** The channel is in the process of opening a connection to the server. */\n  OPENING: 2,\n\n  /** The channel is open. */\n  OPENED: 3\n};\n\n\n/**\n * The current state of the WebChannel.\n * @private {!WebChannelBase.State}\n */\nWebChannelBase.prototype.state_ = WebChannelBase.State.INIT;\n\n\n/**\n * The timeout in milliseconds for a forward channel request.\n * @type {number}\n */\nWebChannelBase.FORWARD_CHANNEL_RETRY_TIMEOUT = 20 * 1000;\n\n\n/**\n * Maximum number of attempts to connect to the server for back channel\n * requests.\n * @type {number}\n */\nWebChannelBase.BACK_CHANNEL_MAX_RETRIES = 3;\n\n\n/**\n * A number in MS of how long we guess the maxmium amount of time a round trip\n * to the server should take. In the future this could be substituted with a\n * real measurement of the RTT.\n * @type {number}\n */\nWebChannelBase.RTT_ESTIMATE = 3 * 1000;\n\n\n/**\n * When retrying for an inactive channel, we will multiply the total delay by\n * this number.\n * @type {number}\n */\nWebChannelBase.INACTIVE_CHANNEL_RETRY_FACTOR = 2;\n\n\n/**\n * Enum type for identifying an error.\n * @enum {number}\n */\nWebChannelBase.Error = {\n  /** Value that indicates no error has occurred. */\n  OK: 0,\n\n  /** An error due to a request failing. */\n  REQUEST_FAILED: 2,\n\n  /** An error due to the user being logged out. */\n  LOGGED_OUT: 4,\n\n  /** An error due to server response which contains no data. */\n  NO_DATA: 5,\n\n  /** An error due to a server response indicating an unknown session id */\n  UNKNOWN_SESSION_ID: 6,\n\n  /** An error due to a server response requesting to stop the channel. */\n  STOP: 7,\n\n  /** A general network error. */\n  NETWORK: 8,\n\n  /** An error due to bad data being returned from the server. */\n  BAD_DATA: 10,\n\n  /** An error due to a response that is not parsable. */\n  BAD_RESPONSE: 11\n};\n\n\n/**\n * Internal enum type for the two channel types.\n * @enum {number}\n * @private\n */\nWebChannelBase.ChannelType_ = {\n  FORWARD_CHANNEL: 1,\n\n  BACK_CHANNEL: 2\n};\n\n\n/**\n * The maximum number of maps that can be sent in one POST. Should match\n * MAX_MAPS_PER_REQUEST on the server code.\n * @type {number}\n * @private\n */\nWebChannelBase.MAX_MAPS_PER_REQUEST_ = 1000;\n\n\n/**\n * The maximum number of utf-8 chars that can be sent in one GET to enable 0-RTT\n * handshake.\n *\n *  @const @private {number}\n */\nWebChannelBase.MAX_CHARS_PER_GET_ = 4 * 1024;\n\n\n/**\n * A guess at a cutoff at which to no longer assume the backchannel is dead\n * when we are slow to receive data. Number in bytes.\n *\n * Assumption: The worst bandwidth we work on is 50 kilobits/sec\n * 50kbits/sec * (1 byte / 8 bits) * 6 sec dead backchannel timeout\n * @type {number}\n */\nWebChannelBase.OUTSTANDING_DATA_BACKCHANNEL_RETRY_CUTOFF = 37500;\n\n\n/**\n * @return {number} The server version or 0 if undefined\n */\nWebChannelBase.prototype.getServerVersion = function() {\n  'use strict';\n  return this.serverVersion_;\n};\n\n\n/**\n * @return {!ForwardChannelRequestPool} The forward channel request pool.\n */\nWebChannelBase.prototype.getForwardChannelRequestPool = function() {\n  'use strict';\n  return this.forwardChannelRequestPool_;\n};\n\n\n/**\n * @return {!Object} The codec object.\n */\nWebChannelBase.prototype.getWireCodec = function() {\n  'use strict';\n  return this.wireCodec_;\n};\n\n\n/**\n * Returns the logger.\n *\n * @return {!WebChannelDebug} The channel debug object.\n */\nWebChannelBase.prototype.getChannelDebug = function() {\n  'use strict';\n  return this.channelDebug_;\n};\n\n\n/**\n * Sets the logger.\n *\n * @param {!WebChannelDebug} channelDebug The channel debug object.\n */\nWebChannelBase.prototype.setChannelDebug = function(channelDebug) {\n  'use strict';\n  this.channelDebug_ = channelDebug;\n};\n\n\n/**\n * Starts the channel. This initiates connections to the server.\n *\n * @param {string} channelPath  The path for the channel connection.\n * @param {!Object=} opt_extraParams Extra parameter keys and values to add to\n *     the requests.\n * @param {string=} opt_oldSessionId  Session ID from a previous session.\n * @param {number=} opt_oldArrayId  The last array ID from a previous session.\n */\nWebChannelBase.prototype.connect = function(\n    channelPath, opt_extraParams, opt_oldSessionId, opt_oldArrayId) {\n  'use strict';\n  this.channelDebug_.debug('connect()');\n\n  this.startOriginTrials_(channelPath);\n\n  requestStats.notifyStatEvent(requestStats.Stat.CONNECT_ATTEMPT);\n\n  this.path_ = channelPath;\n  this.extraParams_ = opt_extraParams || {};\n\n  // Attach parameters about the previous session if reconnecting.\n  if (opt_oldSessionId && opt_oldArrayId !== undefined) {\n    this.extraParams_['OSID'] = opt_oldSessionId;\n    this.extraParams_['OAID'] = opt_oldArrayId;\n  }\n\n  this.enableStreaming_ = this.allowStreamingMode_;\n  this.connectChannel_();\n};\n\n\n/**\n * Disconnects and closes the channel.\n */\nWebChannelBase.prototype.disconnect = function() {\n  'use strict';\n  this.channelDebug_.debug('disconnect()');\n\n  this.cancelRequests_();\n\n  if (this.state_ == WebChannelBase.State.OPENED) {\n    const rid = this.nextRid_++;\n    const uri = this.forwardChannelUri_.clone();\n    uri.setParameterValue('SID', this.sid_);\n    uri.setParameterValue('RID', rid);\n    uri.setParameterValue('TYPE', 'terminate');\n\n    // Add the reconnect parameters.\n    this.addAdditionalParams_(uri);\n\n    const request = ChannelRequest.createChannelRequest(\n        this, this.channelDebug_, this.sid_, rid);\n    request.sendCloseRequest(uri);\n  }\n\n  this.onClose_();\n};\n\n\n/**\n * Returns the session id of the channel. Only available after the\n * channel has been opened.\n * @return {string} Session ID.\n */\nWebChannelBase.prototype.getSessionId = function() {\n  'use strict';\n  return this.sid_;\n};\n\n\n/**\n * Starts the connection.\n * @private\n */\nWebChannelBase.prototype.connectChannel_ = function() {\n  'use strict';\n  this.channelDebug_.debug('connectChannel_()');\n  this.ensureInState_(WebChannelBase.State.INIT, WebChannelBase.State.CLOSED);\n  this.forwardChannelUri_ =\n      this.getForwardChannelUri(/** @type {string} */ (this.path_));\n  this.ensureForwardChannel_();\n};\n\n\n/**\n * Starts the Origin Trials.\n * @param {string} channelPath  The path for the channel connection.\n * @private\n */\nWebChannelBase.prototype.startOriginTrials_ = function(channelPath) {\n  'use strict';\n\n  if (!this.enableOriginTrials_) {\n    return;\n  }\n\n  this.channelDebug_.info('Origin Trials enabled.');\n  goog.async.run(goog.bind(this.runOriginTrials_, this, channelPath));\n};\n\n\n/**\n * Runs the Origin Trials.\n * @param {string} channelPath  The path for the channel connection.\n * @private\n */\nWebChannelBase.prototype.runOriginTrials_ = function(channelPath) {\n  'use strict';\n\n  try {\n    environment.startOriginTrials(channelPath);\n    this.channelDebug_.info('Origin Trials invoked: ' + channelPath);\n  } catch (e) {\n    this.channelDebug_.dumpException(e, 'Error in running origin trials');\n  }\n};\n\n\n/**\n * Cancels backchannel request.\n * @private\n */\nWebChannelBase.prototype.cancelBackChannelRequest_ = function() {\n  'use strict';\n  if (this.backChannelRequest_) {\n    this.clearBpDetectionTimer_();\n    this.backChannelRequest_.cancel();\n    this.backChannelRequest_ = null;\n  }\n};\n\n\n/**\n * Cancels all outstanding requests.\n * @private\n */\nWebChannelBase.prototype.cancelRequests_ = function() {\n  'use strict';\n  this.cancelBackChannelRequest_();\n\n  if (this.backChannelTimerId_) {\n    goog.global.clearTimeout(this.backChannelTimerId_);\n    this.backChannelTimerId_ = null;\n  }\n\n  this.clearDeadBackchannelTimer_();\n\n  this.forwardChannelRequestPool_.cancel();\n\n  if (this.forwardChannelTimerId_) {\n    this.clearForwardChannelTimer_();\n  }\n};\n\n\n/**\n * Clears the forward channel timer.\n * @private\n */\nWebChannelBase.prototype.clearForwardChannelTimer_ = function() {\n  'use strict';\n  if (typeof this.forwardChannelTimerId_ === 'number') {\n    goog.global.clearTimeout(this.forwardChannelTimerId_);\n  }\n\n  this.forwardChannelTimerId_ = null;\n};\n\n\n/**\n * Returns the extra HTTP headers to add to all the requests sent to the server.\n *\n * @return {Object} The HTTP headers, or null.\n */\nWebChannelBase.prototype.getExtraHeaders = function() {\n  'use strict';\n  return this.extraHeaders_;\n};\n\n\n/**\n * Sets extra HTTP headers to add to all the requests sent to the server.\n *\n * @param {Object} extraHeaders The HTTP headers, or null.\n */\nWebChannelBase.prototype.setExtraHeaders = function(extraHeaders) {\n  'use strict';\n  this.extraHeaders_ = extraHeaders;\n};\n\n\n/**\n * Returns the extra HTTP headers to add to the init requests\n * sent to the server.\n *\n * @return {Object} The HTTP headers, or null.\n */\nWebChannelBase.prototype.getInitHeaders = function() {\n  'use strict';\n  return this.initHeaders_;\n};\n\n\n/**\n * Sets extra HTTP headers to add to the init requests sent to the server.\n *\n * @param {Object} initHeaders The HTTP headers, or null.\n */\nWebChannelBase.prototype.setInitHeaders = function(initHeaders) {\n  'use strict';\n  this.initHeaders_ = initHeaders;\n};\n\n\n/**\n * Sets the URL param name to overwrite custom HTTP headers.\n *\n * @param {string} httpHeadersOverwriteParam The URL param name.\n */\nWebChannelBase.prototype.setHttpHeadersOverwriteParam = function(\n    httpHeadersOverwriteParam) {\n  'use strict';\n  this.httpHeadersOverwriteParam_ = httpHeadersOverwriteParam;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.setHttpSessionIdParam = function(httpSessionIdParam) {\n  'use strict';\n  this.httpSessionIdParam_ = httpSessionIdParam;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getHttpSessionIdParam = function() {\n  'use strict';\n  return this.httpSessionIdParam_;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.setHttpSessionId = function(httpSessionId) {\n  'use strict';\n  this.httpSessionId_ = httpSessionId;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getHttpSessionId = function() {\n  'use strict';\n  return this.httpSessionId_;\n};\n\n\n/**\n * Sets the throttle for handling onreadystatechange events for the request.\n *\n * @param {number} throttle The throttle in ms.  A value of zero indicates\n *     no throttle.\n */\nWebChannelBase.prototype.setReadyStateChangeThrottle = function(throttle) {\n  'use strict';\n  this.readyStateChangeThrottleMs_ = throttle;\n};\n\n\n/**\n * Sets whether cross origin requests are supported for the channel.\n *\n * Setting this allows the creation of requests to secondary domains and\n * sends XHRs with the CORS withCredentials bit set to true.\n *\n * In order for cross-origin requests to work, the server will also need to set\n * CORS response headers as per:\n * https://developer.mozilla.org/en-US/docs/HTTP_access_control\n *\n * See {@link goog.net.XhrIo#setWithCredentials}.\n * @param {boolean} supportCrossDomain Whether cross domain XHRs are supported.\n */\nWebChannelBase.prototype.setSupportsCrossDomainXhrs = function(\n    supportCrossDomain) {\n  'use strict';\n  this.supportsCrossDomainXhrs_ = supportCrossDomain;\n};\n\n\n/**\n * Returns the handler used for channel callback events.\n *\n * @return {WebChannelBase.Handler} The handler.\n */\nWebChannelBase.prototype.getHandler = function() {\n  'use strict';\n  return this.handler_;\n};\n\n\n/**\n * Sets the handler used for channel callback events.\n * @param {WebChannelBase.Handler} handler The handler to set.\n */\nWebChannelBase.prototype.setHandler = function(handler) {\n  'use strict';\n  this.handler_ = handler;\n};\n\n\n/**\n * Returns whether the channel allows the use of a subdomain. There may be\n * cases where this isn't allowed.\n * @return {boolean} Whether a host prefix is allowed.\n */\nWebChannelBase.prototype.getAllowHostPrefix = function() {\n  'use strict';\n  return this.allowHostPrefix_;\n};\n\n\n/**\n * Sets whether the channel allows the use of a subdomain. There may be cases\n * where this isn't allowed, for example, logging in with troutboard where\n * using a subdomain causes Apache to force the user to authenticate twice.\n * @param {boolean} allowHostPrefix Whether a host prefix is allowed.\n */\nWebChannelBase.prototype.setAllowHostPrefix = function(allowHostPrefix) {\n  'use strict';\n  this.allowHostPrefix_ = allowHostPrefix;\n};\n\n\n/**\n * Returns whether the channel is buffered or not.  This may be\n * queried in the WebChannelBase.okToMakeRequest() callback.\n *\n * @return {boolean} Whether the channel is buffered.\n */\nWebChannelBase.prototype.isBuffered = function() {\n  'use strict';\n  return !this.enableStreaming_;\n};\n\n\n/**\n * Returns whether streaming mode is allowed. In certain debugging situations,\n * it's useful for the application to have a way to disable streaming mode for a\n * user.\n\n * @return {boolean} Whether streaming mode is allowed.\n */\nWebChannelBase.prototype.getAllowStreamingMode = function() {\n  'use strict';\n  return this.allowStreamingMode_;\n};\n\n\n/**\n * Sets whether streaming mode is allowed. In certain debugging situations, it's\n * useful for the application to have a way to disable streaming mode for a\n * user.\n * @param {boolean} allowStreamingMode  Whether streaming mode is allowed.\n */\nWebChannelBase.prototype.setAllowStreamingMode = function(allowStreamingMode) {\n  'use strict';\n  this.allowStreamingMode_ = allowStreamingMode;\n};\n\n\n/**\n * Sends a request to the server. The format of the request is a Map data\n * structure of key/value pairs. These maps are then encoded in a format\n * suitable for the wire and then reconstituted as a Map data structure that\n * the server can process.\n * @param {!Object|!goog.structs.Map} map The map to send.\n * @param {!Object=} opt_context The context associated with the map.\n */\nWebChannelBase.prototype.sendMap = function(map, opt_context) {\n  'use strict';\n  goog.asserts.assert(\n      this.state_ != WebChannelBase.State.CLOSED,\n      'Invalid operation: sending map when state is closed');\n\n  // We can only send 1000 maps per POST, but typically we should never have\n  // that much to send, so warn if we exceed that (we still send all the maps).\n  if (this.outgoingMaps_.length == WebChannelBase.MAX_MAPS_PER_REQUEST_) {\n    // severe() is temporary so that we get these uploaded and can figure out\n    // what's causing them. Afterwards can change to warning().\n    this.channelDebug_.severe(function() {\n      'use strict';\n      return 'Already have ' + WebChannelBase.MAX_MAPS_PER_REQUEST_ +\n          ' queued maps upon queueing ' + goog.json.serialize(map);\n    });\n  }\n\n  this.outgoingMaps_.push(\n      new Wire.QueuedMap(this.nextMapId_++, map, opt_context));\n\n  // Messages need be buffered during OPENING to avoid server-side race\n  if (this.state_ == WebChannelBase.State.OPENED) {\n    this.ensureForwardChannel_();\n  }\n};\n\n\n/**\n * When set to true, this changes the behavior of the forward channel so it\n * will not retry requests; it will fail after one network failure, and if\n * there was already one network failure, the request will fail immediately.\n * @param {boolean} failFast  Whether or not to fail fast.\n */\nWebChannelBase.prototype.setFailFast = function(failFast) {\n  'use strict';\n  this.failFast_ = failFast;\n  this.channelDebug_.info('setFailFast: ' + failFast);\n  if ((this.forwardChannelRequestPool_.hasPendingRequest() ||\n       this.forwardChannelTimerId_) &&\n      this.forwardChannelRetryCount_ > this.getForwardChannelMaxRetries()) {\n    const self = this;\n    this.channelDebug_.info(function() {\n      'use strict';\n      return 'Retry count ' + self.forwardChannelRetryCount_ +\n          ' > new maxRetries ' + self.getForwardChannelMaxRetries() +\n          '. Fail immediately!';\n    });\n\n    if (!this.forwardChannelRequestPool_.forceComplete(\n            goog.bind(this.onRequestComplete, this))) {\n      // i.e., this.forwardChannelTimerId_\n      this.clearForwardChannelTimer_();\n      // The error code from the last failed request is gone, so just use a\n      // generic one.\n      this.signalError_(WebChannelBase.Error.REQUEST_FAILED);\n    }\n  }\n};\n\n\n/**\n * @return {number} The max number of forward-channel retries, which will be 0\n * in fail-fast mode.\n */\nWebChannelBase.prototype.getForwardChannelMaxRetries = function() {\n  'use strict';\n  return this.failFast_ ? 0 : this.forwardChannelMaxRetries_;\n};\n\n\n/**\n * Sets the maximum number of attempts to connect to the server for forward\n * channel requests.\n * @param {number} retries The maximum number of attempts.\n */\nWebChannelBase.prototype.setForwardChannelMaxRetries = function(retries) {\n  'use strict';\n  this.forwardChannelMaxRetries_ = retries;\n};\n\n\n/**\n * Sets the timeout for a forward channel request.\n * @param {number} timeoutMs The timeout in milliseconds.\n */\nWebChannelBase.prototype.setForwardChannelRequestTimeout = function(timeoutMs) {\n  'use strict';\n  this.forwardChannelRequestTimeoutMs_ = timeoutMs;\n};\n\n\n/**\n * @return {number} The max number of back-channel retries, which is a constant.\n */\nWebChannelBase.prototype.getBackChannelMaxRetries = function() {\n  'use strict';\n  // Back-channel retries is a constant.\n  return WebChannelBase.BACK_CHANNEL_MAX_RETRIES;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.isClosed = function() {\n  'use strict';\n  return this.state_ == WebChannelBase.State.CLOSED;\n};\n\n\n/**\n * Returns the channel state.\n * @return {WebChannelBase.State} The current state of the channel.\n */\nWebChannelBase.prototype.getState = function() {\n  'use strict';\n  return this.state_;\n};\n\n\n/**\n * Return the last status code received for a request.\n * @return {number} The last status code received for a request.\n */\nWebChannelBase.prototype.getLastStatusCode = function() {\n  'use strict';\n  return this.lastStatusCode_;\n};\n\n\n/**\n * @return {number} The last array id received.\n */\nWebChannelBase.prototype.getLastArrayId = function() {\n  'use strict';\n  return this.lastArrayId_;\n};\n\n\n/**\n * Returns whether there are outstanding requests servicing the channel.\n * @return {boolean} true if there are outstanding requests.\n */\nWebChannelBase.prototype.hasOutstandingRequests = function() {\n  'use strict';\n  return this.getOutstandingRequests_() != 0;\n};\n\n\n/**\n * Returns the number of outstanding requests.\n * @return {number} The number of outstanding requests to the server.\n * @private\n */\nWebChannelBase.prototype.getOutstandingRequests_ = function() {\n  'use strict';\n  let count = 0;\n  if (this.backChannelRequest_) {\n    count++;\n  }\n  count += this.forwardChannelRequestPool_.getRequestCount();\n  return count;\n};\n\n\n/**\n * Ensures that a forward channel request is scheduled.\n * @private\n */\nWebChannelBase.prototype.ensureForwardChannel_ = function() {\n  'use strict';\n  if (this.forwardChannelRequestPool_.isFull()) {\n    // enough connection in process - no need to start a new request\n    return;\n  }\n\n  if (this.forwardChannelTimerId_) {\n    // no need to start a new request - one is already scheduled\n    return;\n  }\n\n  // Use async.run instead of setTimeout(0) to avoid the 1s message delay\n  // from chrome/firefox background tabs\n  this.forwardChannelTimerId_ = true;\n  goog.async.run(this.onStartForwardChannelTimer_, this);\n\n  this.forwardChannelRetryCount_ = 0;\n};\n\n\n/**\n * Schedules a forward-channel retry for the specified request, unless the max\n * retries has been reached.\n * @param {!ChannelRequest} request The failed request to retry.\n * @return {boolean} true iff a retry was scheduled.\n * @private\n */\nWebChannelBase.prototype.maybeRetryForwardChannel_ = function(request) {\n  'use strict';\n  if (this.forwardChannelRequestPool_.getRequestCount() >=\n      this.forwardChannelRequestPool_.getMaxSize() -\n          (this.forwardChannelTimerId_ ? 1 : 0)) {\n    // Should be impossible to be called in this state.\n    this.channelDebug_.severe('Unexpected retry request is scheduled.');\n    return false;\n  }\n\n  if (this.forwardChannelTimerId_) {\n    this.channelDebug_.debug(\n        'Use the retry request that is already scheduled.');\n    this.outgoingMaps_ =\n        request.getPendingMessages().concat(this.outgoingMaps_);\n    return true;\n  }\n\n  // No retry for open_() and fail-fast\n  if (this.state_ == WebChannelBase.State.INIT ||\n      this.state_ == WebChannelBase.State.OPENING ||\n      (this.forwardChannelRetryCount_ >= this.getForwardChannelMaxRetries())) {\n    return false;\n  }\n\n  this.channelDebug_.debug('Going to retry POST');\n\n  this.forwardChannelTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onStartForwardChannelTimer_, this, request),\n      this.getRetryTime_(this.forwardChannelRetryCount_));\n  this.forwardChannelRetryCount_++;\n  return true;\n};\n\n\n/**\n * Timer callback for ensureForwardChannel\n * @param {ChannelRequest=} opt_retryRequest A failed request\n * to retry.\n * @private\n */\nWebChannelBase.prototype.onStartForwardChannelTimer_ = function(\n    opt_retryRequest) {\n  'use strict';\n  // null is possible if scheduled with async.run\n  if (this.forwardChannelTimerId_) {\n    this.forwardChannelTimerId_ = null;\n    this.startForwardChannel_(opt_retryRequest);\n  }\n};\n\n\n/**\n * Begins a new forward channel operation to the server.\n * @param {ChannelRequest=} opt_retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.startForwardChannel_ = function(opt_retryRequest) {\n  'use strict';\n  this.channelDebug_.debug('startForwardChannel_');\n  if (!this.okToMakeRequest_()) {\n    return;  // channel is cancelled\n  } else if (this.state_ == WebChannelBase.State.INIT) {\n    if (opt_retryRequest) {\n      this.channelDebug_.severe('Not supposed to retry the open');\n      return;\n    }\n    this.open_();\n    this.state_ = WebChannelBase.State.OPENING;\n  } else if (this.state_ == WebChannelBase.State.OPENED) {\n    if (opt_retryRequest) {\n      this.makeForwardChannelRequest_(opt_retryRequest);\n      return;\n    }\n\n    if (this.outgoingMaps_.length == 0) {\n      this.channelDebug_.debug(\n          'startForwardChannel_ returned: ' +\n          'nothing to send');\n      // no need to start a new forward channel request\n      return;\n    }\n\n    if (this.forwardChannelRequestPool_.isFull()) {\n      // Should be impossible to be called in this state.\n      this.channelDebug_.severe(\n          'startForwardChannel_ returned: ' +\n          'connection already in progress');\n      return;\n    }\n\n    this.makeForwardChannelRequest_();\n    this.channelDebug_.debug('startForwardChannel_ finished, sent request');\n  }\n};\n\n\n/**\n * Establishes a new channel session with the server.\n * @private\n */\nWebChannelBase.prototype.open_ = function() {\n  'use strict';\n  this.channelDebug_.debug('open_()');\n  this.nextRid_ = Math.floor(Math.random() * 100000);\n\n  const rid = this.nextRid_++;\n  const request =\n      ChannelRequest.createChannelRequest(this, this.channelDebug_, '', rid);\n\n  // mix the init headers\n  let extraHeaders = this.extraHeaders_;\n  if (this.initHeaders_) {\n    if (extraHeaders) {\n      extraHeaders = goog.object.clone(extraHeaders);\n      goog.object.extend(extraHeaders, this.initHeaders_);\n    } else {\n      extraHeaders = this.initHeaders_;\n    }\n  }\n\n  if (this.httpHeadersOverwriteParam_ === null) {\n    request.setExtraHeaders(extraHeaders);\n  }\n\n  const requestText = this.dequeueOutgoingMaps_(\n      request,\n      this.fastHandshake_ ? this.getMaxNumMessagesForFastHandshake_() :\n                            WebChannelBase.MAX_MAPS_PER_REQUEST_);\n\n  const uri = this.forwardChannelUri_.clone();\n  uri.setParameterValue('RID', rid);\n\n  if (this.clientVersion_ > 0) {\n    uri.setParameterValue('CVER', this.clientVersion_);\n  }\n\n  // http-session-id to be generated as the response\n  if (this.getHttpSessionIdParam()) {\n    uri.setParameterValue(\n        WebChannel.X_HTTP_SESSION_ID, this.getHttpSessionIdParam());\n  }\n\n  // Add the reconnect parameters.\n  this.addAdditionalParams_(uri);\n\n  if (this.httpHeadersOverwriteParam_ && extraHeaders) {\n    httpCors.setHttpHeadersWithOverwriteParam(\n        uri, this.httpHeadersOverwriteParam_, extraHeaders);\n  }\n\n  this.forwardChannelRequestPool_.addRequest(request);\n\n  if (this.blockingHandshake_) {\n    uri.setParameterValue('TYPE', 'init');  // default to blocking in future\n  }\n\n  // Check the option and use GET to enable QUIC 0-RTT\n  if (this.fastHandshake_) {\n    uri.setParameterValue('$req', requestText);\n\n    // enable handshake upgrade\n    uri.setParameterValue('SID', 'null');\n    request.setDecodeInitialResponse();\n\n    request.xmlHttpPost(uri, null, true);  // Send as a GET\n  } else {\n    request.xmlHttpPost(uri, requestText, true);\n  }\n};\n\n\n/**\n * @return {number} The number of raw JSON messages to be encoded\n * with the fast-handshake (GET) request, including zero. If messages are not\n * encoded as raw JSON data, return WebChannelBase.MAX_MAPS_PER_REQUEST_\n * @private\n */\nWebChannelBase.prototype.getMaxNumMessagesForFastHandshake_ = function() {\n  'use strict';\n  let total = 0;\n  for (let i = 0; i < this.outgoingMaps_.length; i++) {\n    const map = this.outgoingMaps_[i];\n    const size = map.getRawDataSize();\n    if (size === undefined) {\n      break;\n    }\n    total += size;\n\n    if (total > WebChannelBase.MAX_CHARS_PER_GET_) {\n      return i;\n    }\n\n    if (total === WebChannelBase.MAX_CHARS_PER_GET_ ||\n        i === this.outgoingMaps_.length - 1) {\n      return i + 1;\n    }\n  }\n\n  return WebChannelBase.MAX_MAPS_PER_REQUEST_;\n};\n\n\n\n/**\n * Makes a forward channel request using XMLHTTP.\n * @param {!ChannelRequest=} opt_retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.makeForwardChannelRequest_ = function(\n    opt_retryRequest) {\n  'use strict';\n  let rid;\n  if (opt_retryRequest) {\n    rid = opt_retryRequest.getRequestId();  // Reuse the same RID for a retry\n  } else {\n    rid = this.nextRid_++;\n  }\n\n  const uri = this.forwardChannelUri_.clone();\n  uri.setParameterValue('SID', this.sid_);\n  uri.setParameterValue('RID', rid);\n  uri.setParameterValue('AID', this.lastArrayId_);\n  // Add the additional reconnect parameters.\n  this.addAdditionalParams_(uri);\n\n  if (this.httpHeadersOverwriteParam_ && this.extraHeaders_) {\n    httpCors.setHttpHeadersWithOverwriteParam(\n        uri, this.httpHeadersOverwriteParam_, this.extraHeaders_);\n  }\n\n  const request = ChannelRequest.createChannelRequest(\n      this, this.channelDebug_, this.sid_, rid,\n      this.forwardChannelRetryCount_ + 1);\n\n  if (this.httpHeadersOverwriteParam_ === null) {\n    request.setExtraHeaders(this.extraHeaders_);\n  }\n\n  let requestText;\n  if (opt_retryRequest) {\n    this.requeuePendingMaps_(opt_retryRequest);\n  }\n  requestText =\n      this.dequeueOutgoingMaps_(request, WebChannelBase.MAX_MAPS_PER_REQUEST_);\n\n  // Randomize from 50%-100% of the forward channel timeout to avoid\n  // a big hit if servers happen to die at once.\n  request.setTimeout(\n      Math.round(this.forwardChannelRequestTimeoutMs_ * 0.50) +\n      Math.round(this.forwardChannelRequestTimeoutMs_ * 0.50 * Math.random()));\n  this.forwardChannelRequestPool_.addRequest(request);\n  request.xmlHttpPost(uri, requestText, true);\n};\n\n\n/**\n * Adds the additional parameters from the handler to the given URI.\n * @param {!goog.Uri} uri The URI to add the parameters to.\n * @private\n */\nWebChannelBase.prototype.addAdditionalParams_ = function(uri) {\n  'use strict';\n  // Add the additional reconnect parameters as needed.\n  if (this.handler_) {\n    const params = this.handler_.getAdditionalParams(this);\n    if (params) {\n      goog.structs.forEach(params, function(value, key, coll) {\n        'use strict';\n        uri.setParameterValue(key, value);\n      });\n    }\n  }\n};\n\n\n/**\n * Returns the request text from the outgoing maps and resets it.\n * @param {!ChannelRequest} request The new request for sending the messages.\n * @param {number} maxNum The maximum number of messages to be encoded\n * @return {string} The encoded request text created from all the currently\n *                  queued outgoing maps.\n * @private\n */\nWebChannelBase.prototype.dequeueOutgoingMaps_ = function(request, maxNum) {\n  'use strict';\n  const count = Math.min(this.outgoingMaps_.length, maxNum);\n\n  const badMapHandler = this.handler_ ?\n      goog.bind(this.handler_.badMapError, this.handler_, this) :\n      null;\n  const result = this.wireCodec_.encodeMessageQueue(\n      this.outgoingMaps_, count, badMapHandler);\n\n  request.setPendingMessages(this.outgoingMaps_.splice(0, count));\n\n  return result;\n};\n\n\n/**\n * Requeues unacknowledged sent arrays for retransmission in the next forward\n * channel request.\n * @param {!ChannelRequest} retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.requeuePendingMaps_ = function(retryRequest) {\n  'use strict';\n  this.outgoingMaps_ =\n      retryRequest.getPendingMessages().concat(this.outgoingMaps_);\n};\n\n\n/**\n * Ensures there is a backchannel request for receiving data from the server.\n * @private\n */\nWebChannelBase.prototype.ensureBackChannel_ = function() {\n  'use strict';\n  if (this.backChannelRequest_) {\n    // already have one\n    return;\n  }\n\n  if (this.backChannelTimerId_) {\n    // no need to start a new request - one is already scheduled\n    return;\n  }\n\n  this.backChannelAttemptId_ = 1;\n\n  // Use async.run instead of setTimeout(0) to avoid the 1s message delay\n  // from chrome/firefox background tabs\n  // backChannelTimerId_ stays unset, as with setTimeout(0)\n  goog.async.run(this.onStartBackChannelTimer_, this);\n\n  this.backChannelRetryCount_ = 0;\n};\n\n\n/**\n * Schedules a back-channel retry, unless the max retries has been reached.\n * @return {boolean} true iff a retry was scheduled.\n * @private\n */\nWebChannelBase.prototype.maybeRetryBackChannel_ = function() {\n  'use strict';\n  if (this.backChannelRequest_ || this.backChannelTimerId_) {\n    // Should be impossible to be called in this state.\n    this.channelDebug_.severe('Request already in progress');\n    return false;\n  }\n\n  if (this.backChannelRetryCount_ >= this.getBackChannelMaxRetries()) {\n    return false;\n  }\n\n  this.channelDebug_.debug('Going to retry GET');\n\n  this.backChannelAttemptId_++;\n  this.backChannelTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onStartBackChannelTimer_, this),\n      this.getRetryTime_(this.backChannelRetryCount_));\n  this.backChannelRetryCount_++;\n  return true;\n};\n\n\n/**\n * Timer callback for ensureBackChannel_.\n * @private\n */\nWebChannelBase.prototype.onStartBackChannelTimer_ = function() {\n  'use strict';\n  this.backChannelTimerId_ = null;\n  this.startBackChannel_();\n\n  if (!this.detectBufferingProxy_) {\n    return;\n  }\n\n  if (this.bpDetectionDone_) {\n    return;\n  }\n\n  if (this.backChannelRequest_ == null || this.handshakeRttMs_ <= 0) {\n    this.channelDebug_.warning(\n        'Skip bpDetectionTimerId_ ' + this.backChannelRequest_ + ' ' +\n        this.handshakeRttMs_);\n    return;\n  }\n\n  // This goes with each new request until bpDetectionDone_\n  const bpDetectionTimeout = 2 * this.handshakeRttMs_;\n  this.channelDebug_.info('BP detection timer enabled: ' + bpDetectionTimeout);\n\n  this.bpDetectionTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onBpDetectionTimer_, this), bpDetectionTimeout);\n};\n\n\n/**\n * Timer callback for bpDetection.\n * @private\n */\nWebChannelBase.prototype.onBpDetectionTimer_ = function() {\n  'use strict';\n  if (!this.bpDetectionTimerId_) {\n    this.channelDebug_.warning('Invalid operation.');\n    return;\n  }\n\n  this.bpDetectionTimerId_ = null;\n  this.channelDebug_.info('BP detection timeout reached.');\n\n  goog.asserts.assert(\n      this.backChannelRequest_ != null,\n      'Invalid state: no backchannel request');\n\n  // We wait for extra response payload in addition to just headers to\n  // cancel the timer.\n  if (this.backChannelRequest_.getXhr() != null) {\n    const responseData = this.backChannelRequest_.getXhr().getResponseText();\n    if (responseData) {\n      this.channelDebug_.warning(\n          'Timer should have been cancelled : ' + responseData);\n    }\n  }\n\n  // Enable long-polling\n  this.channelDebug_.info(\n      'Buffering proxy detected and switch to long-polling!');\n  this.enableStreaming_ = false;\n\n  this.bpDetectionDone_ = true;\n  requestStats.notifyStatEvent(requestStats.Stat.PROXY);\n\n  // Cancel the request and start a new one immediately\n  this.cancelBackChannelRequest_();\n  this.startBackChannel_();\n};\n\n\n/**\n * Clears the timer for BP detection.\n * @private\n */\nWebChannelBase.prototype.clearBpDetectionTimer_ = function() {\n  'use strict';\n  if (this.bpDetectionTimerId_ != null) {\n    this.channelDebug_.debug('Cancel the BP detection timer.');\n    goog.global.clearTimeout(this.bpDetectionTimerId_);\n    this.bpDetectionTimerId_ = null;\n  }\n};\n\n\n/**\n * Begins a new back channel operation to the server.\n * @private\n */\nWebChannelBase.prototype.startBackChannel_ = function() {\n  'use strict';\n  if (!this.okToMakeRequest_()) {\n    // channel is cancelled\n    return;\n  }\n\n  this.channelDebug_.debug('Creating new HttpRequest');\n  this.backChannelRequest_ = ChannelRequest.createChannelRequest(\n      this, this.channelDebug_, this.sid_, 'rpc', this.backChannelAttemptId_);\n\n  if (this.httpHeadersOverwriteParam_ === null) {\n    this.backChannelRequest_.setExtraHeaders(this.extraHeaders_);\n  }\n\n  this.backChannelRequest_.setReadyStateChangeThrottle(\n      this.readyStateChangeThrottleMs_);\n  const uri = this.backChannelUri_.clone();\n  uri.setParameterValue('RID', 'rpc');\n  uri.setParameterValue('SID', this.sid_);\n  uri.setParameterValue('CI', this.enableStreaming_ ? '0' : '1');\n  uri.setParameterValue('AID', this.lastArrayId_);\n\n  // Add the reconnect parameters.\n  this.addAdditionalParams_(uri);\n\n  uri.setParameterValue('TYPE', 'xmlhttp');\n\n  if (this.httpHeadersOverwriteParam_ && this.extraHeaders_) {\n    httpCors.setHttpHeadersWithOverwriteParam(\n        uri, this.httpHeadersOverwriteParam_, this.extraHeaders_);\n  }\n\n  if (this.backChannelRequestTimeoutMs_) {\n    this.backChannelRequest_.setTimeout(this.backChannelRequestTimeoutMs_);\n  }\n\n  this.backChannelRequest_.xmlHttpGet(\n      uri, true /* decodeChunks */, this.hostPrefix_);\n\n  this.channelDebug_.debug('New Request created');\n};\n\n\n/**\n * Gives the handler a chance to return an error code and stop channel\n * execution. A handler might want to do this to check that the user is still\n * logged in, for example.\n * @private\n * @return {boolean} If it's OK to make a request.\n */\nWebChannelBase.prototype.okToMakeRequest_ = function() {\n  'use strict';\n  if (this.handler_) {\n    const result = this.handler_.okToMakeRequest(this);\n    if (result != WebChannelBase.Error.OK) {\n      this.channelDebug_.debug(\n          'Handler returned error code from okToMakeRequest');\n      this.signalError_(result);\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.onFirstByteReceived = function(request, responseText) {\n  'use strict';\n  if (this.backChannelRequest_ == request && this.detectBufferingProxy_) {\n    if (!this.bpDetectionDone_) {\n      this.channelDebug_.info(\n          'Great, no buffering proxy detected. Bytes received: ' +\n          responseText.length);\n      goog.asserts.assert(\n          this.bpDetectionTimerId_, 'Timer should not have been cancelled.');\n      this.clearBpDetectionTimer_();\n      this.bpDetectionDone_ = true;\n      requestStats.notifyStatEvent(requestStats.Stat.NOPROXY);\n    }\n  }\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.onRequestData = function(request, responseText) {\n  'use strict';\n  if (this.state_ == WebChannelBase.State.CLOSED ||\n      (this.backChannelRequest_ != request &&\n       !this.forwardChannelRequestPool_.hasRequest(request))) {\n    // either CLOSED or a request we don't know about (perhaps an old request)\n    return;\n  }\n  this.lastStatusCode_ = request.getLastStatusCode();\n\n  // first to check if request has been upgraded to backchannel\n  if (!request.isInitialResponseDecoded() &&\n      this.forwardChannelRequestPool_.hasRequest(request) &&\n      this.state_ == WebChannelBase.State.OPENED) {\n    let response;\n    try {\n      response = this.wireCodec_.decodeMessage(responseText);\n    } catch (ex) {\n      response = null;\n    }\n    if (Array.isArray(response) && response.length == 3) {\n      this.handlePostResponse_(/** @type {!Array<?>} */ (response), request);\n      this.onForwardChannelFlushed_();\n    } else {\n      this.channelDebug_.debug('Bad POST response data returned');\n      this.signalError_(WebChannelBase.Error.BAD_RESPONSE);\n    }\n  } else {\n    if (request.isInitialResponseDecoded() ||\n        this.backChannelRequest_ == request) {\n      this.clearDeadBackchannelTimer_();\n    }\n\n    if (!goog.string.isEmptyOrWhitespace(responseText)) {\n      let response = this.wireCodec_.decodeMessage(responseText);\n      this.onInput_(/** @type {!Array<?>} */ (response), request);\n    }\n  }\n};\n\n\n/**\n * Checks if we need call the flush callback.\n *\n * @private\n */\nWebChannelBase.prototype.onForwardChannelFlushed_ = function() {\n  'use strict';\n  if (this.forwardChannelRequestPool_.getRequestCount() <= 1) {\n    if (this.forwardChannelFlushedCallback_) {\n      try {\n        this.forwardChannelFlushedCallback_();\n      } catch (ex) {\n        this.channelDebug_.dumpException(\n            ex, 'Exception from forwardChannelFlushedCallback_ ');\n      }\n      // reset\n      this.forwardChannelFlushedCallback_ = undefined;\n    }\n  }\n};\n\n\n/**\n * Handles a POST response from the server.\n * @param {Array<number>} responseValues The key value pairs in\n *     the POST response.\n * @param {!ChannelRequest} forwardReq The forward channel request that\n * triggers this function call.\n * @private\n */\nWebChannelBase.prototype.handlePostResponse_ = function(\n    responseValues, forwardReq) {\n  'use strict';\n  // The first response value is set to 0 if server is missing backchannel.\n  if (responseValues[0] == 0) {\n    this.handleBackchannelMissing_(forwardReq);\n    return;\n  }\n  this.lastPostResponseArrayId_ = responseValues[1];\n  const outstandingArrays = this.lastPostResponseArrayId_ - this.lastArrayId_;\n  if (0 < outstandingArrays) {\n    const numOutstandingBackchannelBytes = responseValues[2];\n    this.channelDebug_.debug(\n        numOutstandingBackchannelBytes + ' bytes (in ' + outstandingArrays +\n        ' arrays) are outstanding on the BackChannel');\n    if (!this.shouldRetryBackChannel_(numOutstandingBackchannelBytes)) {\n      return;\n    }\n    if (!this.deadBackChannelTimerId_) {\n      // We expect to receive data within 2 RTTs or we retry the backchannel.\n      this.deadBackChannelTimerId_ = requestStats.setTimeout(\n          goog.bind(this.onBackChannelDead_, this),\n          2 * WebChannelBase.RTT_ESTIMATE);\n    }\n  }\n};\n\n\n/**\n * Handles a POST response from the server telling us that it has detected that\n * we have no hanging GET connection.\n * @param {!ChannelRequest} forwardReq The forward channel request that\n * triggers this function call.\n * @private\n */\nWebChannelBase.prototype.handleBackchannelMissing_ = function(forwardReq) {\n  'use strict';\n  // As long as the back channel was started before the POST was sent,\n  // we should retry the backchannel. We give a slight buffer of RTT_ESTIMATE\n  // so as not to excessively retry the backchannel\n  this.channelDebug_.debug('Server claims our backchannel is missing.');\n  if (this.backChannelTimerId_) {\n    this.channelDebug_.debug('But we are currently starting the request.');\n    return;\n  } else if (!this.backChannelRequest_) {\n    this.channelDebug_.warning('We do not have a BackChannel established');\n  } else if (\n      this.backChannelRequest_.getRequestStartTime() +\n          WebChannelBase.RTT_ESTIMATE <\n      forwardReq.getRequestStartTime()) {\n    this.clearDeadBackchannelTimer_();\n    this.cancelBackChannelRequest_();\n  } else {\n    return;\n  }\n  this.maybeRetryBackChannel_();\n  requestStats.notifyStatEvent(requestStats.Stat.BACKCHANNEL_MISSING);\n};\n\n\n/**\n * Determines whether we should start the process of retrying a possibly\n * dead backchannel.\n * @param {number} outstandingBytes The number of bytes for which the server has\n *     not yet received acknowledgement.\n * @return {boolean} Whether to start the backchannel retry timer.\n * @private\n */\nWebChannelBase.prototype.shouldRetryBackChannel_ = function(outstandingBytes) {\n  'use strict';\n  // Not too many outstanding bytes, not buffered and not after a retry.\n  return outstandingBytes <\n      WebChannelBase.OUTSTANDING_DATA_BACKCHANNEL_RETRY_CUTOFF &&\n      !this.isBuffered() && this.backChannelRetryCount_ == 0;\n};\n\n\n/**\n * Decides which host prefix should be used, if any.  If there is a handler,\n * allows the handler to validate a host prefix provided by the server, and\n * optionally override it.\n * @param {?string} serverHostPrefix The host prefix provided by the server.\n * @return {?string} The host prefix to actually use, if any. Will return null\n *     if the use of host prefixes was disabled via setAllowHostPrefix().\n * @override\n */\nWebChannelBase.prototype.correctHostPrefix = function(serverHostPrefix) {\n  'use strict';\n  if (this.allowHostPrefix_) {\n    if (this.handler_) {\n      return this.handler_.correctHostPrefix(serverHostPrefix);\n    }\n    return serverHostPrefix;\n  }\n  return null;\n};\n\n\n/**\n * Handles the timer that indicates that our backchannel is no longer able to\n * successfully receive data from the server.\n * @private\n */\nWebChannelBase.prototype.onBackChannelDead_ = function() {\n  'use strict';\n  if (this.deadBackChannelTimerId_ != null) {\n    this.deadBackChannelTimerId_ = null;\n    this.cancelBackChannelRequest_();\n    this.maybeRetryBackChannel_();\n    requestStats.notifyStatEvent(requestStats.Stat.BACKCHANNEL_DEAD);\n  }\n};\n\n\n/**\n * Clears the timer that indicates that our backchannel is no longer able to\n * successfully receive data from the server.\n * @private\n */\nWebChannelBase.prototype.clearDeadBackchannelTimer_ = function() {\n  'use strict';\n  if (this.deadBackChannelTimerId_ != null) {\n    goog.global.clearTimeout(this.deadBackChannelTimerId_);\n    this.deadBackChannelTimerId_ = null;\n  }\n};\n\n\n/**\n * Returns whether or not the given error/status combination is fatal or not.\n * On fatal errors we immediately close the session rather than retrying the\n * failed request.\n * @param {?ChannelRequest.Error} error The error code for the\n * failed request.\n * @param {number} statusCode The last HTTP status code.\n * @return {boolean} Whether or not the error is fatal.\n * @private\n */\nWebChannelBase.isFatalError_ = function(error, statusCode) {\n  'use strict';\n  return error == ChannelRequest.Error.UNKNOWN_SESSION_ID ||\n      (error == ChannelRequest.Error.STATUS && statusCode > 0);\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.onRequestComplete = function(request) {\n  'use strict';\n  this.channelDebug_.debug('Request complete');\n  let type;\n  let pendingMessages = null;\n  if (this.backChannelRequest_ == request) {\n    this.clearDeadBackchannelTimer_();\n    this.clearBpDetectionTimer_();\n    this.backChannelRequest_ = null;\n    type = WebChannelBase.ChannelType_.BACK_CHANNEL;\n  } else if (this.forwardChannelRequestPool_.hasRequest(request)) {\n    pendingMessages = request.getPendingMessages();\n    this.forwardChannelRequestPool_.removeRequest(request);\n    type = WebChannelBase.ChannelType_.FORWARD_CHANNEL;\n  } else {\n    // return if it was an old request from a previous session\n    return;\n  }\n\n  this.lastStatusCode_ = request.getLastStatusCode();\n\n  if (this.state_ == WebChannelBase.State.CLOSED) {\n    return;\n  }\n\n  if (request.getSuccess()) {\n    if (type == WebChannelBase.ChannelType_.FORWARD_CHANNEL) {\n      const size = request.getPostData() ? request.getPostData().length : 0;\n      requestStats.notifyTimingEvent(\n          size, Date.now() - request.getRequestStartTime(),\n          this.forwardChannelRetryCount_);\n      this.ensureForwardChannel_();\n      this.onSuccess_(request);\n    } else {  // i.e., back-channel\n      this.ensureBackChannel_();\n    }\n    return;\n  }\n  // Else unsuccessful. Fall through.\n\n  const lastError = request.getLastError();\n  if (!WebChannelBase.isFatalError_(lastError, this.lastStatusCode_)) {\n    // Maybe retry.\n    const self = this;\n    this.channelDebug_.debug(function() {\n      'use strict';\n      return 'Maybe retrying, last error: ' +\n          ChannelRequest.errorStringFromCode(lastError, self.lastStatusCode_);\n    });\n    if (type == WebChannelBase.ChannelType_.FORWARD_CHANNEL) {\n      if (this.maybeRetryForwardChannel_(request)) {\n        return;\n      }\n    }\n    if (type == WebChannelBase.ChannelType_.BACK_CHANNEL) {\n      if (this.maybeRetryBackChannel_()) {\n        return;\n      }\n    }\n    // Else exceeded max retries. Fall through.\n    this.channelDebug_.debug('Exceeded max number of retries');\n  } else {\n    // Else fatal error. Fall through and mark the pending maps as failed.\n    this.channelDebug_.debug('Not retrying due to error type');\n  }\n\n\n  // Abort the channel now\n\n  // Record pending messages from the failed request\n  if (pendingMessages && pendingMessages.length > 0) {\n    this.forwardChannelRequestPool_.addPendingMessages(pendingMessages);\n  }\n\n  this.channelDebug_.debug('Error: HTTP request failed');\n  switch (lastError) {\n    case ChannelRequest.Error.NO_DATA:\n      this.signalError_(WebChannelBase.Error.NO_DATA);\n      break;\n    case ChannelRequest.Error.BAD_DATA:\n      this.signalError_(WebChannelBase.Error.BAD_DATA);\n      break;\n    case ChannelRequest.Error.UNKNOWN_SESSION_ID:\n      this.signalError_(WebChannelBase.Error.UNKNOWN_SESSION_ID);\n      break;\n    default:\n      this.signalError_(WebChannelBase.Error.REQUEST_FAILED);\n      break;\n  }\n};\n\n\n/**\n * @param {number} retryCount Number of retries so far.\n * @return {number} Time in ms before firing next retry request.\n * @private\n */\nWebChannelBase.prototype.getRetryTime_ = function(retryCount) {\n  'use strict';\n  let retryTime = this.baseRetryDelayMs_ +\n      Math.floor(Math.random() * this.retryDelaySeedMs_);\n  if (!this.isActive()) {\n    this.channelDebug_.debug('Inactive channel');\n    retryTime = retryTime * WebChannelBase.INACTIVE_CHANNEL_RETRY_FACTOR;\n  }\n  // Backoff for subsequent retries\n  retryTime *= retryCount;\n  return retryTime;\n};\n\n\n/**\n * @param {number} baseDelayMs The base part of the retry delay, in ms.\n * @param {number} delaySeedMs A random delay between 0 and this is added to\n *     the base part.\n */\nWebChannelBase.prototype.setRetryDelay = function(baseDelayMs, delaySeedMs) {\n  'use strict';\n  this.baseRetryDelayMs_ = baseDelayMs;\n  this.retryDelaySeedMs_ = delaySeedMs;\n};\n\n\n/**\n * Apply any handshake control headers.\n * @param {!ChannelRequest} request The underlying request object\n * @private\n */\nWebChannelBase.prototype.applyControlHeaders_ = function(request) {\n  'use strict';\n  const xhr = request.getXhr();\n  if (xhr) {\n    const clientProtocol =\n        xhr.getStreamingResponseHeader(WebChannel.X_CLIENT_WIRE_PROTOCOL);\n    if (clientProtocol) {\n      this.forwardChannelRequestPool_.applyClientProtocol(clientProtocol);\n    }\n\n    if (this.getHttpSessionIdParam()) {\n      const httpSessionIdHeader =\n          xhr.getStreamingResponseHeader(WebChannel.X_HTTP_SESSION_ID);\n      if (httpSessionIdHeader) {\n        this.setHttpSessionId(httpSessionIdHeader);\n        // update the cached uri\n        const httpSessionIdParam = this.getHttpSessionIdParam();\n\n        this.forwardChannelUri_.setParameterValue(\n            /** @type {string} */ (httpSessionIdParam),  // never null\n            httpSessionIdHeader);\n      } else {\n        this.channelDebug_.warning(\n            'Missing X_HTTP_SESSION_ID in the handshake response');\n      }\n    }\n  }\n};\n\n\n/**\n * Processes the data returned by the server.\n * @param {!Array<!Array<?>>} respArray The response array returned\n *     by the server.\n * @param {!ChannelRequest} request The underlying request object\n * @private\n */\nWebChannelBase.prototype.onInput_ = function(respArray, request) {\n  'use strict';\n  const batch =\n      this.handler_ && this.handler_.channelHandleMultipleArrays ? [] : null;\n  for (let i = 0; i < respArray.length; i++) {\n    let nextArray = respArray[i];\n    this.lastArrayId_ = nextArray[0];\n    nextArray = nextArray[1];\n    if (this.state_ == WebChannelBase.State.OPENING) {\n      if (nextArray[0] == 'c') {\n        this.sid_ = nextArray[1];\n        this.hostPrefix_ = this.correctHostPrefix(nextArray[2]);\n\n        const negotiatedVersion = nextArray[3];\n        if (negotiatedVersion != null) {\n          this.channelVersion_ = negotiatedVersion;\n          this.channelDebug_.info('VER=' + this.channelVersion_);\n        }\n\n        const negotiatedServerVersion = nextArray[4];\n        if (negotiatedServerVersion != null) {\n          this.serverVersion_ = negotiatedServerVersion;\n          this.channelDebug_.info('SVER=' + this.serverVersion_);\n        }\n\n        // CVER=22\n        const serverKeepaliveMs = nextArray[5];\n        if (serverKeepaliveMs != null &&\n            typeof serverKeepaliveMs === 'number' && serverKeepaliveMs > 0) {\n          const timeout = 1.5 * serverKeepaliveMs;\n          this.backChannelRequestTimeoutMs_ = timeout;\n          this.channelDebug_.info('backChannelRequestTimeoutMs_=' + timeout);\n        }\n\n        this.applyControlHeaders_(request);\n\n        this.state_ = WebChannelBase.State.OPENED;\n        if (this.handler_) {\n          this.handler_.channelOpened(this);\n        }\n\n        if (this.detectBufferingProxy_) {\n          this.handshakeRttMs_ = Date.now() - request.getRequestStartTime();\n          this.channelDebug_.info(\n              'Handshake RTT: ' + this.handshakeRttMs_ + 'ms');\n        }\n\n        this.startBackchannelAfterHandshake_(request);\n\n        if (this.outgoingMaps_.length > 0) {\n          this.ensureForwardChannel_();\n        }\n      } else if (nextArray[0] == 'stop' || nextArray[0] == 'close') {\n        // treat close also as an abort\n        this.signalError_(WebChannelBase.Error.STOP);\n      }\n    } else if (this.state_ == WebChannelBase.State.OPENED) {\n      if (nextArray[0] == 'stop' || nextArray[0] == 'close') {\n        if (batch && !goog.array.isEmpty(batch)) {\n          this.handler_.channelHandleMultipleArrays(this, batch);\n          batch.length = 0;\n        }\n        if (nextArray[0] == 'stop') {\n          this.signalError_(WebChannelBase.Error.STOP);\n        } else {\n          this.disconnect();\n        }\n      } else if (nextArray[0] == 'noop') {\n        // ignore - noop to keep connection happy\n      } else {\n        if (batch) {\n          batch.push(nextArray);\n        } else if (this.handler_) {\n          this.handler_.channelHandleArray(this, nextArray);\n        }\n      }\n      // We have received useful data on the back-channel, so clear its retry\n      // count. We do this because back-channels by design do not complete\n      // quickly, so on a flaky connection we could have many fail to complete\n      // fully but still deliver a lot of data before they fail. We don't want\n      // to count such failures towards the retry limit, because we don't want\n      // to give up on a session if we can still receive data.\n      this.backChannelRetryCount_ = 0;\n    }\n  }\n  if (batch && !goog.array.isEmpty(batch)) {\n    this.handler_.channelHandleMultipleArrays(this, batch);\n  }\n};\n\n\n/**\n * Starts the backchannel after the handshake.\n *\n * @param {!ChannelRequest} request The underlying request object\n * @private\n */\nWebChannelBase.prototype.startBackchannelAfterHandshake_ = function(request) {\n  'use strict';\n  this.backChannelUri_ = this.getBackChannelUri(\n      this.hostPrefix_, /** @type {string} */ (this.path_));\n\n  if (request.isInitialResponseDecoded()) {\n    this.channelDebug_.debug('Upgrade the handshake request to a backchannel.');\n    this.forwardChannelRequestPool_.removeRequest(request);\n    request.resetTimeout(this.backChannelRequestTimeoutMs_);\n    this.backChannelRequest_ = request;\n  } else {\n    this.ensureBackChannel_();\n  }\n};\n\n\n/**\n * Helper to ensure the channel is in the expected state.\n * @param {...number} var_args The channel must be in one of the indicated\n *     states.\n * @private\n */\nWebChannelBase.prototype.ensureInState_ = function(var_args) {\n  'use strict';\n  goog.asserts.assert(\n      goog.array.contains(arguments, this.state_),\n      'Unexpected channel state: %s', this.state_);\n};\n\n\n/**\n * Signals an error has occurred.\n * @param {WebChannelBase.Error} error The error code for the failure.\n * @private\n */\nWebChannelBase.prototype.signalError_ = function(error) {\n  'use strict';\n  this.channelDebug_.info('Error code ' + error);\n  if (error == WebChannelBase.Error.REQUEST_FAILED) {\n    // Create a separate Internet connection to check\n    // if it's a server error or user's network error.\n    let imageUri = null;\n    if (this.handler_) {\n      imageUri = this.handler_.getNetworkTestImageUri(this);\n    }\n    netUtils.testNetwork(goog.bind(this.testNetworkCallback_, this), imageUri);\n  } else {\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_OTHER);\n  }\n  this.onError_(error);\n};\n\n\n/**\n * Callback for netUtils.testNetwork during error handling.\n * @param {boolean} networkUp Whether the network is up.\n * @private\n */\nWebChannelBase.prototype.testNetworkCallback_ = function(networkUp) {\n  'use strict';\n  if (networkUp) {\n    this.channelDebug_.info('Successfully pinged google.com');\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_OTHER);\n  } else {\n    this.channelDebug_.info('Failed to ping google.com');\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_NETWORK);\n    // Do not call onError_ again to eliminate duplicated Error events.\n  }\n};\n\n\n/**\n * Called when messages have been successfully sent from the queue.\n * @param {!ChannelRequest} request The request object\n * @private\n */\nWebChannelBase.prototype.onSuccess_ = function(request) {\n  'use strict';\n  if (this.handler_) {\n    this.handler_.channelSuccess(this, request);\n  }\n};\n\n\n/**\n * Called when we've determined the final error for a channel. It closes the\n * notifiers the handler of the error and closes the channel.\n * @param {WebChannelBase.Error} error  The error code for the failure.\n * @private\n */\nWebChannelBase.prototype.onError_ = function(error) {\n  'use strict';\n  this.channelDebug_.debug('HttpChannel: error - ' + error);\n  this.state_ = WebChannelBase.State.CLOSED;\n  if (this.handler_) {\n    this.handler_.channelError(this, error);\n  }\n  this.onClose_();\n  this.cancelRequests_();\n};\n\n\n/**\n * Called when the channel has been closed. It notifiers the handler of the\n * event, and reports any pending or undelivered maps.\n * @private\n */\nWebChannelBase.prototype.onClose_ = function() {\n  'use strict';\n  this.state_ = WebChannelBase.State.CLOSED;\n  this.lastStatusCode_ = -1;\n  if (this.handler_) {\n    const pendingMessages =\n        this.forwardChannelRequestPool_.getPendingMessages();\n\n    if (pendingMessages.length == 0 && this.outgoingMaps_.length == 0) {\n      this.handler_.channelClosed(this);\n    } else {\n      const self = this;\n      this.channelDebug_.debug(function() {\n        'use strict';\n        return 'Number of undelivered maps' +\n            ', pending: ' + pendingMessages.length +\n            ', outgoing: ' + self.outgoingMaps_.length;\n      });\n\n      this.forwardChannelRequestPool_.clearPendingMessages();\n\n      const copyOfUndeliveredMaps = goog.array.clone(this.outgoingMaps_);\n      this.outgoingMaps_.length = 0;\n\n      this.handler_.channelClosed(this, pendingMessages, copyOfUndeliveredMaps);\n    }\n  }\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getForwardChannelUri = function(path) {\n  'use strict';\n  const uri = this.createDataUri(null, path);\n  this.channelDebug_.debug('GetForwardChannelUri: ' + uri);\n  return uri;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getConnectionState = function() {\n  'use strict';\n  return this.connState_;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getBackChannelUri = function(hostPrefix, path) {\n  'use strict';\n  const uri = this.createDataUri(\n      this.shouldUseSecondaryDomains() ? hostPrefix : null, path);\n  this.channelDebug_.debug('GetBackChannelUri: ' + uri);\n  return uri;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.createDataUri = function(\n    hostPrefix, path, opt_overridePort) {\n  'use strict';\n  let uri = goog.Uri.parse(path);\n  const uriAbsolute = (uri.getDomain() != '');\n  if (uriAbsolute) {\n    if (hostPrefix) {\n      uri.setDomain(hostPrefix + '.' + uri.getDomain());\n    }\n\n    uri.setPort(opt_overridePort || uri.getPort());\n  } else {\n    const locationPage = goog.global.location;\n    let hostName;\n    if (hostPrefix) {\n      hostName = hostPrefix + '.' + locationPage.hostname;\n    } else {\n      hostName = locationPage.hostname;\n    }\n\n    const port = opt_overridePort || +locationPage.port;\n\n    uri = goog.Uri.create(locationPage.protocol, null, hostName, port, path);\n  }\n\n  if (this.extraParams_) {\n    goog.object.forEach(this.extraParams_, function(value, key) {\n      'use strict';\n      uri.setParameterValue(key, value);\n    });\n  }\n\n  const param = this.getHttpSessionIdParam();\n  const value = this.getHttpSessionId();\n  if (param && value) {\n    uri.setParameterValue(param, value);\n  }\n\n  // Add the protocol version to the URI.\n  uri.setParameterValue('VER', this.channelVersion_);\n\n  // Add the reconnect parameters.\n  this.addAdditionalParams_(uri);\n\n  return uri;\n};\n\n/**\n * @override\n * @param {?string} hostPrefix The host prefix, if we need an XhrIo object\n *     capable of calling a secondary domain.\n * @param {boolean=} isStreaming Whether or not fetch/streams are enabled for\n *     the underlying HTTP request.\n * @return {!goog.net.XhrIo} A new XhrIo object.\n */\nWebChannelBase.prototype.createXhrIo = function(hostPrefix, isStreaming) {\n  'use strict';\n  if (hostPrefix && !this.supportsCrossDomainXhrs_) {\n    throw new Error('Can\\'t create secondary domain capable XhrIo object.');\n  }\n  let xhr;\n  if (isStreaming && this.usesFetchStreams_ && !this.xmlHttpFactory_) {\n    xhr = new goog.net.XhrIo(\n        new goog.net.FetchXmlHttpFactory({streamBinaryChunks: true}));\n  } else {\n    xhr = new goog.net.XhrIo(this.xmlHttpFactory_);\n  }\n  xhr.setWithCredentials(this.supportsCrossDomainXhrs_);\n  return xhr;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.isActive = function() {\n  'use strict';\n  return !!this.handler_ && this.handler_.isActive(this);\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.shouldUseSecondaryDomains = function() {\n  'use strict';\n  return this.supportsCrossDomainXhrs_;\n};\n\n\n/**\n * Sets (overwrites) the forward channel flush callback.\n *\n * @param {function()} callback The callback to be invoked.\n */\nWebChannelBase.prototype.setForwardChannelFlushCallback = function(callback) {\n  'use strict';\n  this.forwardChannelFlushedCallback_ = callback;\n};\n\n\n/**\n * Abstract base class for the channel handler\n * @constructor\n * @struct\n */\nWebChannelBase.Handler = function() {};\n\n\n/**\n * Callback handler for when a batch of response arrays is received from the\n * server. When null, batched dispatching is disabled.\n * @type {?function(!WebChannelBase, !Array<!Array<?>>)}\n */\nWebChannelBase.Handler.prototype.channelHandleMultipleArrays = null;\n\n\n/**\n * Whether it's okay to make a request to the server. A handler can return\n * false if the channel should fail. For example, if the user has logged out,\n * the handler may want all requests to fail immediately.\n * @param {WebChannelBase} channel The channel.\n * @return {WebChannelBase.Error} An error code. The code should\n * return WebChannelBase.Error.OK to indicate it's okay. Any other\n * error code will cause a failure.\n */\nWebChannelBase.Handler.prototype.okToMakeRequest = function(channel) {\n  'use strict';\n  return WebChannelBase.Error.OK;\n};\n\n\n/**\n * Indicates the WebChannel has successfully negotiated with the server\n * and can now send and receive data.\n * @param {WebChannelBase} channel The channel.\n */\nWebChannelBase.Handler.prototype.channelOpened = function(channel) {};\n\n\n/**\n * New input is available for the application to process.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {Array<?>} array The data array.\n */\nWebChannelBase.Handler.prototype.channelHandleArray = function(\n    channel, array) {};\n\n\n/**\n * Indicates messages that have been successfully sent on the channel.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {!ChannelRequest} request The request object that contains\n *     the pending messages that have been successfully delivered to the server.\n */\nWebChannelBase.Handler.prototype.channelSuccess = function(channel, request) {};\n\n\n/**\n * Indicates an error occurred on the WebChannel.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {WebChannelBase.Error} error The error code.\n */\nWebChannelBase.Handler.prototype.channelError = function(channel, error) {};\n\n\n/**\n * Indicates the WebChannel is closed. Also notifies about which maps,\n * if any, that may not have been delivered to the server.\n * @param {WebChannelBase} channel The channel.\n * @param {Array<Wire.QueuedMap>=} opt_pendingMaps The\n *     array of pending maps, which may or may not have been delivered to the\n *     server.\n * @param {Array<Wire.QueuedMap>=} opt_undeliveredMaps\n *     The array of undelivered maps, which have definitely not been delivered\n *     to the server.\n */\nWebChannelBase.Handler.prototype.channelClosed = function(\n    channel, opt_pendingMaps, opt_undeliveredMaps) {};\n\n\n/**\n * Gets any parameters that should be added at the time another connection is\n * made to the server.\n * @param {WebChannelBase} channel The channel.\n * @return {!Object} Extra parameter keys and values to add to the requests.\n */\nWebChannelBase.Handler.prototype.getAdditionalParams = function(channel) {\n  'use strict';\n  return {};\n};\n\n\n/**\n * Gets the URI of an image that can be used to test network connectivity.\n * @param {WebChannelBase} channel The channel.\n * @return {goog.Uri?} A custom URI to load for the network test.\n */\nWebChannelBase.Handler.prototype.getNetworkTestImageUri = function(channel) {\n  'use strict';\n  return null;\n};\n\n\n/**\n * Gets whether this channel is currently active. This is used to determine the\n * length of time to wait before retrying.\n * @param {WebChannelBase} channel The channel.\n * @return {boolean} Whether the channel is currently active.\n */\nWebChannelBase.Handler.prototype.isActive = function(channel) {\n  'use strict';\n  return true;\n};\n\n/**\n * Whether or not this channel uses WHATWG Fetch/streams.\n * @override\n * @return {boolean}\n */\nWebChannelBase.prototype.usesFetchStreams = function() {\n  'use strict';\n  return this.usesFetchStreams_;\n};\n\n\n/**\n * Called by the channel if enumeration of the map throws an exception.\n * @param {WebChannelBase} channel The channel.\n * @param {Object} map The map that can't be enumerated.\n */\nWebChannelBase.Handler.prototype.badMapError = function(channel, map) {};\n\n\n/**\n * Allows the handler to override a host prefix provided by the server. Will\n * be called whenever the channel has received such a prefix and is considering\n * its use.\n * @param {?string} serverHostPrefix The host prefix provided by the server.\n * @return {?string} The host prefix the client should use.\n */\nWebChannelBase.Handler.prototype.correctHostPrefix = function(\n    serverHostPrefix) {\n  'use strict';\n  return serverHostPrefix;\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * This package is deprecated in favour of the Closure URL package (goog.url)\n * when manipulating URIs for use by a browser. This package uses regular\n * expressions to parse a potential URI which can fall out of sync with how a\n * browser will actually interpret the URI. See\n * `goog.uri.utils.setUrlPackageSupportLoggingHandler` for one way to identify\n * URIs that should instead be parsed using the URL package.\n *\n * Use goog.Uri(string) to parse a URI string.  Use goog.Uri.create(...) to\n * create a new instance of the goog.Uri object from Uri parts.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.string');\ngoog.require('goog.structs');\ngoog.require('goog.structs.Map');\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\ngoog.require('goog.uri.utils.StandardQueryParam');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>goog.Uri.parse('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>goog.Uri.parse('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string.  The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>goog.Uri.parse('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse\n *        (use goog.Uri.create() to create a URI from parts), or if\n *        a goog.Uri is passed, a clone is created.\n * @param {boolean=} opt_ignoreCase If true, #getParameterValue will ignore\n * the case of the parameter name.\n *\n * @throws URIError If opt_uri is provided and URI is malformed (that is,\n *     if decodeURIComponent fails on any of the URI components).\n * @constructor\n * @struct\n */\ngoog.Uri = function(opt_uri, opt_ignoreCase) {\n  'use strict';\n  /**\n   * Scheme such as \"http\".\n   * @private {string}\n   */\n  this.scheme_ = '';\n\n  /**\n   * User credentials in the form \"username:password\".\n   * @private {string}\n   */\n  this.userInfo_ = '';\n\n  /**\n   * Domain part, e.g. \"www.google.com\".\n   * @private {string}\n   */\n  this.domain_ = '';\n\n  /**\n   * Port, e.g. 8080.\n   * @private {?number}\n   */\n  this.port_ = null;\n\n  /**\n   * Path, e.g. \"/tests/img.png\".\n   * @private {string}\n   */\n  this.path_ = '';\n\n  /**\n   * The fragment without the #.\n   * @private {string}\n   */\n  this.fragment_ = '';\n\n  /**\n   * Whether or not this Uri should be treated as Read Only.\n   * @private {boolean}\n   */\n  this.isReadOnly_ = false;\n\n  /**\n   * Whether or not to ignore case when comparing query params.\n   * @private {boolean}\n   */\n  this.ignoreCase_ = false;\n\n  /**\n   * Object representing query data.\n   * @private {!goog.Uri.QueryData}\n   */\n  this.queryData_;\n\n  // Parse in the uri string\n  var m;\n  if (opt_uri instanceof goog.Uri) {\n    this.ignoreCase_ = (opt_ignoreCase !== undefined) ? opt_ignoreCase :\n                                                        opt_uri.getIgnoreCase();\n    this.setScheme(opt_uri.getScheme());\n    this.setUserInfo(opt_uri.getUserInfo());\n    this.setDomain(opt_uri.getDomain());\n    this.setPort(opt_uri.getPort());\n    this.setPath(opt_uri.getPath());\n    this.setQueryData(opt_uri.getQueryData().clone());\n    this.setFragment(opt_uri.getFragment());\n  } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n    this.ignoreCase_ = !!opt_ignoreCase;\n\n    // Set the parts -- decoding as we do so.\n    // COMPATIBILITY NOTE - In IE, unmatched fields may be empty strings,\n    // whereas in other browsers they will be undefined.\n    this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n    this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n    this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n    this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n    this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n    this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n    this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n\n  } else {\n    this.ignoreCase_ = !!opt_ignoreCase;\n    this.queryData_ = new goog.Uri.QueryData(null, this.ignoreCase_);\n  }\n};\n\n\n/**\n * Parameter name added to stop caching.\n * @type {string}\n */\ngoog.Uri.RANDOM_PARAM = goog.uri.utils.StandardQueryParam.RANDOM;\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n  'use strict';\n  var out = [];\n\n  var scheme = this.getScheme();\n  if (scheme) {\n    out.push(\n        goog.Uri.encodeSpecialChars_(\n            scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true),\n        ':');\n  }\n\n  var domain = this.getDomain();\n  if (domain || scheme == 'file') {\n    out.push('//');\n\n    var userInfo = this.getUserInfo();\n    if (userInfo) {\n      out.push(\n          goog.Uri.encodeSpecialChars_(\n              userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true),\n          '@');\n    }\n\n    out.push(goog.Uri.removeDoubleEncoding_(goog.string.urlEncode(domain)));\n\n    var port = this.getPort();\n    if (port != null) {\n      out.push(':', String(port));\n    }\n  }\n\n  var path = this.getPath();\n  if (path) {\n    if (this.hasDomain() && path.charAt(0) != '/') {\n      out.push('/');\n    }\n    out.push(goog.Uri.encodeSpecialChars_(\n        path,\n        path.charAt(0) == '/' ? goog.Uri.reDisallowedInAbsolutePath_ :\n                                goog.Uri.reDisallowedInRelativePath_,\n        true));\n  }\n\n  var query = this.getEncodedQuery();\n  if (query) {\n    out.push('?', query);\n  }\n\n  var fragment = this.getFragment();\n  if (fragment) {\n    out.push(\n        '#',\n        goog.Uri.encodeSpecialChars_(\n            fragment, goog.Uri.reDisallowedInFragment_));\n  }\n  return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on.  foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {!goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n  'use strict';\n  var absoluteUri = this.clone();\n\n  // we satisfy these conditions by looking for the first part of relativeUri\n  // that is not blank and applying defaults to the rest\n\n  var overridden = relativeUri.hasScheme();\n\n  if (overridden) {\n    absoluteUri.setScheme(relativeUri.getScheme());\n  } else {\n    overridden = relativeUri.hasUserInfo();\n  }\n\n  if (overridden) {\n    absoluteUri.setUserInfo(relativeUri.getUserInfo());\n  } else {\n    overridden = relativeUri.hasDomain();\n  }\n\n  if (overridden) {\n    absoluteUri.setDomain(relativeUri.getDomain());\n  } else {\n    overridden = relativeUri.hasPort();\n  }\n\n  var path = relativeUri.getPath();\n  if (overridden) {\n    absoluteUri.setPort(relativeUri.getPort());\n  } else {\n    overridden = relativeUri.hasPath();\n    if (overridden) {\n      // resolve path properly\n      if (path.charAt(0) != '/') {\n        // path is relative\n        if (this.hasDomain() && !this.hasPath()) {\n          // RFC 3986, section 5.2.3, case 1\n          path = '/' + path;\n        } else {\n          // RFC 3986, section 5.2.3, case 2\n          var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n          if (lastSlashIndex != -1) {\n            path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path;\n          }\n        }\n      }\n      path = goog.Uri.removeDotSegments(path);\n    }\n  }\n\n  if (overridden) {\n    absoluteUri.setPath(path);\n  } else {\n    overridden = relativeUri.hasQuery();\n  }\n\n  if (overridden) {\n    absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n  } else {\n    overridden = relativeUri.hasFragment();\n  }\n\n  if (overridden) {\n    absoluteUri.setFragment(relativeUri.getFragment());\n  }\n\n  return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n  'use strict';\n  return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n  'use strict';\n  return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @throws URIError If opt_decode is true and newScheme is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.scheme_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) : newScheme;\n\n  // remove an : at the end of the scheme so somebody can pass in\n  // window.location.protocol\n  if (this.scheme_) {\n    this.scheme_ = this.scheme_.replace(/:$/, '');\n  }\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n  'use strict';\n  return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n  'use strict';\n  return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @throws URIError If opt_decode is true and newUserInfo is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.userInfo_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) : newUserInfo;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n  'use strict';\n  return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n  'use strict';\n  return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @throws URIError If opt_decode is true and newDomain is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.domain_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) : newDomain;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n  'use strict';\n  return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n  'use strict';\n  return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (newPort) {\n    newPort = Number(newPort);\n    if (isNaN(newPort) || newPort < 0) {\n      throw new Error('Bad port number ' + newPort);\n    }\n    this.port_ = newPort;\n  } else {\n    this.port_ = null;\n  }\n\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n  'use strict';\n  return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n  'use strict';\n  return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @throws URIError If opt_decode is true and newPath is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n  'use strict';\n  return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n  'use strict';\n  return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n *     Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (queryData instanceof goog.Uri.QueryData) {\n    this.queryData_ = queryData;\n    this.queryData_.setIgnoreCase(this.ignoreCase_);\n  } else {\n    if (!opt_decode) {\n      // QueryData accepts encoded query string, so encode it if\n      // opt_decode flag is not true.\n      queryData = goog.Uri.encodeSpecialChars_(\n          queryData, goog.Uri.reDisallowedInQuery_);\n    }\n    this.queryData_ = new goog.Uri.QueryData(queryData, this.ignoreCase_);\n  }\n\n  return this;\n};\n\n\n/**\n * Sets the URI query.\n * @param {string} newQuery New query value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQuery = function(newQuery, opt_decode) {\n  'use strict';\n  return this.setQueryData(newQuery, opt_decode);\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n  'use strict';\n  return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n  'use strict';\n  return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n  'use strict';\n  return this.queryData_;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n *\n * Warning: This method, unlike other getter methods, returns encoded\n * value, instead of decoded one.\n */\ngoog.Uri.prototype.getQuery = function() {\n  'use strict';\n  return this.getEncodedQuery();\n};\n\n\n/**\n * Sets the value of the named query parameters, clearing previous values for\n * that key.\n *\n * @param {string} key The parameter to set.\n * @param {*} value The new value. Value does not need to be encoded.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setParameterValue = function(key, value) {\n  'use strict';\n  this.enforceReadOnly();\n  this.queryData_.set(key, value);\n  return this;\n};\n\n\n/**\n * Sets the values of the named query parameters, clearing previous values for\n * that key.  Not new values will currently be moved to the end of the query\n * string.\n *\n * So, <code>goog.Uri.parse('foo?a=b&c=d&e=f').setParameterValues('c', ['new'])\n * </code> yields <tt>foo?a=b&e=f&c=new</tt>.</p>\n *\n * @param {string} key The parameter to set.\n * @param {*} values The new values. If values is a single\n *     string then it will be treated as the sole value. Values do not need to\n *     be encoded.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setParameterValues = function(key, values) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (!Array.isArray(values)) {\n    values = [String(values)];\n  }\n\n  this.queryData_.setValues(key, values);\n\n  return this;\n};\n\n\n/**\n * Returns the value<b>s</b> for a given cgi parameter as a list of decoded\n * query parameter values.\n * @param {string} name The parameter to get values for.\n * @return {!Array<?>} The values for a given cgi parameter as a list of\n *     decoded query parameter values.\n */\ngoog.Uri.prototype.getParameterValues = function(name) {\n  'use strict';\n  return this.queryData_.getValues(name);\n};\n\n\n/**\n * Returns the first value for a given cgi parameter or undefined if the given\n * parameter name does not appear in the query string.\n * @param {string} paramName Unescaped parameter name.\n * @return {string|undefined} The first value for a given cgi parameter or\n *     undefined if the given parameter name does not appear in the query\n *     string.\n */\ngoog.Uri.prototype.getParameterValue = function(paramName) {\n  'use strict';\n  return /** @type {string|undefined} */ (this.queryData_.get(paramName));\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n  'use strict';\n  return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @throws URIError If opt_decode is true and newFragment is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.fragment_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) : newFragment;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n  'use strict';\n  return !!this.fragment_;\n};\n\n\n/**\n * Returns true if this has the same domain as that of uri2.\n * @param {!goog.Uri} uri2 The URI object to compare to.\n * @return {boolean} true if same domain; false otherwise.\n */\ngoog.Uri.prototype.hasSameDomainAs = function(uri2) {\n  'use strict';\n  return ((!this.hasDomain() && !uri2.hasDomain()) ||\n          this.getDomain() == uri2.getDomain()) &&\n      ((!this.hasPort() && !uri2.hasPort()) ||\n       this.getPort() == uri2.getPort());\n};\n\n\n/**\n * Adds a random parameter to the Uri.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.makeUnique = function() {\n  'use strict';\n  this.enforceReadOnly();\n  this.setParameterValue(goog.Uri.RANDOM_PARAM, goog.string.getRandomString());\n\n  return this;\n};\n\n\n/**\n * Removes the named query parameter.\n *\n * @param {string} key The parameter to remove.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.removeParameter = function(key) {\n  'use strict';\n  this.enforceReadOnly();\n  this.queryData_.remove(key);\n  return this;\n};\n\n\n/**\n * Sets whether Uri is read only. If this goog.Uri is read-only,\n * enforceReadOnly_ will be called at the start of any function that may modify\n * this Uri.\n * @param {boolean} isReadOnly whether this goog.Uri should be read only.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.setReadOnly = function(isReadOnly) {\n  'use strict';\n  this.isReadOnly_ = isReadOnly;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI is read only.\n */\ngoog.Uri.prototype.isReadOnly = function() {\n  'use strict';\n  return this.isReadOnly_;\n};\n\n\n/**\n * Checks if this Uri has been marked as read only, and if so, throws an error.\n * This should be called whenever any modifying function is called.\n */\ngoog.Uri.prototype.enforceReadOnly = function() {\n  'use strict';\n  if (this.isReadOnly_) {\n    throw new Error('Tried to modify a read-only Uri');\n  }\n};\n\n\n/**\n * Sets whether to ignore case.\n * NOTE: If there are already key/value pairs in the QueryData, and\n * ignoreCase_ is set to false, the keys will all be lower-cased.\n * @param {boolean} ignoreCase whether this goog.Uri should ignore case.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.setIgnoreCase = function(ignoreCase) {\n  'use strict';\n  this.ignoreCase_ = ignoreCase;\n  if (this.queryData_) {\n    this.queryData_.setIgnoreCase(ignoreCase);\n  }\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether to ignore case.\n */\ngoog.Uri.prototype.getIgnoreCase = function() {\n  'use strict';\n  return this.ignoreCase_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Creates a uri from the string form.  Basically an alias of new goog.Uri().\n * If a Uri object is passed to parse then it will return a clone of the object.\n *\n * @throws URIError If parsing the URI is malformed. The passed URI components\n *     should all be parseable by decodeURIComponent.\n * @param {*} uri Raw URI string or instance of Uri\n *     object.\n * @param {boolean=} opt_ignoreCase Whether to ignore the case of parameter\n * names in #getParameterValue.\n * @return {!goog.Uri} The new URI object.\n */\ngoog.Uri.parse = function(uri, opt_ignoreCase) {\n  'use strict';\n  return uri instanceof goog.Uri ? uri.clone() :\n                                   new goog.Uri(uri, opt_ignoreCase);\n};\n\n\n/**\n * Creates a new goog.Uri object from unencoded parts.\n *\n * @param {?string=} opt_scheme Scheme/protocol or full URI to parse.\n * @param {?string=} opt_userInfo username:password.\n * @param {?string=} opt_domain www.google.com.\n * @param {?number=} opt_port 9830.\n * @param {?string=} opt_path /some/path/to/a/file.html.\n * @param {string|goog.Uri.QueryData=} opt_query a=1&b=2.\n * @param {?string=} opt_fragment The fragment without the #.\n * @param {boolean=} opt_ignoreCase Whether to ignore parameter name case in\n *     #getParameterValue.\n *\n * @return {!goog.Uri} The new URI object.\n */\ngoog.Uri.create = function(\n    opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_query,\n    opt_fragment, opt_ignoreCase) {\n  'use strict';\n  var uri = new goog.Uri(null, opt_ignoreCase);\n\n  // Only set the parts if they are defined and not empty strings.\n  opt_scheme && uri.setScheme(opt_scheme);\n  opt_userInfo && uri.setUserInfo(opt_userInfo);\n  opt_domain && uri.setDomain(opt_domain);\n  opt_port && uri.setPort(opt_port);\n  opt_path && uri.setPath(opt_path);\n  opt_query && uri.setQueryData(opt_query);\n  opt_fragment && uri.setFragment(opt_fragment);\n\n  return uri;\n};\n\n\n/**\n * Resolves a relative Uri against a base Uri, accepting both strings and\n * Uri objects.\n *\n * @param {*} base Base Uri.\n * @param {*} rel Relative Uri.\n * @return {!goog.Uri} Resolved uri.\n */\ngoog.Uri.resolve = function(base, rel) {\n  'use strict';\n  if (!(base instanceof goog.Uri)) {\n    base = goog.Uri.parse(base);\n  }\n\n  if (!(rel instanceof goog.Uri)) {\n    rel = goog.Uri.parse(rel);\n  }\n\n  return base.resolve(rel);\n};\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n  'use strict';\n  if (path == '..' || path == '.') {\n    return '';\n\n  } else if (\n      !goog.string.contains(path, './') && !goog.string.contains(path, '/.')) {\n    // This optimization detects uris which do not contain dot-segments,\n    // and as a consequence do not require any processing.\n    return path;\n\n  } else {\n    var leadingSlash = goog.string.startsWith(path, '/');\n    var segments = path.split('/');\n    var out = [];\n\n    for (var pos = 0; pos < segments.length;) {\n      var segment = segments[pos++];\n\n      if (segment == '.') {\n        if (leadingSlash && pos == segments.length) {\n          out.push('');\n        }\n      } else if (segment == '..') {\n        if (out.length > 1 || out.length == 1 && out[0] != '') {\n          out.pop();\n        }\n        if (leadingSlash && pos == segments.length) {\n          out.push('');\n        }\n      } else {\n        out.push(segment);\n        leadingSlash = true;\n      }\n    }\n\n    return out.join('/');\n  }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @throws URIError If decodeURIComponent fails to decode val.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n *     not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n  'use strict';\n  // Don't use UrlDecode() here because val is not a query parameter.\n  if (!val) {\n    return '';\n  }\n\n  // decodeURI has the same output for '%2f' and '%252f'. We double encode %25\n  // so that we can distinguish between the 2 inputs. This is later undone by\n  // removeDoubleEncoding_.\n  return opt_preserveReserved ? decodeURI(val.replace(/%25/g, '%2525')) :\n                                decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n *     encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(\n    unescapedPart, extra, opt_removeDoubleEncoding) {\n  'use strict';\n  if (typeof unescapedPart === 'string') {\n    var encoded = encodeURI(unescapedPart).replace(extra, goog.Uri.encodeChar_);\n    if (opt_removeDoubleEncoding) {\n      // encodeURI double-escapes %XX sequences used to represent restricted\n      // characters in some URI components, remove the double escaping here.\n      encoded = goog.Uri.removeDoubleEncoding_(encoded);\n    }\n    return encoded;\n  }\n  return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n  'use strict';\n  var n = ch.charCodeAt(0);\n  return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param  {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n  'use strict';\n  return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n/**\n * Checks whether two URIs have the same domain.\n * @param {string} uri1String First URI string.\n * @param {string} uri2String Second URI string.\n * @return {boolean} true if the two URIs have the same domain; false otherwise.\n */\ngoog.Uri.haveSameDomain = function(uri1String, uri2String) {\n  'use strict';\n  // Differs from goog.uri.utils.haveSameDomain, since this ignores scheme.\n  // TODO(gboyer): Have this just call goog.uri.util.haveSameDomain.\n  var pieces1 = goog.uri.utils.split(uri1String);\n  var pieces2 = goog.uri.utils.split(uri2String);\n  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] ==\n      pieces2[goog.uri.utils.ComponentIndex.DOMAIN] &&\n      pieces1[goog.uri.utils.ComponentIndex.PORT] ==\n      pieces2[goog.uri.utils.ComponentIndex.PORT];\n};\n\n\n\n/**\n * Class used to represent URI query parameters.  It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n *     the object.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @constructor\n * @struct\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_ignoreCase) {\n  'use strict';\n  /**\n   * The map containing name/value or name/array-of-values pairs.\n   * May be null if it requires parsing from the query string.\n   *\n   * We need to use a Map because we cannot guarantee that the key names will\n   * not be problematic for IE.\n   *\n   * @private {?goog.structs.Map<string, !Array<*>>}\n   */\n  this.keyMap_ = null;\n\n  /**\n   * The number of params, or null if it requires computing.\n   * @private {?number}\n   */\n  this.count_ = null;\n\n  /**\n   * Encoded query string, or null if it requires computing from the key map.\n   * @private {?string}\n   */\n  this.encodedQuery_ = opt_query || null;\n\n  /**\n   * If true, ignore the case of the parameter name in #get.\n   * @private {boolean}\n   */\n  this.ignoreCase_ = !!opt_ignoreCase;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n  'use strict';\n  if (!this.keyMap_) {\n    this.keyMap_ = new goog.structs.Map();\n    this.count_ = 0;\n    if (this.encodedQuery_) {\n      var self = this;\n      goog.uri.utils.parseQueryData(this.encodedQuery_, function(name, value) {\n        'use strict';\n        self.add(goog.string.urlDecode(name), value);\n      });\n    }\n  }\n};\n\n\n/**\n * Creates a new query data instance from a map of names and values.\n *\n * @param {!goog.structs.Map<string, ?>|!Object} map Map of string parameter\n *     names to parameter value. If parameter value is an array, it is\n *     treated as if the key maps to each individual value in the\n *     array.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @return {!goog.Uri.QueryData} The populated query data instance.\n */\ngoog.Uri.QueryData.createFromMap = function(map, opt_ignoreCase) {\n  'use strict';\n  var keys = goog.structs.getKeys(map);\n  if (typeof keys == 'undefined') {\n    throw new Error('Keys are undefined');\n  }\n\n  var queryData = new goog.Uri.QueryData(null, opt_ignoreCase);\n  var values = goog.structs.getValues(map);\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    var value = values[i];\n    if (!Array.isArray(value)) {\n      queryData.add(key, value);\n    } else {\n      queryData.setValues(key, value);\n    }\n  }\n  return queryData;\n};\n\n\n/**\n * Creates a new query data instance from parallel arrays of parameter names\n * and values. Allows for duplicate parameter names. Throws an error if the\n * lengths of the arrays differ.\n *\n * @param {!Array<string>} keys Parameter names.\n * @param {!Array<?>} values Parameter values.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @return {!goog.Uri.QueryData} The populated query data instance.\n */\ngoog.Uri.QueryData.createFromKeysValues = function(\n    keys, values, opt_ignoreCase) {\n  'use strict';\n  if (keys.length != values.length) {\n    throw new Error('Mismatched lengths for keys/values');\n  }\n  var queryData = new goog.Uri.QueryData(null, opt_ignoreCase);\n  for (var i = 0; i < keys.length; i++) {\n    queryData.add(keys[i], values[i]);\n  }\n  return queryData;\n};\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.invalidateCache_();\n\n  key = this.getKeyName_(key);\n  var values = this.keyMap_.get(key);\n  if (!values) {\n    this.keyMap_.set(key, (values = []));\n  }\n  values.push(value);\n  this.count_ = goog.asserts.assertNumber(this.count_) + 1;\n  return this;\n};\n\n\n/**\n * Removes all the params with the given key.\n * @param {string} key Name.\n * @return {boolean} Whether any parameter was removed.\n */\ngoog.Uri.QueryData.prototype.remove = function(key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n\n  key = this.getKeyName_(key);\n  if (this.keyMap_.containsKey(key)) {\n    this.invalidateCache_();\n\n    // Decrement parameter count.\n    this.count_ =\n        goog.asserts.assertNumber(this.count_) - this.keyMap_.get(key).length;\n    return this.keyMap_.remove(key);\n  }\n  return false;\n};\n\n\n/**\n * Clears the parameters.\n */\ngoog.Uri.QueryData.prototype.clear = function() {\n  'use strict';\n  this.invalidateCache_();\n  this.keyMap_ = null;\n  this.count_ = 0;\n};\n\n\n/**\n * @return {boolean} Whether we have any parameters.\n */\ngoog.Uri.QueryData.prototype.isEmpty = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  return this.count_ == 0;\n};\n\n\n/**\n * Whether there is a parameter with the given name\n * @param {string} key The parameter name to check for.\n * @return {boolean} Whether there is a parameter with the given name.\n */\ngoog.Uri.QueryData.prototype.containsKey = function(key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  key = this.getKeyName_(key);\n  return this.keyMap_.containsKey(key);\n};\n\n\n/**\n * Whether there is a parameter with the given value.\n * @param {*} value The value to check for.\n * @return {boolean} Whether there is a parameter with the given value.\n */\ngoog.Uri.QueryData.prototype.containsValue = function(value) {\n  'use strict';\n  // NOTE(arv): This solution goes through all the params even if it was the\n  // first param. We can get around this by not reusing code or by switching to\n  // iterators.\n  var vals = this.getValues();\n  return goog.array.contains(vals, value);\n};\n\n\n/**\n * Runs a callback on every key-value pair in the map, including duplicate keys.\n * This won't maintain original order when duplicate keys are interspersed (like\n * getKeys() / getValues()).\n * @param {function(this:SCOPE, ?, string, !goog.Uri.QueryData)} f\n * @param {SCOPE=} opt_scope The value of \"this\" inside f.\n * @template SCOPE\n */\ngoog.Uri.QueryData.prototype.forEach = function(f, opt_scope) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.keyMap_.forEach(function(values, key) {\n    'use strict';\n    goog.array.forEach(values, function(value) {\n      'use strict';\n      f.call(opt_scope, value, key, this);\n    }, this);\n  }, this);\n};\n\n\n/**\n * Returns all the keys of the parameters. If a key is used multiple times\n * it will be included multiple times in the returned array\n * @return {!Array<string>} All the keys of the parameters.\n */\ngoog.Uri.QueryData.prototype.getKeys = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  // We need to get the values to know how many keys to add.\n  var vals = this.keyMap_.getValues();\n  var keys = this.keyMap_.getKeys();\n  var rv = [];\n  for (var i = 0; i < keys.length; i++) {\n    var val = vals[i];\n    for (var j = 0; j < val.length; j++) {\n      rv.push(keys[i]);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Returns all the values of the parameters with the given name. If the query\n * data has no such key this will return an empty array. If no key is given\n * all values wil be returned.\n * @param {string=} opt_key The name of the parameter to get the values for.\n * @return {!Array<?>} All the values of the parameters with the given name.\n */\ngoog.Uri.QueryData.prototype.getValues = function(opt_key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  var rv = [];\n  if (typeof opt_key === 'string') {\n    if (this.containsKey(opt_key)) {\n      rv = goog.array.concat(rv, this.keyMap_.get(this.getKeyName_(opt_key)));\n    }\n  } else {\n    // Return all values.\n    var values = this.keyMap_.getValues();\n    for (var i = 0; i < values.length; i++) {\n      rv = goog.array.concat(rv, values[i]);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Sets a key value pair and removes all other keys with the same value.\n *\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.set = function(key, value) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.invalidateCache_();\n\n  // TODO(chrishenry): This could be better written as\n  // this.remove(key), this.add(key, value), but that would reorder\n  // the key (since the key is first removed and then added at the\n  // end) and we would have to fix unit tests that depend on key\n  // ordering.\n  key = this.getKeyName_(key);\n  if (this.containsKey(key)) {\n    this.count_ =\n        goog.asserts.assertNumber(this.count_) - this.keyMap_.get(key).length;\n  }\n  this.keyMap_.set(key, [value]);\n  this.count_ = goog.asserts.assertNumber(this.count_) + 1;\n  return this;\n};\n\n\n/**\n * Returns the first value associated with the key. If the query data has no\n * such key this will return undefined or the optional default.\n * @param {string} key The name of the parameter to get the value for.\n * @param {*=} opt_default The default value to return if the query data\n *     has no such key.\n * @return {*} The first string value associated with the key, or opt_default\n *     if there's no value.\n */\ngoog.Uri.QueryData.prototype.get = function(key, opt_default) {\n  'use strict';\n  if (!key) {\n    return opt_default;\n  }\n  var values = this.getValues(key);\n  return values.length > 0 ? String(values[0]) : opt_default;\n};\n\n\n/**\n * Sets the values for a key. If the key already exists, this will\n * override all of the existing values that correspond to the key.\n * @param {string} key The key to set values for.\n * @param {!Array<?>} values The values to set.\n */\ngoog.Uri.QueryData.prototype.setValues = function(key, values) {\n  'use strict';\n  this.remove(key);\n\n  if (values.length > 0) {\n    this.invalidateCache_();\n    this.keyMap_.set(this.getKeyName_(key), goog.array.clone(values));\n    this.count_ = goog.asserts.assertNumber(this.count_) + values.length;\n  }\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n  'use strict';\n  if (this.encodedQuery_) {\n    return this.encodedQuery_;\n  }\n\n  if (!this.keyMap_) {\n    return '';\n  }\n\n  var sb = [];\n\n  // In the past, we use this.getKeys() and this.getVals(), but that\n  // generates a lot of allocations as compared to simply iterating\n  // over the keys.\n  var keys = this.keyMap_.getKeys();\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    var encodedKey = goog.string.urlEncode(key);\n    var val = this.getValues(key);\n    for (var j = 0; j < val.length; j++) {\n      var param = encodedKey;\n      // Ensure that null and undefined are encoded into the url as\n      // literal strings.\n      if (val[j] !== '') {\n        param += '=' + goog.string.urlEncode(val[j]);\n      }\n      sb.push(param);\n    }\n  }\n\n  return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @throws URIError If URI is malformed (that is, if decodeURIComponent fails on\n *     any of the URI components).\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n  'use strict';\n  return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Invalidate the cache.\n * @private\n */\ngoog.Uri.QueryData.prototype.invalidateCache_ = function() {\n  'use strict';\n  this.encodedQuery_ = null;\n};\n\n\n/**\n * Removes all keys that are not in the provided list. (Modifies this object.)\n * @param {Array<string>} keys The desired keys.\n * @return {!goog.Uri.QueryData} a reference to this object.\n */\ngoog.Uri.QueryData.prototype.filterKeys = function(keys) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.keyMap_.forEach(function(value, key) {\n    'use strict';\n    if (!goog.array.contains(keys, key)) {\n      this.remove(key);\n    }\n  }, this);\n  return this;\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n  'use strict';\n  var rv = new goog.Uri.QueryData();\n  rv.encodedQuery_ = this.encodedQuery_;\n  if (this.keyMap_) {\n    rv.keyMap_ = this.keyMap_.clone();\n    rv.count_ = this.count_;\n  }\n  return rv;\n};\n\n\n/**\n * Helper function to get the key name from a JavaScript object. Converts\n * the object to a string, and to lower case if necessary.\n * @private\n * @param {*} arg The object to get a key name from.\n * @return {string} valid key name which can be looked up in #keyMap_.\n */\ngoog.Uri.QueryData.prototype.getKeyName_ = function(arg) {\n  'use strict';\n  var keyName = String(arg);\n  if (this.ignoreCase_) {\n    keyName = keyName.toLowerCase();\n  }\n  return keyName;\n};\n\n\n/**\n * Ignore case in parameter names.\n * NOTE: If there are already key/value pairs in the QueryData, and\n * ignoreCase_ is set to false, the keys will all be lower-cased.\n * @param {boolean} ignoreCase whether this goog.Uri should ignore case.\n */\ngoog.Uri.QueryData.prototype.setIgnoreCase = function(ignoreCase) {\n  'use strict';\n  var resetKeys = ignoreCase && !this.ignoreCase_;\n  if (resetKeys) {\n    this.ensureKeyMapInitialized_();\n    this.invalidateCache_();\n    this.keyMap_.forEach(function(value, key) {\n      'use strict';\n      var lowerCase = key.toLowerCase();\n      if (key != lowerCase) {\n        this.remove(key);\n        this.setValues(lowerCase, value);\n      }\n    }, this);\n  }\n  this.ignoreCase_ = ignoreCase;\n};\n\n\n/**\n * Extends a query data object with another query data or map like object. This\n * operates 'in-place', it does not create a new QueryData object.\n *\n * @param {...(?goog.Uri.QueryData|?goog.structs.Map<?, ?>|?Object)} var_args\n *     The object from which key value pairs will be copied. Note: does not\n *     accept null.\n * @suppress {deprecated} Use deprecated goog.structs.forEach to allow different\n * types of parameters.\n */\ngoog.Uri.QueryData.prototype.extend = function(var_args) {\n  'use strict';\n  for (var i = 0; i < arguments.length; i++) {\n    var data = arguments[i];\n    goog.structs.forEach(data, function(value, key) {\n      'use strict';\n      this.add(key, value);\n    }, this);\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for string manipulation.\n */\n\n\n/**\n * Namespace for string utilities\n */\ngoog.provide('goog.string');\ngoog.provide('goog.string.Unicode');\n\ngoog.require('goog.dom.safe');\ngoog.require('goog.html.uncheckedconversions');\ngoog.require('goog.string.Const');\ngoog.require('goog.string.internal');\n\n\n/**\n * @define {boolean} Enables HTML escaping of lowercase letter \"e\" which helps\n * with detection of double-escaping as this letter is frequently used.\n */\ngoog.string.DETECT_DOUBLE_ESCAPING =\n    goog.define('goog.string.DETECT_DOUBLE_ESCAPING', false);\n\n\n/**\n * @define {boolean} Whether to force non-dom html unescaping.\n */\ngoog.string.FORCE_NON_DOM_HTML_UNESCAPING =\n    goog.define('goog.string.FORCE_NON_DOM_HTML_UNESCAPING', false);\n\n\n/**\n * Common Unicode string characters.\n * @enum {string}\n */\ngoog.string.Unicode = {\n  NBSP: '\\xa0'\n};\n\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n */\ngoog.string.startsWith = goog.string.internal.startsWith;\n\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n */\ngoog.string.endsWith = goog.string.internal.endsWith;\n\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix  A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n *     case).\n */\ngoog.string.caseInsensitiveStartsWith =\n    goog.string.internal.caseInsensitiveStartsWith;\n\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n *     case).\n */\ngoog.string.caseInsensitiveEndsWith =\n    goog.string.internal.caseInsensitiveEndsWith;\n\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n *     ignoring case.\n */\ngoog.string.caseInsensitiveEquals = goog.string.internal.caseInsensitiveEquals;\n\n\n/**\n * Does simple python-style string substitution.\n * subs(\"foo%s hot%s\", \"bar\", \"dog\") becomes \"foobar hotdog\".\n * @param {string} str The string containing the pattern.\n * @param {...*} var_args The items to substitute into the pattern.\n * @return {string} A copy of `str` in which each occurrence of\n *     {@code %s} has been replaced an argument from `var_args`.\n */\ngoog.string.subs = function(str, var_args) {\n  'use strict';\n  const splitParts = str.split('%s');\n  let returnString = '';\n\n  const subsArguments = Array.prototype.slice.call(arguments, 1);\n  while (subsArguments.length &&\n         // Replace up to the last split part. We are inserting in the\n         // positions between split parts.\n         splitParts.length > 1) {\n    returnString += splitParts.shift() + subsArguments.shift();\n  }\n\n  return returnString + splitParts.join('%s');  // Join unused '%s'\n};\n\n\n/**\n * Converts multiple whitespace chars (spaces, non-breaking-spaces, new lines\n * and tabs) to a single space, and strips leading and trailing whitespace.\n * @param {string} str Input string.\n * @return {string} A copy of `str` with collapsed whitespace.\n */\ngoog.string.collapseWhitespace = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/[\\s\\xa0]+/g, ' ').replace(/^\\s+|\\s+$/g, '');\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n */\ngoog.string.isEmptyOrWhitespace = goog.string.internal.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is empty.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty.\n */\ngoog.string.isEmptyString = function(str) {\n  'use strict';\n  return str.length == 0;\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n *\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmpty = goog.string.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n *     whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str))\n *     instead.\n */\ngoog.string.isEmptyOrWhitespaceSafe = function(str) {\n  'use strict';\n  return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str));\n};\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n *\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n *     whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe;\n\n\n/**\n * Checks if a string is all breaking whitespace.\n * @param {string} str The string to check.\n * @return {boolean} Whether the string is all breaking whitespace.\n */\ngoog.string.isBreakingWhitespace = function(str) {\n  'use strict';\n  return !/[^\\t\\n\\r ]/.test(str);\n};\n\n\n/**\n * Checks if a string contains all letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` consists entirely of letters.\n */\ngoog.string.isAlpha = function(str) {\n  'use strict';\n  return !/[^a-zA-Z]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers.\n * @param {*} str string to check. If not a string, it will be\n *     casted to one.\n * @return {boolean} True if `str` is numeric.\n */\ngoog.string.isNumeric = function(str) {\n  'use strict';\n  return !/[^0-9]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers or letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` is alphanumeric.\n */\ngoog.string.isAlphaNumeric = function(str) {\n  'use strict';\n  return !/[^a-zA-Z0-9]/.test(str);\n};\n\n\n/**\n * Checks if a character is a space character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a space.\n */\ngoog.string.isSpace = function(ch) {\n  'use strict';\n  return ch == ' ';\n};\n\n\n/**\n * Checks if a character is a valid unicode character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a valid unicode character.\n */\ngoog.string.isUnicodeChar = function(ch) {\n  'use strict';\n  return ch.length == 1 && ch >= ' ' && ch <= '~' ||\n      ch >= '\\u0080' && ch <= '\\uFFFD';\n};\n\n\n/**\n * Takes a string and replaces newlines with a space. Multiple lines are\n * replaced with a single space.\n * @param {string} str The string from which to strip newlines.\n * @return {string} A copy of `str` stripped of newlines.\n */\ngoog.string.stripNewlines = function(str) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)+/g, ' ');\n};\n\n\n/**\n * Replaces Windows and Mac new lines with unix style: \\r or \\r\\n with \\n.\n * @param {string} str The string to in which to canonicalize newlines.\n * @return {string} `str` A copy of {@code} with canonicalized newlines.\n */\ngoog.string.canonicalizeNewlines = function(str) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)/g, '\\n');\n};\n\n\n/**\n * Normalizes whitespace in a string, replacing all whitespace chars with\n * a space.\n * @param {string} str The string in which to normalize whitespace.\n * @return {string} A copy of `str` with all whitespace normalized.\n */\ngoog.string.normalizeWhitespace = function(str) {\n  'use strict';\n  return str.replace(/\\xa0|\\s/g, ' ');\n};\n\n\n/**\n * Normalizes spaces in a string, replacing all consecutive spaces and tabs\n * with a single space. Replaces non-breaking space with a space.\n * @param {string} str The string in which to normalize spaces.\n * @return {string} A copy of `str` with all consecutive spaces and tabs\n *    replaced with a single space.\n */\ngoog.string.normalizeSpaces = function(str) {\n  'use strict';\n  return str.replace(/\\xa0|[ \\t]+/g, ' ');\n};\n\n\n/**\n * Removes the breaking spaces from the left and right of the string and\n * collapses the sequences of breaking spaces in the middle into single spaces.\n * The original and the result strings render the same way in HTML.\n * @param {string} str A string in which to collapse spaces.\n * @return {string} Copy of the string with normalized breaking spaces.\n */\ngoog.string.collapseBreakingSpaces = function(str) {\n  'use strict';\n  return str.replace(/[\\t\\r\\n ]+/g, ' ')\n      .replace(/^[\\t\\r\\n ]+|[\\t\\r\\n ]+$/g, '');\n};\n\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trim = goog.string.internal.trim;\n\n\n/**\n * Trims whitespaces at the left end of a string.\n * @param {string} str The string to left trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimLeft = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/^[\\s\\xa0]+/, '');\n};\n\n\n/**\n * Trims whitespaces at the right end of a string.\n * @param {string} str The string to right trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimRight = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/[\\s\\xa0]+$/, '');\n};\n\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n *  0 = str1 equals str2\n *  1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n */\ngoog.string.caseInsensitiveCompare =\n    goog.string.internal.caseInsensitiveCompare;\n\n\n/**\n * Compares two strings interpreting their numeric substrings as numbers.\n *\n * @param {string} str1 First string.\n * @param {string} str2 Second string.\n * @param {!RegExp} tokenizerRegExp Splits a string into substrings of\n *     non-negative integers, non-numeric characters and optionally fractional\n *     numbers starting with a decimal point.\n * @return {number} Negative if str1 < str2, 0 is str1 == str2, positive if\n *     str1 > str2.\n * @private\n */\ngoog.string.numberAwareCompare_ = function(str1, str2, tokenizerRegExp) {\n  'use strict';\n  if (str1 == str2) {\n    return 0;\n  }\n  if (!str1) {\n    return -1;\n  }\n  if (!str2) {\n    return 1;\n  }\n\n  // Using match to split the entire string ahead of time turns out to be faster\n  // for most inputs than using RegExp.exec or iterating over each character.\n  const tokens1 = str1.toLowerCase().match(tokenizerRegExp);\n  const tokens2 = str2.toLowerCase().match(tokenizerRegExp);\n\n  const count = Math.min(tokens1.length, tokens2.length);\n\n  for (let i = 0; i < count; i++) {\n    const a = tokens1[i];\n    const b = tokens2[i];\n\n    // Compare pairs of tokens, returning if one token sorts before the other.\n    if (a != b) {\n      // Only if both tokens are integers is a special comparison required.\n      // Decimal numbers are sorted as strings (e.g., '.09' < '.1').\n      const num1 = parseInt(a, 10);\n      if (!isNaN(num1)) {\n        const num2 = parseInt(b, 10);\n        if (!isNaN(num2) && num1 - num2) {\n          return num1 - num2;\n        }\n      }\n      return a < b ? -1 : 1;\n    }\n  }\n\n  // If one string is a substring of the other, the shorter string sorts first.\n  if (tokens1.length != tokens2.length) {\n    return tokens1.length - tokens2.length;\n  }\n\n  // The two strings must be equivalent except for case (perfect equality is\n  // tested at the head of the function.) Revert to default ASCII string\n  // comparison to stabilize the sort.\n  return str1 < str2 ? -1 : 1;\n};\n\n\n/**\n * String comparison function that handles non-negative integer numbers in a\n * way humans might expect. Using this function, the string 'File 2.jpg' sorts\n * before 'File 10.jpg', and 'Version 1.9' before 'Version 1.10'. The comparison\n * is mostly case-insensitive, though strings that are identical except for case\n * are sorted with the upper-case strings before lower-case.\n *\n * This comparison function is up to 50x slower than either the default or the\n * case-insensitive compare. It should not be used in time-critical code, but\n * should be fast enough to sort several hundred short strings (like filenames)\n * with a reasonable delay.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n *     0 if str1 > str2.\n */\ngoog.string.intAwareCompare = function(str1, str2) {\n  'use strict';\n  return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\D+/g);\n};\n\n\n/**\n * String comparison function that handles non-negative integer and fractional\n * numbers in a way humans might expect. Using this function, the string\n * 'File 2.jpg' sorts before 'File 10.jpg', and '3.14' before '3.2'. Equivalent\n * to {@link goog.string.intAwareCompare} apart from the way how it interprets\n * dots.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n *     0 if str1 > str2.\n */\ngoog.string.floatAwareCompare = function(str1, str2) {\n  'use strict';\n  return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\.\\d+|\\D+/g);\n};\n\n\n/**\n * Alias for {@link goog.string.floatAwareCompare}.\n *\n * @param {string} str1\n * @param {string} str2\n * @return {number}\n */\ngoog.string.numerateCompare = goog.string.floatAwareCompare;\n\n\n/**\n * URL-encodes a string\n * @param {*} str The string to url-encode.\n * @return {string} An encoded copy of `str` that is safe for urls.\n *     Note that '#', ':', and other characters used to delimit portions\n *     of URLs *will* be encoded.\n */\ngoog.string.urlEncode = function(str) {\n  'use strict';\n  return encodeURIComponent(String(str));\n};\n\n\n/**\n * URL-decodes the string. We need to specially handle '+'s because\n * the javascript library doesn't convert them to spaces.\n * @param {string} str The string to url decode.\n * @return {string} The decoded `str`.\n */\ngoog.string.urlDecode = function(str) {\n  'use strict';\n  return decodeURIComponent(str.replace(/\\+/g, ' '));\n};\n\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n */\ngoog.string.newLineToBr = goog.string.internal.newLineToBr;\n\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n *\n * It should be noted that > doesn't need to be escaped for the HTML or XML to\n * be valid, but it has been decided to escape it for consistency with other\n * implementations.\n *\n * With goog.string.DETECT_DOUBLE_ESCAPING, this function escapes also the\n * lowercase letter \"e\".\n *\n * NOTE(user):\n * HtmlEscape is often called during the generation of large blocks of HTML.\n * Using statics for the regular expressions and strings is an optimization\n * that can more than half the amount of time IE spends in this function for\n * large apps, since strings and regexes both contribute to GC allocations.\n *\n * Testing for the presence of a character before escaping increases the number\n * of function calls, but actually provides a speed increase for the average\n * case -- since the average case often doesn't require the escaping of all 4\n * characters and indexOf() is much cheaper than replace().\n * The worst case does suffer slightly from the additional calls, therefore the\n * opt_isLikelyToContainHtmlChars option has been included for situations\n * where all 4 HTML entities are very likely to be present and need escaping.\n *\n * Some benchmarks (times tended to fluctuate +-0.05ms):\n *                                     FireFox                     IE6\n * (no chars / average (mix of cases) / all 4 chars)\n * no checks                     0.13 / 0.22 / 0.22         0.23 / 0.53 / 0.80\n * indexOf                       0.08 / 0.17 / 0.26         0.22 / 0.54 / 0.84\n * indexOf + re test             0.07 / 0.17 / 0.28         0.19 / 0.50 / 0.85\n *\n * An additional advantage of checking if replace actually needs to be called\n * is a reduction in the number of object allocations, so as the size of the\n * application grows the difference between the various methods would increase.\n *\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars Don't perform a check to see\n *     if the character needs replacing - use this option if you expect each of\n *     the characters to appear often. Leave false if you expect few html\n *     characters to occur in your strings, such as if you are escaping HTML.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.htmlEscape = function(str, opt_isLikelyToContainHtmlChars) {\n  'use strict';\n  str = goog.string.internal.htmlEscape(str, opt_isLikelyToContainHtmlChars);\n  if (goog.string.DETECT_DOUBLE_ESCAPING) {\n    str = str.replace(goog.string.E_RE_, '&#101;');\n  }\n  return str;\n};\n\n\n/**\n * Regular expression that matches a lowercase letter \"e\", for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.E_RE_ = /e/g;\n\n\n/**\n * Unescapes an HTML string.\n *\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntities = function(str) {\n  'use strict';\n  if (goog.string.contains(str, '&')) {\n    // We are careful not to use a DOM if we do not have one or we explicitly\n    // requested non-DOM html unescaping.\n    if (!goog.string.FORCE_NON_DOM_HTML_UNESCAPING &&\n        'document' in goog.global) {\n      return goog.string.unescapeEntitiesUsingDom_(str);\n    } else {\n      // Fall back on pure XML entities\n      return goog.string.unescapePureXmlEntities_(str);\n    }\n  }\n  return str;\n};\n\n\n/**\n * Unescapes a HTML string using the provided document.\n *\n * @param {string} str The string to unescape.\n * @param {!Document} document A document to use in escaping the string.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntitiesWithDocument = function(str, document) {\n  'use strict';\n  if (goog.string.contains(str, '&')) {\n    return goog.string.unescapeEntitiesUsingDom_(str, document);\n  }\n  return str;\n};\n\n\n/**\n * Unescapes an HTML string using a DOM to resolve non-XML, non-numeric\n * entities. This function is XSS-safe and whitespace-preserving.\n * @private\n * @param {string} str The string to unescape.\n * @param {Document=} opt_document An optional document to use for creating\n *     elements. If this is not specified then the default window.document\n *     will be used.\n * @return {string} The unescaped `str` string.\n */\ngoog.string.unescapeEntitiesUsingDom_ = function(str, opt_document) {\n  'use strict';\n  /** @type {!Object<string, string>} */\n  const seen = {'&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '\"'};\n  /** @type {!Element} */\n  let div;\n  if (opt_document) {\n    div = opt_document.createElement('div');\n  } else {\n    div = goog.global.document.createElement('div');\n  }\n  // Match as many valid entity characters as possible. If the actual entity\n  // happens to be shorter, it will still work as innerHTML will return the\n  // trailing characters unchanged. Since the entity characters do not include\n  // open angle bracket, there is no chance of XSS from the innerHTML use.\n  // Since no whitespace is passed to innerHTML, whitespace is preserved.\n  return str.replace(goog.string.HTML_ENTITY_PATTERN_, function(s, entity) {\n    'use strict';\n    // Check for cached entity.\n    let value = seen[s];\n    if (value) {\n      return value;\n    }\n    // Check for numeric entity.\n    if (entity.charAt(0) == '#') {\n      // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex numbers.\n      const n = Number('0' + entity.substr(1));\n      if (!isNaN(n)) {\n        value = String.fromCharCode(n);\n      }\n    }\n    // Fall back to innerHTML otherwise.\n    if (!value) {\n      // Append a non-entity character to avoid a bug in Webkit that parses\n      // an invalid entity at the end of innerHTML text as the empty string.\n      goog.dom.safe.setInnerHtml(\n          div,\n          goog.html.uncheckedconversions\n              .safeHtmlFromStringKnownToSatisfyTypeContract(\n                  goog.string.Const.from('Single HTML entity.'), s + ' '));\n      // Then remove the trailing character from the result.\n      value = div.firstChild.nodeValue.slice(0, -1);\n    }\n    // Cache and return.\n    return seen[s] = value;\n  });\n};\n\n\n/**\n * Unescapes XML entities.\n * @private\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapePureXmlEntities_ = function(str) {\n  'use strict';\n  return str.replace(/&([^;]+);/g, function(s, entity) {\n    'use strict';\n    switch (entity) {\n      case 'amp':\n        return '&';\n      case 'lt':\n        return '<';\n      case 'gt':\n        return '>';\n      case 'quot':\n        return '\"';\n      default:\n        if (entity.charAt(0) == '#') {\n          // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex.\n          const n = Number('0' + entity.substr(1));\n          if (!isNaN(n)) {\n            return String.fromCharCode(n);\n          }\n        }\n        // For invalid entities we just return the entity\n        return s;\n    }\n  });\n};\n\n\n/**\n * Regular expression that matches an HTML entity.\n * See also HTML5: Tokenization / Tokenizing character references.\n * @private\n * @type {!RegExp}\n */\ngoog.string.HTML_ENTITY_PATTERN_ = /&([^;\\s<&]+);?/g;\n\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.whitespaceEscape = function(str, opt_xml) {\n  'use strict';\n  // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n  return goog.string.newLineToBr(str.replace(/  /g, ' &#160;'), opt_xml);\n};\n\n\n/**\n * Preserve spaces that would be otherwise collapsed in HTML by replacing them\n * with non-breaking space Unicode characters.\n * @param {string} str The string in which to preserve whitespace.\n * @return {string} A copy of `str` with preserved whitespace.\n */\ngoog.string.preserveSpaces = function(str) {\n  'use strict';\n  return str.replace(/(^|[\\n ]) /g, '$1' + goog.string.Unicode.NBSP);\n};\n\n\n/**\n * Strip quote characters around a string.  The second argument is a string of\n * characters to treat as quotes.  This can be a single character or a string of\n * multiple character and in that case each of those are treated as possible\n * quote characters. For example:\n *\n * <pre>\n * goog.string.stripQuotes('\"abc\"', '\"`') --> 'abc'\n * goog.string.stripQuotes('`abc`', '\"`') --> 'abc'\n * </pre>\n *\n * @param {string} str The string to strip.\n * @param {string} quoteChars The quote characters to strip.\n * @return {string} A copy of `str` without the quotes.\n */\ngoog.string.stripQuotes = function(str, quoteChars) {\n  'use strict';\n  const length = quoteChars.length;\n  for (let i = 0; i < length; i++) {\n    const quoteChar = length == 1 ? quoteChars : quoteChars.charAt(i);\n    if (str.charAt(0) == quoteChar && str.charAt(str.length - 1) == quoteChar) {\n      return str.substring(1, str.length - 1);\n    }\n  }\n  return str;\n};\n\n\n/**\n * Truncates a string to a certain length and adds '...' if necessary.  The\n * length also accounts for the ellipsis, so a maximum length of 10 and a string\n * 'Hello World!' produces 'Hello W...'.\n * @param {string} str The string to truncate.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n *     characters from being cut off in the middle.\n * @return {string} The truncated `str` string.\n */\ngoog.string.truncate = function(str, chars, opt_protectEscapedCharacters) {\n  'use strict';\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.unescapeEntities(str);\n  }\n\n  if (str.length > chars) {\n    str = str.substring(0, chars - 3) + '...';\n  }\n\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.htmlEscape(str);\n  }\n\n  return str;\n};\n\n\n/**\n * Truncate a string in the middle, adding \"...\" if necessary,\n * and favoring the beginning of the string.\n * @param {string} str The string to truncate the middle of.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n *     characters from being cutoff in the middle.\n * @param {number=} opt_trailingChars Optional number of trailing characters to\n *     leave at the end of the string, instead of truncating as close to the\n *     middle as possible.\n * @return {string} A truncated copy of `str`.\n */\ngoog.string.truncateMiddle = function(\n    str, chars, opt_protectEscapedCharacters, opt_trailingChars) {\n  'use strict';\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.unescapeEntities(str);\n  }\n\n  if (opt_trailingChars && str.length > chars) {\n    if (opt_trailingChars > chars) {\n      opt_trailingChars = chars;\n    }\n    const endPoint = str.length - opt_trailingChars;\n    const startPoint = chars - opt_trailingChars;\n    str = str.substring(0, startPoint) + '...' + str.substring(endPoint);\n  } else if (str.length > chars) {\n    // Favor the beginning of the string:\n    let half = Math.floor(chars / 2);\n    const endPos = str.length - half;\n    half += chars % 2;\n    str = str.substring(0, half) + '...' + str.substring(endPos);\n  }\n\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.htmlEscape(str);\n  }\n\n  return str;\n};\n\n\n/**\n * Special chars that need to be escaped for goog.string.quote.\n * @private {!Object<string, string>}\n */\ngoog.string.specialEscapeChars_ = {\n  '\\0': '\\\\0',\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t',\n  '\\x0B': '\\\\x0B',  // '\\v' is not supported in JScript\n  '\"': '\\\\\"',\n  '\\\\': '\\\\\\\\',\n  // To support the use case of embedding quoted strings inside of script\n  // tags, we have to make sure HTML comments and opening/closing script tags do\n  // not appear in the resulting string. The specific strings that must be\n  // escaped are documented at:\n  // https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements\n  '<': '\\\\u003C'  // NOTE: JSON.parse crashes on '\\\\x3c'.\n};\n\n\n/**\n * Character mappings used internally for goog.string.escapeChar.\n * @private {!Object<string, string>}\n */\ngoog.string.jsEscapeCache_ = {\n  '\\'': '\\\\\\''\n};\n\n\n/**\n * Encloses a string in double quotes and escapes characters so that the\n * string is a valid JS string. The resulting string is safe to embed in\n * `<script>` tags as \"<\" is escaped.\n * @param {string} s The string to quote.\n * @return {string} A copy of `s` surrounded by double quotes.\n */\ngoog.string.quote = function(s) {\n  'use strict';\n  s = String(s);\n  const sb = ['\"'];\n  for (let i = 0; i < s.length; i++) {\n    const ch = s.charAt(i);\n    const cc = ch.charCodeAt(0);\n    sb[i + 1] = goog.string.specialEscapeChars_[ch] ||\n        ((cc > 31 && cc < 127) ? ch : goog.string.escapeChar(ch));\n  }\n  sb.push('\"');\n  return sb.join('');\n};\n\n\n/**\n * Takes a string and returns the escaped string for that input string.\n * @param {string} str The string to escape.\n * @return {string} An escaped string representing `str`.\n */\ngoog.string.escapeString = function(str) {\n  'use strict';\n  const sb = [];\n  for (let i = 0; i < str.length; i++) {\n    sb[i] = goog.string.escapeChar(str.charAt(i));\n  }\n  return sb.join('');\n};\n\n\n/**\n * Takes a character and returns the escaped string for that character. For\n * example escapeChar(String.fromCharCode(15)) -> \"\\\\x0E\".\n * @param {string} c The character to escape.\n * @return {string} An escaped string representing `c`.\n */\ngoog.string.escapeChar = function(c) {\n  'use strict';\n  if (c in goog.string.jsEscapeCache_) {\n    return goog.string.jsEscapeCache_[c];\n  }\n\n  if (c in goog.string.specialEscapeChars_) {\n    return goog.string.jsEscapeCache_[c] = goog.string.specialEscapeChars_[c];\n  }\n\n  let rv = c;\n  const cc = c.charCodeAt(0);\n  if (cc > 31 && cc < 127) {\n    rv = c;\n  } else {\n    // tab is 9 but handled above\n    if (cc < 256) {\n      rv = '\\\\x';\n      if (cc < 16 || cc > 256) {\n        rv += '0';\n      }\n    } else {\n      rv = '\\\\u';\n      if (cc < 4096) {  // \\u1000\n        rv += '0';\n      }\n    }\n    rv += cc.toString(16).toUpperCase();\n  }\n\n  return goog.string.jsEscapeCache_[c] = rv;\n};\n\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.contains = goog.string.internal.contains;\n\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.caseInsensitiveContains =\n    goog.string.internal.caseInsensitiveContains;\n\n\n/**\n * Returns the non-overlapping occurrences of ss in s.\n * If either s or ss evalutes to false, then returns zero.\n * @param {string} s The string to look in.\n * @param {string} ss The string to look for.\n * @return {number} Number of occurrences of ss in s.\n */\ngoog.string.countOf = function(s, ss) {\n  'use strict';\n  return s && ss ? s.split(ss).length - 1 : 0;\n};\n\n\n/**\n * Removes a substring of a specified length at a specific\n * index in a string.\n * @param {string} s The base string from which to remove.\n * @param {number} index The index at which to remove the substring.\n * @param {number} stringLength The length of the substring to remove.\n * @return {string} A copy of `s` with the substring removed or the full\n *     string if nothing is removed or the input is invalid.\n */\ngoog.string.removeAt = function(s, index, stringLength) {\n  'use strict';\n  let resultStr = s;\n  // If the index is greater or equal to 0 then remove substring\n  if (index >= 0 && index < s.length && stringLength > 0) {\n    resultStr = s.substr(0, index) +\n        s.substr(index + stringLength, s.length - index - stringLength);\n  }\n  return resultStr;\n};\n\n\n/**\n * Removes the first occurrence of a substring from a string.\n * @param {string} str The base string from which to remove.\n * @param {string} substr The string to remove.\n * @return {string} A copy of `str` with `substr` removed or the\n *     full string if nothing is removed.\n */\ngoog.string.remove = function(str, substr) {\n  'use strict';\n  return str.replace(substr, '');\n};\n\n\n/**\n *  Removes all occurrences of a substring from a string.\n *  @param {string} s The base string from which to remove.\n *  @param {string} ss The string to remove.\n *  @return {string} A copy of `s` with `ss` removed or the full\n *      string if nothing is removed.\n */\ngoog.string.removeAll = function(s, ss) {\n  'use strict';\n  const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n  return s.replace(re, '');\n};\n\n\n/**\n *  Replaces all occurrences of a substring of a string with a new substring.\n *  @param {string} s The base string from which to remove.\n *  @param {string} ss The string to replace.\n *  @param {string} replacement The replacement string.\n *  @return {string} A copy of `s` with `ss` replaced by\n *      `replacement` or the original string if nothing is replaced.\n */\ngoog.string.replaceAll = function(s, ss, replacement) {\n  'use strict';\n  const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n  return s.replace(re, replacement.replace(/\\$/g, '$$$$'));\n};\n\n\n/**\n * Escapes characters in the string that are not safe to use in a RegExp.\n * @param {*} s The string to escape. If not a string, it will be casted\n *     to one.\n * @return {string} A RegExp safe, escaped copy of `s`.\n */\ngoog.string.regExpEscape = function(s) {\n  'use strict';\n  return String(s)\n      .replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')\n      .replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * Repeats a string n times.\n * @param {string} string The string to repeat.\n * @param {number} length The number of times to repeat.\n * @return {string} A string containing `length` repetitions of\n *     `string`.\n */\ngoog.string.repeat = (String.prototype.repeat) ? function(string, length) {\n  'use strict';\n  // The native method is over 100 times faster than the alternative.\n  return string.repeat(length);\n} : function(string, length) {\n  'use strict';\n  return new Array(length + 1).join(string);\n};\n\n\n/**\n * Pads number to given length and optionally rounds it to a given precision.\n * For example:\n * <pre>padNumber(1.25, 2, 3) -> '01.250'\n * padNumber(1.25, 2) -> '01.25'\n * padNumber(1.25, 2, 1) -> '01.3'\n * padNumber(1.25, 0) -> '1.25'</pre>\n *\n * @param {number} num The number to pad.\n * @param {number} length The desired length.\n * @param {number=} opt_precision The desired precision.\n * @return {string} `num` as a string with the given options.\n */\ngoog.string.padNumber = function(num, length, opt_precision) {\n  'use strict';\n  const s =\n      (opt_precision !== undefined) ? num.toFixed(opt_precision) : String(num);\n  let index = s.indexOf('.');\n  if (index == -1) {\n    index = s.length;\n  }\n  return goog.string.repeat('0', Math.max(0, length - index)) + s;\n};\n\n\n/**\n * Returns a string representation of the given object, with\n * null and undefined being returned as the empty string.\n *\n * @param {*} obj The object to convert.\n * @return {string} A string representation of the `obj`.\n */\ngoog.string.makeSafe = function(obj) {\n  'use strict';\n  return obj == null ? '' : String(obj);\n};\n\n\n/**\n * Concatenates string expressions. This is useful\n * since some browsers are very inefficient when it comes to using plus to\n * concat strings. Be careful when using null and undefined here since\n * these will not be included in the result. If you need to represent these\n * be sure to cast the argument to a String first.\n * For example:\n * <pre>buildString('a', 'b', 'c', 'd') -> 'abcd'\n * buildString(null, undefined) -> ''\n * </pre>\n * @param {...*} var_args A list of strings to concatenate. If not a string,\n *     it will be casted to one.\n * @return {string} The concatenation of `var_args`.\n */\ngoog.string.buildString = function(var_args) {\n  'use strict';\n  return Array.prototype.join.call(arguments, '');\n};\n\n\n/**\n * Returns a string with at least 64-bits of randomness.\n *\n * Doesn't trust JavaScript's random function entirely. Uses a combination of\n * random and current timestamp, and then encodes the string in base-36 to\n * make it shorter.\n *\n * @return {string} A random string, e.g. sn1s7vb4gcic.\n */\ngoog.string.getRandomString = function() {\n  'use strict';\n  const x = 2147483648;\n  return Math.floor(Math.random() * x).toString(36) +\n      Math.abs(Math.floor(Math.random() * x) ^ goog.now()).toString(36);\n};\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number}  1 if `version1` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `version2` is higher.\n */\ngoog.string.compareVersions = goog.string.internal.compareVersions;\n\n\n/**\n * String hash function similar to java.lang.String.hashCode().\n * The hash code for a string is computed as\n * s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n * where s[i] is the ith character of the string and n is the length of\n * the string. We mod the result to make it between 0 (inclusive) and 2^32\n * (exclusive).\n * @param {string} str A string.\n * @return {number} Hash value for `str`, between 0 (inclusive) and 2^32\n *  (exclusive). The empty string returns 0.\n */\ngoog.string.hashCode = function(str) {\n  'use strict';\n  let result = 0;\n  for (let i = 0; i < str.length; ++i) {\n    // Normalize to 4 byte range, 0 ... 2^32.\n    result = (31 * result + str.charCodeAt(i)) >>> 0;\n  }\n  return result;\n};\n\n\n/**\n * The most recent unique ID. |0 is equivalent to Math.floor in this case.\n * @type {number}\n * @private\n */\ngoog.string.uniqueStringCounter_ = Math.random() * 0x80000000 | 0;\n\n\n/**\n * Generates and returns a string which is unique in the current document.\n * This is useful, for example, to create unique IDs for DOM elements.\n * @return {string} A unique id.\n */\ngoog.string.createUniqueString = function() {\n  'use strict';\n  return 'goog_' + goog.string.uniqueStringCounter_++;\n};\n\n\n/**\n * Converts the supplied string to a number, which may be Infinity or NaN.\n * This function strips whitespace: (toNumber(' 123') === 123)\n * This function accepts scientific notation: (toNumber('1e1') === 10)\n *\n * This is better than JavaScript's built-in conversions because, sadly:\n *     (Number(' ') === 0) and (parseFloat('123a') === 123)\n *\n * @param {string} str The string to convert.\n * @return {number} The number the supplied string represents, or NaN.\n */\ngoog.string.toNumber = function(str) {\n  'use strict';\n  const num = Number(str);\n  if (num == 0 && goog.string.isEmptyOrWhitespace(str)) {\n    return NaN;\n  }\n  return num;\n};\n\n\n/**\n * Returns whether the given string is lower camel case (e.g. \"isFooBar\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is lower camel case.\n */\ngoog.string.isLowerCamelCase = function(str) {\n  'use strict';\n  return /^[a-z]+([A-Z][a-z]*)*$/.test(str);\n};\n\n\n/**\n * Returns whether the given string is upper camel case (e.g. \"FooBarBaz\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is upper camel case.\n */\ngoog.string.isUpperCamelCase = function(str) {\n  'use strict';\n  return /^([A-Z][a-z]*)+$/.test(str);\n};\n\n\n/**\n * Converts a string from selector-case to camelCase (e.g. from\n * \"multi-part-string\" to \"multiPartString\"), useful for converting\n * CSS selectors and HTML dataset keys to their equivalent JS properties.\n * @param {string} str The string in selector-case form.\n * @return {string} The string in camelCase form.\n */\ngoog.string.toCamelCase = function(str) {\n  'use strict';\n  return String(str).replace(/\\-([a-z])/g, function(all, match) {\n    'use strict';\n    return match.toUpperCase();\n  });\n};\n\n\n/**\n * Converts a string from camelCase to selector-case (e.g. from\n * \"multiPartString\" to \"multi-part-string\"), useful for converting JS\n * style and dataset properties to equivalent CSS selectors and HTML keys.\n * @param {string} str The string in camelCase form.\n * @return {string} The string in selector-case form.\n */\ngoog.string.toSelectorCase = function(str) {\n  'use strict';\n  return String(str).replace(/([A-Z])/g, '-$1').toLowerCase();\n};\n\n\n/**\n * Converts a string into TitleCase. First character of the string is always\n * capitalized in addition to the first letter of every subsequent word.\n * Words are delimited by one or more whitespaces by default. Custom delimiters\n * can optionally be specified to replace the default, which doesn't preserve\n * whitespace delimiters and instead must be explicitly included if needed.\n *\n * Default delimiter => \" \":\n *    goog.string.toTitleCase('oneTwoThree')    => 'OneTwoThree'\n *    goog.string.toTitleCase('one two three')  => 'One Two Three'\n *    goog.string.toTitleCase('  one   two   ') => '  One   Two   '\n *    goog.string.toTitleCase('one_two_three')  => 'One_two_three'\n *    goog.string.toTitleCase('one-two-three')  => 'One-two-three'\n *\n * Custom delimiter => \"_-.\":\n *    goog.string.toTitleCase('oneTwoThree', '_-.')       => 'OneTwoThree'\n *    goog.string.toTitleCase('one two three', '_-.')     => 'One two three'\n *    goog.string.toTitleCase('  one   two   ', '_-.')    => '  one   two   '\n *    goog.string.toTitleCase('one_two_three', '_-.')     => 'One_Two_Three'\n *    goog.string.toTitleCase('one-two-three', '_-.')     => 'One-Two-Three'\n *    goog.string.toTitleCase('one...two...three', '_-.') => 'One...Two...Three'\n *    goog.string.toTitleCase('one. two. three', '_-.')   => 'One. two. three'\n *    goog.string.toTitleCase('one-two.three', '_-.')     => 'One-Two.Three'\n *\n * @param {string} str String value in camelCase form.\n * @param {string=} opt_delimiters Custom delimiter character set used to\n *      distinguish words in the string value. Each character represents a\n *      single delimiter. When provided, default whitespace delimiter is\n *      overridden and must be explicitly included if needed.\n * @return {string} String value in TitleCase form.\n */\ngoog.string.toTitleCase = function(str, opt_delimiters) {\n  'use strict';\n  let delimiters = (typeof opt_delimiters === 'string') ?\n      goog.string.regExpEscape(opt_delimiters) :\n      '\\\\s';\n\n  // For IE8, we need to prevent using an empty character set. Otherwise,\n  // incorrect matching will occur.\n  delimiters = delimiters ? '|[' + delimiters + ']+' : '';\n\n  const regexp = new RegExp('(^' + delimiters + ')([a-z])', 'g');\n  return str.replace(regexp, function(all, p1, p2) {\n    'use strict';\n    return p1 + p2.toUpperCase();\n  });\n};\n\n\n/**\n * Capitalizes a string, i.e. converts the first letter to uppercase\n * and all other letters to lowercase, e.g.:\n *\n * goog.string.capitalize('one')     => 'One'\n * goog.string.capitalize('ONE')     => 'One'\n * goog.string.capitalize('one two') => 'One two'\n *\n * Note that this function does not trim initial whitespace.\n *\n * @param {string} str String value to capitalize.\n * @return {string} String value with first letter in uppercase.\n */\ngoog.string.capitalize = function(str) {\n  'use strict';\n  return String(str.charAt(0)).toUpperCase() +\n      String(str.substr(1)).toLowerCase();\n};\n\n\n/**\n * Parse a string in decimal or hexidecimal ('0xFFFF') form.\n *\n * To parse a particular radix, please use parseInt(string, radix) directly. See\n * https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt\n *\n * This is a wrapper for the built-in parseInt function that will only parse\n * numbers as base 10 or base 16.  Some JS implementations assume strings\n * starting with \"0\" are intended to be octal. ES3 allowed but discouraged\n * this behavior. ES5 forbids it.  This function emulates the ES5 behavior.\n *\n * For more information, see Mozilla JS Reference: http://goo.gl/8RiFj\n *\n * @param {string|number|null|undefined} value The value to be parsed.\n * @return {number} The number, parsed. If the string failed to parse, this\n *     will be NaN.\n */\ngoog.string.parseInt = function(value) {\n  'use strict';\n  // Force finite numbers to strings.\n  if (isFinite(value)) {\n    value = String(value);\n  }\n\n  if (typeof value === 'string') {\n    // If the string starts with '0x' or '-0x', parse as hex.\n    return /^\\s*-?0x/i.test(value) ? parseInt(value, 16) : parseInt(value, 10);\n  }\n\n  return NaN;\n};\n\n\n/**\n * Splits a string on a separator a limited number of times.\n *\n * This implementation is more similar to Python or Java, where the limit\n * parameter specifies the maximum number of splits rather than truncating\n * the number of results.\n *\n * See http://docs.python.org/2/library/stdtypes.html#str.split\n * See JavaDoc: http://goo.gl/F2AsY\n * See Mozilla reference: http://goo.gl/dZdZs\n *\n * @param {string} str String to split.\n * @param {string} separator The separator.\n * @param {number} limit The limit to the number of splits. The resulting array\n *     will have a maximum length of limit+1.  Negative numbers are the same\n *     as zero.\n * @return {!Array<string>} The string, split.\n */\ngoog.string.splitLimit = function(str, separator, limit) {\n  'use strict';\n  const parts = str.split(separator);\n  const returnVal = [];\n\n  // Only continue doing this while we haven't hit the limit and we have\n  // parts left.\n  while (limit > 0 && parts.length) {\n    returnVal.push(parts.shift());\n    limit--;\n  }\n\n  // If there are remaining parts, append them to the end.\n  if (parts.length) {\n    returnVal.push(parts.join(separator));\n  }\n\n  return returnVal;\n};\n\n\n/**\n * Finds the characters to the right of the last instance of any separator\n *\n * This function is similar to goog.string.path.baseName, except it can take a\n * list of characters to split the string on. It will return the rightmost\n * grouping of characters to the right of any separator as a left-to-right\n * oriented string.\n *\n * @see goog.string.path.baseName\n * @param {string} str The string\n * @param {string|!Array<string>} separators A list of separator characters\n * @return {string} The last part of the string with respect to the separators\n */\ngoog.string.lastComponent = function(str, separators) {\n  'use strict';\n  if (!separators) {\n    return str;\n  } else if (typeof separators == 'string') {\n    separators = [separators];\n  }\n\n  let lastSeparatorIndex = -1;\n  for (let i = 0; i < separators.length; i++) {\n    if (separators[i] == '') {\n      continue;\n    }\n    const currentSeparatorIndex = str.lastIndexOf(separators[i]);\n    if (currentSeparatorIndex > lastSeparatorIndex) {\n      lastSeparatorIndex = currentSeparatorIndex;\n    }\n  }\n  if (lastSeparatorIndex == -1) {\n    return str;\n  }\n  return str.slice(lastSeparatorIndex + 1);\n};\n\n\n/**\n * Computes the Levenshtein edit distance between two strings.\n * @param {string} a\n * @param {string} b\n * @return {number} The edit distance between the two strings.\n */\ngoog.string.editDistance = function(a, b) {\n  'use strict';\n  const v0 = [];\n  const v1 = [];\n\n  if (a == b) {\n    return 0;\n  }\n\n  if (!a.length || !b.length) {\n    return Math.max(a.length, b.length);\n  }\n\n  for (let i = 0; i < b.length + 1; i++) {\n    v0[i] = i;\n  }\n\n  for (let i = 0; i < a.length; i++) {\n    v1[0] = i + 1;\n\n    for (let j = 0; j < b.length; j++) {\n      const cost = Number(a[i] != b[j]);\n      // Cost for the substring is the minimum of adding one character, removing\n      // one character, or a swap.\n      v1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost);\n    }\n\n    for (let j = 0; j < v0.length; j++) {\n      v0[j] = v1[j];\n    }\n  }\n\n  return v1[b.length];\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview The dispose method is used to clean up references and\n * resources.\n */\n\ngoog.module('goog.dispose');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Calls `dispose` on the argument if it supports it. If obj is not an\n *     object with a dispose() method, this is a no-op.\n * @param {*} obj The object to dispose of.\n */\nfunction dispose(obj) {\n  if (obj && typeof obj.dispose == 'function') {\n    obj.dispose();\n  }\n}\nexports = dispose;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Codec functions of the v8 wire protocol. Eventually we'd want\n * to support pluggable wire-format to improve wire efficiency and to enable\n * binary encoding. Such support will require an interface class, which\n * will be added later.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WireV8');\n\ngoog.require('goog.asserts');\ngoog.require('goog.json');\ngoog.require('goog.json.NativeJsonProcessor');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.structs');\ngoog.requireType('goog.string.Parser');\ngoog.requireType('goog.structs.Map');\n\n\n\n/**\n * The v8 codec class.\n *\n * @constructor\n * @struct\n */\ngoog.labs.net.webChannel.WireV8 = function() {\n  'use strict';\n  /**\n   * Parser for a response payload. The parser should return an array.\n   * @private {!goog.string.Parser}\n   */\n  this.parser_ = new goog.json.NativeJsonProcessor();\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WireV8 = goog.labs.net.webChannel.WireV8;\nconst Wire = goog.labs.net.webChannel.Wire;\n\n\n/**\n * Encodes a standalone message into the wire format.\n *\n * May throw exception if the message object contains any invalid elements.\n *\n * @param {!Object|!goog.structs.Map} message The message data.\n *     V8 only support JS objects (or Map).\n * @param {!Array<string>} buffer The text buffer to write the message to.\n * @param {string=} opt_prefix The prefix for each field of the object.\n */\nWireV8.prototype.encodeMessage = function(message, buffer, opt_prefix) {\n  'use strict';\n  const prefix = opt_prefix || '';\n  try {\n    goog.structs.forEach(message, function(value, key) {\n      'use strict';\n      let encodedValue = value;\n      if (goog.isObject(value)) {\n        encodedValue = goog.json.serialize(value);\n      }  // keep the fast-path for primitive types\n      buffer.push(prefix + key + '=' + encodeURIComponent(encodedValue));\n    });\n  } catch (ex) {\n    // We send a map here because lots of the retry logic relies on map IDs,\n    // so we have to send something (possibly redundant).\n    buffer.push(\n        prefix + 'type' +\n        '=' + encodeURIComponent('_badmap'));\n    throw ex;\n  }\n};\n\n\n/**\n * Encodes all the buffered messages of the forward channel.\n *\n * @param {!Array<Wire.QueuedMap>} messageQueue The message data.\n *     V8 only support JS objects.\n * @param {number} count The number of messages to be encoded.\n * @param {?function(!Object)} badMapHandler Callback for bad messages.\n * @return {string} the encoded messages\n */\nWireV8.prototype.encodeMessageQueue = function(\n    messageQueue, count, badMapHandler) {\n  'use strict';\n  let offset = -1;\n  while (true) {\n    const sb = ['count=' + count];\n    // To save a bit of bandwidth, specify the base mapId and the rest as\n    // offsets from it.\n    if (offset == -1) {\n      if (count > 0) {\n        offset = messageQueue[0].mapId;\n        sb.push('ofs=' + offset);\n      } else {\n        offset = 0;\n      }\n    } else {\n      sb.push('ofs=' + offset);\n    }\n    let done = true;\n    for (let i = 0; i < count; i++) {\n      let mapId = messageQueue[i].mapId;\n      const map = messageQueue[i].map;\n      mapId -= offset;\n      if (mapId < 0) {\n        // redo the encoding in case of retry/reordering, plus extra space\n        offset = Math.max(0, messageQueue[i].mapId - 100);\n        done = false;\n        continue;\n      }\n      try {\n        this.encodeMessage(map, sb, 'req' + mapId + '_');\n      } catch (ex) {\n        if (badMapHandler) {\n          badMapHandler(map);\n        }\n      }\n    }\n    if (done) {\n      return sb.join('&');\n    }\n  }\n};\n\n\n/**\n * Decodes a standalone message received from the wire. May throw exception\n * if text is ill-formatted.\n *\n * Must be valid JSON as it is insecure to use eval() to decode JS literals;\n * and eval() is disallowed in Chrome apps too.\n *\n * Invalid JS literals include null array elements, quotas etc.\n *\n * @param {string} messageText The string content as received from the wire.\n * @return {*} The decoded message object.\n */\nWireV8.prototype.decodeMessage = function(messageText) {\n  'use strict';\n  const response = this.parser_.parse(messageText);\n  goog.asserts.assert(Array.isArray(response));  // throw exception\n  return response;\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A pool of forward channel requests to enable real-time\n * messaging from the client to server.\n *\n */\n\ngoog.module('goog.labs.net.webChannel.ForwardChannelRequestPool');\n\ngoog.module.declareLegacyNamespace();\n\nconst ChannelRequest = goog.require('goog.labs.net.webChannel.ChannelRequest');\nconst Wire = goog.require('goog.labs.net.webChannel.Wire');\nconst array = goog.require('goog.array');\nconst googString = goog.require('goog.string');\n\n\n/**\n * This class represents the state of all forward channel requests.\n *\n * @param {number=} opt_maxPoolSize The maximum pool size.\n *\n * @struct @constructor @final\n */\nconst ForwardChannelRequestPool = function(opt_maxPoolSize) {\n  /**\n   * The max pool size as configured.\n   *\n   * @private {number}\n   */\n  this.maxPoolSizeConfigured_ =\n      opt_maxPoolSize || ForwardChannelRequestPool.MAX_POOL_SIZE_;\n\n  /**\n   * The current size limit of the request pool. This limit is meant to be\n   * read-only after the channel is fully opened.\n   *\n   * If SPDY or HTTP2 is enabled, set it to the max pool size, which is also\n   * configurable.\n   *\n   * @private {number}\n   */\n  this.maxSize_ = ForwardChannelRequestPool.isSpdyOrHttp2Enabled_() ?\n      this.maxPoolSizeConfigured_ :\n      1;\n\n  /**\n   * The container for all the pending request objects.\n   *\n   * @private {?Set<?ChannelRequest>}\n   */\n  this.requestPool_ = null;\n\n  if (this.maxSize_ > 1) {\n    this.requestPool_ = new Set();\n  }\n\n  /**\n   * The single request object when the pool size is limited to one.\n   *\n   * @private {?ChannelRequest}\n   */\n  this.request_ = null;\n\n  /**\n   * Saved pending messages when the pool is cancelled.\n   *\n   * @private {!Array<Wire.QueuedMap>}\n   */\n  this.pendingMessages_ = [];\n};\n\n\n/**\n * The default size limit of the request pool.\n *\n * @private {number}\n */\nForwardChannelRequestPool.MAX_POOL_SIZE_ = 10;\n\n\n/**\n * @return {boolean} True if SPDY or HTTP2 is enabled. Uses chrome-specific APIs\n *     as a fallback and will always return false for other browsers where\n *     PerformanceNavigationTiming is not available.\n * @private\n */\nForwardChannelRequestPool.isSpdyOrHttp2Enabled_ = function() {\n  if (goog.global.PerformanceNavigationTiming) {\n    const entrys = /** @type {!Array<!PerformanceNavigationTiming>} */ (\n        goog.global.performance.getEntriesByType('navigation'));\n    return entrys.length > 0 &&\n        (entrys[0].nextHopProtocol == 'hq' ||\n         entrys[0].nextHopProtocol == 'h2');\n  }\n  return !!(\n      goog.global.chrome && goog.global.chrome.loadTimes &&\n      goog.global.chrome.loadTimes() &&\n      goog.global.chrome.loadTimes().wasFetchedViaSpdy);\n};\n\n\n/**\n * Once we know the client protocol (from the handshake), check if we need\n * enable the request pool accordingly. This is more robust than using\n * browser-internal APIs (specific to Chrome).\n *\n * @param {string} clientProtocol The client protocol\n */\nForwardChannelRequestPool.prototype.applyClientProtocol = function(\n    clientProtocol) {\n  if (this.requestPool_) {\n    return;\n  }\n\n  if (googString.contains(clientProtocol, 'spdy') ||\n      googString.contains(clientProtocol, 'quic') ||\n      googString.contains(clientProtocol, 'h2')) {\n    this.maxSize_ = this.maxPoolSizeConfigured_;\n    this.requestPool_ = new Set();\n    if (this.request_) {\n      this.addRequest(this.request_);\n      this.request_ = null;\n    }\n  }\n};\n\n\n/**\n * @return {boolean} True if the pool is full.\n */\nForwardChannelRequestPool.prototype.isFull = function() {\n  if (this.request_) {\n    return true;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.size >= this.maxSize_;\n  }\n\n  return false;\n};\n\n\n/**\n * @return {number} The current size limit.\n */\nForwardChannelRequestPool.prototype.getMaxSize = function() {\n  return this.maxSize_;\n};\n\n\n/**\n * @return {number} The number of pending requests in the pool.\n */\nForwardChannelRequestPool.prototype.getRequestCount = function() {\n  if (this.request_) {\n    return 1;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.size;\n  }\n\n  return 0;\n};\n\n\n/**\n * @param {ChannelRequest} req The channel request.\n * @return {boolean} True if the request is a included inside the pool.\n */\nForwardChannelRequestPool.prototype.hasRequest = function(req) {\n  if (this.request_) {\n    return this.request_ == req;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.has(req);\n  }\n\n  return false;\n};\n\n\n/**\n * Adds a new request to the pool.\n *\n * @param {!ChannelRequest} req The new channel request.\n */\nForwardChannelRequestPool.prototype.addRequest = function(req) {\n  if (this.requestPool_) {\n    this.requestPool_.add(req);\n  } else {\n    this.request_ = req;\n  }\n};\n\n\n/**\n * Removes the given request from the pool.\n *\n * @param {ChannelRequest} req The channel request.\n * @return {boolean} Whether the request has been removed from the pool.\n */\nForwardChannelRequestPool.prototype.removeRequest = function(req) {\n  if (this.request_ && this.request_ == req) {\n    this.request_ = null;\n    return true;\n  }\n\n  if (this.requestPool_ && this.requestPool_.has(req)) {\n    this.requestPool_.delete(req);\n    return true;\n  }\n\n  return false;\n};\n\n\n/**\n * Clears the pool and cancel all the pending requests.\n */\nForwardChannelRequestPool.prototype.cancel = function() {\n  // save any pending messages\n  this.pendingMessages_ = this.getPendingMessages();\n\n  if (this.request_) {\n    this.request_.cancel();\n    this.request_ = null;\n    return;\n  }\n\n  if (this.requestPool_ && this.requestPool_.size !== 0) {\n    for (const val of this.requestPool_.values()) {\n      val.cancel();\n    }\n    this.requestPool_.clear();\n  }\n};\n\n\n/**\n * @return {boolean} Whether there are any pending requests.\n */\nForwardChannelRequestPool.prototype.hasPendingRequest = function() {\n  return (this.request_ != null) ||\n      (this.requestPool_ != null && this.requestPool_.size !== 0);\n};\n\n\n/**\n * @return {!Array<Wire.QueuedMap>} All the pending messages from the pool,\n *     as a new array.\n */\nForwardChannelRequestPool.prototype.getPendingMessages = function() {\n  if (this.request_ != null) {\n    return this.pendingMessages_.concat(this.request_.getPendingMessages());\n  }\n\n  if (this.requestPool_ != null && this.requestPool_.size !== 0) {\n    let result = this.pendingMessages_;\n    for (const val of this.requestPool_.values()) {\n      result = result.concat(val.getPendingMessages());\n    }\n    return result;\n  }\n\n  return array.clone(this.pendingMessages_);\n};\n\n\n/**\n * Records pending messages, e.g. when a request receives a failed response.\n *\n * @param {!Array<Wire.QueuedMap>} messages Pending messages.\n */\nForwardChannelRequestPool.prototype.addPendingMessages = function(messages) {\n  this.pendingMessages_ = this.pendingMessages_.concat(messages);\n};\n\n\n/**\n * Clears any recorded pending messages.\n */\nForwardChannelRequestPool.prototype.clearPendingMessages = function() {\n  this.pendingMessages_.length = 0;\n};\n\n\n/**\n * Cancels all pending requests and force the completion of channel requests.\n *\n * Need go through the standard onRequestComplete logic to expose the max-retry\n * failure in the standard way.\n *\n * @param {function(!ChannelRequest)} onComplete The completion callback.\n * @return {boolean} true if any request has been forced to complete.\n */\nForwardChannelRequestPool.prototype.forceComplete = function(onComplete) {\n  if (this.request_ != null) {\n    this.request_.cancel();\n    onComplete(this.request_);\n    return true;\n  }\n\n  if (this.requestPool_ && this.requestPool_.size !== 0) {\n    for (const val of this.requestPool_.values()) {\n      val.cancel();\n      onComplete(val);\n    }\n    return true;\n  }\n\n  return false;\n};\n\nexports = ForwardChannelRequestPool;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Generics method for collection-like classes and objects.\n *\n *\n * This file contains functions to work with collections. It supports using\n * Map, Set, Array and Object and other classes that implement collection-like\n * methods.\n * @suppress {strictMissingProperties}\n */\n\n\ngoog.provide('goog.structs');\n\ngoog.require('goog.array');\ngoog.require('goog.object');\n\n\n// We treat an object as a dictionary if it has getKeys or it is an object that\n// isn't arrayLike.\n\n\n/**\n * Returns the number of values in the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {number} The number of values in the collection-like object.\n */\ngoog.structs.getCount = function(col) {\n  'use strict';\n  if (col.getCount && typeof col.getCount == 'function') {\n    return col.getCount();\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return col.length;\n  }\n  return goog.object.getCount(col);\n};\n\n\n/**\n * Returns the values of the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {!Array<?>} The values in the collection-like object.\n */\ngoog.structs.getValues = function(col) {\n  'use strict';\n  if (col.getValues && typeof col.getValues == 'function') {\n    return col.getValues();\n  }\n  if (typeof col === 'string') {\n    return col.split('');\n  }\n  if (goog.isArrayLike(col)) {\n    var rv = [];\n    var l = col.length;\n    for (var i = 0; i < l; i++) {\n      rv.push(col[i]);\n    }\n    return rv;\n  }\n  return goog.object.getValues(col);\n};\n\n\n/**\n * Returns the keys of the collection. Some collections have no notion of\n * keys/indexes and this function will return undefined in those cases.\n * @param {Object} col The collection-like object.\n * @return {!Array|undefined} The keys in the collection.\n */\ngoog.structs.getKeys = function(col) {\n  'use strict';\n  if (col.getKeys && typeof col.getKeys == 'function') {\n    return col.getKeys();\n  }\n  // if we have getValues but no getKeys we know this is a key-less collection\n  if (col.getValues && typeof col.getValues == 'function') {\n    return undefined;\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    var rv = [];\n    var l = col.length;\n    for (var i = 0; i < l; i++) {\n      rv.push(i);\n    }\n    return rv;\n  }\n\n  return goog.object.getKeys(col);\n};\n\n\n/**\n * Whether the collection contains the given value. This is O(n) and uses\n * equals (==) to test the existence.\n * @param {Object} col The collection-like object.\n * @param {*} val The value to check for.\n * @return {boolean} True if the map contains the value.\n */\ngoog.structs.contains = function(col, val) {\n  'use strict';\n  if (col.contains && typeof col.contains == 'function') {\n    return col.contains(val);\n  }\n  if (col.containsValue && typeof col.containsValue == 'function') {\n    return col.containsValue(val);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.contains(/** @type {!Array<?>} */ (col), val);\n  }\n  return goog.object.containsValue(col, val);\n};\n\n\n/**\n * Whether the collection is empty.\n * @param {Object} col The collection-like object.\n * @return {boolean} True if empty.\n */\ngoog.structs.isEmpty = function(col) {\n  'use strict';\n  if (col.isEmpty && typeof col.isEmpty == 'function') {\n    return col.isEmpty();\n  }\n\n  // We do not use goog.string.isEmptyOrWhitespace because here we treat the\n  // string as\n  // collection and as such even whitespace matters\n\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.isEmpty(/** @type {!Array<?>} */ (col));\n  }\n  return goog.object.isEmpty(col);\n};\n\n\n/**\n * Removes all the elements from the collection.\n * @param {Object} col The collection-like object.\n * @return {void}\n */\ngoog.structs.clear = function(col) {\n  'use strict';\n  // NOTE(arv): This should not contain strings because strings are immutable\n  if (col.clear && typeof col.clear == 'function') {\n    col.clear();\n  } else if (goog.isArrayLike(col)) {\n    goog.array.clear(/** @type {IArrayLike<?>} */ (col));\n  } else {\n    goog.object.clear(col);\n  }\n};\n\n\n/**\n * Calls a function for each value in a collection. The function takes\n * three arguments; the value, the key and the collection.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):?} f The function to call for every value.\n *     This function takes\n *     3 arguments (the value, the key or undefined if the collection has no\n *     notion of keys, and the collection) and the return value is irrelevant.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n *     within `f`.\n * @return {void}\n * @template T,S\n * @deprecated Use a more specific method, e.g. goog.array.forEach,\n *     goog.object.forEach, or for-of.\n */\ngoog.structs.forEach = function(col, f, opt_obj) {\n  'use strict';\n  if (col.forEach && typeof col.forEach == 'function') {\n    col.forEach(f, opt_obj);\n  } else if (goog.isArrayLike(col) || typeof col === 'string') {\n    goog.array.forEach(/** @type {!Array<?>} */ (col), f, opt_obj);\n  } else {\n    var keys = goog.structs.getKeys(col);\n    var values = goog.structs.getValues(col);\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n      f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col);\n    }\n  }\n};\n\n\n/**\n * Calls a function for every value in the collection. When a call returns true,\n * adds the value to a new collection (Array is returned by default).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes\n *     3 arguments (the value, the key or undefined if the collection has no\n *     notion of keys, and the collection) and should return a Boolean. If the\n *     return value is true the value is added to the result collection. If it\n *     is false the value is not included.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n *     within `f`.\n * @return {!Object|!Array<?>} A new collection where the passed values are\n *     present. If col is a key-less collection an array is returned.  If col\n *     has keys and values a plain old JS object is returned.\n * @template T,S\n */\ngoog.structs.filter = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.filter == 'function') {\n    return col.filter(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.filter(/** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n\n  var rv;\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  if (keys) {\n    rv = {};\n    for (var i = 0; i < l; i++) {\n      if (f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col)) {\n        rv[keys[i]] = values[i];\n      }\n    }\n  } else {\n    // We should not use goog.array.filter here since we want to make sure that\n    // the index is undefined as well as make sure that col is passed to the\n    // function.\n    rv = [];\n    for (var i = 0; i < l; i++) {\n      if (f.call(opt_obj, values[i], undefined, col)) {\n        rv.push(values[i]);\n      }\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Calls a function for every value in the collection and adds the result into a\n * new collection (defaults to creating a new Array).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):V} f The function to call for every value.\n *     This function takes 3 arguments (the value, the key or undefined if the\n *     collection has no notion of keys, and the collection) and should return\n *     something. The result will be used as the value in the new collection.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {!Object<V>|!Array<V>} A new collection with the new values.  If\n *     col is a key-less collection an array is returned.  If col has keys and\n *     values a plain old JS object is returned.\n * @template T,S,V\n */\ngoog.structs.map = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.map == 'function') {\n    return col.map(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.map(/** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n\n  var rv;\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  if (keys) {\n    rv = {};\n    for (var i = 0; i < l; i++) {\n      rv[keys[i]] = f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col);\n    }\n  } else {\n    // We should not use goog.array.map here since we want to make sure that\n    // the index is undefined as well as make sure that col is passed to the\n    // function.\n    rv = [];\n    for (var i = 0; i < l; i++) {\n      rv[i] = f.call(/** @type {?} */ (opt_obj), values[i], undefined, col);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Calls f for each value in a collection. If any call returns true this returns\n * true (without checking the rest). If all returns false this returns false.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes 3 arguments (the value, the key or undefined\n *     if the collection has no notion of keys, and the collection) and should\n *     return a boolean.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {boolean} True if any value passes the test.\n * @template T,S\n */\ngoog.structs.some = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.some == 'function') {\n    return col.some(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.some(/** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  for (var i = 0; i < l; i++) {\n    if (f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n      return true;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Calls f for each value in a collection. If all calls return true this return\n * true this returns true. If any returns false this returns false at this point\n *  and does not continue to check the remaining values.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes 3 arguments (the value, the key or\n *     undefined if the collection has no notion of keys, and the collection)\n *     and should return a boolean.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {boolean} True if all key-value pairs pass the test.\n * @template T,S\n */\ngoog.structs.every = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.every == 'function') {\n    return col.every(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.every(/** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  for (var i = 0; i < l; i++) {\n    if (!f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n      return false;\n    }\n  }\n  return true;\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Datastructure: Hash Map.\n *\n *\n * This file contains an implementation of a Map structure. It implements a lot\n * of the methods used in goog.structs so those functions work on hashes. This\n * is best suited for complex key types. For simple keys such as numbers and\n * strings consider using the lighter-weight utilities in goog.object.\n */\n\n\ngoog.provide('goog.structs.Map');\n\ngoog.require('goog.iter.Iterator');\ngoog.require('goog.iter.StopIteration');\n\n\n\n/**\n * Class for Hash Map datastructure.\n * @param {*=} opt_map Map or Object to initialize the map with.\n * @param {...*} var_args If 2 or more arguments are present then they\n *     will be used as key-value pairs.\n * @constructor\n * @template K, V\n * @deprecated This type is misleading: use ES6 Map instead.\n */\ngoog.structs.Map = function(opt_map, var_args) {\n  'use strict';\n  /**\n   * Underlying JS object used to implement the map.\n   * @private {!Object}\n   */\n  this.map_ = {};\n\n  /**\n   * An array of keys. This is necessary for two reasons:\n   *   1. Iterating the keys using for (var key in this.map_) allocates an\n   *      object for every key in IE which is really bad for IE6 GC perf.\n   *   2. Without a side data structure, we would need to escape all the keys\n   *      as that would be the only way we could tell during iteration if the\n   *      key was an internal key or a property of the object.\n   *\n   * This array can contain deleted keys so it's necessary to check the map\n   * as well to see if the key is still in the map (this doesn't require a\n   * memory allocation in IE).\n   * @private {!Array<string>}\n   */\n  this.keys_ = [];\n\n  /**\n   * The number of key value pairs in the map.\n   * @private {number}\n   */\n  this.count_ = 0;\n\n  /**\n   * Version used to detect changes while iterating.\n   * @private {number}\n   */\n  this.version_ = 0;\n\n  var argLength = arguments.length;\n\n  if (argLength > 1) {\n    if (argLength % 2) {\n      throw new Error('Uneven number of arguments');\n    }\n    for (var i = 0; i < argLength; i += 2) {\n      this.set(arguments[i], arguments[i + 1]);\n    }\n  } else if (opt_map) {\n    this.addAll(/** @type {!Object} */ (opt_map));\n  }\n};\n\n\n/**\n * @return {number} The number of key-value pairs in the map.\n */\ngoog.structs.Map.prototype.getCount = function() {\n  'use strict';\n  return this.count_;\n};\n\n\n/**\n * Returns the values of the map.\n * @return {!Array<V>} The values in the map.\n */\ngoog.structs.Map.prototype.getValues = function() {\n  'use strict';\n  this.cleanupKeysArray_();\n\n  var rv = [];\n  for (var i = 0; i < this.keys_.length; i++) {\n    var key = this.keys_[i];\n    rv.push(this.map_[key]);\n  }\n  return rv;\n};\n\n\n/**\n * Returns the keys of the map.\n * @return {!Array<string>} Array of string values.\n */\ngoog.structs.Map.prototype.getKeys = function() {\n  'use strict';\n  this.cleanupKeysArray_();\n  return /** @type {!Array<string>} */ (this.keys_.concat());\n};\n\n\n/**\n * Whether the map contains the given key.\n * @param {*} key The key to check for.\n * @return {boolean} Whether the map contains the key.\n */\ngoog.structs.Map.prototype.containsKey = function(key) {\n  'use strict';\n  return goog.structs.Map.hasKey_(this.map_, key);\n};\n\n\n/**\n * Whether the map contains the given value. This is O(n).\n * @param {V} val The value to check for.\n * @return {boolean} Whether the map contains the value.\n */\ngoog.structs.Map.prototype.containsValue = function(val) {\n  'use strict';\n  for (var i = 0; i < this.keys_.length; i++) {\n    var key = this.keys_[i];\n    if (goog.structs.Map.hasKey_(this.map_, key) && this.map_[key] == val) {\n      return true;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Whether this map is equal to the argument map.\n * @param {goog.structs.Map} otherMap The map against which to test equality.\n * @param {function(V, V): boolean=} opt_equalityFn Optional equality function\n *     to test equality of values. If not specified, this will test whether\n *     the values contained in each map are identical objects.\n * @return {boolean} Whether the maps are equal.\n */\ngoog.structs.Map.prototype.equals = function(otherMap, opt_equalityFn) {\n  'use strict';\n  if (this === otherMap) {\n    return true;\n  }\n\n  if (this.count_ != otherMap.getCount()) {\n    return false;\n  }\n\n  var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;\n\n  this.cleanupKeysArray_();\n  for (var key, i = 0; key = this.keys_[i]; i++) {\n    if (!equalityFn(this.get(key), otherMap.get(key))) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\n\n/**\n * Default equality test for values.\n * @param {*} a The first value.\n * @param {*} b The second value.\n * @return {boolean} Whether a and b reference the same object.\n */\ngoog.structs.Map.defaultEquals = function(a, b) {\n  'use strict';\n  return a === b;\n};\n\n\n/**\n * @return {boolean} Whether the map is empty.\n */\ngoog.structs.Map.prototype.isEmpty = function() {\n  'use strict';\n  return this.count_ == 0;\n};\n\n\n/**\n * Removes all key-value pairs from the map.\n */\ngoog.structs.Map.prototype.clear = function() {\n  'use strict';\n  this.map_ = {};\n  this.keys_.length = 0;\n  this.count_ = 0;\n  this.version_ = 0;\n};\n\n\n/**\n * Removes a key-value pair based on the key. This is O(logN) amortized due to\n * updating the keys array whenever the count becomes half the size of the keys\n * in the keys array.\n * @param {*} key  The key to remove.\n * @return {boolean} Whether object was removed.\n */\ngoog.structs.Map.prototype.remove = function(key) {\n  'use strict';\n  if (goog.structs.Map.hasKey_(this.map_, key)) {\n    delete this.map_[key];\n    this.count_--;\n    this.version_++;\n\n    // clean up the keys array if the threshold is hit\n    if (this.keys_.length > 2 * this.count_) {\n      this.cleanupKeysArray_();\n    }\n\n    return true;\n  }\n  return false;\n};\n\n\n/**\n * Cleans up the temp keys array by removing entries that are no longer in the\n * map.\n * @private\n */\ngoog.structs.Map.prototype.cleanupKeysArray_ = function() {\n  'use strict';\n  if (this.count_ != this.keys_.length) {\n    // First remove keys that are no longer in the map.\n    var srcIndex = 0;\n    var destIndex = 0;\n    while (srcIndex < this.keys_.length) {\n      var key = this.keys_[srcIndex];\n      if (goog.structs.Map.hasKey_(this.map_, key)) {\n        this.keys_[destIndex++] = key;\n      }\n      srcIndex++;\n    }\n    this.keys_.length = destIndex;\n  }\n\n  if (this.count_ != this.keys_.length) {\n    // If the count still isn't correct, that means we have duplicates. This can\n    // happen when the same key is added and removed multiple times. Now we have\n    // to allocate one extra Object to remove the duplicates. This could have\n    // been done in the first pass, but in the common case, we can avoid\n    // allocating an extra object by only doing this when necessary.\n    var seen = {};\n    var srcIndex = 0;\n    var destIndex = 0;\n    while (srcIndex < this.keys_.length) {\n      var key = this.keys_[srcIndex];\n      if (!(goog.structs.Map.hasKey_(seen, key))) {\n        this.keys_[destIndex++] = key;\n        seen[key] = 1;\n      }\n      srcIndex++;\n    }\n    this.keys_.length = destIndex;\n  }\n};\n\n\n/**\n * Returns the value for the given key.  If the key is not found and the default\n * value is not given this will return `undefined`.\n * @param {*} key The key to get the value for.\n * @param {DEFAULT=} opt_val The value to return if no item is found for the\n *     given key, defaults to undefined.\n * @return {V|DEFAULT} The value for the given key.\n * @template DEFAULT\n */\ngoog.structs.Map.prototype.get = function(key, opt_val) {\n  'use strict';\n  if (goog.structs.Map.hasKey_(this.map_, key)) {\n    return this.map_[key];\n  }\n  return opt_val;\n};\n\n\n/**\n * Adds a key-value pair to the map.\n * @param {*} key The key.\n * @param {V} value The value to add.\n * @return {*} Some subclasses return a value.\n */\ngoog.structs.Map.prototype.set = function(key, value) {\n  'use strict';\n  if (!(goog.structs.Map.hasKey_(this.map_, key))) {\n    this.count_++;\n    // TODO(johnlenz): This class lies, it claims to return an array of string\n    // keys, but instead returns the original object used.\n    this.keys_.push(/** @type {?} */ (key));\n    // Only change the version if we add a new key.\n    this.version_++;\n  }\n  this.map_[key] = value;\n};\n\n\n/**\n * Adds multiple key-value pairs from another goog.structs.Map or Object.\n * @param {?Object} map Object containing the data to add.\n */\ngoog.structs.Map.prototype.addAll = function(map) {\n  'use strict';\n  if (map instanceof goog.structs.Map) {\n    var keys = map.getKeys();\n    for (var i = 0; i < keys.length; i++) {\n      this.set(keys[i], map.get(keys[i]));\n    }\n  } else {\n    for (var key in map) {\n      this.set(key, map[key]);\n    }\n  }\n};\n\n\n/**\n * Calls the given function on each entry in the map.\n * @param {function(this:T, V, K, goog.structs.Map<K,V>)} f\n * @param {T=} opt_obj The value of \"this\" inside f.\n * @template T\n */\ngoog.structs.Map.prototype.forEach = function(f, opt_obj) {\n  'use strict';\n  var keys = this.getKeys();\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    var value = this.get(key);\n    f.call(opt_obj, value, key, this);\n  }\n};\n\n\n/**\n * Clones a map and returns a new map.\n * @return {!goog.structs.Map} A new map with the same key-value pairs.\n */\ngoog.structs.Map.prototype.clone = function() {\n  'use strict';\n  return new goog.structs.Map(this);\n};\n\n\n/**\n * Returns a new map in which all the keys and values are interchanged\n * (keys become values and values become keys). If multiple keys map to the\n * same value, the chosen transposed value is implementation-dependent.\n *\n * It acts very similarly to {goog.object.transpose(Object)}.\n *\n * @return {!goog.structs.Map} The transposed map.\n */\ngoog.structs.Map.prototype.transpose = function() {\n  'use strict';\n  var transposed = new goog.structs.Map();\n  for (var i = 0; i < this.keys_.length; i++) {\n    var key = this.keys_[i];\n    var value = this.map_[key];\n    transposed.set(value, key);\n  }\n\n  return transposed;\n};\n\n\n/**\n * @return {!Object} Object representation of the map.\n */\ngoog.structs.Map.prototype.toObject = function() {\n  'use strict';\n  this.cleanupKeysArray_();\n  var obj = {};\n  for (var i = 0; i < this.keys_.length; i++) {\n    var key = this.keys_[i];\n    obj[key] = this.map_[key];\n  }\n  return obj;\n};\n\n\n/**\n * Returns an iterator that iterates over the keys in the map.  Removal of keys\n * while iterating might have undesired side effects.\n * @return {!goog.iter.Iterator} An iterator over the keys in the map.\n */\ngoog.structs.Map.prototype.getKeyIterator = function() {\n  'use strict';\n  return this.__iterator__(true);\n};\n\n\n/**\n * Returns an iterator that iterates over the values in the map.  Removal of\n * keys while iterating might have undesired side effects.\n * @return {!goog.iter.Iterator} An iterator over the values in the map.\n */\ngoog.structs.Map.prototype.getValueIterator = function() {\n  'use strict';\n  return this.__iterator__(false);\n};\n\n\n/**\n * Returns an iterator that iterates over the values or the keys in the map.\n * This throws an exception if the map was mutated since the iterator was\n * created.\n * @param {boolean=} opt_keys True to iterate over the keys. False to iterate\n *     over the values.  The default value is false.\n * @return {!goog.iter.Iterator} An iterator over the values or keys in the map.\n */\ngoog.structs.Map.prototype.__iterator__ = function(opt_keys) {\n  'use strict';\n  // Clean up keys to minimize the risk of iterating over dead keys.\n  this.cleanupKeysArray_();\n\n  var i = 0;\n  var version = this.version_;\n  var selfObj = this;\n\n  var newIter = new goog.iter.Iterator;\n  newIter.next = function() {\n    'use strict';\n    if (version != selfObj.version_) {\n      throw new Error('The map has changed since the iterator was created');\n    }\n    if (i >= selfObj.keys_.length) {\n      throw goog.iter.StopIteration;\n    }\n    var key = selfObj.keys_[i++];\n    return opt_keys ? key : selfObj.map_[key];\n  };\n  return newIter;\n};\n\n\n/**\n * Safe way to test for hasOwnProperty.  It even allows testing for\n * 'hasOwnProperty'.\n * @param {!Object} obj The object to test for presence of the given key.\n * @param {*} key The key to check for.\n * @return {boolean} Whether the object has the key.\n * @private\n */\ngoog.structs.Map.hasKey_ = function(obj, key) {\n  'use strict';\n  return Object.prototype.hasOwnProperty.call(obj, key);\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Simple utilities for dealing with URI strings.\n *\n * This package is deprecated in favour of the Closure URL package (goog.url)\n * when manipulating URIs for use by a browser. This package uses regular\n * expressions to parse a potential URI which can fall out of sync with how a\n * browser will actually interpret the URI. See\n * `goog.uri.utils.setUrlPackageSupportLoggingHandler` for one way to identify\n * URIs that should instead be parsed using the URL package.\n *\n * This is intended to be a lightweight alternative to constructing goog.Uri\n * objects.  Whereas goog.Uri adds several kilobytes to the binary regardless\n * of how much of its functionality you use, this is designed to be a set of\n * mostly-independent utilities so that the compiler includes only what is\n * necessary for the task.  Estimated savings of porting is 5k pre-gzip and\n * 1.5k post-gzip.  To ensure the savings remain, future developers should\n * avoid adding new functionality to existing functions, but instead create\n * new ones and factor out shared code.\n *\n * Many of these utilities have limited functionality, tailored to common\n * cases.  The query parameter utilities assume that the parameter keys are\n * already encoded, since most keys are compile-time alphanumeric strings.  The\n * query parameter mutation utilities also do not tolerate fragment identifiers.\n *\n * By design, these functions can be slower than goog.Uri equivalents.\n * Repeated calls to some of functions may be quadratic in behavior for IE,\n * although the effect is somewhat limited given the 2kb limit.\n *\n * One advantage of the limited functionality here is that this approach is\n * less sensitive to differences in URI encodings than goog.Uri, since these\n * functions operate on strings directly, rather than decoding them and\n * then re-encoding.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n *   http://www.ietf.org/rfc/rfc3986.txt\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\ngoog.provide('goog.uri.utils.QueryArray');\ngoog.provide('goog.uri.utils.QueryValue');\ngoog.provide('goog.uri.utils.StandardQueryParam');\n\ngoog.require('goog.asserts');\ngoog.require('goog.string');\n\n\n/**\n * Character codes inlined to avoid object allocations due to charCode.\n * @enum {number}\n * @private\n */\ngoog.uri.utils.CharCode_ = {\n  AMPERSAND: 38,\n  EQUAL: 61,\n  HASH: 35,\n  QUESTION: 63\n};\n\n\n/**\n * Builds a URI string from already-encoded parts.\n *\n * No encoding is performed.  Any component may be omitted as either null or\n * undefined.\n *\n * @param {?string=} opt_scheme The scheme such as 'http'.\n * @param {?string=} opt_userInfo The user name before the '@'.\n * @param {?string=} opt_domain The domain such as 'www.google.com', already\n *     URI-encoded.\n * @param {(string|number|null)=} opt_port The port number.\n * @param {?string=} opt_path The path, already URI-encoded.  If it is not\n *     empty, it must begin with a slash.\n * @param {?string=} opt_queryData The URI-encoded query data.\n * @param {?string=} opt_fragment The URI-encoded fragment identifier.\n * @return {string} The fully combined URI.\n */\ngoog.uri.utils.buildFromEncodedParts = function(\n    opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData,\n    opt_fragment) {\n  'use strict';\n  var out = '';\n\n  if (opt_scheme) {\n    out += opt_scheme + ':';\n  }\n\n  if (opt_domain) {\n    out += '//';\n\n    if (opt_userInfo) {\n      out += opt_userInfo + '@';\n    }\n\n    out += opt_domain;\n\n    if (opt_port) {\n      out += ':' + opt_port;\n    }\n  }\n\n  if (opt_path) {\n    out += opt_path;\n  }\n\n  if (opt_queryData) {\n    out += '?' + opt_queryData;\n  }\n\n  if (opt_fragment) {\n    out += '#' + opt_fragment;\n  }\n\n  return out;\n};\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n *  12            3  4          5       6  7        8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n *     http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n *    $1 = http:\n *    $2 = http\n *    $3 = //www.ics.uci.edu\n *    $4 = www.ics.uci.edu\n *    $5 = /pub/ietf/uri/\n *    $6 = <undefined>\n *    $7 = <undefined>\n *    $8 = #Related\n *    $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n *    scheme    = $2\n *    authority = $4\n *    path      = $5\n *    query     = $7\n *    fragment  = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n *    $1 = http              scheme\n *    $2 = <undefined>       userInfo -\\\n *    $3 = www.ics.uci.edu   domain     | authority\n *    $4 = <undefined>       port     -/\n *    $5 = /pub/ietf/uri/    path\n *    $6 = <undefined>       query without ?\n *    $7 = Related           fragment without #\n * </pre>\n *\n * TODO(user): separate out the authority terminating characters once this\n * file is moved to ES6.\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n    '^' +  // Anchor against the entire string.\n    '(?:' +\n    '([^:/?#.]+)' +  // scheme - ignore special characters\n                     // used by other URL parts such as :,\n                     // ?, /, #, and .\n    ':)?' +\n    '(?://' +\n    '(?:([^\\\\\\\\/?#]*)@)?' +  // userInfo\n    '([^\\\\\\\\/?#]*?)' +       // domain\n    '(?::([0-9]+))?' +       // port\n    '(?=[\\\\\\\\/?#]|$)' +      // authority-terminating character.\n    ')?' +\n    '([^?#]+)?' +          // path\n    '(?:\\\\?([^#]*))?' +    // query\n    '(?:#([\\\\s\\\\S]*))?' +  // fragment. Can't use '.*' with 's' flag as Firefox\n                           // doesn't support the flag, and can't use an\n                           // \"everything set\" ([^]) as IE10 doesn't match any\n                           // characters with it.\n    '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n  SCHEME: 1,\n  USER_INFO: 2,\n  DOMAIN: 3,\n  PORT: 4,\n  PATH: 5,\n  QUERY_DATA: 6,\n  FRAGMENT: 7\n};\n\n/**\n * @type {?function(string)}\n * @private\n */\ngoog.uri.utils.urlPackageSupportLoggingHandler_ = null;\n\n/**\n * @param {?function(string)} handler The handler function to call when a URI\n *     with a protocol that is better supported by the Closure URL package is\n *     detected.\n */\ngoog.uri.utils.setUrlPackageSupportLoggingHandler = function(handler) {\n  'use strict';\n  goog.uri.utils.urlPackageSupportLoggingHandler_ = handler;\n};\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.ComponentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array<string|undefined>} Each component still URI-encoded.\n *     Each component that is present will contain the encoded value, whereas\n *     components that are not present will be undefined or empty, depending\n *     on the browser's regular expression implementation.  Never null, since\n *     arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n  'use strict';\n  // See @return comment -- never null.\n  var result = /** @type {!Array<string|undefined>} */ (\n      uri.match(goog.uri.utils.splitRe_));\n  if (goog.uri.utils.urlPackageSupportLoggingHandler_ &&\n      ['http', 'https', 'ws', 'wss',\n       'ftp'].indexOf(result[goog.uri.utils.ComponentIndex.SCHEME]) >= 0) {\n    goog.uri.utils.urlPackageSupportLoggingHandler_(uri);\n  }\n  return result;\n};\n\n\n/**\n * @param {?string} uri A possibly null string.\n * @param {boolean=} opt_preserveReserved If true, percent-encoding of RFC-3986\n *     reserved characters will not be removed.\n * @return {?string} The string URI-decoded, or null if uri is null.\n * @private\n */\ngoog.uri.utils.decodeIfPossible_ = function(uri, opt_preserveReserved) {\n  'use strict';\n  if (!uri) {\n    return uri;\n  }\n\n  return opt_preserveReserved ? decodeURI(uri) : decodeURIComponent(uri);\n};\n\n\n/**\n * Gets a URI component by index.\n *\n * It is preferred to use the getPathEncoded() variety of functions ahead,\n * since they are more readable.\n *\n * @param {goog.uri.utils.ComponentIndex} componentIndex The component index.\n * @param {string} uri The URI to examine.\n * @return {?string} The still-encoded component, or null if the component\n *     is not present.\n * @private\n */\ngoog.uri.utils.getComponentByIndex_ = function(componentIndex, uri) {\n  'use strict';\n  // Convert undefined, null, and empty string into null.\n  return goog.uri.utils.split(uri)[componentIndex] || null;\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The protocol or scheme, or null if none.  Does not\n *     include trailing colons or slashes.\n */\ngoog.uri.utils.getScheme = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.SCHEME, uri);\n};\n\n\n/**\n * Gets the effective scheme for the URL.  If the URL is relative then the\n * scheme is derived from the page's location.\n * @param {string} uri The URI to examine.\n * @return {string} The protocol or scheme, always lower case.\n */\ngoog.uri.utils.getEffectiveScheme = function(uri) {\n  'use strict';\n  var scheme = goog.uri.utils.getScheme(uri);\n  if (!scheme && goog.global.self && goog.global.self.location) {\n    var protocol = goog.global.self.location.protocol;\n    scheme = protocol.substr(0, protocol.length - 1);\n  }\n  // NOTE: When called from a web worker in Firefox 3.5, location may be null.\n  // All other browsers with web workers support self.location from the worker.\n  return scheme ? scheme.toLowerCase() : '';\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The user name still encoded, or null if none.\n */\ngoog.uri.utils.getUserInfoEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.USER_INFO, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded user info, or null if none.\n */\ngoog.uri.utils.getUserInfo = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getUserInfoEncoded(uri));\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The domain name still encoded, or null if none.\n */\ngoog.uri.utils.getDomainEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.DOMAIN, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded domain, or null if none.\n */\ngoog.uri.utils.getDomain = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getDomainEncoded(uri), true /* opt_preserveReserved */);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?number} The port number, or null if none.\n */\ngoog.uri.utils.getPort = function(uri) {\n  'use strict';\n  // Coerce to a number.  If the result of getComponentByIndex_ is null or\n  // non-numeric, the number coersion yields NaN.  This will then return\n  // null for all non-numeric cases (though also zero, which isn't a relevant\n  // port number).\n  return Number(\n             goog.uri.utils.getComponentByIndex_(\n                 goog.uri.utils.ComponentIndex.PORT, uri)) ||\n      null;\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The path still encoded, or null if none. Includes the\n *     leading slash, if any.\n */\ngoog.uri.utils.getPathEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.PATH, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded path, or null if none.  Includes the leading\n *     slash, if any.\n */\ngoog.uri.utils.getPath = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getPathEncoded(uri), true /* opt_preserveReserved */);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The query data still encoded, or null if none.  Does not\n *     include the question mark itself.\n */\ngoog.uri.utils.getQueryData = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.QUERY_DATA, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The fragment identifier, or null if none.  Does not\n *     include the hash mark itself.\n */\ngoog.uri.utils.getFragmentEncoded = function(uri) {\n  'use strict';\n  // The hash mark may not appear in any other part of the URL.\n  var hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? null : uri.substr(hashIndex + 1);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @param {?string} fragment The encoded fragment identifier, or null if none.\n *     Does not include the hash mark itself.\n * @return {string} The URI with the fragment set.\n */\ngoog.uri.utils.setFragmentEncoded = function(uri, fragment) {\n  'use strict';\n  return goog.uri.utils.removeFragment(uri) + (fragment ? '#' + fragment : '');\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded fragment identifier, or null if none.  Does\n *     not include the hash mark.\n */\ngoog.uri.utils.getFragment = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getFragmentEncoded(uri));\n};\n\n\n/**\n * Extracts everything up to the port of the URI.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\ngoog.uri.utils.getHost = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      pieces[goog.uri.utils.ComponentIndex.SCHEME],\n      pieces[goog.uri.utils.ComponentIndex.USER_INFO],\n      pieces[goog.uri.utils.ComponentIndex.DOMAIN],\n      pieces[goog.uri.utils.ComponentIndex.PORT]);\n};\n\n\n/**\n * Returns the origin for a given URL.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\ngoog.uri.utils.getOrigin = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      pieces[goog.uri.utils.ComponentIndex.SCHEME], null /* opt_userInfo */,\n      pieces[goog.uri.utils.ComponentIndex.DOMAIN],\n      pieces[goog.uri.utils.ComponentIndex.PORT]);\n};\n\n\n/**\n * Extracts the path of the URL and everything after.\n * @param {string} uri The URI string.\n * @return {string} The URI, starting at the path and including the query\n *     parameters and fragment identifier.\n */\ngoog.uri.utils.getPathAndAfter = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      null, null, null, null, pieces[goog.uri.utils.ComponentIndex.PATH],\n      pieces[goog.uri.utils.ComponentIndex.QUERY_DATA],\n      pieces[goog.uri.utils.ComponentIndex.FRAGMENT]);\n};\n\n\n/**\n * Gets the URI with the fragment identifier removed.\n * @param {string} uri The URI to examine.\n * @return {string} Everything preceding the hash mark.\n */\ngoog.uri.utils.removeFragment = function(uri) {\n  'use strict';\n  // The hash mark may not appear in any other part of the URL.\n  var hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? uri : uri.substr(0, hashIndex);\n};\n\n\n/**\n * Ensures that two URI's have the exact same domain, scheme, and port.\n *\n * Unlike the version in goog.Uri, this checks protocol, and therefore is\n * suitable for checking against the browser's same-origin policy.\n *\n * @param {string} uri1 The first URI.\n * @param {string} uri2 The second URI.\n * @return {boolean} Whether they have the same scheme, domain and port.\n */\ngoog.uri.utils.haveSameDomain = function(uri1, uri2) {\n  'use strict';\n  var pieces1 = goog.uri.utils.split(uri1);\n  var pieces2 = goog.uri.utils.split(uri2);\n  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] ==\n      pieces2[goog.uri.utils.ComponentIndex.DOMAIN] &&\n      pieces1[goog.uri.utils.ComponentIndex.SCHEME] ==\n      pieces2[goog.uri.utils.ComponentIndex.SCHEME] &&\n      pieces1[goog.uri.utils.ComponentIndex.PORT] ==\n      pieces2[goog.uri.utils.ComponentIndex.PORT];\n};\n\n\n/**\n * Asserts that there are no fragment or query identifiers, only in uncompiled\n * mode.\n * @param {string} uri The URI to examine.\n * @private\n */\ngoog.uri.utils.assertNoFragmentsOrQueries_ = function(uri) {\n  'use strict';\n  goog.asserts.assert(\n      uri.indexOf('#') < 0 && uri.indexOf('?') < 0,\n      'goog.uri.utils: Fragment or query identifiers are not supported: [%s]',\n      uri);\n};\n\n\n/**\n * Supported query parameter values by the parameter serializing utilities.\n *\n * If a value is null or undefined, the key-value pair is skipped, as an easy\n * way to omit parameters conditionally.  Non-array parameters are converted\n * to a string and URI encoded.  Array values are expanded into multiple\n * &key=value pairs, with each element stringized and URI-encoded.\n *\n * @typedef {*}\n */\ngoog.uri.utils.QueryValue;\n\n\n/**\n * An array representing a set of query parameters with alternating keys\n * and values.\n *\n * Keys are assumed to be URI encoded already and live at even indices.  See\n * goog.uri.utils.QueryValue for details on how parameter values are encoded.\n *\n * Example:\n * <pre>\n * var data = [\n *   // Simple param: ?name=BobBarker\n *   'name', 'BobBarker',\n *   // Conditional param -- may be omitted entirely.\n *   'specialDietaryNeeds', hasDietaryNeeds() ? getDietaryNeeds() : null,\n *   // Multi-valued param: &house=LosAngeles&house=NewYork&house=null\n *   'house', ['LosAngeles', 'NewYork', null]\n * ];\n * </pre>\n *\n * @typedef {!Array<string|goog.uri.utils.QueryValue>}\n */\ngoog.uri.utils.QueryArray;\n\n\n/**\n * Parses encoded query parameters and calls callback function for every\n * parameter found in the string.\n *\n * Missing value of parameter (e.g. \u201C\u2026&key&\u2026\u201D) is treated as if the value was an\n * empty string.  Keys may be empty strings (e.g. \u201C\u2026&=value&\u2026\u201D) which also means\n * that \u201C\u2026&=&\u2026\u201D and \u201C\u2026&&\u2026\u201D will result in an empty key and value.\n *\n * @param {string} encodedQuery Encoded query string excluding question mark at\n *     the beginning.\n * @param {function(string, string)} callback Function called for every\n *     parameter found in query string.  The first argument (name) will not be\n *     urldecoded (so the function is consistent with buildQueryData), but the\n *     second will.  If the parameter has no value (i.e. \u201C=\u201D was not present)\n *     the second argument (value) will be an empty string.\n */\ngoog.uri.utils.parseQueryData = function(encodedQuery, callback) {\n  'use strict';\n  if (!encodedQuery) {\n    return;\n  }\n  var pairs = encodedQuery.split('&');\n  for (var i = 0; i < pairs.length; i++) {\n    var indexOfEquals = pairs[i].indexOf('=');\n    var name = null;\n    var value = null;\n    if (indexOfEquals >= 0) {\n      name = pairs[i].substring(0, indexOfEquals);\n      value = pairs[i].substring(indexOfEquals + 1);\n    } else {\n      name = pairs[i];\n    }\n    callback(name, value ? goog.string.urlDecode(value) : '');\n  }\n};\n\n\n/**\n * Split the URI into 3 parts where the [1] is the queryData without a leading\n * '?'. For example, the URI http://foo.com/bar?a=b#abc returns\n * ['http://foo.com/bar','a=b','#abc'].\n * @param {string} uri The URI to parse.\n * @return {!Array<string>} An array representation of uri of length 3 where the\n *     middle value is the queryData without a leading '?'.\n * @private\n */\ngoog.uri.utils.splitQueryData_ = function(uri) {\n  'use strict';\n  // Find the query data and hash.\n  var hashIndex = uri.indexOf('#');\n  if (hashIndex < 0) {\n    hashIndex = uri.length;\n  }\n  var questionIndex = uri.indexOf('?');\n  var queryData;\n  if (questionIndex < 0 || questionIndex > hashIndex) {\n    questionIndex = hashIndex;\n    queryData = '';\n  } else {\n    queryData = uri.substring(questionIndex + 1, hashIndex);\n  }\n  return [uri.substr(0, questionIndex), queryData, uri.substr(hashIndex)];\n};\n\n\n/**\n * Join an array created by splitQueryData_ back into a URI.\n * @param {!Array<string>} parts A URI in the form generated by splitQueryData_.\n * @return {string} The joined URI.\n * @private\n */\ngoog.uri.utils.joinQueryData_ = function(parts) {\n  'use strict';\n  return parts[0] + (parts[1] ? '?' + parts[1] : '') + parts[2];\n};\n\n\n/**\n * @param {string} queryData\n * @param {string} newData\n * @return {string}\n * @private\n */\ngoog.uri.utils.appendQueryData_ = function(queryData, newData) {\n  'use strict';\n  if (!newData) {\n    return queryData;\n  }\n  return queryData ? queryData + '&' + newData : newData;\n};\n\n\n/**\n * @param {string} uri\n * @param {string} queryData\n * @return {string}\n * @private\n */\ngoog.uri.utils.appendQueryDataToUri_ = function(uri, queryData) {\n  'use strict';\n  if (!queryData) {\n    return uri;\n  }\n  var parts = goog.uri.utils.splitQueryData_(uri);\n  parts[1] = goog.uri.utils.appendQueryData_(parts[1], queryData);\n  return goog.uri.utils.joinQueryData_(parts);\n};\n\n\n/**\n * Appends key=value pairs to an array, supporting multi-valued objects.\n * @param {*} key The key prefix.\n * @param {goog.uri.utils.QueryValue} value The value to serialize.\n * @param {!Array<string>} pairs The array to which the 'key=value' strings\n *     should be appended.\n * @private\n */\ngoog.uri.utils.appendKeyValuePairs_ = function(key, value, pairs) {\n  'use strict';\n  goog.asserts.assertString(key);\n  if (Array.isArray(value)) {\n    // Convince the compiler it's an array.\n    goog.asserts.assertArray(value);\n    for (var j = 0; j < value.length; j++) {\n      // Convert to string explicitly, to short circuit the null and array\n      // logic in this function -- this ensures that null and undefined get\n      // written as literal 'null' and 'undefined', and arrays don't get\n      // expanded out but instead encoded in the default way.\n      goog.uri.utils.appendKeyValuePairs_(key, String(value[j]), pairs);\n    }\n  } else if (value != null) {\n    // Skip a top-level null or undefined entirely.\n    pairs.push(\n        key +\n        // Check for empty string. Zero gets encoded into the url as literal\n        // strings.  For empty string, skip the equal sign, to be consistent\n        // with UriBuilder.java.\n        (value === '' ? '' : '=' + goog.string.urlEncode(value)));\n  }\n};\n\n\n/**\n * Builds a query data string from a sequence of alternating keys and values.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!IArrayLike<string|goog.uri.utils.QueryValue>} keysAndValues\n *     Alternating keys and values. See the QueryArray typedef.\n * @param {number=} opt_startIndex A start offset into the arary, defaults to 0.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\ngoog.uri.utils.buildQueryData = function(keysAndValues, opt_startIndex) {\n  'use strict';\n  goog.asserts.assert(\n      Math.max(keysAndValues.length - (opt_startIndex || 0), 0) % 2 == 0,\n      'goog.uri.utils: Key/value lists must be even in length.');\n\n  var params = [];\n  for (var i = opt_startIndex || 0; i < keysAndValues.length; i += 2) {\n    var key = /** @type {string} */ (keysAndValues[i]);\n    goog.uri.utils.appendKeyValuePairs_(key, keysAndValues[i + 1], params);\n  }\n  return params.join('&');\n};\n\n\n/**\n * Builds a query data string from a map.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!Object<string, goog.uri.utils.QueryValue>} map An object where keys\n *     are URI-encoded parameter keys, and the values are arbitrary types\n *     or arrays. Keys with a null value are dropped.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\ngoog.uri.utils.buildQueryDataFromMap = function(map) {\n  'use strict';\n  var params = [];\n  for (var key in map) {\n    goog.uri.utils.appendKeyValuePairs_(key, map[key], params);\n  }\n  return params.join('&');\n};\n\n\n/**\n * Appends URI parameters to an existing URI.\n *\n * The variable arguments may contain alternating keys and values.  Keys are\n * assumed to be already URI encoded.  The values should not be URI-encoded,\n * and will instead be encoded by this function.\n * <pre>\n * appendParams('http://www.foo.com?existing=true',\n *     'key1', 'value1',\n *     'key2', 'value?willBeEncoded',\n *     'key3', ['valueA', 'valueB', 'valueC'],\n *     'key4', null);\n * result: 'http://www.foo.com?existing=true&' +\n *     'key1=value1&' +\n *     'key2=value%3FwillBeEncoded&' +\n *     'key3=valueA&key3=valueB&key3=valueC'\n * </pre>\n *\n * A single call to this function will not exhibit quadratic behavior in IE,\n * whereas multiple repeated calls may, although the effect is limited by\n * fact that URL's generally can't exceed 2kb.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {...(goog.uri.utils.QueryArray|goog.uri.utils.QueryValue)}\n * var_args\n *     An array or argument list conforming to goog.uri.utils.QueryArray.\n * @return {string} The URI with all query parameters added.\n */\ngoog.uri.utils.appendParams = function(uri, var_args) {\n  'use strict';\n  var queryData = arguments.length == 2 ?\n      goog.uri.utils.buildQueryData(arguments[1], 0) :\n      goog.uri.utils.buildQueryData(arguments, 1);\n  return goog.uri.utils.appendQueryDataToUri_(uri, queryData);\n};\n\n\n/**\n * Appends query parameters from a map.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {!Object<goog.uri.utils.QueryValue>} map An object where keys are\n *     URI-encoded parameter keys, and the values are arbitrary types or arrays.\n *     Keys with a null value are dropped.\n * @return {string} The new parameters.\n */\ngoog.uri.utils.appendParamsFromMap = function(uri, map) {\n  'use strict';\n  var queryData = goog.uri.utils.buildQueryDataFromMap(map);\n  return goog.uri.utils.appendQueryDataToUri_(uri, queryData);\n};\n\n\n/**\n * Appends a single URI parameter.\n *\n * Repeated calls to this can exhibit quadratic behavior in IE6 due to the\n * way string append works, though it should be limited given the 2kb limit.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} key The key, which must already be URI encoded.\n * @param {*=} opt_value The value, which will be stringized and encoded\n *     (assumed not already to be encoded).  If omitted, undefined, or null, the\n *     key will be added as a valueless parameter.\n * @return {string} The URI with the query parameter added.\n */\ngoog.uri.utils.appendParam = function(uri, key, opt_value) {\n  'use strict';\n  var value = (opt_value != null) ? '=' + goog.string.urlEncode(opt_value) : '';\n  return goog.uri.utils.appendQueryDataToUri_(uri, key + value);\n};\n\n\n/**\n * Finds the next instance of a query parameter with the specified name.\n *\n * Does not instantiate any objects.\n *\n * @param {string} uri The URI to search.  May contain a fragment identifier\n *     if opt_hashIndex is specified.\n * @param {number} startIndex The index to begin searching for the key at.  A\n *     match may be found even if this is one character after the ampersand.\n * @param {string} keyEncoded The URI-encoded key.\n * @param {number} hashOrEndIndex Index to stop looking at.  If a hash\n *     mark is present, it should be its index, otherwise it should be the\n *     length of the string.\n * @return {number} The position of the first character in the key's name,\n *     immediately after either a question mark or a dot.\n * @private\n */\ngoog.uri.utils.findParam_ = function(\n    uri, startIndex, keyEncoded, hashOrEndIndex) {\n  'use strict';\n  var index = startIndex;\n  var keyLength = keyEncoded.length;\n\n  // Search for the key itself and post-filter for surronuding punctuation,\n  // rather than expensively building a regexp.\n  while ((index = uri.indexOf(keyEncoded, index)) >= 0 &&\n         index < hashOrEndIndex) {\n    var precedingChar = uri.charCodeAt(index - 1);\n    // Ensure that the preceding character is '&' or '?'.\n    if (precedingChar == goog.uri.utils.CharCode_.AMPERSAND ||\n        precedingChar == goog.uri.utils.CharCode_.QUESTION) {\n      // Ensure the following character is '&', '=', '#', or NaN\n      // (end of string).\n      var followingChar = uri.charCodeAt(index + keyLength);\n      if (!followingChar || followingChar == goog.uri.utils.CharCode_.EQUAL ||\n          followingChar == goog.uri.utils.CharCode_.AMPERSAND ||\n          followingChar == goog.uri.utils.CharCode_.HASH) {\n        return index;\n      }\n    }\n    index += keyLength + 1;\n  }\n\n  return -1;\n};\n\n\n/**\n * Regular expression for finding a hash mark or end of string.\n * @type {RegExp}\n * @private\n */\ngoog.uri.utils.hashOrEndRe_ = /#|$/;\n\n\n/**\n * Determines if the URI contains a specific key.\n *\n * Performs no object instantiations.\n *\n * @param {string} uri The URI to process.  May contain a fragment\n *     identifier.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {boolean} Whether the key is present.\n */\ngoog.uri.utils.hasParam = function(uri, keyEncoded) {\n  'use strict';\n  return goog.uri.utils.findParam_(\n             uri, 0, keyEncoded, uri.search(goog.uri.utils.hashOrEndRe_)) >= 0;\n};\n\n\n/**\n * Gets the first value of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {?string} The first value of the parameter (URI-decoded), or null\n *     if the parameter is not found.\n */\ngoog.uri.utils.getParamValue = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var foundIndex =\n      goog.uri.utils.findParam_(uri, 0, keyEncoded, hashOrEndIndex);\n\n  if (foundIndex < 0) {\n    return null;\n  } else {\n    var endPosition = uri.indexOf('&', foundIndex);\n    if (endPosition < 0 || endPosition > hashOrEndIndex) {\n      endPosition = hashOrEndIndex;\n    }\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    // Use substr, because it (unlike substring) will return empty string\n    // if foundIndex > endPosition.\n    return goog.string.urlDecode(\n        uri.substr(foundIndex, endPosition - foundIndex));\n  }\n};\n\n\n/**\n * Gets all values of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {!Array<string>} All URI-decoded values with the given key.\n *     If the key is not found, this will have length 0, but never be null.\n */\ngoog.uri.utils.getParamValues = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var position = 0;\n  var foundIndex;\n  var result = [];\n\n  while ((foundIndex = goog.uri.utils.findParam_(\n              uri, position, keyEncoded, hashOrEndIndex)) >= 0) {\n    // Find where this parameter ends, either the '&' or the end of the\n    // query parameters.\n    position = uri.indexOf('&', foundIndex);\n    if (position < 0 || position > hashOrEndIndex) {\n      position = hashOrEndIndex;\n    }\n\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    // Use substr, because it (unlike substring) will return empty string\n    // if foundIndex > position.\n    result.push(\n        goog.string.urlDecode(uri.substr(foundIndex, position - foundIndex)));\n  }\n\n  return result;\n};\n\n\n/**\n * Regexp to find trailing question marks and ampersands.\n * @type {RegExp}\n * @private\n */\ngoog.uri.utils.trailingQueryPunctuationRe_ = /[?&]($|#)/;\n\n\n/**\n * Removes all instances of a query parameter.\n * @param {string} uri The URI to process.  Must not contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.\n * @return {string} The URI with all instances of the parameter removed.\n */\ngoog.uri.utils.removeParam = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var position = 0;\n  var foundIndex;\n  var buffer = [];\n\n  // Look for a query parameter.\n  while ((foundIndex = goog.uri.utils.findParam_(\n              uri, position, keyEncoded, hashOrEndIndex)) >= 0) {\n    // Get the portion of the query string up to, but not including, the ?\n    // or & starting the parameter.\n    buffer.push(uri.substring(position, foundIndex));\n    // Progress to immediately after the '&'.  If not found, go to the end.\n    // Avoid including the hash mark.\n    position = Math.min(\n        (uri.indexOf('&', foundIndex) + 1) || hashOrEndIndex, hashOrEndIndex);\n  }\n\n  // Append everything that is remaining.\n  buffer.push(uri.substr(position));\n\n  // Join the buffer, and remove trailing punctuation that remains.\n  return buffer.join('').replace(\n      goog.uri.utils.trailingQueryPunctuationRe_, '$1');\n};\n\n\n/**\n * Replaces all existing definitions of a parameter with a single definition.\n *\n * Repeated calls to this can exhibit quadratic behavior due to the need to\n * find existing instances and reconstruct the string, though it should be\n * limited given the 2kb limit.  Consider using appendParams or setParamsFromMap\n * to update multiple parameters in bulk.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} keyEncoded The key, which must already be URI encoded.\n * @param {*} value The value, which will be stringized and encoded (assumed\n *     not already to be encoded).\n * @return {string} The URI with the query parameter added.\n */\ngoog.uri.utils.setParam = function(uri, keyEncoded, value) {\n  'use strict';\n  return goog.uri.utils.appendParam(\n      goog.uri.utils.removeParam(uri, keyEncoded), keyEncoded, value);\n};\n\n\n/**\n * Effeciently set or remove multiple query parameters in a URI. Order of\n * unchanged parameters will not be modified, all updated parameters will be\n * appended to the end of the query. Params with values of null or undefined are\n * removed.\n *\n * @param {string} uri The URI to process.\n * @param {!Object<string, goog.uri.utils.QueryValue>} params A list of\n *     parameters to update. If null or undefined, the param will be removed.\n * @return {string} An updated URI where the query data has been updated with\n *     the params.\n */\ngoog.uri.utils.setParamsFromMap = function(uri, params) {\n  'use strict';\n  var parts = goog.uri.utils.splitQueryData_(uri);\n  var queryData = parts[1];\n  var buffer = [];\n  if (queryData) {\n    queryData.split('&').forEach(function(pair) {\n      'use strict';\n      var indexOfEquals = pair.indexOf('=');\n      var name = indexOfEquals >= 0 ? pair.substr(0, indexOfEquals) : pair;\n      if (!params.hasOwnProperty(name)) {\n        buffer.push(pair);\n      }\n    });\n  }\n  parts[1] = goog.uri.utils.appendQueryData_(\n      buffer.join('&'), goog.uri.utils.buildQueryDataFromMap(params));\n  return goog.uri.utils.joinQueryData_(parts);\n};\n\n\n/**\n * Generates a URI path using a given URI and a path with checks to\n * prevent consecutive \"//\". The baseUri passed in must not contain\n * query or fragment identifiers. The path to append may not contain query or\n * fragment identifiers.\n *\n * @param {string} baseUri URI to use as the base.\n * @param {string} path Path to append.\n * @return {string} Updated URI.\n */\ngoog.uri.utils.appendPath = function(baseUri, path) {\n  'use strict';\n  goog.uri.utils.assertNoFragmentsOrQueries_(baseUri);\n\n  // Remove any trailing '/'\n  if (goog.string.endsWith(baseUri, '/')) {\n    baseUri = baseUri.substr(0, baseUri.length - 1);\n  }\n  // Remove any leading '/'\n  if (goog.string.startsWith(path, '/')) {\n    path = path.substr(1);\n  }\n  return '' + baseUri + '/' + path;\n};\n\n\n/**\n * Replaces the path.\n * @param {string} uri URI to use as the base.\n * @param {string} path New path.\n * @return {string} Updated URI.\n */\ngoog.uri.utils.setPath = function(uri, path) {\n  'use strict';\n  // Add any missing '/'.\n  if (!goog.string.startsWith(path, '/')) {\n    path = '/' + path;\n  }\n  var parts = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      parts[goog.uri.utils.ComponentIndex.SCHEME],\n      parts[goog.uri.utils.ComponentIndex.USER_INFO],\n      parts[goog.uri.utils.ComponentIndex.DOMAIN],\n      parts[goog.uri.utils.ComponentIndex.PORT], path,\n      parts[goog.uri.utils.ComponentIndex.QUERY_DATA],\n      parts[goog.uri.utils.ComponentIndex.FRAGMENT]);\n};\n\n\n/**\n * Standard supported query parameters.\n * @enum {string}\n */\ngoog.uri.utils.StandardQueryParam = {\n\n  /** Unused parameter for unique-ifying. */\n  RANDOM: 'zx'\n};\n\n\n/**\n * Sets the zx parameter of a URI to a random value.\n * @param {string} uri Any URI.\n * @return {string} That URI with the \"zx\" parameter added or replaced to\n *     contain a random string.\n */\ngoog.uri.utils.makeUnique = function(uri) {\n  'use strict';\n  return goog.uri.utils.setParam(\n      uri, goog.uri.utils.StandardQueryParam.RANDOM,\n      goog.string.getRandomString());\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Interface and shared data structures for implementing\n * different wire protocol versions.\n */\ngoog.provide('goog.labs.net.webChannel.Wire');\ngoog.provide('goog.labs.net.webChannel.Wire.QueuedMap');\n\ngoog.requireType('goog.structs.Map');\n\n\n\n/**\n * The interface class.\n * @interface\n */\ngoog.labs.net.webChannel.Wire = class {\n  constructor() {}\n};\n\n\n/**\n * The latest protocol version that this class supports. We request this version\n * from the server when opening the connection. Should match\n * LATEST_CHANNEL_VERSION on the server code.\n * @type {number}\n */\ngoog.labs.net.webChannel.Wire.LATEST_CHANNEL_VERSION = 8;\n\n\n/**\n * The JSON field key for the raw data wrapper object.\n * @type {string}\n */\ngoog.labs.net.webChannel.Wire.RAW_DATA_KEY = '__data__';\n\n\n\n/**\n * Simple container class for a (mapId, map) pair.\n */\ngoog.labs.net.webChannel.Wire.QueuedMap = class {\n  /**\n   * @param {number} mapId The id for this map.\n   * @param {!Object|!goog.structs.Map} map The map itself.\n   * @param {!Object=} opt_context The context associated with the map.\n   */\n  constructor(mapId, map, opt_context) {\n    'use strict';\n    /**\n     * The id for this map.\n     * @type {number}\n     */\n    this.mapId = mapId;\n\n    /**\n     * The map itself.\n     * @type {!Object|!goog.structs.Map}\n     */\n    this.map = map;\n\n    /**\n     * The context for the map.\n     * @type {Object}\n     */\n    this.context = opt_context || null;\n  }\n\n  /**\n   * @return {number|undefined} the size of the raw JSON message or\n   * undefined if the message is not encoded as a raw JSON message\n   */\n  getRawDataSize() {\n    'use strict';\n    if (goog.labs.net.webChannel.Wire.RAW_DATA_KEY in this.map) {\n      const data = this.map[goog.labs.net.webChannel.Wire.RAW_DATA_KEY];\n      if (typeof data === 'string') {\n        return data.length;\n      }\n    }\n\n    return undefined;\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\n/**\n * @fileoverview Defines a class for parsing JSON using the browser's built in\n * JSON library.\n * @suppress {missingRequire} TODO(user): this shouldn't be needed\n */\n\ngoog.provide('goog.json.NativeJsonProcessor');\n\ngoog.require('goog.asserts');\ngoog.require('goog.json.Processor');\n\n\n\n/**\n * A class that parses and stringifies JSON using the browser's built-in JSON\n * library, if it is available.\n *\n * Note that the native JSON api has subtle differences across browsers, so\n * use this implementation with care.  See json_test#assertSerialize\n * for details on the differences from goog.json.\n *\n * This implementation is signficantly faster than goog.json, at least on\n * Chrome.  See json_perf.html for a perf test showing the difference.\n *\n * @param {?goog.json.Replacer=} opt_replacer An optional replacer to use during\n *     serialization.\n * @param {?goog.json.Reviver=} opt_reviver An optional reviver to use during\n *     parsing.\n * @constructor\n * @implements {goog.json.Processor}\n * @final\n */\ngoog.json.NativeJsonProcessor = function(opt_replacer, opt_reviver) {\n  'use strict';\n  goog.asserts.assert(goog.global['JSON'] !== undefined, 'JSON not defined');\n\n  /**\n   * @type {goog.json.Replacer|null|undefined}\n   * @private\n   */\n  this.replacer_ = opt_replacer;\n\n  /**\n   * @type {goog.json.Reviver|null|undefined}\n   * @private\n   */\n  this.reviver_ = opt_reviver;\n};\n\n\n/** @override */\ngoog.json.NativeJsonProcessor.prototype.stringify = function(object) {\n  'use strict';\n  return goog.global['JSON'].stringify(object, this.replacer_);\n};\n\n\n/** @override */\ngoog.json.NativeJsonProcessor.prototype.parse = function(s) {\n  'use strict';\n  return goog.global['JSON'].parse(s, this.reviver_);\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utility functions for managing networking, such as\n * testing network connectivity.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.netUtils');\n\ngoog.require('goog.Uri');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\n\ngoog.scope(function() {\n'use strict';\nconst netUtils = goog.labs.net.webChannel.netUtils;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\n\n\n/**\n * Default timeout to allow for URI pings.\n * @type {number}\n */\nnetUtils.NETWORK_TIMEOUT = 10000;\n\n\n/**\n * Pings the network with an image URI to check if an error is a server error\n * or user's network error.\n *\n * The caller needs to add a 'rand' parameter to make sure the response is\n * not fulfilled by browser cache.\n *\n * @param {function(boolean)} callback The function to call back with results.\n * @param {goog.Uri=} opt_imageUri The URI (of an image) to use for the network\n *     test.\n */\nnetUtils.testNetwork = function(callback, opt_imageUri) {\n  'use strict';\n  let uri = opt_imageUri;\n  if (!uri) {\n    // default google.com image\n    uri = new goog.Uri('//www.google.com/images/cleardot.gif');\n\n    if (!(goog.global.location && goog.global.location.protocol == 'http')) {\n      uri.setScheme('https');  // e.g. chrome-extension\n    }\n    uri.makeUnique();\n  }\n\n  netUtils.testLoadImage(uri.toString(), netUtils.NETWORK_TIMEOUT, callback);\n};\n\n\n/**\n * Test loading the given image, retrying if necessary.\n * @param {string} url URL to the image.\n * @param {number} timeout Milliseconds before giving up.\n * @param {function(boolean)} callback Function to call with results.\n * @param {number} retries The number of times to retry.\n * @param {!WebChannelDebug} channelDebug The debug object\n * @param {number=} opt_pauseBetweenRetriesMS Optional number of milliseconds\n *     between retries - defaults to 0.\n */\nnetUtils.testLoadImageWithRetries = function(\n    url, timeout, callback, retries, channelDebug, opt_pauseBetweenRetriesMS) {\n  'use strict';\n  channelDebug.debug('TestLoadImageWithRetries: ' + opt_pauseBetweenRetriesMS);\n  if (retries == 0) {\n    // no more retries, give up\n    callback(false);\n    return;\n  }\n\n  const pauseBetweenRetries = opt_pauseBetweenRetriesMS || 0;\n  retries--;\n  netUtils.testLoadImage(url, timeout, function(succeeded) {\n    'use strict';\n    if (succeeded) {\n      callback(true);\n    } else {\n      // try again\n      goog.global.setTimeout(function() {\n        'use strict';\n        netUtils.testLoadImageWithRetries(\n            url, timeout, callback, retries, channelDebug, pauseBetweenRetries);\n      }, pauseBetweenRetries);\n    }\n  });\n};\n\n\n/**\n * Test loading the given image.\n * @param {string} url URL to the image.\n * @param {number} timeout Milliseconds before giving up.\n * @param {function(boolean)} callback Function to call with results.\n * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration\n */\nnetUtils.testLoadImage = function(url, timeout, callback) {\n  'use strict';\n  const channelDebug = new WebChannelDebug();\n  channelDebug.debug('TestLoadImage: loading ' + url);\n  if (goog.global.Image) {\n    const img = new Image();\n    img.onload = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: loaded',\n        true, callback);\n    img.onerror = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: error',\n        false, callback);\n    img.onabort = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: abort',\n        false, callback);\n    img.ontimeout = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: timeout',\n        false, callback);\n\n    goog.global.setTimeout(function() {\n      'use strict';\n      if (img.ontimeout) {\n        img.ontimeout();\n      }\n    }, timeout);\n    img.src = url;\n  } else {\n    // log ERROR_OTHER from environements where Image is not supported\n    callback(false);\n  }\n};\n\n\n/**\n * Wrap the image callback with debug and cleanup logic.\n * @param {!WebChannelDebug} channelDebug The WebChannelDebug object.\n * @param {!Image} img The image element.\n * @param {string} debugText The debug text.\n * @param {boolean} result The result of image loading.\n * @param {function(boolean)} callback The image callback.\n * @private\n */\nnetUtils.imageCallback_ = function(\n    channelDebug, img, debugText, result, callback) {\n  'use strict';\n  try {\n    channelDebug.debug(debugText);\n    netUtils.clearImageCallbacks_(img);\n    callback(result);\n  } catch (e) {\n    channelDebug.dumpException(e);\n  }\n};\n\n\n/**\n * Clears handlers to avoid memory leaks.\n * @param {Image} img The image to clear handlers from.\n * @private\n * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration\n */\nnetUtils.clearImageCallbacks_ = function(img) {\n  'use strict';\n  img.onload = null;\n  img.onerror = null;\n  img.onabort = null;\n  img.ontimeout = null;\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.net.FetchXmlHttp');\ngoog.provide('goog.net.FetchXmlHttpFactory');\n\ngoog.require('goog.asserts');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.functions');\ngoog.require('goog.log');\ngoog.require('goog.net.XhrLike');\ngoog.require('goog.net.XmlHttpFactory');\n\n\n\n/**\n * @record\n */\ngoog.net.FetchXmlHttpFactoryOptions = function() {\n  /**\n   * @type {!WorkerGlobalScope|undefined} The Service Worker global scope.\n   */\n  this.worker;\n\n  /**\n   * @type {boolean|undefined} Whether to store the FetchXmlHttp response as an\n   * array of Uint8Arrays.  If this is true then the 'responseType' attribute\n   * must be empty.\n   */\n  this.streamBinaryChunks;\n};\n\n\n\n/**\n * Factory for creating Xhr objects that uses the native fetch() method.\n * https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n * @param {!goog.net.FetchXmlHttpFactoryOptions} opts\n * @extends {goog.net.XmlHttpFactory}\n * @struct\n * @constructor\n */\ngoog.net.FetchXmlHttpFactory = function(opts) {\n  'use strict';\n  goog.net.FetchXmlHttpFactory.base(this, 'constructor');\n\n  /** @private @final {?WorkerGlobalScope} */\n  this.worker_ = opts.worker || null;\n\n  /** @private @final {boolean} */\n  this.streamBinaryChunks_ = opts.streamBinaryChunks || false;\n\n  /** @private {!RequestCredentials|undefined} */\n  this.credentialsMode_ = undefined;\n\n  /** @private {!RequestCache|undefined} */\n  this.cacheMode_ = undefined;\n};\ngoog.inherits(goog.net.FetchXmlHttpFactory, goog.net.XmlHttpFactory);\n\n\n/** @override */\ngoog.net.FetchXmlHttpFactory.prototype.createInstance = function() {\n  'use strict';\n  const instance =\n      new goog.net.FetchXmlHttp(this.worker_, this.streamBinaryChunks_);\n  if (this.credentialsMode_) {\n    instance.setCredentialsMode(this.credentialsMode_);\n  }\n  if (this.cacheMode_) {\n    instance.setCacheMode(this.cacheMode_);\n  }\n  return instance;\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttpFactory.prototype.internalGetOptions =\n    goog.functions.constant({});\n\n\n/**\n * @param {!RequestCredentials} credentialsMode The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttpFactory.prototype.setCredentialsMode = function(\n    credentialsMode) {\n  'use strict';\n  this.credentialsMode_ = credentialsMode;\n};\n\n\n/**\n * @param {!RequestCache} cacheMode The cache mode of the Service Worker fetch.\n */\ngoog.net.FetchXmlHttpFactory.prototype.setCacheMode = function(cacheMode) {\n  'use strict';\n  this.cacheMode_ = cacheMode;\n};\n\n\n\n/**\n * FetchXmlHttp object constructor.\n * @param {?WorkerGlobalScope} worker\n * @param {boolean} streamBinaryChunks\n * @extends {goog.events.EventTarget}\n * @implements {goog.net.XhrLike}\n * @constructor\n * @struct\n */\ngoog.net.FetchXmlHttp = function(worker, streamBinaryChunks) {\n  'use strict';\n  goog.net.FetchXmlHttp.base(this, 'constructor');\n\n  /** @private @final {?WorkerGlobalScope} */\n  this.worker_ = worker;\n\n  /** @private @final {boolean} */\n  this.streamBinaryChunks_ = streamBinaryChunks;\n\n  /** @private {RequestCredentials|undefined} */\n  this.credentialsMode_ = undefined;\n\n  /** @private {RequestCache|undefined} */\n  this.cacheMode_ = undefined;\n\n  /**\n   * Request state.\n   * @type {goog.net.FetchXmlHttp.RequestState}\n   */\n  this.readyState = goog.net.FetchXmlHttp.RequestState.UNSENT;\n\n  /**\n   * HTTP status.\n   * @type {number}\n   */\n  this.status = 0;\n\n  /**\n   * HTTP status string.\n   * @type {string}\n   */\n  this.statusText = '';\n\n  /**\n   * Content of the response.\n   * @type {string|!ArrayBuffer|!Array<!Uint8Array>}\n   */\n  this.response = '';\n\n  /**\n   * Content of the response.\n   * @type {string}\n   */\n  this.responseText = '';\n\n  /**\n   * The type of the response.  If this is set to 'arraybuffer' the request will\n   * be discrete, streaming is only supported for text encoded requests.\n   * @type {string}\n   */\n  this.responseType = '';\n\n  /**\n   * Document response entity body.\n   * NOTE: This is always null and not supported by this class.\n   * @final {null}\n   */\n  this.responseXML = null;\n\n  /**\n   * Method to call when the state changes.\n   * @type {?function()}\n   */\n  this.onreadystatechange = null;\n\n  /** @private {!Headers} */\n  this.requestHeaders_ = new Headers();\n\n  /** @private {?Headers} */\n  this.responseHeaders_ = null;\n\n  /**\n   * Request method (GET or POST).\n   * @private {string}\n   */\n  this.method_ = 'GET';\n\n  /**\n   * Request URL.\n   * @private {string}\n   */\n  this.url_ = '';\n\n  /**\n   * Whether the request is in progress.\n   * @private {boolean}\n   */\n  this.inProgress_ = false;\n\n  /** @private @final {?goog.log.Logger} */\n  this.logger_ = goog.log.getLogger('goog.net.FetchXmlHttp');\n\n  /** @private {?Response} */\n  this.fetchResponse_ = null;\n\n  /** @private {!ReadableStreamDefaultReader|null} */\n  this.currentReader_ = null;\n\n  /** @private {?TextDecoder} */\n  this.textDecoder_ = null;\n};\ngoog.inherits(goog.net.FetchXmlHttp, goog.events.EventTarget);\n\n\n/**\n * State of the requests.\n * @enum {number}\n */\ngoog.net.FetchXmlHttp.RequestState = {\n  UNSENT: 0,\n  OPENED: 1,\n  HEADER_RECEIVED: 2,\n  LOADING: 3,\n  DONE: 4,\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.open = function(method, url, opt_async) {\n  'use strict';\n  goog.asserts.assert(!!opt_async, 'Only async requests are supported.');\n  if (this.readyState != goog.net.FetchXmlHttp.RequestState.UNSENT) {\n    this.abort();\n    throw new Error('Error reopening a connection');\n  }\n\n  this.method_ = method;\n  this.url_ = url;\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.OPENED;\n  this.dispatchCallback_();\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.send = function(opt_data) {\n  'use strict';\n  if (this.readyState != goog.net.FetchXmlHttp.RequestState.OPENED) {\n    this.abort();\n    throw new Error('need to call open() first. ');\n  }\n\n  this.inProgress_ = true;\n  const requestInit = {\n    headers: this.requestHeaders_,\n    method: this.method_,\n    credentials: this.credentialsMode_,\n    cache: this.cacheMode_,\n  };\n  if (opt_data) {\n    requestInit['body'] = opt_data;\n  }\n\n  (this.worker_ || goog.global)\n      .fetch(new Request(this.url_, /** @type {!RequestInit} */ (requestInit)))\n      .then(\n          this.handleResponse_.bind(this), this.handleSendFailure_.bind(this));\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.abort = function() {\n  'use strict';\n  this.response = this.responseText = '';\n  this.requestHeaders_ = new Headers();\n  this.status = 0;\n\n  if (!!this.currentReader_) {\n    this.currentReader_.cancel('Request was aborted.');\n  }\n\n  if (((this.readyState >= goog.net.FetchXmlHttp.RequestState.OPENED) &&\n       this.inProgress_) &&\n      (this.readyState != goog.net.FetchXmlHttp.RequestState.DONE)) {\n    this.inProgress_ = false;\n    this.requestDone_();\n  }\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.UNSENT;\n};\n\n\n/**\n * Handles the fetch response.\n * @param {!Response} response\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponse_ = function(response) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  this.fetchResponse_ = response;\n\n  if (!this.responseHeaders_) {\n    this.status = this.fetchResponse_.status;\n    this.statusText = this.fetchResponse_.statusText;\n    this.responseHeaders_ = response.headers;\n    this.readyState = goog.net.FetchXmlHttp.RequestState.HEADER_RECEIVED;\n    this.dispatchCallback_();\n  }\n  // A callback may abort the request.\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.LOADING;\n  this.dispatchCallback_();\n  // A callback may abort the request.\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  if (this.responseType === 'arraybuffer') {\n    response.arrayBuffer().then(\n        this.handleResponseArrayBuffer_.bind(this),\n        this.handleSendFailure_.bind(this));\n  } else if (\n      typeof (goog.global.ReadableStream) !== 'undefined' &&\n      'body' in response) {\n    this.currentReader_ =\n        /** @type {!ReadableStreamDefaultReader} */ (response.body.getReader());\n    if (this.streamBinaryChunks_) {\n      if (this.responseType) {\n        throw new Error(\n            'responseType must be empty for \"streamBinaryChunks\" mode responses.');\n      }\n      this.response = [];\n    } else {\n      this.response = this.responseText = '';\n      this.textDecoder_ = new TextDecoder();\n    }\n    this.readInputFromFetch_();\n  } else {\n    response.text().then(\n        this.handleResponseText_.bind(this),\n        this.handleSendFailure_.bind(this));\n  }\n};\n\n\n/**\n * Reads the next chunk of data from the fetch response.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.readInputFromFetch_ = function() {\n  'use strict';\n  this.currentReader_.read()\n      .then(this.handleDataFromStream_.bind(this))\n      .catch(this.handleSendFailure_.bind(this));\n};\n\n\n/**\n * Handles a chunk of data from the fetch response stream reader.\n * @param {!IIterableResult} result\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleDataFromStream_ = function(result) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  if (this.streamBinaryChunks_ && result.value) {\n    this.response.push(/** @type {!Uint8Array} */ (result.value));\n  } else if (!this.streamBinaryChunks_) {\n    const dataPacket = result.value ?\n        /** @type {!Uint8Array} */ (result.value) :\n        new Uint8Array(0);\n    const newText =\n        this.textDecoder_.decode(dataPacket, {stream: !result.done});\n    if (newText) {\n      this.responseText += newText;\n      this.response = this.responseText;\n    }\n  }\n  if (result.done) {\n    this.requestDone_();\n  } else {\n    this.dispatchCallback_();\n  }\n\n  if (this.readyState == goog.net.FetchXmlHttp.RequestState.LOADING) {\n    this.readInputFromFetch_();\n  }\n};\n\n/**\n * Handles the response text.\n * @param {string} responseText\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponseText_ = function(responseText) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.response = this.responseText = responseText;\n  this.requestDone_();\n};\n\n\n/**\n * Handles the response text.\n * @param {!ArrayBuffer} responseArrayBuffer\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponseArrayBuffer_ = function(\n    responseArrayBuffer) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.response = responseArrayBuffer;\n  this.requestDone_();\n};\n\n\n/**\n * Handles the send failure.\n * @param {*} error\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleSendFailure_ = function(error) {\n  'use strict';\n  const e = error instanceof Error ? error : Error(error);\n  goog.log.warning(this.logger_, 'Failed to fetch url ' + this.url_, e);\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.requestDone_();\n};\n\n\n/**\n * Sets the request state to DONE and performs cleanup.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.requestDone_ = function() {\n  'use strict';\n  this.readyState = goog.net.FetchXmlHttp.RequestState.DONE;\n\n  this.fetchResponse_ = null;\n  this.currentReader_ = null;\n  this.textDecoder_ = null;\n\n  this.dispatchCallback_();\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.setRequestHeader = function(header, value) {\n  'use strict';\n  this.requestHeaders_.append(header, value);\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.getResponseHeader = function(header) {\n  'use strict';\n  // TODO(user): This method should return null when the headers are not\n  // present or the specified header is missing. The externs need to be fixed.\n  if (!this.responseHeaders_) {\n    goog.log.warning(\n        this.logger_,\n        'Attempting to get response header but no headers have been received ' +\n            'for url: ' + this.url_);\n    return '';\n  }\n  return this.responseHeaders_.get(header.toLowerCase()) || '';\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.getAllResponseHeaders = function() {\n  'use strict';\n  if (!this.responseHeaders_) {\n    goog.log.warning(\n        this.logger_,\n        'Attempting to get all response headers but no headers have been ' +\n            'received for url: ' + this.url_);\n    return '';\n  }\n  const lines = [];\n  const iter = this.responseHeaders_.entries();\n  let entry = iter.next();\n  while (!entry.done) {\n    const pair = entry.value;\n    lines.push(pair[0] + ': ' + pair[1]);\n    entry = iter.next();\n  }\n  return lines.join('\\r\\n');\n};\n\n\n/**\n * @param {!RequestCredentials} credentialsMode The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.setCredentialsMode = function(credentialsMode) {\n  'use strict';\n  this.credentialsMode_ = credentialsMode;\n};\n\n/**\n * @return {!RequestCredentials|undefined} The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.getCredentialsMode = function() {\n  'use strict';\n  return this.credentialsMode_;\n};\n\n/**\n * @param {!RequestCache} cacheMode The cache mode of the Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.setCacheMode = function(cacheMode) {\n  'use strict';\n  this.cacheMode_ = cacheMode;\n};\n\n\n/**\n * Dispatches the callback, if the callback attribute is defined.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.dispatchCallback_ = function() {\n  'use strict';\n  if (this.onreadystatechange) {\n    this.onreadystatechange.call(this);\n  }\n};\n\n// Polyfill XmlHttpRequest's withCredentials property for specifying whether to\n// include credentials on cross domain requests.\nObject.defineProperty(goog.net.FetchXmlHttp.prototype, 'withCredentials', {\n  get:\n      /**\n       * @this {goog.net.FetchXmlHttp}\n       * @return {boolean} Whether to include credentials in cross domain\n       *     requests.\n       */\n      function() {\n        'use strict';\n        return this.getCredentialsMode() === 'include';\n      },\n\n  set:\n      /**\n       * @param {boolean} value Whether to include credentials in cross domain\n       *     requests.\n       * @this {goog.net.FetchXmlHttp}\n       **/\n      function(value) {\n        'use strict';\n        this.setCredentialsMode(value ? 'include' : 'same-origin');\n      }\n});\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for creating functions. Loosely inspired by these\n * java classes from the Guava library:\n * com.google.common.base.Functions\n * https://google.github.io/guava/releases/snapshot-jre/api/docs/index.html?com/google/common/base/Functions.html\n *\n * com.google.common.base.Predicates\n * https://google.github.io/guava/releases/snapshot-jre/api/docs/index.html?com/google/common/base/Predicates.html\n *\n * More about these can be found at\n * https://github.com/google/guava/wiki/FunctionalExplained\n */\n\n\ngoog.provide('goog.functions');\n\n\n/**\n * Creates a function that always returns the same value.\n * @param {T} retValue The value to return.\n * @return {function():T} The new function.\n * @template T\n */\ngoog.functions.constant = function(retValue) {\n  'use strict';\n  return function() {\n    'use strict';\n    return retValue;\n  };\n};\n\n\n/**\n * Always returns false.\n * @type {function(...): boolean}\n */\ngoog.functions.FALSE = function() {\n  'use strict';\n  return false;\n};\n\n\n/**\n * Always returns true.\n * @type {function(...): boolean}\n */\ngoog.functions.TRUE = function() {\n  'use strict';\n  return true;\n};\n\n\n/**\n * Always returns `null`.\n * @type {function(...): null}\n */\ngoog.functions.NULL = function() {\n  'use strict';\n  return null;\n};\n\n\n/**\n * Always returns `undefined`.\n * @type {function(...): undefined}\n */\ngoog.functions.UNDEFINED = function() {\n  return undefined;\n};\n\n/**\n * Always returns `undefined` (loosely-typed version).\n * @type {!Function}\n */\ngoog.functions.EMPTY = /** @type {?} */ (goog.functions.UNDEFINED);\n\n\n/**\n * A simple function that returns the first argument of whatever is passed\n * into it.\n * @param {T=} opt_returnValue The single value that will be returned.\n * @param {...*} var_args Optional trailing arguments. These are ignored.\n * @return {T} The first argument passed in, or undefined if nothing was passed.\n * @template T\n */\ngoog.functions.identity = function(opt_returnValue, var_args) {\n  'use strict';\n  return opt_returnValue;\n};\n\n\n/**\n * Creates a function that always throws an error with the given message.\n * @param {string} message The error message.\n * @return {!Function} The error-throwing function.\n */\ngoog.functions.error = function(message) {\n  'use strict';\n  return function() {\n    'use strict';\n    throw new Error(message);\n  };\n};\n\n\n/**\n * Creates a function that throws the given object.\n * @param {*} err An object to be thrown.\n * @return {!Function} The error-throwing function.\n */\ngoog.functions.fail = function(err) {\n  'use strict';\n  return function() {\n    'use strict';\n    throw err;\n  };\n};\n\n\n/**\n * Given a function, create a function that keeps opt_numArgs arguments and\n * silently discards all additional arguments.\n * @param {Function} f The original function.\n * @param {number=} opt_numArgs The number of arguments to keep. Defaults to 0.\n * @return {!Function} A version of f that only keeps the first opt_numArgs\n *     arguments.\n */\ngoog.functions.lock = function(f, opt_numArgs) {\n  'use strict';\n  opt_numArgs = opt_numArgs || 0;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    return f.apply(self, Array.prototype.slice.call(arguments, 0, opt_numArgs));\n  };\n};\n\n\n/**\n * Creates a function that returns its nth argument.\n * @param {number} n The position of the return argument.\n * @return {!Function} A new function.\n */\ngoog.functions.nth = function(n) {\n  'use strict';\n  return function() {\n    'use strict';\n    return arguments[n];\n  };\n};\n\n\n/**\n * Like goog.partial(), except that arguments are added after arguments to the\n * returned function.\n *\n * Usage:\n * function f(arg1, arg2, arg3, arg4) { ... }\n * var g = goog.functions.partialRight(f, arg3, arg4);\n * g(arg1, arg2);\n *\n * @param {!Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn\n *     at the end.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.functions.partialRight = function(fn, var_args) {\n  'use strict';\n  const rightArgs = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    'use strict';\n    // Even in strict mode, IE10/11 and Edge (non-Chromium) use global context\n    // when free-calling functions. To catch cases where people were using this\n    // erroneously, we explicitly change the context to undefined to match\n    // strict mode specifications.\n    let self = /** @type {*} */ (this);\n    if (self === goog.global) {\n      self = undefined;\n    }\n    const newArgs = Array.prototype.slice.call(arguments);\n    newArgs.push.apply(newArgs, rightArgs);\n    return fn.apply(self, newArgs);\n  };\n};\n\n\n/**\n * Given a function, create a new function that swallows its return value\n * and replaces it with a new one.\n * @param {Function} f A function.\n * @param {T} retValue A new return value.\n * @return {function(...?):T} A new function.\n * @template T\n */\ngoog.functions.withReturnValue = function(f, retValue) {\n  'use strict';\n  return goog.functions.sequence(f, goog.functions.constant(retValue));\n};\n\n\n/**\n * Creates a function that returns whether its argument equals the given value.\n *\n * Example:\n * var key = goog.object.findKey(obj, goog.functions.equalTo('needle'));\n *\n * @param {*} value The value to compare to.\n * @param {boolean=} opt_useLooseComparison Whether to use a loose (==)\n *     comparison rather than a strict (===) one. Defaults to false.\n * @return {function(*):boolean} The new function.\n */\ngoog.functions.equalTo = function(value, opt_useLooseComparison) {\n  'use strict';\n  return function(other) {\n    'use strict';\n    return opt_useLooseComparison ? (value == other) : (value === other);\n  };\n};\n\n\n/**\n * Creates the composition of the functions passed in.\n * For example, (goog.functions.compose(f, g))(a) is equivalent to f(g(a)).\n * @param {function(...?):T} fn The final function.\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):T} The composition of all inputs.\n * @template T\n */\ngoog.functions.compose = function(fn, var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    let result;\n    if (length) {\n      result = functions[length - 1].apply(self, arguments);\n    }\n\n    for (let i = length - 2; i >= 0; i--) {\n      result = functions[i].call(self, result);\n    }\n    return result;\n  };\n};\n\n\n/**\n * Creates a function that calls the functions passed in in sequence, and\n * returns the value of the last function. For example,\n * (goog.functions.sequence(f, g))(x) is equivalent to f(x),g(x).\n * @param {...Function} var_args A list of functions.\n * @return {!Function} A function that calls all inputs in sequence.\n */\ngoog.functions.sequence = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    let result;\n    for (let i = 0; i < length; i++) {\n      result = functions[i].apply(self, arguments);\n    }\n    return result;\n  };\n};\n\n\n/**\n * Creates a function that returns true if each of its components evaluates\n * to true. The components are evaluated in order, and the evaluation will be\n * short-circuited as soon as a function returns false.\n * For example, (goog.functions.and(f, g))(x) is equivalent to f(x) && g(x).\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):boolean} A function that ANDs its component\n *      functions.\n */\ngoog.functions.and = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    for (let i = 0; i < length; i++) {\n      if (!functions[i].apply(self, arguments)) {\n        return false;\n      }\n    }\n    return true;\n  };\n};\n\n\n/**\n * Creates a function that returns true if any of its components evaluates\n * to true. The components are evaluated in order, and the evaluation will be\n * short-circuited as soon as a function returns true.\n * For example, (goog.functions.or(f, g))(x) is equivalent to f(x) || g(x).\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):boolean} A function that ORs its component\n *    functions.\n */\ngoog.functions.or = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    for (let i = 0; i < length; i++) {\n      if (functions[i].apply(self, arguments)) {\n        return true;\n      }\n    }\n    return false;\n  };\n};\n\n\n/**\n * Creates a function that returns the Boolean opposite of a provided function.\n * For example, (goog.functions.not(f))(x) is equivalent to !f(x).\n * @param {!Function} f The original function.\n * @return {function(...?):boolean} A function that delegates to f and returns\n * opposite.\n */\ngoog.functions.not = function(f) {\n  'use strict';\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    return !f.apply(self, arguments);\n  };\n};\n\n\n/**\n * Generic factory function to construct an object given the constructor\n * and the arguments. Intended to be bound to create object factories.\n *\n * Example:\n *\n * var factory = goog.partial(goog.functions.create, Class);\n *\n * @param {function(new:T, ...)} constructor The constructor for the Object.\n * @param {...*} var_args The arguments to be passed to the constructor.\n * @return {T} A new instance of the class given in `constructor`.\n * @template T\n * @deprecated This function does not work with ES6 class constructors. Use\n *     arrow functions + spread args instead.\n */\ngoog.functions.create = function(constructor, var_args) {\n  'use strict';\n  /**\n   * @constructor\n   * @final\n   */\n  const temp = function() {};\n  temp.prototype = constructor.prototype;\n\n  // obj will have constructor's prototype in its chain and\n  // 'obj instanceof constructor' will be true.\n  const obj = new temp();\n\n  // obj is initialized by constructor.\n  // arguments is only array-like so lacks shift(), but can be used with\n  // the Array prototype function.\n  constructor.apply(obj, Array.prototype.slice.call(arguments, 1));\n  return obj;\n};\n\n\n/**\n * @define {boolean} Whether the return value cache should be used.\n *    This should only be used to disable caches when testing.\n */\ngoog.functions.CACHE_RETURN_VALUE =\n    goog.define('goog.functions.CACHE_RETURN_VALUE', true);\n\n\n/**\n * Gives a wrapper function that caches the return value of a parameterless\n * function when first called.\n *\n * When called for the first time, the given function is called and its\n * return value is cached (thus this is only appropriate for idempotent\n * functions).  Subsequent calls will return the cached return value. This\n * allows the evaluation of expensive functions to be delayed until first used.\n *\n * To cache the return values of functions with parameters, see goog.memoize.\n *\n * @param {function():T} fn A function to lazily evaluate.\n * @return {function():T} A wrapped version the function.\n * @template T\n */\ngoog.functions.cacheReturnValue = function(fn) {\n  'use strict';\n  let called = false;\n  let value;\n\n  return function() {\n    'use strict';\n    if (!goog.functions.CACHE_RETURN_VALUE) {\n      return fn();\n    }\n\n    if (!called) {\n      value = fn();\n      called = true;\n    }\n\n    return value;\n  };\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once. All\n * additional calls are no-ops.\n *\n * This is particularly useful for initialization functions\n * that should be called, at most, once.\n *\n * @param {function():*} f Function to call.\n * @return {function():undefined} Wrapped function.\n */\ngoog.functions.once = function(f) {\n  'use strict';\n  // Keep a reference to the function that we null out when we're done with\n  // it -- that way, the function can be GC'd when we're done with it.\n  let inner = f;\n  return function() {\n    'use strict';\n    if (inner) {\n      const tmp = inner;\n      inner = null;\n      tmp();\n    }\n  };\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times within\n * that interval, only the Nth call will go through.\n *\n * This is particularly useful for batching up repeated actions where the\n * last action should win. This can be used, for example, for refreshing an\n * autocomplete pop-up every so often rather than updating with every keystroke,\n * since the final text typed by the user is the one that should produce the\n * final autocomplete results. For more stateful debouncing with support for\n * pausing, resuming, and canceling debounced actions, use\n * `goog.async.Debouncer`.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to debounce. The function will\n *     only be called after the full interval has elapsed since the last call.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.debounce = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    goog.global.clearTimeout(timeout);\n    const args = arguments;\n    timeout = goog.global.setTimeout(function() {\n      'use strict';\n      f.apply(opt_scope, args);\n    }, interval);\n  });\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times in\n * that interval, both the 1st and the Nth calls will go through.\n *\n * This is particularly useful for limiting repeated user requests where the\n * the last action should win, but you also don't want to wait until the end of\n * the interval before sending a request out, as it leads to a perception of\n * slowness for the user.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to throttle. The function can\n *     only be called once per interval.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.throttle = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n  let shouldFire = false;\n  let storedArgs = [];\n\n  const handleTimeout = function() {\n    'use strict';\n    timeout = 0;\n    if (shouldFire) {\n      shouldFire = false;\n      fire();\n    }\n  };\n\n  const fire = function() {\n    'use strict';\n    timeout = goog.global.setTimeout(handleTimeout, interval);\n    let args = storedArgs;\n    storedArgs = [];  // Avoid a space leak by clearing stored arguments.\n    f.apply(opt_scope, args);\n  };\n\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    storedArgs = arguments;\n    if (!timeout) {\n      fire();\n    } else {\n      shouldFire = true;\n    }\n  });\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times within\n * that interval, only the 1st call will go through.\n *\n * This is particularly useful for limiting repeated user requests where the\n * first request is guaranteed to have all the data required to perform the\n * final action, so there's no need to wait until the end of the interval before\n * sending the request out.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to rate-limit. The function will\n *     only be called once per interval, and ignored for the remainer of the\n *     interval.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.rateLimit = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n\n  const handleTimeout = function() {\n    'use strict';\n    timeout = 0;\n  };\n\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    if (!timeout) {\n      timeout = goog.global.setTimeout(handleTimeout, interval);\n      f.apply(opt_scope, arguments);\n    }\n  });\n};\n\n/**\n * Returns true if the specified value is a function.\n * @param {*} val Variable to test.\n * @return {boolean} Whether variable is a function.\n */\ngoog.functions.isFunction = (val) => {\n  return typeof val === 'function';\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\n/**\n * @fileoverview Utility to attempt native JSON processing, falling back to\n *     goog.json if not available.\n *\n *     This is intended as a drop-in for current users of goog.json who want\n *     to take advantage of native JSON if present.\n */\n\ngoog.provide('goog.json.hybrid');\n\ngoog.require('goog.asserts');\ngoog.require('goog.json');\n\n\n/**\n * Attempts to serialize the JSON string natively, falling back to\n * `goog.json.serialize` if unsuccessful.\n * @param {!Object} obj JavaScript object to serialize to JSON.\n * @return {string} Resulting JSON string.\n */\ngoog.json.hybrid.stringify = goog.json.USE_NATIVE_JSON ?\n    goog.global['JSON']['stringify'] :\n    function(obj) {\n      'use strict';\n      if (goog.global.JSON) {\n        try {\n          return goog.global.JSON.stringify(obj);\n        } catch (e) {\n          // Native serialization failed.  Fall through to retry with\n          // goog.json.serialize.\n        }\n      }\n\n      return goog.json.serialize(obj);\n    };\n\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * the supplied `fallbackParser` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @param {function(string):Object} fallbackParser Fallback JSON parser used\n *     if native\n * @return {?Object} Resulting JSON object.\n * @private\n */\ngoog.json.hybrid.parse_ = function(jsonString, fallbackParser) {\n  'use strict';\n  if (goog.global.JSON) {\n    try {\n      var obj = goog.global.JSON.parse(jsonString);\n      goog.asserts.assert(typeof obj == 'object');\n      return /** @type {?Object} */ (obj);\n    } catch (e) {\n      // Native parse failed.  Fall through to retry with goog.json.parse.\n    }\n  }\n\n  return fallbackParser(jsonString);\n};\n\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * `goog.json.parse` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @return {?Object} Resulting JSON object.\n */\ngoog.json.hybrid.parse = goog.json.USE_NATIVE_JSON ?\n    goog.global['JSON']['parse'] :\n    function(jsonString) {\n      'use strict';\n      return goog.json.hybrid.parse_(jsonString, goog.json.parse);\n    };\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Constants for HTTP status codes.\n */\n\ngoog.provide('goog.net.HttpStatus');\n\n\n/**\n * HTTP Status Codes defined in RFC 2616, RFC 6585, RFC 4918 and RFC 7538.\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n * @see http://tools.ietf.org/html/rfc6585\n * @see https://tools.ietf.org/html/rfc4918\n * @see https://tools.ietf.org/html/rfc7538\n * @enum {number}\n */\ngoog.net.HttpStatus = {\n  // Informational 1xx\n  CONTINUE: 100,\n  SWITCHING_PROTOCOLS: 101,\n\n  // Successful 2xx\n  OK: 200,\n  CREATED: 201,\n  ACCEPTED: 202,\n  NON_AUTHORITATIVE_INFORMATION: 203,\n  NO_CONTENT: 204,\n  RESET_CONTENT: 205,\n  PARTIAL_CONTENT: 206,\n  MULTI_STATUS: 207,\n\n  // Redirection 3xx\n  MULTIPLE_CHOICES: 300,\n  MOVED_PERMANENTLY: 301,\n  FOUND: 302,\n  SEE_OTHER: 303,\n  NOT_MODIFIED: 304,\n  USE_PROXY: 305,\n  TEMPORARY_REDIRECT: 307,\n  PERMANENT_REDIRECT: 308,\n\n  // Client Error 4xx\n  BAD_REQUEST: 400,\n  UNAUTHORIZED: 401,\n  PAYMENT_REQUIRED: 402,\n  FORBIDDEN: 403,\n  NOT_FOUND: 404,\n  METHOD_NOT_ALLOWED: 405,\n  NOT_ACCEPTABLE: 406,\n  PROXY_AUTHENTICATION_REQUIRED: 407,\n  REQUEST_TIMEOUT: 408,\n  CONFLICT: 409,\n  GONE: 410,\n  LENGTH_REQUIRED: 411,\n  PRECONDITION_FAILED: 412,\n  REQUEST_ENTITY_TOO_LARGE: 413,\n  REQUEST_URI_TOO_LONG: 414,\n  UNSUPPORTED_MEDIA_TYPE: 415,\n  REQUEST_RANGE_NOT_SATISFIABLE: 416,\n  EXPECTATION_FAILED: 417,\n  UNPROCESSABLE_ENTITY: 422,\n  LOCKED: 423,\n  FAILED_DEPENDENCY: 424,\n  PRECONDITION_REQUIRED: 428,\n  TOO_MANY_REQUESTS: 429,\n  REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n\n  // Server Error 5xx\n  INTERNAL_SERVER_ERROR: 500,\n  NOT_IMPLEMENTED: 501,\n  BAD_GATEWAY: 502,\n  SERVICE_UNAVAILABLE: 503,\n  GATEWAY_TIMEOUT: 504,\n  HTTP_VERSION_NOT_SUPPORTED: 505,\n  INSUFFICIENT_STORAGE: 507,\n  NETWORK_AUTHENTICATION_REQUIRED: 511,\n\n  /*\n   * IE returns this code for 204 due to its use of URLMon, which returns this\n   * code for 'Operation Aborted'. The status text is 'Unknown', the response\n   * headers are ''. Known to occur on IE 6 on XP through IE9 on Win7.\n   */\n  QUIRK_IE_NO_CONTENT: 1223,\n};\n\n\n/**\n * Returns whether the given status should be considered successful.\n *\n * Successful codes are OK (200), CREATED (201), ACCEPTED (202),\n * NO CONTENT (204), PARTIAL CONTENT (206), NOT MODIFIED (304),\n * and IE's no content code (1223).\n *\n * @param {number} status The status code to test.\n * @return {boolean} Whether the status code should be considered successful.\n */\ngoog.net.HttpStatus.isSuccess = function(status) {\n  'use strict';\n  switch (status) {\n    case goog.net.HttpStatus.OK:\n    case goog.net.HttpStatus.CREATED:\n    case goog.net.HttpStatus.ACCEPTED:\n    case goog.net.HttpStatus.NO_CONTENT:\n    case goog.net.HttpStatus.PARTIAL_CONTENT:\n    case goog.net.HttpStatus.NOT_MODIFIED:\n    case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT:\n      return true;\n\n    default:\n      return false;\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides CORS support for HTTP based RPC requests.\n *\n * As part of net.rpc package, CORS features provided by this class\n * depend on the server support. Please check related specs to decide how\n * to enable any of the features provided by this class.\n */\n\ngoog.module('goog.net.rpc.HttpCors');\n\nconst GoogUri = goog.require('goog.Uri');\nconst googObject = goog.require('goog.object');\nconst googString = goog.require('goog.string');\nconst googUriUtils = goog.require('goog.uri.utils');\n\n\n/**\n * The default URL parameter name to overwrite http headers with a URL param\n * to avoid CORS preflight.\n *\n * See https://github.com/whatwg/fetch/issues/210#issue-129531743 for the spec.\n *\n * @type {string}\n */\nexports.HTTP_HEADERS_PARAM_NAME = '$httpHeaders';\n\n\n/**\n * The default URL parameter name to overwrite http method with a URL param\n * to avoid CORS preflight.\n *\n * See https://github.com/whatwg/fetch/issues/210#issue-129531743 for the spec.\n *\n * @type {string}\n */\nexports.HTTP_METHOD_PARAM_NAME = '$httpMethod';\n\n\n/**\n * Generates the URL parameter value with custom headers encoded as\n * HTTP/1.1 headers block.\n *\n * @param {!Object<string, string>} headers The custom headers.\n * @return {string} The URL param to overwrite custom HTTP headers.\n */\nexports.generateHttpHeadersOverwriteParam = function(headers) {\n  let result = '';\n  googObject.forEach(headers, function(value, key) {\n    result += key;\n    result += ':';\n    result += value;\n    result += '\\r\\n';\n  });\n  return result;\n};\n\n\n/**\n * Generates the URL-encoded URL parameter value with custom headers encoded as\n * HTTP/1.1 headers block.\n *\n * @param {!Object<string, string>} headers The custom headers.\n * @return {string} The URL param to overwrite custom HTTP headers.\n */\nexports.generateEncodedHttpHeadersOverwriteParam = function(headers) {\n  return googString.urlEncode(\n      exports.generateHttpHeadersOverwriteParam(headers));\n};\n\n\n/**\n * Sets custom HTTP headers via an overwrite URL param.\n *\n * @param {!GoogUri|string} url The URI object or a string path.\n * @param {string} urlParam The URL param name.\n * @param {!Object<string, string>} extraHeaders The HTTP headers.\n * @return {!GoogUri|string} The URI object or a string path with headers\n * encoded as a url param.\n */\nexports.setHttpHeadersWithOverwriteParam = function(\n    url, urlParam, extraHeaders) {\n  if (googObject.isEmpty(extraHeaders)) {\n    return url;\n  }\n  const httpHeaders = exports.generateHttpHeadersOverwriteParam(extraHeaders);\n  if (typeof url === 'string') {\n    return googUriUtils.appendParam(\n        url, googString.urlEncode(urlParam), httpHeaders);\n  } else {\n    url.setParameterValue(urlParam, httpHeaders);  // duplicate removed!\n    return url;\n  }\n};\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Transport support for WebChannel.\n *\n * The <code>WebChannelTransport</code> implementation serves as the factory\n * for <code>WebChannel</code>, which offers an abstraction for\n * point-to-point socket-like communication similar to what BrowserChannel\n * or HTML5 WebSocket offers.\n */\n\ngoog.provide('goog.net.WebChannelTransport');\n\ngoog.requireType('goog.net.WebChannel');\ngoog.requireType('goog.net.WebChannel.Options');\n\n\n\n/**\n * A WebChannelTransport instance represents a shared context of logical\n * connectivity between a browser client and a remote origin.\n *\n * Over a single WebChannelTransport instance, multiple WebChannels may be\n * created against different URLs, which may all share the same\n * underlying connectivity (i.e. TCP connection) whenever possible.\n *\n * When multi-domains are supported, such as CORS, multiple origins may be\n * supported over a single WebChannelTransport instance at the same time.\n *\n * Sharing between different window contexts such as tabs is not addressed\n * by WebChannelTransport. Applications may choose HTML5 shared workers\n * or other techniques to access the same transport instance\n * across different window contexts.\n *\n * @interface\n */\ngoog.net.WebChannelTransport = function() {};\n\n\n/**\n * The client version. This integer value will be passed to the server\n * when a channel is opened to inform the server the client \"capabilities\".\n *\n * Wire protocol version is a different concept and is internal to the\n * transport implementation.\n *\n * @const\n * @type {number}\n */\ngoog.net.WebChannelTransport.CLIENT_VERSION = 22;\n\n\n/**\n * Create a new WebChannel instance.\n *\n * The new WebChannel is to be opened against the server-side resource\n * as specified by the given URL. See {@link goog.net.WebChannel} for detailed\n * semantics.\n *\n * @param {string} url The URL path for the new WebChannel instance.\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *     new WebChannel instance. The configuration object is reusable after\n *     the new channel instance is created.\n * @return {!goog.net.WebChannel} the newly created WebChannel instance.\n */\ngoog.net.WebChannelTransport.prototype.createWebChannel = goog.abstractMethod;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implementation of a WebChannel transport using WebChannelBase.\n *\n * When WebChannelBase is used as the underlying transport, the capabilities\n * of the WebChannel are limited to what's supported by the implementation.\n * Particularly, multiplexing is not possible, and only strings are\n * supported as message types.\n */\n\ngoog.provide('goog.labs.net.webChannel.WebChannelBaseTransport');\n\ngoog.require('goog.asserts');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.json');\ngoog.require('goog.labs.net.webChannel.ChannelRequest');\ngoog.require('goog.labs.net.webChannel.WebChannelBase');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.log');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.WebChannelTransport');\ngoog.require('goog.object');\ngoog.require('goog.string');\n\n\n\n/**\n * Implementation of {@link goog.net.WebChannelTransport} with\n * {@link goog.labs.net.webChannel.WebChannelBase} as the underlying channel\n * implementation.\n *\n * @constructor\n * @struct\n * @implements {goog.net.WebChannelTransport}\n * @final\n */\ngoog.labs.net.webChannel.WebChannelBaseTransport = function() {\n  'use strict';\n  if (!goog.labs.net.webChannel.ChannelRequest.supportsXhrStreaming()) {\n    throw new Error('Environmental error: no available transport.');\n  }\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WebChannelBaseTransport =\n    goog.labs.net.webChannel.WebChannelBaseTransport;\nconst WebChannelBase = goog.labs.net.webChannel.WebChannelBase;\nconst Wire = goog.labs.net.webChannel.Wire;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.prototype.createWebChannel = function(\n    url, opt_options) {\n  'use strict';\n  return new WebChannelBaseTransport.Channel(url, opt_options);\n};\n\n\n\n/**\n * Implementation of the {@link goog.net.WebChannel} interface.\n *\n * @param {string} url The URL path for the new WebChannel instance.\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *     new WebChannel instance.\n *\n * @constructor\n * @implements {goog.net.WebChannel}\n * @extends {goog.events.EventTarget}\n * @final\n */\nWebChannelBaseTransport.Channel = function(url, opt_options) {\n  'use strict';\n  WebChannelBaseTransport.Channel.base(this, 'constructor');\n\n  /**\n   * @private {!WebChannelBase} The underlying channel object.\n   */\n  this.channel_ = new WebChannelBase(\n      opt_options, goog.net.WebChannelTransport.CLIENT_VERSION);\n\n  /**\n   * @private {string} The URL of the target server end-point.\n   */\n  this.url_ = url;\n\n  /**\n   * @private {goog.log.Logger} The logger for this class.\n   */\n  this.logger_ =\n      goog.log.getLogger('goog.labs.net.webChannel.WebChannelBaseTransport');\n\n  /**\n   * @private {Object<string, string>} Extra URL parameters\n   * to be added to each HTTP request.\n   */\n  this.messageUrlParams_ =\n      (opt_options && opt_options.messageUrlParams) || null;\n\n  let messageHeaders = (opt_options && opt_options.messageHeaders) || null;\n\n  // default is false\n  if (opt_options && opt_options.clientProtocolHeaderRequired) {\n    if (messageHeaders) {\n      goog.object.set(\n          messageHeaders, goog.net.WebChannel.X_CLIENT_PROTOCOL,\n          goog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL);\n    } else {\n      messageHeaders = goog.object.create(\n          goog.net.WebChannel.X_CLIENT_PROTOCOL,\n          goog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL);\n    }\n  }\n\n  this.channel_.setExtraHeaders(messageHeaders);\n\n  let initHeaders = (opt_options && opt_options.initMessageHeaders) || null;\n\n  if (opt_options && opt_options.messageContentType) {\n    if (initHeaders) {\n      goog.object.set(\n          initHeaders, goog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE,\n          opt_options.messageContentType);\n    } else {\n      initHeaders = goog.object.create(\n          goog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE,\n          opt_options.messageContentType);\n    }\n  }\n\n  if (opt_options && opt_options.clientProfile) {\n    if (initHeaders) {\n      goog.object.set(\n          initHeaders, goog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE,\n          opt_options.clientProfile);\n    } else {\n      initHeaders = goog.object.create(\n          goog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE,\n          opt_options.clientProfile);\n    }\n  }\n\n  this.channel_.setInitHeaders(initHeaders);\n\n  const httpHeadersOverwriteParam =\n      opt_options && opt_options.httpHeadersOverwriteParam;\n  if (httpHeadersOverwriteParam &&\n      !goog.string.isEmptyOrWhitespace(httpHeadersOverwriteParam)) {\n    this.channel_.setHttpHeadersOverwriteParam(httpHeadersOverwriteParam);\n  }\n\n  /**\n   * @private {boolean} Whether to enable CORS.\n   */\n  this.supportsCrossDomainXhr_ =\n      (opt_options && opt_options.supportsCrossDomainXhr) || false;\n\n  /**\n   * @private {boolean} Whether to send raw Json and bypass v8 wire format.\n   */\n  this.sendRawJson_ = (opt_options && opt_options.sendRawJson) || false;\n\n  // Note that httpSessionIdParam will be ignored if the same parameter name\n  // has already been specified with messageUrlParams\n  const httpSessionIdParam = opt_options && opt_options.httpSessionIdParam;\n  if (httpSessionIdParam &&\n      !goog.string.isEmptyOrWhitespace(httpSessionIdParam)) {\n    this.channel_.setHttpSessionIdParam(httpSessionIdParam);\n    if (goog.object.containsKey(this.messageUrlParams_, httpSessionIdParam)) {\n      goog.object.remove(this.messageUrlParams_, httpSessionIdParam);\n      goog.log.warning(this.logger_,\n          'Ignore httpSessionIdParam also specified with messageUrlParams: '\n          + httpSessionIdParam);\n    }\n  }\n\n  /**\n   * The channel handler.\n   *\n   * @private {!WebChannelBaseTransport.Channel.Handler_}\n   */\n  this.channelHandler_ = new WebChannelBaseTransport.Channel.Handler_(this);\n};\ngoog.inherits(WebChannelBaseTransport.Channel, goog.events.EventTarget);\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.open = function() {\n  'use strict';\n  this.channel_.setHandler(this.channelHandler_);\n  if (this.supportsCrossDomainXhr_) {\n    this.channel_.setSupportsCrossDomainXhrs(true);\n  }\n  this.channel_.connect(this.url_, (this.messageUrlParams_ || undefined));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.close = function() {\n  'use strict';\n  this.channel_.disconnect();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.halfClose = function() {\n  'use strict';\n  // to be implemented\n  throw new Error('Not implemented');\n};\n\n\n/**\n * The WebChannelBase only supports object types.\n *\n * @param {!goog.net.WebChannel.MessageData} message The message to send.\n *\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.send = function(message) {\n  'use strict';\n  goog.asserts.assert(\n      goog.isObject(message) || typeof message === 'string',\n      'only object type or raw string is supported');\n\n  if (typeof message === 'string') {\n    const rawJson = {};\n    rawJson[Wire.RAW_DATA_KEY] = message;\n    this.channel_.sendMap(rawJson);\n  } else if (this.sendRawJson_) {\n    const rawJson = {};\n    rawJson[Wire.RAW_DATA_KEY] = goog.json.serialize(message);\n    this.channel_.sendMap(rawJson);\n  } else {\n    this.channel_.sendMap(message);\n  }\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.disposeInternal = function() {\n  'use strict';\n  this.channel_.setHandler(null);\n  delete this.channelHandler_;\n  this.channel_.disconnect();\n  delete this.channel_;\n\n  WebChannelBaseTransport.Channel.base(this, 'disposeInternal');\n};\n\n\n\n/**\n * The message event.\n *\n * @param {!Array<?>|!Object} array The data array from the underlying channel.\n * @constructor\n * @extends {goog.net.WebChannel.MessageEvent}\n * @final\n */\nWebChannelBaseTransport.Channel.MessageEvent = function(array) {\n  'use strict';\n  WebChannelBaseTransport.Channel.MessageEvent.base(this, 'constructor');\n\n  // single-metadata only\n  const metadata = array['__sm__'];\n  if (metadata) {\n    this.metadataKey = goog.object.getAnyKey(metadata);\n    if (this.metadataKey) {\n      this.data = goog.object.get(metadata, this.metadataKey);\n    } else {\n      this.data = metadata;  // empty\n    }\n  } else {\n    this.data = array;\n  }\n};\ngoog.inherits(\n    WebChannelBaseTransport.Channel.MessageEvent,\n    goog.net.WebChannel.MessageEvent);\n\n\n\n/**\n * The error event.\n *\n * @param {WebChannelBase.Error} error The error code.\n * @constructor\n * @extends {goog.net.WebChannel.ErrorEvent}\n * @final\n */\nWebChannelBaseTransport.Channel.ErrorEvent = function(error) {\n  'use strict';\n  WebChannelBaseTransport.Channel.ErrorEvent.base(this, 'constructor');\n\n  /**\n   * High-level status code.\n   */\n  this.status = goog.net.WebChannel.ErrorStatus.NETWORK_ERROR;\n\n  /**\n   * @const {WebChannelBase.Error} Internal error code, for debugging use only.\n   */\n  this.errorCode = error;\n};\ngoog.inherits(\n    WebChannelBaseTransport.Channel.ErrorEvent, goog.net.WebChannel.ErrorEvent);\n\n\n\n/**\n * Implementation of {@link WebChannelBase.Handler} interface.\n *\n * @param {!WebChannelBaseTransport.Channel} channel The enclosing WebChannel.\n *\n * @constructor\n * @extends {WebChannelBase.Handler}\n * @private\n */\nWebChannelBaseTransport.Channel.Handler_ = function(channel) {\n  'use strict';\n  WebChannelBaseTransport.Channel.Handler_.base(this, 'constructor');\n\n  /**\n   * @type {!WebChannelBaseTransport.Channel}\n   * @private\n   */\n  this.channel_ = channel;\n};\ngoog.inherits(WebChannelBaseTransport.Channel.Handler_, WebChannelBase.Handler);\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelOpened = function(\n    channel) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_, 'WebChannel opened on ' + this.channel_.url_);\n  this.channel_.dispatchEvent(goog.net.WebChannel.EventType.OPEN);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelHandleArray =\n    function(channel, array) {\n  'use strict';\n  goog.asserts.assert(array, 'array expected to be defined');\n  this.channel_.dispatchEvent(\n      new WebChannelBaseTransport.Channel.MessageEvent(array));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelError = function(\n    channel, error) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_,\n      'WebChannel aborted on ' + this.channel_.url_ +\n          ' due to channel error: ' + error);\n  this.channel_.dispatchEvent(\n      new WebChannelBaseTransport.Channel.ErrorEvent(error));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelClosed = function(\n    channel, opt_pendingMaps, opt_undeliveredMaps) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_, 'WebChannel closed on ' + this.channel_.url_);\n  this.channel_.dispatchEvent(goog.net.WebChannel.EventType.CLOSE);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.getRuntimeProperties = function() {\n  'use strict';\n  return new WebChannelBaseTransport.ChannelProperties(this.channel_);\n};\n\n\n\n/**\n * Implementation of the {@link goog.net.WebChannel.RuntimeProperties}.\n *\n * @param {!WebChannelBase} channel The underlying channel object.\n *\n * @constructor\n * @implements {goog.net.WebChannel.RuntimeProperties}\n * @final\n */\nWebChannelBaseTransport.ChannelProperties = function(channel) {\n  'use strict';\n  /**\n   * The underlying channel object.\n   *\n   * @private {!WebChannelBase}\n   */\n  this.channel_ = channel;\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getConcurrentRequestLimit =\n    function() {\n  'use strict';\n  return this.channel_.getForwardChannelRequestPool().getMaxSize();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.isSpdyEnabled = function() {\n  'use strict';\n  return this.getConcurrentRequestLimit() > 1;\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getPendingRequestCount =\n    function() {\n  'use strict';\n  return this.channel_.getForwardChannelRequestPool().getRequestCount();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getHttpSessionId =\n    function() {\n  'use strict';\n  return this.channel_.getHttpSessionId();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.commit = function(\n    callback) {\n  'use strict';\n  this.channel_.setForwardChannelFlushCallback(callback);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.notifyNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.onCommit =\n    goog.abstractMethod;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.ackCommit =\n    goog.abstractMethod;\n\n\n/** @override */\nWebChannelBaseTransport.ChannelProperties.prototype.getLastStatusCode =\n    function() {\n  'use strict';\n  return this.channel_.getLastStatusCode();\n};\n});  // goog.scope\n", "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bring in closure-library dependencies\n */\n\ngoog.provide('firebase.webchannel.wrapper');\n\n// goog.net.WebChannelTransport\ngoog.require('goog.net.createWebChannelTransport');\ngoog.require('goog.net.FetchXmlHttpFactory');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.labs.net.webChannel.WebChannelBaseTransport');\n\n/**\n * NOTE: The `createWebChannel` function takes an options object as a second param\n * whose properties are typically mangled. We override these in externs/overrides.js\n * Without those externs, this does not function properly.\n */\ngoog.labs.net.webChannel.WebChannelBaseTransport.prototype['createWebChannel'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.prototype.createWebChannel;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['send'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.send;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['open'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.open;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['close'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.close;\n\n// goog.net.ErrorCode\ngoog.require('goog.net.ErrorCode');\ngoog.net.ErrorCode['NO_ERROR'] = goog.net.ErrorCode.NO_ERROR;\ngoog.net.ErrorCode['TIMEOUT'] = goog.net.ErrorCode.TIMEOUT;\ngoog.net.ErrorCode['HTTP_ERROR'] = goog.net.ErrorCode.HTTP_ERROR;\n\n// goog.net.ErrorType\ngoog.require('goog.net.EventType');\ngoog.net.EventType['COMPLETE'] = goog.net.EventType.COMPLETE;\n\n// goog.net.WebChannel\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.events.EventTarget');\ngoog.net.WebChannel['EventType'] = goog.net.WebChannel.EventType;\ngoog.net.WebChannel.EventType['OPEN'] = goog.net.WebChannel.EventType.OPEN;\ngoog.net.WebChannel.EventType['CLOSE'] = goog.net.WebChannel.EventType.CLOSE;\ngoog.net.WebChannel.EventType['ERROR'] = goog.net.WebChannel.EventType.ERROR;\ngoog.net.WebChannel.EventType['MESSAGE'] =\n  goog.net.WebChannel.EventType.MESSAGE;\ngoog.events.EventTarget.prototype['listen'] =\n  goog.events.EventTarget.prototype.listen;\n\ngoog.require('goog.net.XhrIo');\ngoog.net.XhrIo.prototype['listenOnce'] = goog.net.XhrIo.prototype.listenOnce;\ngoog.net.XhrIo.prototype['getLastError'] =\n  goog.net.XhrIo.prototype.getLastError;\ngoog.net.XhrIo.prototype['getLastErrorCode'] =\n  goog.net.XhrIo.prototype.getLastErrorCode;\ngoog.net.XhrIo.prototype['getStatus'] = goog.net.XhrIo.prototype.getStatus;\ngoog.net.XhrIo.prototype['getResponseJson'] =\n  goog.net.XhrIo.prototype.getResponseJson;\ngoog.net.XhrIo.prototype['getResponseText'] =\n  goog.net.XhrIo.prototype.getResponseText;\ngoog.net.XhrIo.prototype['send'] = goog.net.XhrIo.prototype.send;\n\nmodule['exports']['createWebChannelTransport'] =\n  goog.net.createWebChannelTransport;\nmodule['exports']['getStatEventTarget'] =\n  goog.labs.net.webChannel.requestStats.getStatEventTarget;\nmodule['exports']['ErrorCode'] = goog.net.ErrorCode;\nmodule['exports']['EventType'] = goog.net.EventType;\nmodule['exports']['Event'] = goog.labs.net.webChannel.requestStats.Event;\nmodule['exports']['Stat'] = goog.labs.net.webChannel.requestStats.Stat;\nmodule['exports']['FetchXmlHttpFactory'] = goog.net.FetchXmlHttpFactory;\nmodule['exports']['WebChannel'] = goog.net.WebChannel;\nmodule['exports']['XhrIo'] = goog.net.XhrIo;\n", "/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Default factory for <code>WebChannelTransport</code> to\n * avoid exposing concrete classes to clients.\n */\n\ngoog.provide('goog.net.createWebChannelTransport');\n\ngoog.require('goog.labs.net.webChannel.WebChannelBaseTransport');\ngoog.requireType('goog.net.WebChannelTransport');\n\n\n/**\n * Create a new WebChannelTransport instance using the default implementation.\n * Throws an error message if no default transport available in the current\n * environment.\n *\n * @return {!goog.net.WebChannelTransport} the newly created transport instance.\n */\ngoog.net.createWebChannelTransport = function() {\n  'use strict';\n  return new goog.labs.net.webChannel.WebChannelBaseTransport();\n};\n", "import { _getProvider, getApp as t, _removeServiceInstance as e, _registerComponent as n, registerVersion as s, SDK_VERSION as i } from \"@firebase/app\";\n\nimport { Component as r } from \"@firebase/component\";\n\nimport { Logger as o, LogLevel as a } from \"@firebase/logger\";\n\nimport { FirebaseError as u, getUA as c, isIndexedDBAvailable as h, isSafari as l, isMobileCordova as f, isReactNative as d, isElectron as _, isIE as w, isUWP as m, isBrowserExtension as g, createMockUserToken as y, getModularInstance as p, deepEqual as I } from \"@firebase/util\";\n\nimport { XhrIo as T, EventType as E, ErrorCode as A, createWebChannelTransport as R, getStatEventTarget as b, FetchXmlHttpFactory as P, WebChannel as V, Event as v, Stat as S } from \"@firebase/webchannel-wrapper\";\n\nconst D = \"@firebase/firestore\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Simple wrapper around a nullable UID. Mostly exists to make code more\n * readable.\n */\nclass C {\n    constructor(t) {\n        this.uid = t;\n    }\n    isAuthenticated() {\n        return null != this.uid;\n    }\n    /**\n     * Returns a key representing this user, suitable for inclusion in a\n     * dictionary.\n     */    toKey() {\n        return this.isAuthenticated() ? \"uid:\" + this.uid : \"anonymous-user\";\n    }\n    isEqual(t) {\n        return t.uid === this.uid;\n    }\n}\n\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \n// TODO(mikelehen): Look into getting a proper uid-equivalent for\n// non-FirebaseAuth providers.\nC.GOOGLE_CREDENTIALS = new C(\"google-credentials-uid\"), C.FIRST_PARTY = new C(\"first-party-uid\"), \nC.MOCK_USER = new C(\"mock-user\");\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet x = \"9.6.9\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst N = new o(\"@firebase/firestore\");\n\n// Helper methods are needed because variables can't be exported as read/write\nfunction k() {\n    return N.logLevel;\n}\n\n/**\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\n *\n * @param logLevel - The verbosity you set for activity and error logging. Can\n *   be any of the following values:\n *\n *   <ul>\n *     <li>`debug` for the most verbose logging level, primarily for\n *     debugging.</li>\n *     <li>`error` to log errors only.</li>\n *     <li><code>`silent` to turn off logging.</li>\n *   </ul>\n */ function M(t) {\n    N.setLogLevel(t);\n}\n\nfunction O(t, ...e) {\n    if (N.logLevel <= a.DEBUG) {\n        const n = e.map(B);\n        N.debug(`Firestore (${x}): ${t}`, ...n);\n    }\n}\n\nfunction $(t, ...e) {\n    if (N.logLevel <= a.ERROR) {\n        const n = e.map(B);\n        N.error(`Firestore (${x}): ${t}`, ...n);\n    }\n}\n\n/**\n * @internal\n */ function F(t, ...e) {\n    if (N.logLevel <= a.WARN) {\n        const n = e.map(B);\n        N.warn(`Firestore (${x}): ${t}`, ...n);\n    }\n}\n\n/**\n * Converts an additional log parameter to a string representation.\n */ function B(t) {\n    if (\"string\" == typeof t) return t;\n    try {\n        return e = t, JSON.stringify(e);\n    } catch (e) {\n        // Converting to JSON failed, just log the object directly\n        return t;\n    }\n    /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n    /** Formats an object as a JSON string, suitable for logging. */\n    var e;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Unconditionally fails, throwing an Error with the given message.\n * Messages are stripped in production builds.\n *\n * Returns `never` and can be used in expressions:\n * @example\n * let futureVar = fail('not implemented yet');\n */ function L(t = \"Unexpected state\") {\n    // Log the failure in addition to throw an exception, just in case the\n    // exception is swallowed.\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\n    // NOTE: We don't use FirestoreError here because these are internal failures\n    // that cannot be handled by the user. (Also it would create a circular\n    // dependency between the error and assert modules which doesn't work.)\n    throw $(e), new Error(e);\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * Messages are stripped in production builds.\n */ function q(t, e) {\n    t || L();\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * The code of callsites invoking this function are stripped out in production\n * builds. Any side-effects of code within the debugAssert() invocation will not\n * happen in this case.\n *\n * @internal\n */ function U(t, e) {\n    t || L();\n}\n\n/**\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\n * instance of `T` before casting.\n */ function K(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n    return t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const G = {\n    // Causes are copied from:\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n    /** Not an error; returned on success. */\n    OK: \"ok\",\n    /** The operation was cancelled (typically by the caller). */\n    CANCELLED: \"cancelled\",\n    /** Unknown error or an error from a different error domain. */\n    UNKNOWN: \"unknown\",\n    /**\n     * Client specified an invalid argument. Note that this differs from\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\n     * problematic regardless of the state of the system (e.g., a malformed file\n     * name).\n     */\n    INVALID_ARGUMENT: \"invalid-argument\",\n    /**\n     * Deadline expired before operation could complete. For operations that\n     * change the state of the system, this error may be returned even if the\n     * operation has completed successfully. For example, a successful response\n     * from a server could have been delayed long enough for the deadline to\n     * expire.\n     */\n    DEADLINE_EXCEEDED: \"deadline-exceeded\",\n    /** Some requested entity (e.g., file or directory) was not found. */\n    NOT_FOUND: \"not-found\",\n    /**\n     * Some entity that we attempted to create (e.g., file or directory) already\n     * exists.\n     */\n    ALREADY_EXISTS: \"already-exists\",\n    /**\n     * The caller does not have permission to execute the specified operation.\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\n     * PERMISSION_DENIED must not be used if the caller can not be identified\n     * (use UNAUTHENTICATED instead for those errors).\n     */\n    PERMISSION_DENIED: \"permission-denied\",\n    /**\n     * The request does not have valid authentication credentials for the\n     * operation.\n     */\n    UNAUTHENTICATED: \"unauthenticated\",\n    /**\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n     * entire file system is out of space.\n     */\n    RESOURCE_EXHAUSTED: \"resource-exhausted\",\n    /**\n     * Operation was rejected because the system is not in a state required for\n     * the operation's execution. For example, directory to be deleted may be\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\n     *\n     * A litmus test that may help a service implementor in deciding\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\n     *  (b) Use ABORTED if the client should retry at a higher-level\n     *      (e.g., restarting a read-modify-write sequence).\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\n     *      the system state has been explicitly fixed. E.g., if an \"rmdir\"\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\n     *      should be returned since the client should not retry unless\n     *      they have first fixed up the directory by deleting files from it.\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\n     *      REST Get/Update/Delete on a resource and the resource on the\n     *      server does not match the condition. E.g., conflicting\n     *      read-modify-write on the same resource.\n     */\n    FAILED_PRECONDITION: \"failed-precondition\",\n    /**\n     * The operation was aborted, typically due to a concurrency issue like\n     * sequencer check failures, transaction aborts, etc.\n     *\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n     * and UNAVAILABLE.\n     */\n    ABORTED: \"aborted\",\n    /**\n     * Operation was attempted past the valid range. E.g., seeking or reading\n     * past end of file.\n     *\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\n     * if the system state changes. For example, a 32-bit file system will\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\n     * an offset past the current file size.\n     *\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\n     * when it applies so that callers who are iterating through a space can\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\n     */\n    OUT_OF_RANGE: \"out-of-range\",\n    /** Operation is not implemented or not supported/enabled in this service. */\n    UNIMPLEMENTED: \"unimplemented\",\n    /**\n     * Internal errors. Means some invariants expected by underlying System has\n     * been broken. If you see one of these errors, Something is very broken.\n     */\n    INTERNAL: \"internal\",\n    /**\n     * The service is currently unavailable. This is a most likely a transient\n     * condition and may be corrected by retrying with a backoff.\n     *\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n     * and UNAVAILABLE.\n     */\n    UNAVAILABLE: \"unavailable\",\n    /** Unrecoverable data loss or corruption. */\n    DATA_LOSS: \"data-loss\"\n};\n\n/** An error returned by a Firestore operation. */ class Q extends u {\n    /** @hideconstructor */\n    constructor(\n    /**\n     * The backend error code associated with this error.\n     */\n    t, \n    /**\n     * A custom error description.\n     */\n    e) {\n        super(t, e), this.code = t, this.message = e, \n        // HACK: We write a toString property directly because Error is not a real\n        // class and so inheritance does not work correctly. We could alternatively\n        // do the same \"back-door inheritance\" trick that FirebaseError does.\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class j {\n    constructor() {\n        this.promise = new Promise(((t, e) => {\n            this.resolve = t, this.reject = e;\n        }));\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class W {\n    constructor(t, e) {\n        this.user = e, this.type = \"OAuth\", this.headers = new Map, this.headers.set(\"Authorization\", `Bearer ${t}`);\n    }\n}\n\n/**\n * A CredentialsProvider that always yields an empty token.\n * @internal\n */ class z {\n    getToken() {\n        return Promise.resolve(null);\n    }\n    invalidateToken() {}\n    start(t, e) {\n        // Fire with initial user.\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\n    }\n    shutdown() {}\n}\n\n/**\n * A CredentialsProvider that always returns a constant token. Used for\n * emulator token mocking.\n */ class H {\n    constructor(t) {\n        this.token = t, \n        /**\n         * Stores the listener registered with setChangeListener()\n         * This isn't actually necessary since the UID never changes, but we use this\n         * to verify the listen contract is adhered to in tests.\n         */\n        this.changeListener = null;\n    }\n    getToken() {\n        return Promise.resolve(this.token);\n    }\n    invalidateToken() {}\n    start(t, e) {\n        this.changeListener = e, \n        // Fire with initial user.\n        t.enqueueRetryable((() => e(this.token.user)));\n    }\n    shutdown() {\n        this.changeListener = null;\n    }\n}\n\nclass J {\n    constructor(t) {\n        this.t = t, \n        /** Tracks the current User. */\n        this.currentUser = C.UNAUTHENTICATED, \n        /**\n         * Counter used to detect if the token changed while a getToken request was\n         * outstanding.\n         */\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\n    }\n    start(t, e) {\n        let n = this.i;\n        // A change listener that prevents double-firing for the same token change.\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\n        // A promise that can be waited on to block on the next token change.\n        // This promise is re-created after each change.\n                let i = new j;\n        this.o = () => {\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\n        };\n        const r = () => {\n            const e = i;\n            t.enqueueRetryable((async () => {\n                await e.promise, await s(this.currentUser);\n            }));\n        }, o = t => {\n            O(\"FirebaseAuthCredentialsProvider\", \"Auth detected\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \n            r();\n        };\n        this.t.onInit((t => o(t))), \n        // Our users can initialize Auth right after Firestore, so we give it\n        // a chance to register itself with the component framework before we\n        // determine whether to start up in unauthenticated mode.\n        setTimeout((() => {\n            if (!this.auth) {\n                const t = this.t.getImmediate({\n                    optional: !0\n                });\n                t ? o(t) : (\n                // If auth is still not available, proceed with `null` user\n                O(\"FirebaseAuthCredentialsProvider\", \"Auth not yet detected\"), i.resolve(), i = new j);\n            }\n        }), 0), r();\n    }\n    getToken() {\n        // Take note of the current value of the tokenCounter so that this method\n        // can fail (with an ABORTED error) if there is a token change while the\n        // request is outstanding.\n        const t = this.i, e = this.forceRefresh;\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \n        // Cancel the request since the token changed while the request was\n        // outstanding so the response is potentially for a previous user (which\n        // user, we can't be sure).\n        this.i !== t ? (O(\"FirebaseAuthCredentialsProvider\", \"getToken aborted due to token change.\"), \n        this.getToken()) : e ? (q(\"string\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\n    }\n    invalidateToken() {\n        this.forceRefresh = !0;\n    }\n    shutdown() {\n        this.auth && this.auth.removeAuthTokenListener(this.o);\n    }\n    // Auth.getUid() can return null even with a user logged in. It is because\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\n    // This method should only be called in the AuthTokenListener callback\n    // to guarantee to get the actual user.\n    u() {\n        const t = this.auth && this.auth.getUid();\n        return q(null === t || \"string\" == typeof t), new C(t);\n    }\n}\n\n/*\n * FirstPartyToken provides a fresh token each time its value\n * is requested, because if the token is too old, requests will be rejected.\n * Technically this may no longer be necessary since the SDK should gracefully\n * recover from unauthenticated errors (see b/33147818 for context), but it's\n * safer to keep the implementation as-is.\n */ class Y {\n    constructor(t, e, n) {\n        this.type = \"FirstParty\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\"X-Goog-AuthUser\", e);\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\n        s && this.headers.set(\"Authorization\", s), n && this.headers.set(\"X-Goog-Iam-Authorization-Token\", n);\n    }\n}\n\n/*\n * Provides user credentials required for the Firestore JavaScript SDK\n * to authenticate the user, using technique that is only available\n * to applications hosted by Google.\n */ class X {\n    constructor(t, e, n) {\n        this.h = t, this.l = e, this.m = n;\n    }\n    getToken() {\n        return Promise.resolve(new Y(this.h, this.l, this.m));\n    }\n    start(t, e) {\n        // Fire with initial uid.\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\n    }\n    shutdown() {}\n    invalidateToken() {}\n}\n\nclass Z {\n    constructor(t) {\n        this.value = t, this.type = \"AppCheck\", this.headers = new Map, t && t.length > 0 && this.headers.set(\"x-firebase-appcheck\", this.value);\n    }\n}\n\nclass tt {\n    constructor(t) {\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\n    }\n    start(t, e) {\n        const n = t => {\n            null != t.error && O(\"FirebaseAppCheckTokenProvider\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\n            const n = t.token !== this.p;\n            return this.p = t.token, O(\"FirebaseAppCheckTokenProvider\", `Received ${n ? \"new\" : \"existing\"} token.`), \n            n ? e(t.token) : Promise.resolve();\n        };\n        this.o = e => {\n            t.enqueueRetryable((() => n(e)));\n        };\n        const s = t => {\n            O(\"FirebaseAppCheckTokenProvider\", \"AppCheck detected\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\n        };\n        this.g.onInit((t => s(t))), \n        // Our users can initialize AppCheck after Firestore, so we give it\n        // a chance to register itself with the component framework.\n        setTimeout((() => {\n            if (!this.appCheck) {\n                const t = this.g.getImmediate({\n                    optional: !0\n                });\n                t ? s(t) : \n                // If AppCheck is still not available, proceed without it.\n                O(\"FirebaseAppCheckTokenProvider\", \"AppCheck not yet detected\");\n            }\n        }), 0);\n    }\n    getToken() {\n        const t = this.forceRefresh;\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (q(\"string\" == typeof t.token), \n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\n    }\n    invalidateToken() {\n        this.forceRefresh = !0;\n    }\n    shutdown() {\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\n    }\n}\n\n/**\n * An AppCheck token provider that always yields an empty token.\n * @internal\n */ class et {\n    getToken() {\n        return Promise.resolve(new Z(\"\"));\n    }\n    invalidateToken() {}\n    start(t, e) {}\n    shutdown() {}\n}\n\n/**\n * Builds a CredentialsProvider depending on the type of\n * the credentials passed in.\n */\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\n * exceed. All subsequent calls to next will return increasing values. If provided with a\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\n * well as write out sequence numbers that it produces via `next()`.\n */\nclass nt {\n    constructor(t, e) {\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\n    }\n    I(t) {\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\n    }\n    next() {\n        const t = ++this.previousValue;\n        return this.T && this.T(t), t;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generates `nBytes` of random bytes.\n *\n * If `nBytes < 0` , an error will be thrown.\n */\nfunction st(t) {\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\n    const e = \n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    \"undefined\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\n    if (e && \"function\" == typeof e.getRandomValues) e.getRandomValues(n); else \n    // Falls back to Math.random\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\n    return n;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ nt.A = -1;\n\nclass it {\n    static R() {\n        // Alphanumeric characters\n        const t = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\", e = Math.floor(256 / t.length) * t.length;\n        // The largest byte value that is a multiple of `char.length`.\n                let n = \"\";\n        for (;n.length < 20; ) {\n            const s = st(40);\n            for (let i = 0; i < s.length; ++i) \n            // Only accept values that are [0, maxMultiple), this ensures they can\n            // be evenly mapped to indices of `chars` via a modulo operation.\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\n        }\n        return n;\n    }\n}\n\nfunction rt(t, e) {\n    return t < e ? -1 : t > e ? 1 : 0;\n}\n\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\n}\n\n/**\n * Returns the immediate lexicographically-following string. This is useful to\n * construct an inclusive range for indexeddb iterators.\n */ function at(t) {\n    // Return the input string, with an additional NUL byte appended.\n    return t + \"\\0\";\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\n/**\n * A `Timestamp` represents a point in time independent of any time zone or\n * calendar, represented as seconds and fractions of seconds at nanosecond\n * resolution in UTC Epoch time.\n *\n * It is encoded using the Proleptic Gregorian Calendar which extends the\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59.999999999Z.\n *\n * For examples and further specifications, refer to the\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\n */\nclass ut {\n    /**\n     * Creates a new timestamp.\n     *\n     * @param seconds - The number of seconds of UTC time since Unix epoch\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n     *     9999-12-31T23:59:59Z inclusive.\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\n     *     resolution. Negative second values with fractions must still have\n     *     non-negative nanoseconds values that count forward in time. Must be\n     *     from 0 to 999,999,999 inclusive.\n     */\n    constructor(\n    /**\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\n     */\n    t, \n    /**\n     * The fractions of a second at nanosecond resolution.*\n     */\n    e) {\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n        // This will break in the year 10,000.\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n    }\n    /**\n     * Creates a new timestamp with the current date, with millisecond precision.\n     *\n     * @returns a new timestamp representing the current date.\n     */    static now() {\n        return ut.fromMillis(Date.now());\n    }\n    /**\n     * Creates a new timestamp from the given date.\n     *\n     * @param date - The date to initialize the `Timestamp` from.\n     * @returns A new `Timestamp` representing the same point in time as the given\n     *     date.\n     */    static fromDate(t) {\n        return ut.fromMillis(t.getTime());\n    }\n    /**\n     * Creates a new timestamp from the given number of milliseconds.\n     *\n     * @param milliseconds - Number of milliseconds since Unix epoch\n     *     1970-01-01T00:00:00Z.\n     * @returns A new `Timestamp` representing the same point in time as the given\n     *     number of milliseconds.\n     */    static fromMillis(t) {\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\n        return new ut(e, n);\n    }\n    /**\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\n     * causes a loss of precision since `Date` objects only support millisecond\n     * precision.\n     *\n     * @returns JavaScript `Date` object representing the same point in time as\n     *     this `Timestamp`, with millisecond precision.\n     */    toDate() {\n        return new Date(this.toMillis());\n    }\n    /**\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\n     * epoch). This operation causes a loss of precision.\n     *\n     * @returns The point in time corresponding to this timestamp, represented as\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\n     */    toMillis() {\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\n    }\n    _compareTo(t) {\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\n    }\n    /**\n     * Returns true if this `Timestamp` is equal to the provided one.\n     *\n     * @param other - The `Timestamp` to compare against.\n     * @returns true if this `Timestamp` is equal to the provided one.\n     */    isEqual(t) {\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\n    }\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\n        return \"Timestamp(seconds=\" + this.seconds + \", nanoseconds=\" + this.nanoseconds + \")\";\n    }\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\n        return {\n            seconds: this.seconds,\n            nanoseconds: this.nanoseconds\n        };\n    }\n    /**\n     * Converts this object to a primitive string, which allows `Timestamp` objects\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\n     */    valueOf() {\n        // This method returns a string of the form <seconds>.<nanoseconds> where\n        // <seconds> is translated to have a non-negative value and both <seconds>\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\n        // Strings with this format then have a lexiographical ordering that matches\n        // the expected ordering. The <seconds> translation is done to avoid having\n        // a leading negative sign (i.e. a leading '-' character) in its string\n        // representation, which would affect its lexiographical ordering.\n        const t = this.seconds - -62135596800;\n        // Note: Up to 12 decimal digits are required to represent all valid\n        // 'seconds' values.\n                return String(t).padStart(12, \"0\") + \".\" + String(this.nanoseconds).padStart(9, \"0\");\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A version of a document in Firestore. This corresponds to the version\n * timestamp, such as update_time or read_time.\n */ class ct {\n    constructor(t) {\n        this.timestamp = t;\n    }\n    static fromTimestamp(t) {\n        return new ct(t);\n    }\n    static min() {\n        return new ct(new ut(0, 0));\n    }\n    compareTo(t) {\n        return this.timestamp._compareTo(t.timestamp);\n    }\n    isEqual(t) {\n        return this.timestamp.isEqual(t.timestamp);\n    }\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\n        // Convert to microseconds.\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\n    }\n    toString() {\n        return \"SnapshotVersion(\" + this.timestamp.toString() + \")\";\n    }\n    toTimestamp() {\n        return this.timestamp;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function ht(t) {\n    let e = 0;\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\n    return e;\n}\n\nfunction lt(t, e) {\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\n}\n\nfunction ft(t) {\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\n    return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Path represents an ordered sequence of string segments.\n */\nclass dt {\n    constructor(t, e, n) {\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \n        this.segments = t, this.offset = e, this.len = n;\n    }\n    get length() {\n        return this.len;\n    }\n    isEqual(t) {\n        return 0 === dt.comparator(this, t);\n    }\n    child(t) {\n        const e = this.segments.slice(this.offset, this.limit());\n        return t instanceof dt ? t.forEach((t => {\n            e.push(t);\n        })) : e.push(t), this.construct(e);\n    }\n    /** The index of one past the last segment of the path. */    limit() {\n        return this.offset + this.length;\n    }\n    popFirst(t) {\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\n    }\n    popLast() {\n        return this.construct(this.segments, this.offset, this.length - 1);\n    }\n    firstSegment() {\n        return this.segments[this.offset];\n    }\n    lastSegment() {\n        return this.get(this.length - 1);\n    }\n    get(t) {\n        return this.segments[this.offset + t];\n    }\n    isEmpty() {\n        return 0 === this.length;\n    }\n    isPrefixOf(t) {\n        if (t.length < this.length) return !1;\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n        return !0;\n    }\n    isImmediateParentOf(t) {\n        if (this.length + 1 !== t.length) return !1;\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\n        return !0;\n    }\n    forEach(t) {\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\n    }\n    toArray() {\n        return this.segments.slice(this.offset, this.limit());\n    }\n    static comparator(t, e) {\n        const n = Math.min(t.length, e.length);\n        for (let s = 0; s < n; s++) {\n            const n = t.get(s), i = e.get(s);\n            if (n < i) return -1;\n            if (n > i) return 1;\n        }\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\n    }\n}\n\n/**\n * A slash-separated path for navigating resources (documents and collections)\n * within Firestore.\n *\n * @internal\n */ class _t extends dt {\n    construct(t, e, n) {\n        return new _t(t, e, n);\n    }\n    canonicalString() {\n        // NOTE: The client is ignorant of any path segments containing escape\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\n        // for legacy reasons and should not be used frequently).\n        return this.toArray().join(\"/\");\n    }\n    toString() {\n        return this.canonicalString();\n    }\n    /**\n     * Creates a resource path from the given slash-delimited string. If multiple\n     * arguments are provided, all components are combined. Leading and trailing\n     * slashes from all components are ignored.\n     */    static fromString(...t) {\n        // NOTE: The client is ignorant of any path segments containing escape\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\n        // for legacy reasons and should not be used frequently).\n        const e = [];\n        for (const n of t) {\n            if (n.indexOf(\"//\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\n            // Strip leading and traling slashed.\n                        e.push(...n.split(\"/\").filter((t => t.length > 0)));\n        }\n        return new _t(e);\n    }\n    static emptyPath() {\n        return new _t([]);\n    }\n}\n\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n\n/**\n * A dot-separated path for navigating sub-objects within a document.\n * @internal\n */ class mt extends dt {\n    construct(t, e, n) {\n        return new mt(t, e, n);\n    }\n    /**\n     * Returns true if the string could be used as a segment in a field path\n     * without escaping.\n     */    static isValidIdentifier(t) {\n        return wt.test(t);\n    }\n    canonicalString() {\n        return this.toArray().map((t => (t = t.replace(/\\\\/g, \"\\\\\\\\\").replace(/`/g, \"\\\\`\"), \n        mt.isValidIdentifier(t) || (t = \"`\" + t + \"`\"), t))).join(\".\");\n    }\n    toString() {\n        return this.canonicalString();\n    }\n    /**\n     * Returns true if this field references the key of a document.\n     */    isKeyField() {\n        return 1 === this.length && \"__name__\" === this.get(0);\n    }\n    /**\n     * The field designating the key of a document.\n     */    static keyField() {\n        return new mt([ \"__name__\" ]);\n    }\n    /**\n     * Parses a field string from the given server-formatted string.\n     *\n     * - Splitting the empty string is not allowed (for now at least).\n     * - Empty segments within the string (e.g. if there are two consecutive\n     *   separators) are not allowed.\n     *\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\n     * non-identifier path components, even if they aren't escaped.\n     */    static fromServerFormat(t) {\n        const e = [];\n        let n = \"\", s = 0;\n        const i = () => {\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\n            e.push(n), n = \"\";\n        };\n        let r = !1;\n        for (;s < t.length; ) {\n            const e = t[s];\n            if (\"\\\\\" === e) {\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \"Path has trailing escape character: \" + t);\n                const e = t[s + 1];\n                if (\"\\\\\" !== e && \".\" !== e && \"`\" !== e) throw new Q(G.INVALID_ARGUMENT, \"Path has invalid escape sequence: \" + t);\n                n += e, s += 2;\n            } else \"`\" === e ? (r = !r, s++) : \".\" !== e || r ? (n += e, s++) : (i(), s++);\n        }\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \"Unterminated ` in path: \" + t);\n        return new mt(e);\n    }\n    static emptyPath() {\n        return new mt([]);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a set of fields that can be used to partially patch a document.\n * FieldMask is used in conjunction with ObjectValue.\n * Examples:\n *   foo - Overwrites foo entirely with the provided value. If foo is not\n *         present in the companion ObjectValue, the field is deleted.\n *   foo.bar - Overwrites only the field bar of the object foo.\n *             If foo is not an object, foo is replaced with an object\n *             containing foo\n */ class gt {\n    constructor(t) {\n        this.fields = t, \n        // TODO(dimond): validation of FieldMask\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\n        t.sort(mt.comparator);\n    }\n    /**\n     * Verifies that `fieldPath` is included by at least one field in this field\n     * mask.\n     *\n     * This is an O(n) operation, where `n` is the size of the field mask.\n     */    covers(t) {\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\n        return !1;\n    }\n    isEqual(t) {\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Converts a Base64 encoded string to a binary string. */\n/** True if and only if the Base64 conversion functions are available. */\nfunction yt() {\n    return \"undefined\" != typeof atob;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Immutable class that represents a \"proto\" byte string.\n *\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\n * sent on the wire. This class abstracts away this differentiation by holding\n * the proto byte string in a common class that must be converted into a string\n * before being sent as a proto.\n * @internal\n */ class pt {\n    constructor(t) {\n        this.binaryString = t;\n    }\n    static fromBase64String(t) {\n        const e = atob(t);\n        return new pt(e);\n    }\n    static fromUint8Array(t) {\n        // TODO(indexing); Remove the copy of the byte string here as this method\n        // is frequently called during indexing.\n        const e = \n        /**\n * Helper function to convert an Uint8array to a binary string.\n */\n        function(t) {\n            let e = \"\";\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\n            return e;\n        }\n        /**\n * Helper function to convert a binary string to an Uint8Array.\n */ (t);\n        return new pt(e);\n    }\n    [Symbol.iterator]() {\n        let t = 0;\n        return {\n            next: () => t < this.binaryString.length ? {\n                value: this.binaryString.charCodeAt(t++),\n                done: !1\n            } : {\n                value: void 0,\n                done: !0\n            }\n        };\n    }\n    toBase64() {\n        return t = this.binaryString, btoa(t);\n        /** Converts a binary string to a Base64 encoded string. */\n        var t;\n    }\n    toUint8Array() {\n        return function(t) {\n            const e = new Uint8Array(t.length);\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\n            return e;\n        }\n        /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\n        (this.binaryString);\n    }\n    approximateByteSize() {\n        return 2 * this.binaryString.length;\n    }\n    compareTo(t) {\n        return rt(this.binaryString, t.binaryString);\n    }\n    isEqual(t) {\n        return this.binaryString === t.binaryString;\n    }\n}\n\npt.EMPTY_BYTE_STRING = new pt(\"\");\n\nconst It = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\n\n/**\n * Converts the possible Proto values for a timestamp value into a \"seconds and\n * nanos\" representation.\n */ function Tt(t) {\n    // The json interface (for the browser) will return an iso timestamp string,\n    // while the proto js library (for node) will return a\n    // google.protobuf.Timestamp instance.\n    if (q(!!t), \"string\" == typeof t) {\n        // The date string can have higher precision (nanos) than the Date class\n        // (millis), so we do some custom parsing here.\n        // Parse the nanos right out of the string.\n        let e = 0;\n        const n = It.exec(t);\n        if (q(!!n), n[1]) {\n            // Pad the fraction out to 9 digits (nanos).\n            let t = n[1];\n            t = (t + \"000000000\").substr(0, 9), e = Number(t);\n        }\n        // Parse the date to get the seconds.\n                const s = new Date(t);\n        return {\n            seconds: Math.floor(s.getTime() / 1e3),\n            nanos: e\n        };\n    }\n    return {\n        seconds: Et(t.seconds),\n        nanos: Et(t.nanos)\n    };\n}\n\n/**\n * Converts the possible Proto types for numbers into a JavaScript number.\n * Returns 0 if the value is not numeric.\n */ function Et(t) {\n    // TODO(bjornick): Handle int64 greater than 53 bits.\n    return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n}\n\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\n    return \"string\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a locally-applied ServerTimestamp.\n *\n * Server Timestamps are backed by MapValues that contain an internal field\n * `__type__` with a value of `server_timestamp`. The previous value and local\n * write time are stored in its `__previous_value__` and `__local_write_time__`\n * fields respectively.\n *\n * Notes:\n * - ServerTimestampValue instances are created as the result of applying a\n *   transform. They can only exist in the local view of a document. Therefore\n *   they do not need to be parsed or serialized.\n * - When evaluated locally (e.g. for snapshot.data()), they by default\n *   evaluate to `null`. This behavior can be configured by passing custom\n *   FieldValueOptions to value().\n * - With respect to other ServerTimestampValues, they sort by their\n *   localWriteTime.\n */ function Rt(t) {\n    var e, n;\n    return \"server_timestamp\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\n}\n\n/**\n * Creates a new ServerTimestamp proto value (using the internal format).\n */\n/**\n * Returns the value of the field before this ServerTimestamp was set.\n *\n * Preserving the previous values allows the user to display the last resoled\n * value until the backend responds with the timestamp.\n */\nfunction bt(t) {\n    const e = t.mapValue.fields.__previous_value__;\n    return Rt(e) ? bt(e) : e;\n}\n\n/**\n * Returns the local time at which this timestamp was first set.\n */ function Pt(t) {\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\n    return new ut(e.seconds, e.nanos);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class Vt {\n    /**\n     * Constructs a DatabaseInfo using the provided host, databaseId and\n     * persistenceKey.\n     *\n     * @param databaseId - The database to use.\n     * @param appId - The Firebase App Id.\n     * @param persistenceKey - A unique identifier for this Firestore's local\n     * storage (used in conjunction with the databaseId).\n     * @param host - The Firestore backend host to connect to.\n     * @param ssl - Whether to use SSL when connecting.\n     * @param forceLongPolling - Whether to use the forceLongPolling option\n     * when using WebChannel as the network transport.\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\n     * option when using WebChannel as the network transport.\n     * @param useFetchStreams Whether to use the Fetch API instead of\n     * XMLHTTPRequest\n     */\n    constructor(t, e, n, s, i, r, o, a) {\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = a;\n    }\n}\n\n/** The default database name for a project. */\n/**\n * Represents the database ID a Firestore client is associated with.\n * @internal\n */\nclass vt {\n    constructor(t, e) {\n        this.projectId = t, this.database = e || \"(default)\";\n    }\n    static empty() {\n        return new vt(\"\", \"\");\n    }\n    get isDefaultDatabase() {\n        return \"(default)\" === this.database;\n    }\n    isEqual(t) {\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Sentinel value that sorts before any Mutation Batch ID. */\n/**\n * Returns whether a variable is either undefined or null.\n */\nfunction St(t) {\n    return null == t;\n}\n\n/** Returns whether the value represents -0. */ function Dt(t) {\n    // Detect if the value is -0.0. Based on polyfill from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n    return 0 === t && 1 / t == -1 / 0;\n}\n\n/**\n * Returns whether a value is an integer and in the safe integer range\n * @param value - The value to test for being an integer and in the safe range\n */ function Ct(t) {\n    return \"number\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @internal\n */ class xt {\n    constructor(t) {\n        this.path = t;\n    }\n    static fromPath(t) {\n        return new xt(_t.fromString(t));\n    }\n    static fromName(t) {\n        return new xt(_t.fromString(t).popFirst(5));\n    }\n    static empty() {\n        return new xt(_t.emptyPath());\n    }\n    get collectionGroup() {\n        return this.path.popLast().lastSegment();\n    }\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\n    }\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\n        return this.path.get(this.path.length - 2);\n    }\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\n        return this.path.popLast();\n    }\n    isEqual(t) {\n        return null !== t && 0 === _t.comparator(this.path, t.path);\n    }\n    toString() {\n        return this.path.toString();\n    }\n    static comparator(t, e) {\n        return _t.comparator(t.path, e.path);\n    }\n    static isDocumentKey(t) {\n        return t.length % 2 == 0;\n    }\n    /**\n     * Creates and returns a new document key with the given segments.\n     *\n     * @param segments - The segments of the path to the document\n     * @returns A new instance of DocumentKey\n     */    static fromSegments(t) {\n        return new xt(new _t(t.slice()));\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Nt = {\n    mapValue: {\n        fields: {\n            __type__: {\n                stringValue: \"__max__\"\n            }\n        }\n    }\n}, kt = {\n    nullValue: \"NULL_VALUE\"\n};\n\n/** Extracts the backend's type order for the provided value. */\nfunction Mt(t) {\n    return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : L();\n}\n\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\n    if (t === e) return !0;\n    const n = Mt(t);\n    if (n !== Mt(e)) return !1;\n    switch (n) {\n      case 0 /* NullValue */ :\n      case 9007199254740991 /* MaxValue */ :\n        return !0;\n\n      case 1 /* BooleanValue */ :\n        return t.booleanValue === e.booleanValue;\n\n      case 4 /* ServerTimestampValue */ :\n        return Pt(t).isEqual(Pt(e));\n\n      case 3 /* TimestampValue */ :\n        return function(t, e) {\n            if (\"string\" == typeof t.timestampValue && \"string\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \n            // Use string equality for ISO 8601 timestamps\n            return t.timestampValue === e.timestampValue;\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\n            return n.seconds === s.seconds && n.nanos === s.nanos;\n        }(t, e);\n\n      case 5 /* StringValue */ :\n        return t.stringValue === e.stringValue;\n\n      case 6 /* BlobValue */ :\n        return function(t, e) {\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\n        }(t, e);\n\n      case 7 /* RefValue */ :\n        return t.referenceValue === e.referenceValue;\n\n      case 8 /* GeoPointValue */ :\n        return function(t, e) {\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\n        }(t, e);\n\n      case 2 /* NumberValue */ :\n        return function(t, e) {\n            if (\"integerValue\" in t && \"integerValue\" in e) return Et(t.integerValue) === Et(e.integerValue);\n            if (\"doubleValue\" in t && \"doubleValue\" in e) {\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\n            }\n            return !1;\n        }(t, e);\n\n      case 9 /* ArrayValue */ :\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\n\n      case 10 /* ObjectValue */ :\n        return function(t, e) {\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\n            if (ht(n) !== ht(s)) return !1;\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\n            return !0;\n        }\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\n\n      default:\n        return L();\n    }\n}\n\nfunction $t(t, e) {\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\n}\n\nfunction Ft(t, e) {\n    if (t === e) return 0;\n    const n = Mt(t), s = Mt(e);\n    if (n !== s) return rt(n, s);\n    switch (n) {\n      case 0 /* NullValue */ :\n      case 9007199254740991 /* MaxValue */ :\n        return 0;\n\n      case 1 /* BooleanValue */ :\n        return rt(t.booleanValue, e.booleanValue);\n\n      case 2 /* NumberValue */ :\n        return function(t, e) {\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \n            // one or both are NaN.\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\n        }(t, e);\n\n      case 3 /* TimestampValue */ :\n        return Bt(t.timestampValue, e.timestampValue);\n\n      case 4 /* ServerTimestampValue */ :\n        return Bt(Pt(t), Pt(e));\n\n      case 5 /* StringValue */ :\n        return rt(t.stringValue, e.stringValue);\n\n      case 6 /* BlobValue */ :\n        return function(t, e) {\n            const n = At(t), s = At(e);\n            return n.compareTo(s);\n        }(t.bytesValue, e.bytesValue);\n\n      case 7 /* RefValue */ :\n        return function(t, e) {\n            const n = t.split(\"/\"), s = e.split(\"/\");\n            for (let t = 0; t < n.length && t < s.length; t++) {\n                const e = rt(n[t], s[t]);\n                if (0 !== e) return e;\n            }\n            return rt(n.length, s.length);\n        }(t.referenceValue, e.referenceValue);\n\n      case 8 /* GeoPointValue */ :\n        return function(t, e) {\n            const n = rt(Et(t.latitude), Et(e.latitude));\n            if (0 !== n) return n;\n            return rt(Et(t.longitude), Et(e.longitude));\n        }(t.geoPointValue, e.geoPointValue);\n\n      case 9 /* ArrayValue */ :\n        return function(t, e) {\n            const n = t.values || [], s = e.values || [];\n            for (let t = 0; t < n.length && t < s.length; ++t) {\n                const e = Ft(n[t], s[t]);\n                if (e) return e;\n            }\n            return rt(n.length, s.length);\n        }(t.arrayValue, e.arrayValue);\n\n      case 10 /* ObjectValue */ :\n        return function(t, e) {\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\n            // Even though MapValues are likely sorted correctly based on their insertion\n            // order (e.g. when received from the backend), local modifications can bring\n            // elements out of order. We need to re-sort the elements to ensure that\n            // canonical IDs are independent of insertion order.\n            s.sort(), r.sort();\n            for (let t = 0; t < s.length && t < r.length; ++t) {\n                const e = rt(s[t], r[t]);\n                if (0 !== e) return e;\n                const o = Ft(n[s[t]], i[r[t]]);\n                if (0 !== o) return o;\n            }\n            return rt(s.length, r.length);\n        }\n        /**\n * Generates the canonical ID for the provided field value (as used in Target\n * serialization).\n */ (t.mapValue, e.mapValue);\n\n      default:\n        throw L();\n    }\n}\n\nfunction Bt(t, e) {\n    if (\"string\" == typeof t && \"string\" == typeof e && t.length === e.length) return rt(t, e);\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\n}\n\nfunction Lt(t) {\n    return qt(t);\n}\n\nfunction qt(t) {\n    return \"nullValue\" in t ? \"null\" : \"booleanValue\" in t ? \"\" + t.booleanValue : \"integerValue\" in t ? \"\" + t.integerValue : \"doubleValue\" in t ? \"\" + t.doubleValue : \"timestampValue\" in t ? function(t) {\n        const e = Tt(t);\n        return `time(${e.seconds},${e.nanos})`;\n    }(t.timestampValue) : \"stringValue\" in t ? t.stringValue : \"bytesValue\" in t ? At(t.bytesValue).toBase64() : \"referenceValue\" in t ? (n = t.referenceValue, \n    xt.fromName(n).toString()) : \"geoPointValue\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \"arrayValue\" in t ? function(t) {\n        let e = \"[\", n = !0;\n        for (const s of t.values || []) n ? n = !1 : e += \",\", e += qt(s);\n        return e + \"]\";\n    }\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \"mapValue\" in t ? function(t) {\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\n        // matching canonical IDs for identical maps, we need to sort the keys.\n        const e = Object.keys(t.fields || {}).sort();\n        let n = \"{\", s = !0;\n        for (const i of e) s ? s = !1 : n += \",\", n += `${i}:${qt(t.fields[i])}`;\n        return n + \"}\";\n    }(t.mapValue) : L();\n    var e, n;\n}\n\nfunction Ut(t, e) {\n    return {\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\n    };\n}\n\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\n    return !!t && \"integerValue\" in t;\n}\n\n/** Returns true if `value` is a DoubleValue. */\n/** Returns true if `value` is an ArrayValue. */\nfunction Gt(t) {\n    return !!t && \"arrayValue\" in t;\n}\n\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\n    return !!t && \"nullValue\" in t;\n}\n\n/** Returns true if `value` is NaN. */ function jt(t) {\n    return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}\n\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\n    return !!t && \"mapValue\" in t;\n}\n\n/** Creates a deep copy of `source`. */ function zt(t) {\n    if (t.geoPointValue) return {\n        geoPointValue: Object.assign({}, t.geoPointValue)\n    };\n    if (t.timestampValue && \"object\" == typeof t.timestampValue) return {\n        timestampValue: Object.assign({}, t.timestampValue)\n    };\n    if (t.mapValue) {\n        const e = {\n            mapValue: {\n                fields: {}\n            }\n        };\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\n    }\n    if (t.arrayValue) {\n        const e = {\n            arrayValue: {\n                values: []\n            }\n        };\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\n        return e;\n    }\n    return Object.assign({}, t);\n}\n\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\n    return \"__max__\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\n}\n\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t, e) {\n    return void 0 === t ? e : void 0 === e || Ft(t, e) > 0 ? t : e;\n}\n\nfunction Yt(t, e) {\n    return void 0 === t ? e : void 0 === e || Ft(t, e) < 0 ? t : e;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\n * ability to add and remove fields (via the ObjectValueBuilder).\n */ class Xt {\n    constructor(t) {\n        this.value = t;\n    }\n    static empty() {\n        return new Xt({\n            mapValue: {}\n        });\n    }\n    /**\n     * Returns the value at the given path or null.\n     *\n     * @param path - the path to search\n     * @returns The value at the path or null if the path is not set.\n     */    field(t) {\n        if (t.isEmpty()) return this.value;\n        {\n            let e = this.value;\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \n            !Wt(e)) return null;\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\n        }\n    }\n    /**\n     * Sets the field to the provided value.\n     *\n     * @param path - The field path to set.\n     * @param value - The value to set.\n     */    set(t, e) {\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\n    }\n    /**\n     * Sets the provided fields to the provided values.\n     *\n     * @param data - A map of fields to values (or null for deletes).\n     */    setAll(t) {\n        let e = mt.emptyPath(), n = {}, s = [];\n        t.forEach(((t, i) => {\n            if (!e.isImmediateParentOf(i)) {\n                // Insert the accumulated changes at this parent location\n                const t = this.getFieldsMap(e);\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\n            }\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\n        }));\n        const i = this.getFieldsMap(e);\n        this.applyChanges(i, n, s);\n    }\n    /**\n     * Removes the field at the specified path. If there is no field at the\n     * specified path, nothing is changed.\n     *\n     * @param path - The field path to remove.\n     */    delete(t) {\n        const e = this.field(t.popLast());\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\n    }\n    isEqual(t) {\n        return Ot(this.value, t.value);\n    }\n    /**\n     * Returns the map that contains the leaf element of `path`. If the parent\n     * entry does not yet exist, or if it is not a map, a new map will be created.\n     */    getFieldsMap(t) {\n        let e = this.value;\n        e.mapValue.fields || (e.mapValue = {\n            fields: {}\n        });\n        for (let n = 0; n < t.length; ++n) {\n            let s = e.mapValue.fields[t.get(n)];\n            Wt(s) && s.mapValue.fields || (s = {\n                mapValue: {\n                    fields: {}\n                }\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\n        }\n        return e.mapValue.fields;\n    }\n    /**\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\n     * entries.\n     */    applyChanges(t, e, n) {\n        lt(e, ((e, n) => t[e] = n));\n        for (const e of n) delete t[e];\n    }\n    clone() {\n        return new Xt(zt(this.value));\n    }\n}\n\n/**\n * Returns a FieldMask built from all fields in a MapValue.\n */ function Zt(t) {\n    const e = [];\n    return lt(t.fields, ((t, n) => {\n        const s = new mt([ t ]);\n        if (Wt(n)) {\n            const t = Zt(n.mapValue).fields;\n            if (0 === t.length) \n            // Preserve the empty map by adding it to the FieldMask.\n            e.push(s); else \n            // For nested and non-empty ObjectValues, add the FieldPath of the\n            // leaf nodes.\n            for (const n of t) e.push(s.child(n));\n        } else \n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\n        // nodes.\n        e.push(s);\n    })), new gt(e);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a document in Firestore with a key, version, data and whether it\n * has local mutations applied to it.\n *\n * Documents can transition between states via `convertToFoundDocument()`,\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\n * not transition to one of these states even after all mutations have been\n * applied, `isValidDocument()` returns false and the document should be removed\n * from all views.\n */ class te {\n    constructor(t, e, n, s, i, r) {\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \n        this.documentState = r;\n    }\n    /**\n     * Creates a document with no known version or data, but which can serve as\n     * base document for mutations.\n     */    static newInvalidDocument(t) {\n        return new te(t, 0 /* INVALID */ , ct.min(), ct.min(), Xt.empty(), 0 /* SYNCED */);\n    }\n    /**\n     * Creates a new document that is known to exist with the given data at the\n     * given version.\n     */    static newFoundDocument(t, e, n) {\n        return new te(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\n    }\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\n        return new te(t, 2 /* NO_DOCUMENT */ , e, ct.min(), Xt.empty(), 0 /* SYNCED */);\n    }\n    /**\n     * Creates a new document that is known to exist at the given version but\n     * whose data is not known (e.g. a document that was updated without a known\n     * base document).\n     */    static newUnknownDocument(t, e) {\n        return new te(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), Xt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\n    }\n    /**\n     * Changes the document type to indicate that it exists and that its version\n     * and data are known.\n     */    convertToFoundDocument(t, e) {\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \n        this.documentState = 0 /* SYNCED */ , this;\n    }\n    /**\n     * Changes the document type to indicate that it doesn't exist at the given\n     * version.\n     */    convertToNoDocument(t) {\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Xt.empty(), \n        this.documentState = 0 /* SYNCED */ , this;\n    }\n    /**\n     * Changes the document type to indicate that it exists at a given version but\n     * that its data is not known (e.g. a document that was updated without a known\n     * base document).\n     */    convertToUnknownDocument(t) {\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Xt.empty(), \n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n    }\n    setHasCommittedMutations() {\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n    }\n    setHasLocalMutations() {\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\n    }\n    setReadTime(t) {\n        return this.readTime = t, this;\n    }\n    get hasLocalMutations() {\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\n    }\n    get hasCommittedMutations() {\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\n    }\n    get hasPendingWrites() {\n        return this.hasLocalMutations || this.hasCommittedMutations;\n    }\n    isValidDocument() {\n        return 0 /* INVALID */ !== this.documentType;\n    }\n    isFoundDocument() {\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\n    }\n    isNoDocument() {\n        return 2 /* NO_DOCUMENT */ === this.documentType;\n    }\n    isUnknownDocument() {\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\n    }\n    isEqual(t) {\n        return t instanceof te && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\n    }\n    mutableCopy() {\n        return new te(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\n    }\n    toString() {\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\n    }\n}\n\n/**\n * Compares the value for field `field` in the provided documents. Throws if\n * the field does not exist in both documents.\n */\n/**\n * An index definition for field indexes in Firestore.\n *\n * Every index is associated with a collection. The definition contains a list\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\n *\n * Unlike the backend, the SDK does not differentiate between collection or\n * collection group-scoped indices. Every index can be used for both single\n * collection and collection group queries.\n */\nclass ee {\n    constructor(\n    /**\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\n     * has not yet been persisted).\n     */\n    t, \n    /** The collection ID this index applies to. */\n    e, \n    /** The field segments for this index. */\n    n, \n    /** Shows how up-to-date the index is for the current user. */\n    s) {\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\n    }\n}\n\n/** An ID for an index that has not yet been added to persistence.  */\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\nfunction ne(t) {\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\n}\n\n/** Returns all directional (ascending/descending) segments for this index. */ function se(t) {\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\n}\n\n/** Returns a debug representation of the field index */ ee.UNKNOWN_ID = -1;\n\n/** An index component consisting of field path and index type.  */\nclass ie {\n    constructor(\n    /** The field path of the component. */\n    t, \n    /** The fields sorting order. */\n    e) {\n        this.fieldPath = t, this.kind = e;\n    }\n}\n\n/**\n * Stores the \"high water mark\" that indicates how updated the Index is for the\n * current user.\n */ class re {\n    constructor(\n    /**\n     * Indicates when the index was last updated (relative to other indexes).\n     */\n    t, \n    /** The the latest indexed read time, document and batch id. */\n    e) {\n        this.sequenceNumber = t, this.offset = e;\n    }\n    /** The state of an index that has not yet been backfilled. */    static empty() {\n        return new re(0, oe.min());\n    }\n}\n\n/**\n * Stores the latest read time, document and batch ID that were processed for an\n * index.\n */ class oe {\n    constructor(\n    /**\n     * The latest read time version that has been indexed by Firestore for this\n     * field index.\n     */\n    t, \n    /**\n     * The key of the last document that was indexed for this query. Use\n     * `DocumentKey.empty()` if no document has been indexed.\n     */\n    e, \n    /*\n     * The largest mutation batch id that's been processed by Firestore.\n     */\n    n) {\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\n    }\n    /** The state of an index that has not yet been backfilled. */    static min() {\n        return new oe(ct.min(), xt.empty(), -1);\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Visible for testing\nclass ae {\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \n        this.startAt = r, this.endAt = o, this.P = null;\n    }\n}\n\n/**\n * Initializes a Target with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n *\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\n * using this factory method, because `Query` provides an implicit `orderBy`\n * property.\n */ function ue(t, e = null, n = [], s = [], i = null, r = null, o = null) {\n    return new ae(t, e, n, s, i, r, o);\n}\n\nfunction ce(t) {\n    const e = K(t);\n    if (null === e.P) {\n        let t = e.path.canonicalString();\n        null !== e.collectionGroup && (t += \"|cg:\" + e.collectionGroup), t += \"|f:\", t += e.filters.map((t => {\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\n            var e;\n        })).join(\",\"), t += \"|ob:\", t += e.orderBy.map((t => function(t) {\n            // TODO(b/29183165): Make this collision robust.\n            return t.field.canonicalString() + t.dir;\n        }(t))).join(\",\"), St(e.limit) || (t += \"|l:\", t += e.limit), e.startAt && (t += \"|lb:\", \n        t += e.startAt.inclusive ? \"b:\" : \"a:\", t += e.startAt.position.map((t => Lt(t))).join(\",\")), \n        e.endAt && (t += \"|ub:\", t += e.endAt.inclusive ? \"a:\" : \"b:\", t += e.endAt.position.map((t => Lt(t))).join(\",\")), \n        e.P = t;\n    }\n    return e.P;\n}\n\nfunction he(t) {\n    let e = t.path.canonicalString();\n    return null !== t.collectionGroup && (e += \" collectionGroup=\" + t.collectionGroup), \n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\n        /** Returns a debug description for `filter`. */\n        var e;\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\", \")}]`), \n    St(t.limit) || (e += \", limit: \" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\n        return `${t.field.canonicalString()} (${t.dir})`;\n    }(t))).join(\", \")}]`), t.startAt && (e += \", startAt: \", e += t.startAt.inclusive ? \"b:\" : \"a:\", \n    e += t.startAt.position.map((t => Lt(t))).join(\",\")), t.endAt && (e += \", endAt: \", \n    e += t.endAt.inclusive ? \"a:\" : \"b:\", e += t.endAt.position.map((t => Lt(t))).join(\",\")), \n    `Target(${e})`;\n}\n\nfunction le(t, e) {\n    if (t.limit !== e.limit) return !1;\n    if (t.orderBy.length !== e.orderBy.length) return !1;\n    for (let n = 0; n < t.orderBy.length; n++) if (!be(t.orderBy[n], e.orderBy[n])) return !1;\n    if (t.filters.length !== e.filters.length) return !1;\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\n    var n, s;\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Ve(t.startAt, e.startAt) && Ve(t.endAt, e.endAt)));\n}\n\nfunction fe(t) {\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n}\n\n/** Returns the field filters that target the given field path. */ function de(t, e) {\n    return t.filters.filter((t => t instanceof _e && t.field.isEqual(e)));\n}\n\n/**\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\n * filters. Returns `null` if there are no such filters.\n */ class _e extends class {} {\n    constructor(t, e, n) {\n        super(), this.field = t, this.op = e, this.value = n;\n    }\n    /**\n     * Creates a filter based on the provided arguments.\n     */    static create(t, e, n) {\n        return t.isKeyField() ? \"in\" /* IN */ === e || \"not-in\" /* NOT_IN */ === e ? this.V(t, e, n) : new we(t, e, n) : \"array-contains\" /* ARRAY_CONTAINS */ === e ? new pe(t, n) : \"in\" /* IN */ === e ? new Ie(t, n) : \"not-in\" /* NOT_IN */ === e ? new Te(t, n) : \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === e ? new Ee(t, n) : new _e(t, e, n);\n    }\n    static V(t, e, n) {\n        return \"in\" /* IN */ === e ? new me(t, n) : new ge(t, n);\n    }\n    matches(t) {\n        const e = t.data.field(this.field);\n        // Types do not have to match in NOT_EQUAL filters.\n                return \"!=\" /* NOT_EQUAL */ === this.op ? null !== e && this.v(Ft(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v(Ft(e, this.value));\n        // Only compare types with matching backend order (such as double and int).\n        }\n    v(t) {\n        switch (this.op) {\n          case \"<\" /* LESS_THAN */ :\n            return t < 0;\n\n          case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n            return t <= 0;\n\n          case \"==\" /* EQUAL */ :\n            return 0 === t;\n\n          case \"!=\" /* NOT_EQUAL */ :\n            return 0 !== t;\n\n          case \">\" /* GREATER_THAN */ :\n            return t > 0;\n\n          case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n            return t >= 0;\n\n          default:\n            return L();\n        }\n    }\n    S() {\n        return [ \"<\" /* LESS_THAN */ , \"<=\" /* LESS_THAN_OR_EQUAL */ , \">\" /* GREATER_THAN */ , \">=\" /* GREATER_THAN_OR_EQUAL */ , \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ].indexOf(this.op) >= 0;\n    }\n}\n\nclass we extends _e {\n    constructor(t, e, n) {\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\n    }\n    matches(t) {\n        const e = xt.comparator(t.key, this.key);\n        return this.v(e);\n    }\n}\n\n/** Filter that matches on key fields within an array. */ class me extends _e {\n    constructor(t, e) {\n        super(t, \"in\" /* IN */ , e), this.keys = ye(\"in\" /* IN */ , e);\n    }\n    matches(t) {\n        return this.keys.some((e => e.isEqual(t.key)));\n    }\n}\n\n/** Filter that matches on key fields not present within an array. */ class ge extends _e {\n    constructor(t, e) {\n        super(t, \"not-in\" /* NOT_IN */ , e), this.keys = ye(\"not-in\" /* NOT_IN */ , e);\n    }\n    matches(t) {\n        return !this.keys.some((e => e.isEqual(t.key)));\n    }\n}\n\nfunction ye(t, e) {\n    var n;\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\n}\n\n/** A Filter that implements the array-contains operator. */ class pe extends _e {\n    constructor(t, e) {\n        super(t, \"array-contains\" /* ARRAY_CONTAINS */ , e);\n    }\n    matches(t) {\n        const e = t.data.field(this.field);\n        return Gt(e) && $t(e.arrayValue, this.value);\n    }\n}\n\n/** A Filter that implements the IN operator. */ class Ie extends _e {\n    constructor(t, e) {\n        super(t, \"in\" /* IN */ , e);\n    }\n    matches(t) {\n        const e = t.data.field(this.field);\n        return null !== e && $t(this.value.arrayValue, e);\n    }\n}\n\n/** A Filter that implements the not-in operator. */ class Te extends _e {\n    constructor(t, e) {\n        super(t, \"not-in\" /* NOT_IN */ , e);\n    }\n    matches(t) {\n        if ($t(this.value.arrayValue, {\n            nullValue: \"NULL_VALUE\"\n        })) return !1;\n        const e = t.data.field(this.field);\n        return null !== e && !$t(this.value.arrayValue, e);\n    }\n}\n\n/** A Filter that implements the array-contains-any operator. */ class Ee extends _e {\n    constructor(t, e) {\n        super(t, \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , e);\n    }\n    matches(t) {\n        const e = t.data.field(this.field);\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => $t(this.value.arrayValue, t)));\n    }\n}\n\n/**\n * Represents a bound of a query.\n *\n * The bound is specified with the given components representing a position and\n * whether it's just before or just after the position (relative to whatever the\n * query order is).\n *\n * The position represents a logical index position for a query. It's a prefix\n * of values for the (potentially implicit) order by clauses of a query.\n *\n * Bound provides a function to determine whether a document comes before or\n * after a bound. This is influenced by whether the position is just before or\n * just after the provided values.\n */ class Ae {\n    constructor(t, e) {\n        this.position = t, this.inclusive = e;\n    }\n}\n\n/**\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\n */ class Re {\n    constructor(t, e = \"asc\" /* ASCENDING */) {\n        this.field = t, this.dir = e;\n    }\n}\n\nfunction be(t, e) {\n    return t.dir === e.dir && t.field.isEqual(e.field);\n}\n\nfunction Pe(t, e, n) {\n    let s = 0;\n    for (let i = 0; i < t.position.length; i++) {\n        const r = e[i], o = t.position[i];\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\n            s = Ft(o, n.data.field(r.field));\n        }\n        if (\"desc\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\n    }\n    return s;\n}\n\n/**\n * Returns true if a document sorts after a bound using the provided sort\n * order.\n */ function Ve(t, e) {\n    if (null === t) return null === e;\n    if (null === e) return !1;\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\n    for (let n = 0; n < t.position.length; n++) {\n        if (!Ot(t.position[n], e.position[n])) return !1;\n    }\n    return !0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Query encapsulates all the query attributes we support in the SDK. It can\n * be run against the LocalStore, as well as be converted to a `Target` to\n * query the RemoteStore results.\n *\n * Visible for testing.\n */ class ve {\n    /**\n     * Initializes a Query with a path and optional additional query constraints.\n     * Path must currently be empty if this is a collection group query.\n     */\n    constructor(t, e = null, n = [], s = [], i = null, r = \"F\" /* First */ , o = null, a = null) {\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = a, this.D = null, \n        // The corresponding `Target` of this `Query` instance.\n        this.C = null, this.startAt, this.endAt;\n    }\n}\n\n/** Creates a new Query instance with the options provided. */ function Se(t, e, n, s, i, r, o, a) {\n    return new ve(t, e, n, s, i, r, o, a);\n}\n\n/** Creates a new Query for a query that matches all documents at `path` */ function De(t) {\n    return new ve(t);\n}\n\n/**\n * Helper to convert a collection group query into a collection query at a\n * specific path. This is used when executing collection group queries, since\n * we have to split the query into a set of collection queries at multiple\n * paths.\n */ function Ce(t) {\n    return !St(t.limit) && \"F\" /* First */ === t.limitType;\n}\n\nfunction xe(t) {\n    return !St(t.limit) && \"L\" /* Last */ === t.limitType;\n}\n\nfunction Ne(t) {\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\n}\n\nfunction ke(t) {\n    for (const e of t.filters) if (e.S()) return e.field;\n    return null;\n}\n\n/**\n * Checks if any of the provided Operators are included in the query and\n * returns the first one that is, or null if none are.\n */\n/**\n * Returns whether the query matches a collection group rather than a specific\n * collection.\n */\nfunction Me(t) {\n    return null !== t.collectionGroup;\n}\n\n/**\n * Returns the implicit order by constraint that is used to execute the Query,\n * which can be different from the order by constraints the user provided (e.g.\n * the SDK and backend always orders by `__name__`).\n */ function Oe(t) {\n    const e = K(t);\n    if (null === e.D) {\n        e.D = [];\n        const t = ke(e), n = Ne(e);\n        if (null !== t && null === n) \n        // In order to implicitly add key ordering, we must also add the\n        // inequality filter field for it to be a valid query.\n        // Note that the default inequality field and key ordering is ascending.\n        t.isKeyField() || e.D.push(new Re(t)), e.D.push(new Re(mt.keyField(), \"asc\" /* ASCENDING */)); else {\n            let t = !1;\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\n            if (!t) {\n                // The order of the implicit key ordering always matches the last\n                // explicit order by\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \"asc\" /* ASCENDING */;\n                e.D.push(new Re(mt.keyField(), t));\n            }\n        }\n    }\n    return e.D;\n}\n\n/**\n * Converts this `Query` instance to it's corresponding `Target` representation.\n */ function $e(t) {\n    const e = K(t);\n    if (!e.C) if (\"F\" /* First */ === e.limitType) e.C = ue(e.path, e.collectionGroup, Oe(e), e.filters, e.limit, e.startAt, e.endAt); else {\n        // Flip the orderBy directions since we want the last results\n        const t = [];\n        for (const n of Oe(e)) {\n            const e = \"desc\" /* DESCENDING */ === n.dir ? \"asc\" /* ASCENDING */ : \"desc\" /* DESCENDING */;\n            t.push(new Re(n.field, e));\n        }\n        // We need to swap the cursors to match the now-flipped query ordering.\n                const n = e.endAt ? new Ae(e.endAt.position, !e.endAt.inclusive) : null, s = e.startAt ? new Ae(e.startAt.position, !e.startAt.inclusive) : null;\n        // Now return as a LimitType.First query.\n        e.C = ue(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\n    }\n    return e.C;\n}\n\nfunction Fe(t, e, n) {\n    return new ve(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\n}\n\nfunction Be(t, e) {\n    return le($e(t), $e(e)) && t.limitType === e.limitType;\n}\n\n// TODO(b/29183165): This is used to get a unique string from a query to, for\n// example, use as a dictionary key, but the implementation is subject to\n// collisions. Make it collision-free.\nfunction Le(t) {\n    return `${ce($e(t))}|lt:${t.limitType}`;\n}\n\nfunction qe(t) {\n    return `Query(target=${he($e(t))}; limitType=${t.limitType})`;\n}\n\n/** Returns whether `doc` matches the constraints of `query`. */ function Ue(t, e) {\n    return e.isFoundDocument() && function(t, e) {\n        const n = e.key.path;\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\n    }\n    /**\n * A document must have a value for every ordering clause in order to show up\n * in the results.\n */ (t, e) && function(t, e) {\n        for (const n of t.explicitOrderBy) \n        // order by key always matches\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\n        return !0;\n    }(t, e) && function(t, e) {\n        for (const n of t.filters) if (!n.matches(e)) return !1;\n        return !0;\n    }\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\n        if (t.startAt && !\n        /**\n * Returns true if a document sorts before a bound using the provided sort\n * order.\n */\n        function(t, e, n) {\n            const s = Pe(t, e, n);\n            return t.inclusive ? s <= 0 : s < 0;\n        }(t.startAt, Oe(t), e)) return !1;\n        if (t.endAt && !function(t, e, n) {\n            const s = Pe(t, e, n);\n            return t.inclusive ? s >= 0 : s > 0;\n        }(t.endAt, Oe(t), e)) return !1;\n        return !0;\n    }\n    /**\n * Returns a new comparator function that can be used to compare two documents\n * based on the Query's ordering constraint.\n */ (t, e);\n}\n\nfunction Ke(t) {\n    return (e, n) => {\n        let s = !1;\n        for (const i of Oe(t)) {\n            const t = Ge(i, e, n);\n            if (0 !== t) return t;\n            s = s || i.field.isKeyField();\n        }\n        return 0;\n    };\n}\n\nfunction Ge(t, e, n) {\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\n        const s = e.data.field(t), i = n.data.field(t);\n        return null !== s && null !== i ? Ft(s, i) : L();\n    }\n    /**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n    /**\n * The initial mutation batch id for each index. Gets updated during index\n * backfill.\n */ (t.field, e, n);\n    switch (t.dir) {\n      case \"asc\" /* ASCENDING */ :\n        return s;\n\n      case \"desc\" /* DESCENDING */ :\n        return -1 * s;\n\n      default:\n        return L();\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns an DoubleValue for `value` that is encoded based the serializer's\n * `useProto3Json` setting.\n */ function Qe(t, e) {\n    if (t.N) {\n        if (isNaN(e)) return {\n            doubleValue: \"NaN\"\n        };\n        if (e === 1 / 0) return {\n            doubleValue: \"Infinity\"\n        };\n        if (e === -1 / 0) return {\n            doubleValue: \"-Infinity\"\n        };\n    }\n    return {\n        doubleValue: Dt(e) ? \"-0\" : e\n    };\n}\n\n/**\n * Returns an IntegerValue for `value`.\n */ function je(t) {\n    return {\n        integerValue: \"\" + t\n    };\n}\n\n/**\n * Returns a value for a number that's appropriate to put into a proto.\n * The return value is an IntegerValue if it can safely represent the value,\n * otherwise a DoubleValue is returned.\n */ function We(t, e) {\n    return Ct(e) ? je(e) : Qe(t, e);\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Used to represent a field transform on a mutation. */ class ze {\n    constructor() {\n        // Make sure that the structural type of `TransformOperation` is unique.\n        // See https://github.com/microsoft/TypeScript/issues/5451\n        this._ = void 0;\n    }\n}\n\n/**\n * Computes the local transform result against the provided `previousValue`,\n * optionally using the provided localWriteTime.\n */ function He(t, e, n) {\n    return t instanceof Xe ? function(t, e) {\n        const n = {\n            fields: {\n                __type__: {\n                    stringValue: \"server_timestamp\"\n                },\n                __local_write_time__: {\n                    timestampValue: {\n                        seconds: t.seconds,\n                        nanos: t.nanoseconds\n                    }\n                }\n            }\n        };\n        return e && (n.fields.__previous_value__ = e), {\n            mapValue: n\n        };\n    }(n, e) : t instanceof Ze ? tn(t, e) : t instanceof en ? nn(t, e) : function(t, e) {\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n        // precision and resolves overflows by reducing precision, we do not\n        // manually cap overflows at 2^63.\n        const n = Ye(t, e), s = rn(n) + rn(t.k);\n        return Kt(n) && Kt(t.k) ? je(s) : Qe(t.M, s);\n    }(t, e);\n}\n\n/**\n * Computes a final transform result after the transform has been acknowledged\n * by the server, potentially using the server-provided transformResult.\n */ function Je(t, e, n) {\n    // The server just sends null as the transform result for array operations,\n    // so we have to calculate a result the same as we do for local\n    // applications.\n    return t instanceof Ze ? tn(t, e) : t instanceof en ? nn(t, e) : n;\n}\n\n/**\n * If this transform operation is not idempotent, returns the base value to\n * persist for this transform. If a base value is returned, the transform\n * operation is always applied to this base value, even if document has\n * already been updated.\n *\n * Base values provide consistent behavior for non-idempotent transforms and\n * allow us to return the same latency-compensated value even if the backend\n * has already applied the transform operation. The base value is null for\n * idempotent transforms, as they can be re-played even if the backend has\n * already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent transforms.\n */ function Ye(t, e) {\n    return t instanceof sn ? Kt(n = e) || function(t) {\n        return !!t && \"doubleValue\" in t;\n    }\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\n        integerValue: 0\n    } : null;\n    var n;\n}\n\n/** Transforms a value into a server-generated timestamp. */\nclass Xe extends ze {}\n\n/** Transforms an array value via a union operation. */ class Ze extends ze {\n    constructor(t) {\n        super(), this.elements = t;\n    }\n}\n\nfunction tn(t, e) {\n    const n = on(e);\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\n    return {\n        arrayValue: {\n            values: n\n        }\n    };\n}\n\n/** Transforms an array value via a remove operation. */ class en extends ze {\n    constructor(t) {\n        super(), this.elements = t;\n    }\n}\n\nfunction nn(t, e) {\n    let n = on(e);\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\n    return {\n        arrayValue: {\n            values: n\n        }\n    };\n}\n\n/**\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\n * transforms. Converts all field values to integers or doubles, but unlike the\n * backend does not cap integer values at 2^63. Instead, JavaScript number\n * arithmetic is used and precision loss can occur for values greater than 2^53.\n */ class sn extends ze {\n    constructor(t, e) {\n        super(), this.M = t, this.k = e;\n    }\n}\n\nfunction rn(t) {\n    return Et(t.integerValue || t.doubleValue);\n}\n\nfunction on(t) {\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A field path and the TransformOperation to perform upon it. */ class an {\n    constructor(t, e) {\n        this.field = t, this.transform = e;\n    }\n}\n\nfunction un(t, e) {\n    return t.field.isEqual(e.field) && function(t, e) {\n        return t instanceof Ze && e instanceof Ze || t instanceof en && e instanceof en ? ot(t.elements, e.elements, Ot) : t instanceof sn && e instanceof sn ? Ot(t.k, e.k) : t instanceof Xe && e instanceof Xe;\n    }(t.transform, e.transform);\n}\n\n/** The result of successfully applying a mutation to the backend. */\nclass cn {\n    constructor(\n    /**\n     * The version at which the mutation was committed:\n     *\n     * - For most operations, this is the updateTime in the WriteResult.\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\n     *   not stored and have no updateTime).\n     *\n     * Note that these versions can be different: No-op writes will not change\n     * the updateTime even though the commitTime advances.\n     */\n    t, \n    /**\n     * The resulting fields returned from the backend after a mutation\n     * containing field transforms has been committed. Contains one FieldValue\n     * for each FieldTransform that was in the mutation.\n     *\n     * Will be empty if the mutation did not contain any field transforms.\n     */\n    e) {\n        this.version = t, this.transformResults = e;\n    }\n}\n\n/**\n * Encodes a precondition for a mutation. This follows the model that the\n * backend accepts with the special case of an explicit \"empty\" precondition\n * (meaning no precondition).\n */ class hn {\n    constructor(t, e) {\n        this.updateTime = t, this.exists = e;\n    }\n    /** Creates a new empty Precondition. */    static none() {\n        return new hn;\n    }\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\n        return new hn(void 0, t);\n    }\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\n        return new hn(t);\n    }\n    /** Returns whether this Precondition is empty. */    get isNone() {\n        return void 0 === this.updateTime && void 0 === this.exists;\n    }\n    isEqual(t) {\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\n    }\n}\n\n/** Returns true if the preconditions is valid for the given document. */ function ln(t, e) {\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\n}\n\n/**\n * A mutation describes a self-contained change to a document. Mutations can\n * create, replace, delete, and update subsets of documents.\n *\n * Mutations not only act on the value of the document but also its version.\n *\n * For local mutations (mutations that haven't been committed yet), we preserve\n * the existing version for Set and Patch mutations. For Delete mutations, we\n * reset the version to 0.\n *\n * Here's the expected transition table.\n *\n * MUTATION           APPLIED TO            RESULTS IN\n *\n * SetMutation        Document(v3)          Document(v3)\n * SetMutation        NoDocument(v3)        Document(v0)\n * SetMutation        InvalidDocument(v0)   Document(v0)\n * PatchMutation      Document(v3)          Document(v3)\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\n * DeleteMutation     Document(v3)          NoDocument(v0)\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\n *\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\n * the resulting version for Set and Patch mutations. As deletes have no\n * explicit update time, we use the commitTime of the WriteResponse for\n * Delete mutations.\n *\n * If a mutation is acknowledged by the backend but fails the precondition check\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\n * the updated version.\n *\n * Field transforms are used only with Patch and Set Mutations. We use the\n * `updateTransforms` message to store transforms, rather than the `transforms`s\n * messages.\n *\n * ## Subclassing Notes\n *\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\n * applyToLocalView() to implement the actual behavior of applying the mutation\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\n * example).\n */ class fn {}\n\n/**\n * Applies this mutation to the given document for the purposes of computing a\n * new remote document. If the input document doesn't match the expected state\n * (e.g. it is invalid or outdated), the document type may transition to\n * unknown.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n *     invalid document if the client has no knowledge of the pre-mutation state\n *     of the document.\n * @param mutationResult - The result of applying the mutation from the backend.\n */ function dn(t, e, n) {\n    t instanceof yn ? function(t, e, n) {\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\n        // remote document the server has accepted the mutation so the precondition\n        // must have held.\n        const s = t.value.clone(), i = Tn(t.fieldTransforms, e, n.transformResults);\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\n    }(t, e, n) : t instanceof pn ? function(t, e, n) {\n        if (!ln(t.precondition, e)) \n        // Since the mutation was not rejected, we know that the precondition\n        // matched on the backend. We therefore must not have the expected version\n        // of the document in our cache and convert to an UnknownDocument with a\n        // known updateTime.\n        return void e.convertToUnknownDocument(n.version);\n        const s = Tn(t.fieldTransforms, e, n.transformResults), i = e.data;\n        i.setAll(In(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\n    }(t, e, n) : function(t, e, n) {\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\n        // document the server has accepted the mutation so the precondition must\n        // have held.\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\n    }(0, e, n);\n}\n\n/**\n * Applies this mutation to the given document for the purposes of computing\n * the new local view of a document. If the input document doesn't match the\n * expected state, the document is not modified.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n *     invalid document if the client has no knowledge of the pre-mutation state\n *     of the document.\n * @param localWriteTime - A timestamp indicating the local write time of the\n *     batch this mutation is a part of.\n */ function _n(t, e, n) {\n    t instanceof yn ? function(t, e, n) {\n        if (!ln(t.precondition, e)) \n        // The mutation failed to apply (e.g. a document ID created with add()\n        // caused a name collision).\n        return;\n        const s = t.value.clone(), i = En(t.fieldTransforms, n, e);\n        s.setAll(i), e.convertToFoundDocument(gn(e), s).setHasLocalMutations();\n    }\n    /**\n * A mutation that modifies fields of the document at the given key with the\n * given values. The values are applied through a field mask:\n *\n *  * When a field is in both the mask and the values, the corresponding field\n *    is updated.\n *  * When a field is in neither the mask nor the values, the corresponding\n *    field is unmodified.\n *  * When a field is in the mask but not in the values, the corresponding field\n *    is deleted.\n *  * When a field is not in the mask but is in the values, the values map is\n *    ignored.\n */ (t, e, n) : t instanceof pn ? function(t, e, n) {\n        if (!ln(t.precondition, e)) return;\n        const s = En(t.fieldTransforms, n, e), i = e.data;\n        i.setAll(In(t)), i.setAll(s), e.convertToFoundDocument(gn(e), i).setHasLocalMutations();\n    }\n    /**\n * Returns a FieldPath/Value map with the content of the PatchMutation.\n */ (t, e, n) : function(t, e) {\n        ln(t.precondition, e) && \n        // We don't call `setHasLocalMutations()` since we want to be backwards\n        // compatible with the existing SDK behavior.\n        e.convertToNoDocument(ct.min());\n    }\n    /**\n * A mutation that verifies the existence of the document at the given key with\n * the provided precondition.\n *\n * The `verify` operation is only used in Transactions, and this class serves\n * primarily to facilitate serialization into protos.\n */ (t, e);\n}\n\n/**\n * If this mutation is not idempotent, returns the base value to persist with\n * this mutation. If a base value is returned, the mutation is always applied\n * to this base value, even if document has already been updated.\n *\n * The base value is a sparse object that consists of only the document\n * fields for which this mutation contains a non-idempotent transformation\n * (e.g. a numeric increment). The provided value guarantees consistent\n * behavior for non-idempotent transforms and allow us to return the same\n * latency-compensated value even if the backend has already applied the\n * mutation. The base value is null for idempotent mutations, as they can be\n * re-played even if the backend has already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent mutations.\n */ function wn(t, e) {\n    let n = null;\n    for (const s of t.fieldTransforms) {\n        const t = e.data.field(s.field), i = Ye(s.transform, t || null);\n        null != i && (null == n && (n = Xt.empty()), n.set(s.field, i));\n    }\n    return n || null;\n}\n\nfunction mn(t, e) {\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => un(t, e)));\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\n}\n\n/**\n * Returns the version from the given document for use as the result of a\n * mutation. Mutations are defined to return the version of the base document\n * only if it is an existing document. Deleted and unknown documents have a\n * post-mutation version of SnapshotVersion.min().\n */ function gn(t) {\n    return t.isFoundDocument() ? t.version : ct.min();\n}\n\n/**\n * A mutation that creates or replaces the document at the given key with the\n * object value contents.\n */ class yn extends fn {\n    constructor(t, e, n, s = []) {\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \n        this.type = 0 /* Set */;\n    }\n}\n\nclass pn extends fn {\n    constructor(t, e, n, s, i = []) {\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \n        this.fieldTransforms = i, this.type = 1 /* Patch */;\n    }\n}\n\nfunction In(t) {\n    const e = new Map;\n    return t.fieldMask.fields.forEach((n => {\n        if (!n.isEmpty()) {\n            const s = t.data.field(n);\n            e.set(n, s);\n        }\n    })), e;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use after a mutation\n * containing transforms has been acknowledged by the server.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param mutableDocument - The current state of the document after applying all\n * previous mutations.\n * @param serverTransformResults - The transform results received by the server.\n * @returns The transform results list.\n */ function Tn(t, e, n) {\n    const s = new Map;\n    q(t.length === n.length);\n    for (let i = 0; i < n.length; i++) {\n        const r = t[i], o = r.transform, a = e.data.field(r.field);\n        s.set(r.field, Je(o, a, n[i]));\n    }\n    return s;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use when applying a\n * transform locally.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param localWriteTime - The local time of the mutation (used to\n *     generate ServerTimestampValues).\n * @param mutableDocument - The current state of the document after applying all\n *     previous mutations.\n * @returns The transform results list.\n */ function En(t, e, n) {\n    const s = new Map;\n    for (const i of t) {\n        const t = i.transform, r = n.data.field(i.field);\n        s.set(i.field, He(t, r, e));\n    }\n    return s;\n}\n\n/** A mutation that deletes the document at the given key. */ class An extends fn {\n    constructor(t, e) {\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\n    }\n}\n\nclass Rn extends fn {\n    constructor(t, e) {\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class bn {\n    // TODO(b/33078163): just use simplest form of existence filter for now\n    constructor(t) {\n        this.count = t;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Error Codes describing the different ways GRPC can fail. These are copied\n * directly from GRPC's sources here:\n *\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n *\n * Important! The names of these identifiers matter because the string forms\n * are used for reverse lookups from the webchannel stream. Do NOT change the\n * names of these identifiers or change this into a const enum.\n */ var Pn, Vn;\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a non-write operation.\n *\n * See isPermanentWriteError for classifying write errors.\n */\nfunction vn(t) {\n    switch (t) {\n      default:\n        return L();\n\n      case G.CANCELLED:\n      case G.UNKNOWN:\n      case G.DEADLINE_EXCEEDED:\n      case G.RESOURCE_EXHAUSTED:\n      case G.INTERNAL:\n      case G.UNAVAILABLE:\n // Unauthenticated means something went wrong with our token and we need\n        // to retry with new credentials which will happen automatically.\n              case G.UNAUTHENTICATED:\n        return !1;\n\n      case G.INVALID_ARGUMENT:\n      case G.NOT_FOUND:\n      case G.ALREADY_EXISTS:\n      case G.PERMISSION_DENIED:\n      case G.FAILED_PRECONDITION:\n // Aborted might be retried in some scenarios, but that is dependant on\n        // the context and should handled individually by the calling code.\n        // See https://cloud.google.com/apis/design/errors.\n              case G.ABORTED:\n      case G.OUT_OF_RANGE:\n      case G.UNIMPLEMENTED:\n      case G.DATA_LOSS:\n        return !0;\n    }\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a write operation.\n *\n * Write operations must be handled specially because as of b/119437764, ABORTED\n * errors on the write stream should be retried too (even though ABORTED errors\n * are not generally retryable).\n *\n * Note that during the initial handshake on the write stream an ABORTED error\n * signals that we should discard our stream token (i.e. it is permanent). This\n * means a handshake error should be classified with isPermanentError, above.\n */\n/**\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\n * are not the same as HTTP status codes.\n *\n * @returns The Code equivalent to the given GRPC status code. Fails if there\n *     is no match.\n */\nfunction Sn(t) {\n    if (void 0 === t) \n    // This shouldn't normally happen, but in certain error cases (like trying\n    // to send invalid proto messages) we may get an error with no GRPC code.\n    return $(\"GRPC error has no .code\"), G.UNKNOWN;\n    switch (t) {\n      case Pn.OK:\n        return G.OK;\n\n      case Pn.CANCELLED:\n        return G.CANCELLED;\n\n      case Pn.UNKNOWN:\n        return G.UNKNOWN;\n\n      case Pn.DEADLINE_EXCEEDED:\n        return G.DEADLINE_EXCEEDED;\n\n      case Pn.RESOURCE_EXHAUSTED:\n        return G.RESOURCE_EXHAUSTED;\n\n      case Pn.INTERNAL:\n        return G.INTERNAL;\n\n      case Pn.UNAVAILABLE:\n        return G.UNAVAILABLE;\n\n      case Pn.UNAUTHENTICATED:\n        return G.UNAUTHENTICATED;\n\n      case Pn.INVALID_ARGUMENT:\n        return G.INVALID_ARGUMENT;\n\n      case Pn.NOT_FOUND:\n        return G.NOT_FOUND;\n\n      case Pn.ALREADY_EXISTS:\n        return G.ALREADY_EXISTS;\n\n      case Pn.PERMISSION_DENIED:\n        return G.PERMISSION_DENIED;\n\n      case Pn.FAILED_PRECONDITION:\n        return G.FAILED_PRECONDITION;\n\n      case Pn.ABORTED:\n        return G.ABORTED;\n\n      case Pn.OUT_OF_RANGE:\n        return G.OUT_OF_RANGE;\n\n      case Pn.UNIMPLEMENTED:\n        return G.UNIMPLEMENTED;\n\n      case Pn.DATA_LOSS:\n        return G.DATA_LOSS;\n\n      default:\n        return L();\n    }\n}\n\n/**\n * Converts an HTTP response's error status to the equivalent error code.\n *\n * @param status - An HTTP error response status (\"FAILED_PRECONDITION\",\n * \"UNKNOWN\", etc.)\n * @returns The equivalent Code. Non-matching responses are mapped to\n *     Code.UNKNOWN.\n */ (Vn = Pn || (Pn = {}))[Vn.OK = 0] = \"OK\", Vn[Vn.CANCELLED = 1] = \"CANCELLED\", \nVn[Vn.UNKNOWN = 2] = \"UNKNOWN\", Vn[Vn.INVALID_ARGUMENT = 3] = \"INVALID_ARGUMENT\", \nVn[Vn.DEADLINE_EXCEEDED = 4] = \"DEADLINE_EXCEEDED\", Vn[Vn.NOT_FOUND = 5] = \"NOT_FOUND\", \nVn[Vn.ALREADY_EXISTS = 6] = \"ALREADY_EXISTS\", Vn[Vn.PERMISSION_DENIED = 7] = \"PERMISSION_DENIED\", \nVn[Vn.UNAUTHENTICATED = 16] = \"UNAUTHENTICATED\", Vn[Vn.RESOURCE_EXHAUSTED = 8] = \"RESOURCE_EXHAUSTED\", \nVn[Vn.FAILED_PRECONDITION = 9] = \"FAILED_PRECONDITION\", Vn[Vn.ABORTED = 10] = \"ABORTED\", \nVn[Vn.OUT_OF_RANGE = 11] = \"OUT_OF_RANGE\", Vn[Vn.UNIMPLEMENTED = 12] = \"UNIMPLEMENTED\", \nVn[Vn.INTERNAL = 13] = \"INTERNAL\", Vn[Vn.UNAVAILABLE = 14] = \"UNAVAILABLE\", Vn[Vn.DATA_LOSS = 15] = \"DATA_LOSS\";\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A map implementation that uses objects as keys. Objects must have an\n * associated equals function and must be immutable. Entries in the map are\n * stored together with the key being produced from the mapKeyFn. This map\n * automatically handles collisions of keys.\n */\nclass Dn {\n    constructor(t, e) {\n        this.mapKeyFn = t, this.equalsFn = e, \n        /**\n         * The inner map for a key/value pair. Due to the possibility of collisions we\n         * keep a list of entries that we do a linear search through to find an actual\n         * match. Note that collisions should be rare, so we still expect near\n         * constant time lookups in practice.\n         */\n        this.inner = {}, \n        /** The number of entries stored in the map */\n        this.innerSize = 0;\n    }\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\n        const e = this.mapKeyFn(t), n = this.inner[e];\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\n    }\n    has(t) {\n        return void 0 !== this.get(t);\n    }\n    /** Put this key and value in the map. */    set(t, e) {\n        const n = this.mapKeyFn(t), s = this.inner[n];\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \n        // This is updating an existing entry and does not increase `innerSize`.\n        return void (s[n] = [ t, e ]);\n        s.push([ t, e ]), this.innerSize++;\n    }\n    /**\n     * Remove this key from the map. Returns a boolean if anything was deleted.\n     */    delete(t) {\n        const e = this.mapKeyFn(t), n = this.inner[e];\n        if (void 0 === n) return !1;\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \n        this.innerSize--, !0;\n        return !1;\n    }\n    forEach(t) {\n        lt(this.inner, ((e, n) => {\n            for (const [e, s] of n) t(e, s);\n        }));\n    }\n    isEmpty() {\n        return ft(this.inner);\n    }\n    size() {\n        return this.innerSize;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\n// tree.\nclass Cn {\n    constructor(t, e) {\n        this.comparator = t, this.root = e || Nn.EMPTY;\n    }\n    // Returns a copy of the map, with the specified key/value added or replaced.\n    insert(t, e) {\n        return new Cn(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, Nn.BLACK, null, null));\n    }\n    // Returns a copy of the map, with the specified key removed.\n    remove(t) {\n        return new Cn(this.comparator, this.root.remove(t, this.comparator).copy(null, null, Nn.BLACK, null, null));\n    }\n    // Returns the value of the node with the given key, or null.\n    get(t) {\n        let e = this.root;\n        for (;!e.isEmpty(); ) {\n            const n = this.comparator(t, e.key);\n            if (0 === n) return e.value;\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\n        }\n        return null;\n    }\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\n    // exist.\n    indexOf(t) {\n        // Number of nodes that were pruned when descending right\n        let e = 0, n = this.root;\n        for (;!n.isEmpty(); ) {\n            const s = this.comparator(t, n.key);\n            if (0 === s) return e + n.left.size;\n            s < 0 ? n = n.left : (\n            // Count all nodes left of the node plus the node itself\n            e += n.left.size + 1, n = n.right);\n        }\n        // Node not found\n                return -1;\n    }\n    isEmpty() {\n        return this.root.isEmpty();\n    }\n    // Returns the total number of nodes in the map.\n    get size() {\n        return this.root.size;\n    }\n    // Returns the minimum key in the map.\n    minKey() {\n        return this.root.minKey();\n    }\n    // Returns the maximum key in the map.\n    maxKey() {\n        return this.root.maxKey();\n    }\n    // Traverses the map in key order and calls the specified action function\n    // for each key/value pair. If action returns true, traversal is aborted.\n    // Returns the first truthy value returned by action, or the last falsey\n    // value returned by action.\n    inorderTraversal(t) {\n        return this.root.inorderTraversal(t);\n    }\n    forEach(t) {\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\n    }\n    toString() {\n        const t = [];\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\", \")}}`;\n    }\n    // Traverses the map in reverse key order and calls the specified action\n    // function for each key/value pair. If action returns true, traversal is\n    // aborted.\n    // Returns the first truthy value returned by action, or the last falsey\n    // value returned by action.\n    reverseTraversal(t) {\n        return this.root.reverseTraversal(t);\n    }\n    // Returns an iterator over the SortedMap.\n    getIterator() {\n        return new xn(this.root, null, this.comparator, !1);\n    }\n    getIteratorFrom(t) {\n        return new xn(this.root, t, this.comparator, !1);\n    }\n    getReverseIterator() {\n        return new xn(this.root, null, this.comparator, !0);\n    }\n    getReverseIteratorFrom(t) {\n        return new xn(this.root, t, this.comparator, !0);\n    }\n}\n\n // end SortedMap\n// An iterator over an LLRBNode.\nclass xn {\n    constructor(t, e, n, s) {\n        this.isReverse = s, this.nodeStack = [];\n        let i = 1;\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \n        // flip the comparison if we're going in reverse\n        e && s && (i *= -1), i < 0) \n        // This node is less than our start key. ignore it\n        t = this.isReverse ? t.left : t.right; else {\n            if (0 === i) {\n                // This node is exactly equal to our start key. Push it on the stack,\n                // but stop iterating;\n                this.nodeStack.push(t);\n                break;\n            }\n            // This node is greater than our start key, add it to the stack and move\n            // to the next one\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\n        }\n    }\n    getNext() {\n        let t = this.nodeStack.pop();\n        const e = {\n            key: t.key,\n            value: t.value\n        };\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \n        t = t.left;\n        return e;\n    }\n    hasNext() {\n        return this.nodeStack.length > 0;\n    }\n    peek() {\n        if (0 === this.nodeStack.length) return null;\n        const t = this.nodeStack[this.nodeStack.length - 1];\n        return {\n            key: t.key,\n            value: t.value\n        };\n    }\n}\n\n // end SortedMapIterator\n// Represents a node in a Left-leaning Red-Black tree.\nclass Nn {\n    constructor(t, e, n, s, i) {\n        this.key = t, this.value = e, this.color = null != n ? n : Nn.RED, this.left = null != s ? s : Nn.EMPTY, \n        this.right = null != i ? i : Nn.EMPTY, this.size = this.left.size + 1 + this.right.size;\n    }\n    // Returns a copy of the current node, optionally replacing pieces of it.\n    copy(t, e, n, s, i) {\n        return new Nn(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\n    }\n    isEmpty() {\n        return !1;\n    }\n    // Traverses the tree in key order and calls the specified action function\n    // for each node. If action returns true, traversal is aborted.\n    // Returns the first truthy value returned by action, or the last falsey\n    // value returned by action.\n    inorderTraversal(t) {\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\n    }\n    // Traverses the tree in reverse key order and calls the specified action\n    // function for each node. If action returns true, traversal is aborted.\n    // Returns the first truthy value returned by action, or the last falsey\n    // value returned by action.\n    reverseTraversal(t) {\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\n    }\n    // Returns the minimum node in the tree.\n    min() {\n        return this.left.isEmpty() ? this : this.left.min();\n    }\n    // Returns the maximum key in the tree.\n    minKey() {\n        return this.min().key;\n    }\n    // Returns the maximum key in the tree.\n    maxKey() {\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\n    }\n    // Returns new tree, with the key/value added.\n    insert(t, e, n) {\n        let s = this;\n        const i = n(t, s.key);\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \n        s.fixUp();\n    }\n    removeMin() {\n        if (this.left.isEmpty()) return Nn.EMPTY;\n        let t = this;\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \n        t.fixUp();\n    }\n    // Returns new tree, with the specified item removed.\n    remove(t, e) {\n        let n, s = this;\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \n            0 === e(t, s.key)) {\n                if (s.right.isEmpty()) return Nn.EMPTY;\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\n            }\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\n        }\n        return s.fixUp();\n    }\n    isRed() {\n        return this.color;\n    }\n    // Returns new tree after performing any needed rotations.\n    fixUp() {\n        let t = this;\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\n    }\n    moveRedLeft() {\n        let t = this.colorFlip();\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \n        t = t.rotateLeft(), t = t.colorFlip()), t;\n    }\n    moveRedRight() {\n        let t = this.colorFlip();\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\n    }\n    rotateLeft() {\n        const t = this.copy(null, null, Nn.RED, null, this.right.left);\n        return this.right.copy(null, null, this.color, t, null);\n    }\n    rotateRight() {\n        const t = this.copy(null, null, Nn.RED, this.left.right, null);\n        return this.left.copy(null, null, this.color, null, t);\n    }\n    colorFlip() {\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\n        return this.copy(null, null, !this.color, t, e);\n    }\n    // For testing.\n    checkMaxDepth() {\n        const t = this.check();\n        return Math.pow(2, t) <= this.size + 1;\n    }\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\n    // leaves is equal on both sides.  This function verifies that or asserts.\n    check() {\n        if (this.isRed() && this.left.isRed()) throw L();\n        if (this.right.isRed()) throw L();\n        const t = this.left.check();\n        if (t !== this.right.check()) throw L();\n        return t + (this.isRed() ? 0 : 1);\n    }\n}\n\n // end LLRBNode\n// Empty node is shared between all LLRB trees.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nNn.EMPTY = null, Nn.RED = !0, Nn.BLACK = !1;\n\n// end LLRBEmptyNode\nNn.EMPTY = new \n// Represents an empty node (a leaf node in the Red-Black Tree).\nclass {\n    constructor() {\n        this.size = 0;\n    }\n    get key() {\n        throw L();\n    }\n    get value() {\n        throw L();\n    }\n    get color() {\n        throw L();\n    }\n    get left() {\n        throw L();\n    }\n    get right() {\n        throw L();\n    }\n    // Returns a copy of the current node.\n    copy(t, e, n, s, i) {\n        return this;\n    }\n    // Returns a copy of the tree, with the specified key/value added.\n    insert(t, e, n) {\n        return new Nn(t, e);\n    }\n    // Returns a copy of the tree, with the specified key removed.\n    remove(t, e) {\n        return this;\n    }\n    isEmpty() {\n        return !0;\n    }\n    inorderTraversal(t) {\n        return !1;\n    }\n    reverseTraversal(t) {\n        return !1;\n    }\n    minKey() {\n        return null;\n    }\n    maxKey() {\n        return null;\n    }\n    isRed() {\n        return !1;\n    }\n    // For testing.\n    checkMaxDepth() {\n        return !0;\n    }\n    check() {\n        return 0;\n    }\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * SortedSet is an immutable (copy-on-write) collection that holds elements\n * in order specified by the provided comparator.\n *\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\n * be equal!\n */\nclass kn {\n    constructor(t) {\n        this.comparator = t, this.data = new Cn(this.comparator);\n    }\n    has(t) {\n        return null !== this.data.get(t);\n    }\n    first() {\n        return this.data.minKey();\n    }\n    last() {\n        return this.data.maxKey();\n    }\n    get size() {\n        return this.data.size;\n    }\n    indexOf(t) {\n        return this.data.indexOf(t);\n    }\n    /** Iterates elements in order defined by \"comparator\" */    forEach(t) {\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\n    }\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\n        const n = this.data.getIteratorFrom(t[0]);\n        for (;n.hasNext(); ) {\n            const s = n.getNext();\n            if (this.comparator(s.key, t[1]) >= 0) return;\n            e(s.key);\n        }\n    }\n    /**\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\n     */    forEachWhile(t, e) {\n        let n;\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\n            if (!t(n.getNext().key)) return;\n        }\n    }\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\n        const e = this.data.getIteratorFrom(t);\n        return e.hasNext() ? e.getNext().key : null;\n    }\n    getIterator() {\n        return new Mn(this.data.getIterator());\n    }\n    getIteratorFrom(t) {\n        return new Mn(this.data.getIteratorFrom(t));\n    }\n    /** Inserts or updates an element */    add(t) {\n        return this.copy(this.data.remove(t).insert(t, !0));\n    }\n    /** Deletes an element */    delete(t) {\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\n    }\n    isEmpty() {\n        return this.data.isEmpty();\n    }\n    unionWith(t) {\n        let e = this;\n        // Make sure `result` always refers to the larger one of the two sets.\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\n            e = e.add(t);\n        })), e;\n    }\n    isEqual(t) {\n        if (!(t instanceof kn)) return !1;\n        if (this.size !== t.size) return !1;\n        const e = this.data.getIterator(), n = t.data.getIterator();\n        for (;e.hasNext(); ) {\n            const t = e.getNext().key, s = n.getNext().key;\n            if (0 !== this.comparator(t, s)) return !1;\n        }\n        return !0;\n    }\n    toArray() {\n        const t = [];\n        return this.forEach((e => {\n            t.push(e);\n        })), t;\n    }\n    toString() {\n        const t = [];\n        return this.forEach((e => t.push(e))), \"SortedSet(\" + t.toString() + \")\";\n    }\n    copy(t) {\n        const e = new kn(this.comparator);\n        return e.data = t, e;\n    }\n}\n\nclass Mn {\n    constructor(t) {\n        this.iter = t;\n    }\n    getNext() {\n        return this.iter.getNext().key;\n    }\n    hasNext() {\n        return this.iter.hasNext();\n    }\n}\n\n/**\n * Compares two sorted sets for equality using their natural ordering. The\n * method computes the intersection and invokes `onAdd` for every element that\n * is in `after` but not `before`. `onRemove` is invoked for every element in\n * `before` but missing from `after`.\n *\n * The method creates a copy of both `before` and `after` and runs in O(n log\n * n), where n is the size of the two lists.\n *\n * @param before - The elements that exist in the original set.\n * @param after - The elements to diff against the original set.\n * @param comparator - The comparator for the elements in before and after.\n * @param onAdd - A function to invoke for every element that is part of `\n * after` but not `before`.\n * @param onRemove - A function to invoke for every element that is part of\n * `before` but not `after`.\n */\n/**\n * Returns the next element from the iterator or `undefined` if none available.\n */\nfunction On(t) {\n    return t.hasNext() ? t.getNext() : void 0;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const $n = new Cn(xt.comparator);\n\nfunction Fn() {\n    return $n;\n}\n\nconst Bn = new Cn(xt.comparator);\n\nfunction Ln() {\n    return Bn;\n}\n\nfunction qn() {\n    return new Dn((t => t.toString()), ((t, e) => t.isEqual(e)));\n}\n\nconst Un = new Cn(xt.comparator);\n\nconst Kn = new kn(xt.comparator);\n\nfunction Gn(...t) {\n    let e = Kn;\n    for (const n of t) e = e.add(n);\n    return e;\n}\n\nconst Qn = new kn(rt);\n\nfunction jn() {\n    return Qn;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An event from the RemoteStore. It is split into targetChanges (changes to the\n * state or the set of documents in our watched targets) and documentUpdates\n * (changes to the actual documents).\n */ class Wn {\n    constructor(\n    /**\n     * The snapshot version this event brings us up to, or MIN if not set.\n     */\n    t, \n    /**\n     * A map from target to changes to the target. See TargetChange.\n     */\n    e, \n    /**\n     * A set of targets that is known to be inconsistent. Listens for these\n     * targets should be re-established without resume tokens.\n     */\n    n, \n    /**\n     * A set of which documents have changed or been deleted, along with the\n     * doc's new values (if not deleted).\n     */\n    s, \n    /**\n     * A set of which document updates are due only to limbo resolution targets.\n     */\n    i) {\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \n        this.resolvedLimboDocuments = i;\n    }\n    /**\n     * HACK: Views require RemoteEvents in order to determine whether the view is\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\n     * used to create a synthesized RemoteEvent that can be used to apply a\n     * CURRENT status change to a View, for queries executed in a different tab.\n     */\n    // PORTING NOTE: Multi-tab only\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\n        const n = new Map;\n        return n.set(t, zn.createSynthesizedTargetChangeForCurrentChange(t, e)), new Wn(ct.min(), n, jn(), Fn(), Gn());\n    }\n}\n\n/**\n * A TargetChange specifies the set of changes for a specific target as part of\n * a RemoteEvent. These changes track which documents are added, modified or\n * removed, as well as the target's resume token and whether the target is\n * marked CURRENT.\n * The actual changes *to* documents are not part of the TargetChange since\n * documents may be part of multiple targets.\n */ class zn {\n    constructor(\n    /**\n     * An opaque, server-assigned token that allows watching a query to be resumed\n     * after disconnecting without retransmitting all the data that matches the\n     * query. The resume token essentially identifies a point in time from which\n     * the server should resume sending results.\n     */\n    t, \n    /**\n     * The \"current\" (synced) status of this target. Note that \"current\"\n     * has special meaning in the RPC protocol that implies that a target is\n     * both up-to-date and consistent with the rest of the watch stream.\n     */\n    e, \n    /**\n     * The set of documents that were newly assigned to this target as part of\n     * this remote event.\n     */\n    n, \n    /**\n     * The set of documents that were already assigned to this target but received\n     * an update during this remote event.\n     */\n    s, \n    /**\n     * The set of documents that were removed from this target as part of this\n     * remote event.\n     */\n    i) {\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \n        this.removedDocuments = i;\n    }\n    /**\n     * This method is used to create a synthesized TargetChanges that can be used to\n     * apply a CURRENT status change to a View (for queries executed in a different\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\n        return new zn(pt.EMPTY_BYTE_STRING, e, Gn(), Gn(), Gn());\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a changed document and a list of target ids to which this change\n * applies.\n *\n * If document has been deleted NoDocument will be provided.\n */ class Hn {\n    constructor(\n    /** The new document applies to all of these targets. */\n    t, \n    /** The new document is removed from all of these targets. */\n    e, \n    /** The key of the document for this change. */\n    n, \n    /**\n     * The new document or NoDocument if it was deleted. Is null if the\n     * document went out of view without the server sending a new document.\n     */\n    s) {\n        this.O = t, this.removedTargetIds = e, this.key = n, this.$ = s;\n    }\n}\n\nclass Jn {\n    constructor(t, e) {\n        this.targetId = t, this.F = e;\n    }\n}\n\nclass Yn {\n    constructor(\n    /** What kind of change occurred to the watch target. */\n    t, \n    /** The target IDs that were added/removed/set. */\n    e, \n    /**\n     * An opaque, server-assigned token that allows watching a target to be\n     * resumed after disconnecting without retransmitting all the data that\n     * matches the target. The resume token essentially identifies a point in\n     * time from which the server should resume sending results.\n     */\n    n = pt.EMPTY_BYTE_STRING\n    /** An RPC error indicating why the watch failed. */ , s = null) {\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\n    }\n}\n\n/** Tracks the internal state of a Watch target. */ class Xn {\n    constructor() {\n        /**\n         * The number of pending responses (adds or removes) that we are waiting on.\n         * We only consider targets active that have no pending responses.\n         */\n        this.B = 0, \n        /**\n         * Keeps track of the document changes since the last raised snapshot.\n         *\n         * These changes are continuously updated as we receive document updates and\n         * always reflect the current set of changes against the last issued snapshot.\n         */\n        this.L = es(), \n        /** See public getters for explanations of these fields. */\n        this.q = pt.EMPTY_BYTE_STRING, this.U = !1, \n        /**\n         * Whether this target state should be included in the next snapshot. We\n         * initialize to true so that newly-added targets are included in the next\n         * RemoteEvent.\n         */\n        this.K = !0;\n    }\n    /**\n     * Whether this target has been marked 'current'.\n     *\n     * 'Current' has special meaning in the RPC protocol: It implies that the\n     * Watch backend has sent us all changes up to the point at which the target\n     * was added and that the target is consistent with the rest of the watch\n     * stream.\n     */    get current() {\n        return this.U;\n    }\n    /** The last resume token sent to us for this target. */    get resumeToken() {\n        return this.q;\n    }\n    /** Whether this target has pending target adds or target removes. */    get G() {\n        return 0 !== this.B;\n    }\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\n        return this.K;\n    }\n    /**\n     * Applies the resume token to the TargetChange, but only when it has a new\n     * value. Empty resumeTokens are discarded.\n     */    W(t) {\n        t.approximateByteSize() > 0 && (this.K = !0, this.q = t);\n    }\n    /**\n     * Creates a target change from the current set of changes.\n     *\n     * To reset the document changes after raising this snapshot, call\n     * `clearPendingChanges()`.\n     */    H() {\n        let t = Gn(), e = Gn(), n = Gn();\n        return this.L.forEach(((s, i) => {\n            switch (i) {\n              case 0 /* Added */ :\n                t = t.add(s);\n                break;\n\n              case 2 /* Modified */ :\n                e = e.add(s);\n                break;\n\n              case 1 /* Removed */ :\n                n = n.add(s);\n                break;\n\n              default:\n                L();\n            }\n        })), new zn(this.q, this.U, t, e, n);\n    }\n    /**\n     * Resets the document changes and sets `hasPendingChanges` to false.\n     */    J() {\n        this.K = !1, this.L = es();\n    }\n    Y(t, e) {\n        this.K = !0, this.L = this.L.insert(t, e);\n    }\n    X(t) {\n        this.K = !0, this.L = this.L.remove(t);\n    }\n    Z() {\n        this.B += 1;\n    }\n    tt() {\n        this.B -= 1;\n    }\n    et() {\n        this.K = !0, this.U = !0;\n    }\n}\n\n/**\n * A helper class to accumulate watch changes into a RemoteEvent.\n */\nclass Zn {\n    constructor(t) {\n        this.nt = t, \n        /** The internal state of all tracked targets. */\n        this.st = new Map, \n        /** Keeps track of the documents to update since the last raised snapshot. */\n        this.it = Fn(), \n        /** A mapping of document keys to their set of target IDs. */\n        this.rt = ts(), \n        /**\n         * A list of targets with existence filter mismatches. These targets are\n         * known to be inconsistent and their listens needs to be re-established by\n         * RemoteStore.\n         */\n        this.ot = new kn(rt);\n    }\n    /**\n     * Processes and adds the DocumentWatchChange to the current set of changes.\n     */    at(t) {\n        for (const e of t.O) t.$ && t.$.isFoundDocument() ? this.ut(e, t.$) : this.ct(e, t.key, t.$);\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.$);\n    }\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\n        this.forEachTarget(t, (e => {\n            const n = this.lt(e);\n            switch (t.state) {\n              case 0 /* NoChange */ :\n                this.ft(e) && n.W(t.resumeToken);\n                break;\n\n              case 1 /* Added */ :\n                // We need to decrement the number of pending acks needed from watch\n                // for this targetId.\n                n.tt(), n.G || \n                // We have a freshly added target, so we need to reset any state\n                // that we had previously. This can happen e.g. when remove and add\n                // back a target for existence filter mismatches.\n                n.J(), n.W(t.resumeToken);\n                break;\n\n              case 2 /* Removed */ :\n                // We need to keep track of removed targets to we can post-filter and\n                // remove any target changes.\n                // We need to decrement the number of pending acks needed from watch\n                // for this targetId.\n                n.tt(), n.G || this.removeTarget(e);\n                break;\n\n              case 3 /* Current */ :\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\n                break;\n\n              case 4 /* Reset */ :\n                this.ft(e) && (\n                // Reset the target and synthesizes removes for all existing\n                // documents. The backend will re-add any documents that still\n                // match the target before it sends the next global snapshot.\n                this.dt(e), n.W(t.resumeToken));\n                break;\n\n              default:\n                L();\n            }\n        }));\n    }\n    /**\n     * Iterates over all targetIds that the watch change applies to: either the\n     * targetIds explicitly listed in the change or the targetIds of all currently\n     * active targets.\n     */    forEachTarget(t, e) {\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\n            this.ft(n) && e(n);\n        }));\n    }\n    /**\n     * Handles existence filters and synthesizes deletes for filter mismatches.\n     * Targets that are invalidated by filter mismatches are added to\n     * `pendingTargetResets`.\n     */    _t(t) {\n        const e = t.targetId, n = t.F.count, s = this.wt(e);\n        if (s) {\n            const t = s.target;\n            if (fe(t)) if (0 === n) {\n                // The existence filter told us the document does not exist. We deduce\n                // that this document does not exist and apply a deleted document to\n                // our updates. Without applying this deleted document there might be\n                // another query that will raise this document as part of a snapshot\n                // until it is resolved, essentially exposing inconsistency between\n                // queries.\n                const n = new xt(t.path);\n                this.ct(e, n, te.newNoDocument(n, ct.min()));\n            } else q(1 === n); else {\n                this.gt(e) !== n && (\n                // Existence filter mismatch: We reset the mapping and raise a new\n                // snapshot with `isFromCache:true`.\n                this.dt(e), this.ot = this.ot.add(e));\n            }\n        }\n    }\n    /**\n     * Converts the currently accumulated state into a remote event at the\n     * provided snapshot version. Resets the accumulated changes before returning.\n     */    yt(t) {\n        const e = new Map;\n        this.st.forEach(((n, s) => {\n            const i = this.wt(s);\n            if (i) {\n                if (n.current && fe(i.target)) {\n                    // Document queries for document that don't exist can produce an empty\n                    // result set. To update our local cache, we synthesize a document\n                    // delete if we have not previously received the document. This\n                    // resolves the limbo state of the document, removing it from\n                    // limboDocumentRefs.\n                    // TODO(dimond): Ideally we would have an explicit lookup target\n                    // instead resulting in an explicit delete message and we could\n                    // remove this special logic.\n                    const e = new xt(i.target.path);\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, te.newNoDocument(e, t));\n                }\n                n.j && (e.set(s, n.H()), n.J());\n            }\n        }));\n        let n = Gn();\n        // We extract the set of limbo-only document updates as the GC logic\n        // special-cases documents that do not appear in the target cache.\n        \n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\n        // client.\n                this.rt.forEach(((t, e) => {\n            let s = !0;\n            e.forEachWhile((t => {\n                const e = this.wt(t);\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\n            })), s && (n = n.add(t));\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\n        const s = new Wn(t, e, this.ot, this.it, n);\n        return this.it = Fn(), this.rt = ts(), this.ot = new kn(rt), s;\n    }\n    /**\n     * Adds the provided document to the internal list of document updates and\n     * its document key to the given target's mapping.\n     */\n    // Visible for testing.\n    ut(t, e) {\n        if (!this.ft(t)) return;\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\n    }\n    /**\n     * Removes the provided document from the target mapping. If the\n     * document no longer matches the target, but the document's state is still\n     * known (e.g. we know that the document was deleted or we received the change\n     * that caused the filter mismatch), the new document can be provided\n     * to update the remote document cache.\n     */\n    // Visible for testing.\n    ct(t, e, n) {\n        if (!this.ft(t)) return;\n        const s = this.lt(t);\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \n        // The document may have entered and left the target before we raised a\n        // snapshot, so we can just ignore the change.\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\n    }\n    removeTarget(t) {\n        this.st.delete(t);\n    }\n    /**\n     * Returns the current count of documents in the target. This includes both\n     * the number of documents that the LocalStore considers to be part of the\n     * target as well as any accumulated changes.\n     */    gt(t) {\n        const e = this.lt(t).H();\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\n    }\n    /**\n     * Increment the number of acks needed from watch before we can consider the\n     * server to be 'in-sync' with the client's active targets.\n     */    Z(t) {\n        this.lt(t).Z();\n    }\n    lt(t) {\n        let e = this.st.get(t);\n        return e || (e = new Xn, this.st.set(t, e)), e;\n    }\n    Tt(t) {\n        let e = this.rt.get(t);\n        return e || (e = new kn(rt), this.rt = this.rt.insert(t, e)), e;\n    }\n    /**\n     * Verifies that the user is still interested in this target (by calling\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\n     * from watch.\n     */    ft(t) {\n        const e = null !== this.wt(t);\n        return e || O(\"WatchChangeAggregator\", \"Detected inactive target\", t), e;\n    }\n    /**\n     * Returns the TargetData for an active target (i.e. a target that the user\n     * is still interested in that has no outstanding target change requests).\n     */    wt(t) {\n        const e = this.st.get(t);\n        return e && e.G ? null : this.nt.Et(t);\n    }\n    /**\n     * Resets the state of a Watch target to its initial state (e.g. sets\n     * 'current' to false, clears the resume token and removes its target mapping\n     * from all documents).\n     */    dt(t) {\n        this.st.set(t, new Xn);\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\n            this.ct(t, e, /*updatedDocument=*/ null);\n        }));\n    }\n    /**\n     * Returns whether the LocalStore considers the document to be part of the\n     * specified target.\n     */    It(t, e) {\n        return this.nt.getRemoteKeysForTarget(t).has(e);\n    }\n}\n\nfunction ts() {\n    return new Cn(xt.comparator);\n}\n\nfunction es() {\n    return new Cn(xt.comparator);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const ns = (() => {\n    const t = {\n        asc: \"ASCENDING\",\n        desc: \"DESCENDING\"\n    };\n    return t;\n})(), ss = (() => {\n    const t = {\n        \"<\": \"LESS_THAN\",\n        \"<=\": \"LESS_THAN_OR_EQUAL\",\n        \">\": \"GREATER_THAN\",\n        \">=\": \"GREATER_THAN_OR_EQUAL\",\n        \"==\": \"EQUAL\",\n        \"!=\": \"NOT_EQUAL\",\n        \"array-contains\": \"ARRAY_CONTAINS\",\n        in: \"IN\",\n        \"not-in\": \"NOT_IN\",\n        \"array-contains-any\": \"ARRAY_CONTAINS_ANY\"\n    };\n    return t;\n})();\n\n/**\n * This class generates JsonObject values for the Datastore API suitable for\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\n *\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\n * format.\n *\n * For a description of the Proto3 JSON format check\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n *\n * TODO(klimt): We can remove the databaseId argument if we keep the full\n * resource name in documents.\n */\nclass is {\n    constructor(t, e) {\n        this.databaseId = t, this.N = e;\n    }\n}\n\n/**\n * Returns a value for a Date that's appropriate to put into a proto.\n */\nfunction rs(t, e) {\n    if (t.N) {\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\.\\d*/, \"\").replace(\"Z\", \"\")}.${(\"000000000\" + e.nanoseconds).slice(-9)}Z`;\n    }\n    return {\n        seconds: \"\" + e.seconds,\n        nanos: e.nanoseconds\n    };\n}\n\n/**\n * Returns a value for bytes that's appropriate to put in a proto.\n *\n * Visible for testing.\n */\nfunction os(t, e) {\n    return t.N ? e.toBase64() : e.toUint8Array();\n}\n\n/**\n * Returns a ByteString based on the proto string value.\n */ function as(t, e) {\n    return rs(t, e.toTimestamp());\n}\n\nfunction us(t) {\n    return q(!!t), ct.fromTimestamp(function(t) {\n        const e = Tt(t);\n        return new ut(e.seconds, e.nanos);\n    }(t));\n}\n\nfunction cs(t, e) {\n    return function(t) {\n        return new _t([ \"projects\", t.projectId, \"databases\", t.database ]);\n    }(t).child(\"documents\").child(e).canonicalString();\n}\n\nfunction hs(t) {\n    const e = _t.fromString(t);\n    return q(Os(e)), e;\n}\n\nfunction ls(t, e) {\n    return cs(t.databaseId, e.path);\n}\n\nfunction fs(t, e) {\n    const n = hs(e);\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \"Tried to deserialize key from different project: \" + n.get(1) + \" vs \" + t.databaseId.projectId);\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \"Tried to deserialize key from different database: \" + n.get(3) + \" vs \" + t.databaseId.database);\n    return new xt(ms(n));\n}\n\nfunction ds(t, e) {\n    return cs(t.databaseId, e);\n}\n\nfunction _s(t) {\n    const e = hs(t);\n    // In v1beta1 queries for collections at the root did not have a trailing\n    // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\n    // ability to read the v1beta1 form for compatibility with queries persisted\n    // in the local target cache.\n        return 4 === e.length ? _t.emptyPath() : ms(e);\n}\n\nfunction ws(t) {\n    return new _t([ \"projects\", t.databaseId.projectId, \"databases\", t.databaseId.database ]).canonicalString();\n}\n\nfunction ms(t) {\n    return q(t.length > 4 && \"documents\" === t.get(4)), t.popFirst(5);\n}\n\n/** Creates a Document proto from key and fields (but no create/update time) */ function gs(t, e, n) {\n    return {\n        name: ls(t, e),\n        fields: n.value.mapValue.fields\n    };\n}\n\nfunction ys(t, e, n) {\n    const s = fs(t, e.name), i = us(e.updateTime), r = new Xt({\n        mapValue: {\n            fields: e.fields\n        }\n    }), o = te.newFoundDocument(s, i, r);\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\n}\n\nfunction ps(t, e) {\n    return \"found\" in e ? function(t, e) {\n        q(!!e.found), e.found.name, e.found.updateTime;\n        const n = fs(t, e.found.name), s = us(e.found.updateTime), i = new Xt({\n            mapValue: {\n                fields: e.found.fields\n            }\n        });\n        return te.newFoundDocument(n, s, i);\n    }(t, e) : \"missing\" in e ? function(t, e) {\n        q(!!e.missing), q(!!e.readTime);\n        const n = fs(t, e.missing), s = us(e.readTime);\n        return te.newNoDocument(n, s);\n    }(t, e) : L();\n}\n\nfunction Is(t, e) {\n    let n;\n    if (\"targetChange\" in e) {\n        e.targetChange;\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\n        // if unset\n        const s = function(t) {\n            return \"NO_CHANGE\" === t ? 0 /* NoChange */ : \"ADD\" === t ? 1 /* Added */ : \"REMOVE\" === t ? 2 /* Removed */ : \"CURRENT\" === t ? 3 /* Current */ : \"RESET\" === t ? 4 /* Reset */ : L();\n        }(e.targetChange.targetChangeType || \"NO_CHANGE\"), i = e.targetChange.targetIds || [], r = function(t, e) {\n            return t.N ? (q(void 0 === e || \"string\" == typeof e), pt.fromBase64String(e || \"\")) : (q(void 0 === e || e instanceof Uint8Array), \n            pt.fromUint8Array(e || new Uint8Array));\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, a = o && function(t) {\n            const e = void 0 === t.code ? G.UNKNOWN : Sn(t.code);\n            return new Q(e, t.message || \"\");\n        }\n        /**\n * Returns a value for a number (or null) that's appropriate to put into\n * a google.protobuf.Int32Value proto.\n * DO NOT USE THIS FOR ANYTHING ELSE.\n * This method cheats. It's typed as returning \"number\" because that's what\n * our generated proto interfaces say Int32Value must be. But GRPC actually\n * expects a { value: <number> } struct.\n */ (o);\n        n = new Yn(s, i, r, a || null);\n    } else if (\"documentChange\" in e) {\n        e.documentChange;\n        const s = e.documentChange;\n        s.document, s.document.name, s.document.updateTime;\n        const i = fs(t, s.document.name), r = us(s.document.updateTime), o = new Xt({\n            mapValue: {\n                fields: s.document.fields\n            }\n        }), a = te.newFoundDocument(i, r, o), u = s.targetIds || [], c = s.removedTargetIds || [];\n        n = new Hn(u, c, a.key, a);\n    } else if (\"documentDelete\" in e) {\n        e.documentDelete;\n        const s = e.documentDelete;\n        s.document;\n        const i = fs(t, s.document), r = s.readTime ? us(s.readTime) : ct.min(), o = te.newNoDocument(i, r), a = s.removedTargetIds || [];\n        n = new Hn([], a, o.key, o);\n    } else if (\"documentRemove\" in e) {\n        e.documentRemove;\n        const s = e.documentRemove;\n        s.document;\n        const i = fs(t, s.document), r = s.removedTargetIds || [];\n        n = new Hn([], r, i, null);\n    } else {\n        if (!(\"filter\" in e)) return L();\n        {\n            e.filter;\n            const t = e.filter;\n            t.targetId;\n            const s = t.count || 0, i = new bn(s), r = t.targetId;\n            n = new Jn(r, i);\n        }\n    }\n    return n;\n}\n\nfunction Ts(t, e) {\n    let n;\n    if (e instanceof yn) n = {\n        update: gs(t, e.key, e.value)\n    }; else if (e instanceof An) n = {\n        delete: ls(t, e.key)\n    }; else if (e instanceof pn) n = {\n        update: gs(t, e.key, e.data),\n        updateMask: Ms(e.fieldMask)\n    }; else {\n        if (!(e instanceof Rn)) return L();\n        n = {\n            verify: ls(t, e.key)\n        };\n    }\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\n        const n = e.transform;\n        if (n instanceof Xe) return {\n            fieldPath: e.field.canonicalString(),\n            setToServerValue: \"REQUEST_TIME\"\n        };\n        if (n instanceof Ze) return {\n            fieldPath: e.field.canonicalString(),\n            appendMissingElements: {\n                values: n.elements\n            }\n        };\n        if (n instanceof en) return {\n            fieldPath: e.field.canonicalString(),\n            removeAllFromArray: {\n                values: n.elements\n            }\n        };\n        if (n instanceof sn) return {\n            fieldPath: e.field.canonicalString(),\n            increment: n.k\n        };\n        throw L();\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\n        return void 0 !== e.updateTime ? {\n            updateTime: as(t, e.updateTime)\n        } : void 0 !== e.exists ? {\n            exists: e.exists\n        } : L();\n    }(t, e.precondition)), n;\n}\n\nfunction Es(t, e) {\n    const n = e.currentDocument ? function(t) {\n        return void 0 !== t.updateTime ? hn.updateTime(us(t.updateTime)) : void 0 !== t.exists ? hn.exists(t.exists) : hn.none();\n    }(e.currentDocument) : hn.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\n        let n = null;\n        if (\"setToServerValue\" in e) q(\"REQUEST_TIME\" === e.setToServerValue), n = new Xe; else if (\"appendMissingElements\" in e) {\n            const t = e.appendMissingElements.values || [];\n            n = new Ze(t);\n        } else if (\"removeAllFromArray\" in e) {\n            const t = e.removeAllFromArray.values || [];\n            n = new en(t);\n        } else \"increment\" in e ? n = new sn(t, e.increment) : L();\n        const s = mt.fromServerFormat(e.fieldPath);\n        return new an(s, n);\n    }(t, e))) : [];\n    if (e.update) {\n        e.update.name;\n        const i = fs(t, e.update.name), r = new Xt({\n            mapValue: {\n                fields: e.update.fields\n            }\n        });\n        if (e.updateMask) {\n            const t = function(t) {\n                const e = t.fieldPaths || [];\n                return new gt(e.map((t => mt.fromServerFormat(t))));\n            }(e.updateMask);\n            return new pn(i, r, t, n, s);\n        }\n        return new yn(i, r, n, s);\n    }\n    if (e.delete) {\n        const s = fs(t, e.delete);\n        return new An(s, n);\n    }\n    if (e.verify) {\n        const s = fs(t, e.verify);\n        return new Rn(s, n);\n    }\n    return L();\n}\n\nfunction As(t, e) {\n    return t && t.length > 0 ? (q(void 0 !== e), t.map((t => function(t, e) {\n        // NOTE: Deletes don't have an updateTime.\n        let n = t.updateTime ? us(t.updateTime) : us(e);\n        return n.isEqual(ct.min()) && (\n        // The Firestore Emulator currently returns an update time of 0 for\n        // deletes of non-existing documents (rather than null). This breaks the\n        // test \"get deleted doc while offline with source=cache\" as NoDocuments\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\n        // TODO(#2149): Remove this when Emulator is fixed\n        n = us(e)), new cn(n, t.transformResults || []);\n    }(t, e)))) : [];\n}\n\nfunction Rs(t, e) {\n    return {\n        documents: [ ds(t, e.path) ]\n    };\n}\n\nfunction bs(t, e) {\n    // Dissect the path into parent, collectionId, and optional key filter.\n    const n = {\n        structuredQuery: {}\n    }, s = e.path;\n    null !== e.collectionGroup ? (n.parent = ds(t, s), n.structuredQuery.from = [ {\n        collectionId: e.collectionGroup,\n        allDescendants: !0\n    } ]) : (n.parent = ds(t, s.popLast()), n.structuredQuery.from = [ {\n        collectionId: s.lastSegment()\n    } ]);\n    const i = function(t) {\n        if (0 === t.length) return;\n        const e = t.map((t => \n        // visible for testing\n        function(t) {\n            if (\"==\" /* EQUAL */ === t.op) {\n                if (jt(t.value)) return {\n                    unaryFilter: {\n                        field: Cs(t.field),\n                        op: \"IS_NAN\"\n                    }\n                };\n                if (Qt(t.value)) return {\n                    unaryFilter: {\n                        field: Cs(t.field),\n                        op: \"IS_NULL\"\n                    }\n                };\n            } else if (\"!=\" /* NOT_EQUAL */ === t.op) {\n                if (jt(t.value)) return {\n                    unaryFilter: {\n                        field: Cs(t.field),\n                        op: \"IS_NOT_NAN\"\n                    }\n                };\n                if (Qt(t.value)) return {\n                    unaryFilter: {\n                        field: Cs(t.field),\n                        op: \"IS_NOT_NULL\"\n                    }\n                };\n            }\n            return {\n                fieldFilter: {\n                    field: Cs(t.field),\n                    op: Ds(t.op),\n                    value: t.value\n                }\n            };\n        }(t)));\n        if (1 === e.length) return e[0];\n        return {\n            compositeFilter: {\n                op: \"AND\",\n                filters: e\n            }\n        };\n    }(e.filters);\n    i && (n.structuredQuery.where = i);\n    const r = function(t) {\n        if (0 === t.length) return;\n        return t.map((t => \n        // visible for testing\n        function(t) {\n            return {\n                field: Cs(t.field),\n                direction: Ss(t.dir)\n            };\n        }(t)));\n    }(e.orderBy);\n    r && (n.structuredQuery.orderBy = r);\n    const o = function(t, e) {\n        return t.N || St(e) ? e : {\n            value: e\n        };\n    }\n    /**\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\n */ (t, e.limit);\n    var a;\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\n        before: (a = e.startAt).inclusive,\n        values: a.position\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\n        return {\n            before: !t.inclusive,\n            values: t.position\n        };\n    }(e.endAt)), n;\n}\n\nfunction Ps(t) {\n    let e = _s(t.parent);\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\n    let i = null;\n    if (s > 0) {\n        q(1 === s);\n        const t = n.from[0];\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\n    }\n    let r = [];\n    n.where && (r = vs(n.where));\n    let o = [];\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\n        return new Re(xs(t.field), \n        // visible for testing\n        function(t) {\n            switch (t) {\n              case \"ASCENDING\":\n                return \"asc\" /* ASCENDING */;\n\n              case \"DESCENDING\":\n                return \"desc\" /* DESCENDING */;\n\n              default:\n                return;\n            }\n        }\n        // visible for testing\n        (t.direction));\n    }(t))));\n    let a = null;\n    n.limit && (a = function(t) {\n        let e;\n        return e = \"object\" == typeof t ? t.value : t, St(e) ? null : e;\n    }(n.limit));\n    let u = null;\n    n.startAt && (u = function(t) {\n        const e = !!t.before, n = t.values || [];\n        return new Ae(n, e);\n    }(n.startAt));\n    let c = null;\n    return n.endAt && (c = function(t) {\n        const e = !t.before, n = t.values || [];\n        return new Ae(n, e);\n    }\n    // visible for testing\n    (n.endAt)), Se(e, i, o, r, a, \"F\" /* First */ , u, c);\n}\n\nfunction Vs(t, e) {\n    const n = function(t, e) {\n        switch (e) {\n          case 0 /* Listen */ :\n            return null;\n\n          case 1 /* ExistenceFilterMismatch */ :\n            return \"existence-filter-mismatch\";\n\n          case 2 /* LimboResolution */ :\n            return \"limbo-document\";\n\n          default:\n            return L();\n        }\n    }(0, e.purpose);\n    return null == n ? null : {\n        \"goog-listen-tags\": n\n    };\n}\n\nfunction vs(t) {\n    return t ? void 0 !== t.unaryFilter ? [ ks(t) ] : void 0 !== t.fieldFilter ? [ Ns(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => vs(t))).reduce(((t, e) => t.concat(e))) : L() : [];\n}\n\nfunction Ss(t) {\n    return ns[t];\n}\n\nfunction Ds(t) {\n    return ss[t];\n}\n\nfunction Cs(t) {\n    return {\n        fieldPath: t.canonicalString()\n    };\n}\n\nfunction xs(t) {\n    return mt.fromServerFormat(t.fieldPath);\n}\n\nfunction Ns(t) {\n    return _e.create(xs(t.fieldFilter.field), function(t) {\n        switch (t) {\n          case \"EQUAL\":\n            return \"==\" /* EQUAL */;\n\n          case \"NOT_EQUAL\":\n            return \"!=\" /* NOT_EQUAL */;\n\n          case \"GREATER_THAN\":\n            return \">\" /* GREATER_THAN */;\n\n          case \"GREATER_THAN_OR_EQUAL\":\n            return \">=\" /* GREATER_THAN_OR_EQUAL */;\n\n          case \"LESS_THAN\":\n            return \"<\" /* LESS_THAN */;\n\n          case \"LESS_THAN_OR_EQUAL\":\n            return \"<=\" /* LESS_THAN_OR_EQUAL */;\n\n          case \"ARRAY_CONTAINS\":\n            return \"array-contains\" /* ARRAY_CONTAINS */;\n\n          case \"IN\":\n            return \"in\" /* IN */;\n\n          case \"NOT_IN\":\n            return \"not-in\" /* NOT_IN */;\n\n          case \"ARRAY_CONTAINS_ANY\":\n            return \"array-contains-any\" /* ARRAY_CONTAINS_ANY */;\n\n          default:\n            return L();\n        }\n    }(t.fieldFilter.op), t.fieldFilter.value);\n}\n\nfunction ks(t) {\n    switch (t.unaryFilter.op) {\n      case \"IS_NAN\":\n        const e = xs(t.unaryFilter.field);\n        return _e.create(e, \"==\" /* EQUAL */ , {\n            doubleValue: NaN\n        });\n\n      case \"IS_NULL\":\n        const n = xs(t.unaryFilter.field);\n        return _e.create(n, \"==\" /* EQUAL */ , {\n            nullValue: \"NULL_VALUE\"\n        });\n\n      case \"IS_NOT_NAN\":\n        const s = xs(t.unaryFilter.field);\n        return _e.create(s, \"!=\" /* NOT_EQUAL */ , {\n            doubleValue: NaN\n        });\n\n      case \"IS_NOT_NULL\":\n        const i = xs(t.unaryFilter.field);\n        return _e.create(i, \"!=\" /* NOT_EQUAL */ , {\n            nullValue: \"NULL_VALUE\"\n        });\n\n      default:\n        return L();\n    }\n}\n\nfunction Ms(t) {\n    const e = [];\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\n        fieldPaths: e\n    };\n}\n\nfunction Os(t) {\n    // Resource names have at least 4 components (project ID, database ID)\n    return t.length >= 4 && \"projects\" === t.get(0) && \"databases\" === t.get(2);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Encodes a resource path into a IndexedDb-compatible string form.\n */\nfunction $s(t) {\n    let e = \"\";\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = Bs(e)), e = Fs(t.get(n), e);\n    return Bs(e);\n}\n\n/** Encodes a single segment of a resource path into the given result */ function Fs(t, e) {\n    let n = e;\n    const s = t.length;\n    for (let e = 0; e < s; e++) {\n        const s = t.charAt(e);\n        switch (s) {\n          case \"\\0\":\n            n += \"\u0001\u0010\";\n            break;\n\n          case \"\u0001\":\n            n += \"\u0001\u0011\";\n            break;\n\n          default:\n            n += s;\n        }\n    }\n    return n;\n}\n\n/** Encodes a path separator into the given result */ function Bs(t) {\n    return t + \"\u0001\u0001\";\n}\n\n/**\n * Decodes the given IndexedDb-compatible string form of a resource path into\n * a ResourcePath instance. Note that this method is not suitable for use with\n * decoding resource names from the server; those are One Platform format\n * strings.\n */ function Ls(t) {\n    // Event the empty path must encode as a path of at least length 2. A path\n    // with exactly 2 must be the empty path.\n    const e = t.length;\n    if (q(e >= 2), 2 === e) return q(\"\u0001\" === t.charAt(0) && \"\u0001\" === t.charAt(1)), _t.emptyPath();\n    // Escape characters cannot exist past the second-to-last position in the\n    // source value.\n        const n = e - 2, s = [];\n    let i = \"\";\n    for (let r = 0; r < e; ) {\n        // The last two characters of a valid encoded path must be a separator, so\n        // there must be an end to this segment.\n        const e = t.indexOf(\"\u0001\", r);\n        (e < 0 || e > n) && L();\n        switch (t.charAt(e + 1)) {\n          case \"\u0001\":\n            const n = t.substring(r, e);\n            let o;\n            0 === i.length ? \n            // Avoid copying for the common case of a segment that excludes \\0\n            // and \\001\n            o = n : (i += n, o = i, i = \"\"), s.push(o);\n            break;\n\n          case \"\u0010\":\n            i += t.substring(r, e), i += \"\\0\";\n            break;\n\n          case \"\u0011\":\n            // The escape character can be used in the output to encode itself.\n            i += t.substring(r, e + 1);\n            break;\n\n          default:\n            L();\n        }\n        r = e + 2;\n    }\n    return new _t(s);\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Name of the IndexedDb object store.\n *\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\n * older clients that only supported single locked access to the persistence\n * layer.\n */ const qs = [ \"userId\", \"batchId\" ];\n\n/**\n * The key string used for the single object that exists in the\n * DbPrimaryClient store.\n */\n/**\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\n * index to iterate over all at document mutations for a given path or lower.\n */\nfunction Us(t, e) {\n    return [ t, $s(e) ];\n}\n\n/**\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\n * and deleting into the DbDocumentMutations index.\n */ function Ks(t, e, n) {\n    return [ t, $s(e), n ];\n}\n\n/**\n * Because we store all the useful information for this store in the key,\n * there is no useful information to store as the value. The raw (unencoded)\n * path cannot be stored because IndexedDb doesn't store prototype\n * information.\n */ const Gs = {}, Qs = [ \"parentPath\", \"readTime\" ], js = [ \"canonicalId\", \"targetId\" ], Ws = [ \"targetId\", \"path\" ], zs = [ \"path\", \"targetId\" ], Hs = [ \"collectionId\", \"parent\" ], Js = [ \"indexId\", \"uid\" ], Ys = [ \"uid\", \"sequenceNumber\" ], Xs = [ \"indexId\", \"uid\", \"arrayValue\", \"directionalValue\", \"documentKey\" ], Zs = [ \"indexId\", \"uid\", \"documentKey\" ], ti = [ \"userId\", \"collectionPath\", \"documentId\" ], ei = [ \"userId\", \"collectionPath\", \"largestBatchId\" ], ni = [ \"userId\", \"collectionGroup\", \"largestBatchId\" ], si = [ ...[ ...[ ...[ ...[ \"mutationQueues\", \"mutations\", \"documentMutations\", \"remoteDocuments\", \"targets\", \"owner\", \"targetGlobal\", \"targetDocuments\" ], \"clientMetadata\" ], \"remoteDocumentGlobal\" ], \"collectionParents\" ], \"bundles\", \"namedQueries\" ], ii = [ ...si, \"documentOverlays\" ], ri = [ ...ii, \"indexConfiguration\", \"indexState\", \"indexEntries\" ];\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst oi = \"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\";\n\n/**\n * A base class representing a persistence transaction, encapsulating both the\n * transaction's sequence numbers as well as a list of onCommitted listeners.\n *\n * When you call Persistence.runTransaction(), it will create a transaction and\n * pass it to your callback. You then pass it to any method that operates\n * on persistence.\n */ class ai {\n    constructor() {\n        this.onCommittedListeners = [];\n    }\n    addOnCommittedListener(t) {\n        this.onCommittedListeners.push(t);\n    }\n    raiseOnCommittedEvent() {\n        this.onCommittedListeners.forEach((t => t()));\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * PersistencePromise is essentially a re-implementation of Promise except\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\n * are executed synchronously when a PersistencePromise resolves rather than\n * asynchronously (Promise implementations use setImmediate() or similar).\n *\n * This is necessary to interoperate with IndexedDB which will automatically\n * commit transactions if control is returned to the event loop without\n * synchronously initiating another operation on the transaction.\n *\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\n * Promises.\n */ class ui {\n    constructor(t) {\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\n        // not the user's raw next() or catch() callbacks.\n        this.nextCallback = null, this.catchCallback = null, \n        // When the operation resolves, we'll set result or error and mark isDone.\n        this.result = void 0, this.error = void 0, this.isDone = !1, \n        // Set to true when .then() or .catch() are called and prevents additional\n        // chaining.\n        this.callbackAttached = !1, t((t => {\n            this.isDone = !0, this.result = t, this.nextCallback && \n            // value should be defined unless T is Void, but we can't express\n            // that in the type system.\n            this.nextCallback(t);\n        }), (t => {\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\n        }));\n    }\n    catch(t) {\n        return this.next(void 0, t);\n    }\n    next(t, e) {\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new ui(((n, s) => {\n            this.nextCallback = e => {\n                this.wrapSuccess(t, e).next(n, s);\n            }, this.catchCallback = t => {\n                this.wrapFailure(e, t).next(n, s);\n            };\n        }));\n    }\n    toPromise() {\n        return new Promise(((t, e) => {\n            this.next(t, e);\n        }));\n    }\n    wrapUserFunction(t) {\n        try {\n            const e = t();\n            return e instanceof ui ? e : ui.resolve(e);\n        } catch (t) {\n            return ui.reject(t);\n        }\n    }\n    wrapSuccess(t, e) {\n        return t ? this.wrapUserFunction((() => t(e))) : ui.resolve(e);\n    }\n    wrapFailure(t, e) {\n        return t ? this.wrapUserFunction((() => t(e))) : ui.reject(e);\n    }\n    static resolve(t) {\n        return new ui(((e, n) => {\n            e(t);\n        }));\n    }\n    static reject(t) {\n        return new ui(((e, n) => {\n            n(t);\n        }));\n    }\n    static waitFor(\n    // Accept all Promise types in waitFor().\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    t) {\n        return new ui(((e, n) => {\n            let s = 0, i = 0, r = !1;\n            t.forEach((t => {\n                ++s, t.next((() => {\n                    ++i, r && i === s && e();\n                }), (t => n(t)));\n            })), r = !0, i === s && e();\n        }));\n    }\n    /**\n     * Given an array of predicate functions that asynchronously evaluate to a\n     * boolean, implements a short-circuiting `or` between the results. Predicates\n     * will be evaluated until one of them returns `true`, then stop. The final\n     * result will be whether any of them returned `true`.\n     */    static or(t) {\n        let e = ui.resolve(!1);\n        for (const n of t) e = e.next((t => t ? ui.resolve(t) : n()));\n        return e;\n    }\n    static forEach(t, e) {\n        const n = [];\n        return t.forEach(((t, s) => {\n            n.push(e.call(this, t, s));\n        })), this.waitFor(n);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// References to `window` are guarded by SimpleDb.isAvailable()\n/* eslint-disable no-restricted-globals */\n/**\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\n * specific object store.\n */\nclass ci {\n    constructor(t, e) {\n        this.action = t, this.transaction = e, this.aborted = !1, \n        /**\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\n         */\n        this.At = new j, this.transaction.oncomplete = () => {\n            this.At.resolve();\n        }, this.transaction.onabort = () => {\n            e.error ? this.At.reject(new fi(t, e.error)) : this.At.resolve();\n        }, this.transaction.onerror = e => {\n            const n = gi(e.target.error);\n            this.At.reject(new fi(t, n));\n        };\n    }\n    static open(t, e, n, s) {\n        try {\n            return new ci(e, t.transaction(s, n));\n        } catch (t) {\n            throw new fi(e, t);\n        }\n    }\n    get Rt() {\n        return this.At.promise;\n    }\n    abort(t) {\n        t && this.At.reject(t), this.aborted || (O(\"SimpleDb\", \"Aborting transaction:\", t ? t.message : \"Client-initiated abort\"), \n        this.aborted = !0, this.transaction.abort());\n    }\n    bt() {\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\n        // speed up index DB processing if the event loop remains blocks.\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const t = this.transaction;\n        this.aborted || \"function\" != typeof t.commit || t.commit();\n    }\n    /**\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\n     * operations performed on the SimpleDbStore happen within the context of this\n     * transaction and it cannot be used anymore once the transaction is\n     * completed.\n     *\n     * Note that we can't actually enforce that the KeyType and ValueType are\n     * correct, but they allow type safety through the rest of the consuming code.\n     */    store(t) {\n        const e = this.transaction.objectStore(t);\n        return new _i(e);\n    }\n}\n\n/**\n * Provides a wrapper around IndexedDb with a simplified interface that uses\n * Promise-like return values to chain operations. Real promises cannot be used\n * since .then() continuations are executed asynchronously (e.g. via\n * .setImmediate), which would cause IndexedDB to end the transaction.\n * See PersistencePromise for more details.\n */ class hi {\n    /*\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\n     *\n     * Note that `version` must not be a downgrade. IndexedDB does not support\n     * downgrading the schema version. We currently do not support any way to do\n     * versioning outside of IndexedDB's versioning mechanism, as only\n     * version-upgrade transactions are allowed to do things like create\n     * objectstores.\n     */\n    constructor(t, e, n) {\n        this.name = t, this.version = e, this.Pt = n;\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\n        // log on 12.2.\n        12.2 === hi.Vt(c()) && $(\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\");\n    }\n    /** Deletes the specified database. */    static delete(t) {\n        return O(\"SimpleDb\", \"Removing database:\", t), wi(window.indexedDB.deleteDatabase(t)).toPromise();\n    }\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\n        if (!h()) return !1;\n        if (hi.St()) return !0;\n        // We extensively use indexed array values and compound keys,\n        // which IE and Edge do not support. However, they still have indexedDB\n        // defined on the window, so we need to check for them here and make sure\n        // to return that persistence is not enabled for those browsers.\n        // For tracking support of this feature, see here:\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\n        // Check the UA string to find out the browser.\n                const t = c(), e = hi.Vt(t), n = 0 < e && e < 10, s = hi.Dt(t), i = 0 < s && s < 4.5;\n        // IE 10\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n        // IE 11\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n        // Edge\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n        // iOS Safari: Disable for users running iOS version < 10.\n                return !(t.indexOf(\"MSIE \") > 0 || t.indexOf(\"Trident/\") > 0 || t.indexOf(\"Edge/\") > 0 || n || i);\n    }\n    /**\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\n     * (see https://github.com/axemclion/IndexedDBShim).\n     */    static St() {\n        var t;\n        return \"undefined\" != typeof process && \"YES\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\n    }\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\n        return t.store(e);\n    }\n    // visible for testing\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\n    static Vt(t) {\n        const e = t.match(/i(?:phone|pad|pod) os ([\\d_]+)/i), n = e ? e[1].split(\"_\").slice(0, 2).join(\".\") : \"-1\";\n        return Number(n);\n    }\n    // visible for testing\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\n    static Dt(t) {\n        const e = t.match(/Android ([\\d.]+)/i), n = e ? e[1].split(\".\").slice(0, 2).join(\".\") : \"-1\";\n        return Number(n);\n    }\n    /**\n     * Opens the specified database, creating or upgrading it if necessary.\n     */    async Nt(t) {\n        return this.db || (O(\"SimpleDb\", \"Opening database:\", this.name), this.db = await new Promise(((e, n) => {\n            // TODO(mikelehen): Investigate browser compatibility.\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n            // suggests IE9 and older WebKit browsers handle upgrade\n            // differently. They expect setVersion, as described here:\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n            const s = indexedDB.open(this.name, this.version);\n            s.onsuccess = t => {\n                const n = t.target.result;\n                e(n);\n            }, s.onblocked = () => {\n                n(new fi(t, \"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\"));\n            }, s.onerror = e => {\n                const s = e.target.error;\n                \"VersionError\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\")) : \"InvalidStateError\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \" + s)) : n(new fi(t, s));\n            }, s.onupgradeneeded = t => {\n                O(\"SimpleDb\", 'Database \"' + this.name + '\" requires upgrade from version:', t.oldVersion);\n                const e = t.target.result;\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\n                    O(\"SimpleDb\", \"Database upgrade to version \" + this.version + \" complete\");\n                }));\n            };\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\n    }\n    Ot(t) {\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\n    }\n    async runTransaction(t, e, n, s) {\n        const i = \"readonly\" === e;\n        let r = 0;\n        for (;;) {\n            ++r;\n            try {\n                this.db = await this.Nt(t);\n                const e = ci.open(this.db, t, i ? \"readonly\" : \"readwrite\", n), r = s(e).next((t => (e.bt(), \n                t))).catch((t => (\n                // Abort the transaction if there was an error.\n                e.abort(t), ui.reject(t)))).toPromise();\n                // As noted above, errors are propagated by aborting the transaction. So\n                // we swallow any error here to avoid the browser logging it as unhandled.\n                return r.catch((() => {})), \n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n                // fire), but still return the original transactionFnResult back to the\n                // caller.\n                await e.Rt, r;\n            } catch (t) {\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\n                // not retry exceptions that are likely unrecoverable (such as quota\n                // exceeded errors).\n                // Note: We cannot use an instanceof check for FirestoreException, since the\n                // exception is wrapped in a generic error by our async/await handling.\n                const e = \"FirebaseError\" !== t.name && r < 3;\n                if (O(\"SimpleDb\", \"Transaction failed with error:\", t.message, \"Retrying:\", e), \n                this.close(), !e) return Promise.reject(t);\n            }\n        }\n    }\n    close() {\n        this.db && this.db.close(), this.db = void 0;\n    }\n}\n\n/**\n * A controller for iterating over a key range or index. It allows an iterate\n * callback to delete the currently-referenced object, or jump to a new key\n * within the key range or index.\n */ class li {\n    constructor(t) {\n        this.$t = t, this.Ft = !1, this.Bt = null;\n    }\n    get isDone() {\n        return this.Ft;\n    }\n    get Lt() {\n        return this.Bt;\n    }\n    set cursor(t) {\n        this.$t = t;\n    }\n    /**\n     * This function can be called to stop iteration at any point.\n     */    done() {\n        this.Ft = !0;\n    }\n    /**\n     * This function can be called to skip to that next key, which could be\n     * an index or a primary key.\n     */    qt(t) {\n        this.Bt = t;\n    }\n    /**\n     * Delete the current cursor value from the object store.\n     *\n     * NOTE: You CANNOT do this with a keysOnly query.\n     */    delete() {\n        return wi(this.$t.delete());\n    }\n}\n\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class fi extends Q {\n    constructor(t, e) {\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \"IndexedDbTransactionError\";\n    }\n}\n\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function di(t) {\n    // Use name equality, as instanceof checks on errors don't work with errors\n    // that wrap other errors.\n    return \"IndexedDbTransactionError\" === t.name;\n}\n\n/**\n * A wrapper around an IDBObjectStore providing an API that:\n *\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\n * methods for acting against the object store.\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\n * method return a PersistencePromise instead.\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\n */ class _i {\n    constructor(t) {\n        this.store = t;\n    }\n    put(t, e) {\n        let n;\n        return void 0 !== e ? (O(\"SimpleDb\", \"PUT\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\"SimpleDb\", \"PUT\", this.store.name, \"<auto-key>\", t), \n        n = this.store.put(t)), wi(n);\n    }\n    /**\n     * Adds a new value into an Object Store and returns the new key. Similar to\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\n     *\n     * @param value - The object to write.\n     * @returns The key of the value to add.\n     */    add(t) {\n        O(\"SimpleDb\", \"ADD\", this.store.name, t, t);\n        return wi(this.store.add(t));\n    }\n    /**\n     * Gets the object with the specified key from the specified store, or null\n     * if no object exists with the specified key.\n     *\n     * @key The key of the object to get.\n     * @returns The object with the specified key or null if no object exists.\n     */    get(t) {\n        // We're doing an unsafe cast to ValueType.\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        return wi(this.store.get(t)).next((e => (\n        // Normalize nonexistence to null.\n        void 0 === e && (e = null), O(\"SimpleDb\", \"GET\", this.store.name, t, e), e)));\n    }\n    delete(t) {\n        O(\"SimpleDb\", \"DELETE\", this.store.name, t);\n        return wi(this.store.delete(t));\n    }\n    /**\n     * If we ever need more of the count variants, we can add overloads. For now,\n     * all we need is to count everything in a store.\n     *\n     * Returns the number of rows in the store.\n     */    count() {\n        O(\"SimpleDb\", \"COUNT\", this.store.name);\n        return wi(this.store.count());\n    }\n    Ut(t, e) {\n        const n = this.options(t, e);\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\n                if (n.index || \"function\" != typeof this.store.getAll) {\n            const t = this.cursor(n), e = [];\n            return this.Kt(t, ((t, n) => {\n                e.push(n);\n            })).next((() => e));\n        }\n        {\n            const t = this.store.getAll(n.range);\n            return new ui(((e, n) => {\n                t.onerror = t => {\n                    n(t.target.error);\n                }, t.onsuccess = t => {\n                    e(t.target.result);\n                };\n            }));\n        }\n    }\n    /**\n     * Loads the first `count` elements from the provided index range. Loads all\n     * elements if no limit is provided.\n     */    Gt(t, e) {\n        const n = this.store.getAll(t, null === e ? void 0 : e);\n        return new ui(((t, e) => {\n            n.onerror = t => {\n                e(t.target.error);\n            }, n.onsuccess = e => {\n                t(e.target.result);\n            };\n        }));\n    }\n    Qt(t, e) {\n        O(\"SimpleDb\", \"DELETE ALL\", this.store.name);\n        const n = this.options(t, e);\n        n.jt = !1;\n        const s = this.cursor(n);\n        return this.Kt(s, ((t, e, n) => n.delete()));\n    }\n    Wt(t, e) {\n        let n;\n        e ? n = t : (n = {}, e = t);\n        const s = this.cursor(n);\n        return this.Kt(s, e);\n    }\n    /**\n     * Iterates over a store, but waits for the given callback to complete for\n     * each entry before iterating the next entry. This allows the callback to do\n     * asynchronous work to determine if this iteration should continue.\n     *\n     * The provided callback should return `true` to continue iteration, and\n     * `false` otherwise.\n     */    zt(t) {\n        const e = this.cursor({});\n        return new ui(((n, s) => {\n            e.onerror = t => {\n                const e = gi(t.target.error);\n                s(e);\n            }, e.onsuccess = e => {\n                const s = e.target.result;\n                s ? t(s.primaryKey, s.value).next((t => {\n                    t ? s.continue() : n();\n                })) : n();\n            };\n        }));\n    }\n    Kt(t, e) {\n        const n = [];\n        return new ui(((s, i) => {\n            t.onerror = t => {\n                i(t.target.error);\n            }, t.onsuccess = t => {\n                const i = t.target.result;\n                if (!i) return void s();\n                const r = new li(i), o = e(i.primaryKey, i.value, r);\n                if (o instanceof ui) {\n                    const t = o.catch((t => (r.done(), ui.reject(t))));\n                    n.push(t);\n                }\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\n            };\n        })).next((() => ui.waitFor(n)));\n    }\n    options(t, e) {\n        let n;\n        return void 0 !== t && (\"string\" == typeof t ? n = t : e = t), {\n            index: n,\n            range: e\n        };\n    }\n    cursor(t) {\n        let e = \"next\";\n        if (t.reverse && (e = \"prev\"), t.index) {\n            const n = this.store.index(t.index);\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\n        }\n        return this.store.openCursor(t.range, e);\n    }\n}\n\n/**\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\n * handlers to resolve / reject the PersistencePromise as appropriate.\n */ function wi(t) {\n    return new ui(((e, n) => {\n        t.onsuccess = t => {\n            const n = t.target.result;\n            e(n);\n        }, t.onerror = t => {\n            const e = gi(t.target.error);\n            n(e);\n        };\n    }));\n}\n\n// Guard so we only report the error once.\nlet mi = !1;\n\nfunction gi(t) {\n    const e = hi.Vt(c());\n    if (e >= 12.2 && e < 13) {\n        const e = \"An internal error was encountered in the Indexed Database server\";\n        if (t.message.indexOf(e) >= 0) {\n            // Wrap error in a more descriptive one.\n            const t = new Q(\"internal\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\n            return mi || (mi = !0, \n            // Throw a global exception outside of this promise chain, for the user to\n            // potentially catch.\n            setTimeout((() => {\n                throw t;\n            }), 0)), t;\n        }\n    }\n    return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class yi extends ai {\n    constructor(t, e) {\n        super(), this.Ht = t, this.currentSequenceNumber = e;\n    }\n}\n\nfunction pi(t, e) {\n    const n = K(t);\n    return hi.xt(n.Ht, e);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A batch of mutations that will be sent as one unit to the backend.\n */ class Ii {\n    /**\n     * @param batchId - The unique ID of this mutation batch.\n     * @param localWriteTime - The original write time of this mutation.\n     * @param baseMutations - Mutations that are used to populate the base\n     * values when this mutation is applied locally. This can be used to locally\n     * overwrite values that are persisted in the remote document cache. Base\n     * mutations are never sent to the backend.\n     * @param mutations - The user-provided mutations in this mutation batch.\n     * User-provided mutations are applied both locally and remotely on the\n     * backend.\n     */\n    constructor(t, e, n, s) {\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\n    }\n    /**\n     * Applies all the mutations in this MutationBatch to the specified document\n     * to compute the state of the remote document\n     *\n     * @param document - The document to apply mutations to.\n     * @param batchResult - The result of applying the MutationBatch to the\n     * backend.\n     */    applyToRemoteDocument(t, e) {\n        const n = e.mutationResults;\n        for (let e = 0; e < this.mutations.length; e++) {\n            const s = this.mutations[e];\n            if (s.key.isEqual(t.key)) {\n                dn(s, t, n[e]);\n            }\n        }\n    }\n    /**\n     * Computes the local view of a document given all the mutations in this\n     * batch.\n     *\n     * @param document - The document to apply mutations to.\n     */    applyToLocalView(t) {\n        // First, apply the base state. This allows us to apply non-idempotent\n        // transform against a consistent set of values.\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && _n(e, t, this.localWriteTime);\n        // Second, apply all user-provided mutations.\n                for (const e of this.mutations) e.key.isEqual(t.key) && _n(e, t, this.localWriteTime);\n    }\n    /**\n     * Computes the local view for all provided documents given the mutations in\n     * this batch.\n     */    applyToLocalDocumentSet(t) {\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\n        // to O(n).\n        this.mutations.forEach((e => {\n            const n = t.get(e.key), s = n;\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\n            // and we should remove this cast.\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\n        }));\n    }\n    keys() {\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Gn());\n    }\n    isEqual(t) {\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => mn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => mn(t, e)));\n    }\n}\n\n/** The result of applying a mutation batch to the backend. */ class Ti {\n    constructor(t, e, n, \n    /**\n     * A pre-computed mapping from each mutated document to the resulting\n     * version.\n     */\n    s) {\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\n    }\n    /**\n     * Creates a new MutationBatchResult for the given batch and results. There\n     * must be one result for each mutation in the batch. This static factory\n     * caches a document=&gt;version mapping (docVersions).\n     */    static from(t, e, n) {\n        q(t.mutations.length === n.length);\n        let s = Un;\n        const i = t.mutations;\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\n        return new Ti(t, e, n, s);\n    }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Representation of an overlay computed by Firestore.\n *\n * Holds information about a mutation and the largest batch id in Firestore when\n * the mutation was created.\n */ class Ei {\n    constructor(t, e) {\n        this.largestBatchId = t, this.mutation = e;\n    }\n    getKey() {\n        return this.mutation.key;\n    }\n    isEqual(t) {\n        return null !== t && this.mutation === t.mutation;\n    }\n    toString() {\n        return `Overlay{\\n      largestBatchId: ${this.largestBatchId},\\n      mutation: ${this.mutation.toString()}\\n    }`;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable set of metadata that the local store tracks for each target.\n */ class Ai {\n    constructor(\n    /** The target being listened to. */\n    t, \n    /**\n     * The target ID to which the target corresponds; Assigned by the\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\n     */\n    e, \n    /** The purpose of the target. */\n    n, \n    /**\n     * The sequence number of the last transaction during which this target data\n     * was modified.\n     */\n    s, \n    /** The latest snapshot version seen for this target. */\n    i = ct.min()\n    /**\n     * The maximum snapshot version at which the associated view\n     * contained no limbo documents.\n     */ , r = ct.min()\n    /**\n     * An opaque, server-assigned token that allows watching a target to be\n     * resumed after disconnecting without retransmitting all the data that\n     * matches the target. The resume token essentially identifies a point in\n     * time from which the server should resume sending results.\n     */ , o = pt.EMPTY_BYTE_STRING) {\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\n    }\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\n        return new Ai(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\n    }\n    /**\n     * Creates a new target data instance with an updated resume token and\n     * snapshot version.\n     */    withResumeToken(t, e) {\n        return new Ai(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\n    }\n    /**\n     * Creates a new target data instance with an updated last limbo free\n     * snapshot version number.\n     */    withLastLimboFreeSnapshotVersion(t) {\n        return new Ai(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Serializer for values stored in the LocalStore. */ class Ri {\n    constructor(t) {\n        this.Jt = t;\n    }\n}\n\n/** Decodes a remote document from storage locally to a Document. */ function bi(t, e) {\n    let n;\n    if (e.document) n = ys(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\n        const t = xt.fromSegments(e.noDocument.path), s = Di(e.noDocument.readTime);\n        n = te.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\n    } else {\n        if (!e.unknownDocument) return L();\n        {\n            const t = xt.fromSegments(e.unknownDocument.path), s = Di(e.unknownDocument.version);\n            n = te.newUnknownDocument(t, s);\n        }\n    }\n    return e.readTime && n.setReadTime(vi(e.readTime)), n;\n}\n\n/** Encodes a document for storage locally. */ function Pi(t, e) {\n    const n = e.key.path.popLast().toArray(), s = Vi(e.readTime);\n    if (e.isFoundDocument()) {\n        const i = function(t, e) {\n            return {\n                name: ls(t, e.key),\n                fields: e.data.value.mapValue.fields,\n                updateTime: rs(t, e.version.toTimestamp())\n            };\n        }(t.Jt, e);\n        return {\n            document: i,\n            hasCommittedMutations: e.hasCommittedMutations,\n            readTime: s,\n            parentPath: n\n        };\n    }\n    if (e.isNoDocument()) {\n        const t = e.key.path.toArray(), i = e.hasCommittedMutations;\n        return {\n            noDocument: {\n                path: t,\n                readTime: Si(e.version)\n            },\n            hasCommittedMutations: i,\n            readTime: s,\n            parentPath: n\n        };\n    }\n    if (e.isUnknownDocument()) {\n        return {\n            unknownDocument: {\n                path: e.key.path.toArray(),\n                version: Si(e.version)\n            },\n            hasCommittedMutations: !0,\n            readTime: s,\n            parentPath: n\n        };\n    }\n    return L();\n}\n\nfunction Vi(t) {\n    const e = t.toTimestamp();\n    return [ e.seconds, e.nanoseconds ];\n}\n\nfunction vi(t) {\n    const e = new ut(t[0], t[1]);\n    return ct.fromTimestamp(e);\n}\n\nfunction Si(t) {\n    const e = t.toTimestamp();\n    return {\n        seconds: e.seconds,\n        nanoseconds: e.nanoseconds\n    };\n}\n\nfunction Di(t) {\n    const e = new ut(t.seconds, t.nanoseconds);\n    return ct.fromTimestamp(e);\n}\n\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\n/** Decodes a DbMutationBatch into a MutationBatch */\nfunction Ci(t, e) {\n    const n = (e.baseMutations || []).map((e => Es(t.Jt, e)));\n    // Squash old transform mutations into existing patch or set mutations.\n    // The replacement of representing `transforms` with `update_transforms`\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\n    // to be updated to `update_transforms`.\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\n        const n = e.mutations[t];\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\n            const s = e.mutations[t + 1];\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \n            ++t;\n        }\n    }\n    const s = e.mutations.map((e => Es(t.Jt, e))), i = ut.fromMillis(e.localWriteTimeMs);\n    return new Ii(e.batchId, i, n, s);\n}\n\n/** Decodes a DbTarget into TargetData */ function xi(t) {\n    const e = Di(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Di(t.lastLimboFreeSnapshotVersion) : ct.min();\n    let s;\n    var i;\n    return void 0 !== t.query.documents ? (q(1 === (i = t.query).documents.length), \n    s = $e(De(_s(i.documents[0])))) : s = function(t) {\n        return $e(Ps(t));\n    }(t.query), new Ai(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\n}\n\n/** Encodes TargetData into a DbTarget for storage locally. */ function Ni(t, e) {\n    const n = Si(e.snapshotVersion), s = Si(e.lastLimboFreeSnapshotVersion);\n    let i;\n    i = fe(e.target) ? Rs(t.Jt, e.target) : bs(t.Jt, e.target);\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\n    // convert it to a base64 string for storage.\n        const r = e.resumeToken.toBase64();\n    // lastListenSequenceNumber is always 0 until we do real GC.\n        return {\n        targetId: e.targetId,\n        canonicalId: ce(e.target),\n        readTime: n,\n        resumeToken: r,\n        lastListenSequenceNumber: e.sequenceNumber,\n        lastLimboFreeSnapshotVersion: s,\n        query: i\n    };\n}\n\n/**\n * A helper function for figuring out what kind of query has been stored.\n */\n/**\n * Encodes a `BundledQuery` from bundle proto to a Query object.\n *\n * This reconstructs the original query used to build the bundle being loaded,\n * including features exists only in SDKs (for example: limit-to-last).\n */\nfunction ki(t) {\n    const e = Ps({\n        parent: t.parent,\n        structuredQuery: t.structuredQuery\n    });\n    return \"LAST\" === t.limitType ? Fe(e, e.limit, \"L\" /* Last */) : e;\n}\n\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\nfunction Mi(t, e) {\n    return new Ei(e.largestBatchId, Es(t.Jt, e.overlayMutation));\n}\n\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\n/**\n * Returns the DbDocumentOverlayKey corresponding to the given user and\n * document key.\n */\nfunction Oi(t, e) {\n    const n = e.path.lastSegment();\n    return [ t, $s(e.path.popLast()), n ];\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass $i {\n    getBundleMetadata(t, e) {\n        return Fi(t).get(e).next((t => {\n            if (t) return {\n                id: (e = t).bundleId,\n                createTime: Di(e.createTime),\n                version: e.version\n            };\n            /** Encodes a DbBundle to a BundleMetadata object. */\n            var e;\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\n    }\n    saveBundleMetadata(t, e) {\n        return Fi(t).put({\n            bundleId: (n = e).id,\n            createTime: Si(us(n.createTime)),\n            version: n.version\n        });\n        var n;\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\n    getNamedQuery(t, e) {\n        return Bi(t).get(e).next((t => {\n            if (t) return {\n                name: (e = t).name,\n                query: ki(e.bundledQuery),\n                readTime: Di(e.readTime)\n            };\n            var e;\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\n    }\n    saveNamedQuery(t, e) {\n        return Bi(t).put(function(t) {\n            return {\n                name: t.name,\n                readTime: Si(us(t.readTime)),\n                bundledQuery: t.bundledQuery\n            };\n        }(e));\n    }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the bundles object store.\n */ function Fi(t) {\n    return pi(t, \"bundles\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\n */ function Bi(t) {\n    return pi(t, \"namedQueries\");\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Implementation of DocumentOverlayCache using IndexedDb.\n */ class Li {\n    /**\n     * @param serializer - The document serializer.\n     * @param userId - The userId for which we are accessing overlays.\n     */\n    constructor(t, e) {\n        this.M = t, this.userId = e;\n    }\n    static Yt(t, e) {\n        const n = e.uid || \"\";\n        return new Li(t, n);\n    }\n    getOverlay(t, e) {\n        return qi(t).get(Oi(this.userId, e)).next((t => t ? Mi(this.M, t) : null));\n    }\n    saveOverlays(t, e, n) {\n        const s = [];\n        return n.forEach(((n, i) => {\n            const r = new Ei(e, i);\n            s.push(this.Xt(t, r));\n        })), ui.waitFor(s);\n    }\n    removeOverlaysForBatchId(t, e, n) {\n        const s = new Set;\n        // Get the set of unique collection paths.\n                e.forEach((t => s.add($s(t.getCollectionPath()))));\n        const i = [];\n        return s.forEach((e => {\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \n            /*lowerOpen=*/ !1, \n            /*upperOpen=*/ !0);\n            i.push(qi(t).Qt(\"collectionPathOverlayIndex\", s));\n        })), ui.waitFor(i);\n    }\n    getOverlaysForCollection(t, e, n) {\n        const s = qn(), i = $s(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \n        /*lowerOpen=*/ !0);\n        return qi(t).Ut(\"collectionPathOverlayIndex\", r).next((t => {\n            for (const e of t) {\n                const t = Mi(this.M, e);\n                s.set(t.getKey(), t);\n            }\n            return s;\n        }));\n    }\n    getOverlaysForCollectionGroup(t, e, n, s) {\n        const i = qn();\n        let r;\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\n        // is not inclusive.\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \n        /*lowerOpen=*/ !0);\n        return qi(t).Wt({\n            index: \"collectionGroupOverlayIndex\",\n            range: o\n        }, ((t, e, n) => {\n            // We do not want to return partial batch overlays, even if the size\n            // of the result set exceeds the given `count` argument. Therefore, we\n            // continue to aggregate results even after the result size exceeds\n            // `count` if there are more overlays from the `currentBatchId`.\n            const o = Mi(this.M, e);\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\n        })).next((() => i));\n    }\n    Xt(t, e) {\n        return qi(t).put(function(t, e, n) {\n            const [s, i, r] = Oi(e, n.mutation.key);\n            return {\n                userId: e,\n                collectionPath: i,\n                documentId: r,\n                collectionGroup: n.mutation.key.getCollectionGroup(),\n                largestBatchId: n.largestBatchId,\n                overlayMutation: Ts(t.Jt, n.mutation)\n            };\n        }(this.M, this.userId, e));\n    }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document overlay object store.\n */ function qi(t) {\n    return pi(t, \"documentOverlays\");\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Note: This code is copied from the backend. Code that is not used by\n// Firestore was removed.\n/** Firestore index value writer.  */\nclass Ui {\n    constructor() {}\n    // The write methods below short-circuit writing terminators for values\n    // containing a (terminating) truncated value.\n    // As an example, consider the resulting encoding for:\n    // [\"bar\", [2, \"foo\"]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TERM, TERM, TERM)\n    // [\"bar\", [2, truncated(\"foo\")]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TRUNC)\n    // [\"bar\", truncated([\"foo\"])] -> (STRING, \"bar\", TERM, ARRAY. STRING, \"foo\", TERM, TRUNC)\n    /** Writes an index value.  */\n    Zt(t, e) {\n        this.te(t, e), \n        // Write separator to split index values\n        // (see go/firestore-storage-format#encodings).\n        e.ee();\n    }\n    te(t, e) {\n        if (\"nullValue\" in t) this.ne(e, 5); else if (\"booleanValue\" in t) this.ne(e, 10), \n        e.se(t.booleanValue ? 1 : 0); else if (\"integerValue\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\"doubleValue\" in t) {\n            const n = Et(t.doubleValue);\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \n            // -0.0, 0 and 0.0 are all considered the same\n            e.se(0) : e.se(n));\n        } else if (\"timestampValue\" in t) {\n            const n = t.timestampValue;\n            this.ne(e, 20), \"string\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \"\"}`), e.se(n.nanos || 0));\n        } else if (\"stringValue\" in t) this.re(t.stringValue, e), this.oe(e); else if (\"bytesValue\" in t) this.ne(e, 30), \n        e.ae(At(t.bytesValue)), this.oe(e); else if (\"referenceValue\" in t) this.ue(t.referenceValue, e); else if (\"geoPointValue\" in t) {\n            const n = t.geoPointValue;\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\n        } else \"mapValue\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \n        this.oe(e)) : \"arrayValue\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\n    }\n    re(t, e) {\n        this.ne(e, 25), this.le(t, e);\n    }\n    le(t, e) {\n        e.ie(t);\n    }\n    ce(t, e) {\n        const n = t.fields || {};\n        this.ne(e, 55);\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\n    }\n    he(t, e) {\n        const n = t.values || [];\n        this.ne(e, 50);\n        for (const t of n) this.te(t, e);\n    }\n    ue(t, e) {\n        this.ne(e, 37);\n        xt.fromName(t).path.forEach((t => {\n            this.ne(e, 60), this.le(t, e);\n        }));\n    }\n    ne(t, e) {\n        t.se(e);\n    }\n    oe(t) {\n        // While the SDK does not implement truncation, the truncation marker is\n        // used to terminate all variable length values (which are strings, bytes,\n        // references, arrays and maps).\n        t.se(2);\n    }\n}\n\nUi.fe = new Ui;\n\n/**\n * Counts the number of zeros in a byte.\n *\n * Visible for testing.\n */\nfunction Ki(t) {\n    if (0 === t) return 8;\n    let e = 0;\n    return t >> 4 == 0 && (\n    // Test if the first four bits are zero.\n    e += 4, t <<= 4), t >> 6 == 0 && (\n    // Test if the first two (or next two) bits are zero.\n    e += 2, t <<= 2), t >> 7 == 0 && (\n    // Test if the remaining bit is zero.\n    e += 1), e;\n}\n\n/** Counts the number of leading zeros in the given byte array. */\n/**\n * Returns the number of bytes required to store \"value\". Leading zero bytes\n * are skipped.\n */\nfunction Gi(t) {\n    // This is just the number of bytes for the unsigned representation of the number.\n    const e = 64 - function(t) {\n        let e = 0;\n        for (let n = 0; n < 8; ++n) {\n            const s = Ki(255 & t[n]);\n            if (e += s, 8 !== s) break;\n        }\n        return e;\n    }(t);\n    return Math.ceil(e / 8);\n}\n\n/**\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\n * behavior defined by the backend.\n *\n * The code is ported from its Java counterpart.\n */ class Qi {\n    constructor() {\n        this.buffer = new Uint8Array(1024), this.position = 0;\n    }\n    de(t) {\n        const e = t[Symbol.iterator]();\n        let n = e.next();\n        for (;!n.done; ) this._e(n.value), n = e.next();\n        this.we();\n    }\n    me(t) {\n        const e = t[Symbol.iterator]();\n        let n = e.next();\n        for (;!n.done; ) this.ge(n.value), n = e.next();\n        this.ye();\n    }\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\n        for (const e of t) {\n            const t = e.charCodeAt(0);\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \"\\ud800\" || \"\\udbff\" < e) this._e(480 | t >>> 12), \n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\n                const t = e.codePointAt(0);\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \n                this._e(128 | 63 & t);\n            }\n        }\n        this.we();\n    }\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\n        for (const e of t) {\n            const t = e.charCodeAt(0);\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \"\\ud800\" || \"\\udbff\" < e) this.ge(480 | t >>> 12), \n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\n                const t = e.codePointAt(0);\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \n                this.ge(128 | 63 & t);\n            }\n        }\n        this.ye();\n    }\n    Te(t) {\n        // Values are encoded with a single byte length prefix, followed by the\n        // actual value in big-endian format with leading 0 bytes dropped.\n        const e = this.Ee(t), n = Gi(e);\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\n        // Write the length\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\n    }\n    Re(t) {\n        // Values are encoded with a single byte length prefix, followed by the\n        // inverted value in big-endian format with leading 0 bytes dropped.\n        const e = this.Ee(t), n = Gi(e);\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\n        // Write the length\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\n    }\n    /**\n     * Writes the \"infinity\" byte sequence that sorts after all other byte\n     * sequences written in ascending order.\n     */    be() {\n        this.Pe(255), this.Pe(255);\n    }\n    /**\n     * Writes the \"infinity\" byte sequence that sorts before all other byte\n     * sequences written in descending order.\n     */    Ve() {\n        this.ve(255), this.ve(255);\n    }\n    /**\n     * Resets the buffer such that it is the same as when it was newly\n     * constructed.\n     */    reset() {\n        this.position = 0;\n    }\n    seed(t) {\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\n    }\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\n        return this.buffer.slice(0, this.position);\n    }\n    /**\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\n     * floating-point comparison results with the following exceptions:\n     *   -0.0 < 0.0\n     *   all non-NaN < NaN\n     *   NaN = NaN\n     */    Ee(t) {\n        const e = \n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\n        function(t) {\n            const e = new DataView(new ArrayBuffer(8));\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\n        }(t), n = 0 != (128 & e[0]);\n        // Check if the first bit is set. We use a bit mask since value[0] is\n        // encoded as a number from 0 to 255.\n                // Revert the two complement to get natural ordering\n        e[0] ^= n ? 255 : 128;\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\n        return e;\n    }\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\n        const e = 255 & t;\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\n    }\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\n        const e = 255 & t;\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\n    }\n    we() {\n        this.Pe(0), this.Pe(1);\n    }\n    ye() {\n        this.ve(0), this.ve(1);\n    }\n    Pe(t) {\n        this.Ae(1), this.buffer[this.position++] = t;\n    }\n    ve(t) {\n        this.Ae(1), this.buffer[this.position++] = ~t;\n    }\n    Ae(t) {\n        const e = t + this.position;\n        if (e <= this.buffer.length) return;\n        // Try doubling.\n                let n = 2 * this.buffer.length;\n        // Still not big enough? Just allocate the right size.\n                n < e && (n = e);\n        // Create the new buffer.\n                const s = new Uint8Array(n);\n        s.set(this.buffer), // copy old data\n        this.buffer = s;\n    }\n}\n\nclass ji {\n    constructor(t) {\n        this.De = t;\n    }\n    ae(t) {\n        this.De.de(t);\n    }\n    ie(t) {\n        this.De.pe(t);\n    }\n    se(t) {\n        this.De.Te(t);\n    }\n    ee() {\n        this.De.be();\n    }\n}\n\nclass Wi {\n    constructor(t) {\n        this.De = t;\n    }\n    ae(t) {\n        this.De.me(t);\n    }\n    ie(t) {\n        this.De.Ie(t);\n    }\n    se(t) {\n        this.De.Re(t);\n    }\n    ee() {\n        this.De.Ve();\n    }\n}\n\n/**\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\n * actual encoding.\n */ class zi {\n    constructor() {\n        this.De = new Qi, this.Ce = new ji(this.De), this.xe = new Wi(this.De);\n    }\n    seed(t) {\n        this.De.seed(t);\n    }\n    Ne(t) {\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\n    }\n    Se() {\n        return this.De.Se();\n    }\n    reset() {\n        this.De.reset();\n    }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Represents an index entry saved by the SDK in persisted storage. */ class Hi {\n    constructor(t, e, n, s) {\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\n    }\n    /**\n     * Returns an IndexEntry entry that sorts immediately after the current\n     * directional value.\n     */    ke() {\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \n        new Hi(this.indexId, this.documentKey, this.arrayValue, n);\n    }\n}\n\nfunction Ji(t, e) {\n    let n = t.indexId - e.indexId;\n    return 0 !== n ? n : (n = Yi(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = Yi(t.directionalValue, e.directionalValue), \n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\n}\n\nfunction Yi(t, e) {\n    for (let n = 0; n < t.length && n < e.length; ++n) {\n        const s = t[n] - e[n];\n        if (0 !== s) return s;\n    }\n    return t.length - e.length;\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A light query planner for Firestore.\n *\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\n * determines whether a given index can be used to serve the specified target.\n *\n * The following table showcases some possible index configurations:\n *\n * Query                                               | Index\n * -----------------------------------------------------------------------------\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\n */ class Xi {\n    constructor(t) {\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \n        this.Me = t.orderBy, this.Oe = [];\n        for (const e of t.filters) {\n            const t = e;\n            t.S() ? this.$e = t : this.Oe.push(t);\n        }\n    }\n    /**\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\n     * target.\n     *\n     * An index is considered capable of serving the target when:\n     * - The target uses all index segments for its filters and orderBy clauses.\n     *   The target can have additional filter and orderBy clauses, but not\n     *   fewer.\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\n     *   have a corresponding `CONTAINS` segment.\n     * - All directional index segments can be mapped to the target as a series of\n     *   equality filters, a single inequality filter and a series of orderBy\n     *   clauses.\n     * - The segments that represent the equality filters may appear out of order.\n     * - The optional segment for the inequality filter must appear after all\n     *   equality segments.\n     * - The segments that represent that orderBy clause of the target must appear\n     *   in order after all equality and inequality segments. Single orderBy\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\n     *   omitted.\n     */    Fe(t) {\n        // If there is an array element, find a matching filter.\n        const e = ne(t);\n        if (void 0 !== e && !this.Be(e)) return !1;\n        const n = se(t);\n        let s = 0, i = 0;\n        // Process all equalities first. Equalities can appear out of order.\n        for (;s < n.length && this.Be(n[s]); ++s) ;\n        // If we already have processed all segments, all segments are used to serve\n        // the equality filters and we do not need to map any segments to the\n        // target's inequality and orderBy clauses.\n                if (s === n.length) return !0;\n        // If there is an inequality filter, the next segment must match both the\n        // filter and the first orderBy clause.\n                if (void 0 !== this.$e) {\n            const t = n[s];\n            if (!this.Le(this.$e, t) || !this.qe(this.Me[i++], t)) return !1;\n            ++s;\n        }\n        // All remaining segments need to represent the prefix of the target's\n        // orderBy.\n                for (;s < n.length; ++s) {\n            const t = n[s];\n            if (i >= this.Me.length || !this.qe(this.Me[i++], t)) return !1;\n        }\n        return !0;\n    }\n    Be(t) {\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\n        return !1;\n    }\n    Le(t, e) {\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\n        const n = \"array-contains\" /* ARRAY_CONTAINS */ === t.op || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === t.op;\n        return 2 /* CONTAINS */ === e.kind === n;\n    }\n    qe(t, e) {\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \"asc\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \"desc\" /* DESCENDING */ === t.dir);\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of IndexManager.\n */ class Zi {\n    constructor() {\n        this.Ue = new tr;\n    }\n    addToCollectionParentIndex(t, e) {\n        return this.Ue.add(e), ui.resolve();\n    }\n    getCollectionParents(t, e) {\n        return ui.resolve(this.Ue.getEntries(e));\n    }\n    addFieldIndex(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve();\n    }\n    deleteFieldIndex(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve();\n    }\n    getDocumentsMatchingTarget(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve(null);\n    }\n    getFieldIndex(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve(null);\n    }\n    getFieldIndexes(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve([]);\n    }\n    getNextCollectionGroupToUpdate(t) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve(null);\n    }\n    updateCollectionGroup(t, e, n) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve();\n    }\n    updateIndexEntries(t, e) {\n        // Field indices are not supported with memory persistence.\n        return ui.resolve();\n    }\n}\n\n/**\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\n * in indexeddb_schema.ts\n */ class tr {\n    constructor() {\n        this.index = {};\n    }\n    // Returns false if the entry already existed.\n    add(t) {\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new kn(_t.comparator), i = !s.has(n);\n        return this.index[e] = s.add(n), i;\n    }\n    has(t) {\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\n        return s && s.has(n);\n    }\n    getEntries(t) {\n        return (this.index[t] || new kn(_t.comparator)).toArray();\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const er = new Uint8Array(0);\n\n/**\n * A persisted implementation of IndexManager.\n *\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\n * data as it supports multi-tab access.\n */\nclass nr {\n    constructor(t) {\n        this.user = t, \n        /**\n         * An in-memory copy of the index entries we've already written since the SDK\n         * launched. Used to avoid re-writing the same entry repeatedly.\n         *\n         * This is *NOT* a complete cache of what's in persistence and so can never be\n         * used to satisfy reads.\n         */\n        this.Ke = new tr, \n        /**\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\n         * contains only one term from the target's disjunctive normal form (DNF).\n         */\n        this.Ge = new Dn((t => ce(t)), ((t, e) => le(t, e))), this.uid = t.uid || \"\";\n    }\n    /**\n     * Adds a new entry to the collection parent index.\n     *\n     * Repeated calls for the same collectionPath should be avoided within a\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\n     * has been committed.\n     */    addToCollectionParentIndex(t, e) {\n        if (!this.Ke.has(e)) {\n            const n = e.lastSegment(), s = e.popLast();\n            t.addOnCommittedListener((() => {\n                // Add the collection to the in memory cache only if the transaction was\n                // successfully committed.\n                this.Ke.add(e);\n            }));\n            const i = {\n                collectionId: n,\n                parent: $s(s)\n            };\n            return sr(t).put(i);\n        }\n        return ui.resolve();\n    }\n    getCollectionParents(t, e) {\n        const n = [], s = IDBKeyRange.bound([ e, \"\" ], [ at(e), \"\" ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0);\n        return sr(t).Ut(s).next((t => {\n            for (const s of t) {\n                // This collectionId guard shouldn't be necessary (and isn't as long\n                // as we're running in a real browser), but there's a bug in\n                // indexeddbshim that breaks our range in our tests running in node:\n                // https://github.com/axemclion/IndexedDBShim/issues/334\n                if (s.collectionId !== e) break;\n                n.push(Ls(s.parent));\n            }\n            return n;\n        }));\n    }\n    addFieldIndex(t, e) {\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\n        // Safari & Firefox.\n        const n = rr(t), s = function(t) {\n            return {\n                indexId: t.indexId,\n                collectionGroup: t.collectionGroup,\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\n            };\n        }(e);\n        // `indexId` is auto-populated by IndexedDb\n        return delete s.indexId, n.add(s).next();\n    }\n    deleteFieldIndex(t, e) {\n        const n = rr(t), s = or(t), i = ir(t);\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0))));\n    }\n    getDocumentsMatchingTarget(t, e) {\n        const n = ir(t);\n        let s = !0;\n        const i = new Map;\n        return ui.forEach(this.Qe(e), (e => this.getFieldIndex(t, e).next((t => {\n            s && (s = !!t), i.set(e, t);\n        })))).next((() => {\n            if (s) {\n                let t = Gn();\n                return ui.forEach(i, ((s, i) => {\n                    var r;\n                    O(\"IndexedDbIndexManager\", `Using index ${r = s, `id=${r.indexId}|cg=${r.collectionGroup}|f=${r.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\",\")}`} to execute ${ce(e)}`);\n                    const o = function(t, e) {\n                        const n = ne(e);\n                        if (void 0 === n) return null;\n                        for (const e of de(t, n.fieldPath)) switch (e.op) {\n                          case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n                            return e.value.arrayValue.values || [];\n\n                          case \"array-contains\" /* ARRAY_CONTAINS */ :\n                            return [ e.value ];\n                            // Remaining filters are not array filters.\n                                                }\n                        return null;\n                    }\n                    /**\n * Returns the list of values that are used in != or NOT_IN filters. Returns\n * `null` if there are no such filters.\n */ (i, s), a = function(t, e) {\n                        const n = new Map;\n                        for (const s of se(e)) for (const e of de(t, s.fieldPath)) switch (e.op) {\n                          case \"==\" /* EQUAL */ :\n                          case \"in\" /* IN */ :\n                            // Encode equality prefix, which is encoded in the index value before\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\n                            // `value != 'ab'`).\n                            n.set(s.fieldPath.canonicalString(), e.value);\n                            break;\n\n                          case \"not-in\" /* NOT_IN */ :\n                          case \"!=\" /* NOT_EQUAL */ :\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\n                            // segments and hence we can return early here.\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\n                            // Remaining filters cannot be used as notIn bounds.\n                                                }\n                        return null;\n                    }\n                    /**\n * Returns a lower bound of field values that can be used as a starting point to\n * scan the index defined by `fieldIndex`. Returns `null` if no lower bound\n * exists.\n */ (i, s), u = function(t, e) {\n                        const n = [];\n                        let s = !0;\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\n                        // startAt.\n                                                for (const r of se(e)) {\n                            let e, o = !0;\n                            // Process all filters to find a value for the current field segment\n                            for (const n of de(t, r.fieldPath)) {\n                                let t, s = !0;\n                                switch (n.op) {\n                                  case \"<\" /* LESS_THAN */ :\n                                  case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n                                    t = \"nullValue\" in (i = n.value) ? kt : \"booleanValue\" in i ? {\n                                        booleanValue: !1\n                                    } : \"integerValue\" in i || \"doubleValue\" in i ? {\n                                        doubleValue: NaN\n                                    } : \"timestampValue\" in i ? {\n                                        timestampValue: {\n                                            seconds: Number.MIN_SAFE_INTEGER\n                                        }\n                                    } : \"stringValue\" in i ? {\n                                        stringValue: \"\"\n                                    } : \"bytesValue\" in i ? {\n                                        bytesValue: \"\"\n                                    } : \"referenceValue\" in i ? Ut(vt.empty(), xt.empty()) : \"geoPointValue\" in i ? {\n                                        geoPointValue: {\n                                            latitude: -90,\n                                            longitude: -180\n                                        }\n                                    } : \"arrayValue\" in i ? {\n                                        arrayValue: {}\n                                    } : \"mapValue\" in i ? {\n                                        mapValue: {}\n                                    } : L();\n                                    break;\n\n                                  case \"==\" /* EQUAL */ :\n                                  case \"in\" /* IN */ :\n                                  case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n                                    t = n.value;\n                                    break;\n\n                                  case \">\" /* GREATER_THAN */ :\n                                    t = n.value, s = !1;\n                                    break;\n\n                                  case \"!=\" /* NOT_EQUAL */ :\n                                  case \"not-in\" /* NOT_IN */ :\n                                    t = kt;\n // Remaining filters cannot be used as lower bounds.\n                                                                }\n                                Jt(e, t) === t && (e = t, o = s);\n                            }\n                            // If there is a startAt bound, compare the values against the existing\n                            // boundary to see if we can narrow the scope.\n                                                        if (null !== t.startAt) for (let n = 0; n < t.orderBy.length; ++n) if (t.orderBy[n].field.isEqual(r.fieldPath)) {\n                                const s = t.startAt.position[n];\n                                Jt(e, s) === s && (e = s, o = t.startAt.inclusive);\n                                break;\n                            }\n                            if (void 0 === e) \n                            // No lower bound exists\n                            return null;\n                            n.push(e), s && (s = o);\n                        }\n                        var i;\n                        /** Returns the largest value for the given value type (exclusive). */                        return new Ae(n, s);\n                    }\n                    /**\n * Returns an upper bound of field values that can be used as an ending point\n * when scanning the index defined by `fieldIndex`. Returns `null` if no\n * upper bound exists.\n */ (i, s), c = function(t, e) {\n                        const n = [];\n                        let s = !0;\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\n                        // endAt.\n                                                for (const r of se(e)) {\n                            let e, o = !0;\n                            // Process all filters to find a value for the current field segment\n                            for (const n of de(t, r.fieldPath)) {\n                                let t, s = !0;\n                                switch (n.op) {\n                                  case \">=\" /* GREATER_THAN_OR_EQUAL */ :\n                                  case \">\" /* GREATER_THAN */ :\n                                    t = \"nullValue\" in (i = n.value) ? {\n                                        booleanValue: !1\n                                    } : \"booleanValue\" in i ? {\n                                        doubleValue: NaN\n                                    } : \"integerValue\" in i || \"doubleValue\" in i ? {\n                                        timestampValue: {\n                                            seconds: Number.MIN_SAFE_INTEGER\n                                        }\n                                    } : \"timestampValue\" in i ? {\n                                        stringValue: \"\"\n                                    } : \"stringValue\" in i ? {\n                                        bytesValue: \"\"\n                                    } : \"bytesValue\" in i ? Ut(vt.empty(), xt.empty()) : \"referenceValue\" in i ? {\n                                        geoPointValue: {\n                                            latitude: -90,\n                                            longitude: -180\n                                        }\n                                    } : \"geoPointValue\" in i ? {\n                                        arrayValue: {}\n                                    } : \"arrayValue\" in i ? {\n                                        mapValue: {}\n                                    } : \"mapValue\" in i ? Nt : L(), s = !1;\n                                    break;\n\n                                  case \"==\" /* EQUAL */ :\n                                  case \"in\" /* IN */ :\n                                  case \"<=\" /* LESS_THAN_OR_EQUAL */ :\n                                    t = n.value;\n                                    break;\n\n                                  case \"<\" /* LESS_THAN */ :\n                                    t = n.value, s = !1;\n                                    break;\n\n                                  case \"!=\" /* NOT_EQUAL */ :\n                                  case \"not-in\" /* NOT_IN */ :\n                                    t = Nt;\n // Remaining filters cannot be used as upper bounds.\n                                                                }\n                                Yt(e, t) === t && (e = t, o = s);\n                            }\n                            // If there is a endAt bound, compare the values against the existing\n                            // boundary to see if we can narrow the scope.\n                                                        if (null !== t.endAt) for (let n = 0; n < t.orderBy.length; ++n) if (t.orderBy[n].field.isEqual(r.fieldPath)) {\n                                const s = t.endAt.position[n];\n                                Yt(e, s) === s && (e = s, o = t.endAt.inclusive);\n                                break;\n                            }\n                            if (void 0 === e) \n                            // No upper bound exists\n                            return null;\n                            n.push(e), s && (s = o);\n                        }\n                        var i;\n                        return new Ae(n, s);\n                    }(i, s), h = this.je(s, i, u), l = this.je(s, i, c), f = this.We(s, i, a), d = this.ze(s.indexId, o, h, !!u && u.inclusive, l, !!c && c.inclusive, f);\n                    return ui.forEach(d, (s => n.Gt(s, e.limit).next((e => {\n                        e.forEach((e => {\n                            t = t.add(new xt(Ls(e.documentKey)));\n                        }));\n                    }))));\n                })).next((() => t));\n            }\n            return ui.resolve(null);\n        }));\n    }\n    Qe(t) {\n        let e = this.Ge.get(t);\n        return e || (\n        // TODO(orquery): Implement DNF transform\n        e = [ t ], this.Ge.set(t, e), e);\n    }\n    /**\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\n     * bounds.\n     */    ze(t, e, n, s, i, r, o) {\n        // The number of total index scans we union together. This is similar to a\n        // distributed normal form, but adapted for array values. We create a single\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\n        // combined with the values from the query bounds.\n        const a = (null != e ? e.length : 1) * Math.max(null != n ? n.length : 1, null != i ? i.length : 1), u = a / (null != e ? e.length : 1), c = [];\n        for (let h = 0; h < a; ++h) {\n            const a = e ? this.He(e[h / u]) : er, l = n ? this.Je(t, a, n[h % u], s) : this.Ye(t), f = i ? this.Xe(t, a, i[h % u], r) : this.Ye(t + 1);\n            c.push(...this.createRange(l, f, o.map((e => this.Je(t, a, e, \n            /* inclusive= */ !0)))));\n        }\n        return c;\n    }\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Je(t, e, n, s) {\n        const i = new Hi(t, xt.empty(), e, n);\n        return s ? i : i.ke();\n    }\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\n        const i = new Hi(t, xt.empty(), e, n);\n        return s ? i.ke() : i;\n    }\n    /**\n     * Generates an empty bound that scopes the index scan to the current index\n     * and user.\n     */    Ye(t) {\n        return new Hi(t, xt.empty(), er, er);\n    }\n    getFieldIndex(t, e) {\n        const n = new Xi(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\n        return this.getFieldIndexes(t, s).next((t => {\n            const e = t.filter((t => n.Fe(t)));\n            // Return the index that matches the most number of segments.\n                        return e.sort(((t, e) => e.fields.length - t.fields.length)), e.length > 0 ? e[0] : null;\n        }));\n    }\n    /**\n     * Returns the byte encoded form of the directional values in the field index.\n     * Returns `null` if the document does not have all fields specified in the\n     * index.\n     */    Ze(t, e) {\n        const n = new zi;\n        for (const s of se(t)) {\n            const t = e.data.field(s.fieldPath);\n            if (null == t) return null;\n            const i = n.Ne(s.kind);\n            Ui.fe.Zt(t, i);\n        }\n        return n.Se();\n    }\n    /** Encodes a single value to the ascending index format. */    He(t) {\n        const e = new zi;\n        return Ui.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\n    }\n    /**\n     * Encodes the given field values according to the specification in `target`.\n     * For IN queries, a list of possible values is returned.\n     */    We(t, e, n) {\n        if (null === n) return [];\n        let s = [];\n        s.push(new zi);\n        let i = 0;\n        for (const r of se(t)) {\n            const t = n[i++];\n            for (const n of s) if (this.tn(e, r.fieldPath) && Gt(t)) s = this.en(s, r, t); else {\n                const e = n.Ne(r.kind);\n                Ui.fe.Zt(t, e);\n            }\n        }\n        return this.nn(s);\n    }\n    /**\n     * Encodes the given bounds according to the specification in `target`. For IN\n     * queries, a list of possible values is returned.\n     */    je(t, e, n) {\n        return null == n ? null : this.We(t, e, n.position);\n    }\n    /** Returns the byte representation for the provided encoders. */    nn(t) {\n        const e = [];\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\n        return e;\n    }\n    /**\n     * Creates a separate encoder for each element of an array.\n     *\n     * The method appends each value to all existing encoders (e.g. filter(\"a\",\n     * \"==\", \"a1\").filter(\"b\", \"in\", [\"b1\", \"b2\"]) becomes [\"a1,b1\", \"a1,b2\"]). A\n     * list of new encoders is returned.\n     */    en(t, e, n) {\n        const s = [ ...t ], i = [];\n        for (const t of n.arrayValue.values || []) for (const n of s) {\n            const s = new zi;\n            s.seed(n.Se()), Ui.fe.Zt(t, s.Ne(e.kind)), i.push(s);\n        }\n        return i;\n    }\n    tn(t, e) {\n        return !!t.filters.find((t => t instanceof _e && t.field.isEqual(e) && (\"in\" /* IN */ === t.op || \"not-in\" /* NOT_IN */ === t.op)));\n    }\n    getFieldIndexes(t, e) {\n        const n = rr(t), s = or(t);\n        return (e ? n.Ut(\"collectionGroupIndex\", IDBKeyRange.bound(e, e)) : n.Ut()).next((t => {\n            const e = [];\n            return ui.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\n                e.push(function(t, e) {\n                    const n = e ? new re(e.sequenceNumber, new oe(Di(e.readTime), new xt(Ls(e.documentKey)), e.largestBatchId)) : re.empty(), s = t.fields.map((([t, e]) => new ie(mt.fromServerFormat(t), e)));\n                    return new ee(t.indexId, t.collectionGroup, s, n);\n                }(t, n));\n            })))).next((() => e));\n        }));\n    }\n    getNextCollectionGroupToUpdate(t) {\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\n        })), t[0].collectionGroup)));\n    }\n    updateCollectionGroup(t, e, n) {\n        const s = rr(t), i = or(t);\n        return this.sn(t).next((t => s.Ut(\"collectionGroupIndex\", IDBKeyRange.bound(e, e)).next((e => ui.forEach(e, (e => i.put(function(t, e, n, s) {\n            return {\n                indexId: t,\n                uid: e.uid || \"\",\n                sequenceNumber: n,\n                readTime: Si(s.readTime),\n                documentKey: $s(s.documentKey.path),\n                largestBatchId: s.largestBatchId\n            };\n        }(e.indexId, this.user, t, n))))))));\n    }\n    updateIndexEntries(t, e) {\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\n        // it could be used across different IndexedDB transactions. As any cached\n        // data might be invalidated by other multi-tab clients, we can only trust\n        // data within a single IndexedDB transaction. We therefore add a cache\n        // here.\n        const n = new Map;\n        return ui.forEach(e, ((e, s) => {\n            const i = n.get(e.collectionGroup);\n            return (i ? ui.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \n            ui.forEach(i, (n => this.rn(t, e, n).next((e => {\n                const i = this.on(s, n);\n                return e.isEqual(i) ? ui.resolve() : this.an(t, s, e, i);\n            })))))));\n        }));\n    }\n    un(t, e, n) {\n        return ir(t).put({\n            indexId: n.indexId,\n            uid: this.uid,\n            arrayValue: n.arrayValue,\n            directionalValue: n.directionalValue,\n            documentKey: $s(e.key.path)\n        });\n    }\n    cn(t, e, n) {\n        return ir(t).delete([ n.indexId, this.uid, n.arrayValue, n.directionalValue, $s(e.key.path) ]);\n    }\n    rn(t, e, n) {\n        const s = ir(t);\n        let i = new kn(Ji);\n        return s.Wt({\n            index: \"documentKeyIndex\",\n            range: IDBKeyRange.only([ n.indexId, this.uid, $s(e.path) ])\n        }, ((t, s) => {\n            i = i.add(new Hi(n.indexId, e, s.arrayValue, s.directionalValue));\n        })).next((() => i));\n    }\n    /** Creates the index entries for the given document. */    on(t, e) {\n        let n = new kn(Ji);\n        const s = this.Ze(e, t);\n        if (null == s) return n;\n        const i = ne(e);\n        if (null != i) {\n            const r = t.data.field(i.fieldPath);\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new Hi(e.indexId, t.key, this.He(i), s));\n        } else n = n.add(new Hi(e.indexId, t.key, er, s));\n        return n;\n    }\n    /**\n     * Updates the index entries for the provided document by deleting entries\n     * that are no longer referenced in `newEntries` and adding all newly added\n     * entries.\n     */    an(t, e, n, s) {\n        O(\"IndexedDbIndexManager\", \"Updating index entries for document '%s'\", e.key);\n        const i = [];\n        return function(t, e, n, s, i) {\n            const r = t.getIterator(), o = e.getIterator();\n            let a = On(r), u = On(o);\n            // Walk through the two sets at the same time, using the ordering defined by\n            // `comparator`.\n            for (;a || u; ) {\n                let t = !1, e = !1;\n                if (a && u) {\n                    const s = n(a, u);\n                    s < 0 ? \n                    // The element was removed if the next element in our ordered\n                    // walkthrough is only in `before`.\n                    e = !0 : s > 0 && (\n                    // The element was added if the next element in our ordered walkthrough\n                    // is only in `after`.\n                    t = !0);\n                } else null != a ? e = !0 : t = !0;\n                t ? (s(u), u = On(o)) : e ? (i(a), a = On(r)) : (a = On(r), u = On(o));\n            }\n        }(n, s, Ji, (\n        /* onAdd= */ n => {\n            i.push(this.un(t, e, n));\n        }), (\n        /* onRemove= */ n => {\n            i.push(this.cn(t, e, n));\n        })), ui.waitFor(i);\n    }\n    sn(t) {\n        let e = 1;\n        return or(t).Wt({\n            index: \"sequenceNumberIndex\",\n            reverse: !0,\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\n        }, ((t, n, s) => {\n            s.done(), e = n.sequenceNumber + 1;\n        })).next((() => e));\n    }\n    /**\n     * Returns a new set of IDB ranges that splits the existing range and excludes\n     * any values that match the `notInValue` from these ranges. As an example,\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\n     */    createRange(t, e, n) {\n        // The notIb values need to be sorted and unique so that we can return a\n        // sorted set of non-overlapping ranges.\n        n = n.sort(((t, e) => Ji(t, e))).filter(((t, e, n) => !e || 0 !== Ji(t, n[e - 1])));\n        const s = [];\n        s.push(t);\n        for (const i of n) {\n            const n = Ji(i, t), r = Ji(i, e);\n            if (0 === n) \n            // `notInValue` is the lower bound. We therefore need to raise the bound\n            // to the next value.\n            s[0] = t.ke(); else if (n > 0 && r < 0) \n            // `notInValue` is in the middle of the range\n            s.push(i), s.push(i.ke()); else if (r > 0) \n            // `notInValue` (and all following values) are out of the range\n            break;\n        }\n        s.push(e);\n        const i = [];\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, \"\" ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, \"\" ]));\n        return i;\n    }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the collectionParents\n * document store.\n */ function sr(t) {\n    return pi(t, \"collectionParents\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index entry object store.\n */ function ir(t) {\n    return pi(t, \"indexEntries\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index configuration object store.\n */ function rr(t) {\n    return pi(t, \"indexConfiguration\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index state object store.\n */ function or(t) {\n    return pi(t, \"indexState\");\n}\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const ar = {\n    didRun: !1,\n    sequenceNumbersCollected: 0,\n    targetsRemoved: 0,\n    documentsRemoved: 0\n};\n\nclass ur {\n    constructor(\n    // When we attempt to collect, we will only do so if the cache size is greater than this\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\n    t, \n    // The percentage of sequence numbers that we will attempt to collect\n    e, \n    // A cap on the total number of sequence numbers that will be collected. This prevents\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\n    n) {\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\n    }\n    static withCacheSize(t) {\n        return new ur(t, ur.DEFAULT_COLLECTION_PERCENTILE, ur.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Delete a mutation batch and the associated document mutations.\n * @returns A PersistencePromise of the document mutations that were removed.\n */\nfunction cr(t, e, n) {\n    const s = t.store(\"mutations\"), i = t.store(\"documentMutations\"), r = [], o = IDBKeyRange.only(n.batchId);\n    let a = 0;\n    const u = s.Wt({\n        range: o\n    }, ((t, e, n) => (a++, n.delete())));\n    r.push(u.next((() => {\n        q(1 === a);\n    })));\n    const c = [];\n    for (const t of n.mutations) {\n        const s = Ks(e, t.key.path, n.batchId);\n        r.push(i.delete(s)), c.push(t.key);\n    }\n    return ui.waitFor(r).next((() => c));\n}\n\n/**\n * Returns an approximate size for the given document.\n */ function hr(t) {\n    if (!t) return 0;\n    let e;\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n        if (!t.noDocument) throw L();\n        e = t.noDocument;\n    }\n    return JSON.stringify(e).length;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** A mutation queue for a specific user, backed by IndexedDB. */ ur.DEFAULT_COLLECTION_PERCENTILE = 10, \nur.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, ur.DEFAULT = new ur(41943040, ur.DEFAULT_COLLECTION_PERCENTILE, ur.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \nur.DISABLED = new ur(-1, 0, 0);\n\nclass lr {\n    constructor(\n    /**\n     * The normalized userId (e.g. null UID => \"\" userId) used to store /\n     * retrieve mutations.\n     */\n    t, e, n, s) {\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \n        /**\n         * Caches the document keys for pending mutation batches. If the mutation\n         * has been removed from IndexedDb, the cached value may continue to\n         * be used to retrieve the batch's document keys. To remove a cached value\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\n         * or through `removeMutationBatches()`.\n         *\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\n         * this cache is used by secondary clients to invalidate the local\n         * view of the documents that were previously affected by the mutation.\n         */\n        // PORTING NOTE: Multi-tab only.\n        this.hn = {};\n    }\n    /**\n     * Creates a new mutation queue for the given user.\n     * @param user - The user for which to create a mutation queue.\n     * @param serializer - The serializer to use when persisting to IndexedDb.\n     */    static Yt(t, e, n, s) {\n        // TODO(mcg): Figure out what constraints there are on userIDs\n        // In particular, are there any reserved characters? are empty ids allowed?\n        // For the moment store these together in the same mutations table assuming\n        // that empty userIDs aren't allowed.\n        q(\"\" !== t.uid);\n        const i = t.isAuthenticated() ? t.uid : \"\";\n        return new lr(i, e, n, s);\n    }\n    checkEmpty(t) {\n        let e = !0;\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\n        return dr(t).Wt({\n            index: \"userMutationsIndex\",\n            range: n\n        }, ((t, n, s) => {\n            e = !1, s.done();\n        })).next((() => e));\n    }\n    addMutationBatch(t, e, n, s) {\n        const i = _r(t), r = dr(t);\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\n        // compound indices that include auto-generated keys correctly. To ensure\n        // that the index entry is added correctly in all browsers, we perform two\n        // writes: The first write is used to retrieve the next auto-generated Batch\n        // ID, and the second write populates the index and stores the actual\n        // mutation batch.\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\n        // We write an empty object to obtain key\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        return r.add({}).next((o => {\n            q(\"number\" == typeof o);\n            const a = new Ii(o, e, n, s), u = function(t, e, n) {\n                const s = n.baseMutations.map((e => Ts(t.Jt, e))), i = n.mutations.map((e => Ts(t.Jt, e)));\n                return {\n                    userId: e,\n                    batchId: n.batchId,\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\n                    baseMutations: s,\n                    mutations: i\n                };\n            }(this.M, this.userId, a), c = [];\n            let h = new kn(((t, e) => rt(t.canonicalString(), e.canonicalString())));\n            for (const t of s) {\n                const e = Ks(this.userId, t.key.path, o);\n                h = h.add(t.key.path.popLast()), c.push(r.put(u)), c.push(i.put(e, Gs));\n            }\n            return h.forEach((e => {\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\n            })), t.addOnCommittedListener((() => {\n                this.hn[o] = a.keys();\n            })), ui.waitFor(c).next((() => a));\n        }));\n    }\n    lookupMutationBatch(t, e) {\n        return dr(t).get(e).next((t => t ? (q(t.userId === this.userId), Ci(this.M, t)) : null));\n    }\n    /**\n     * Returns the document keys for the mutation batch with the given batchId.\n     * For primary clients, this method returns `null` after\n     * `removeMutationBatches()` has been called. Secondary clients return a\n     * cached result until `removeCachedMutationKeys()` is invoked.\n     */\n    // PORTING NOTE: Multi-tab only.\n    ln(t, e) {\n        return this.hn[e] ? ui.resolve(this.hn[e]) : this.lookupMutationBatch(t, e).next((t => {\n            if (t) {\n                const n = t.keys();\n                return this.hn[e] = n, n;\n            }\n            return null;\n        }));\n    }\n    getNextMutationBatchAfterBatchId(t, e) {\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\n        let i = null;\n        return dr(t).Wt({\n            index: \"userMutationsIndex\",\n            range: s\n        }, ((t, e, s) => {\n            e.userId === this.userId && (q(e.batchId >= n), i = Ci(this.M, e)), s.done();\n        })).next((() => i));\n    }\n    getHighestUnacknowledgedBatchId(t) {\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\n        let n = -1;\n        return dr(t).Wt({\n            index: \"userMutationsIndex\",\n            range: e,\n            reverse: !0\n        }, ((t, e, s) => {\n            n = e.batchId, s.done();\n        })).next((() => n));\n    }\n    getAllMutationBatches(t) {\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\n        return dr(t).Ut(\"userMutationsIndex\", e).next((t => t.map((t => Ci(this.M, t)))));\n    }\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\n        // Scan the document-mutation index starting with a prefix starting with\n        // the given documentKey.\n        const n = Us(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\n        return _r(t).Wt({\n            range: s\n        }, ((n, s, r) => {\n            const [o, a, u] = n, c = Ls(a);\n            // Only consider rows matching exactly the specific key of\n            // interest. Note that because we order by path first, and we\n            // order terminators before path separators, we'll encounter all\n            // the index rows for documentKey contiguously. In particular, all\n            // the rows for documentKey will occur before any rows for\n            // documents nested in a subcollection beneath documentKey so we\n            // can stop as soon as we hit any such row.\n                        if (o === this.userId && e.path.isEqual(c)) \n            // Look up the mutation batch in the store.\n            return dr(t).get(u).next((t => {\n                if (!t) throw L();\n                q(t.userId === this.userId), i.push(Ci(this.M, t));\n            }));\n            r.done();\n        })).next((() => i));\n    }\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\n        let n = new kn(rt);\n        const s = [];\n        return e.forEach((e => {\n            const i = Us(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = _r(t).Wt({\n                range: r\n            }, ((t, s, i) => {\n                const [r, o, a] = t, u = Ls(o);\n                // Only consider rows matching exactly the specific key of\n                // interest. Note that because we order by path first, and we\n                // order terminators before path separators, we'll encounter all\n                // the index rows for documentKey contiguously. In particular, all\n                // the rows for documentKey will occur before any rows for\n                // documents nested in a subcollection beneath documentKey so we\n                // can stop as soon as we hit any such row.\n                                r === this.userId && e.path.isEqual(u) ? n = n.add(a) : i.done();\n            }));\n            s.push(o);\n        })), ui.waitFor(s).next((() => this.fn(t, n)));\n    }\n    getAllMutationBatchesAffectingQuery(t, e) {\n        const n = e.path, s = n.length + 1, i = Us(this.userId, n), r = IDBKeyRange.lowerBound(i);\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\n        // scan of the main table.\n        let o = new kn(rt);\n        return _r(t).Wt({\n            range: r\n        }, ((t, e, i) => {\n            const [r, a, u] = t, c = Ls(a);\n            r === this.userId && n.isPrefixOf(c) ? \n            // Rows with document keys more than one segment longer than the\n            // query path can't be matches. For example, a query on 'rooms'\n            // can't match the document /rooms/abc/messages/xyx.\n            // TODO(mcg): we'll need a different scanner when we implement\n            // ancestor queries.\n            c.length === s && (o = o.add(u)) : i.done();\n        })).next((() => this.fn(t, o)));\n    }\n    fn(t, e) {\n        const n = [], s = [];\n        // TODO(rockwood): Implement this using iterate.\n        return e.forEach((e => {\n            s.push(dr(t).get(e).next((t => {\n                if (null === t) throw L();\n                q(t.userId === this.userId), n.push(Ci(this.M, t));\n            })));\n        })), ui.waitFor(s).next((() => n));\n    }\n    removeMutationBatch(t, e) {\n        return cr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\n            this.dn(e.batchId);\n        })), ui.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\n    }\n    /**\n     * Clears the cached keys for a mutation batch. This method should be\n     * called by secondary clients after they process mutation updates.\n     *\n     * Note that this method does not have to be called from primary clients as\n     * the corresponding cache entries are cleared when an acknowledged or\n     * rejected batch is removed from the mutation queue.\n     */\n    // PORTING NOTE: Multi-tab only\n    dn(t) {\n        delete this.hn[t];\n    }\n    performConsistencyCheck(t) {\n        return this.checkEmpty(t).next((e => {\n            if (!e) return ui.resolve();\n            // Verify that there are no entries in the documentMutations index if\n            // the queue is empty.\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\n            const s = [];\n            return _r(t).Wt({\n                range: n\n            }, ((t, e, n) => {\n                if (t[0] === this.userId) {\n                    const e = Ls(t[1]);\n                    s.push(e);\n                } else n.done();\n            })).next((() => {\n                q(0 === s.length);\n            }));\n        }));\n    }\n    containsKey(t, e) {\n        return fr(t, this.userId, e);\n    }\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\n    /** Returns the mutation queue's metadata from IndexedDb. */\n    _n(t) {\n        return wr(t).get(this.userId).next((t => t || {\n            userId: this.userId,\n            lastAcknowledgedBatchId: -1,\n            lastStreamToken: \"\"\n        }));\n    }\n}\n\n/**\n * @returns true if the mutation queue for the given user contains a pending\n *         mutation for the given key.\n */ function fr(t, e, n) {\n    const s = Us(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\n    let o = !1;\n    return _r(t).Wt({\n        range: r,\n        jt: !0\n    }, ((t, n, s) => {\n        const [r, a, /*batchID*/ u] = t;\n        r === e && a === i && (o = !0), s.done();\n    })).next((() => o));\n}\n\n/** Returns true if any mutation queue contains the given document. */\n/**\n * Helper to get a typed SimpleDbStore for the mutations object store.\n */\nfunction dr(t) {\n    return pi(t, \"mutations\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function _r(t) {\n    return pi(t, \"documentMutations\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */ function wr(t) {\n    return pi(t, \"mutationQueues\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Offset to ensure non-overlapping target ids. */\n/**\n * Generates monotonically increasing target IDs for sending targets to the\n * watch stream.\n *\n * The client constructs two generators, one for the target cache, and one for\n * for the sync engine (to generate limbo documents targets). These\n * generators produce non-overlapping IDs (by using even and odd IDs\n * respectively).\n *\n * By separating the target ID space, the query cache can generate target IDs\n * that persist across client restarts, while sync engine can independently\n * generate in-memory target IDs that are transient and can be reused after a\n * restart.\n */\nclass mr {\n    constructor(t) {\n        this.wn = t;\n    }\n    next() {\n        return this.wn += 2, this.wn;\n    }\n    static mn() {\n        // The target cache generator must return '2' in its first call to `next()`\n        // as there is no differentiation in the protocol layer between an unset\n        // number and the number '0'. If we were to sent a target with target ID\n        // '0', the backend would consider it unset and replace it with its own ID.\n        return new mr(0);\n    }\n    static gn() {\n        // Sync engine assigns target IDs for limbo document detection.\n        return new mr(-1);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class gr {\n    constructor(t, e) {\n        this.referenceDelegate = t, this.M = e;\n    }\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\n    // some of it (in particular `highestTargetId`) can be modified by secondary\n    // tabs. We could perhaps be more granular (and e.g. still cache\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\n    // out to have a meaningful performance impact.\n    allocateTargetId(t) {\n        return this.yn(t).next((e => {\n            const n = new mr(e.highestTargetId);\n            return e.highestTargetId = n.next(), this.pn(t, e).next((() => e.highestTargetId));\n        }));\n    }\n    getLastRemoteSnapshotVersion(t) {\n        return this.yn(t).next((t => ct.fromTimestamp(new ut(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\n    }\n    getHighestSequenceNumber(t) {\n        return this.yn(t).next((t => t.highestListenSequenceNumber));\n    }\n    setTargetsMetadata(t, e, n) {\n        return this.yn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.pn(t, s))));\n    }\n    addTargetData(t, e) {\n        return this.In(t, e).next((() => this.yn(t).next((n => (n.targetCount += 1, this.Tn(e, n), \n        this.pn(t, n))))));\n    }\n    updateTargetData(t, e) {\n        return this.In(t, e);\n    }\n    removeTargetData(t, e) {\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => yr(t).delete(e.targetId))).next((() => this.yn(t))).next((e => (q(e.targetCount > 0), \n        e.targetCount -= 1, this.pn(t, e))));\n    }\n    /**\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\n     * Returns the number of targets removed.\n     */    removeTargets(t, e, n) {\n        let s = 0;\n        const i = [];\n        return yr(t).Wt(((r, o) => {\n            const a = xi(o);\n            a.sequenceNumber <= e && null === n.get(a.targetId) && (s++, i.push(this.removeTargetData(t, a)));\n        })).next((() => ui.waitFor(i))).next((() => s));\n    }\n    /**\n     * Call provided function with each `TargetData` that we have cached.\n     */    forEachTarget(t, e) {\n        return yr(t).Wt(((t, n) => {\n            const s = xi(n);\n            e(s);\n        }));\n    }\n    yn(t) {\n        return pr(t).get(\"targetGlobalKey\").next((t => (q(null !== t), t)));\n    }\n    pn(t, e) {\n        return pr(t).put(\"targetGlobalKey\", e);\n    }\n    In(t, e) {\n        return yr(t).put(Ni(this.M, e));\n    }\n    /**\n     * In-place updates the provided metadata to account for values in the given\n     * TargetData. Saving is done separately. Returns true if there were any\n     * changes to the metadata.\n     */    Tn(t, e) {\n        let n = !1;\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \n        n = !0), n;\n    }\n    getTargetCount(t) {\n        return this.yn(t).next((t => t.targetCount));\n    }\n    getTargetData(t, e) {\n        // Iterating by the canonicalId may yield more than one result because\n        // canonicalId values are not required to be unique per target. This query\n        // depends on the queryTargets index to be efficient.\n        const n = ce(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\n        let i = null;\n        return yr(t).Wt({\n            range: s,\n            index: \"queryTargetsIndex\"\n        }, ((t, n, s) => {\n            const r = xi(n);\n            // After finding a potential match, check that the target is\n            // actually equal to the requested target.\n                        le(e, r.target) && (i = r, s.done());\n        })).next((() => i));\n    }\n    addMatchingKeys(t, e, n) {\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n        // IndexedDb.\n        const s = [], i = Ir(t);\n        return e.forEach((e => {\n            const r = $s(e.path);\n            s.push(i.put({\n                targetId: n,\n                path: r\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\n        })), ui.waitFor(s);\n    }\n    removeMatchingKeys(t, e, n) {\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n        // IndexedDb.\n        const s = Ir(t);\n        return ui.forEach(e, (e => {\n            const i = $s(e.path);\n            return ui.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\n        }));\n    }\n    removeMatchingKeysForTargetId(t, e) {\n        const n = Ir(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0);\n        return n.delete(s);\n    }\n    getMatchingKeysForTargetId(t, e) {\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0), s = Ir(t);\n        let i = Gn();\n        return s.Wt({\n            range: n,\n            jt: !0\n        }, ((t, e, n) => {\n            const s = Ls(t[1]), r = new xt(s);\n            i = i.add(r);\n        })).next((() => i));\n    }\n    containsKey(t, e) {\n        const n = $s(e.path), s = IDBKeyRange.bound([ n ], [ at(n) ], \n        /*lowerOpen=*/ !1, \n        /*upperOpen=*/ !0);\n        let i = 0;\n        return Ir(t).Wt({\n            index: \"documentTargetsIndex\",\n            jt: !0,\n            range: s\n        }, (([t, e], n, s) => {\n            // Having a sentinel row for a document does not count as containing that document;\n            // For the target cache, containing the document means the document is part of some\n            // target.\n            0 !== t && (i++, s.done());\n        })).next((() => i > 0));\n    }\n    /**\n     * Looks up a TargetData entry by target ID.\n     *\n     * @param targetId - The target ID of the TargetData entry to look up.\n     * @returns The cached TargetData entry, or null if the cache has no entry for\n     * the target.\n     */\n    // PORTING NOTE: Multi-tab only.\n    Et(t, e) {\n        return yr(t).get(e).next((t => t ? xi(t) : null));\n    }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the queries object store.\n */ function yr(t) {\n    return pi(t, \"targets\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the target globals object store.\n */ function pr(t) {\n    return pi(t, \"targetGlobal\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document target object store.\n */ function Ir(t) {\n    return pi(t, \"targetDocuments\");\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\n * operation fails because the primary lease has been taken by another client,\n * we ignore the error (the persistence layer will immediately call\n * `applyPrimaryLease` to propagate the primary state change). All other errors\n * are re-thrown.\n *\n * @param err - An error returned by a LocalStore operation.\n * @returns A Promise that resolves after we recovered, or the original error.\n */ async function Tr(t) {\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== oi) throw t;\n    O(\"LocalStore\", \"Unexpectedly lost primary lease\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function Er([t, e], [n, s]) {\n    const i = rt(t, n);\n    return 0 === i ? rt(e, s) : i;\n}\n\n/**\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\n * lowest n values passed to `addElement`, and finally reports the largest of\n * them in `maxValue`.\n */ class Ar {\n    constructor(t) {\n        this.En = t, this.buffer = new kn(Er), this.An = 0;\n    }\n    Rn() {\n        return ++this.An;\n    }\n    bn(t) {\n        const e = [ t, this.Rn() ];\n        if (this.buffer.size < this.En) this.buffer = this.buffer.add(e); else {\n            const t = this.buffer.last();\n            Er(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\n        }\n    }\n    get maxValue() {\n        // Guaranteed to be non-empty. If we decide we are not collecting any\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\n        // decided that we are collecting n sequence numbers, it's because n is some\n        // percentage of the existing sequence numbers. That means we should never\n        // be in a situation where we are collecting sequence numbers but don't\n        // actually have any.\n        return this.buffer.last()[0];\n    }\n}\n\n/**\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\n * whether or not GC is enabled, as well as which delay to use before the next run.\n */ class Rr {\n    constructor(t, e) {\n        this.garbageCollector = t, this.asyncQueue = e, this.Pn = !1, this.Vn = null;\n    }\n    start(t) {\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.vn(t);\n    }\n    stop() {\n        this.Vn && (this.Vn.cancel(), this.Vn = null);\n    }\n    get started() {\n        return null !== this.Vn;\n    }\n    vn(t) {\n        const e = this.Pn ? 3e5 : 6e4;\n        O(\"LruGarbageCollector\", `Garbage collection scheduled in ${e}ms`), this.Vn = this.asyncQueue.enqueueAfterDelay(\"lru_garbage_collection\" /* LruGarbageCollection */ , e, (async () => {\n            this.Vn = null, this.Pn = !0;\n            try {\n                await t.collectGarbage(this.garbageCollector);\n            } catch (t) {\n                di(t) ? O(\"LruGarbageCollector\", \"Ignoring IndexedDB error during garbage collection: \", t) : await Tr(t);\n            }\n            await this.vn(t);\n        }));\n    }\n}\n\n/** Implements the steps for LRU garbage collection. */ class br {\n    constructor(t, e) {\n        this.Sn = t, this.params = e;\n    }\n    calculateTargetCount(t, e) {\n        return this.Sn.Dn(t).next((t => Math.floor(e / 100 * t)));\n    }\n    nthSequenceNumber(t, e) {\n        if (0 === e) return ui.resolve(nt.A);\n        const n = new Ar(e);\n        return this.Sn.forEachTarget(t, (t => n.bn(t.sequenceNumber))).next((() => this.Sn.Cn(t, (t => n.bn(t))))).next((() => n.maxValue));\n    }\n    removeTargets(t, e, n) {\n        return this.Sn.removeTargets(t, e, n);\n    }\n    removeOrphanedDocuments(t, e) {\n        return this.Sn.removeOrphanedDocuments(t, e);\n    }\n    collect(t, e) {\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\"LruGarbageCollector\", \"Garbage collection skipped; disabled\"), \n        ui.resolve(ar)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\"LruGarbageCollector\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \n        ar) : this.xn(t, e)));\n    }\n    getCacheSize(t) {\n        return this.Sn.getCacheSize(t);\n    }\n    xn(t, e) {\n        let n, s, i, r, o, u, c;\n        const h = Date.now();\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\n        // Cap at the configured max\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\"LruGarbageCollector\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, u = Date.now(), \n        this.removeOrphanedDocuments(t, n)))).next((t => {\n            if (c = Date.now(), k() <= a.DEBUG) {\n                O(\"LruGarbageCollector\", `LRU Garbage Collection\\n\\tCounted targets in ${r - h}ms\\n\\tDetermined least recently used ${s} in ` + (o - r) + \"ms\\n\" + `\\tRemoved ${i} targets in ` + (u - o) + \"ms\\n\" + `\\tRemoved ${t} documents in ` + (c - u) + \"ms\\n\" + `Total Duration: ${c - h}ms`);\n            }\n            return ui.resolve({\n                didRun: !0,\n                sequenceNumbersCollected: s,\n                targetsRemoved: i,\n                documentsRemoved: t\n            });\n        }));\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Provides LRU functionality for IndexedDB persistence. */\nclass Pr {\n    constructor(t, e) {\n        this.db = t, this.garbageCollector = function(t, e) {\n            return new br(t, e);\n        }(this, e);\n    }\n    Dn(t) {\n        const e = this.Nn(t);\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\n    }\n    Nn(t) {\n        let e = 0;\n        return this.Cn(t, (t => {\n            e++;\n        })).next((() => e));\n    }\n    forEachTarget(t, e) {\n        return this.db.getTargetCache().forEachTarget(t, e);\n    }\n    Cn(t, e) {\n        return this.kn(t, ((t, n) => e(n)));\n    }\n    addReference(t, e, n) {\n        return Vr(t, n);\n    }\n    removeReference(t, e, n) {\n        return Vr(t, n);\n    }\n    removeTargets(t, e, n) {\n        return this.db.getTargetCache().removeTargets(t, e, n);\n    }\n    markPotentiallyOrphaned(t, e) {\n        return Vr(t, e);\n    }\n    /**\n     * Returns true if anything would prevent this document from being garbage\n     * collected, given that the document in question is not present in any\n     * targets and has a sequence number less than or equal to the upper bound for\n     * the collection run.\n     */    Mn(t, e) {\n        return function(t, e) {\n            let n = !1;\n            return wr(t).zt((s => fr(t, s, e).next((t => (t && (n = !0), ui.resolve(!t)))))).next((() => n));\n        }(t, e);\n    }\n    removeOrphanedDocuments(t, e) {\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\n        let i = 0;\n        return this.kn(t, ((r, o) => {\n            if (o <= e) {\n                const e = this.Mn(t, r).next((e => {\n                    if (!e) \n                    // Our size accounting requires us to read all documents before\n                    // removing them.\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Ir(t).delete([ 0, $s(r.path) ]))));\n                }));\n                s.push(e);\n            }\n        })).next((() => ui.waitFor(s))).next((() => n.apply(t))).next((() => i));\n    }\n    removeTarget(t, e) {\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\n        return this.db.getTargetCache().updateTargetData(t, n);\n    }\n    updateLimboDocument(t, e) {\n        return Vr(t, e);\n    }\n    /**\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\n     * means not a part of any target, so the only entry in the target-document index for\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\n     * number for the last time the document was accessed.\n     */    kn(t, e) {\n        const n = Ir(t);\n        let s, i = nt.A;\n        return n.Wt({\n            index: \"documentTargetsIndex\"\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\n            0 === t ? (\n            // if nextToReport is valid, report it, this is a new key so the\n            // last one must not be a member of any targets.\n            i !== nt.A && e(new xt(Ls(s)), i), \n            // set nextToReport to be this sequence number. It's the next one we\n            // might report, if we don't find any targets for this document.\n            // Note that the sequence number must be defined when the targetId\n            // is 0.\n            i = o, s = r) : \n            // set nextToReport to be invalid, we know we don't need to report\n            // this one since we found a target for it.\n            i = nt.A;\n        })).next((() => {\n            // Since we report sequence numbers after getting to the next key, we\n            // need to check if the last key we iterated over was an orphaned\n            // document and report it.\n            i !== nt.A && e(new xt(Ls(s)), i);\n        }));\n    }\n    getCacheSize(t) {\n        return this.db.getRemoteDocumentCache().getSize(t);\n    }\n}\n\nfunction Vr(t, e) {\n    return Ir(t).put(\n    /**\n * @returns A value suitable for writing a sentinel row in the target-document\n * store.\n */\n    function(t, e) {\n        return {\n            targetId: 0,\n            path: $s(t.path),\n            sequenceNumber: e\n        };\n    }(e, t.currentSequenceNumber));\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\n * It can be used to batch up a set of changes to be written to the cache, but\n * additionally supports reading entries back with the `getEntry()` method,\n * falling back to the underlying RemoteDocumentCache if no entry is\n * buffered.\n *\n * Entries added to the cache *must* be read first. This is to facilitate\n * calculating the size delta of the pending changes.\n *\n * PORTING NOTE: This class was implemented then removed from other platforms.\n * If byte-counting ends up being needed on the other platforms, consider\n * porting this class as part of that implementation work.\n */ class vr {\n    constructor() {\n        // A mapping of document key to the new cache entry that should be written.\n        this.changes = new Dn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\n    }\n    /**\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\n     *\n     * You can only modify documents that have already been retrieved via\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n     */    addEntry(t) {\n        this.assertNotApplied(), this.changes.set(t.key, t);\n    }\n    /**\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\n     *\n     * You can only remove documents that have already been retrieved via\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n     */    removeEntry(t, e) {\n        this.assertNotApplied(), this.changes.set(t, te.newInvalidDocument(t).setReadTime(e));\n    }\n    /**\n     * Looks up an entry in the cache. The buffered changes will first be checked,\n     * and if no buffered change applies, this will forward to\n     * `RemoteDocumentCache.getEntry()`.\n     *\n     * @param transaction - The transaction in which to perform any persistence\n     *     operations.\n     * @param documentKey - The key of the entry to look up.\n     * @returns The cached document or an invalid document if we have nothing\n     * cached.\n     */    getEntry(t, e) {\n        this.assertNotApplied();\n        const n = this.changes.get(e);\n        return void 0 !== n ? ui.resolve(n) : this.getFromCache(t, e);\n    }\n    /**\n     * Looks up several entries in the cache, forwarding to\n     * `RemoteDocumentCache.getEntry()`.\n     *\n     * @param transaction - The transaction in which to perform any persistence\n     *     operations.\n     * @param documentKeys - The keys of the entries to look up.\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\n     *     found, the corresponding key will be mapped to an invalid document.\n     */    getEntries(t, e) {\n        return this.getAllFromCache(t, e);\n    }\n    /**\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\n     * the provided transaction.\n     */    apply(t) {\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\n    }\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newIndexedDbRemoteDocumentCache()`.\n */ class Sr {\n    constructor(t) {\n        this.M = t;\n    }\n    setIndexManager(t) {\n        this.indexManager = t;\n    }\n    /**\n     * Adds the supplied entries to the cache.\n     *\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n     */    addEntry(t, e, n) {\n        return xr(t).put(Nr(e), n);\n    }\n    /**\n     * Removes a document from the cache.\n     *\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n     */    removeEntry(t, e) {\n        const n = xr(t), s = Nr(e);\n        return n.delete(s);\n    }\n    /**\n     * Updates the current cache size.\n     *\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\n     * cache's metadata.\n     */    updateMetadata(t, e) {\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.On(t, n))));\n    }\n    getEntry(t, e) {\n        return xr(t).get(Nr(e)).next((t => this.$n(e, t)));\n    }\n    /**\n     * Looks up an entry in the cache.\n     *\n     * @param documentKey - The key of the entry to look up.\n     * @returns The cached document entry and its size.\n     */    Fn(t, e) {\n        return xr(t).get(Nr(e)).next((t => ({\n            document: this.$n(e, t),\n            size: hr(t)\n        })));\n    }\n    getEntries(t, e) {\n        let n = Fn();\n        return this.Bn(t, e, ((t, e) => {\n            const s = this.$n(t, e);\n            n = n.insert(t, s);\n        })).next((() => n));\n    }\n    /**\n     * Looks up several entries in the cache.\n     *\n     * @param documentKeys - The set of keys entries to look up.\n     * @returns A map of documents indexed by key and a map of sizes indexed by\n     *     key (zero if the document does not exist).\n     */    Ln(t, e) {\n        let n = Fn(), s = new Cn(xt.comparator);\n        return this.Bn(t, e, ((t, e) => {\n            const i = this.$n(t, e);\n            n = n.insert(t, i), s = s.insert(t, hr(e));\n        })).next((() => ({\n            documents: n,\n            qn: s\n        })));\n    }\n    Bn(t, e, n) {\n        if (e.isEmpty()) return ui.resolve();\n        const s = IDBKeyRange.bound(e.first().path.toArray(), e.last().path.toArray()), i = e.getIterator();\n        let r = i.getNext();\n        return xr(t).Wt({\n            range: s\n        }, ((t, e, s) => {\n            const o = xt.fromSegments(t);\n            // Go through keys not found in cache.\n                        for (;r && xt.comparator(r, o) < 0; ) n(r, null), r = i.getNext();\n            r && r.isEqual(o) && (\n            // Key found in cache.\n            n(r, e), r = i.hasNext() ? i.getNext() : null), \n            // Skip to the next key (if there is one).\n            r ? s.qt(r.path.toArray()) : s.done();\n        })).next((() => {\n            // The rest of the keys are not in the cache. One case where `iterate`\n            // above won't go through them is when the cache is empty.\n            for (;r; ) n(r, null), r = i.hasNext() ? i.getNext() : null;\n        }));\n    }\n    getAll(t, e, n) {\n        let s = Fn();\n        const i = e.length + 1, r = {};\n        if (n.isEqual(ct.min())) {\n            // Documents are ordered by key, so we can use a prefix scan to narrow\n            // down the documents we need to match the query against.\n            const t = e.toArray();\n            r.range = IDBKeyRange.lowerBound(t);\n        } else {\n            // Execute an index-free query and filter by read time. This is safe\n            // since all document changes to queries that have a\n            // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.\n            const t = e.toArray(), s = Vi(n);\n            r.range = IDBKeyRange.lowerBound([ t, s ], \n            /* open= */ !0), r.index = \"collectionReadTimeIndex\";\n        }\n        return xr(t).Wt(r, ((t, n, r) => {\n            // The query is actually returning any path that starts with the query\n            // path prefix which may include documents in subcollections. For\n            // example, a query on 'rooms' will return rooms/abc/messages/xyx but we\n            // shouldn't match it. Fix this by discarding rows with document keys\n            // more than one segment longer than the query path.\n            if (t.length !== i) return;\n            const o = this.$n(xt.fromSegments(t), n);\n            e.isPrefixOf(o.key.path) ? s = s.insert(o.key, o) : r.done();\n        })).next((() => s));\n    }\n    newChangeBuffer(t) {\n        return new Dr(this, !!t && t.trackRemovals);\n    }\n    getSize(t) {\n        return this.getMetadata(t).next((t => t.byteSize));\n    }\n    getMetadata(t) {\n        return Cr(t).get(\"remoteDocumentGlobalKey\").next((t => (q(!!t), t)));\n    }\n    On(t, e) {\n        return Cr(t).put(\"remoteDocumentGlobalKey\", e);\n    }\n    /**\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\n     * the document corresponds to the format used for sentinel deletes).\n     */    $n(t, e) {\n        if (e) {\n            const t = bi(this.M, e);\n            // Whether the document is a sentinel removal and should only be used in the\n            // `getNewDocumentChanges()`\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\n        }\n        return te.newInvalidDocument(t);\n    }\n}\n\n/** Creates a new IndexedDbRemoteDocumentCache. */\n/**\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\n *\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\n * when we apply the changes.\n */\nclass Dr extends vr {\n    /**\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\n     * `getNewDocumentChanges()`.\n     */\n    constructor(t, e) {\n        super(), this.Un = t, this.trackRemovals = e, \n        // A map of document sizes prior to applying the changes in this buffer.\n        this.Kn = new Dn((t => t.toString()), ((t, e) => t.isEqual(e)));\n    }\n    applyChanges(t) {\n        const e = [];\n        let n = 0, s = new kn(((t, e) => rt(t.canonicalString(), e.canonicalString())));\n        return this.changes.forEach(((i, r) => {\n            const o = this.Kn.get(i);\n            if (r.isValidDocument()) {\n                const a = Pi(this.Un.M, r);\n                s = s.add(i.path.popLast());\n                const u = hr(a);\n                n += u - o, e.push(this.Un.addEntry(t, i, a));\n            } else if (n -= o, this.trackRemovals) {\n                // In order to track removals, we store a \"sentinel delete\" in the\n                // RemoteDocumentCache. This entry is represented by a NoDocument\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\n                // preserved in `getNewDocumentChanges()`.\n                const n = Pi(this.Un.M, r.convertToNoDocument(ct.min()));\n                e.push(this.Un.addEntry(t, i, n));\n            } else e.push(this.Un.removeEntry(t, i));\n        })), s.forEach((n => {\n            e.push(this.Un.indexManager.addToCollectionParentIndex(t, n));\n        })), e.push(this.Un.updateMetadata(t, n)), ui.waitFor(e);\n    }\n    getFromCache(t, e) {\n        // Record the size of everything we load from the cache so we can compute a delta later.\n        return this.Un.Fn(t, e).next((t => (this.Kn.set(e, t.size), t.document)));\n    }\n    getAllFromCache(t, e) {\n        // Record the size of everything we load from the cache so we can compute\n        // a delta later.\n        return this.Un.Ln(t, e).next((({documents: t, qn: e}) => (\n        // Note: `getAllFromCache` returns two maps instead of a single map from\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\n        // `MutableDocumentMap` directly, without a conversion.\n        e.forEach(((t, e) => {\n            this.Kn.set(t, e);\n        })), t)));\n    }\n}\n\nfunction Cr(t) {\n    return pi(t, \"remoteDocumentGlobal\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\n */ function xr(t) {\n    return pi(t, \"remoteDocuments\");\n}\n\nfunction Nr(t) {\n    return t.path.toArray();\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(indexing): Remove this constant\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Performs database creation and schema upgrades. */\nclass kr {\n    constructor(t) {\n        this.M = t;\n    }\n    /**\n     * Performs database creation and schema upgrades.\n     *\n     * Note that in production, this method is only ever used to upgrade the schema\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\n     * and local feature development.\n     */    kt(t, e, n, s) {\n        const i = new ci(\"createOrUpgrade\", e);\n        n < 1 && s >= 1 && (function(t) {\n            t.createObjectStore(\"owner\");\n        }(t), function(t) {\n            t.createObjectStore(\"mutationQueues\", {\n                keyPath: \"userId\"\n            });\n            t.createObjectStore(\"mutations\", {\n                keyPath: \"batchId\",\n                autoIncrement: !0\n            }).createIndex(\"userMutationsIndex\", qs, {\n                unique: !0\n            }), t.createObjectStore(\"documentMutations\");\n        }\n        /**\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\n * and rewrites all data.\n */ (t), Mr(t), function(t) {\n            t.createObjectStore(\"remoteDocuments\");\n        }(t));\n        // Migration 2 to populate the targetGlobal object no longer needed since\n        // migration 3 unconditionally clears it.\n                let r = ui.resolve();\n        return n < 3 && s >= 3 && (\n        // Brand new clients don't need to drop and recreate--only clients that\n        // potentially have corrupt data.\n        0 !== n && (!function(t) {\n            t.deleteObjectStore(\"targetDocuments\"), t.deleteObjectStore(\"targets\"), t.deleteObjectStore(\"targetGlobal\");\n        }(t), Mr(t)), r = r.next((() => \n        /**\n * Creates the target global singleton row.\n *\n * @param txn - The version upgrade transaction for indexeddb\n */\n        function(t) {\n            const e = t.store(\"targetGlobal\"), n = {\n                highestTargetId: 0,\n                highestListenSequenceNumber: 0,\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\n                targetCount: 0\n            };\n            return e.put(\"targetGlobalKey\", n);\n        }\n        /**\n * Creates indices on the RemoteDocuments store used for both multi-tab\n * and Index-Free queries.\n */ (i)))), n < 4 && s >= 4 && (0 !== n && (\n        // Schema version 3 uses auto-generated keys to generate globally unique\n        // mutation batch IDs (this was previously ensured internally by the\n        // client). To migrate to the new schema, we have to read all mutations\n        // and write them back out. We preserve the existing batch IDs to guarantee\n        // consistency with other object stores. Any further mutation batch IDs will\n        // be auto-generated.\n        r = r.next((() => function(t, e) {\n            return e.store(\"mutations\").Ut().next((n => {\n                t.deleteObjectStore(\"mutations\");\n                t.createObjectStore(\"mutations\", {\n                    keyPath: \"batchId\",\n                    autoIncrement: !0\n                }).createIndex(\"userMutationsIndex\", qs, {\n                    unique: !0\n                });\n                const s = e.store(\"mutations\"), i = n.map((t => s.put(t)));\n                return ui.waitFor(i);\n            }));\n        }(t, i)))), r = r.next((() => {\n            !function(t) {\n                t.createObjectStore(\"clientMetadata\", {\n                    keyPath: \"clientId\"\n                });\n            }(t);\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Gn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\n            t.createObjectStore(\"remoteDocumentGlobal\");\n        }(t), this.Qn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.jn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.Wn(t, i)))), \n        n < 9 && s >= 9 && (r = r.next((() => {\n            // Multi-Tab used to manage its own changelog, but this has been moved\n            // to the DbRemoteDocument object store itself. Since the previous change\n            // log only contained transient data, we can drop its object store.\n            !function(t) {\n                t.objectStoreNames.contains(\"remoteDocumentChanges\") && t.deleteObjectStore(\"remoteDocumentChanges\");\n            }(t), function(t) {\n                const e = t.objectStore(\"remoteDocuments\");\n                e.createIndex(\"readTimeIndex\", \"readTime\", {\n                    unique: !1\n                }), e.createIndex(\"collectionReadTimeIndex\", Qs, {\n                    unique: !1\n                });\n            }(e);\n        }))), n < 10 && s >= 10 && (r = r.next((() => this.zn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\n            !function(t) {\n                t.createObjectStore(\"bundles\", {\n                    keyPath: \"bundleId\"\n                });\n            }(t), function(t) {\n                t.createObjectStore(\"namedQueries\", {\n                    keyPath: \"name\"\n                });\n            }(t);\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\n            !function(t) {\n                const e = t.createObjectStore(\"documentOverlays\", {\n                    keyPath: ti\n                });\n                e.createIndex(\"collectionPathOverlayIndex\", ei, {\n                    unique: !1\n                }), e.createIndex(\"collectionGroupOverlayIndex\", ni, {\n                    unique: !1\n                });\n            }\n            /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t);\n        }))), n < 13 && s >= 13 && (r = r.next((() => {\n            !function(t) {\n                t.createObjectStore(\"indexConfiguration\", {\n                    keyPath: \"indexId\",\n                    autoIncrement: !0\n                }).createIndex(\"collectionGroupIndex\", \"collectionGroup\", {\n                    unique: !1\n                });\n                t.createObjectStore(\"indexState\", {\n                    keyPath: Js\n                }).createIndex(\"sequenceNumberIndex\", Ys, {\n                    unique: !1\n                });\n                t.createObjectStore(\"indexEntries\", {\n                    keyPath: Xs\n                }).createIndex(\"documentKeyIndex\", Zs, {\n                    unique: !1\n                });\n            }(t);\n        }))), r;\n    }\n    Qn(t) {\n        let e = 0;\n        return t.store(\"remoteDocuments\").Wt(((t, n) => {\n            e += hr(n);\n        })).next((() => {\n            const n = {\n                byteSize: e\n            };\n            return t.store(\"remoteDocumentGlobal\").put(\"remoteDocumentGlobalKey\", n);\n        }));\n    }\n    Gn(t) {\n        const e = t.store(\"mutationQueues\"), n = t.store(\"mutations\");\n        return e.Ut().next((e => ui.forEach(e, (e => {\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\n            return n.Ut(\"userMutationsIndex\", s).next((n => ui.forEach(n, (n => {\n                q(n.userId === e.userId);\n                const s = Ci(this.M, n);\n                return cr(t, e.userId, s).next((() => {}));\n            }))));\n        }))));\n    }\n    /**\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\n     * with a sequence number. Missing rows are given the most recently used sequence number.\n     */    jn(t) {\n        const e = t.store(\"targetDocuments\"), n = t.store(\"remoteDocuments\");\n        return t.store(\"targetGlobal\").get(\"targetGlobalKey\").next((t => {\n            const s = [];\n            return n.Wt(((n, i) => {\n                const r = new _t(n), o = function(t) {\n                    return [ 0, $s(t) ];\n                }(r);\n                s.push(e.get(o).next((n => n ? ui.resolve() : (n => e.put({\n                    targetId: 0,\n                    path: $s(n),\n                    sequenceNumber: t.highestListenSequenceNumber\n                }))(r))));\n            })).next((() => ui.waitFor(s)));\n        }));\n    }\n    Wn(t, e) {\n        // Create the index.\n        t.createObjectStore(\"collectionParents\", {\n            keyPath: Hs\n        });\n        const n = e.store(\"collectionParents\"), s = new tr, i = t => {\n            if (s.add(t)) {\n                const e = t.lastSegment(), s = t.popLast();\n                return n.put({\n                    collectionId: e,\n                    parent: $s(s)\n                });\n            }\n        };\n        // Helper to add an index entry iff we haven't already written it.\n                // Index existing remote documents.\n        return e.store(\"remoteDocuments\").Wt({\n            jt: !0\n        }, ((t, e) => {\n            const n = new _t(t);\n            return i(n.popLast());\n        })).next((() => e.store(\"documentMutations\").Wt({\n            jt: !0\n        }, (([t, e, n], s) => {\n            const r = Ls(e);\n            return i(r.popLast());\n        }))));\n    }\n    zn(t) {\n        const e = t.store(\"targets\");\n        return e.Wt(((t, n) => {\n            const s = xi(n), i = Ni(this.M, s);\n            return e.put(i);\n        }));\n    }\n}\n\nfunction Mr(t) {\n    t.createObjectStore(\"targetDocuments\", {\n        keyPath: Ws\n    }).createIndex(\"documentTargetsIndex\", zs, {\n        unique: !0\n    });\n    // NOTE: This is unique only because the TargetId is the suffix.\n    t.createObjectStore(\"targets\", {\n        keyPath: \"targetId\"\n    }).createIndex(\"queryTargetsIndex\", js, {\n        unique: !0\n    }), t.createObjectStore(\"targetGlobal\");\n}\n\nconst Or = \"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\";\n\n/**\n * Oldest acceptable age in milliseconds for client metadata before the client\n * is considered inactive and its associated data is garbage collected.\n */\n/**\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\n * across sessions.\n *\n * On Web only, the Firestore SDKs support shared access to its persistence\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\n * to synchronize state even without network connectivity. Shared access is\n * currently optional and not enabled unless all clients invoke\n * `enablePersistence()` with `{synchronizeTabs:true}`.\n *\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\n * will designate one client as the \u201Cprimary client\u201D. An effort is made to pick\n * a visible, network-connected and active client, and this client is\n * responsible for letting other clients know about its presence. The primary\n * client writes a unique client-generated identifier (the client ID) to\n * IndexedDb\u2019s \u201Cowner\u201D store every 4 seconds. If the primary client fails to\n * update this entry, another client can acquire the lease and take over as\n * primary.\n *\n * Some persistence operations in the SDK are designated as primary-client only\n * operations. This includes the acknowledgment of mutations and all updates of\n * remote documents. The effects of these operations are written to persistence\n * and then broadcast to other tabs via LocalStorage (see\n * `WebStorageSharedClientState`), which then refresh their state from\n * persistence.\n *\n * Similarly, the primary client listens to notifications sent by secondary\n * clients to discover persistence changes written by secondary clients, such as\n * the addition of new mutations and query targets.\n *\n * If multi-tab is not enabled and another tab already obtained the primary\n * lease, IndexedDbPersistence enters a failed state and all subsequent\n * operations will automatically fail.\n *\n * Additionally, there is an optimization so that when a tab is closed, the\n * primary lease is released immediately (this is especially important to make\n * sure that a refreshed tab is able to immediately re-acquire the primary\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\n * since it is an asynchronous API. So in addition to attempting to give up the\n * lease, the leaseholder writes its client ID to a \"zombiedClient\" entry in\n * LocalStorage which acts as an indicator that another tab should go ahead and\n * take the primary lease immediately regardless of the current lease timestamp.\n *\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\n * longer optional.\n */\nclass $r {\n    constructor(\n    /**\n     * Whether to synchronize the in-memory state of multiple tabs and share\n     * access to local persistence.\n     */\n    t, e, n, s, i, r, o, a, u, \n    /**\n     * If set to true, forcefully obtains database access. Existing tabs will\n     * no longer be able to access IndexedDB.\n     */\n    c, h = 12) {\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \n        this.Hn = i, this.window = r, this.document = o, this.Jn = u, this.Yn = c, this.Xn = h, \n        this.Zn = null, this.ts = !1, this.isPrimary = !1, this.networkEnabled = !0, \n        /** Our window.unload handler, if registered. */\n        this.es = null, this.inForeground = !1, \n        /** Our 'visibilitychange' listener if registered. */\n        this.ns = null, \n        /** The client metadata refresh task. */\n        this.ss = null, \n        /** The last time we garbage collected the client metadata object store. */\n        this.rs = Number.NEGATIVE_INFINITY, \n        /** A listener to notify on primary state changes. */\n        this.os = t => Promise.resolve(), !$r.vt()) throw new Q(G.UNIMPLEMENTED, \"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\");\n        this.referenceDelegate = new Pr(this, s), this.us = e + \"main\", this.M = new Ri(a), \n        this.cs = new hi(this.us, this.Xn, new kr(this.M)), this.hs = new gr(this.referenceDelegate, this.M), \n        this.ls = function(t) {\n            return new Sr(t);\n        }\n        /**\n * Returns the set of documents that have changed since the specified read\n * time.\n */\n        // PORTING NOTE: This is only used for multi-tab synchronization.\n        (this.M), this.fs = new $i, this.window && this.window.localStorage ? this.ds = this.window.localStorage : (this.ds = null, \n        !1 === c && $(\"IndexedDbPersistence\", \"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\"));\n    }\n    /**\n     * Attempt to start IndexedDb persistence.\n     *\n     * @returns Whether persistence was enabled.\n     */    start() {\n        // NOTE: This is expected to fail sometimes (in the case of another tab\n        // already having the persistence lock), so it's the first thing we should\n        // do.\n        return this._s().then((() => {\n            if (!this.isPrimary && !this.allowTabSynchronization) \n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\n            // obtain the primary lease.\n            throw new Q(G.FAILED_PRECONDITION, Or);\n            return this.ws(), this.gs(), this.ys(), this.runTransaction(\"getHighestListenSequenceNumber\", \"readonly\", (t => this.hs.getHighestSequenceNumber(t)));\n        })).then((t => {\n            this.Zn = new nt(t, this.Jn);\n        })).then((() => {\n            this.ts = !0;\n        })).catch((t => (this.cs && this.cs.close(), Promise.reject(t))));\n    }\n    /**\n     * Registers a listener that gets called when the primary state of the\n     * instance changes. Upon registering, this listener is invoked immediately\n     * with the current primary state.\n     *\n     * PORTING NOTE: This is only used for Web multi-tab.\n     */    ps(t) {\n        return this.os = async e => {\n            if (this.started) return t(e);\n        }, t(this.isPrimary);\n    }\n    /**\n     * Registers a listener that gets called when the database receives a\n     * version change event indicating that it has deleted.\n     *\n     * PORTING NOTE: This is only used for Web multi-tab.\n     */    setDatabaseDeletedListener(t) {\n        this.cs.Ot((async e => {\n            // Check if an attempt is made to delete IndexedDB.\n            null === e.newVersion && await t();\n        }));\n    }\n    /**\n     * Adjusts the current network state in the client's metadata, potentially\n     * affecting the primary lease.\n     *\n     * PORTING NOTE: This is only used for Web multi-tab.\n     */    setNetworkEnabled(t) {\n        this.networkEnabled !== t && (this.networkEnabled = t, \n        // Schedule a primary lease refresh for immediate execution. The eventual\n        // lease update will be propagated via `primaryStateListener`.\n        this.Hn.enqueueAndForget((async () => {\n            this.started && await this._s();\n        })));\n    }\n    /**\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\n     * extend the primary lease for the local client. Asynchronously notifies the\n     * primary state listener if the client either newly obtained or released its\n     * primary lease.\n     */    _s() {\n        return this.runTransaction(\"updateClientMetadataAndTryBecomePrimary\", \"readwrite\", (t => Br(t).put({\n            clientId: this.clientId,\n            updateTimeMs: Date.now(),\n            networkEnabled: this.networkEnabled,\n            inForeground: this.inForeground\n        }).next((() => {\n            if (this.isPrimary) return this.Is(t).next((t => {\n                t || (this.isPrimary = !1, this.Hn.enqueueRetryable((() => this.os(!1))));\n            }));\n        })).next((() => this.Ts(t))).next((e => this.isPrimary && !e ? this.Es(t).next((() => !1)) : !!e && this.As(t).next((() => !0)))))).catch((t => {\n            if (di(t)) \n            // Proceed with the existing state. Any subsequent access to\n            // IndexedDB will verify the lease.\n            return O(\"IndexedDbPersistence\", \"Failed to extend owner lease: \", t), this.isPrimary;\n            if (!this.allowTabSynchronization) throw t;\n            return O(\"IndexedDbPersistence\", \"Releasing owner lease after error during lease refresh\", t), \n            /* isPrimary= */ !1;\n        })).then((t => {\n            this.isPrimary !== t && this.Hn.enqueueRetryable((() => this.os(t))), this.isPrimary = t;\n        }));\n    }\n    Is(t) {\n        return Fr(t).get(\"owner\").next((t => ui.resolve(this.Rs(t))));\n    }\n    bs(t) {\n        return Br(t).delete(this.clientId);\n    }\n    /**\n     * If the garbage collection threshold has passed, prunes the\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\n     * time of all clients.\n     */    async Ps() {\n        if (this.isPrimary && !this.Vs(this.rs, 18e5)) {\n            this.rs = Date.now();\n            const t = await this.runTransaction(\"maybeGarbageCollectMultiClientState\", \"readwrite-primary\", (t => {\n                const e = pi(t, \"clientMetadata\");\n                return e.Ut().next((t => {\n                    const n = this.vs(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\n                    // Delete metadata for clients that are no longer considered active.\n                    return ui.forEach(s, (t => e.delete(t.clientId))).next((() => s));\n                }));\n            })).catch((() => []));\n            // Delete potential leftover entries that may continue to mark the\n            // inactive clients as zombied in LocalStorage.\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\n            // entries first to avoid potentially reviving a zombied client.\n                        if (this.ds) for (const e of t) this.ds.removeItem(this.Ss(e.clientId));\n        }\n    }\n    /**\n     * Schedules a recurring timer to update the client metadata and to either\n     * extend or acquire the primary lease if the client is eligible.\n     */    ys() {\n        this.ss = this.Hn.enqueueAfterDelay(\"client_metadata_refresh\" /* ClientMetadataRefresh */ , 4e3, (() => this._s().then((() => this.Ps())).then((() => this.ys()))));\n    }\n    /** Checks whether `client` is the local client. */    Rs(t) {\n        return !!t && t.ownerId === this.clientId;\n    }\n    /**\n     * Evaluate the state of all active clients and determine whether the local\n     * client is or can act as the holder of the primary lease. Returns whether\n     * the client is eligible for the lease, but does not actually acquire it.\n     * May return 'false' even if there is no active leaseholder and another\n     * (foreground) client should become leaseholder instead.\n     */    Ts(t) {\n        if (this.Yn) return ui.resolve(!0);\n        return Fr(t).get(\"owner\").next((e => {\n            // A client is eligible for the primary lease if:\n            // - its network is enabled and the client's tab is in the foreground.\n            // - its network is enabled and no other client's tab is in the\n            //   foreground.\n            // - every clients network is disabled and the client's tab is in the\n            //   foreground.\n            // - every clients network is disabled and no other client's tab is in\n            //   the foreground.\n            // - the `forceOwningTab` setting was passed in.\n            if (null !== e && this.Vs(e.leaseTimestampMs, 5e3) && !this.Ds(e.ownerId)) {\n                if (this.Rs(e) && this.networkEnabled) return !0;\n                if (!this.Rs(e)) {\n                    if (!e.allowTabSynchronization) \n                    // Fail the `canActAsPrimary` check if the current leaseholder has\n                    // not opted into multi-tab synchronization. If this happens at\n                    // client startup, we reject the Promise returned by\n                    // `enablePersistence()` and the user can continue to use Firestore\n                    // with in-memory persistence.\n                    // If this fails during a lease refresh, we will instead block the\n                    // AsyncQueue from executing further operations. Note that this is\n                    // acceptable since mixing & matching different `synchronizeTabs`\n                    // settings is not supported.\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\n                    // no longer be turned off.\n                    throw new Q(G.FAILED_PRECONDITION, Or);\n                    return !1;\n                }\n            }\n            return !(!this.networkEnabled || !this.inForeground) || Br(t).Ut().next((t => void 0 === this.vs(t, 5e3).find((t => {\n                if (this.clientId !== t.clientId) {\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\n                    if (e || n && s) return !0;\n                }\n                return !1;\n            }))));\n        })).next((t => (this.isPrimary !== t && O(\"IndexedDbPersistence\", `Client ${t ? \"is\" : \"is not\"} eligible for a primary lease.`), \n        t)));\n    }\n    async shutdown() {\n        // The shutdown() operations are idempotent and can be called even when\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\n        this.ts = !1, this.Cs(), this.ss && (this.ss.cancel(), this.ss = null), this.xs(), \n        this.Ns(), \n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n        // has obtained the primary lease.\n        await this.cs.runTransaction(\"shutdown\", \"readwrite\", [ \"owner\", \"clientMetadata\" ], (t => {\n            const e = new yi(t, nt.A);\n            return this.Es(e).next((() => this.bs(e)));\n        })), this.cs.close(), \n        // Remove the entry marking the client as zombied from LocalStorage since\n        // we successfully deleted its metadata from IndexedDb.\n        this.ks();\n    }\n    /**\n     * Returns clients that are not zombied and have an updateTime within the\n     * provided threshold.\n     */    vs(t, e) {\n        return t.filter((t => this.Vs(t.updateTimeMs, e) && !this.Ds(t.clientId)));\n    }\n    /**\n     * Returns the IDs of the clients that are currently active. If multi-tab\n     * is not supported, returns an array that only contains the local client's\n     * ID.\n     *\n     * PORTING NOTE: This is only used for Web multi-tab.\n     */    Ms() {\n        return this.runTransaction(\"getActiveClients\", \"readonly\", (t => Br(t).Ut().next((t => this.vs(t, 18e5).map((t => t.clientId))))));\n    }\n    get started() {\n        return this.ts;\n    }\n    getMutationQueue(t, e) {\n        return lr.Yt(t, this.M, e, this.referenceDelegate);\n    }\n    getTargetCache() {\n        return this.hs;\n    }\n    getRemoteDocumentCache() {\n        return this.ls;\n    }\n    getIndexManager(t) {\n        return new nr(t);\n    }\n    getDocumentOverlayCache(t) {\n        return Li.Yt(this.M, t);\n    }\n    getBundleCache() {\n        return this.fs;\n    }\n    runTransaction(t, e, n) {\n        O(\"IndexedDbPersistence\", \"Starting transaction:\", t);\n        const s = \"readonly\" === e ? \"readonly\" : \"readwrite\", i = 13 === (r = this.Xn) ? ri : 12 === r ? ii : 11 === r ? si : void L();\n        /** Returns the object stores for the provided schema. */\n        var r;\n        let o;\n        // Do all transactions as readwrite against all object stores, since we\n        // are the only reader/writer.\n                return this.cs.runTransaction(t, s, i, (s => (o = new yi(s, this.Zn ? this.Zn.next() : nt.A), \n        \"readwrite-primary\" === e ? this.Is(o).next((t => !!t || this.Ts(o))).next((e => {\n            if (!e) throw $(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \n            this.Hn.enqueueRetryable((() => this.os(!1))), new Q(G.FAILED_PRECONDITION, oi);\n            return n(o);\n        })).next((t => this.As(o).next((() => t)))) : this.Os(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \n        t)));\n    }\n    /**\n     * Verifies that the current tab is the primary leaseholder or alternatively\n     * that the leaseholder has opted into multi-tab synchronization.\n     */\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\n    // be turned off.\n    Os(t) {\n        return Fr(t).get(\"owner\").next((t => {\n            if (null !== t && this.Vs(t.leaseTimestampMs, 5e3) && !this.Ds(t.ownerId) && !this.Rs(t) && !(this.Yn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Or);\n        }));\n    }\n    /**\n     * Obtains or extends the new primary lease for the local client. This\n     * method does not verify that the client is eligible for this lease.\n     */    As(t) {\n        const e = {\n            ownerId: this.clientId,\n            allowTabSynchronization: this.allowTabSynchronization,\n            leaseTimestampMs: Date.now()\n        };\n        return Fr(t).put(\"owner\", e);\n    }\n    static vt() {\n        return hi.vt();\n    }\n    /** Checks the primary lease and removes it if we are the current primary. */    Es(t) {\n        const e = Fr(t);\n        return e.get(\"owner\").next((t => this.Rs(t) ? (O(\"IndexedDbPersistence\", \"Releasing primary lease.\"), \n        e.delete(\"owner\")) : ui.resolve()));\n    }\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Vs(t, e) {\n        const n = Date.now();\n        return !(t < n - e) && (!(t > n) || ($(`Detected an update time that is in the future: ${t} > ${n}`), \n        !1));\n    }\n    ws() {\n        null !== this.document && \"function\" == typeof this.document.addEventListener && (this.ns = () => {\n            this.Hn.enqueueAndForget((() => (this.inForeground = \"visible\" === this.document.visibilityState, \n            this._s())));\n        }, this.document.addEventListener(\"visibilitychange\", this.ns), this.inForeground = \"visible\" === this.document.visibilityState);\n    }\n    xs() {\n        this.ns && (this.document.removeEventListener(\"visibilitychange\", this.ns), this.ns = null);\n    }\n    /**\n     * Attaches a window.unload handler that will synchronously write our\n     * clientId to a \"zombie client id\" location in LocalStorage. This can be used\n     * by tabs trying to acquire the primary lease to determine that the lease\n     * is no longer valid even if the timestamp is recent. This is particularly\n     * important for the refresh case (so the tab correctly re-acquires the\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\n     * it is a synchronous API and so can be used reliably from  an unload\n     * handler.\n     */    gs() {\n        var t;\n        \"function\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.es = () => {\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\n            // accesses internal state. We execute this code directly during shutdown\n            // to make sure it gets a chance to run.\n            this.Cs(), l() && navigator.appVersion.match(/Version\\/1[45]/) && \n            // On Safari 14 and 15, we do not run any cleanup actions as it might\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\n            // the next page load.\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\n            this.Hn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Hn.enqueueAndForget((() => this.shutdown()));\n        }, this.window.addEventListener(\"pagehide\", this.es));\n    }\n    Ns() {\n        this.es && (this.window.removeEventListener(\"pagehide\", this.es), this.es = null);\n    }\n    /**\n     * Returns whether a client is \"zombied\" based on its LocalStorage entry.\n     * Clients become zombied when their tab closes without running all of the\n     * cleanup logic in `shutdown()`.\n     */    Ds(t) {\n        var e;\n        try {\n            const n = null !== (null === (e = this.ds) || void 0 === e ? void 0 : e.getItem(this.Ss(t)));\n            return O(\"IndexedDbPersistence\", `Client '${t}' ${n ? \"is\" : \"is not\"} zombied in LocalStorage`), \n            n;\n        } catch (t) {\n            // Gracefully handle if LocalStorage isn't working.\n            return $(\"IndexedDbPersistence\", \"Failed to get zombied client id.\", t), !1;\n        }\n    }\n    /**\n     * Record client as zombied (a client that had its tab closed). Zombied\n     * clients are ignored during primary tab selection.\n     */    Cs() {\n        if (this.ds) try {\n            this.ds.setItem(this.Ss(this.clientId), String(Date.now()));\n        } catch (t) {\n            // Gracefully handle if LocalStorage isn't available / working.\n            $(\"Failed to set zombie client id.\", t);\n        }\n    }\n    /** Removes the zombied client entry if it exists. */    ks() {\n        if (this.ds) try {\n            this.ds.removeItem(this.Ss(this.clientId));\n        } catch (t) {\n            // Ignore\n        }\n    }\n    Ss(t) {\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\n    }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the primary client object store.\n */ function Fr(t) {\n    return pi(t, \"owner\");\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the client metadata object store.\n */ function Br(t) {\n    return pi(t, \"clientMetadata\");\n}\n\n/**\n * Generates a string used as a prefix when storing data in IndexedDB and\n * LocalStorage.\n */ function Lr(t, e) {\n    // Use two different prefix formats:\n    //   * firestore / persistenceKey / projectID . databaseID / ...\n    //   * firestore / persistenceKey / projectID / ...\n    // projectIDs are DNS-compatible names and cannot contain dots\n    // so there's no danger of collisions.\n    let n = t.projectId;\n    return t.isDefaultDatabase || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\";\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass qr {\n    constructor(t, e) {\n        this.progress = t, this.$s = e;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A readonly view of the local state of all documents we're tracking (i.e. we\n * have a cached version in remoteDocumentCache or local mutations for the\n * document). The view is computed by applying the mutations in the\n * MutationQueue to the RemoteDocumentCache.\n */ class Ur {\n    constructor(t, e, n) {\n        this.ls = t, this.Fs = e, this.indexManager = n;\n    }\n    /**\n     * Get the local view of the document identified by `key`.\n     *\n     * @returns Local view of the document or null if we don't have any cached\n     * state for it.\n     */    Bs(t, e) {\n        return this.Fs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Ls(t, e, n)));\n    }\n    /** Internal version of `getDocument` that allows reusing batches. */    Ls(t, e, n) {\n        return this.ls.getEntry(t, e).next((t => {\n            for (const e of n) e.applyToLocalView(t);\n            return t;\n        }));\n    }\n    // Returns the view of the given `docs` as they would appear after applying\n    // all mutations in the given `batches`.\n    qs(t, e) {\n        t.forEach(((t, n) => {\n            for (const t of e) t.applyToLocalView(n);\n        }));\n    }\n    /**\n     * Gets the local view of the documents identified by `keys`.\n     *\n     * If we don't have cached state for a document in `keys`, a NoDocument will\n     * be stored for that key in the resulting set.\n     */    Us(t, e) {\n        return this.ls.getEntries(t, e).next((e => this.Ks(t, e).next((() => e))));\n    }\n    /**\n     * Applies the local view the given `baseDocs` without retrieving documents\n     * from the local store.\n     */    Ks(t, e) {\n        return this.Fs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\n    }\n    /**\n     * Performs a query against the local view of all documents.\n     *\n     * @param transaction - The persistence transaction.\n     * @param query - The query to match documents against.\n     * @param sinceReadTime - If not set to SnapshotVersion.min(), return only\n     *     documents that have been read since this snapshot version (exclusive).\n     */    Gs(t, e, n) {\n        /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n        return function(t) {\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n        }(e) ? this.Qs(t, e.path) : Me(e) ? this.js(t, e, n) : this.Ws(t, e, n);\n    }\n    Qs(t, e) {\n        // Just do a simple document lookup.\n        return this.Bs(t, new xt(e)).next((t => {\n            let e = Ln();\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\n        }));\n    }\n    js(t, e, n) {\n        const s = e.collectionGroup;\n        let i = Ln();\n        return this.indexManager.getCollectionParents(t, s).next((r => ui.forEach(r, (r => {\n            const o = function(t, e) {\n                return new ve(e, \n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\n            }\n            /**\n * Returns true if this query does not specify any query constraints that\n * could remove results.\n */ (e, r.child(s));\n            return this.Ws(t, o, n).next((t => {\n                t.forEach(((t, e) => {\n                    i = i.insert(t, e);\n                }));\n            }));\n        })).next((() => i))));\n    }\n    Ws(t, e, n) {\n        // Query the remote documents and overlay mutations.\n        let s;\n        return this.ls.getAll(t, e.path, n).next((n => (s = n, this.Fs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\n            for (const e of t) for (const t of e.mutations) {\n                const n = t.key;\n                let i = s.get(n);\n                null == i && (\n                // Create invalid document to apply mutations on top of\n                i = te.newInvalidDocument(n), s = s.insert(n, i)), _n(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\n            }\n        })).next((() => (\n        // Finally, filter out any documents that don't actually match\n        // the query.\n        s.forEach(((t, n) => {\n            Ue(e, n) || (s = s.remove(t));\n        })), s)));\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A set of changes to what documents are currently in view and out of view for\n * a given query. These changes are sent to the LocalStore by the View (via\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\n */ class Kr {\n    constructor(t, e, n, s) {\n        this.targetId = t, this.fromCache = e, this.zs = n, this.Hs = s;\n    }\n    static Js(t, e) {\n        let n = Gn(), s = Gn();\n        for (const t of e.docChanges) switch (t.type) {\n          case 0 /* Added */ :\n            n = n.add(t.doc.key);\n            break;\n\n          case 1 /* Removed */ :\n            s = s.add(t.doc.key);\n // do nothing\n                }\n        return new Kr(t, e.fromCache, n, s);\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A query engine that takes advantage of the target document mapping in the\n * QueryCache. Query execution is optimized by only reading the documents that\n * previously matched a query plus any documents that were edited after the\n * query was last listened to.\n *\n * There are some cases when this optimization is not guaranteed to produce\n * the same results as full collection scans. In these cases, query\n * processing falls back to full scans. These cases are:\n *\n * - Limit queries where a document that matched the query previously no longer\n *   matches the query.\n *\n * - Limit queries where a document edit may cause the document to sort below\n *   another document that is in the local cache.\n *\n * - Queries that have never been CURRENT or free of limbo documents.\n */ class Gr {\n    /** Sets the document view to query against. */\n    Ys(t) {\n        this.Xs = t;\n    }\n    /** Returns all local documents matching the specified query. */    Gs(t, e, n, s) {\n        // Queries that match all documents don't benefit from using\n        // key-based lookups. It is more efficient to scan all documents in a\n        // collection, rather than to perform individual lookups.\n        return function(t) {\n            return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\n        }(e) || n.isEqual(ct.min()) ? this.Zs(t, e) : this.Xs.Us(t, s).next((i => {\n            const r = this.ti(e, i);\n            return (Ce(e) || xe(e)) && this.ei(e.limitType, r, s, n) ? this.Zs(t, e) : (k() <= a.DEBUG && O(\"QueryEngine\", \"Re-using previous result from %s to execute query: %s\", n.toString(), qe(e)), \n            this.Xs.Gs(t, e, n).next((t => (\n            // We merge `previousResults` into `updateResults`, since\n            // `updateResults` is already a DocumentMap. If a document is\n            // contained in both lists, then its contents are the same.\n            r.forEach((e => {\n                t = t.insert(e.key, e);\n            })), t))));\n        }));\n        // Queries that have never seen a snapshot without limbo free documents\n        // should also be run as a full collection scan.\n        }\n    /** Applies the query filter and sorting to the provided documents.  */    ti(t, e) {\n        // Sort the documents and re-apply the query filter since previously\n        // matching documents do not necessarily still match the query.\n        let n = new kn(Ke(t));\n        return e.forEach(((e, s) => {\n            Ue(t, s) && (n = n.add(s));\n        })), n;\n    }\n    /**\n     * Determines if a limit query needs to be refilled from cache, making it\n     * ineligible for index-free execution.\n     *\n     * @param sortedPreviousResults - The documents that matched the query when it\n     * was last synchronized, sorted by the query's comparator.\n     * @param remoteKeys - The document keys that matched the query at the last\n     * snapshot.\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\n     * query was last synchronized.\n     */    ei(t, e, n, s) {\n        // The query needs to be refilled if a previously matching document no\n        // longer matches.\n        if (n.size !== e.size) return !0;\n        // Limit queries are not eligible for index-free query execution if there is\n        // a potential that an older document from cache now sorts before a document\n        // that was previously part of the limit. This, however, can only happen if\n        // the document at the edge of the limit goes out of limit.\n        // If a document that is not the limit boundary sorts differently,\n        // the boundary of the limit itself did not change and documents from cache\n        // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n        // any modifications that don't affect the last document.\n                const i = \"F\" /* First */ === t ? e.last() : e.first();\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\n    }\n    Zs(t, e) {\n        return k() <= a.DEBUG && O(\"QueryEngine\", \"Using full collection scan to execute query:\", qe(e)), \n        this.Xs.Gs(t, e, ct.min());\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */\nclass Qr {\n    constructor(\n    /** Manages our in-memory or durable persistence. */\n    t, e, n, s) {\n        this.persistence = t, this.ni = e, this.M = s, \n        /**\n         * Maps a targetID to data about its target.\n         *\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\n         * of `applyRemoteEvent()` idempotent.\n         */\n        this.si = new Cn(rt), \n        /** Maps a target to its targetID. */\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\n        this.ii = new Dn((t => ce(t)), le), \n        /**\n         * The read time of the last entry processed by `getNewDocumentChanges()`.\n         *\n         * PORTING NOTE: This is only used for multi-tab synchronization.\n         */\n        this.ri = ct.min(), this.oi = t.getRemoteDocumentCache(), this.hs = t.getTargetCache(), \n        this.fs = t.getBundleCache(), this.ai(n);\n    }\n    ai(t) {\n        // TODO(indexing): Add spec tests that test these components change after a\n        // user change\n        this.indexManager = this.persistence.getIndexManager(t), this.Fs = this.persistence.getMutationQueue(t, this.indexManager), \n        this.ui = new Ur(this.oi, this.Fs, this.indexManager), this.oi.setIndexManager(this.indexManager), \n        this.ni.Ys(this.ui);\n    }\n    collectGarbage(t) {\n        return this.persistence.runTransaction(\"Collect garbage\", \"readwrite-primary\", (e => t.collect(e, this.si)));\n    }\n}\n\nfunction jr(\n/** Manages our in-memory or durable persistence. */\nt, e, n, s) {\n    return new Qr(t, e, n, s);\n}\n\n/**\n * Tells the LocalStore that the currently authenticated user has changed.\n *\n * In response the local store switches the mutation queue to the new user and\n * returns any resulting document changes.\n */\n// PORTING NOTE: Android and iOS only return the documents affected by the\n// change.\nasync function Wr(t, e) {\n    const n = K(t);\n    return await n.persistence.runTransaction(\"Handle user change\", \"readonly\", (t => {\n        // Swap out the mutation queue, grabbing the pending mutation batches\n        // before and after.\n        let s;\n        return n.Fs.getAllMutationBatches(t).next((i => (s = i, n.ai(e), n.Fs.getAllMutationBatches(t)))).next((e => {\n            const i = [], r = [];\n            // Union the old/new changed keys.\n            let o = Gn();\n            for (const t of s) {\n                i.push(t.batchId);\n                for (const e of t.mutations) o = o.add(e.key);\n            }\n            for (const t of e) {\n                r.push(t.batchId);\n                for (const e of t.mutations) o = o.add(e.key);\n            }\n            // Return the set of all (potentially) changed documents and the list\n            // of mutation batch IDs that were affected by change.\n                        return n.ui.Us(t, o).next((t => ({\n                ci: t,\n                removedBatchIds: i,\n                addedBatchIds: r\n            })));\n        }));\n    }));\n}\n\n/* Accepts locally generated Mutations and commit them to storage. */\n/**\n * Acknowledges the given batch.\n *\n * On the happy path when a batch is acknowledged, the local store will\n *\n *  + remove the batch from the mutation queue;\n *  + apply the changes to the remote document cache;\n *  + recalculate the latency compensated view implied by those changes (there\n *    may be mutations in the queue that affect the documents but haven't been\n *    acknowledged yet); and\n *  + give the changed documents back the sync engine\n *\n * @returns The resulting (modified) documents.\n */\nfunction zr(t, e) {\n    const n = K(t);\n    return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (t => {\n        const s = e.batch.keys(), i = n.oi.newChangeBuffer({\n            trackRemovals: !0\n        });\n        return function(t, e, n, s) {\n            const i = n.batch, r = i.keys();\n            let o = ui.resolve();\n            return r.forEach((t => {\n                o = o.next((() => s.getEntry(e, t))).next((e => {\n                    const r = n.docVersions.get(t);\n                    q(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\n                    // We use the commitVersion as the readTime rather than the\n                    // document's updateTime since the updateTime is not advanced\n                    // for updates that do not modify the underlying document.\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\n                }));\n            })), o.next((() => t.Fs.removeMutationBatch(e, i)));\n        }\n        /** Returns the local view of the documents affected by a mutation batch. */\n        // PORTING NOTE: Multi-Tab only.\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Fs.performConsistencyCheck(t))).next((() => n.ui.Us(t, s)));\n    }));\n}\n\n/**\n * Removes mutations from the MutationQueue for the specified batch;\n * LocalDocuments will be recalculated.\n *\n * @returns The resulting modified documents.\n */\n/**\n * Returns the last consistent snapshot processed (used by the RemoteStore to\n * determine whether to buffer incoming snapshots from the backend).\n */\nfunction Hr(t) {\n    const e = K(t);\n    return e.persistence.runTransaction(\"Get last remote snapshot version\", \"readonly\", (t => e.hs.getLastRemoteSnapshotVersion(t)));\n}\n\n/**\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\n * event reflects any write batches that have been acknowledged or rejected\n * (i.e. we do not re-apply local mutations to updates from this event).\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */ function Jr(t, e) {\n    const n = K(t), s = e.snapshotVersion;\n    let i = n.si;\n    return n.persistence.runTransaction(\"Apply remote event\", \"readwrite-primary\", (t => {\n        const r = n.oi.newChangeBuffer({\n            trackRemovals: !0\n        });\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\n                i = n.si;\n        const o = [];\n        e.targetChanges.forEach(((r, a) => {\n            const u = i.get(a);\n            if (!u) return;\n            // Only update the remote keys if the target is still active. This\n            // ensures that we can persist the updated target data along with\n            // the updated assignment.\n                        o.push(n.hs.removeMatchingKeys(t, r.removedDocuments, a).next((() => n.hs.addMatchingKeys(t, r.addedDocuments, a))));\n            let c = u.withSequenceNumber(t.currentSequenceNumber);\n            e.targetMismatches.has(a) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \n            i = i.insert(a, c), \n            // Update the target data if there are target changes (or if\n            // sufficient time has passed since the last update).\n            /**\n * Returns true if the newTargetData should be persisted during an update of\n * an active target. TargetData should always be persisted when a target is\n * being released and should not call this function.\n *\n * While the target is active, TargetData updates can be omitted when nothing\n * about the target has changed except metadata like the resume token or\n * snapshot version. Occasionally it's worth the extra write to prevent these\n * values from getting too stale after a crash, but this doesn't have to be\n * too frequent.\n */\n            function(t, e, n) {\n                // Always persist target data if we don't already have a resume token.\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\n                // Don't allow resume token changes to be buffered indefinitely. This\n                // allows us to be reasonably up-to-date after a crash and avoids needing\n                // to loop over all active queries on shutdown. Especially in the browser\n                // we may not get time to do anything interesting while the current tab is\n                // closing.\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\n                // Otherwise if the only thing that has changed about a target is its resume\n                // token it's not worth persisting. Note that the RemoteStore keeps an\n                // in-memory view of the currently active targets which includes the current\n                // resume token, so stream failure or user changes will still use an\n                // up-to-date resume token regardless of what we do here.\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\n            }\n            /**\n * Notifies local store of the changed views to locally pin documents.\n */ (u, c, r) && o.push(n.hs.updateTargetData(t, c));\n        }));\n        let a = Fn();\n        // HACK: The only reason we allow a null snapshot version is so that we\n        // can synthesize remote events when we get permission denied errors while\n        // trying to resolve the state of a locally cached document that is in\n        // limbo.\n        if (e.documentUpdates.forEach((s => {\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\n        })), \n        // Each loop iteration only affects its \"own\" doc, so it's safe to get all the remote\n        // documents in advance in a single call.\n        o.push(Yr(t, r, e.documentUpdates).next((t => {\n            a = t;\n        }))), !s.isEqual(ct.min())) {\n            const e = n.hs.getLastRemoteSnapshotVersion(t).next((e => n.hs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\n            o.push(e);\n        }\n        return ui.waitFor(o).next((() => r.apply(t))).next((() => n.ui.Ks(t, a))).next((() => a));\n    })).then((t => (n.si = i, t)));\n}\n\n/**\n * Populates document change buffer with documents from backend or a bundle.\n * Returns the document changes resulting from applying those documents.\n *\n * @param txn - Transaction to use to read existing documents from storage.\n * @param documentBuffer - Document buffer to collect the resulted changes to be\n *        applied to storage.\n * @param documents - Documents to be applied.\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\n *        documents have the same read time.\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\n *        have their own read time.\n *\n * Note: this function will use `documentVersions` if it is defined;\n * when it is not defined, resorts to `globalVersion`.\n */ function Yr(t, e, n) {\n    let s = Gn();\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\n        let s = Fn();\n        return n.forEach(((n, i) => {\n            const r = t.get(n);\n            // Note: The order of the steps below is important, since we want\n            // to ensure that rejected limbo resolutions (which fabricate\n            // NoDocuments with SnapshotVersion.min()) never add documents to\n            // cache.\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\n            // events. We remove these documents from cache since we lost\n            // access.\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \n            s = s.insert(n, i)) : O(\"LocalStore\", \"Ignoring outdated watch update for \", n, \". Current version:\", r.version, \" Watch version:\", i.version);\n        })), s;\n    }));\n}\n\n/**\n * Gets the mutation batch after the passed in batchId in the mutation queue\n * or null if empty.\n * @param afterBatchId - If provided, the batch to search after.\n * @returns The next mutation or null if there wasn't one.\n */\nfunction Xr(t, e) {\n    const n = K(t);\n    return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", (t => (void 0 === e && (e = -1), \n    n.Fs.getNextMutationBatchAfterBatchId(t, e))));\n}\n\n/**\n * Reads the current value of a Document with a given key or null if not\n * found - used for testing.\n */\n/**\n * Assigns the given target an internal ID so that its results can be pinned so\n * they don't get GC'd. A target must be allocated in the local store before\n * the store can be used to manage its view.\n *\n * Allocating an already allocated `Target` will return the existing `TargetData`\n * for that `Target`.\n */\nfunction Zr(t, e) {\n    const n = K(t);\n    return n.persistence.runTransaction(\"Allocate target\", \"readwrite\", (t => {\n        let s;\n        return n.hs.getTargetData(t, e).next((i => i ? (\n        // This target has been listened to previously, so reuse the\n        // previous targetID.\n        // TODO(mcg): freshen last accessed date?\n        s = i, ui.resolve(s)) : n.hs.allocateTargetId(t).next((i => (s = new Ai(e, i, 0 /* Listen */ , t.currentSequenceNumber), \n        n.hs.addTargetData(t, s).next((() => s)))))));\n    })).then((t => {\n        // If Multi-Tab is enabled, the existing target data may be newer than\n        // the in-memory data\n        const s = n.si.get(t.targetId);\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.si = n.si.insert(t.targetId, t), \n        n.ii.set(e, t.targetId)), t;\n    }));\n}\n\n/**\n * Returns the TargetData as seen by the LocalStore, including updates that may\n * have not yet been persisted to the TargetCache.\n */\n// Visible for testing.\n/**\n * Unpins all the documents associated with the given target. If\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\n * directly removes the associated target data from the target cache.\n *\n * Releasing a non-existing `Target` is a no-op.\n */\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\nasync function to(t, e, n) {\n    const s = K(t), i = s.si.get(e), r = n ? \"readwrite\" : \"readwrite-primary\";\n    try {\n        n || await s.persistence.runTransaction(\"Release target\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\n    } catch (t) {\n        if (!di(t)) throw t;\n        // All `releaseTarget` does is record the final metadata state for the\n        // target, but we've been recording this periodically during target\n        // activity. If we lose this write this could cause a very slight\n        // difference in the order of target deletion during GC, but we\n        // don't define exact LRU semantics so this is acceptable.\n        O(\"LocalStore\", `Failed to update sequence numbers for target ${e}: ${t}`);\n    }\n    s.si = s.si.remove(e), s.ii.delete(i.target);\n}\n\n/**\n * Runs the specified query against the local store and returns the results,\n * potentially taking advantage of query data from previous executions (such\n * as the set of remote keys).\n *\n * @param usePreviousResults - Whether results from previous executions can\n * be used to optimize this query execution.\n */ function eo(t, e, n) {\n    const s = K(t);\n    let i = ct.min(), r = Gn();\n    return s.persistence.runTransaction(\"Execute query\", \"readonly\", (t => function(t, e, n) {\n        const s = K(t), i = s.ii.get(n);\n        return void 0 !== i ? ui.resolve(s.si.get(i)) : s.hs.getTargetData(e, n);\n    }(s, t, $e(e)).next((e => {\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.hs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\n            r = t;\n        }));\n    })).next((() => s.ni.Gs(t, e, n ? i : ct.min(), n ? r : Gn()))).next((t => ({\n        documents: t,\n        hi: r\n    })))));\n}\n\n// PORTING NOTE: Multi-Tab only.\nfunction no(t, e) {\n    const n = K(t), s = K(n.hs), i = n.si.get(e);\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\"Get target data\", \"readonly\", (t => s.Et(t, e).next((t => t ? t.target : null))));\n}\n\n/**\n * Returns the set of documents that have been updated since the last call.\n * If this is the first call, returns the set of changes since client\n * initialization. Further invocations will return document that have changed\n * since the prior call.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction so(t) {\n    const e = K(t);\n    return e.persistence.runTransaction(\"Get new document changes\", \"readonly\", (t => function(t, e, n) {\n        const s = K(t);\n        let i = Fn(), r = Vi(n);\n        const o = xr(e), a = IDBKeyRange.lowerBound(r, !0);\n        return o.Wt({\n            index: \"readTimeIndex\",\n            range: a\n        }, ((t, e) => {\n            // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses\n            // the documents directly since we want to keep sentinel deletes.\n            const n = bi(s.M, e);\n            i = i.insert(n.key, n), r = e.readTime;\n        })).next((() => ({\n            $s: i,\n            readTime: vi(r)\n        })));\n    }\n    /**\n * Returns the read time of the most recently read document in the cache, or\n * SnapshotVersion.min() if not available.\n */\n    // PORTING NOTE: This is only used for multi-tab synchronization.\n    (e.oi, t, e.ri))).then((({$s: t, readTime: n}) => (e.ri = n, t)));\n}\n\n/**\n * Reads the newest document change from persistence and moves the internal\n * synchronization marker forward so that calls to `getNewDocumentChanges()`\n * only return changes that happened after client initialization.\n */\n// PORTING NOTE: Multi-Tab only.\nasync function io(t) {\n    const e = K(t);\n    return e.persistence.runTransaction(\"Synchronize last document change read time\", \"readonly\", (t => function(t) {\n        const e = xr(t);\n        // If there are no existing entries, we return SnapshotVersion.min().\n                let n = ct.min();\n        return e.Wt({\n            index: \"readTimeIndex\",\n            reverse: !0\n        }, ((t, e, s) => {\n            e.readTime && (n = vi(e.readTime)), s.done();\n        })).next((() => n));\n    }(t))).then((t => {\n        e.ri = t;\n    }));\n}\n\n/**\n * Creates a new target using the given bundle name, which will be used to\n * hold the keys of all documents from the bundle in query-document mappings.\n * This ensures that the loaded documents do not get garbage collected\n * right away.\n */\n/**\n * Applies the documents from a bundle to the \"ground-state\" (remote)\n * documents.\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */\nasync function ro(t, e, n, s) {\n    const i = K(t);\n    let r = Gn(), o = Fn();\n    for (const t of n) {\n        const n = e.li(t.metadata.name);\n        t.document && (r = r.add(n));\n        const s = e.fi(t);\n        s.setReadTime(e.di(t.metadata.readTime)), o = o.insert(n, s);\n    }\n    const a = i.oi.newChangeBuffer({\n        trackRemovals: !0\n    }), u = await Zr(i, function(t) {\n        // It is OK that the path used for the query is not valid, because this will\n        // not be read and queried.\n        return $e(De(_t.fromString(`__bundle__/docs/${t}`)));\n    }(s));\n    // Allocates a target to hold all document keys from the bundle, such that\n    // they will not get garbage collected right away.\n        return i.persistence.runTransaction(\"Apply bundle documents\", \"readwrite\", (t => Yr(t, a, o).next((e => (a.apply(t), \n    e))).next((e => i.hs.removeMatchingKeysForTargetId(t, u.targetId).next((() => i.hs.addMatchingKeys(t, r, u.targetId))).next((() => i.ui.Ks(t, e))).next((() => e))))));\n}\n\n/**\n * Returns a promise of a boolean to indicate if the given bundle has already\n * been loaded and the create time is newer than the current loading bundle.\n */\n/**\n * Saves the given `NamedQuery` to local persistence.\n */\nasync function oo(t, e, n = Gn()) {\n    // Allocate a target for the named query such that it can be resumed\n    // from associated read time if users use it to listen.\n    // NOTE: this also means if no corresponding target exists, the new target\n    // will remain active and will not get collected, unless users happen to\n    // unlisten the query somehow.\n    const s = await Zr(t, $e(ki(e.bundledQuery))), i = K(t);\n    return i.persistence.runTransaction(\"Save named query\", \"readwrite\", (t => {\n        const r = us(e.readTime);\n        // Simply save the query itself if it is older than what the SDK already\n        // has.\n                if (s.snapshotVersion.compareTo(r) >= 0) return i.fs.saveNamedQuery(t, e);\n        // Update existing target data because the query from the bundle is newer.\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\n        return i.si = i.si.insert(o.targetId, o), i.hs.updateTargetData(t, o).next((() => i.hs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.hs.addMatchingKeys(t, n, s.targetId))).next((() => i.fs.saveNamedQuery(t, e)));\n    }));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class ao {\n    constructor(t) {\n        this.M = t, this._i = new Map, this.wi = new Map;\n    }\n    getBundleMetadata(t, e) {\n        return ui.resolve(this._i.get(e));\n    }\n    saveBundleMetadata(t, e) {\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\n        var n;\n        return this._i.set(e.id, {\n            id: (n = e).id,\n            version: n.version,\n            createTime: us(n.createTime)\n        }), ui.resolve();\n    }\n    getNamedQuery(t, e) {\n        return ui.resolve(this.wi.get(e));\n    }\n    saveNamedQuery(t, e) {\n        return this.wi.set(e.name, function(t) {\n            return {\n                name: t.name,\n                query: ki(t.bundledQuery),\n                readTime: us(t.readTime)\n            };\n        }(e)), ui.resolve();\n    }\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An in-memory implementation of DocumentOverlayCache.\n */ class uo {\n    constructor() {\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\n        // for the overlay and the overlay itself.\n        this.overlays = new Cn(xt.comparator), this.mi = new Map;\n    }\n    getOverlay(t, e) {\n        return ui.resolve(this.overlays.get(e));\n    }\n    saveOverlays(t, e, n) {\n        return n.forEach(((n, s) => {\n            this.Xt(t, e, s);\n        })), ui.resolve();\n    }\n    removeOverlaysForBatchId(t, e, n) {\n        const s = this.mi.get(n);\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \n        this.mi.delete(n)), ui.resolve();\n    }\n    getOverlaysForCollection(t, e, n) {\n        const s = qn(), i = e.length + 1, r = new xt(e.child(\"\")), o = this.overlays.getIteratorFrom(r);\n        for (;o.hasNext(); ) {\n            const t = o.getNext().value, r = t.getKey();\n            if (!e.isPrefixOf(r.path)) break;\n            // Documents from sub-collections\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\n        }\n        return ui.resolve(s);\n    }\n    getOverlaysForCollectionGroup(t, e, n, s) {\n        let i = new Cn(((t, e) => t - e));\n        const r = this.overlays.getIterator();\n        for (;r.hasNext(); ) {\n            const t = r.getNext().value;\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\n                let e = i.get(t.largestBatchId);\n                null === e && (e = qn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\n            }\n        }\n        const o = qn(), a = i.getIterator();\n        for (;a.hasNext(); ) {\n            if (a.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\n        }\n        return ui.resolve(o);\n    }\n    Xt(t, e, n) {\n        if (null === n) return;\n        // Remove the association of the overlay to its batch id.\n                const s = this.overlays.get(n.key);\n        if (null !== s) {\n            const t = this.mi.get(s.largestBatchId).delete(n.key);\n            this.mi.set(s.largestBatchId, t);\n        }\n        this.overlays = this.overlays.insert(n.key, new Ei(e, n));\n        // Create the association of this overlay to the given largestBatchId.\n        let i = this.mi.get(e);\n        void 0 === i && (i = Gn(), this.mi.set(e, i)), this.mi.set(e, i.add(n.key));\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A collection of references to a document from some kind of numbered entity\n * (either a target ID or batch ID). As references are added to or removed from\n * the set corresponding events are emitted to a registered garbage collector.\n *\n * Each reference is represented by a DocumentReference object. Each of them\n * contains enough information to uniquely identify the reference. They are all\n * stored primarily in a set sorted by key. A document is considered garbage if\n * there's no references in that set (this can be efficiently checked thanks to\n * sorting by key).\n *\n * ReferenceSet also keeps a secondary set that contains references sorted by\n * IDs. This one is used to efficiently implement removal of all references by\n * some target ID.\n */ class co {\n    constructor() {\n        // A set of outstanding references to a document sorted by key.\n        this.gi = new kn(ho.yi), \n        // A set of outstanding references to a document sorted by target id.\n        this.pi = new kn(ho.Ii);\n    }\n    /** Returns true if the reference set contains no references. */    isEmpty() {\n        return this.gi.isEmpty();\n    }\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\n        const n = new ho(t, e);\n        this.gi = this.gi.add(n), this.pi = this.pi.add(n);\n    }\n    /** Add references to the given document keys for the given ID. */    Ti(t, e) {\n        t.forEach((t => this.addReference(t, e)));\n    }\n    /**\n     * Removes a reference to the given document key for the given\n     * ID.\n     */    removeReference(t, e) {\n        this.Ei(new ho(t, e));\n    }\n    Ai(t, e) {\n        t.forEach((t => this.removeReference(t, e)));\n    }\n    /**\n     * Clears all references with a given ID. Calls removeRef() for each key\n     * removed.\n     */    Ri(t) {\n        const e = new xt(new _t([])), n = new ho(e, t), s = new ho(e, t + 1), i = [];\n        return this.pi.forEachInRange([ n, s ], (t => {\n            this.Ei(t), i.push(t.key);\n        })), i;\n    }\n    bi() {\n        this.gi.forEach((t => this.Ei(t)));\n    }\n    Ei(t) {\n        this.gi = this.gi.delete(t), this.pi = this.pi.delete(t);\n    }\n    Pi(t) {\n        const e = new xt(new _t([])), n = new ho(e, t), s = new ho(e, t + 1);\n        let i = Gn();\n        return this.pi.forEachInRange([ n, s ], (t => {\n            i = i.add(t.key);\n        })), i;\n    }\n    containsKey(t) {\n        const e = new ho(t, 0), n = this.gi.firstAfterOrEqual(e);\n        return null !== n && t.isEqual(n.key);\n    }\n}\n\nclass ho {\n    constructor(t, e) {\n        this.key = t, this.Vi = e;\n    }\n    /** Compare by key then by ID */    static yi(t, e) {\n        return xt.comparator(t.key, e.key) || rt(t.Vi, e.Vi);\n    }\n    /** Compare by ID then by key */    static Ii(t, e) {\n        return rt(t.Vi, e.Vi) || xt.comparator(t.key, e.key);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class lo {\n    constructor(t, e) {\n        this.indexManager = t, this.referenceDelegate = e, \n        /**\n         * The set of all mutations that have been sent but not yet been applied to\n         * the backend.\n         */\n        this.Fs = [], \n        /** Next value to use when assigning sequential IDs to each mutation batch. */\n        this.vi = 1, \n        /** An ordered mapping between documents and the mutations batch IDs. */\n        this.Si = new kn(ho.yi);\n    }\n    checkEmpty(t) {\n        return ui.resolve(0 === this.Fs.length);\n    }\n    addMutationBatch(t, e, n, s) {\n        const i = this.vi;\n        this.vi++, this.Fs.length > 0 && this.Fs[this.Fs.length - 1];\n        const r = new Ii(i, e, n, s);\n        this.Fs.push(r);\n        // Track references by document key and index collection parents.\n        for (const e of s) this.Si = this.Si.add(new ho(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\n        return ui.resolve(r);\n    }\n    lookupMutationBatch(t, e) {\n        return ui.resolve(this.Di(e));\n    }\n    getNextMutationBatchAfterBatchId(t, e) {\n        const n = e + 1, s = this.Ci(n), i = s < 0 ? 0 : s;\n        // The requested batchId may still be out of range so normalize it to the\n        // start of the queue.\n                return ui.resolve(this.Fs.length > i ? this.Fs[i] : null);\n    }\n    getHighestUnacknowledgedBatchId() {\n        return ui.resolve(0 === this.Fs.length ? -1 : this.vi - 1);\n    }\n    getAllMutationBatches(t) {\n        return ui.resolve(this.Fs.slice());\n    }\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\n        const n = new ho(e, 0), s = new ho(e, Number.POSITIVE_INFINITY), i = [];\n        return this.Si.forEachInRange([ n, s ], (t => {\n            const e = this.Di(t.Vi);\n            i.push(e);\n        })), ui.resolve(i);\n    }\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\n        let n = new kn(rt);\n        return e.forEach((t => {\n            const e = new ho(t, 0), s = new ho(t, Number.POSITIVE_INFINITY);\n            this.Si.forEachInRange([ e, s ], (t => {\n                n = n.add(t.Vi);\n            }));\n        })), ui.resolve(this.xi(n));\n    }\n    getAllMutationBatchesAffectingQuery(t, e) {\n        // Use the query path as a prefix for testing if a document matches the\n        // query.\n        const n = e.path, s = n.length + 1;\n        // Construct a document reference for actually scanning the index. Unlike\n        // the prefix the document key in this reference must have an even number of\n        // segments. The empty segment can be used a suffix of the query path\n        // because it precedes all other segments in an ordered traversal.\n        let i = n;\n        xt.isDocumentKey(i) || (i = i.child(\"\"));\n        const r = new ho(new xt(i), 0);\n        // Find unique batchIDs referenced by all documents potentially matching the\n        // query.\n                let o = new kn(rt);\n        return this.Si.forEachWhile((t => {\n            const e = t.key.path;\n            return !!n.isPrefixOf(e) && (\n            // Rows with document keys more than one segment longer than the query\n            // path can't be matches. For example, a query on 'rooms' can't match\n            // the document /rooms/abc/messages/xyx.\n            // TODO(mcg): we'll need a different scanner when we implement\n            // ancestor queries.\n            e.length === s && (o = o.add(t.Vi)), !0);\n        }), r), ui.resolve(this.xi(o));\n    }\n    xi(t) {\n        // Construct an array of matching batches, sorted by batchID to ensure that\n        // multiple mutations affecting the same document key are applied in order.\n        const e = [];\n        return t.forEach((t => {\n            const n = this.Di(t);\n            null !== n && e.push(n);\n        })), e;\n    }\n    removeMutationBatch(t, e) {\n        q(0 === this.Ni(e.batchId, \"removed\")), this.Fs.shift();\n        let n = this.Si;\n        return ui.forEach(e.mutations, (s => {\n            const i = new ho(s.key, e.batchId);\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\n        })).next((() => {\n            this.Si = n;\n        }));\n    }\n    dn(t) {\n        // No-op since the memory mutation queue does not maintain a separate cache.\n    }\n    containsKey(t, e) {\n        const n = new ho(e, 0), s = this.Si.firstAfterOrEqual(n);\n        return ui.resolve(e.isEqual(s && s.key));\n    }\n    performConsistencyCheck(t) {\n        return this.Fs.length, ui.resolve();\n    }\n    /**\n     * Finds the index of the given batchId in the mutation queue and asserts that\n     * the resulting index is within the bounds of the queue.\n     *\n     * @param batchId - The batchId to search for\n     * @param action - A description of what the caller is doing, phrased in passive\n     * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\n     */    Ni(t, e) {\n        return this.Ci(t);\n    }\n    /**\n     * Finds the index of the given batchId in the mutation queue. This operation\n     * is O(1).\n     *\n     * @returns The computed index of the batch with the given batchId, based on\n     * the state of the queue. Note this index can be negative if the requested\n     * batchId has already been remvoed from the queue or past the end of the\n     * queue if the batchId is larger than the last added batch.\n     */    Ci(t) {\n        if (0 === this.Fs.length) \n        // As an index this is past the end of the queue\n        return 0;\n        // Examine the front of the queue to figure out the difference between the\n        // batchId and indexes in the array. Note that since the queue is ordered\n        // by batchId, if the first batch has a larger batchId then the requested\n        // batchId doesn't exist in the queue.\n                return t - this.Fs[0].batchId;\n    }\n    /**\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\n     * other functions that uses this code easier to read and more efficent.\n     */    Di(t) {\n        const e = this.Ci(t);\n        if (e < 0 || e >= this.Fs.length) return null;\n        return this.Fs[e];\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newMemoryRemoteDocumentCache()`.\n */\nclass fo {\n    /**\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\n     * expected to just return 0 to avoid unnecessarily doing the work of\n     * calculating the size.\n     */\n    constructor(t) {\n        this.ki = t, \n        /** Underlying cache of documents and their read times. */\n        this.docs = new Cn(xt.comparator), \n        /** Size of all cached documents. */\n        this.size = 0;\n    }\n    setIndexManager(t) {\n        this.indexManager = t;\n    }\n    /**\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\n     *\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\n     * returned by `newChangeBuffer()`.\n     */    addEntry(t, e) {\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.ki(e);\n        return this.docs = this.docs.insert(n, {\n            document: e.mutableCopy(),\n            size: r\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\n    }\n    /**\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\n     *\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n     * returned by `newChangeBuffer()`.\n     */    removeEntry(t) {\n        const e = this.docs.get(t);\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\n    }\n    getEntry(t, e) {\n        const n = this.docs.get(e);\n        return ui.resolve(n ? n.document.mutableCopy() : te.newInvalidDocument(e));\n    }\n    getEntries(t, e) {\n        let n = Fn();\n        return e.forEach((t => {\n            const e = this.docs.get(t);\n            n = n.insert(t, e ? e.document.mutableCopy() : te.newInvalidDocument(t));\n        })), ui.resolve(n);\n    }\n    getAll(t, e, n) {\n        let s = Fn();\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\n        // the documents we need to match the query against.\n                const i = new xt(e.child(\"\")), r = this.docs.getIteratorFrom(i);\n        for (;r.hasNext(); ) {\n            const {key: t, value: {document: i}} = r.getNext();\n            if (!e.isPrefixOf(t.path)) break;\n            t.path.length > e.length + 1 || (i.readTime.compareTo(n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\n        }\n        return ui.resolve(s);\n    }\n    Mi(t, e) {\n        return ui.forEach(this.docs, (t => e(t)));\n    }\n    newChangeBuffer(t) {\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\n        // a separate changelog and does not need special handling for removals.\n        return new _o(this);\n    }\n    getSize(t) {\n        return ui.resolve(this.size);\n    }\n}\n\n/**\n * Creates a new memory-only RemoteDocumentCache.\n *\n * @param sizer - Used to assess the size of a document. For eager GC, this is\n * expected to just return 0 to avoid unnecessarily doing the work of\n * calculating the size.\n */\n/**\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\n */\nclass _o extends vr {\n    constructor(t) {\n        super(), this.Un = t;\n    }\n    applyChanges(t) {\n        const e = [];\n        return this.changes.forEach(((n, s) => {\n            s.isValidDocument() ? e.push(this.Un.addEntry(t, s)) : this.Un.removeEntry(n);\n        })), ui.waitFor(e);\n    }\n    getFromCache(t, e) {\n        return this.Un.getEntry(t, e);\n    }\n    getAllFromCache(t, e) {\n        return this.Un.getEntries(t, e);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class wo {\n    constructor(t) {\n        this.persistence = t, \n        /**\n         * Maps a target to the data about that target\n         */\n        this.Oi = new Dn((t => ce(t)), le), \n        /** The last received snapshot version. */\n        this.lastRemoteSnapshotVersion = ct.min(), \n        /** The highest numbered target ID encountered. */\n        this.highestTargetId = 0, \n        /** The highest sequence number encountered. */\n        this.$i = 0, \n        /**\n         * A ordered bidirectional mapping between documents and the remote target\n         * IDs.\n         */\n        this.Fi = new co, this.targetCount = 0, this.Bi = mr.mn();\n    }\n    forEachTarget(t, e) {\n        return this.Oi.forEach(((t, n) => e(n))), ui.resolve();\n    }\n    getLastRemoteSnapshotVersion(t) {\n        return ui.resolve(this.lastRemoteSnapshotVersion);\n    }\n    getHighestSequenceNumber(t) {\n        return ui.resolve(this.$i);\n    }\n    allocateTargetId(t) {\n        return this.highestTargetId = this.Bi.next(), ui.resolve(this.highestTargetId);\n    }\n    setTargetsMetadata(t, e, n) {\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.$i && (this.$i = e), \n        ui.resolve();\n    }\n    In(t) {\n        this.Oi.set(t.target, t);\n        const e = t.targetId;\n        e > this.highestTargetId && (this.Bi = new mr(e), this.highestTargetId = e), t.sequenceNumber > this.$i && (this.$i = t.sequenceNumber);\n    }\n    addTargetData(t, e) {\n        return this.In(e), this.targetCount += 1, ui.resolve();\n    }\n    updateTargetData(t, e) {\n        return this.In(e), ui.resolve();\n    }\n    removeTargetData(t, e) {\n        return this.Oi.delete(e.target), this.Fi.Ri(e.targetId), this.targetCount -= 1, \n        ui.resolve();\n    }\n    removeTargets(t, e, n) {\n        let s = 0;\n        const i = [];\n        return this.Oi.forEach(((r, o) => {\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Oi.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \n            s++);\n        })), ui.waitFor(i).next((() => s));\n    }\n    getTargetCount(t) {\n        return ui.resolve(this.targetCount);\n    }\n    getTargetData(t, e) {\n        const n = this.Oi.get(e) || null;\n        return ui.resolve(n);\n    }\n    addMatchingKeys(t, e, n) {\n        return this.Fi.Ti(e, n), ui.resolve();\n    }\n    removeMatchingKeys(t, e, n) {\n        this.Fi.Ai(e, n);\n        const s = this.persistence.referenceDelegate, i = [];\n        return s && e.forEach((e => {\n            i.push(s.markPotentiallyOrphaned(t, e));\n        })), ui.waitFor(i);\n    }\n    removeMatchingKeysForTargetId(t, e) {\n        return this.Fi.Ri(e), ui.resolve();\n    }\n    getMatchingKeysForTargetId(t, e) {\n        const n = this.Fi.Pi(e);\n        return ui.resolve(n);\n    }\n    containsKey(t, e) {\n        return ui.resolve(this.Fi.containsKey(e));\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A memory-backed instance of Persistence. Data is stored only in RAM and\n * not persisted across sessions.\n */\nclass mo {\n    /**\n     * The constructor accepts a factory for creating a reference delegate. This\n     * allows both the delegate and this instance to have strong references to\n     * each other without having nullable fields that would then need to be\n     * checked or asserted on every access.\n     */\n    constructor(t, e) {\n        this.Li = {}, this.overlays = {}, this.Zn = new nt(0), this.ts = !1, this.ts = !0, \n        this.referenceDelegate = t(this), this.hs = new wo(this);\n        this.indexManager = new Zi, this.ls = function(t) {\n            return new fo(t);\n        }((t => this.referenceDelegate.qi(t))), this.M = new Ri(e), this.fs = new ao(this.M);\n    }\n    start() {\n        return Promise.resolve();\n    }\n    shutdown() {\n        // No durable state to ensure is closed on shutdown.\n        return this.ts = !1, Promise.resolve();\n    }\n    get started() {\n        return this.ts;\n    }\n    setDatabaseDeletedListener() {\n        // No op.\n    }\n    setNetworkEnabled() {\n        // No op.\n    }\n    getIndexManager(t) {\n        // We do not currently support indices for memory persistence, so we can\n        // return the same shared instance of the memory index manager.\n        return this.indexManager;\n    }\n    getDocumentOverlayCache(t) {\n        let e = this.overlays[t.toKey()];\n        return e || (e = new uo, this.overlays[t.toKey()] = e), e;\n    }\n    getMutationQueue(t, e) {\n        let n = this.Li[t.toKey()];\n        return n || (n = new lo(e, this.referenceDelegate), this.Li[t.toKey()] = n), n;\n    }\n    getTargetCache() {\n        return this.hs;\n    }\n    getRemoteDocumentCache() {\n        return this.ls;\n    }\n    getBundleCache() {\n        return this.fs;\n    }\n    runTransaction(t, e, n) {\n        O(\"MemoryPersistence\", \"Starting transaction:\", t);\n        const s = new go(this.Zn.next());\n        return this.referenceDelegate.Ui(), n(s).next((t => this.referenceDelegate.Ki(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \n        t)));\n    }\n    Gi(t, e) {\n        return ui.or(Object.values(this.Li).map((n => () => n.containsKey(t, e))));\n    }\n}\n\n/**\n * Memory persistence is not actually transactional, but future implementations\n * may have transaction-scoped state.\n */ class go extends ai {\n    constructor(t) {\n        super(), this.currentSequenceNumber = t;\n    }\n}\n\nclass yo {\n    constructor(t) {\n        this.persistence = t, \n        /** Tracks all documents that are active in Query views. */\n        this.Qi = new co, \n        /** The list of documents that are potentially GCed after each transaction. */\n        this.ji = null;\n    }\n    static Wi(t) {\n        return new yo(t);\n    }\n    get zi() {\n        if (this.ji) return this.ji;\n        throw L();\n    }\n    addReference(t, e, n) {\n        return this.Qi.addReference(n, e), this.zi.delete(n.toString()), ui.resolve();\n    }\n    removeReference(t, e, n) {\n        return this.Qi.removeReference(n, e), this.zi.add(n.toString()), ui.resolve();\n    }\n    markPotentiallyOrphaned(t, e) {\n        return this.zi.add(e.toString()), ui.resolve();\n    }\n    removeTarget(t, e) {\n        this.Qi.Ri(e.targetId).forEach((t => this.zi.add(t.toString())));\n        const n = this.persistence.getTargetCache();\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\n            t.forEach((t => this.zi.add(t.toString())));\n        })).next((() => n.removeTargetData(t, e)));\n    }\n    Ui() {\n        this.ji = new Set;\n    }\n    Ki(t) {\n        // Remove newly orphaned documents.\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\n        return ui.forEach(this.zi, (n => {\n            const s = xt.fromPath(n);\n            return this.Hi(t, s).next((t => {\n                t || e.removeEntry(s, ct.min());\n            }));\n        })).next((() => (this.ji = null, e.apply(t))));\n    }\n    updateLimboDocument(t, e) {\n        return this.Hi(t, e).next((t => {\n            t ? this.zi.delete(e.toString()) : this.zi.add(e.toString());\n        }));\n    }\n    qi(t) {\n        // For eager GC, we don't care about the document size, there are no size thresholds.\n        return 0;\n    }\n    Hi(t, e) {\n        return ui.or([ () => ui.resolve(this.Qi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.Gi(t, e) ]);\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// The format of the LocalStorage key that stores the client state is:\n//     firestore_clients_<persistence_prefix>_<instance_key>\n/** Assembles the key for a client state in WebStorage */\nfunction po(t, e) {\n    return `firestore_clients_${t}_${e}`;\n}\n\n// The format of the WebStorage key that stores the mutation state is:\n//     firestore_mutations_<persistence_prefix>_<batch_id>\n//     (for unauthenticated users)\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\n\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\n// contain.\n/** Assembles the key for a mutation batch in WebStorage */\nfunction Io(t, e, n) {\n    let s = `firestore_mutations_${t}_${n}`;\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\n}\n\n// The format of the WebStorage key that stores a query target's metadata is:\n//     firestore_targets_<persistence_prefix>_<target_id>\n/** Assembles the key for a query state in WebStorage */\nfunction To(t, e) {\n    return `firestore_targets_${t}_${e}`;\n}\n\n// The WebStorage prefix that stores the primary tab's online state. The\n// format of the key is:\n//     firestore_online_state_<persistence_prefix>\n/**\n * Holds the state of a mutation batch, including its user ID, batch ID and\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\n */\n// Visible for testing\nclass Eo {\n    constructor(t, e, n, s) {\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\n    }\n    /**\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\n     * Logs a warning and returns null if the format of the data is not valid.\n     */    static Ji(t, e, n) {\n        const s = JSON.parse(n);\n        let i, r = \"object\" == typeof s && -1 !== [ \"pending\", \"acknowledged\", \"rejected\" ].indexOf(s.state) && (void 0 === s.error || \"object\" == typeof s.error);\n        return r && s.error && (r = \"string\" == typeof s.error.message && \"string\" == typeof s.error.code, \n        r && (i = new Q(s.error.code, s.error.message))), r ? new Eo(t, e, s.state, i) : ($(\"SharedClientState\", `Failed to parse mutation state for ID '${e}': ${n}`), \n        null);\n    }\n    Yi() {\n        const t = {\n            state: this.state,\n            updateTimeMs: Date.now()\n        };\n        return this.error && (t.error = {\n            code: this.error.code,\n            message: this.error.message\n        }), JSON.stringify(t);\n    }\n}\n\n/**\n * Holds the state of a query target, including its target ID and whether the\n * target is 'not-current', 'current' or 'rejected'.\n */\n// Visible for testing\nclass Ao {\n    constructor(t, e, n) {\n        this.targetId = t, this.state = e, this.error = n;\n    }\n    /**\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\n     * Logs a warning and returns null if the format of the data is not valid.\n     */    static Ji(t, e) {\n        const n = JSON.parse(e);\n        let s, i = \"object\" == typeof n && -1 !== [ \"not-current\", \"current\", \"rejected\" ].indexOf(n.state) && (void 0 === n.error || \"object\" == typeof n.error);\n        return i && n.error && (i = \"string\" == typeof n.error.message && \"string\" == typeof n.error.code, \n        i && (s = new Q(n.error.code, n.error.message))), i ? new Ao(t, n.state, s) : ($(\"SharedClientState\", `Failed to parse target state for ID '${t}': ${e}`), \n        null);\n    }\n    Yi() {\n        const t = {\n            state: this.state,\n            updateTimeMs: Date.now()\n        };\n        return this.error && (t.error = {\n            code: this.error.code,\n            message: this.error.message\n        }), JSON.stringify(t);\n    }\n}\n\n/**\n * This class represents the immutable ClientState for a client read from\n * WebStorage, containing the list of active query targets.\n */ class Ro {\n    constructor(t, e) {\n        this.clientId = t, this.activeTargetIds = e;\n    }\n    /**\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\n     * Logs a warning and returns null if the format of the data is not valid.\n     */    static Ji(t, e) {\n        const n = JSON.parse(e);\n        let s = \"object\" == typeof n && n.activeTargetIds instanceof Array, i = jn();\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \n        i = i.add(n.activeTargetIds[t]);\n        return s ? new Ro(t, i) : ($(\"SharedClientState\", `Failed to parse client data for instance '${t}': ${e}`), \n        null);\n    }\n}\n\n/**\n * This class represents the online state for all clients participating in\n * multi-tab. The online state is only written to by the primary client, and\n * used in secondary clients to update their query views.\n */ class bo {\n    constructor(t, e) {\n        this.clientId = t, this.onlineState = e;\n    }\n    /**\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\n     * Logs a warning and returns null if the format of the data is not valid.\n     */    static Ji(t) {\n        const e = JSON.parse(t);\n        return \"object\" == typeof e && -1 !== [ \"Unknown\", \"Online\", \"Offline\" ].indexOf(e.onlineState) && \"string\" == typeof e.clientId ? new bo(e.clientId, e.onlineState) : ($(\"SharedClientState\", `Failed to parse online state: ${t}`), \n        null);\n    }\n}\n\n/**\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\n * mutable and keeps track of all pending mutations, which allows us to\n * update the range of pending mutation batch IDs as new mutations are added or\n * removed.\n *\n * The data in `LocalClientState` is not read from WebStorage and instead\n * updated via its instance methods. The updated state can be serialized via\n * `toWebStorageJSON()`.\n */\n// Visible for testing.\nclass Po {\n    constructor() {\n        this.activeTargetIds = jn();\n    }\n    Xi(t) {\n        this.activeTargetIds = this.activeTargetIds.add(t);\n    }\n    Zi(t) {\n        this.activeTargetIds = this.activeTargetIds.delete(t);\n    }\n    /**\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\n     * Does not encode `clientId` as it is part of the key in WebStorage.\n     */    Yi() {\n        const t = {\n            activeTargetIds: this.activeTargetIds.toArray(),\n            updateTimeMs: Date.now()\n        };\n        return JSON.stringify(t);\n    }\n}\n\n/**\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\n * backing store for the SharedClientState. It keeps track of all active\n * clients and supports modifications of the local client's data.\n */ class Vo {\n    constructor(t, e, n, s, i) {\n        this.window = t, this.Hn = e, this.persistenceKey = n, this.tr = s, this.syncEngine = null, \n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.er = this.nr.bind(this), \n        this.sr = new Cn(rt), this.started = !1, \n        /**\n         * Captures WebStorage events that occur before `start()` is called. These\n         * events are replayed once `WebStorageSharedClientState` is started.\n         */\n        this.ir = [];\n        // Escape the special characters mentioned here:\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n        const r = n.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n        this.storage = this.window.localStorage, this.currentUser = i, this.rr = po(this.persistenceKey, this.tr), \n        this.ar = \n        /** Assembles the key for the current sequence number. */\n        function(t) {\n            return `firestore_sequence_number_${t}`;\n        }\n        /**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (this.persistenceKey), this.sr = this.sr.insert(this.tr, new Po), this.ur = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \n        this.cr = new RegExp(`^firestore_mutations_${r}_(\\\\d+)(?:_(.*))?$`), this.hr = new RegExp(`^firestore_targets_${r}_(\\\\d+)$`), \n        this.lr = \n        /** Assembles the key for the online state of the primary tab. */\n        function(t) {\n            return `firestore_online_state_${t}`;\n        }\n        // The WebStorage prefix that plays as a event to indicate the remote documents\n        // might have changed due to some secondary tabs loading a bundle.\n        // format of the key is:\n        //     firestore_bundle_loaded_<persistenceKey>\n        (this.persistenceKey), this.dr = function(t) {\n            return `firestore_bundle_loaded_${t}`;\n        }\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\n        (this.persistenceKey), \n        // Rather than adding the storage observer during start(), we add the\n        // storage observer during initialization. This ensures that we collect\n        // events before other components populate their initial state (during their\n        // respective start() calls). Otherwise, we might for example miss a\n        // mutation that is added after LocalStore's start() processed the existing\n        // mutations but before we observe WebStorage events.\n        this.window.addEventListener(\"storage\", this.er);\n    }\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\n        return !(!t || !t.localStorage);\n    }\n    async start() {\n        // Retrieve the list of existing clients to backfill the data in\n        // SharedClientState.\n        const t = await this.syncEngine.Ms();\n        for (const e of t) {\n            if (e === this.tr) continue;\n            const t = this.getItem(po(this.persistenceKey, e));\n            if (t) {\n                const n = Ro.Ji(e, t);\n                n && (this.sr = this.sr.insert(n.clientId, n));\n            }\n        }\n        this._r();\n        // Check if there is an existing online state and call the callback handler\n        // if applicable.\n        const e = this.storage.getItem(this.lr);\n        if (e) {\n            const t = this.wr(e);\n            t && this.mr(t);\n        }\n        for (const t of this.ir) this.nr(t);\n        this.ir = [], \n        // Register a window unload hook to remove the client metadata entry from\n        // WebStorage even if `shutdown()` was not called.\n        this.window.addEventListener(\"pagehide\", (() => this.shutdown())), this.started = !0;\n    }\n    writeSequenceNumber(t) {\n        this.setItem(this.ar, JSON.stringify(t));\n    }\n    getAllActiveQueryTargets() {\n        return this.gr(this.sr);\n    }\n    isActiveQueryTarget(t) {\n        let e = !1;\n        return this.sr.forEach(((n, s) => {\n            s.activeTargetIds.has(t) && (e = !0);\n        })), e;\n    }\n    addPendingMutation(t) {\n        this.yr(t, \"pending\");\n    }\n    updateMutationState(t, e, n) {\n        this.yr(t, e, n), \n        // Once a final mutation result is observed by other clients, they no longer\n        // access the mutation's metadata entry. Since WebStorage replays events\n        // in order, it is safe to delete the entry right after updating it.\n        this.pr(t);\n    }\n    addLocalQueryTarget(t) {\n        let e = \"not-current\";\n        // Lookup an existing query state if the target ID was already registered\n        // by another tab\n                if (this.isActiveQueryTarget(t)) {\n            const n = this.storage.getItem(To(this.persistenceKey, t));\n            if (n) {\n                const s = Ao.Ji(t, n);\n                s && (e = s.state);\n            }\n        }\n        return this.Ir.Xi(t), this._r(), e;\n    }\n    removeLocalQueryTarget(t) {\n        this.Ir.Zi(t), this._r();\n    }\n    isLocalQueryTarget(t) {\n        return this.Ir.activeTargetIds.has(t);\n    }\n    clearQueryState(t) {\n        this.removeItem(To(this.persistenceKey, t));\n    }\n    updateQueryState(t, e, n) {\n        this.Tr(t, e, n);\n    }\n    handleUserChange(t, e, n) {\n        e.forEach((t => {\n            this.pr(t);\n        })), this.currentUser = t, n.forEach((t => {\n            this.addPendingMutation(t);\n        }));\n    }\n    setOnlineState(t) {\n        this.Er(t);\n    }\n    notifyBundleLoaded() {\n        this.Ar();\n    }\n    shutdown() {\n        this.started && (this.window.removeEventListener(\"storage\", this.er), this.removeItem(this.rr), \n        this.started = !1);\n    }\n    getItem(t) {\n        const e = this.storage.getItem(t);\n        return O(\"SharedClientState\", \"READ\", t, e), e;\n    }\n    setItem(t, e) {\n        O(\"SharedClientState\", \"SET\", t, e), this.storage.setItem(t, e);\n    }\n    removeItem(t) {\n        O(\"SharedClientState\", \"REMOVE\", t), this.storage.removeItem(t);\n    }\n    nr(t) {\n        // Note: The function is typed to take Event to be interface-compatible with\n        // `Window.addEventListener`.\n        const e = t;\n        if (e.storageArea === this.storage) {\n            if (O(\"SharedClientState\", \"EVENT\", e.key, e.newValue), e.key === this.rr) return void $(\"Received WebStorage notification for local change. Another client might have garbage-collected our state\");\n            this.Hn.enqueueRetryable((async () => {\n                if (this.started) {\n                    if (null !== e.key) if (this.ur.test(e.key)) {\n                        if (null == e.newValue) {\n                            const t = this.Rr(e.key);\n                            return this.br(t, null);\n                        }\n                        {\n                            const t = this.Pr(e.key, e.newValue);\n                            if (t) return this.br(t.clientId, t);\n                        }\n                    } else if (this.cr.test(e.key)) {\n                        if (null !== e.newValue) {\n                            const t = this.Vr(e.key, e.newValue);\n                            if (t) return this.vr(t);\n                        }\n                    } else if (this.hr.test(e.key)) {\n                        if (null !== e.newValue) {\n                            const t = this.Sr(e.key, e.newValue);\n                            if (t) return this.Dr(t);\n                        }\n                    } else if (e.key === this.lr) {\n                        if (null !== e.newValue) {\n                            const t = this.wr(e.newValue);\n                            if (t) return this.mr(t);\n                        }\n                    } else if (e.key === this.ar) {\n                        const t = function(t) {\n                            let e = nt.A;\n                            if (null != t) try {\n                                const n = JSON.parse(t);\n                                q(\"number\" == typeof n), e = n;\n                            } catch (t) {\n                                $(\"SharedClientState\", \"Failed to read sequence number from WebStorage\", t);\n                            }\n                            return e;\n                        }\n                        /**\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\n * clients using memory persistence. The state in this class remains fully\n * isolated and no synchronization is performed.\n */ (e.newValue);\n                        t !== nt.A && this.sequenceNumberHandler(t);\n                    } else if (e.key === this.dr) return this.syncEngine.Cr();\n                } else this.ir.push(e);\n            }));\n        }\n    }\n    get Ir() {\n        return this.sr.get(this.tr);\n    }\n    _r() {\n        this.setItem(this.rr, this.Ir.Yi());\n    }\n    yr(t, e, n) {\n        const s = new Eo(this.currentUser, t, e, n), i = Io(this.persistenceKey, this.currentUser, t);\n        this.setItem(i, s.Yi());\n    }\n    pr(t) {\n        const e = Io(this.persistenceKey, this.currentUser, t);\n        this.removeItem(e);\n    }\n    Er(t) {\n        const e = {\n            clientId: this.tr,\n            onlineState: t\n        };\n        this.storage.setItem(this.lr, JSON.stringify(e));\n    }\n    Tr(t, e, n) {\n        const s = To(this.persistenceKey, t), i = new Ao(t, e, n);\n        this.setItem(s, i.Yi());\n    }\n    Ar() {\n        this.setItem(this.dr, \"value-not-used\");\n    }\n    /**\n     * Parses a client state key in WebStorage. Returns null if the key does not\n     * match the expected key format.\n     */    Rr(t) {\n        const e = this.ur.exec(t);\n        return e ? e[1] : null;\n    }\n    /**\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\n     * be parsed.\n     */    Pr(t, e) {\n        const n = this.Rr(t);\n        return Ro.Ji(n, e);\n    }\n    /**\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\n     * could not be parsed.\n     */    Vr(t, e) {\n        const n = this.cr.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\n        return Eo.Ji(new C(i), s, e);\n    }\n    /**\n     * Parses a query target state from WebStorage. Returns 'null' if the value\n     * could not be parsed.\n     */    Sr(t, e) {\n        const n = this.hr.exec(t), s = Number(n[1]);\n        return Ao.Ji(s, e);\n    }\n    /**\n     * Parses an online state from WebStorage. Returns 'null' if the value\n     * could not be parsed.\n     */    wr(t) {\n        return bo.Ji(t);\n    }\n    async vr(t) {\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.Nr(t.batchId, t.state, t.error);\n        O(\"SharedClientState\", `Ignoring mutation for non-active user ${t.user.uid}`);\n    }\n    Dr(t) {\n        return this.syncEngine.kr(t.targetId, t.state, t.error);\n    }\n    br(t, e) {\n        const n = e ? this.sr.insert(t, e) : this.sr.remove(t), s = this.gr(this.sr), i = this.gr(n), r = [], o = [];\n        return i.forEach((t => {\n            s.has(t) || r.push(t);\n        })), s.forEach((t => {\n            i.has(t) || o.push(t);\n        })), this.syncEngine.Mr(r, o).then((() => {\n            this.sr = n;\n        }));\n    }\n    mr(t) {\n        // We check whether the client that wrote this online state is still active\n        // by comparing its client ID to the list of clients kept active in\n        // IndexedDb. If a client does not update their IndexedDb client state\n        // within 5 seconds, it is considered inactive and we don't emit an online\n        // state event.\n        this.sr.get(t.clientId) && this.onlineStateHandler(t.onlineState);\n    }\n    gr(t) {\n        let e = jn();\n        return t.forEach(((t, n) => {\n            e = e.unionWith(n.activeTargetIds);\n        })), e;\n    }\n}\n\nclass vo {\n    constructor() {\n        this.Or = new Po, this.$r = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\n    }\n    addPendingMutation(t) {\n        // No op.\n    }\n    updateMutationState(t, e, n) {\n        // No op.\n    }\n    addLocalQueryTarget(t) {\n        return this.Or.Xi(t), this.$r[t] || \"not-current\";\n    }\n    updateQueryState(t, e, n) {\n        this.$r[t] = e;\n    }\n    removeLocalQueryTarget(t) {\n        this.Or.Zi(t);\n    }\n    isLocalQueryTarget(t) {\n        return this.Or.activeTargetIds.has(t);\n    }\n    clearQueryState(t) {\n        delete this.$r[t];\n    }\n    getAllActiveQueryTargets() {\n        return this.Or.activeTargetIds;\n    }\n    isActiveQueryTarget(t) {\n        return this.Or.activeTargetIds.has(t);\n    }\n    start() {\n        return this.Or = new Po, Promise.resolve();\n    }\n    handleUserChange(t, e, n) {\n        // No op.\n    }\n    setOnlineState(t) {\n        // No op.\n    }\n    shutdown() {}\n    writeSequenceNumber(t) {}\n    notifyBundleLoaded() {\n        // No op.\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class So {\n    Fr(t) {\n        // No-op.\n    }\n    shutdown() {\n        // No-op.\n    }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\n/* eslint-disable no-restricted-globals */\n/**\n * Browser implementation of ConnectivityMonitor.\n */\nclass Do {\n    constructor() {\n        this.Br = () => this.Lr(), this.qr = () => this.Ur(), this.Kr = [], this.Gr();\n    }\n    Fr(t) {\n        this.Kr.push(t);\n    }\n    shutdown() {\n        window.removeEventListener(\"online\", this.Br), window.removeEventListener(\"offline\", this.qr);\n    }\n    Gr() {\n        window.addEventListener(\"online\", this.Br), window.addEventListener(\"offline\", this.qr);\n    }\n    Lr() {\n        O(\"ConnectivityMonitor\", \"Network connectivity changed: AVAILABLE\");\n        for (const t of this.Kr) t(0 /* AVAILABLE */);\n    }\n    Ur() {\n        O(\"ConnectivityMonitor\", \"Network connectivity changed: UNAVAILABLE\");\n        for (const t of this.Kr) t(1 /* UNAVAILABLE */);\n    }\n    // TODO(chenbrian): Consider passing in window either into this component or\n    // here for testing via FakeWindow.\n    /** Checks that all used attributes of window are available. */\n    static vt() {\n        return \"undefined\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Co = {\n    BatchGetDocuments: \"batchGet\",\n    Commit: \"commit\",\n    RunQuery: \"runQuery\"\n};\n\n/**\n * Maps RPC names to the corresponding REST endpoint name.\n *\n * We use array notation to avoid mangling.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides a simple helper class that implements the Stream interface to\n * bridge to other implementations that are streams but do not implement the\n * interface. The stream callbacks are invoked with the callOn... methods.\n */\nclass xo {\n    constructor(t) {\n        this.Qr = t.Qr, this.jr = t.jr;\n    }\n    Wr(t) {\n        this.zr = t;\n    }\n    Hr(t) {\n        this.Jr = t;\n    }\n    onMessage(t) {\n        this.Yr = t;\n    }\n    close() {\n        this.jr();\n    }\n    send(t) {\n        this.Qr(t);\n    }\n    Xr() {\n        this.zr();\n    }\n    Zr(t) {\n        this.Jr(t);\n    }\n    eo(t) {\n        this.Yr(t);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class No extends \n/**\n * Base class for all Rest-based connections to the backend (WebChannel and\n * HTTP).\n */\nclass {\n    constructor(t) {\n        this.databaseInfo = t, this.databaseId = t.databaseId;\n        const e = t.ssl ? \"https\" : \"http\";\n        this.no = e + \"://\" + t.host, this.so = \"projects/\" + this.databaseId.projectId + \"/databases/\" + this.databaseId.database + \"/documents\";\n    }\n    io(t, e, n, s, i) {\n        const r = this.ro(t, e);\n        O(\"RestConnection\", \"Sending: \", r, n);\n        const o = {};\n        return this.oo(o, s, i), this.ao(t, r, o, n).then((t => (O(\"RestConnection\", \"Received: \", t), \n        t)), (e => {\n            throw F(\"RestConnection\", `${t} failed with error: `, e, \"url: \", r, \"request:\", n), \n            e;\n        }));\n    }\n    uo(t, e, n, s, i) {\n        // The REST API automatically aggregates all of the streamed results, so we\n        // can just use the normal invoke() method.\n        return this.io(t, e, n, s, i);\n    }\n    /**\n     * Modifies the headers for a request, adding any authorization token if\n     * present and any additional headers for the request.\n     */    oo(t, e, n) {\n        t[\"X-Goog-Api-Client\"] = \"gl-js/ fire/\" + x, \n        // Content-Type: text/plain will avoid preflight requests which might\n        // mess with CORS and redirects by proxies. If we add custom headers\n        // we will need to change this code to potentially use the $httpOverwrite\n        // parameter supported by ESF to avoid triggering preflight requests.\n        t[\"Content-Type\"] = \"text/plain\", this.databaseInfo.appId && (t[\"X-Firebase-GMPID\"] = this.databaseInfo.appId), \n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\n    }\n    ro(t, e) {\n        const n = Co[t];\n        return `${this.no}/v1/${e}:${n}`;\n    }\n} {\n    constructor(t) {\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \n        this.useFetchStreams = t.useFetchStreams;\n    }\n    ao(t, e, n, s) {\n        return new Promise(((i, r) => {\n            const o = new T;\n            o.listenOnce(E.COMPLETE, (() => {\n                try {\n                    switch (o.getLastErrorCode()) {\n                      case A.NO_ERROR:\n                        const e = o.getResponseJson();\n                        O(\"Connection\", \"XHR received:\", JSON.stringify(e)), i(e);\n                        break;\n\n                      case A.TIMEOUT:\n                        O(\"Connection\", 'RPC \"' + t + '\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \"Request time out\"));\n                        break;\n\n                      case A.HTTP_ERROR:\n                        const n = o.getStatus();\n                        if (O(\"Connection\", 'RPC \"' + t + '\" failed with status:', n, \"response text:\", o.getResponseText()), \n                        n > 0) {\n                            const t = o.getResponseJson().error;\n                            if (t && t.status && t.message) {\n                                const e = function(t) {\n                                    const e = t.toLowerCase().replace(/_/g, \"-\");\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\n                                }(t.status);\n                                r(new Q(e, t.message));\n                            } else r(new Q(G.UNKNOWN, \"Server responded with status \" + o.getStatus()));\n                        } else \n                        // If we received an HTTP_ERROR but there's no status code,\n                        // it's most probably a connection issue\n                        r(new Q(G.UNAVAILABLE, \"Connection failed.\"));\n                        break;\n\n                      default:\n                        L();\n                    }\n                } finally {\n                    O(\"Connection\", 'RPC \"' + t + '\" completed.');\n                }\n            }));\n            const a = JSON.stringify(s);\n            o.send(e, \"POST\", a, n, 15);\n        }));\n    }\n    co(t, e, n) {\n        const s = [ this.no, \"/\", \"google.firestore.v1.Firestore\", \"/\", t, \"/channel\" ], i = R(), r = b(), o = {\n            // Required for backend stickiness, routing behavior is based on this\n            // parameter.\n            httpSessionIdParam: \"gsessionid\",\n            initMessageHeaders: {},\n            messageUrlParams: {\n                // This param is used to improve routing and project isolation by the\n                // backend and must be included in every request.\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\n            },\n            sendRawJson: !0,\n            supportsCrossDomainXhr: !0,\n            internalChannelParams: {\n                // Override the default timeout (randomized between 10-20 seconds) since\n                // a large write batch on a slow internet connection may take a long\n                // time to send to the backend. Rather than have WebChannel impose a\n                // tight timeout which could lead to infinite timeouts and retries, we\n                // set it very large (5-10 minutes) and rely on the browser's builtin\n                // timeouts to kick in if the request isn't working.\n                forwardChannelRequestTimeoutMs: 6e5\n            },\n            forceLongPolling: this.forceLongPolling,\n            detectBufferingProxy: this.autoDetectLongPolling\n        };\n        this.useFetchStreams && (o.xmlHttpFactory = new P({})), this.oo(o.initMessageHeaders, e, n), \n        // Sending the custom headers we just added to request.initMessageHeaders\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\n        // request because the XHR will no longer meet the criteria for a \"simple\"\n        // CORS request:\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n        // Therefore to avoid the CORS preflight request (an extra network\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\n        // the headers should instead be encoded into a special \"$httpHeaders\" query\n        // parameter, which is recognized by the webchannel backend. This is\n        // formally defined here:\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\n        // known to (sometimes) not include an Origin. See\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\n        f() || d() || _() || w() || m() || g() || (o.httpHeadersOverwriteParam = \"$httpHeaders\");\n        const a = s.join(\"\");\n        O(\"Connection\", \"Creating WebChannel: \" + a, o);\n        const u = i.createWebChannel(a, o);\n        // WebChannel supports sending the first message with the handshake - saving\n        // a network round trip. However, it will have to call send in the same\n        // JS event loop as open. In order to enforce this, we delay actually\n        // opening the WebChannel until send is called. Whether we have called\n        // open is tracked with this variable.\n                let c = !1, h = !1;\n        // A flag to determine whether the stream was closed (by us or through an\n        // error/close event) to avoid delivering multiple close events or sending\n        // on a closed stream\n                const l = new xo({\n            Qr: t => {\n                h ? O(\"Connection\", \"Not sending because WebChannel is closed:\", t) : (c || (O(\"Connection\", \"Opening WebChannel transport.\"), \n                u.open(), c = !0), O(\"Connection\", \"WebChannel sending:\", t), u.send(t));\n            },\n            jr: () => u.close()\n        }), y = (t, e, n) => {\n            // TODO(dimond): closure typing seems broken because WebChannel does\n            // not implement goog.events.Listenable\n            t.listen(e, (t => {\n                try {\n                    n(t);\n                } catch (t) {\n                    setTimeout((() => {\n                        throw t;\n                    }), 0);\n                }\n            }));\n        };\n        // Closure events are guarded and exceptions are swallowed, so catch any\n        // exception and rethrow using a setTimeout so they become visible again.\n        // Note that eventually this function could go away if we are confident\n        // enough the code is exception free.\n                return y(u, V.EventType.OPEN, (() => {\n            h || O(\"Connection\", \"WebChannel transport opened.\");\n        })), y(u, V.EventType.CLOSE, (() => {\n            h || (h = !0, O(\"Connection\", \"WebChannel transport closed\"), l.Zr());\n        })), y(u, V.EventType.ERROR, (t => {\n            h || (h = !0, F(\"Connection\", \"WebChannel transport errored:\", t), l.Zr(new Q(G.UNAVAILABLE, \"The operation could not be completed\")));\n        })), y(u, V.EventType.MESSAGE, (t => {\n            var e;\n            if (!h) {\n                const n = t.data[0];\n                q(!!n);\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\n                // (and only errors) to be wrapped in an extra array. To be forward\n                // compatible with the bug we need to check either condition. The latter\n                // can be removed once the fix has been rolled out.\n                // Use any because msgData.error is not typed.\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\n                if (i) {\n                    O(\"Connection\", \"WebChannel received error:\", i);\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\n                    const t = i.status;\n                    let e = \n                    /**\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\n *\n * @returns The Code equivalent to the given status string or undefined if\n *     there is no match.\n */\n                    function(t) {\n                        // lookup by string\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n                        const e = Pn[t];\n                        if (void 0 !== e) return Sn(e);\n                    }(t), n = i.message;\n                    void 0 === e && (e = G.INTERNAL, n = \"Unknown error status: \" + t + \" with message \" + i.message), \n                    // Mark closed so no further events are propagated\n                    h = !0, l.Zr(new Q(e, n)), u.close();\n                } else O(\"Connection\", \"WebChannel received:\", n), l.eo(n);\n            }\n        })), y(r, v.STAT_EVENT, (t => {\n            t.stat === S.PROXY ? O(\"Connection\", \"Detected buffering proxy\") : t.stat === S.NOPROXY && O(\"Connection\", \"Detected no buffering proxy\");\n        })), setTimeout((() => {\n            // Technically we could/should wait for the WebChannel opened event,\n            // but because we want to send the first message with the WebChannel\n            // handshake we pretend the channel opened here (asynchronously), and\n            // then delay the actual open until the first message is sent.\n            l.Xr();\n        }), 0), l;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Initializes the WebChannelConnection for the browser. */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** The Platform's 'window' implementation or null if not available. */\nfunction ko() {\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\n    // eslint-disable-next-line no-restricted-globals\n    return \"undefined\" != typeof window ? window : null;\n}\n\n/** The Platform's 'document' implementation or null if not available. */ function Mo() {\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\n    // eslint-disable-next-line no-restricted-globals\n    return \"undefined\" != typeof document ? document : null;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function Oo(t) {\n    return new is(t, /* useProto3Json= */ !0);\n}\n\n/**\n * An instance of the Platform's 'TextEncoder' implementation.\n */\n/**\n * A helper for running delayed tasks following an exponential backoff curve\n * between attempts.\n *\n * Each delay is made up of a \"base\" delay which follows the exponential\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\n * base delay. This prevents clients from accidentally synchronizing their\n * delays causing spikes of load to the backend.\n */\nclass $o {\n    constructor(\n    /**\n     * The AsyncQueue to run backoff operations on.\n     */\n    t, \n    /**\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\n     */\n    e, \n    /**\n     * The initial delay (used as the base delay on the first retry attempt).\n     * Note that jitter will still be applied, so the actual delay could be as\n     * little as 0.5*initialDelayMs.\n     */\n    n = 1e3\n    /**\n     * The multiplier to use to determine the extended base delay after each\n     * attempt.\n     */ , s = 1.5\n    /**\n     * The maximum base delay after which no further backoff is performed.\n     * Note that jitter will still be applied, so the actual delay could be as\n     * much as 1.5*maxDelayMs.\n     */ , i = 6e4) {\n        this.Hn = t, this.timerId = e, this.ho = n, this.lo = s, this.fo = i, this._o = 0, \n        this.wo = null, \n        /** The last backoff attempt, as epoch milliseconds. */\n        this.mo = Date.now(), this.reset();\n    }\n    /**\n     * Resets the backoff delay.\n     *\n     * The very next backoffAndWait() will have no delay. If it is called again\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\n     * subsequent ones will increase according to the backoffFactor.\n     */    reset() {\n        this._o = 0;\n    }\n    /**\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\n     * RESOURCE_EXHAUSTED error).\n     */    yo() {\n        this._o = this.fo;\n    }\n    /**\n     * Returns a promise that resolves after currentDelayMs, and increases the\n     * delay for any subsequent attempts. If there was a pending backoff operation\n     * already, it will be canceled.\n     */    po(t) {\n        // Cancel any pending backoff operation.\n        this.cancel();\n        // First schedule using the current base (which may be 0 and should be\n        // honored as such).\n        const e = Math.floor(this._o + this.Io()), n = Math.max(0, Date.now() - this.mo), s = Math.max(0, e - n);\n        // Guard against lastAttemptTime being in the future due to a clock change.\n                s > 0 && O(\"ExponentialBackoff\", `Backing off for ${s} ms (base delay: ${this._o} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \n        this.wo = this.Hn.enqueueAfterDelay(this.timerId, s, (() => (this.mo = Date.now(), \n        t()))), \n        // Apply backoff factor to determine next delay and ensure it is within\n        // bounds.\n        this._o *= this.lo, this._o < this.ho && (this._o = this.ho), this._o > this.fo && (this._o = this.fo);\n    }\n    To() {\n        null !== this.wo && (this.wo.skipDelay(), this.wo = null);\n    }\n    cancel() {\n        null !== this.wo && (this.wo.cancel(), this.wo = null);\n    }\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    Io() {\n        return (Math.random() - .5) * this._o;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A PersistentStream is an abstract base class that represents a streaming RPC\n * to the Firestore backend. It's built on top of the connections own support\n * for streaming RPCs, and adds several critical features for our clients:\n *\n *   - Exponential backoff on failure\n *   - Authentication via CredentialsProvider\n *   - Dispatching all callbacks into the shared worker queue\n *   - Closing idle streams after 60 seconds of inactivity\n *\n * Subclasses of PersistentStream implement serialization of models to and\n * from the JSON representation of the protocol buffers for a specific\n * streaming RPC.\n *\n * ## Starting and Stopping\n *\n * Streaming RPCs are stateful and need to be start()ed before messages can\n * be sent and received. The PersistentStream will call the onOpen() function\n * of the listener once the stream is ready to accept requests.\n *\n * Should a start() fail, PersistentStream will call the registered onClose()\n * listener with a FirestoreError indicating what went wrong.\n *\n * A PersistentStream can be started and stopped repeatedly.\n *\n * Generic types:\n *  SendType: The type of the outgoing message of the underlying\n *    connection stream\n *  ReceiveType: The type of the incoming message of the underlying\n *    connection stream\n *  ListenerType: The type of the listener that will be used for callbacks\n */\nclass Fo {\n    constructor(t, e, n, s, i, r, o, a) {\n        this.Hn = t, this.Eo = n, this.Ao = s, this.Ro = i, this.authCredentialsProvider = r, \n        this.appCheckCredentialsProvider = o, this.listener = a, this.state = 0 /* Initial */ , \n        /**\n         * A close count that's incremented every time the stream is closed; used by\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\n         * close.\n         */\n        this.bo = 0, this.Po = null, this.Vo = null, this.stream = null, this.vo = new $o(t, e);\n    }\n    /**\n     * Returns true if start() has been called and no error has occurred. True\n     * indicates the stream is open or in the process of opening (which\n     * encompasses respecting backoff, getting auth tokens, and starting the\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\n     * outbound requests.\n     */    So() {\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Do();\n    }\n    /**\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\n     * called) and the stream is ready for outbound requests.\n     */    Do() {\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\n    }\n    /**\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\n     * ready for outbound requests, at which point isOpen() will return true.\n     *\n     * When start returns, isStarted() will return true.\n     */    start() {\n        4 /* Error */ !== this.state ? this.auth() : this.Co();\n    }\n    /**\n     * Stops the RPC. This call is idempotent and allowed regardless of the\n     * current isStarted() state.\n     *\n     * When stop returns, isStarted() and isOpen() will both return false.\n     */    async stop() {\n        this.So() && await this.close(0 /* Initial */);\n    }\n    /**\n     * After an error the stream will usually back off on the next attempt to\n     * start it. If the error warrants an immediate restart of the stream, the\n     * sender can use this to indicate that the receiver should not back off.\n     *\n     * Each error will call the onClose() listener. That function can decide to\n     * inhibit backoff if required.\n     */    xo() {\n        this.state = 0 /* Initial */ , this.vo.reset();\n    }\n    /**\n     * Marks this stream as idle. If no further actions are performed on the\n     * stream for one minute, the stream will automatically close itself and\n     * notify the stream's onClose() handler with Status.OK. The stream will then\n     * be in a !isStarted() state, requiring the caller to start the stream again\n     * before further use.\n     *\n     * Only streams that are in state 'Open' can be marked idle, as all other\n     * states imply pending network operations.\n     */    No() {\n        // Starts the idle time if we are in state 'Open' and are not yet already\n        // running a timer (in which case the previous idle timeout still applies).\n        this.Do() && null === this.Po && (this.Po = this.Hn.enqueueAfterDelay(this.Eo, 6e4, (() => this.ko())));\n    }\n    /** Sends a message to the underlying stream. */    Mo(t) {\n        this.Oo(), this.stream.send(t);\n    }\n    /** Called by the idle timer when the stream should close due to inactivity. */    async ko() {\n        if (this.Do()) \n        // When timing out an idle stream there's no reason to force the stream into backoff when\n        // it restarts so set the stream state to Initial instead of Error.\n        return this.close(0 /* Initial */);\n    }\n    /** Marks the stream as active again. */    Oo() {\n        this.Po && (this.Po.cancel(), this.Po = null);\n    }\n    /** Cancels the health check delayed operation. */    $o() {\n        this.Vo && (this.Vo.cancel(), this.Vo = null);\n    }\n    /**\n     * Closes the stream and cleans up as necessary:\n     *\n     * * closes the underlying GRPC stream;\n     * * calls the onClose handler with the given 'error';\n     * * sets internal stream state to 'finalState';\n     * * adjusts the backoff timer based on the error\n     *\n     * A new stream can be opened by calling start().\n     *\n     * @param finalState - the intended state of the stream after closing.\n     * @param error - the error the connection was closed with.\n     */    async close(t, e) {\n        // Cancel any outstanding timers (they're guaranteed not to execute).\n        this.Oo(), this.$o(), this.vo.cancel(), \n        // Invalidates any stream-related callbacks (e.g. from auth or the\n        // underlying stream), guaranteeing they won't execute.\n        this.bo++, 4 /* Error */ !== t ? \n        // If this is an intentional close ensure we don't delay our next connection attempt.\n        this.vo.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\n        $(e.toString()), $(\"Using maximum backoff delay to prevent overloading the backend.\"), \n        this.vo.yo()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\n        // \"unauthenticated\" error means the token was rejected. This should rarely\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\n        // request a token. If a user manually resets their system clock this can\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\n        // before we received the first message and we need to invalidate the token\n        // to ensure that we fetch a new token.\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \n        // Clean up the underlying stream because we are no longer interested in events.\n        null !== this.stream && (this.Fo(), this.stream.close(), this.stream = null), \n        // This state must be assigned before calling onClose() to allow the callback to\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\n        this.state = t, \n        // Notify the listener that the stream closed.\n        await this.listener.Hr(e);\n    }\n    /**\n     * Can be overridden to perform additional cleanup before the stream is closed.\n     * Calling super.tearDown() is not required.\n     */    Fo() {}\n    auth() {\n        this.state = 1 /* Starting */;\n        const t = this.Bo(this.bo), e = this.bo;\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\n            // Stream can be stopped while waiting for authentication.\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\n            // and let this dispatch onto the queue, but that opened a spec test can\n            // of worms that I don't want to deal with in this PR.\n            this.bo === e && \n            // Normally we'd have to schedule the callback on the AsyncQueue.\n            // However, the following calls are safe to be called outside the\n            // AsyncQueue since they don't chain asynchronous calls\n            this.Lo(t, n);\n        }), (e => {\n            t((() => {\n                const t = new Q(G.UNKNOWN, \"Fetching auth token failed: \" + e.message);\n                return this.qo(t);\n            }));\n        }));\n    }\n    Lo(t, e) {\n        const n = this.Bo(this.bo);\n        this.stream = this.Uo(t, e), this.stream.Wr((() => {\n            n((() => (this.state = 2 /* Open */ , this.Vo = this.Hn.enqueueAfterDelay(this.Ao, 1e4, (() => (this.Do() && (this.state = 3 /* Healthy */), \n            Promise.resolve()))), this.listener.Wr())));\n        })), this.stream.Hr((t => {\n            n((() => this.qo(t)));\n        })), this.stream.onMessage((t => {\n            n((() => this.onMessage(t)));\n        }));\n    }\n    Co() {\n        this.state = 5 /* Backoff */ , this.vo.po((async () => {\n            this.state = 0 /* Initial */ , this.start();\n        }));\n    }\n    // Visible for tests\n    qo(t) {\n        // In theory the stream could close cleanly, however, in our current model\n        // we never expect this to happen because if we stop a stream ourselves,\n        // this callback will never be called. To prevent cases where we retry\n        // without a backoff accidentally, we set the stream to error in all cases.\n        return O(\"PersistentStream\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\n    }\n    /**\n     * Returns a \"dispatcher\" function that dispatches operations onto the\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\n     * re-opened, etc.\n     */    Bo(t) {\n        return e => {\n            this.Hn.enqueueAndForget((() => this.bo === t ? e() : (O(\"PersistentStream\", \"stream callback skipped by getCloseGuardedDispatcher.\"), \n            Promise.resolve())));\n        };\n    }\n}\n\n/**\n * A PersistentStream that implements the Listen RPC.\n *\n * Once the Listen stream has called the onOpen() listener, any number of\n * listen() and unlisten() calls can be made to control what changes will be\n * sent from the server for ListenResponses.\n */ class Bo extends Fo {\n    constructor(t, e, n, s, i, r) {\n        super(t, \"listen_stream_connection_backoff\" /* ListenStreamConnectionBackoff */ , \"listen_stream_idle\" /* ListenStreamIdle */ , \"health_check_timeout\" /* HealthCheckTimeout */ , e, n, s, r), \n        this.M = i;\n    }\n    Uo(t, e) {\n        return this.Ro.co(\"Listen\", t, e);\n    }\n    onMessage(t) {\n        // A successful response means the stream is healthy\n        this.vo.reset();\n        const e = Is(this.M, t), n = function(t) {\n            // We have only reached a consistent snapshot for the entire stream if there\n            // is a read_time set and it applies to all targets (i.e. the list of\n            // targets is empty). The backend is guaranteed to send such responses.\n            if (!(\"targetChange\" in t)) return ct.min();\n            const e = t.targetChange;\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? us(e.readTime) : ct.min();\n        }(t);\n        return this.listener.Ko(e, n);\n    }\n    /**\n     * Registers interest in the results of the given target. If the target\n     * includes a resumeToken it will be included in the request. Results that\n     * affect the target will be streamed back as WatchChange messages that\n     * reference the targetId.\n     */    Go(t) {\n        const e = {};\n        e.database = ws(this.M), e.addTarget = function(t, e) {\n            let n;\n            const s = e.target;\n            return n = fe(s) ? {\n                documents: Rs(t, s)\n            } : {\n                query: bs(t, s)\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = os(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\n            // TODO(wuandy): Consider removing above check because it is most likely true.\n            // Right now, many tests depend on this behaviour though (leaving min() out\n            // of serialization).\n            n.readTime = rs(t, e.snapshotVersion.toTimestamp())), n;\n        }(this.M, t);\n        const n = Vs(this.M, t);\n        n && (e.labels = n), this.Mo(e);\n    }\n    /**\n     * Unregisters interest in the results of the target associated with the\n     * given targetId.\n     */    Qo(t) {\n        const e = {};\n        e.database = ws(this.M), e.removeTarget = t, this.Mo(e);\n    }\n}\n\n/**\n * A Stream that implements the Write RPC.\n *\n * The Write RPC requires the caller to maintain special streamToken\n * state in between calls, to help the server understand which responses the\n * client has processed by the time the next request is made. Every response\n * will contain a streamToken; this value must be passed to the next\n * request.\n *\n * After calling start() on this stream, the next request must be a handshake,\n * containing whatever streamToken is on hand. Once a response to this\n * request is received, all pending mutations may be submitted. When\n * submitting multiple batches of mutations at the same time, it's\n * okay to use the same streamToken for the calls to writeMutations.\n *\n * TODO(b/33271235): Use proto types\n */ class Lo extends Fo {\n    constructor(t, e, n, s, i, r) {\n        super(t, \"write_stream_connection_backoff\" /* WriteStreamConnectionBackoff */ , \"write_stream_idle\" /* WriteStreamIdle */ , \"health_check_timeout\" /* HealthCheckTimeout */ , e, n, s, r), \n        this.M = i, this.jo = !1;\n    }\n    /**\n     * Tracks whether or not a handshake has been successfully exchanged and\n     * the stream is ready to accept mutations.\n     */    get Wo() {\n        return this.jo;\n    }\n    // Override of PersistentStream.start\n    start() {\n        this.jo = !1, this.lastStreamToken = void 0, super.start();\n    }\n    Fo() {\n        this.jo && this.zo([]);\n    }\n    Uo(t, e) {\n        return this.Ro.co(\"Write\", t, e);\n    }\n    onMessage(t) {\n        if (\n        // Always capture the last stream token.\n        q(!!t.streamToken), this.lastStreamToken = t.streamToken, this.jo) {\n            // A successful first write response means the stream is healthy,\n            // Note, that we could consider a successful handshake healthy, however,\n            // the write itself might be causing an error we want to back off from.\n            this.vo.reset();\n            const e = As(t.writeResults, t.commitTime), n = us(t.commitTime);\n            return this.listener.Ho(n, e);\n        }\n        // The first response is always the handshake response\n        return q(!t.writeResults || 0 === t.writeResults.length), this.jo = !0, this.listener.Jo();\n    }\n    /**\n     * Sends an initial streamToken to the server, performing the handshake\n     * required to make the StreamingWrite RPC work. Subsequent\n     * calls should wait until onHandshakeComplete was called.\n     */    Yo() {\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\n        // stream token on the handshake, ignoring any stream token we might have.\n        const t = {};\n        t.database = ws(this.M), this.Mo(t);\n    }\n    /** Sends a group of mutations to the Firestore backend to apply. */    zo(t) {\n        const e = {\n            streamToken: this.lastStreamToken,\n            writes: t.map((t => Ts(this.M, t)))\n        };\n        this.Mo(e);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Datastore and its related methods are a wrapper around the external Google\n * Cloud Datastore grpc API, which provides an interface that is more convenient\n * for the rest of the client SDK architecture to consume.\n */\n/**\n * An implementation of Datastore that exposes additional state for internal\n * consumption.\n */\nclass qo extends class {} {\n    constructor(t, e, n, s) {\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.Ro = n, this.M = s, \n        this.Xo = !1;\n    }\n    Zo() {\n        if (this.Xo) throw new Q(G.FAILED_PRECONDITION, \"The client has already been terminated.\");\n    }\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    io(t, e, n) {\n        return this.Zo(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.Ro.io(t, e, n, s, i))).catch((t => {\n            throw \"FirebaseError\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\n        }));\n    }\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    uo(t, e, n) {\n        return this.Zo(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.Ro.uo(t, e, n, s, i))).catch((t => {\n            throw \"FirebaseError\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\n        }));\n    }\n    terminate() {\n        this.Xo = !0;\n    }\n}\n\n// TODO(firestorexp): Make sure there is only one Datastore instance per\n// firestore-exp client.\n/**\n * A component used by the RemoteStore to track the OnlineState (that is,\n * whether or not the client as a whole should be considered to be online or\n * offline), implementing the appropriate heuristics.\n *\n * In particular, when the client is trying to connect to the backend, we\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\n * a connection to succeed. If we have too many failures or the timeout elapses,\n * then we set the OnlineState to Offline, and the client will behave as if\n * it is offline (get()s will return cached data, etc.).\n */\nclass Uo {\n    constructor(t, e) {\n        this.asyncQueue = t, this.onlineStateHandler = e, \n        /** The current OnlineState. */\n        this.state = \"Unknown\" /* Unknown */ , \n        /**\n         * A count of consecutive failures to open the stream. If it reaches the\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\n         * Offline.\n         */\n        this.ta = 0, \n        /**\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\n         */\n        this.ea = null, \n        /**\n         * Whether the client should log a warning message if it fails to connect to\n         * the backend (initially true, cleared after a successful stream, or if we've\n         * logged the message already).\n         */\n        this.na = !0;\n    }\n    /**\n     * Called by RemoteStore when a watch stream is started (including on each\n     * backoff attempt).\n     *\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\n     * the onlineStateTimer.\n     */    sa() {\n        0 === this.ta && (this.ia(\"Unknown\" /* Unknown */), this.ea = this.asyncQueue.enqueueAfterDelay(\"online_state_timeout\" /* OnlineStateTimeout */ , 1e4, (() => (this.ea = null, \n        this.ra(\"Backend didn't respond within 10 seconds.\"), this.ia(\"Offline\" /* Offline */), \n        Promise.resolve()))));\n    }\n    /**\n     * Updates our OnlineState as appropriate after the watch stream reports a\n     * failure. The first failure moves us to the 'Unknown' state. We then may\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\n     * actually transition to the 'Offline' state.\n     */    oa(t) {\n        \"Online\" /* Online */ === this.state ? this.ia(\"Unknown\" /* Unknown */) : (this.ta++, \n        this.ta >= 1 && (this.aa(), this.ra(`Connection failed 1 times. Most recent error: ${t.toString()}`), \n        this.ia(\"Offline\" /* Offline */)));\n    }\n    /**\n     * Explicitly sets the OnlineState to the specified state.\n     *\n     * Note that this resets our timers / failure counters, etc. used by our\n     * Offline heuristics, so must not be used in place of\n     * handleWatchStreamStart() and handleWatchStreamFailure().\n     */    set(t) {\n        this.aa(), this.ta = 0, \"Online\" /* Online */ === t && (\n        // We've connected to watch at least once. Don't warn the developer\n        // about being offline going forward.\n        this.na = !1), this.ia(t);\n    }\n    ia(t) {\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\n    }\n    ra(t) {\n        const e = `Could not reach Cloud Firestore backend. ${t}\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\n        this.na ? ($(e), this.na = !1) : O(\"OnlineStateTracker\", e);\n    }\n    aa() {\n        null !== this.ea && (this.ea.cancel(), this.ea = null);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class Ko {\n    constructor(\n    /**\n     * The local store, used to fill the write pipeline with outbound mutations.\n     */\n    t, \n    /** The client-side proxy for interacting with the backend. */\n    e, n, s, i) {\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \n        /**\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\n         * LocalStore via fillWritePipeline() and have or will send to the write\n         * stream.\n         *\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\n         * restart the write stream. When the stream is established the writes in the\n         * pipeline will be sent in order.\n         *\n         * Writes remain in writePipeline until they are acknowledged by the backend\n         * and thus will automatically be re-sent if the stream is interrupted /\n         * restarted before they're acknowledged.\n         *\n         * Write responses from the backend are linked to their originating request\n         * purely based on order, and so we can just shift() writes from the front of\n         * the writePipeline as we receive responses.\n         */\n        this.ua = [], \n        /**\n         * A mapping of watched targets that the client cares about tracking and the\n         * user has explicitly called a 'listen' for this target.\n         *\n         * These targets may or may not have been sent to or acknowledged by the\n         * server. On re-establishing the listen stream, these targets should be sent\n         * to the server. The targets removed with unlistens are removed eagerly\n         * without waiting for confirmation from the listen stream.\n         */\n        this.ca = new Map, \n        /**\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\n         * RemoteStore may start its network connections.\n         */\n        this.ha = new Set, \n        /**\n         * Event handlers that get called when the network is disabled or enabled.\n         *\n         * PORTING NOTE: These functions are used on the Web client to create the\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\n         * the streams are created during construction of RemoteStore.\n         */\n        this.la = [], this.fa = i, this.fa.Fr((t => {\n            n.enqueueAndForget((async () => {\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\n                // network becomes unreachable as we don't have any other way to tear\n                // down our streams.\n                Xo(this) && (O(\"RemoteStore\", \"Restarting streams for network reachability change.\"), \n                await async function(t) {\n                    const e = K(t);\n                    e.ha.add(4 /* ConnectivityChange */), await Qo(e), e.da.set(\"Unknown\" /* Unknown */), \n                    e.ha.delete(4 /* ConnectivityChange */), await Go(e);\n                }(this));\n            }));\n        })), this.da = new Uo(n, s);\n    }\n}\n\nasync function Go(t) {\n    if (Xo(t)) for (const e of t.la) await e(/* enabled= */ !0);\n}\n\n/**\n * Temporarily disables the network. The network can be re-enabled using\n * enableNetwork().\n */ async function Qo(t) {\n    for (const e of t.la) await e(/* enabled= */ !1);\n}\n\n/**\n * Starts new listen for the given target. Uses resume token if provided. It\n * is a no-op if the target of given `TargetData` is already being listened to.\n */\nfunction jo(t, e) {\n    const n = K(t);\n    n.ca.has(e.targetId) || (\n    // Mark this as something the client is currently listening for.\n    n.ca.set(e.targetId, e), Yo(n) ? \n    // The listen will be sent in onWatchStreamOpen\n    Jo(n) : ma(n).Do() && zo(n, e));\n}\n\n/**\n * Removes the listen from server. It is a no-op if the given target id is\n * not being listened to.\n */ function Wo(t, e) {\n    const n = K(t), s = ma(n);\n    n.ca.delete(e), s.Do() && Ho(n, e), 0 === n.ca.size && (s.Do() ? s.No() : Xo(n) && \n    // Revert to OnlineState.Unknown if the watch stream is not open and we\n    // have no listeners, since without any listens to send we cannot\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\n    n.da.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * We need to increment the the expected number of pending responses we're due\n * from watch so we wait for the ack to process any messages from this target.\n */ function zo(t, e) {\n    t._a.Z(e.targetId), ma(t).Go(e);\n}\n\n/**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */ function Ho(t, e) {\n    t._a.Z(e), ma(t).Qo(e);\n}\n\nfunction Jo(t) {\n    t._a = new Zn({\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\n        Et: e => t.ca.get(e) || null\n    }), ma(t).start(), t.da.sa();\n}\n\n/**\n * Returns whether the watch stream should be started because it's necessary\n * and has not yet been started.\n */ function Yo(t) {\n    return Xo(t) && !ma(t).So() && t.ca.size > 0;\n}\n\nfunction Xo(t) {\n    return 0 === K(t).ha.size;\n}\n\nfunction Zo(t) {\n    t._a = void 0;\n}\n\nasync function ta(t) {\n    t.ca.forEach(((e, n) => {\n        zo(t, e);\n    }));\n}\n\nasync function ea(t, e) {\n    Zo(t), \n    // If we still need the watch stream, retry the connection.\n    Yo(t) ? (t.da.oa(e), Jo(t)) : \n    // No need to restart watch stream because there are no active targets.\n    // The online state is set to unknown because there is no active attempt\n    // at establishing a connection\n    t.da.set(\"Unknown\" /* Unknown */);\n}\n\nasync function na(t, e, n) {\n    if (\n    // Mark the client as online since we got a message from the server\n    t.da.set(\"Online\" /* Online */), e instanceof Yn && 2 /* Removed */ === e.state && e.cause) \n    // There was an error on a target, don't wait for a consistent snapshot\n    // to raise events\n    try {\n        await \n        /** Handles an error on a target */\n        async function(t, e) {\n            const n = e.cause;\n            for (const s of e.targetIds) \n            // A watched target might have been removed already.\n            t.ca.has(s) && (await t.remoteSyncer.rejectListen(s, n), t.ca.delete(s), t._a.removeTarget(s));\n        }\n        /**\n * Attempts to fill our write pipeline with writes from the LocalStore.\n *\n * Called internally to bootstrap or refill the write pipeline and by\n * SyncEngine whenever there are new mutations to process.\n *\n * Starts the write stream if necessary.\n */ (t, e);\n    } catch (n) {\n        O(\"RemoteStore\", \"Failed to remove targets %s: %s \", e.targetIds.join(\",\"), n), \n        await sa(t, n);\n    } else if (e instanceof Hn ? t._a.at(e) : e instanceof Jn ? t._a._t(e) : t._a.ht(e), \n    !n.isEqual(ct.min())) try {\n        const e = await Hr(t.localStore);\n        n.compareTo(e) >= 0 && \n        // We have received a target change with a global snapshot if the snapshot\n        // version is not equal to SnapshotVersion.min().\n        await \n        /**\n * Takes a batch of changes from the Datastore, repackages them as a\n * RemoteEvent, and passes that on to the listener, which is typically the\n * SyncEngine.\n */\n        function(t, e) {\n            const n = t._a.yt(e);\n            // Update in-memory resume tokens. LocalStore will update the\n            // persistent view of these when applying the completed RemoteEvent.\n                        return n.targetChanges.forEach(((n, s) => {\n                if (n.resumeToken.approximateByteSize() > 0) {\n                    const i = t.ca.get(s);\n                    // A watched target might have been removed already.\n                                        i && t.ca.set(s, i.withResumeToken(n.resumeToken, e));\n                }\n            })), \n            // Re-establish listens for the targets that have been invalidated by\n            // existence filter mismatches.\n            n.targetMismatches.forEach((e => {\n                const n = t.ca.get(e);\n                if (!n) \n                // A watched target might have been removed already.\n                return;\n                // Clear the resume token for the target, since we're in a known mismatch\n                // state.\n                                t.ca.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \n                // Cause a hard reset by unwatching and rewatching immediately, but\n                // deliberately don't send a resume token so that we get a full update.\n                Ho(t, e);\n                // Mark the target we send as being on behalf of an existence filter\n                // mismatch, but don't actually retain that in listenTargets. This ensures\n                // that we flag the first re-listen this way without impacting future\n                // listens of this target (that might happen e.g. on reconnect).\n                const s = new Ai(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\n                zo(t, s);\n            })), t.remoteSyncer.applyRemoteEvent(n);\n        }(t, n);\n    } catch (e) {\n        O(\"RemoteStore\", \"Failed to raise snapshot:\", e), await sa(t, e);\n    }\n}\n\n/**\n * Recovery logic for IndexedDB errors that takes the network offline until\n * `op` succeeds. Retries are scheduled with backoff using\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\n * validated via a generic operation.\n *\n * The returned Promise is resolved once the network is disabled and before\n * any retry attempt.\n */ async function sa(t, e, n) {\n    if (!di(e)) throw e;\n    t.ha.add(1 /* IndexedDbFailed */), \n    // Disable network and raise offline snapshots\n    await Qo(t), t.da.set(\"Offline\" /* Offline */), n || (\n    // Use a simple read operation to determine if IndexedDB recovered.\n    // Ideally, we would expose a health check directly on SimpleDb, but\n    // RemoteStore only has access to persistence through LocalStore.\n    n = () => Hr(t.localStore)), \n    // Probe IndexedDB periodically and re-enable network\n    t.asyncQueue.enqueueRetryable((async () => {\n        O(\"RemoteStore\", \"Retrying IndexedDB access\"), await n(), t.ha.delete(1 /* IndexedDbFailed */), \n        await Go(t);\n    }));\n}\n\n/**\n * Executes `op`. If `op` fails, takes the network offline until `op`\n * succeeds. Returns after the first attempt.\n */ function ia(t, e) {\n    return e().catch((n => sa(t, n, e)));\n}\n\nasync function ra(t) {\n    const e = K(t), n = ga(e);\n    let s = e.ua.length > 0 ? e.ua[e.ua.length - 1].batchId : -1;\n    for (;oa(e); ) try {\n        const t = await Xr(e.localStore, s);\n        if (null === t) {\n            0 === e.ua.length && n.No();\n            break;\n        }\n        s = t.batchId, aa(e, t);\n    } catch (t) {\n        await sa(e, t);\n    }\n    ua(e) && ca(e);\n}\n\n/**\n * Returns true if we can add to the write pipeline (i.e. the network is\n * enabled and the write pipeline is not full).\n */ function oa(t) {\n    return Xo(t) && t.ua.length < 10;\n}\n\n/**\n * Queues additional writes to be sent to the write stream, sending them\n * immediately if the write stream is established.\n */ function aa(t, e) {\n    t.ua.push(e);\n    const n = ga(t);\n    n.Do() && n.Wo && n.zo(e.mutations);\n}\n\nfunction ua(t) {\n    return Xo(t) && !ga(t).So() && t.ua.length > 0;\n}\n\nfunction ca(t) {\n    ga(t).start();\n}\n\nasync function ha(t) {\n    ga(t).Yo();\n}\n\nasync function la(t) {\n    const e = ga(t);\n    // Send the write pipeline now that the stream is established.\n        for (const n of t.ua) e.zo(n.mutations);\n}\n\nasync function fa(t, e, n) {\n    const s = t.ua.shift(), i = Ti.from(s, e, n);\n    await ia(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \n    // It's possible that with the completion of this mutation another\n    // slot has freed up.\n    await ra(t);\n}\n\nasync function da(t, e) {\n    // If the write stream closed after the write handshake completes, a write\n    // operation failed and we fail the pending operation.\n    e && ga(t).Wo && \n    // This error affects the actual write.\n    await async function(t, e) {\n        // Only handle permanent errors here. If it's transient, just let the retry\n        // logic kick in.\n        if (n = e.code, vn(n) && n !== G.ABORTED) {\n            // This was a permanent error, the request itself was the problem\n            // so it's not going to succeed if we resend it.\n            const n = t.ua.shift();\n            // In this case it's also unlikely that the server itself is melting\n            // down -- this was just a bad request so inhibit backoff on the next\n            // restart.\n                        ga(t).xo(), await ia(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \n            // It's possible that with the completion of this mutation\n            // another slot has freed up.\n            await ra(t);\n        }\n        var n;\n    }(t, e), \n    // The write stream might have been started by refilling the write\n    // pipeline for failed writes\n    ua(t) && ca(t);\n}\n\nasync function _a(t, e) {\n    const n = K(t);\n    n.asyncQueue.verifyOperationInProgress(), O(\"RemoteStore\", \"RemoteStore received new credentials\");\n    const s = Xo(n);\n    // Tear down and re-create our network streams. This will ensure we get a\n    // fresh auth token for the new user and re-fill the write pipeline with\n    // new mutations from the LocalStore (since mutations are per-user).\n        n.ha.add(3 /* CredentialChange */), await Qo(n), s && \n    // Don't set the network status to Unknown if we are offline.\n    n.da.set(\"Unknown\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \n    n.ha.delete(3 /* CredentialChange */), await Go(n);\n}\n\n/**\n * Toggles the network state when the client gains or loses its primary lease.\n */ async function wa(t, e) {\n    const n = K(t);\n    e ? (n.ha.delete(2 /* IsSecondary */), await Go(n)) : e || (n.ha.add(2 /* IsSecondary */), \n    await Qo(n), n.da.set(\"Unknown\" /* Unknown */));\n}\n\n/**\n * If not yet initialized, registers the WatchStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function ma(t) {\n    return t.wa || (\n    // Create stream (but note that it is not started yet).\n    t.wa = function(t, e, n) {\n        const s = K(t);\n        return s.Zo(), new Bo(e, s.Ro, s.authCredentials, s.appCheckCredentials, s.M, n);\n    }\n    /**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t.datastore, t.asyncQueue, {\n        Wr: ta.bind(null, t),\n        Hr: ea.bind(null, t),\n        Ko: na.bind(null, t)\n    }), t.la.push((async e => {\n        e ? (t.wa.xo(), Yo(t) ? Jo(t) : t.da.set(\"Unknown\" /* Unknown */)) : (await t.wa.stop(), \n        Zo(t));\n    }))), t.wa;\n}\n\n/**\n * If not yet initialized, registers the WriteStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */ function ga(t) {\n    return t.ma || (\n    // Create stream (but note that it is not started yet).\n    t.ma = function(t, e, n) {\n        const s = K(t);\n        return s.Zo(), new Lo(e, s.Ro, s.authCredentials, s.appCheckCredentials, s.M, n);\n    }(t.datastore, t.asyncQueue, {\n        Wr: ha.bind(null, t),\n        Hr: da.bind(null, t),\n        Jo: la.bind(null, t),\n        Ho: fa.bind(null, t)\n    }), t.la.push((async e => {\n        e ? (t.ma.xo(), \n        // This will start the write stream if necessary.\n        await ra(t)) : (await t.ma.stop(), t.ua.length > 0 && (O(\"RemoteStore\", `Stopping write stream with ${t.ua.length} pending writes`), \n        t.ua = []));\n    }))), t.ma;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\n *\n * It is created via DelayedOperation.createAndSchedule().\n *\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\n *\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\n * in newer versions of TypeScript defines `finally`, which is not available in\n * IE.\n */\nclass ya {\n    constructor(t, e, n, s, i) {\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \n        // It's normal for the deferred promise to be canceled (due to cancellation)\n        // and so we attach a dummy catch callback to avoid\n        // 'UnhandledPromiseRejectionWarning' log spam.\n        this.deferred.promise.catch((t => {}));\n    }\n    /**\n     * Creates and returns a DelayedOperation that has been scheduled to be\n     * executed on the provided asyncQueue after the provided delayMs.\n     *\n     * @param asyncQueue - The queue to schedule the operation on.\n     * @param id - A Timer ID identifying the type of operation this is.\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\n     * @param op - The operation to run.\n     * @param removalCallback - A callback to be called synchronously once the\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\n     *   from its delayedOperations list.\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\n     *   the DelayedOperation class public.\n     */    static createAndSchedule(t, e, n, s, i) {\n        const r = Date.now() + n, o = new ya(t, e, r, s, i);\n        return o.start(n), o;\n    }\n    /**\n     * Starts the timer. This is called immediately after construction by\n     * createAndSchedule().\n     */    start(t) {\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\n    }\n    /**\n     * Queues the operation to run immediately (if it hasn't already been run or\n     * canceled).\n     */    skipDelay() {\n        return this.handleDelayElapsed();\n    }\n    /**\n     * Cancels the operation if it hasn't already been executed or canceled. The\n     * promise will be rejected.\n     *\n     * As long as the operation has not yet been run, calling cancel() provides a\n     * guarantee that the operation will not be run.\n     */    cancel(t) {\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \"Operation cancelled\" + (t ? \": \" + t : \"\"))));\n    }\n    handleDelayElapsed() {\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\n    }\n    clearTimeout() {\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \n        this.timerHandle = null);\n    }\n}\n\n/**\n * Returns a FirestoreError that can be surfaced to the user if the provided\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\n */ function pa(t, e) {\n    if ($(\"AsyncQueue\", `${e}: ${t}`), di(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\n    throw t;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\n * in order specified by the provided comparator. We always add a document key\n * comparator on top of what is provided to guarantee document equality based on\n * the key.\n */ class Ia {\n    /** The default ordering is by key if the comparator is omitted */\n    constructor(t) {\n        // We are adding document key comparator to the end as it's the only\n        // guaranteed unique property of a document.\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \n        this.keyedMap = Ln(), this.sortedSet = new Cn(this.comparator);\n    }\n    /**\n     * Returns an empty copy of the existing DocumentSet, using the same\n     * comparator.\n     */    static emptySet(t) {\n        return new Ia(t.comparator);\n    }\n    has(t) {\n        return null != this.keyedMap.get(t);\n    }\n    get(t) {\n        return this.keyedMap.get(t);\n    }\n    first() {\n        return this.sortedSet.minKey();\n    }\n    last() {\n        return this.sortedSet.maxKey();\n    }\n    isEmpty() {\n        return this.sortedSet.isEmpty();\n    }\n    /**\n     * Returns the index of the provided key in the document set, or -1 if the\n     * document key is not present in the set;\n     */    indexOf(t) {\n        const e = this.keyedMap.get(t);\n        return e ? this.sortedSet.indexOf(e) : -1;\n    }\n    get size() {\n        return this.sortedSet.size;\n    }\n    /** Iterates documents in order defined by \"comparator\" */    forEach(t) {\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\n    }\n    /** Inserts or updates a document with the same key */    add(t) {\n        // First remove the element if we have it.\n        const e = this.delete(t.key);\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\n    }\n    /** Deletes a document with a given key */    delete(t) {\n        const e = this.get(t);\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\n    }\n    isEqual(t) {\n        if (!(t instanceof Ia)) return !1;\n        if (this.size !== t.size) return !1;\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\n        for (;e.hasNext(); ) {\n            const t = e.getNext().key, s = n.getNext().key;\n            if (!t.isEqual(s)) return !1;\n        }\n        return !0;\n    }\n    toString() {\n        const t = [];\n        return this.forEach((e => {\n            t.push(e.toString());\n        })), 0 === t.length ? \"DocumentSet ()\" : \"DocumentSet (\\n  \" + t.join(\"  \\n\") + \"\\n)\";\n    }\n    copy(t, e) {\n        const n = new Ia;\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\n * duplicate events for the same doc.\n */ class Ta {\n    constructor() {\n        this.ga = new Cn(xt.comparator);\n    }\n    track(t) {\n        const e = t.doc.key, n = this.ga.get(e);\n        n ? \n        // Merge the new change with the existing change.\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.ga = this.ga.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.ga = this.ga.insert(e, {\n            type: n.type,\n            doc: t.doc\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.ga = this.ga.insert(e, {\n            type: 2 /* Modified */ ,\n            doc: t.doc\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.ga = this.ga.insert(e, {\n            type: 0 /* Added */ ,\n            doc: t.doc\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.ga = this.ga.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.ga = this.ga.insert(e, {\n            type: 1 /* Removed */ ,\n            doc: n.doc\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.ga = this.ga.insert(e, {\n            type: 2 /* Modified */ ,\n            doc: t.doc\n        }) : \n        // This includes these cases, which don't make sense:\n        // Added->Added\n        // Removed->Removed\n        // Modified->Added\n        // Removed->Modified\n        // Metadata->Added\n        // Removed->Metadata\n        L() : this.ga = this.ga.insert(e, t);\n    }\n    ya() {\n        const t = [];\n        return this.ga.inorderTraversal(((e, n) => {\n            t.push(n);\n        })), t;\n    }\n}\n\nclass Ea {\n    constructor(t, e, n, s, i, r, o, a) {\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = a;\n    }\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\n        const i = [];\n        return e.forEach((t => {\n            i.push({\n                type: 0 /* Added */ ,\n                doc: t\n            });\n        })), new Ea(t, e, Ia.emptySet(e), i, n, s, \n        /* syncStateChanged= */ !0, \n        /* excludesMetadataChanges= */ !1);\n    }\n    get hasPendingWrites() {\n        return !this.mutatedKeys.isEmpty();\n    }\n    isEqual(t) {\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Be(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\n        const e = this.docChanges, n = t.docChanges;\n        if (e.length !== n.length) return !1;\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\n        return !0;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Holds the listeners and the last received ViewSnapshot for a query being\n * tracked by EventManager.\n */ class Aa {\n    constructor() {\n        this.pa = void 0, this.listeners = [];\n    }\n}\n\nclass Ra {\n    constructor() {\n        this.queries = new Dn((t => Le(t)), Be), this.onlineState = \"Unknown\" /* Unknown */ , \n        this.Ia = new Set;\n    }\n}\n\nasync function ba(t, e) {\n    const n = K(t), s = e.query;\n    let i = !1, r = n.queries.get(s);\n    if (r || (i = !0, r = new Aa), i) try {\n        r.pa = await n.onListen(s);\n    } catch (t) {\n        const n = pa(t, `Initialization of query '${qe(e.query)}' failed`);\n        return void e.onError(n);\n    }\n    if (n.queries.set(s, r), r.listeners.push(e), \n    // Run global snapshot listeners if a consistent snapshot has been emitted.\n    e.Ta(n.onlineState), r.pa) {\n        e.Ea(r.pa) && Sa(n);\n    }\n}\n\nasync function Pa(t, e) {\n    const n = K(t), s = e.query;\n    let i = !1;\n    const r = n.queries.get(s);\n    if (r) {\n        const t = r.listeners.indexOf(e);\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\n    }\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\n}\n\nfunction Va(t, e) {\n    const n = K(t);\n    let s = !1;\n    for (const t of e) {\n        const e = t.query, i = n.queries.get(e);\n        if (i) {\n            for (const e of i.listeners) e.Ea(t) && (s = !0);\n            i.pa = t;\n        }\n    }\n    s && Sa(n);\n}\n\nfunction va(t, e, n) {\n    const s = K(t), i = s.queries.get(e);\n    if (i) for (const t of i.listeners) t.onError(n);\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\n    // after an error.\n        s.queries.delete(e);\n}\n\n// Call all global snapshot listeners that have been set.\nfunction Sa(t) {\n    t.Ia.forEach((t => {\n        t.next();\n    }));\n}\n\n/**\n * QueryListener takes a series of internal view snapshots and determines\n * when to raise the event.\n *\n * It uses an Observer to dispatch events.\n */ class Da {\n    constructor(t, e, n) {\n        this.query = t, this.Aa = e, \n        /**\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\n         * observer. This flag is set to true once we've actually raised an event.\n         */\n        this.Ra = !1, this.ba = null, this.onlineState = \"Unknown\" /* Unknown */ , this.options = n || {};\n    }\n    /**\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\n     * if applicable (depending on what changed, whether the user has opted into\n     * metadata-only changes, etc.). Returns true if a user-facing event was\n     * indeed raised.\n     */    Ea(t) {\n        if (!this.options.includeMetadataChanges) {\n            // Remove the metadata only changes.\n            const e = [];\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\n            t = new Ea(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \n            /* excludesMetadataChanges= */ !0);\n        }\n        let e = !1;\n        return this.Ra ? this.Pa(t) && (this.Aa.next(t), e = !0) : this.Va(t, this.onlineState) && (this.va(t), \n        e = !0), this.ba = t, e;\n    }\n    onError(t) {\n        this.Aa.error(t);\n    }\n    /** Returns whether a snapshot was raised. */    Ta(t) {\n        this.onlineState = t;\n        let e = !1;\n        return this.ba && !this.Ra && this.Va(this.ba, t) && (this.va(this.ba), e = !0), \n        e;\n    }\n    Va(t, e) {\n        // Always raise the first event when we're synced\n        if (!t.fromCache) return !0;\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\n        // or Online if we wait long enough).\n                const n = \"Offline\" /* Offline */ !== e;\n        // Don't raise the event if we're online, aren't synced yet (checked\n        // above) and are waiting for a sync.\n                return (!this.options.Sa || !n) && (!t.docs.isEmpty() || \"Offline\" /* Offline */ === e);\n        // Raise data from cache if we have any documents or we are offline\n        }\n    Pa(t) {\n        // We don't need to handle includeDocumentMetadataChanges here because\n        // the Metadata only changes have already been stripped out if needed.\n        // At this point the only changes we will see are the ones we should\n        // propagate.\n        if (t.docChanges.length > 0) return !0;\n        const e = this.ba && this.ba.hasPendingWrites !== t.hasPendingWrites;\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\n        // Generally we should have hit one of the cases above, but it's possible\n        // to get here if there were only metadata docChanges and they got\n        // stripped out.\n        }\n    va(t) {\n        t = Ea.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Ra = !0, \n        this.Aa.next(t);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A complete element in the bundle stream, together with the byte length it\n * occupies in the stream.\n */ class Ca {\n    constructor(t, \n    // How many bytes this element takes to store in the bundle.\n    e) {\n        this.payload = t, this.byteLength = e;\n    }\n    Da() {\n        return \"metadata\" in this.payload;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Helper to convert objects from bundles to model objects in the SDK.\n */ class xa {\n    constructor(t) {\n        this.M = t;\n    }\n    li(t) {\n        return fs(this.M, t);\n    }\n    /**\n     * Converts a BundleDocument to a MutableDocument.\n     */    fi(t) {\n        return t.metadata.exists ? ys(this.M, t.document, !1) : te.newNoDocument(this.li(t.metadata.name), this.di(t.metadata.readTime));\n    }\n    di(t) {\n        return us(t);\n    }\n}\n\n/**\n * A class to process the elements from a bundle, load them into local\n * storage and provide progress update while loading.\n */ class Na {\n    constructor(t, e, n) {\n        this.Ca = t, this.localStore = e, this.M = n, \n        /** Batched queries to be saved into storage */\n        this.queries = [], \n        /** Batched documents to be saved into storage */\n        this.documents = [], this.progress = ka(t);\n    }\n    /**\n     * Adds an element from the bundle to the loader.\n     *\n     * Returns a new progress if adding the element leads to a new progress,\n     * otherwise returns null.\n     */    xa(t) {\n        this.progress.bytesLoaded += t.byteLength;\n        let e = this.progress.documentsLoaded;\n        return t.payload.namedQuery ? this.queries.push(t.payload.namedQuery) : t.payload.documentMetadata ? (this.documents.push({\n            metadata: t.payload.documentMetadata\n        }), t.payload.documentMetadata.exists || ++e) : t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \n        ++e), e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \n        Object.assign({}, this.progress)) : null;\n    }\n    Na(t) {\n        const e = new Map, n = new xa(this.M);\n        for (const s of t) if (s.metadata.queries) {\n            const t = n.li(s.metadata.name);\n            for (const n of s.metadata.queries) {\n                const s = (e.get(n) || Gn()).add(t);\n                e.set(n, s);\n            }\n        }\n        return e;\n    }\n    /**\n     * Update the progress to 'Success' and return the updated progress.\n     */    async complete() {\n        const t = await ro(this.localStore, new xa(this.M), this.documents, this.Ca.id), e = this.Na(this.documents);\n        for (const t of this.queries) await oo(this.localStore, t, e.get(t.name));\n        return this.progress.taskState = \"Success\", new qr(Object.assign({}, this.progress), t);\n    }\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\n * loading a bundle.\n */ function ka(t) {\n    return {\n        taskState: \"Running\",\n        documentsLoaded: 0,\n        bytesLoaded: 0,\n        totalDocuments: t.totalDocuments,\n        totalBytes: t.totalBytes\n    };\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\n * has succeeded.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass Ma {\n    constructor(t) {\n        this.key = t;\n    }\n}\n\nclass Oa {\n    constructor(t) {\n        this.key = t;\n    }\n}\n\n/**\n * View is responsible for computing the final merged truth of what docs are in\n * a query. It gets notified of local and remote changes to docs, and applies\n * the query filters and limits to determine the most correct possible results.\n */ class $a {\n    constructor(t, \n    /** Documents included in the remote target */\n    e) {\n        this.query = t, this.ka = e, this.Ma = null, \n        /**\n         * A flag whether the view is current with the backend. A view is considered\n         * current after it has seen the current flag from the backend and did not\n         * lose consistency within the watch stream (e.g. because of an existence\n         * filter mismatch).\n         */\n        this.current = !1, \n        /** Documents in the view but not in the remote target */\n        this.Oa = Gn(), \n        /** Document Keys that have local changes */\n        this.mutatedKeys = Gn(), this.$a = Ke(t), this.Fa = new Ia(this.$a);\n    }\n    /**\n     * The set of remote documents that the server has told us belongs to the target associated with\n     * this view.\n     */    get Ba() {\n        return this.ka;\n    }\n    /**\n     * Iterates over a set of doc changes, applies the query limit, and computes\n     * what the new results should be, what the changes were, and whether we may\n     * need to go back to the local cache for more results. Does not make any\n     * changes to the view.\n     * @param docChanges - The doc changes to apply to this view.\n     * @param previousChanges - If this is being called with a refill, then start\n     *        with this set of docs and changes instead of the current view.\n     * @returns a new set of docs, changes, and refill flag.\n     */    La(t, e) {\n        const n = e ? e.qa : new Ta, s = e ? e.Fa : this.Fa;\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\n        // Track the last doc in a (full) limit. This is necessary, because some\n        // update (a delete, or an update moving a doc past the old limit) might\n        // mean there is some other document in the local cache that either should\n        // come (1) between the old last limit doc and the new last document, in the\n        // case of updates, or (2) after the new last document, in the case of\n        // deletes. So we keep this doc at the old limit to compare the updates to.\n        // Note that this should never get used in a refill (when previousChanges is\n        // set), because there will only be adds -- no deletes or updates.\n        const a = Ce(this.query) && s.size === this.query.limit ? s.last() : null, u = xe(this.query) && s.size === this.query.limit ? s.first() : null;\n        // Drop documents out to meet limit/limitToLast requirement.\n        if (t.inorderTraversal(((t, e) => {\n            const c = s.get(t), h = Ue(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \n            // We only consider committed mutations for documents that were\n            // mutated during the lifetime of the view.\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\n            let d = !1;\n            // Calculate change\n                        if (c && h) {\n                c.data.isEqual(h.data) ? l !== f && (n.track({\n                    type: 3 /* Metadata */ ,\n                    doc: h\n                }), d = !0) : this.Ua(c, h) || (n.track({\n                    type: 2 /* Modified */ ,\n                    doc: h\n                }), d = !0, (a && this.$a(h, a) > 0 || u && this.$a(h, u) < 0) && (\n                // This doc moved from inside the limit to outside the limit.\n                // That means there may be some other doc in the local cache\n                // that should be included instead.\n                o = !0));\n            } else !c && h ? (n.track({\n                type: 0 /* Added */ ,\n                doc: h\n            }), d = !0) : c && !h && (n.track({\n                type: 1 /* Removed */ ,\n                doc: c\n            }), d = !0, (a || u) && (\n            // A doc was removed from a full limit query. We'll need to\n            // requery from the local cache to see if we know about some other\n            // doc that should be in the results.\n            o = !0));\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\n        })), Ce(this.query) || xe(this.query)) for (;r.size > this.query.limit; ) {\n            const t = Ce(this.query) ? r.last() : r.first();\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\n                type: 1 /* Removed */ ,\n                doc: t\n            });\n        }\n        return {\n            Fa: r,\n            qa: n,\n            ei: o,\n            mutatedKeys: i\n        };\n    }\n    Ua(t, e) {\n        // We suppress the initial change event for documents that were modified as\n        // part of a write acknowledgment (e.g. when the value of a server transform\n        // is applied) as Watch will send us the same document again.\n        // By suppressing the event, we only raise two user visible events (one with\n        // `hasPendingWrites` and the final state of the document) instead of three\n        // (one with `hasPendingWrites`, the modified document with\n        // `hasPendingWrites` and the final state of the document).\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\n    }\n    /**\n     * Updates the view with the given ViewDocumentChanges and optionally updates\n     * limbo docs and sync state from the provided target change.\n     * @param docChanges - The set of changes to make to the view's docs.\n     * @param updateLimboDocuments - Whether to update limbo documents based on\n     *        this change.\n     * @param targetChange - A target change to apply for computing limbo docs and\n     *        sync state.\n     * @returns A new ViewChange with the given docs, changes, and sync state.\n     */\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\n    applyChanges(t, e, n) {\n        const s = this.Fa;\n        this.Fa = t.Fa, this.mutatedKeys = t.mutatedKeys;\n        // Sort changes based on type and query comparator\n        const i = t.qa.ya();\n        i.sort(((t, e) => function(t, e) {\n            const n = t => {\n                switch (t) {\n                  case 0 /* Added */ :\n                    return 1;\n\n                  case 2 /* Modified */ :\n                  case 3 /* Metadata */ :\n                    // A metadata change is converted to a modified change at the public\n                    // api layer.  Since we sort by document key and then change type,\n                    // metadata and modified changes must be sorted equivalently.\n                    return 2;\n\n                  case 1 /* Removed */ :\n                    return 0;\n\n                  default:\n                    return L();\n                }\n            };\n            return n(t) - n(e);\n        }\n        /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t.type, e.type) || this.$a(t.doc, e.doc))), this.Ka(n);\n        const r = e ? this.Ga() : [], o = 0 === this.Oa.size && this.current ? 1 /* Synced */ : 0 /* Local */ , a = o !== this.Ma;\n        if (this.Ma = o, 0 !== i.length || a) {\n            return {\n                snapshot: new Ea(this.query, t.Fa, s, i, t.mutatedKeys, 0 /* Local */ === o, a, \n                /* excludesMetadataChanges= */ !1),\n                Qa: r\n            };\n        }\n        // no changes\n        return {\n            Qa: r\n        };\n    }\n    /**\n     * Applies an OnlineState change to the view, potentially generating a\n     * ViewChange if the view's syncState changes as a result.\n     */    Ta(t) {\n        return this.current && \"Offline\" /* Offline */ === t ? (\n        // If we're offline, set `current` to false and then call applyChanges()\n        // to refresh our syncState and generate a ViewChange as appropriate. We\n        // are guaranteed to get a new TargetChange that sets `current` back to\n        // true once the client is back online.\n        this.current = !1, this.applyChanges({\n            Fa: this.Fa,\n            qa: new Ta,\n            mutatedKeys: this.mutatedKeys,\n            ei: !1\n        }, \n        /* updateLimboDocuments= */ !1)) : {\n            Qa: []\n        };\n    }\n    /**\n     * Returns whether the doc for the given key should be in limbo.\n     */    ja(t) {\n        // If the remote end says it's part of this query, it's not in limbo.\n        return !this.ka.has(t) && (\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\n        !!this.Fa.has(t) && !this.Fa.get(t).hasLocalMutations);\n    }\n    /**\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\n     * Returns the list of changes to which docs are in limbo.\n     */    Ka(t) {\n        t && (t.addedDocuments.forEach((t => this.ka = this.ka.add(t))), t.modifiedDocuments.forEach((t => {})), \n        t.removedDocuments.forEach((t => this.ka = this.ka.delete(t))), this.current = t.current);\n    }\n    Ga() {\n        // We can only determine limbo documents when we're in-sync with the server.\n        if (!this.current) return [];\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\n        // updating many documents.\n                const t = this.Oa;\n        this.Oa = Gn(), this.Fa.forEach((t => {\n            this.ja(t.key) && (this.Oa = this.Oa.add(t.key));\n        }));\n        // Diff the new limbo docs with the old limbo docs.\n        const e = [];\n        return t.forEach((t => {\n            this.Oa.has(t) || e.push(new Oa(t));\n        })), this.Oa.forEach((n => {\n            t.has(n) || e.push(new Ma(n));\n        })), e;\n    }\n    /**\n     * Update the in-memory state of the current view with the state read from\n     * persistence.\n     *\n     * We update the query view whenever a client's primary status changes:\n     * - When a client transitions from primary to secondary, it can miss\n     *   LocalStorage updates and its query views may temporarily not be\n     *   synchronized with the state on disk.\n     * - For secondary to primary transitions, the client needs to update the list\n     *   of `syncedDocuments` since secondary clients update their query views\n     *   based purely on synthesized RemoteEvents.\n     *\n     * @param queryResult.documents - The documents that match the query according\n     * to the LocalStore.\n     * @param queryResult.remoteKeys - The keys of the documents that match the\n     * query according to the backend.\n     *\n     * @returns The ViewChange that resulted from this synchronization.\n     */\n    // PORTING NOTE: Multi-tab only.\n    Wa(t) {\n        this.ka = t.hi, this.Oa = Gn();\n        const e = this.La(t.documents);\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\n    }\n    /**\n     * Returns a view snapshot as if this query was just listened to. Contains\n     * a document add for every existing document and the `fromCache` and\n     * `hasPendingWrites` status of the already established view.\n     */\n    // PORTING NOTE: Multi-tab only.\n    za() {\n        return Ea.fromInitialDocuments(this.query, this.Fa, this.mutatedKeys, 0 /* Local */ === this.Ma);\n    }\n}\n\n/**\n * QueryView contains all of the data that SyncEngine needs to keep track of for\n * a particular query.\n */\nclass Fa {\n    constructor(\n    /**\n     * The query itself.\n     */\n    t, \n    /**\n     * The target number created by the client that is used in the watch\n     * stream to identify this query.\n     */\n    e, \n    /**\n     * The view is responsible for computing the final merged truth of what\n     * docs are in the query. It gets notified of local and remote changes,\n     * and applies the query filters and limits to determine the most correct\n     * possible results.\n     */\n    n) {\n        this.query = t, this.targetId = e, this.view = n;\n    }\n}\n\n/** Tracks a limbo resolution. */ class Ba {\n    constructor(t) {\n        this.key = t, \n        /**\n         * Set to true once we've received a document. This is used in\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\n         * decide whether it needs to manufacture a delete event for the target once\n         * the target is CURRENT.\n         */\n        this.Ha = !1;\n    }\n}\n\n/**\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\n *\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\n * registered individually. This is done in `syncEngineWrite()` and\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\n * serve as entry points to RemoteStore's functionality.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */ class La {\n    constructor(t, e, n, \n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\n    s, i, r) {\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.Ja = {}, this.Ya = new Dn((t => Le(t)), Be), \n        this.Xa = new Map, \n        /**\n         * The keys of documents that are in limbo for which we haven't yet started a\n         * limbo resolution query. The strings in this set are the result of calling\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\n         *\n         * The `Set` type was chosen because it provides efficient lookup and removal\n         * of arbitrary elements and it also maintains insertion order, providing the\n         * desired queue-like FIFO semantics.\n         */\n        this.Za = new Set, \n        /**\n         * Keeps track of the target ID for each document that is in limbo with an\n         * active target.\n         */\n        this.tu = new Cn(xt.comparator), \n        /**\n         * Keeps track of the information about an active limbo resolution for each\n         * active target ID that was started for the purpose of limbo resolution.\n         */\n        this.eu = new Map, this.nu = new co, \n        /** Stores user completion handlers, indexed by User and BatchId. */\n        this.su = {}, \n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\n        this.iu = new Map, this.ru = mr.gn(), this.onlineState = \"Unknown\" /* Unknown */ , \n        // The primary state is set to `true` or `false` immediately after Firestore\n        // startup. In the interim, a client should only be considered primary if\n        // `isPrimary` is true.\n        this.ou = void 0;\n    }\n    get isPrimaryClient() {\n        return !0 === this.ou;\n    }\n}\n\n/**\n * Initiates the new listen, resolves promise when listen enqueued to the\n * server. All the subsequent view snapshots or errors are sent to the\n * subscribed handlers. Returns the initial snapshot.\n */\nasync function qa(t, e) {\n    const n = mu(t);\n    let s, i;\n    const r = n.Ya.get(e);\n    if (r) \n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\n    // already exists when EventManager calls us for the first time. This\n    // happens when the primary tab is already listening to this query on\n    // behalf of another tab and the user of the primary also starts listening\n    // to the query. EventManager will not have an assigned target ID in this\n    // case and calls `listen` to obtain this ID.\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.za(); else {\n        const t = await Zr(n.localStore, $e(e));\n        n.isPrimaryClient && jo(n.remoteStore, t);\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\n        s = t.targetId, i = await Ua(n, e, s, \"current\" === r);\n    }\n    return i;\n}\n\n/**\n * Registers a view for a previously unknown query and computes its initial\n * snapshot.\n */ async function Ua(t, e, n, s) {\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n    // targets based on view changes. This allows us to only depend on Limbo\n    // changes when user code includes queries.\n    t.au = (e, n, s) => async function(t, e, n, s) {\n        let i = e.view.La(n);\n        i.ei && (\n        // The query has a limit and some docs were removed, so we need\n        // to re-run the query against the local store to make sure we\n        // didn't lose any good docs that had been past the limit.\n        i = await eo(t.localStore, e.query, \n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.La(t, i))));\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\n        return eu(t, e.targetId, o.Qa), o.snapshot;\n    }(t, e, n, s);\n    const i = await eo(t.localStore, e, \n    /* usePreviousResults= */ !0), r = new $a(e, i.hi), o = r.La(i.documents), a = zn.createSynthesizedTargetChangeForCurrentChange(n, s && \"Offline\" /* Offline */ !== t.onlineState), u = r.applyChanges(o, \n    /* updateLimboDocuments= */ t.isPrimaryClient, a);\n    eu(t, n, u.Qa);\n    const c = new Fa(e, n, r);\n    return t.Ya.set(e, c), t.Xa.has(n) ? t.Xa.get(n).push(e) : t.Xa.set(n, [ e ]), u.snapshot;\n}\n\n/** Stops listening to the query. */ async function Ka(t, e) {\n    const n = K(t), s = n.Ya.get(e), i = n.Xa.get(s.targetId);\n    if (i.length > 1) return n.Xa.set(s.targetId, i.filter((t => !Be(t, e)))), void n.Ya.delete(e);\n    // No other queries are mapped to the target, clean up the query and the target.\n        if (n.isPrimaryClient) {\n        // We need to remove the local query target first to allow us to verify\n        // whether any other client is still interested in this target.\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await to(n.localStore, s.targetId, \n        /*keepPersistedTargetData=*/ !1).then((() => {\n            n.sharedClientState.clearQueryState(s.targetId), Wo(n.remoteStore, s.targetId), \n            Za(n, s.targetId);\n        })).catch(Tr);\n    } else Za(n, s.targetId), await to(n.localStore, s.targetId, \n    /*keepPersistedTargetData=*/ !0);\n}\n\n/**\n * Initiates the write of local mutation batch which involves adding the\n * writes to the mutation queue, notifying the remote store about new\n * mutations and raising events for any changes this write caused.\n *\n * The promise returned by this call is resolved when the above steps\n * have completed, *not* when the write was acked by the backend. The\n * userCallback is resolved once the write was acked/rejected by the\n * backend (or failed locally for any other reason).\n */ async function Ga(t, e, n) {\n    const s = gu(t);\n    try {\n        const t = await function(t, e) {\n            const n = K(t), s = ut.now(), i = e.reduce(((t, e) => t.add(e.key)), Gn());\n            let r;\n            return n.persistence.runTransaction(\"Locally write mutations\", \"readwrite\", (t => n.ui.Us(t, i).next((i => {\n                r = i;\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\n                // we record the base state in a separate patch mutation. This is\n                // later used to guarantee consistent values and prevents flicker\n                // even if the backend sends us an update that already includes our\n                // transform.\n                const o = [];\n                for (const t of e) {\n                    const e = wn(t, r.get(t.key));\n                    null != e && \n                    // NOTE: The base state should only be applied if there's some\n                    // existing document to override, so use a Precondition of\n                    // exists=true\n                    o.push(new pn(t.key, e, Zt(e.value.mapValue), hn.exists(!0)));\n                }\n                return n.Fs.addMutationBatch(t, s, o, e);\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\n                batchId: t.batchId,\n                changes: r\n            })));\n        }(s.localStore, e);\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\n            let s = t.su[t.currentUser.toKey()];\n            s || (s = new Cn(rt));\n            s = s.insert(e, n), t.su[t.currentUser.toKey()] = s;\n        }\n        /**\n * Resolves or rejects the user callback for the given batch and then discards\n * it.\n */ (s, t.batchId, n), await iu(s, t.changes), await ra(s.remoteStore);\n    } catch (t) {\n        // If we can't persist the mutation, we reject the user callback and\n        // don't send the mutation. The user can then retry the write.\n        const e = pa(t, \"Failed to persist write\");\n        n.reject(e);\n    }\n}\n\n/**\n * Applies one remote event to the sync engine, notifying any views of the\n * changes, and releasing any pending mutation batches that would become\n * visible because of the snapshot version the remote event contains.\n */ async function Qa(t, e) {\n    const n = K(t);\n    try {\n        const t = await Jr(n.localStore, e);\n        // Update `receivedDocument` as appropriate for any limbo targets.\n                e.targetChanges.forEach(((t, e) => {\n            const s = n.eu.get(e);\n            s && (\n            // Since this is a limbo resolution lookup, it's for a single document\n            // and it could be added, modified, or removed, but not a combination.\n            q(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \n            t.addedDocuments.size > 0 ? s.Ha = !0 : t.modifiedDocuments.size > 0 ? q(s.Ha) : t.removedDocuments.size > 0 && (q(s.Ha), \n            s.Ha = !1));\n        })), await iu(n, t, e);\n    } catch (t) {\n        await Tr(t);\n    }\n}\n\n/**\n * Applies an OnlineState change to the sync engine and notifies any views of\n * the change.\n */ function ja(t, e, n) {\n    const s = K(t);\n    // If we are the secondary client, we explicitly ignore the remote store's\n    // online state (the local client may go offline, even though the primary\n    // tab remains online) and only apply the primary tab's online state from\n    // SharedClientState.\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\n        const t = [];\n        s.Ya.forEach(((n, s) => {\n            const i = s.view.Ta(e);\n            i.snapshot && t.push(i.snapshot);\n        })), function(t, e) {\n            const n = K(t);\n            n.onlineState = e;\n            let s = !1;\n            n.queries.forEach(((t, n) => {\n                for (const t of n.listeners) \n                // Run global snapshot listeners if a consistent snapshot has been emitted.\n                t.Ta(e) && (s = !0);\n            })), s && Sa(n);\n        }(s.eventManager, e), t.length && s.Ja.Ko(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\n    }\n}\n\n/**\n * Rejects the listen for the given targetID. This can be triggered by the\n * backend for any active target.\n *\n * @param syncEngine - The sync engine implementation.\n * @param targetId - The targetID corresponds to one previously initiated by the\n * user as part of TargetData passed to listen() on RemoteStore.\n * @param err - A description of the condition that has forced the rejection.\n * Nearly always this will be an indication that the user is no longer\n * authorized to see the data matching the target.\n */ async function Wa(t, e, n) {\n    const s = K(t);\n    // PORTING NOTE: Multi-tab only.\n        s.sharedClientState.updateQueryState(e, \"rejected\", n);\n    const i = s.eu.get(e), r = i && i.key;\n    if (r) {\n        // TODO(klimt): We really only should do the following on permission\n        // denied errors, but we don't have the cause code here.\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\n        // This is kind of a hack. Ideally, we would have a method in the local\n        // store to purge a document. However, it would be tricky to keep all of\n        // the local store's invariants with another method.\n        let t = new Cn(xt.comparator);\n        // TODO(b/217189216): This limbo document should ideally have a read time,\n        // so that it is picked up by any read-time based scans. The backend,\n        // however, does not send a read time for target removals.\n                t = t.insert(r, te.newNoDocument(r, ct.min()));\n        const n = Gn().add(r), i = new Wn(ct.min(), \n        /* targetChanges= */ new Map, \n        /* targetMismatches= */ new kn(rt), t, n);\n        await Qa(s, i), \n        // Since this query failed, we won't want to manually unlisten to it.\n        // We only remove it from bookkeeping after we successfully applied the\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\n        // this query when the RemoteStore restarts the Watch stream, which should\n        // re-trigger the target failure.\n        s.tu = s.tu.remove(r), s.eu.delete(e), su(s);\n    } else await to(s.localStore, e, \n    /* keepPersistedTargetData */ !1).then((() => Za(s, e, n))).catch(Tr);\n}\n\nasync function za(t, e) {\n    const n = K(t), s = e.batch.batchId;\n    try {\n        const t = await zr(n.localStore, e);\n        // The local store may or may not be able to apply the write result and\n        // raise events immediately (depending on whether the watcher is caught\n        // up), so we raise user callbacks first so that they consistently happen\n        // before listen events.\n                Xa(n, s, /*error=*/ null), Ya(n, s), n.sharedClientState.updateMutationState(s, \"acknowledged\"), \n        await iu(n, t);\n    } catch (t) {\n        await Tr(t);\n    }\n}\n\nasync function Ha(t, e, n) {\n    const s = K(t);\n    try {\n        const t = await function(t, e) {\n            const n = K(t);\n            return n.persistence.runTransaction(\"Reject batch\", \"readwrite-primary\", (t => {\n                let s;\n                return n.Fs.lookupMutationBatch(t, e).next((e => (q(null !== e), s = e.keys(), n.Fs.removeMutationBatch(t, e)))).next((() => n.Fs.performConsistencyCheck(t))).next((() => n.ui.Us(t, s)));\n            }));\n        }\n        /**\n * Returns the largest (latest) batch id in mutation queue that is pending\n * server response.\n *\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\n */ (s.localStore, e);\n        // The local store may or may not be able to apply the write result and\n        // raise events immediately (depending on whether the watcher is caught up),\n        // so we raise user callbacks first so that they consistently happen before\n        // listen events.\n                Xa(s, e, n), Ya(s, e), s.sharedClientState.updateMutationState(e, \"rejected\", n), \n        await iu(s, t);\n    } catch (n) {\n        await Tr(n);\n    }\n}\n\n/**\n * Registers a user callback that resolves when all pending mutations at the moment of calling\n * are acknowledged .\n */ async function Ja(t, e) {\n    const n = K(t);\n    Xo(n.remoteStore) || O(\"SyncEngine\", \"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\");\n    try {\n        const t = await function(t) {\n            const e = K(t);\n            return e.persistence.runTransaction(\"Get highest unacknowledged batch id\", \"readonly\", (t => e.Fs.getHighestUnacknowledgedBatchId(t)));\n        }(n.localStore);\n        if (-1 === t) \n        // Trigger the callback right away if there is no pending writes at the moment.\n        return void e.resolve();\n        const s = n.iu.get(t) || [];\n        s.push(e), n.iu.set(t, s);\n    } catch (t) {\n        const n = pa(t, \"Initialization of waitForPendingWrites() operation failed\");\n        e.reject(n);\n    }\n}\n\n/**\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\n * if there are any.\n */ function Ya(t, e) {\n    (t.iu.get(e) || []).forEach((t => {\n        t.resolve();\n    })), t.iu.delete(e);\n}\n\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function Xa(t, e, n) {\n    const s = K(t);\n    let i = s.su[s.currentUser.toKey()];\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\n    // okay for there to be no callback for this ID.\n        if (i) {\n        const t = i.get(e);\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.su[s.currentUser.toKey()] = i;\n    }\n}\n\nfunction Za(t, e, n = null) {\n    t.sharedClientState.removeLocalQueryTarget(e);\n    for (const s of t.Xa.get(e)) t.Ya.delete(s), n && t.Ja.uu(s, n);\n    if (t.Xa.delete(e), t.isPrimaryClient) {\n        t.nu.Ri(e).forEach((e => {\n            t.nu.containsKey(e) || \n            // We removed the last reference for this key\n            tu(t, e);\n        }));\n    }\n}\n\nfunction tu(t, e) {\n    t.Za.delete(e.path.canonicalString());\n    // It's possible that the target already got removed because the query failed. In that case,\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\n    const n = t.tu.get(e);\n    null !== n && (Wo(t.remoteStore, n), t.tu = t.tu.remove(e), t.eu.delete(n), su(t));\n}\n\nfunction eu(t, e, n) {\n    for (const s of n) if (s instanceof Ma) t.nu.addReference(s.key, e), nu(t, s); else if (s instanceof Oa) {\n        O(\"SyncEngine\", \"Document no longer in limbo: \" + s.key), t.nu.removeReference(s.key, e);\n        t.nu.containsKey(s.key) || \n        // We removed the last reference for this key\n        tu(t, s.key);\n    } else L();\n}\n\nfunction nu(t, e) {\n    const n = e.key, s = n.path.canonicalString();\n    t.tu.get(n) || t.Za.has(s) || (O(\"SyncEngine\", \"New document in limbo: \" + n), t.Za.add(s), \n    su(t));\n}\n\n/**\n * Starts listens for documents in limbo that are enqueued for resolution,\n * subject to a maximum number of concurrent resolutions.\n *\n * Without bounding the number of concurrent resolutions, the server can fail\n * with \"resource exhausted\" errors which can lead to pathological client\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\n */ function su(t) {\n    for (;t.Za.size > 0 && t.tu.size < t.maxConcurrentLimboResolutions; ) {\n        const e = t.Za.values().next().value;\n        t.Za.delete(e);\n        const n = new xt(_t.fromString(e)), s = t.ru.next();\n        t.eu.set(s, new Ba(n)), t.tu = t.tu.insert(n, s), jo(t.remoteStore, new Ai($e(De(n.path)), s, 2 /* LimboResolution */ , nt.A));\n    }\n}\n\nasync function iu(t, e, n) {\n    const s = K(t), i = [], r = [], o = [];\n    s.Ya.isEmpty() || (s.Ya.forEach(((t, a) => {\n        o.push(s.au(a, e, n).then((t => {\n            if (t) {\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(a.targetId, t.fromCache ? \"not-current\" : \"current\"), \n                i.push(t);\n                const e = Kr.Js(a.targetId, t);\n                r.push(e);\n            }\n        })));\n    })), await Promise.all(o), s.Ja.Ko(i), await async function(t, e) {\n        const n = K(t);\n        try {\n            await n.persistence.runTransaction(\"notifyLocalViewChanges\", \"readwrite\", (t => ui.forEach(e, (e => ui.forEach(e.zs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => ui.forEach(e.Hs, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\n        } catch (t) {\n            if (!di(t)) throw t;\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\n            // number for the documents that were included in this transaction.\n            // This might trigger them to be deleted earlier than they otherwise\n            // would have, but it should not invalidate the integrity of the data.\n            O(\"LocalStore\", \"Failed to update sequence numbers: \" + t);\n        }\n        for (const t of e) {\n            const e = t.targetId;\n            if (!t.fromCache) {\n                const t = n.si.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\n                // Advance the last limbo free snapshot version\n                                n.si = n.si.insert(e, i);\n            }\n        }\n    }(s.localStore, r));\n}\n\nasync function ru(t, e) {\n    const n = K(t);\n    if (!n.currentUser.isEqual(e)) {\n        O(\"SyncEngine\", \"User change. New user:\", e.toKey());\n        const t = await Wr(n.localStore, e);\n        n.currentUser = e, \n        // Fails tasks waiting for pending writes requested by previous user.\n        function(t, e) {\n            t.iu.forEach((t => {\n                t.forEach((t => {\n                    t.reject(new Q(G.CANCELLED, e));\n                }));\n            })), t.iu.clear();\n        }(n, \"'waitForPendingWrites' promise is rejected due to a user change.\"), \n        // TODO(b/114226417): Consider calling this only in the primary tab.\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await iu(n, t.ci);\n    }\n}\n\nfunction ou(t, e) {\n    const n = K(t), s = n.eu.get(e);\n    if (s && s.Ha) return Gn().add(s.key);\n    {\n        let t = Gn();\n        const s = n.Xa.get(e);\n        if (!s) return t;\n        for (const e of s) {\n            const s = n.Ya.get(e);\n            t = t.unionWith(s.view.Ba);\n        }\n        return t;\n    }\n}\n\n/**\n * Reconcile the list of synced documents in an existing view with those\n * from persistence.\n */ async function au(t, e) {\n    const n = K(t), s = await eo(n.localStore, e.query, \n    /* usePreviousResults= */ !0), i = e.view.Wa(s);\n    return n.isPrimaryClient && eu(n, e.targetId, i.Qa), i;\n}\n\n/**\n * Retrieves newly changed documents from remote document cache and raises\n * snapshots if needed.\n */\n// PORTING NOTE: Multi-Tab only.\nasync function uu(t) {\n    const e = K(t);\n    return so(e.localStore).then((t => iu(e, t)));\n}\n\n/** Applies a mutation state to an existing batch.  */\n// PORTING NOTE: Multi-Tab only.\nasync function cu(t, e, n, s) {\n    const i = K(t), r = await function(t, e) {\n        const n = K(t), s = K(n.Fs);\n        return n.persistence.runTransaction(\"Lookup mutation documents\", \"readonly\", (t => s.ln(t, e).next((e => e ? n.ui.Us(t, e) : ui.resolve(null)))));\n    }\n    // PORTING NOTE: Multi-Tab only.\n    (i.localStore, e);\n    null !== r ? (\"pending\" === n ? \n    // If we are the primary client, we need to send this write to the\n    // backend. Secondary clients will ignore these writes since their remote\n    // connection is disabled.\n    await ra(i.remoteStore) : \"acknowledged\" === n || \"rejected\" === n ? (\n    // NOTE: Both these methods are no-ops for batches that originated from\n    // other clients.\n    Xa(i, e, s || null), Ya(i, e), function(t, e) {\n        K(K(t).Fs).dn(e);\n    }\n    // PORTING NOTE: Multi-Tab only.\n    (i.localStore, e)) : L(), await iu(i, r)) : \n    // A throttled tab may not have seen the mutation before it was completed\n    // and removed from the mutation queue, in which case we won't have cached\n    // the affected documents. In this case we can safely ignore the update\n    // since that means we didn't apply the mutation locally at all (if we\n    // had, we would have cached the affected documents), and so we will just\n    // see any resulting document changes via normal remote document updates\n    // as applicable.\n    O(\"SyncEngine\", \"Cannot apply mutation batch with id: \" + e);\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nasync function hu(t, e) {\n    const n = K(t);\n    if (mu(n), gu(n), !0 === e && !0 !== n.ou) {\n        // Secondary tabs only maintain Views for their local listeners and the\n        // Views internal state may not be 100% populated (in particular\n        // secondary tabs don't track syncedDocuments, the set of documents the\n        // server considers to be in the target). So when a secondary becomes\n        // primary, we need to need to make sure that all views for all targets\n        // match the state on disk.\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await lu(n, t.toArray());\n        n.ou = !0, await wa(n.remoteStore, !0);\n        for (const t of e) jo(n.remoteStore, t);\n    } else if (!1 === e && !1 !== n.ou) {\n        const t = [];\n        let e = Promise.resolve();\n        n.Xa.forEach(((s, i) => {\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (Za(n, i), \n            to(n.localStore, i, \n            /*keepPersistedTargetData=*/ !0)))), Wo(n.remoteStore, i);\n        })), await e, await lu(n, t), \n        // PORTING NOTE: Multi-Tab only.\n        function(t) {\n            const e = K(t);\n            e.eu.forEach(((t, n) => {\n                Wo(e.remoteStore, n);\n            })), e.nu.bi(), e.eu = new Map, e.tu = new Cn(xt.comparator);\n        }\n        /**\n * Reconcile the query views of the provided query targets with the state from\n * persistence. Raises snapshots for any changes that affect the local\n * client and returns the updated state of all target's query data.\n *\n * @param syncEngine - The sync engine implementation\n * @param targets - the list of targets with views that need to be recomputed\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\n * tab to a primary tab\n */\n        // PORTING NOTE: Multi-Tab only.\n        (n), n.ou = !1, await wa(n.remoteStore, !1);\n    }\n}\n\nasync function lu(t, e, n) {\n    const s = K(t), i = [], r = [];\n    for (const t of e) {\n        let e;\n        const n = s.Xa.get(t);\n        if (n && 0 !== n.length) {\n            // For queries that have a local View, we fetch their current state\n            // from LocalStore (as the resume token and the snapshot version\n            // might have changed) and reconcile their views with the persisted\n            // state (the list of syncedDocuments may have gotten out of sync).\n            e = await Zr(s.localStore, $e(n[0]));\n            for (const t of n) {\n                const e = s.Ya.get(t), n = await au(s, e);\n                n.snapshot && r.push(n.snapshot);\n            }\n        } else {\n            // For queries that never executed on this client, we need to\n            // allocate the target in LocalStore and initialize a new View.\n            const n = await no(s.localStore, t);\n            e = await Zr(s.localStore, n), await Ua(s, fu(n), t, \n            /*current=*/ !1);\n        }\n        i.push(e);\n    }\n    return s.Ja.Ko(r), i;\n}\n\n/**\n * Creates a `Query` object from the specified `Target`. There is no way to\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\n * object.\n *\n * The synthesized result might be different from the original `Query`, but\n * since the synthesized `Query` should return the same results as the\n * original one (only the presentation of results might differ), the potential\n * difference will not cause issues.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction fu(t) {\n    return Se(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \"F\" /* First */ , t.startAt, t.endAt);\n}\n\n/** Returns the IDs of the clients that are currently active. */\n// PORTING NOTE: Multi-Tab only.\nfunction du(t) {\n    const e = K(t);\n    return K(K(e.localStore).persistence).Ms();\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nasync function _u(t, e, n, s) {\n    const i = K(t);\n    if (i.ou) \n    // If we receive a target state notification via WebStorage, we are\n    // either already secondary or another tab has taken the primary lease.\n    O(\"SyncEngine\", \"Ignoring unexpected query state notification.\"); else if (i.Xa.has(e)) switch (n) {\n      case \"current\":\n      case \"not-current\":\n        {\n            const t = await so(i.localStore), s = Wn.createSynthesizedRemoteEventForCurrentChange(e, \"current\" === n);\n            await iu(i, t, s);\n            break;\n        }\n\n      case \"rejected\":\n        await to(i.localStore, e, \n        /* keepPersistedTargetData */ !0), Za(i, e, s);\n        break;\n\n      default:\n        L();\n    }\n}\n\n/** Adds or removes Watch targets for queries from different tabs. */ async function wu(t, e, n) {\n    const s = mu(t);\n    if (s.ou) {\n        for (const t of e) {\n            if (s.Xa.has(t)) {\n                // A target might have been added in a previous attempt\n                O(\"SyncEngine\", \"Adding an already active target \" + t);\n                continue;\n            }\n            const e = await no(s.localStore, t), n = await Zr(s.localStore, e);\n            await Ua(s, fu(e), n.targetId, \n            /*current=*/ !1), jo(s.remoteStore, n);\n        }\n        for (const t of n) \n        // Check that the target is still active since the target might have been\n        // removed if it has been rejected by the backend.\n        s.Xa.has(t) && \n        // Release queries that are still active.\n        await to(s.localStore, t, \n        /* keepPersistedTargetData */ !1).then((() => {\n            Wo(s.remoteStore, t), Za(s, t);\n        })).catch(Tr);\n    }\n}\n\nfunction mu(t) {\n    const e = K(t);\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = Qa.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ou.bind(null, e), \n    e.remoteStore.remoteSyncer.rejectListen = Wa.bind(null, e), e.Ja.Ko = Va.bind(null, e.eventManager), \n    e.Ja.uu = va.bind(null, e.eventManager), e;\n}\n\nfunction gu(t) {\n    const e = K(t);\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = za.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = Ha.bind(null, e), \n    e;\n}\n\n/**\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\n * the bundle finished loading.\n *\n * @param syncEngine - SyncEngine to use.\n * @param bundleReader - Bundle to load into the SDK.\n * @param task - LoadBundleTask used to update the loading progress to public API.\n */ function yu(t, e, n) {\n    const s = K(t);\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        (async function(t, e, n) {\n        try {\n            const s = await e.getMetadata();\n            if (await function(t, e) {\n                const n = K(t), s = us(e.createTime);\n                return n.persistence.runTransaction(\"hasNewerBundle\", \"readonly\", (t => n.fs.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\n            }\n            /**\n * Saves the given `BundleMetadata` to local persistence.\n */ (t.localStore, s)) return await e.close(), void n._completeWith(function(t) {\n                return {\n                    taskState: \"Success\",\n                    documentsLoaded: t.totalDocuments,\n                    bytesLoaded: t.totalBytes,\n                    totalDocuments: t.totalDocuments,\n                    totalBytes: t.totalBytes\n                };\n            }(s));\n            n._updateProgress(ka(s));\n            const i = new Na(s, t.localStore, e.M);\n            let r = await e.cu();\n            for (;r; ) {\n                const t = await i.xa(r);\n                t && n._updateProgress(t), r = await e.cu();\n            }\n            const o = await i.complete();\n            // TODO(b/160876443): This currently raises snapshots with\n            // `fromCache=false` if users already listen to some queries and bundles\n            // has newer version.\n                        await iu(t, o.$s, \n            /* remoteEvent */ void 0), \n            // Save metadata, so loading the same bundle will skip.\n            await function(t, e) {\n                const n = K(t);\n                return n.persistence.runTransaction(\"Save bundle\", \"readwrite\", (t => n.fs.saveBundleMetadata(t, e)));\n            }\n            /**\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\n * resolves to undefined if no persisted data can be found.\n */ (t.localStore, s), n._completeWith(o.progress);\n        } catch (t) {\n            F(\"SyncEngine\", `Loading bundle failed with ${t}`), n._failWith(t);\n        }\n    }\n    /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n    /**\n * Provides all components needed for Firestore with in-memory persistence.\n * Uses EagerGC garbage collection.\n */)(s, e, n).then((() => {\n        s.sharedClientState.notifyBundleLoaded();\n    }));\n}\n\nclass pu {\n    constructor() {\n        this.synchronizeTabs = !1;\n    }\n    async initialize(t) {\n        this.M = Oo(t.databaseInfo.databaseId), this.sharedClientState = this.hu(t), this.persistence = this.lu(t), \n        await this.persistence.start(), this.gcScheduler = this.fu(t), this.localStore = this.du(t);\n    }\n    fu(t) {\n        return null;\n    }\n    du(t) {\n        return jr(this.persistence, new Gr, t.initialUser, this.M);\n    }\n    lu(t) {\n        return new mo(yo.Wi, this.M);\n    }\n    hu(t) {\n        return new vo;\n    }\n    async terminate() {\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \n        await this.persistence.shutdown();\n    }\n}\n\n/**\n * Provides all components needed for Firestore with IndexedDB persistence.\n */ class Iu extends pu {\n    constructor(t, e, n) {\n        super(), this._u = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\n    }\n    async initialize(t) {\n        await super.initialize(t), await io(this.localStore), await this._u.initialize(this, t), \n        // Enqueue writes from a previous session\n        await gu(this._u.syncEngine), await ra(this._u.remoteStore), \n        // NOTE: This will immediately call the listener, so we make sure to\n        // set it after localStore / remoteStore are started.\n        await this.persistence.ps((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \n        Promise.resolve())));\n    }\n    du(t) {\n        return jr(this.persistence, new Gr, t.initialUser, this.M);\n    }\n    fu(t) {\n        const e = this.persistence.referenceDelegate.garbageCollector;\n        return new Rr(e, t.asyncQueue);\n    }\n    lu(t) {\n        const e = Lr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? ur.withCacheSize(this.cacheSizeBytes) : ur.DEFAULT;\n        return new $r(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, ko(), Mo(), this.M, this.sharedClientState, !!this.forceOwnership);\n    }\n    hu(t) {\n        return new vo;\n    }\n}\n\n/**\n * Provides all components needed for Firestore with multi-tab IndexedDB\n * persistence.\n *\n * In the legacy client, this provider is used to provide both multi-tab and\n * non-multi-tab persistence since we cannot tell at build time whether\n * `synchronizeTabs` will be enabled.\n */ class Tu extends Iu {\n    constructor(t, e) {\n        super(t, e, /* forceOwnership= */ !1), this._u = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\n    }\n    async initialize(t) {\n        await super.initialize(t);\n        const e = this._u.syncEngine;\n        this.sharedClientState instanceof Vo && (this.sharedClientState.syncEngine = {\n            Nr: cu.bind(null, e),\n            kr: _u.bind(null, e),\n            Mr: wu.bind(null, e),\n            Ms: du.bind(null, e),\n            Cr: uu.bind(null, e)\n        }, await this.sharedClientState.start()), \n        // NOTE: This will immediately call the listener, so we make sure to\n        // set it after localStore / remoteStore are started.\n        await this.persistence.ps((async t => {\n            await hu(this._u.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\n        }));\n    }\n    hu(t) {\n        const e = ko();\n        if (!Vo.vt(e)) throw new Q(G.UNIMPLEMENTED, \"IndexedDB persistence is only available on platforms that support LocalStorage.\");\n        const n = Lr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\n        return new Vo(e, t.asyncQueue, n, t.clientId, t.initialUser);\n    }\n}\n\n/**\n * Initializes and wires the components that are needed to interface with the\n * network.\n */ class Eu {\n    async initialize(t, e) {\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => ja(this.syncEngine, t, 1 /* SharedClientState */), \n        this.remoteStore.remoteSyncer.handleCredentialChange = ru.bind(null, this.syncEngine), \n        await wa(this.remoteStore, this.syncEngine.isPrimaryClient));\n    }\n    createEventManager(t) {\n        return new Ra;\n    }\n    createDatastore(t) {\n        const e = Oo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new No(s));\n        var s;\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\n            return new qo(t, e, n, s);\n        }(t.authCredentials, t.appCheckCredentials, n, e);\n    }\n    createRemoteStore(t) {\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => ja(this.syncEngine, t, 0 /* RemoteStore */), \n        r = Do.vt() ? new Do : new So, new Ko(e, n, s, i, r);\n        var e, n, s, i, r;\n        /** Re-enables the network. Idempotent. */    }\n    createSyncEngine(t, e) {\n        return function(t, e, n, \n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\n        s, i, r, o) {\n            const a = new La(t, e, n, s, i, r);\n            return o && (a.ou = !0), a;\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\n    }\n    terminate() {\n        return async function(t) {\n            const e = K(t);\n            O(\"RemoteStore\", \"RemoteStore shutting down.\"), e.ha.add(5 /* Shutdown */), await Qo(e), \n            e.fa.shutdown(), \n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\n            // triggering spurious listener events with cached data, etc.\n            e.da.set(\"Unknown\" /* Unknown */);\n        }(this.remoteStore);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * How many bytes to read each time when `ReadableStreamReader.read()` is\n * called. Only applicable for byte streams that we control (e.g. those backed\n * by an UInt8Array).\n */\n/**\n * Builds a `ByteStreamReader` from a UInt8Array.\n * @param source - The data source to use.\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\n *        will read.\n */\nfunction Au(t, e = 10240) {\n    let n = 0;\n    // The TypeScript definition for ReadableStreamReader changed. We use\n    // `any` here to allow this code to compile with different versions.\n    // See https://github.com/microsoft/TypeScript/issues/42970\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        return {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        async read() {\n            if (n < t.byteLength) {\n                const s = {\n                    value: t.slice(n, n + e),\n                    done: !1\n                };\n                return n += e, s;\n            }\n            return {\n                done: !0\n            };\n        },\n        async cancel() {},\n        releaseLock() {},\n        closed: Promise.reject(\"unimplemented\")\n    };\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * A wrapper implementation of Observer<T> that will dispatch events\n * asynchronously. To allow immediate silencing, a mute call is added which\n * causes events scheduled to no longer be raised.\n */\nclass Ru {\n    constructor(t) {\n        this.observer = t, \n        /**\n         * When set to true, will not raise future events. Necessary to deal with\n         * async detachment of listener.\n         */\n        this.muted = !1;\n    }\n    next(t) {\n        this.observer.next && this.wu(this.observer.next, t);\n    }\n    error(t) {\n        this.observer.error ? this.wu(this.observer.error, t) : console.error(\"Uncaught Error in snapshot listener:\", t);\n    }\n    mu() {\n        this.muted = !0;\n    }\n    wu(t, e) {\n        this.muted || setTimeout((() => {\n            this.muted || t(e);\n        }), 0);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A class representing a bundle.\n *\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\n * elements out of the underlying content.\n */ class bu {\n    constructor(\n    /** The reader to read from underlying binary bundle data source. */\n    t, e) {\n        this.gu = t, this.M = e, \n        /** Cached bundle metadata. */\n        this.metadata = new j, \n        /**\n         * Internal buffer to hold bundle content, accumulating incomplete element\n         * content.\n         */\n        this.buffer = new Uint8Array, this.yu = new TextDecoder(\"utf-8\"), \n        // Read the metadata (which is the first element).\n        this.pu().then((t => {\n            t && t.Da() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\n        }), (t => this.metadata.reject(t)));\n    }\n    close() {\n        return this.gu.cancel();\n    }\n    async getMetadata() {\n        return this.metadata.promise;\n    }\n    async cu() {\n        // Makes sure metadata is read before proceeding.\n        return await this.getMetadata(), this.pu();\n    }\n    /**\n     * Reads from the head of internal buffer, and pulling more data from\n     * underlying stream if a complete element cannot be found, until an\n     * element(including the prefixed length and the JSON string) is found.\n     *\n     * Once a complete element is read, it is dropped from internal buffer.\n     *\n     * Returns either the bundled element, or null if we have reached the end of\n     * the stream.\n     */    async pu() {\n        const t = await this.Iu();\n        if (null === t) return null;\n        const e = this.yu.decode(t), n = Number(e);\n        isNaN(n) && this.Tu(`length string (${e}) is not valid number`);\n        const s = await this.Eu(n);\n        return new Ca(JSON.parse(s), t.length + n);\n    }\n    /** First index of '{' from the underlying buffer. */    Au() {\n        return this.buffer.findIndex((t => t === \"{\".charCodeAt(0)));\n    }\n    /**\n     * Reads from the beginning of the internal buffer, until the first '{', and\n     * return the content.\n     *\n     * If reached end of the stream, returns a null.\n     */    async Iu() {\n        for (;this.Au() < 0; ) {\n            if (await this.Ru()) break;\n        }\n        // Broke out of the loop because underlying stream is closed, and there\n        // happens to be no more data to process.\n                if (0 === this.buffer.length) return null;\n        const t = this.Au();\n        // Broke out of the loop because underlying stream is closed, but still\n        // cannot find an open bracket.\n                t < 0 && this.Tu(\"Reached the end of bundle when a length string is expected.\");\n        const e = this.buffer.slice(0, t);\n        // Update the internal buffer to drop the read length.\n                return this.buffer = this.buffer.slice(t), e;\n    }\n    /**\n     * Reads from a specified position from the internal buffer, for a specified\n     * number of bytes, pulling more data from the underlying stream if needed.\n     *\n     * Returns a string decoded from the read bytes.\n     */    async Eu(t) {\n        for (;this.buffer.length < t; ) {\n            await this.Ru() && this.Tu(\"Reached the end of bundle when more is expected.\");\n        }\n        const e = this.yu.decode(this.buffer.slice(0, t));\n        // Update the internal buffer to drop the read json string.\n                return this.buffer = this.buffer.slice(t), e;\n    }\n    Tu(t) {\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        throw this.gu.cancel(), new Error(`Invalid bundle format: ${t}`);\n    }\n    /**\n     * Pulls more data from underlying stream to internal buffer.\n     * Returns a boolean indicating whether the stream is finished.\n     */    async Ru() {\n        const t = await this.gu.read();\n        if (!t.done) {\n            const e = new Uint8Array(this.buffer.length + t.value.length);\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\n        }\n        return t.done;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Internal transaction object responsible for accumulating the mutations to\n * perform and the base versions for any documents read.\n */\nclass Pu {\n    constructor(t) {\n        this.datastore = t, \n        // The version of each document that was read during this transaction.\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \n        /**\n         * A deferred usage error that occurred previously in this transaction that\n         * will cause the transaction to fail once it actually commits.\n         */\n        this.lastWriteError = null, \n        /**\n         * Set of documents that have been written in the transaction.\n         *\n         * When there's more than one write to the same key in a transaction, any\n         * writes after the first are handled differently.\n         */\n        this.writtenDocs = new Set;\n    }\n    async lookup(t) {\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \"Firestore transactions require all reads to be executed before all writes.\");\n        const e = await async function(t, e) {\n            const n = K(t), s = ws(n.M) + \"/documents\", i = {\n                documents: e.map((t => ls(n.M, t)))\n            }, r = await n.uo(\"BatchGetDocuments\", s, i), o = new Map;\n            r.forEach((t => {\n                const e = ps(n.M, t);\n                o.set(e.key.toString(), e);\n            }));\n            const a = [];\n            return e.forEach((t => {\n                const e = o.get(t.toString());\n                q(!!e), a.push(e);\n            })), a;\n        }(this.datastore, t);\n        return e.forEach((t => this.recordVersion(t))), e;\n    }\n    set(t, e) {\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\n    }\n    update(t, e) {\n        try {\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\n        } catch (t) {\n            this.lastWriteError = t;\n        }\n        this.writtenDocs.add(t.toString());\n    }\n    delete(t) {\n        this.write(new An(t, this.precondition(t))), this.writtenDocs.add(t.toString());\n    }\n    async commit() {\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\n        const t = this.readVersions;\n        // For each mutation, note that the doc was written.\n                this.mutations.forEach((e => {\n            t.delete(e.key.toString());\n        })), \n        // For each document that was read but not written to, we want to perform\n        // a `verify` operation.\n        t.forEach(((t, e) => {\n            const n = xt.fromPath(e);\n            this.mutations.push(new Rn(n, this.precondition(n)));\n        })), await async function(t, e) {\n            const n = K(t), s = ws(n.M) + \"/documents\", i = {\n                writes: e.map((t => Ts(n.M, t)))\n            };\n            await n.io(\"Commit\", s, i);\n        }(this.datastore, this.mutations), this.committed = !0;\n    }\n    recordVersion(t) {\n        let e;\n        if (t.isFoundDocument()) e = t.version; else {\n            if (!t.isNoDocument()) throw L();\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\n            e = ct.min();\n        }\n        const n = this.readVersions.get(t.key.toString());\n        if (n) {\n            if (!e.isEqual(n)) \n            // This transaction will fail no matter what.\n            throw new Q(G.ABORTED, \"Document version changed between two reads.\");\n        } else this.readVersions.set(t.key.toString(), e);\n    }\n    /**\n     * Returns the version of this document when it was read in this transaction,\n     * as a precondition, or no precondition if it was not read.\n     */    precondition(t) {\n        const e = this.readVersions.get(t.toString());\n        return !this.writtenDocs.has(t.toString()) && e ? hn.updateTime(e) : hn.none();\n    }\n    /**\n     * Returns the precondition for a document if the operation is an update.\n     */    preconditionForUpdate(t) {\n        const e = this.readVersions.get(t.toString());\n        // The first time a document is written, we want to take into account the\n        // read time and existence\n                if (!this.writtenDocs.has(t.toString()) && e) {\n            if (e.isEqual(ct.min())) \n            // The document doesn't exist, so fail the transaction.\n            // This has to be validated locally because you can't send a\n            // precondition that a document does not exist without changing the\n            // semantics of the backend write to be an insert. This is the reverse\n            // of what we want, since we want to assert that the document doesn't\n            // exist but then send the update and have it fail. Since we can't\n            // express that to the backend, we have to validate locally.\n            // Note: this can change once we can send separate verify writes in the\n            // transaction.\n            throw new Q(G.INVALID_ARGUMENT, \"Can't update a document that doesn't exist.\");\n            // Document exists, base precondition on document update time.\n                        return hn.updateTime(e);\n        }\n        // Document was not read, so we just use the preconditions for a blind\n        // update.\n        return hn.exists(!0);\n    }\n    write(t) {\n        this.ensureCommitNotCalled(), this.mutations.push(t);\n    }\n    ensureCommitNotCalled() {}\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * TransactionRunner encapsulates the logic needed to run and retry transactions\n * with backoff.\n */\nclass Vu {\n    constructor(t, e, n, s) {\n        this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = s, \n        this.bu = 5, this.vo = new $o(this.asyncQueue, \"transaction_retry\" /* TransactionRetry */);\n    }\n    /** Runs the transaction and sets the result on deferred. */    run() {\n        this.bu -= 1, this.Pu();\n    }\n    Pu() {\n        this.vo.po((async () => {\n            const t = new Pu(this.datastore), e = this.Vu(t);\n            e && e.then((e => {\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\n                    this.deferred.resolve(e);\n                })).catch((t => {\n                    this.vu(t);\n                }))));\n            })).catch((t => {\n                this.vu(t);\n            }));\n        }));\n    }\n    Vu(t) {\n        try {\n            const e = this.updateFunction(t);\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\"Transaction callback must return a Promise\")), \n            null);\n        } catch (t) {\n            // Do not retry errors thrown by user provided updateFunction.\n            return this.deferred.reject(t), null;\n        }\n    }\n    vu(t) {\n        this.bu > 0 && this.Su(t) ? (this.bu -= 1, this.asyncQueue.enqueueAndForget((() => (this.Pu(), \n        Promise.resolve())))) : this.deferred.reject(t);\n    }\n    Su(t) {\n        if (\"FirebaseError\" === t.name) {\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\n            // non-matching document versions with ABORTED. These errors should be retried.\n            const e = t.code;\n            return \"aborted\" === e || \"failed-precondition\" === e || !vn(e);\n        }\n        return !1;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * FirestoreClient is a top-level class that constructs and owns all of the\n * pieces of the client SDK architecture. It is responsible for creating the\n * async queue that is shared by all of the other components in the system.\n */\nclass vu {\n    constructor(t, e, \n    /**\n     * Asynchronous queue responsible for all of our internal processing. When\n     * we get incoming work from the user (via public API) or the network\n     * (incoming GRPC messages), we should always schedule onto this queue.\n     * This ensures all of our work is properly serialized (e.g. we don't\n     * start processing a new operation while the previous one is waiting for\n     * an async I/O to complete).\n     */\n    n, s) {\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\n            O(\"FirestoreClient\", \"Received user=\", t.uid), await this.authCredentialListener(t), \n            this.user = t;\n        })), this.appCheckCredentials.start(n, (t => (O(\"FirestoreClient\", \"Received new app check token=\", t), \n        this.appCheckCredentialListener(t, this.user))));\n    }\n    async getConfiguration() {\n        return {\n            asyncQueue: this.asyncQueue,\n            databaseInfo: this.databaseInfo,\n            clientId: this.clientId,\n            authCredentials: this.authCredentials,\n            appCheckCredentials: this.appCheckCredentials,\n            initialUser: this.user,\n            maxConcurrentLimboResolutions: 100\n        };\n    }\n    setCredentialChangeListener(t) {\n        this.authCredentialListener = t;\n    }\n    setAppCheckTokenChangeListener(t) {\n        this.appCheckCredentialListener = t;\n    }\n    /**\n     * Checks that the client has not been terminated. Ensures that other methods on\n     * this class cannot be called after the client is terminated.\n     */    verifyNotTerminated() {\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \"The client has already been terminated.\");\n    }\n    terminate() {\n        this.asyncQueue.enterRestrictedMode();\n        const t = new j;\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\n            try {\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \n                // The credentials provider must be terminated after shutting down the\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\n                // tokens.\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\n            } catch (e) {\n                const n = pa(e, \"Failed to shutdown persistence\");\n                t.reject(n);\n            }\n        })), t.promise;\n    }\n}\n\nasync function Su(t, e) {\n    t.asyncQueue.verifyOperationInProgress(), O(\"FirestoreClient\", \"Initializing OfflineComponentProvider\");\n    const n = await t.getConfiguration();\n    await e.initialize(n);\n    let s = n.initialUser;\n    t.setCredentialChangeListener((async t => {\n        s.isEqual(t) || (await Wr(e.localStore, t), s = t);\n    })), \n    // When a user calls clearPersistence() in one client, all other clients\n    // need to be terminated to allow the delete to succeed.\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\n}\n\nasync function Du(t, e) {\n    t.asyncQueue.verifyOperationInProgress();\n    const n = await Cu(t);\n    O(\"FirestoreClient\", \"Initializing OnlineComponentProvider\");\n    const s = await t.getConfiguration();\n    await e.initialize(n, s), \n    // The CredentialChangeListener of the online component provider takes\n    // precedence over the offline component provider.\n    t.setCredentialChangeListener((t => _a(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => _a(e.remoteStore, n))), \n    t.onlineComponents = e;\n}\n\nasync function Cu(t) {\n    return t.offlineComponents || (O(\"FirestoreClient\", \"Using default OfflineComponentProvider\"), \n    await Su(t, new pu)), t.offlineComponents;\n}\n\nasync function xu(t) {\n    return t.onlineComponents || (O(\"FirestoreClient\", \"Using default OnlineComponentProvider\"), \n    await Du(t, new Eu)), t.onlineComponents;\n}\n\nfunction Nu(t) {\n    return Cu(t).then((t => t.persistence));\n}\n\nfunction ku(t) {\n    return Cu(t).then((t => t.localStore));\n}\n\nfunction Mu(t) {\n    return xu(t).then((t => t.remoteStore));\n}\n\nfunction Ou(t) {\n    return xu(t).then((t => t.syncEngine));\n}\n\nasync function $u(t) {\n    const e = await xu(t), n = e.eventManager;\n    return n.onListen = qa.bind(null, e.syncEngine), n.onUnlisten = Ka.bind(null, e.syncEngine), \n    n;\n}\n\n/** Enables the network connection and re-enqueues all pending operations. */ function Fu(t) {\n    return t.asyncQueue.enqueue((async () => {\n        const e = await Nu(t), n = await Mu(t);\n        return e.setNetworkEnabled(!0), function(t) {\n            const e = K(t);\n            return e.ha.delete(0 /* UserDisabled */), Go(e);\n        }(n);\n    }));\n}\n\n/** Disables the network connection. Pending operations will not complete. */ function Bu(t) {\n    return t.asyncQueue.enqueue((async () => {\n        const e = await Nu(t), n = await Mu(t);\n        return e.setNetworkEnabled(!1), async function(t) {\n            const e = K(t);\n            e.ha.add(0 /* UserDisabled */), await Qo(e), \n            // Set the OnlineState to Offline so get()s return from cache, etc.\n            e.da.set(\"Offline\" /* Offline */);\n        }(n);\n    }));\n}\n\n/**\n * Returns a Promise that resolves when all writes that were pending at the time\n * this method was called received server acknowledgement. An acknowledgement\n * can be either acceptance or rejection.\n */ function Lu(t, e) {\n    const n = new j;\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\n        try {\n            const s = await function(t, e) {\n                const n = K(t);\n                return n.persistence.runTransaction(\"read document\", \"readonly\", (t => n.ui.Bs(t, e)));\n            }(t, e);\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\"));\n        } catch (t) {\n            const s = pa(t, `Failed to get document '${e} from cache`);\n            n.reject(s);\n        }\n    }\n    /**\n * Retrieves a latency-compensated document from the backend via a\n * SnapshotListener.\n */ (await ku(t), e, n))), n.promise;\n}\n\nfunction qu(t, e, n = {}) {\n    const s = new j;\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\n        const r = new Ru({\n            next: r => {\n                // Remove query first before passing event to user to avoid\n                // user actions affecting the now stale query.\n                e.enqueueAndForget((() => Pa(t, o)));\n                const a = r.docs.has(n);\n                !a && r.fromCache ? \n                // TODO(dimond): If we're online and the document doesn't\n                // exist then we resolve with a doc.exists set to false. If\n                // we're offline however, we reject the Promise in this\n                // case. Two options: 1) Cache the negative response from\n                // the server so we can deliver that even when you're\n                // offline 2) Actually reject the Promise in the online case\n                // if the document doesn't exist.\n                i.reject(new Q(G.UNAVAILABLE, \"Failed to get document because the client is offline.\")) : a && r.fromCache && s && \"server\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)')) : i.resolve(r);\n            },\n            error: t => i.reject(t)\n        }), o = new Da(De(n.path), r, {\n            includeMetadataChanges: !0,\n            Sa: !0\n        });\n        return ba(t, o);\n    }(await $u(t), t.asyncQueue, e, n, s))), s.promise;\n}\n\nfunction Uu(t, e) {\n    const n = new j;\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\n        try {\n            const s = await eo(t, e, \n            /* usePreviousResults= */ !0), i = new $a(e, s.hi), r = i.La(s.documents), o = i.applyChanges(r, \n            /* updateLimboDocuments= */ !1);\n            n.resolve(o.snapshot);\n        } catch (t) {\n            const s = pa(t, `Failed to execute query '${e} against cache`);\n            n.reject(s);\n        }\n    }\n    /**\n * Retrieves a latency-compensated query snapshot from the backend via a\n * SnapshotListener.\n */ (await ku(t), e, n))), n.promise;\n}\n\nfunction Ku(t, e, n = {}) {\n    const s = new j;\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\n        const r = new Ru({\n            next: n => {\n                // Remove query first before passing event to user to avoid\n                // user actions affecting the now stale query.\n                e.enqueueAndForget((() => Pa(t, o))), n.fromCache && \"server\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)')) : i.resolve(n);\n            },\n            error: t => i.reject(t)\n        }), o = new Da(n, r, {\n            includeMetadataChanges: !0,\n            Sa: !0\n        });\n        return ba(t, o);\n    }(await $u(t), t.asyncQueue, e, n, s))), s.promise;\n}\n\nfunction Gu(t, e) {\n    const n = new Ru(e);\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\n        K(t).Ia.add(e), \n        // Immediately fire an initial event, indicating all existing listeners\n        // are in-sync.\n        e.next();\n    }(await $u(t), n))), () => {\n        n.mu(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\n            K(t).Ia.delete(e);\n        }(await $u(t), n)));\n    };\n}\n\n/**\n * Takes an updateFunction in which a set of reads and writes can be performed\n * atomically. In the updateFunction, the client can read and write values\n * using the supplied transaction object. After the updateFunction, all\n * changes will be committed. If a retryable error occurs (ex: some other\n * client has changed any of the data referenced), then the updateFunction\n * will be called again after a backoff. If the updateFunction still fails\n * after all retries, then the transaction will be rejected.\n *\n * The transaction object passed to the updateFunction contains methods for\n * accessing documents and collections. Unlike other datastore access, data\n * accessed with the transaction will not reflect local changes that have not\n * been committed. For this reason, it is required that all reads are\n * performed before any writes. Transactions must be performed while online.\n */ function Qu(t, e) {\n    const n = new j;\n    return t.asyncQueue.enqueueAndForget((async () => {\n        const s = await function(t) {\n            return xu(t).then((t => t.datastore));\n        }(t);\n        new Vu(t.asyncQueue, s, e, n).run();\n    })), n.promise;\n}\n\nfunction ju(t, e, n, s) {\n    const i = function(t, e) {\n        let n;\n        n = \"string\" == typeof t ? (new TextEncoder).encode(t) : t;\n        return function(t, e) {\n            return new bu(t, e);\n        }(function(t, e) {\n            if (t instanceof Uint8Array) return Au(t, e);\n            if (t instanceof ArrayBuffer) return Au(new Uint8Array(t), e);\n            if (t instanceof ReadableStream) return t.getReader();\n            throw new Error(\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\");\n        }(n), e);\n    }\n    /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (n, Oo(e));\n    t.asyncQueue.enqueueAndForget((async () => {\n        yu(await Ou(t), i, s);\n    }));\n}\n\nfunction Wu(t, e) {\n    return t.asyncQueue.enqueue((async () => function(t, e) {\n        const n = K(t);\n        return n.persistence.runTransaction(\"Get named query\", \"readonly\", (t => n.fs.getNamedQuery(t, e)));\n    }(await ku(t), e)));\n}\n\nconst zu = new Map;\n\n/**\n * An instance map that ensures only one Datastore exists per Firestore\n * instance.\n */\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction Hu(t, e, n) {\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\n}\n\n/**\n * Validates that two boolean options are not set at the same time.\n * @internal\n */ function Ju(t, e, n, s) {\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\n}\n\n/**\n * Validates that `path` refers to a document (indicated by the fact it contains\n * an even numbers of segments).\n */ function Yu(t) {\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\n}\n\n/**\n * Validates that `path` refers to a collection (indicated by the fact it\n * contains an odd numbers of segments).\n */ function Xu(t) {\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\n}\n\n/**\n * Returns true if it's a non-null object without a custom prototype\n * (i.e. excludes Array, Date, etc.).\n */\n/** Returns a string describing the type / value of the provided input. */\nfunction Zu(t) {\n    if (void 0 === t) return \"undefined\";\n    if (null === t) return \"null\";\n    if (\"string\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \n    JSON.stringify(t);\n    if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n    if (\"object\" == typeof t) {\n        if (t instanceof Array) return \"an array\";\n        {\n            const e = \n            /** try to get the constructor name for an object. */\n            function(t) {\n                if (t.constructor) return t.constructor.name;\n                return null;\n            }\n            /**\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\n * underlying instance. Throws if  `obj` is not an instance of `T`.\n *\n * This cast is used in the Lite and Full SDK to verify instance types for\n * arguments passed to the public API.\n * @internal\n */ (t);\n            return e ? `a custom ${e} object` : \"an object\";\n        }\n    }\n    return \"function\" == typeof t ? \"a function\" : L();\n}\n\nfunction tc(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n    if (\"_delegate\" in t && (\n    // Unwrap Compat types\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    t = t._delegate), !(t instanceof e)) {\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\");\n        {\n            const n = Zu(t);\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\n        }\n    }\n    return t;\n}\n\nfunction ec(t, e) {\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// settings() defaults:\n/**\n * A concrete type describing all the values that can be applied via a\n * user-supplied `FirestoreSettings` object. This is a separate type so that\n * defaults can be supplied and the value can be checked for equality.\n */\nclass nc {\n    constructor(t) {\n        var e;\n        if (void 0 === t.host) {\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\n            this.host = \"firestore.googleapis.com\", this.ssl = true;\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \"cacheSizeBytes must be at least 1048576\");\n            this.cacheSizeBytes = t.cacheSizeBytes;\n        }\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \n        this.useFetchStreams = !!t.useFetchStreams, Ju(\"experimentalForceLongPolling\", t.experimentalForceLongPolling, \"experimentalAutoDetectLongPolling\", t.experimentalAutoDetectLongPolling);\n    }\n    isEqual(t) {\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\n */ class sc {\n    /** @hideconstructor */\n    constructor(t, e, n) {\n        this._authCredentials = e, this._appCheckCredentials = n, \n        /**\n         * Whether it's a Firestore or Firestore Lite instance.\n         */\n        this.type = \"firestore-lite\", this._persistenceKey = \"(lite)\", this._settings = new nc({}), \n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \n        this._databaseId = function(t) {\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \"projectId\" ])) throw new Q(G.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\n            return new vt(t.options.projectId);\n        }\n        /**\n * Modify this instance to communicate with the Cloud Firestore emulator.\n *\n * Note: This must be called before this instance has been used to do any\n * operations.\n *\n * @param firestore - The `Firestore` instance to configure to connect to the\n * emulator.\n * @param host - the emulator host (ex: localhost).\n * @param port - the emulator port (ex: 9000).\n * @param options.mockUserToken - the mock auth token to use for unit testing\n * Security Rules.\n */ (t));\n    }\n    /**\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\n     * instance.\n     */    get app() {\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is not available\");\n        return this._app;\n    }\n    get _initialized() {\n        return this._settingsFrozen;\n    }\n    get _terminated() {\n        return void 0 !== this._terminateTask;\n    }\n    _setSettings(t) {\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\");\n        this._settings = new nc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\n            if (!t) return new z;\n            switch (t.type) {\n              case \"gapi\":\n                const e = t.client;\n                // Make sure this really is a Gapi client.\n                                return q(!(\"object\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \n                new X(e, t.sessionIndex || \"0\", t.iamToken || null);\n\n              case \"provider\":\n                return t.client;\n\n              default:\n                throw new Q(G.INVALID_ARGUMENT, \"makeAuthCredentialsProvider failed due to invalid credential type\");\n            }\n        }(t.credentials));\n    }\n    _getSettings() {\n        return this._settings;\n    }\n    _freezeSettings() {\n        return this._settingsFrozen = !0, this._settings;\n    }\n    _delete() {\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\n    }\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\n        return {\n            app: this._app,\n            databaseId: this._databaseId,\n            settings: this._settings\n        };\n    }\n    /**\n     * Terminates all components used by this client. Subclasses can override\n     * this method to clean up their own dependencies, but must also call this\n     * method.\n     *\n     * Only ever called once.\n     */    _terminate() {\n        /**\n * Removes all components associated with the provided instance. Must be called\n * when the `Firestore` instance is terminated.\n */\n        return function(t) {\n            const e = zu.get(t);\n            e && (O(\"ComponentProvider\", \"Removing Datastore\"), zu.delete(t), e.terminate());\n        }(this), Promise.resolve();\n    }\n}\n\nfunction ic(t, e, n, s = {}) {\n    var i;\n    const r = (t = tc(t, sc))._getSettings();\n    if (\"firestore.googleapis.com\" !== r.host && r.host !== e && F(\"Host has been set in both settings() and useEmulator(), emulator host will be used\"), \n    t._setSettings(Object.assign(Object.assign({}, r), {\n        host: `${e}:${n}`,\n        ssl: !1\n    })), s.mockUserToken) {\n        let e, n;\n        if (\"string\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\n            // Let createMockUserToken validate first (catches common mistakes like\n            // invalid field \"uid\" and missing field \"sub\" / \"user_id\".)\n            e = y(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \"mockUserToken must contain 'sub' or 'user_id' field!\");\n            n = new C(r);\n        }\n        t._authCredentials = new H(new W(e, n));\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `DocumentReference` refers to a document location in a Firestore database\n * and can be used to write, read, or listen to the location. The document at\n * the referenced location may or may not exist.\n */ class rc {\n    /** @hideconstructor */\n    constructor(t, \n    /**\n     * If provided, the `FirestoreDataConverter` associated with this instance.\n     */\n    e, n) {\n        this.converter = e, this._key = n, \n        /** The type of this Firestore reference. */\n        this.type = \"document\", this.firestore = t;\n    }\n    get _path() {\n        return this._key.path;\n    }\n    /**\n     * The document's identifier within its collection.\n     */    get id() {\n        return this._key.path.lastSegment();\n    }\n    /**\n     * A string representing the path of the referenced document (relative\n     * to the root of the database).\n     */    get path() {\n        return this._key.path.canonicalString();\n    }\n    /**\n     * The collection this `DocumentReference` belongs to.\n     */    get parent() {\n        return new ac(this.firestore, this.converter, this._key.path.popLast());\n    }\n    withConverter(t) {\n        return new rc(this.firestore, t, this._key);\n    }\n}\n\n/**\n * A `Query` refers to a query which you can read or listen to. You can also\n * construct refined `Query` objects by adding filters and ordering.\n */ class oc {\n    // This is the lite version of the Query class in the main SDK.\n    /** @hideconstructor protected */\n    constructor(t, \n    /**\n     * If provided, the `FirestoreDataConverter` associated with this instance.\n     */\n    e, n) {\n        this.converter = e, this._query = n, \n        /** The type of this Firestore reference. */\n        this.type = \"query\", this.firestore = t;\n    }\n    withConverter(t) {\n        return new oc(this.firestore, t, this._query);\n    }\n}\n\n/**\n * A `CollectionReference` object can be used for adding documents, getting\n * document references, and querying for documents (using {@link query}).\n */ class ac extends oc {\n    /** @hideconstructor */\n    constructor(t, e, n) {\n        super(t, e, De(n)), this._path = n, \n        /** The type of this Firestore reference. */\n        this.type = \"collection\";\n    }\n    /** The collection's identifier. */    get id() {\n        return this._query.path.lastSegment();\n    }\n    /**\n     * A string representing the path of the referenced collection (relative\n     * to the root of the database).\n     */    get path() {\n        return this._query.path.canonicalString();\n    }\n    /**\n     * A reference to the containing `DocumentReference` if this is a\n     * subcollection. If this isn't a subcollection, the reference is null.\n     */    get parent() {\n        const t = this._path.popLast();\n        return t.isEmpty() ? null : new rc(this.firestore, \n        /* converter= */ null, new xt(t));\n    }\n    withConverter(t) {\n        return new ac(this.firestore, t, this._path);\n    }\n}\n\nfunction uc(t, e, ...n) {\n    if (t = p(t), Hu(\"collection\", \"path\", e), t instanceof sc) {\n        const s = _t.fromString(e, ...n);\n        return Xu(s), new ac(t, /* converter= */ null, s);\n    }\n    {\n        if (!(t instanceof rc || t instanceof ac)) throw new Q(G.INVALID_ARGUMENT, \"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\");\n        const s = t._path.child(_t.fromString(e, ...n));\n        return Xu(s), new ac(t.firestore, \n        /* converter= */ null, s);\n    }\n}\n\n// TODO(firestorelite): Consider using ErrorFactory -\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\n/**\n * Creates and returns a new `Query` instance that includes all documents in the\n * database that are contained in a collection or subcollection with the\n * given `collectionId`.\n *\n * @param firestore - A reference to the root `Firestore` instance.\n * @param collectionId - Identifies the collections to query over. Every\n * collection or subcollection with this ID as the last segment of its path\n * will be included. Cannot contain a slash.\n * @returns The created `Query`.\n */ function cc(t, e) {\n    if (t = tc(t, sc), Hu(\"collectionGroup\", \"collection id\", e), e.indexOf(\"/\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\n    return new oc(t, \n    /* converter= */ null, \n    /**\n * Creates a new Query for a collection group query that matches all documents\n * within the provided collection group.\n */\n    function(t) {\n        return new ve(_t.emptyPath(), t);\n    }(e));\n}\n\nfunction hc(t, e, ...n) {\n    if (t = p(t), \n    // We allow omission of 'pathString' but explicitly prohibit passing in both\n    // 'undefined' and 'null'.\n    1 === arguments.length && (e = it.R()), Hu(\"doc\", \"path\", e), t instanceof sc) {\n        const s = _t.fromString(e, ...n);\n        return Yu(s), new rc(t, \n        /* converter= */ null, new xt(s));\n    }\n    {\n        if (!(t instanceof rc || t instanceof ac)) throw new Q(G.INVALID_ARGUMENT, \"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\");\n        const s = t._path.child(_t.fromString(e, ...n));\n        return Yu(s), new rc(t.firestore, t instanceof ac ? t.converter : null, new xt(s));\n    }\n}\n\n/**\n * Returns true if the provided references are equal.\n *\n * @param left - A reference to compare.\n * @param right - A reference to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */ function lc(t, e) {\n    return t = p(t), e = p(e), (t instanceof rc || t instanceof ac) && (e instanceof rc || e instanceof ac) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\n}\n\n/**\n * Returns true if the provided queries point to the same collection and apply\n * the same constraints.\n *\n * @param left - A `Query` to compare.\n * @param right - A `Query` to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */ function fc(t, e) {\n    return t = p(t), e = p(e), t instanceof oc && e instanceof oc && (t.firestore === e.firestore && Be(t._query, e._query) && t.converter === e.converter);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ class dc {\n    constructor() {\n        // The last promise in the queue.\n        this.Du = Promise.resolve(), \n        // A list of retryable operations. Retryable operations are run in order and\n        // retried with backoff.\n        this.Cu = [], \n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\n        // be changed again.\n        this.xu = !1, \n        // Operations scheduled to be queued in the future. Operations are\n        // automatically removed after they are run or canceled.\n        this.Nu = [], \n        // visible for testing\n        this.ku = null, \n        // Flag set while there's an outstanding AsyncQueue operation, used for\n        // assertion sanity-checks.\n        this.Mu = !1, \n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\n        this.Ou = !1, \n        // List of TimerIds to fast-forward delays for.\n        this.$u = [], \n        // Backoff timer used to schedule retries for retryable operations\n        this.vo = new $o(this, \"async_queue_retry\" /* AsyncQueueRetry */), \n        // Visibility handler that triggers an immediate retry of all retryable\n        // operations. Meant to speed up recovery when we regain file system access\n        // after page comes into foreground.\n        this.Fu = () => {\n            const t = Mo();\n            t && O(\"AsyncQueue\", \"Visibility state changed to \" + t.visibilityState), this.vo.To();\n        };\n        const t = Mo();\n        t && \"function\" == typeof t.addEventListener && t.addEventListener(\"visibilitychange\", this.Fu);\n    }\n    get isShuttingDown() {\n        return this.xu;\n    }\n    /**\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\n     * we ignore the Promise result).\n     */    enqueueAndForget(t) {\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        this.enqueue(t);\n    }\n    enqueueAndForgetEvenWhileRestricted(t) {\n        this.Bu(), \n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        this.Lu(t);\n    }\n    enterRestrictedMode(t) {\n        if (!this.xu) {\n            this.xu = !0, this.Ou = t || !1;\n            const e = Mo();\n            e && \"function\" == typeof e.removeEventListener && e.removeEventListener(\"visibilitychange\", this.Fu);\n        }\n    }\n    enqueue(t) {\n        if (this.Bu(), this.xu) \n        // Return a Promise which never resolves.\n        return new Promise((() => {}));\n        // Create a deferred Promise that we can return to the callee. This\n        // allows us to return a \"hanging Promise\" only to the callee and still\n        // advance the queue even when the operation is not run.\n                const e = new j;\n        return this.Lu((() => this.xu && this.Ou ? Promise.resolve() : (t().then(e.resolve, e.reject), \n        e.promise))).then((() => e.promise));\n    }\n    enqueueRetryable(t) {\n        this.enqueueAndForget((() => (this.Cu.push(t), this.qu())));\n    }\n    /**\n     * Runs the next operation from the retryable queue. If the operation fails,\n     * reschedules with backoff.\n     */    async qu() {\n        if (0 !== this.Cu.length) {\n            try {\n                await this.Cu[0](), this.Cu.shift(), this.vo.reset();\n            } catch (t) {\n                if (!di(t)) throw t;\n // Failure will be handled by AsyncQueue\n                                O(\"AsyncQueue\", \"Operation failed with retryable error: \" + t);\n            }\n            this.Cu.length > 0 && \n            // If there are additional operations, we re-schedule `retryNextOp()`.\n            // This is necessary to run retryable operations that failed during\n            // their initial attempt since we don't know whether they are already\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n            // call scheduled here.\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\n            // new backoff on every call, there is only ever a single additional\n            // operation in the queue.\n            this.vo.po((() => this.qu()));\n        }\n    }\n    Lu(t) {\n        const e = this.Du.then((() => (this.Mu = !0, t().catch((t => {\n            this.ku = t, this.Mu = !1;\n            const e = \n            /**\n * Chrome includes Error.message in Error.stack. Other browsers do not.\n * This returns expected output of message + stack when available.\n * @param error - Error or FirestoreError\n */\n            function(t) {\n                let e = t.message || \"\";\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \"\\n\" + t.stack);\n                return e;\n            }\n            /**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ (t);\n            // Re-throw the error so that this.tail becomes a rejected Promise and\n            // all further attempts to chain (via .then) will just short-circuit\n            // and return the rejected Promise.\n            throw $(\"INTERNAL UNHANDLED ERROR: \", e), t;\n        })).then((t => (this.Mu = !1, t))))));\n        return this.Du = e, e;\n    }\n    enqueueAfterDelay(t, e, n) {\n        this.Bu(), \n        // Fast-forward delays for timerIds that have been overriden.\n        this.$u.indexOf(t) > -1 && (e = 0);\n        const s = ya.createAndSchedule(this, t, e, n, (t => this.Uu(t)));\n        return this.Nu.push(s), s;\n    }\n    Bu() {\n        this.ku && L();\n    }\n    verifyOperationInProgress() {}\n    /**\n     * Waits until all currently queued tasks are finished executing. Delayed\n     * operations are not run.\n     */    async Ku() {\n        // Operations in the queue prior to draining may have enqueued additional\n        // operations. Keep draining the queue until the tail is no longer advanced,\n        // which indicates that no more new operations were enqueued and that all\n        // operations were executed.\n        let t;\n        do {\n            t = this.Du, await t;\n        } while (t !== this.Du);\n    }\n    /**\n     * For Tests: Determine if a delayed operation with a particular TimerId\n     * exists.\n     */    Gu(t) {\n        for (const e of this.Nu) if (e.timerId === t) return !0;\n        return !1;\n    }\n    /**\n     * For Tests: Runs some or all delayed operations early.\n     *\n     * @param lastTimerId - Delayed operations up to and including this TimerId\n     * will be drained. Pass TimerId.All to run all delayed operations.\n     * @returns a Promise that resolves once all operations have been run.\n     */    Qu(t) {\n        // Note that draining may generate more delayed ops, so we do that first.\n        return this.Ku().then((() => {\n            // Run ops in the same order they'd run if they ran naturally.\n            this.Nu.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\n            for (const e of this.Nu) if (e.skipDelay(), \"all\" /* All */ !== t && e.timerId === t) break;\n            return this.Ku();\n        }));\n    }\n    /**\n     * For Tests: Skip all subsequent delays for a timer id.\n     */    ju(t) {\n        this.$u.push(t);\n    }\n    /** Called once a DelayedOperation is run or canceled. */    Uu(t) {\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\n        const e = this.Nu.indexOf(t);\n        this.Nu.splice(e, 1);\n    }\n}\n\nfunction _c(t) {\n    /**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\n    return function(t, e) {\n        if (\"object\" != typeof t || null === t) return !1;\n        const n = t;\n        for (const t of e) if (t in n && \"function\" == typeof n[t]) return !0;\n        return !1;\n    }\n    /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n    /**\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\n * loading, as well as task completion and error events.\n *\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\n */ (t, [ \"next\", \"error\", \"complete\" ]);\n}\n\nclass wc {\n    constructor() {\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\n            taskState: \"Running\",\n            totalBytes: 0,\n            totalDocuments: 0,\n            bytesLoaded: 0,\n            documentsLoaded: 0\n        };\n    }\n    /**\n     * Registers functions to listen to bundle loading progress events.\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\n     *   each time a Firestore document is loaded from the bundle.\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\n     *   error, and there should be no more updates after this.\n     * @param complete - Called when the loading task is complete.\n     */    onProgress(t, e, n) {\n        this._progressObserver = {\n            next: t,\n            error: e,\n            complete: n\n        };\n    }\n    /**\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\n     *\n     * @param onRejected - Called when an error occurs during bundle loading.\n     */    catch(t) {\n        return this._taskCompletionResolver.promise.catch(t);\n    }\n    /**\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\n     *\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\n     *   The update will always have its `taskState` set to `\"Success\"`.\n     * @param onRejected - Called when an error occurs during bundle loading.\n     */    then(t, e) {\n        return this._taskCompletionResolver.promise.then(t, e);\n    }\n    /**\n     * Notifies all observers that bundle loading has completed, with a provided\n     * `LoadBundleTaskProgress` object.\n     *\n     * @private\n     */    _completeWith(t) {\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \n        this._taskCompletionResolver.resolve(t);\n    }\n    /**\n     * Notifies all observers that bundle loading has failed, with a provided\n     * `Error` as the reason.\n     *\n     * @private\n     */    _failWith(t) {\n        this._lastProgress.taskState = \"Error\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\n    }\n    /**\n     * Notifies a progress update of loading a bundle.\n     * @param progress - The new progress.\n     *\n     * @private\n     */    _updateProgress(t) {\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** DOMException error code constants. */ const mc = -1;\n\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\n */\nclass gc extends sc {\n    /** @hideconstructor */\n    constructor(t, e, n) {\n        super(t, e, n), \n        /**\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\n         */\n        this.type = \"firestore\", this._queue = new dc, this._persistenceKey = \"name\" in t ? t.name : \"[DEFAULT]\";\n    }\n    _terminate() {\n        return this._firestoreClient || \n        // The client must be initialized to ensure that all subsequent API\n        // usage throws an exception.\n        Tc(this), this._firestoreClient.terminate();\n    }\n}\n\n/**\n * Initializes a new instance of {@link Firestore} with the provided settings.\n * Can only be called before any other function, including\n * {@link getFirestore}. If the custom settings are empty, this function is\n * equivalent to calling {@link getFirestore}.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\n * be associated.\n * @param settings - A settings object to configure the {@link Firestore} instance.\n * @returns A newly initialized {@link Firestore} instance.\n */ function yc(t, e) {\n    const n = _getProvider(t, \"firestore\");\n    if (n.isInitialized()) {\n        const t = n.getImmediate(), s = n.getOptions();\n        if (I(s, e)) return t;\n        throw new Q(G.FAILED_PRECONDITION, \"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\");\n    }\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \"cacheSizeBytes must be at least 1048576\");\n    return n.initialize({\n        options: e\n    });\n}\n\n/**\n * Returns the existing {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @returns The {@link Firestore} instance of the provided app.\n */ function pc(e = t()) {\n    return _getProvider(e, \"firestore\").getImmediate();\n}\n\n/**\n * @internal\n */ function Ic(t) {\n    return t._firestoreClient || Tc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\n}\n\nfunction Tc(t) {\n    var e;\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \"\", t._persistenceKey, n);\n    t._firestoreClient = new vu(t._authCredentials, t._appCheckCredentials, t._queue, s);\n}\n\n/**\n * Attempts to enable persistent storage, if possible.\n *\n * Must be called before any other functions (other than\n * {@link initializeFirestore}, {@link getFirestore} or\n * {@link clearIndexedDbPersistence}.\n *\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\n * returns. Note that even after this failure, the {@link Firestore} instance will\n * remain usable, however offline persistence will be disabled.\n *\n * There are several reasons why this can fail, which can be identified by\n * the `code` on the error.\n *\n *   * failed-precondition: The app is already open in another browser tab.\n *   * unimplemented: The browser is incompatible with the offline\n *     persistence implementation.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @param persistenceSettings - Optional settings object to configure\n * persistence.\n * @returns A `Promise` that represents successfully enabling persistent storage.\n */ function Ec(t, e) {\n    xc(t = tc(t, gc));\n    const n = Ic(t), s = t._freezeSettings(), i = new Eu;\n    return Rc(n, i, new Iu(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\n}\n\n/**\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\n * across all tabs, all operations share access to local persistence, including\n * shared execution of queries and latency-compensated local document updates\n * across all connected instances.\n *\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\n * it returns. Note that even after this failure, the {@link Firestore} instance will\n * remain usable, however offline persistence will be disabled.\n *\n * There are several reasons why this can fail, which can be identified by\n * the `code` on the error.\n *\n *   * failed-precondition: The app is already open in another browser tab and\n *     multi-tab is not enabled.\n *   * unimplemented: The browser is incompatible with the offline\n *     persistence implementation.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @returns A `Promise` that represents successfully enabling persistent\n * storage.\n */ function Ac(t) {\n    xc(t = tc(t, gc));\n    const e = Ic(t), n = t._freezeSettings(), s = new Eu;\n    return Rc(e, s, new Tu(s, n.cacheSizeBytes));\n}\n\n/**\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\n * If the operation fails with a recoverable error (see\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\n * but the client remains usable.\n */ function Rc(t, e, n) {\n    const s = new j;\n    return t.asyncQueue.enqueue((async () => {\n        try {\n            await Su(t, n), await Du(t, e), s.resolve();\n        } catch (t) {\n            if (!\n            /**\n * Decides whether the provided error allows us to gracefully disable\n * persistence (as opposed to crashing the client).\n */\n            function(t) {\n                if (\"FirebaseError\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\n                if (\"undefined\" != typeof DOMException && t instanceof DOMException) \n                // There are a few known circumstances where we can open IndexedDb but\n                // trying to read/write will fail (e.g. quota exceeded). For\n                // well-understood cases, we attempt to detect these and then gracefully\n                // fall back to memory persistence.\n                // NOTE: Rather than continue to add to this list, we could decide to\n                // always fall back, with the risk that we might accidentally hide errors\n                // representing actual SDK bugs.\n                // When the browser is out of quota we could get either quota exceeded\n                // or an aborted error depending on whether the error happened during\n                // schema migration.\n                return 22 === t.code || 20 === t.code || \n                // Firefox Private Browsing mode disables IndexedDb and returns\n                // INVALID_STATE for any usage.\n                11 === t.code;\n                return !0;\n            }\n            /**\n * Clears the persistent storage. This includes pending writes and cached\n * documents.\n *\n * Must be called while the {@link Firestore} instance is not started (after the app is\n * terminated or when the app is first initialized). On startup, this function\n * must be called before other functions (other than {@link\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\n * instance is still running, the promise will be rejected with the error code\n * of `failed-precondition`.\n *\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\n * dropping existing data but does not attempt to securely overwrite or\n * otherwise make cached data unrecoverable. For applications that are sensitive\n * to the disclosure of cached data in between user sessions, we strongly\n * recommend not enabling persistence at all.\n *\n * @param firestore - The {@link Firestore} instance to clear persistence for.\n * @returns A `Promise` that is resolved when the persistent storage is\n * cleared. Otherwise, the promise is rejected with an error.\n */ (t)) throw t;\n            console.warn(\"Error enabling offline persistence. Falling back to persistence disabled: \" + t), \n            s.reject(t);\n        }\n    })).then((() => s.promise));\n}\n\nfunction bc(t) {\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\");\n    const e = new j;\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\n        try {\n            await async function(t) {\n                if (!hi.vt()) return Promise.resolve();\n                const e = t + \"main\";\n                await hi.delete(e);\n            }(Lr(t._databaseId, t._persistenceKey)), e.resolve();\n        } catch (t) {\n            e.reject(t);\n        }\n    })), e.promise;\n}\n\n/**\n * Waits until all currently pending writes for the active user have been\n * acknowledged by the backend.\n *\n * The returned promise resolves immediately if there are no outstanding writes.\n * Otherwise, the promise waits for all previously issued writes (including\n * those written in a previous app session), but it does not wait for writes\n * that were added after the function is called. If you want to wait for\n * additional writes, call `waitForPendingWrites()` again.\n *\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\n * changes.\n *\n * @returns A `Promise` which resolves when all currently pending writes have been\n * acknowledged by the backend.\n */ function Pc(t) {\n    return function(t) {\n        const e = new j;\n        return t.asyncQueue.enqueueAndForget((async () => Ja(await Ou(t), e))), e.promise;\n    }(Ic(t = tc(t, gc)));\n}\n\n/**\n * Re-enables use of the network for this {@link Firestore} instance after a prior\n * call to {@link disableNetwork}.\n *\n * @returns A `Promise` that is resolved once the network has been enabled.\n */ function Vc(t) {\n    return Fu(Ic(t = tc(t, gc)));\n}\n\n/**\n * Disables network usage for this instance. It can be re-enabled via {@link\n * enableNetwork}. While the network is disabled, any snapshot listeners,\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\n * operations will be queued until the network is restored.\n *\n * @returns A `Promise` that is resolved once the network has been disabled.\n */ function vc(t) {\n    return Bu(Ic(t = tc(t, gc)));\n}\n\n/**\n * Terminates the provided {@link Firestore} instance.\n *\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\n * may be used. Any other function will throw a `FirestoreError`.\n *\n * To restart after termination, create a new instance of FirebaseFirestore with\n * {@link getFirestore}.\n *\n * Termination does not cancel any pending writes, and any promises that are\n * awaiting a response from the server will not be resolved. If you have\n * persistence enabled, the next time you start this instance, it will resume\n * sending these writes to the server.\n *\n * Note: Under normal circumstances, calling `terminate()` is not required. This\n * function is useful only when you want to force this instance to release all\n * of its resources or in combination with `clearIndexedDbPersistence()` to\n * ensure that all local state is destroyed between test runs.\n *\n * @returns A `Promise` that is resolved when the instance has been successfully\n * terminated.\n */ function Sc(t) {\n    return e(t.app, \"firestore\"), t._delete();\n}\n\n/**\n * Loads a Firestore bundle into the local cache.\n *\n * @param firestore - The {@link Firestore} instance to load bundles for.\n * @param bundleData - An object representing the bundle to be loaded. Valid\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\n *\n * @returns A `LoadBundleTask` object, which notifies callers with progress\n * updates, and completion or error events. It can be used as a\n * `Promise<LoadBundleTaskProgress>`.\n */ function Dc(t, e) {\n    const n = Ic(t = tc(t, gc)), s = new wc;\n    return ju(n, t._databaseId, e, s), s;\n}\n\n/**\n * Reads a Firestore {@link Query} from local cache, identified by the given\n * name.\n *\n * The named queries are packaged  into bundles on the server side (along\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\n * in local cache, use this method to extract a {@link Query} by name.\n *\n * @param firestore - The {@link Firestore} instance to read the query from.\n * @param name - The name of the query.\n * @returns A `Promise` that is resolved with the Query or `null`.\n */ function Cc(t, e) {\n    return Wu(Ic(t = tc(t, gc)), e).then((e => e ? new oc(t, null, e.query) : null));\n}\n\nfunction xc(t) {\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a\n * list of field names (referring to a nested field in the document).\n *\n * Create a `FieldPath` by providing field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n */\nclass Nc {\n    /**\n     * Creates a `FieldPath` from the provided field names. If more than one field\n     * name is provided, the path will point to a nested field in a document.\n     *\n     * @param fieldNames - A list of field names.\n     */\n    constructor(...t) {\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). Field names must not be empty.\");\n        this._internalPath = new mt(t);\n    }\n    /**\n     * Returns true if this `FieldPath` is equal to the provided one.\n     *\n     * @param other - The `FieldPath` to compare against.\n     * @returns true if this `FieldPath` is equal to the provided one.\n     */    isEqual(t) {\n        return this._internalPath.isEqual(t._internalPath);\n    }\n}\n\n/**\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\n * It can be used in queries to sort or filter by the document ID.\n */ function kc() {\n    return new Nc(\"__name__\");\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable object representing an array of bytes.\n */ class Mc {\n    /** @hideconstructor */\n    constructor(t) {\n        this._byteString = t;\n    }\n    /**\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\n     * bytes.\n     *\n     * @param base64 - The Base64 string used to create the `Bytes` object.\n     */    static fromBase64String(t) {\n        try {\n            return new Mc(pt.fromBase64String(t));\n        } catch (t) {\n            throw new Q(G.INVALID_ARGUMENT, \"Failed to construct data from Base64 string: \" + t);\n        }\n    }\n    /**\n     * Creates a new `Bytes` object from the given Uint8Array.\n     *\n     * @param array - The Uint8Array used to create the `Bytes` object.\n     */    static fromUint8Array(t) {\n        return new Mc(pt.fromUint8Array(t));\n    }\n    /**\n     * Returns the underlying bytes as a Base64-encoded string.\n     *\n     * @returns The Base64-encoded string created from the `Bytes` object.\n     */    toBase64() {\n        return this._byteString.toBase64();\n    }\n    /**\n     * Returns the underlying bytes in a new `Uint8Array`.\n     *\n     * @returns The Uint8Array created from the `Bytes` object.\n     */    toUint8Array() {\n        return this._byteString.toUint8Array();\n    }\n    /**\n     * Returns a string representation of the `Bytes` object.\n     *\n     * @returns A string representation of the `Bytes` object.\n     */    toString() {\n        return \"Bytes(base64: \" + this.toBase64() + \")\";\n    }\n    /**\n     * Returns true if this `Bytes` object is equal to the provided one.\n     *\n     * @param other - The `Bytes` object to compare against.\n     * @returns true if this `Bytes` object is equal to the provided one.\n     */    isEqual(t) {\n        return this._byteString.isEqual(t._byteString);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Sentinel values that can be used when writing document fields with `set()`\n * or `update()`.\n */ class Oc {\n    /**\n     * @param _methodName - The public API endpoint that returns this class.\n     * @hideconstructor\n     */\n    constructor(t) {\n        this._methodName = t;\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * An immutable object representing a geographic location in Firestore. The\n * location is represented as latitude/longitude pair.\n *\n * Latitude values are in the range of [-90, 90].\n * Longitude values are in the range of [-180, 180].\n */ class $c {\n    /**\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\n     * longitude values.\n     * @param latitude - The latitude as number between -90 and 90.\n     * @param longitude - The longitude as number between -180 and 180.\n     */\n    constructor(t, e) {\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \"Latitude must be a number between -90 and 90, but was: \" + t);\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \"Longitude must be a number between -180 and 180, but was: \" + e);\n        this._lat = t, this._long = e;\n    }\n    /**\n     * The latitude of this `GeoPoint` instance.\n     */    get latitude() {\n        return this._lat;\n    }\n    /**\n     * The longitude of this `GeoPoint` instance.\n     */    get longitude() {\n        return this._long;\n    }\n    /**\n     * Returns true if this `GeoPoint` is equal to the provided one.\n     *\n     * @param other - The `GeoPoint` to compare against.\n     * @returns true if this `GeoPoint` is equal to the provided one.\n     */    isEqual(t) {\n        return this._lat === t._lat && this._long === t._long;\n    }\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\n        return {\n            latitude: this._lat,\n            longitude: this._long\n        };\n    }\n    /**\n     * Actually private to JS consumers of our API, so this function is prefixed\n     * with an underscore.\n     */    _compareTo(t) {\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\n    }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ const Fc = /^__.*__$/;\n\n/** The result of parsing document data (e.g. for a setData call). */ class Bc {\n    constructor(t, e, n) {\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\n    }\n    toMutation(t, e) {\n        return null !== this.fieldMask ? new pn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new yn(t, this.data, e, this.fieldTransforms);\n    }\n}\n\n/** The result of parsing \"update\" data (i.e. for an updateData call). */ class Lc {\n    constructor(t, \n    // The fieldMask does not include document transforms.\n    e, n) {\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\n    }\n    toMutation(t, e) {\n        return new pn(t, this.data, this.fieldMask, e, this.fieldTransforms);\n    }\n}\n\nfunction qc(t) {\n    switch (t) {\n      case 0 /* Set */ :\n // fall through\n              case 2 /* MergeSet */ :\n // fall through\n              case 1 /* Update */ :\n        return !0;\n\n      case 3 /* Argument */ :\n      case 4 /* ArrayArgument */ :\n        return !1;\n\n      default:\n        throw L();\n    }\n}\n\n/** A \"context\" object passed around while parsing user data. */ class Uc {\n    /**\n     * Initializes a ParseContext with the given source and path.\n     *\n     * @param settings - The settings for the parser.\n     * @param databaseId - The database ID of the Firestore instance.\n     * @param serializer - The serializer to use to generate the Value proto.\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\n     * rather than throw.\n     * @param fieldTransforms - A mutable list of field transforms encountered\n     * while parsing the data.\n     * @param fieldMask - A mutable list of field paths encountered while parsing\n     * the data.\n     *\n     * TODO(b/34871131): We don't support array paths right now, so path can be\n     * null to indicate the context represents any location within an array (in\n     * which case certain features will not work and errors will be somewhat\n     * compromised).\n     */\n    constructor(t, e, n, s, i, r) {\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \n        // Minor hack: If fieldTransforms is undefined, we assume this is an\n        // external call and we need to validate the entire path.\n        void 0 === i && this.Wu(), this.fieldTransforms = i || [], this.fieldMask = r || [];\n    }\n    get path() {\n        return this.settings.path;\n    }\n    get zu() {\n        return this.settings.zu;\n    }\n    /** Returns a new context with the specified settings overwritten. */    Hu(t) {\n        return new Uc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\n    }\n    Ju(t) {\n        var e;\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Hu({\n            path: n,\n            Yu: !1\n        });\n        return s.Xu(t), s;\n    }\n    Zu(t) {\n        var e;\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Hu({\n            path: n,\n            Yu: !1\n        });\n        return s.Wu(), s;\n    }\n    tc(t) {\n        // TODO(b/34871131): We don't support array paths right now; so make path\n        // undefined.\n        return this.Hu({\n            path: void 0,\n            Yu: !0\n        });\n    }\n    ec(t) {\n        return uh(t, this.settings.methodName, this.settings.nc || !1, this.path, this.settings.sc);\n    }\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\n    }\n    Wu() {\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\n        // within arrays.\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.Xu(this.path.get(t));\n    }\n    Xu(t) {\n        if (0 === t.length) throw this.ec(\"Document fields must not be empty\");\n        if (qc(this.zu) && Fc.test(t)) throw this.ec('Document fields cannot begin and end with \"__\"');\n    }\n}\n\n/**\n * Helper for parsing raw user input (provided via the API) into internal model\n * classes.\n */ class Kc {\n    constructor(t, e, n) {\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || Oo(t);\n    }\n    /** Creates a new top-level parse context. */    ic(t, e, n, s = !1) {\n        return new Uc({\n            zu: t,\n            methodName: e,\n            sc: n,\n            path: mt.emptyPath(),\n            Yu: !1,\n            nc: s\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\n    }\n}\n\nfunction Gc(t) {\n    const e = t._freezeSettings(), n = Oo(t._databaseId);\n    return new Kc(t._databaseId, !!e.ignoreUndefinedProperties, n);\n}\n\n/** Parse document data from a set() call. */ function Qc(t, e, n, s, i, r = {}) {\n    const o = t.ic(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\n    ih(\"Data must be an object, but it was:\", o, s);\n    const a = nh(s, o);\n    let u, c;\n    if (r.merge) u = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\n        const t = [];\n        for (const s of r.mergeFields) {\n            const i = rh(e, s, n);\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\n            ch(t, i) || t.push(i);\n        }\n        u = new gt(t), c = o.fieldTransforms.filter((t => u.covers(t.field)));\n    } else u = null, c = o.fieldTransforms;\n    return new Bc(new Xt(a), u, c);\n}\n\nclass jc extends Oc {\n    _toFieldTransform(t) {\n        if (2 /* MergeSet */ !== t.zu) throw 1 /* Update */ === t.zu ? t.ec(`${this._methodName}() can only appear at the top level of your update data`) : t.ec(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\n        // No transform to add for a delete, but we need to add it to our\n        // fieldMask so it gets deleted.\n        return t.fieldMask.push(t.path), null;\n    }\n    isEqual(t) {\n        return t instanceof jc;\n    }\n}\n\n/**\n * Creates a child context for parsing SerializableFieldValues.\n *\n * This is different than calling `ParseContext.contextWith` because it keeps\n * the fieldTransforms and fieldMask separate.\n *\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\n * Although these values are used with writes, any elements in these FieldValues\n * are not considered writes since they cannot contain any FieldValue sentinels,\n * etc.\n *\n * @param fieldValue - The sentinel FieldValue for which to create a child\n *     context.\n * @param context - The parent context.\n * @param arrayElement - Whether or not the FieldValue has an array.\n */ function Wc(t, e, n) {\n    return new Uc({\n        zu: 3 /* Argument */ ,\n        sc: e.settings.sc,\n        methodName: t._methodName,\n        Yu: n\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\n}\n\nclass zc extends Oc {\n    _toFieldTransform(t) {\n        return new an(t.path, new Xe);\n    }\n    isEqual(t) {\n        return t instanceof zc;\n    }\n}\n\nclass Hc extends Oc {\n    constructor(t, e) {\n        super(t), this.rc = e;\n    }\n    _toFieldTransform(t) {\n        const e = Wc(this, t, \n        /*array=*/ !0), n = this.rc.map((t => eh(t, e))), s = new Ze(n);\n        return new an(t.path, s);\n    }\n    isEqual(t) {\n        // TODO(mrschmidt): Implement isEquals\n        return this === t;\n    }\n}\n\nclass Jc extends Oc {\n    constructor(t, e) {\n        super(t), this.rc = e;\n    }\n    _toFieldTransform(t) {\n        const e = Wc(this, t, \n        /*array=*/ !0), n = this.rc.map((t => eh(t, e))), s = new en(n);\n        return new an(t.path, s);\n    }\n    isEqual(t) {\n        // TODO(mrschmidt): Implement isEquals\n        return this === t;\n    }\n}\n\nclass Yc extends Oc {\n    constructor(t, e) {\n        super(t), this.oc = e;\n    }\n    _toFieldTransform(t) {\n        const e = new sn(t.M, We(t.M, this.oc));\n        return new an(t.path, e);\n    }\n    isEqual(t) {\n        // TODO(mrschmidt): Implement isEquals\n        return this === t;\n    }\n}\n\n/** Parse update data from an update() call. */ function Xc(t, e, n, s) {\n    const i = t.ic(1 /* Update */ , e, n);\n    ih(\"Data must be an object, but it was:\", i, s);\n    const r = [], o = Xt.empty();\n    lt(s, ((t, s) => {\n        const a = ah(e, t, n);\n        // For Compat types, we have to \"extract\" the underlying types before\n        // performing validation.\n                s = p(s);\n        const u = i.Zu(a);\n        if (s instanceof jc) \n        // Add it to the field mask, but don't add anything to updateData.\n        r.push(a); else {\n            const t = eh(s, u);\n            null != t && (r.push(a), o.set(a, t));\n        }\n    }));\n    const a = new gt(r);\n    return new Lc(o, a, i.fieldTransforms);\n}\n\n/** Parse update data from a list of field/value arguments. */ function Zc(t, e, n, s, i, r) {\n    const o = t.ic(1 /* Update */ , e, n), a = [ rh(e, s, n) ], u = [ i ];\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\n    for (let t = 0; t < r.length; t += 2) a.push(rh(e, r[t])), u.push(r[t + 1]);\n    const c = [], h = Xt.empty();\n    // We iterate in reverse order to pick the last value for a field if the\n    // user specified the field multiple times.\n    for (let t = a.length - 1; t >= 0; --t) if (!ch(c, a[t])) {\n        const e = a[t];\n        let n = u[t];\n        // For Compat types, we have to \"extract\" the underlying types before\n        // performing validation.\n                n = p(n);\n        const s = o.Zu(e);\n        if (n instanceof jc) \n        // Add it to the field mask, but don't add anything to updateData.\n        c.push(e); else {\n            const t = eh(n, s);\n            null != t && (c.push(e), h.set(e, t));\n        }\n    }\n    const l = new gt(c);\n    return new Lc(h, l, o.fieldTransforms);\n}\n\n/**\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\n * bound).\n *\n * @param allowArrays - Whether the query value is an array that may directly\n * contain additional arrays (e.g. the operand of an `in` query).\n */ function th(t, e, n, s = !1) {\n    return eh(n, t.ic(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\n}\n\n/**\n * Parses user data to Protobuf Values.\n *\n * @param input - Data to be parsed.\n * @param context - A context object representing the current path being parsed,\n * the source of the data being parsed, etc.\n * @returns The parsed value, or null if the value was a FieldValue sentinel\n * that should not be included in the resulting parsed data.\n */ function eh(t, e) {\n    if (sh(\n    // Unwrap the API type from the Compat SDK. This will return the API type\n    // from firestore-exp.\n    t = p(t))) return ih(\"Unsupported field value:\", e, t), nh(t, e);\n    if (t instanceof Oc) \n    // FieldValues usually parse into transforms (except deleteField())\n    // in which case we do not want to include this field in our parsed data\n    // (as doing so will overwrite the field directly prior to the transform\n    // trying to transform it). So we don't add this location to\n    // context.fieldMask and we return null as our parsing result.\n    /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n    return function(t, e) {\n        // Sentinels are only supported with writes, and not within arrays.\n        if (!qc(e.zu)) throw e.ec(`${t._methodName}() can only be used with update() and set()`);\n        if (!e.path) throw e.ec(`${t._methodName}() is not currently supported inside arrays`);\n        const n = t._toFieldTransform(e);\n        n && e.fieldTransforms.push(n);\n    }\n    /**\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\n *\n * @returns The parsed value\n */ (t, e), null;\n    if (void 0 === t && e.ignoreUndefinedProperties) \n    // If the input is undefined it can never participate in the fieldMask, so\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\n    // `parseScalarValue` will reject an undefined value.\n    return null;\n    if (\n    // If context.path is null we are inside an array and we don't support\n    // field mask paths more granular than the top-level array.\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\n        // TODO(b/34871131): Include the path containing the array in the error\n        // message.\n        // In the case of IN queries, the parsed data is an array (representing\n        // the set of values to be included for the IN query) that may directly\n        // contain additional arrays (each representing an individual field\n        // value), so we disable this validation.\n        if (e.settings.Yu && 4 /* ArrayArgument */ !== e.zu) throw e.ec(\"Nested arrays are not supported\");\n        return function(t, e) {\n            const n = [];\n            let s = 0;\n            for (const i of t) {\n                let t = eh(i, e.tc(s));\n                null == t && (\n                // Just include nulls in the array for fields being replaced with a\n                // sentinel.\n                t = {\n                    nullValue: \"NULL_VALUE\"\n                }), n.push(t), s++;\n            }\n            return {\n                arrayValue: {\n                    values: n\n                }\n            };\n        }(t, e);\n    }\n    return function(t, e) {\n        if (null === (t = p(t))) return {\n            nullValue: \"NULL_VALUE\"\n        };\n        if (\"number\" == typeof t) return We(e.M, t);\n        if (\"boolean\" == typeof t) return {\n            booleanValue: t\n        };\n        if (\"string\" == typeof t) return {\n            stringValue: t\n        };\n        if (t instanceof Date) {\n            const n = ut.fromDate(t);\n            return {\n                timestampValue: rs(e.M, n)\n            };\n        }\n        if (t instanceof ut) {\n            // Firestore backend truncates precision down to microseconds. To ensure\n            // offline mode works the same with regards to truncation, perform the\n            // truncation immediately without waiting for the backend to do that.\n            const n = new ut(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n            return {\n                timestampValue: rs(e.M, n)\n            };\n        }\n        if (t instanceof $c) return {\n            geoPointValue: {\n                latitude: t.latitude,\n                longitude: t.longitude\n            }\n        };\n        if (t instanceof Mc) return {\n            bytesValue: os(e.M, t._byteString)\n        };\n        if (t instanceof rc) {\n            const n = e.databaseId, s = t.firestore._databaseId;\n            if (!s.isEqual(n)) throw e.ec(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\n            return {\n                referenceValue: cs(t.firestore._databaseId || e.databaseId, t._key.path)\n            };\n        }\n        throw e.ec(`Unsupported field value: ${Zu(t)}`);\n    }\n    /**\n * Checks whether an object looks like a JSON object that should be converted\n * into a struct. Normal class/prototype instances are considered to look like\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\n * GeoPoints, etc. are not considered to look like JSON objects since they map\n * to specific FieldValue types other than ObjectValue.\n */ (t, e);\n}\n\nfunction nh(t, e) {\n    const n = {};\n    return ft(t) ? \n    // If we encounter an empty object, we explicitly add it to the update\n    // mask to ensure that the server creates a map entry.\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\n        const i = eh(s, e.Ju(t));\n        null != i && (n[t] = i);\n    })), {\n        mapValue: {\n            fields: n\n        }\n    };\n}\n\nfunction sh(t) {\n    return !(\"object\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof ut || t instanceof $c || t instanceof Mc || t instanceof rc || t instanceof Oc);\n}\n\nfunction ih(t, e, n) {\n    if (!sh(n) || !function(t) {\n        return \"object\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\n    }(n)) {\n        const s = Zu(n);\n        throw \"an object\" === s ? e.ec(t + \" a custom object\") : e.ec(t + \" \" + s);\n    }\n}\n\n/**\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\n */ function rh(t, e, n) {\n    if ((\n    // If required, replace the FieldPath Compat class with with the firestore-exp\n    // FieldPath.\n    e = p(e)) instanceof Nc) return e._internalPath;\n    if (\"string\" == typeof e) return ah(t, e);\n    throw uh(\"Field path arguments must be of type string or \", t, \n    /* hasConverter= */ !1, \n    /* path= */ void 0, n);\n}\n\n/**\n * Matches any characters in a field path string that are reserved.\n */ const oh = new RegExp(\"[~\\\\*/\\\\[\\\\]]\");\n\n/**\n * Wraps fromDotSeparatedString with an error message about the method that\n * was thrown.\n * @param methodName - The publicly visible method name\n * @param path - The dot-separated string form of a field path which will be\n * split on dots.\n * @param targetDoc - The document against which the field path will be\n * evaluated.\n */ function ah(t, e, n) {\n    if (e.search(oh) >= 0) throw uh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \n    /* hasConverter= */ !1, \n    /* path= */ void 0, n);\n    try {\n        return new Nc(...e.split(\".\"))._internalPath;\n    } catch (s) {\n        throw uh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \n        /* hasConverter= */ !1, \n        /* path= */ void 0, n);\n    }\n}\n\nfunction uh(t, e, n, s, i) {\n    const r = s && !s.isEmpty(), o = void 0 !== i;\n    let a = `Function ${e}() called with invalid data`;\n    n && (a += \" (via `toFirestore()`)\"), a += \". \";\n    let u = \"\";\n    return (r || o) && (u += \" (found\", r && (u += ` in field ${s}`), o && (u += ` in document ${i}`), \n    u += \")\"), new Q(G.INVALID_ARGUMENT, a + t + u);\n}\n\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ch(t, e) {\n    return t.some((t => t.isEqual(e)));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */ class hh {\n    // Note: This class is stripped down version of the DocumentSnapshot in\n    // the legacy SDK. The changes are:\n    // - No support for SnapshotMetadata.\n    // - No support for SnapshotOptions.\n    /** @hideconstructor protected */\n    constructor(t, e, n, s, i) {\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \n        this._converter = i;\n    }\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\n        return this._key.path.lastSegment();\n    }\n    /**\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\n     */    get ref() {\n        return new rc(this._firestore, this._converter, this._key);\n    }\n    /**\n     * Signals whether or not the document at the snapshot's location exists.\n     *\n     * @returns true if the document exists.\n     */    exists() {\n        return null !== this._document;\n    }\n    /**\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n     * the document doesn't exist.\n     *\n     * @returns An `Object` containing all fields in the document or `undefined`\n     * if the document doesn't exist.\n     */    data() {\n        if (this._document) {\n            if (this._converter) {\n                // We only want to use the converter and create a new DocumentSnapshot\n                // if a converter has been provided.\n                const t = new lh(this._firestore, this._userDataWriter, this._key, this._document, \n                /* converter= */ null);\n                return this._converter.fromFirestore(t);\n            }\n            return this._userDataWriter.convertValue(this._document.data.value);\n        }\n    }\n    /**\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n     * document or field doesn't exist.\n     *\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n     * field.\n     * @returns The data at the specified field location or undefined if no such\n     * field exists in the document.\n     */\n    // We are using `any` here to avoid an explicit cast by our users.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    get(t) {\n        if (this._document) {\n            const e = this._document.data.field(fh(\"DocumentSnapshot.get\", t));\n            if (null !== e) return this._userDataWriter.convertValue(e);\n        }\n    }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */ class lh extends hh {\n    /**\n     * Retrieves all fields in the document as an `Object`.\n     *\n     * @override\n     * @returns An `Object` containing all fields in the document.\n     */\n    data() {\n        return super.data();\n    }\n}\n\n/**\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\n */ function fh(t, e) {\n    return \"string\" == typeof e ? ah(t, e) : e instanceof Nc ? e._internalPath : e._delegate._internalPath;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Metadata about a snapshot, describing the state of the snapshot.\n */ class dh {\n    /** @hideconstructor */\n    constructor(t, e) {\n        this.hasPendingWrites = t, this.fromCache = e;\n    }\n    /**\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\n     *\n     * @param other - The `SnapshotMetadata` to compare against.\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\n     */    isEqual(t) {\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\n    }\n}\n\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */ class _h extends hh {\n    /** @hideconstructor protected */\n    constructor(t, e, n, s, i, r) {\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\n    }\n    /**\n     * Returns whether or not the data exists. True if the document exists.\n     */    exists() {\n        return super.exists();\n    }\n    /**\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n     * the document doesn't exist.\n     *\n     * By default, `serverTimestamp()` values that have not yet been\n     * set to their final value will be returned as `null`. You can override\n     * this by passing an options object.\n     *\n     * @param options - An options object to configure how data is retrieved from\n     * the snapshot (for example the desired behavior for server timestamps that\n     * have not yet been set to their final value).\n     * @returns An `Object` containing all fields in the document or `undefined` if\n     * the document doesn't exist.\n     */    data(t = {}) {\n        if (this._document) {\n            if (this._converter) {\n                // We only want to use the converter and create a new DocumentSnapshot\n                // if a converter has been provided.\n                const e = new wh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \n                /* converter= */ null);\n                return this._converter.fromFirestore(e, t);\n            }\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\n        }\n    }\n    /**\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n     * document or field doesn't exist.\n     *\n     * By default, a `serverTimestamp()` that has not yet been set to\n     * its final value will be returned as `null`. You can override this by\n     * passing an options object.\n     *\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n     * field.\n     * @param options - An options object to configure how the field is retrieved\n     * from the snapshot (for example the desired behavior for server timestamps\n     * that have not yet been set to their final value).\n     * @returns The data at the specified field location or undefined if no such\n     * field exists in the document.\n     */\n    // We are using `any` here to avoid an explicit cast by our users.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    get(t, e = {}) {\n        if (this._document) {\n            const n = this._document.data.field(fh(\"DocumentSnapshot.get\", t));\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\n        }\n    }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */ class wh extends _h {\n    /**\n     * Retrieves all fields in the document as an `Object`.\n     *\n     * By default, `serverTimestamp()` values that have not yet been\n     * set to their final value will be returned as `null`. You can override\n     * this by passing an options object.\n     *\n     * @override\n     * @param options - An options object to configure how data is retrieved from\n     * the snapshot (for example the desired behavior for server timestamps that\n     * have not yet been set to their final value).\n     * @returns An `Object` containing all fields in the document.\n     */\n    data(t = {}) {\n        return super.data(t);\n    }\n}\n\n/**\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\n * representing the results of a query. The documents can be accessed as an\n * array via the `docs` property or enumerated using the `forEach` method. The\n * number of documents can be determined via the `empty` and `size`\n * properties.\n */ class mh {\n    /** @hideconstructor */\n    constructor(t, e, n, s) {\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new dh(s.hasPendingWrites, s.fromCache), \n        this.query = n;\n    }\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\n        const t = [];\n        return this.forEach((e => t.push(e))), t;\n    }\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\n        return this._snapshot.docs.size;\n    }\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\n        return 0 === this.size;\n    }\n    /**\n     * Enumerates all of the documents in the `QuerySnapshot`.\n     *\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\n     * each document in the snapshot.\n     * @param thisArg - The `this` binding for the callback.\n     */    forEach(t, e) {\n        this._snapshot.docs.forEach((n => {\n            t.call(e, new wh(this._firestore, this._userDataWriter, n.key, n, new dh(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\n        }));\n    }\n    /**\n     * Returns an array of the documents changes since the last snapshot. If this\n     * is the first snapshot, all documents will be in the list as 'added'\n     * changes.\n     *\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\n     * snapshot events.\n     */    docChanges(t = {}) {\n        const e = !!t.includeMetadataChanges;\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\");\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\n        function(t, e) {\n            if (t._snapshot.oldDocs.isEmpty()) {\n                let e = 0;\n                return t._snapshot.docChanges.map((n => ({\n                    type: \"added\",\n                    doc: new wh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new dh(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\n                    oldIndex: -1,\n                    newIndex: e++\n                })));\n            }\n            {\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\n                // to lookup the index of a document.\n                let n = t._snapshot.oldDocs;\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\n                    const s = new wh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new dh(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\n                    let i = -1, r = -1;\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\n                        type: gh(e.type),\n                        doc: s,\n                        oldIndex: i,\n                        newIndex: r\n                    };\n                }));\n            }\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\n    }\n}\n\nfunction gh(t) {\n    switch (t) {\n      case 0 /* Added */ :\n        return \"added\";\n\n      case 2 /* Modified */ :\n      case 3 /* Metadata */ :\n        return \"modified\";\n\n      case 1 /* Removed */ :\n        return \"removed\";\n\n      default:\n        return L();\n    }\n}\n\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\n// metadata\n/**\n * Returns true if the provided snapshots are equal.\n *\n * @param left - A snapshot to compare.\n * @param right - A snapshot to compare.\n * @returns true if the snapshots are equal.\n */ function yh(t, e) {\n    return t instanceof _h && e instanceof _h ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof mh && e instanceof mh && (t._firestore === e._firestore && fc(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function ph(t) {\n    if (xe(t) && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \"limitToLast() queries require specifying at least one orderBy() clause\");\n}\n\n/**\n * A `QueryConstraint` is used to narrow the set of documents returned by a\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\n * can then be passed to {@link query} to create a new query instance that\n * also contains this `QueryConstraint`.\n */ class Ih {}\n\n/**\n * Creates a new immutable instance of {@link Query} that is extended to also include\n * additional query constraints.\n *\n * @param query - The {@link Query} instance to use as a base for the new constraints.\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\n * @throws if any of the provided query constraints cannot be combined with the\n * existing or new constraints.\n */ function Th(t, ...e) {\n    for (const n of e) t = n._apply(t);\n    return t;\n}\n\nclass Eh extends Ih {\n    constructor(t, e, n) {\n        super(), this.ac = t, this.uc = e, this.cc = n, this.type = \"where\";\n    }\n    _apply(t) {\n        const e = Gc(t.firestore), n = function(t, e, n, s, i, r, o) {\n            let a;\n            if (i.isKeyField()) {\n                if (\"array-contains\" /* ARRAY_CONTAINS */ === r || \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\n                if (\"in\" /* IN */ === r || \"not-in\" /* NOT_IN */ === r) {\n                    $h(o, r);\n                    const e = [];\n                    for (const n of o) e.push(Oh(s, t, n));\n                    a = {\n                        arrayValue: {\n                            values: e\n                        }\n                    };\n                } else a = Oh(s, t, o);\n            } else \"in\" /* IN */ !== r && \"not-in\" /* NOT_IN */ !== r && \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ !== r || $h(o, r), \n            a = th(n, e, o, \n            /* allowArrays= */ \"in\" /* IN */ === r || \"not-in\" /* NOT_IN */ === r);\n            const u = _e.create(i, r, a);\n            return function(t, e) {\n                if (e.S()) {\n                    const n = ke(t);\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\n                    const s = Ne(t);\n                    null !== s && Fh(t, e.field, s);\n                }\n                const n = function(t, e) {\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\n                    return null;\n                }(t, \n                /**\n * Given an operator, returns the set of operators that cannot be used with it.\n *\n * Operators in a query must adhere to the following set of rules:\n * 1. Only one array operator is allowed.\n * 2. Only one disjunctive operator is allowed.\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\n *\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\n */\n                function(t) {\n                    switch (t) {\n                      case \"!=\" /* NOT_EQUAL */ :\n                        return [ \"!=\" /* NOT_EQUAL */ , \"not-in\" /* NOT_IN */ ];\n\n                      case \"array-contains\" /* ARRAY_CONTAINS */ :\n                        return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"not-in\" /* NOT_IN */ ];\n\n                      case \"in\" /* IN */ :\n                        return [ \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n                      case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ :\n                        return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ ];\n\n                      case \"not-in\" /* NOT_IN */ :\n                        return [ \"array-contains\" /* ARRAY_CONTAINS */ , \"array-contains-any\" /* ARRAY_CONTAINS_ANY */ , \"in\" /* IN */ , \"not-in\" /* NOT_IN */ , \"!=\" /* NOT_EQUAL */ ];\n\n                      default:\n                        return [];\n                    }\n                }(e.op));\n                if (null !== n) \n                // Special case when it's a duplicate op to give a slightly clearer error message.\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\n            }(t, u), u;\n        }(t._query, \"where\", e, t.firestore._databaseId, this.ac, this.uc, this.cc);\n        return new oc(t.firestore, t.converter, function(t, e) {\n            const n = t.filters.concat([ e ]);\n            return new ve(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\n        }(t._query, n));\n    }\n}\n\n/**\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\n * specified field and that the value should satisfy the relation constraint\n * provided.\n *\n * @param fieldPath - The path to compare\n * @param opStr - The operation string (e.g \"&lt;\", \"&lt;=\", \"==\", \"&lt;\",\n *   \"&lt;=\", \"!=\").\n * @param value - The value for comparison\n * @returns The created {@link Query}.\n */ function Ah(t, e, n) {\n    const s = e, i = fh(\"where\", t);\n    return new Eh(i, s, n);\n}\n\nclass Rh extends Ih {\n    constructor(t, e) {\n        super(), this.ac = t, this.hc = e, this.type = \"orderBy\";\n    }\n    _apply(t) {\n        const e = function(t, e, n) {\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\");\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\");\n            const s = new Re(e, n);\n            return function(t, e) {\n                if (null === Ne(t)) {\n                    // This is the first order by. It must match any inequality.\n                    const n = ke(t);\n                    null !== n && Fh(t, n, e.field);\n                }\n            }(t, s), s;\n        }\n        /**\n * Create a `Bound` from a query and a document.\n *\n * Note that the `Bound` will always include the key of the document\n * and so only the provided document will compare equal to the returned\n * position.\n *\n * Will throw if the document does not contain all fields of the order by\n * of the query or if any of the fields in the order by are an uncommitted\n * server timestamp.\n */ (t._query, this.ac, this.hc);\n        return new oc(t.firestore, t.converter, function(t, e) {\n            // TODO(dimond): validate that orderBy does not list the same key twice.\n            const n = t.explicitOrderBy.concat([ e ]);\n            return new ve(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\n        }(t._query, e));\n    }\n}\n\n/**\n * Creates a {@link QueryConstraint} that sorts the query result by the\n * specified field, optionally in descending order instead of ascending.\n *\n * @param fieldPath - The field to sort by.\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\n * not specified, order will be ascending.\n * @returns The created {@link Query}.\n */ function bh(t, e = \"asc\") {\n    const n = e, s = fh(\"orderBy\", t);\n    return new Rh(s, n);\n}\n\nclass Ph extends Ih {\n    constructor(t, e, n) {\n        super(), this.type = t, this.lc = e, this.fc = n;\n    }\n    _apply(t) {\n        return new oc(t.firestore, t.converter, Fe(t._query, this.lc, this.fc));\n    }\n}\n\n/**\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link Query}.\n */ function Vh(t) {\n    return ec(\"limit\", t), new Ph(\"limit\", t, \"F\" /* First */);\n}\n\n/**\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\n *\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\n * otherwise an exception will be thrown during execution.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link Query}.\n */ function vh(t) {\n    return ec(\"limitToLast\", t), new Ph(\"limitToLast\", t, \"L\" /* Last */);\n}\n\nclass Sh extends Ih {\n    constructor(t, e, n) {\n        super(), this.type = t, this.dc = e, this._c = n;\n    }\n    _apply(t) {\n        const e = Mh(t, this.type, this.dc, this._c);\n        return new oc(t.firestore, t.converter, function(t, e) {\n            return new ve(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\n        }(t._query, e));\n    }\n}\n\nfunction Dh(...t) {\n    return new Sh(\"startAt\", t, \n    /*inclusive=*/ !0);\n}\n\nfunction Ch(...t) {\n    return new Sh(\"startAfter\", t, \n    /*inclusive=*/ !1);\n}\n\nclass xh extends Ih {\n    constructor(t, e, n) {\n        super(), this.type = t, this.dc = e, this._c = n;\n    }\n    _apply(t) {\n        const e = Mh(t, this.type, this.dc, this._c);\n        return new oc(t.firestore, t.converter, function(t, e) {\n            return new ve(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\n        }(t._query, e));\n    }\n}\n\nfunction Nh(...t) {\n    return new xh(\"endBefore\", t, \n    /*inclusive=*/ !1);\n}\n\nfunction kh(...t) {\n    return new xh(\"endAt\", t, /*inclusive=*/ !0);\n}\n\n/** Helper function to create a bound from a document or fields */ function Mh(t, e, n, s) {\n    if (n[0] = p(n[0]), n[0] instanceof hh) return function(t, e, n, s, i) {\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\n        const r = [];\n        // Because people expect to continue/end a query at the exact document\n        // provided, we need to use the implicit sort order rather than the explicit\n        // sort order, because it's guaranteed to contain the document key. That way\n        // the position becomes unambiguous and the query continues/ends exactly at\n        // the provided document. Without the key (by using the explicit sort\n        // orders), multiple documents could match the position, yielding duplicate\n        // results.\n                for (const n of Oe(t)) if (n.field.isKeyField()) r.push(Ut(e, s.key)); else {\n            const t = s.data.field(n.field);\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \"' + n.field + '\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\n            if (null === t) {\n                const t = n.field.canonicalString();\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\n            }\n            r.push(t);\n        }\n        return new Ae(r, i);\n    }\n    /**\n * Converts a list of field values to a `Bound` for the given query.\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\n    {\n        const i = Gc(t.firestore);\n        return function(t, e, n, s, i, r) {\n            // Use explicit order by's because it has to match the query the user made\n            const o = t.explicitOrderBy;\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\n            const a = [];\n            for (let r = 0; r < i.length; r++) {\n                const u = i[r];\n                if (o[r].field.isKeyField()) {\n                    if (\"string\" != typeof u) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof u}`);\n                    if (!Me(t) && -1 !== u.indexOf(\"/\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${u}' contains a slash.`);\n                    const n = t.path.child(_t.fromString(u));\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\n                    const i = new xt(n);\n                    a.push(Ut(e, i));\n                } else {\n                    const t = th(n, s, u);\n                    a.push(t);\n                }\n            }\n            return new Ae(a, r);\n        }\n        /**\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\n * appropriate errors if the value is anything other than a `DocumentReference`\n * or `string`, or if the string is malformed.\n */ (t._query, t.firestore._databaseId, i, e, n, s);\n    }\n}\n\nfunction Oh(t, e, n) {\n    if (\"string\" == typeof (n = p(n))) {\n        if (\"\" === n) throw new Q(G.INVALID_ARGUMENT, \"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\");\n        if (!Me(e) && -1 !== n.indexOf(\"/\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\n        const s = e.path.child(_t.fromString(n));\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\n        return Ut(t, new xt(s));\n    }\n    if (n instanceof rc) return Ut(t, n._key);\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Zu(n)}.`);\n}\n\n/**\n * Validates that the value passed into a disjunctive filter satisfies all\n * array requirements.\n */ function $h(t, e) {\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\n}\n\nfunction Fh(t, e, n) {\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Converts Firestore's internal types to the JavaScript types that we expose\n * to the user.\n *\n * @internal\n */ class Bh {\n    convertValue(t, e = \"none\") {\n        switch (Mt(t)) {\n          case 0 /* NullValue */ :\n            return null;\n\n          case 1 /* BooleanValue */ :\n            return t.booleanValue;\n\n          case 2 /* NumberValue */ :\n            return Et(t.integerValue || t.doubleValue);\n\n          case 3 /* TimestampValue */ :\n            return this.convertTimestamp(t.timestampValue);\n\n          case 4 /* ServerTimestampValue */ :\n            return this.convertServerTimestamp(t, e);\n\n          case 5 /* StringValue */ :\n            return t.stringValue;\n\n          case 6 /* BlobValue */ :\n            return this.convertBytes(At(t.bytesValue));\n\n          case 7 /* RefValue */ :\n            return this.convertReference(t.referenceValue);\n\n          case 8 /* GeoPointValue */ :\n            return this.convertGeoPoint(t.geoPointValue);\n\n          case 9 /* ArrayValue */ :\n            return this.convertArray(t.arrayValue, e);\n\n          case 10 /* ObjectValue */ :\n            return this.convertObject(t.mapValue, e);\n\n          default:\n            throw L();\n        }\n    }\n    convertObject(t, e) {\n        const n = {};\n        return lt(t.fields, ((t, s) => {\n            n[t] = this.convertValue(s, e);\n        })), n;\n    }\n    convertGeoPoint(t) {\n        return new $c(Et(t.latitude), Et(t.longitude));\n    }\n    convertArray(t, e) {\n        return (t.values || []).map((t => this.convertValue(t, e)));\n    }\n    convertServerTimestamp(t, e) {\n        switch (e) {\n          case \"previous\":\n            const n = bt(t);\n            return null == n ? null : this.convertValue(n, e);\n\n          case \"estimate\":\n            return this.convertTimestamp(Pt(t));\n\n          default:\n            return null;\n        }\n    }\n    convertTimestamp(t) {\n        const e = Tt(t);\n        return new ut(e.seconds, e.nanos);\n    }\n    convertDocumentKey(t, e) {\n        const n = _t.fromString(t);\n        q(Os(n));\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\n        return s.isEqual(e) || \n        // TODO(b/64130202): Somehow support foreign references.\n        $(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \n        i;\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Converts custom model object of type T into `DocumentData` by applying the\n * converter if it exists.\n *\n * This function is used when converting user objects to `DocumentData`\n * because we want to provide the user with a more specific error message if\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\n * call.\n */ function Lh(t, e, n) {\n    let s;\n    // Cast to `any` in order to satisfy the union type constraint on\n    // toFirestore().\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \n    s;\n}\n\nclass qh extends Bh {\n    constructor(t) {\n        super(), this.firestore = t;\n    }\n    convertBytes(t) {\n        return new Mc(t);\n    }\n    convertReference(t) {\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\n        return new rc(this.firestore, /* converter= */ null, e);\n    }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A write batch, used to perform multiple writes as a single atomic unit.\n *\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\n * provides methods for adding writes to the write batch. None of the writes\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\n * called.\n */ class Uh {\n    /** @hideconstructor */\n    constructor(t, e) {\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \n        this._dataReader = Gc(t);\n    }\n    set(t, e, n) {\n        this._verifyNotCommitted();\n        const s = Kh(t, this._firestore), i = Lh(s.converter, e, n), r = Qc(this._dataReader, \"WriteBatch.set\", s._key, i, null !== s.converter, n);\n        return this._mutations.push(r.toMutation(s._key, hn.none())), this;\n    }\n    update(t, e, n, ...s) {\n        this._verifyNotCommitted();\n        const i = Kh(t, this._firestore);\n        // For Compat types, we have to \"extract\" the underlying types before\n        // performing validation.\n                let r;\n        return r = \"string\" == typeof (e = p(e)) || e instanceof Nc ? Zc(this._dataReader, \"WriteBatch.update\", i._key, e, n, s) : Xc(this._dataReader, \"WriteBatch.update\", i._key, e), \n        this._mutations.push(r.toMutation(i._key, hn.exists(!0))), this;\n    }\n    /**\n     * Deletes the document referred to by the provided {@link DocumentReference}.\n     *\n     * @param documentRef - A reference to the document to be deleted.\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\n     */    delete(t) {\n        this._verifyNotCommitted();\n        const e = Kh(t, this._firestore);\n        return this._mutations = this._mutations.concat(new An(e._key, hn.none())), this;\n    }\n    /**\n     * Commits all of the writes in this write batch as a single atomic unit.\n     *\n     * The result of these writes will only be reflected in document reads that\n     * occur after the returned promise resolves. If the client is offline, the\n     * write fails. If you would like to see local modifications or buffer writes\n     * until the client is online, use the full Firestore SDK.\n     *\n     * @returns A `Promise` resolved once all of the writes in the batch have been\n     * successfully written to the backend as an atomic unit (note that it won't\n     * resolve while you're offline).\n     */    commit() {\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\n    }\n    _verifyNotCommitted() {\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \"A write batch can no longer be used after commit() has been called.\");\n    }\n}\n\nfunction Kh(t, e) {\n    if ((t = p(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \"Provided document reference is from a different Firestore instance.\");\n    return t;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\n// legacy SDK.\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Reads the document referred to by this `DocumentReference`.\n *\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\n * for data from the server, but it may return cached data or fail if you are\n * offline and the server cannot be reached. To specify this behavior, invoke\n * {@link getDocFromCache} or {@link getDocFromServer}.\n *\n * @param reference - The reference of the document to fetch.\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */\nfunction Gh(t) {\n    t = tc(t, rc);\n    const e = tc(t.firestore, gc);\n    return qu(Ic(e), t._key).then((n => il(e, t, n)));\n}\n\nclass Qh extends Bh {\n    constructor(t) {\n        super(), this.firestore = t;\n    }\n    convertBytes(t) {\n        return new Mc(t);\n    }\n    convertReference(t) {\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\n        return new rc(this.firestore, /* converter= */ null, e);\n    }\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from cache.\n * Returns an error if the document is not currently cached.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */ function jh(t) {\n    t = tc(t, rc);\n    const e = tc(t.firestore, gc), n = Ic(e), s = new Qh(e);\n    return Lu(n, t._key).then((n => new _h(e, s, t._key, n, new dh(null !== n && n.hasLocalMutations, \n    /* fromCache= */ !0), t.converter)));\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from the server.\n * Returns an error if the network is not available.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */ function Wh(t) {\n    t = tc(t, rc);\n    const e = tc(t.firestore, gc);\n    return qu(Ic(e), t._key, {\n        source: \"server\"\n    }).then((n => il(e, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot`.\n *\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\n * waiting for data from the server, but it may return cached data or fail if\n * you are offline and the server cannot be reached. To specify this behavior,\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function zh(t) {\n    t = tc(t, oc);\n    const e = tc(t.firestore, gc), n = Ic(e), s = new Qh(e);\n    return ph(t._query), Ku(n, t._query).then((n => new mh(e, s, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\n * Returns an error if the document is not currently cached.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function Hh(t) {\n    t = tc(t, oc);\n    const e = tc(t.firestore, gc), n = Ic(e), s = new Qh(e);\n    return Uu(n, t._query).then((n => new mh(e, s, t, n)));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from the\n * server. Returns an error if the network is not available.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */ function Jh(t) {\n    t = tc(t, oc);\n    const e = tc(t.firestore, gc), n = Ic(e), s = new Qh(e);\n    return Ku(n, t._query, {\n        source: \"server\"\n    }).then((n => new mh(e, s, t, n)));\n}\n\nfunction Yh(t, e, n) {\n    t = tc(t, rc);\n    const s = tc(t.firestore, gc), i = Lh(t.converter, e, n);\n    return sl(s, [ Qc(Gc(s), \"setDoc\", t._key, i, null !== t.converter, n).toMutation(t._key, hn.none()) ]);\n}\n\nfunction Xh(t, e, n, ...s) {\n    t = tc(t, rc);\n    const i = tc(t.firestore, gc), r = Gc(i);\n    let o;\n    o = \"string\" == typeof (\n    // For Compat types, we have to \"extract\" the underlying types before\n    // performing validation.\n    e = p(e)) || e instanceof Nc ? Zc(r, \"updateDoc\", t._key, e, n, s) : Xc(r, \"updateDoc\", t._key, e);\n    return sl(i, [ o.toMutation(t._key, hn.exists(!0)) ]);\n}\n\n/**\n * Deletes the document referred to by the specified `DocumentReference`.\n *\n * @param reference - A reference to the document to delete.\n * @returns A Promise resolved once the document has been successfully\n * deleted from the backend (note that it won't resolve while you're offline).\n */ function Zh(t) {\n    return sl(tc(t.firestore, gc), [ new An(t._key, hn.none()) ]);\n}\n\n/**\n * Add a new document to specified `CollectionReference` with the given data,\n * assigning it a document ID automatically.\n *\n * @param reference - A reference to the collection to add this document to.\n * @param data - An Object containing the data for the new document.\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\n * newly created document after it has been written to the backend (Note that it\n * won't resolve while you're offline).\n */ function tl(t, e) {\n    const n = tc(t.firestore, gc), s = hc(t), i = Lh(t.converter, e);\n    return sl(n, [ Qc(Gc(t.firestore), \"addDoc\", s._key, i, null !== t.converter, {}).toMutation(s._key, hn.exists(!1)) ]).then((() => s));\n}\n\nfunction el(t, ...e) {\n    var n, s, i;\n    t = p(t);\n    let r = {\n        includeMetadataChanges: !1\n    }, o = 0;\n    \"object\" != typeof e[o] || _c(e[o]) || (r = e[o], o++);\n    const a = {\n        includeMetadataChanges: r.includeMetadataChanges\n    };\n    if (_c(e[o])) {\n        const t = e[o];\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\n    }\n    let u, c, h;\n    if (t instanceof rc) c = tc(t.firestore, gc), h = De(t._key.path), u = {\n        next: n => {\n            e[o] && e[o](il(c, t, n));\n        },\n        error: e[o + 1],\n        complete: e[o + 2]\n    }; else {\n        const n = tc(t, oc);\n        c = tc(n.firestore, gc), h = n._query;\n        const s = new Qh(c);\n        u = {\n            next: t => {\n                e[o] && e[o](new mh(c, s, n, t));\n            },\n            error: e[o + 1],\n            complete: e[o + 2]\n        }, ph(t._query);\n    }\n    return function(t, e, n, s) {\n        const i = new Ru(s), r = new Da(e, i, n);\n        return t.asyncQueue.enqueueAndForget((async () => ba(await $u(t), r))), () => {\n            i.mu(), t.asyncQueue.enqueueAndForget((async () => Pa(await $u(t), r)));\n        };\n    }(Ic(c), h, a, u);\n}\n\nfunction nl(t, e) {\n    return Gu(Ic(t = tc(t, gc)), _c(e) ? e : {\n        next: e\n    });\n}\n\n/**\n * Locally writes `mutations` on the async queue.\n * @internal\n */ function sl(t, e) {\n    return function(t, e) {\n        const n = new j;\n        return t.asyncQueue.enqueueAndForget((async () => Ga(await Ou(t), e, n))), n.promise;\n    }(Ic(t), e);\n}\n\n/**\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\n * to a {@link DocumentSnapshot}.\n */ function il(t, e, n) {\n    const s = n.docs.get(e._key), i = new Qh(t);\n    return new _h(t, i, e._key, s, new dh(n.hasPendingWrites, n.fromCache), e.converter);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */ class rl extends class {\n    /** @hideconstructor */\n    constructor(t, e) {\n        this._firestore = t, this._transaction = e, this._dataReader = Gc(t);\n    }\n    /**\n     * Reads the document referenced by the provided {@link DocumentReference}.\n     *\n     * @param documentRef - A reference to the document to be read.\n     * @returns A `DocumentSnapshot` with the read data.\n     */    get(t) {\n        const e = Kh(t, this._firestore), n = new qh(this._firestore);\n        return this._transaction.lookup([ e._key ]).then((t => {\n            if (!t || 1 !== t.length) return L();\n            const s = t[0];\n            if (s.isFoundDocument()) return new hh(this._firestore, n, s.key, s, e.converter);\n            if (s.isNoDocument()) return new hh(this._firestore, n, e._key, null, e.converter);\n            throw L();\n        }));\n    }\n    set(t, e, n) {\n        const s = Kh(t, this._firestore), i = Lh(s.converter, e, n), r = Qc(this._dataReader, \"Transaction.set\", s._key, i, null !== s.converter, n);\n        return this._transaction.set(s._key, r), this;\n    }\n    update(t, e, n, ...s) {\n        const i = Kh(t, this._firestore);\n        // For Compat types, we have to \"extract\" the underlying types before\n        // performing validation.\n                let r;\n        return r = \"string\" == typeof (e = p(e)) || e instanceof Nc ? Zc(this._dataReader, \"Transaction.update\", i._key, e, n, s) : Xc(this._dataReader, \"Transaction.update\", i._key, e), \n        this._transaction.update(i._key, r), this;\n    }\n    /**\n     * Deletes the document referred to by the provided {@link DocumentReference}.\n     *\n     * @param documentRef - A reference to the document to be deleted.\n     * @returns This `Transaction` instance. Used for chaining method calls.\n     */    delete(t) {\n        const e = Kh(t, this._firestore);\n        return this._transaction.delete(e._key), this;\n    }\n} {\n    // This class implements the same logic as the Transaction API in the Lite SDK\n    // but is subclassed in order to return its own DocumentSnapshot types.\n    /** @hideconstructor */\n    constructor(t, e) {\n        super(t, e), this._firestore = t;\n    }\n    /**\n     * Reads the document referenced by the provided {@link DocumentReference}.\n     *\n     * @param documentRef - A reference to the document to be read.\n     * @returns A `DocumentSnapshot` with the read data.\n     */    get(t) {\n        const e = Kh(t, this._firestore), n = new Qh(this._firestore);\n        return super.get(t).then((t => new _h(this._firestore, n, e._key, t._document, new dh(\n        /* hasPendingWrites= */ !1, \n        /* fromCache= */ !1), e.converter)));\n    }\n}\n\n/**\n * Executes the given `updateFunction` and then attempts to commit the changes\n * applied within the transaction. If any document read within the transaction\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\n * commit after 5 attempts, the transaction fails.\n *\n * The maximum number of writes allowed in a single transaction is 500.\n *\n * @param firestore - A reference to the Firestore database to run this\n * transaction against.\n * @param updateFunction - The function to execute within the transaction\n * context.\n * @returns If the transaction completed successfully or was explicitly aborted\n * (the `updateFunction` returned a failed promise), the promise returned by the\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\n * rejected promise with the corresponding failure error is returned.\n */ function ol(t, e) {\n    return Qu(Ic(t = tc(t, gc)), (n => e(new rl(t, n))));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\n */ function al() {\n    return new jc(\"deleteField\");\n}\n\n/**\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\n * include a server-generated timestamp in the written data.\n */ function ul() {\n    return new zc(\"serverTimestamp\");\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\n * value that already exists on the server. Each specified element that doesn't\n * already exist in the array will be added to the end. If the field being\n * modified is not already an array it will be overwritten with an array\n * containing exactly the specified elements.\n *\n * @param elements - The elements to union into the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`.\n */ function cl(...t) {\n    // NOTE: We don't actually parse the data until it's used in set() or\n    // update() since we'd need the Firestore instance to do this.\n    return new Hc(\"arrayUnion\", t);\n}\n\n/**\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\n * updateDoc:1} that tells the server to remove the given elements from any\n * array value that already exists on the server. All instances of each element\n * specified will be removed from the array. If the field being modified is not\n * already an array it will be overwritten with an empty array.\n *\n * @param elements - The elements to remove from the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */ function hl(...t) {\n    // NOTE: We don't actually parse the data until it's used in set() or\n    // update() since we'd need the Firestore instance to do this.\n    return new Jc(\"arrayRemove\", t);\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\n * the given value.\n *\n * If either the operand or the current field value uses floating point\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\n * integers, values outside of JavaScript's safe number range\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\n * precision loss. Furthermore, once processed by the Firestore backend, all\n * integer operations are capped between -2^63 and 2^63-1.\n *\n * If the current field value is not of type `number`, or if the field does not\n * yet exist, the transformation sets the field to the given value.\n *\n * @param n - The value to increment by.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */ function ll(t) {\n    return new Yc(\"increment\", t);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Creates a write batch, used for performing multiple writes as a single\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\n * is 500.\n *\n * Unlike transactions, write batches are persisted offline and therefore are\n * preferable when you don't need to condition your writes on read data.\n *\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\n * writes.\n */ function fl(t) {\n    return Ic(t = tc(t, gc)), new Uh(t, (e => sl(t, e)));\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */ function dl(t, e) {\n    Ic(t = tc(t, gc));\n    const n = \"string\" == typeof e ? function(t) {\n        try {\n            return JSON.parse(t);\n        } catch (t) {\n            throw new Q(G.INVALID_ARGUMENT, \"Failed to parse JSON:\" + t.message);\n        }\n    }(e) : e, s = [];\n    // PORTING NOTE: We don't return an error if the user has not enabled\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\n        const e = _l(t, \"collectionGroup\"), n = [];\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\n            const t = ah(\"setIndexConfiguration\", _l(e, \"fieldPath\"));\n            \"CONTAINS\" === e.arrayConfig ? n.push(new ie(t, 2 /* CONTAINS */)) : \"ASCENDING\" === e.order ? n.push(new ie(t, 0 /* ASCENDING */)) : \"DESCENDING\" === e.order && n.push(new ie(t, 1 /* DESCENDING */));\n        }\n        s.push(new ee(ee.UNKNOWN_ID, e, n, re.empty()));\n    }\n    // TODO(indexing): Configure indexes\n        return Promise.resolve();\n}\n\nfunction _l(t, e) {\n    if (\"string\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \"Missing string value for: \" + e);\n    return t[e];\n}\n\n/**\n * Cloud Firestore\n *\n * @packageDocumentation\n */ !function(t, e = !0) {\n    !function(t) {\n        x = t;\n    }(i), n(new r(\"firestore\", ((t, {options: n}) => {\n        const s = t.getProvider(\"app\").getImmediate(), i = new gc(s, new J(t.getProvider(\"auth-internal\")), new tt(t.getProvider(\"app-check-internal\")));\n        return n = Object.assign({\n            useFetchStreams: e\n        }, n), i._setSettings(n), i;\n    }), \"PUBLIC\")), s(D, \"3.4.6\", t), \n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n    s(D, \"3.4.6\", \"__BUILD_TARGET__\");\n}();\n\nexport { Bh as AbstractUserDataWriter, Mc as Bytes, mc as CACHE_SIZE_UNLIMITED, ac as CollectionReference, rc as DocumentReference, _h as DocumentSnapshot, Nc as FieldPath, Oc as FieldValue, gc as Firestore, Q as FirestoreError, $c as GeoPoint, wc as LoadBundleTask, oc as Query, Ih as QueryConstraint, wh as QueryDocumentSnapshot, mh as QuerySnapshot, dh as SnapshotMetadata, ut as Timestamp, rl as Transaction, Uh as WriteBatch, vt as _DatabaseId, xt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, tc as _cast, U as _debugAssert, yt as _isBase64Available, F as _logWarn, dl as _setIndexConfiguration, Ju as _validateIsNotUsedTogether, tl as addDoc, hl as arrayRemove, cl as arrayUnion, bc as clearIndexedDbPersistence, uc as collection, cc as collectionGroup, ic as connectFirestoreEmulator, Zh as deleteDoc, al as deleteField, vc as disableNetwork, hc as doc, kc as documentId, Ec as enableIndexedDbPersistence, Ac as enableMultiTabIndexedDbPersistence, Vc as enableNetwork, kh as endAt, Nh as endBefore, Ic as ensureFirestoreConfigured, sl as executeWrite, Gh as getDoc, jh as getDocFromCache, Wh as getDocFromServer, zh as getDocs, Hh as getDocsFromCache, Jh as getDocsFromServer, pc as getFirestore, ll as increment, yc as initializeFirestore, Vh as limit, vh as limitToLast, Dc as loadBundle, Cc as namedQuery, el as onSnapshot, nl as onSnapshotsInSync, bh as orderBy, Th as query, fc as queryEqual, lc as refEqual, ol as runTransaction, ul as serverTimestamp, Yh as setDoc, M as setLogLevel, yh as snapshotEqual, Ch as startAfter, Dh as startAt, Sc as terminate, Xh as updateDoc, Pc as waitForPendingWrites, Ah as where, fl as writeBatch };\n//# sourceMappingURL=index.esm2017.js.map\n", "// Import Firebase\nimport { initializeApp } from \"firebase/app\";\nimport { enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, getFirestore, collection, doc, getDoc, onSnapshot, query, where, orderBy, limit, setLogLevel} from 'firebase/firestore';\nimport { isSafari } from '@firebase/util';\n\nvar db, analyticsUnsubscribe, activityFeedUnsubscribe;\n\nimport { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\n  static targets = ['activeUsersCount', 'totalViews', 'totalVisitors', 'activityFeeds', 'accountActivityFeed', 'networkActivityFeed']\n\n  static values = {\n    environment: String,\n    apikey: String,\n    authdomain: String,\n    projectid: String,\n    accountid: Number,\n    profileid: Number,\n    userType: String\n  }\n\n  initialize() {\n    \n    if (typeof db == 'undefined') {\n      this.setUpFirestore();\n    }\n    \n  }\n  \n  setUpFirestore() {\n    \n    // Firebase configuration\n    const firebaseConfig = {\n      apiKey: this.apikeyValue,\n      authDomain: this.authdomainValue,\n      projectId: this.projectidValue\n    };\n    \n    // Initialize Firebase\n    const app = initializeApp(firebaseConfig);\n    db = getFirestore(app);\n    // setLogLevel('debug');\n    \n    // enableIndexedDbPersistence(db, {forceOwnership: true});\n    if (!isSafari()) {\n      enableMultiTabIndexedDbPersistence(db);\n    }\n    \n  }\n\n  async dashboardData(accountId) {\n    \n    // Don't show Special Feature Account Data\n    if (this.userTypeValue == 'staff') {accountId = 0}\n    \n      const dashboardDoc = this.dashboardDoc(accountId);\n      const docSnap = await getDoc(dashboardDoc);\n      if (docSnap.exists()) {\n        let dataToSave = {\n          createdAt: Date.now(),\n          data: docSnap.data()\n        };\n        \n        return docSnap.data();\n      } else {\n        // doc.data() will be undefined in this case\n        console.log(\"No such document!\");\n        return null;\n      }\n      \n  }\n  \n  async analyticsDataLast30Days() {\n    \n    const analyticsLast30DaysDoc = this.analyticsLast30DaysDoc();\n    const docSnap = await getDoc(analyticsLast30DaysDoc);\n    if (docSnap.exists()) {\n      let dataToSave = {\n        createdAt: Date.now(),\n        data: docSnap.data()\n      };\n      \n      return docSnap.data();\n      \n    } else {\n      // doc.data() will be undefined in this case\n      console.log(\"No such document!\");\n      return null;\n    }\n      \n  }\n   \n  accountActivityFeedTargetConnected() {\n    let accountID = this.accountidValue;\n    if (accountID != 0 && accountID != null && this.userTypeValue != 'staff') {\n      this.populateActivityStream(true);\n    } else {\n      this.accountActivityFeedTarget.classList.add('hidden');\n    }\n  }\n  \n  networkActivityFeedTargetConnected() {\n    this.populateActivityStream(false);\n  }\n  \n  populateActivityStream(accountOnly = true) {\n    \n    var initialLoad = true;\n    let that = this;\n    let elements = accountOnly ? this.accountActivityFeedTargets : this.networkActivityFeedTargets;\n    let query = accountOnly ? this.accountActivityFeedDataQuery() : this.siteActivityFeedDataQuery();\n    \n    activityFeedUnsubscribe = onSnapshot(query, (activityStreamDataQuerySnapshot) => {\n      \n      setTimeout(function() {\n        initialLoad = false;\n      }, 2000);\n      \n        \n      if (activityStreamDataQuerySnapshot.docChanges().length == 0) {\n        elements.forEach(function(element) {\n          if (element.innerHTML == '') {\n            element.insertAdjacentHTML(\"afterbegin\", that.activityFeedController.emptyTemplate());\n          }\n        });\n      } else {\n        \n        activityStreamDataQuerySnapshot.docChanges().forEach((change, index) => {\n          let item = change.doc.data();\n          var additions = 0;\n          activityStreamDataQuerySnapshot.docChanges().forEach((item) => {\n            if (item.type == 'added') {additions++}\n          });\n          \n          if (change.type == 'added') {\n            \n            let noRecentActivity = document.getElementById('no-recent-activity');\n            \n            if (noRecentActivity) {\n              document.getElementById('no-recent-activity').classList.add(\"hidden\");\n            }\n            \n            // Check item is not already on page\n            if ( document.getElementById('activity-'+item.id) ) {\n              \n              // If present replace activity item\n              let feedItem = document.getElementById('activity-'+item.id);\n              feedItem.innerHTML = that.activityFeedController.feedItemTemplate(item, {'returnChild': true});\n            } else {\n              \n              // If not present, add activity item\n              elements.forEach(function(element) {\n                let firstItem = element.firstChild;\n                if (firstItem && (Number(item.id) <= Number(firstItem.dataset.itemId))) {\n                  element.insertAdjacentHTML(\"beforeend\", that.activityFeedController.feedItemTemplate(item, {'initialLoad': initialLoad}));\n                } else if (additions == 1) {\n                  element.insertAdjacentHTML(\"afterbegin\", that.activityFeedController.feedItemTemplate(item, {'initialLoad': initialLoad}));\n                } else {\n                  element.insertAdjacentHTML(\"beforeend\", that.activityFeedController.feedItemTemplate(item, {'initialLoad': initialLoad}));\n                }\n              });\n            }            \n            \n          } else if (change.type == 'modified') {\n            let feedItem = document.getElementById('activity-'+item.id);\n            feedItem.innerHTML = that.activityFeedController.feedItemTemplate(item, {'returnChild': true});\n          } else if (change.type == 'removed') {\n            let feedItem = document.getElementById('activity-'+item.id);\n            if (feedItem) {\n              \n              feedItem.classList.add('removed');\n              setTimeout(function() {\n                feedItem.remove();\n              }, 700);\n            }\n          }\n          \n        });\n        \n      }\n      \n    });\n    \n  }\n\n  dashboardDoc(accountId) {\n    const environment = this.firebaseEnvironmentToUse();\n    const environmentRef = collection(db, environment);\n    const serverDoc = doc(environmentRef, this.serverDomain());\n    const dashboardDataRef = collection(serverDoc, 'dashboardData');\n    const dashboardAccountDoc = doc(dashboardDataRef, 'account-' + accountId);\n    return dashboardAccountDoc\n  }\n  \n  analyticsLast30DaysDoc() {\n    const environment = this.firebaseEnvironmentToUse();\n    const environmentRef = collection(db, environment);\n    const serverDoc = doc(environmentRef, this.serverDomain());\n    const dashboardDataRef = collection(serverDoc, 'analytics');\n    const dashboardAccountDoc = doc(dashboardDataRef, 'last30Days');\n    return dashboardAccountDoc\n  }\n\n  analyticDataQuery() {\n    const environment = this.firebaseEnvironmentToUse();\n    const environmentRef = collection(db, environment);\n    const serverDoc = doc(environmentRef, this.serverDomain());\n    const analyticsDataRef = collection(serverDoc, 'analytics');\n    const q = query(analyticsDataRef);\n    return q\n  }\n  \n  accountActivityFeedDataQuery() {\n    const environment = this.firebaseEnvironmentToUse();\n    const environmentRef = collection(db, environment);\n    const serverDoc = doc(environmentRef, this.serverDomain());\n    const activityFeedDataRef = collection(serverDoc, 'activityFeed');\n    const q = query(activityFeedDataRef, where(\"context\", \"array-contains-any\", ['a'+this.accountidValue, 'p'+this.profileidValue]), orderBy(\"createdAt\", \"desc\"), limit(10));\n    return q\n  }\n  \n  siteActivityFeedDataQuery() {\n    const environment = this.firebaseEnvironmentToUse();\n    const environmentRef = collection(db, environment);\n    const serverDoc = doc(environmentRef, this.serverDomain());\n    const activityFeedDataRef = collection(serverDoc, 'activityFeed');\n    const q = query(activityFeedDataRef, orderBy(\"createdAt\", \"desc\"), limit(10));\n    return q\n  }\n\n  // Root Firestore Document\n  serverDomain() {\n    switch (this.firebaseEnvironmentToUse()) {\n      case 'development':\n        return window.location.hostname.replace('www.', '').replace('lounge.', '');\n        break;\n      case 'staging':\n        return 'staging.luxre.net';\n        break;\n      default:\n        return 'luxuryrealestate.com';\n    }\n  }\n  \n  firebaseEnvironmentToUse() {\n    \n    if (this.environmentValue == 'development' || this.environmentValue == 'staging') {\n      \n      const urlParams = new URL(window.location.toLocaleString()).searchParams;\n      const envParam = urlParams.get('env');\n      const environmentParam = urlParams.get('environment');\n      let environmentToUse = (envParam == \"production\" || environmentParam == \"production\") ? 'production' : this.environmentValue;\n      \n      return environmentToUse;\n      \n    } else {\n      return this.environmentValue;\n    }\n    \n  }\n  \n  get activityFeedController() {\n    var activityFeedElement = document.querySelector('.activity-wrapper')\n    \n    return this.application.getControllerForElementAndIdentifier(activityFeedElement, 'activity');\n  }  \n\n}\n", "import SlimSelect from 'slim-select'\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"form\"\nexport default class extends Controller {\n\n  static targets = ['phoneNumberForm', 'certificationForm', 'linkForm', 'mlsIdForm', 'feederMarketForm', 'addItemButton', 'disabledAddItemButton', 'subdivisions', 'iso3166Field', 'testimonialForm', 'languageForm', 'searchSelect', 'additionalEmailForm', 'areaField', 'subdivisionField']\n\n  static values = {\n    phoneTableSrc: String,\n    certificationTableSrc: String,\n    testimonialTableSrc: String,\n    additionalEmailTableSrc: String,\n    feederMarketTableSrc: String,\n    languageTableSrc: String,\n    linkTableSrc: String,\n    mlsIdTableSrc: String,\n    hasSubdivisions: Array\n  }\n\n  disableAddItemButton() {\n    this.addItemButtonTarget.classList.add('hidden');\n    this.disabledAddItemButtonTarget.classList.remove('hidden');\n  }\n  enableAddItemButton() {\n    this.addItemButtonTarget.classList.remove('hidden');\n    this.disabledAddItemButtonTarget.classList.add('hidden');\n  }\n\n  enterEditMode() {\n    this.element.classList.add('editing');\n    this.disableAddItemButton();\n  }\n\n  exitEditMode() {\n    this.element.classList.remove('editing');\n  }\n\n  updatePhoneKind(e) {\n    let newExtensionInput = e.target.parentNode.parentNode.querySelector('.extension-wrapper input.phone-extension');\n    if (['mobile', 'fax'].includes(e.target.value )) {\n      newExtensionInput.classList.add('hidden');\n      newExtensionInput.value = '';\n    } else {\n      newExtensionInput.classList.remove('hidden');\n    }\n  }\n\n  phoneNumberFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormRow);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormRow);\n    });\n\n    function closeFormRow(event) {\n      if (event.key == 'Escape') {\n        let newPhoneFrame = document.getElementById('new_phone_number');\n        let phoneTableFrame = document.getElementById('phone_numbers_table');\n        newPhoneFrame.src = that.phoneTableSrcValue;\n        phoneTableFrame.src = that.phoneTableSrcValue;\n        that.enableAddItemButton();\n      }\n    }\n\n  }\n\n  certificationFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormRow);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormRow);\n    });\n\n    function closeFormRow(event) {\n      if (event.key == 'Escape') {\n        let newCertificationFrame = document.getElementById('new_certification');\n        let certificationTableFrame = document.getElementById('certifications_table');\n        newCertificationFrame.src = that.certificationTableSrcValue;\n        certificationTableFrame.src = that.certificationTableSrcValue;\n        that.enableAddItemButton();\n      }\n    }\n  }\n\n  feederMarketFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormRow);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormRow);\n    });\n\n    function closeFormRow(event) {\n      if (event.key == 'Escape') {\n        let newFeederMarketFrame = document.getElementById('new_feeder_market');\n        let feederMarketTableFrame = document.getElementById('feeder_markets_table');\n        newFeederMarketFrame.src = that.feederMarketTableSrcValue;\n        feederMarketTableFrame.src = that.feederMarketTableSrcValue;\n        that.enableAddItemButton();\n      }\n    }\n\n  }\n\n  testimonialFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormOnEsc);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormOnEsc);\n    });\n\n    function closeFormOnEsc(event) {\n      if (event.key == 'Escape') {\n        let table = document.getElementById('testimonial_table');\n        table.src = that.testimonialTableSrcValue;\n      }\n    }\n  }\n\n  languageFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormOnEsc);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormOnEsc);\n    });\n\n    function closeFormOnEsc(event) {\n      if (event.key == 'Escape') {\n        let table = document.getElementById('languages_table');\n        table.src = that.languageTableSrcValue;\n        that.enableAddItemButton();\n      }\n    }\n  }\n\n  linkFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormOnEsc);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormOnEsc);\n    });\n\n    function closeFormOnEsc(event) {\n      if (event.key == 'Escape') {\n        let table = document.getElementById('links_table');\n        let newLinkRow = document.getElementById('new_link');\n        table.src = that.linkTableSrcValue;\n        that.exitEditMode();\n        that.enableAddItemButton();\n        newLinkRow.innerHTML = '';\n      }\n    }\n  }\n\n  mlsIdFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormOnEsc);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormOnEsc);\n    });\n\n    function closeFormOnEsc(event) {\n      if (event.key == 'Escape') {\n        let table = document.getElementById('mls_id_table');\n        table.src = that.mlsIdTableSrcValue;\n        that.exitEditMode();\n        that.enableAddItemButton();\n      }\n    }\n  }\n\n  additionalEmailFormTargetConnected(element) {\n    let that = this;\n    document.addEventListener('keypress', closeFormRow);\n    document.addEventListener('turbo:before-cache', function() {\n      document.removeEventListener('keypress', closeFormRow);\n    });\n\n    function closeFormRow(event) {\n      if (event.key == 'Escape') {\n        let newCertificationFrame = document.getElementById('new_additional_email');\n        let additionalEmailTableFrame = document.getElementById('additional_emails_table');\n        newCertificationFrame.src = that.additionalEmailTableSrcValue;\n        additionalEmailTableFrame.src = that.additionalEmailTableSrcValue;\n        that.enableAddItemButton();\n      }\n    }\n  }\n\n  searchSelectTargetConnected(element) {\n    new SlimSelect({ select: element });\n  }\n\n  submitWithoutEmptyValues(event) {\n\n      event.preventDefault();\n      var queryString = \"?\";\n      var queryVals = [];\n      var formData = new FormData(event.target);\n      for (var pair of formData.entries()) {\n        if (pair[1]) {\n          queryVals.push(pair[0] + \"=\" + pair[1]);\n        }\n      }\n\n      queryString += queryVals.join('&');\n      const newURL = location.pathname + queryString;\n      this.navigationController.updatePageContentAndURL(newURL);\n  }\n\n\n  updateFormUrlWithSelect(e) {\n    let input = e.target;\n    let form = input.form;\n    form.action = input.value;\n  }\n\n  imageDroped(event) {\n    this.displaySpinner(event);\n    this.submitFormFromInputWithTurbo(event);\n  }\n\n  profileImageDropped(e) {\n    var that = this;\n\n    if (e) {\n      var file = e.target.files[0];\n      var reader  = new FileReader();\n\n      that.imageController.destroyCropper();\n\n      reader.onload = function(e)  {\n        var image = document.querySelector(\"img#image-to-crop\");\n        image.src = e.target.result;\n        that.imageController.cropImage(image, false);\n\n      }\n      reader.readAsDataURL(file);\n    } else {\n      var image = document.querySelector(\"img#image-to-crop\");\n      that.imageController.cropImage(image);\n    }\n    this.modalController.open();\n  }\n\n  displaySpinner(event) {\n    let element = event.target;\n    let spinners = document.getElementsByClassName(element.dataset.spinner); //the div where we will show image\n\n    [].forEach.call(spinners, (spinner) => {\n      spinner.classList.remove('hidden');\n    });\n  }\n\n  confirmRemovePhoto(event) {\n    if (confirm(\"Are you sure that you want to delete this photo?\") == true) {\n      this.displaySpinner(event);\n      this.submitFormFromInputWithTurbo(event);\n    } else {\n      event.target.checked = false;\n    }\n  }\n\n  submitFormFromInputWithTurbo(event, form = null) {\n    if (form) {\n      form.dispatchEvent(new CustomEvent('submit', { bubbles: true }))\n    } else {\n      event.target.form.dispatchEvent(new CustomEvent('submit', { bubbles: true }))\n    }\n  }\n\n  submitFormFromSelectTurbo(event) {\n    var spinnerDisplayed = false;\n    if (event.params.elIdToClear) {\n      const toClear = document.getElementById(event.params.elIdToClear);\n\n      if (event.params.showSpinner) {\n        toClear.innerHTML = \"<div class='spinner my-8'></div>\";\n        spinnerDisplayed = true;\n      } else {\n        toClear.innerHTML = '';\n      }\n    }\n    if (event.params.showSpinner && !spinnerDisplayed) {\n      const spinner = document.createElement(\"div\");\n      spinner.classList.add('spinner', 'my-8');\n      event.target.form.insertAdjacentElement(\"afterend\", spinner);\n    }\n    event.target.form.dispatchEvent(new CustomEvent('submit', { bubbles: true }))\n  }\n\n  updateSubdivisions(e) {\n    let countryCode = e.target.value;\n    this.updateISO3166(countryCode);\n\n    if (this.hasSubdivisionsValue.includes(countryCode)) {\n      this.subdivisionsTarget.classList.remove('hidden');\n\n      this.hasSubdivisionsValue.forEach((code) => {\n        if (code == countryCode) {\n          document.getElementById(countryCode+'-subdivisions').classList.remove('hidden');\n        } else {\n          let subdivision = document.getElementById(code+'-subdivisions');\n          subdivision.classList.add('hidden');\n          subdivision.value = '';\n        }\n      })\n\n    } else {\n      this.subdivisionsTarget.classList.add('hidden');\n\n      this.hasSubdivisionsValue.forEach((code) => {\n        let subdivision = document.getElementById(code+'-subdivisions');\n        subdivision.classList.add('hidden');\n        subdivision.value = '';\n      })\n    }\n\n  }\n\n  submitProfilePhotoForm() {\n    document.querySelector('form#profile-form').submit();\n  }\n\n  selectState(e) {\n    this.updateISO3166(e.target.value);\n  }\n\n  updateISO3166(value) {\n    this.iso3166FieldTarget.value = value;\n  }\n\n  updateMlsIdSource(event) {\n    let selectedOption = event.srcElement[event.target.selectedIndex];\n    let sourceInput = document.getElementById('mls_id_source');\n    sourceInput.value = selectedOption.dataset.source;\n  }\n\n  enableSubmit(e) {\n    let form = e.target.form;\n    let submitButton = form.querySelector('button.disabled, input.disabled[type=submit]');\n    if (submitButton) {\n      submitButton.classList.remove('disabled');\n      submitButton.disabled = false;\n    }\n  }\n\n  openCropModal() {\n    this.profileImageDropped();\n  }\n\n  setArea(event) {\n    var val = event.target.value;\n    var areaField = this.areaFieldTarget;\n    areaField.value += ',' + val\n    this.submitFormFromInputWithTurbo(event);\n  }\n\n  removeLocation(event) {\n    const input = document.querySelector('input[name=locations]');\n    const currentValArray = input.value.split(',');\n    const newVal = currentValArray.filter((l) => l !== event.target.dataset.value).join(',')\n    input.value = newVal;\n    input.form.dispatchEvent(new CustomEvent('submit', { bubbles: true }));\n  }\n\n  get imageController() {\n    var imageContainerElement = document.getElementById('image-crop-container')\n    return this.application.getControllerForElementAndIdentifier(imageContainerElement, 'image');\n  }\n\n  get navigationController() {\n    var navigationContainerElement = document.getElementById('page-content')\n    return this.application.getControllerForElementAndIdentifier(navigationContainerElement, 'navigation');\n  }\n\n  get modalController() {\n    var modalContainerElement = document.getElementById('modal')\n    return this.application.getControllerForElementAndIdentifier(modalContainerElement, 'modal');\n  }\n\n}\n", "var searchQueue;\nvar autocomplete;\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"geocoder\"\nexport default class extends Controller {\n\n  static targets = ['feederMarketForm', 'feederMarketInput', 'results']\n  \n  feederMarketInputTargetConnected() {\n    var that = this;\n    autocomplete = new google.maps.places.Autocomplete(\n      this.feederMarketInputTarget, {fields: ['place_id', 'name'], types: ['(regions)']}\n    );\n    autocomplete.addListener('place_changed', function() {\n      var place = autocomplete.getPlace();\n      that.findByPlaceId(place);\n    });\n  }\n  \n  findByPlaceId(place) {\n    if (place) {\n      var that = this;\n      var geocoder = new google.maps.Geocoder();\n      var placeID = place.place_id;\n      geocoder.geocode( { 'placeId': placeID}, function(result, status) {\n        var placeResult = Array.isArray(result) ? result[0] : result;\n        \n        if (placeResult) {\n          that.addFeederMarketByPlace(placeResult);\n        } else {\n          that.selectFirstFeederMarket();\n        }\n      });\n    } else {\n      this.selectFirstFeederMarket();\n    }\n    \n  }\n  \n  addFeederMarketByPlace(place) {\n    this.feederMarketFormTarget.innerHTML = `<span class=\"text-gray-400 dark:text-gray-600 text-xs\">${place.formatted_address}</span>`;\n    var newFeederMarketForm = document.getElementById('new_profile_feeder_market');\n    \n    newFeederMarketForm.querySelector('#feeder-market-address').value = place.formatted_address;\n    newFeederMarketForm.querySelector('#feeder-market-status').value = 'geocoded';\n    newFeederMarketForm.querySelector('#feeder-market-response_code').value = 200;\n    newFeederMarketForm.querySelector('#feeder-market-lat').value = place.geometry.location.lat();\n    newFeederMarketForm.querySelector('#feeder-market-lng').value = place.geometry.location.lng();\n    newFeederMarketForm.querySelector('#feeder-market-north').value = place.geometry.bounds.getNorthEast().lat();\n    newFeederMarketForm.querySelector('#feeder-market-south').value = place.geometry.bounds.getSouthWest().lat();\n    newFeederMarketForm.querySelector('#feeder-market-east').value = place.geometry.bounds.getNorthEast().lng();\n    newFeederMarketForm.querySelector('#feeder-market-west').value = place.geometry.bounds.getSouthWest().lng();\n    \n    newFeederMarketForm.submit();\n  }\n  \n  selectFirstFeederMarket() {\n    var that = this;\n    var firstResult = document.querySelector('.pac-container .pac-item:first-of-type').textContent;\n    var formattedFirstResult = firstResult.replace(/([A-Z]+)*([A-Z][a-z])/g, \"$1 $2\")\n    var geocoder = new google.maps.Geocoder();\n    \n    this.feederMarketInputTarget.value = formattedFirstResult;\n    this.feederMarketInputTarget.disabled = true;\n    this.feederMarketFormTarget.innerHTML = `<span class=\"text-gray-400 dark:text-gray-600 text-xs\">${formattedFirstResult}</span>`;\n    geocoder.geocode({\"address\": firstResult }, function(result, status) {\n      if (status == google.maps.GeocoderStatus.OK) {\n        that.addFeederMarketByPlace(result[0])\n      } else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {\n        geocoder.geocode({\"address\": formattedFirstResult }, function(result, status) {\n          if (status == google.maps.GeocoderStatus.OK) {\n            that.addFeederMarketByPlace(result[0]);\n          }\n        });\n      }\n    });\n  }\n\n}\n", "import Cropper from 'cropperjs';\nimport { Controller } from \"@hotwired/stimulus\"\n\nvar cropper;\n\n// Connects to data-controller=\"image\"\nexport default class extends Controller {\n  \n  cropImage(image, existingImage = true) {\n    var that = this;\n    cropper = new Cropper(image, {\n      checkCrossOrigin: false,\n      zoomable: false,\n      restore: false,\n      aspectRatio: 1,\n      rotatable: false,\n      scalable: false,\n      ready: function () {\n        var cropper = this.cropper;\n        \n        if (existingImage) {\n          var existingCropData = document.getElementById('crop-data').value.split(',');\n          \n          cropper.setData({\n            x: parseInt(existingCropData[0]),\n            y: parseInt(existingCropData[1]),\n            width: parseInt(existingCropData[2]),\n            height: parseInt(existingCropData[3])\n          });\n        } else {\n          that.setCropData();\n        }\n        this.cropper.crop();\n\n      },\n    \n      cropend: function (e) {\n        that.setCropData();\n      }\n    });\n    \n  }\n  \n  destroyCropper() {\n    if (cropper) {\n      cropper.destroy();\n      var image = document.querySelector(\"img#image-to-crop\");\n      image.src = image.dataset.ogImg;\n    }\n  }\n  \n  setCropData(cropData) {\n    var cropData = cropper.getData(true);\n    var imageData = cropper.getImageData();\n    \n    var maxX = imageData.naturalWidth - 1 - cropData.width < 0 ? 0 : imageData.naturalWidth - 1 - cropData.width;\n    var maxY = imageData.naturalHeight - 1 - cropData.height < 0 ? 0 : imageData.naturalHeight - 1 - cropData.height;\n    var maxDimension = imageData.naturalWidth > imageData.naturalHeight ? imageData.naturalHeight - 1 : imageData.naturalWidth - 1;\n    var cropWidth = cropData.width > maxDimension ? maxDimension : cropData.width;\n    var cropHeight = cropData.height > maxDimension ? maxDimension : cropData.height;\n    var cropX = cropData.x < 0 ? 0 : cropData.x;\n    var cropY = cropData.y < 0 ? 0 : cropData.y;\n    cropX = cropX > maxX ? maxX : cropX;\n    cropY = cropY > maxY ? maxY : cropY;\n    \n    var dataString = cropX + ',' + cropY +',' + cropWidth + ',' + cropHeight;\n    var cropDataField = document.querySelector('input#crop-data');\n    cropDataField.value = dataString;\n  }\n\n}\n", "import List from 'list.js'\nimport { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"list\"\nexport default class extends Controller {\n\n  static targets = ['availableFeaturedListings', 'item']\n\n  availableFeaturedListingsTargetConnected(element) {\n    var options = {\n      valueNames: [ 'listing-title', 'listing-location' ],\n      page: 10,\n      visibleItems: \".summary\",\n      pagination: {\n        // outerWindow: 1,\n        innerWindow: 1,\n        includeDirectionLinks: true,\n        leftDirectionText: '\u2190',\n        rightDirectionText: '\u2192',\n        item: \"<li><span class='page link'></span></li>\"\n      }\n    };\n\n    var listObj = new List('listId', options);\n  }\n\n  toggleMoreListItems(event) {\n    const buttonText = event.target.innerText == 'View More' ? 'View Less' : 'View More';\n    const items = this.itemTargets;\n    event.target.innerText = buttonText;\n\n    items.forEach( (item) => {\n      if ( item.classList.contains('li-to-hide') ) {\n        item.classList.toggle('hidden');\n      }\n    });\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"listing\"\nexport default class extends Controller {\n\n  static values = {\n    url: String\n  }\n\n  toggleArchive() {\n    console.log(this.urlValue);\n\n    var url = this.urlValue;\n\n    fetch(url, {\n      method: \"put\",\n      headers: {\n        'Accept': 'application/json',\n        'Content-Type': 'application/json',\n        'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')\n      }\n    })\n    .then( (response) => {\n\n    });\n\n  }\n\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nvar jvmViewsMap;\nvar jvmNetworkMap = false;\nvar accountID;\nvar selectedAccount = 0;\nvar selectedTimeSpan = 30;\nvar mapviews;\nvar markers;\n\nexport default class extends Controller {\n\n  static targets = ['dashboardViewsMap', 'dashboardNetworkMap', 'lists', 'moreButton']\n\n  dashboardViewsMapTargetConnected(element) {\n    accountID = this.firebaseController.accountidValue;\n    \n    var that = this;\n    var accountViewsPromise = this.firebaseController.dashboardData(accountID);\n\n    accountViewsPromise.then(function(results) {\n      if (results) {\n        let accountMapButton = document.getElementById('accountViewsButton');\n        if (accountID != 0 && accountID != null && that.firebaseController.userTypeValue != 'staff') {\n          accountMapButton.classList.remove('hidden');\n        }\n      }\n      \n      var siteViewsPromise = that.firebaseController.dashboardData(0);\n      siteViewsPromise.then(function(siteResults) {\n        if (siteResults) {\n          that.initPropertyViewsMap(siteResults);\n        } else {\n          console.log('map error');\n        }\n      }, failureCallback);\n      \n      \n    }, failureCallback);\n  }\n\n  dashboardViewsMapTargetDisconnected(element) {\n    // Clear out map element to prevent duplicates on back\n    element.innerHTML = '';\n  }\n\n  dashboardNetworkMapTargetDisconnected(element) {\n    // Clear out map element to prevent duplicates on back\n    element.innerHTML = '';\n  }\n\n  selectAccountViewsMap(e) {\n    updateViewsMapTabs(e.target);\n    selectedAccount = accountID;\n    this.updateMapData(accountID);\n    // this.firebaseController.populateActivityStream();\n    \n    this.dashboardViewsMapTarget.classList.remove('hidden');\n    this.dashboardNetworkMapTarget.classList.add('hidden');\n  }\n\n  selectSiteViewsMap(e) {\n    updateViewsMapTabs(e.target);\n    selectedAccount = 0;\n    this.updateMapData(0);\n    // this.firebaseController.populateActivityStream(false);\n    \n    this.dashboardViewsMapTarget.classList.remove('hidden');\n    this.dashboardNetworkMapTarget.classList.add('hidden');\n  }\n  \n  selectNetworkMap(e) {\n    updateViewsMapTabs(e.target);\n    this.displayNetworkMap();\n  }\n\n  updateDataTimeSpan(e) {\n    let accountButton = document.getElementById('accountViewsButton');\n    let timeSpan = e.target.dataset.duration == \"7\" ? 7 : 30;\n    selectedTimeSpan = timeSpan;\n    let dataset = accountButton.classList.contains('active') ? accountID : 0;\n\n    this.updateMapData(dataset);\n    updateDurationTabs(e.target);\n  }\n\n  updateMapData(accountID) {\n    var viewsPromise = this.firebaseController.dashboardData(accountID);\n    viewsPromise.then(function(results) {\n      let current_map = jvmViewsMap.history[jvmViewsMap.history.length - 1].params.map.replace('_mill', '');\n      updateMapValues(results, current_map);\n      updateTopViewsLists(results, current_map);\n    }, failureCallback);\n  }\n  \n  displayNetworkMap() {\n    \n    this.dashboardViewsMapTarget.classList.add('hidden');\n    this.dashboardNetworkMapTarget.classList.remove('hidden');\n    \n    if (!jvmNetworkMap) {\n      this.initNetworkMap();\n    }\n\n    this.fetchMembersList();\n  }\n  \n  fetchMembersList() {\n\n    markers = {\n      coords: [],\n      label: [],\n      region: []\n    };\n\n    fetch(\"/members_list\", {method: \"post\"})\n    .then((response) => response.text())\n    .then((data) => {\n\n      let json = JSON.parse(data);\n\n      json.forEach(item => {\n\n        markers.coords.push([item.location.latitude, item.location.longitude]);\n        markers.region.push(item.members[0].iso3166);\n        var label = '<b>'+ item.members[0].location +'</b></br>';\n        \n        var memberNames = []\n\n        item.members.forEach(member => {\n          memberNames.push(member.name);\n        });\n\n        memberNames.sort().forEach(name => {\n          label += name + '<br>';\n        });\n\n        markers.label.push(label);\n      });\n\n      this.addMemberMarkers(markers);\n    });\n    \n  }\n  \n  addMemberMarkers(markers) {\n    for (const map in jvmNetworkMap.maps) {\n      jvmNetworkMap.maps[map].reset();\n      jvmNetworkMap.maps[map].addMarkers([]);\n      jvmNetworkMap.maps[map].addMarkers(markers.coords);\n    }\n  }\n\n  initPropertyViewsMap(data) {\n      \n    updateTopViewsLists(data);\n     \n    if (data.hasOwnProperty('propertyViewsLast30Days')) {\n      let countryViews = data.propertyViewsLast30Days.views;\n      mapviews = valuesToPercent(countryViews, data.propertyViewsLast30Days.total);\n      \n      $(function(){\n        jvmViewsMap = new jvm.MultiMap({\n          container: $('#views-map'),\n          maxLevel: 1,\n          subMapsOptions: {\n            backgroundColor: 'transparent',\n            regionStyle: {\n              initial: {\n                fill: '#eeeeee'\n              }\n            },\n            series: {\n              regions: [{\n                values: mapviews,\n                scale: ['#C8EEFF', '#0071A4'],\n                normalizeFunction: 'polynomial'\n              }]\n            },\n            onRegionTipShow: function(e, el, code){\n              const count = (typeof(mapviews[code]) == 'undefined' || mapviews[code] == 0) ? '' : ' ' + mapviews[code] + '%';\n              el.html(el.html()+count);\n            }\n          },\n          main: {\n            map: 'world_mill',\n            backgroundColor: 'transparent',\n            zoomAnimate: true,\n            regionStyle: {\n              initial: {\n                fill: '#eeeeee'\n              }\n            },\n            series: {\n              regions: [{\n                values: mapviews,\n                scale: ['#C8EEFF', '#0071A4'],\n                normalizeFunction: 'polynomial'\n              }]\n            },\n            onRegionTipShow: function(e, el, code){\n              const count = (typeof(mapviews[code]) == 'undefined' || mapviews[code] == 0) ? '' : ' ' + mapviews[code] + '%';\n              el.html(el.html()+ count);\n            },\n            onMarkerTipShow: function(event, label, index){\n              label.html(\n                markers.label[index]\n              );\n            }\n          },\n          mapNameByCode: function(code, multiMap){\n            var submaps = ['AU', 'CA', 'NL', 'NZ', 'US'];\n            if (submaps.includes(code)) {\n              return code.toLowerCase()+'_mill';\n            } else {\n              return 'world_mill';\n            }\n          },\n          mapUrlByCode: function(code, multiMap) {\n            var submaps = ['AU', 'CA', 'NL', 'NZ', 'US'];\n            if (submaps.includes(code)) {\n              return '/js/jquery-jvectormap-'+code.toLowerCase()+'-mill.js';\n            } else {\n              return '/js/jquery-jvectormap-world-mill.js';\n            }\n          }\n        });\n      });\n    }\n    \n  }\n  \n  initNetworkMap() {\n    \n    var that = this;\n    \n    $(function(){\n      jvmNetworkMap = new jvm.MultiMap({\n        container: $('#network-map'),\n        zoomStep: 1.9,\n        zoomMax: 50,\n        main: {\n          map: 'world_mill',\n          backgroundColor: 'transparent',\n          zoomAnimate: true,\n          zoomStep: 1.9,\n          zoomMax: 50,\n          regionStyle: {\n            initial: {\n              fill: '#7FB4D3'\n            }\n          },\n          markerStyle: {\n            initial: {\n              fill: '#085E90',\n              stroke: 'white'\n            },\n            hover: {\n              \"fill-opacity\": 1,\n              cursor: 'pointer',\n              stroke: '#dddddd'\n            },\n          },\n          onRegionTipShow: function(e, el, code){\n            el.style.display = 'none';\n          },\n          onRegionClick: function(e, code){\n            let current_map = jvmNetworkMap.history[jvmNetworkMap.history.length - 1];\n            var submaps = ['US'];\n            if (submaps.includes(code)) {\n              that.fetchMembersList();\n              that.addMemberMarkers(markers);\n            }\n            that.clearNetworkMapHistory();\n          },\n          onMarkerTipShow: function(event, label, index){\n            label.html(\n              markers.label[index]\n            );\n          },\n          onMarkerClick: function(event, index){\n            that.zoomNetworkMapToMarkerRegion(index);\n          }\n        },\n        subMapsOptions: {\n          backgroundColor: 'transparent',\n          zoomAnimate: true,\n          zoomStep: 1.9,\n          zoomMax: 50,\n          markers: markers.coords,\n          regionStyle: {\n            initial: {\n              fill: '#7FB4D3'\n            }\n          },\n          markerStyle: {\n            initial: {\n              fill: '#085E90',\n              stroke: 'white'\n            },\n            hover: {\n              \"fill-opacity\": 1,\n              cursor: 'pointer',\n              stroke: '#dddddd'\n            },\n          },\n          onRegionTipShow: function(e, el, code){\n            el.style.display = 'none';\n          },\n          onRegionClick: function(e, code){\n            let current_map = jvmNetworkMap.history[jvmNetworkMap.history.length - 1];\n            jvmNetworkMap.history[2] = current_map;\n          },\n          onMarkerTipShow: function(event, label, index){\n            label.html(\n              markers.label[index]\n            );\n          },\n          onMarkerClick: function(event, index){\n            that.zoomNetworkMapToMarkerRegion(index);\n            let current_map = jvmNetworkMap.history[jvmNetworkMap.history.length - 1];\n            jvmNetworkMap.history[2] = current_map;\n          }\n        },\n        mapNameByCode: function(code, multiMap){\n          var submaps = ['US'];\n          if (code.startsWith('US')) {\n            return code.toLowerCase()+'_mill';\n          } else {\n            return 'world_mill';\n          }\n        },\n        mapUrlByCode: function(code, multiMap) {\n          var submaps = ['US'];\n          if (code.startsWith('US')) {\n            return '/js/jquery-jvectormap-'+code.toLowerCase()+'-mill.js';\n          } else {\n            return '/js/jquery-jvectormap-world-mill.js';\n          }\n        }\n      });\n    });\n  }\n  \n  clearNetworkMapHistory() {\n    let current_map = jvmNetworkMap.history[jvmNetworkMap.history.length - 1];\n    jvmNetworkMap.history.splice(1, 5);\n  }\n  \n  zoomNetworkMapToMarkerRegion(index) {\n\n    var regionCode = markers.region[index].split(\"-\")[0];\n    let current_map = jvmNetworkMap.history[jvmNetworkMap.history.length - 1];\n    \n    if (current_map.params.map == 'us_mill') {\n      jvmNetworkMap.drillDown('us_mill', markers.region[index]);\n      current_map.setFocus({region: markers.region[index], animate: true});\n      \n    } else {\n      this.clearNetworkMapHistory();\n  \n      if (regionCode == 'US') {\n        jvmNetworkMap.drillDown('us_mill', regionCode);\n        this.fetchMembersList();\n        this.addMemberMarkers(markers);\n      } else {\n        jvmNetworkMap.drillDown('world_mill', regionCode);\n      }\n    }\n\n  }\n  \n  toggleMoreViewListItems(e) {\n    let buttonText = e.target.innerText == 'View More' ? 'View Less' : 'View More';\n    this.listsTarget.style.maxHeight = this.listsTarget.offsetHeight;\n    let hiddenItems = document.querySelectorAll('.property-view-lists tr.to-hide');\n    [].forEach.call(hiddenItems, (row) => {\n      \n      row.classList.toggle('hide-tr');\n      row.classList.toggle('expanded');\n        \n    });\n    \n    e.target.innerText = buttonText;\n    \n  }\n\n  get firebaseController() {\n    var firebaseElement = document.getElementById('firebase')\n    return this.application.getControllerForElementAndIdentifier(firebaseElement, 'firebase');\n  }\n\n}\n\nfunction updateTopViewsLists(viewData, submap = false) {\n\n  // TODO: make these stimulus targets\n  const topCountriesList = document.getElementById('country-views-list');\n  const topCitiesList = document.getElementById('city-views-list');\n\n  let countryViews = selectedTimeSpan == '7' ? viewData.countryViewsLast7days : viewData.countryViewsLast30days;\n  let cityViews = selectedTimeSpan == '7' ? viewData.cityViewsLast7days : viewData.cityViewsLast30days;\n  \n  topCountriesList.innerHTML = '';\n  topCitiesList.innerHTML = '';\n\n  var countryResults = [];\n  var countryTotalPercent = 0;\n  var cityResults = [];\n  var cityTotalPercent = 0;\n  \n  var showMoreButton = false;\n  \n  const upArrow = `<span class=\"flex justify-end\"><svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"2.5\" stroke=\"currentColor\" class=\"w-6 h-3.5 text-green-600\">\n    <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 6.75L12 3m0 0l3.75 3.75M12 3v18\" />\n  </svg></span>`;\n  const downArrow = `<span class=\"flex justify-end\"><svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"2.5\" stroke=\"currentColor\" class=\"w-6 h-3.5 text-red-600\">\n    <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 17.25L12 21m0 0l-3.75-3.75M12 21V3\" />\n  </svg></span>`;\n  \n  if (cityViews) {\n    cityViews.views.forEach((item) => {\n      let cityName = item.city;\n      if (item.iso.includes('AU-') || item.iso.includes('CA-') || item.iso.includes('US-')) {\n        cityName = item.city + ', ' + item.iso.split('-')[1];\n      }\n    \n      if (item.viewsPercentage >= 1 && item.iso != null) {\n        cityTotalPercent += item.viewsPercentage;\n        changeArrow = item.changePercentage < 0 ? downArrow : upArrow;\n        cityResults.push({area: cityName, viewsPercentage: item.viewsPercentage, code: item.iso.split('-')[0].toLowerCase(), change: changeArrow});\n      }\n    \n    });\n  }\n\n  if (countryViews) {\n    countryViews.views.forEach((item) => {\n      \n      if (item.viewsPercentage >= 1 && item.iso != null) {\n        cityTotalPercent += item.viewsPercentage;\n        changeArrow = item.changePercentage < 0 ? downArrow : upArrow;\n        countryResults.push({area: I18n.t('iso3166.'+item.iso), viewsPercentage: item.viewsPercentage, code: item.iso.split('-')[0].toLowerCase(), change: changeArrow});\n      }\n    \n    });\n  }\n\n\n  cityResults.sort((a, b) => (a.viewsPercentage < b.viewsPercentage || a.code == 'other') ? 1 : -1);\n  for (const value in cityResults) {\n    let hidden = value < 10 ? '' : 'hide-tr to-hide';\n    topCitiesList.innerHTML += '<tr class=\"h-6 mb-3 dark:border-gray-800 '+hidden+'\"><td class=\"pl-4 pb-2.5\"><span class=\"flag-icon '+cityResults[value].code+'\"></span>' + ' ' +cityResults[value].area + ' </td><td class=\"py-2.5 text-right\">' + cityResults[value].viewsPercentage + '%</td><td class=\"pr-4 py-2.5 text-right\">'+cityResults[value].change+'</td></tr>'\n  }\n\n  countryResults.sort((a, b) => (a.viewsPercentage < b.viewsPercentage|| a.code == 'other') ? 1 : -1);\n  for (const value in countryResults) {\n    let hidden = value < 10 ? '' : 'hide-tr to-hide';\n    topCountriesList.innerHTML += '<tr class=\"h-6 mb-3 dark:border-gray-800 '+hidden+'\"><td class=\"pl-4 pb-2.5\"><span class=\"flag-icon '+countryResults[value].code+'\"></span>' + ' ' +countryResults[value].area + ' </td><td class=\"py-2.5 text-right\">' + countryResults[value].viewsPercentage + '%</td><td class=\"pr-4 py-2.5 text-right\">'+countryResults[value].change+'</td></tr>'\n  }\n\n}\n\n\nfunction updateMapValues(newValues, submap = false) {\n\n  let countryViews = selectedTimeSpan == 7 ? newValues.propertyViewsLast7Days.views : newValues.propertyViewsLast30Days.views;\n  mapviews = selectedTimeSpan == 7 ? valuesToPercent(countryViews, newValues.propertyViewsLast7Days.total) : valuesToPercent(countryViews, newValues.propertyViewsLast30Days.total);\n\n  for (const map in jvmViewsMap.maps) {\n    jvmViewsMap.maps[map].reset();\n    jvmViewsMap.maps[map].removeAllMarkers();\n    jvmViewsMap.maps[map].series.regions[0].setValues(mapviews);\n  }\n  // submap = (!submap || submap == 'world') ? false : submap.toUpperCase();\n  submap = false;\n  updateTopViewsLists(newValues, submap);\n}\n\nfunction updateViewsMapTabs(activeTab) {\n  var tabs = document.querySelectorAll('.property-map-button');\n  [].forEach.call(tabs, (tab) => {\n    if (tab == activeTab) {\n      tab.classList.add(\"border-gray-500\", \"text-gray-600\", \"dark:text-gray-300/75\", \"dark:border-gray-300/75\", \"active\");\n      tab.classList.remove(\"border-transparent\", \"text-gray-500\", \"dark:text-gray-400/75\", \"hover:text-gray-700\", \"dark:hover:text-gray-500\", \"hover:border-gray-300\", \"hidden\", \"dark:hover:border-gray-500\");\n    } else {\n      tab.classList.remove(\"border-gray-500\", \"text-gray-600\", \"dark:text-gray-300/75\", \"dark:border-gray-300/75\", \"active\");\n      tab.classList.add(\"border-transparent\", \"text-gray-500\", \"dark:text-gray-400/75\", \"hover:text-gray-700\", \"dark:hover:text-gray-500\", \"hover:border-gray-300\", \"dark:hover:border-gray-500\");\n    }\n  });\n}\n\nfunction updateDurationTabs(activeTab) {\n  var tabs = document.querySelectorAll('.property-duration-button');\n  [].forEach.call(tabs, (tab) => {\n    if (tab == activeTab) {\n      tab.classList.add(\"text-gray-900\", \"bg-white\", \"dark:bg-gray-700\", \"dark:text-gray-300\", \"shadow-sm\", \"ring-1\", \"ring-black\", \"shadow-sm\", \"ring-1\", \"ring-black\", \"ring-opacity-5\", \"flex\", \"rounded-md\");\n      tab.classList.remove(\"text-gray-600\", \"dark:text-gray-400\", \"group-hover:text-gray-900\", \"dark:group-hover:text-gray-300\");\n    } else {\n      tab.classList.add(\"text-gray-600\", \"dark:text-gray-400\", \"group-hover:text-gray-900\", \"dark:group-hover:text-gray-300\");\n      tab.classList.remove(\"text-gray-900\", \"bg-white\", \"dark:bg-gray-700\", \"dark:text-gray-300\", \"shadow-sm\", \"ring-1\", \"ring-black\", \"bg-white\", \"shadow-sm\", \"ring-1\", \"ring-black\", \"ring-opacity-5\", \"flex\", \"rounded-md\");\n    }\n  });\n}\n\nfunction percentToOneDecimal(value, of) {\n  let percent = (value / of * 100).toFixed(1);\n  return parseFloat(percent)\n}\n\nfunction valuesToPercent(values, total) {\n  var percentObject = {};\n  for (let val in values) {\n    if (val.includes('-')) {\n      let mapCode = val.split('-')[0];\n      percentObject[val] = parseFloat((values[val] / values[mapCode] * 100).toFixed(1));\n    } else {\n      percentObject[val] = parseFloat((values[val] / total * 100).toFixed(1));\n    }\n  }\n  return percentObject;\n}\n\nfunction failureCallback(err) {\n  console.log(\"An error occured: \" + err);\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"menu\"\nexport default class extends Controller {\n\n  static targets = ['mobileOpen', 'mobileClose', 'mobileMenu', 'mobileSearchMenu', 'slideoutSidebar']\n\n  toggleMobileMenu() {\n    // Open/close menu\n    this.mobileMenuTarget.classList.toggle('hidden');\n    this.mobileMenuTarget.classList.toggle('block');\n\n    // Show/Hide menu open button\n    this.mobileOpenTarget.classList.toggle('hidden');\n    this.mobileOpenTarget.classList.toggle('block');\n\n    // Show/Hide menu close button\n    this.mobileCloseTarget.classList.toggle('hidden');\n    this.mobileCloseTarget.classList.toggle('block');\n  }\n\n  mobileMenuTargetConnected(element) {\n    var submenues = element.querySelectorAll('.dropdown');\n\n    [].forEach.call(submenues, (submenu) => {\n      submenu.addEventListener('click', () => {\n\n        // Close all other menus\n        [].forEach.call(submenues, (sub) => {\n          if (submenu != sub) {\n            sub.classList.remove('open');\n          }\n        });\n\n        // Toggle Menu open/close\n        submenu.classList.toggle('open');\n      });\n    });\n\n  }\n\n  slideoutSidebarTargetConnected(element) {\n    let state = localStorage.getItem(\"slideout\");\n    if (state == 'open') {\n      element.classList.add('open');\n    }\n  }\n\n  toggleSidebarSlideout() {\n    this.setSlideoutState();\n\n    this.slideoutSidebarTarget.classList.add('transitioning');\n    this.slideoutSidebarTarget.classList.toggle('open');\n\n    setTimeout(() => {\n      this.slideoutSidebarTarget.classList.remove('transitioning');\n    }, 500);\n  }\n\n  setSlideoutState(state = false) {\n\n    if (state) {\n      localStorage.setItem(\"slideout\", state);\n    } else {\n      let isOpen = this.slideoutSidebarTarget.classList.contains('open');\n\n      if (isOpen) {\n        localStorage.setItem(\"slideout\", \"closed\");\n      } else {\n        localStorage.setItem(\"slideout\", \"open\");\n      }\n    }\n\n  }\n\n  resetSlideoutState() {\n    if (window.innerWidth >= 1024) {\n      this.closeSlideoutState();\n    }\n  }\n\n  closeSlideoutState() {\n\n    if (this.slideoutSidebarTarget.classList.contains('open')) {\n      this.slideoutSidebarTarget.classList.add('transitioning');\n      this.slideoutSidebarTarget.classList.remove('open');\n\n      this.setSlideoutState('closed');\n      setTimeout(() => {\n        this.slideoutSidebarTarget.classList.remove('transitioning');\n      }, 500);\n    }\n  }\n\n\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"modal\"\nexport default class extends Controller {\n\n  static targets = ['window']\n\n  static values = {\n    targetId: String\n  }\n\n\n  open() {\n    this.windowTarget.classList.remove('hidden');\n  }\n\n  close() {\n    this.windowTarget.classList.add('hidden');\n  }\n\n  enter() {\n    var modalWidow = document.getElementById(this.targetIdValue);\n    modalWidow.classList.add('open');\n  }\n\n  exit() {\n    var modalWidow = document.getElementById(this.targetIdValue);\n    modalWidow.classList.remove('open');\n  }\n\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"navigation\"\nexport default class extends Controller {\n\n  updateURL(event, url = false) {\n\n    var target = event.target;\n    var newURL;\n    if (url) {\n      newURL = url;\n    } else if ( target.hasAttribute('href') ) {\n      newURL = target.href;\n    } else if ( target.parentElement.hasAttribute('href') ) {\n      newURL = target.parentElement.href;\n    } else if ( target.parentElement.parentElement.hasAttribute('href') ) {\n      newURL = target.parentElement.parentElement.href;\n    } else {\n      return null;\n    }\n\n    newURL = newURL.replaceAll('%2C', ','); // allow commas\n    newURL = newURL.replaceAll('%5B', '[').replaceAll('%5D', ']'); // allow brackets\n    history.replaceState({}, \"\", newURL);\n  }\n\n  updatePageContentAndURL(url) {\n    document.getElementById('page-content').src = url;\n    this.updateURL({}, url);\n  }\n\n  updatePageContentAndURLWithSelect(event) {\n    const that = this;\n    const selectedValue = event.target.selectedOptions[0].value;\n    if (selectedValue) {\n      that.updatePageContentAndURL(selectedValue);\n    }\n  }\n\n\n\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"spinner\"\nexport default class extends Controller {\n  \n  replace(event) {\n    let element = event.target;\n    let spinners = document.getElementsByClassName(element.dataset.spinner);\n    \n    // Hide element\n    element.classList.add('hidden');\n    \n    // Display spinner\n    [].forEach.call(spinners, (spinner) => {\n      spinner.classList.remove('hidden');\n    });\n    \n  }\n  \n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"theme\"\nexport default class extends Controller {\n  \n  static targets = ['lightCheck', 'darkCheck', 'autoCheck'];\n\n  connect() {\n    this.updateTheme();\n    const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n    mq.addEventListener(\"change\", (e) => {\n      this.updateTheme();\n    });\n  }\n  \n  updateTheme(e) {\n    if (e) {\n      this.theme = e.target.dataset.themeSelected;\n    }\n    this.setHTMLClass(this.theme);\n    this.updateSelectedMenuItem(this.theme);\n    this.broadcastThemeChange();\n  }\n  \n  setHTMLClass(theme) {\n    if (this.theme === 'dark' || ((this.theme === 'auto' || !('theme' in localStorage)) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n      document.documentElement.classList.add('dark');\n    } else {\n      document.documentElement.classList.remove('dark');\n    }\n  }\n  \n  updateSelectedMenuItem(theme) {\n    let checks = document.querySelectorAll('.theme-check');\n    [].forEach.call(checks, (check) => {\n      check.classList.add('hidden');\n    });\n    if (checks.length > 0) {\n      this.targets.find(theme+'Check').classList.remove('hidden');\n    }\n  }\n  \n  broadcastThemeChange() {\n    const event = document.createEvent('Event');\n    event.initEvent('themeChange', true, true);\n    document.dispatchEvent(event);\n  }\n  \n  set theme(value) {\n    window.localStorage.setItem('theme', value);\n  }\n  \n  get theme() {\n    var savedTheme = window.localStorage.theme;\n    var selectedTheme = savedTheme == 'dark' || savedTheme == 'light' || savedTheme == 'auto' ? savedTheme : 'auto';\n    return selectedTheme;\n  }\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 ActivityController from \"./activity_controller\"\napplication.register(\"activity\", ActivityController)\n\nimport AlertController from \"./alert_controller\"\napplication.register(\"alert\", AlertController)\n\nimport AnalyticsController from \"./analytics_controller\"\napplication.register(\"analytics\", AnalyticsController)\n\nimport AutocompleteController from \"./autocomplete_controller\"\napplication.register(\"autocomplete\", AutocompleteController)\n\nimport ChartsController from \"./charts_controller\"\napplication.register(\"charts\", ChartsController)\n\nimport DashboardController from \"./dashboard_controller\"\napplication.register(\"dashboard\", DashboardController)\n\nimport DraggableController from \"./draggable_controller\"\napplication.register(\"draggable\", DraggableController)\n\nimport FavoriteController from \"./favorite_controller\"\napplication.register(\"favorite\", FavoriteController)\n\nimport FirebaseController from \"./firebase_controller\"\napplication.register(\"firebase\", FirebaseController)\n\nimport FormController from \"./form_controller\"\napplication.register(\"form\", FormController)\n\nimport GeocoderController from \"./geocoder_controller\"\napplication.register(\"geocoder\", GeocoderController)\n\nimport ImageController from \"./image_controller\"\napplication.register(\"image\", ImageController)\n\nimport ListController from \"./list_controller\"\napplication.register(\"list\", ListController)\n\nimport ListingController from \"./listing_controller\"\napplication.register(\"listing\", ListingController)\n\nimport MapController from \"./map_controller\"\napplication.register(\"map\", MapController)\n\nimport MenuController from \"./menu_controller\"\napplication.register(\"menu\", MenuController)\n\nimport ModalController from \"./modal_controller\"\napplication.register(\"modal\", ModalController)\n\nimport NavigationController from \"./navigation_controller\"\napplication.register(\"navigation\", NavigationController)\n\nimport SpinnerController from \"./spinner_controller\"\napplication.register(\"spinner\", SpinnerController)\n\nimport ThemeController from \"./theme_controller\"\napplication.register(\"theme\", ThemeController)\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAO;AAAP;AAAA;AAAA,MAAO,mBAAQ;AAAA,QACb,QAAQ,KAAK;AAAA,QACb,WAAW,KAAK;AAAA,MAClB;AAAA;AAAA;;;ACHA,MAcO;AAdP;AAAA;AAAA;AAcA,MAAO,iBAAQ;AAAA,QACb,OAAO,UAAU;AACf,cAAI,KAAK,SAAS;AAChB,qBAAS,KAAK,KAAK,IAAI,CAAC;AACxB,6BAAS,OAAO,IAAI,iBAAiB,GAAG,QAAQ;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA;AAAA;;;ACrBA,MAKM,KAEA,cAEN,mBAmHO;AA5HP;AAAA;AAAA;AAKA,MAAM,MAAM,MAAM,IAAI,KAAK,EAAE,QAAQ;AAErC,MAAM,eAAe,UAAS,KAAI,IAAI,QAAQ;AAE9C,gCAAwB;AAAA,QACtB,YAAY,YAAY;AACtB,eAAK,sBAAsB,KAAK,oBAAoB,KAAK,IAAI;AAC7D,eAAK,aAAa;AAClB,eAAK,oBAAoB;AAAA,QAC3B;AAAA,QAEA,QAAQ;AACN,cAAI,CAAC,KAAK,UAAU,GAAG;AACrB,iBAAK,YAAY,IAAI;AACrB,mBAAO,KAAK;AACZ,iBAAK,aAAa;AAClB,6BAAiB,oBAAoB,KAAK,mBAAmB;AAC7D,2BAAO,IAAI,gDAAgD,KAAK,YAAY,kBAAkB;AAAA,UAChG;AAAA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