/*!
 * 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():"function"==typeof define&&define.amd?define("hyDrawer",[],e):"object"==typeof exports?exports.hyDrawer=e():t.hyDrawer=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}({2:function(t,e,n){"use strict";n.r(e);var r="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,n){return n===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 n;return(n=t.has(e))&&(t.size--,t.splice(t.indexOf(e),1)),n},t.clear=function(){for(;t.pop(););t.size=0},t};var o=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setupComponent(e,n),this.connectComponent()},i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=function(t){return"[object HTMLCollection]"===Object.prototype.toString.call(t)},s=function(t){return"[object NodeList]"===Object.prototype.toString.call(t)},c=function(t,e){function n(t){"string"==typeof t?this.appendChild(e(t)):this.appendChild(t)}return function(r,o){var c=t(r);for(var a in o)c.setAttribute(a,o[a]);for(var l=arguments.length,f=new Array(l>2?l-2:0),p=2;p<l;p++)f[p-2]=arguments[p];var h,y=f[0];return i(y)||(h=u(y))||(h=s(y))?(h&&(y=Array.prototype.slice.call(y,0)),Array.prototype.forEach.call(y,n,c)):Array.prototype.forEach.call(f,function(t){"string"==typeof t?c.appendChild(e(t)):c.appendChild(t)}),c}},a=c(document.createElement.bind(document),document.createTextNode.bind(document));function l(t){return(l="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 f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}function h(t,e){return!e||"object"!==l(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)}function b(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&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var m=new r(["customevent"]),w=Symbol||function(t){return"_".concat(t)},_=w("sroot"),g=w("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 S=function t(){v(this,t)},E=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S;return function(e){function n(){return v(this,n),h(this,y(n).apply(this,arguments))}return b(n,t),p(n,[{key:"setupComponent",value:function(t,e){var n=this.constructor.defaults;this[g]=Object.assign({},n,e),this.setupProperties(this),this[_]=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[_]}},{key:"getEl",value:function(){return this[_]}},{key:"fireEvent",value:function(t,e){var n=this.constructor.componentName,r=new CustomEvent("".concat(n,"-").concat(t),e);this.el.dispatchEvent(r)}},{key:"setInternalState",value:function(t,e){this[g][t]=e}},{key:"setupProperties",value:function(){var t=this,e=this.constructor.sideEffects;Object.keys(this[g]).forEach(function(n){var r=e[n];t.setupProperty(n,r)})}},{key:"setupProperty",value:function(t,e){var n=this;Object.defineProperty(this,t,{get:function(){return n[g][t]},set:function(r){var o=n[g][t];n.setInternalState(t,r),e&&e.call(n,r,o)},enumerable:!0,configurable:!0})}},{key:"sroot",get:function(){return this.getRoot()}},{key:"el",get:function(){return this.getEl()}}]),n}()};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var O=function(t,e){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function j(t,e){function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function x(t){return"function"==typeof t}var T=!1,P={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;T=t},get useDeprecatedSynchronousErrorHandling(){return T}};function I(t){setTimeout(function(){throw t},0)}var C={closed:!0,next:function(t){},error:function(t){if(P.useDeprecatedSynchronousErrorHandling)throw t;I(t)},complete:function(){}},k=Array.isArray||function(t){return t&&"number"==typeof t.length};function A(t){return(A="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 N(t){return null!==t&&"object"===A(t)}function R(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}R.prototype=Object.create(Error.prototype);var M=R;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)}var V=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 n=this._parentOrParents,r=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var i=0;i<n.length;++i){n[i].remove(this)}if(x(r))try{r.call(this)}catch(t){e=t instanceof M?X(t.errors):[t]}if(k(o)){i=-1;for(var u=o.length;++i<u;){var s=o[i];if(N(s))try{s.unsubscribe()}catch(t){e=e||[],t instanceof M?e=e.concat(X(t.errors)):e.push(t)}}}if(e)throw new M(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(D(e)){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function X(t){return t.reduce(function(t,e){return t.concat(e instanceof M?e.errors:e)},[])}var Y="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();function F(t){return(F="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 $=function(t){function e(n,r,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=C;break;case 1:if(!n){i.destination=C;break}if("object"===F(n)){n instanceof e?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new L(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new L(i,n,r,o)}return i}return j(e,t),e.prototype[Y]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);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}(V),L=function(t){function e(e,n,r,o){var i,u=t.call(this)||this;u._parentSubscriber=e;var s=u;return x(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==C&&(x((s=Object.create(n)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=i,u._error=r,u._complete=o,u}return j(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;P.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,n=P.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):I(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;I(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};P.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),P.useDeprecatedSynchronousErrorHandling)throw t;I(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!P.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return P.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(I(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}($);var q="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(){}function z(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:H}var W=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(t instanceof $)return t;if(t[Y])return t[Y]()}return t||e||n?new $(t,e,n):new $(C)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||P.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),P.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){P.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&r instanceof $?r:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=B(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[q]=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:z(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=B(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function B(t){if(t||(t=P.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function U(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}U.prototype=Object.create(Error.prototype);var G=U,K=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return j(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 n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(V),J=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return j(e,t),e}($),Q=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 j(e,t),e.prototype[Y]=function(){return new J(this)},e.prototype.lift=function(t){var e=new Z(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new G;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new G;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new G;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].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 G;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new G;return this.hasError?(t.error(this.thrownError),V.EMPTY):this.isStopped?(t.complete(),V.EMPTY):(this.observers.push(t),new K(this,t))},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new Z(t,e)},e}(W),Z=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return j(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):V.EMPTY},e}(Q),tt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return j(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!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 n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return j(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(V)),et=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return j(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(tt),nt=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),rt=function(t){function e(n,r){void 0===r&&(r=nt.now);var o=t.call(this,n,function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return j(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(nt),ot=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e}(rt))(et),it=new W(function(t){return t.complete()});function ut(t){return t?function(t){return new W(function(e){return t.schedule(function(){return e.complete()})})}(t):it}function st(t){return t&&"function"==typeof t.schedule}var ct,at=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function lt(t,e){return new W(function(n){var r=new V,o=0;return r.add(e.schedule(function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()})),r})}function ft(t,e){return e?lt(t,e):new W(at(t))}function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return st(n)?(t.pop(),lt(t,n)):ft(t)}function ht(t){var e=t.error;t.subscriber.error(e)}ct||(ct={});var yt=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,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,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return pt(this.value);case"E":return t=this.error,new W(e?function(n){return e.schedule(ht,0,{error:t,subscriber:n})}:function(e){return e.error(t)});case"C":return ut()}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 bt=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new dt(t,this.scheduler,this.delay))},t}(),dt=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return j(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new vt(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(yt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(yt.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(yt.createComplete()),this.unsubscribe()},e}($),vt=function(){return function(t,e){this.notification=t,this.destination=e}}(),mt=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return j(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new wt(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new G;if(this.isStopped||this.hasError?e=V.EMPTY:(this.observers.push(t),e=new K(this,t)),o&&t.add(t=new dt(t,o)),n)for(var u=0;u<i&&!t.closed;u++)t.next(r[u]);else for(u=0;u<i&&!t.closed;u++)t.next(r[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||ot).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r},e}(Q),wt=function(){return function(t,e){this.time=t,this.value=e}}();function _t(t){return(_t="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 gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function St(t,e){return!e||"object"!==_t(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 Et(t,e,n){return(Et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ot(t){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jt(t,e){return(jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var xt=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),St(this,Ot(n).apply(this,arguments))}var r,o,i;return 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&&jt(t,e)}(n,t),r=n,(o=[{key:"setupComponent",value:function(t,e){var r=this,o={};this.subjects={},this.subjects.disconnect=new Q,this.subjects.document=new mt,Object.keys(this.constructor.types).map(function(t){r.subjects[t]=new mt(1),o[t]=function(e){return r.subjects[t].next(e)}}),Object.defineProperty(this.constructor,"sideEffects",{get:function(){return o},set:function(){},enumerable:!0,configurable:!0}),Et(Ot(n.prototype),"setupComponent",this).call(this,t,e)}},{key:"connectComponent",value:function(){var t=this;Et(Ot(n.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(){Et(Ot(n.prototype),"disconnectComponent",this).call(this),this.subjects.disconnect.next({})}},{key:"adaptComponent",value:function(){Et(Ot(n.prototype),"adaptComponent",this).call(this),this.subjects.document.next(document)}}])&&gt(r.prototype,o),i&&gt(r,i),n}()},Tt=function(t){return null==t?null:t.trim().replace(/^\[?(.*?)\]?$/,"$1").split(",").map(function(t){return t.trim()})||null};Tt.stringify=function(t){return t&&t.length>0?t.join(","):null};var Pt=function(t){var e=function(e){if(null==e)return null;var n=Tt(e).map(t);return n.reduce(function(t,e){return t&&null!==e},!0)?n:null};return e.stringify=function(e){var n=e&&e.map&&e.map(t.stringify);return n&&n.reduce(function(t,e){return t&&null!==e},!0)?Tt.stringify(n):null},e},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 Ct=function(t){return null==t?null:Number(t)};Ct.stringify=function(t){return null==t?null:"".concat(t)};var kt=function(t){var e=function(e){if(null==e)return null;var n=t.indexOf(e);return n>-1?t[n]:null};return e.stringify=function(e){return-1!==t.indexOf(e)?e:null},e},At=function(t){if(null==t)return null;var e=(t.trim&&t.trim()||t).match(/^\/?(.*?)(\/([gimy]*))?$/);return new RegExp(e[1],e[3])};At.stringify=function(t){return t&&t.toString()||null};var Nt=function(t){return t};Nt.stringify=function(t){return t};var Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}($),Mt=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return j(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}($);function Dt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Vt=Dt(),Xt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Yt(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Ft=function(t){if(t&&"function"==typeof t[q])return r=t,function(t){var e=r[q]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Xt(t))return at(t);if(Yt(t))return n=t,function(t){return n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,I),t};if(t&&"function"==typeof t[Vt])return e=t,function(t){for(var n=e[Vt]();;){var r=n.next();if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add(function(){n.return&&n.return()}),t};var e,n,r,o=N(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 $t(t,e,n,r,o){if(void 0===o&&(o=new Mt(t,n,r)),!o.closed)return e instanceof W?e.subscribe(o):Ft(e)(o)}var Lt={};function qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null,r=null;return st(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&k(t[0])&&(t=t[0]),ft(t,r).lift(new Ht(n))}var Ht=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new zt(t,this.resultSelector))},t}(),zt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return j(e,t),e.prototype._next=function(t){this.values.push(Lt),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add($t(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.values,u=i[n],s=this.toRespond?u===Lt?--this.toRespond:this.toRespond:0;i[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},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}(Rt);function Wt(t){return(Wt="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 Bt(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[q]}(t))return function(t,e){return new W(function(n){var r=new V;return r.add(e.schedule(function(){var o=t[q]();r.add(o.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}(t,e);if(Yt(t))return function(t,e){return new W(function(n){var r=new V;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r})}(t,e);if(Xt(t))return lt(t,e);if(function(t){return t&&"function"==typeof t[Vt]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new W(function(n){var r,o=new V;return o.add(function(){r&&"function"==typeof r.return&&r.return()}),o.add(e.schedule(function(){r=t[Vt](),o.add(e.schedule(function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}}))})),o})}(t,e)}throw new TypeError((null!==t&&Wt(t)||t)+" is not observable")}function Ut(t,e){return e?Bt(t,e):t instanceof W?t:new W(Ft(t))}function Gt(t){return new W(function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?Ut(n):ut()).subscribe(e)})}function Kt(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Jt(t,e))}}var Jt=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Qt(t,this.project,this.thisArg))},t}(),Qt=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return j(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}($);var Zt=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 te(t,this.project,this.concurrent))},t}(),te=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return j(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,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new Mt(this,void 0,void 0);this.destination.add(r),$t(this,t,e,n,r)},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,n,r,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}(Rt);function ee(t){return t}function ne(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function t(e,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(o){return o.pipe(t(function(t,r){return Ut(e(t,r)).pipe(Kt(function(e,o){return n(t,e,r,o)}))},r))}:("number"==typeof n&&(r=n),function(t){return t.lift(new Zt(e,r))})}(ee,t)}function re(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return st(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof W?t[0]:ne(n)(ft(t,r))}var oe=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return j(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(function(){return e.flush(null)})))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(tt),ie=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(rt))(oe);Object.prototype.toString;function ue(t,e,n,r){return x(n)&&(r=n,n=void 0),r?ue(t,e,n).pipe(Kt(function(t){return k(t)?r.apply(void 0,t):r(t)})):new W(function(r){!function t(e,n,r,o,i){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(n,r,i),u=function(){return s.removeEventListener(n,r,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var c=e;e.on(n,r),u=function(){return c.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var a=e;e.addListener(n,r),u=function(){return a.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,f=e.length;l<f;l++)t(e[l],n,r,o,i)}o.add(u)}(t,e,function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)},r,n)})}var se=new W(H);function ce(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ne(1)(pt.apply(void 0,t))}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return st(n)?(t.pop(),function(e){return ce(t,e,n)}):function(e){return ce(t,e)}}function le(t){return function(e){return e.lift(new fe(t))}}var fe=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new pe(t),r=$t(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),pe=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return j(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(Rt);function he(){return function(t){return t.lift(new ye(t))}}var ye=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new be(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),be=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return j(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 n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}($),de=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return j(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 V).add(this.source.subscribe(new me(this.getSubject(),this))),t.closed&&(this._connection=null,t=V.EMPTY)),t},e.prototype.refCount=function(){return he()(this)},e}(W).prototype,ve={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:de._subscribe},_isComplete:{value:de._isComplete,writable:!0},getSubject:{value:de.getSubject},connect:{value:de.connect},refCount:{value:de.refCount}},me=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return j(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}(J);var we=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();function _e(){return new Q}function ge(){return function(t){return he()((e=_e,function(t){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof n)return t.lift(new we(r,n));var o=Object.create(t,ve);return o.source=t,o.subjectFactory=r,o})(t));var e,n}}function Se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new Ee(r,n))}}var Ee=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Oe(t,this.observables,this.project))},t}(),Oe=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=new Array(i);for(var u=0;u<i;u++)o.toRespond.push(u);for(u=0;u<i;u++){var s=n[u];o.add($t(o,s,s,u))}return o}return j(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e;var i=this.toRespond;if(i.length>0){var u=i.indexOf(n);-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}(Rt);function je(t,e,n){return function(r){return r.lift(new xe(t,e,n))}}var xe=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.nextOrObserver,this.error,this.complete))},t}(),Te=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i._tapNext=H,i._tapError=H,i._tapComplete=H,i._tapError=r||H,i._tapComplete=o||H,x(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||H,i._tapError=n.error||H,i._tapComplete=n.complete||H),i}return j(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}($);var Pe=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Ie(t),r=e.subscribe(n);return r.add($t(n,this.notifier)),r},t}(),Ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return j(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Rt),Ce=new rt(tt);var ke=function(){return function(t,e){this.value=t,this.timestamp=e}}();var Ae=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ne(t))},t}(),Ne=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return j(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}($);function Re(t,e){return function(n){return n.lift(new Me(t,e))}}var Me=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new De(t,this.predicate,this.thisArg))},t}(),De=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return j(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}($);function Ve(t,e){return"function"==typeof e?function(n){return n.pipe(Ve(function(n,r){return Ut(t(n,r)).pipe(Kt(function(t,o){return e(n,t,r,o)}))}))}:function(e){return e.lift(new Xe(t))}}var Xe=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ye(t,this.project))},t}(),Ye=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return j(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var o=new Mt(this,void 0,void 0);this.destination.add(o),this.innerSubscription=$t(this,t,e,n,o)},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,n,r,o){this.destination.next(e)},e}(Rt);var Fe=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new $e(t,this.total))},t}(),$e=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return j(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}($);function Le(t,e,n,r,o){return W.create(function(i){var u,s=requestAnimationFrame(function c(a){var l=a-(u=u||a);l<r?(i.next(t(l,e,n,r,o)),s=requestAnimationFrame(c)):(i.next(t(r,e,n,r,o)),s=requestAnimationFrame(function(){return i.complete()}))});return function(){s&&cancelAnimationFrame(s)}})}function qe(t,e,n,r){return n*Math.sin(t/r*(Math.PI/2))+e}function He(t){return Be(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||We()}function ze(t,e){return Be(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||We()}function We(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Be(t){if(Array.isArray(t))return t}var Ue=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(e){return 0===n.length?e.pipe(Se(t),Re(function(t){return ze(t,2)[1]}),Kt(function(t){return ze(t,1)[0]})):e.pipe(Se.apply(void 0,[t].concat(n)),Re(function(t){return He(t).slice(1).every(function(t){return t})}),Kt(function(t){return ze(t,1)[0]}))}};function Ge(t){return(Ge="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 Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Je(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qe(t,e){return!e||"object"!==Ge(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 Ze(t){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function tn(t,e){return(tn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var en=Math.min.bind(Math),nn=Math.max.bind(Math),rn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Qe(this,Ze(n).apply(this,arguments))}var r,o,i;return 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&&tn(t,e)}(n,t),r=n,(o=[{key:"calcIsInRange",value:function(t,e){switch(this.align){case"left":var n=this.range[0],r=this.range[1];return t>n&&(e||t<r);case"right":var o=window.innerWidth-this.range[0],i=window.innerWidth-this.range[1];return t<o&&(e||t>i);default:throw Error()}}},{key:"calcIsSwipe",value:function(t){var e=Ke(t,4),n=e[0].clientX,r=e[1].clientX,o=e[2],i=e[3];return n!==r||o>0&&o<i}},{key:"calcWillOpen",value:function(t){var e=Ke(t,5),n=e[2],r=e[3],o=e[4];switch(this.align){case"left":return o>.15||!(o<-.15)&&n>=r/2;case"right":return-o>.15||!(-o<-.15)&&n<=-r/2;default:throw Error()}}},{key:"calcTranslateX",value:function(t,e,n,r){switch(this.align){case"left":return nn(0,en(r,n+(t-e)));case"right":return en(0,nn(-r,n+(t-e)));default:throw Error()}}}])&&Je(r.prototype,o),i&&Je(r,i),n}()};function on(t){return(on="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 un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function sn(t,e){return!e||"object"!==on(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 cn(t){return(cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function an(t,e){return(an=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ln="attributeStyleMap"in Element.prototype&&"CSS"in window&&CSS.number,fn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),sn(this,cn(n).apply(this,arguments))}var r,o,i;return 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)}(n,t),r=n,(o=[{key:"histId",value:function(){return this.el.id||this.constructor.componentName}},{key:"prepareInteraction",value:function(){ln?(this.contentEl.attributeStyleMap.set("will-change","transform"),this.scrimEl.attributeStyleMap.set("will-change","opacity")):(this.contentEl.style.willChange="transform",this.scrimEl.style.willChange="opacity"),this.fireEvent("prepare")}},{key:"cleanupInteraction",value:function(t){ln?(this.contentEl.attributeStyleMap.delete("will-change"),this.scrimEl.attributeStyleMap.delete("will-change"),t?this.scrimEl.attributeStyleMap.set("pointer-events",new CSSKeywordValue("all")):this.scrimEl.attributeStyleMap.delete("pointer-events")):(this.scrimEl.style.willChange="",this.contentEl.style.willChange="",this.scrimEl.style.pointerEvents=t?"all":""),this.fireEvent("transitioned",{detail:t})}},{key:"updateDOM",value:function(t,e){this.translateX=t;var n="left"===this.align?1:-1,r=this.opacity=t/e*n;this.moveCallback&&this.moveCallback({translateX:t,opacity:r}),ln?(this.contentEl.attributeStyleMap.set("transform",new CSSTransformValue([new CSSTranslate(CSS.px(t),CSS.px(0))])),this.scrimEl.attributeStyleMap.set("opacity",this.opacity)):(this.contentEl.style.transform="translateX(".concat(t,"px)"),this.scrimEl.style.opacity=this.opacity)}}])&&un(r.prototype,o),i&&un(r,i),n}()};function pn(t){return function(e){return e.lift(new hn(t))}}var hn=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new yn(t,this.value))},t}(),yn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return j(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}($);function bn(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}bn.prototype=Object.create(Error.prototype);var dn=bn;var vn=function(){function t(t){if(this.total=t,this.total<0)throw new dn}return t.prototype.call=function(t,e){return e.subscribe(new mn(t,this.total))},t}(),mn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return j(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}($);var wn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new _n(t,this.notifier,e))},t}(),_n=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return j(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Q;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=$t(this,e)},e}(Rt);var gn=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Sn(t,this.predicate))},t}(),Sn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return j(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}($);function En(t){return(En="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){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xn(t,e){return!e||"object"!==En(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 Tn(t){return(Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pn(t,e){return(Pn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var In=Math.abs.bind(Math),Cn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),xn(this,Tn(n).apply(this,arguments))}var r,o,i;return 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&&Pn(t,e)}(n,t),r=n,(o=[{key:"getStartObservable",value:function(){return qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents).pipe(Ve(function(t){var e=On(t,3),n=e[0],r=e[1],o=e[2];return re(r?ue(n,"touchstart",{passive:!0}).pipe(Re(function(t){return 1===t.touches.length}),Kt(function(t){return t.touches[0]})):se,o?ue(n,"mousedown").pipe(je(function(t){return t.event=t,t})):se)}))}},{key:"getMoveObservable",value:function(t,e){return qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents,this.subjects.preventDefault).pipe(Ve(function(n){var r,o=On(n,4),i=o[0],u=o[1],s=o[2],c=o[3],a=u?ue(i,"touchmove",{passive:!c}).pipe(Kt(function(t){return t.touches[0].event=t,t.touches[0]})):se,l=s?ue(i,"mousemove",{passive:!c}).pipe((r=re(t.pipe(pn(!0)),e.pipe(pn(!1))),function(t){return r.pipe(Ve(function(e){return e?t:se}))}),je(function(t){return t.event=t,t})):se;return re(a,l)}))}},{key:"getEndObservable",value:function(){return qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents).pipe(Ve(function(t){var e=On(t,3),n=e[0],r=e[1],o=e[2];return re(r?ue(n,"touchend",{passive:!0}).pipe(Re(function(t){return 0===t.touches.length}),Kt(function(t){return t.changedTouches[0]})):se,o?ue(n,"mouseup",{passive:!0}):se)}))}},{key:"getIsSlidingObservable",value:function(t,e,n){return this.getIsSlidingObservable2(t,e).pipe((o=1,function(t){return 0===o?ut():t.lift(new vn(o))}),ae(void 0),(r=function(){return n},function(t){return t.lift(new wn(r))}));var r,o}},{key:"getIsSlidingObservable2",value:function(t,e){var n,r=this;return this.threshold?t.pipe(Se(e),(n=function(t){var e=On(t,2),n=e[0],o=n.clientX,i=n.clientY,u=e[1],s=u.clientX,c=u.clientY;return In(c-i)<r.threshold&&In(s-o)<r.threshold},function(t){return t.lift(new gn(n))}),Kt(function(t){var e=On(t,2),n=e[0],r=n.clientX,o=n.clientY,i=e[1],u=i.clientX,s=i.clientY;return In(u-r)>=In(s-o)})):t.pipe(Se(e),Kt(function(t){var e=On(t,2),n=e[0],o=n.clientX,i=n.clientY,u=n.event,s=e[1],c=s.clientX,a=s.clientY,l=In(c-o)>=In(a-i);return r.preventDefault&&l&&u.preventDefault(),l}))}}])&&jn(r.prototype,o),i&&jn(r,i),n}()};function kn(t){return(kn="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 An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=t[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Rn(t,e){return!e||"object"!==kn(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 Mn(t){return(Mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dn(t,e){return(Dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Vn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Rn(this,Mn(n).apply(this,arguments))}var r,o,i;return 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&&Dn(t,e)}(n,Cn(fn(rn(t)))),r=n,(o=[{key:"setupObservables",value:function(){var t,e=this,n={contentRect:this.contentEl.getBoundingClientRect()},r=("ResizeObserver"in window?(t=ResizeObserver,function(e,n,r){return W.create(function(o){var i=o.next.bind(o),u=new t(function(t){return Array.from(t).forEach(i)},n);return u.observe(e,r),function(){u.unobserve(e)}})})(this.contentEl).pipe(ae(n)):pt(n)).pipe(le(this.subjects.disconnect),Kt(function(t){return t.contentRect.width}),ge(),ae(n.contentRect.width));this._peek$&&(r=qt(r,this._peek$).pipe(Kt(function(t){var e=An(t,2);return e[0]-e[1]})));var o,i=this.subjects.persistent.pipe(Kt(function(t){return!t})),u=this.getStartObservable().pipe(le(this.subjects.disconnect),Ue(i),ge()),s=Gt(function(){return e.translateX$.pipe(Kt(function(t){return 0!=t}))}),c=u.pipe(Se(s),Kt(function(t){var n=An(t,2),r=n[0].clientX,o=n[1];return e.calcIsInRange(r,o)}),je(function(t){t&&(e.mouseEvents&&e.contentEl.classList.add("hy-drawer-grabbing"),e.prepareInteraction())}),ge()),a=this.getEndObservable().pipe(le(this.subjects.disconnect),Ue(i,c),ge()),l=this.getMoveObservable(u,a).pipe(le(this.subjects.disconnect),Ue(i,c),ge()),f=this.getIsSlidingObservable(l,u,a).pipe(je(function(t){t&&e.fireEvent("slidestart",{detail:e.opened})}));this.translateX$=Gt(function(){return re(e.tween$,l.pipe(Ue(f),je(function(t){var n=t.event;return e.preventDefault&&n.preventDefault()}),Se(u,e.startTranslateX$,r),(t=ie,void 0===n&&(n=0),function(e){return e.lift(new bt(t,n))}),Kt(function(t){var n=An(t,4),r=n[0].clientX,o=n[1].clientX,i=n[2],u=n[3];return e.calcTranslateX(r,o,i,u)})),qt(e.subjects.opened,e.subjects.align,r).pipe(je(function(t){var n=An(t,1)[0];return e.cleanupInteraction(n)}),Kt(function(t){var e=An(t,3),n=e[0],r=e[1],o=e[2];return n?o*("left"===r?1:-1):0})));var t,n}).pipe(le(this.subjects.disconnect),ge()),this.startTranslateX$=this.translateX$.pipe((o=u,function(t){return t.lift(new Pe(o))}));var p,h=this.translateX$.pipe((void 0===p&&(p=Ce),Kt(function(t){return new ke(t,p.now())})),function(t){return t.lift(new Ae)},Re(function(t){var e=An(t,2),n=e[0].timestamp;return e[1].timestamp-n>0}),Kt(function(t){var e=An(t,2),n=e[0],r=n.value,o=n.timestamp,i=e[1];return(i.value-r)/(i.timestamp-o)}),ae(0)),y=re(a.pipe(je(function(){return e.contentEl.classList.remove("hy-drawer-grabbing")}),Se(u,this.translateX$,r,h),Re(this.calcIsSwipe.bind(this)),Kt(this.calcWillOpen.bind(this)),je(function(t){return e.fireEvent("slideend",{detail:t})})),this.animateTo$.pipe(je(this.prepareInteraction.bind(this))));this.tween$=y.pipe(je(function(t){return e.setInternalState("opened",t)}),Se(this.translateX$,r),Ve(function(t){var n,r=An(t,3),o=r[0],i=r[1],s=r[2],c="left"===e.align?1:-1;return Le(qe,i,(o?s*c:0)-i,200+.15*s).pipe(je({complete:function(){return e.subjects.opened.next(o)}}),le(u),le(e.subjects.align.pipe((n=1,function(t){return t.lift(new Fe(n))}))),ge())})),this.translateX$.pipe(Se(r)).subscribe(function(t){var n=An(t,2),r=n[0],o=n[1];return e.updateDOM(r,o)}),ue(this.scrimEl,"click").pipe(le(this.subjects.disconnect)).subscribe(function(){return e.close()}),i.pipe(le(this.subjects.disconnect)).subscribe(function(t){e.scrimEl.style.display=t?"block":"none"}),this.subjects.align.pipe(le(this.subjects.disconnect)).subscribe(function(t){e.contentEl.classList.remove("hy-drawer-left"),e.contentEl.classList.remove("hy-drawer-right"),e.contentEl.classList.add("hy-drawer-".concat(t))}),this.subjects.mouseEvents.pipe(le(this.subjects.disconnect),Ve(function(t){return t?e.contentEl.classList.add("hy-drawer-grab"):e.contentEl.classList.remove("hy-drawer-grab"),t?u.pipe(Se(c)):se})).subscribe(function(t){var e=An(t,2),n=e[0].event;return e[1]&&n&&n.preventDefault()}),this.fireEvent("init",{detail:this.opened})}}])&&Nn(r.prototype,o),i&&Nn(r,i),n}()};function Xn(t){return(Xn="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 Yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fn(t,e){return!e||"object"!==Xn(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,e,n){return($n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ln(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qn(t,e){return(qn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Hn,zn=new r([].concat(function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(Hn=m)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(Hn)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}(),["eventlistener","queryselector","requestanimationframe","classlist","opacity","csstransforms","csspointerevents"])),Wn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Fn(this,Ln(n).apply(this,arguments))}var r,o,i;return 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&&qn(t,e)}(n,Vn(xt(E(t)))),r=n,i=[{key:"componentName",get:function(){return"hy-drawer"}},{key:"types",get:function(){return{opened:It,align:kt(["left","right"]),persistent:It,range:Pt(Ct),threshold:Ct,preventDefault:It,touchEvents:It,mouseEvents:It}}},{key:"defaults",get:function(){return{opened:!1,align:"left",persistent:!1,range:[0,100],threshold:10,preventDefault:!1,touchEvents:!1,mouseEvents:!1}}}],(o=[{key:"setupComponent",value:function(t,e){$n(Ln(n.prototype),"setupComponent",this).call(this,t,e),this.animateTo$=new Q,this.scrimEl=this.sroot.querySelector(".hy-drawer-scrim"),this.contentEl=this.sroot.querySelector(".hy-drawer-content"),this.contentEl.classList.add("hy-drawer-".concat(this.align))}},{key:"connectComponent",value:function(){this.setupObservables(),$n(Ln(n.prototype),"connectComponent",this).call(this)}},{key:"open",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.animateTo$.next(!0):this.opened=!0}},{key:"close",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.animateTo$.next(!1):this.opened=!1}},{key:"toggle",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.animateTo$.next(!this.opened):this.opened=!this.opened}}])&&Yn(r.prototype,o),i&&Yn(r,i),n}()};function Bn(t){return(Bn="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 Un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gn(t,e){return!e||"object"!==Bn(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)}function Jn(t,e){return(Jn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"VANILLA_FEATURE_TESTS",function(){return Qn}),n.d(e,"HyDrawer",function(){return Zn}),n.d(e,"Set",function(){return r});var Qn=zn,Zn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Gn(this,Kn(e).apply(this,arguments))}var n,r,i;return 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&&Jn(t,e)}(e,Wn(o)),n=e,(r=[{key:"setupShadowDOM",value:function(t){if(!t)throw Error("No element provided");var e=new DocumentFragment;return e.appendChild(a("div",{class:"hy-drawer-scrim"})),e.appendChild(a("div",{class:"hy-drawer-content"},t.children)),t.appendChild(e),t}}])&&Un(n.prototype,r),i&&Un(n,i),e}()}})});
//# sourceMappingURL=index.js.map