text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@tinymce/tinymce-angular",["exports","@angular/core","@angular/common","@angular/forms"],e):e(((t=t||self).tinymce=t.tinymce||{},t.tinymce["tinymce-angular"]={}),t.ng.core,t.ng.common,t.ng.forms)}(this,(function(t,e,o,n){"use strict";
  /*! *****************************************************************************
      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 i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function u(t,e,o,n){var i,r=arguments.length,u=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,o,n);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(u=(r<3?i(u):r>3?i(e,o,u):i(e,o))||u);return r>3&&u&&Object.defineProperty(e,o,u),u}function p(t,e){return function(o,n){e(o,n,t)}}var s=function(){var t="undefined"!=typeof window?window:void 0;return t&&t.tinymce?t.tinymce:null},d=function(){function t(){this.onBeforePaste=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.onClick=new e.EventEmitter,this.onContextMenu=new e.EventEmitter,this.onCopy=new e.EventEmitter,this.onCut=new e.EventEmitter,this.onDblclick=new e.EventEmitter,this.onDrag=new e.EventEmitter,this.onDragDrop=new e.EventEmitter,this.onDragEnd=new e.EventEmitter,this.onDragGesture=new e.EventEmitter,this.onDragOver=new e.EventEmitter,this.onDrop=new e.EventEmitter,this.onFocus=new e.EventEmitter,this.onFocusIn=new e.EventEmitter,this.onFocusOut=new e.EventEmitter,this.onKeyDown=new e.EventEmitter,this.onKeyPress=new e.EventEmitter,this.onKeyUp=new e.EventEmitter,this.onMouseDown=new e.EventEmitter,this.onMouseEnter=new e.EventEmitter,this.onMouseLeave=new e.EventEmitter,this.onMouseMove=new e.EventEmitter,this.onMouseOut=new e.EventEmitter,this.onMouseOver=new e.EventEmitter,this.onMouseUp=new e.EventEmitter,this.onPaste=new e.EventEmitter,this.onSelectionChange=new e.EventEmitter,this.onActivate=new e.EventEmitter,this.onAddUndo=new e.EventEmitter,this.onBeforeAddUndo=new e.EventEmitter,this.onBeforeExecCommand=new e.EventEmitter,this.onBeforeGetContent=new e.EventEmitter,this.onBeforeRenderUI=new e.EventEmitter,this.onBeforeSetContent=new e.EventEmitter,this.onChange=new e.EventEmitter,this.onClearUndos=new e.EventEmitter,this.onDeactivate=new e.EventEmitter,this.onDirty=new e.EventEmitter,this.onExecCommand=new e.EventEmitter,this.onGetContent=new e.EventEmitter,this.onHide=new e.EventEmitter,this.onInit=new e.EventEmitter,this.onLoadContent=new e.EventEmitter,this.onNodeChange=new e.EventEmitter,this.onPostProcess=new e.EventEmitter,this.onPostRender=new e.EventEmitter,this.onPreInit=new e.EventEmitter,this.onPreProcess=new e.EventEmitter,this.onProgressState=new e.EventEmitter,this.onRedo=new e.EventEmitter,this.onRemove=new e.EventEmitter,this.onReset=new e.EventEmitter,this.onSaveContent=new e.EventEmitter,this.onSetAttrib=new e.EventEmitter,this.onObjectResizeStart=new e.EventEmitter,this.onObjectResized=new e.EventEmitter,this.onObjectSelected=new e.EventEmitter,this.onSetContent=new e.EventEmitter,this.onShow=new e.EventEmitter,this.onSubmit=new e.EventEmitter,this.onUndo=new e.EventEmitter,this.onVisualAid=new e.EventEmitter}return u([e.Output()],t.prototype,"onBeforePaste",void 0),u([e.Output()],t.prototype,"onBlur",void 0),u([e.Output()],t.prototype,"onClick",void 0),u([e.Output()],t.prototype,"onContextMenu",void 0),u([e.Output()],t.prototype,"onCopy",void 0),u([e.Output()],t.prototype,"onCut",void 0),u([e.Output()],t.prototype,"onDblclick",void 0),u([e.Output()],t.prototype,"onDrag",void 0),u([e.Output()],t.prototype,"onDragDrop",void 0),u([e.Output()],t.prototype,"onDragEnd",void 0),u([e.Output()],t.prototype,"onDragGesture",void 0),u([e.Output()],t.prototype,"onDragOver",void 0),u([e.Output()],t.prototype,"onDrop",void 0),u([e.Output()],t.prototype,"onFocus",void 0),u([e.Output()],t.prototype,"onFocusIn",void 0),u([e.Output()],t.prototype,"onFocusOut",void 0),u([e.Output()],t.prototype,"onKeyDown",void 0),u([e.Output()],t.prototype,"onKeyPress",void 0),u([e.Output()],t.prototype,"onKeyUp",void 0),u([e.Output()],t.prototype,"onMouseDown",void 0),u([e.Output()],t.prototype,"onMouseEnter",void 0),u([e.Output()],t.prototype,"onMouseLeave",void 0),u([e.Output()],t.prototype,"onMouseMove",void 0),u([e.Output()],t.prototype,"onMouseOut",void 0),u([e.Output()],t.prototype,"onMouseOver",void 0),u([e.Output()],t.prototype,"onMouseUp",void 0),u([e.Output()],t.prototype,"onPaste",void 0),u([e.Output()],t.prototype,"onSelectionChange",void 0),u([e.Output()],t.prototype,"onActivate",void 0),u([e.Output()],t.prototype,"onAddUndo",void 0),u([e.Output()],t.prototype,"onBeforeAddUndo",void 0),u([e.Output()],t.prototype,"onBeforeExecCommand",void 0),u([e.Output()],t.prototype,"onBeforeGetContent",void 0),u([e.Output()],t.prototype,"onBeforeRenderUI",void 0),u([e.Output()],t.prototype,"onBeforeSetContent",void 0),u([e.Output()],t.prototype,"onChange",void 0),u([e.Output()],t.prototype,"onClearUndos",void 0),u([e.Output()],t.prototype,"onDeactivate",void 0),u([e.Output()],t.prototype,"onDirty",void 0),u([e.Output()],t.prototype,"onExecCommand",void 0),u([e.Output()],t.prototype,"onGetContent",void 0),u([e.Output()],t.prototype,"onHide",void 0),u([e.Output()],t.prototype,"onInit",void 0),u([e.Output()],t.prototype,"onLoadContent",void 0),u([e.Output()],t.prototype,"onNodeChange",void 0),u([e.Output()],t.prototype,"onPostProcess",void 0),u([e.Output()],t.prototype,"onPostRender",void 0),u([e.Output()],t.prototype,"onPreInit",void 0),u([e.Output()],t.prototype,"onPreProcess",void 0),u([e.Output()],t.prototype,"onProgressState",void 0),u([e.Output()],t.prototype,"onRedo",void 0),u([e.Output()],t.prototype,"onRemove",void 0),u([e.Output()],t.prototype,"onReset",void 0),u([e.Output()],t.prototype,"onSaveContent",void 0),u([e.Output()],t.prototype,"onSetAttrib",void 0),u([e.Output()],t.prototype,"onObjectResizeStart",void 0),u([e.Output()],t.prototype,"onObjectResized",void 0),u([e.Output()],t.prototype,"onObjectSelected",void 0),u([e.Output()],t.prototype,"onSetContent",void 0),u([e.Output()],t.prototype,"onShow",void 0),u([e.Output()],t.prototype,"onSubmit",void 0),u([e.Output()],t.prototype,"onUndo",void 0),u([e.Output()],t.prototype,"onVisualAid",void 0),t}(),a=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],c=function(t,e){a.forEach((function(o){var n=t[o];e.on(o.substring(2),(function(o){return t.ngZone.run((function(){return n.emit({event:o,editor:e})}))}))}))},v=0,l=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++v+String(e)},h=function(t){return void 0!==t&&"textarea"===t.tagName.toLowerCase()},y=function(t){return void 0===t||""===t?[]:Array.isArray(t)?t:t.split(" ")},m=function(t,e){return y(t).concat(y(e))},E=function(){},f=function(t){return null==t},O=function(){return{listeners:[],scriptId:l("tiny-script"),scriptLoaded:!1}},g=function(){var t=O();return{load:function(e,o,n){t.scriptLoaded?n():(t.listeners.push(n),e.getElementById(t.scriptId)||function(t,e,o,n){var i=e.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=t,i.src=o;var r=function(){i.removeEventListener("load",r),n()};i.addEventListener("load",r),e.head&&e.head.appendChild(i)}(t.scriptId,e,o,(function(){t.listeners.forEach((function(t){return t()})),t.scriptLoaded=!0})))},reinitialize:function(){t=O()}}},w=g(),C=new e.InjectionToken("TINYMCE_SCRIPT_SRC"),b={provide:n.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return S})),multi:!0},S=function(t){function n(e,o,n,i){var r=t.call(this)||this;return r.platformId=n,r.tinymceScriptSrc=i,r.cloudChannel="5",r.apiKey="no-api-key",r.id="",r.modelEvents="change keyup undo redo",r.onTouchedCallback=E,r.onChangeCallback=E,r._elementRef=e,r.ngZone=o,r.initialise=r.initialise.bind(r),r}return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(n,t),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this._editor&&this._editor.initialized&&this._editor.setMode(t?"readonly":"design")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"editor",{get:function(){return this._editor},enumerable:!0,configurable:!0}),n.prototype.writeValue=function(t){this._editor&&this._editor.initialized?this._editor.setContent(f(t)?"":t):this.initialValue=null===t?void 0:t},n.prototype.registerOnChange=function(t){this.onChangeCallback=t},n.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},n.prototype.setDisabledState=function(t){this._editor?this._editor.setMode(t?"readonly":"design"):t&&(this.init=r({},this.init,{readonly:!0}))},n.prototype.ngAfterViewInit=function(){o.isPlatformBrowser(this.platformId)&&(this.id=this.id||l("tiny-angular"),this.inline=void 0!==this.inline?"boolean"!=typeof this.inline||this.inline:this.init&&this.init.inline,this.createElement(),null!==s()?this.initialise():this._element&&this._element.ownerDocument&&w.load(this._element.ownerDocument,this.getScriptSrc(),this.initialise))},n.prototype.ngOnDestroy=function(){null!==s()&&s().remove(this._editor)},n.prototype.createElement=function(){var t="string"==typeof this.tagName?this.tagName:"div";this._element=document.createElement(this.inline?t:"textarea"),this._element&&(this._element.id=this.id,h(this._element)&&(this._element.style.visibility="hidden"),this._elementRef.nativeElement.appendChild(this._element))},n.prototype.initialise=function(){var t=this,e=r({},this.init,{target:this._element,inline:this.inline,readonly:this.disabled,plugins:m(this.init&&this.init.plugins,this.plugins),toolbar:this.toolbar||this.init&&this.init.toolbar,setup:function(e){t._editor=e,e.on("init",(function(o){t.initEditor(e)})),c(t,e),t.init&&"function"==typeof t.init.setup&&t.init.setup(e)}});h(this._element)&&(this._element.style.visibility=""),this.ngZone.runOutsideAngular((function(){s().init(e)}))},n.prototype.getScriptSrc=function(){return f(this.tinymceScriptSrc)?"https://cdn.tiny.cloud/1/"+this.apiKey+"/tinymce/"+this.cloudChannel+"/tinymce.min.js":this.tinymceScriptSrc},n.prototype.initEditor=function(t){var e=this;t.on("blur",(function(){return e.ngZone.run((function(){return e.onTouchedCallback()}))})),t.on(this.modelEvents,(function(){e.ngZone.run((function(){return e.onChangeCallback(t.getContent({format:e.outputFormat}))}))})),"string"==typeof this.initialValue&&this.ngZone.run((function(){t.setContent(e.initialValue),e.onChangeCallback(t.getContent({format:e.outputFormat}))}))},n.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[C]}]}]},u([e.Input()],n.prototype,"disabled",null),u([e.Input()],n.prototype,"cloudChannel",void 0),u([e.Input()],n.prototype,"apiKey",void 0),u([e.Input()],n.prototype,"init",void 0),u([e.Input()],n.prototype,"id",void 0),u([e.Input()],n.prototype,"initialValue",void 0),u([e.Input()],n.prototype,"outputFormat",void 0),u([e.Input()],n.prototype,"inline",void 0),u([e.Input()],n.prototype,"tagName",void 0),u([e.Input()],n.prototype,"plugins",void 0),u([e.Input()],n.prototype,"toolbar",void 0),u([e.Input()],n.prototype,"modelEvents",void 0),n=u([e.Component({selector:"editor",template:"<ng-template></ng-template>",providers:[b],styles:[":host { display: block; }"]}),p(2,e.Inject(e.PLATFORM_ID)),p(3,e.Optional()),p(3,e.Inject(C))],n)}(d),_=function(){function t(){}return t=u([e.NgModule({imports:[o.CommonModule,n.FormsModule],declarations:[S],exports:[S]})],t)}();t.EditorComponent=S,t.EditorModule=_,t.TINYMCE_SCRIPT_SRC=C,t.ɵa=d,Object.defineProperty(t,"__esModule",{value:!0})}));
  //# sourceMappingURL=tinymce-tinymce-angular.umd.min.js.map