/*! * Copyright (c) 2018 Florian Klampfer * * 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 . * */ !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;p0&&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;i0?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;nthis._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;ue&&(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;n0?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;e0?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;e1&&"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(++r1?r.next(Array.prototype.slice.call(arguments)):r.next(t)},r,n)})}var se=new W(H);function ce(){for(var t=[],e=0;e1)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;e0){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);l1?e-1:0),r=1;rn&&(e||ti);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.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=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;n0}),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;n0&&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