@angular-package/prism
Version:
Simple Angular 5+ Prism highlighter module.
3 lines (2 loc) • 22.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular-package/change-detection"),require("lodash-es"),require("@angular/platform-browser"),require("prismjs")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular-package/change-detection","lodash-es","@angular/platform-browser","prismjs"],t):t((e.ap=e.ap||{},e.ap.prismCore={}),e.ng.common,e.ng.core,e.ap.changeDetection,e._,e.ng.platformBrowser,e.Prism)}(this,function(e,t,r,n,o,s,i){"use strict";i=i&&i.hasOwnProperty("default")?i.default:i;class c{constructor(e){this.sanitizer=e}highlight(e,t){e instanceof r.ElementRef&&(t.code&&(e.nativeElement.innerHTML=this.sanitizer.sanitize(r.SecurityContext.HTML,this.escapeHtml(t.code))),t.interpolation&&(e.nativeElement.innerHTML=this.interpolate(e.nativeElement.innerHTML,t.interpolation)),i.highlightElement(e.nativeElement,t.async,t.callback))}hooks(){return i.hooks}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}interpolate(e,t){return t&&"object"==typeof t?(o.templateSettings.interpolate=/{{([\s\S]+?)}}/g,o.template(e)(t)):e}}c.decorators=[{type:r.Injectable}],c.ctorParameters=(()=>[{type:s.DomSanitizer}]);class a{constructor(e,t){this.changeDetectorRef=e,this.prismService=t,this.ready=!1,this._async=!1}set cd(e){this._cd=e,!0===this.ready&&(this.__properties=e)}get cd(){return this._cd}set async(e){this._async=e}get async(){return this._async}set callback(e){this._callback=e}get callback(){return this._callback}set code(e){this._code=e,this.ready&&!0===this.__properties.code&&this.highlightElement({code:e,language:this.language})}get code(){return this._code}set hooks(e){this._hooks=e,e instanceof Object&&o.forEach(e,(e,t)=>{this.prismService.hooks().add(t,e)}),this.highlightElement({code:this.code,language:this.language})}get hooks(){return this._hooks}set language(e){if(!e)throw new Error("Missing property `language`.");if("string"!=typeof e)throw new Error(`Property \`language\` should be \`string\` instead of provided \`${typeof e}\``);this._language=e,this.highlightElement({code:this.code,language:e})}get language(){return this._language}highlightElement(e){!0===this.ready&&this.prismService.highlight(this.el,{async:this.async,callback:this.callback,code:e.code,interpolation:this.interpolation})}}a.decorators=[{type:r.Injectable}],a.ctorParameters=(()=>[{type:r.ChangeDetectorRef},{type:c}]),a.propDecorators={el:[{type:r.ViewChild,args:["el",{read:r.ElementRef}]}],cd:[{type:r.Input,args:["cd"]}],async:[{type:r.Input,args:["async"]}],callback:[{type:r.Input,args:["callback"]}],code:[{type:r.Input,args:["code"]}],hooks:[{type:r.Input,args:["hooks"]}],language:[{type:r.Input,args:["language"]}],interpolation:[{type:r.Input,args:["interpolation"]}]};var u=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},h=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let p=class extends a{constructor(e,t){super(e,t),this.changeDetectorRef=e,this.prismService=t}ngAfterContentInit(){this.cd&&(this.__properties=this.cd)}ngAfterViewInit(){this.ready=!0,this.highlightElement({code:this.code,language:this.language})}ngOnInit(){}};p.decorators=[{type:r.Component,args:[{changeDetection:r.ChangeDetectionStrategy.OnPush,encapsulation:r.ViewEncapsulation.None,exportAs:"apPrism",preserveWhitespaces:!1,providers:[c],selector:"ngx-prism",template:'<pre class="language-{{language}}" *ngIf="language"><code #el class="language-{{language}}"><ng-content *ngIf="!code"></ng-content></code></pre>'}]}],p.ctorParameters=(()=>[{type:r.ChangeDetectorRef},{type:c}]);const l=[p=u([n.ChangeDetection(!1,{async:!0,callback:!0,code:!0,hooks:!0,language:!0,interpolation:!0}),h("design:paramtypes",[r.ChangeDetectorRef,c])],p)];class b{}b.decorators=[{type:r.NgModule,args:[{declarations:l,exports:l,imports:[t.CommonModule]}]}],b.ctorParameters=(()=>[]);var f={isArray:Array.isArray||function(e){return e&&"number"==typeof e.length}};var g={isObject:function(e){return null!=e&&"object"==typeof e}};var d,y={isFunction:function(e){return"function"==typeof e}},m={errorObject:{e:{}}};function _(){try{return d.apply(this,arguments)}catch(e){return m.errorObject.e=e,m.errorObject}}var v={tryCatch:function(e){return d=e,_}},w="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e,t){return e(t={exports:{}},t.exports),t.exports}var S=w&&w.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},O={UnsubscriptionError:function(e){S(t,e);function t(t){e.call(this),this.errors=t;var r=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return t}(Error)},x=function(){function e(e){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}e.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){var r=this._parent,n=this._parents,o=this._unsubscribe,s=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var i=-1,c=n?n.length:0;r;)r.remove(this),r=++i<c&&n[i]||null;if(y.isFunction(o)){v.tryCatch(o).call(this)===m.errorObject&&(t=!0,e=e||(m.errorObject.e instanceof O.UnsubscriptionError?j(m.errorObject.e.errors):[m.errorObject.e]))}if(f.isArray(s))for(i=-1,c=s.length;++i<c;){var a=s[i];if(g.isObject(a)){if(v.tryCatch(a.unsubscribe).call(a)===m.errorObject){t=!0,e=e||[];var u=m.errorObject.e;u instanceof O.UnsubscriptionError?e=e.concat(j(u.errors)):e.push(u)}}}if(t)throw new O.UnsubscriptionError(e)}},e.prototype.add=function(t){if(!t||t===e.EMPTY)return e.EMPTY;if(t===this)return this;var r=t;switch(typeof t){case"function":r=new e(t);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.prototype._addParent=function(e){var t=this._parent,r=this._parents;t&&t!==e?r?-1===r.indexOf(e)&&r.push(e):this._parents=[e]:this._parent=e},e.EMPTY=(t=new e,t.closed=!0,t);var t;return e}();function j(e){return e.reduce(function(e,t){return e.concat(t instanceof O.UnsubscriptionError?t.errors:t)},[])}var k={Subscription:x},P="undefined"!=typeof window&&window,R="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,$=P||void 0!==w&&w||R,T=$;!function(){if(!$)throw new Error("RxJS could not find any global context (window, self, global)")}();var I={root:T},C={empty:{closed:!0,next:function(e){},error:function(e){throw e},complete:function(){}}},M=E(function(e,t){var r=I.root.Symbol;t.rxSubscriber="function"==typeof r&&"function"==typeof r.for?r.for("rxSubscriber"):"@@rxSubscriber",t.$$rxSubscriber=t.rxSubscriber}),D=(M.rxSubscriber,M.$$rxSubscriber,w&&w.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),U=function(e){D(t,e);function t(r,n,o){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=C.empty;break;case 1:if(!r){this.destination=C.empty;break}if("object"==typeof r){r instanceof t?(this.syncErrorThrowable=r.syncErrorThrowable,this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new V(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new V(this,r,n,o)}}return t.prototype[M.rxSubscriber]=function(){return this},t.create=function(e,r,n){var o=new t(e,r,n);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parent,t=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=t,this},t}(k.Subscription),A=U,V=function(e){D(t,e);function t(t,r,n,o){e.call(this),this._parentSubscriber=t;var s,i=this;y.isFunction(r)?s=r:r&&(s=r.next,n=r.error,o=r.complete,r!==C.empty&&(i=Object.create(r),y.isFunction(i.unsubscribe)&&this.add(i.unsubscribe.bind(i)),i.unsubscribe=this.unsubscribe.bind(this))),this._context=i,this._next=s,this._error=n,this._complete=o}return t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){throw this.unsubscribe(),e}},t.prototype.__tryOrSetError=function(e,t,r){try{t.call(this._context,r)}catch(t){return e.syncErrorValue=t,e.syncErrorThrown=!0,!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(U),H={Subscriber:A};var z={toSubscriber:function(e,t,r){if(e){if(e instanceof H.Subscriber)return e;if(e[M.rxSubscriber])return e[M.rxSubscriber]()}return e||t||r?new H.Subscriber(e,t,r):new H.Subscriber(C.empty)}},L=E(function(e,t){function r(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}t.getSymbolObservable=r,t.observable=r(I.root),t.$$observable=t.observable});L.getSymbolObservable,L.observable,L.$$observable;var q={noop:function(){}};function F(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}:q.noop}var Y={pipe:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return F(e)},pipeFromArray:F},N={Observable:function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=z.toSubscriber(e,t,r);if(n?n.call(o,this.source):o.add(this.source||!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var r=this;if(t||(I.root.Rx&&I.root.Rx.config&&I.root.Rx.config.Promise?t=I.root.Rx.config.Promise:I.root.Promise&&(t=I.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,n){var o;o=r.subscribe(function(t){if(o)try{e(t)}catch(e){n(e),o.unsubscribe()}else e(t)},n,t)})},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[L.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return 0===e.length?this:Y.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;if(e||(I.root.Rx&&I.root.Rx.config&&I.root.Rx.config.Promise?e=I.root.Rx.config.Promise:I.root.Promise&&(e=I.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}()},W=w&&w.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},G={ObjectUnsubscribedError:function(e){W(t,e);function t(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return t}(Error)},B=w&&w.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},J={SubjectSubscription:function(e){B(t,e);function t(t,r){e.call(this),this.subject=t,this.subscriber=r,this.closed=!1}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(k.Subscription)},K=w&&w.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},Q=function(e){K(t,e);function t(t){e.call(this,t),this.destination=t}return t}(H.Subscriber),X=function(e){K(t,e);function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return t.prototype[M.rxSubscriber]=function(){return new Q(this)},t.prototype.lift=function(e){var t=new ee(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new G.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),o=0;o<r;o++)n[o].next(e)},t.prototype.error=function(e){if(this.closed)throw new G.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),o=0;o<r;o++)n[o].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new G.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new G.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new G.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),k.Subscription.EMPTY):this.isStopped?(e.complete(),k.Subscription.EMPTY):(this.observers.push(e),new J.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new N.Observable;return e.source=this,e},t.create=function(e,t){return new ee(e,t)},t}(N.Observable),Z=X,ee=function(e){K(t,e);function t(t,r){e.call(this),this.destination=t,this.source=r}return t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):k.Subscription.EMPTY},t}(X);const te=function(e,t){const r=e.prototype.ngOnInit,n={getter:{},setter:{}};o.each(t,t=>{n.getter[t]=e.prototype.__proto__.__lookupGetter__(t),n.setter[t]=e.prototype.__proto__.__lookupSetter__(t)}),e.prototype.ngOnInit=function(){t instanceof Array&&o.each(t,e=>{const t=this[e];Object.defineProperty(this,`${e}$$`,{writable:!1,value:new Z}),Object.defineProperty(this,`${e}$`,{writable:!1,value:this[`${e}$$`].asObservable()}),Object.defineProperty(this,e,{set:function(t){setTimeout(()=>{this[`${e}$$`].next(t)},0),void 0!==n.setter[e]?n.setter[e].apply(this,arguments):this[`_${e}`]=t},get:function(){return void 0===n.getter[e]?this[`_${e}`]:n.getter[e].apply(this,arguments)}}),this[`_${e}`]=t}),void 0!==r&&r.apply(this,arguments)}},re=function(e,t){const r=e.prototype.ngOnDestroy;e.prototype.ngOnDestroy=function(){void 0===t?o.each(this,e=>{e instanceof x&&!1===e.closed&&e.unsubscribe()}):o.each(this,(e,r)=>{o.each(t,t=>{r.includes(t)&&e instanceof x&&!1===e.closed&&e.unsubscribe()})}),void 0!==r&&r.apply(this,arguments)}};class ne{constructor(e){this.sanitizer=e,this.subject={code:new Z,language:new Z},this.templateOptions={interpolate:/{{([\s\S]+?)}}/g},this.code$=this.subject.code.asObservable(),this.language$=this.subject.language.asObservable(),this.prism=i}set async(e){this._async=e}get async(){return this._async}set callback(e){this._callback=e}get callback(){return this._callback}set code(e){this._code=e,e&&(e=this.sanitizer.sanitize(r.SecurityContext.HTML,this.escapeHtml(e)))}get code(){return this._code}set hooks(e){this._hooks=e,e instanceof Object&&o.forEach(e,(e,t)=>{this.prism.hooks.add(t,e)})}get hooks(){return this._hooks}set interpolation(e){this._interpolation=e}get interpolation(){return this._interpolation}set language(e){this._language=e}get language(){return this._language}highlightElement(e){e instanceof r.ElementRef&&(this.interpolate(e),this.prism.highlightElement(e.nativeElement,this.async,this.callback))}interpolate(e){return this.interpolation&&e instanceof r.ElementRef&&(e.nativeElement.innerHTML=o.template(e.nativeElement.innerHTML,this.templateOptions)(this.interpolation)),e}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}ne.decorators=[{type:r.Injectable}],ne.ctorParameters=(()=>[{type:s.DomSanitizer}]);class oe{constructor(e){this.prismService=e,this.change=!1}set async(e){this.prismService.async=e}get async(){return this.prismService.async}set callback(e){this.prismService.callback=e}get callback(){return this.prismService.callback}set code(e){if(e){if("string"!=typeof e)throw new Error(`Property \`code\` should be \`string\` instead of provided \`${typeof e}\``);this.prismService.code=e}else this.prismService.code=e}get code(){return this.prismService.code}set hooks(e){this.prismService.hooks=e}get hooks(){return this.prismService.hooks}set language(e){if(!e)throw new Error("Missing property `language`.");if("string"!=typeof e)throw new Error(`Property \`language\` should be \`string\` instead of provided \`${typeof e}\``);this.prismService.language=e}get language(){return this.prismService.language}set interpolation(e){this.prismService.interpolation=e}get interpolation(){return this.prismService.interpolation}onChanges(e,t){t&&o.each(t,(r,n)=>{if(e instanceof Array)o.each(e,e=>{n===e&&t[n].currentValue!==t[n].previousValue&&!1===t[n].firstChange&&(this.change=!0)});else switch(n){case e:t[n].currentValue!==t[n].previousValue&&!1===t[n].firstChange&&(this.change=!0)}})}}oe.decorators=[{type:r.Injectable}],oe.ctorParameters=(()=>[{type:ne}]),oe.propDecorators={async:[{type:r.Input,args:["async"]}],callback:[{type:r.Input,args:["callback"]}],code:[{type:r.Input,args:["code"]}],hooks:[{type:r.Input,args:["hooks"]}],language:[{type:r.Input,args:["language"]}],interpolation:[{type:r.Input,args:["interpolation"]}],codeElementRef:[{type:r.ViewChild,args:["codeElementRef"]}]};var se=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},ie=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let ce=class extends oe{constructor(e){super(e),this.prismService=e}ngOnInit(){this.code$$$=this.code$.subscribe({next:e=>{this.codeElementRef&&!0===this.change&&(this.codeElementRef.nativeElement.innerHTML=e,this.prismService.highlightElement(this.codeElementRef),this.change=!1)}}),this.language$$$=this.language$.subscribe({next:e=>{this.codeElementRef&&!0===this.change&&(this.prismService.highlightElement(this.codeElementRef),this.change=!1)}})}ngAfterViewInit(){this.prismService.highlightElement(this.codeElementRef)}ngOnChanges(e){this.onChanges(["code","language"],e)}};ce.decorators=[{type:r.Component,args:[{changeDetection:r.ChangeDetectionStrategy.OnPush,encapsulation:r.ViewEncapsulation.None,exportAs:"apPrismRxjs",preserveWhitespaces:!1,providers:[ne],selector:"ngx-prism",template:'<pre class="language-{{language}}"><code #codeElementRef class="language-{{language}}" *ngIf="code">{{code}}</code><code #codeElementRef class="language-{{language}}" *ngIf="!code"><ng-content></ng-content></code></pre><ng-template *ngIf="code" #loading>Loading...</ng-template>'}]}],ce.ctorParameters=(()=>[{type:ne}]),ce=se([(ae=["code","language"],function(e){te(e,ae),re(e,ae)}),ie("design:paramtypes",[ne])],ce);var ae;class ue{}ue.decorators=[{type:r.NgModule,args:[{declarations:[ce],exports:[ce],imports:[t.CommonModule]}]}],ue.ctorParameters=(()=>[]),e.ApPrismModule=b,e.ApPrismRxjsModule=ue,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=bundle.umd.js.map