hy-push-state
Version:
Turn static web sites into dynamic web apps
34 lines • 101 kB
JavaScript
/*!
* Copyright (c) 2018 Florian Klampfer <https://qwtel.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jQuery")):"function"==typeof define&&define.amd?define("hyPushState",["jQuery"],e):"object"==typeof exports?exports.hyPushState=e(require("jQuery")):t.hyPushState=e(t.jQuery)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return i}));var n="undefined"!=typeof window&&window,o="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,i=n||void 0!==t&&t||o}).call(this,r(4))},function(e,r){e.exports=t},,,function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";r.r(e),r.d(e,"JQUERY_FEATURE_TESTS",(function(){return wo})),r.d(e,"Set",(function(){return i}));var n=r(1),o=r.n(n),i="undefined"!=typeof Set&&1===new Set([1]).size?Set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(t=t.filter((function(e,r){return r===t.indexOf(e)}))).size=t.length,t.has=function(e){return t.indexOf(e)>-1},t.add=function(e){return t.has(e)||(t.size++,t.push(e)),t},t.delete=function(e){var r;return(r=t.has(e))&&(t.size--,t.splice(t.indexOf(e),1)),r},t.clear=function(){for(;t.pop(););t.size=0},t};function u(t,e){return t?t(e):e}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function f(t,e,r){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y(t);if(e){var o=y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return h(this,r)}}function h(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setupComponent(e,r),this.connectComponent()};function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function m(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),t}function w(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=E(t);if(e){var o=E(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _(this,r)}}function _(t,e){return!e||"object"!==d(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var j=new i(["customevent"]),x=Symbol||function(t){return"_".concat(t)},R=x("sroot"),P=x("state");window.process=window.process||{},window.process.env=window.process.env||{},window.requestIdleCallback=window.requestIdleCallback||function(t){return window.setTimeout(t,0)},window.cancelIdleCallback=window.cancelIdleCallback||window.clearTimeout;var T=function t(){O(this,t)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var k=function(t,e){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function A(t,e){function r(){this.constructor=t}k(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function C(t){return"function"==typeof t}var I=!1,N={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;I=t},get useDeprecatedSynchronousErrorHandling(){return I}};function L(t){setTimeout((function(){throw t}),0)}var D={closed:!0,next:function(t){},error:function(t){if(N.useDeprecatedSynchronousErrorHandling)throw t;L(t)},complete:function(){}},q=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function U(t){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t){return null!==t&&"object"===U(t)}var H=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}();function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var F=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this._parentOrParents,n=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var i=0;i<r.length;++i){r[i].remove(this)}if(C(n))try{n.call(this)}catch(t){e=t instanceof H?$(t.errors):[t]}if(q(o)){i=-1;for(var u=o.length;++i<u;){var c=o[i];if(M(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof H?e=e.concat($(t.errors)):e.push(t)}}}if(e)throw new H(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(V(e)){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=r._parentOrParents;if(null===o)r._parentOrParents=this;else if(o instanceof t){if(o===this)return r;r._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return r;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[r]:i.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function $(t){return t.reduce((function(t,e){return t.concat(e instanceof H?e.errors:e)}),[])}var X=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var B=function(t){function e(r,n,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=D;break;case 1:if(!r){i.destination=D;break}if("object"===Y(r)){r instanceof e?(i.syncErrorThrowable=r.syncErrorThrowable,i.destination=r,r.add(i)):(i.syncErrorThrowable=!0,i.destination=new W(i,r));break}default:i.syncErrorThrowable=!0,i.destination=new W(i,r,n,o)}return i}return A(e,t),e.prototype[X]=function(){return this},e.create=function(t,r,n){var o=new e(t,r,n);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(F),W=function(t){function e(e,r,n,o){var i,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return C(r)?i=r:r&&(i=r.next,n=r.error,o=r.complete,r!==D&&(C((c=Object.create(r)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=i,u._error=n,u._complete=o,u}return A(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;N.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=N.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):L(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;L(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};N.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),N.useDeprecatedSynchronousErrorHandling)throw t;L(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!N.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return N.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(L(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(B);var z=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function G(t){return t}function J(t){return 0===t.length?G:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var K=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=function(t,e,r){if(t){if(t instanceof B)return t;if(t[X])return t[X]()}return t||e||r?new B(t,e,r):new B(D)}(t,e,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||N.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),N.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){N.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,r=e.closed,n=e.destination,o=e.isStopped;if(r||o)return!1;t=n&&n instanceof B?n:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=Q(e))((function(e,n){var o;o=r.subscribe((function(e){try{t(e)}catch(t){n(t),o&&o.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[z]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:J(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Q(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function Q(t){if(t||(t=N.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var Z=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),tt=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return A(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(F),et=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return A(e,t),e}(B),rt=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return A(e,t),e.prototype[X]=function(){return new et(this)},e.prototype.lift=function(t){var e=new nt(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new Z;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new Z;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Z;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new Z;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new Z;return this.hasError?(t.error(this.thrownError),F.EMPTY):this.isStopped?(t.complete(),F.EMPTY):(this.observers.push(t),new tt(this,t))},e.prototype.asObservable=function(){var t=new K;return t.source=this,t},e.create=function(t,e){return new nt(t,e)},e}(K),nt=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return A(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):F.EMPTY},e}(rt),ot=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return A(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return A(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(F)),it=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return A(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(ot),ut=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),ct=function(t){function e(r,n){void 0===n&&(n=ut.now);var o=t.call(this,r,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():n()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return A(e,t),e.prototype.schedule=function(r,n,o){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,o):t.prototype.schedule.call(this,r,n,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(ut),st=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return A(e,t),e}(ct))(it),at=new K((function(t){return t.complete()}));function ft(t){return t?function(t){return new K((function(e){return t.schedule((function(){return e.complete()}))}))}(t):at}function lt(t){return t&&"function"==typeof t.schedule}var pt,ht=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function yt(t,e){return new K((function(r){var n=new F,o=0;return n.add(e.schedule((function(){o!==t.length?(r.next(t[o++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}function bt(t,e){return e?yt(t,e):new K(ht(t))}function dt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return lt(r)?(t.pop(),yt(t,r)):bt(t)}function vt(t){var e=t.error;t.subscriber.error(e)}pt||(pt={});var mt=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return dt(this.value);case"E":return t=this.error,new K(e?function(r){return e.schedule(vt,0,{error:t,subscriber:r})}:function(e){return e.error(t)});case"C":return ft()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var wt=function(t){function e(e,r,n){void 0===n&&(n=0);var o=t.call(this,e)||this;return o.scheduler=r,o.delay=n,o}return A(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new gt(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(mt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(mt.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(mt.createComplete()),this.unsubscribe()},e}(B),gt=function(){return function(t,e){this.notification=t,this.destination=e}}(),St=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=n,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return A(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new _t(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=n.length;if(this.closed)throw new Z;if(this.isStopped||this.hasError?e=F.EMPTY:(this.observers.push(t),e=new tt(this,t)),o&&t.add(t=new wt(t,o)),r)for(var u=0;u<i&&!t.closed;u++)t.next(n[u]);else for(u=0;u<i&&!t.closed;u++)t.next(n[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||st).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,o=n.length,i=0;i<o&&!(t-n[i].time<r);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&n.splice(0,i),n},e}(rt),_t=function(){return function(t,e){this.time=t,this.value=e}}();function Et(t){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function xt(t,e,r){return(xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Rt(t,e){return(Rt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kt(t);if(e){var o=kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Tt(this,r)}}function Tt(t,e){return!e||"object"!==Et(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function kt(t){return(kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var At=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rt(t,e)}(i,t);var e,r,n,o=Pt(i);function i(){return Ot(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"setupComponent",value:function(t,e){var r=this,n={};this.subjects={},this.subjects.disconnect=new rt,this.subjects.document=new St,Object.keys(this.constructor.types).map((function(t){r.subjects[t]=new St(1),n[t]=function(e){return r.subjects[t].next(e)}})),Object.defineProperty(this.constructor,"sideEffects",{get:function(){return n},set:function(){},enumerable:!0,configurable:!0}),xt(kt(i.prototype),"setupComponent",this).call(this,t,e)}},{key:"connectComponent",value:function(){var t=this;xt(kt(i.prototype),"connectComponent",this).call(this),this.subjects.document.next(document),Object.keys(this.constructor.types).map((function(e){return t.subjects[e].next(t[e])}))}},{key:"disconnectComponent",value:function(){xt(kt(i.prototype),"disconnectComponent",this).call(this),this.subjects.disconnect.next({})}},{key:"adaptComponent",value:function(){xt(kt(i.prototype),"adaptComponent",this).call(this),this.subjects.document.next(document)}}])&&jt(e.prototype,r),n&&jt(e,n),i}(t)},Ct=function(t){return null==t?null:t.trim().replace(/^\[?(.*?)\]?$/,"$1").split(",").map((function(t){return t.trim()}))||null};Ct.stringify=function(t){return t&&t.length>0?t.join(","):null};var It=function(t){if(null==t)return!1;var e=t.trim&&t.trim()||t;return!("false"===e||"null"===e||"undefined"===e||"0"===e||!1===e)};It.stringify=function(t){return t?"":null};var Nt=function(t){return null==t?null:Number(t)};Nt.stringify=function(t){return null==t?null:"".concat(t)};var Lt=function(t){if(null==t)return null;var e=(t.trim&&t.trim()||t).match(/^\/?(.*?)(\/([gimy]*))?$/);return new RegExp(e[1],e[3])};Lt.stringify=function(t){return t&&t.toString()||null};var Dt=function(t){return t};Dt.stringify=function(t){return t};var qt=window.URL;if(!qt||!qt.prototype||!("href"in qt.prototype)){(qt=function(t,e){if(!t)throw new TypeError("Invalid argument");var r=document.implementation.createHTMLDocument("");if(e){var n=r.createElement("base");n.href=e,r.head.appendChild(n)}var o=r.createElement("a");if(o.href=t,r.body.appendChild(o),":"===o.protocol||!/:/.test(o.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o})}).prototype={toString:function(){return this.href},get href(){return this._anchorElement.href},set href(t){this._anchorElement.href=t},get protocol(){return this._anchorElement.protocol},set protocol(t){this._anchorElement.protocol=t},get host(){return this._anchorElement.host},set host(t){this._anchorElement.host=t},get hostname(){return this._anchorElement.hostname},set hostname(t){this._anchorElement.hostname=t},get port(){return this._anchorElement.port},set port(t){this._anchorElement.port=t},get pathname(){return this._anchorElement.pathname},set pathname(t){this._anchorElement.pathname=t},get search(){return this._anchorElement.search},set search(t){this._anchorElement.search=t},get hash(){return this._anchorElement.hash},set hash(t){this._anchorElement.hash=t}};var Ut=window.URL||window.webkitURL||window.mozURL;qt.createObjectURL=function(t){return Ut.createObjectURL.apply(Ut,arguments)},qt.revokeObjectURL=function(t){return Ut.revokeObjectURL.apply(Ut,arguments)},Object.defineProperty(qt.prototype,"toString",{enumerable:!1})}var Mt=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector;function Ht(t){for(var e=this;e!==document&&e!==document.documentElement;){if(Mt.call(e,t))return e;e=e.parentNode}return null}function Vt(t){var e=t.protocol,r=t.host,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;return e!==n.protocol||r!==n.host}function Ft(){return window.pageYOffset||document.body.scrollTop}var $t="push";function Xt(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Yt(t,e))}}var Yt=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.project,this.thisArg))},t}(),Bt=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.project=r,o.count=0,o.thisArg=n||o,o}return A(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(B);function Wt(t,e,r,n){return C(r)&&(n=r,r=void 0),n?Wt(t,e,r).pipe(Xt((function(t){return q(t)?n.apply(void 0,t):n(t)}))):new K((function(n){!function t(e,r,n,o,i){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var c=e;e.addEventListener(r,n,i),u=function(){return c.removeEventListener(r,n,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var s=e;e.on(r,n),u=function(){return s.off(r,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var a=e;e.addListener(r,n),u=function(){return a.removeListener(r,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var f=0,l=e.length;f<l;f++)t(e[f],r,n,o,i)}o.add(u)}(t,e,(function(t){arguments.length>1?n.next(Array.prototype.slice.call(arguments)):n.next(t)}),n,r)}))}var zt=function(t){function e(e,r,n){var o=t.call(this)||this;return o.parent=e,o.outerValue=r,o.outerIndex=n,o.index=0,o}return A(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(B);function Gt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Jt=Gt(),Kt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Qt(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Zt=function(t){if(t&&"function"==typeof t[z])return n=t,function(t){var e=n[z]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Kt(t))return ht(t);if(Qt(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,L),t};if(t&&"function"==typeof t[Jt])return e=t,function(t){for(var r=e[Jt]();;){var n=r.next();if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,o=M(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function te(t,e,r,n,o){if(void 0===o&&(o=new zt(t,r,n)),!o.closed)return e instanceof K?e.subscribe(o):Zt(e)(o)}var ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return A(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(B);function re(t){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ne(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[z]}(t))return function(t,e){return new K((function(r){var n=new F;return n.add(e.schedule((function(){var o=t[z]();n.add(o.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(Qt(t))return function(t,e){return new K((function(r){var n=new F;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(Kt(t))return yt(t,e);if(function(t){return t&&"function"==typeof t[Jt]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new K((function(r){var n,o=new F;return o.add((function(){n&&"function"==typeof n.return&&n.return()})),o.add(e.schedule((function(){n=t[Jt](),o.add(e.schedule((function(){if(!r.closed){var t,e;try{var o=n.next();t=o.value,e=o.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),o}))}(t,e)}throw new TypeError((null!==t&&re(t)||t)+" is not observable")}function oe(t,e){return e?ne(t,e):t instanceof K?t:new K(Zt(t))}function ie(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(ie((function(r,n){return oe(t(r,n)).pipe(Xt((function(t,o){return e(r,t,n,o)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new ue(t,r))})}var ue=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.project,this.concurrent))},t}(),ce=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=r,o.concurrent=n,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return A(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=new zt(this,e,r),o=this.destination;o.add(n);var i=te(this,t,void 0,void 0,n);i!==n&&o.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(ee);function se(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),ie(G,t)}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,o=t[t.length-1];return lt(o)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof o&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof K?t[0]:se(r)(bt(t,n))}function fe(){}var le=new K(fe);function pe(t){return new K((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?oe(r):ft()).subscribe(e)}))}function he(t){return function(e){return e.lift(new ye(t))}}var ye=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new be(t),n=te(r,this.notifier);return n&&!r.seenValue?(r.add(n),e.subscribe(r)):r},t}(),be=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return A(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(ee);function de(t,e){return function(r){return r.lift(new ve(t,e))}}var ve=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new me(t,this.predicate,this.thisArg))},t}(),me=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.predicate=r,o.thisArg=n,o.count=0,o}return A(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(B);function we(t,e,r){return function(n){return n.lift(new ge(t,e,r))}}var ge=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new Se(t,this.nextOrObserver,this.error,this.complete))},t}(),Se=function(t){function e(e,r,n,o){var i=t.call(this,e)||this;return i._tapNext=fe,i._tapError=fe,i._tapComplete=fe,i._tapError=n||fe,i._tapComplete=o||fe,C(r)?(i._context=i,i._tapNext=r):r&&(i._context=r,i._tapNext=r.next||fe,i._tapError=r.error||fe,i._tapComplete=r.complete||fe),i}return A(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(B);function _e(){return se(1)}function Ee(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _e()(dt.apply(void 0,t))}function Oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return lt(r)?(t.pop(),function(e){return Ee(t,e,r)}):function(e){return Ee(t,e)}}var je=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new xe(t))},t}(),xe=function(t){function e(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return A(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(B);function Re(){return function(t){return t.lift(new Pe(t))}}var Pe=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new Te(t,r),o=e.subscribe(n);return n.closed||(n.connection=r.connect()),o},t}(),Te=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return A(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(B),ke=function(t){function e(e,r){var n=t.call(this)||this;return n.source=e,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return A(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new F).add(this.source.subscribe(new Ce(this.getSubject(),this))),t.closed&&(this._connection=null,t=F.EMPTY)),t},e.prototype.refCount=function(){return Re()(this)},e}(K),Ae=function(){var t=ke.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Ce=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return A(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(et);var Ie=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),o=r(n).subscribe(t);return o.add(e.subscribe(n)),o},t}();function Ne(){return new rt}function Le(){return function(t){return Re()((e=Ne,function(t){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof r)return t.lift(new Ie(n,r));var o=Object.create(t,Ae);return o.source=t,o.subjectFactory=n,o})(t));var e,r}}function De(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function qe(t,e){return function(r){return[de(t,e)(r),de(De(t,e))(r)]}}function Ue(t,e){return"function"==typeof e?function(r){return r.pipe(Ue((function(r,n){return oe(t(r,n)).pipe(Xt((function(t,o){return e(r,t,n,o)})))})))}:function(e){return e.lift(new Me(t))}}var Me=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new He(t,this.project))},t}(),He=function(t){function e(e,r){var n=t.call(this,e)||this;return n.project=r,n.index=0,n}return A(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=this.innerSubscription;n&&n.unsubscribe();var o=new zt(this,e,r),i=this.destination;i.add(o),this.innerSubscription=te(this,t,void 0,void 0,o),this.innerSubscription!==o&&i.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e}(ee);function Ve(t){return function(e){return e.lift(new Fe(t))}}var Fe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new $e(t,this.value))},t}(),$e=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return A(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(B);var Xe=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Ye(t,this.compare,this.keySelector))},t}(),Ye=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.keySelector=n,o.hasKey=!1,"function"==typeof r&&(o.compare=r),o}return A(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))},e}(B);var Be=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.observables,this.project))},t}(),We=function(t){function e(e,r,n){var o=t.call(this,e)||this;o.observables=r,o.project=n,o.toRespond=[];var i=r.length;o.values=new Array(i);for(var u=0;u<i;u++)o.toRespond.push(u);for(u=0;u<i;u++){var c=r[u];o.add(te(o,c,c,u))}return o}return A(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.values[r]=e;var i=this.toRespond;if(i.length>0){var u=i.indexOf(r);-1!==u&&i.splice(u,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(ee);function ze(t){return function(e){var r=new Ge(t),n=e.lift(r);return r.caught=n}}var Ge=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Je(t,this.selector,this.caught))},t}(),Je=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.selector=r,o.caught=n,o}return A(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var n=new zt(this,void 0,void 0);this.add(n);var o=te(this,r,void 0,void 0,n);o!==n&&this.add(o)}},e}(ee);function Ke(t){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ze(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ze(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rr(t,e){return(rr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ir(t);if(e){var o=ir(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return or(this,r)}}function or(t,e){return!e||"object"!==Ke(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ir(t){return(ir=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ur=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rr(t,e)}(i,t);var e,r,n,o=nr(i);function i(){return tr(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"histId",value:function(){return this.el.id||this.constructor.componentName}},{key:"shouldLoadAnchor",value:function(t,e){return t&&""===t.target&&(!e||-1!==t.href.search(e))}},{key:"isPushEvent",value:function(t){var e=t.url,r=t.anchor,n=t.event,o=n.metaKey,i=n.ctrlKey;return!o&&!i&&this.shouldLoadAnchor(r,this.hrefRegex)&&!Vt(e,this)}},{key:"isHintEvent",value:function(t){var e=t.url,r=t.anchor;return this.shouldLoadAnchor(r,this.hrefRegex)&&!Vt(e,this)&&!function(t){var e=t.hash,r=t.origin,n=t.pathname,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;return""!==e&&r===o.origin&&n===o.pathname}(e,this)}},{key:"isHashChange",value:function(t){var e=Qe(t,2),r=e[0].url.pathname,n=e[1],o=n.url,i=o.pathname,u=o.hash,c=n.type;return i===r&&("pop"===c||c===$t&&""!==u)}}])&&er(e.prototype,r),n&&er(e,n),i}(t)};function cr(t){return(cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ar(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=hr(t);if(e){var o=hr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return pr(this,r)}}function pr(t,e){return!e||"object"!==cr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function hr(t){return(hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yr=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(i,t);var e,r,n,o=lr(i);function i(){return sr(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"assignScrollPosition",value:function(t){var e,r,n,o,i,u,c=this.histId();return Object.assign(t,(e={},r=c,n=Object.assign(t[c]||{},{scrollTop:Ft(),scrollHeight:(o=document.documentElement,i=document.body,u="scrollHeight",o[u]||i[u])}),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e))}},{key:"manageScrollPostion",value:function(t){var e=t.type,r=t.url.hash;switch(e){case $t:this.scrollHashIntoView(r,{behavior:"smooth",block:"start",inline:"nearest"});break;case"pop":this.restoreScrollPostion();break;case INIT:}}},{key:"scrollHashIntoView",value:function(t,e){if(t){var r=document.getElementById(decodeURIComponent(t.substr(1)));r&&r.scrollIntoView(e)}else window.scroll(window.pageXOffset,0)}},{key:"restoreScrollPostion",value:function(){var t=this.histId(),e=window.history.state&&window.history.state[t]||{},r=e.scrollTop;e.scrollHeight,null!=r&&window.scroll(window.pageXOffset,r)}},{key:"restoreScrollPostionOnReload",value:function(){0!=Ft()||this.restoreScrollPostion()}}])&&ar(e.prototype,r),n&&ar(e,n),i}(t)};function br(t){return(br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_r(t);if(e){var o=_r(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sr(this,r)}}function Sr(t,e){return!e||"object"!==br(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _r(t){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Er=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wr(t,e)}(i,t);var e,r,n,o=gr(i);function i(){return vr(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"updateHistoryState",value:function(t){var e=t.type,r=t.replace,n=t.url.href;if(!Vt(this))switch(e){case"init":case $t:var o=this.histId(),i=r||n===window.location.href?"replaceState":"pushState",u=Object.assign(window.history.state||{},dr({},o,{}));window.history[i](u,document.title,n)}}},{key:"updateHistoryStateHash",value:function(t){var e=t.type,r=t.url;if(!Vt(this)&&e===$t){var n=this.histId();window.history.pushState(dr({},n,{}),document.title,r)}}},{key:"updateHistoryTitle",value:function(t){var e=t.type,r=t.title;document.title=r,Vt(this)||e!==$t||window.history.replaceState(window.history.state,r,window.location)}},{key:"saveScrollPosition",value:function(){if(!Vt(this)){var t=this.assignScrollPosition(window.history.state||{});window.history.replaceState(t,document.title,window.location)}}}])&&mr(e.prototype,r),n&&mr(e,n),i}(yr(t))};var Or=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new jr(t,this.resultSelector))},t}(),jr=function(t){function e(e,r,n){void 0===n&&(n=Object.create(null));var o=t.call(this,e)||this;return o.iterators=[],o.active=0,o.resultSelector="function"==typeof r?r:null,o.values=n,o}return A(e,t),e.prototype._next=function(t){var e=this.iterators;q(t)?e.push(new Rr(t)):"function"==typeof t[Jt]?e.push(new xr(t[Jt]())):e.push(new Pr(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe(n,r));else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++){if("function"==typeof(u=t[n]).hasValue&&!u.hasValue())return}var o=!1,i=[];for(n=0;n<e;n++){var u,c=(u=t[n]).next();if(u.hasCompleted()&&(o=!0),c.done)return void r.complete();i.push(c.value)}this.resultSelector?this._tryresultSelector(i):r.next(i),o&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(B),xr=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}(),Rr=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Jt]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Pr=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.parent=r,o.observable=n,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return A(e,t),e.prototype[Jt]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,o){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return te(this,this.observable,this,e)},e}(ee),Tr=r(0);function kr(t,e){return void 0===e&&(e=null),new qr({method:"GET",url:t,headers:e})}function Ar(t,e,r){return new qr({method:"POST",url:t,body:e,headers:r})}function Cr(t,e){return new qr({method:"DELETE",url:t,headers:e})}function Ir(t,e,r){return new qr({method:"PUT",url:t,body:e,headers:r})}function Nr(t,e,r){return new qr({method:"PATCH",url:t,body:e,headers:r})}var Lr=Xt((function(t,e){return t.response}));function Dr(t,e){return Lr(new qr({method:"GET",url:t,responseType:"json",headers:e}))}var qr=function(t){function e(e){var r=t.call(this)||this,n={async:!0,createXHR:function(){return this.crossDomain?function(){if(Tr.a.XMLHttpRequest)return new Tr.a.XMLHttpRequest;if(Tr.a.XDomainRequest)return new Tr.a.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(Tr.a.XMLHttpRequest)return new Tr.a.XMLHttpRequest;var t=void 0;try{for(var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(t=e[r],new Tr.a.ActiveXObject(t))break}catch(t){}return new Tr.a.ActiveXObject(t)}catch(t){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof e)n.url=e;else for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);return r.request=n,r}var r;return A(e,t),e.prototype._subscribe=function(t){return new Ur(t,this.request)},e.create=((r=function(t){return new e(t)}).get=kr,r.post=Ar,r.delete=Cr,r.put=Ir,r.patch=Nr,r.getJSON=Dr,r),e}(K),Ur=function(t){function e(e,r){var n=t.call(this,e)||this;n.request=r,n.done=!1;var o=r.headers=r.headers||{};return r.crossDomain||n.getHeader(o,"X-Requested-With")||(o["X-Requested-With"]="XMLHttpRequest"),n.getHeader(o,"Content-Type")||Tr.a.FormData&&r.body instanceof Tr.a.FormData||void 0===r.body||(o["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),r.body=n.serializeBody(r.body,n.getHeader(r.headers,"Content-Type")),n.send(),n}return A(e,t),e.prototype.next=function(t){this.done=!0;var e,r=this.xhr,n=this.request,o=this.destination;try{e=new Mr(t,r,n)}catch(t){return o.error(t)}o.next(e)},e.prototype.send=function(){var t=this.request,e=this.request,r=e.user,n=e.method,o=e.url,i=e.async,u=e.password,c=e.headers,s=e.body;try{var a=this.xhr=t.createXHR();this.setupEvents(a,t),r?a.open(n,o,i,r,u):a.open(n,o,i),i&&(a.timeout=t.timeout,a.responseType=t.responseType),"withCredentials"in a&&(a.withCredentials=!!t.withCredentials),this.setHeaders(a,c),s?a.send(s):a.send()}catch(t){this.error(t)}},e.prototype.serializeBody=function(t,e){if(!t||"string"==typeof t)return t;if(Tr.a.FormData&&t instanceof Tr.a.FormData)return t;if(e){var r=e.indexOf(";");-1!==r&&(e=e.substring(0,r))}switch(e){case"application/x-www-form-urlencoded":return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");case"application/json":return JSON.stringify(t);default:return t}},e.prototype.setHeaders=function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setRequestHeader(r,e[r])},e.prototype.getHeader=function(t,e){for(var r in t)if(r.toLowerCase()===e.toLowerCase())return t[r]},e.prototype.setupEvents=function(t,e){var r=e.progressSubscriber;function n(t){var e,r=n,o=r.subscriber,i=r.progressSubscriber,u=r.request;i&&i.error(t);try{e=new Fr(this,u)}catch(t){e=t}o.error(e)}if(t.ontimeout=n,n.request=e,n.subscriber=this,n.progressSubscriber=r,t.upload&&"withCredentials"in t){var o,i;if(r)o=function(t){o.progressSubscriber.next(t)},Tr.a.XDomainRequest?t.onprogress=o:t.upload.onprogress=o,o.progressSubscriber=r;i=function(t){var e,r=i,n=r.progressSubscriber,o=r.subscriber,u=r.request;n&&n.error(t);try{e=new Hr("ajax error",this,u)}catch(t){e=t}o.error(e)},t.onerror=i,i.request=e,i.subscriber=this,i.progressSubscriber=r}function u(t){}function c(t){var e=c,r=e.subscriber,n=e.progressSubscriber,o=e.request;if(4===this.readyState){var i=1223===this.status?204:this.status,u="text"===this.responseType?this.response||this.responseText:this.response;if(0===i&&(i=u?200:0),i<400)n&&n.complete(),r.next(t),r.complete();else{n&&n.error(t);var s=void 0;try{s=new Hr("ajax error "+i,this,o)}catch(t){s=t}r.error(s)}}}t.onreadystatechange=u,u.subscriber=this,u.progressSubscriber=r,u.request=e,t.onload=c,c.subscriber=this,c.progressSubscriber=r,c.request=e},e.prototype.unsubscribe=function(){var e=this.done,r=this.xhr;!e&&r&&4!==r.readyState&&"function"==typeof r.abort&&r.abort(),t.prototype.unsubscribe.call(this)},e}(B),Mr=function(){return function(t,e,r){this.originalEvent=t,this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Vr(this.responseType,e)}}(),Hr=function(){function t(t,e,r){return Error.call(this),this.message=t,this.name="AjaxError",this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Vr(this.responseType,e),this}return t.prototype=Object.create(Error.prototype),t}();function Vr(t,e){switch(t){case"json":return function(t){return"response"in t?t.responseType?t.response:JSON.parse(t.response||t.responseText||"null"):JSON.parse(t.responseText||"null")}(e);case"xml":return e.responseXML;case"text":default:return"response"in e?e.response:e.responseText}}var Fr=function(t,e){return Hr.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this},$r=function(){return qr.create}(),Xr=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}();var Yr=function(){function t(t){if(this.total=t,this.total<0)throw new Xr}return t.prototype.call=function(t,e){return e.subscribe(new Br(t,this.total))},t}(),Br=function(t){function e(e,r){var n=t.call(this,e)||this;return n.total=r,n.count=0,n}return A(e,t),e.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},e}(B);function Wr(t){return(Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Gr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gr(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Qr(t,e){return(Qr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=en(t);if(e){var o=en(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(t,e){return!e||"object"!==Wr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qr(t,e)}(i,t);var e,r,n,o=Zr(i);function i(){return Jr(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"makeRequest",value:function(t){var e=this;return $r({method:"GET",responseType:"text",url:t.url,crossDomain:Vt(this),headers:{Accept:"text/html"}}).pipe(Xt((function(e){var r=e.response;return Object.assign(t,{response:r})})),ze((function(r){return e.recoverIfResponse(t,r)})))}},{key:"recoverIfResponse",value:function(t,e){var r=e.status,n=e.xhr;return n&&n.response&&r>400&&r<598?dt(Object.assign(t,{response:n.response})):dt(Object.assign(t,{error:e}))}},{key:"getFetch$",value:function(t,e,r){var n;return t.url.href===e.url.href&&null==e.error?dt(e):r.pipe((n=1,function(t){return 0===n?ft():t.lift(new Yr(n))}))}},{key:"getResponse",value:function(t,e){var r=zr(e,2),n=r[0],o=r[1];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),bt(t,void 0).lift(new Or(r))}(this.getFetch$(n,o,t).pipe(Xt((function(t){return Object.assign(t,n)}))),this.animPromise,(function(t){return t}))}}])&&Kr(e.prototype,r),n&&Kr(e,n),i}(t)};function nn(t){return(nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function on(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return un(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return un(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function an(t,e){return(an=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pn(t);if(e){var o=pn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ln(this,r)}}function ln(t,e){return!e||"object"!==nn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pn(t){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&an(t,e)}(i,t);var e,r,n,o=fn(i);function i(){return cn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"tempRemoveScriptTags",value:function(t){var e=this,r=[];return t.forEach((function(t){return Array.from(t.querySelectorAll(e.scriptSelector)).forEach((function(t){var e=[t,t.previousSibling];t.parentNode.removeChild(t),r.push(e)}))})),r}},{key:"insertScript",value:function(t){var e=on(t,2),r=e[0],n=e[1],o=document.write;return document.write=function(){for(var t=document.createElement("div"),e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t.innerHTML=r.join(),Array.from(t.childNodes).forEach((function(t){n.parentNode.insertBefore(t,n.nextSibling)}))},""!==r.src?K.create((function(t){r.addEventListener("load",(function(e){document.write=o,t.complete(e)})),r.addEventListener("error",(function(e){document.write=o,t.error(e)})),n.parentNode.insertBefore(r,n.nextSibling)})):dt({}).pipe(we((function(){n.parentNode.insertBefore(r,n.nextSibling),document.write=o})))}},{key:"reinsertScriptTags",value:function(t){return this.scriptSelector?oe(t.scripts).pipe((e=this.insertScript.bind(this),ie(e,r,1)),ze((function(e){throw Object.assign(t,{error:e})}))).toPromise().then((function(){return t})):dt(t);var e,r}}])&&sn(e.prototype,r),n&&sn(e,n),i}(t)};function yn(t){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return dn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wn(t,e){return(wn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_n(t);if(e){var o=_n(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sn(this,r)}}function Sn(t,e){return!e||"object"!==yn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _n(t){return(_n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var En=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wn(t,e)}(i,t);var e,r,n,o=gn(i);function i(){return vn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getTitle",value:function(t){return(t.querySelector("title")||{}).textContent}},{key:"getReplaceElements",value:function(t){if(this.replaceIds.length>0)return this.replaceIds.map((function(e){return t.getElementById(e)}));if(this.el.id)return[t.getElementById(this.el.id)];var e=Array.from(document.getElementsByTagName(this.el.tagName)).indexOf(this.el);return[t.querySelectorAll(this.el.tagName)[e]]}},{key:"responseToContent",value:function(t){var e,r=t.response,n=(e=r,document.createRange().createContextualFragment(e)),o=this.getTitle(n),i=this.getReplaceElements(n);if(i.some((function(t){return null==t})))throw Object.assign(t,{replaceElMissing:!0});var u=this.scriptSelector?this.tempRemoveScriptTags(i):[];return Object.assign(t,{documentFragment:n,title:o,replaceEls:i,scripts:u})}},{key:"replaceContentByIds",value:function(t){this.replaceIds.map((function(t){return document.getElementById(t)})).forEach((function(e,r){return e.parentNode.replaceChild(t[r],e)}))}},{key:"replaceContentWholesale",value:function(t){var e=bn(t,1)[0];this.el.innerHTML=e.innerHTML}},{key:"replaceContent",value:function(t){this.replaceIds.length>0?this.replaceContentByIds(t):this.replaceContentWholesale(t)}},{key:"updateDOM",value:function(t){try{var e=t.replaceEls;this.updateHistoryTitle(t),Vt(this)&&this.rewriteURLs(e),this.replaceContent(e)}catch(e){throw Object.assign(t,{error:e})}}},{key:"rewriteURLs",value:function(t){var e=this;t.forEach((function(t){t.querySelectorAll("[href]").forEach(e.rewriteURL("href")),t.querySelectorAll("[src]").forEach(e.rewriteURL("src")),t.querySelectorAll("img[srcset]").forEach(e.rewriteURLSrcSet("srcset")),t.querySelectorAll("blockquote[cite]").forEach(e.rewriteURL("cite")),t.querySelectorAll("del[cite]").forEach(e.rewriteURL("cite")),t.querySelectorAll("ins[cite]").forEach(e.rewriteURL("cite")),t.querySelectorAll("q[cite]").forEach(e.rewriteURL("cite")),t.querySelectorAll("img[longdesc]").forEach(e.rewriteURL("longdesc")),t.querySelectorAll("frame[longdesc]").forEach(e.rewriteURL("longdesc")),t.querySelectorAll("iframe[longdesc]").forEach(e.rewriteURL("longdesc")),t.querySelectorAll("img[usemap]").forEach(e.rewriteURL("usemap")),t.querySelectorAll("input[usemap]").forEach(e.rewriteURL("usemap")),t.querySelectorAll("object[usemap]").forEach(e.rewriteURL("usemap")),t.querySelectorAll("form[action]").forEach(e.rewriteURL("action")),t.querySelectorAll("button[formaction]").forEach(e.rewriteURL("formaction")),t.querySelectorAll("input[formaction]").forEach(e.rewriteURL("formaction")),t.querySelectorAll("video[poster]").forEach(e.rewriteURL("poster")),t.querySelectorAll("object[data]").forEach(e.rewriteURL("data")),t.querySelectorAll("object[codebase]").forEach(e.rewriteURL("codebase")),t.querySelectorAll("object[archive]").forEach(e.rewriteURLList("archive"))}))}},{key:"rewriteURL",value:function(t){var e=this;return function(r){try{r.setAttribute(t,new URL(r.getAttribute(t),e.href).href)}catch(t){}}}},{key:"rewriteURLSrcSet",value:function(t){var e=this;return function(r){try{r.setAttribute(t,r.getAttribute(t).split(/\s*,\s*/).map((function(t){var r=t.split(/\s+/);return r[0]=new URL(r[0],e.href).href,r.join(" ")})).join(", "))}catch(t){}}}},{key:"rewriteURLList",value:function(t){var e=this;return function(r){try{r.setAttribute(t,r.getAttribute(t).split(/[\s,]+/).map((function(t){return new URL(t,e.href).href})).join(", "))}catch(t){}}}}])&&mn(e.prototype,r),n&&mn(e,n),i}(hn(t))},On=new ct(ot);function jn(t){return!q(t)&&t-parseFloat(t)+1>=0}function xn(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}}function Rn(t){return(Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function kn(t,e){return(kn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function An(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=In(t);if(e){var o=In(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cn(this,r)}}function Cn(t,e){return!e||"object"!==Rn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function In(t){return(In=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kn(t,e)}(i,t);var e,r,n,o=An(i);function i(){return Pn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"onStart",value:function(t){var e=this;this.animPromise=function(t,e,r){void 0===t&&(t=0);var n=-1;return jn(e)?n=Number(e)<1?1:Number(e):lt(e)&&(r=e),lt(r)||(r=On),new K((function(e){var o=jn(t)?t:+t-r.now();return r.schedule(xn,o,{index:0,period:n,subscriber:e})}))}(this.duration),this.fireEvent("start",{detail:Object.assign(t,{transitionUntil:function(t){e.animPromise=t}})})}},{key:"onDOMError",value:function(t){var e=t.replaceElMissing,r=t.url;e?(window.history.back(),setTimeout((function(){document.location.href=r}),100)):this.fireEvent("error",{detail:t})}},{key:"onNetworkError",value:function(t){this.fireEvent("networkerror",{detail:t})}},{key:"onError",value:function(t){this.fireEvent("error",{detail:t})}},{key:"onReady",value:function(t){this.fireEvent("ready",{detail:t})}},{key:"onAfter",value:function(t){this.fireEvent("after",{detail:t})}},{key:"onProgress",value:function(t){this.fireEvent("progress",{detail:t})}},{key:"onLoad",value:function(t){this.fireEvent("load",{detail:t})}}])&&Tn(e.prototype,r),n&&Tn(e,n),i}(t)};function Ln(t){return(Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Un(t,e){return(Un=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vn(t);if(e){var o=Vn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hn(this,r)}}function Hn(t,e){return!e||"object"!==Ln(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vn(t){return(Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Un(t,e)}(i,t);var e,r,n,o=Mn(i);function i(){return Dn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"setupEventListeners",value:function(){var t,e=this;if("MutationObserver"in window&&"WeakSet"in window){var r=new WeakSet,n=this.pushSubject.next.bind(this.pushSubject),o=this.hintSubject.next.bind(this.hintSubject),i=function(t){r.has(t)||(r.add(t),t.addEventListener("click",n),t.addEventListener("mouseenter",o,{passive:!0}),t.addEventListener("touchstart",o,{passive:!0}),t.addEventListener("focus",o,{passive:!0}))},u=function(t){t instanceof Element&&(Mt.call(t,e.linkSelector)?i(t):Array.from(t.querySelectorAll(e.linkSelector)).forEach(i))},c=function(t){r.delete(t),t.removeEventListener("click",n),t.removeEventListener("mouseenter",o,{passive:!0}),t.removeEventListener("touchstart",o,{passive:!0}),t.removeEventListener("focus",o,{passive:!0})},s=function(t){t instanceof Element&&(Mt.call(t,e.linkSelector)?c(t):Array.from(t.querySelectorAll(e.linkSelector)).forEach(c))};(t=MutationObserver,function(e,r,n){return K.create((function(o){var i=o.next.bind(o),u=new t((function(t){return Array.from(t).forEach(i)}),r);return u.observe(e,n),function(){u.unobserve(e)}}))})(this.el,{},{childList:!0,subtree:!0}).subscribe((function(t){var r=t.addedNodes,n=t.removedNodes;Array.from(n).forEach(s.bind(e)),Array.from(r).forEach(u.bind(e))})),this.subjects.linkSelector.subscribe((function(){Array.from(r).forEach(c),u.call(e,e.el)}))}else this.el.addEventListener("click",(function(t){var r=Ht.call(t.target,e.linkSelector);r&&r.href&&(t.currentTarget=r,pushSubject.next(t))}))}}])&&qn(e.prototype,r),n&&qn(e,n),i}(t)};function $n(t){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Yn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zn(t,e){return(zn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Kn(t);if(e){var o=Kn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jn(this,r)}}function Jn(t,e){return!e||"object"!==$n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Kn(t){return(Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zn(t,e)}(i,t);var e,r,n,o=Gn(i);function i(){return Bn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"compareContext",value:function(t,e){return t.url.href===e.url.href&&t.error===e.error&&t.cacheNr===e.cacheNr}},{key:"setupObservables",value:function(){var t=this;this.cacheNr=1,this.pushSubject=new rt,this.hintSubject=new rt;var e,r,n=ae(this.pushSubject.pipe(he(this.subjects.disconnect),Xt((function(e){return{type:$t,url:new qt(e.currentTarget.href,t.href),anchor:e.currentTarget,event:e,cacheNr:t.cacheNr}})),de(this.isPushEvent.bind(this)),we((function(e){e.event.preventDefault(),t.saveScrollPosition()}))),Wt(window,"popstate").pipe(he(this.subjects.disconnect),de((function(){return window.history.state&&window.history.state[t.histId()]})),Xt((function(e){return{type:"pop",url:new qt(window.location,t.href),event:e,cacheNr:t.cacheNr}}))),this.reload$.pipe(he(this.subjects.disconnect))).pipe(Oe({url:new qt(this.initialHref)}),we((function(e){var r=e.url;return t._url=r})),(function(t){return t.lift(new je)}),Le(),qe(this.isHashChange)).map((function(t){return t.pipe(Xt((function(t){return Xn(t,2)[1]})),Le())})),o=Xn(n,2),i=o[0],u=o[1],c=this.subjects.prefetch.pipe(Ue((function(e){if(!e)return le;var r=pe((function(){return ae(u.pipe(Ve(!0)),t.fetch$.pipe(Ve(!1)))})).pipe(Oe(!1),Le());return t.hintSubject.pipe(he(t.subjects.disconnect),function(t){return function(e){return t.pipe(Ue((function(t){return t?le:e})))}}(r),Xt((function(e){return{type:"hint",url:new qt(e.currentTarget.href,t.href),anchor:e.currentTarget,event:e,cacheNr:t.cacheNr}})),de(t.isHintEvent.bind(t)))}))),s=ae(c,u).pipe((e=this.compareContext.bind(this),function(t){return t.lift(new Xe(e,r))}),Ue(this.makeRequest.bind(this)),Oe({url:{}}),Le());this.fetch$=u.pipe(we((function(e){t.updateHistoryState(e),t.onStart(e)})),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var n=t;return e.lift(new Be(n,r))}}(s),Ue(this.getResponse.bind(this,s)),Le());var a=Xn(this.fetch$.pipe(qe((function(t){return!t.error}))),2),f=a[0],l=a[1];f.pipe(Xt(this.responseToContent.bind(this)),we((function(e){t.onReady(e),t.updateDOM(e),t.onAfter(e),t.manageScrollPostion(e)})),we({error:function(e){return t.onDOMError(e)}}),ze((function(t,e){return e})),Ue(this.reinsertScriptTags.bind(this)),we({error:function(e){return t.onError(e)}}),ze((function(t,e){return e}))).subscribe(this.onLoad.bind(this)),i.subscribe((function(e){t.updateHistoryStateHash(e),t.manageScrollPostion(e)})),l.subscribe(this.onNetworkError.bind(this)),u.pipe(Ue((function(e){return pe((function(){return t.animPromise})).pipe(he(t.fetch$),Ve(e))}))).subscribe(this.onProgress.bind(this)),this.setupEventListeners()}}])&&Wn(e.prototype,r),n&&Wn(e,n),i}(Fn(Nn(En(rn(Er(ur(t)))))))};function Zn(t){return(Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function to(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ro(t,e,r){return(ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=uo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function no(t,e){return(no=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function oo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=uo(t);if(e){var o=uo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return io(this,r)}}function io(t,e){return!e||"object"!==Zn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function uo(t){return(uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function co(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var so,ao=new i([].concat(function(t){if(Array.isArray(t))return co(t)}(so=j)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(so)||function(t,e){if(t){if("string"==typeof t)return co(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?co(t,e):void 0}}(so)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["documentfragment","eventlistener","history","promises","queryselector","requestanimationframe"]));DocumentFragment.prototype.getElementById=DocumentFragment.prototype.getElementById||function(t){return this.querySelector("#".concat(t))};function fo(t){return(fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function po(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ho(t,e){return(ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=vo(t);if(e){var o=vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bo(this,r)}}function bo(t,e){return!e||"object"!==fo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function vo(t){return(vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var wo=new i(function(t){return function(t){if(Array.isArray(t))return mo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mo(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(ao));wo.delete("customevent"),function(t,e){var r=t.toLowerCase(),n=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(n,t);var e=p(n);function n(){return s(this,n),e.apply(this,arguments)}return function(t,e,r){e&&a(t.prototype,e),r&&a(t,r)}(n,[{key:"setupShadowDOM",value:function(t){return this.$element=f(y(n.prototype),"setupShadowDOM",this).call(this,o()(t)),this.$element[0]}},{key:"fireEvent",value:function(t,e){var n=o.a.Event("".concat(t,".").concat(r),e);this.$element.trigger(n)}}]),n}(e),i=r.split(".").pop(),h=o.a.fn[i];o.a.fn[i]=function(t,i){for(var s=arguments.length,a=new Array(s>2?s-2:0),f=2;f<s;f++)a[f-2]=arguments[f];var l="string"==typeof t?t:null;return this.each((function(){var s=o()(this),f=s.data(r);if(f)l&&"function"==typeof f[l]?f[l].apply(f,[i].concat(a)):"object"===c(t)&&t&&o.a.extend(f,t);else{var p=e.defaults,h=e.types,y=s.data();Object.keys(p).forEach((function(t){if(y[t]){var r=u(h[t],y[t]);y[t]=null!=r?r:e.defaults[t]}}));var b=o.a.extend({},y,"object"===c(t)&&t);s.data(r,new n(this,b))}}))},o.a.fn[i].Constructor=n,o.a.fn[i].noConflict=function(){return o.a.fn[i]=h,this}}("hy.pushstate",function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ho(t,e)}(i,t);var e,r,n,o=yo(i);function i(){return lo(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"setupShadowDOM",value:function(t){return t}}])&&po(e.prototype,r),n&&po(e,n),i}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&no(t,e)}(i,t);var e,r,n,o=oo(i);function i(){return to(this,i),o.apply(this,arguments)}return e=i,n=[{key:"componentName",get:function(){return"hy-push-state"}},{key:"types",get:function(){return{replaceIds:Ct,linkSelector:Dt,duration:Nt,hrefRegex:Lt,scriptSelector:Dt,initialHref:Dt,prefetch:It}}},{key:"defaults",get:function(){return{replaceIds:[],linkSelector:"a[href]:not(.no-push-state)",duration:0,hrefRegex:null,scriptSelector:null,initialHref:window.location.href,prefetch:!1}}}],(r=[{key:"setupComponent",value:function(t,e){ro(uo(i.prototype),"setupComponent",this).call(this,t,e),this.saveScrollPosition=this.saveScrollPosition.bind(this),this.reload$=new rt}},{key:"setupShadowDOM",value:function(t){return t}},{key:"connectComponent",value:function(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual"),this.restoreScrollPostionOnReload(),window.addEventListener("beforeunload",this.saveScrollPosition),this.setupObservables(),ro(uo(i.prototype),"connectComponent",this).call(this);var t=new qt(this.initialHref);this.updateHistoryState({type:"init",replace:!0,url:t});var e=this.getReplaceElements(document);Vt(this)&&this.rewriteURLs(e),this.fireEvent("init"),this.onLoad({type:"init",title:this.getTitle(document),replaceEls:e,url:t,cacheNr:this.cacheNr})}},{key:"disconnectComponent",value:function(){ro(uo(i.prototype),"disconnectComponent",this).call(this),window.removeEventListener("beforeunload",this.saveScrollPosition)}},{key:"assign",value:function(t){this.reload$.next({type:$t,url:new qt(t,this.href),cacheNr:++this.cacheNr})}},{key:"reload",value:function(){this.reload$.next({type:$t,url:new qt(this.href),cacheNr:++this.cacheNr,replace:!0})}},{key:"replace",value:function(t){this.reload$.next({type:$t,url:new qt(t,this.href),cacheNr:++this.cacheNr,replace:!0})}},{key:"hash",get:function(){return this._url.hash}},{key:"host",get:function(){return this._url.host}},{key:"hostname",get:function(){return this._url.hostname}},{key:"href",get:function(){return this._url.href}},{key:"origin",get:function(){return this._url.origin}},{key:"pathname",get:function(){return this._url.pathname}},{key:"port",get:function(){return this._url.port}},{key:"protocol",get:function(){return this._url.protocol}},{key:"search",get:function(){return this._url.search}}])&&eo(e.prototype,r),n&&eo(e,n),i}(Qn(At(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return function(t){w(r,t);var e=S(r);function r(){return O(this,r),e.apply(this,arguments)}return m(r,[{key:"setupComponent",value:function(t,e){var r=this.constructor.defaults;this[P]=Object.assign({},r,e),this.setupProperties(this),this[R]=this.setupShadowDOM(t)}},{key:"setupShadowDOM",value:function(t){return t}},{key:"connectComponent",value:function(){}},{key:"disconnectComponent",value:function(){}},{key:"adoptComponent",value:function(){}},{key:"getRoot",value:function(){return this[R]}},{key:"getEl",value:function(){return this[R]}},{key:"fireEvent",value:function(t,e){var r=this.constructor.componentName,n=new CustomEvent("".concat(r,"-").concat(t),e);this.el.dispatchEvent(n)}},{key:"setInternalState",value:function(t,e){this[P][t]=e}},{key:"setupProperties",value:function(){var t=this,e=this.constructor.sideEffects;Object.keys(this[P]).forEach((function(r){var n=e[r];t.setupProperty(r,n)}))}},{key:"setupProperty",value:function(t,e){var r=this;Object.defineProperty(this,t,{get:function(){return r[P][t]},set:function(n){var o=r[P][t];r.setInternalState(t,n),e&&e.call(r,n,o)},enumerable:!0,configurable:!0})}},{key:"sroot",get:function(){return this.getRoot()}},{key:"el",get:function(){return this.getEl()}}]),r}(t)}(b))))))}])}));
//# sourceMappingURL=index.js.map