!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/cdk/overlay"),require("@angular/cdk/portal")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/cdk/overlay","@angular/cdk/portal"],e):e(t["context-menu-angular6"]={},t.ng.core,t.ng.common,t.ng.cdk.overlay,t.ng.cdk.portal)}(this,function(t,r,e,n,s){"use strict";var o=function rt(){this.$implicit={}},i=function(){function t(t){this.template=t,this.closeOnClick=!0,this.click=new r.EventEmitter,this.context=new o}return t.prototype.setNotActive=function(){this._active=!1,this.subMenu&&this.subMenu.setNotActive()},t.prototype.setActive=function(){this._active=!0},t}();i.decorators=[{type:r.Directive,args:[{selector:"[shContextMenuItem]"}]}],i.ctorParameters=function(){return[{type:r.TemplateRef,decorators:[{type:r.Optional}]}]},i.propDecorators={subMenu:[{type:r.Input}],divider:[{type:r.Input}],visible:[{type:r.Input}],disabled:[{type:r.Input}],closeOnClick:[{type:r.Input}],click:[{type:r.Output}]};var u=function(t,e){return(u=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 c(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function p(t){return"function"==typeof t}var a=!1,l={Promise:undefined,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;a=t},get useDeprecatedSynchronousErrorHandling(){return a}};function h(t){setTimeout(function(){throw t})}var f={closed:!0,next:function(t){},error:function(t){if(l.useDeprecatedSynchronousErrorHandling)throw t;h(t)},complete:function(){}},d=Array.isArray||function(t){return t&&"number"==typeof t.length};function y(t){return null!=t&&"object"==typeof t}var b,v={e:{}};function m(){try{return b.apply(this,arguments)}catch(t){return v.e=t,v}}function g(t){return b=t,m}var x=function(n){function r(t){var e=n.call(this,t?t.length+" errors occurred during unsubscription:\n  "+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"")||this;return e.errors=t,e.name="UnsubscriptionError",Object.setPrototypeOf(e,r.prototype),e}return c(r,n),r}(Error),_=function(){function r(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var t;return r.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,o=this._unsubscribe,i=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var s=-1,u=r?r.length:0;n;)n.remove(this),n=++s<u&&r[s]||null;if(p(o))g(o).call(this)===v&&(e=!0,t=t||(v.e instanceof x?w(v.e.errors):[v.e]));if(d(i))for(s=-1,u=i.length;++s<u;){var c=i[s];if(y(c))if(g(c.unsubscribe).call(c)===v){e=!0,t=t||[];var a=v.e;a instanceof x?t=t.concat(w(a.errors)):t.push(a)}}if(e)throw new x(t)}},r.prototype.add=function(t){if(!t||t===r.EMPTY)return r.EMPTY;if(t===this)return this;var e=t;switch(typeof t){case"function":e=new r(t);case"object":if(e.closed||"function"!=typeof e.unsubscribe)return e;if(this.closed)return e.unsubscribe(),e;if("function"!=typeof e._addParent){var n=e;(e=new r)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(e),e._addParent(this),e},r.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},r.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},r.EMPTY=((t=new r).closed=!0,t),r}();function w(t){return t.reduce(function(t,e){return t.concat(e instanceof x?e.errors:e)},[])}var E="function"==typeof Symbol&&"function"==typeof Symbol["for"]?Symbol["for"]("rxSubscriber"):"@@rxSubscriber",S=function(s){function o(t,e,n){var r=s.call(this)||this;switch(r.syncErrorValue=null,r.syncErrorThrown=!1,r.syncErrorThrowable=!1,r.isStopped=!1,arguments.length){case 0:r.destination=f;break;case 1:if(!t){r.destination=f;break}if("object"==typeof t){if(function i(t){return t instanceof S||"syncErrorThrowable"in t&&t[E]}(t)){var o=t[E]();r.syncErrorThrowable=o.syncErrorThrowable,(r.destination=o).add(r)}else r.syncErrorThrowable=!0,r.destination=new I(r,t);break}default:r.syncErrorThrowable=!0,r.destination=new I(r,t,e,n)}return r}return c(o,s),o.prototype[E]=function(){return this},o.create=function(t,e,n){var r=new o(t,e,n);return r.syncErrorThrowable=!1,r},o.prototype.next=function(t){this.isStopped||this._next(t)},o.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},o.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},o.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this))},o.prototype._next=function(t){this.destination.next(t)},o.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},o.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},o.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},o}(_),I=function(u){function t(t,e,n,r){var o,i=u.call(this)||this;i._parentSubscriber=t;var s=i;return p(e)?o=e:e&&(o=e.next,n=e.error,r=e.complete,e!==f&&(p((s=Object.create(e)).unsubscribe)&&i.add(s.unsubscribe.bind(s)),s.unsubscribe=i.unsubscribe.bind(i))),i._context=s,i._next=o,i._error=n,i._complete=r,i}return c(t,u),t.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;l.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},t.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=l.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?this.__tryOrSetError(e,this._error,t):this.__tryOrUnsub(this._error,t),this.unsubscribe();else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):h(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;h(t)}}},t.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)};l.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,n):this.__tryOrUnsub(n),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),l.useDeprecatedSynchronousErrorHandling)throw n;h(n)}},t.prototype.__tryOrSetError=function(t,e,n){if(!l.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return l.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0):(h(r),!0)}return!1},t.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},t}(S);var C="function"==typeof Symbol&&Symbol.observable||"@@observable";function T(){}var O=function(){function n(t){this._isScalar=!1,t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,n){var r=this.operator,o=function i(t,e,n){if(t){if(t instanceof S)return t;if(t[E])return t[E]()}return t||e||n?new S(t,e,n):new S(f)}(t,e,n);if(r?r.call(o,this.source):o.add(this.source||l.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),l.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){l.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),t.error(e)}},n.prototype.forEach=function(o,t){var e=this;return new(t=k(t))(function(t,n){var r;r=e.subscribe(function(t){try{o(t)}catch(e){n(e),r&&r.unsubscribe()}},n,t)})},n.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},n.prototype[C]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:function n(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(t,e){return e(t)},t)}:T}(t)(this)},n.prototype.toPromise=function(t){var r=this;return new(t=k(t))(function(t,e){var n;r.subscribe(function(t){return n=t},function(t){return e(t)},function(){return t(n)})})},n.create=function(t){return new n(t)},n}();function k(t){if(t||(t=l.Promise||Promise),!t)throw new Error("no Promise impl found");return t}Error;function M(t){return t&&"function"==typeof t.schedule}var P=function(r){return function(t){for(var e=0,n=r.length;e<n&&!t.closed;e++)t.next(r[e]);t.closed||t.complete()}};function A(r,o){return new O(o?function(t){var e=new _,n=0;return e.add(o.schedule(function(){n!==r.length?(t.next(r[n++]),t.closed||e.add(this.schedule())):t.complete()})),e}:P(r))}function Y(t){return t}Error,Error,Error;function N(e,n){return function(t){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return t.lift(new D(e,n))}}var D=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new j(t,this.project,this.thisArg))},t}(),j=function(o){function t(t,e,n){var r=o.call(this,t)||this;return r.project=e,r.count=0,r.thisArg=n||r,r}return c(t,o),t.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},t}(S),X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(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}(S),V=function(o){function t(t,e,n){var r=o.call(this)||this;return r.parent=t,r.outerValue=e,r.outerIndex=n,r.index=0,r}return c(t,o),t.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},t.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(S),R=function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,h),e}};function F(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var H=F(),L=function(r){return function(t){for(var e=r[H]();;){var n=e.next();if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof e["return"]&&t.add(function(){e["return"]&&e["return"]()}),t}},$=function(n){return function(t){var e=n[C]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)}},B=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function U(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var q=function(e){if(e instanceof O)return function(t){return e._isScalar?(t.next(e.value),t.complete(),undefined):e.subscribe(t)};if(e&&"function"==typeof e[C])return $(e);if(B(e))return P(e);if(U(e))return R(e);if(e&&"function"==typeof e[H])return L(e);var t=y(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function G(t,e,n,r){var o=new V(t,n,r);return q(e)(o)}function Q(t,e){if(!e)return t instanceof O?t:new O(q(t));if(null!=t){if(function n(t){return t&&"function"==typeof t[C]}(t))return function i(r,o){return new O(o?function(e){var n=new _;return n.add(o.schedule(function(){var t=r[C]();n.add(t.subscribe({next:function(t){n.add(o.schedule(function(){return e.next(t)}))},error:function(t){n.add(o.schedule(function(){return e.error(t)}))},complete:function(){n.add(o.schedule(function(){return e.complete()}))}}))})),n}:$(r))}(t,e);if(U(t))return function o(t,r){return new O(r?function(e){var n=new _;return n.add(r.schedule(function(){return t.then(function(t){n.add(r.schedule(function(){e.next(t),n.add(r.schedule(function(){return e.complete()}))}))},function(t){n.add(r.schedule(function(){return e.error(t)}))})})),n}:R(t))}(t,e);if(B(t))return A(t,e);if(function r(t){return t&&"function"==typeof t[H]}(t)||"string"==typeof t)return function s(e,n){if(!e)throw new Error("Iterable cannot be null");return new O(n?function(o){var i,t=new _;return t.add(function(){i&&"function"==typeof i["return"]&&i["return"]()}),t.add(n.schedule(function(){i=e[H](),t.add(n.schedule(function(){if(!o.closed){var t,e;try{var n=i.next();t=n.value,e=n.done}catch(r){return void o.error(r)}e?o.complete():(o.next(t),this.schedule())}}))})),t}:L(e))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var W=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 z(t,this.project,this.concurrent))},t}(),z=function(o){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var r=o.call(this,t)||this;return r.project=e,r.concurrent=n,r.hasCompleted=!1,r.buffer=[],r.active=0,r.index=0,r}return c(t,o),t.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},t.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(e,t,n)},t.prototype._innerSub=function(t,e,n){this.add(G(this,t,e,n))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},t.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,0<e.length?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(X);function J(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function r(e,o,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof o?function(t){return t.pipe(r(function(n,r){return Q(e(n,r)).pipe(N(function(t,e){return o(n,t,r,e)}))},n))}:("number"==typeof o&&(n=o),function(t){return t.lift(new W(e,n))})}(Y,t)}function K(t,r,o,e){return p(o)&&(e=o,o=undefined),e?K(t,r,o).pipe(N(function(t){return d(t)?e.apply(void 0,t):e(t)})):new O(function(e){!function d(t,e,n,r,o){var i;if(function l(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var s=t;t.addEventListener(e,n,o),i=function(){return s.removeEventListener(e,n,o)}}else if(function h(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var u=t;t.on(e,n),i=function(){return u.off(e,n)}}else if(function f(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var c=t;t.addListener(e,n),i=function(){return c.removeListener(e,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var a=0,p=t.length;a<p;a++)d(t[a],e,n,r,o)}r.add(i)}(t,r,function n(t){1<arguments.length?e.next(Array.prototype.slice.call(arguments)):e.next(t)},e,o)})}var Z=function(){function t(t){this.overlay=t,this.activeOverlays=[]}return t.prototype.openMenu=function(t){this.closeCurrentOverlays();var e=t.menu,n=t.mouseEvent,r=t.targetElement,o=t.data;this.activeMenu=e,n.preventDefault(),n.stopPropagation(),this.overrideGetBoundingClientRect(r,n);var i=this.buildCloseScrollStrategy(),s=this.buildConnectedPositionStrategy(r);this.attachContextToItems(e,o);var u=this.createAndAttachOverlay(s,i,e,!0);this.attachOverlayRef(e,u),this.registerBackdropEvents(u)},t.prototype.openSubMenu=function(t){var e=t.menu,n=t.mouseEvent,r=t.targetElement,o=t.data,i=t.parentMenu;n.preventDefault(),n.stopPropagation();var s=this.buildCloseScrollStrategy(),u=this.buildConnectedPositionStrategyForSubMenu(r),c=this.createAndAttachOverlay(u,s,e,!1);this.attachContextToItems(e,o),this.attachThisContext(e,i),this.attachOverlayRef(e,c)},t.prototype.destroy=function(){this.closeCurrentOverlays(),this.backDropSub.unsubscribe()},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.closeSubMenus=function(t){var e=this,n=t.menuItems.filter(function(t){return!!t.subMenu&&!!t.subMenu.overlayRef});n.length&&(n.forEach(function(t){return e.closeSubMenus(t.subMenu)}),n.map(function(t){return t.subMenu.overlayRef}).forEach(function(t){return t.dispose()}))},t.prototype.registerBackdropEvents=function(t){var e=t.backdropElement;this.backDropSub=K(e,"mousedown").subscribe(this.closeCurrentOverlays.bind(this))},t.prototype.createAndAttachOverlay=function(t,e,n,r){void 0===r&&(r=!0);var o=this.overlay.create({positionStrategy:t,scrollStrategy:e,hasBackdrop:r,backdropClass:"sh-backdrop"}),i=new s.TemplatePortal(n.menuTemplate,n.menuContainer);return o.attach(i),this.activeOverlays.push(o),o},t.prototype.buildCloseScrollStrategy=function(){return this.overlay.scrollStrategies.close()},t.prototype.buildConnectedPositionStrategy=function(t){return this.overlay.position().connectedTo(t,{originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"}).withFallbackPosition({originX:"start",originY:"top"},{overlayX:"start",overlayY:"bottom"}).withFallbackPosition({originX:"end",originY:"top"},{overlayX:"start",overlayY:"top"}).withFallbackPosition({originX:"start",originY:"top"},{overlayX:"end",overlayY:"top"}).withFallbackPosition({originX:"end",originY:"center"},{overlayX:"start",overlayY:"center"}).withFallbackPosition({originX:"start",originY:"center"},{overlayX:"end",overlayY:"center"})},t.prototype.buildConnectedPositionStrategyForSubMenu=function(t){return this.overlay.position().connectedTo(t,{originX:"end",originY:"top"},{overlayX:"start",overlayY:"top"}).withFallbackPosition({originX:"start",originY:"top"},{overlayX:"end",overlayY:"top"}).withFallbackPosition({originX:"end",originY:"bottom"},{overlayX:"start",overlayY:"bottom"}).withFallbackPosition({originX:"start",originY:"bottom"},{overlayX:"end",overlayY:"bottom"})},t.prototype.overrideGetBoundingClientRect=function(t,e){var n=e.clientX,r=e.clientY;t.nativeElement.getBoundingClientRect=function(){return{bottom:r,height:0,left:n,right:n,top:r,width:0}}},t.prototype.closeCurrentOverlays=function(){this.activeOverlays.forEach(function(t){t.detach(),t.dispose()}),this.activeOverlays=[],this.activeMenu&&this.activeMenu.close()},t.prototype.attachContextToItems=function(t,e){t.menuItems.forEach(function(t){return t.context.$implicit=e})},t.prototype.attachThisContext=function(t,e){t.thisContext=e.thisContext},t.prototype.attachOverlayRef=function(t,e){t.overlayRef=e},t}();Z.decorators=[{type:r.Injectable}],Z.ctorParameters=function(){return[{type:n.Overlay}]};var tt=function(){function t(t){this.ctxService=t,this.contentChildrenItems=new r.QueryList,this.viewChildrenItems=new r.QueryList}return Object.defineProperty(t.prototype,"menuItems",{get:function(){return this.contentChildrenItems.length?this.contentChildrenItems:this.viewChildrenItems},enumerable:!0,configurable:!0}),t.prototype.onEnter=function(t,e,n){this.ctxService.closeSubMenus(this),this.setNotActive(),e.subMenu&&(this.setActive(e),this.ctxService.openSubMenu({data:e.context.$implicit,targetElement:new r.ElementRef(n),menu:e.subMenu,mouseEvent:t,parentMenu:this}))},t.prototype.setActive=function(t){t.setActive(),this.subActive=!0},t.prototype.onClick=function(t,e){e.divider||!e.subMenu&&e.closeOnClick&&(this.ctxService.destroy(),e.click.emit({data:e.context.$implicit,event:t}))},t.prototype.callWithContext=function(t,e,n,r){return t.call(this.thisContext?this.thisContext:e,{data:n,event:r})},t.prototype.close=function(){this.setNotActive(),this.menuContainer.detach(),this.overlayRef&&this.overlayRef.detach()},t.prototype.ngOnDestroy=function(){this.close()},t.prototype.setNotActive=function(){this.subActive=!1,this.menuItems.forEach(function(t){return t.setNotActive()})},t.prototype.isVisible=function(t){return!t.visible||this.callWithContext(t.visible,this,t.context.$implicit,null)},t}();tt.decorators=[{type:r.Component,args:[{selector:"sh-context-menu",encapsulation:r.ViewEncapsulation.None,styles:['\n    .sh-backdrop {\n      background-color: transparent;\n    }\n\n    .sh-context-menu {\n      background: #ececec;\n      min-width: 150px;\n      border: 1px solid rgba(0, 0, 0, 0.2);\n      border-radius: 3px;\n      -webkit-box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n              box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);\n      color: black;\n      padding: 5px 0;\n      margin: 0;\n    }\n\n    .sh-context-menu--item {\n      padding: 5px 10px 5px 15px;\n      -webkit-transition: all 0.15s;\n      transition: all 0.15s;\n    }\n\n    .sh-context-menu--item:hover, .sh-context-menu--item__sub-active {\n      background-color: #4b8bec;\n      color: white;\n      cursor: pointer;\n    }\n\n    .sh-context-menu--item.sh-context-menu--item__divider:hover {\n      background-color: #ececec;\n      color: black;\n      cursor: default;\n    }\n\n    .sh-context-menu--item__divider {\n      height: 1px;\n      margin: 1px 1px 8px 1px;\n      overflow: hidden;\n      border-bottom: 1px solid #d0d0d0;\n    }\n\n    .sh-context-menu--item.sh-sub-anchor {\n      position: relative;\n      min-width: 160px;\n    }\n\n    .sh-sub-anchor:after {\n      content: "";\n      top: 50%;\n      right: 6px;\n      -webkit-transform: translateY(-50%);\n              transform: translateY(-50%);\n      position: absolute;\n      border-top: 6px solid transparent;\n      border-bottom: 6px solid transparent;\n      border-left: 8px solid black;\n    }\n  '],template:'\n    <ng-container #menuContainer></ng-container>\n    <ng-template #menuTemplate>\n      <div class="sh-context-menu">\n        <div\n          *ngFor="let menuItem of menuItems"\n          #itemElement\n          [ngClass]="{\'sh-sub-anchor\': menuItem.subMenu,\n           \'sh-context-menu--item__divider\': menuItem.divider,\n           \'sh-context-menu--item__sub-active\': subActive && menuItem.active}"\n          class="sh-context-menu--item"\n          (mouseenter)="onEnter($event, menuItem, itemElement)"\n          (click)="onClick($event, menuItem)">\n          <ng-container *ngIf="!menuItem.divider || !isVisible(menuItem)">\n            <ng-content *ngTemplateOutlet="menuItem.template; context: menuItem.context"></ng-content>\n          </ng-container>\n        </div>\n      </div>\n    </ng-template>\n  '}]}],tt.ctorParameters=function(){return[{type:Z}]},tt.propDecorators={thisContext:[{type:r.Input,args:["this"]}],contentChildrenItems:[{type:r.ContentChildren,args:[i,{read:i}]}],viewChildrenItems:[{type:r.ViewChildren,args:[i,{read:i}]}],menuTemplate:[{type:r.ViewChild,args:["menuTemplate",{read:r.TemplateRef}]}],menuContainer:[{type:r.ViewChild,args:["menuContainer",{read:r.ViewContainerRef}]}]};var et=function(){function t(t,e){this.ctxService=t,this.elm=e}return t.prototype.ngOnInit=function(){this.setupEvents()},t.prototype.setupEvents=function(){var e=this,n=[];this.triggers?this.triggers.forEach(function(t){n.push(K(e.elm.nativeElement,t))}):n.push(K(this.elm.nativeElement,"contextmenu")),this.sub=function i(){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 M(o)?(r=t.pop(),1<t.length&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof O?t[0]:J(n)(A(t,r))}.apply(void 0,n).subscribe(this.openMenu.bind(this))},t.prototype.openMenu=function(t){this.ctxService.openMenu({menu:this.menu,mouseEvent:t,targetElement:this.elm,data:this.data})},t.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},t}();et.decorators=[{type:r.Directive,args:[{selector:"[shAttachMenu]"}]}],et.ctorParameters=function(){return[{type:Z},{type:r.ElementRef}]},et.propDecorators={menu:[{type:r.Input,args:["shAttachMenu"]}],triggers:[{type:r.Input,args:["shMenuTriggers"]}],data:[{type:r.Input,args:["shMenuData"]}]};var nt=function ot(){};nt.decorators=[{type:r.NgModule,args:[{declarations:[et,tt,i],exports:[et,tt,i],providers:[Z],imports:[e.CommonModule,n.OverlayModule],entryComponents:[tt]}]}],nt.ctorParameters=function(){return[]},t.ShContextMenuModule=nt,t.ShContextMenuComponent=tt,t.ShAttachMenuDirective=et,t.ShContextMenuItemDirective=i,t.ShContextMenuService=Z,t.ɵa=o,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=context-menu-angular6.umd.min.js.map
