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,EAAQ,UAAU,aAAe,WAE/B,IAAK,KAAK,QACR,MAAM,IAAI,MAAM,4CAElB,OAAO,KAAK,aACd,EAQO,CACT,GACC,CAvSD,CAuSqB,mBAAX,QAAyB,OAAO,IAAM,OAAS,SAAU,GAAW,OAAO,QAAU,EAAQ,QAAU","file":"/npm/location-bar@3.0.1/location-bar.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/location-bar@3.0.1/location-bar.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// LocationBar module extracted from Backbone.js 1.1.0\n//\n// the dependency on backbone, underscore and jquery have been removed to turn\n// this into a small standalone library for handling browser's history API\n// cross browser and with a fallback to hashchange events or polling.\n\n(function(define) {\ndefine(function() {\n\n  // 3 helper functions we use to avoid pulling in entire _ and $\n  var _ = {};\n  _.extend = function extend(obj, source) {\n    for (var prop in source) {\n      obj[prop] = source[prop];\n    }\n    return obj;\n  }\n  _.any = function any(arr, fn) {\n    for (var i = 0, l = arr.length; i < l; i++) {\n      if (fn(arr[i])) {\n        return true;\n      }\n    }\n    return false;\n  }\n  \n  function on(obj, type, fn) {\n    if (obj.attachEvent) {\n      obj['e'+type+fn] = fn;\n      obj[type+fn] = function(){ obj['e'+type+fn]( window.event ); };\n      obj.attachEvent( 'on'+type, obj[type+fn] );\n    } else {\n      obj.addEventListener( type, fn, false );\n    }\n  }\n  function off(obj, type, fn) {\n    if (obj.detachEvent) {\n      obj.detachEvent('on'+type, obj[type+fn]);\n      obj[type+fn] = null;\n    } else {\n      obj.removeEventListener(type, fn, false);\n    }\n  }\n\n\n\n\n\n  // this is mostly original code with minor modifications\n  // to avoid dependency on 3rd party libraries\n  //\n  // Backbone.History\n  // ----------------\n\n  // Handles cross-browser history management, based on either\n  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n  // and URL fragments.\n  var History = function() {\n    this.handlers = [];\n\n    // MODIFICATION OF ORIGINAL BACKBONE.HISTORY\n    //\n    // _.bindAll(this, 'checkUrl');\n    //\n    var self = this;\n    var checkUrl = this.checkUrl;\n    this.checkUrl = function () {\n      checkUrl.apply(self, arguments);\n    };\n\n    // Ensure that `History` can be used outside of the browser.\n    if (typeof window !== 'undefined') {\n      this.location = window.location;\n      this.history = window.history;\n    }\n  };\n\n  // Cached regex for stripping a leading hash/slash and trailing space.\n  var routeStripper = /^[#\\/]|\\s+$/g;\n\n  // Cached regex for stripping leading and trailing slashes.\n  var rootStripper = /^\\/+|\\/+$/g;\n\n  // Cached regex for removing a trailing slash.\n  var trailingSlash = /\\/$/;\n\n  // Cached regex for stripping urls of hash.\n  var pathStripper = /#.*$/;\n\n  // MODIFICATION OF ORIGINAL BACKBONE.HISTORY\n  // Has the history handling already been started?\n  // History.started = false;\n\n  // Set up all inheritable **Backbone.History** properties and methods.\n  _.extend(History.prototype, {\n\n    // Are we at the app root?\n    atRoot: function() {\n      return this.location.pathname.replace(/[^\\/]$/, '$&/') === this.root;\n    },\n\n    // Gets the true hash value. Cannot use location.hash directly due to bug\n    // in Firefox where location.hash will always be decoded.\n    getHash: function(window) {\n      var match = (window || this).location.href.match(/#(.*)$/);\n      return match ? match[1] : '';\n    },\n\n    // Get the cross-browser normalized URL fragment, either from the URL,\n    // the hash, or the override.\n    getFragment: function(fragment, forcePushState) {\n      if (fragment == null) {\n        if (this._hasPushState || !this._wantsHashChange || forcePushState) {\n          fragment = decodeURI(this.location.pathname + this.location.search);\n          var root = this.root.replace(trailingSlash, '');\n          if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);\n        } else {\n          fragment = this.getHash();\n        }\n      }\n      return fragment.replace(routeStripper, '');\n    },\n\n    // Start the hash change handling, returning `true` if the current URL matches\n    // an existing route, and `false` otherwise.\n    start: function(options) {\n      // MODIFICATION OF ORIGINAL BACKBONE.HISTORY\n      // if (History.started) throw new Error(\"LocationBar has already been started\");\n      // History.started = true;\n      this.started = true;\n\n      // Figure out the initial configuration.\n      // Is pushState desired ... is it available?\n      this.options          = _.extend({root: '/'}, options);\n      this.location         = this.options.location || this.location;\n      this.history          = this.options.history || this.history;\n      this.root             = this.options.root;\n      this._wantsHashChange = this.options.hashChange !== false;\n      this._wantsPushState  = !!this.options.pushState;\n      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);\n      var fragment          = this.getFragment();\n\n      // Normalize root to always include a leading and trailing slash.\n      this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n      // Depending on whether we're using pushState or hashes, and whether\n      // 'onhashchange' is supported, determine how we check the URL state.\n      if (this._hasPushState) {\n        on(window, 'popstate', this.checkUrl);\n      } else {\n        on(window, 'hashchange', this.checkUrl);\n      }\n\n      // Determine if we need to change the base url, for a pushState link\n      // opened by a non-pushState browser.\n      this.fragment = fragment;\n      var loc = this.location;\n\n      // Transition from hashChange to pushState or vice versa if both are\n      // requested.\n      if (this._wantsHashChange && this._wantsPushState) {\n\n        // If we've started off with a route from a `pushState`-enabled\n        // browser, but we're currently in a browser that doesn't support it...\n        if (!this._hasPushState && !this.atRoot()) {\n          this.fragment = this.getFragment(null, true);\n          this.location.replace(this.root + '#' + this.fragment);\n          // Return immediately as browser will do redirect to new url\n          return true;\n\n        // Or if we've started out with a hash-based route, but we're currently\n        // in a browser where it could be `pushState`-based instead...\n        } else if (this._hasPushState && this.atRoot() && loc.hash) {\n          this.fragment = this.getHash().replace(routeStripper, '');\n          this.history.replaceState({}, document.title, this.root + this.fragment);\n        }\n\n      }\n\n      if (!this.options.silent) return this.loadUrl();\n    },\n\n    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n    // but possibly useful for unit testing Routers.\n    stop: function() {\n      off(window, 'popstate', this.checkUrl);\n      off(window, 'hashchange', this.checkUrl);\n      this.started = false;\n    },\n\n    // Add a route to be tested when the fragment changes. Routes added later\n    // may override previous routes.\n    route: function(route, callback) {\n      this.handlers.unshift({route: route, callback: callback});\n    },\n\n    // Checks the current URL to see if it has changed, and if it has,\n    // calls `loadUrl`.\n    checkUrl: function() {\n      var current = this.getFragment();\n      if (current === this.fragment) return false;\n      this.loadUrl();\n    },\n\n    // Attempt to load the current URL fragment. If a route succeeds with a\n    // match, returns `true`. If no defined routes matches the fragment,\n    // returns `false`.\n    loadUrl: function(fragment) {\n      fragment = this.fragment = this.getFragment(fragment);\n      return _.any(this.handlers, function(handler) {\n        if (handler.route.test(fragment)) {\n          handler.callback(fragment);\n          return true;\n        }\n      });\n    },\n\n    // Save a fragment into the hash history, or replace the URL state if the\n    // 'replace' option is passed. You are responsible for properly URL-encoding\n    // the fragment in advance.\n    //\n    // The options object can contain `trigger: true` if you wish to have the\n    // route callback be fired (not usually desirable), or `replace: true`, if\n    // you wish to modify the current URL without adding an entry to the history.\n    navigate: function(fragment, options) {\n      if (!this.started) return false;\n      if (!options || options === true) options = {trigger: !!options};\n\n      var url = this.root + (fragment = this.getFragment(fragment || ''));\n\n      // Strip the hash for matching.\n      fragment = fragment.replace(pathStripper, '');\n\n      if (this.fragment === fragment) return;\n      this.fragment = fragment;\n\n      // Don't include a trailing slash on the root.\n      if (fragment === '' && url !== '/') url = url.slice(0, -1);\n\n      // If pushState is available, we use it to set the fragment as a real URL.\n      if (this._hasPushState) {\n        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n      // If hash changes haven't been explicitly disabled, update the hash\n      // fragment to store history.\n      } else if (this._wantsHashChange) {\n        this._updateHash(this.location, fragment, options.replace);\n      // If you've told us that you explicitly don't want fallback hashchange-\n      // based history, then `navigate` becomes a page refresh.\n      } else {\n        return this.location.assign(url);\n      }\n      if (options.trigger) return this.loadUrl(fragment);\n    },\n\n    // Update the hash location, either replacing the current entry, or adding\n    // a new one to the browser history.\n    _updateHash: function(location, fragment, replace) {\n      if (replace) {\n        var href = location.href.replace(/(javascript:|#).*$/, '');\n        location.replace(href + '#' + fragment);\n      } else {\n        // Some browsers require that `hash` contains a leading #.\n        location.hash = '#' + fragment;\n      }\n    }\n\n  });\n\n\n\n  // add some features to History\n\n  // a more intuitive alias for navigate\n  History.prototype.update = function () {\n    this.navigate.apply(this, arguments);\n  };\n\n  // a generic callback for any changes\n  History.prototype.onChange = function (callback) {\n    this.route(/^(.*?)$/, callback);\n  };\n\n  // checks if the browser has pushstate support\n  History.prototype.hasPushState = function () {\n    // MODIFICATION OF ORIGINAL BACKBONE.HISTORY\n    if (!this.started) {\n      throw new Error(\"only available after LocationBar.start()\");\n    }\n    return this._hasPushState;\n  };\n\n\n\n\n\n\n  // export\n  return History;\n});\n})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });"]}