tinymce-rails 5.0.14 → 5.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +3 -3
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
  17. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  39. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -1
  43. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
  44. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -2
  48. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.css +7 -0
  49. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.min.css +7 -0
  50. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
  51. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
  52. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  53. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  54. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  55. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  56. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
  57. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
  58. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  59. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
  60. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  61. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  62. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
  63. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  64. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  65. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82ad3a419045eb4f1f2004b363206fa490cfe3e34c53161bd69143e4ae3135be
4
- data.tar.gz: dc31a70b97ff33c946992e3ee55c647332269763d8b06455e032cdfd59173633
3
+ metadata.gz: 6ada0ccb4c7b9408c438216a4970ca05a1cba8d44d8e4f48fe3e9ade3ca73b2a
4
+ data.tar.gz: 06bf3ebc1b02531f2f22d8b9859f4d9bbfb30c15e87d2485c6c10a2a9196fe51
5
5
  SHA512:
6
- metadata.gz: 8caa09d91ff8cd6995904cbb03affab4a2edd92ecfebe55e9f0b5e2f680242226978289ea13429cc7f3c0e874ede880786cc886f7d7ee23af4700a10dbc687bb
7
- data.tar.gz: b997f5d6fbb7e4d6b7a76f48fd0353ce87c150ef143d1b710ce0b8df0697ed92349a69c21712b0c0d852cf52eef1678a7bf6164c8f3bee07133ddbb677b30b92
6
+ metadata.gz: 0cae2b4a020e692f16222a3771719c9c014435aaa2945d8af2d7d5ac4788f2ce80b030b405e50e3cb7488e79fcdea458f8878ebadd6723309e3311ddca9ceb12
7
+ data.tar.gz: 997e7771d2e3b79c696f9e0bd93b7bbaac5677c7dd050d3121d48fefcab5287d972be3be6959b9f5117b2dcf946076f8ef00a422172bfff6088250f7627ccd37
@@ -4,7 +4,7 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  (function (domGlobals) {
10
10
  'use strict';
@@ -27176,8 +27176,8 @@
27176
27176
  suffix: null,
27177
27177
  $: DomQuery,
27178
27178
  majorVersion: '5',
27179
- minorVersion: '0.14',
27180
- releaseDate: '2019-08-19',
27179
+ minorVersion: '0.15',
27180
+ releaseDate: '2019-09-02',
27181
27181
  editors: legacyEditors,
27182
27182
  i18n: I18n,
27183
27183
  activeEditor: null,
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "5.0.14"
4
- TINYMCE_VERSION = "5.0.14"
3
+ VERSION = "5.0.15"
4
+ TINYMCE_VERSION = "5.0.15"
5
5
  end
6
6
  end
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var n,t,e,r,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},o=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){O(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){O(e,"OL",t["list-style-type"])})},i=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},l=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},c=function(n){return function(){return n}},s=c(!1),f=c(!0),a=s,d=f,g=function(){return p},p=(r={fold:function(n,t){return n()},is:a,isSome:a,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:a,forall:d,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),m=function(e){var n=function(){return e},t=function(){return u},r=function(n){return n(e)},u={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return m(n(e))},ap:function(n){return n.fold(g,function(n){return m(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?u:p},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(a,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return u},y=function(n){return null===n||n===undefined?p:m(n)},h=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},L=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},N=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return y(e)},S=function(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e;return-1}(t.parents,h),u=-1!==r?t.parents.slice(0,r):t.parents,o=v.grep(u,L(n));return 0<o.length&&o[0].nodeName===e},T=function(n,t,e,r,u,o){var i,l,c,s,f,a,d,g,p,m,y;0<o.length?(d=t,g=e,p=r,m=u,y=o,(a=n).ui.registry.addSplitButton(d,{tooltip:g,icon:"OL"===m?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(v.map(y,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===m?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return a.execCommand(p)},onItemAction:function(n,t){O(a,m,t)},select:function(t){return N(a).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){var n=function(n){t.setActive(S(a,n,m))};return a.on("NodeChange",n),function(){return a.off("NodeChange",n)}}})):(l=t,c=e,s=r,f=u,(i=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===f?"ordered-list":"unordered-list",onSetup:function(t){var n=function(n){t.setActive(S(i,n,f))};return i.on("NodeChange",n),function(){return i.off("NodeChange",n)}},onAction:function(){return i.execCommand(s)}}))},b=function(n){T(n,"numlist","Numbered list","InsertOrderedList","OL",i(n)),T(n,"bullist","Bullet list","InsertUnorderedList","UL",l(n))};!function A(){u.add("advlist",function(n){var t,e,r;e="lists",r=(t=n).settings.plugins?t.settings.plugins:"",-1!==v.inArray(r.split(/[ ,]/),e)&&(b(n),o(n))})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(e)},t=function(e){var t=e.selection.getNode();return"A"===t.tagName&&""===e.dom.getAttrib(t,"href")?t.getAttribute("id")||t.getAttribute("name"):""},r=function(e,t){var n=e.selection.getNode();"A"===n.tagName&&""===e.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=t,e.undoManager.add()):(e.focus(),e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t})))},n=function(o){var e=t(o);o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:e},onSubmit:function(e){var t,n;t=o,n=e.getData().id,(a(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})},o=function(e){e.addCommand("mceAnchor",function(){n(e)})},i=function(o){return function(e){for(var t=0;t<e.length;t++)(n=e[t]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||e[t].attr("contenteditable",o);var n}},c=function(e){e.on("PreInit",function(){e.parser.addNodeFilter("a",i("false")),e.serializer.addNodeFilter("a",i(null))})},d=function(t){t.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return t.execCommand("mceAnchor")},onSetup:function(e){return t.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),t.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return t.execCommand("mceAnchor")}})};!function u(){e.add("anchor",function(e){c(e),o(e),d(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),m=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},y=function(e){return e.getParam("default_link_target",!1)},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},p=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,f,s,d,l,c,u,g=m(e),h=y(e);if("A"!==e.selection.getNode().tagName){if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,k(i,l,c),p(i,l,c),i.endOffset<5)return;o=i.endOffset,a=l}else{if(3!==(a=i.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(k(i,a,0),p(i,a,a.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-t}for(r=o;k(i,a,2<=o?o-2:0),p(i,a,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);var C;(C=i.toString())===n||" "===C||160===C.charCodeAt(0)?(k(i,a,o),p(i,a,r),o+=1):(0===i.startOffset?k(i,a,0):k(i,a,o),p(i,a,r)),"."===(s=i.toString()).charAt(s.length-1)&&p(i,a,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),f=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,d[1]+d[2]),!1!==h&&e.dom.setAttrib(e.selection.getNode(),"target",h),e.selection.moveToBookmark(f),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),i.ie&&i.ie<=11?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};!function n(){e.add("autolink",function(e){t(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var i=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return i(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(e){return e.fire("ResizeEditor")},v=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},y=function(e){return e.getParam("max_height",0,"number")},o=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},p=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},u=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},z=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},C=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if((a=e).plugins.fullscreen&&a.plugins.fullscreen.isFullscreen())z(e,!0);else{var a,s=u.documentElement,f=p(e);i=v(e);var c=C(r,s,"margin-top",!0),g=C(r,s,"margin-bottom",!0);(o=s.offsetHeight+c+g+f)<0&&(o=0);var l=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+l>v(e)&&(i=o+l);var m=y(e);m&&m<i?(i=m,z(e,!0)):z(e,!1),i!==t.get()&&(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),h(e),d.webkit&&n<0&&b(e,t))}},n={setup:function(t,n){t.on("init",function(){var e=o(t);t.dom.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){b(t,n)}),u(t)&&t.on("init",function(){a(t,n,20,100,function(){a(t,n,5,1e3)})})},resize:b},s=function(e,t){e.addCommand("mceAutoResize",function(){n.resize(e,t)})};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=i(0);s(e,t),n.setup(e,t)}})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(r){"use strict";var o=function(t){var e=t,r=function(){return e};return{get:r,set:function(t){e=t},clone:function(){return o(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},s=function(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,r.document.location.pathname)).replace(/\{query\}/g,r.document.location.search)).replace(/\{hash\}/g,r.document.location.hash)).replace(/\{id\}/g,t.id)},c=function(t,e){var r=t.settings.forced_root_block;return""===(e=i.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+r+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+r+">|<br>$","i").test(e)},f=function(t){var e=parseInt(a.getItem(s(t)+"time"),10)||0;return!((new Date).getTime()-e>u(t.settings.autosave_retention,"20m"))||(l(t,!1),!1)},l=function(t,e){var r=s(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=s(t);!c(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},v=function(t){var e=s(t);f(t)&&(t.setContent(a.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},d=function(t,e){var r=u(t.settings.autosave_interval,"30s");e.get()||(n.setInterval(function(){t.removed||m(t)},r),e.set(!0))},g=function(t){t.undoManager.transact(function(){v(t),l(t)}),t.focus()};function y(n){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=o.concat(t);return n.apply(null,r)}}var p=tinymce.util.Tools.resolve("tinymce.EditorManager"),D=function(r,t){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};!function e(){t.add("autosave",function(t){var e,r,n=o(!1);return t.editorManager.on("BeforeUnload",function(t){var e;i.each(p.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),d(e=t,n),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:D(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:D(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&v(t)}),{hasDraft:y(f,r=t),storeDraft:y(m,r),restoreDraft:y(v,r),removeDraft:y(l,r),isEmpty:y(c,r)}})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),t},i=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(l){"use strict";var n,e,r,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){return n.fire("insertCustomChar",{chr:e})},f=function(n,e){var r=i(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n){return n.settings.charmap},u=function(n){return n.settings.charmap_append},s=function(n){return function(){return n}},g=s(!1),m=s(!0),h=g,d=m,p=function(){return y},y=(t={fold:function(n,e){return n()},is:h,isSome:h,isNone:d,getOr:r=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:e,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:h,forall:d,filter:p,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(t),t),w=function(r){var n=function(){return r},e=function(){return a},t=function(n){return n(r)},a={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:d,isNone:h,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return w(n(r))},ap:function(n){return n.fold(p,function(n){return w(n(r))})},each:function(n){n(r)},bind:t,flatten:n,exists:t,forall:t,filter:function(n){return n(r)?a:y},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(h,function(n){return e(r,n)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return a},b={some:w,none:p,from:function(n){return null===n||n===undefined?y:w(n)}},v=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},k=v("array"),C=v("function"),A=Array.prototype.slice,O=function(n,e){for(var r=n.length,t=new Array(r),a=0;a<r;a++){var i=n[a];t[a]=e(i,a,n)}return t},x=Array.prototype.push,q=function(n,e){return function(n){for(var e=[],r=0,t=n.length;r<t;++r){if(!k(n[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+n);x.apply(e,n[r])}return e}(O(n,e))},S=(C(Array.from)&&Array.from,o.isArray),T="User Defined",E=function(n){return S(n)?[].concat((e=n,o.grep(e,function(n){return S(n)&&2===n.length}))):"function"==typeof n?n():[];var e},z=function(n){var e=function(n,e){var r=c(n);r&&(e=[{name:T,characters:E(r)}]);var t=u(n);if(t){var a=o.grep(e,function(n){return n.name===T});return a.length?(a[0].characters=[].concat(a[0].characters).concat(E(t)),e):[].concat(e).concat({name:T,characters:E(t)})}return e}(n,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<e.length?[{name:"All",characters:q(e,function(n){return n.characters})}].concat(e):e},N=function(e){return{getCharMap:function(){return z(e)},insertChar:function(n){f(e,n)}}},U=function(n){var e=n,r=function(){return e};return{get:r,set:function(n){e=n},clone:function(){return U(r())}}},D=function(n,e){return-1!==n.indexOf(e)},I=function(n,e){var a=[],i=e.toLowerCase();return function(n,e){for(var r=0,t=n.length;r<t;r++)e(n[r],r,n)}(n.characters,function(n){var e,r,t;e=n[0],r=n[1],t=i,(D(String.fromCharCode(e).toLowerCase(),t)||D(r.toLowerCase(),t)||D(r.toLowerCase().replace(/\s+/g,""),t))&&a.push(n)}),O(a,function(n){return{text:n[1],value:String.fromCharCode(n[0]),icon:String.fromCharCode(n[0])}})},P="pattern",j=function(r,n){var t,a,i,e=function(){return[{label:"Search",type:"input",name:P},{type:"collection",name:"results"}]},o=1===n.length?U(T):U("All"),c=function(r,t){(function(n,e){for(var r=0,t=n.length;r<t;r++){var a=n[r];if(e(a,r,n))return b.some(a)}return b.none()})(n,function(n){return n.name===o.get()}).each(function(n){var e=I(n,t);r.setData({results:e})})},u=(t=function(n){var e=n.getData().pattern;c(n,e)},a=40,i=null,{cancel:function(){null!==i&&(l.clearTimeout(i),i=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==i&&l.clearTimeout(i),i=l.setTimeout(function(){t.apply(null,n),i=null},a)}}),s={title:"Special Character",size:"normal",body:1===n.length?{type:"panel",items:e()}:{type:"tabpanel",tabs:O(n,function(n){return{title:n.name,name:n.name,items:e()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:I(n[0],"")},onAction:function(n,e){"results"===e.name&&(f(r,e.value),n.close())},onTabChange:function(n,e){o.set(e.newTabName),u.throttle(n)},onChange:function(n,e){e.name===P&&u.throttle(n)}};r.windowManager.open(s)},L=function(n,e){n.addCommand("mceShowCharmap",function(){j(n,e)})},M=tinymce.util.Tools.resolve("tinymce.util.Promise"),R=function(n){n.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}})};!function Y(){a.add("charmap",function(n){var t,a,e=z(n);return L(n,e),R(n),t=n,a=e[0],t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,n){return new M(function(n,e){n(I(a,r))})},onAction:function(n,e,r){t.selection.setRng(e),t.insertContent(r),n.hide()}}),N(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};!function u(){e.add("code",function(e){return c(e),i(e),{}})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,g=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&c.self instanceof WorkerGlobalScope?c.self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=g.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){switch(S.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=S.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return S.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=S.util.clone(S.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||S.languages)[n];if(2===arguments.length){for(var i in t=e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}var o={};for(var s in r)if(r.hasOwnProperty(s)){if(s===e)for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o[s]=r[s]}return S.languages.DFS(S.languages,function(e,t){t===a[n]&&e!==n&&(this[e]=o)}),a[n]=o},DFS:function(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.call(e,a,e[a],n||a),"Object"===S.util.type(e[a])?S.languages.DFS(e[a],t):"Array"===S.util.type(e[a])&&S.languages.DFS(e[a],t,a))}},plugins:{},highlightAll:function(e,t){for(var n=c.document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0,r=void 0;r=n[a++];)S.highlightElement(r,!0===e,t)},highlightElement:function(e,t,n){for(var a,r,i=e;i&&!u.test(i.className);)i=i.parentNode;i&&(a=(i.className.match(u)||[,""])[1],r=S.languages[a]),e.className=e.className.replace(u,"").replace(/\s+/g," ")+" language-"+a,i=e.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(u,"").replace(/\s+/g," ")+" language-"+a);var o=e.textContent,s={element:e,language:a,grammar:r,code:o};if(o&&r)if(S.hooks.run("before-highlight",s),t&&g.Worker){var l=new c.Worker(S.filename);l.onmessage=function(e){s.highlightedCode=e.data,S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(s.element),S.hooks.run("after-highlight",s),S.hooks.run("complete",s)},l.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else s.highlightedCode=S.highlight(s.code,s.grammar,s.language),S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(e),S.hooks.run("after-highlight",s),S.hooks.run("complete",s);else S.hooks.run("complete",s)},highlight:function(e,t,n){var a=S.tokenize(e,t);return s.stringify(S.util.encode(a),n)},tokenize:function(e,t,n){var a=S.Token,r=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s="Array"===S.util.type(s)?s:[s];for(var l=0;l<s.length;++l){var u=s[l],c=u.inside,g=!!u.lookbehind,d=0,p=u.alias;u=u.pattern||u;for(var f=0;f<r.length;f++){var h=r[f];if(r.length>e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+"</"+a.tag+">"},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);var a,o,s,l,u,d={isCodeSample:function M(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function F(n){return function(e,t){return n(t)}}},p=function(e){return function(){return e}},f=p(!1),h=p(!0),m=f,b=h,y=function(){return v},v=(l={fold:function(e,t){return e()},is:m,isSome:m,isNone:b,getOr:s=function(e){return e},getOrThunk:o=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:s,orThunk:o,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:m,forall:b,filter:y,equals:a=function(e){return e.isNone()},equals_:a,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(l),l),k=function(n){var e=function(){return n},t=function(){return r},a=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:b,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(y,function(e){return k(e(n))})},each:function(e){e(n)},bind:a,flatten:e,exists:a,forall:a,filter:function(e){return e(n)?r:v},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(m,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},w={some:k,none:y,from:function(e){return null===e||e===undefined?v:k(e)}},x=function(e){var t=e.selection?e.selection.getNode():null;return d.isCodeSample(t)?w.some(t):w.none()},S=x,A=function(t,n,a){t.undoManager.transact(function(){var e=x(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+n+'">'+a+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},C=function(e){return x(e).fold(function(){return""},function(e){return e.textContent})},_=function(e){return e.settings.codesample_languages},N=function(e){var t=_(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},O=function(e,n){return S(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},z=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===u}),P=Array.prototype.slice,W=(z(Array.from)&&Array.from,function(n){var e,t=N(n),a=(e=t,0===e.length?w.none():w.some(e[0])).fold(function(){return""},function(e){return e.value}),r=O(n,a),i=C(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:function(e){var t=e.getData();A(n,t.language,t.code),e.close()}})}),j=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||d.isCodeSample(e)?W(t):t.formatter.toggle("code")})},T=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(d.trimArg(d.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(d.trimArg(d.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},B=function(a){a.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return W(a)},onSetup:function(n){var e=function(){var e,t;n.setActive((t=(e=a).selection.getStart(),e.dom.is(t,"pre.language-markup")))};return a.on("NodeChange",e),function(){return a.off("NodeChange",e)}}}),a.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return W(a)}})};!function $(){e.add("codesample",function(t){T(t),B(t),j(t),t.on("dblclick",function(e){d.isCodeSample(e.target)&&W(t)})})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(c){"use strict";var n,t,e,r,o,i,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),f.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},l=function(n){n.addCommand("mceDirectionLTR",function(){d(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){d(n,"rtl")})},a=function(n){return function(){return n}},m=a(!1),N=a(!0),s=m,g=N,T=function(){return E},E=(r={fold:function(n,t){return n()},is:s,isSome:s,isNone:g,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:T,ap:T,each:function(){},bind:T,flatten:T,exists:s,forall:g,filter:T,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(r),r),O=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:g,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return O(n(e))},ap:function(n){return n.fold(T,function(n){return O(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:E},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(s,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},y=function(n){return null===n||n===undefined?E:O(n)},p=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:a(n)}},D={fromHtml:function(n,t){var e=(t||c.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw c.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return p(e.childNodes[0])},fromTag:function(n,t){var e=(t||c.document).createElement(n);return p(e)},fromText:function(n,t){var e=(t||c.document).createTextNode(n);return p(e)},fromDom:p,fromPoint:function(n,t,e){var r=n.dom();return y(r.elementFromPoint(t,e)).map(p)}},h=(o="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===o}),_=Array.prototype.slice,v=(h(Array.from)&&Array.from,c.Node.ATTRIBUTE_NODE,c.Node.CDATA_SECTION_NODE,c.Node.COMMENT_NODE,c.Node.DOCUMENT_NODE,c.Node.DOCUMENT_TYPE_NODE,c.Node.DOCUMENT_FRAGMENT_NODE,c.Node.ELEMENT_NODE,c.Node.TEXT_NODE),C=(c.Node.PROCESSING_INSTRUCTION_NODE,c.Node.ENTITY_REFERENCE_NODE,c.Node.ENTITY_NODE,c.Node.NOTATION_NODE,"undefined"!=typeof c.window?c.window:Function("return this;")(),i=v,function(n){return n.dom().nodeType===i}),A=function(n,t){var e,r,o=n.dom(),i=c.window.getComputedStyle(o).getPropertyValue(t),u=""!==i||(r=C(e=n)?e.dom().parentNode:e.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:w(o,t);return null===u?undefined:u},w=function(n,t){return(e=n).style!==undefined&&h(e.style.getPropertyValue)?n.style.getPropertyValue(t):"";var e},S=function(t,r){return function(e){var n=function(n){var t=D.fromDom(n.element);e.setActive(("rtl"===A(t,"direction")?"rtl":"ltr")===r)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}},R=function(n){n.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return n.execCommand("mceDirectionLTR")},onSetup:S(n,"ltr")}),n.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return n.execCommand("mceDirectionRTL")},onSetup:S(n,"rtl")})};!function M(){u.add("directionality",function(n){l(n),R(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
- !function(m){"use strict";var n,t,e,r,o,u,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return function(){return n}},a=c(!1),l=c(!0),s=a,f=l,g=function(){return d},d=(r={fold:function(n,t){return n()},is:s,isSome:s,isNone:f,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:s,forall:f,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),y=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:f,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return y(n(e))},ap:function(n){return n.fold(g,function(n){return y(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:d},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(s,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},p={some:y,none:g,from:function(n){return null===n||n===undefined?d:y(n)}},v=(o="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===o}),h=Array.prototype.slice,b=function(n,t){for(var e=0,r=n.length;e<r;e++){if(t(n[e],e,n))return p.some(e)}return p.none()},w=(v(Array.from)&&Array.from,function(n,t){return-1!==n.indexOf(t)}),O=function(n,t){return w(n.title.toLowerCase(),t)||(e=n.keywords,b(e,function(n){return w(n.toLowerCase(),t)}).isSome());var e},A=function(n,t,e){for(var r=[],o=t.toLowerCase(),i=e.fold(function(){return a},function(t){return function(n){return t<=n}}),u=0;u<n.length&&(0!==t.length&&!O(n[u],o)||(r.push({value:n[u]["char"],text:n[u].title,icon:n[u]["char"]}),!i(r.length)));u++);return r},j=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return j(e())}}},C=Object.prototype.hasOwnProperty,k=(u=function(n,t){return t},function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<n.length;r++){var o=n[r];for(var i in o)C.call(o,i)&&(e[i]=u(e[i],o[i]))}return e}),T=Object.keys,_=Object.hasOwnProperty,P=function(n,t){for(var e=T(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i,n)}},S=function(r,o){var i={};return P(r,function(n,t){var e=o(n,t,r);i[e.k]=e.v}),i},D=tinymce.util.Tools.resolve("tinymce.Resource"),x=tinymce.util.Tools.resolve("tinymce.util.Delay"),L=tinymce.util.Tools.resolve("tinymce.util.Promise"),N=function(n,t){return n.getParam("emoticons_database_url",t+"/js/emojis"+n.suffix+".js")},E=function(n){return n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string")},F=function(n){return n.getParam("emoticons_append",{},"object")},q="All",z={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},I=function(n,t){return e=n,r=t,_.call(e,r)?n[t]:t;var e,r},M=function(n){var r,t=F(n);return r=function(n){return k({keywords:[],category:"user"},n)},S(t,function(n,t,e){return{k:t,v:r(n,t,e)}})},U=function(r,o,n){var u=j(p.none()),c=j(p.none());r.on("init",function(){D.load(n,o).then(function(n){var t,o,i,e=M(r);t=k(n,e),o={},i=[],P(t,function(n,t){var e={title:t,keywords:n.keywords,"char":n["char"],category:I(z,n.category)},r=o[e.category]!==undefined?o[e.category]:[];o[e.category]=r.concat([e]),i.push(e)}),u.set(p.some(o)),c.set(p.some(i))},function(n){m.console.log("Failed to load emoticons: "+n),u.set(p.some({})),c.set(p.some([]))})});var e=function(){return c.get().getOr([])},i=function(){return u.get().isSome()&&c.get().isSome()};return{listCategories:function(){return[q].concat(T(u.get().getOr({})))},hasLoaded:i,waitForLoad:function(){return i()?L.resolve(!0):new L(function(n,t){var e=3,r=x.setInterval(function(){i()?(x.clearInterval(r),n(!0)):--e<0&&(m.console.log("Could not load emojis from url: "+o),x.clearInterval(r),t(!1))},500)})},listAll:e,listCategory:function(t){return t===q?e():u.get().bind(function(n){return p.from(n[t])}).getOr([])}}},R="pattern",B=function(o,u){var e,r,i,n={pattern:"",results:A(u.listAll(),"",p.some(300))},c=j(q),a=(e=function(n){var t,e,r,o,i;e=(t=n).getData(),r=c.get(),o=u.listCategory(r),i=A(o,e[R],r===q?p.some(300):p.none()),t.setData({results:i})},r=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){e.apply(null,n),i=null},r)}}),t={label:"Search",type:"input",name:R},l={type:"collection",name:"results"},s=function(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r}(u.listCategories(),function(n){return{title:n,name:n,items:[t,l]}})},initialData:n,onTabChange:function(n,t){c.set(t.newTabName),a.throttle(n)},onChange:a.throttle,onAction:function(n,t){var e,r;"results"===t.name&&(e=o,r=t.value,e.insertContent(r),n.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},f=o.windowManager.open(s());f.focus(R),u.hasLoaded()||(f.block("Loading emoticons..."),u.waitForLoad().then(function(){f.redial(s()),a.throttle(f),f.focus(R),f.unblock()})["catch"](function(n){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(R),f.unblock()}))},G=function(n,t){var e=function(){return B(n,t)};n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function H(){i.add("emoticons",function(n,t){var r,o,e=N(n,t),i=E(n),u=U(n,e,i);G(n,u),o=u,(r=n).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return A(n,t,p.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})})}()}(window);
9
+ !function(m){"use strict";var n,t,e,r,o,u,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return function(){return n}},a=c(!1),l=c(!0),s=a,f=l,g=function(){return d},d=(r={fold:function(n,t){return n()},is:s,isSome:s,isNone:f,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:s,forall:f,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),y=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:f,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return y(n(e))},ap:function(n){return n.fold(g,function(n){return y(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:d},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(s,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},p={some:y,none:g,from:function(n){return null===n||n===undefined?d:y(n)}},v=(o="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===o}),h=Array.prototype.slice,b=function(n,t){for(var e=0,r=n.length;e<r;e++){if(t(n[e],e,n))return p.some(e)}return p.none()},w=(v(Array.from)&&Array.from,function(n,t){return-1!==n.indexOf(t)}),O=function(n,t){return w(n.title.toLowerCase(),t)||(e=n.keywords,b(e,function(n){return w(n.toLowerCase(),t)}).isSome());var e},A=function(n,t,e){for(var r=[],o=t.toLowerCase(),i=e.fold(function(){return a},function(t){return function(n){return t<=n}}),u=0;u<n.length&&(0!==t.length&&!O(n[u],o)||(r.push({value:n[u]["char"],text:n[u].title,icon:n[u]["char"]}),!i(r.length)));u++);return r},j=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return j(e())}}},C=Object.prototype.hasOwnProperty,k=(u=function(n,t){return t},function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<n.length;r++){var o=n[r];for(var i in o)C.call(o,i)&&(e[i]=u(e[i],o[i]))}return e}),T=Object.keys,_=Object.hasOwnProperty,P=function(n,t){for(var e=T(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i,n)}},S=function(r,o){var i={};return P(r,function(n,t){var e=o(n,t,r);i[e.k]=e.v}),i},D=tinymce.util.Tools.resolve("tinymce.Resource"),x=tinymce.util.Tools.resolve("tinymce.util.Delay"),L=tinymce.util.Tools.resolve("tinymce.util.Promise"),N=function(n,t){return n.getParam("emoticons_database_url",t+"/js/emojis"+n.suffix+".js")},E=function(n){return n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string")},F=function(n){return n.getParam("emoticons_append",{},"object")},q="All",z={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},I=function(n,t){return e=n,r=t,_.call(e,r)?n[t]:t;var e,r},M=function(n){var r,t=F(n);return r=function(n){return k({keywords:[],category:"user"},n)},S(t,function(n,t,e){return{k:t,v:r(n,t,e)}})},U=function(r,o,n){var u=j(p.none()),c=j(p.none());r.on("init",function(){D.load(n,o).then(function(n){var t,o,i,e=M(r);t=k(n,e),o={},i=[],P(t,function(n,t){var e={title:t,keywords:n.keywords,"char":n["char"],category:I(z,n.category)},r=o[e.category]!==undefined?o[e.category]:[];o[e.category]=r.concat([e]),i.push(e)}),u.set(p.some(o)),c.set(p.some(i))},function(n){m.console.log("Failed to load emoticons: "+n),u.set(p.some({})),c.set(p.some([]))})});var e=function(){return c.get().getOr([])},i=function(){return u.get().isSome()&&c.get().isSome()};return{listCategories:function(){return[q].concat(T(u.get().getOr({})))},hasLoaded:i,waitForLoad:function(){return i()?L.resolve(!0):new L(function(n,t){var e=15,r=x.setInterval(function(){i()?(x.clearInterval(r),n(!0)):--e<0&&(m.console.log("Could not load emojis from url: "+o),x.clearInterval(r),t(!1))},100)})},listAll:e,listCategory:function(t){return t===q?e():u.get().bind(function(n){return p.from(n[t])}).getOr([])}}},R="pattern",B=function(o,u){var e,r,i,n={pattern:"",results:A(u.listAll(),"",p.some(300))},c=j(q),a=(e=function(n){var t,e,r,o,i;e=(t=n).getData(),r=c.get(),o=u.listCategory(r),i=A(o,e[R],r===q?p.some(300):p.none()),t.setData({results:i})},r=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){e.apply(null,n),i=null},r)}}),t={label:"Search",type:"input",name:R},l={type:"collection",name:"results"},s=function(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r}(u.listCategories(),function(n){return{title:n,name:n,items:[t,l]}})},initialData:n,onTabChange:function(n,t){c.set(t.newTabName),a.throttle(n)},onChange:a.throttle,onAction:function(n,t){var e,r;"results"===t.name&&(e=o,r=t.value,e.insertContent(r),n.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},f=o.windowManager.open(s());f.focus(R),u.hasLoaded()||(f.block("Loading emoticons..."),u.waitForLoad().then(function(){f.redial(s()),a.throttle(f),f.focus(R),f.unblock()})["catch"](function(n){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(R),f.unblock()}))},G=function(n,t){var e=function(){return B(n,t)};n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function H(){i.add("emoticons",function(n,t){var r,o,e=N(n,t),i=E(n),u=U(n,e,i);G(n,u),o=u,(r=n).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return A(n,t,p.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(m){"use strict";var o,i=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return i(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.html.DomParser"),f=tinymce.util.Tools.resolve("tinymce.html.Node"),p=tinymce.util.Tools.resolve("tinymce.html.Serializer"),h=function(e){return e.getParam("fullpage_hide_in_source_view")},l=function(e){return e.getParam("fullpage_default_xml_pi")},a=function(e){return e.getParam("fullpage_default_encoding")},c=function(e){return e.getParam("fullpage_default_font_family")},s=function(e){return e.getParam("fullpage_default_font_size")},u=function(e){return e.getParam("fullpage_default_text_color")},d=function(e){return e.getParam("fullpage_default_title")},y=function(e){return e.getParam("fullpage_default_doctype","<!DOCTYPE html>")},v=function(e){return t({validate:!1,root_name:"#document"}).parse(e)},_=v,n=function(e,t){var n,i,r=v(t),l={};function o(e,t){return e.attr(t)||""}return l.fontface=c(e),l.fontsize=s(e),7===(n=r.firstChild).type&&(l.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(l.docencoding=i[1])),(n=r.getAll("#doctype")[0])&&(l.doctype="<!DOCTYPE"+n.value+">"),(n=r.getAll("title")[0])&&n.firstChild&&(l.title=n.firstChild.value),g.each(r.getAll("meta"),function(e){var t,n=e.attr("name"),i=e.attr("http-equiv");n?l[n.toLowerCase()]=e.attr("content"):"Content-Type"===i&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(l.docencoding=t[1])}),(n=r.getAll("html")[0])&&(l.langcode=o(n,"lang")||o(n,"xml:lang")),l.stylesheets=[],g.each(r.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&l.stylesheets.push(e.attr("href"))}),(n=r.getAll("body")[0])&&(l.langdir=o(n,"dir"),l.style=o(n,"style"),l.visited_color=o(n,"vlink"),l.link_color=o(n,"link"),l.active_color=o(n,"alink")),l},b=function(e,l,t){var o,n,i,a,r,c=e.dom;function s(e,t,n){e.attr(t,n||undefined)}function u(e){n.firstChild?n.insert(e,n.firstChild):n.append(e)}o=v(t),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new f("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,l.xml_pi?(r='version="1.0"',l.docencoding&&(r+=' encoding="'+l.docencoding+'"'),7!==a.type&&(a=new f("xml",7),o.insert(a,o.firstChild,!0)),a.value=r):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],l.doctype?(a||(a=new f("#doctype",10),l.xml_pi?o.insert(a,o.firstChild):u(a)),a.value=l.doctype.substring(9,l.doctype.length-1)):a&&a.remove(),a=null,g.each(o.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(a=e)}),l.docencoding?(a||((a=new f("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,u(a)),a.attr("content","text/html; charset="+l.docencoding)):a&&a.remove(),a=o.getAll("title")[0],l.title?(a?a.empty():u(a=new f("title",1)),a.append(new f("#text",3)).value=l.title):a&&a.remove(),g.each("keywords,description,author,copyright,robots".split(","),function(e){var t,n,i=o.getAll("meta"),r=l[e];for(t=0;t<i.length;t++)if((n=i[t]).attr("name")===e)return void(r?n.attr("content",r):n.remove());r&&((a=new f("meta",1)).attr("name",e),a.attr("content",r),a.shortEnded=!0,u(a))});var d={};return g.each(o.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&(d[e.attr("href")]=e)}),g.each(l.stylesheets,function(e){d[e]||((a=new f("link",1)).attr({rel:"stylesheet",text:"text/css",href:e}),a.shortEnded=!0,u(a)),delete d[e]}),g.each(d,function(e){e.remove()}),(a=o.getAll("body")[0])&&(s(a,"dir",l.langdir),s(a,"style",l.style),s(a,"vlink",l.visited_color),s(a,"link",l.link_color),s(a,"alink",l.active_color),c.setAttribs(e.getBody(),{style:l.style,dir:l.dir,vLink:l.visited_color,link:l.link_color,aLink:l.active_color})),(a=o.getAll("html")[0])&&(s(a,"lang",l.langcode),s(a,"xml:lang",l.langcode)),n.firstChild||n.remove(),(i=p({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(o)).substring(0,i.indexOf("</body>"))},x=Object.prototype.hasOwnProperty,C=(o=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},i=0;i<e.length;i++){var r=e[i];for(var l in r)x.call(r,l)&&(n[l]=o(n[l],r[l]))}return n}),r=function(i,r){var l=n(i,r.get()),e=C({title:"",keywords:"",description:"",robots:"",author:"",docencoding:""},l);i.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:e,onSubmit:function(e){var t=e.getData(),n=b(i,g.extend(l,t),r.get());r.set(n),e.close()}})},k=function(e,t){e.addCommand("mceFullPageProperties",function(){r(e,t)})},w=function(e,t){return g.each(e,function(e){t=t.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),t},A=function(e){return e.replace(/<!--mce:protected ([\s\S]*?)-->/g,function(e,t){return unescape(t)})},P=g.each,T=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},O=function(e){var t,n="",i="";if(l(e)){var r=a(e);n+='<?xml version="1.0" encoding="'+(r||"ISO-8859-1")+'" ?>\n'}return n+=y(e),n+="\n<html>\n<head>\n",(t=d(e))&&(n+="<title>"+t+"</title>\n"),(t=a(e))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=c(e))&&(i+="font-family: "+t+";"),(t=s(e))&&(i+="font-size: "+t+";"),(t=u(e))&&(i+="color: "+t+";"),n+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n"},D=function(l,o,a){l.on("BeforeSetContent",function(e){!function(e,t,n,i){var r,l,o,a,c="",s=e.dom;if(!(i.selection||(o=w(e.settings.protect,i.content),"raw"===i.format&&t.get()||i.source_view&&h(e)))){0!==o.length||i.source_view||(o=g.trim(t.get())+"\n"+g.trim(o)+"\n"+g.trim(n.get())),-1!==(r=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(r=o.indexOf(">",r),t.set(T(o.substring(0,r+1))),-1===(l=o.indexOf("</body",r))&&(l=o.length),i.content=g.trim(o.substring(r+1,l)),n.set(T(o.substring(l)))):(t.set(O(e)),n.set("\n</body>\n</html>")),a=_(t.get()),P(a.getAll("style"),function(e){e.firstChild&&(c+=e.firstChild.value)});var u=a.getAll("body")[0];u&&s.setAttribs(e.getBody(),{style:u.attr("style")||"",dir:u.attr("dir")||"",vLink:u.attr("vlink")||"",link:u.attr("link")||"",aLink:u.attr("alink")||""}),s.remove("fullpage_styles");var d=e.getDoc().getElementsByTagName("head")[0];c&&s.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};g.each(d.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(f[e.href]=e)}),g.each(a.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;f[t]||"stylesheet"!==e.attr("rel")||s.add(d,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete f[t]}),g.each(f,function(e){e.parentNode.removeChild(e)})}}(l,o,a,e)}),l.on("GetContent",function(e){var t,n,i,r;t=l,n=o.get(),i=a.get(),(r=e).selection||r.source_view&&h(t)||(r.content=A(g.trim(n)+"\n"+g.trim(r.content)+"\n"+g.trim(i)))})},E=function(e){e.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){e.execCommand("mceFullPageProperties")}}),e.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){e.execCommand("mceFullPageProperties")}})};!function z(){e.add("fullpage",function(e){var t=i(""),n=i("");k(e,t),E(e),D(e,t,n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(d){"use strict";var e,n,r,t,o,i,u,s,c,f,a=function(e){var n=e,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return a(r())}}},l=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=function(e){return{isFullscreen:function(){return null!==e.get()}}},h=function(){},v=function(e){return function(){return e}},g=v(!1),O=v(!0),S=g,w=O,p=function(){return x},x=(t={fold:function(e,n){return e()},is:S,isSome:S,isNone:w,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:S,forall:w,filter:p,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(t),t),E=function(r){var e=function(){return r},n=function(){return o},t=function(e){return e(r)},o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:w,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return E(e(r))},ap:function(e){return e.fold(p,function(e){return E(e(r))})},each:function(e){e(r)},bind:t,flatten:e,exists:t,forall:t,filter:function(e){return e(r)?o:x},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(S,function(e){return n(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},N={some:E,none:p,from:function(e){return null===e||e===undefined?x:E(e)}},T=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}},y=T("string"),C=T("function"),b=Array.prototype.slice,A=(C(Array.from)&&Array.from,Object.keys),D=function(e,n){return-1!==e.indexOf(n)},F=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(e)}},_={fromHtml:function(e,n){var r=(n||d.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw d.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return F(r.childNodes[0])},fromTag:function(e,n){var r=(n||d.document).createElement(e);return F(r)},fromText:function(e,n){var r=(n||d.document).createTextNode(e);return F(r)},fromDom:F,fromPoint:function(e,n,r){var t=e.dom();return N.from(t.elementFromPoint(n,r)).map(F)}},R=(d.Node.ATTRIBUTE_NODE,d.Node.CDATA_SECTION_NODE,d.Node.COMMENT_NODE,d.Node.DOCUMENT_NODE,d.Node.DOCUMENT_TYPE_NODE,d.Node.DOCUMENT_FRAGMENT_NODE,d.Node.ELEMENT_NODE,d.Node.TEXT_NODE,d.Node.PROCESSING_INSTRUCTION_NODE,d.Node.ENTITY_REFERENCE_NODE,d.Node.ENTITY_NODE,d.Node.NOTATION_NODE,"undefined"!=typeof d.window?d.window:Function("return this;")(),function(e,n,r){if(!y(r))throw d.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);var t;(t=e).style!==undefined&&C(t.style.getPropertyValue)&&e.style.setProperty(n,r)}),M=function(e,n){var r=e.dom();!function(e,n){for(var r=A(e),t=0,o=r.length;t<o;t++){var i=r[t];n(e[i],i,e)}}(n,function(e,n){R(r,n,e)})},P=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),L=function(e,n){e.fire("FullscreenStateChanged",{state:n})},k=function(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};var t=function(e){return Number(n.replace(r,"$"+e))};return j(t(1),t(2))},I=function(){return j(0,0)},j=function(e,n){return{major:e,minor:n}},H={nu:j,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?I():k(e,r)},unknown:I},W="Firefox",U=function(e,n){return function(){return n===e}},q=function(e){var n=e.current;return{current:n,version:e.version,isEdge:U("Edge",n),isChrome:U("Chrome",n),isIE:U("IE",n),isOpera:U("Opera",n),isFirefox:U(W,n),isSafari:U("Safari",n)}},B={unknown:function(){return q({current:undefined,version:H.unknown()})},nu:q,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v(W),safari:v("Safari")},V="Windows",X="Android",z="Solaris",Y="FreeBSD",G=function(e,n){return function(){return n===e}},$=function(e){var n=e.current;return{current:n,version:e.version,isWindows:G(V,n),isiOS:G("iOS",n),isAndroid:G(X,n),isOSX:G("OSX",n),isLinux:G("Linux",n),isSolaris:G(z,n),isFreeBSD:G(Y,n)}},J={unknown:function(){return $({current:undefined,version:H.unknown()})},nu:$,windows:v(V),ios:v("iOS"),android:v(X),linux:v("Linux"),osx:v("OSX"),solaris:v(z),freebsd:v(Y)},K=function(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r,e))return N.some(o)}return N.none()}(e,function(e){return e.search(r)})},Q=function(e,r){return K(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},Z=function(e,r){return K(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},ee=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ne=function(n){return function(e){return D(e,n)}},re=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return D(e,"edge/")&&D(e,"chrome")&&D(e,"safari")&&D(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ee],search:function(e){return D(e,"chrome")&&!D(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return D(e,"msie")||D(e,"trident")}},{name:"Opera",versionRegexes:[ee,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ne("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ne("firefox")},{name:"Safari",versionRegexes:[ee,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(D(e,"safari")||D(e,"mobile/"))&&D(e,"applewebkit")}}],te=[{name:"Windows",search:ne("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return D(e,"iphone")||D(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ne("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ne("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ne("linux"),versionRegexes:[]},{name:"Solaris",search:ne("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ne("freebsd"),versionRegexes:[]}],oe={browsers:v(re),oses:v(te)},ie=function(e){var n,r,t,o,i,u,s,c,f,a,d,l=oe.browsers(),m=oe.oses(),h=Q(l,e).fold(B.unknown,B.nu),g=Z(m,e).fold(J.unknown,J.nu);return{browser:h,os:g,deviceType:(r=h,t=e,o=(n=g).isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,s=n.isAndroid()&&4===n.version.major,c=o||u||s&&!0===/mobile/i.test(t),f=n.isiOS()||n.isAndroid(),a=f&&!c,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(a),isTouch:v(f),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(d)})}},ue={detect:(u=!(o=function(){var e=d.navigator.userAgent;return ie(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return u||(u=!0,i=o.apply(null,e)),i})},se=P.DOM,ce=d.window.visualViewport,fe=ue.detect().browser.isSafari()&&ce!==undefined?(s=a(N.none()),c={clear:function(){s.set(N.none())},set:function(e){s.set(N.some(e))},isSet:function(){return s.get().isSome()},on:function(e){s.get().each(e)}},f=function(){d.window.requestAnimationFrame(function(){c.on(function(e){return M(e,{top:ce.offsetTop+"px",left:ce.offsetLeft+"px",height:ce.height+"px",width:ce.width+"px"})})})},{bind:function(e){c.set(e),f(),ce.addEventListener("resize",f),ce.addEventListener("scroll",f)},unbind:function(){c.on(function(){ce.removeEventListener("scroll",f),ce.removeEventListener("resize",f)}),c.clear()}}):{bind:h,unbind:h},ae=function(e,n){var r,t,o,i,u,s=d.document.body,c=d.document.documentElement,f=n.get();if(r=(t=e.getContainer()).style,o=e.getContentAreaContainer().firstChild.style,f)o.width=f.iframeWidth,o.height=f.iframeHeight,f.containerWidth&&(r.width=f.containerWidth),f.containerHeight&&(r.height=f.containerHeight),se.removeClass(s,"tox-fullscreen"),se.removeClass(c,"tox-fullscreen"),se.removeClass(t,"tox-fullscreen"),i=f.scrollPos,d.window.scrollTo(i.x,i.y),n.set(null),L(e,!1),fe.unbind(),e.off("remove",fe.unbind);else{var a={scrollPos:(u=se.getViewPort(),{x:u.x,y:u.y}),containerWidth:r.width,containerHeight:r.height,iframeWidth:o.width,iframeHeight:o.height};o.width=o.height="100%",r.width=r.height="",se.addClass(s,"tox-fullscreen"),se.addClass(c,"tox-fullscreen"),se.addClass(t,"tox-fullscreen"),fe.bind(_.fromDom(t)),e.on("remove",fe.unbind),n.set(a),L(e,!0)}},de=function(e,n){e.addCommand("mceFullScreen",function(){ae(e,n)})},le=function(r,t){return function(n){n.setActive(null!==t.get());var e=function(e){return n.setActive(e.state)};return r.on("FullscreenStateChanged",e),function(){return r.off("FullscreenStateChanged",e)}}},me=function(e,n){e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:le(e,n)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:le(e,n)})};!function he(){l.add("fullscreen",function(e){var n=a(null);return e.settings.inline||(de(e,n),me(e,n),e.addShortcut("Meta+Shift+F","","mceFullScreen")),m(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},l=function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},t=function(e){return function(){return e}};function p(o){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return o.apply(null,n)}}var n,o,a,c,u,h,m=t(!1),d=t(!0),f=m,g=d,y=function(){return b},b=(c={fold:function(e,t){return e()},is:f,isSome:f,isNone:g,getOr:a=function(e){return e},getOrThunk:o=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:o,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:f,forall:g,filter:y,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(c),c),k=function(n){var e=function(){return n},t=function(){return a},o=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:g,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(y,function(e){return k(e(n))})},each:function(e){e(n)},bind:o,flatten:e,exists:o,forall:o,filter:function(e){return e(n)?a:b},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},v={some:k,none:y,from:function(e){return null===e||e===undefined?b:k(e)}},w=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===u}),A=Array.prototype.slice,C=(h=Array.prototype.indexOf)===undefined?function(e,t){return P(e,t)}:function(e,t){return h.call(e,t)},T=function(e,t){return-1<C(e,t)},x=function(e,t){for(var n=e.length,o=new Array(n),a=0;a<n;a++){var r=e[a];o[a]=t(r,a,e)}return o},P=function(e,t){for(var n=0,o=e.length;n<o;++n)if(e[n]===t)return n;return-1},M=(w(Array.from)&&Array.from,Object.keys),O=Object.hasOwnProperty,F=function(e,t){return O.call(e,t)},S=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Header 1"},{shortcuts:["Access + 2"],action:"Header 2"},{shortcuts:["Access + 3"],action:"Header 3"},{shortcuts:["Access + 4"],action:"Header 4"},{shortcuts:["Access + 5"],action:"Header 5"},{shortcuts:["Access + 6"],action:"Header 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],E=tinymce.util.Tools.resolve("tinymce.Env"),I=function(e){var n=E.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),o=x(t,function(e){var t=e.toLowerCase().trim();return F(n,t)?n[t]:e});return E.mac?o.join("").replace(/\s/,""):o.join("+")},_=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:x(S,function(e){var t=x(e.shortcuts,I).join(" or ");return[e.action,t]})}]}},j=function(e,a){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,o=a[t];return"string"===(n=typeof o)||"number"===n?o.toString():e})},H=tinymce.util.Tools.resolve("tinymce.util.I18n"),U=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*"}],W=function(e){var t,n,o=p(j,'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),a=function(t,n){return function(e,t){for(var n=0,o=e.length;n<o;n++){var a=e[n];if(t(a,n,e))return v.some(a)}return v.none()}(U,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?o(e()):n},function(e){return o({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+(r=n,c=M((i=r).plugins),l=i.settings.forced_plugins===undefined?c:function(e,t){for(var n=[],o=0,a=e.length;o<a;o++){var r=e[o];t(r,o,e)&&n.push(r)}return n}(c,(s=p(T,i.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!s.apply(null,e)})),u=x(l,function(e){return"<li>"+a(r,e)+"</li>"}),h=u.length,m=u.join(""),"<p><b>"+H.translate(["Plugins installed ({0}):",h])+"</b></p><ul>"+m+"</ul>")+"</div>"),(t=x(["Accessibility Checker","Advanced Code Editor","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+H.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+H.translate("Premium plugins:")+"</b></p><ul>"+t+'<li style="list-style: none; margin-top: 1em;"><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+H.translate("Learn more...")+"</a></li></ul></div>")].join("")}]};var r,i,s,c,l,u,h,m},D=tinymce.util.Tools.resolve("tinymce.EditorManager"),N=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=D.majorVersion,t=D.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+H.translate(["You are using {0}",n])+"</p>",presets:"document"}]}},L=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]}},B=function(e){var t,n=M(e);return(-1===(t=C(n,"versions"))?v.none():v.some(t)).each(function(e){n.splice(e,1),n.push("versions")}),{tabs:e,names:n}},z=function(e,t){var n,o,a=_(),r=L(),i=W(e),s=N(),c=l(((n={})[a.name]=a,n[r.name]=r,n[i.name]=i,n[s.name]=s,n),t.get());return(o=e,v.from(o.getParam("help_tabs"))).fold(function(){return B(c)},function(e){return t=c,n={},o=x(e,function(e){return"string"==typeof e?(F(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:o};var t,n,o})},V=function(a,r){return function(){var e=z(a,r),o=e.tabs,t=e.names,n={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(x(t,function(e){return F(t=o,n=e)?v.from(t[n]):v.none();var t,n}))};a.windowManager.open({title:"Help",size:"medium",body:n,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}};!function q(){e.add("help",function(e){var n,t=r({}),o=(n=t,{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}),a=V(e,t);return s(e,a),i(e,a),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),o})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(s){"use strict";var t,e,n,r,i,o,a,f,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){},l=function(t){return function(){return t}},d=function(t){return t},m=l(!1),p=l(!0),g=m,h=p,y=function(){return v},v=(r={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:g,forall:h,filter:y,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(r),r),b=function(n){var t=function(){return n},e=function(){return i},r=function(t){return t(n)},i={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:g,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(y,function(t){return b(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?i:v},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return i},w={some:b,none:y,from:function(t){return null===t||t===undefined?v:b(t)}},T=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}},_=T("string"),U=T("object"),x=T("array"),A=T("boolean"),I=T("function"),S=Array.prototype.slice,D=Array.prototype.push,O=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);D.apply(e,t[n])}return e},C=(I(Array.from)&&Array.from,function(){return(C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}),P={},E={exports:P};i=undefined,o=P,a=E,f=undefined,function(t){"object"==typeof o&&void 0!==a?a.exports=t():"function"==typeof i&&i.amd?i([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function s(o,a,u){function c(e,t){if(!a[e]){if(!o[e]){var n="function"==typeof f&&f;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[e]={exports:{}};o[e][0].call(i.exports,function(t){return c(o[e][1][t]||t)},i,i.exports,s,o,a,u)}return a[e].exports}for(var l="function"==typeof f&&f,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,e,n){var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(t){i=u}}();var l,s=[],f=!1,d=-1;function m(){f&&l&&(f=!1,l.length?s=l.concat(s):d=-1,s.length&&p())}function p(){if(!f){var t=c(m);f=!0;for(var e=s.length;e;){for(l=s,s=[];++d<e;)l&&l[d].run();d=-1,e=s.length}l=null,f=!1,function n(t){if(i===clearTimeout)return clearTimeout(t);if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new g(t,e)),1!==s.length||f||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],2:[function(t,f,e){(function(n){!function(t){var e=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],s(t,this)}function i(r,i){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,o._immediateFn(function(){var t=1===r._state?i.onFulfilled:i.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(i.promise,n)}a(i.promise,e)}else(1===r._state?a:u)(i.promise,r._value)})):r._deferreds.push(i)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,c(t)}catch(i){u(t,i)}}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new l(t,e,n)),n},o.all=function(t){var c=Array.prototype.slice.call(t);return new o(function(i,o){if(0===c.length)return i([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},o)}c[e]=t,0==--a&&i(c)}catch(r){o(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(i){return new o(function(t,e){for(var n=0,r=i.length;n<r;n++)i[n].then(t,e)})},o._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=o:t.Promise||(t.Promise=o)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,l){(function(t,e){var r=c("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function u(t,e){this._id=t,this._clearFn=e}l.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},l.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},l._unrefActive=l.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},l.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,r(function(){o[e]&&(n?t.apply(null,n):t.call(null),l.clearImmediate(e))}),e},l.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),i="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:i.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var L=E.exports.boltExport,N=function(t){var n=w.none(),e=[],r=function(t){i()?a(t):e.push(t)},i=function(){return n.isSome()},o=function(t){!function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)}(t,a)},a=function(e){n.each(function(t){s.setTimeout(function(){e(t)},0)})};return t(function(t){n=w.some(t),o(e),e=[]}),{get:r,map:function(n){return N(function(e){r(function(t){e(n(t))})})},isReady:i}},j={nu:N,pure:function(e){return N(function(t){t(e)})}},R=function(t){s.setTimeout(function(){throw t},0)},F=function(n){var t=function(t){n().then(t,R)};return{map:function(t){return F(function(){return n().then(t)})},bind:function(e){return F(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return F(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return j.nu(t)},toCached:function(){var t=null;return F(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},k=function(t){return F(function(){return new L(t)})},z=function(t){return F(function(){return L.resolve(t)})},H=function(n){return{is:function(t){return n===t},isValue:p,isError:m,getOr:l(n),getOrThunk:l(n),getOrDie:l(n),or:function(t){return H(n)},orThunk:function(t){return H(n)},fold:function(t,e){return e(n)},map:function(t){return H(t(n))},mapError:function(t){return H(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},B=function(n){return{is:m,isValue:m,isError:p,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(n),function(){throw new Error(t)}();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return B(n)},mapError:function(t){return B(t(n))},each:c,bind:function(t){return B(n)},exists:m,forall:p,toOption:w.none}},M={value:H,error:B,fromOption:function(t,e){return t.fold(function(){return B(e)},H)}},G=function(o){return C({},o,{toCached:function(){return G(o.toCached())},bindFuture:function(e){return G(o.bind(function(t){return t.fold(function(t){return z(M.error(t))},function(t){return e(t)})}))},bindResult:function(e){return G(o.map(function(t){return t.bind(e)}))},mapResult:function(e){return G(o.map(function(t){return t.map(e)}))},mapError:function(e){return G(o.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return o.map(function(t){return t.fold(e,n)})},withTimeout:function(t,i){return G(k(function(e){var n=!1,r=s.setTimeout(function(){n=!0,e(M.error(i()))},t);o.get(function(t){n||(s.clearTimeout(r),e(t))})}))}})},W=function(t){return G(k(t))},q=W,$=Object.prototype.hasOwnProperty,J=function(a){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var i=t[r];for(var o in i)$.call(i,o)&&(n[o]=a(n[o],i[o]))}return n}},V=J(function(t,e){return U(t)&&U(e)?V(t,e):e}),X=J(function(t,e){return e}),Z=function(t){var e=t.imageList.map(function(t){return{name:"images",type:"selectbox",label:"Image list",items:t}}),n=t.classList.map(function(t){return{name:"classes",type:"selectbox",label:"Class",items:t}});return O([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:O([n.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},K=function(t){return{title:"General",name:"general",items:Z(t)}},Q=Z,Y=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tt=tinymce.util.Tools.resolve("tinymce.util.Promise"),et=tinymce.util.Tools.resolve("tinymce.util.XHR"),nt=function(t){return t.getParam("images_upload_url","","string")},rt=function(t){return t.getParam("images_upload_handler",undefined,"function")},it={hasDimensions:function(t){return t.getParam("image_dimensions",!0,"boolean")},hasUploadTab:function(t){return t.getParam("image_uploadtab",!0,"boolean")},hasAdvTab:function(t){return t.getParam("image_advtab",!1,"boolean")},getPrependUrl:function(t){return t.getParam("image_prepend_url","","string")},getClassList:function(t){return t.getParam("image_class_list")},hasDescription:function(t){return t.getParam("image_description",!0,"boolean")},hasImageTitle:function(t){return t.getParam("image_title",!1,"boolean")},hasImageCaption:function(t){return t.getParam("image_caption",!1,"boolean")},getImageList:function(t){return t.getParam("image_list",!1)},hasUploadUrl:function(t){return!!nt(t)},hasUploadHandler:function(t){return!!rt(t)},getUploadUrl:nt,getUploadHandler:rt,getUploadBasePath:function(t){return t.getParam("images_upload_base_path",undefined,"string")},getUploadCredentials:function(t){return t.getParam("images_upload_credentials",!1,"boolean")}},ot=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},at=function(t,e){var n=s.document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:ot(n.width,n.clientWidth),height:ot(n.height,n.clientHeight)};r(M.value(t))},n.onerror=function(){r(M.error("Failed to get image dimensions for: "+t))};var i=n.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",s.document.body.appendChild(n),n.src=t},ut=function(t){return t&&(t=t.replace(/px$/,"")),t},ct=function(t){return 0<t.length&&/^[0-9]+$/.test(t)&&(t+="px"),t},lt=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},st=function(t,e){var n=it.getImageList(t);"string"==typeof n?et.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)},ft=function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!it.hasDimensions(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},dt=function(r){return new tt(function(t,e){var n=new s.FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(r)})},mt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},pt=Y.DOM,gt=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?ut(t.style.marginLeft):""},ht=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?ut(t.style.marginTop):""},yt=function(t){return t.style.borderWidth?ut(t.style.borderWidth):""},vt=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},bt=function(t,e){return t.style[e]?t.style[e]:""},wt=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Tt=function(t,e,n){t.setAttribute(e,n)},_t=function(t){var e,n,r,i;wt(t)?(i=(r=t).parentNode,pt.insertAfter(r,i),pt.remove(i)):(e=t,n=pt.create("figure",{"class":"image"}),pt.insertAfter(n,e),n.appendChild(e),n.appendChild(pt.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false")},Ut=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");0<r.length?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},xt=function(t,r){return function(t,e,n){t.style[e]?(t.style[e]=ct(n),Ut(t,r)):Tt(t,e,n)}},At=function(t,e){return t.style[e]?ut(t.style[e]):vt(t,e)},It=function(t,e){var n=ct(e);t.style.marginLeft=n,t.style.marginRight=n},St=function(t,e){var n=ct(e);t.style.marginTop=n,t.style.marginBottom=n},Dt=function(t,e){var n=ct(e);t.style.borderWidth=n},Ot=function(t,e){t.style.borderStyle=e},Ct=function(t){return"FIGURE"===t.nodeName},Pt=function(t,e){var n=s.document.createElement("img");return Tt(n,"style",e.style),(gt(n)||""!==e.hspace)&&It(n,e.hspace),(ht(n)||""!==e.vspace)&&St(n,e.vspace),(yt(n)||""!==e.border)&&Dt(n,e.border),(bt(n,"borderStyle")||""!==e.borderStyle)&&Ot(n,e.borderStyle),t(n.getAttribute("style"))},Et=function(t,e){return{src:vt(e,"src"),alt:vt(e,"alt"),title:vt(e,"title"),width:At(e,"width"),height:At(e,"height"),"class":vt(e,"class"),style:t(vt(e,"style")),caption:wt(e),hspace:gt(e),vspace:ht(e),border:yt(e),borderStyle:bt(e,"borderStyle")}},Lt=function(t,e,n,r,i){n[r]!==e[r]&&i(t,r,n[r])},Nt=function(r,i){return function(t,e,n){r(t,n),Ut(t,i)}},jt=function(t,e,n){var r=Et(t,n);Lt(n,r,e,"caption",function(t,e,n){return _t(t)}),Lt(n,r,e,"src",Tt),Lt(n,r,e,"alt",Tt),Lt(n,r,e,"title",Tt),Lt(n,r,e,"width",xt(0,t)),Lt(n,r,e,"height",xt(0,t)),Lt(n,r,e,"class",Tt),Lt(n,r,e,"style",Nt(function(t,e){return Tt(t,"style",e)},t)),Lt(n,r,e,"hspace",Nt(It,t)),Lt(n,r,e,"vspace",Nt(St,t)),Lt(n,r,e,"border",Nt(Dt,t)),Lt(n,r,e,"borderStyle",Nt(Ot,t))},Rt=function(t,e){var n=t.dom.styles.parse(e),r=lt(n),i=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(i)},Ft=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||mt(e))?null:e},kt=function(e,t){var n=e.dom,r=n.getParent(t.parentNode,function(t){return e.schema.getTextBlockElements()[t.nodeName]},e.getBody());return r?n.split(r,t):t},zt=function(e,t){var n=function(t,e){var n=s.document.createElement("img");if(jt(t,X(e,{caption:!1}),n),Tt(n,"alt",e.alt),e.caption){var r=pt.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(pt.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(t){return Rt(e,t)},t);e.dom.setAttrib(n,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(n.outerHTML);var r=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(r,"data-mce-id",null),Ct(r)){var i=kt(e,r);e.selection.select(i)}else e.selection.select(r)},Ht=function(t,e){var n=Ft(t);n?e.src?function(e,t){var n,r=Ft(e);if(jt(function(t){return Rt(e,t)},t,r),n=r,e.dom.setAttrib(n,"src",n.getAttribute("src")),Ct(r.parentNode)){var i=r.parentNode;kt(e,i),e.selection.select(r.parentNode)}else e.selection.select(r),ft(e,t,r)}(t,e):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n):e.src&&zt(t,e)},Bt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Mt=function(t){return _(t.value)?t.value:""},Gt=function(t,i){var o=[];return Bt.each(t,function(t){var e=_(t.text)?t.text:_(t.title)?t.title:"";if(t.menu!==undefined){var n=Gt(t.menu,i);o.push({text:e,items:n})}else{var r=i(t);o.push({text:e,value:r})}}),o},Wt=function(e){return void 0===e&&(e=Mt),function(t){return t?w.from(t).map(function(t){return Gt(t,e)}):w.none()}},qt=function(t,n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return w.none()}(t,function(t){return e=t,Object.prototype.hasOwnProperty.call(e,"items")?qt(t.items,n):t.value===n?w.some(t):w.none();var e})},$t=Wt,Jt=function(t){return Wt(Mt)(t)},Vt=function(t,e){return t.bind(function(t){return qt(t,e)})};function Xt(a){var e=function(t,r,i,e){var o,n;(o=new s.XMLHttpRequest).open("POST",a.url),o.withCredentials=a.credentials,o.upload.onprogress=function(t){e(t.loaded/t.total*100)},o.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var t,e,n;o.status<200||300<=o.status?i("HTTP Error: "+o.status):(t=JSON.parse(o.responseText))&&"string"==typeof t.location?r((e=a.basePath,n=t.location,e?e.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):i("Invalid JSON: "+o.responseText)},(n=new s.FormData).append("file",t.blob(),t.filename()),o.send(n)};return a=Bt.extend({credentials:!1,handler:e},a),{upload:function(t){return a.url||a.handler!==e?(r=t,i=a.handler,new tt(function(t,e){try{i(r,t,e,c)}catch(n){e(n.message)}})):tt.reject("Upload url missing from the settings.");var r,i}}}var Zt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace"},{type:"input",label:"Horizontal space",name:"hspace"},{type:"input",label:"Border width",name:"border"},{type:"selectbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Kt=function(n){var e,t,r=$t(function(t){return n.convertURL(t.value||t.url,"src")}),i=k(function(e){st(n,function(t){e(r(t).map(function(t){return O([[{text:"None",value:""}],t])}))})}),o=Jt(it.getClassList(n)),a=it.hasAdvTab(n),u=it.hasUploadTab(n),c=it.hasUploadUrl(n),l=it.hasUploadHandler(n),s=(t=Ft(e=n))?Et(function(t){return Rt(e,t)},t):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},f=it.hasDescription(n),d=it.hasImageTitle(n),m=it.hasDimensions(n),p=it.hasImageCaption(n),g=it.getUploadUrl(n),h=it.getUploadBasePath(n),y=it.getUploadCredentials(n),v=it.getUploadHandler(n),b=w.some(it.getPrependUrl(n)).filter(function(t){return _(t)&&0<t.length});return i.map(function(t){return{image:s,imageList:t,classList:o,hasAdvTab:a,hasUploadTab:u,hasUploadUrl:c,hasUploadHandler:l,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:p,url:g,basePath:h,credentials:y,handler:v,prependURL:b}})},Qt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Yt=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t["class"],caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[]}},te=function(t){return{src:t.src.value,alt:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,"class":t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle}},ee=function(t,e){var n,r,i=e.getData();(n=t,r=i.src.value,/^(?:[a-zA-Z]+:)?\/\//.test(r)?w.none():n.prependURL.bind(function(t){return r.substring(0,t.length)!==t?w.some(t+r):w.none()})).each(function(t){e.setData({src:{value:t,meta:i.src.meta}})})},ne=function(t,e){var n,r,i,o=e.getData(),a=o.src.meta;if(a!==undefined){var u=V({},o);r=u,i=a,(n=t).hasDescription&&_(i.alt)&&(r.alt=i.alt),n.hasImageTitle&&_(i.title)&&(r.title=i.title),n.hasDimensions&&(_(i.width)&&(r.dimensions.width=i.width),_(i.height)&&(r.dimensions.height=i.height)),_(i["class"])&&Vt(n.classList,i["class"]).each(function(t){r.classes=t.value}),n.hasImageCaption&&A(i.caption)&&(r.caption=i.caption),n.hasAdvTab&&(_(i.vspace)&&(r.vspace=i.vspace),_(i.border)&&(r.border=i.border),_(i.hspace)&&(r.hspace=i.hspace),_(i.borderstyle)&&(r.borderstyle=i.borderstyle)),e.setData(u)}},re=function(t,e,n,r){var i,o,a,u,c,l,s,f,d,m,p,g;ee(e,r),ne(e,r),i=t,o=e,a=n,c=(u=r).getData(),l=c.src.value,(s=c.src.meta||{}).width||s.height||!o.hasDimensions||i.imageSize(l).get(function(t){t.each(function(t){a.open&&u.setData({dimensions:t})})}),f=e,d=n,p=(m=r).getData(),g=Vt(f.imageList,p.src.value),d.prevImage=g,m.setData({images:g.map(function(t){return t.value}).getOr("")})},ie=function(t,e,n){var r,i,o,a,u,c=lt(t(n.style)),l=V({},n);return l.vspace=(r=c)["margin-top"]&&r["margin-bottom"]&&r["margin-top"]===r["margin-bottom"]?ut(String(r["margin-top"])):"",l.hspace=(i=c)["margin-right"]&&i["margin-left"]&&i["margin-right"]===i["margin-left"]?ut(String(i["margin-right"])):"",l.border=(o=c)["border-width"]?ut(String(o["border-width"])):"",l.borderstyle=(a=c)["border-style"]?String(a["border-style"]):"",l.style=(u=e)(t(u(c))),l},oe=function(a,u,c,l){var t,e=l.getData();l.block("Uploading image"),(t=e.fileinput,0===t.length?w.none():w.some(t[0])).fold(function(){l.unblock()},function(n){var r=s.URL.createObjectURL(n),i=Xt({url:u.url,basePath:u.basePath,credentials:u.credentials,handler:u.handler}),o=function(){l.unblock(),s.URL.revokeObjectURL(r)};dt(n).then(function(t){var e=a.createBlobCache(n,r,t);i.upload(e).then(function(t){l.setData({src:{value:t,meta:{}}}),l.showTab("general"),re(a,u,c,l),o()})["catch"](function(t){o(),a.alertErr(l,t)})})})},ae=function(h,y,v){return function(t,e){var n,r,i,o,a,u,c,l,s,f,d,m,p,g;"src"===e.name?re(h,y,v,t):"images"===e.name?(s=h,f=y,d=v,p=(m=t).getData(),(g=Vt(f.imageList,p.images)).each(function(t){""===p.alt||d.prevImage.map(function(t){return t.text===p.alt}).getOr(!1)?""===t.value?m.setData({src:t,alt:d.prevAlt}):m.setData({src:t,alt:t.text}):m.setData({src:t})}),d.prevImage=g,re(s,f,d,m)):"alt"===e.name?v.prevAlt=t.getData().alt:"style"===e.name?(a=h,c=(u=t).getData(),l=ie(a.parseStyle,a.serializeStyle,c),u.setData(l)):"vspace"===e.name||"hspace"===e.name||"border"===e.name||"borderstyle"===e.name?(n=h,r=t,i=V(Yt(y.image),r.getData()),o=Pt(n.normalizeCss,te(i)),r.setData({style:o})):"fileinput"===e.name&&oe(h,y,v,t)}},ue=function(o){return function(t){var e,n,r,i={prevImage:Vt((e=t).imageList,e.image.src),prevAlt:e.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=t,r.hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:O([[K(r)],r.hasAdvTab?[Zt(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[Qt(r)]:[]])}:{type:"panel",items:Q(r)}),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Yt(t.image),onSubmit:o.onSubmit(t),onChange:ae(o,t,i),onClose:(n=i,function(){n.open=!1})}}},ce=function(e){var n,r,i,o,a,u,c,t={onSubmit:(c=e,function(n){return function(t){var e=V(Yt(n.image),t.getData());c.undoManager.transact(function(){Ht(c,te(e))}),c.editorUpload.uploadImagesAuto(),t.close()}}),imageSize:(u=e,function(t){return q(function(n){at(u.documentBaseURI.toAbsolute(t),function(t){var e=t.map(function(t){return{width:String(t.width),height:String(t.height)}});n(e)})})}),createBlobCache:(a=e,function(t,e,n){return a.editorUpload.blobCache.create({blob:t,blobUri:e,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,base64:n.split(",")[1]})}),alertErr:(o=e,function(t,e){o.windowManager.alert(e,t.close)}),normalizeCss:(i=e,function(t){return Rt(i,t)}),parseStyle:(r=e,function(t){return r.dom.parseStyle(t)}),serializeStyle:(n=e,function(t,e){return n.dom.serializeStyle(t,e)})};return{open:function(){return Kt(e).map(ue(t)).get(function(t){e.windowManager.open(t)})}}},le=function(t){t.addCommand("mceImage",ce(t).open)},se=function(o){return function(t){for(var e,n=t.length,r=function(t){t.attr("contenteditable",o?"true":null)};n--;){var i=t[n];void 0,(e=i.attr("class"))&&/\bimage\b/.test(e)&&(i.attr("contenteditable",o?"false":null),Bt.each(i.getAll("figcaption"),r))}}},fe=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("figure",se(!0)),t.serializer.addNodeFilter("figure",se(!1))})},de=function(e){e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ce(e).open,onSetup:function(t){return e.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",t.setActive).unbind}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ce(e).open}),e.ui.registry.addContextMenu("image",{update:function(t){return Ct(t)||"IMG"===t.nodeName&&!mt(t)?["image"]:[]}})};!function me(){u.add("image",function(t){fe(t),de(t),le(t)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(v){"use strict";var e,n,t,r,o=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return o(t())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=function(e){return function(){return e}},u=p(!1),c=p(!0),s=u,f=c,l=function(){return d},d=(r={fold:function(e,n){return e()},is:s,isSome:s,isNone:f,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:l,ap:l,each:function(){},bind:l,flatten:l,exists:s,forall:f,filter:l,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(r),r),m=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:f,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},ap:function(e){return e.fold(l,function(e){return m(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:d},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},y={some:m,none:l,from:function(e){return null===e||e===undefined?d:m(e)}};function h(e,n){return b(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return w(n).drawImage(e,0,0),n}function w(e){return e.getContext("2d")}function b(e,n,t){return e.width=n,e.height=t,e}var E=window.Promise?window.Promise:function(){var i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(e,r(o,this),r(a,this))},e=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)};function r(e,n){return function(){return e.apply(n,arguments)}}var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function u(r){var o=this;null!==this._state?e(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var n;try{n=e(o._value)}catch(t){return void r.reject(t)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void f(r(n,e),r(o,this),r(a,this))}this._state=!0,this._value=e,c.call(this)}catch(t){a.call(this,t)}}function a(e){this._state=!1,this._value=e,c.call(this)}function c(){for(var e=0,n=this._deferreds;e<n.length;e++){var t=n[e];u.call(this,t)}this._deferreds=[]}function s(e,n,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.resolve=t,this.reject=r}function f(e,n,t){var r=!1;try{e(function(e){r||(r=!0,n(e))},function(e){r||(r=!0,t(e))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(t,r){var o=this;return new i(function(e,n){u.call(o,new s(t,r,e,n))})},i.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var c=Array.prototype.slice.call(1===e.length&&t(e[0])?e[0]:e);return new i(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void t.call(e,function(e){a(n,e)},i)}c[n]=e,0==--u&&o(c)}catch(r){i(r)}}for(var e=0;e<c.length;e++)a(e,c[e])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(e){e(n)})},i.reject=function(t){return new i(function(e,n){n(t)})},i.race=function(o){return new i(function(e,n){for(var t=0,r=o;t<r.length;t++)r[t].then(e,n)})},i}();function O(e){var n=e.src;return 0===n.indexOf("data:")?I(n):function t(r){return new E(function(e,t){var n=new v.XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e,n=this;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+n.status+" downloading image"))},n.send()})}(n)}function T(a){return new E(function(e,n){var t=v.URL.createObjectURL(a),r=new v.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),e(r)}function u(){o(),n("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function I(t){return new E(function(e,n){(function g(e){var n=e.split(","),t=/data:([^;]+)/.exec(n[0]);if(!t)return y.none();for(var r=t[1],o=n[1],i=v.atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(f+1024,u),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return y.some(new v.Blob(c,{type:r}))})(t).fold(function(){n("uri is not base64: "+t)},e)})}function N(e,r,o){return r=r||"image/png",v.HTMLCanvasElement.prototype.toBlob?new E(function(n,t){e.toBlob(function(e){e?n(e):t()},r,o)}):I(e.toDataURL(r,o))}function S(e){return T(e).then(function(e){!function t(e){v.URL.revokeObjectURL(e.src)}(e);var n=h(function r(e){return e.naturalWidth||e.width}(e),function o(e){return e.naturalHeight||e.height}(e));return w(n).drawImage(e,0,0),n})}function _(e,n,t){var r=n.type;function o(n,t){return e.then(function(e){return function r(e,n,t){return n=n||"image/png",e.toDataURL(n,t)}(e,n,t)})}return{getType:p(r),toBlob:function i(){return E.resolve(n)},toDataURL:function u(){return t},toBase64:function a(){return t.split(",")[1]},toAdjustedBlob:function c(n,t){return e.then(function(e){return N(e,n,t)})},toAdjustedDataURL:o,toAdjustedBase64:function s(e,n){return o(e,n).then(function(e){return e.split(",")[1]})},toCanvas:function f(){return e.then(g)}}}function x(n){return function e(t){return new E(function(e){var n=new v.FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}(n).then(function(e){return _(S(n),n,e)})}function R(n,e){return N(n,e).then(function(e){return _(E.resolve(n),e,n.toDataURL())})}function A(n,t){return n.toCanvas().then(function(e){return function a(e,n,t){var r=h(e.width,e.height),o=w(r),i=0,u=0;90!==(t=t<0?360+t:t)&&270!==t||b(r,r.height,r.width);90!==t&&180!==t||(i=r.width);270!==t&&180!==t||(u=r.height);return o.translate(i,u),o.rotate(t*Math.PI/180),o.drawImage(e,0,0),R(r,n)}(e,n.getType(),t)})}function C(n,t){return n.toCanvas().then(function(e){return function i(e,n,t){var r=h(e.width,e.height),o=w(r);"v"===t?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0));return R(r,n)}(e,n.getType(),t)})}var U=function(e){return x(e)},D=tinymce.util.Tools.resolve("tinymce.util.Delay"),j=tinymce.util.Tools.resolve("tinymce.util.Promise"),L=tinymce.util.Tools.resolve("tinymce.util.URI");var k,P={getImageSize:function mn(e){var n,t;function r(e){return/^[0-9\.]+px$/.test(e)}return n=e.style.width,t=e.style.height,n||t?r(n)&&r(t)?{w:parseInt(n,10),h:parseInt(t,10)}:null:(n=e.width,t=e.height,n&&t?{w:parseInt(n,10),h:parseInt(t,10)}:null)},setImageSize:function hn(e,n){var t,r;n&&(t=e.style.width,r=e.style.height,(t||r)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),t=e.width,r=e.height,(t||r)&&(e.setAttribute("width",n.w),e.setAttribute("height",n.h)))},getNaturalImageSize:function gn(e){return{w:e.naturalWidth,h:e.naturalHeight}}},M=(k="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===k}),B=Array.prototype.slice,F=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return y.some(o)}return y.none()},z=(M(Array.from)&&Array.from,function(e){return null!==e&&e!==undefined}),H=function(e,n){var t;return t=n.reduce(function(e,n){return z(e)?e[n]:undefined},e),z(t)?t:null},q=function(n){return new j(function(t){var e=new v.FileReader;e.onload=function(e){var n=e.target;t(n.result)},e.readAsText(n)})},$=function(n,r,o){return new j(function(e){var t;(t=new v.XMLHttpRequest).onreadystatechange=function(){4===t.readyState&&e({status:t.status,blob:this.response})},t.open("GET",n,!0),t.withCredentials=o,a.each(r,function(e,n){t.setRequestHeader(n,e)}),t.responseType="blob",t.send()})},X=function(e){var n;try{n=JSON.parse(e)}catch(t){}return n},W=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],G=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],Y=function(n){return"ImageProxy HTTP error: "+F(W,function(e){return n===e.code}).fold(p("Unknown ImageProxy error"),function(e){return e.message})},V=function(e){var n=Y(e);return j.reject(n)},J=function(n){return F(G,function(e){return e.type===n}).fold(p("Unknown service error"),function(e){return e.message})},K=function(e,n){return q(n).then(function(e){var n,t,r=(n=X(e),"ImageProxy Service error: "+((t=H(n,["error","type"]))?J(t):"Invalid JSON in service error message"));return j.reject(r)})},Q=function(e,n){return 400===(t=e)||403===t||500===t?K(0,n):V(e);var t},Z=V,ee=function(e,n){var t,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":n};return $((t=e,r=n,o=-1===t.indexOf("?")?"?":"&",/[?&]apiKey=/.test(t)||!r?t:t+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(e){return e.status<200||300<=e.status?Q(e.status,e.blob):j.resolve(e.blob)})};var ne,te,re,oe=function(e,n,t){return n?ee(e,n):function r(e,n){return $(e,{},n).then(function(e){return e.status<200||300<=e.status?Z(e.status):j.resolve(e.blob)})}(e,t)},ie=function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)},ue=function(e,n){return ie(e,n,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},ae=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return se(r(1),r(2))},ce=function(){return se(0,0)},se=function(e,n){return{major:e,minor:n}},fe={nu:se,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?ce():ae(e,t)},unknown:ce},le="Firefox",de=function(e,n){return function(){return n===e}},me=function(e){var n=e.current;return{current:n,version:e.version,isEdge:de("Edge",n),isChrome:de("Chrome",n),isIE:de("IE",n),isOpera:de("Opera",n),isFirefox:de(le,n),isSafari:de("Safari",n)}},he={unknown:function(){return me({current:undefined,version:fe.unknown()})},nu:me,edge:p("Edge"),chrome:p("Chrome"),ie:p("IE"),opera:p("Opera"),firefox:p(le),safari:p("Safari")},ge="Windows",ve="Android",pe="Solaris",ye="FreeBSD",we=function(e,n){return function(){return n===e}},be=function(e){var n=e.current;return{current:n,version:e.version,isWindows:we(ge,n),isiOS:we("iOS",n),isAndroid:we(ve,n),isOSX:we("OSX",n),isLinux:we("Linux",n),isSolaris:we(pe,n),isFreeBSD:we(ye,n)}},Ee={unknown:function(){return be({current:undefined,version:fe.unknown()})},nu:be,windows:p(ge),ios:p("iOS"),android:p(ve),linux:p("Linux"),osx:p("OSX"),solaris:p(pe),freebsd:p(ye)},Oe=function(e,n){var t=String(n).toLowerCase();return F(e,function(e){return e.search(t)})},Te=function(e,t){return Oe(e,t).map(function(e){var n=fe.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Ie=function(e,t){return Oe(e,t).map(function(e){var n=fe.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Ne=function(e,n){return-1!==e.indexOf(n)},Se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,_e=function(n){return function(e){return Ne(e,n)}},xe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ne(e,"edge/")&&Ne(e,"chrome")&&Ne(e,"safari")&&Ne(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Se],search:function(e){return Ne(e,"chrome")&&!Ne(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ne(e,"msie")||Ne(e,"trident")}},{name:"Opera",versionRegexes:[Se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:_e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:_e("firefox")},{name:"Safari",versionRegexes:[Se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Ne(e,"safari")||Ne(e,"mobile/"))&&Ne(e,"applewebkit")}}],Re=[{name:"Windows",search:_e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ne(e,"iphone")||Ne(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:_e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:_e("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:_e("linux"),versionRegexes:[]},{name:"Solaris",search:_e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:_e("freebsd"),versionRegexes:[]}],Ae={browsers:p(xe),oses:p(Re)},Ce=function(e){var n,t,r,o,i,u,a,c,s,f,l,d=Ae.browsers(),m=Ae.oses(),h=Te(d,e).fold(he.unknown,he.nu),g=Ie(m,e).fold(Ee.unknown,Ee.nu);return{browser:h,os:g,deviceType:(t=h,r=e,o=(n=g).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,c=o||u||a&&!0===/mobile/i.test(r),s=n.isiOS()||n.isAndroid(),f=s&&!c,l=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:p(o),isiPhone:p(i),isTablet:p(c),isPhone:p(f),isTouch:p(s),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:p(l)})}},Ue={detect:(re=!(ne=function(){var e=v.navigator.userAgent;return Ce(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return re||(re=!0,te=ne.apply(null,e)),te})},De=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:p(e)}},je={fromHtml:function(e,n){var t=(n||v.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return De(t.childNodes[0])},fromTag:function(e,n){var t=(n||v.document).createElement(e);return De(t)},fromText:function(e,n){var t=(n||v.document).createTextNode(e);return De(t)},fromDom:De,fromPoint:function(e,n,t){var r=e.dom();return y.from(r.elementFromPoint(n,t)).map(De)}},Le=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE,v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),ke=(v.Node.TEXT_NODE,v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,Le),Pe=(Ue.detect().browser.isIE(),"undefined"!=typeof v.window?v.window:Function("return this;")(),function(e,n){return t=function(e){return function(e,n){var t=e.dom();if(t.nodeType!==ke)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}(e,n)},F(e.dom().childNodes,function(e){return t(je.fromDom(e))}).map(je.fromDom);var t}),Me=0,Be=function(e){return Pe(je.fromDom(e),"img")},Fe=function(e,n){return e.dom.is(n,"figure")},ze=function(e,n){e.notificationManager.open({text:n,type:"error"})},He=function(e){var n=e.selection.getNode();return Fe(e,n)?Be(n):y.some(je.fromDom(n))},qe=function(e,n){var t=n.src;return 0===t.indexOf("data:")||0===t.indexOf("blob:")||new L(t).host===e.documentBaseURI.host},$e=function(e,n){return-1!==a.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new L(n.src).host)},Xe=function(e,n){var t,r,o,i,u=n.src;return $e(e,n)?oe(n.src,null,(r=e,o=n,-1!==a.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new L(o.src).host))):qe(e,n)?O(n):(u=e.getParam("imagetools_proxy"),u+=(-1===u.indexOf("?")?"?":"&")+"url="+encodeURIComponent(n.src),t=(i=e).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),oe(u,t,!1))},We=function(e,n){return(t=e,y.from(t.getParam("imagetools_fetch_image",null,"function"))).fold(function(){return Xe(e,n)},function(e){return e(n)});var t},Ge=function(e,n){var t;return(t=e.editorUpload.blobCache.getByUri(n.src))?j.resolve(t.blob()):We(e,n)},Ye=function(e){D.clearTimeout(e.get())},Ve=function(a,c,s,f,l,d){return c.toBlob().then(function(e){var n,t,r,o,i,u;return r=a.editorUpload.blobCache,n=l.src,a.getParam("images_reuse_filename",!1,"boolean")&&(t=(o=r.getByUri(n))?(n=o.uri(),o.name()):(i=a,(u=n.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?i.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+Me++,blob:e,base64:c.toBase64(),uri:n,name:t}),r.add(o),a.undoManager.transact(function(){a.$(l).on("load",function r(){var e,n,t;a.$(l).off("load",r),a.nodeChanged(),s?a.editorUpload.uploadImagesAuto():(Ye(f),e=a,n=f,t=D.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),n.set(t))}),d&&a.$(l).attr({width:d.w,height:d.h}),a.$(l).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},Je=function(t,r,e,o){return function(){return He(t).fold(function(){ze(t,"Could not find selected image")},function(n){return t._scanForImages().then(function(){return Ge(t,n.dom())}).then(U).then(e).then(function(e){return Ve(t,e,!1,r,n.dom(),o)},function(e){ze(t,e)})})}},Ke=function(n,t,r){return function(){var e=He(n).fold(function(){return null},function(e){var n=P.getImageSize(e.dom());return n?{w:n.h,h:n.w}:null});return Je(n,t,function(e){return A(e,r)},e)()}},Qe=function(e,n,t){return function(){return Je(e,n,function(e){return C(e,t)})()}},Ze=function(t,e){var n=function(e){return n=e,t.dom.is(n,"img:not([data-mce-object],[data-mce-placeholder])")&&(qe(t,e)||$e(t,e)||t.settings.imagetools_proxy);var n};return Fe(t,e)?Be(e).map(function(e){return n(e.dom())?y.some(e.dom()):y.none()}):n(e)?y.some(e):y.none()},en=Ye,nn=Ge,tn=He,rn=function(t,r,o,i,u){return new j(function(e){var n;(n=u,T(n)).then(function(e){var n=P.getNaturalImageSize(e);return i.w===n.w&&i.h===n.h||P.getImageSize(o)&&P.setImageSize(o,n),v.URL.revokeObjectURL(e.src),u}).then(U).then(function(e){return Ve(t,e,!0,r,o)},function(){})})},on=p("save-state"),un=p("disable"),an=p("enable"),cn=function(i,u){return function(){var r=tn(i),o=r.map(function(e){return P.getNaturalImageSize(e.dom())});tn(i).each(function(n){Ze(i,n.dom()).each(function(e){nn(i,n.dom()).then(function(e){var n,t={blob:n=e,url:v.URL.createObjectURL(n)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var t=e.getData().imagetools.blob;r.each(function(n){o.each(function(e){rn(i,u,n.dom(),e,t)})}),e.close()},onCancel:function(){},onAction:function(e,n){switch(n.name){case on():n.value?e.enable("save"):e.disable("save");break;case un():e.disable("save"),e.disable("cancel");break;case an():e.enable("cancel")}}})})})})}},sn=function(t,e){a.each({mceImageRotateLeft:Ke(t,e,-90),mceImageRotateRight:Ke(t,e,90),mceImageFlipVertical:Qe(t,e,"v"),mceImageFlipHorizontal:Qe(t,e,"h"),mceEditImage:cn(t,e)},function(e,n){t.addCommand(n,e)})},fn=function(t,r,o){t.on("NodeChange",function(e){var n=o.get();n&&n.src!==e.element.src&&(en(r),t.editorUpload.uploadImagesAuto(),o.set(null)),Ze(t,e.element).each(o.set)})},ln=function(r){var n=function(e){return function(){return r.execCommand(e)}};r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:function(t){var e=function(){tn(r).each(function(e){var n=Ze(r,e.dom()).isNone();t.setDisabled(n)})};return r.on("NodeChange",e),function(){r.off("NodeChange",e)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:n("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(e){return Ze(r,e).fold(function(){return[]},function(e){return[{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}]})}})},dn=function(n){var e;n.ui.registry.addContextToolbar("imagetools",{items:(e=n,e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")),predicate:function(e){return Ze(n,e).isSome()},position:"node",scope:"node"})};!function vn(){i.add("imagetools",function(e){var n=o(0),t=o(null);sn(e,n),ln(e),dn(e),fn(e,n,t)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},h=function(t){return t.getParam("importcss_selector_converter")},l=function(t){return t.getParam("importcss_selector_filter")},p=function(t){return t.getParam("importcss_groups")},_=function(t){return t.getParam("importcss_append")},x=function(t){return t.getParam("importcss_file_filter")},u=function(t){return function(){return t}},s=u(!1),a=u(!0),g=function(){return y},y=(r={fold:function(t,e){return t()},is:s,isSome:s,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:s,forall:a,filter:g,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(r),r),O=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}},T=O("array"),b=O("function"),k=Array.prototype.slice,S=Array.prototype.push,A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!T(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o,t)}return r}(t,e))},P=(b(Array.from)&&Array.from,function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}),w=function(c,t,s){var a=[],n={};function l(t,e){var n,r,o,i=t.href;if(r=i,o=m.cacheSuffix,"string"==typeof r&&(r=r.replace("?"+o,"").replace("&"+o,"")),(i=r)&&s(i,e)&&!function(t,e){var n=t.settings,r=!1!==n.skin&&(n.skin||"oxide");if(r){var o=n.skin_url?t.documentBaseURI.toAbsolute(n.skin_url):f.baseURL+"/skins/ui/"+r,i=f.baseURL+"/skins/content/";return e===o+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(i)}return!1}(c,i)){d.each(t.imports,function(t){l(t,!0)});try{n=t.cssRules||t.rules}catch(u){}d.each(n,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&d.each(t.selectorText.split(","),function(t){a.push(d.trim(t))})})}}d.each(c.contentCSS,function(t){n[t]=!0}),s||(s=function(t,e){return e||n[t]});try{d.each(t.styleSheets,function(t){l(t)})}catch(e){}return a},E=function(t,e){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(r){var o=r[1],i=r[2].substr(1).split(".").join(" "),u=d.makeMap("a,img");return r[1]?(n={title:e},t.schema.getTextBlockElements()[o]?n.block=o:t.schema.getBlockElements()[o]||u[o.toLowerCase()]?n.selector=o:n.inline=o):r[2]&&(n={inline:"span",title:e.substr(1),classes:i}),!1!==c(t)?n.classes=i:n.attributes={"class":i},n}},I=function(t,e){return null===e||!1!==i(t)},M=E,j=function(y){y.on("init",function(t){var e,n,r,o,i=(e=[],n=[],r={},{addItemToGroup:function(t,e){r[t]?r[t].push(e):(n.push(t),r[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return A(n,function(t){var e=r[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),g={},u=P(l(y)),c=(o=p(y),d.map(o,function(t){return d.extend({},t,{original:t,selectors:{},filter:P(t.filter),item:{text:t.title,menu:[]}})})),s=function(t,e){if(f=t,p=g,!(I(y,m=e)?f in p:f in m.selectors)){s=t,l=g,I(y,a=e)?l[s]=!0:a.selectors[s]=!0;var n=(i=(o=y).plugins.importcss,u=t,((c=e)&&c.selector_converter?c.selector_converter:h(o)?h(o):function(){return E(o,u)}).call(i,u,c));if(n){var r=n.name||v.DOM.uniqueId();return y.formatter.register(r,n),d.extend({},{title:n.title,format:r})}}var o,i,u,c,s,a,l,f,m,p;return null};d.each(w(y,y.getDoc(),P(x(y))),function(n){if(-1===n.indexOf(".mce-")&&(!u||u(n))){var t=(r=c,o=n,d.grep(r,function(t){return!t.filter||t.filter(o)}));if(0<t.length)d.each(t,function(t){var e=s(n,t);e&&i.addItemToGroup(t.title,e)});else{var e=s(n,null);e&&i.addItem(e)}}var r,o});var a=i.toFormats();y.fire("addStyleModifications",{items:a,replace:!_(y)})})},D=function(e){return{convertSelectorToFormat:function(t){return M(e,t)}}};!function R(){o.add("importcss",function(t){return j(t),D(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},a=n,i=r,o=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},l=function(e){return e.getParam("insertdatetime_element",!1)},u="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),m="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" "),d=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",d(n.getMonth()+1,2))).replace("%d",d(n.getDate(),2))).replace("%H",""+d(n.getHours(),2))).replace("%M",""+d(n.getMinutes(),2))).replace("%S",""+d(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(s[n.getMonth()]))).replace("%b",""+e.translate(m[n.getMonth()]))).replace("%A",""+e.translate(c[n.getDay()]))).replace("%a",""+e.translate(u[n.getDay()]))).replace("%%","%")},p=function(e,t){if(l(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,c,m},g=f,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,a(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return S(n())}}},v=function(n){var t=i(n),r=S(o(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];p(n,r.get())},onItemAction:function(e,t){r.set(t),p(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return M.map(t,function(e){return{type:"menuitem",text:g(n,e),onAction:(t=e,function(){r.set(t),p(n,t)})};var t})}})};!function h(){e.add("insertdatetime",function(e){y(e),v(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},s=function(e,t){e.settings.font_formats=t},r=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},o=function(e,t){e.settings.inline_styles=t},a=function(a){var e;o(e=a,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||s(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),a.on("init",function(){return e=a,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(r(e)),n=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return l.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,n})};!function c(){e.add("legacyoutput",function(e){a(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(c){"use strict";var n,t,e,r,o,i,u,a,s,l=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}},m=d("string"),h=d("array"),p=d("boolean"),g=d("function"),v=function(n){var t=n.getParam("link_assume_external_targets",!1);return p(t)&&t?1:!m(t)||"http"!==t&&"https"!==t?0:t},y=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},w=function(n){return n.getParam("link_list")},x=function(n){return n.getParam("default_link_target")},k=function(n){return n.getParam("target_list",!0)},b=function(n){return n.getParam("rel_list",[],"array")},_=function(n){return n.getParam("link_class_list",[],"array")},T=function(n){return n.getParam("link_title",!0,"boolean")},O=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},A=function(n){return n.getParam("link_quicklink",!1,"boolean")},C=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.Env"),N=function(n){if(!P.ie||10<P.ie){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),i=t,u=e,c.document.body.appendChild(i),i.dispatchEvent(u),c.document.body.removeChild(i)}else{var r=c.window.open("","_blank");if(r){r.opener=null;var o=r.document;o.open(),o.write('<meta http-equiv="refresh" content="0; url='+C.DOM.encode(n)+'">'),o.close()}}var i,u},E=function(){},I=function(n){return function(){return n}},j=I(!1),S=I(!0),F=j,L=S,R=function(){return D},D=(r={fold:function(n,t){return n()},is:F,isSome:F,isNone:L,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:R,ap:R,each:function(){},bind:R,flatten:R,exists:F,forall:L,filter:R,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:I("none()")},Object.freeze&&Object.freeze(r),r),U=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:L,isNone:F,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return U(n(e))},ap:function(n){return n.fold(R,function(n){return U(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:D},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(F,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},M={some:U,none:R,from:function(n){return null===n||n===undefined?D:U(n)}},z=Array.prototype.slice,q=(o=Array.prototype.indexOf)===undefined?function(n,t){return B(n,t)}:function(n,t){return o.call(n,t)},K=function(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e,n)}},B=function(n,t){for(var e=0,r=n.length;e<r;++e)if(n[e]===t)return e;return-1},V=Array.prototype.push,W=function(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!h(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);V.apply(t,n[e])}return t},H=function(n,t){var e=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r}(n,t);return W(e)},$=(g(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Tools")),G=function(n){return/^\w+:/i.test(n)},J=function(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===$.inArray(o,n)})},c=t?0<(e=u(e=i)).length?e.concat(o):o:u(i);return 0<c.length?(r=c,$.trim(r.sort().join(" "))):""},X=function(n,t){return t=t||n.selection.getNode(),Y(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")},Q=function(n){return n&&"A"===n.nodeName&&!!n.href},Y=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},Z=function(n){return t=["title","rel","class","target"],e=function(t,e){return n[e].each(function(n){t[e]=0<n.length?n:null}),t},r={href:n.href},K(t,function(n){r=e(r,n)}),r;var t,e,r},nn=function(n,t){var e=n.dom.select("img",t)[0];if(e){var r=n.dom.getParents(e,"a[href]",t)[0];r&&(r.parentNode.insertBefore(e,r),n.dom.remove(r))}},tn=function(n,t,e){var r=n.dom.select("img",t)[0];if(r){var o=n.dom.create("a",e);r.parentNode.insertBefore(o,r),o.appendChild(r)}},en=function(h,p,g){h.undoManager.transact(function(){var n,t,e,r,o,i,u,c,a,l,f=h.selection.getNode(),s=X(h,f),d=Z(g);if(!(0<b(h).length)&&!1===O(h)){var m=J(d.rel,"_blank"===d.target);d.rel=m||null}M.from(d.target).isNone()&&(d.target=x(h)),d.href=(n=d.href,"http"!==(t=v(h))&&"https"!==t||G(n)?n:t+"://"+n),g.href===p.href&&p.attach(),s?(h.focus(),u=h,c=s,a=g.text,l=d,a.each(function(n){c.hasOwnProperty("innerText")?c.innerText=n:c.textContent=n}),u.dom.setAttribs(c,l),u.selection.select(c)):(e=h,r=f,o=g.text,i=d,Y(r)?tn(e,r,i):o.fold(function(){e.execCommand("mceInsertLink",!1,i)},function(n){e.insertContent(e.dom.createHTML("a",i,e.dom.encode(n)))}))})},rn=function(e){e.undoManager.transact(function(){var n=e.selection.getNode();if(Y(n))nn(e,n);else{var t=e.dom.getParent(n,"a[href]",e.getBody());t&&e.dom.remove(t,!0)}e.focus()})},on=function(n){return 0<$.grep(n,Q).length},un=function(n){var t=n.getAttribute("data-mce-href");return t||n.getAttribute("href")},cn=function(n){return!(/</.test(n)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},an=X,ln=function(n,t){var e=t?t.innerText||t.textContent:n.getContent({format:"text"});return e.replace(/\uFEFF/g,"")},fn=J,sn=G,dn=function(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return M.none()},mn=function(n){return m(n.value)?n.value:""},hn=function(e){return void 0===e&&(e=mn),function(n){return M.from(n).map(function(n){return t=n,r=e,o=[],$.each(t,function(n){var t=m(n.text)?n.text:m(n.title)?n.title:"";if(n.menu!==undefined);else{var e=r(n);o.push({text:t,value:e})}}),o;var t,r,o})}},pn={sanitize:function(n){return hn(mn)(n)},sanitizeWith:hn,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:mn},gn=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return gn(e())}}},vn=function(t,n,e,r){var o,i,u=r[n],c=0<t.length;return u!==undefined?(o=u,i=e,dn(i,function(n){return M.some(n).filter(function(n){return n.value===o})})).map(function(n){return{url:{value:n.value,meta:{text:c?t:n.text,attach:E}},text:c?t:n.text}}):M.none()},yn=function(n,i){var u=gn(n.text),o=function(n,t){var e,r,o=(e=i,r=t.name,"link"===r?e.catalogs.link:"anchor"===r?e.catalogs.anchor:M.none()).getOr([]);return vn(u.get(),t.name,o,n)};return{onChange:function(n,t){return"url"===t.name?function(n){if(u.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return M.some({text:t})}return M.none()}(n()):(e=["anchor","link"],r=t.name,-1<q(e,r)?o(n(),t):("text"===t.name&&u.set(n().text),M.none()));var e,r}}},wn=function(){return(wn=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},xn={},kn={exports:xn};i=undefined,u=xn,a=kn,s=undefined,function(n){"object"==typeof u&&void 0!==a?a.exports=n():"function"==typeof i&&i.amd?i([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function f(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof s&&s;if(!n&&e)return e(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,f,i,u,c)}return u[t].exports}for(var l="function"==typeof s&&s,n=0;n<c.length;n++)a(c[n]);return a}({1:[function(n,t,e){var r,o,i=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(t){try{return r.call(null,n,0)}catch(t){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var l,f=[],s=!1,d=-1;function m(){s&&l&&(s=!1,l.length?f=l.concat(f):d=-1,f.length&&h())}function h(){if(!s){var n=a(m);s=!0;for(var t=f.length;t;){for(l=f,f=[];++d<t;)l&&l[d].run();d=-1,t=f.length}l=null,s=!1,function e(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return o(n)}catch(t){try{return o.call(null,n)}catch(t){return o.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function g(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(new p(n,t)),1!==f.length||s||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,s,t){(function(e){!function(n){var t=setTimeout;function r(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var t;try{t=n(r._value)}catch(e){return void c(o.promise,e)}u(o.promise,t)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void a(n);if("function"==typeof e)return void f(function r(n,t){return function(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,a(n)}catch(o){c(n,o)}}function c(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)o(n,n._deferreds[t]);n._deferreds=null}function l(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,c(t,n))})}catch(r){if(e)return;e=!0,c(t,r)}}i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(r);return o(this,new l(n,t,e)),e},i.all=function(n){var a=Array.prototype.slice.call(n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){c(t,n)},i)}a[t]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(n){n(t)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(o){return new i(function(n,t){for(var e=0,r=o.length;e<r;e++)o[e].then(n,t)})},i._immediateFn="function"==typeof e?function(n){e(n)}:function(n){t(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==s&&s.exports?s.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,l){(function(n,t){var r=a("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,t){this._id=n,this._clearFn=t}l.setTimeout=function(){return new c(e.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new c(e.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},l.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},l._unrefActive=l.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},l.setImmediate="function"==typeof n?n:function(n){var t=u++,e=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(e?n.apply(null,e):n.call(null),l.clearImmediate(t))}),t},l.clearImmediate="function"==typeof t?t:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var bn=kn.exports.boltExport,_n=function(n){var e=M.none(),t=[],r=function(n){o()?u(n):t.push(n)},o=function(){return e.isSome()},i=function(n){K(n,u)},u=function(t){e.each(function(n){c.setTimeout(function(){t(n)},0)})};return n(function(n){e=M.some(n),i(t),t=[]}),{get:r,map:function(e){return _n(function(t){r(function(n){t(e(n))})})},isReady:o}},Tn={nu:_n,pure:function(t){return _n(function(n){n(t)})}},On=function(n){c.setTimeout(function(){throw n},0)},An=function(e){var n=function(n){e().then(n,On)};return{map:function(n){return An(function(){return e().then(n)})},bind:function(t){return An(function(){return e().then(function(n){return t(n).toPromise()})})},anonBind:function(n){return An(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return Tn.nu(n)},toCached:function(){var n=null;return An(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},Cn=function(n){return An(function(){return new bn(n)})},Pn=function(n){return An(function(){return bn.resolve(n)})},Nn=tinymce.util.Tools.resolve("tinymce.util.Delay"),En=function(n){var t=n.href;return 0<t.indexOf("@")&&-1===t.indexOf("//")&&-1===t.indexOf("mailto:")?M.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(n){return wn({},n,{href:"mailto:"+t})}}):M.none()},In=function(u,n,c){return dn([En,(e=n,function(n){var t=n.href;return 1===e&&!sn(t)||0===e&&/^\s*www[\.|\d\.]/i.test(t)?M.some({message:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",preprocess:function(n){return wn({},n,{href:"http://"+t})}}):M.none()})],function(n){return n(c)}).fold(function(){return Pn(c)},function(i){return Cn(function(t){var e,n,r,o;e=u,n=i.message,r=function(n){t(n?i.preprocess(c):c)},o=e.selection.getRng(),Nn.setEditorTimeout(e,function(){e.windowManager.confirm(n,function(n){e.selection.setRng(o),r(n)})})})});var e},jn=function(n){var t=n.dom.select("a:not([href])"),e=H(t,function(n){var t=n.name||n.id;return t?[{text:t,value:"#"+t}]:[]});return 0<e.length?M.some([{text:"None",value:""}].concat(e)):M.none()},Sn=function(n){var t=_(n);return 0<t.length?pn.sanitize(t):M.none()},Fn=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ln=function(t){var e=function(n){return t.convertURL(n.value||n.url,"href")},n=w(t);return Cn(function(t){m(n)?Fn.send({url:n,success:function(n){return t(function(n){try{return M.some(JSON.parse(n))}catch(t){return M.none()}}(n))},error:function(n){return t(M.none())}}):g(n)?n(function(n){return t(M.some(n))}):t(M.from(n))}).map(function(n){return n.bind(pn.sanitizeWith(e)).map(function(n){return 0<n.length?[{text:"None",value:""}].concat(n):n})})},Rn=function(n,t){var e=b(n);if(0<e.length){var r=t.is("_blank");return(!1===O(n)?pn.sanitizeWith(function(n){return fn(pn.getValue(n),r)}):pn.sanitize)(e)}return M.none()},Dn=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Un=function(n){var t=k(n);return h(t)?pn.sanitize(t).orThunk(function(){return M.some(Dn)}):!1===t?M.none():M.some(Dn)},Mn=function(n,t,e){var r=n.getAttrib(t,e);return null!==r&&0<r.length?M.some(r):M.none()},zn=function(f,s){return Ln(f).map(function(n){var t,e,r,o,i,u,c,a,l=(e=s,r=(t=f).dom,o=cn(t.selection.getContent())?M.some(ln(t.selection,e)):M.none(),i=e?M.some(r.getAttrib(e,"href")):M.none(),u=e?M.from(r.getAttrib(e,"target")):M.none(),c=Mn(r,e,"rel"),a=Mn(r,e,"class"),{url:i,text:o,title:Mn(r,e,"title"),target:u,rel:c,linkClass:a});return{anchor:l,catalogs:{targets:Un(f),rels:Rn(f,l.target),classes:Sn(f),anchor:jn(f),link:n},optNode:M.from(s),flags:{titleEnabled:T(f)}}})},qn=function(g){var n,t;(t=an(n=g),zn(n,t)).map(function(n){var i,u,c,t,e,r,o,a,l,f,s,d,m,h,p=(u=n,c=v(i=g),function(n){var e=n.getData();if(!e.url.value)return rn(i),void n.close();var t=function(t){return M.from(e[t]).filter(function(n){return!u.anchor[t].is(n)})},r={href:e.url.value,text:t("text"),target:t("target"),rel:t("rel"),"class":t("linkClass"),title:t("title")},o={href:e.url.value,attach:e.url.meta!==undefined&&e.url.meta.attach?e.url.meta.attach:function(){}};In(i,c,r).get(function(n){en(i,o,n)}),n.close()});return e=p,r=g,l=(t=n).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),f=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],s=M.from(x(r)),a=s,d={url:{value:(o=t).anchor.url.getOr(""),meta:{attach:function(){},text:o.anchor.url.fold(function(){return""},function(){return o.anchor.text.getOr("")}),original:{value:o.anchor.url.getOr("")}}},text:o.anchor.text.getOr(""),title:o.anchor.title.getOr(""),anchor:o.anchor.url.getOr(""),link:o.anchor.url.getOr(""),rel:o.anchor.rel.getOr(""),target:o.anchor.target.or(a).getOr(""),linkClass:o.anchor.linkClass.getOr("")},m=yn(d,t),h=t.catalogs,{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:W([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],l,f,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t}([h.anchor.map(pn.createUi("anchor","Anchors")),h.rels.map(pn.createUi("rel","Rel")),h.targets.map(pn.createUi("target","Open link in...")),h.link.map(pn.createUi("link","Link list")),h.classes.map(pn.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:d,onChange:function(t,n){var e=n.name;m.onChange(t.getData,{name:e}).each(function(n){t.setData(n)})},onSubmit:e}}).get(function(n){g.windowManager.open(n)})},Kn=function(n,t){return n.dom.getParent(t,"a[href]")},Bn=function(n){return Kn(n,n.selection.getStart())},Vn=function(n,t){if(t){var e=un(t);if(/^#/.test(e)){var r=n.$(e);r.length&&n.selection.scrollIntoView(r[0],!0)}else N(t.href)}},Wn=function(n){return function(){qn(n)}},Hn=function(n){return function(){Vn(n,Bn(n))}},$n=function(r){r.on("click",function(n){var t=Kn(r,n.target);t&&f.metaKeyPressed(n)&&(n.preventDefault(),Vn(r,t))}),r.on("keydown",function(n){var t,e=Bn(r);e&&13===n.keyCode&&!0===(t=n).altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey&&(n.preventDefault(),Vn(r,e))})},Gn=function(e){return function(t){var n=function(n){return t.setActive(!e.readonly&&!!an(e,n.element))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Jn=function(e){return function(t){t.setDisabled(!on(e.dom.getParents(e.selection.getStart())));var n=function(n){return t.setDisabled(!on(n.parents))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Xn=function(n){n.addCommand("mceLink",function(){A(n)?n.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Wn(n)()})},Qn=function(n){n.addShortcut("Meta+K","",function(){n.execCommand("mceLink")})},Yn=function(n){n.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Wn(n),onSetup:Gn(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return rn(n)},onSetup:Jn(n)})},Zn=function(n){n.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Hn(n),onSetup:Jn(n)}),n.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Wn(n)}),n.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return rn(n)},onSetup:Jn(n)})},nt=function(t){t.ui.registry.addContextMenu("link",{update:function(n){return on(t.dom.getParents(n,"a"))?"link unlink openlink":"link"}})},tt=function(i){var n=function(n){var t=i.selection.getNode();return n.setDisabled(!an(i,t)),function(){}};i.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Gn(i)},label:"Link",predicate:function(n){return!!an(i,n)&&y(i)},initValue:function(){var n=an(i);return n?un(n):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var t=i.selection.getNode();return n.setActive(!!an(i,t)),Gn(i)(n)},onAction:function(n){var t=an(i),e=n.getValue();if(t)i.dom.setAttrib(t,"href",e),i.selection.collapse(!1),n.hide();else{var r={href:e,attach:function(){}},o=cn(i.selection.getContent())?M.some(ln(i.selection,t)).filter(function(n){return 0<n.length}).or(M.from(e)):M.none();en(i,r,{href:e,text:o,title:M.none(),rel:M.none(),target:M.none(),"class":M.none()}),n.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){rn(i),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){Hn(i)(),n.hide()}}]})};!function et(){l.add("link",function(n){Yn(n),Zn(n),nt(n),tt(n),$n(n),Xn(n),Qn(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(u){"use strict";var e,n,t,r,o,i,a,s,c,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(e){return function(){return e}},d=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},l=v(!1),m=v(!0),g=l,p=m,h=function(){return y},y=(r={fold:function(e,n){return e()},is:g,isSome:g,isNone:p,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:h,ap:h,each:function(){},bind:h,flatten:h,exists:g,forall:p,filter:h,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(r),r),N=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:p,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return N(e(t))},ap:function(e){return e.fold(h,function(e){return N(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:y},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(g,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:N,none:h,from:function(e){return null===e||e===undefined?y:N(e)}},O=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}},C=O("string"),b=O("array"),L=O("boolean"),T=O("function"),E=O("number"),D=Array.prototype.slice,w=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o,e)}return r},k=function(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t,e)}},A=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r,e)&&t.push(i)}return t},x=function(e,n,t){return k(e,function(e){t=n(t,e)}),t},R=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return S.some(o)}return S.none()},I=Array.prototype.push,_=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!b(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);I.apply(n,e[t])}return n}(w(e,n))},B=function(e){return 0===e.length?S.none():S.some(e[0])},P=function(e){return 0===e.length?S.none():S.some(e[e.length-1])},M=(T(Array.from)&&Array.from,function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}),U=function(e,n){return M(e,n,u.Node.DOCUMENT_POSITION_CONTAINED_BY)},F=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return H(r(1),r(2))},j=function(){return H(0,0)},H=function(e,n){return{major:e,minor:n}},$={nu:H,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?j():F(e,t)},unknown:j},q="Edge",W="Chrome",V="Opera",z="Firefox",K="Safari",X=function(e,n){return function(){return n===e}},Q=function(e){var n=e.current;return{current:n,version:e.version,isEdge:X(q,n),isChrome:X(W,n),isIE:X("IE",n),isOpera:X(V,n),isFirefox:X(z,n),isSafari:X(K,n)}},Y={unknown:function(){return Q({current:undefined,version:$.unknown()})},nu:Q,edge:v(q),chrome:v(W),ie:v("IE"),opera:v(V),firefox:v(z),safari:v(K)},G="Windows",J="Android",Z="Solaris",ee="FreeBSD",ne=function(e,n){return function(){return n===e}},te=function(e){var n=e.current;return{current:n,version:e.version,isWindows:ne(G,n),isiOS:ne("iOS",n),isAndroid:ne(J,n),isOSX:ne("OSX",n),isLinux:ne("Linux",n),isSolaris:ne(Z,n),isFreeBSD:ne(ee,n)}},re={unknown:function(){return te({current:undefined,version:$.unknown()})},nu:te,windows:v(G),ios:v("iOS"),android:v(J),linux:v("Linux"),osx:v("OSX"),solaris:v(Z),freebsd:v(ee)},oe=function(e,n){var t=String(n).toLowerCase();return R(e,function(e){return e.search(t)})},ie=function(e,t){return oe(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},ue=function(e,t){return oe(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},ae=function(e,n){return-1!==e.indexOf(n)},se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ce=function(n){return function(e){return ae(e,n)}},fe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ae(e,"edge/")&&ae(e,"chrome")&&ae(e,"safari")&&ae(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,se],search:function(e){return ae(e,"chrome")&&!ae(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ae(e,"msie")||ae(e,"trident")}},{name:"Opera",versionRegexes:[se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ce("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ce("firefox")},{name:"Safari",versionRegexes:[se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ae(e,"safari")||ae(e,"mobile/"))&&ae(e,"applewebkit")}}],de=[{name:"Windows",search:ce("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ae(e,"iphone")||ae(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ce("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ce("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ce("linux"),versionRegexes:[]},{name:"Solaris",search:ce("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ce("freebsd"),versionRegexes:[]}],le={browsers:v(fe),oses:v(de)},me=function(e){var n,t,r,o,i,u,a,s,c,f,d,l=le.browsers(),m=le.oses(),g=ie(l,e).fold(Y.unknown,Y.nu),p=ue(m,e).fold(re.unknown,re.nu);return{browser:g,os:p,deviceType:(t=g,r=e,o=(n=p).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,s=o||u||a&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),f=c&&!s,d=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:v(o),isiPhone:v(i),isTablet:v(s),isPhone:v(f),isTouch:v(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(d)})}},ge={detect:(a=!(o=function(){var e=u.navigator.userAgent;return me(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a||(a=!0,i=o.apply(null,e)),i})},pe=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(e)}},ve={fromHtml:function(e,n){var t=(n||u.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw u.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return pe(t.childNodes[0])},fromTag:function(e,n){var t=(n||u.document).createElement(e);return pe(t)},fromText:function(e,n){var t=(n||u.document).createTextNode(e);return pe(t)},fromDom:pe,fromPoint:function(e,n,t){var r=e.dom();return S.from(r.elementFromPoint(n,t)).map(pe)}},he=(u.Node.ATTRIBUTE_NODE,u.Node.CDATA_SECTION_NODE,u.Node.COMMENT_NODE,u.Node.DOCUMENT_NODE,u.Node.DOCUMENT_TYPE_NODE,u.Node.DOCUMENT_FRAGMENT_NODE,u.Node.ELEMENT_NODE),ye=(u.Node.TEXT_NODE,u.Node.PROCESSING_INSTRUCTION_NODE,u.Node.ENTITY_REFERENCE_NODE,u.Node.ENTITY_NODE,u.Node.NOTATION_NODE,he),Ne=function(e,n){return e.dom()===n.dom()},Se=ge.detect().browser.isIE()?function(e,n){return U(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},Oe=function(e,n){var t=e.dom();if(t.nodeType!==ye)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},Ce=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),be=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Le=tinymce.util.Tools.resolve("tinymce.util.VK"),Te=function(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return S.none();t.push(o.getOrDie())}return S.some(n.apply(null,t))},Ee=Object.keys,De=function(e){return S.from(e.dom().parentNode).map(ve.fromDom)},we=function(e){return w(e.dom().childNodes,ve.fromDom)},ke=function(e,n){var t=e.dom().childNodes;return S.from(t[n]).map(ve.fromDom)},Ae=function(e){return ke(e,0)},xe=function(e){return ke(e,e.dom().childNodes.length-1)},Re=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(n,t){De(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}),Ie=function(e,n){e.dom().appendChild(n.dom())},_e=function(n,e){k(e,function(e){Ie(n,e)})},Be=function(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},Pe=function(e,n,t){return e.fire("ListMutation",{action:n,element:t})},Me="undefined"!=typeof u.window?u.window:Function("return this;")(),Ue=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:Me,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},Fe=function(e,n){var t=Ue(e,n);if(t===undefined||null===t)throw new Error(e+" not available on this browser");return t},je=function(e){var n,t=Ue("ownerDocument.defaultView",e);return(n=t,Fe("HTMLElement",n)).prototype.isPrototypeOf(e)},He=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),$e=tinymce.util.Tools.resolve("tinymce.util.Tools"),qe=function(e){return e&&"BR"===e.nodeName},We=function(e){return e&&3===e.nodeType},Ve=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},ze=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},Ke=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},Xe=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},Qe=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},Ye=qe,Ge=function(e){return e.parentNode.firstChild===e},Je=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},Ze=function(e,n){return e&&e.nodeName in n},en=function(e,n){return!!qe(n)&&!(!e.isBlock(n.nextSibling)||qe(n.previousSibling))},nn=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},tn=function(e,n){return e.isChildOf(n,e.getRoot())},rn=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",un(e,n))},on=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return $e.grep((t=e,n=o,r=$e.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",un(t,e));return n||e}),He.unique(r)),function(e){return Xe(e)})},un=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},an=function(e,n){var t=e.dom.getParents(n,"ol,ul",un(e,n));return P(t)},sn=function(n,e){var t=w(e,function(e){return an(n,e).getOr(e)});return He.unique(t)},cn={isList:function(e){var n=rn(e);return je(n)},getParentList:rn,getSelectedSubLists:function(e){var n,t,r,o=rn(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,$e.grep(n.querySelectorAll("ol,ul,dl"),function(e){return Ve(e)})):$e.grep(i,function(e){return Ve(e)&&o!==e})},getSelectedListItems:on,getClosestListRootElm:un,getSelectedDlItems:function(e){return A(on(e),Ke)},getSelectedListRoots:function(e){var n,t,r,o=(t=an(n=e,n.selection.getStart()),r=A(n.selection.getSelectedBlocks(),ze),t.toArray().concat(r));return sn(e,o)}},fn=tinymce.util.Tools.resolve("tinymce.Env"),dn=function(e,n){var t,r,o,i,u=e.dom,a=e.schema.getBlockElements(),s=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),Ze(n.firstChild,a)||s.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),Ze(t,a)?(s.appendChild(t),r=null):o?(r||(r=u.create(o),s.appendChild(r)),r.appendChild(t)):s.appendChild(t)}return e.settings.forced_root_block?i||fn.ie&&!(10<fn.ie)||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):s.appendChild(u.create("br")),s},ln=function(e){return e.dom().nodeName.toLowerCase()},mn=(s=he,function(e){return e.dom().nodeType===s}),gn=function(e,n){var t=e.dom();!function(e,n){for(var t=Ee(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i,e)}}(n,function(e,n){!function(e,n,t){if(!(C(t)||L(t)||E(t)))throw u.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},pn=function(e){return x(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})},vn=function(e,n,t){if(!C(t))throw u.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);var r;(r=e).style!==undefined&&T(r.style.getPropertyValue)&&e.style.setProperty(n,t)},hn=function(e){return n=e,t=!0,ve.fromDom(n.dom().cloneNode(t));var n,t},yn=function(e,n){var t,r,o,i,u=(t=e,r=n,o=ve.fromTag(r),i=pn(t),gn(o,i),o);Re(e,u);var a=we(e);return _e(u,a),Be(e),u},Nn=function(e,n){Ie(e.item,n.list)},Sn=function(f,e,d){var n=e.slice(0,d.depth);return P(n).each(function(e){var n,t,r,o,i,u,a,s,c=(n=f,t=d.itemAttributes,r=d.content,o=ve.fromTag("li",n),gn(o,t),_e(o,r),o);u=c,Ie((i=e).list,u),i.item=u,s=d,ln((a=e).list)!==s.listType&&(a.list=yn(a.list,s.listType)),gn(a.list,s.listAttributes)}),n},On=function(e,n,t){var r,o=function(e,n,t){for(var r,o,i,u=[],a=0;a<t;a++)u.push((r=e,o=n.listType,i={list:ve.fromTag(o,r),item:ve.fromTag("li",r)},Ie(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)Nn(e[n-1],e[n])}(o),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",u=r.dom(),vn(u,o,i);var r,o,i,u;P(e).each(function(e){gn(e.list,n.listAttributes),gn(e.item,n.itemAttributes),_e(e.item,n.content)})}(o,t),r=o,Te([P(n),B(r)],Nn),n.concat(o)},Cn=function(e){return Oe(e,"OL,UL")},bn=function(e){return Ae(e).map(Cn).getOr(!1)},Ln=function(e){return 0<e.depth},Tn=function(e){return e.isSelected},En=function(e){var n=we(e),t=xe(e).map(Cn).getOr(!1)?n.slice(0,-1):n;return w(t,hn)},Dn=Object.prototype.hasOwnProperty,wn=(c=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Dn.call(o,i)&&(t[i]=c(t[i],o[i]))}return t}),kn=function(n){k(n,function(r,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return S.some(e[r]);if(e[r].depth<t)break}return S.none()})(n,e).each(function(e){var n,t;t=e,(n=r).listType=t.listType,n.listAttributes=wn({},t.listAttributes)})})},An=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return An(t())}}},xn=function(i,u,a,s){return Ae(s).filter(Cn).fold(function(){u.each(function(e){Ne(e.start,s)&&a.set(!0)});var n,t,r,e=(n=s,t=i,r=a.get(),De(n).filter(mn).map(function(e){return{depth:t,isSelected:r,content:En(n),itemAttributes:pn(n),listAttributes:pn(e),listType:ln(e)}}));u.each(function(e){Ne(e.end,s)&&a.set(!1)});var o=xe(s).filter(Cn).map(function(e){return Rn(i,u,a,e)}).getOr([]);return e.toArray().concat(o)},function(e){return Rn(i,u,a,e)})},Rn=function(n,t,r,e){return _(we(e),function(e){return(Cn(e)?Rn:xn)(n+1,t,r,e)})},In=function(i,e){return w(e,function(e){var n,t,r,o=(n=e.content,r=(t||u.document).createDocumentFragment(),k(n,function(e){r.appendChild(e.dom())}),ve.fromDom(r));return ve.fromDom(dn(i,o.dom()))})},_n=function(e,n){return kn(n),(t=e.contentDocument,r=n,o=x(r,function(e,n){return n.depth>e.length?On(t,e,n):Sn(t,e,n)},[]),B(o).map(function(e){return e.list})).toArray();var t,r,o},Bn=function(e){var n,t,r=w(cn.getSelectedListItems(e),ve.fromDom);return Te([R(r,d(bn)),R((n=r,t=D.call(n,0),t.reverse(),t),d(bn))],function(e,n){return{start:e,end:n}})},Pn=function(a,e,s){var n,t,r,o=(n=e,t=Bn(a),r=An(!1),w(n,function(e){return{sourceList:e,entries:Rn(0,t,r,e)}}));k(o,function(e){var n,t;n=e.entries,t=s,k(A(n,Tn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)});var r,o,i,u=(r=a,o=e.entries,_(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var a=e[i],s=n(a);s!==t&&(r.push(o),o=[]),t=s,o.push(a)}return 0!==o.length&&r.push(o),r}(o,Ln),function(e){return B(e).map(Ln).getOr(!1)?_n(r,e):In(r,e)}));k(u,function(e){Pe(a,"Indent"===s?"IndentList":"OutdentList",e.dom())}),i=e.sourceList,k(u,function(e){Re(i,e)}),Be(e.sourceList)})},Mn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Un=Mn.DOM,Fn=function(e,n,t){var r,o,i,u,a,s;for(i=Un.select('span[data-mce-type="bookmark"]',n),a=dn(e,t),(r=Un.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){Un.remove(u);break}e.dom.isEmpty(o)||Un.insertAfter(o,n),Un.insertAfter(a,n),nn(e.dom,t.parentNode)&&(s=t.parentNode,$e.each(i,function(e){s.parentNode.insertBefore(e,t.parentNode)}),Un.remove(s)),Un.remove(t),nn(e.dom,n)&&Un.remove(n)},jn=function(e){Oe(e,"dt")&&yn(e,"dd")},Hn=function(r,e,n){k(n,"Indent"===e?jn:function(e){return n=r,void(Oe(t=e,"dd")?yn(t,"dt"):Oe(t,"dt")&&De(t).each(function(e){return Fn(n,e.dom(),t.dom())}));var n,t})},$n=function(e,n){if(We(e))return{container:e,offset:n};var t=Ce.getNode(e,n);return We(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&We(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&We(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},qn=function(e){var n=e.cloneRange(),t=$n(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=$n(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},Wn=function(e,n){var t=w(cn.getSelectedListRoots(e),ve.fromDom),r=w(cn.getSelectedDlItems(e),ve.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();Pn(e,t,n),Hn(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(qn(e.selection.getRng())),e.nodeChanged(),o=!0}return o},Vn=function(e){return Wn(e,"Indent")},zn=function(e){return Wn(e,"Outdent")},Kn=function(e){return Wn(e,"Flatten")},Xn=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Qn=Mn.DOM,Yn=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=Qn.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):Qn.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},Gn=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,Qn.remove(r),!n.hasChildNodes()&&Qn.isBlock(n)&&n.appendChild(Qn.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=Qn.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),qn(n)},Jn=function(e){return/\btox\-/.test(e.className)},Zn=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},et=function(t,e){$e.each(e,function(e,n){t.setAttribute(n,e)})},nt=function(e,n,t){var r,o,i,u,a,s,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),a=e,et(s=n,(c=t)["list-attributes"]),$e.each(a.select("li",s),function(e){et(e,c["list-item-attributes"])})},tt=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&Ye(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Je(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},rt=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(!0),m="LI",t=cn.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=Yn(n),$e.each(function(t,e,r){for(var o,i=[],u=t.dom,n=tt(t,e,!0,r),a=tt(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return $e.each(s,function(e){if(Je(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||Ye(e))return Ye(e)&&u.remove(e),void(o=null);var n=e.nextSibling;Xn.isBookmarkNode(e)&&(Je(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,a,s,c;(t=e.previousSibling)&&Ve(t)&&t.nodeName===d&&(r=t,o=l,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=g.rename(e,m),t.appendChild(e)):(n=g.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=g.rename(e,m)),a=g,s=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],$e.each(c,function(e){var n;return a.setStyle(s,((n={})[e]="",n))}),nt(g,n,l),it(f.dom,n)}),f.selection.setRng(Gn(e)))},ot=function(e,n,t){return s=t,(a=n)&&s&&Ve(a)&&a.nodeName===s.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,a,s},it=function(e,n){var t,r;if(t=n.nextSibling,ot(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,ot(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},ut=function(n,e,t,r,o){if(e.nodeName!==r||at(o)){var i=Yn(n.selection.getRng(!0));$e.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);nt(e.dom,o,r),Pe(e,Zn(t),o)}else nt(e.dom,n,r),Pe(e,Zn(t),n)}(n,e,r,o)}),n.selection.setRng(Gn(i))}else Kn(n)},at=function(e){return"list-style-type"in e},st={toggleList:function(e,n,t){var r=cn.getParentList(e),o=cn.getSelectedSubLists(e);t=t||{},r&&0<o.length?ut(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||at(r)||Jn(n)){var o=Yn(e.selection.getRng(!0));nt(e.dom,n,r);var i=e.dom.rename(n,t);it(e.dom,i),e.selection.setRng(Gn(o)),Pe(e,Zn(t),i)}else Kn(e);else rt(e,t,r),Pe(e,Zn(t),n)}(e,r,n,t)},mergeWithAdjacentLists:it},ct=Mn.DOM,ft=function(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),nn(e,r)&&ct.remove(r)):ct.setStyle(r,"listStyleType","none")),Ve(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)},dt=function(n,e){$e.each($e.grep(n.select("ol,ul",e)),function(e){ft(n,e)})},lt=function(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(We(o)&&(t?i<o.data.length:0<i))return o;var u=e.schema.getNonEmptyElements();1===o.nodeType&&(o=Ce.getNode(o,i));var a=new be(o,r);for(t&&en(e.dom,o)&&a.next();o=a[t?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(We(o)&&0<o.data.length)return o}},mt=function(e,n){var t=n.childNodes;return 1===t.length&&!Ve(t[0])&&e.isBlock(t[0])},gt=function(e,n,t){var r,o,i,u;if(o=mt(e,t)?t.firstChild:t,mt(i=e,u=n)&&i.remove(u.firstChild,!0),!nn(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)},pt=function(n,e,t){var r,o,i=e.parentNode;if(tn(n,e)&&tn(n,t)){Ve(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&Ye(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&Ye(r)&&e.hasChildNodes()&&n.remove(r),nn(n,t,!0)&&n.$(t).empty(),gt(n,e,t),o&&t.appendChild(o);var u=Se(ve.fromDom(t),ve.fromDom(e))?n.getParents(e,Ve,t):[];n.remove(e),k(u,function(e){nn(n,e)&&e!==n.getRoot()&&n.remove(e)})}},vt=function(e,n,t,r){var o,i,u,a=e.dom;if(a.isEmpty(r))i=t,u=r,(o=e).dom.$(u).empty(),pt(o.dom,i,u),o.selection.setCursorLocation(u);else{var s=Yn(n);pt(a,t,r),e.selection.setRng(Gn(s))}},ht=function(e,n){var t=e.dom,r=e.selection,o=r.getStart(),i=cn.getClosestListRootElm(e,o),u=t.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===e.getBody()&&nn(t,a))return!0;var s=qn(r.getRng()),c=t.getParent(lt(e,s,n,i),"LI",i);if(c&&c!==u)return e.undoManager.transact(function(){n?vt(e,s,c,u):Ge(u)?zn(e):function(e,n,t,r){var o=Yn(n);pt(e.dom,t,r);var i=Gn(o);e.selection.setRng(i)}(e,s,u,c)}),!0;if(!c&&!n&&0===s.startOffset&&0===s.endOffset)return e.undoManager.transact(function(){Kn(e)}),!0}return!1},yt=function(e,n){return ht(e,n)||function(o,i){var u=o.dom,e=o.selection.getStart(),a=cn.getClosestListRootElm(o,e),s=u.getParent(e,u.isBlock,a);if(s&&u.isEmpty(s)){var n=qn(o.selection.getRng()),c=u.getParent(lt(o,n,i,a),"LI",a);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=s,t=a,r=(e=u).getParent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),st.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,n)},Nt=function(e,n){return e.selection.isCollapsed()?yt(e,n):(r=(t=e).selection.getStart(),o=cn.getClosestListRootElm(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<cn.getSelectedListItems(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),dt(t.dom,t.getBody())}),!0));var t,r,o},St=function(n){n.on("keydown",function(e){e.keyCode===Le.BACKSPACE?Nt(n,!1)&&e.preventDefault():e.keyCode===Le.DELETE&&Nt(n,!0)&&e.preventDefault()})},Ot=Nt,Ct=function(n){return{backspaceDelete:function(e){Ot(n,e)}}},bt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},Lt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?Vn(t):"outdent"===n&&zn(t)}),t.addCommand("InsertUnorderedList",function(e,n){st.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){st.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){st.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){Kn(t)}),t.addQueryStateHandler("InsertUnorderedList",bt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",bt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",bt(t,"DL"))},Tt=function(e){return e.getParam("lists_indent_on_tab",!0)},Et=function(e){var n;Tt(e)&&(n=e).on("keydown",function(e){e.keyCode!==Le.TAB||Le.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?zn(n):Vn(n))&&e.preventDefault()})}),St(e)},Dt=function(n,i){return function(o){var e=function(e){var n=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(e.parents,Qe),t=-1!==n?e.parents.slice(0,n):e.parents,r=$e.grep(t,Ve);o.setActive(0<r.length&&r[0].nodeName===i&&!Jn(r[0]))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}},wt=function(n){var e,t,r,o=function(e){return function(){return n.execCommand(e)}};t="advlist",r=(e=n).settings.plugins?e.settings.plugins:"",-1===$e.inArray(r.split(/[ ,]/),t)&&(n.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:o("InsertOrderedList"),onSetup:Dt(n,"OL")}),n.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:o("InsertUnorderedList"),onSetup:Dt(n,"UL")}))};!function kt(){f.add("lists",function(e){return Et(e),wt(e),Lt(e),Ct(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e,t,r,n,a,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},o=function(e){return function(){return e}},u=o(!1),s=o(!0),l=u,m=s,d=function(){return f},f=(n={fold:function(e,t){return e()},is:l,isSome:l,isNone:m,getOr:r=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:t,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:l,forall:m,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(n),n),h=function(r){var e=function(){return r},t=function(){return i},n=function(e){return e(r)},i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:m,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(r))},ap:function(e){return e.fold(d,function(e){return h(e(r))})},each:function(e){e(r)},bind:n,flatten:e,exists:n,forall:n,filter:function(e){return e(r)?i:f},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(l,function(e){return t(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return i},p=d,g=function(e){return null===e||e===undefined?f:h(e)},v=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},w=v("string"),b=v("array"),y=v("function"),x=Array.prototype.slice,j=function(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r,e)}},O=Array.prototype.push,A=(y(Array.from)&&Array.from,function(e){var t=e,r=function(){return t};return{get:r,set:function(e){t=e},clone:function(){return A(r())}}}),S=Object.prototype.hasOwnProperty,_=(a=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},n=0;n<e.length;n++){var i=e[n];for(var o in i)S.call(i,o)&&(r[o]=a(r[o],i[o]))}return r}),C=Object.hasOwnProperty,M=function(e,t){return F(e,t)?g(e[t]):p()},F=function(e,t){return C.call(e,t)},P=function(e){return e.getParam("media_scripts")},k=function(e){return e.getParam("audio_template_callback")},T=function(e){return e.getParam("video_template_callback")},$=function(e){return e.getParam("media_live_embeds",!0)},z=function(e){return e.getParam("media_filter_html",!0)},D=function(e){return e.getParam("media_url_resolver")},E=function(e){return e.getParam("media_alt_source",!0)},N=function(e){return e.getParam("media_poster",!0)},U=function(e){return e.getParam("media_dimensions",!0)},R=tinymce.util.Tools.resolve("tinymce.util.Tools"),L=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),W=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),H=function(t){return function(e){return e?e.style[t].replace(/px$/,""):""}},I=function(n){return function(e,t){var r;e&&(e.style[n]=/^[0-9.]+$/.test(r=t)?r+"px":r)}},q={getMaxWidth:H("maxWidth"),getMaxHeight:H("maxHeight"),setMaxWidth:I("maxWidth"),setMaxHeight:I("maxHeight")},B=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},G=W.DOM,J=function(e){return G.getAttrib(e,"data-ephox-embed-iri")},K=function(e,t){return c=t,u=G.createFragment(c),""!==J(u.firstChild)?(o=t,a=G.createFragment(o).firstChild,{type:"ephox-embed-iri",source1:J(a),source2:"",poster:"",width:q.getMaxWidth(a),height:q.getMaxHeight(a)}):(n=e,r=t,L({validate:!(i={}),allow_conditional_comments:!0,start:function(e,t){if(i.source1||"param"!==e||(i.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(i.type||(i.type=e),i=R.extend(t.map,i)),"script"===e){var r=B(n,t.map.src);if(!r)return;i={type:"script",source1:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(i.source1?i.source2||(i.source2=t.map.src):i.source1=t.map.src),"img"!==e||i.poster||(i.poster=t.map.src)}}).parse(r),i.source1=i.source1||i.src||i.data,i.source2=i.source2||"",i.poster=i.poster||"",i);var n,r,i,o,a,c,u},Q=tinymce.util.Tools.resolve("tinymce.util.Promise"),V=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},X=tinymce.util.Tools.resolve("tinymce.html.Writer"),Y=tinymce.util.Tools.resolve("tinymce.html.Schema"),Z=W.DOM,ee=function(e,t){var r,n,i,o;for(r in t)if(i=""+t[r],e.map[r])for(n=e.length;n--;)(o=e[n]).name===r&&(i?(e.map[r]=i,o.value=i):(delete e.map[r],e.splice(n,1)));else i&&(e.push({name:r,value:i}),e.map[r]=i)},te=function(e,t){var r,n,i=Z.createFragment(e).firstChild;return q.setMaxWidth(i,t.width),q.setMaxHeight(i,t.height),r=i.outerHTML,n=X(),L(n).parse(r),n.getContent()},re=function(e,t,r){return s=e,l=Z.createFragment(s),""!==Z.getAttrib(l.firstChild,"data-ephox-embed-iri")?te(e,t):(n=e,i=t,o=r,c=X(),L({validate:!1,allow_conditional_comments:!(u=0),comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":i.height!==undefined&&i.width!==undefined&&ee(t,{width:i.width,height:i.height})}if(o)switch(e){case"video":ee(t,{poster:i.poster,src:""}),i.source2&&ee(t,{src:""});break;case"iframe":ee(t,{src:i.source1});break;case"source":if(++u<=2&&(ee(t,{src:i["source"+u],type:i["source"+u+"mime"]}),!i["source"+u]))return;break;case"img":if(!i.poster)return;a=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(i["source"+t]){var r=[];r.map={},u<t&&(ee(r,{src:i["source"+t],type:i["source"+t+"mime"]}),c.start("source",r,!0))}if(i.poster&&"object"===e&&o&&!a){var n=[];n.map={},ee(n,{src:i.poster,width:i.width,height:i.height}),c.start("img",n,!0)}c.end(e)}},Y({})).parse(n),c.getContent());var n,i,o,a,c,u,s,l},ne=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],ie=function(r,e){var n=R.extend({},e);if(!n.source1&&(R.extend(n,K(P(r),n.embed)),!n.source1))return"";n.source2||(n.source2=""),n.poster||(n.poster=""),n.source1=r.convertURL(n.source1,"source"),n.source2=r.convertURL(n.source2,"source"),n.source1mime=V(n.source1),n.source2mime=V(n.source2),n.poster=r.convertURL(n.poster,"poster");var t,i,o=(t=n.source1,0<(i=ne.filter(function(e){return e.regex.test(t)})).length?R.extend({},i[0],{url:function(e,t){for(var r=e.regex.exec(t),n=e.url,i=function(e){n=n.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)i(o);return n.replace(/\?$/,"")}(i[0],t)}):null);if(o&&(n.source1=o.url,n.type=o.type,n.allowFullscreen=o.allowFullscreen,n.width=n.width||String(o.w),n.height=n.height||String(o.h)),n.embed)return re(n.embed,n,!0);var a=B(P(r),n.source1);a&&(n.type="script",n.width=String(a.width),n.height=String(a.height));var c,u,s,l,m,d,f,h,p=k(r),g=T(r);return n.width=n.width||"300",n.height=n.height||"150",R.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?(h=(f=n).allowFullscreen?' allowFullscreen="1"':"",'<iframe src="'+f.source1+'" width="'+f.width+'" height="'+f.height+'"'+h+"></iframe>"):"application/x-shockwave-flash"===n.source1mime?(d='<object data="'+(m=n).source1+'" width="'+m.width+'" height="'+m.height+'" type="application/x-shockwave-flash">',m.poster&&(d+='<img src="'+m.poster+'" width="'+m.width+'" height="'+m.height+'" />'),d+="</object>"):-1!==n.source1mime.indexOf("audio")?(s=n,(l=p)?l(s):'<audio controls="controls" src="'+s.source1+'">'+(s.source2?'\n<source src="'+s.source2+'"'+(s.source2mime?' type="'+s.source2mime+'"':"")+" />\n":"")+"</audio>"):"script"===n.type?'<script src="'+n.source1+'"><\/script>':(c=n,(u=g)?u(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+' controls="controls">\n<source src="'+c.source1+'"'+(c.source1mime?' type="'+c.source1mime+'"':"")+" />\n"+(c.source2?'<source src="'+c.source2+'"'+(c.source2mime?' type="'+c.source2mime+'"':"")+" />\n":"")+"</video>")},oe={},ae=function(t){return function(e){return ie(t,e)}},ce=function(e,t){var r,n,i,o,a,c=D(e);return c?(i=t,o=ae(e),a=c,new Q(function(t,e){var r=function(e){return e.html&&(oe[i.source1]=e),t({url:i.source1,html:e.html?e.html:o(i)})};oe[i.source1]?r(oe[i.source1]):a({url:i.source1},r,e)})):(r=t,n=ae(e),new Q(function(e){e({html:n(r),url:r.source1})}))},ue=function(e){return oe.hasOwnProperty(e)},se=function(e){var r=_(e,{source1:e.source1.value,source2:M(e,"source2").bind(function(e){return M(e,"value")}).getOr(""),poster:M(e,"poster").bind(function(e){return M(e,"value")}).getOr("")});return M(e,"dimensions").each(function(e){j(["width","height"],function(t){M(e,t).each(function(e){return r[t]=e})})}),r},le=function(e){var n=_(e,{source1:{value:M(e,"source1").getOr("")},source2:{value:M(e,"source2").getOr("")},poster:{value:M(e,"poster").getOr("")}});return j(["width","height"],function(r){M(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n},me=function(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}},de=function(e,t){return K(P(e),t)},fe=function(i,o){return function(e){if(w(e.url)&&0<e.url.trim().length){var t=e.html,r=de(o,t),n=c({},r,{source1:e.url,embed:t});i.setData(le(n))}}},he=function(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("img[data-mce-object]"),n=0;n<t.length;n++)for(var i=r.length-1;0<=i;i--)t[n]===r[i]&&r.splice(i,1);e.selection.select(r[0])}(e,r),e.nodeChanged()},pe=function(c){var e,t,r,n,i=(r=(e=c).selection.getNode(),n=(t=r).getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")?e.serializer.serialize(r,{selection:!0}):"",_({embed:n},K(P(e),n))),u=A(i),o=le(i),s=function(e){return se(e.getData())},a={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!b(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);O.apply(t,e[r])}return t}([[{name:"source1",type:"urlinput",filetype:"media",label:"Source"}],U(c)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},l={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},m=[];E(c)&&m.push({name:"source2",type:"urlinput",filetype:"media",label:"Alternative source URL"}),N(c)&&m.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var d={title:"Advanced",name:"advanced",items:m},f=[a,l];0<m.length&&f.push(d);var h={type:"tabpanel",tabs:f},p=c.windowManager.open({title:"Insert/Edit Media",size:"normal",body:h,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t,r,n,i=s(e);t=u.get(),n=c,(r=i).embed=re(r.embed,r),r.embed&&(t.source1===r.source1||ue(r.source1))?he(n,r.embed):ce(n,r).then(function(e){he(n,e.html)})["catch"](me(n)),e.close()},onChange:function(e,t){switch(t.name){case"source1":o=u.get(),a=s(e),o.source1!==a.source1&&(fe(p,c)({url:a.source1,html:""}),ce(c,a).then(fe(p,c))["catch"](me(c)));break;case"embed":n=se((r=e).getData()),i=de(c,n.embed),r.setData(le(i))}var r,n,i,o,a;u.set(s(e))},initialData:o})},ge=function(e){return{showDialog:function(){pe(e)}}},ve=function(e){e.addCommand("mceMedia",function(){pe(e)})},we=tinymce.util.Tools.resolve("tinymce.html.Node"),be=tinymce.util.Tools.resolve("tinymce.Env"),ye=function(i,e){if(!1===z(i))return e;var o,a=X();return L({validate:!1,allow_conditional_comments:!1,comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var n=0;n<t.length;n++){if(0===t[n].name.indexOf("on"))return;"style"===t[n].name&&(t[n].value=i.dom.serializeStyle(i.dom.parseStyle(t[n].value),e))}a.start(e,t,r),o=!1}},end:function(e){o||a.end(e)}},Y({})).parse(e),a.getContent()},xe=function(e,t){var r,n=t.name;return(r=new we("img",1)).shortEnded=!0,Oe(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:be.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r},je=function(e,t){var r,n,i,o=t.name;return(r=new we("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),Oe(e,t,r),(n=new we(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(i=new we("span",1)).attr("class","mce-shim"),r.append(n),r.append(i),r},Oe=function(e,t,r){var n,i,o,a,c;for(a=(o=t.attributes).length;a--;)n=o[a].name,i=o[a].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(ye(e,c))),r.firstChild=null)},Ae=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(void 0,(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t)))return!0;var t;return!1},Se=function(i){return function(e){for(var t,r,n=e.length;n--;)(t=e[n]).parent&&(t.parent.attr("data-mce-object")||("script"!==t.name||(r=B(P(i),t.attr("src"))))&&(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&$(i)&&be.ceFalse?Ae(t)||t.replace(je(i,t)):Ae(t)||t.replace(xe(i,t))))}},_e=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();R.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();R.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",Se(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,o,a,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new we(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(o=r.attributes).length;i--;){var m=o[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[i].value)}"script"===u&&n.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new we("#text",3)).raw=!0,c.value=ye(d,unescape(a)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})})},Ce=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},Me=function(t){t.on("click keyup",function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),t.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("ObjectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(re(t,{width:String(e.width),height:String(e.height)}))))})},Fe=function(e){var t,r;e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:(t=e,r=["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"],function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind})}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};!function Pe(){i.add("media",function(e){return ve(e),Fe(e),Ce(e),_e(e),Me(e),ge(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},i=function(n){return n.getParam("nonbreaking_wrap",!0,"boolean")},a=function(n,e){for(var t="",o=0;o<e;o++)t+=n;return t},r=function(n,e){var t,o=i(n)||n.plugins.visualchars?'<span class="'+((t=n).plugins.visualchars&&t.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+a("&nbsp;",e)+"</span>":a("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(o)})},e=function(n){n.addCommand("mceNonBreaking",function(){r(n,1)})},c=tinymce.util.Tools.resolve("tinymce.util.VK"),t=function(e){var t=o(e);0<t&&e.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(e,t)}})},u=function(n){n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}})};!function s(){n.add("nonbreaking",function(n){e(n),u(n),t(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},u=function(t){return t.getParam("noneditable_editable_class","mceEditable")},f=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},s=function(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}},d=function(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0<e?o.charAt(e-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(n[0])+'">'+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}},n=function(n){var t,e,r="contenteditable";t=" "+c.trim(u(n))+" ",e=" "+c.trim(l(n))+" ";var a=s(t),i=s(e),o=f(n);n.on("PreInit",function(){0<o.length&&n.on("BeforeSetContent",function(t){!function(t,n,e){var r=n.length,a=e.content;if("raw"!==e.format){for(;r--;)a=a.replace(n[r],d(t,a,l(t)));e.content=a}}(n,o,t)}),n.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],a(n)?n.attr(r,"true"):i(n)&&n.attr(r,"false")}),n.serializer.addAttributeFilter(r,function(t){for(var n,e=t.length;e--;)n=t[e],(a(n)||i(n))&&(0<o.length&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(r,null))})})};!function e(){t.add("noneditable",function(t){n(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),a=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},t=function(){return"mce-pagebreak"},r=function(){return'<img src="'+n.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'},o=function(o){var c=a(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=r,u=t,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+c()+"</p>"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){e.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(h){"use strict";var t,e,n,r,o,i,a,u,f,p=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return p(n())}}},s=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!s.get("powerpaste")||("undefined"!=typeof h.window.console&&h.window.console.log&&h.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},l=function(t,e){return{clipboard:t,quirks:e}},d=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},m=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},g=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},v=function(t,e){return t.fire("paste",{ieFake:e})},y=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),g(t,!1)):(e.pasteFormat.set("text"),g(t,!0)),t.focus()},b=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){y(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},w=function(t){return function(){return t}},x=w(!1),_=w(!0),P=x,T=_,D=function(){return C},C=(r={fold:function(t,e){return t()},is:P,isSome:P,isNone:T,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:D,ap:D,each:function(){},bind:D,flatten:D,exists:P,forall:T,filter:D,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:w("none()")},Object.freeze&&Object.freeze(r),r),k=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:T,isNone:P,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return k(t(n))},ap:function(t){return t.fold(D,function(t){return k(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:C},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(P,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:k,none:D,from:function(t){return null===t||t===undefined?C:k(t)}},F=(o="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===o}),I=Array.prototype.slice,E=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o,t)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n,t)}},R=F(Array.from)?Array.from:function(t){return I.call(t)},A={},j={exports:A};i=undefined,a=A,u=j,f=undefined,function(t){"object"==typeof a&&void 0!==u?u.exports=t():"function"==typeof i&&i.amd?i([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,a,u){function s(e,t){if(!a[e]){if(!i[e]){var n="function"==typeof f&&f;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=a[e]={exports:{}};i[e][0].call(o.exports,function(t){return s(i[e][1][t]||t)},o,o.exports,l,i,a,u)}return a[e].exports}for(var c="function"==typeof f&&f,t=0;t<u.length;t++)s(u[t]);return s}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function n(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,e){(function(n){!function(t){var e=setTimeout;function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(o.promise,n)}a(o.promise,e)}else(1===r._state?a:u)(o.promise,r._value)})):r._deferreds.push(o)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(o){u(t,o)}}function u(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},i.all=function(t){var s=Array.prototype.slice.call(t);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}s[e]=t,0==--a&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)u(t,s[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},i._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:t.Promise||(t.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var M=j.exports.boltExport,L=function(t){var n=S.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){O(t,a)},a=function(e){n.each(function(t){h.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return L(function(e){r(function(t){e(n(t))})})},isReady:o}},N={nu:L,pure:function(e){return L(function(t){t(e)})}},B=function(t){h.setTimeout(function(){throw t},0)},H=function(n){var t=function(t){n().then(t,B)};return{map:function(t){return H(function(){return n().then(t)})},bind:function(e){return H(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return H(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return N.nu(t)},toCached:function(){var t=null;return H(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},$=function(t){return H(function(){return new M(t)})},W=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):O(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},U=function(t,e){var n=E(t,e);return W(n,$)},z=tinymce.util.Tools.resolve("tinymce.Env"),V=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),K=tinymce.util.Tools.resolve("tinymce.util.VK"),G="x-tinymce/html",X="\x3c!-- "+G+" --\x3e",Y=function(t){return X+t},Z=function(t){return t.replace(X,"")},J=function(t){return-1!==t.indexOf(X)},Q=function(){return G},tt=tinymce.util.Tools.resolve("tinymce.html.Entities"),et=function(t){return t.replace(/\r?\n/g,"<br>")},nt=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+tt.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=q.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:q.map(a,function(t){return o+t+i}).join("")},rt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},ot=function(t,e,n){return e?nt(t,!0===e?"p":e,n):et(t)},it=tinymce.util.Tools.resolve("tinymce.html.DomParser"),at=tinymce.util.Tools.resolve("tinymce.html.Node"),ut=tinymce.util.Tools.resolve("tinymce.html.Schema"),st=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ct={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function lt(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var ft={filter:lt,innerText:function se(t){var e=ut(),n=it({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=lt(t,[/<!\[[^\]]+\]>/g]),function u(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;u(t),t=t.next;);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function ce(t){return t=lt(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function le(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==h.navigator.userAgent.indexOf(" Edge/")}};function dt(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function mt(t){var i,a,u=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||u;r!==u&&(r<u?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===e?i.append(t):(a=a||i,i=new at(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",u<r&&a&&a.lastChild.append(i),u=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(dt(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function pt(n,r,o,i){var a,u={},t=n.dom.parseStyle(i);return q.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(u[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===ct.getRetainStyleProps(n)||r&&r[e])&&(u[e]=t):o.remove()}),/(bold)/i.test(u["font-weight"])&&(delete u["font-weight"],o.wrap(new at("b",1))),/(italic)/i.test(u["font-style"])&&(delete u["font-style"],o.wrap(new at("i",1))),(u=n.dom.serializeStyle(u,o.name))||null}var gt={preProcess:function(t,e){return ct.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=ct.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=ft.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=ct.getWordValidElements(r),i=ut({valid_elements:n,valid_children:"-li[p]"});q.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var a=it({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",pt(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),a.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),a.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),a.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var u=a.parse(t);return ct.shouldConvertWordFakeLists(r)&&mt(u),t=st({validate:r.settings.validate},i).serialize(u)}(t,e):e},isWordContent:function fe(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},ht=function(t,e){return{content:t,cancelled:e}},vt=function(t,e,n,r){var o,i,a,u,s,c,l=d(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!l.isDefaultPrevented()?(o=t,i=l.content,a=n,u=r,s=o.dom.create("div",{style:"display:none"},i),c=m(o,s,a,u),ht(c.node.innerHTML,c.isDefaultPrevented())):ht(l.content,l.isDefaultPrevented())},yt=function(t,e,n){var r=gt.isWordContent(e),o=r?gt.preProcess(t,e):e;return vt(t,o,n,r)},bt=function(t,e){var n,r;return t.insertContent((n=e,r=t.dom.create("body",{},n),q.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:ct.shouldMergeFormats(t),paste:!0}),!0},wt=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},xt=function(t){return wt(t)&&/.(gif|jpe?g|png)$/.test(t)},_t=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!wt(e))&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),!0);var r,o,i},Pt=function(t,e,n){return!!xt(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},Tt=function(t,e){var n,r;!1===ct.isSmartPasteEnabled(t)?bt(t,e):(n=t,r=e,q.each([_t,Pt,bt],function(t){return!0!==t(n,r,bt)}))},Dt=function(t){return"\n"===t||"\r"===t},Ct=function(o){var e,n;return(n={pcIsSpace:!(e=function(t,e){return-1!==" \f\t\x0B".indexOf(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===o.length-1||(n=o,(r=t.str.length+1)<n.length&&0<=r&&Dt(n[r]))?{pcIsSpace:!1,str:t.str+"\xa0"}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:Dt(e),str:t.str+e};var n,r}),str:""},O(o,function(t){n=e(n,t)}),n).str},kt=function(t,e,n){var r=n||J(e),o=yt(t,Z(e),r);!1===o.cancelled&&Tt(t,o.content)},St=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=Ct(n),o=ot(r,t.settings.forced_root_block,t.settings.forced_root_block_attrs);kt(t,o,!1)},Ft=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e},It=function(t,e){return e in t&&0<t[e].length},Et=function(t){return It(t,"text/html")||It(t,"text/plain")},Ot=ft.createIdGenerator("mceclip"),Rt=function(e,t,n){var r,o,i,a,u="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&u){var s=(i=(o=u).items?E(R(o.items),function(t){return t.getAsFile()}):[],a=o.files?R(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<s.length)return t.preventDefault(),(r=s,U(r,function(r){return $(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),O(t,function(t){!function(t,e){var n,r,o,i,a,u,s,c=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),l=Ot(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):l,d=new h.Image;if(d.src=e.uri,u=t.settings,s=d,!u.images_dataimg_filter||u.images_dataimg_filter(s)){var m,p=t.editorUpload.blobCache,g=void 0;(m=p.findFirst(function(t){return t.base64()===c}))?g=m:(g=p.create(l,e.blob,c,f),p.add(g)),kt(t,'<img src="'+g.blobUri()+'">',!1)}else kt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},At=function(t){return K.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},jt=function(s,c,l){var e,f,d=(e=p(S.none()),{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}});function m(t,e,n,r){var o,i;It(t,"text/html")?o=t["text/html"]:(o=c.getHtml(),r=r||J(o),c.isDefaultContent(o)&&(n=!0)),o=ft.trimHtml(o),c.remove(),i=!1===r&&rt(o),o.length&&!i||(n=!0),n&&(o=It(t,"text/plain")&&i?t["text/plain"]:ft.innerText(o)),c.isDefaultContent(o)?e||s.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?St(s,o):kt(s,o,r)}s.on("keydown",function(t){function e(t){At(t)&&!t.isDefaultPrevented()&&c.remove()}if(At(t)&&!t.isDefaultPrevented()){if((f=t.shiftKey&&86===t.keyCode)&&z.webkit&&-1!==h.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),d.set(t),window.setTimeout(function(){d.clear()},100),z.ie&&f)return t.preventDefault(),void v(s,!0);c.remove(),c.create(),s.once("keyup",e),s.once("paste",function(){s.off("keyup",e)})}});s.on("paste",function(t){var e,n,r,o=d.isSet(),i=(e=s,n=Ft(t.clipboardData||e.getDoc().dataTransfer),ft.isMsEdge()?q.extend(n,{"text/html":""}):n),a="text"===l.get()||f,u=It(i,Q());(f=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==h.navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length))?c.remove():Et(i)||!Rt(s,t,c.getLastRng()||s.selection.getRng())?(o||t.preventDefault(),!z.ie||o&&!t.ieFake||It(i,"text/html")||(c.create(),s.dom.bind(c.getEl(),"paste",function(t){t.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),i["text/html"]=c.getHtml()),It(i,"text/html")?(t.preventDefault(),u||(u=J(i["text/html"])),m(i,o,a,u)):V.setEditorTimeout(s,function(){m(i,o,a,u)},0)):c.remove()})},Mt=function(t){return z.ie&&t.inline?h.document.body:t.getBody()},Lt=function(e,t,n){var r;Mt(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Ht(e,n)||e.fire("paste")})},Nt=function(t){return t.dom.get("mcepastebin")},Bt=function(t,e){return e===t},Ht=function(t,e){var n,r=Nt(t);return(n=r)&&"mcepastebin"===n.id&&Bt(e,r.innerHTML)},$t=function(a){var u=p(null),s="%MCEPASTEBIN%";return{create:function(){return e=u,n=s,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Mt(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(z.ie||z.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Lt(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(Nt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(a,u)},getEl:function(){return Nt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=q.grep(Mt(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),q.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return u.get()},isDefault:function(){return Ht(a,s)},isDefaultContent:function(t){return Bt(s,t)}}},Wt=function(n,t){var e=$t(n);return n.on("PreInit",function(){return jt(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||u===z.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(u=t[i].attr("src"))&&(0===u.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==u.indexOf("data:")||o(t[i]))});var a,u}),{pasteFormat:t,pasteHtml:function(t,e){return kt(n,t,e)},pasteText:function(t){return St(n,t)},pasteImageData:function(t,e){return Rt(n,t,e)},getDataTransferItems:Ft,hasHtmlOrText:Et,hasContentType:It}},Ut=function(){},zt=function(t,e,n){if(r=t,!1!==z.iOS||r===undefined||"function"!=typeof r.setData||!0===ft.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(Q(),e),!0}catch(o){return!1}var r},Vt=function(t,e,n,r){zt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},qt=function(u){return function(t,e){var n=Y(t),r=u.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=u.dom.create("div",{contenteditable:"true"},n);u.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),u.dom.add(u.getBody(),r);var i=u.selection.getRng();o.focus();var a=u.dom.createRng();a.selectNodeContents(o),u.selection.setRng(a),V.setTimeout(function(){u.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Kt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Gt=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},Xt=function(t){var e,n;t.on("cut",(e=t,function(t){Gt(e)&&Vt(t,Kt(e),qt(e),function(){V.setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Gt(n)&&Vt(t,Kt(n),qt(n),Ut)}))},Yt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Zt=function(t,e){return Yt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Jt=function(t,e){t.focus(),t.selection.setRng(e)},Qt=function(a,u,s){ct.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),ct.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Zt(a,t),!t.isDefaultPrevented()&&!s.get()){e=u.getDataTransferItems(t.dataTransfer);var r,o=u.hasContentType(e,Q());if((u.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!u.pasteImageData(t,n))&&n&&ct.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),V.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),Jt(a,n),i=ft.trimHtml(i),e["text/html"]?u.pasteHtml(i,o):u.pasteText(i)})}))}}}),a.on("dragstart",function(t){s.set(!0)}),a.on("dragover dragend",function(t){ct.shouldPasteDataImages(a)&&!1===s.get()&&(t.preventDefault(),Jt(a,Zt(a,t))),"dragend"===t.type&&s.set(!1)})},te=function(t){var e=t.plugins.paste,n=ct.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=ct.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function ee(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function ne(t,e){if(!gt.isWordContent(e))return e;var n=[];q.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=ft.filter(e,[[r,"$1"]]),e=ft.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function re(t,e,n,r){if(r||n)return e;var c,o=ct.getWebkitStyles(t);if(!1===ct.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var a=0;a<c.length;a++){var u=o[c[a]],s=l.getStyle(f,c[a],!0);/color/.test(c[a])&&(u=l.toHex(u),s=l.toHex(s)),s!==u&&(i[c[a]]=u)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function oe(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var ie=function(t){z.webkit&&ee(t,re),z.ie&&(ee(t,ne),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,oe))},ae=function(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());var t=function(t){return e.setActive(t.state)};return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}},ue=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ae(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ae(t,e)})};!function de(){s.add("paste",function(t){if(!1===c(t)){var e=p(!1),n=p(ct.isPasteAsTextEnabled(t)?"text":"html"),r=Wt(t,n),o=ie(t);return ue(t,r),b(t,r),te(t),Xt(t),Qt(t,r,e),l(r,o)}})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return e.getParam("content_style","")},m=function(e){return e.getParam("content_css_cors",!1,"boolean")},i=function(t){var n="",i=t.dom.encode,e=l(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=m(t)?' crossorigin="anonymous"':"";d.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c=t.getBody().dir,s=c?' dir="'+i(c)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+s+">"+t.getContent()+'<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);<\/script> </body></html>'},t=function(n){n.addCommand("mcePreview",function(){var e,t;t=i(e=n),e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")})},n=function(e){e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return e.execCommand("mcePreview")}}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return e.execCommand("mcePreview")}})};!function o(){e.add("preview",function(e){t(e),n(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),i=function(n){n.addCommand("mcePrint",function(){t.ie&&t.ie<=11?n.getDoc().execCommand("print",!1,null):n.getWin().print()})},e=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};!function o(){n.add("print",function(n){i(n),e(n),n.addShortcut("Meta+P","","mcePrint")})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(t){"use strict";var e,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=0,u=function(e,n,r){var t,o,i;e.plugins.table?e.plugins.table.insertTable(n,r):(o=n,i=r,(t=e).undoManager.transact(function(){var e,n;t.insertContent(function(e,n){var r,t,o;for(o='<table data-mce-id="mce" style="width: 100%">',o+="<tbody>",t=0;t<n;t++){for(o+="<tr>",r=0;r<e;r++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(o,i)),(e=t.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),n=t.dom.select("td,th",e),t.selection.setCursorLocation(n[0],0)}))},s=function(e,n,r){var t,o,i,u;o=(t=e.editorUpload.blobCache).create((i="mceu",u=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++a+String(u)),r,n),t.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},c=tinymce.util.Tools.resolve("tinymce.util.Promise"),f=function(r){return new c(function(e){var n=new t.FileReader;n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(r)})},d=function(){return new c(function(n){var e;(e=t.document.createElement("input")).type="file",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.opacity=.001,t.document.body.appendChild(e),e.onchange=function(e){n(Array.prototype.slice.call(e.target.files))},e.click(),e.parentNode.removeChild(e)})},l=function(r){r.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){d().then(function(e){var n=e[0];f(n).then(function(e){s(r,e,n)})})}}),r.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){u(r,2,2)}})},v=function(e){return function(){return e}},m=v(!1),g=v(!0),h=m,p=g,N=function(){return O},O=(o={fold:function(e,n){return e()},is:h,isSome:h,isNone:p,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:h,forall:p,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(o),o),b=function(r){var e=function(){return r},n=function(){return o},t=function(e){return e(r)},o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:p,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(r))},ap:function(e){return e.fold(N,function(e){return b(e(r))})},each:function(e){e(r)},bind:t,flatten:e,exists:t,forall:t,filter:function(e){return e(r)?o:O},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(h,function(e){return n(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},E={some:b,none:N,from:function(e){return null===e||e===undefined?O:b(e)}},w=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(e)}},T={fromHtml:function(e,n){var r=(n||t.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return w(r.childNodes[0])},fromTag:function(e,n){var r=(n||t.document).createElement(e);return w(r)},fromText:function(e,n){var r=(n||t.document).createTextNode(e);return w(r)},fromDom:w,fromPoint:function(e,n,r){var t=e.dom();return E.from(t.elementFromPoint(n,r)).map(w)}},S=(t.Node.ATTRIBUTE_NODE,t.Node.CDATA_SECTION_NODE,t.Node.COMMENT_NODE,t.Node.DOCUMENT_NODE,t.Node.DOCUMENT_TYPE_NODE,t.Node.DOCUMENT_FRAGMENT_NODE,t.Node.ELEMENT_NODE),y=(t.Node.TEXT_NODE,t.Node.PROCESSING_INSTRUCTION_NODE,t.Node.ENTITY_REFERENCE_NODE,t.Node.ENTITY_NODE,t.Node.NOTATION_NODE,"undefined"!=typeof t.window?t.window:Function("return this;")(),function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}),x=y("string"),k=y("object"),D=y("array"),_=y("boolean"),C=y("undefined"),A=y("function"),R=Array.prototype.slice;A(Array.from)&&Array.from;function I(e,n,r,t,o){return e(r,t)?E.some(r):A(o)&&o(r)?E.none():n(r,t,o)}var M,q,L,P,F=function(e,n,r){return 0!=(e.compareDocumentPosition(n)&r)},U=function(e,n){return F(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},B=function(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};var t=function(e){return Number(n.replace(r,"$"+e))};return H(t(1),t(2))},j=function(){return H(0,0)},H=function(e,n){return{major:e,minor:n}},X={nu:H,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?j():B(e,r)},unknown:j},z="Firefox",G=function(e,n){return function(){return n===e}},W=function(e){var n=e.current;return{current:n,version:e.version,isEdge:G("Edge",n),isChrome:G("Chrome",n),isIE:G("IE",n),isOpera:G("Opera",n),isFirefox:G(z,n),isSafari:G("Safari",n)}},Y={unknown:function(){return W({current:undefined,version:X.unknown()})},nu:W,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v(z),safari:v("Safari")},$="Windows",V="Android",J="Solaris",K="FreeBSD",Q=function(e,n){return function(){return n===e}},Z=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Q($,n),isiOS:Q("iOS",n),isAndroid:Q(V,n),isOSX:Q("OSX",n),isLinux:Q("Linux",n),isSolaris:Q(J,n),isFreeBSD:Q(K,n)}},ee={unknown:function(){return Z({current:undefined,version:X.unknown()})},nu:Z,windows:v($),ios:v("iOS"),android:v(V),linux:v("Linux"),osx:v("OSX"),solaris:v(J),freebsd:v(K)},ne=function(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r,e))return E.some(o)}return E.none()}(e,function(e){return e.search(r)})},re=function(e,r){return ne(e,r).map(function(e){var n=X.detect(e.versionRegexes,r);return{current:e.name,version:n}})},te=function(e,r){return ne(e,r).map(function(e){var n=X.detect(e.versionRegexes,r);return{current:e.name,version:n}})},oe=function(e,n){return-1!==e.indexOf(n)},ie=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ue=function(n){return function(e){return oe(e,n)}},ae=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return oe(e,"edge/")&&oe(e,"chrome")&&oe(e,"safari")&&oe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ie],search:function(e){return oe(e,"chrome")&&!oe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return oe(e,"msie")||oe(e,"trident")}},{name:"Opera",versionRegexes:[ie,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ue("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ue("firefox")},{name:"Safari",versionRegexes:[ie,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(oe(e,"safari")||oe(e,"mobile/"))&&oe(e,"applewebkit")}}],se=[{name:"Windows",search:ue("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return oe(e,"iphone")||oe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ue("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ue("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ue("linux"),versionRegexes:[]},{name:"Solaris",search:ue("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ue("freebsd"),versionRegexes:[]}],ce={browsers:v(ae),oses:v(se)},fe=function(e){var n,r,t,o,i,u,a,s,c,f,d,l=ce.browsers(),m=ce.oses(),g=re(l,e).fold(Y.unknown,Y.nu),h=te(m,e).fold(ee.unknown,ee.nu);return{browser:g,os:h,deviceType:(r=g,t=e,o=(n=h).isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,s=o||u||a&&!0===/mobile/i.test(t),c=n.isiOS()||n.isAndroid(),f=c&&!s,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),{isiPad:v(o),isiPhone:v(i),isTablet:v(s),isPhone:v(f),isTouch:v(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(d)})}},de=(L=!(M=function(){var e=t.navigator.userAgent;return fe(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return L||(L=!0,q=M.apply(null,e)),q}),le=S,me=function(e,n){var r=e.dom();if(r.nodeType!==le)return!1;var t=r;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},ge=({detect:de}.detect().browser.isIE(),function(e,n,r){for(var t=e.dom(),o=A(r)?r:v(!1);t.parentNode;){t=t.parentNode;var i=T.fromDom(t);if(n(i))return E.some(i);if(o(i))break}return E.none()}),he=function(e,n,r){return ge(e,function(e){return me(e,n)},r)},ve={getToolbarItemsOr:(P=x,function(e,n,r){return function(e,n){if(!n(e))throw new Error("Default value doesn't match requested type.")}(r,P),function(e,n){if(D(e)||k(e))throw new Error("expected a string but found: "+e);return C(e)?n:_(e)?!1===e?"":n:e}(e.getParam(n,r),r)})},pe=function(e){return ve.getToolbarItemsOr(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote")},Ne=function(e){return ve.getToolbarItemsOr(e,"quickbars_insert_toolbar","quickimage quicktable")},Oe=function(a){var e=Ne(a);0<e.trim().length&&a.ui.registry.addContextToolbar("quickblock",{predicate:function(e){var n,r,t,o=T.fromDom(e),i=a.schema.getTextBlockElements(),u=function(e){return e.dom()===a.getBody()};return(n=o,r="table",t=u,I(me,he,n,r,t)).fold(function(){return(e=o,n=function(e){return e.dom().nodeName.toLowerCase()in i&&a.dom.isEmpty(e.dom())},r=u,I(function(e,n){return n(e)},ge,e,n,r)).isSome();var e,n,r},function(){return!1})},items:e,position:"line",scope:"editor"})},be=function(n){n.ui.registry.addContextToolbar("imageselection",{predicate:function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},items:"alignleft aligncenter alignright",position:"node"});var e=pe(n);0<e.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!n.selection.isCollapsed()},items:e,position:"selection"})};!function Ee(){i.add("quickbars",function(e){l(e),Oe(e),be(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},i=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},r=function(n,e){n.notificationManager.open({text:e,type:"error"})},e=function(n){var e;if(e=t.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),i(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():r(n,"Error: Form submit field collision.")),n.nodeChanged()):r(n,"Error: No form element found.")}},u=function(n){var e=o.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):n.resetContent(e)},l=function(n){n.addCommand("mceSave",function(){e(n)}),n.addCommand("mceCancel",function(){u(n)})},s=function(t){return function(n){var e=function(){n.setDisabled(a(t)&&!t.isDirty())};return t.on("NodeChange dirty",e),function(){return t.off("NodeChange dirty",e)}}},d=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:s(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:s(n)}),n.addShortcut("Meta+S","","mceSave")};!function m(){n.add("save",function(n){d(n),l(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var s=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return s(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},m=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var t,n,r,o,i,g={findAndReplaceDOMText:function z(e,t,n,r,o){var i,a,h,s,g,p,c=[],u=0;function d(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(h=t.ownerDocument,s=o.getBlockElements(),g=o.getWhiteSpaceElements(),p=o.getShortEndedElements(),a=function l(e){var t;if(3===e.nodeType)return e.data;if(g[e.nodeName]&&!s[e.nodeName])return"";if(t="",x(e))return"\n";if((s[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=l(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;i=e.exec(a);)c.push(d(i,r));else i=a.match(e),c.push(d(i,r));return c.length&&(u=c.length,function m(e,t,n){var r,o,i,a,c=[],u=0,d=e,l=t.shift(),f=0;e:for(;;){if((s[d.nodeName]||p[d.nodeName]||x(d))&&u++,3===d.nodeType&&(!o&&d.length+u>=l[1]?(o=d,a=l[1]-u):r&&c.push(d),!r&&d.length+u>l[0]&&(r=d,i=l[0]-u),u+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:c,match:l[2],matchIndex:f}),u-=o.length-a,o=r=null,c=[],f++,!(l=t.shift()))break}else if(g[d.nodeName]&&!s[d.nodeName]||!d.firstChild){if(d.nextSibling){d=d.nextSibling;continue}}else if(!x(d)){d=d.firstChild;continue}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}(t,c,function f(e){var m;if("function"!=typeof e){var r=e.nodeType?e:h.createElement(e);m=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(h.createTextNode(e)),n}}else m=e;return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex;if(o===i){var c=o;r=c.parentNode,0<e.startNodeIndex&&(t=h.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(t,c));var u=m(e.match[0],a);return r.insertBefore(u,c),e.endNodeIndex<c.length&&(n=h.createTextNode(c.data.substring(e.endNodeIndex)),r.insertBefore(n,c)),c.parentNode.removeChild(c),u}t=h.createTextNode(o.data.substring(0,e.startNodeIndex)),n=h.createTextNode(i.data.substring(e.endNodeIndex));for(var d=m(o.data.substring(e.startNodeIndex),a),l=0,f=e.innerNodes.length;l<f;++l){var s=e.innerNodes[l],g=m(s.data,a);s.parentNode.replaceChild(g,s)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(d,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(n))),u}}},h=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},v=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},c=function(e,t){var n,r=[];if((n=m.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=h(n[o]);null!==i&&i.length&&(i===t.toString()&&r.push(n[o]))}return r},b=function(e,t,n){var r=t.get(),o=r.index,i=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(c(e,r.index),"mce-match-marker-selected");var a=c(e,o);return a.length?(i.addClass(c(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(a[0]),o):-1},y=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},N=function(e,t,n,r,o){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=o?"\\b"+n+"\\b":n;var i,a,c,u,d,l=(i=e,a=t,c=new RegExp(n,r?"g":"gi"),(d=i.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",u=i.getBody(),S(i,a,!1),g.findAndReplaceDOMText(c,u,d,!1,i.schema));if(l){var f=b(e,t,!0);t.set({index:f,count:l,text:n,matchCase:r,wholeWord:o})}return l},C=function(e,t){var n=b(e,t,!0);t.set(p({},t.get(),{index:n}))},w=function(e,t){var n=b(e,t,!1);t.set(p({},t.get(),{index:n}))},A=function(e){var t=h(e);return null!==t&&0<t.length},O=function(e,t,n,r,o){var i,a,c,u,d,l=t.get(),f=l.index,s=f;for(r=!1!==r,c=e.getBody(),a=m.grep(m.toArray(c.getElementsByTagName("span")),A),i=0;i<a.length;i++){var g=h(a[i]);if(u=d=parseInt(g,10),o||u===l.index){for(n.length?(a[i].firstChild.nodeValue=n,v(a[i])):y(e.dom,a[i]);a[++i];){if((u=parseInt(h(a[i]),10))!==d){i--;break}y(e.dom,a[i])}r&&s--}else f<d&&a[i].setAttribute("data-mce-index",String(d-1))}return t.set(p({},l,{count:o?0:l.count-1,index:s})),r?C(e,t):w(e,t),!o&&0<t.get().count},S=function(e,t,n){var r,o,i,a,c=t.get();for(o=m.toArray(e.getBody().getElementsByTagName("span")),r=0;r<o.length;r++){var u=h(o[r]);null!==u&&u.length&&(u===c.index.toString()&&(i||(i=o[r].firstChild),a=o[r].firstChild),v(o[r]))}if(t.set(p({},c,{index:-1,count:0,text:""})),i&&a){var d=e.dom.createRng();return d.setStart(i,0),d.setEnd(a,a.data.length),!1!==n&&e.selection.setRng(d),d}},a=function(r,o){return{done:function(e){return S(r,o,e)},find:function(e,t,n){return N(r,o,e,t,n)},next:function(){return C(r,o)},prev:function(){return w(r,o)},replace:function(e,t,n){return O(r,o,e,t,n)}}},u=function(e){return function(){return e}},d=u(!1),l=u(!0),f=d,T=l,B=function(){return I},I=(o={fold:function(e,t){return e()},is:f,isSome:f,isNone:T,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:B,ap:B,each:function(){},bind:B,flatten:B,exists:f,forall:T,filter:B,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(o),o),k=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:T,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(B,function(e){return k(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:I},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},E={some:k,none:B,from:function(e){return null===e||e===undefined?I:k(e)}},M=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===i}),R=Array.prototype.slice,D=(M(Array.from)&&Array.from,function(i,a){var t,n=(t=s(E.none()),{clear:function(){t.set(E.none())},set:function(e){t.set(E.some(e))},isSet:function(){return t.get().isSome()},on:function(e){t.get().each(e)}}),c=s(a.get().matchCase),u=s(a.get().wholeWord);i.undoManager.add();var e=m.trim(i.selection.getContent({format:"text"}));function d(e){(1<a.get().count?e.enable:e.disable)("next"),(1<a.get().count?e.enable:e.disable)("prev")}var l=function(e,t){!function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}(["replace","replaceall","prev","next"],t?e.disable:e.enable)};var f=function(e){S(i,a,!1),l(e,!0),d(e)},r=function(e){var t=e.getData(),n=a.get();if(t.findtext.length){if(n.text===t.findtext&&n.matchCase===c.get()&&n.wholeWord===u.get())C(i,a);else{var r=N(i,a,t.findtext,c.get(),u.get());r<=0&&function o(e){i.windowManager.alert("Could not find the specified string.",function(){e.focus("findtext")})}(e),l(e,0===r)}d(e)}else f(e)},o={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",fetch:function(e){e([{type:"togglemenuitem",text:"Match case",onAction:function(e){c.set(!c.get()),n.on(function(e){return e.focus("options")})},active:c.get()},{type:"togglemenuitem",text:"Find whole words only",onAction:function(e){u.set(!u.get()),n.on(function(e){return e.focus("options")})},active:u.get()}])}},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:e,replacetext:""},onChange:function(e,t){"findtext"===t.name&&0<a.get().count&&f(e)},onAction:function(e,t){var n=e.getData();switch(t.name){case"find":r(e);break;case"replace":O(i,a,n.replacetext)?d(e):f(e);break;case"replaceall":O(i,a,n.replacetext,!0,!0),f(e);break;case"prev":w(i,a),d(e);break;case"next":C(i,a),d(e)}},onSubmit:r,onClose:function(){i.focus(),S(i,a),i.undoManager.add()}};n.set(i.windowManager.open(o,{inline:"toolbar"}))}),F=function(e,t){e.addCommand("SearchReplace",function(){D(e,t)})},j=function(e,t){return function(){D(e,t)}},P=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:j(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:j(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",j(e,t))};!function W(){e.add("searchreplace",function(e){var t=s({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1});return F(e,t),P(e,t),a(e,t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(t){"use strict";var a=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return a(n())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker")||("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},u=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function l(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function e(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function t(e){var t,n,r=s(e?l(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function u(e){var t=s(l(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return g=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),p=r.schema.getShortEndedElements(),{text:o=function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(b(e))return"\n";if(t="",(g[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=d(e),e=e.nextSibling;);return t}(a),matches:i,each:e,filter:function f(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function m(){return i.splice(0,i.length),t(),this},matchFromElement:function x(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function k(e){return s(l(e))[0]},find:function N(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(c(n,t));return this},add:function y(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function S(e){return i.length&&function f(e,t,n){var r,o,i,a,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((g[u.nodeName]||p[u.nodeName]||b(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,a=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,i=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!g[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!b(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0<e.startNodeIndex&&(t=c.createTextNode(s.data.substring(0,e.startNodeIndex)),r.insertBefore(t,s));var l=m(e.match,a);return r.insertBefore(l,s),e.endNodeIndex<s.length&&(n=c.createTextNode(s.data.substring(e.endNodeIndex)),r.insertBefore(n,s)),s.parentNode.removeChild(s),l}t=c.createTextNode(o.data.substring(0,e.startNodeIndex)),n=c.createTextNode(i.data.substring(e.endNodeIndex));for(var u=m(o.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=m(g.data,a);g.parentNode.replaceChild(h,g)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(u,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(e)),this},unwrap:t,replace:function w(e,t){var n=u(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:u,indexOf:l}},m=function(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()},v=function(e,t,n,r,o,i,a){var c,s,l,u=p(e);(u||(c=e,s=t,l=n,function(e,t,r,o){var n={method:e,lang:l.get()},i="";n["addToDictionary"===e?"word":"text"]=t,N.each(n,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),f.send({url:new d(s).toAbsolute(h(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){var t=JSON.parse(e);if(t)t.error?o(t.error):r(t);else{var n=c.translate("Server response wasn't proper JSON.");o(n)}},error:function(){var e=c.translate("The spelling service was not found: (")+h(c)+c.translate(")");o(e)}})})).call(e.plugins.spellchecker,r,o,i,a)},x=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||k(e,t,n)},k=function(e,t,n){var r=e.selection.getBookmark();if(m(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},y=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},S=function(t,e,n,r,o){var i=!!o.dictionary,a=o.words;if(t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(a)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:a,hasDictionarySupport:i});var s=t.selection.getBookmark();m(t,n).find(u(t)).filter(function(e){return!!a[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),l(t)},w={spellcheck:function(t,e,n,r,o,i){k(t,n,r)||(t.setProgressState(!0),v(t,e,i,"spellcheck",m(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),k(t,n,r)}),t.focus())},checkIfFinished:x,addToDictionary:function(t,e,n,r,o,i,a){t.setProgressState(!0),v(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(a,!0),x(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?N.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),x(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=N.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=y(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:y,markErrors:S},T=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return u(t)},markErrors:function(e){w.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},I=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){w.spellcheck(e,t,n,r,o,i)})},B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},A="SpellcheckStart SpellcheckEnd",E=function(n,e,r,t,o,i){var a,c,s,l=(s=n,a=N.map(g(s).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}}),c=[],N.each(a,function(e){c.push({selectable:!0,text:e.name,data:e.value})}),c),u=function(){w.spellcheck(n,e,r,t,i,o)},d={tooltip:"Spellcheck",onAction:u,icon:"spell-check",onSetup:function(e){var t=function(){e.setActive(r.get())};return n.on(A,t),function(){n.off(A,t)}}},f=B({},d,{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(N.map(l,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<l.length?n.ui.registry.addSplitButton("spellchecker",f):n.ui.registry.addToggleButton("spellchecker",d),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",onSetup:function(e){e.setActive(r.get());var t=function(){e.setActive(r.get())};return n.on(A,t),function(){n.off(A,t)}},onAction:u})},C=function(h,p,m,v,x,k){h.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n,r,o,i,a,c,s,l,u,d,f=w.findSpansByIndex(h,w.getElmIndex(t));if(0<f.length){var g=h.dom.createRng();return g.setStartBefore(f[0]),g.setEndAfter(f[f.length-1]),h.selection.setRng(g),n=h,r=p,o=m,i=v,a=x,c=k,s=t.getAttribute("data-mce-word"),l=f,u=[],d=o.get().suggestions[s],N.each(d,function(e){u.push({text:e,onAction:function(){n.insertContent(n.dom.encode(e)),n.dom.remove(l),w.checkIfFinished(n,i,a)}})}),o.get().hasDictionarySupport&&(u.push({type:"separator"}),u.push({text:"Add to dictionary",onAction:function(){w.addToDictionary(n,r,i,a,c,s,l)}})),u.push.apply(u,[{type:"separator"},{text:"Ignore",onAction:function(){w.ignoreWord(n,i,a,s,l)}},{text:"Ignore all",onAction:function(){w.ignoreWord(n,i,a,s,l,!0)}}]),u}}})};!function e(){n.add("spellchecker",function(e,t){if(!1===c(e)){var n=a(!1),r=a(s(e)),o=a(null),i=a(null);return E(e,t,n,o,r,i),C(e,t,i,n,o,r),I(e,t,n,o,i,r),T(e,n,i,o,r,t)}})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},v=t.DOM,n=function(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};!function o(){e.add("tabfocus",function(e){i(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
- !function(m){"use strict";var l=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return l(n())}}},y=function(){},C=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},S=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,d=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},u=function(e){return e()},f=S(!1),c=S(!0),a=f,s=c,g=function(){return p},p=(r={fold:function(e,t){return e()},is:a,isSome:a,isNone:s,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:a,forall:s,filter:g,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:S("none()")},Object.freeze&&Object.freeze(r),r),h=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(n))},ap:function(e){return e.fold(g,function(e){return h(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:p},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(a,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},x={some:h,none:g,from:function(e){return null===e||e===undefined?p:h(e)}},v=tinymce.util.Tools.resolve("tinymce.PluginManager"),w=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},R=w("string"),T=w("array"),O=w("boolean"),D=w("function"),A=w("number"),E=Array.prototype.slice,N=(i=Array.prototype.indexOf)===undefined?function(e,t){return z(e,t)}:function(e,t){return i.call(e,t)},I=function(e,t){return-1<N(e,t)},k=function(e,t){return j(e,t).isSome()},P=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},B=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n,e)}},M=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},W=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},_=function(e,t,n){return B(e,function(e){n=t(n,e)}),n},L=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return x.some(o)}return x.none()},j=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n,e))return x.some(n)}return x.none()},z=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},H=Array.prototype.push,F=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!T(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);H.apply(t,e[n])}return t},U=function(e,t){var n=P(e,t);return F(n)},q=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n,e))return!1}return!0},V=function(e){var t=E.call(e,0);return t.reverse(),t},G=(D(Array.from)&&Array.from,Object.keys),Y=Object.hasOwnProperty,K=function(e,t){for(var n=G(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},X=function(e,r){return $(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},$=function(r,o){var i={};return K(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},J=function(e,t){return Q(e,t)?x.from(e[t]):x.none()},Q=function(e,t){return Y.call(e,t)},Z=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return B(t,function(e,t){r[e]=S(n[t])}),r}},ee=function(e){return e.slice(0).sort()},te=function(e,t){throw new Error("All required keys ("+ee(e).join(", ")+") were not specified. Specified keys were: "+ee(t).join(", ")+".")},ne=function(e){throw new Error("Unsupported keys for object: "+ee(e).join(", "))},re=function(t,e){if(!T(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");B(e,function(e){if(!R(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},oe=function(e){var n=ee(e);L(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},ie=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return re("required",o),re("optional",i),oe(u),function(t){var n=G(t);q(o,function(e){return I(n,e)})||te(o,n);var e=M(n,function(e){return!I(u,e)});0<e.length&&ne(e);var r={};return B(o,function(e){r[e]=S(t[e])}),B(i,function(e){r[e]=S(Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none())}),r}},ue=(m.Node.ATTRIBUTE_NODE,m.Node.CDATA_SECTION_NODE,m.Node.COMMENT_NODE),ce=m.Node.DOCUMENT_NODE,ae=(m.Node.DOCUMENT_TYPE_NODE,m.Node.DOCUMENT_FRAGMENT_NODE,m.Node.ELEMENT_NODE),le=m.Node.TEXT_NODE,fe=(m.Node.PROCESSING_INSTRUCTION_NODE,m.Node.ENTITY_REFERENCE_NODE,m.Node.ENTITY_NODE,m.Node.NOTATION_NODE,"undefined"!=typeof m.window?m.window:Function("return this;")(),function(e){return e.dom().nodeName.toLowerCase()}),se=function(e){return e.dom().nodeType},de=function(t){return function(e){return se(e)===t}},me=function(e){return se(e)===ue||"#comment"===fe(e)},ge=de(ae),pe=de(le),he=function(e,t,n){if(!(R(n)||O(n)||A(n)))throw m.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ve=function(e,t,n){he(e.dom(),t,n)},be=function(e,t){var n=e.dom();K(t,function(e,t){he(n,t,e)})},we=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},ye=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},Ce=function(e,t){e.dom().removeAttribute(t)},Se=function(e){return _(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},xe=function(e,t,n){return""===t||!(e.length<t.length)&&e.substr(n,n+t.length)===t},Re=function(e,t){return-1!==e.indexOf(t)},Te=function(e,t){return xe(e,t,0)},Oe=function(e){return e.style!==undefined&&D(e.style.getPropertyValue)},De=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Ae=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:S(e)}},Ee={fromHtml:function(e,t){var n=(t||m.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw m.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ae(n.childNodes[0])},fromTag:function(e,t){var n=(t||m.document).createElement(e);return Ae(n)},fromText:function(e,t){var n=(t||m.document).createTextNode(e);return Ae(n)},fromDom:Ae,fromPoint:function(e,t,n){var r=e.dom();return x.from(r.elementFromPoint(t,n)).map(Ae)}},Ne=function(e){var t=pe(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},Ie=De(function(){return ke(Ee.fromDom(m.document))}),ke=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return Ee.fromDom(t)},Pe=function(e,t,n){if(!R(n))throw m.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Oe(e)&&e.style.setProperty(t,n)},Be=function(e,t,n){var r=e.dom();Pe(r,t,n)},Me=function(e,t){var n=e.dom();K(t,function(e,t){Pe(n,t,e)})},We=function(e,t){var n=e.dom(),r=m.window.getComputedStyle(n).getPropertyValue(t),o=""!==r||Ne(e)?r:_e(n,t);return null===o?undefined:o},_e=function(e,t){return Oe(e)?e.style.getPropertyValue(t):""},Le=function(e,t){var n=e.dom(),r=_e(n,t);return x.from(r).filter(function(e){return 0<e.length})},je=function(e,t){var n,r,o=e.dom();r=t,Oe(n=o)&&n.style.removeProperty(r),ye(e,"style")&&""===we(e,"style").replace(/^\s+|\s+$/g,"")&&Ce(e,"style")},ze=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},He=function(e,t){return ze(e,t,m.Node.DOCUMENT_POSITION_CONTAINED_BY)},Fe=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return qe(r(1),r(2))},Ue=function(){return qe(0,0)},qe=function(e,t){return{major:e,minor:t}},Ve={nu:qe,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Ue():Fe(e,n)},unknown:Ue},Ge="Firefox",Ye=function(e,t){return function(){return t===e}},Ke=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ye("Edge",t),isChrome:Ye("Chrome",t),isIE:Ye("IE",t),isOpera:Ye("Opera",t),isFirefox:Ye(Ge,t),isSafari:Ye("Safari",t)}},Xe={unknown:function(){return Ke({current:undefined,version:Ve.unknown()})},nu:Ke,edge:S("Edge"),chrome:S("Chrome"),ie:S("IE"),opera:S("Opera"),firefox:S(Ge),safari:S("Safari")},$e="Windows",Je="Android",Qe="Solaris",Ze="FreeBSD",et=function(e,t){return function(){return t===e}},tt=function(e){var t=e.current;return{current:t,version:e.version,isWindows:et($e,t),isiOS:et("iOS",t),isAndroid:et(Je,t),isOSX:et("OSX",t),isLinux:et("Linux",t),isSolaris:et(Qe,t),isFreeBSD:et(Ze,t)}},nt={unknown:function(){return tt({current:undefined,version:Ve.unknown()})},nu:tt,windows:S($e),ios:S("iOS"),android:S(Je),linux:S("Linux"),osx:S("OSX"),solaris:S(Qe),freebsd:S(Ze)},rt=function(e,t){var n=String(t).toLowerCase();return L(e,function(e){return e.search(n)})},ot=function(e,n){return rt(e,n).map(function(e){var t=Ve.detect(e.versionRegexes,n);return{current:e.name,version:t}})},it=function(e,n){return rt(e,n).map(function(e){var t=Ve.detect(e.versionRegexes,n);return{current:e.name,version:t}})},ut=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ct=function(t){return function(e){return Re(e,t)}},at=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Re(e,"edge/")&&Re(e,"chrome")&&Re(e,"safari")&&Re(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ut],search:function(e){return Re(e,"chrome")&&!Re(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Re(e,"msie")||Re(e,"trident")}},{name:"Opera",versionRegexes:[ut,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ct("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ct("firefox")},{name:"Safari",versionRegexes:[ut,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Re(e,"safari")||Re(e,"mobile/"))&&Re(e,"applewebkit")}}],lt=[{name:"Windows",search:ct("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Re(e,"iphone")||Re(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ct("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ct("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ct("linux"),versionRegexes:[]},{name:"Solaris",search:ct("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ct("freebsd"),versionRegexes:[]}],ft={browsers:S(at),oses:S(lt)},st=function(e){var t,n,r,o,i,u,c,a,l,f,s,d=ft.browsers(),m=ft.oses(),g=ot(d,e).fold(Xe.unknown,Xe.nu),p=it(m,e).fold(nt.unknown,nt.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,c=t.isAndroid()&&4===t.version.major,a=o||u||c&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!a,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:S(o),isiPhone:S(i),isTablet:S(a),isPhone:S(f),isTouch:S(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:S(s)})}},dt={detect:De(function(){var e=m.navigator.userAgent;return st(e)})},mt=ae,gt=ce,pt=function(e,t){var n=e.dom();if(n.nodeType!==mt)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ht=function(e){return e.nodeType!==mt&&e.nodeType!==gt||0===e.childElementCount},vt=function(e,t){return e.dom()===t.dom()},bt=dt.detect().browser.isIE()?function(e,t){return He(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},wt=pt,yt=function(e){return Ee.fromDom(e.dom().ownerDocument)},Ct=function(e){return x.from(e.dom().parentNode).map(Ee.fromDom)},St=function(e,t){for(var n=D(t)?t:f,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=Ee.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},xt=function(e){return x.from(e.dom().previousSibling).map(Ee.fromDom)},Rt=function(e){return x.from(e.dom().nextSibling).map(Ee.fromDom)},Tt=function(e){return P(e.dom().childNodes,Ee.fromDom)},Ot=function(e,t){var n=e.dom().childNodes;return x.from(n[t]).map(Ee.fromDom)},Dt=(Z("element","offset"),function(t,n){Ct(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})}),At=function(e,t){Rt(e).fold(function(){Ct(e).each(function(e){Nt(e,t)})},function(e){Dt(e,t)})},Et=function(t,n){Ot(t,0).fold(function(){Nt(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Nt=function(e,t){e.dom().appendChild(t.dom())},It=function(e,t){Dt(e,t),Nt(t,e)},kt=function(r,o){B(o,function(e,t){var n=0===t?r:o[t-1];At(n,e)})},Pt=function(t,e){B(e,function(e){Nt(t,e)})},Bt=function(e){e.dom().textContent="",B(Tt(e),function(e){Mt(e)})},Mt=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Wt=function(e){var t,n=Tt(e);0<n.length&&(t=e,B(n,function(e){Dt(t,e)})),Mt(e)},_t=(Z("width","height"),Z("width","height"),Z("rows","columns")),Lt=Z("row","column"),jt=(Z("x","y"),Z("element","rowspan","colspan")),zt=Z("element","rowspan","colspan","isNew"),Ht=Z("element","rowspan","colspan","row","column"),Ft=Z("element","cells","section"),Ut=Z("element","isNew"),qt=Z("element","cells","section","isNew"),Vt=Z("cells","section"),Gt=Z("details","section"),Yt=Z("startRow","startCol","finishRow","finishCol"),Kt=function(e,t){var n=[];return B(Tt(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Kt(e,t))}),n},Xt=function(e,t,n){return r=function(e){return pt(e,t)},M(St(e,n),r);var r},$t=function(e,t){return n=function(e){return pt(e,t)},M(Tt(e),n);var n},Jt=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),ht(o)?[]:P(o.querySelectorAll(n),Ee.fromDom);var n,r,o};function Qt(e,t,n,r,o){return e(n,r)?x.some(n):D(o)&&o(n)?x.none():t(n,r,o)}var Zt=function(e,t,n){for(var r=e.dom(),o=D(n)?n:S(!1);r.parentNode;){r=r.parentNode;var i=Ee.fromDom(r);if(t(i))return x.some(i);if(o(i))break}return x.none()},en=function(e,t,n){return Zt(e,function(e){return pt(e,t)},n)},tn=function(e,t){return n=function(e){return pt(e,t)},L(e.dom().childNodes,function(e){return n(Ee.fromDom(e))}).map(Ee.fromDom);var n},nn=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),ht(o)?x.none():x.from(o.querySelector(n)).map(Ee.fromDom);var n,r,o},rn=function(e,t,n){return Qt(pt,en,e,t,n)},on=function(e,t,n){return U(Tt(e),function(e){return pt(e,t)?n(e)?[e]:[]:on(e,t,n)})},un={firstLayer:function(e,t){return on(e,t,S(!0))},filterFirstLayer:on},cn=function(e,t,n){if(void 0===n&&(n=f),n(t))return x.none();if(I(e,fe(t)))return x.some(t);return en(t,e.join(","),function(e){return pt(e,"table")||n(e)})},an=function(t,e){return Ct(e).map(function(e){return $t(e,t)})},ln=b(an,"th,td"),fn=b(an,"tr"),sn=function(e,t){return parseInt(we(e,t),10)},dn={cell:function(e,t){return cn(["td","th"],e,t)},firstCell:function(e){return nn(e,"th,td")},cells:function(e){return un.firstLayer(e,"th,td")},neighbourCells:ln,table:function(e,t){return rn(e,"table",t)},row:function(e,t){return cn(["tr"],e,t)},rows:function(e){return un.firstLayer(e,"tr")},notCell:function(e,t){return cn(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:fn,attr:sn,grid:function(e,t,n){var r=sn(e,t),o=sn(e,n);return _t(r,o)}},mn=function(e){var t=dn.rows(e);return P(t,function(e){var t=e,n=Ct(t).map(function(e){var t=fe(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=P(dn.cells(e),function(e){var t=ye(e,"rowspan")?parseInt(we(e,"rowspan"),10):1,n=ye(e,"colspan")?parseInt(we(e,"colspan"),10):1;return jt(e,t,n)});return Ft(t,r,n)})},gn=function(e,n){return P(e,function(e){var t=P(dn.cells(e),function(e){var t=ye(e,"rowspan")?parseInt(we(e,"rowspan"),10):1,n=ye(e,"colspan")?parseInt(we(e,"colspan"),10):1;return jt(e,t,n)});return Ft(e,t,n.section())})},pn=function(e,t){return e+","+t},hn=function(e,t){var n=U(e.all(),function(e){return e.cells()});return M(n,t)},vn={generate:function(e){var l={},t=[],n=e.length,f=0;B(e,function(e,c){var a=[];B(e.cells(),function(e){for(var t=0;l[pn(c,t)]!==undefined;)t++;for(var n=Ht(e.element(),e.rowspan(),e.colspan(),c,t),r=0;r<e.colspan();r++)for(var o=0;o<e.rowspan();o++){var i=t+r,u=pn(c+o,i);l[u]=n,f=Math.max(f,i+1)}a.push(n)}),t.push(Ft(e.element(),a,e.section()))});var r=_t(n,f);return{grid:S(r),access:S(l),all:S(t)}},getAt:function(e,t,n){var r=e.access()[pn(t,n)];return r!==undefined?x.some(r):x.none()},findItem:function(e,t,n){var r=hn(e,function(e){return n(t,e.element())});return 0<r.length?x.some(r[0]):x.none()},filterItems:hn,justCells:function(e){var t=P(e.all(),function(e){return e.cells()});return F(t)}},bn=Z("minRow","minCol","maxRow","maxCol"),wn=function(e,t){var n,i,r,u,c,a,l,o,f,s,d=function(e){return pt(e.element(),t)},m=mn(e),g=vn.generate(m),p=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),c=r,l=a=0,K(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:a<n&&(a=n),r<c?c=r:l<o&&(l=o)}}),bn(u,c,a,l)),h="th:not("+t+"),td:not("+t+")",v=un.filterFirstLayer(e,"th,td",function(e){return pt(e,h)});return B(v,Mt),function(e,t,n,r){for(var o,i,u,c=t.grid().columns(),a=t.grid().rows(),l=0;l<a;l++)for(var f=!1,s=0;s<c;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(vn.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=Ee.fromTag("td"),Nt(u,Ee.fromTag("br")),(o?Nt:Et)(i,u)):f=!0)}(m,g,p,d),o=e,f=p,s=M(un.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),B(s,Mt),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||B(un.firstLayer(o,"th,td"),function(e){Ce(e,"rowspan"),Ce(e,"colspan")}),Ce(o,"width"),Ce(o,"height"),je(o,"width"),je(o,"height"),e};var yn=function $f(n,r){var t=function(e){return n(e)?x.from(e.dom().nodeValue):x.none()};return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(pe,"text"),Cn=function(e){return yn.get(e)},Sn=function(e){return yn.getOption(e)},xn=function(e,t){yn.set(e,t)},Rn=function(e){return"img"===fe(e)?1:Sn(e).fold(function(){return Tt(e).length},function(e){return e.length})},Tn=["img","br"],On=function(e){return Sn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||I(Tn,fe(e))},Dn=function(e){return o=On,(i=function(e){for(var t=0;t<e.childNodes.length;t++){var n=Ee.fromDom(e.childNodes[t]);if(o(n))return x.some(n);var r=i(e.childNodes[t]);if(r.isSome())return r}return x.none()})(e.dom());var o,i},An=function(e){return En(e,On)},En=function(e,i){var u=function(e){for(var t=Tt(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return x.some(r);var o=u(r);if(o.isSome())return o}return x.none()};return u(e)},Nn=function(e,t){return Ee.fromDom(e.dom().cloneNode(t))},In=function(e){return Nn(e,!1)},kn=function(e){return Nn(e,!0)},Pn=function(e,t){var n,r,o,i,u=(n=e,r=t,o=Ee.fromTag(r),i=Se(n),be(o,i),o),c=Tt(kn(e));return Pt(u,c),u},Bn=function(){var e=Ee.fromTag("td");return Nt(e,Ee.fromTag("br")),e},Mn=function(e,t,n){var r=Pn(e,t);return K(n,function(e,t){null===e?Ce(r,t):ve(r,t,e)}),r},Wn=function(e){return e},_n=function(e){return function(){return Ee.fromTag("tr",e.dom())}},Ln=function(d,e,m){return{row:_n(e),cell:function(e){var r,o,i,t,n,u,c,a=yt(e.element()),l=Ee.fromTag(fe(e.element()),a.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,Dn(r).map(function(e){var t=i.join(","),n=Xt(e,t,function(e){return vt(e,r)});return W(n,function(e,t){var n=In(t);return Ce(n,"contenteditable"),Nt(e,n),n},o)}).getOr(o)):l;return Nt(s,Ee.fromTag("br")),t=e.element(),n=l,u=t.dom(),c=n.dom(),Oe(u)&&Oe(c)&&(c.style.cssText=u.style.cssText),je(l,"height"),1!==e.colspan()&&je(e.element(),"width"),d(e.element(),l),l},replace:Mn,gap:Bn}},jn=function(e){return{row:_n(e),cell:Bn,replace:Wn,gap:Bn}},zn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},Hn=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Fn=function(e,t){for(var n=!0,r=b(zn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&vn.getAt(e,o,i).exists(r);return n?x.some(t):x.none()},Un=function(e,t,n){var r=vn.findItem(e,t,vt),o=vn.findItem(e,n,vt);return r.bind(function(r){return o.map(function(e){return t=r,n=e,Yt(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},qn=Un,Vn=function(t,e,n){return Un(t,e,n).bind(function(e){return Fn(t,e)})},Gn=function(r,e,o,i){return vn.findItem(r,e,vt).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return vn.getAt(r,t+o,n+i).map(function(e){return e.element()})})},Yn=function(n,e,t){return qn(n,e,t).map(function(e){var t=vn.filterItems(n,b(Hn,e));return P(t,function(e){return e.element()})})},Kn=function(e,t){return vn.findItem(e,t,function(e,t){return bt(t,e)}).map(function(e){return e.element()})},Xn=function(e){var t=mn(e);return vn.generate(t)},$n=function(n,r,o){return dn.table(n).bind(function(e){var t=Xn(e);return Gn(t,n,r,o)})},Jn=function(e,t,n){var r=Xn(e);return Yn(r,t,n)},Qn=function(e,t,n,r,o){var i=Xn(e),u=vt(e,n)?x.some(t):Kn(i,t),c=vt(e,o)?x.some(r):Kn(i,r);return u.bind(function(t){return c.bind(function(e){return Yn(i,t,e)})})},Zn=function(e,t,n){var r=Xn(e);return Vn(r,t,n)},er=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function tr(){return{up:S({selector:en,closest:rn,predicate:Zt,all:St}),down:S({selector:Jt,predicate:Kt}),styles:S({get:We,getRaw:Le,set:Be,remove:je}),attrs:S({get:we,set:ve,remove:Ce,copyTo:function(e,t){var n=Se(e);be(t,n)}}),insert:S({before:Dt,after:At,afterAll:kt,append:Nt,appendAll:Pt,prepend:Et,wrap:It}),remove:S({unwrap:Wt,remove:Mt}),create:S({nu:Ee.fromTag,clone:function(e){return Ee.fromDom(e.dom().cloneNode(!1))},text:Ee.fromText}),query:S({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:xt,nextSibling:Rt}),property:S({children:Tt,name:fe,parent:Ct,document:function(e){return e.dom().ownerDocument},isText:pe,isComment:me,isElement:ge,getText:Cn,setText:xn,isBoundary:function(e){return!!ge(e)&&("body"===fe(e)||I(er,fe(e)))},isEmptyTag:function(e){return!!ge(e)&&I(["br","img","hr","input"],fe(e))}}),eq:vt,is:wt}}var nr=Z("left","right"),rr=Z("first","second","splits"),or=function(e,t,n){var r=e.property().children(t);return j(r,b(e.eq,n)).map(function(e){return{before:S(r.slice(0,e)),after:S(r.slice(e+1))}})},ir=function(r,o,e,t){var n=o(r,e);return W(t,function(e,t){var n=o(r,t);return ur(r,e,n)},n)},ur=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},cr=function(e,t){return b(e.eq,t)},ar=function(t,e,n,r){void 0===r&&(r=f);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return j(t,r).fold(function(){return t},function(e){return t.slice(0,e+1)})},c=u(o),a=u(i),l=L(c,function(e){return k(a,cr(t,e))});return{firstpath:S(c),secondpath:S(a),shared:S(l)}},lr={sharedOne:function(e,t,n){return 0<n.length?ir(e,t,(r=n)[0],r.slice(1)):x.none();var r},subset:function(t,e,n){var r=ar(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return x.some([e[0]]);if(o.eq(i,t[0]))return x.some([t[0]]);var n=function(e){var t=V(e),n=j(t,cr(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return j(u,cr(o,r))},r=n(e),c=n(t);return r.bind(function(r){return c.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},ancestors:ar,breakToLeft:function(n,r,o){return or(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),nr(t,r)})},breakToRight:function(n,r,e){return or(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),nr(r,t)})},breakPath:function(i,e,u,c){var a=function(e,t,o){var n=rr(e,x.none(),o);return u(e)?rr(e,t,o):i.property().parent(e).bind(function(r){return c(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return a(n,x.some(e.right()),o.concat(t))})}).getOr(n)};return a(e,x.none(),[])}},fr=tr(),sr={sharedOne:function(n,e){return lr.sharedOne(fr,function(e,t){return n(t)},e)},subset:function(e,t){return lr.subset(fr,e,t)},ancestors:function(e,t,n){return lr.ancestors(fr,e,t,n)},breakToLeft:function(e,t){return lr.breakToLeft(fr,e,t)},breakToRight:function(e,t){return lr.breakToRight(fr,e,t)},breakPath:function(e,t,r){return lr.breakPath(fr,e,t,function(e,t,n){return r(t,n)})}},dr={create:ie(["boxes","start","finish"],[])},mr=function(e){return en(e,"table")},gr=function(c,a,r){var l=function(t){return function(e){return r!==undefined&&r(e)||vt(e,t)}};return vt(c,a)?x.some(dr.create({boxes:x.some([c]),start:c,finish:a})):mr(c).bind(function(u){return mr(a).bind(function(i){if(vt(u,i))return x.some(dr.create({boxes:Jn(u,c,a),start:c,finish:a}));if(bt(u,i)){var e=0<(t=Xt(a,"td,th",l(u))).length?t[t.length-1]:a;return x.some(dr.create({boxes:Qn(u,c,u,a,i),start:c,finish:e}))}if(bt(i,u)){var t,n=0<(t=Xt(c,"td,th",l(i))).length?t[t.length-1]:c;return x.some(dr.create({boxes:Qn(i,c,u,a,i),start:c,finish:n}))}return sr.ancestors(c,a).shared().bind(function(e){return rn(e,"table",r).bind(function(e){var t=Xt(a,"td,th",l(e)),n=0<t.length?t[t.length-1]:a,r=Xt(c,"td,th",l(e)),o=0<r.length?r[r.length-1]:c;return x.some(dr.create({boxes:Qn(e,c,u,a,i),start:o,finish:n}))})})})})},pr=gr,hr=function(e,t){var n=Jt(e,t);return 0<n.length?x.some(n):x.none()},vr=function(e,t,n,r,o){return(i=e,u=o,L(i,function(e){return pt(e,u)})).bind(function(e){return $n(e,t,n).bind(function(e){return n=r,en(t=e,"table").bind(function(e){return nn(e,n).bind(function(e){return gr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:S(e),start:S(t.start()),finish:S(t.finish())}})})})});var t,n})});var i,u},br=function(e,t,r){return nn(e,t).bind(function(n){return nn(e,r).bind(function(t){return sr.sharedOne(mr,[n,t]).map(function(e){return{first:S(n),last:S(t),table:S(e)}})})})},wr=function(e,t){return hr(e,t)},yr=function(o,e,t){return br(o,e,t).bind(function(n){var e=function(e){return vt(o,e)},t=en(n.first(),"thead,tfoot,tbody,table",e),r=en(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return vt(t,e)?Zn(n.table(),n.first(),n.last()):x.none()})})})},Cr="data-mce-selected",Sr="data-mce-first-selected",xr="data-mce-last-selected",Rr={selected:S(Cr),selectedSelector:S("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:S("[data-mce-selected]"),firstSelected:S(Sr),firstSelectedSelector:S("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:S(xr),lastSelectedSelector:S("td[data-mce-last-selected],th[data-mce-last-selected]")},Tr=function(u){if(!T(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],n={};return B(u,function(e,r){var t=G(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!T(i))throw new Error("case arguments must be an array");c.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=G(e);if(c.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+t.join(","));if(!q(c,function(e){return I(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,n)},log:function(e){m.console.log(e,{constructors:c,constructor:o,params:n})}}}}),n},Or=Tr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Dr={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Or.none,multiple:Or.multiple,single:Or.single},Ar=function(e,t){return Dr.cata(t.get(),S([]),o,S([e]))},Er=function(n,e){return Dr.cata(e.get(),x.none,function(t,e){return 0===t.length?x.none():yr(n,Rr.firstSelectedSelector(),Rr.lastSelectedSelector()).bind(function(e){return 1<t.length?x.some({bounds:S(e),cells:S(t)}):x.none()})},x.none)},Nr=function(e,t){var n=Ar(e,t);return 0<n.length&&q(n,function(e){return ye(e,"rowspan")&&1<parseInt(we(e,"rowspan"),10)||ye(e,"colspan")&&1<parseInt(we(e,"colspan"),10)})?x.some(n):x.none()},Ir=Ar,kr=function(e){return{element:S(e),mergable:x.none,unmergable:x.none,selection:S([e])}},Pr=Z("element","clipboard","generators"),Br={noMenu:kr,forMenu:function(e,t,n){return{element:S(n),mergable:S(Er(t,e)),unmergable:S(Nr(n,e)),selection:S(Ir(n,e))}},notCell:function(e){return kr(e)},paste:Pr,pasteRows:function(e,t,n,r,o){return{element:S(n),mergable:x.none,unmergable:x.none,selection:S(Ir(n,e)),clipboard:S(r),generators:S(o)}}},Mr={registerEvents:function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Dr.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,dn.table(t[0]).map(kn).map(function(e){return[wn(e,Rr.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?P(e,function(e){return e.dom().innerText}).join(""):(t=f,P(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&x.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var a=Ee.fromDom(e);dn.table(a).each(function(t){var e,n,r,o=M((e=l.content,(r=(n||m.document).createElement("div")).innerHTML=e,Tt(Ee.fromDom(r))),function(e){return"meta"!==fe(e)});if(1===o.length&&"table"===fe(o[0])){l.preventDefault();var i=Ee.fromDom(f.getDoc()),u=jn(i),c=Br.paste(a,o[0],u);s.pasteCells(t,c).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})}};function Wr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=We(e,r);return parseFloat(n)||0}return t},i=function(o,e){return _(e,function(e,t){var n=We(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!A(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();Oe(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var _r=Wr("height",function(e){var t=e.dom();return Ne(e)?t.getBoundingClientRect().height:t.offsetHeight}),Lr=function(e){return _r.get(e)},jr=function(e){return _r.getOuter(e)},zr=Wr("width",function(e){return e.dom().offsetWidth}),Hr=function(e){return zr.get(e)},Fr=function(e){return zr.getOuter(e)},Ur=dt.detect(),qr=function(e,t,n){return r=We(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Vr=function(e){return Ur.browser.isIE()||Ur.browser.isEdge()?(n=qr(t=e,"padding-top",0),r=qr(t,"padding-bottom",0),o=qr(t,"border-top-width",0),i=qr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===We(t,"box-sizing")?u:u-n-r-(o+i)):qr(e,"height",Lr(e));var t,n,r,o,i,u},Gr=/(\d+(\.\d+)?)(\w|%)*/,Yr=/(\d+(\.\d+)?)%/,Kr=/(\d+(\.\d+)?)px|em/,Xr=function(e,t){Be(e,"height",t+"px")},$r=function(e,t,n,r){var o,i,u,c,a,l,f,s=parseInt(e,10);return xe(l=e,f="%",l.length-f.length)&&"table"!==fe(t)?(o=t,i=s,u=n,c=r,a=dn.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),c(o,a),a):s},Jr=function(e){var t,n=Le(t=e,"height").getOrThunk(function(){return Vr(t)+"px"});return n?$r(n,e,Lr,Xr):Lr(e)},Qr=function(e,t){return ye(e,t)?parseInt(we(e,t),10):1},Zr=function(e){return Le(e,"width").fold(function(){return x.from(we(e,"width"))},function(e){return x.some(e)})},eo=function(e,t){return e/t.pixelWidth()*100},to={percentageBasedSizeRegex:S(Yr),pixelBasedSizeRegex:S(Kr),setPixelWidth:function(e,t){Be(e,"width",t+"px")},setPercentageWidth:function(e,t){Be(e,"width",t+"%")},setHeight:Xr,getPixelWidth:function(t,n){return Zr(t).fold(function(){return Hr(t)},function(e){return function(e,t,n){var r=Kr.exec(t);if(null!==r)return parseInt(r[1],10);var o=Yr.exec(t);if(null===o)return Hr(e);var i=parseFloat(o[1]);return i/100*n.pixelWidth()}(t,e,n)})},getPercentageWidth:function(t,n){return Zr(t).fold(function(){var e=Hr(t);return eo(e,n)},function(e){return function(e,t,n){var r=Yr.exec(t);if(null!==r)return parseFloat(r[1]);var o=Hr(e);return eo(o,n)}(t,e,n)})},getGenericWidth:function(e){return Zr(e).bind(function(e){var t=Gr.exec(e);return null!==t?x.some({width:S(parseFloat(t[1])),unit:S(t[3])}):x.none()})},setGenericWidth:function(e,t,n){Be(e,"width",t+n)},getHeight:function(e){return n="rowspan",Jr(t=e)/Qr(t,n);var t,n},getRawWidth:Zr},no=function(n,r){to.getGenericWidth(n).each(function(e){var t=e.width()/2;to.setGenericWidth(n,t,e.unit()),to.setGenericWidth(r,t,e.unit())})},ro=function(n,r){return{left:S(n),top:S(r),translate:function(e,t){return ro(n+e,r+t)}}},oo=ro,io=function(e,t){return e!==undefined?e:t!==undefined?t:0},uo=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement,i=io(r.pageYOffset,o.scrollTop),u=io(r.pageXOffset,o.scrollLeft),c=io(o.clientTop,n.clientTop),a=io(o.clientLeft,n.clientLeft);return co(e).translate(u-a,i-c)},co=function(e){var t,n=e.dom(),r=n.ownerDocument.body;return r===n?oo(r.offsetLeft,r.offsetTop):Ne(e)?(t=n.getBoundingClientRect(),oo(t.left,t.top)):oo(0,0)},ao=Z("row","y"),lo=Z("col","x"),fo=function(e){return uo(e).left()+Fr(e)},so=function(e){return uo(e).left()},mo=function(e,t){return lo(e,so(t))},go=function(e,t){return lo(e,fo(t))},po=function(e){return uo(e).top()},ho=function(e,t){return ao(e,po(t))},vo=function(e,t){return ao(e,po(t)+jr(t))},bo=function(n,t,r){if(0===r.length)return[];var e=P(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},wo={height:{delta:o,positions:function(e){return bo(ho,vo,e)},edge:po},rtl:{delta:function(e){return-e},edge:fo,positions:function(e){return bo(go,mo,e)}},ltr:{delta:o,edge:so,positions:function(e){return bo(mo,go,e)}}},yo={ltr:wo.ltr,rtl:wo.rtl};function Co(t){var n=function(e){return t(e).isRtl()?yo.rtl:yo.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var So,xo=function(e){var t=mn(e);return vn.generate(t).grid()},Ro=function(){return(Ro=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},To=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Oo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return x.none()},Do=function(e,t,n,r){n===r?Ce(e,t):ve(e,t,n)},Ao=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=tn(o,t).getOrThunk(function(){var e=Ee.fromTag(t,yt(o).dom());return Nt(o,e),e});Bt(n);var r=P(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return Bt(t),B(e.cells(),function(e){e.isNew()&&u.push(e.element()),Do(e.element(),"colspan",e.colspan(),1),Do(e.element(),"rowspan",e.rowspan(),1),Nt(t,e.element())}),t});Pt(n,r)}(e,t):tn(o,t).each(Mt)},n=[],r=[],c=[];return B(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":c.push(e)}}),t(n,"thead"),t(r,"tbody"),t(c,"tfoot"),{newRows:S(i),newCells:S(u)}},Eo=function(e){return P(e,function(e){var n=In(e.element());return B(e.cells(),function(e){var t=kn(e.element());Do(t,"colspan",e.colspan(),1),Do(t,"rowspan",e.rowspan(),1),Nt(n,t)}),n})},No=function(e,t){var n=we(e,t);return n===undefined||""===n?[]:n.split(" ")},Io=function(e){return e.dom().classList!==undefined},ko=function(e,t){return o=t,i=No(n=e,r="class").concat([o]),ve(n,r,i.join(" ")),!0;var n,r,o,i},Po=function(e,t){return o=t,0<(i=M(No(n=e,r="class"),function(e){return e!==o})).length?ve(n,r,i.join(" ")):Ce(n,r),!1;var n,r,o,i},Bo=function(e,t){Io(e)?e.dom().classList.add(t):ko(e,t)},Mo=function(e){0===(Io(e)?e.dom().classList:No(e,"class")).length&&Ce(e,"class")},Wo=function(e,t){return Io(e)&&e.dom().classList.contains(t)},_o=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},Lo=function(t,n){if(n<0||n>=t.length-1)return x.none();var e=t[n].fold(function(){var e=V(t.slice(0,n));return Oo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return x.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return Oo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return x.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},jo=function(e,t,n){var r=e();return L(r,t).orThunk(function(){return x.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},zo=function(n){var e=n.grid(),t=_o(0,e.columns()),r=_o(0,e.rows());return P(t,function(t){return jo(function(){return U(r,function(e){return vn.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(S([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return vn.getAt(n,0,t)})})},Ho=function(n){var e=n.grid(),t=_o(0,e.rows()),r=_o(0,e.columns());return P(t,function(t){return jo(function(){return U(r,function(e){return vn.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(S([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return vn.getAt(n,t,0)})})},Fo=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Uo={resolve:Fo("ephox-snooker").resolve},qo=function(e,t,n,r,o){var i=Ee.fromTag("div");return Me(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),be(i,{"data-column":e,role:"presentation"}),i},Vo=function(e,t,n,r,o){var i=Ee.fromTag("div");return Me(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),be(i,{"data-row":e,role:"presentation"}),i},Go=Uo.resolve("resizer-bar"),Yo=Uo.resolve("resizer-rows"),Ko=Uo.resolve("resizer-cols"),Xo=function(e){var t=Jt(e.parent(),"."+Go);B(t,Mt)},$o=function(n,e,r){var o=n.origin();B(e,function(e,t){e.each(function(e){var t=r(o,e);Bo(t,Go),Nt(n.parent(),t)})})},Jo=function(e,t,n,r,o,i){var u,c,a,l,f=uo(t),s=0<n.length?o.positions(n,t):[];u=e,c=s,a=f,l=Fr(t),$o(u,c,function(e,t){var n=Vo(t.row(),a.left()-e.left(),t.y()-e.top(),l,7);return Bo(n,Yo),n});var d,m,g,p,h=0<r.length?i.positions(r,t):[];d=e,m=h,g=f,p=jr(t),$o(d,m,function(e,t){var n=qo(t.col(),t.x()-e.left(),g.top()-e.top(),7,p);return Bo(n,Ko),n})},Qo=function(e,t){var n=Jt(e.parent(),"."+Go);B(n,t)},Zo=function(e,t,n,r){Xo(e);var o=mn(t),i=vn.generate(o),u=Ho(i),c=zo(i);Jo(e,t,u,c,n,r)},ei=function(e){Qo(e,function(e){Be(e,"display","none")})},ti=function(e){Qo(e,function(e){Be(e,"display","block")})},ni=Xo,ri=function(e){return Wo(e,Yo)},oi=function(e){return Wo(e,Ko)},ii=function(e,t){return Vt(t,e.section())},ui=function(e,t){return e.cells()[t]},ci={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return ii(e,u)},setCells:ii,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:ui,getCellElement:function(e,t){return ui(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=P(n,t);return Vt(r,e.section())},cellLength:function(e){return e.cells().length}},ai=function(e,t){if(0===e.length)return 0;var n=e[0];return j(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},li=function(e,t,n,r){var o,i,u,c,a=(o=e,i=t,o[i]).cells().slice(n),l=ai(a,r),f=(u=e,c=n,P(u,function(e){return ci.getCell(e,c)})).slice(t),s=ai(f,r);return{colspan:S(l),rowspan:S(s)}},fi=function(o,i){var u=P(o,function(e,t){return P(e.cells(),function(e,t){return!1})});return P(o,function(e,r){var t=U(e.cells(),function(e,t){if(!1!==u[r][t])return[];var n=li(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[zt(e.element(),n.rowspan(),n.colspan(),e.isNew())]});return Gt(t,e.section())})},si=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var c=vn.getAt(e,o,u).map(function(e){return Ut(e.element(),n)}).getOrThunk(function(){return Ut(t.gap(),!0)});i.push(c)}var a=Vt(i,e.all()[o].section());r.push(a)}return r},di=function(e,r){return P(e,function(e){var t,n=(t=e.details(),Oo(t,function(e){return Ct(e.element()).map(function(e){var t=Ct(e).isNone();return Ut(e,t)})}).getOrThunk(function(){return Ut(r.row(),!0)}));return qt(n.element(),e.details(),e.section(),n.isNew())})},mi=function(e,t){var n=fi(e,vt);return di(n,t)},gi=function(e,t){var n=F(P(e.all(),function(e){return e.cells()}));return L(n,function(e){return vt(t,e.element())})},pi=function(c,a,l,f,s){return function(n,r,e,o,i){var t=mn(r),u=vn.generate(t);return a(u,e).map(function(e){var t=si(u,o,!1),n=c(t,e,vt,s(o)),r=mi(n.grid(),o);return{grid:S(r),cursor:n.cursor}}).fold(function(){return x.none()},function(e){var t=Ao(r,e.grid());return l(r,e.grid(),i),f(r),Zo(n,r,wo.height,i),x.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},hi=function(t,e){return dn.cell(e.element()).bind(function(e){return gi(t,e)})},vi=function(t,e){var n=P(e.selection(),function(e){return dn.cell(e).bind(function(e){return gi(t,e)})}),r=To(n);return 0<r.length?x.some({cells:r,generators:e.generators,clipboard:e.clipboard}):x.none()},bi=function(t,e){var n=P(e.selection(),function(e){return dn.cell(e).bind(function(e){return gi(t,e)})}),r=To(n);return 0<r.length?x.some(r):x.none()},wi=function(n){return{is:function(e){return n===e},isValue:c,isError:f,getOr:S(n),getOrThunk:S(n),getOrDie:S(n),or:function(e){return wi(n)},orThunk:function(e){return wi(n)},fold:function(e,t){return t(n)},map:function(e){return wi(e(n))},mapError:function(e){return wi(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return x.some(n)}}},yi=function(n){return{is:f,isValue:f,isError:c,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return yi(n)},mapError:function(e){return yi(e(n))},each:y,bind:function(e){return yi(n)},exists:f,forall:c,toOption:x.none}},Ci={value:wi,error:yi,fromOption:function(e,t){return e.fold(function(){return yi(t)},wi)}},Si=function(e,t){return P(e,function(){return Ut(t.cell(),!0)})},xi=function(t,e,n){return t.concat(function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(e,function(e){return ci.setCells(t[t.length-1],Si(t[t.length-1].cells(),n))}))},Ri=function(e,t,n){return P(e,function(e){return ci.setCells(e,e.cells().concat(Si(_o(0,t),n)))})},Ti=function(e,t,n){if(e.row()>=t.length||e.column()>ci.cellLength(t[0]))return Ci.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=ci.cellLength(n[0]),u=n.length;return Ci.value({rowDelta:S(r.length-u),colDelta:S(o.length-i)})},Oi=function(e,t){var n=ci.cellLength(e[0]),r=ci.cellLength(t[0]);return{rowDelta:S(0),colDelta:S(n-r)}},Di=function(e,t,n){var r=t.colDelta()<0?Ri:o;return(t.rowDelta()<0?xi:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},Ai=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)ci.mutateCell(e[o],i,Ut(r(),!1));return e},Ei=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<ci.cellLength(e[0]);u++){var c=n(ci.getCellElement(e[i],u),t);!0===c&&!1===o?ci.mutateCell(e[i],u,Ut(r(),!0)):!0===c&&(o=!1)}return e},Ni=function(i,n,u,c){if(0<n&&n<i.length){var e=i[n-1].cells(),t=(r=u,_(e,function(e,t){return k(e,function(e){return r(e.element(),t.element())})?e:e.concat([t])},[]));B(t,function(r){for(var o=x.none(),e=function(n){for(var e=function(t){var e=i[n].cells()[t];u(e.element(),r.element())&&(o.isNone()&&(o=x.some(c())),o.each(function(e){ci.mutateCell(i[n],t,Ut(e,!0))}))},t=0;t<ci.cellLength(i[0]);t++)e(t)},t=n;t<i.length;t++)e(t)})}var r;return i},Ii=function(n,r,o,i,u){return Ti(n,r,o).map(function(e){var t=Di(r,e,i);return function(e,t,n,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+n.length,m=s+ci.cellLength(n[0]),g=f;g<d;g++)for(var p=s;p<m;p++){i=t,u=g,c=p,l=a=void 0,a=b(o,ci.getCell(i[u],c).element()),l=i[u],1<i.length&&1<ci.cellLength(l)&&(0<c&&a(ci.getCellElement(l,c-1))||c<l.cells().length-1&&a(ci.getCellElement(l,c+1))||0<u&&a(ci.getCellElement(i[u-1],c))||u<i.length-1&&a(ci.getCellElement(i[u+1],c)))&&Ei(t,ci.getCellElement(t[g],p),o,r.cell);var h=ci.getCellElement(n[g-f],p-s),v=r.replace(h);ci.mutateCell(t[g],p,Ut(v,!0))}return t}(n,t,o,i,u)})},ki=function(e,t,n,r,o){Ni(t,e,o,r.cell);var i=Oi(n,t),u=Di(n,i,r),c=Oi(t,u),a=Di(t,c,r);return a.slice(0,e).concat(u).concat(a.slice(e,a.length))},Pi=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),c=ci.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(ci.getCellElement(n[r-1],t),ci.getCellElement(n[r],t))?ci.getCell(n[r],t):Ut(i(e.element(),o),!0)});return t.concat([c]).concat(u)},Bi=function(e,n,r,o,i){return P(e,function(e){var t=0<n&&n<ci.cellLength(e)&&o(ci.getCellElement(e,n-1),ci.getCellElement(e,n))?ci.getCell(e,n):Ut(i(ci.getCellElement(e,r),o),!0);return ci.addCell(e,n,t)})},Mi=function(e,r,o,i,u){var c=o+1;return P(e,function(e,t){var n=t===r?Ut(u(ci.getCellElement(e,o),i),!0):ci.getCell(e,o);return ci.addCell(e,c,n)})},Wi=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),c=e.slice(i),a=ci.mapCells(e[t],function(e,t){return t===n?Ut(o(e.element(),r),!0):e});return u.concat([a]).concat(c)},_i=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},Li=function(e,n,r){var t=P(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return Vt(t,e.section())});return M(t,function(e){return 0<e.cells().length})},ji=function(e,n,r,o){return P(e,function(e){return ci.mapCells(e,function(e){return t=e,k(n,function(e){return r(t.element(),e.element())})?Ut(o(e.element(),r),!0):e;var t})})},zi=function(e,t,n,r){return ci.getCellElement(e[t],n)!==undefined&&0<t&&r(ci.getCellElement(e[t-1],n),ci.getCellElement(e[t],n))},Hi=function(e,t,n){return 0<t&&n(ci.getCellElement(e,t-1),ci.getCellElement(e,t))},Fi=function(n,r,o,e){var t=U(n,function(e,t){return zi(n,t,r,o)||Hi(e,r,o)?[]:[ci.getCell(e,r)]});return ji(n,t,o,e)},Ui=function(n,r,o,e){var i=n[r],t=U(i.cells(),function(e,t){return zi(n,r,t,o)||Hi(i,t,o)?[]:[e]});return ji(n,t,o,e)},qi=Tr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Vi=Ro({},qi),Gi=function(e,t,i,u){var n,r,c=e.slice(0),o=(r=t,0===(n=e).length?Vi.none():1===n.length?Vi.only(0):0===r?Vi.left(0,1):r===n.length-1?Vi.right(r-1,r):0<r&&r<n.length-1?Vi.middle(r-1,r,r+1):Vi.none()),a=function(e){return P(e,S(0))},l=S(a(c)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),c[t]-i);return a(c.slice(0,e)).concat([i,n-c[t]]).concat(a(c.slice(t+1)))}var r=Math.max(u.minCellWidth(),c[e]+i),o=c[e]-r;return a(c.slice(0,e)).concat([r-c[e],o]).concat(a(c.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(c[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return a(c.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),c[t]+i);return a(c.slice(0,t)).concat([n-c[t]])})},Yi=function(e,t){return ye(e,t)&&1<parseInt(we(e,t),10)},Ki={hasColspan:function(e){return Yi(e,"colspan")},hasRowspan:function(e){return Yi(e,"rowspan")},minWidth:S(10),minHeight:S(10),getInt:function(e,t){return parseInt(We(e,t),10)}},Xi=function(e,t,n){return Le(e,t).fold(function(){return n(e)+"px"},function(e){return e})},$i=function(e,t){return Xi(e,"width",function(e){return to.getPixelWidth(e,t)})},Ji=function(e){return Xi(e,"height",to.getHeight)},Qi=function(e,t,n,r,o){var i=zo(e),u=P(i,function(e){return e.map(t.edge)});return P(i,function(e,t){return e.filter(d(Ki.hasColspan)).fold(function(){var e=Lo(u,t);return r(e)},function(e){return n(e,o)})})},Zi=function(e){return e.map(function(e){return e+"px"}).getOr("")},eu=function(e,t,n,r){var o=Ho(e),i=P(o,function(e){return e.map(t.edge)});return P(o,function(e,t){return e.filter(d(Ki.hasRowspan)).fold(function(){var e=Lo(i,t);return r(e)},function(e){return n(e)})})},tu={getRawWidths:function(e,t,n){return Qi(e,t,$i,Zi,n)},getPixelWidths:function(e,t,n){return Qi(e,t,to.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Qi(e,t,to.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return eu(e,t,to.getHeight,function(e){return e.getOrThunk(Ki.minHeight)})},getRawHeights:function(e,t){return eu(e,t,Ji,Zi)}},nu=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},ru=function(e,n){var t=vn.justCells(e);return P(t,function(e){var t=nu(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:S(t),colspan:e.colspan}})},ou=function(e,n){var t=vn.justCells(e);return P(t,function(e){var t=nu(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:S(t),rowspan:e.rowspan}})},iu=function(e,n){return P(e.all(),function(e,t){return{element:e.element,height:S(n[t])}})},uu=function(e){var t=o;return{width:S(e),pixelWidth:S(e),getWidths:tu.getPixelWidths,getCellDelta:t,singleColumnWidth:function(e,t){return[Math.max(Ki.minWidth(),e+t)-e]},minCellWidth:Ki.minWidth,setElementWidth:to.setPixelWidth,setTableWidth:function(e,t,n){var r=W(t,function(e,t){return e+t},0);to.setPixelWidth(e,r)}}},cu=function(e,t){var n,r,o,i,u=to.percentageBasedSizeRegex().exec(t);if(null!==u)return n=u[1],r=e,o=parseFloat(n),i=Hr(r),{width:S(o),pixelWidth:S(i),getWidths:tu.getPercentageWidths,getCellDelta:function(e){return e/i*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Ki.minWidth()/i*100},setElementWidth:to.setPercentageWidth,setTableWidth:function(e,t,n){var r=n/100*o;to.setPercentageWidth(e,o+r)}};var c=to.pixelBasedSizeRegex().exec(t);if(null!==c){var a=parseInt(c[1],10);return uu(a)}var l=Hr(e);return uu(l)},au=function(t){return to.getRawWidth(t).fold(function(){var e=Hr(t);return uu(e)},function(e){return cu(t,e)})},lu=function(e){return vn.generate(e)},fu=function(e){var t=mn(e);return lu(t)},su=function(e,t,n,r){var o=au(e),i=o.getCellDelta(t),u=fu(e),c=o.getWidths(u,r,o),a=Gi(c,n,i,o),l=P(a,function(e,t){return e+c[t]}),f=ru(u,l);B(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},du=function(e,n,r,t){var o=fu(e),i=tu.getPixelHeights(o,t),u=P(i,function(e,t){return r===t?Math.max(n+e,Ki.minHeight()):e}),c=ou(o,u),a=iu(o,u);B(a,function(e){to.setHeight(e.element(),e.height())}),B(c,function(e){to.setHeight(e.element(),e.height())});var l=W(u,function(e,t){return e+t},0);to.setHeight(e,l)},mu=function(e,t,n){var r=au(e),o=lu(t),i=r.getWidths(o,n,r),u=ru(o,i);B(u,function(e){r.setElementWidth(e.element(),e.width())}),0<u.length&&r.setTableWidth(e,i,r.getCellDelta(0))},gu=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return re("required",o),oe(o),function(t){var n=G(t);q(o,function(e){return I(n,e)})||te(o,n),r(o,n);var e=M(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+ee(e).join(", ")+") were not.")}(e,i.label),t}},pu=function(t,e){var n=M(e,function(e){return!I(t,e)});0<n.length&&ne(n)},hu=function(e){return gu(pu,e,{validate:D,label:"function"})},vu=hu(["cell","row","replace","gap"]),bu=function(e){var t=ye(e,"colspan")?parseInt(we(e,"colspan"),10):1,n=ye(e,"rowspan")?parseInt(we(e,"rowspan"),10):1;return{element:S(e),colspan:S(t),rowspan:S(n)}},wu=function(r,o){void 0===o&&(o=bu),vu(r);var n=l(x.none()),i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(x.some(t)),c=x.some({item:e,replacement:t}),t},c=x.none();return{getOrInit:function(t,n){return c.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},yu=function(c,a){return function(r){var o=l(x.none());vu(r);var i=[],u=function(e){var t={scope:c},n=r.replace(e,a,t);return i.push({item:e,sub:n}),o.get().isNone()&&o.set(x.some(n)),n};return{replaceOrInit:function(t,n){return(r=t,o=n,L(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:o.get}}},Cu=function(n){vu(n);var e=l(x.none());return{combine:function(t){return e.get().isNone()&&e.set(x.some(t)),function(){var e=n.cell({element:S(t),colspan:S(1),rowspan:S(1)});return je(e,"width"),je(t,"width"),e}},cursor:e.get}},Su=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],xu=function(e,t){var n=e.property().name(t);return I(Su,n)},Ru=function(e,t){return I(["br","img","hr","input"],e.property().name(t))},Tu=xu,Ou=function(e,t){var n=e.property().name(t);return I(["ol","ul"],n)},Du=Ru,Au=tr(),Eu=function(e){return Tu(Au,e)},Nu=function(e){return Ou(Au,e)},Iu=function(e){return Du(Au,e)},ku=function(e){var t,i=function(e){return"br"===fe(e)},n=function(o){return An(o).bind(function(n){var r=Rt(n).map(function(e){return!!Eu(e)||!!Iu(e)&&"img"!==fe(e)}).getOr(!1);return Ct(n).map(function(e){return!0===r||"li"===fe(t=e)||Zt(t,Nu).isSome()||i(n)||Eu(e)&&!vt(o,e)?[]:[Ee.fromTag("br")];var t})}).getOr([])},r=0===(t=U(e,function(e){var t=Tt(e);return q(t,function(e){return i(e)||pe(e)&&0===Cn(e).trim().length})?[]:t.concat(n(e))})).length?[Ee.fromTag("br")]:t;Bt(e[0]),Pt(e[0],r)},Pu=function(e){0===dn.cells(e).length&&Mt(e)},Bu=Z("grid","cursor"),Mu=function(e,t,n){return Wu(e,t,n).orThunk(function(){return Wu(e,0,0)})},Wu=function(e,t,n){return x.from(e[t]).bind(function(e){return x.from(e.cells()[n]).bind(function(e){return x.from(e.element())})})},_u=function(e,t,n){return Bu(e,Wu(e,t,n))},Lu=function(e){return _(e,function(e,t){return k(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ju=function(e){return _(e,function(e,t){return k(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},zu=function(e,t,n){var r=gn(e,n),o=vn.generate(r);return si(o,t,!0)},Hu=mu,Fu={insertRowBefore:pi(function(e,t,n,r){var o=t.row(),i=t.row(),u=Pi(e,i,o,n,r.getOrInit);return _u(u,i,t.column())},hi,y,y,wu),insertRowsBefore:pi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=Lu(t),c=_(u,function(e,t){return Pi(e,i,o,n,r.getOrInit)},e);return _u(c,i,t[0].column())},bi,y,y,wu),insertRowAfter:pi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=Pi(e,i,o,n,r.getOrInit);return _u(u,i,t.column())},hi,y,y,wu),insertRowsAfter:pi(function(e,t,n,r){var o=Lu(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),c=_(o,function(e,t){return Pi(e,u,i,n,r.getOrInit)},e);return _u(c,u,t[0].column())},bi,y,y,wu),insertColumnBefore:pi(function(e,t,n,r){var o=t.column(),i=t.column(),u=Bi(e,i,o,n,r.getOrInit);return _u(u,t.row(),i)},hi,Hu,y,wu),insertColumnsBefore:pi(function(e,t,n,r){var o=ju(t),i=o[0].column(),u=o[0].column(),c=_(o,function(e,t){return Bi(e,u,i,n,r.getOrInit)},e);return _u(c,t[0].row(),u)},bi,Hu,y,wu),insertColumnAfter:pi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=Bi(e,i,o,n,r.getOrInit);return _u(u,t.row(),i)},hi,Hu,y,wu),insertColumnsAfter:pi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ju(t),c=_(u,function(e,t){return Bi(e,i,o,n,r.getOrInit)},e);return _u(c,t[0].row(),i)},bi,Hu,y,wu),splitCellIntoColumns:pi(function(e,t,n,r){var o=Mi(e,t.row(),t.column(),n,r.getOrInit);return _u(o,t.row(),t.column())},hi,Hu,y,wu),splitCellIntoRows:pi(function(e,t,n,r){var o=Wi(e,t.row(),t.column(),n,r.getOrInit);return _u(o,t.row(),t.column())},hi,y,y,wu),eraseColumns:pi(function(e,t,n,r){var o=ju(t),i=Li(e,o[0].column(),o[o.length-1].column()),u=Mu(i,t[0].row(),t[0].column());return Bu(i,u)},bi,Hu,Pu,wu),eraseRows:pi(function(e,t,n,r){var o=Lu(t),i=_i(e,o[0].row(),o[o.length-1].row()),u=Mu(i,t[0].row(),t[0].column());return Bu(i,u)},bi,y,Pu,wu),makeColumnHeader:pi(function(e,t,n,r){var o=Fi(e,t.column(),n,r.replaceOrInit);return _u(o,t.row(),t.column())},hi,y,y,yu("row","th")),unmakeColumnHeader:pi(function(e,t,n,r){var o=Fi(e,t.column(),n,r.replaceOrInit);return _u(o,t.row(),t.column())},hi,y,y,yu(null,"td")),makeRowHeader:pi(function(e,t,n,r){var o=Ui(e,t.row(),n,r.replaceOrInit);return _u(o,t.row(),t.column())},hi,y,y,yu("col","th")),unmakeRowHeader:pi(function(e,t,n,r){var o=Ui(e,t.row(),n,r.replaceOrInit);return _u(o,t.row(),t.column())},hi,y,y,yu(null,"td")),mergeCells:pi(function(e,t,n,r){var o=t.cells();ku(o);var i=Ai(e,t.bounds(),n,S(o[0]));return Bu(i,x.from(o[0]))},function(e,t){return t.mergable()},y,y,Cu),unmergeCells:pi(function(e,t,n,r){var o=W(t,function(e,t){return Ei(e,t,n,r.combine(t))},e);return Bu(o,x.from(t[0]))},function(e,t){return t.unmergable()},Hu,y,Cu),pasteCells:pi(function(e,n,t,r){var o,i,u,c,a=(o=n.clipboard(),i=n.generators(),u=mn(o),c=vn.generate(u),si(c,i,!0)),l=Lt(n.row(),n.column());return Ii(l,e,a,n.generators(),t).fold(function(){return Bu(e,x.some(n.element()))},function(e){var t=Mu(e,n.row(),n.column());return Bu(e,t)})},function(t,n){return dn.cell(n.element()).bind(function(e){return gi(t,e).map(function(e){return Ro({},e,{generators:n.generators,clipboard:n.clipboard})})})},Hu,y,wu),pasteRowsBefore:pi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=zu(t.clipboard(),t.generators(),o),c=ki(i,e,u,t.generators(),n),a=Mu(c,t.cells[0].row(),t.cells[0].column());return Bu(c,a)},vi,y,y,wu),pasteRowsAfter:pi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=zu(t.clipboard(),t.generators(),o),c=ki(i,e,u,t.generators(),n),a=Mu(c,t.cells[0].row(),t.cells[0].column());return Bu(c,a)},vi,y,y,wu)},Uu=function(e){return Ee.fromDom(e.getBody())},qu=function(e){return e.getBoundingClientRect().width},Vu=function(e){return e.getBoundingClientRect().height},Gu=function(t){return function(e){return vt(e,Uu(t))}},Yu=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},Ku=function(e){var t=Jt(e,"td[data-mce-style],th[data-mce-style]");Ce(e,"data-mce-style"),B(t,function(e){Ce(e,"data-mce-style")})},Xu={isRtl:S(!1)},$u={isRtl:S(!0)},Ju={directionAt:function(e){return"rtl"==("rtl"===We(e,"direction")?"rtl":"ltr")?$u:Xu}},Qu={"border-collapse":"collapse",width:"100%"},Zu={border:"1"},ec=function(e){return e.getParam("table_default_attributes",Zu,"object")},tc=function(e){return e.getParam("table_default_styles",Qu,"object")},nc=function(e){return e.getParam("table_tab_navigation",!0,"boolean")},rc=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},oc=function(e){return e.getParam("table_row_advtab",!0,"boolean")},ic=function(e){return e.getParam("table_advtab",!0,"boolean")},uc=function(e){return e.getParam("table_style_by_css",!1,"boolean")},cc=function(e){return e.getParam("table_class_list",[],"array")},ac=function(e){return!1===e.getParam("table_responsive_width")},lc=function(e,t){return e.fire("newrow",{node:t})},fc=function(e,t){return e.fire("newcell",{node:t})},sc=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},dc=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},mc=function(f,e){var t,n=function(e){return"table"===fe(Uu(e))},s=(t=f.getParam("table_clone_elements"),R(t)?x.some(t.split(/[ ,]/)):Array.isArray(t)?x.some(t):x.none()),r=function(u,c,a,l){return function(e,t){Ku(e);var n=l(),r=Ee.fromDom(f.getDoc()),o=Co(Ju.directionAt),i=Ln(a,r,s);return c(e)?u(n,e,t,i,o).bind(function(e){return B(e.newRows(),function(e){lc(f,e.dom())}),B(e.newCells(),function(e){fc(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):x.none()}};return{deleteRow:r(Fu.eraseRows,function(e){var t=xo(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(Fu.eraseColumns,function(e){var t=xo(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(Fu.insertRowsBefore,c,y,e),insertRowsAfter:r(Fu.insertRowsAfter,c,y,e),insertColumnsBefore:r(Fu.insertColumnsBefore,c,no,e),insertColumnsAfter:r(Fu.insertColumnsAfter,c,no,e),mergeCells:r(Fu.mergeCells,c,y,e),unmergeCells:r(Fu.unmergeCells,c,y,e),pasteRowsBefore:r(Fu.pasteRowsBefore,c,y,e),pasteRowsAfter:r(Fu.pasteRowsAfter,c,y,e),pasteCells:r(Fu.pasteCells,c,y,e)}},gc=function(e,t,r){var n=mn(e),o=vn.generate(n);return bi(o,t).map(function(e){var t=si(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=mi(t,r);return Eo(n)})},pc=tinymce.util.Tools.resolve("tinymce.util.Tools"),hc=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},vc=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},bc=function(t,n){pc.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},wc=function(t,n){pc.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},yc=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},Cc=function(t,e){var n=function(e){return Te(e,"rgb")?t.toHex(e):e};return{borderstyle:Le(Ee.fromDom(e),"border-style").getOr(""),bordercolor:Le(Ee.fromDom(e),"border-color").map(n).getOr(""),backgroundcolor:Le(Ee.fromDom(e),"background-color").map(n).getOr("")}},Sc=function(e,t,n,r,o){var i={};return pc.each(e.split(" "),function(e){r.formatter.matchNode(o,t+e)&&(i[n]=e)}),i[n]||(i[n]=""),i},xc=b(Sc,"left center right"),Rc=b(Sc,"top middle bottom"),Tc=function(e,r,t){var o=function(e,n){return n=n||[],pc.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},Oc=function(e){var i=e[0],t=e.slice(1),n=G(i);return B(t,function(e){B(n,function(o){K(e,function(e,t,n){var r=i[o];""!==r&&o===t&&r!==e&&(i[o]="")})})}),i},Dc=function(){return{title:"Advanced",name:"advanced",items:[{name:"borderstyle",type:"selectbox",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}]}},Ac=function(e,t,n){var r,o,i,u=e.dom;return Ro({width:u.getStyle(t,"width")||u.getAttrib(t,"width"),height:u.getStyle(t,"height")||u.getAttrib(t,"height"),cellspacing:u.getStyle(t,"border-spacing")||u.getAttrib(t,"cellspacing"),cellpadding:u.getAttrib(t,"cellpadding")||yc(e.dom,t,"padding"),border:(r=u,o=t,i=Le(Ee.fromDom(o),"border-width"),uc(e)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||yc(e.dom,o,"border-width")||yc(e.dom,o,"border")),caption:!!u.select("caption",t)[0],"class":u.getAttrib(t,"class","")},xc("align","align",e,t),n?Cc(u,t):{})},Ec=function(e,t,n){var r=e.dom;return Ro({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),"class":r.getAttrib(t,"class",""),align:"",type:t.parentNode.nodeName.toLowerCase()},xc("align","align",e,t),n?Cc(r,t):{})},Nc=function(e,t,n){var r=e.dom;return Ro({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),celltype:t.nodeName.toLowerCase(),"class":r.getAttrib(t,"class","")},xc("align","halign",e,t),Rc("valign","valign",e,t),n?Cc(r,t):{})},Ic=function(e,t){var n,r,o,i,u,c,a,l,f=tc(e),s=ec(e),d=e.dom,m=t?(n=d,r=function(e){return Te(e,"rgb")?n.toHex(e):e},o=J(f,"border-style").getOr(""),i=J(f,"border-color").getOr(""),u=J(f,"background-color").getOr(""),{borderstyle:o,bordercolor:r(i),backgroundcolor:r(u)}):{};return Ro({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""},f,s,m,(l=f["border-width"],uc(e)&&l?{border:l}:J(s,"border").fold(function(){return{}},function(e){return{border:e}})),(c=J(f,"border-spacing").or(J(s,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),a=J(f,"border-padding").or(J(s,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),Ro({},c,a)))},kc=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],Pc=function(e){return(t=e,n=t.getParam("table_cell_class_list",[],"array"),r=Tc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?x.some({name:"class",type:"selectbox",label:"Class",items:r}):x.none()).fold(function(){return kc},function(e){return kc.concat(e)});var t,n,r},Bc={normal:function(n,r){return{setAttrib:function(e,t){n.setAttrib(r,e,t)},setStyle:function(e,t){n.setStyle(r,e,t)}}},ifTruthy:function(n,r){return{setAttrib:function(e,t){t&&n.setAttrib(r,e,t)},setStyle:function(e,t){t&&n.setStyle(r,e,t)}}}},Mc=function(e,t){e.setAttrib("scope",t.scope),e.setAttrib("class",t["class"]),e.setStyle("width",Yu(t.width)),e.setStyle("height",Yu(t.height))},Wc=function(e,t){e.setStyle("background-color",t.backgroundcolor),e.setStyle("border-color",t.bordercolor),e.setStyle("border-style",t.borderstyle)},_c=function(e,t,n){var r=e.dom,o=n.celltype&&t[0].nodeName.toLowerCase()!==n.celltype?r.rename(t[0],n.celltype):t[0],i=Bc.normal(r,o);Mc(i,n),rc(e)&&Wc(i,n),bc(e,o),wc(e,o),n.halign&&hc(e,o,n.halign),n.valign&&vc(e,o,n.valign)},Lc=function(n,e,r){var o=n.dom;pc.each(e,function(e){r.celltype&&e.nodeName.toLowerCase()!==r.celltype&&(e=o.rename(e,r.celltype));var t=Bc.ifTruthy(o,e);Mc(t,r),rc(n)&&Wc(t,r),r.halign&&hc(n,e,r.halign),r.valign&&vc(n,e,r.valign)})},jc=function(e,t,n){var r=n.getData();n.close(),e.undoManager.transact(function(){(1===t.length?_c:Lc)(e,t,r),e.focus()})},zc=function(t){var e,n=[];if(n=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!n.length&&e&&n.push(e),e=e||n[0]){var r=pc.map(n,function(e){return Nc(t,e,rc(t))}),o=Oc(r),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:Pc(t)},Dc()]},u={type:"panel",items:[{type:"grid",columns:2,items:Pc(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:rc(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(jc,t,n)})}},Hc=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Fc=function(e){return(t=e,n=t.getParam("table_row_class_list",[],"array"),r=Tc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?x.some({name:"class",type:"selectbox",label:"Class",items:r}):x.none()).fold(function(){return Hc},function(e){return Hc.concat(e)});var t,n,r},Uc=function(f,e,s,t){var d=f.dom,m=t.getData();t.close();var g=1===e.length?Bc.normal:Bc.ifTruthy;f.undoManager.transact(function(){pc.each(e,function(e){var t,n,r,o,i,u;m.type!==e.parentNode.nodeName.toLowerCase()&&(t=f.dom,n=e,r=m.type,o=t.getParent(n,"table"),i=n.parentNode,(u=t.select(r,o)[0])||(u=t.create(r),o.firstChild?"CAPTION"===o.firstChild.nodeName?t.insertAfter(u,o.firstChild):o.insertBefore(u,o.firstChild):o.appendChild(u)),u.appendChild(n),i.hasChildNodes()||t.remove(i));var c,a,l=g(d,e);l.setAttrib("scope",m.scope),l.setAttrib("class",m["class"]),l.setStyle("height",Yu(m.height)),oc(f)&&(a=m,(c=l).setStyle("background-color",a.backgroundcolor),c.setStyle("border-color",a.bordercolor),c.setStyle("border-style",a.borderstyle)),m.align!==s.align&&(bc(f,e),hc(f,e,m.align))}),f.focus()})},qc=function(t){var e,n,r=t.dom,o=[];if((e=r.getParent(t.selection.getStart(),"table"))&&(n=r.getParent(t.selection.getStart(),"td,th"),pc.each(e.rows,function(t){pc.each(t.cells,function(e){if((r.getAttrib(e,"data-mce-selected")||e===n)&&o.indexOf(t)<0)return o.push(t),!1})}),o[0])){var i=pc.map(o,function(e){return Ec(t,e,oc(t))}),u=Oc(i),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Fc(t)},Dc()]},a={type:"panel",items:[{type:"grid",columns:2,items:Fc(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:oc(t)?c:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:b(Uc,t,o,u)})}},Vc=Object.prototype.hasOwnProperty,Gc=(So=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Vc.call(o,i)&&(n[i]=So(n[i],o[i]))}return n}),Yc=tinymce.util.Tools.resolve("tinymce.Env"),Kc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Xc=function(e,t,n,r,o){void 0===o&&(o=Kc);var i=Ee.fromTag("table");Me(i,o.styles),be(i,o.attributes);var u=Ee.fromTag("tbody");Nt(i,u);for(var c=[],a=0;a<e;a++){for(var l=Ee.fromTag("tr"),f=0;f<t;f++){var s=a<n||f<r?Ee.fromTag("th"):Ee.fromTag("td");f<r&&ve(s,"scope","row"),a<n&&ve(s,"scope","col"),Nt(s,Ee.fromTag("br")),o.percentages&&Be(s,"width",100/t+"%"),Nt(l,s)}c.push(l)}return Pt(u,c),i},$c=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Jc=function(r,e,t){var n,o=tc(r),i={styles:o,attributes:ec(r),percentages:(n=o.width,R(n)&&-1!==n.indexOf("%")&&!ac(r))},u=Xc(t,e,0,0,i);ve(u,"data-mce-id","__mce");var c,a,l,f=(c=u,a=Ee.fromTag("div"),l=Ee.fromDom(c.dom().cloneNode(!0)),Nt(a,l),a.dom().innerHTML);return r.insertContent(f),nn(Uu(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return ac(r)&&Be(e,"width",We(e,"width")),Ce(e,"data-mce-id"),t=r,B(Jt(e,"tr"),function(e){lc(t,e.dom()),B(Jt(e,"th,td"),function(e){fc(t,e.dom())})}),n=r,nn(e,"td,th").each(b($c,n)),e.dom()}).getOr(null)},Qc=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols"},{type:"input",name:"rows",label:"Rows"}]:[],o=t.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing"},{type:"input",name:"cellpadding",label:"Cell padding"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e?[{type:"selectbox",name:"class",label:"Class",items:Tc(cc(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},Zc=function(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)R(n)?e.setStyle(t,n,r):e.setStyle(t,n);else if(t.children)for(var o=0;o<t.children.length;o++)Zc(e,t.children[o],n,r)},ea=function(n,r,e){var o,i=n.dom,u=e.getData();e.close(),""===u["class"]&&delete u["class"],n.undoManager.transact(function(){if(!r){var e=parseInt(u.cols,10)||1,t=parseInt(u.rows,10)||1;r=Jc(n,e,t)}!function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=Yu(n.height),o.getAttrib(t,"width")&&!uc(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Yu(n.width),uc(e)?(u["border-width"]=Yu(n.border),u["border-spacing"]=Yu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),uc(e)&&t.children)for(var c=0;c<t.children.length;c++)Zc(o,t.children[c],{"border-width":Yu(n.border),padding:Yu(n.cellpadding)}),ic(e)&&Zc(o,t.children[c],{"border-color":n.bordercolor});ic(e)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(Gc(tc(e),u)),o.setAttribs(t,Gc(ec(e),i))}(n,r,u),(o=i.select("caption",r)[0])&&!u.caption&&i.remove(o),!o&&u.caption&&((o=i.create("caption")).innerHTML=Yc.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===u.align?bc(n,r):hc(n,r,u.align),n.focus(),n.addVisual()})},ta=function(e,t){var n,r=e.dom,o=Ic(e,ic(e));!1===t?(n=r.getParent(e.selection.getStart(),"table"))?o=Ac(e,n,ic(e)):ic(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",ic(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=0<cc(e).length;i&&o["class"]&&(o["class"]=o["class"].replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:Qc(e,i,t)},c=ic(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Dc()]}:{type:"panel",items:[u]};e.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:b(ea,e,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},na=function(t){return function(e){return x.from(e.dom.getParent(e.selection.getStart(),t)).map(Ee.fromDom)}},ra=na("th,td"),oa=na("th,td,caption"),ia=pc.each,ua={registerCommands:function(c,t,a,l,n){var r=Gu(c),f=function(e){return dn.table(e,r)},s=function(e){return{width:qu(e.dom()),height:qu(e.dom())}},o=function(n){ra(c).each(function(t){f(t).each(function(i){var e=Br.forMenu(l,i,t),u=s(i);n(i,e).each(function(e){var t,n,r,o;t=c,n=u,o=s(r=i),n.width===o.width&&n.height===o.height||(sc(t,r.dom(),n.width,n.height),dc(t,r.dom(),o.width,o.height)),c.selection.setRng(e),c.focus(),a.clear(i),Ku(i)})})})},i=function(e){return ra(c).map(function(o){return f(o).bind(function(e){var t=Ee.fromDom(c.getDoc()),n=Br.forMenu(l,e,o),r=Ln(y,t,x.none());return gc(e,n,r)})})},u=function(u){n.get().each(function(e){var i=P(e,function(e){return kn(e)});ra(c).each(function(o){f(o).each(function(t){var e=Ee.fromDom(c.getDoc()),n=jn(e),r=Br.pasteRows(l,t,o,i,n);u(t,r).each(function(e){c.selection.setRng(e),c.focus(),a.clear(t)})})})})};ia({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){i().each(function(e){n.set(e),o(t.deleteRow)})},mceTableCopyRow:function(e){i().each(function(e){n.set(e)})},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){oa(c).each(function(e){dn.table(e,r).filter(d(r)).each(function(e){var t=Ee.fromText("");if(At(e,t),Mt(e),c.dom.isEmpty(c.getBody()))c.setContent(""),c.selection.setCursorLocation();else{var n=c.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),c.selection.setRng(n),c.nodeChanged()}})})}},function(e,t){c.addCommand(t,e)}),ia({mceInsertTable:b(ta,c,!0),mceTableProps:b(ta,c,!1),mceTableRowProps:b(qc,c),mceTableCellProps:b(zc,c)},function(e,t){c.addCommand(t,function(){e()})})}},ca=function(e){var t=x.from(e.dom().documentElement).map(Ee.fromDom).getOr(e);return{parent:S(t),view:S(e),origin:S(oo(0,0))}},aa=function(e,t){return{parent:S(t),view:S(e),origin:S(oo(0,0))}},la=function(e){var r=Z.apply(null,e),o=[];return{bind:function(e){if(e===undefined)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(t){o=M(o,function(e){return e!==t})},trigger:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(null,e);B(o,function(e){e(n)})}}},fa={create:function(e){return{registry:X(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:X(e,function(e){return e.trigger})}}},sa=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,c,a=Ee.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=C(f,l),d=(t=a,n=e.clientX,r=e.clientY,o=l,i=f,u=s,c=e,{target:S(t),x:S(n),y:S(r),stop:o,prevent:i,kill:u,raw:S(c)});g(d)}}},da=function(e,t,n,r){return o=e,i=t,u=!1,c=sa(n,r),o.dom().addEventListener(i,c,u),{unbind:b(ma,o,i,c,u)};var o,i,u,c},ma=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},ga=S(!0),pa=function(e,t,n){return da(e,t,ga,n)},ha={resolve:Fo("ephox-dragster").resolve},va=hu(["compare","extract","mutate","sink"]),ba=hu(["element","start","stop","destroy"]),wa=hu(["forceDrop","drop","move","delayDrop"]),ya=va({compare:function(e,t){return oo(t.left()-e.left(),t.top()-e.top())},extract:function(e){return x.some(oo(e.x(),e.y()))},sink:function(e,t){var n=(c=t,a=Gc({layerClass:ha.resolve("blocker")},c),l=Ee.fromTag("div"),ve(l,"role","presentation"),Me(l,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bo(l,ha.resolve("blocker")),Bo(l,a.layerClass),{element:function(){return l},destroy:function(){Mt(l)}}),r=pa(n.element(),"mousedown",e.forceDrop),o=pa(n.element(),"mouseup",e.drop),i=pa(n.element(),"mousemove",e.move),u=pa(n.element(),"mouseout",e.delayDrop);var c,a,l;return ba({element:n.element,start:function(e){Nt(e,n.element())},stop:function(){Mt(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function Ca(){var i=x.none(),u=fa.create({move:la(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=x.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=x.none()},events:u.registry}}function Sa(){var e=function r(){return{onEvent:y,reset:y}}(),t=Ca(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var xa=function(t,n,e){var r,o,i,u=!1,c=fa.create({start:la([]),stop:la([])}),a=Sa(),l=function(){d.stop(),a.isOn()&&(a.off(),c.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){r.apply(null,e),i=null},o)}});a.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&n.apply(null,e)}},d=n.sink(wa({forceDrop:l,drop:s(l),move:s(function(e){f.cancel(),a.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),a.on(),c.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:c.registry}},Ra=function(e,t){void 0===t&&(t={});var n=t.mode!==undefined?t.mode:ya;return xa(e,n,t)},Ta=function(){var n,r=fa.create({drag:la(["xDelta","yDelta","target"])}),o=x.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=fa.create({drag:la(["xDelta","yDelta"])})).registry};e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})});return{assign:function(e){o=x.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}},Oa=function(e){return"true"===we(e,"contenteditable")},Da=Uo.resolve("resizer-bar-dragging"),Aa=function(o,t,i){var n=Ta(),r=Ra(n,{}),u=x.none(),e=function(e,t){return x.from(we(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Ki.getInt(n.target(),"top");Be(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Ki.getInt(n.target(),"left");Be(n.target(),"left",t+n.xDelta()+"px")})});var c=function(e,t){return Ki.getInt(e,t)-parseInt(we(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=c(r,"top");Ce(r,"data-initial-top"),m.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=c(r,"left");Ce(r,"data-initial-left"),m.trigger.adjustWidth(n,t,parseInt(e,10))}),Zo(o,n,i,t)})})});var a=function(e,t){m.trigger.startAdjust(),n.assign(e),ve(e,"data-initial-"+t,parseInt(We(e,t),10)),Bo(e,Da),Be(e,"opacity","0.2"),r.go(o.parent())},l=pa(o.parent(),"mousedown",function(e){ri(e.target())&&a(e.target(),"top"),oi(e.target())&&a(e.target(),"left")}),f=function(e){return vt(e,o.view())},s=function(e){return rn(e,"table",f).filter(function(e){return(t=e,n=f,rn(t,"[contenteditable]",n)).exists(Oa);var t,n})},d=pa(o.view(),"mouseover",function(e){s(e.target()).fold(function(){Ne(e.target())&&ni(o)},function(e){u=x.some(e),Zo(o,e,i,t)})}),m=fa.create({adjustHeight:la(["table","delta","row"]),adjustWidth:la(["table","delta","column"]),startAdjust:la([])});return{destroy:function(){l.unbind(),d.unbind(),r.destroy(),ni(o)},refresh:function(e){Zo(o,e,i,t)},on:r.on,off:r.off,hideBars:b(ei,o),showBars:b(ti,o),events:m.registry}};var Ea=function(e,t){return e.inline?aa(Uu(e),(n=Ee.fromTag("div"),Me(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Nt(Ie(),n),n)):ca(Ee.fromDom(e.getDoc()));var n},Na=function(e,t){e.inline&&Mt(t.parent())},Ia=function(e,t){return qu(e.dom())/qu(t.dom())*100+"%"},ka=function(u){var c,a,o=x.none(),l=x.none(),f=x.none(),s=/(\d+(\.\d+)?)%/,d=function(e){return"TABLE"===e.nodeName},m=function(e){var t=u.dom.getStyle(e,"width")||u.dom.getAttrib(e,"width");return x.from(t).filter(function(e){return 0<e.length})},e=function(){return l};return u.on("init",function(){var e,t=Co(Ju.directionAt),n=Ea(u);if(f=x.some(n),e=u.getParam("object_resizing",!0),(R(e)?"table"===e:e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=function i(e,n){var r=wo.height,t=Aa(e,n,r),o=fa.create({beforeResize:la(["table"]),afterResize:la(["table"]),startDrag:la([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());du(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());su(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}(n,t);r.on(),r.events.startDrag.bind(function(e){o=x.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();sc(u,t,qu(t),Vu(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();Ku(t),o.each(function(e){u.selection.setRng(e),u.focus()}),dc(u,n,qu(n),Vu(n)),u.undoManager.add()}),l=x.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n,r,o=e.target;if(d(o)){var i=m(o).map(function(e){return s.test(e)}).getOr(!1);i&&ac(u)?(r=o,Be(Ee.fromDom(r),"width",qu(r).toString()+"px")):i||!0!==u.getParam("table_responsive_width")||(t=o,n=Ee.fromDom(t),Ct(n).map(function(e){return Ia(n,e)}).each(function(e){Be(n,"width",e),B(Jt(n,"tr"),function(t){B(Tt(t),function(e){Be(e,"width",Ia(e,t))})})})),c=e.width,a=m(o).getOr("")}}),u.on("ObjectResized",function(e){var t=e.target;if(d(t)){var n=t;if(s.test(a)){var r=parseFloat(s.exec(a)[1]),o=e.width*r/c;u.dom.setStyle(n,"width",o+"%")}else{var i=[];pc.each(n.rows,function(e){pc.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),pc.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),u.on("SwitchMode",function(){e().each(function(e){u.readonly?e.hideBars():e.showBars()})}),{lazyResize:e,lazyWire:function(){return f.getOr(ca(Ee.fromDom(u.getBody())))},destroy:function(){l.each(function(e){e.destroy()}),f.each(function(e){Na(u,e)})}}},Pa=Tr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Ba=Ro({},Pa,{none:function(e){return void 0===e&&(e=undefined),Pa.none(e)}}),Ma=function(n,e){return dn.table(n,e).bind(function(e){var t=dn.cells(e);return j(t,function(e){return vt(n,e)}).map(function(e){return{index:S(e),all:S(t)}})})},Wa=function(t,e){return Ma(t,e).fold(function(){return Ba.none(t)},function(e){return e.index()+1<e.all().length?Ba.middle(t,e.all()[e.index()+1]):Ba.last(t)})},_a=function(t,e){return Ma(t,e).fold(function(){return Ba.none()},function(e){return 0<=e.index()-1?Ba.middle(t,e.all()[e.index()-1]):Ba.first(t)})},La={create:Z("start","soffset","finish","foffset")},ja=Tr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),za={before:ja.before,on:ja.on,after:ja.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},Ha=Tr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Fa={domRange:Ha.domRange,relative:Ha.relative,exact:Ha.exact,exactFromRange:function(e){return Ha.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t,n=e.match({domRange:function(e){return Ee.fromDom(e.startContainer)},relative:function(e,t){return za.getStart(e)},exact:function(e,t,n,r){return e}});return t=n,Ee.fromDom(t.dom().ownerDocument.defaultView)},range:La.create},Ua=function(e,t){e.selectNodeContents(t.dom())},qa=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},Va=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},Ga=function(e){return{left:S(e.left),top:S(e.top),right:S(e.right),bottom:S(e.bottom),width:S(e.width),height:S(e.height)}},Ya=Tr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ka=function(e,t,n){return t(Ee.fromDom(n.startContainer),n.startOffset,Ee.fromDom(n.endContainer),n.endOffset)},Xa=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:S(e),rtl:x.none}},relative:function(e,t){return{ltr:De(function(){return qa(o,e,t)}),rtl:De(function(){return x.some(qa(o,t,e))})}},exact:function(e,t,n,r){return{ltr:De(function(){return Va(o,e,t,n,r)}),rtl:De(function(){return x.some(Va(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Ya.rtl(Ee.fromDom(e.endContainer),e.endOffset,Ee.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Ka(0,Ya.ltr,r)}):Ka(0,Ya.ltr,r)},$a=function(i,e){return Xa(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},Ja=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Qa=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=Cn(r).length,c=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var c=e(u),a=Math.abs(t-c.left);if(n<=c.bottom){if(n<c.top||i<a)return u-1;i=a}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(c)},Za=function(e,t,n,r){return pe(t)?function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return Oo(i,function(e){return Ja(e,r,o)?x.some(e):x.none()}).map(function(e){return Qa(t,n,r,o,e)})}(e,t,n,r):(i=t,u=n,c=r,a=(o=e).dom().createRange(),l=Tt(i),Oo(l,function(e){return a.selectNode(e.dom()),Ja(a.getBoundingClientRect(),u,c)?Za(o,e,u,c):x.none()}));var o,i,u,c,a,l},el=function(e,t){return t-e.left<e.right-t},tl=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},nl=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=el(o,n);return(!0===i?Dn:An)(e).map(function(e){return tl(t,e,i)})},rl=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=el(r,n);return x.some(tl(e,t,o))},ol=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),c=Math.max(i.top,Math.min(i.bottom,r));return Za(e,t,u,c)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},il=document.caretPositionFromPoint?function(n,e,t){return x.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return x.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),x.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return x.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return Ee.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===Tt(t=r).length?rl:nl)(e,t,n);var e,t,n};return 0===Tt(r).length?e():ol(o,r,i,t).orThunk(e)})},ul=function(e,t){var n=fe(e);return"input"===n?za.after(e):I(["br","img"],n)?0===t?za.before(e):za.after(e):za.on(e,t)},cl=function(e,t){var n=e.fold(za.before,ul,za.after),r=t.fold(za.before,ul,za.after);return Fa.relative(n,r)},al=function(e,t,n,r){var o=ul(e,t),i=ul(n,r);return Fa.relative(o,i)},ll=function(e,t,n,r){var o,i,u,c,a,l=(i=t,u=n,c=r,(a=yt(o=e).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=vt(e,n)&&t===r;return l.collapsed&&!f},fl=function(e,t){x.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},sl=function(e,t,n,r,o){var i=Va(e,t,n,r,o);fl(e,i)},dl=function(s,e){return Xa(s,e).match({ltr:function(e,t,n,r){sl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,c,a,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,c=n,a=r,(o=l).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){sl(s,n,r,e,t)}else sl(s,n,r,e,t)}})},ml=function(e){var o=Fa.getWin(e).dom(),t=function(e,t,n,r){return Va(o,e,t,n,r)},n=e.match({domRange:function(e){var t=Ee.fromDom(e.startContainer),n=Ee.fromDom(e.endContainer);return al(t,e.startOffset,n,e.endOffset)},relative:cl,exact:al});return Xa(o,n).match({ltr:t,rtl:t})},gl=function(e){var t=Ee.fromDom(e.anchorNode),n=Ee.fromDom(e.focusNode);return ll(t,e.anchorOffset,n,e.focusOffset)?x.some(La.create(t,e.anchorOffset,n,e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return x.some(La.create(Ee.fromDom(t.startContainer),t.startOffset,Ee.fromDom(n.endContainer),n.endOffset))}return x.none()}(e)},pl=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),Ua(r,n),r);fl(e,o)},hl=function(e){return(t=e,x.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(gl)).map(function(e){return Fa.exact(e.start(),e.soffset(),e.finish(),e.foffset())});var t},vl=function(e,t){var n,r,o,i=$a(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?x.some(o).map(Ga):x.none()},bl=function(e,t,n){return r=e,o=t,i=n,u=Ee.fromDom(r.document),il(u,o,i).map(function(e){return La.create(Ee.fromDom(e.startContainer),e.startOffset,Ee.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},wl=tinymce.util.Tools.resolve("tinymce.util.VK"),yl=function(e,t,n,r){return Rl(e,t,Wa(n),r)},Cl=function(e,t,n,r){return Rl(e,t,_a(n),r)},Sl=function(e,t){var n=Fa.exact(t,0,t,0);return ml(n)},xl=function(e,t){var n,r=Jt(t,"tr");return(n=r,0===n.length?x.none():x.some(n[n.length-1])).bind(function(e){return nn(e,"td,th").map(function(e){return Sl(0,e)})})},Rl=function(r,e,t,o,n){return t.fold(x.none,x.none,function(e,t){return Dn(t).map(function(e){return Sl(0,e)})},function(n){return dn.table(n,e).bind(function(e){var t=Br.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),xl(0,e)})})},Tl=["table","li","dl"],Ol={handle:function(t,n,r,o){if(t.keyCode===wl.TAB){var i=Uu(n),u=function(e){var t=fe(e);return vt(e,i)||I(Tl,t)},e=n.selection.getRng();if(e.collapsed){var c=Ee.fromDom(e.startContainer);dn.cell(c,u).each(function(e){t.preventDefault(),(t.shiftKey?Cl:yl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}}},Dl={create:Z("selection","kill")},Al=function(e,t,n,r){return{start:S(za.on(e,t)),finish:S(za.on(n,r))}},El={convertToRange:function(e,t){var n=$a(e,t);return La.create(Ee.fromDom(n.startContainer),n.startOffset,Ee.fromDom(n.endContainer),n.endOffset)},makeSitus:Al},Nl=function(n,e,r,t,o){return vt(r,t)?x.none():pr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),x.some(Dl.create(x.some(El.makeSitus(r,0,r,Rn(r))),!0))):x.none()})},Il={sync:function(n,r,e,t,o,i,u){return vt(e,o)&&t===i?x.none():rn(e,"td,th",r).bind(function(t){return rn(o,"td,th",r).bind(function(e){return Nl(n,r,t,e,u)})})},detect:Nl,update:function(e,t,n,r,o){return vr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},kl=Z("item","mode"),Pl=function(e,t,n,r){return void 0===r&&(r=Bl),e.property().parent(t).map(function(e){return kl(e,r)})},Bl=function(e,t,n,r){return void 0===r&&(r=Ml),n.sibling(e,t).map(function(e){return kl(e,r)})},Ml=function(e,t,n,r){void 0===r&&(r=Ml);var o=e.property().children(t);return n.first(o).map(function(e){return kl(e,r)})},Wl=[{current:Pl,next:Bl,fallback:x.none()},{current:Bl,next:Ml,fallback:x.some(Pl)},{current:Ml,next:Ml,fallback:x.some(Bl)}],_l=function(t,n,r,o,e){return void 0===e&&(e=Wl),L(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return _l(t,n,e,o)})})})},Ll=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?x.some(e[e.length-1]):x.none()}}},jl=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?x.some(e[0]):x.none()}}},zl=function(t,e,n,r,o,i){return _l(t,e,r,o).bind(function(e){return i(e.item())?x.none():n(e.item())?x.some(e.item()):zl(t,e.item(),n,e.mode(),o,i)})},Hl=function(t){return function(e){return 0===t.property().children(e).length}},Fl=function(e,t,n,r){return zl(e,t,n,Bl,Ll(),r)},Ul=function(e,t,n,r){return zl(e,t,n,Bl,jl(),r)},ql=tr(),Vl=function(e,t){return r=t,Fl(n=ql,e,Hl(n),r);var n,r},Gl=function(e,t){return r=t,Ul(n=ql,e,Hl(n),r);var n,r},Yl=Z("element","offset"),Kl=(Z("element","deltaOffset"),Z("element","start","finish"),Z("begin","end"),Z("element","text"),Tr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),Xl=function(e){return rn(e,"tr")},$l=Ro({},Kl,{verify:function(c,e,t,n,r,a,o){return rn(n,"td,th",o).bind(function(u){return rn(e,"td,th",o).map(function(i){return vt(u,i)?vt(n,u)&&Rn(u)===r?a(i):Kl.none("in same cell"):sr.sharedOne(Xl,[u,i]).fold(function(){return t=i,n=u,r=(e=c).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Kl.success():a(i);var e,t,n,r,o},function(e){return a(i)})})}).getOr(Kl.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),Jl=(Z("ancestor","descendants","element","index"),Z("parent","children","element","index")),Ql=function(e,t){return j(e,b(vt,t))},Zl=function(e){return"br"===fe(e)},ef=function(e,t,n){return t(e,n).bind(function(e){return pe(e)&&0===Cn(e).trim().length?ef(e,t,n):x.some(e)})},tf=function(t,e,n,r){return(o=e,i=n,Ot(o,i).filter(Zl).orThunk(function(){return Ot(o,i-1).filter(Zl)})).bind(function(e){return r.traverse(e).fold(function(){return ef(e,r.gather,t).map(r.relative)},function(e){return(r=e,Ct(r).bind(function(t){var n=Tt(t);return Ql(n,r).map(function(e){return Jl(t,n,r,e)})})).map(function(e){return za.on(e.parent(),e.index())});var r})});var o,i},nf=function(e,t,n,r){var o,i,u;return(Zl(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return ef(i,u.gather,o)}).map(u.relative)):tf(e,t,n,r)).map(function(e){return{start:S(e),finish:S(e)}})},rf=function(e){return $l.cata(e,function(e){return x.none()},function(){return x.none()},function(e){return x.some(Yl(e,0))},function(e){return x.some(Yl(e,Rn(e)))})},of=ie(["left","top","right","bottom"],[]),uf={nu:of,moveUp:function(e,t){return of({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return of({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return of({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return of({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return of({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},cf=function(e){return uf.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},af=function(e,t){return x.some(e.getRect(t))},lf=function(e,t,n){return ge(t)?af(e,t).map(cf):pe(t)?(r=e,o=t,i=n,0<=i&&i<Rn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):x.none()).map(cf):x.none();var r,o,i},ff=function(e,t){return ge(t)?af(e,t).map(cf):pe(t)?e.getRangedRect(t,0,t,Rn(t)).map(cf):x.none()},sf=Tr([{none:[]},{retry:["caret"]}]),df=function(t,e,r){return(n=e,o=Eu,Qt(function(e,t){return t(e)},Zt,n,o,i)).fold(S(!1),function(e){return ff(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},mf={point:uf.getTop,adjuster:function(e,t,n,r,o){var i=uf.moveUp(o,5);return Math.abs(n.top()-r.top())<1?sf.retry(i):n.bottom()<o.top()?sf.retry(i):n.bottom()===o.top()?sf.retry(uf.moveUp(o,1)):df(e,t,o)?sf.retry(uf.translate(i,5,0)):sf.none()},move:uf.moveUp,gather:Vl},gf={point:uf.getBottom,adjuster:function(e,t,n,r,o){var i=uf.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?sf.retry(i):n.top()>o.bottom()?sf.retry(i):n.top()===o.bottom()?sf.retry(uf.moveDown(o,1)):df(e,t,o)?sf.retry(uf.translate(i,5,0)):sf.none()},move:uf.moveDown,gather:Gl},pf=function(n,r,o,i,u){return 0===u?x.some(i):(a=n,l=i.left(),f=r.point(i),a.elementFromPoint(l,f).filter(function(e){return"table"===fe(e)}).isSome()?(t=i,c=u-1,pf(n,e=r,o,e.move(t,5),c)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(x.none,function(t){return ff(n,t).bind(function(e){return r.adjuster(n,t,e,o,i).fold(x.none,function(e){return pf(n,r,o,e,u-1)})}).orThunk(function(){return x.some(i)})},x.none)}));var e,t,c,a,l,f},hf=function(t,n,e){var r,o,i,u=t.move(e,5),c=pf(n,t,e,u,100).getOr(u);return(r=t,o=c,i=n,r.point(o)>i.getInnerHeight()?x.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?x.some(-r.point(o)):x.none()).fold(function(){return n.situsFromPoint(c.left(),t.point(c))},function(e){return n.scrollBy(0,e),n.situsFromPoint(c.left(),t.point(c)-e)})},vf={tryUp:b(hf,mf),tryDown:b(hf,gf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:S(5)},bf=dt.detect(),wf=function(r,o,i,u,c,a){return 0===a?x.none():Sf(r,o,i,u,c).bind(function(e){var t=r.fromSitus(e),n=$l.verify(r,i,u,t.finish(),t.foffset(),c.failure,o);return $l.cata(n,function(){return x.none()},function(){return x.some(e)},function(e){return vt(i,e)&&0===u?yf(r,i,u,uf.moveUp,c):wf(r,o,e,0,c,a-1)},function(e){return vt(i,e)&&u===Rn(e)?yf(r,i,u,uf.moveDown,c):wf(r,o,e,Rn(e),c,a-1)})})},yf=function(t,e,n,r,o){return lf(t,e,n).bind(function(e){return Cf(t,o,r(e,vf.getJumpSize()))})},Cf=function(e,t,n){return bf.browser.isChrome()||bf.browser.isSafari()||bf.browser.isFirefox()||bf.browser.isEdge()?t.otherRetry(e,n):bf.browser.isIE()?t.ieRetry(e,n):x.none()},Sf=function(t,e,n,r,o){return lf(t,n,r).bind(function(e){return Cf(t,o,e)})},xf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return nf(i,r.finish(),r.foffset(),u).fold(function(){return x.some(Yl(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=$l.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return rf(n)})})).bind(function(e){return wf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},Rf=dt.detect(),Tf=function(e,t){return Zt(e,function(e){return Ct(e).exists(function(e){return vt(e,t)})},n).isSome();var n},Of=function(t,r,o,e,i){return rn(e,"td,th",r).bind(function(n){return rn(n,"table",r).bind(function(e){return Tf(i,e)?xf(t,r,o).bind(function(t){return rn(t.finish(),"td,th",r).map(function(e){return{start:S(n),finish:S(e),range:S(t)}})}):x.none()})})},Df=function(e,t,n,r,o,i){return Rf.browser.isIE()?x.none():i(r,t).orThunk(function(){return Of(e,t,n,r,o).map(function(e){var t=e.range();return Dl.create(x.some(El.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Af=function(e,t,n,r,o,i,u){return Of(e,n,r,o,i).bind(function(e){return Il.detect(t,n,e.start(),e.finish(),u)})},Ef=function(e,u){return rn(e,"tr",u).bind(function(i){return rn(i,"table",u).bind(function(e){var t,n,r,o=Jt(e,"tr");return vt(i,o[0])?(t=e,n=function(e){return An(e).isSome()},r=u,Fl(ql,t,n,r)).map(function(e){var t=Rn(e);return Dl.create(x.some(El.makeSitus(e,t,e,t)),!0)}):x.none()})})},Nf=function(e,u){return rn(e,"tr",u).bind(function(i){return rn(i,"table",u).bind(function(e){var t,n,r,o=Jt(e,"tr");return vt(i,o[o.length-1])?(t=e,n=function(e){return Dn(e).isSome()},r=u,Ul(ql,t,n,r)).map(function(e){return Dl.create(x.some(El.makeSitus(e,0,e,0)),!0)}):x.none()})})},If=function(e,t){return rn(e,"td,th",t)};var kf={down:{traverse:Rt,gather:Gl,relative:za.before,otherRetry:vf.tryDown,ieRetry:vf.ieTryDown,failure:$l.failedDown},up:{traverse:xt,gather:Vl,relative:za.before,otherRetry:vf.tryUp,ieRetry:vf.ieTryUp,failure:$l.failedUp}},Pf=function(t){return function(e){return e===t}},Bf=Pf(38),Mf=Pf(40),Wf={ltr:{isBackward:Pf(37),isForward:Pf(39)},rtl:{isBackward:Pf(39),isForward:Pf(37)},isUp:Bf,isDown:Mf,isNavigation:function(e){return 37<=e&&e<=40}},_f=(dt.detect().browser.isSafari(),function(c){return{elementFromPoint:function(e,t){return Ee.fromPoint(Ee.fromDom(c.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Fa.exact(e,t,n,r);return vl(c,o).map(function(e){return X(e,u)})},getSelection:function(){return hl(c).map(function(e){return El.convertToRange(c,e)})},fromSitus:function(e){var t=Fa.relative(e.start(),e.finish());return El.convertToRange(c,t)},situsFromPoint:function(e,t){return bl(c,e,t).map(function(e){return Al(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){c.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=c,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=al(n,r,o,i),dl(t,u)},setRelativeSelection:function(e,t){var n,r;n=c,r=cl(e,t),dl(n,r)},selectContents:function(e){pl(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){var e,t,n,r;return(e=Ee.fromDom(c.document),t=e!==undefined?e.dom():m.document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,oo(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=Ee.fromDom(c.document))!==undefined?o.dom():m.document).defaultView.scrollBy(n,r)}}}),Lf=Z("rows","cols"),jf={mouse:function(e,t,n,r){var o=function c(o,i,t,u){var n=x.none(),r=function(){n=x.none()};return{mousedown:function(e){u.clear(i),n=If(e.target(),t)},mouseover:function(e){n.each(function(r){u.clear(i),If(e.target(),t).each(function(n){pr(r,n,t).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!vt(r,n))&&(u.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(e){n.each(r)}}}(_f(e),t,n,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(e,l,f,s){var d=_f(e),m=function(){return s.clear(l),x.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw(),c=u.which,a=!0===u.shiftKey;return hr(l,s.selectedSelector()).fold(function(){return Wf.isDown(c)&&a?b(Af,d,l,f,kf.down,r,t,s.selectRange):Wf.isUp(c)&&a?b(Af,d,l,f,kf.up,r,t,s.selectRange):Wf.isDown(c)?b(Df,d,f,kf.down,r,t,Nf):Wf.isUp(c)?b(Df,d,f,kf.up,r,t,Ef):x.none},function(t){var e=function(e){return function(){return Oo(e,function(e){return Il.update(e.rows(),e.cols(),l,t,s)}).fold(function(){return br(l,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(e){var t=Wf.isDown(c)||i.isForward(c)?za.after:za.before;return d.setRelativeSelection(za.on(e.first(),0),t(e.table())),s.clear(l),Dl.create(x.none(),!0)})},function(e){return x.some(Dl.create(x.none(),!0))})}};return Wf.isDown(c)&&a?e([Lf(1,0)]):Wf.isUp(c)&&a?e([Lf(-1,0)]):i.isBackward(c)&&a?e([Lf(0,-1),Lf(-1,0)]):i.isForward(c)&&a?e([Lf(0,1),Lf(1,0)]):Wf.isNavigation(c)&&!1===a?m:x.none})()},keyup:function(n,r,o,i,u){return hr(l,s.selectedSelector()).fold(function(){var e=n.raw(),t=e.which;return 0==(!0===e.shiftKey)?x.none():Wf.isNavigation(t)?Il.sync(l,f,r,o,i,u,s.selectRange):x.none()},x.none)}}}},zf=function(t,e){B(e,function(e){!function(e,t){Io(e)?e.dom().classList.remove(t):Po(e,t);Mo(e)}(t,e)})},Hf={byClass:function(o){var t,n,i=(t=o.selected(),function(e){Bo(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){zf(e,n)}),u=function(e){var t=Jt(e,o.selectedSelector());B(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),B(t,i),Bo(n,o.firstSelected()),Bo(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){Ce(e,o.selected()),Ce(e,o.firstSelected()),Ce(e,o.lastSelected())},i=function(e){ve(e,o.selected(),"1")},u=function(e){var t=Jt(e,o.selectedSelector());B(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),B(t,i),ve(n,o.firstSelected(),"1"),ve(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},Ff=function(e){return!1===Wo(Ee.fromDom(e.target),"ephox-snooker-resizer-bar")};function Uf(p,h){var v=ie(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=x.none(),w=Hf.byAttr(Rr);p.on("init",function(e){var r=p.getWin(),o=Uu(p),t=Gu(p),n=jf.mouse(r,o,t,w),c=jf.keyboard(r,o,t,w),a=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=Fa.relative(e.start(),e.finish()),n=$a(r,t);p.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&Wf.isNavigation(t.raw().which)){var n=p.selection.getRng(),r=Ee.fromDom(n.startContainer),o=Ee.fromDom(n.endContainer);c.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){a(t,e)})}},u=function(e){var t=f(e);h().each(function(e){e.hideBars()});var n=p.selection.getRng(),r=Ee.fromDom(p.selection.getStart()),o=Ee.fromDom(n.startContainer),i=Ee.fromDom(n.endContainer),u=Ju.directionAt(r).isRtl()?Wf.rtl:Wf.ltr;c.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){a(t,e)}),h().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=Ee.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=C(r,n);return{target:S(t),x:S(l(e)?e.x:null),y:S(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:S(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&Ff(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!Ff(e)||n.mouseover(f(e))},g=function(e){s(e)&&Ff(e)&&n.mouseup(f(e))};p.on("mousedown",d),p.on("mouseover",m),p.on("mouseup",g),p.on("keyup",i),p.on("keydown",u),p.on("NodeChange",function(){var e=p.selection,t=Ee.fromDom(e.getStart()),n=Ee.fromDom(e.getEnd());sr.sharedOne(dn.table,[t,n]).fold(function(){w.clear(o)},y)}),b=x.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))});return{clear:w.clear,destroy:function(){b.each(function(e){})}}}var qf=function(t){return{get:function(){var e=Uu(t);return wr(e,Rr.selectedSelector()).fold(function(){return t.selection.getStart()===undefined?Dr.none():Dr.single(t.selection)},function(e){return Dr.multiple(e)})}}},Vf=function(e,n){var o=l(x.none()),i=l([]),t=function(){return oa(e).bind(function(t){return dn.table(t).map(function(e){return"caption"===fe(t)?Br.notCell(t):Br.forMenu(n,e,t)})})},r=function(){o.set(De(t)()),B(i.get(),function(e){return e()})},u=function(t,n){var r=function(){return o.get().fold(function(){t.setDisabled(!0)},function(e){t.setDisabled(n(e))})};return r(),i.set(i.get().concat([r])),function(){i.set(M(i.get(),function(e){return e!==r}))}};return e.on("NodeChange",r),{onSetupTable:function(e){return u(e,function(e){return!1})},onSetupCellOrRow:function(e){return u(e,function(e){return"caption"===fe(e.element())})},onSetupMergeable:function(e){return u(e,function(e){return e.mergable().isNone()})},onSetupUnmergeable:function(e){return u(e,function(e){return e.unmergable().isNone()})},resetTargets:r,targets:function(){return o.get()}}},Gf={addButtons:function(t,e){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable tableprops deletetable | cell row column")}});var n=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:n("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:n("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:n("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:n("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:n("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:n("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:n("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:n("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:n("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:n("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:n("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:n("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",onAction:n("mceTableCutRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",onAction:n("mceTableCopyRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",onAction:n("mceTablePasteRowBefore"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",onAction:n("mceTablePasteRowAfter"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:n("mceInsertTable"),icon:"table"})},addToolbars:function(t){var e=t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol");0<e.length&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}},Yf={addMenuItems:function(r,e){var t=function(e){return function(){return r.execCommand(e)}},n=function(e){var t=e.numRows,n=e.numColumns;r.undoManager.transact(function(){Jc(r,n,t)}),r.addVisual()},o={text:"Table properties",onSetup:e.onSetupTable,onAction:t("mceTableProps")},i={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:t("mceTableDelete")},u=[{type:"menuitem",text:"Insert row before",icon:"table-insert-row-above",onAction:t("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert row after",icon:"table-insert-row-after",onAction:t("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete row",icon:"table-delete-row",onAction:t("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Row properties",icon:"table-row-properties",onAction:t("mceTableRowProps"),onSetup:e.onSetupCellOrRow},{type:"separator"},{type:"menuitem",text:"Cut row",onAction:t("mceTableCutRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Copy row",onAction:t("mceTableCopyRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row before",onAction:t("mceTablePasteRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row after",onAction:t("mceTablePasteRowAfter"),onSetup:e.onSetupCellOrRow}],c={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return u}},a=[{type:"menuitem",text:"Insert column before",icon:"table-insert-column-before",onAction:t("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert column after",icon:"table-insert-column-after",onAction:t("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete column",icon:"table-delete-column",onAction:t("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}],l={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return a}},f=[{type:"menuitem",text:"Cell properties",icon:"table-cell-properties",onAction:t("mceTableCellProps"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Merge cells",icon:"table-merge-cells",onAction:t("mceTableMergeCells"),onSetup:e.onSetupMergeable},{type:"menuitem",text:"Split cell",icon:"table-split-cells",onAction:t("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}],s={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return f}};return!1===r.getParam("table_grid",!0,"boolean")?r.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:t("mceInsertTable")}):r.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:n}]}}),r.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:t("mceInsertTable")}),r.ui.registry.addMenuItem("tableprops",o),r.ui.registry.addMenuItem("deletetable",i),r.ui.registry.addNestedMenuItem("row",c),r.ui.registry.addNestedMenuItem("column",l),r.ui.registry.addNestedMenuItem("cell",s),r.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold(function(){return""},function(e){return"caption"===fe(e.element())?"tableprops deletetable":"cell row column | tableprops deletetable"})}}),{rowItems:u,columnItems:a,cellItems:f}}},Kf=function(n,r,e,t,o){return{insertTable:function(e,t){return Jc(n,e,t)},setClipboardRows:function(e){return t=r,n=P(e,Ee.fromDom),void t.set(x.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return P(e,function(e){return e.dom()})})},resizeHandler:e,menuItems:o,selectionTargets:t}};function Xf(t){var n=ka(t),e=Uf(t,n.lazyResize),r=mc(t,n.lazyWire),o=qf(t),i=Vf(t,o),u=l(x.none());ua.registerCommands(t,r,e,o,u),Mr.registerEvents(t,o,r,e);var c=Yf.addMenuItems(t,i);return Gf.addButtons(t,i),Gf.addToolbars(t),t.on("PreInit",function(){t.serializer.addTempAttr(Rr.firstSelected()),t.serializer.addTempAttr(Rr.lastSelected())}),nc(t)&&t.on("keydown",function(e){Ol.handle(e,t,r,n.lazyWire)}),t.on("remove",function(){n.destroy(),e.destroy()}),Kf(t,u,n,i,c)}!function Jf(){v.add("table",Xf)}()}(window);
9
+ !function(m){"use strict";var l=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return l(n())}}},y=function(){},C=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},S=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,d=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},f=S(!1),u=S(!0),c=f,a=u,s=function(){return g},g=(r={fold:function(e,t){return e()},is:c,isSome:c,isNone:a,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:s,ap:s,each:function(){},bind:s,flatten:s,exists:c,forall:a,filter:s,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:S("none()")},Object.freeze&&Object.freeze(r),r),p=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:a,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},ap:function(e){return e.fold(s,function(e){return p(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(c,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},x={some:p,none:s,from:function(e){return null===e||e===undefined?g:p(e)}},h=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},w=v("string"),R=v("array"),T=v("boolean"),O=v("function"),D=v("number"),A=Array.prototype.slice,E=(i=Array.prototype.indexOf)===undefined?function(e,t){return j(e,t)}:function(e,t){return i.call(e,t)},N=function(e,t){return-1<E(e,t)},I=function(e,t){return L(e,t).isSome()},k=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},P=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n,e)}},B=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},M=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},W=function(e,t,n){return P(e,function(e){n=t(n,e)}),n},_=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return x.some(o)}return x.none()},L=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n,e))return x.some(n)}return x.none()},j=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},z=Array.prototype.push,H=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!R(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);z.apply(t,e[n])}return t},F=function(e,t){var n=k(e,t);return H(n)},U=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n,e))return!1}return!0},q=function(e){var t=A.call(e,0);return t.reverse(),t},V=(O(Array.from)&&Array.from,Object.keys),G=Object.hasOwnProperty,Y=function(e,t){for(var n=V(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},K=function(e,r){return X(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},X=function(r,o){var i={};return Y(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},$=function(e,t){return J(e,t)?x.from(e[t]):x.none()},J=function(e,t){return G.call(e,t)},Q=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return P(t,function(e,t){r[e]=S(n[t])}),r}},Z=function(e){return e.slice(0).sort()},ee=function(e,t){throw new Error("All required keys ("+Z(e).join(", ")+") were not specified. Specified keys were: "+Z(t).join(", ")+".")},te=function(e){throw new Error("Unsupported keys for object: "+Z(e).join(", "))},ne=function(t,e){if(!R(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");P(e,function(e){if(!w(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},re=function(e){var n=Z(e);_(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},oe=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return ne("required",o),ne("optional",i),re(u),function(t){var n=V(t);U(o,function(e){return N(n,e)})||ee(o,n);var e=B(n,function(e){return!N(u,e)});0<e.length&&te(e);var r={};return P(o,function(e){r[e]=S(t[e])}),P(i,function(e){r[e]=S(Object.prototype.hasOwnProperty.call(t,e)?x.some(t[e]):x.none())}),r}},ie=(m.Node.ATTRIBUTE_NODE,m.Node.CDATA_SECTION_NODE,m.Node.COMMENT_NODE),ue=m.Node.DOCUMENT_NODE,ce=(m.Node.DOCUMENT_TYPE_NODE,m.Node.DOCUMENT_FRAGMENT_NODE,m.Node.ELEMENT_NODE),ae=m.Node.TEXT_NODE,le=(m.Node.PROCESSING_INSTRUCTION_NODE,m.Node.ENTITY_REFERENCE_NODE,m.Node.ENTITY_NODE,m.Node.NOTATION_NODE,"undefined"!=typeof m.window?m.window:Function("return this;")(),function(e){return e.dom().nodeName.toLowerCase()}),fe=function(e){return e.dom().nodeType},se=function(t){return function(e){return fe(e)===t}},de=function(e){return fe(e)===ie||"#comment"===le(e)},me=se(ce),ge=se(ae),pe=function(e,t,n){if(!(w(n)||T(n)||D(n)))throw m.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},he=function(e,t,n){pe(e.dom(),t,n)},ve=function(e,t){var n=e.dom();Y(t,function(e,t){pe(n,t,e)})},be=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},we=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},ye=function(e,t){e.dom().removeAttribute(t)},Ce=function(e){return W(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},Se=function(e,t,n){return""===t||!(e.length<t.length)&&e.substr(n,n+t.length)===t},xe=function(e,t){return-1!==e.indexOf(t)},Re=function(e,t){return Se(e,t,0)},Te=function(e){return e.style!==undefined&&O(e.style.getPropertyValue)},Oe=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},De=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:S(e)}},Ae={fromHtml:function(e,t){var n=(t||m.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw m.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return De(n.childNodes[0])},fromTag:function(e,t){var n=(t||m.document).createElement(e);return De(n)},fromText:function(e,t){var n=(t||m.document).createTextNode(e);return De(n)},fromDom:De,fromPoint:function(e,t,n){var r=e.dom();return x.from(r.elementFromPoint(t,n)).map(De)}},Ee=function(e){var t=ge(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},Ne=Oe(function(){return Ie(Ae.fromDom(m.document))}),Ie=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return Ae.fromDom(t)},ke=function(e,t,n){if(!w(n))throw m.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Te(e)&&e.style.setProperty(t,n)},Pe=function(e,t,n){var r=e.dom();ke(r,t,n)},Be=function(e,t){var n=e.dom();Y(t,function(e,t){ke(n,t,e)})},Me=function(e,t){var n=e.dom(),r=m.window.getComputedStyle(n).getPropertyValue(t),o=""!==r||Ee(e)?r:We(n,t);return null===o?undefined:o},We=function(e,t){return Te(e)?e.style.getPropertyValue(t):""},_e=function(e,t){var n=e.dom(),r=We(n,t);return x.from(r).filter(function(e){return 0<e.length})},Le=function(e,t){var n,r,o=e.dom();r=t,Te(n=o)&&n.style.removeProperty(r),we(e,"style")&&""===be(e,"style").replace(/^\s+|\s+$/g,"")&&ye(e,"style")},je=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},ze=function(e,t){return je(e,t,m.Node.DOCUMENT_POSITION_CONTAINED_BY)},He=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ue(r(1),r(2))},Fe=function(){return Ue(0,0)},Ue=function(e,t){return{major:e,minor:t}},qe={nu:Ue,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Fe():He(e,n)},unknown:Fe},Ve="Firefox",Ge=function(e,t){return function(){return t===e}},Ye=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ge("Edge",t),isChrome:Ge("Chrome",t),isIE:Ge("IE",t),isOpera:Ge("Opera",t),isFirefox:Ge(Ve,t),isSafari:Ge("Safari",t)}},Ke={unknown:function(){return Ye({current:undefined,version:qe.unknown()})},nu:Ye,edge:S("Edge"),chrome:S("Chrome"),ie:S("IE"),opera:S("Opera"),firefox:S(Ve),safari:S("Safari")},Xe="Windows",$e="Android",Je="Solaris",Qe="FreeBSD",Ze=function(e,t){return function(){return t===e}},et=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Ze(Xe,t),isiOS:Ze("iOS",t),isAndroid:Ze($e,t),isOSX:Ze("OSX",t),isLinux:Ze("Linux",t),isSolaris:Ze(Je,t),isFreeBSD:Ze(Qe,t)}},tt={unknown:function(){return et({current:undefined,version:qe.unknown()})},nu:et,windows:S(Xe),ios:S("iOS"),android:S($e),linux:S("Linux"),osx:S("OSX"),solaris:S(Je),freebsd:S(Qe)},nt=function(e,t){var n=String(t).toLowerCase();return _(e,function(e){return e.search(n)})},rt=function(e,n){return nt(e,n).map(function(e){var t=qe.detect(e.versionRegexes,n);return{current:e.name,version:t}})},ot=function(e,n){return nt(e,n).map(function(e){var t=qe.detect(e.versionRegexes,n);return{current:e.name,version:t}})},it=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ut=function(t){return function(e){return xe(e,t)}},ct=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return xe(e,"edge/")&&xe(e,"chrome")&&xe(e,"safari")&&xe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,it],search:function(e){return xe(e,"chrome")&&!xe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return xe(e,"msie")||xe(e,"trident")}},{name:"Opera",versionRegexes:[it,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ut("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ut("firefox")},{name:"Safari",versionRegexes:[it,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(xe(e,"safari")||xe(e,"mobile/"))&&xe(e,"applewebkit")}}],at=[{name:"Windows",search:ut("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return xe(e,"iphone")||xe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ut("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ut("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ut("linux"),versionRegexes:[]},{name:"Solaris",search:ut("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ut("freebsd"),versionRegexes:[]}],lt={browsers:S(ct),oses:S(at)},ft=function(e){var t,n,r,o,i,u,c,a,l,f,s,d=lt.browsers(),m=lt.oses(),g=rt(d,e).fold(Ke.unknown,Ke.nu),p=ot(m,e).fold(tt.unknown,tt.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,c=t.isAndroid()&&4===t.version.major,a=o||u||c&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!a,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:S(o),isiPhone:S(i),isTablet:S(a),isPhone:S(f),isTouch:S(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:S(s)})}},st={detect:Oe(function(){var e=m.navigator.userAgent;return ft(e)})},dt=ce,mt=ue,gt=function(e,t){var n=e.dom();if(n.nodeType!==dt)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},pt=function(e){return e.nodeType!==dt&&e.nodeType!==mt||0===e.childElementCount},ht=function(e,t){return e.dom()===t.dom()},vt=st.detect().browser.isIE()?function(e,t){return ze(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},bt=gt,wt=function(e){return Ae.fromDom(e.dom().ownerDocument)},yt=function(e){return x.from(e.dom().parentNode).map(Ae.fromDom)},Ct=function(e,t){for(var n=O(t)?t:f,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=Ae.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},St=function(e){return x.from(e.dom().previousSibling).map(Ae.fromDom)},xt=function(e){return x.from(e.dom().nextSibling).map(Ae.fromDom)},Rt=function(e){return k(e.dom().childNodes,Ae.fromDom)},Tt=function(e,t){var n=e.dom().childNodes;return x.from(n[t]).map(Ae.fromDom)},Ot=(Q("element","offset"),function(t,n){yt(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})}),Dt=function(e,t){xt(e).fold(function(){yt(e).each(function(e){Et(e,t)})},function(e){Ot(e,t)})},At=function(t,n){Tt(t,0).fold(function(){Et(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Et=function(e,t){e.dom().appendChild(t.dom())},Nt=function(e,t){Ot(e,t),Et(t,e)},It=function(r,o){P(o,function(e,t){var n=0===t?r:o[t-1];Dt(n,e)})},kt=function(t,e){P(e,function(e){Et(t,e)})},Pt=function(e){e.dom().textContent="",P(Rt(e),function(e){Bt(e)})},Bt=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Mt=function(e){var t,n=Rt(e);0<n.length&&(t=e,P(n,function(e){Ot(t,e)})),Bt(e)},Wt=(Q("width","height"),Q("width","height"),Q("rows","columns")),_t=Q("row","column"),Lt=(Q("x","y"),Q("element","rowspan","colspan")),jt=Q("element","rowspan","colspan","isNew"),zt=Q("element","rowspan","colspan","row","column"),Ht=Q("element","cells","section"),Ft=Q("element","isNew"),Ut=Q("element","cells","section","isNew"),qt=Q("cells","section"),Vt=Q("details","section"),Gt=Q("startRow","startCol","finishRow","finishCol"),Yt=function(e,t){var n=[];return P(Rt(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Yt(e,t))}),n},Kt=function(e,t,n){return r=function(e){return gt(e,t)},B(Ct(e,n),r);var r},Xt=function(e,t){return n=function(e){return gt(e,t)},B(Rt(e),n);var n},$t=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),pt(o)?[]:k(o.querySelectorAll(n),Ae.fromDom);var n,r,o};function Jt(e,t,n,r,o){return e(n,r)?x.some(n):O(o)&&o(n)?x.none():t(n,r,o)}var Qt=function(e,t,n){for(var r=e.dom(),o=O(n)?n:S(!1);r.parentNode;){r=r.parentNode;var i=Ae.fromDom(r);if(t(i))return x.some(i);if(o(i))break}return x.none()},Zt=function(e,t,n){return Qt(e,function(e){return gt(e,t)},n)},en=function(e,t){return n=function(e){return gt(e,t)},_(e.dom().childNodes,function(e){return n(Ae.fromDom(e))}).map(Ae.fromDom);var n},tn=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),pt(o)?x.none():x.from(o.querySelector(n)).map(Ae.fromDom);var n,r,o},nn=function(e,t,n){return Jt(gt,Zt,e,t,n)},rn=function(e,t,n){return F(Rt(e),function(e){return gt(e,t)?n(e)?[e]:[]:rn(e,t,n)})},on={firstLayer:function(e,t){return rn(e,t,S(!0))},filterFirstLayer:rn},un=function(e,t,n){if(void 0===n&&(n=f),n(t))return x.none();if(N(e,le(t)))return x.some(t);return Zt(t,e.join(","),function(e){return gt(e,"table")||n(e)})},cn=function(t,e){return yt(e).map(function(e){return Xt(e,t)})},an=b(cn,"th,td"),ln=b(cn,"tr"),fn=function(e,t){return parseInt(be(e,t),10)},sn={cell:function(e,t){return un(["td","th"],e,t)},firstCell:function(e){return tn(e,"th,td")},cells:function(e){return on.firstLayer(e,"th,td")},neighbourCells:an,table:function(e,t){return nn(e,"table",t)},row:function(e,t){return un(["tr"],e,t)},rows:function(e){return on.firstLayer(e,"tr")},notCell:function(e,t){return un(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:ln,attr:fn,grid:function(e,t,n){var r=fn(e,t),o=fn(e,n);return Wt(r,o)}},dn=function(e){var t=sn.rows(e);return k(t,function(e){var t=e,n=yt(t).map(function(e){var t=le(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=k(sn.cells(e),function(e){var t=we(e,"rowspan")?parseInt(be(e,"rowspan"),10):1,n=we(e,"colspan")?parseInt(be(e,"colspan"),10):1;return Lt(e,t,n)});return Ht(t,r,n)})},mn=function(e,n){return k(e,function(e){var t=k(sn.cells(e),function(e){var t=we(e,"rowspan")?parseInt(be(e,"rowspan"),10):1,n=we(e,"colspan")?parseInt(be(e,"colspan"),10):1;return Lt(e,t,n)});return Ht(e,t,n.section())})},gn=function(e,t){return e+","+t},pn=function(e,t){var n=F(e.all(),function(e){return e.cells()});return B(n,t)},hn={generate:function(e){var l={},t=[],n=e.length,f=0;P(e,function(e,c){var a=[];P(e.cells(),function(e){for(var t=0;l[gn(c,t)]!==undefined;)t++;for(var n=zt(e.element(),e.rowspan(),e.colspan(),c,t),r=0;r<e.colspan();r++)for(var o=0;o<e.rowspan();o++){var i=t+r,u=gn(c+o,i);l[u]=n,f=Math.max(f,i+1)}a.push(n)}),t.push(Ht(e.element(),a,e.section()))});var r=Wt(n,f);return{grid:S(r),access:S(l),all:S(t)}},getAt:function(e,t,n){var r=e.access()[gn(t,n)];return r!==undefined?x.some(r):x.none()},findItem:function(e,t,n){var r=pn(e,function(e){return n(t,e.element())});return 0<r.length?x.some(r[0]):x.none()},filterItems:pn,justCells:function(e){var t=k(e.all(),function(e){return e.cells()});return H(t)}},vn=Q("minRow","minCol","maxRow","maxCol"),bn=function(e,t){var n,i,r,u,c,a,l,o,f,s,d=function(e){return gt(e.element(),t)},m=dn(e),g=hn.generate(m),p=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),c=r,l=a=0,Y(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:a<n&&(a=n),r<c?c=r:l<o&&(l=o)}}),vn(u,c,a,l)),h="th:not("+t+"),td:not("+t+")",v=on.filterFirstLayer(e,"th,td",function(e){return gt(e,h)});return P(v,Bt),function(e,t,n,r){for(var o,i,u,c=t.grid().columns(),a=t.grid().rows(),l=0;l<a;l++)for(var f=!1,s=0;s<c;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(hn.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=Ae.fromTag("td"),Et(u,Ae.fromTag("br")),(o?Et:At)(i,u)):f=!0)}(m,g,p,d),o=e,f=p,s=B(on.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),P(s,Bt),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||P(on.firstLayer(o,"th,td"),function(e){ye(e,"rowspan"),ye(e,"colspan")}),ye(o,"width"),ye(o,"height"),Le(o,"width"),Le(o,"height"),e};var wn=function $f(n,r){var t=function(e){return n(e)?x.from(e.dom().nodeValue):x.none()};return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(ge,"text"),yn=function(e){return wn.get(e)},Cn=function(e){return wn.getOption(e)},Sn=function(e,t){wn.set(e,t)},xn=function(e){return"img"===le(e)?1:Cn(e).fold(function(){return Rt(e).length},function(e){return e.length})},Rn=["img","br"],Tn=function(e){return Cn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||N(Rn,le(e))},On=function(e){return o=Tn,(i=function(e){for(var t=0;t<e.childNodes.length;t++){var n=Ae.fromDom(e.childNodes[t]);if(o(n))return x.some(n);var r=i(e.childNodes[t]);if(r.isSome())return r}return x.none()})(e.dom());var o,i},Dn=function(e){return An(e,Tn)},An=function(e,i){var u=function(e){for(var t=Rt(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return x.some(r);var o=u(r);if(o.isSome())return o}return x.none()};return u(e)},En=function(e,t){return Ae.fromDom(e.dom().cloneNode(t))},Nn=function(e){return En(e,!1)},In=function(e){return En(e,!0)},kn=function(e,t){var n,r,o,i,u=(n=e,r=t,o=Ae.fromTag(r),i=Ce(n),ve(o,i),o),c=Rt(In(e));return kt(u,c),u},Pn=function(){var e=Ae.fromTag("td");return Et(e,Ae.fromTag("br")),e},Bn=function(e,t,n){var r=kn(e,t);return Y(n,function(e,t){null===e?ye(r,t):he(r,t,e)}),r},Mn=function(e){return e},Wn=function(e){return function(){return Ae.fromTag("tr",e.dom())}},_n=function(d,e,m){return{row:Wn(e),cell:function(e){var r,o,i,t,n,u,c,a=wt(e.element()),l=Ae.fromTag(le(e.element()),a.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,On(r).map(function(e){var t=i.join(","),n=Kt(e,t,function(e){return ht(e,r)});return M(n,function(e,t){var n=Nn(t);return ye(n,"contenteditable"),Et(e,n),n},o)}).getOr(o)):l;return Et(s,Ae.fromTag("br")),t=e.element(),n=l,u=t.dom(),c=n.dom(),Te(u)&&Te(c)&&(c.style.cssText=u.style.cssText),Le(l,"height"),1!==e.colspan()&&Le(e.element(),"width"),d(e.element(),l),l},replace:Bn,gap:Pn}},Ln=function(e){return{row:Wn(e),cell:Pn,replace:Mn,gap:Pn}},jn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},zn=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Hn=function(e,t){for(var n=!0,r=b(jn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&hn.getAt(e,o,i).exists(r);return n?x.some(t):x.none()},Fn=function(e,t,n){var r=hn.findItem(e,t,ht),o=hn.findItem(e,n,ht);return r.bind(function(r){return o.map(function(e){return t=r,n=e,Gt(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},Un=Fn,qn=function(t,e,n){return Fn(t,e,n).bind(function(e){return Hn(t,e)})},Vn=function(r,e,o,i){return hn.findItem(r,e,ht).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return hn.getAt(r,t+o,n+i).map(function(e){return e.element()})})},Gn=function(n,e,t){return Un(n,e,t).map(function(e){var t=hn.filterItems(n,b(zn,e));return k(t,function(e){return e.element()})})},Yn=function(e,t){return hn.findItem(e,t,function(e,t){return vt(t,e)}).map(function(e){return e.element()})},Kn=function(e){var t=dn(e);return hn.generate(t)},Xn=function(n,r,o){return sn.table(n).bind(function(e){var t=Kn(e);return Vn(t,n,r,o)})},$n=function(e,t,n){var r=Kn(e);return Gn(r,t,n)},Jn=function(e,t,n,r,o){var i=Kn(e),u=ht(e,n)?x.some(t):Yn(i,t),c=ht(e,o)?x.some(r):Yn(i,r);return u.bind(function(t){return c.bind(function(e){return Gn(i,t,e)})})},Qn=function(e,t,n){var r=Kn(e);return qn(r,t,n)},Zn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function er(){return{up:S({selector:Zt,closest:nn,predicate:Qt,all:Ct}),down:S({selector:$t,predicate:Yt}),styles:S({get:Me,getRaw:_e,set:Pe,remove:Le}),attrs:S({get:be,set:he,remove:ye,copyTo:function(e,t){var n=Ce(e);ve(t,n)}}),insert:S({before:Ot,after:Dt,afterAll:It,append:Et,appendAll:kt,prepend:At,wrap:Nt}),remove:S({unwrap:Mt,remove:Bt}),create:S({nu:Ae.fromTag,clone:function(e){return Ae.fromDom(e.dom().cloneNode(!1))},text:Ae.fromText}),query:S({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:St,nextSibling:xt}),property:S({children:Rt,name:le,parent:yt,document:function(e){return e.dom().ownerDocument},isText:ge,isComment:de,isElement:me,getText:yn,setText:Sn,isBoundary:function(e){return!!me(e)&&("body"===le(e)||N(Zn,le(e)))},isEmptyTag:function(e){return!!me(e)&&N(["br","img","hr","input"],le(e))}}),eq:ht,is:bt}}var tr=Q("left","right"),nr=Q("first","second","splits"),rr=function(e,t,n){var r=e.property().children(t);return L(r,b(e.eq,n)).map(function(e){return{before:S(r.slice(0,e)),after:S(r.slice(e+1))}})},or=function(r,o,e,t){var n=o(r,e);return M(t,function(e,t){var n=o(r,t);return ir(r,e,n)},n)},ir=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},ur=function(e,t){return b(e.eq,t)},cr=function(t,e,n,r){void 0===r&&(r=f);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return L(t,r).fold(function(){return t},function(e){return t.slice(0,e+1)})},c=u(o),a=u(i),l=_(c,function(e){return I(a,ur(t,e))});return{firstpath:S(c),secondpath:S(a),shared:S(l)}},ar={sharedOne:function(e,t,n){return 0<n.length?or(e,t,(r=n)[0],r.slice(1)):x.none();var r},subset:function(t,e,n){var r=cr(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return x.some([e[0]]);if(o.eq(i,t[0]))return x.some([t[0]]);var n=function(e){var t=q(e),n=L(t,ur(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return L(u,ur(o,r))},r=n(e),c=n(t);return r.bind(function(r){return c.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},ancestors:cr,breakToLeft:function(n,r,o){return rr(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),tr(t,r)})},breakToRight:function(n,r,e){return rr(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),tr(r,t)})},breakPath:function(i,e,u,c){var a=function(e,t,o){var n=nr(e,x.none(),o);return u(e)?nr(e,t,o):i.property().parent(e).bind(function(r){return c(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return a(n,x.some(e.right()),o.concat(t))})}).getOr(n)};return a(e,x.none(),[])}},lr=er(),fr={sharedOne:function(n,e){return ar.sharedOne(lr,function(e,t){return n(t)},e)},subset:function(e,t){return ar.subset(lr,e,t)},ancestors:function(e,t,n){return ar.ancestors(lr,e,t,n)},breakToLeft:function(e,t){return ar.breakToLeft(lr,e,t)},breakToRight:function(e,t){return ar.breakToRight(lr,e,t)},breakPath:function(e,t,r){return ar.breakPath(lr,e,t,function(e,t,n){return r(t,n)})}},sr={create:oe(["boxes","start","finish"],[])},dr=function(e){return Zt(e,"table")},mr=function(c,a,r){var l=function(t){return function(e){return r!==undefined&&r(e)||ht(e,t)}};return ht(c,a)?x.some(sr.create({boxes:x.some([c]),start:c,finish:a})):dr(c).bind(function(u){return dr(a).bind(function(i){if(ht(u,i))return x.some(sr.create({boxes:$n(u,c,a),start:c,finish:a}));if(vt(u,i)){var e=0<(t=Kt(a,"td,th",l(u))).length?t[t.length-1]:a;return x.some(sr.create({boxes:Jn(u,c,u,a,i),start:c,finish:e}))}if(vt(i,u)){var t,n=0<(t=Kt(c,"td,th",l(i))).length?t[t.length-1]:c;return x.some(sr.create({boxes:Jn(i,c,u,a,i),start:c,finish:n}))}return fr.ancestors(c,a).shared().bind(function(e){return nn(e,"table",r).bind(function(e){var t=Kt(a,"td,th",l(e)),n=0<t.length?t[t.length-1]:a,r=Kt(c,"td,th",l(e)),o=0<r.length?r[r.length-1]:c;return x.some(sr.create({boxes:Jn(e,c,u,a,i),start:o,finish:n}))})})})})},gr=mr,pr=function(e,t){var n=$t(e,t);return 0<n.length?x.some(n):x.none()},hr=function(e,t,n,r,o){return(i=e,u=o,_(i,function(e){return gt(e,u)})).bind(function(e){return Xn(e,t,n).bind(function(e){return n=r,Zt(t=e,"table").bind(function(e){return tn(e,n).bind(function(e){return mr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:S(e),start:S(t.start()),finish:S(t.finish())}})})})});var t,n})});var i,u},vr=function(e,t,r){return tn(e,t).bind(function(n){return tn(e,r).bind(function(t){return fr.sharedOne(dr,[n,t]).map(function(e){return{first:S(n),last:S(t),table:S(e)}})})})},br=function(e,t){return pr(e,t)},wr=function(o,e,t){return vr(o,e,t).bind(function(n){var e=function(e){return ht(o,e)},t=Zt(n.first(),"thead,tfoot,tbody,table",e),r=Zt(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return ht(t,e)?Qn(n.table(),n.first(),n.last()):x.none()})})})},yr="data-mce-selected",Cr="data-mce-first-selected",Sr="data-mce-last-selected",xr={selected:S(yr),selectedSelector:S("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:S("[data-mce-selected]"),firstSelected:S(Cr),firstSelectedSelector:S("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:S(Sr),lastSelectedSelector:S("td[data-mce-last-selected],th[data-mce-last-selected]")},Rr=function(u){if(!R(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],n={};return P(u,function(e,r){var t=V(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!R(i))throw new Error("case arguments must be an array");c.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=V(e);if(c.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+t.join(","));if(!U(c,function(e){return N(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,n)},log:function(e){m.console.log(e,{constructors:c,constructor:o,params:n})}}}}),n},Tr=Rr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Or={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Tr.none,multiple:Tr.multiple,single:Tr.single},Dr=function(e,t){return Or.cata(t.get(),S([]),o,S([e]))},Ar=function(n,e){return Or.cata(e.get(),x.none,function(t,e){return 0===t.length?x.none():wr(n,xr.firstSelectedSelector(),xr.lastSelectedSelector()).bind(function(e){return 1<t.length?x.some({bounds:S(e),cells:S(t)}):x.none()})},x.none)},Er=function(e,t){var n=Dr(e,t);return 0<n.length&&U(n,function(e){return we(e,"rowspan")&&1<parseInt(be(e,"rowspan"),10)||we(e,"colspan")&&1<parseInt(be(e,"colspan"),10)})?x.some(n):x.none()},Nr=Dr,Ir=function(e){return{element:S(e),mergable:x.none,unmergable:x.none,selection:S([e])}},kr=Q("element","clipboard","generators"),Pr={noMenu:Ir,forMenu:function(e,t,n){return{element:S(n),mergable:S(Ar(t,e)),unmergable:S(Er(n,e)),selection:S(Nr(n,e))}},notCell:function(e){return Ir(e)},paste:kr,pasteRows:function(e,t,n,r,o){return{element:S(n),mergable:x.none,unmergable:x.none,selection:S(Nr(n,e)),clipboard:S(r),generators:S(o)}}},Br={registerEvents:function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Or.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,sn.table(t[0]).map(In).map(function(e){return[bn(e,xr.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?k(e,function(e){return e.dom().innerText}).join(""):(t=f,k(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&x.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var a=Ae.fromDom(e);sn.table(a).each(function(t){var e,n,r,o=B((e=l.content,(r=(n||m.document).createElement("div")).innerHTML=e,Rt(Ae.fromDom(r))),function(e){return"meta"!==le(e)});if(1===o.length&&"table"===le(o[0])){l.preventDefault();var i=Ae.fromDom(f.getDoc()),u=Ln(i),c=Pr.paste(a,o[0],u);s.pasteCells(t,c).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})}};function Mr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=Me(e,r);return parseFloat(n)||0}return t},i=function(o,e){return W(e,function(e,t){var n=Me(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!D(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();Te(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Wr=Mr("height",function(e){var t=e.dom();return Ee(e)?t.getBoundingClientRect().height:t.offsetHeight}),_r=function(e){return Wr.get(e)},Lr=function(e){return Wr.getOuter(e)},jr=Mr("width",function(e){return e.dom().offsetWidth}),zr=function(e){return jr.get(e)},Hr=function(e){return jr.getOuter(e)},Fr=st.detect(),Ur=function(e,t,n){return r=Me(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},qr=function(e){return Fr.browser.isIE()||Fr.browser.isEdge()?(n=Ur(t=e,"padding-top",0),r=Ur(t,"padding-bottom",0),o=Ur(t,"border-top-width",0),i=Ur(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===Me(t,"box-sizing")?u:u-n-r-(o+i)):Ur(e,"height",_r(e));var t,n,r,o,i,u},Vr=/(\d+(\.\d+)?)(\w|%)*/,Gr=/(\d+(\.\d+)?)%/,Yr=/(\d+(\.\d+)?)px|em/,Kr=function(e,t){Pe(e,"height",t+"px")},Xr=function(e,t,n,r){var o,i,u,c,a,l,f,s=parseInt(e,10);return Se(l=e,f="%",l.length-f.length)&&"table"!==le(t)?(o=t,i=s,u=n,c=r,a=sn.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),c(o,a),a):s},$r=function(e){var t,n=_e(t=e,"height").getOrThunk(function(){return qr(t)+"px"});return n?Xr(n,e,_r,Kr):_r(e)},Jr=function(e,t){return we(e,t)?parseInt(be(e,t),10):1},Qr=function(e){return _e(e,"width").fold(function(){return x.from(be(e,"width"))},function(e){return x.some(e)})},Zr=function(e,t){return e/t.pixelWidth()*100},eo={percentageBasedSizeRegex:S(Gr),pixelBasedSizeRegex:S(Yr),setPixelWidth:function(e,t){Pe(e,"width",t+"px")},setPercentageWidth:function(e,t){Pe(e,"width",t+"%")},setHeight:Kr,getPixelWidth:function(t,n){return Qr(t).fold(function(){return zr(t)},function(e){return function(e,t,n){var r=Yr.exec(t);if(null!==r)return parseInt(r[1],10);var o=Gr.exec(t);if(null===o)return zr(e);var i=parseFloat(o[1]);return i/100*n.pixelWidth()}(t,e,n)})},getPercentageWidth:function(t,n){return Qr(t).fold(function(){var e=zr(t);return Zr(e,n)},function(e){return function(e,t,n){var r=Gr.exec(t);if(null!==r)return parseFloat(r[1]);var o=zr(e);return Zr(o,n)}(t,e,n)})},getGenericWidth:function(e){return Qr(e).bind(function(e){var t=Vr.exec(e);return null!==t?x.some({width:S(parseFloat(t[1])),unit:S(t[3])}):x.none()})},setGenericWidth:function(e,t,n){Pe(e,"width",t+n)},getHeight:function(e){return n="rowspan",$r(t=e)/Jr(t,n);var t,n},getRawWidth:Qr},to=function(n,r){eo.getGenericWidth(n).each(function(e){var t=e.width()/2;eo.setGenericWidth(n,t,e.unit()),eo.setGenericWidth(r,t,e.unit())})},no=function(n,r){return{left:S(n),top:S(r),translate:function(e,t){return no(n+e,r+t)}}},ro=no,oo=function(e,t){return e!==undefined?e:t!==undefined?t:0},io=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement,i=oo(r.pageYOffset,o.scrollTop),u=oo(r.pageXOffset,o.scrollLeft),c=oo(o.clientTop,n.clientTop),a=oo(o.clientLeft,n.clientLeft);return uo(e).translate(u-a,i-c)},uo=function(e){var t,n=e.dom(),r=n.ownerDocument.body;return r===n?ro(r.offsetLeft,r.offsetTop):Ee(e)?(t=n.getBoundingClientRect(),ro(t.left,t.top)):ro(0,0)},co=Q("row","y"),ao=Q("col","x"),lo=function(e){return io(e).left()+Hr(e)},fo=function(e){return io(e).left()},so=function(e,t){return ao(e,fo(t))},mo=function(e,t){return ao(e,lo(t))},go=function(e){return io(e).top()},po=function(e,t){return co(e,go(t))},ho=function(e,t){return co(e,go(t)+Lr(t))},vo=function(n,t,r){if(0===r.length)return[];var e=k(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},bo={height:{delta:o,positions:function(e){return vo(po,ho,e)},edge:go},rtl:{delta:function(e){return-e},edge:lo,positions:function(e){return vo(mo,so,e)}},ltr:{delta:o,edge:fo,positions:function(e){return vo(so,mo,e)}}},wo={ltr:bo.ltr,rtl:bo.rtl};function yo(t){var n=function(e){return t(e).isRtl()?wo.rtl:wo.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var Co,So=function(e){var t=dn(e);return hn.generate(t).grid()},xo=function(){return(xo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ro=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},To=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return x.none()},Oo=function(e,t,n,r){n===r?ye(e,t):he(e,t,n)},Do=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=en(o,t).getOrThunk(function(){var e=Ae.fromTag(t,wt(o).dom());return Et(o,e),e});Pt(n);var r=k(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return Pt(t),P(e.cells(),function(e){e.isNew()&&u.push(e.element()),Oo(e.element(),"colspan",e.colspan(),1),Oo(e.element(),"rowspan",e.rowspan(),1),Et(t,e.element())}),t});kt(n,r)}(e,t):en(o,t).each(Bt)},n=[],r=[],c=[];return P(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":c.push(e)}}),t(n,"thead"),t(r,"tbody"),t(c,"tfoot"),{newRows:S(i),newCells:S(u)}},Ao=function(e){return k(e,function(e){var n=Nn(e.element());return P(e.cells(),function(e){var t=In(e.element());Oo(t,"colspan",e.colspan(),1),Oo(t,"rowspan",e.rowspan(),1),Et(n,t)}),n})},Eo=function(e,t){var n=be(e,t);return n===undefined||""===n?[]:n.split(" ")},No=function(e){return e.dom().classList!==undefined},Io=function(e,t){return o=t,i=Eo(n=e,r="class").concat([o]),he(n,r,i.join(" ")),!0;var n,r,o,i},ko=function(e,t){return o=t,0<(i=B(Eo(n=e,r="class"),function(e){return e!==o})).length?he(n,r,i.join(" ")):ye(n,r),!1;var n,r,o,i},Po=function(e,t){No(e)?e.dom().classList.add(t):Io(e,t)},Bo=function(e){0===(No(e)?e.dom().classList:Eo(e,"class")).length&&ye(e,"class")},Mo=function(e,t){return No(e)&&e.dom().classList.contains(t)},Wo=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},_o=function(t,n){if(n<0||n>=t.length-1)return x.none();var e=t[n].fold(function(){var e=q(t.slice(0,n));return To(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return x.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return To(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return x.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},Lo=function(e,t,n){var r=e();return _(r,t).orThunk(function(){return x.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},jo=function(n){var e=n.grid(),t=Wo(0,e.columns()),r=Wo(0,e.rows());return k(t,function(t){return Lo(function(){return F(r,function(e){return hn.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(S([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return hn.getAt(n,0,t)})})},zo=function(n){var e=n.grid(),t=Wo(0,e.rows()),r=Wo(0,e.columns());return k(t,function(t){return Lo(function(){return F(r,function(e){return hn.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(S([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return hn.getAt(n,t,0)})})},Ho=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Fo={resolve:Ho("ephox-snooker").resolve},Uo=function(e,t,n,r,o){var i=Ae.fromTag("div");return Be(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),ve(i,{"data-column":e,role:"presentation"}),i},qo=function(e,t,n,r,o){var i=Ae.fromTag("div");return Be(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),ve(i,{"data-row":e,role:"presentation"}),i},Vo=Fo.resolve("resizer-bar"),Go=Fo.resolve("resizer-rows"),Yo=Fo.resolve("resizer-cols"),Ko=function(e){var t=$t(e.parent(),"."+Vo);P(t,Bt)},Xo=function(n,e,r){var o=n.origin();P(e,function(e,t){e.each(function(e){var t=r(o,e);Po(t,Vo),Et(n.parent(),t)})})},$o=function(e,t,n,r,o,i){var u,c,a,l,f=io(t),s=0<n.length?o.positions(n,t):[];u=e,c=s,a=f,l=Hr(t),Xo(u,c,function(e,t){var n=qo(t.row(),a.left()-e.left(),t.y()-e.top(),l,7);return Po(n,Go),n});var d,m,g,p,h=0<r.length?i.positions(r,t):[];d=e,m=h,g=f,p=Lr(t),Xo(d,m,function(e,t){var n=Uo(t.col(),t.x()-e.left(),g.top()-e.top(),7,p);return Po(n,Yo),n})},Jo=function(e,t){var n=$t(e.parent(),"."+Vo);P(n,t)},Qo=function(e,t,n,r){Ko(e);var o=dn(t),i=hn.generate(o),u=zo(i),c=jo(i);$o(e,t,u,c,n,r)},Zo=function(e){Jo(e,function(e){Pe(e,"display","none")})},ei=function(e){Jo(e,function(e){Pe(e,"display","block")})},ti=Ko,ni=function(e){return Mo(e,Go)},ri=function(e){return Mo(e,Yo)},oi=function(e,t){return qt(t,e.section())},ii=function(e,t){return e.cells()[t]},ui={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return oi(e,u)},setCells:oi,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:ii,getCellElement:function(e,t){return ii(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=k(n,t);return qt(r,e.section())},cellLength:function(e){return e.cells().length}},ci=function(e,t){if(0===e.length)return 0;var n=e[0];return L(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ai=function(e,t,n,r){var o,i,u,c,a=(o=e,i=t,o[i]).cells().slice(n),l=ci(a,r),f=(u=e,c=n,k(u,function(e){return ui.getCell(e,c)})).slice(t),s=ci(f,r);return{colspan:S(l),rowspan:S(s)}},li=function(o,i){var u=k(o,function(e,t){return k(e.cells(),function(e,t){return!1})});return k(o,function(e,r){var t=F(e.cells(),function(e,t){if(!1!==u[r][t])return[];var n=ai(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[jt(e.element(),n.rowspan(),n.colspan(),e.isNew())]});return Vt(t,e.section())})},fi=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var c=hn.getAt(e,o,u).map(function(e){return Ft(e.element(),n)}).getOrThunk(function(){return Ft(t.gap(),!0)});i.push(c)}var a=qt(i,e.all()[o].section());r.push(a)}return r},si=function(e,r){return k(e,function(e){var t,n=(t=e.details(),To(t,function(e){return yt(e.element()).map(function(e){var t=yt(e).isNone();return Ft(e,t)})}).getOrThunk(function(){return Ft(r.row(),!0)}));return Ut(n.element(),e.details(),e.section(),n.isNew())})},di=function(e,t){var n=li(e,ht);return si(n,t)},mi=function(e,t){var n=H(k(e.all(),function(e){return e.cells()}));return _(n,function(e){return ht(t,e.element())})},gi=function(c,a,l,f,s){return function(n,r,e,o,i){var t=dn(r),u=hn.generate(t);return a(u,e).map(function(e){var t=fi(u,o,!1),n=c(t,e,ht,s(o)),r=di(n.grid(),o);return{grid:S(r),cursor:n.cursor}}).fold(function(){return x.none()},function(e){var t=Do(r,e.grid());return l(r,e.grid(),i),f(r),Qo(n,r,bo.height,i),x.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},pi=function(t,e){return sn.cell(e.element()).bind(function(e){return mi(t,e)})},hi=function(t,e){var n=k(e.selection(),function(e){return sn.cell(e).bind(function(e){return mi(t,e)})}),r=Ro(n);return 0<r.length?x.some({cells:r,generators:e.generators,clipboard:e.clipboard}):x.none()},vi=function(t,e){var n=k(e.selection(),function(e){return sn.cell(e).bind(function(e){return mi(t,e)})}),r=Ro(n);return 0<r.length?x.some(r):x.none()},bi=function(n){return{is:function(e){return n===e},isValue:u,isError:f,getOr:S(n),getOrThunk:S(n),getOrDie:S(n),or:function(e){return bi(n)},orThunk:function(e){return bi(n)},fold:function(e,t){return t(n)},map:function(e){return bi(e(n))},mapError:function(e){return bi(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return x.some(n)}}},wi=function(n){return{is:f,isValue:f,isError:u,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return wi(n)},mapError:function(e){return wi(e(n))},each:y,bind:function(e){return wi(n)},exists:f,forall:u,toOption:x.none}},yi={value:bi,error:wi,fromOption:function(e,t){return e.fold(function(){return wi(t)},bi)}},Ci=function(e,t){return k(e,function(){return Ft(t.cell(),!0)})},Si=function(t,e,n){return t.concat(function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(e,function(e){return ui.setCells(t[t.length-1],Ci(t[t.length-1].cells(),n))}))},xi=function(e,t,n){return k(e,function(e){return ui.setCells(e,e.cells().concat(Ci(Wo(0,t),n)))})},Ri=function(e,t,n){if(e.row()>=t.length||e.column()>ui.cellLength(t[0]))return yi.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=ui.cellLength(n[0]),u=n.length;return yi.value({rowDelta:S(r.length-u),colDelta:S(o.length-i)})},Ti=function(e,t){var n=ui.cellLength(e[0]),r=ui.cellLength(t[0]);return{rowDelta:S(0),colDelta:S(n-r)}},Oi=function(e,t,n){var r=t.colDelta()<0?xi:o;return(t.rowDelta()<0?Si:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},Di=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)ui.mutateCell(e[o],i,Ft(r(),!1));return e},Ai=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<ui.cellLength(e[0]);u++){var c=n(ui.getCellElement(e[i],u),t);!0===c&&!1===o?ui.mutateCell(e[i],u,Ft(r(),!0)):!0===c&&(o=!1)}return e},Ei=function(i,n,u,c){if(0<n&&n<i.length){var e=i[n-1].cells(),t=(r=u,W(e,function(e,t){return I(e,function(e){return r(e.element(),t.element())})?e:e.concat([t])},[]));P(t,function(r){for(var o=x.none(),e=function(n){for(var e=function(t){var e=i[n].cells()[t];u(e.element(),r.element())&&(o.isNone()&&(o=x.some(c())),o.each(function(e){ui.mutateCell(i[n],t,Ft(e,!0))}))},t=0;t<ui.cellLength(i[0]);t++)e(t)},t=n;t<i.length;t++)e(t)})}var r;return i},Ni=function(n,r,o,i,u){return Ri(n,r,o).map(function(e){var t=Oi(r,e,i);return function(e,t,n,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+n.length,m=s+ui.cellLength(n[0]),g=f;g<d;g++)for(var p=s;p<m;p++){i=t,u=g,c=p,l=a=void 0,a=b(o,ui.getCell(i[u],c).element()),l=i[u],1<i.length&&1<ui.cellLength(l)&&(0<c&&a(ui.getCellElement(l,c-1))||c<l.cells().length-1&&a(ui.getCellElement(l,c+1))||0<u&&a(ui.getCellElement(i[u-1],c))||u<i.length-1&&a(ui.getCellElement(i[u+1],c)))&&Ai(t,ui.getCellElement(t[g],p),o,r.cell);var h=ui.getCellElement(n[g-f],p-s),v=r.replace(h);ui.mutateCell(t[g],p,Ft(v,!0))}return t}(n,t,o,i,u)})},Ii=function(e,t,n,r,o){Ei(t,e,o,r.cell);var i=Ti(n,t),u=Oi(n,i,r),c=Ti(t,u),a=Oi(t,c,r);return a.slice(0,e).concat(u).concat(a.slice(e,a.length))},ki=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),c=ui.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(ui.getCellElement(n[r-1],t),ui.getCellElement(n[r],t))?ui.getCell(n[r],t):Ft(i(e.element(),o),!0)});return t.concat([c]).concat(u)},Pi=function(e,n,r,o,i){return k(e,function(e){var t=0<n&&n<ui.cellLength(e)&&o(ui.getCellElement(e,n-1),ui.getCellElement(e,n))?ui.getCell(e,n):Ft(i(ui.getCellElement(e,r),o),!0);return ui.addCell(e,n,t)})},Bi=function(e,r,o,i,u){var c=o+1;return k(e,function(e,t){var n=t===r?Ft(u(ui.getCellElement(e,o),i),!0):ui.getCell(e,o);return ui.addCell(e,c,n)})},Mi=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),c=e.slice(i),a=ui.mapCells(e[t],function(e,t){return t===n?Ft(o(e.element(),r),!0):e});return u.concat([a]).concat(c)},Wi=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},_i=function(e,n,r){var t=k(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return qt(t,e.section())});return B(t,function(e){return 0<e.cells().length})},Li=function(e,n,r,o){return k(e,function(e){return ui.mapCells(e,function(e){return t=e,I(n,function(e){return r(t.element(),e.element())})?Ft(o(e.element(),r),!0):e;var t})})},ji=function(e,t,n,r){return ui.getCellElement(e[t],n)!==undefined&&0<t&&r(ui.getCellElement(e[t-1],n),ui.getCellElement(e[t],n))},zi=function(e,t,n){return 0<t&&n(ui.getCellElement(e,t-1),ui.getCellElement(e,t))},Hi=function(n,r,o,e){var t=F(n,function(e,t){return ji(n,t,r,o)||zi(e,r,o)?[]:[ui.getCell(e,r)]});return Li(n,t,o,e)},Fi=function(n,r,o,e){var i=n[r],t=F(i.cells(),function(e,t){return ji(n,r,t,o)||zi(i,t,o)?[]:[e]});return Li(n,t,o,e)},Ui=Rr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),qi=xo({},Ui),Vi=function(e,t,i,u){var n,r,c=e.slice(0),o=(r=t,0===(n=e).length?qi.none():1===n.length?qi.only(0):0===r?qi.left(0,1):r===n.length-1?qi.right(r-1,r):0<r&&r<n.length-1?qi.middle(r-1,r,r+1):qi.none()),a=function(e){return k(e,S(0))},l=S(a(c)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),c[t]-i);return a(c.slice(0,e)).concat([i,n-c[t]]).concat(a(c.slice(t+1)))}var r=Math.max(u.minCellWidth(),c[e]+i),o=c[e]-r;return a(c.slice(0,e)).concat([r-c[e],o]).concat(a(c.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(c[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return a(c.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),c[t]+i);return a(c.slice(0,t)).concat([n-c[t]])})},Gi=function(e,t){return we(e,t)&&1<parseInt(be(e,t),10)},Yi={hasColspan:function(e){return Gi(e,"colspan")},hasRowspan:function(e){return Gi(e,"rowspan")},minWidth:S(10),minHeight:S(10),getInt:function(e,t){return parseInt(Me(e,t),10)}},Ki=function(e,t,n){return _e(e,t).fold(function(){return n(e)+"px"},function(e){return e})},Xi=function(e,t){return Ki(e,"width",function(e){return eo.getPixelWidth(e,t)})},$i=function(e){return Ki(e,"height",eo.getHeight)},Ji=function(e,t,n,r,o){var i=jo(e),u=k(i,function(e){return e.map(t.edge)});return k(i,function(e,t){return e.filter(d(Yi.hasColspan)).fold(function(){var e=_o(u,t);return r(e)},function(e){return n(e,o)})})},Qi=function(e){return e.map(function(e){return e+"px"}).getOr("")},Zi=function(e,t,n,r){var o=zo(e),i=k(o,function(e){return e.map(t.edge)});return k(o,function(e,t){return e.filter(d(Yi.hasRowspan)).fold(function(){var e=_o(i,t);return r(e)},function(e){return n(e)})})},eu={getRawWidths:function(e,t,n){return Ji(e,t,Xi,Qi,n)},getPixelWidths:function(e,t,n){return Ji(e,t,eo.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Ji(e,t,eo.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Zi(e,t,eo.getHeight,function(e){return e.getOrThunk(Yi.minHeight)})},getRawHeights:function(e,t){return Zi(e,t,$i,Qi)}},tu=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},nu=function(e,n){var t=hn.justCells(e);return k(t,function(e){var t=tu(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:S(t),colspan:e.colspan}})},ru=function(e,n){var t=hn.justCells(e);return k(t,function(e){var t=tu(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:S(t),rowspan:e.rowspan}})},ou=function(e,n){return k(e.all(),function(e,t){return{element:e.element,height:S(n[t])}})},iu=function(e){var t=o;return{width:S(e),pixelWidth:S(e),getWidths:eu.getPixelWidths,getCellDelta:t,singleColumnWidth:function(e,t){return[Math.max(Yi.minWidth(),e+t)-e]},minCellWidth:Yi.minWidth,setElementWidth:eo.setPixelWidth,setTableWidth:function(e,t,n){var r=M(t,function(e,t){return e+t},0);eo.setPixelWidth(e,r)}}},uu=function(e,t){var n,r,o,i,u=eo.percentageBasedSizeRegex().exec(t);if(null!==u)return n=u[1],r=e,o=parseFloat(n),i=zr(r),{width:S(o),pixelWidth:S(i),getWidths:eu.getPercentageWidths,getCellDelta:function(e){return e/i*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Yi.minWidth()/i*100},setElementWidth:eo.setPercentageWidth,setTableWidth:function(e,t,n){var r=n/100*o;eo.setPercentageWidth(e,o+r)}};var c=eo.pixelBasedSizeRegex().exec(t);if(null!==c){var a=parseInt(c[1],10);return iu(a)}var l=zr(e);return iu(l)},cu=function(t){return eo.getRawWidth(t).fold(function(){var e=zr(t);return iu(e)},function(e){return uu(t,e)})},au=function(e){return hn.generate(e)},lu=function(e){var t=dn(e);return au(t)},fu=function(e,t,n,r){var o=cu(e),i=o.getCellDelta(t),u=lu(e),c=o.getWidths(u,r,o),a=Vi(c,n,i,o),l=k(a,function(e,t){return e+c[t]}),f=nu(u,l);P(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},su=function(e,n,r,t){var o=lu(e),i=eu.getPixelHeights(o,t),u=k(i,function(e,t){return r===t?Math.max(n+e,Yi.minHeight()):e}),c=ru(o,u),a=ou(o,u);P(a,function(e){eo.setHeight(e.element(),e.height())}),P(c,function(e){eo.setHeight(e.element(),e.height())});var l=M(u,function(e,t){return e+t},0);eo.setHeight(e,l)},du=function(e,t,n){var r=cu(e),o=au(t),i=r.getWidths(o,n,r),u=nu(o,i);P(u,function(e){r.setElementWidth(e.element(),e.width())}),0<u.length&&r.setTableWidth(e,i,r.getCellDelta(0))},mu=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return ne("required",o),re(o),function(t){var n=V(t);U(o,function(e){return N(n,e)})||ee(o,n),r(o,n);var e=B(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+Z(e).join(", ")+") were not.")}(e,i.label),t}},gu=function(t,e){var n=B(e,function(e){return!N(t,e)});0<n.length&&te(n)},pu=function(e){return mu(gu,e,{validate:O,label:"function"})},hu=pu(["cell","row","replace","gap"]),vu=function(e){var t=we(e,"colspan")?parseInt(be(e,"colspan"),10):1,n=we(e,"rowspan")?parseInt(be(e,"rowspan"),10):1;return{element:S(e),colspan:S(t),rowspan:S(n)}},bu=function(r,o){void 0===o&&(o=vu),hu(r);var n=l(x.none()),i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(x.some(t)),c=x.some({item:e,replacement:t}),t},c=x.none();return{getOrInit:function(t,n){return c.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},wu=function(c,a){return function(r){var o=l(x.none());hu(r);var i=[],u=function(e){var t={scope:c},n=r.replace(e,a,t);return i.push({item:e,sub:n}),o.get().isNone()&&o.set(x.some(n)),n};return{replaceOrInit:function(t,n){return(r=t,o=n,_(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:o.get}}},yu=function(n){hu(n);var e=l(x.none());return{combine:function(t){return e.get().isNone()&&e.set(x.some(t)),function(){var e=n.cell({element:S(t),colspan:S(1),rowspan:S(1)});return Le(e,"width"),Le(t,"width"),e}},cursor:e.get}},Cu=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Su=function(e,t){var n=e.property().name(t);return N(Cu,n)},xu=function(e,t){return N(["br","img","hr","input"],e.property().name(t))},Ru=Su,Tu=function(e,t){var n=e.property().name(t);return N(["ol","ul"],n)},Ou=xu,Du=er(),Au=function(e){return Ru(Du,e)},Eu=function(e){return Tu(Du,e)},Nu=function(e){return Ou(Du,e)},Iu=function(e){var t,i=function(e){return"br"===le(e)},n=function(o){return Dn(o).bind(function(n){var r=xt(n).map(function(e){return!!Au(e)||!!Nu(e)&&"img"!==le(e)}).getOr(!1);return yt(n).map(function(e){return!0===r||"li"===le(t=e)||Qt(t,Eu).isSome()||i(n)||Au(e)&&!ht(o,e)?[]:[Ae.fromTag("br")];var t})}).getOr([])},r=0===(t=F(e,function(e){var t=Rt(e);return U(t,function(e){return i(e)||ge(e)&&0===yn(e).trim().length})?[]:t.concat(n(e))})).length?[Ae.fromTag("br")]:t;Pt(e[0]),kt(e[0],r)},ku=function(e){0===sn.cells(e).length&&Bt(e)},Pu=Q("grid","cursor"),Bu=function(e,t,n){return Mu(e,t,n).orThunk(function(){return Mu(e,0,0)})},Mu=function(e,t,n){return x.from(e[t]).bind(function(e){return x.from(e.cells()[n]).bind(function(e){return x.from(e.element())})})},Wu=function(e,t,n){return Pu(e,Mu(e,t,n))},_u=function(e){return W(e,function(e,t){return I(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},Lu=function(e){return W(e,function(e,t){return I(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},ju=function(e,t,n){var r=mn(e,n),o=hn.generate(r);return fi(o,t,!0)},zu=du,Hu={insertRowBefore:gi(function(e,t,n,r){var o=t.row(),i=t.row(),u=ki(e,i,o,n,r.getOrInit);return Wu(u,i,t.column())},pi,y,y,bu),insertRowsBefore:gi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=_u(t),c=W(u,function(e,t){return ki(e,i,o,n,r.getOrInit)},e);return Wu(c,i,t[0].column())},vi,y,y,bu),insertRowAfter:gi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=ki(e,i,o,n,r.getOrInit);return Wu(u,i,t.column())},pi,y,y,bu),insertRowsAfter:gi(function(e,t,n,r){var o=_u(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),c=W(o,function(e,t){return ki(e,u,i,n,r.getOrInit)},e);return Wu(c,u,t[0].column())},vi,y,y,bu),insertColumnBefore:gi(function(e,t,n,r){var o=t.column(),i=t.column(),u=Pi(e,i,o,n,r.getOrInit);return Wu(u,t.row(),i)},pi,zu,y,bu),insertColumnsBefore:gi(function(e,t,n,r){var o=Lu(t),i=o[0].column(),u=o[0].column(),c=W(o,function(e,t){return Pi(e,u,i,n,r.getOrInit)},e);return Wu(c,t[0].row(),u)},vi,zu,y,bu),insertColumnAfter:gi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=Pi(e,i,o,n,r.getOrInit);return Wu(u,t.row(),i)},pi,zu,y,bu),insertColumnsAfter:gi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=Lu(t),c=W(u,function(e,t){return Pi(e,i,o,n,r.getOrInit)},e);return Wu(c,t[0].row(),i)},vi,zu,y,bu),splitCellIntoColumns:gi(function(e,t,n,r){var o=Bi(e,t.row(),t.column(),n,r.getOrInit);return Wu(o,t.row(),t.column())},pi,zu,y,bu),splitCellIntoRows:gi(function(e,t,n,r){var o=Mi(e,t.row(),t.column(),n,r.getOrInit);return Wu(o,t.row(),t.column())},pi,y,y,bu),eraseColumns:gi(function(e,t,n,r){var o=Lu(t),i=_i(e,o[0].column(),o[o.length-1].column()),u=Bu(i,t[0].row(),t[0].column());return Pu(i,u)},vi,zu,ku,bu),eraseRows:gi(function(e,t,n,r){var o=_u(t),i=Wi(e,o[0].row(),o[o.length-1].row()),u=Bu(i,t[0].row(),t[0].column());return Pu(i,u)},vi,y,ku,bu),makeColumnHeader:gi(function(e,t,n,r){var o=Hi(e,t.column(),n,r.replaceOrInit);return Wu(o,t.row(),t.column())},pi,y,y,wu("row","th")),unmakeColumnHeader:gi(function(e,t,n,r){var o=Hi(e,t.column(),n,r.replaceOrInit);return Wu(o,t.row(),t.column())},pi,y,y,wu(null,"td")),makeRowHeader:gi(function(e,t,n,r){var o=Fi(e,t.row(),n,r.replaceOrInit);return Wu(o,t.row(),t.column())},pi,y,y,wu("col","th")),unmakeRowHeader:gi(function(e,t,n,r){var o=Fi(e,t.row(),n,r.replaceOrInit);return Wu(o,t.row(),t.column())},pi,y,y,wu(null,"td")),mergeCells:gi(function(e,t,n,r){var o=t.cells();Iu(o);var i=Di(e,t.bounds(),n,S(o[0]));return Pu(i,x.from(o[0]))},function(e,t){return t.mergable()},y,y,yu),unmergeCells:gi(function(e,t,n,r){var o=M(t,function(e,t){return Ai(e,t,n,r.combine(t))},e);return Pu(o,x.from(t[0]))},function(e,t){return t.unmergable()},zu,y,yu),pasteCells:gi(function(e,n,t,r){var o,i,u,c,a=(o=n.clipboard(),i=n.generators(),u=dn(o),c=hn.generate(u),fi(c,i,!0)),l=_t(n.row(),n.column());return Ni(l,e,a,n.generators(),t).fold(function(){return Pu(e,x.some(n.element()))},function(e){var t=Bu(e,n.row(),n.column());return Pu(e,t)})},function(t,n){return sn.cell(n.element()).bind(function(e){return mi(t,e).map(function(e){return xo({},e,{generators:n.generators,clipboard:n.clipboard})})})},zu,y,bu),pasteRowsBefore:gi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=ju(t.clipboard(),t.generators(),o),c=Ii(i,e,u,t.generators(),n),a=Bu(c,t.cells[0].row(),t.cells[0].column());return Pu(c,a)},hi,y,y,bu),pasteRowsAfter:gi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=ju(t.clipboard(),t.generators(),o),c=Ii(i,e,u,t.generators(),n),a=Bu(c,t.cells[0].row(),t.cells[0].column());return Pu(c,a)},hi,y,y,bu)},Fu=function(e){return Ae.fromDom(e.getBody())},Uu=function(e){return e.getBoundingClientRect().width},qu=function(e){return e.getBoundingClientRect().height},Vu=function(t){return function(e){return ht(e,Fu(t))}},Gu=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},Yu=function(e){var t=$t(e,"td[data-mce-style],th[data-mce-style]");ye(e,"data-mce-style"),P(t,function(e){ye(e,"data-mce-style")})},Ku={isRtl:S(!1)},Xu={isRtl:S(!0)},$u={directionAt:function(e){return"rtl"==("rtl"===Me(e,"direction")?"rtl":"ltr")?Xu:Ku}},Ju={"border-collapse":"collapse",width:"100%"},Qu={border:"1"},Zu=function(e){return e.getParam("table_default_attributes",Qu,"object")},ec=function(e){return e.getParam("table_default_styles",Ju,"object")},tc=function(e){return e.getParam("table_tab_navigation",!0,"boolean")},nc=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},rc=function(e){return e.getParam("table_row_advtab",!0,"boolean")},oc=function(e){return e.getParam("table_advtab",!0,"boolean")},ic=function(e){return e.getParam("table_style_by_css",!1,"boolean")},uc=function(e){return e.getParam("table_class_list",[],"array")},cc=function(e){return!1===e.getParam("table_responsive_width")},ac=function(e,t){return e.fire("newrow",{node:t})},lc=function(e,t){return e.fire("newcell",{node:t})},fc=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},sc=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},dc=function(f,e){var t,n=function(e){return"table"===le(Fu(e))},s=(t=f.getParam("table_clone_elements"),w(t)?x.some(t.split(/[ ,]/)):Array.isArray(t)?x.some(t):x.none()),r=function(u,c,a,l){return function(e,t){Yu(e);var n=l(),r=Ae.fromDom(f.getDoc()),o=yo($u.directionAt),i=_n(a,r,s);return c(e)?u(n,e,t,i,o).bind(function(e){return P(e.newRows(),function(e){ac(f,e.dom())}),P(e.newCells(),function(e){lc(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):x.none()}};return{deleteRow:r(Hu.eraseRows,function(e){var t=So(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(Hu.eraseColumns,function(e){var t=So(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(Hu.insertRowsBefore,u,y,e),insertRowsAfter:r(Hu.insertRowsAfter,u,y,e),insertColumnsBefore:r(Hu.insertColumnsBefore,u,to,e),insertColumnsAfter:r(Hu.insertColumnsAfter,u,to,e),mergeCells:r(Hu.mergeCells,u,y,e),unmergeCells:r(Hu.unmergeCells,u,y,e),pasteRowsBefore:r(Hu.pasteRowsBefore,u,y,e),pasteRowsAfter:r(Hu.pasteRowsAfter,u,y,e),pasteCells:r(Hu.pasteCells,u,y,e)}},mc=function(e,t,r){var n=dn(e),o=hn.generate(n);return vi(o,t).map(function(e){var t=fi(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=di(t,r);return Ao(n)})},gc=tinymce.util.Tools.resolve("tinymce.util.Tools"),pc=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},hc=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},vc=function(t,n){gc.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},bc=function(t,n){gc.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},wc=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},yc=function(t,e){var n=function(e){return Re(e,"rgb")?t.toHex(e):e};return{borderstyle:_e(Ae.fromDom(e),"border-style").getOr(""),bordercolor:_e(Ae.fromDom(e),"border-color").map(n).getOr(""),backgroundcolor:_e(Ae.fromDom(e),"background-color").map(n).getOr("")}},Cc=function(e,t,n,r,o){var i={};return gc.each(e.split(" "),function(e){r.formatter.matchNode(o,t+e)&&(i[n]=e)}),i[n]||(i[n]=""),i},Sc=b(Cc,"left center right"),xc=b(Cc,"top middle bottom"),Rc=function(e,r,t){var o=function(e,n){return n=n||[],gc.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},Tc=function(e){var i=e[0],t=e.slice(1),n=V(i);return P(t,function(e){P(n,function(o){Y(e,function(e,t,n){var r=i[o];""!==r&&o===t&&r!==e&&(i[o]="")})})}),i},Oc=function(){return{title:"Advanced",name:"advanced",items:[{name:"borderstyle",type:"selectbox",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}]}},Dc=function(e,t,n){var r,o,i,u=e.dom;return xo({width:u.getStyle(t,"width")||u.getAttrib(t,"width"),height:u.getStyle(t,"height")||u.getAttrib(t,"height"),cellspacing:u.getStyle(t,"border-spacing")||u.getAttrib(t,"cellspacing"),cellpadding:u.getAttrib(t,"cellpadding")||wc(e.dom,t,"padding"),border:(r=u,o=t,i=_e(Ae.fromDom(o),"border-width"),ic(e)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||wc(e.dom,o,"border-width")||wc(e.dom,o,"border")),caption:!!u.select("caption",t)[0],"class":u.getAttrib(t,"class","")},Sc("align","align",e,t),n?yc(u,t):{})},Ac=function(e,t,n){var r=e.dom;return xo({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),"class":r.getAttrib(t,"class",""),align:"",type:t.parentNode.nodeName.toLowerCase()},Sc("align","align",e,t),n?yc(r,t):{})},Ec=function(e,t,n){var r=e.dom;return xo({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),celltype:t.nodeName.toLowerCase(),"class":r.getAttrib(t,"class","")},Sc("align","halign",e,t),xc("valign","valign",e,t),n?yc(r,t):{})},Nc=function(e,t){var n,r,o,i,u,c,a,l,f=ec(e),s=Zu(e),d=e.dom,m=t?(n=d,r=function(e){return Re(e,"rgb")?n.toHex(e):e},o=$(f,"border-style").getOr(""),i=$(f,"border-color").getOr(""),u=$(f,"background-color").getOr(""),{borderstyle:o,bordercolor:r(i),backgroundcolor:r(u)}):{};return xo({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""},f,s,m,(l=f["border-width"],ic(e)&&l?{border:l}:$(s,"border").fold(function(){return{}},function(e){return{border:e}})),(c=$(f,"border-spacing").or($(s,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),a=$(f,"border-padding").or($(s,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),xo({},c,a)))},Ic=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],kc=function(e){return(t=e,n=t.getParam("table_cell_class_list",[],"array"),r=Rc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?x.some({name:"class",type:"selectbox",label:"Class",items:r}):x.none()).fold(function(){return Ic},function(e){return Ic.concat(e)});var t,n,r},Pc={normal:function(n,r){return{setAttrib:function(e,t){n.setAttrib(r,e,t)},setStyle:function(e,t){n.setStyle(r,e,t)}}},ifTruthy:function(n,r){return{setAttrib:function(e,t){t&&n.setAttrib(r,e,t)},setStyle:function(e,t){t&&n.setStyle(r,e,t)}}}},Bc=function(e,t){e.setAttrib("scope",t.scope),e.setAttrib("class",t["class"]),e.setStyle("width",Gu(t.width)),e.setStyle("height",Gu(t.height))},Mc=function(e,t){e.setStyle("background-color",t.backgroundcolor),e.setStyle("border-color",t.bordercolor),e.setStyle("border-style",t.borderstyle)},Wc=function(e,t,n){var r=e.dom,o=n.celltype&&t[0].nodeName.toLowerCase()!==n.celltype?r.rename(t[0],n.celltype):t[0],i=Pc.normal(r,o);Bc(i,n),nc(e)&&Mc(i,n),vc(e,o),bc(e,o),n.halign&&pc(e,o,n.halign),n.valign&&hc(e,o,n.valign)},_c=function(n,e,r){var o=n.dom;gc.each(e,function(e){r.celltype&&e.nodeName.toLowerCase()!==r.celltype&&(e=o.rename(e,r.celltype));var t=Pc.ifTruthy(o,e);Bc(t,r),nc(n)&&Mc(t,r),r.halign&&pc(n,e,r.halign),r.valign&&hc(n,e,r.valign)})},Lc=function(e,t,n){var r=n.getData();n.close(),e.undoManager.transact(function(){(1===t.length?Wc:_c)(e,t,r),e.focus()})},jc=function(t){var e,n=[];if(n=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!n.length&&e&&n.push(e),e=e||n[0]){var r=gc.map(n,function(e){return Ec(t,e,nc(t))}),o=Tc(r),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:kc(t)},Oc()]},u={type:"panel",items:[{type:"grid",columns:2,items:kc(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:nc(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(Lc,t,n)})}},zc=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Hc=function(e){return(t=e,n=t.getParam("table_row_class_list",[],"array"),r=Rc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?x.some({name:"class",type:"selectbox",label:"Class",items:r}):x.none()).fold(function(){return zc},function(e){return zc.concat(e)});var t,n,r},Fc=function(f,e,s,t){var d=f.dom,m=t.getData();t.close();var g=1===e.length?Pc.normal:Pc.ifTruthy;f.undoManager.transact(function(){gc.each(e,function(e){var t,n,r,o,i,u;m.type!==e.parentNode.nodeName.toLowerCase()&&(t=f.dom,n=e,r=m.type,o=t.getParent(n,"table"),i=n.parentNode,(u=t.select(r,o)[0])||(u=t.create(r),o.firstChild?"CAPTION"===o.firstChild.nodeName?t.insertAfter(u,o.firstChild):o.insertBefore(u,o.firstChild):o.appendChild(u)),u.appendChild(n),i.hasChildNodes()||t.remove(i));var c,a,l=g(d,e);l.setAttrib("scope",m.scope),l.setAttrib("class",m["class"]),l.setStyle("height",Gu(m.height)),rc(f)&&(a=m,(c=l).setStyle("background-color",a.backgroundcolor),c.setStyle("border-color",a.bordercolor),c.setStyle("border-style",a.borderstyle)),m.align!==s.align&&(vc(f,e),pc(f,e,m.align))}),f.focus()})},Uc=function(t){var e,n,r=t.dom,o=[];if((e=r.getParent(t.selection.getStart(),"table"))&&(n=r.getParent(t.selection.getStart(),"td,th"),gc.each(e.rows,function(t){gc.each(t.cells,function(e){if((r.getAttrib(e,"data-mce-selected")||e===n)&&o.indexOf(t)<0)return o.push(t),!1})}),o[0])){var i=gc.map(o,function(e){return Ac(t,e,rc(t))}),u=Tc(i),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Hc(t)},Oc()]},a={type:"panel",items:[{type:"grid",columns:2,items:Hc(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:rc(t)?c:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:b(Fc,t,o,u)})}},qc=Object.prototype.hasOwnProperty,Vc=(Co=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)qc.call(o,i)&&(n[i]=Co(n[i],o[i]))}return n}),Gc=tinymce.util.Tools.resolve("tinymce.Env"),Yc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Kc=function(e,t,n,r,o){void 0===o&&(o=Yc);var i=Ae.fromTag("table");Be(i,o.styles),ve(i,o.attributes);var u=Ae.fromTag("tbody");Et(i,u);for(var c=[],a=0;a<e;a++){for(var l=Ae.fromTag("tr"),f=0;f<t;f++){var s=a<n||f<r?Ae.fromTag("th"):Ae.fromTag("td");f<r&&he(s,"scope","row"),a<n&&he(s,"scope","col"),Et(s,Ae.fromTag("br")),o.percentages&&Pe(s,"width",100/t+"%"),Et(l,s)}c.push(l)}return kt(u,c),i},Xc=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},$c=function(r,e,t){var n,o=ec(r),i={styles:o,attributes:Zu(r),percentages:(n=o.width,w(n)&&-1!==n.indexOf("%")&&!cc(r))},u=Kc(t,e,0,0,i);he(u,"data-mce-id","__mce");var c,a,l,f=(c=u,a=Ae.fromTag("div"),l=Ae.fromDom(c.dom().cloneNode(!0)),Et(a,l),a.dom().innerHTML);return r.insertContent(f),tn(Fu(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return cc(r)&&Pe(e,"width",Me(e,"width")),ye(e,"data-mce-id"),t=r,P($t(e,"tr"),function(e){ac(t,e.dom()),P($t(e,"th,td"),function(e){lc(t,e.dom())})}),n=r,tn(e,"td,th").each(b(Xc,n)),e.dom()}).getOr(null)},Jc=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols"},{type:"input",name:"rows",label:"Rows"}]:[],o=t.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing"},{type:"input",name:"cellpadding",label:"Cell padding"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e?[{type:"selectbox",name:"class",label:"Class",items:Rc(uc(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},Qc=function(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)w(n)?e.setStyle(t,n,r):e.setStyle(t,n);else if(t.children)for(var o=0;o<t.children.length;o++)Qc(e,t.children[o],n,r)},Zc=function(n,r,e){var o,i=n.dom,u=e.getData();e.close(),""===u["class"]&&delete u["class"],n.undoManager.transact(function(){if(!r){var e=parseInt(u.cols,10)||1,t=parseInt(u.rows,10)||1;r=$c(n,e,t)}!function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=Gu(n.height),o.getAttrib(t,"width")&&!ic(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Gu(n.width),ic(e)?(u["border-width"]=Gu(n.border),u["border-spacing"]=Gu(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),ic(e)&&t.children)for(var c=0;c<t.children.length;c++)Qc(o,t.children[c],{"border-width":Gu(n.border),padding:Gu(n.cellpadding)}),oc(e)&&Qc(o,t.children[c],{"border-color":n.bordercolor});oc(e)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(Vc(ec(e),u)),o.setAttribs(t,Vc(Zu(e),i))}(n,r,u),(o=i.select("caption",r)[0])&&!u.caption&&i.remove(o),!o&&u.caption&&((o=i.create("caption")).innerHTML=Gc.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===u.align?vc(n,r):pc(n,r,u.align),n.focus(),n.addVisual()})},ea=function(e,t){var n,r=e.dom,o=Nc(e,oc(e));!1===t?(n=r.getParent(e.selection.getStart(),"table"))?o=Dc(e,n,oc(e)):oc(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",oc(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=0<uc(e).length;i&&o["class"]&&(o["class"]=o["class"].replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:Jc(e,i,t)},c=oc(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Oc()]}:{type:"panel",items:[u]};e.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:b(Zc,e,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},ta=function(t){return function(e){return x.from(e.dom.getParent(e.selection.getStart(),t)).map(Ae.fromDom)}},na=ta("th,td"),ra=ta("th,td,caption"),oa=gc.each,ia={registerCommands:function(c,t,a,l,n){var r=Vu(c),f=function(e){return sn.table(e,r)},s=function(e){return{width:Uu(e.dom()),height:Uu(e.dom())}},o=function(n){na(c).each(function(t){f(t).each(function(i){var e=Pr.forMenu(l,i,t),u=s(i);n(i,e).each(function(e){var t,n,r,o;t=c,n=u,o=s(r=i),n.width===o.width&&n.height===o.height||(fc(t,r.dom(),n.width,n.height),sc(t,r.dom(),o.width,o.height)),c.selection.setRng(e),c.focus(),a.clear(i),Yu(i)})})})},i=function(e){return na(c).map(function(o){return f(o).bind(function(e){var t=Ae.fromDom(c.getDoc()),n=Pr.forMenu(l,e,o),r=_n(y,t,x.none());return mc(e,n,r)})})},u=function(u){n.get().each(function(e){var i=k(e,function(e){return In(e)});na(c).each(function(o){f(o).each(function(t){var e=Ae.fromDom(c.getDoc()),n=Ln(e),r=Pr.pasteRows(l,t,o,i,n);u(t,r).each(function(e){c.selection.setRng(e),c.focus(),a.clear(t)})})})})};oa({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){i().each(function(e){n.set(e),o(t.deleteRow)})},mceTableCopyRow:function(e){i().each(function(e){n.set(e)})},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){ra(c).each(function(e){sn.table(e,r).filter(d(r)).each(function(e){var t=Ae.fromText("");if(Dt(e,t),Bt(e),c.dom.isEmpty(c.getBody()))c.setContent(""),c.selection.setCursorLocation();else{var n=c.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),c.selection.setRng(n),c.nodeChanged()}})})}},function(e,t){c.addCommand(t,e)}),oa({mceInsertTable:b(ea,c,!0),mceTableProps:b(ea,c,!1),mceTableRowProps:b(Uc,c),mceTableCellProps:b(jc,c)},function(e,t){c.addCommand(t,function(){e()})})}},ua=function(e){var t=x.from(e.dom().documentElement).map(Ae.fromDom).getOr(e);return{parent:S(t),view:S(e),origin:S(ro(0,0))}},ca=function(e,t){return{parent:S(t),view:S(e),origin:S(ro(0,0))}},aa=function(e){var r=Q.apply(null,e),o=[];return{bind:function(e){if(e===undefined)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(t){o=B(o,function(e){return e!==t})},trigger:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(null,e);P(o,function(e){e(n)})}}},la={create:function(e){return{registry:K(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:K(e,function(e){return e.trigger})}}},fa=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,c,a=Ae.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=C(f,l),d=(t=a,n=e.clientX,r=e.clientY,o=l,i=f,u=s,c=e,{target:S(t),x:S(n),y:S(r),stop:o,prevent:i,kill:u,raw:S(c)});g(d)}}},sa=function(e,t,n,r){return o=e,i=t,u=!1,c=fa(n,r),o.dom().addEventListener(i,c,u),{unbind:b(da,o,i,c,u)};var o,i,u,c},da=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},ma=S(!0),ga=function(e,t,n){return sa(e,t,ma,n)},pa={resolve:Ho("ephox-dragster").resolve},ha=pu(["compare","extract","mutate","sink"]),va=pu(["element","start","stop","destroy"]),ba=pu(["forceDrop","drop","move","delayDrop"]),wa=ha({compare:function(e,t){return ro(t.left()-e.left(),t.top()-e.top())},extract:function(e){return x.some(ro(e.x(),e.y()))},sink:function(e,t){var n=(c=t,a=Vc({layerClass:pa.resolve("blocker")},c),l=Ae.fromTag("div"),he(l,"role","presentation"),Be(l,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Po(l,pa.resolve("blocker")),Po(l,a.layerClass),{element:function(){return l},destroy:function(){Bt(l)}}),r=ga(n.element(),"mousedown",e.forceDrop),o=ga(n.element(),"mouseup",e.drop),i=ga(n.element(),"mousemove",e.move),u=ga(n.element(),"mouseout",e.delayDrop);var c,a,l;return va({element:n.element,start:function(e){Et(e,n.element())},stop:function(){Bt(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function ya(){var i=x.none(),u=la.create({move:aa(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=x.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=x.none()},events:u.registry}}function Ca(){var e=function r(){return{onEvent:y,reset:y}}(),t=ya(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var Sa=function(t,n,e){var r,o,i,u=!1,c=la.create({start:aa([]),stop:aa([])}),a=Ca(),l=function(){d.stop(),a.isOn()&&(a.off(),c.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){r.apply(null,e),i=null},o)}});a.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&n.apply(null,e)}},d=n.sink(ba({forceDrop:l,drop:s(l),move:s(function(e){f.cancel(),a.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),a.on(),c.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:c.registry}},xa=function(e,t){void 0===t&&(t={});var n=t.mode!==undefined?t.mode:wa;return Sa(e,n,t)},Ra=function(){var n,r=la.create({drag:aa(["xDelta","yDelta","target"])}),o=x.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=la.create({drag:aa(["xDelta","yDelta"])})).registry};e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})});return{assign:function(e){o=x.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}},Ta=function(e){return"true"===be(e,"contenteditable")},Oa=Fo.resolve("resizer-bar-dragging"),Da=function(o,t,i){var n=Ra(),r=xa(n,{}),u=x.none(),e=function(e,t){return x.from(be(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Yi.getInt(n.target(),"top");Pe(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Yi.getInt(n.target(),"left");Pe(n.target(),"left",t+n.xDelta()+"px")})});var c=function(e,t){return Yi.getInt(e,t)-parseInt(be(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=c(r,"top");ye(r,"data-initial-top"),m.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=c(r,"left");ye(r,"data-initial-left"),m.trigger.adjustWidth(n,t,parseInt(e,10))}),Qo(o,n,i,t)})})});var a=function(e,t){m.trigger.startAdjust(),n.assign(e),he(e,"data-initial-"+t,parseInt(Me(e,t),10)),Po(e,Oa),Pe(e,"opacity","0.2"),r.go(o.parent())},l=ga(o.parent(),"mousedown",function(e){ni(e.target())&&a(e.target(),"top"),ri(e.target())&&a(e.target(),"left")}),f=function(e){return ht(e,o.view())},s=function(e){return nn(e,"table",f).filter(function(e){return(t=e,n=f,nn(t,"[contenteditable]",n)).exists(Ta);var t,n})},d=ga(o.view(),"mouseover",function(e){s(e.target()).fold(function(){Ee(e.target())&&ti(o)},function(e){u=x.some(e),Qo(o,e,i,t)})}),m=la.create({adjustHeight:aa(["table","delta","row"]),adjustWidth:aa(["table","delta","column"]),startAdjust:aa([])});return{destroy:function(){l.unbind(),d.unbind(),r.destroy(),ti(o)},refresh:function(e){Qo(o,e,i,t)},on:r.on,off:r.off,hideBars:b(Zo,o),showBars:b(ei,o),events:m.registry}};var Aa=function(e,t){return e.inline?ca(Fu(e),(n=Ae.fromTag("div"),Be(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Et(Ne(),n),n)):ua(Ae.fromDom(e.getDoc()));var n},Ea=function(e,t){e.inline&&Bt(t.parent())},Na=function(e,t){return Uu(e.dom())/Uu(t.dom())*100+"%"},Ia=function(u){var c,a,o=x.none(),l=x.none(),f=x.none(),s=/(\d+(\.\d+)?)%/,d=function(e){return"TABLE"===e.nodeName},m=function(e){var t=u.dom.getStyle(e,"width")||u.dom.getAttrib(e,"width");return x.from(t).filter(function(e){return 0<e.length})},e=function(){return l};return u.on("init",function(){var e,t=yo($u.directionAt),n=Aa(u);if(f=x.some(n),e=u.getParam("object_resizing",!0),(w(e)?"table"===e:e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=function i(e,n){var r=bo.height,t=Da(e,n,r),o=la.create({beforeResize:aa(["table"]),afterResize:aa(["table"]),startDrag:aa([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());su(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());fu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}(n,t);r.on(),r.events.startDrag.bind(function(e){o=x.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();fc(u,t,Uu(t),qu(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();Yu(t),o.each(function(e){u.selection.setRng(e),u.focus()}),sc(u,n,Uu(n),qu(n)),u.undoManager.add()}),l=x.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n,r,o=e.target;if(d(o)){var i=m(o).map(function(e){return s.test(e)}).getOr(!1);i&&cc(u)?(r=o,Pe(Ae.fromDom(r),"width",Uu(r).toString()+"px")):i||!0!==u.getParam("table_responsive_width")||(t=o,n=Ae.fromDom(t),yt(n).map(function(e){return Na(n,e)}).each(function(e){Pe(n,"width",e),P($t(n,"tr"),function(t){P(Rt(t),function(e){Pe(e,"width",Na(e,t))})})})),c=e.width,a=m(o).getOr("")}}),u.on("ObjectResized",function(e){var t=e.target;if(d(t)){var n=t;if(s.test(a)){var r=parseFloat(s.exec(a)[1]),o=e.width*r/c;u.dom.setStyle(n,"width",o+"%")}else{var i=[];gc.each(n.rows,function(e){gc.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),gc.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),u.on("SwitchMode",function(){e().each(function(e){u.readonly?e.hideBars():e.showBars()})}),{lazyResize:e,lazyWire:function(){return f.getOr(ua(Ae.fromDom(u.getBody())))},destroy:function(){l.each(function(e){e.destroy()}),f.each(function(e){Ea(u,e)})}}},ka=Rr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Pa=xo({},ka,{none:function(e){return void 0===e&&(e=undefined),ka.none(e)}}),Ba=function(n,e){return sn.table(n,e).bind(function(e){var t=sn.cells(e);return L(t,function(e){return ht(n,e)}).map(function(e){return{index:S(e),all:S(t)}})})},Ma=function(t,e){return Ba(t,e).fold(function(){return Pa.none(t)},function(e){return e.index()+1<e.all().length?Pa.middle(t,e.all()[e.index()+1]):Pa.last(t)})},Wa=function(t,e){return Ba(t,e).fold(function(){return Pa.none()},function(e){return 0<=e.index()-1?Pa.middle(t,e.all()[e.index()-1]):Pa.first(t)})},_a={create:Q("start","soffset","finish","foffset")},La=Rr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ja={before:La.before,on:La.on,after:La.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},za=Rr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ha={domRange:za.domRange,relative:za.relative,exact:za.exact,exactFromRange:function(e){return za.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t,n=e.match({domRange:function(e){return Ae.fromDom(e.startContainer)},relative:function(e,t){return ja.getStart(e)},exact:function(e,t,n,r){return e}});return t=n,Ae.fromDom(t.dom().ownerDocument.defaultView)},range:_a.create},Fa=function(e,t){e.selectNodeContents(t.dom())},Ua=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},qa=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},Va=function(e){return{left:S(e.left),top:S(e.top),right:S(e.right),bottom:S(e.bottom),width:S(e.width),height:S(e.height)}},Ga=Rr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ya=function(e,t,n){return t(Ae.fromDom(n.startContainer),n.startOffset,Ae.fromDom(n.endContainer),n.endOffset)},Ka=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:S(e),rtl:x.none}},relative:function(e,t){return{ltr:Oe(function(){return Ua(o,e,t)}),rtl:Oe(function(){return x.some(Ua(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Oe(function(){return qa(o,e,t,n,r)}),rtl:Oe(function(){return x.some(qa(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Ga.rtl(Ae.fromDom(e.endContainer),e.endOffset,Ae.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Ya(0,Ga.ltr,r)}):Ya(0,Ga.ltr,r)},Xa=function(i,e){return Ka(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},$a=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Ja=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=yn(r).length,c=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var c=e(u),a=Math.abs(t-c.left);if(n<=c.bottom){if(n<c.top||i<a)return u-1;i=a}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(c)},Qa=function(e,t,n,r){return ge(t)?function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return To(i,function(e){return $a(e,r,o)?x.some(e):x.none()}).map(function(e){return Ja(t,n,r,o,e)})}(e,t,n,r):(i=t,u=n,c=r,a=(o=e).dom().createRange(),l=Rt(i),To(l,function(e){return a.selectNode(e.dom()),$a(a.getBoundingClientRect(),u,c)?Qa(o,e,u,c):x.none()}));var o,i,u,c,a,l},Za=function(e,t){return t-e.left<e.right-t},el=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},tl=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=Za(o,n);return(!0===i?On:Dn)(e).map(function(e){return el(t,e,i)})},nl=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=Za(r,n);return x.some(el(e,t,o))},rl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),c=Math.max(i.top,Math.min(i.bottom,r));return Qa(e,t,u,c)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},ol=document.caretPositionFromPoint?function(n,e,t){return x.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return x.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),x.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return x.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return Ae.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===Rt(t=r).length?nl:tl)(e,t,n);var e,t,n};return 0===Rt(r).length?e():rl(o,r,i,t).orThunk(e)})},il=function(e,t){var n=le(e);return"input"===n?ja.after(e):N(["br","img"],n)?0===t?ja.before(e):ja.after(e):ja.on(e,t)},ul=function(e,t){var n=e.fold(ja.before,il,ja.after),r=t.fold(ja.before,il,ja.after);return Ha.relative(n,r)},cl=function(e,t,n,r){var o=il(e,t),i=il(n,r);return Ha.relative(o,i)},al=function(e,t,n,r){var o,i,u,c,a,l=(i=t,u=n,c=r,(a=wt(o=e).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=ht(e,n)&&t===r;return l.collapsed&&!f},ll=function(e,t){x.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},fl=function(e,t,n,r,o){var i=qa(e,t,n,r,o);ll(e,i)},sl=function(s,e){return Ka(s,e).match({ltr:function(e,t,n,r){fl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,c,a,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,c=n,a=r,(o=l).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){fl(s,n,r,e,t)}else fl(s,n,r,e,t)}})},dl=function(e){var o=Ha.getWin(e).dom(),t=function(e,t,n,r){return qa(o,e,t,n,r)},n=e.match({domRange:function(e){var t=Ae.fromDom(e.startContainer),n=Ae.fromDom(e.endContainer);return cl(t,e.startOffset,n,e.endOffset)},relative:ul,exact:cl});return Ka(o,n).match({ltr:t,rtl:t})},ml=function(e){var t=Ae.fromDom(e.anchorNode),n=Ae.fromDom(e.focusNode);return al(t,e.anchorOffset,n,e.focusOffset)?x.some(_a.create(t,e.anchorOffset,n,e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return x.some(_a.create(Ae.fromDom(t.startContainer),t.startOffset,Ae.fromDom(n.endContainer),n.endOffset))}return x.none()}(e)},gl=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),Fa(r,n),r);ll(e,o)},pl=function(e){return(t=e,x.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(ml)).map(function(e){return Ha.exact(e.start(),e.soffset(),e.finish(),e.foffset())});var t},hl=function(e,t){var n,r,o,i=Xa(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?x.some(o).map(Va):x.none()},vl=function(e,t,n){return r=e,o=t,i=n,u=Ae.fromDom(r.document),ol(u,o,i).map(function(e){return _a.create(Ae.fromDom(e.startContainer),e.startOffset,Ae.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},bl=tinymce.util.Tools.resolve("tinymce.util.VK"),wl=function(e,t,n,r){return xl(e,t,Ma(n),r)},yl=function(e,t,n,r){return xl(e,t,Wa(n),r)},Cl=function(e,t){var n=Ha.exact(t,0,t,0);return dl(n)},Sl=function(e,t){var n,r=$t(t,"tr");return(n=r,0===n.length?x.none():x.some(n[n.length-1])).bind(function(e){return tn(e,"td,th").map(function(e){return Cl(0,e)})})},xl=function(r,e,t,o,n){return t.fold(x.none,x.none,function(e,t){return On(t).map(function(e){return Cl(0,e)})},function(n){return sn.table(n,e).bind(function(e){var t=Pr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Sl(0,e)})})},Rl=["table","li","dl"],Tl={handle:function(t,n,r,o){if(t.keyCode===bl.TAB){var i=Fu(n),u=function(e){var t=le(e);return ht(e,i)||N(Rl,t)},e=n.selection.getRng();if(e.collapsed){var c=Ae.fromDom(e.startContainer);sn.cell(c,u).each(function(e){t.preventDefault(),(t.shiftKey?yl:wl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}}},Ol={create:Q("selection","kill")},Dl=function(e,t,n,r){return{start:S(ja.on(e,t)),finish:S(ja.on(n,r))}},Al={convertToRange:function(e,t){var n=Xa(e,t);return _a.create(Ae.fromDom(n.startContainer),n.startOffset,Ae.fromDom(n.endContainer),n.endOffset)},makeSitus:Dl},El=function(n,e,r,t,o){return ht(r,t)?x.none():gr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),x.some(Ol.create(x.some(Al.makeSitus(r,0,r,xn(r))),!0))):x.none()})},Nl={sync:function(n,r,e,t,o,i,u){return ht(e,o)&&t===i?x.none():nn(e,"td,th",r).bind(function(t){return nn(o,"td,th",r).bind(function(e){return El(n,r,t,e,u)})})},detect:El,update:function(e,t,n,r,o){return hr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},Il=Q("item","mode"),kl=function(e,t,n,r){return void 0===r&&(r=Pl),e.property().parent(t).map(function(e){return Il(e,r)})},Pl=function(e,t,n,r){return void 0===r&&(r=Bl),n.sibling(e,t).map(function(e){return Il(e,r)})},Bl=function(e,t,n,r){void 0===r&&(r=Bl);var o=e.property().children(t);return n.first(o).map(function(e){return Il(e,r)})},Ml=[{current:kl,next:Pl,fallback:x.none()},{current:Pl,next:Bl,fallback:x.some(kl)},{current:Bl,next:Bl,fallback:x.some(Pl)}],Wl=function(t,n,r,o,e){return void 0===e&&(e=Ml),_(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return Wl(t,n,e,o)})})})},_l=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?x.some(e[e.length-1]):x.none()}}},Ll=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?x.some(e[0]):x.none()}}},jl=function(t,e,n,r,o,i){return Wl(t,e,r,o).bind(function(e){return i(e.item())?x.none():n(e.item())?x.some(e.item()):jl(t,e.item(),n,e.mode(),o,i)})},zl=function(t){return function(e){return 0===t.property().children(e).length}},Hl=function(e,t,n,r){return jl(e,t,n,Pl,_l(),r)},Fl=function(e,t,n,r){return jl(e,t,n,Pl,Ll(),r)},Ul=er(),ql=function(e,t){return r=t,Hl(n=Ul,e,zl(n),r);var n,r},Vl=function(e,t){return r=t,Fl(n=Ul,e,zl(n),r);var n,r},Gl=Q("element","offset"),Yl=(Q("element","deltaOffset"),Q("element","start","finish"),Q("begin","end"),Q("element","text"),Rr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),Kl=function(e){return nn(e,"tr")},Xl=xo({},Yl,{verify:function(c,e,t,n,r,a,o){return nn(n,"td,th",o).bind(function(u){return nn(e,"td,th",o).map(function(i){return ht(u,i)?ht(n,u)&&xn(u)===r?a(i):Yl.none("in same cell"):fr.sharedOne(Kl,[u,i]).fold(function(){return t=i,n=u,r=(e=c).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Yl.success():a(i);var e,t,n,r,o},function(e){return a(i)})})}).getOr(Yl.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),$l=(Q("ancestor","descendants","element","index"),Q("parent","children","element","index")),Jl=function(e,t){return L(e,b(ht,t))},Ql=function(e){return"br"===le(e)},Zl=function(e,t,n){return t(e,n).bind(function(e){return ge(e)&&0===yn(e).trim().length?Zl(e,t,n):x.some(e)})},ef=function(t,e,n,r){return(o=e,i=n,Tt(o,i).filter(Ql).orThunk(function(){return Tt(o,i-1).filter(Ql)})).bind(function(e){return r.traverse(e).fold(function(){return Zl(e,r.gather,t).map(r.relative)},function(e){return(r=e,yt(r).bind(function(t){var n=Rt(t);return Jl(n,r).map(function(e){return $l(t,n,r,e)})})).map(function(e){return ja.on(e.parent(),e.index())});var r})});var o,i},tf=function(e,t,n,r){var o,i,u;return(Ql(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Zl(i,u.gather,o)}).map(u.relative)):ef(e,t,n,r)).map(function(e){return{start:S(e),finish:S(e)}})},nf=function(e){return Xl.cata(e,function(e){return x.none()},function(){return x.none()},function(e){return x.some(Gl(e,0))},function(e){return x.some(Gl(e,xn(e)))})},rf=oe(["left","top","right","bottom"],[]),of={nu:rf,moveUp:function(e,t){return rf({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return rf({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return rf({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return rf({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return rf({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},uf=function(e){return of.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},cf=function(e,t){return x.some(e.getRect(t))},af=function(e,t,n){return me(t)?cf(e,t).map(uf):ge(t)?(r=e,o=t,i=n,0<=i&&i<xn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):x.none()).map(uf):x.none();var r,o,i},lf=function(e,t){return me(t)?cf(e,t).map(uf):ge(t)?e.getRangedRect(t,0,t,xn(t)).map(uf):x.none()},ff=Rr([{none:[]},{retry:["caret"]}]),sf=function(t,e,r){return(n=e,o=Au,Jt(function(e,t){return t(e)},Qt,n,o,i)).fold(S(!1),function(e){return lf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},df={point:of.getTop,adjuster:function(e,t,n,r,o){var i=of.moveUp(o,5);return Math.abs(n.top()-r.top())<1?ff.retry(i):n.bottom()<o.top()?ff.retry(i):n.bottom()===o.top()?ff.retry(of.moveUp(o,1)):sf(e,t,o)?ff.retry(of.translate(i,5,0)):ff.none()},move:of.moveUp,gather:ql},mf={point:of.getBottom,adjuster:function(e,t,n,r,o){var i=of.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?ff.retry(i):n.top()>o.bottom()?ff.retry(i):n.top()===o.bottom()?ff.retry(of.moveDown(o,1)):sf(e,t,o)?ff.retry(of.translate(i,5,0)):ff.none()},move:of.moveDown,gather:Vl},gf=function(n,r,o,i,u){return 0===u?x.some(i):(a=n,l=i.left(),f=r.point(i),a.elementFromPoint(l,f).filter(function(e){return"table"===le(e)}).isSome()?(t=i,c=u-1,gf(n,e=r,o,e.move(t,5),c)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(x.none,function(t){return lf(n,t).bind(function(e){return r.adjuster(n,t,e,o,i).fold(x.none,function(e){return gf(n,r,o,e,u-1)})}).orThunk(function(){return x.some(i)})},x.none)}));var e,t,c,a,l,f},pf=function(t,n,e){var r,o,i,u=t.move(e,5),c=gf(n,t,e,u,100).getOr(u);return(r=t,o=c,i=n,r.point(o)>i.getInnerHeight()?x.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?x.some(-r.point(o)):x.none()).fold(function(){return n.situsFromPoint(c.left(),t.point(c))},function(e){return n.scrollBy(0,e),n.situsFromPoint(c.left(),t.point(c)-e)})},hf={tryUp:b(pf,df),tryDown:b(pf,mf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:S(5)},vf=st.detect(),bf=function(r,o,i,u,c,a){return 0===a?x.none():Cf(r,o,i,u,c).bind(function(e){var t=r.fromSitus(e),n=Xl.verify(r,i,u,t.finish(),t.foffset(),c.failure,o);return Xl.cata(n,function(){return x.none()},function(){return x.some(e)},function(e){return ht(i,e)&&0===u?wf(r,i,u,of.moveUp,c):bf(r,o,e,0,c,a-1)},function(e){return ht(i,e)&&u===xn(e)?wf(r,i,u,of.moveDown,c):bf(r,o,e,xn(e),c,a-1)})})},wf=function(t,e,n,r,o){return af(t,e,n).bind(function(e){return yf(t,o,r(e,hf.getJumpSize()))})},yf=function(e,t,n){return vf.browser.isChrome()||vf.browser.isSafari()||vf.browser.isFirefox()||vf.browser.isEdge()?t.otherRetry(e,n):vf.browser.isIE()?t.ieRetry(e,n):x.none()},Cf=function(t,e,n,r,o){return af(t,n,r).bind(function(e){return yf(t,o,e)})},Sf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return tf(i,r.finish(),r.foffset(),u).fold(function(){return x.some(Gl(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Xl.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return nf(n)})})).bind(function(e){return bf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},xf=st.detect(),Rf=function(e,t){return Qt(e,function(e){return yt(e).exists(function(e){return ht(e,t)})},n).isSome();var n},Tf=function(t,r,o,e,i){return nn(e,"td,th",r).bind(function(n){return nn(n,"table",r).bind(function(e){return Rf(i,e)?Sf(t,r,o).bind(function(t){return nn(t.finish(),"td,th",r).map(function(e){return{start:S(n),finish:S(e),range:S(t)}})}):x.none()})})},Of=function(e,t,n,r,o,i){return xf.browser.isIE()?x.none():i(r,t).orThunk(function(){return Tf(e,t,n,r,o).map(function(e){var t=e.range();return Ol.create(x.some(Al.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Df=function(e,t,n,r,o,i,u){return Tf(e,n,r,o,i).bind(function(e){return Nl.detect(t,n,e.start(),e.finish(),u)})},Af=function(e,u){return nn(e,"tr",u).bind(function(i){return nn(i,"table",u).bind(function(e){var t,n,r,o=$t(e,"tr");return ht(i,o[0])?(t=e,n=function(e){return Dn(e).isSome()},r=u,Hl(Ul,t,n,r)).map(function(e){var t=xn(e);return Ol.create(x.some(Al.makeSitus(e,t,e,t)),!0)}):x.none()})})},Ef=function(e,u){return nn(e,"tr",u).bind(function(i){return nn(i,"table",u).bind(function(e){var t,n,r,o=$t(e,"tr");return ht(i,o[o.length-1])?(t=e,n=function(e){return On(e).isSome()},r=u,Fl(Ul,t,n,r)).map(function(e){return Ol.create(x.some(Al.makeSitus(e,0,e,0)),!0)}):x.none()})})},Nf=function(e,t){return nn(e,"td,th",t)};var If={down:{traverse:xt,gather:Vl,relative:ja.before,otherRetry:hf.tryDown,ieRetry:hf.ieTryDown,failure:Xl.failedDown},up:{traverse:St,gather:ql,relative:ja.before,otherRetry:hf.tryUp,ieRetry:hf.ieTryUp,failure:Xl.failedUp}},kf=function(t){return function(e){return e===t}},Pf=kf(38),Bf=kf(40),Mf={ltr:{isBackward:kf(37),isForward:kf(39)},rtl:{isBackward:kf(39),isForward:kf(37)},isUp:Pf,isDown:Bf,isNavigation:function(e){return 37<=e&&e<=40}},Wf=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},_f=(st.detect().browser.isSafari(),function(c){return{elementFromPoint:function(e,t){return Ae.fromPoint(Ae.fromDom(c.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Ha.exact(e,t,n,r);return hl(c,o).map(Wf)},getSelection:function(){return pl(c).map(function(e){return Al.convertToRange(c,e)})},fromSitus:function(e){var t=Ha.relative(e.start(),e.finish());return Al.convertToRange(c,t)},situsFromPoint:function(e,t){return vl(c,e,t).map(function(e){return Dl(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){c.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=c,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=cl(n,r,o,i),sl(t,u)},setRelativeSelection:function(e,t){var n,r;n=c,r=ul(e,t),sl(n,r)},selectContents:function(e){gl(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){var e,t,n,r;return(e=Ae.fromDom(c.document),t=e!==undefined?e.dom():m.document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,ro(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=Ae.fromDom(c.document))!==undefined?o.dom():m.document).defaultView.scrollBy(n,r)}}}),Lf=Q("rows","cols"),jf={mouse:function(e,t,n,r){var o=function c(o,i,t,u){var n=x.none(),r=function(){n=x.none()};return{mousedown:function(e){u.clear(i),n=Nf(e.target(),t)},mouseover:function(e){n.each(function(r){u.clear(i),Nf(e.target(),t).each(function(n){gr(r,n,t).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!ht(r,n))&&(u.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(e){n.each(r)}}}(_f(e),t,n,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(e,l,f,s){var d=_f(e),m=function(){return s.clear(l),x.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw(),c=u.which,a=!0===u.shiftKey;return pr(l,s.selectedSelector()).fold(function(){return Mf.isDown(c)&&a?b(Df,d,l,f,If.down,r,t,s.selectRange):Mf.isUp(c)&&a?b(Df,d,l,f,If.up,r,t,s.selectRange):Mf.isDown(c)?b(Of,d,f,If.down,r,t,Ef):Mf.isUp(c)?b(Of,d,f,If.up,r,t,Af):x.none},function(t){var e=function(e){return function(){return To(e,function(e){return Nl.update(e.rows(),e.cols(),l,t,s)}).fold(function(){return vr(l,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(e){var t=Mf.isDown(c)||i.isForward(c)?ja.after:ja.before;return d.setRelativeSelection(ja.on(e.first(),0),t(e.table())),s.clear(l),Ol.create(x.none(),!0)})},function(e){return x.some(Ol.create(x.none(),!0))})}};return Mf.isDown(c)&&a?e([Lf(1,0)]):Mf.isUp(c)&&a?e([Lf(-1,0)]):i.isBackward(c)&&a?e([Lf(0,-1),Lf(-1,0)]):i.isForward(c)&&a?e([Lf(0,1),Lf(1,0)]):Mf.isNavigation(c)&&!1===a?m:x.none})()},keyup:function(n,r,o,i,u){return pr(l,s.selectedSelector()).fold(function(){var e=n.raw(),t=e.which;return 0==(!0===e.shiftKey)?x.none():Mf.isNavigation(t)?Nl.sync(l,f,r,o,i,u,s.selectRange):x.none()},x.none)}}}},zf=function(t,e){P(e,function(e){!function(e,t){No(e)?e.dom().classList.remove(t):ko(e,t);Bo(e)}(t,e)})},Hf={byClass:function(o){var t,n,i=(t=o.selected(),function(e){Po(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){zf(e,n)}),u=function(e){var t=$t(e,o.selectedSelector());P(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),P(t,i),Po(n,o.firstSelected()),Po(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){ye(e,o.selected()),ye(e,o.firstSelected()),ye(e,o.lastSelected())},i=function(e){he(e,o.selected(),"1")},u=function(e){var t=$t(e,o.selectedSelector());P(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),P(t,i),he(n,o.firstSelected(),"1"),he(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},Ff=function(e){return!1===Mo(Ae.fromDom(e.target),"ephox-snooker-resizer-bar")};function Uf(p,h){var v=oe(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=x.none(),w=Hf.byAttr(xr);p.on("init",function(e){var r=p.getWin(),o=Fu(p),t=Vu(p),n=jf.mouse(r,o,t,w),c=jf.keyboard(r,o,t,w),a=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=Ha.relative(e.start(),e.finish()),n=Xa(r,t);p.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&Mf.isNavigation(t.raw().which)){var n=p.selection.getRng(),r=Ae.fromDom(n.startContainer),o=Ae.fromDom(n.endContainer);c.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){a(t,e)})}},u=function(e){var t=f(e);h().each(function(e){e.hideBars()});var n=p.selection.getRng(),r=Ae.fromDom(p.selection.getStart()),o=Ae.fromDom(n.startContainer),i=Ae.fromDom(n.endContainer),u=$u.directionAt(r).isRtl()?Mf.rtl:Mf.ltr;c.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){a(t,e)}),h().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=Ae.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=C(r,n);return{target:S(t),x:S(l(e)?e.x:null),y:S(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:S(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&Ff(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!Ff(e)||n.mouseover(f(e))},g=function(e){s(e)&&Ff(e)&&n.mouseup(f(e))};p.on("mousedown",d),p.on("mouseover",m),p.on("mouseup",g),p.on("keyup",i),p.on("keydown",u),p.on("NodeChange",function(){var e=p.selection,t=Ae.fromDom(e.getStart()),n=Ae.fromDom(e.getEnd());fr.sharedOne(sn.table,[t,n]).fold(function(){w.clear(o)},y)}),b=x.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))});return{clear:w.clear,destroy:function(){b.each(function(e){})}}}var qf=function(t){return{get:function(){var e=Fu(t);return br(e,xr.selectedSelector()).fold(function(){return t.selection.getStart()===undefined?Or.none():Or.single(t.selection)},function(e){return Or.multiple(e)})}}},Vf=function(e,n){var o=l(x.none()),i=l([]),t=function(){return ra(e).bind(function(t){return sn.table(t).map(function(e){return"caption"===le(t)?Pr.notCell(t):Pr.forMenu(n,e,t)})})},r=function(){o.set(Oe(t)()),P(i.get(),function(e){return e()})},u=function(t,n){var r=function(){return o.get().fold(function(){t.setDisabled(!0)},function(e){t.setDisabled(n(e))})};return r(),i.set(i.get().concat([r])),function(){i.set(B(i.get(),function(e){return e!==r}))}};return e.on("NodeChange",r),{onSetupTable:function(e){return u(e,function(e){return!1})},onSetupCellOrRow:function(e){return u(e,function(e){return"caption"===le(e.element())})},onSetupMergeable:function(e){return u(e,function(e){return e.mergable().isNone()})},onSetupUnmergeable:function(e){return u(e,function(e){return e.unmergable().isNone()})},resetTargets:r,targets:function(){return o.get()}}},Gf={addButtons:function(t,e){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable tableprops deletetable | cell row column")}});var n=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:n("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:n("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:n("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:n("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:n("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:n("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:n("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:n("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:n("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:n("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:n("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:n("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",onAction:n("mceTableCutRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",onAction:n("mceTableCopyRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",onAction:n("mceTablePasteRowBefore"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",onAction:n("mceTablePasteRowAfter"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:n("mceInsertTable"),icon:"table"})},addToolbars:function(t){var e=t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol");0<e.length&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}},Yf={addMenuItems:function(r,e){var t=function(e){return function(){return r.execCommand(e)}},n=function(e){var t=e.numRows,n=e.numColumns;r.undoManager.transact(function(){$c(r,n,t)}),r.addVisual()},o={text:"Table properties",onSetup:e.onSetupTable,onAction:t("mceTableProps")},i={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:t("mceTableDelete")},u=[{type:"menuitem",text:"Insert row before",icon:"table-insert-row-above",onAction:t("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert row after",icon:"table-insert-row-after",onAction:t("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete row",icon:"table-delete-row",onAction:t("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Row properties",icon:"table-row-properties",onAction:t("mceTableRowProps"),onSetup:e.onSetupCellOrRow},{type:"separator"},{type:"menuitem",text:"Cut row",onAction:t("mceTableCutRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Copy row",onAction:t("mceTableCopyRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row before",onAction:t("mceTablePasteRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row after",onAction:t("mceTablePasteRowAfter"),onSetup:e.onSetupCellOrRow}],c={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return u}},a=[{type:"menuitem",text:"Insert column before",icon:"table-insert-column-before",onAction:t("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert column after",icon:"table-insert-column-after",onAction:t("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete column",icon:"table-delete-column",onAction:t("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}],l={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return a}},f=[{type:"menuitem",text:"Cell properties",icon:"table-cell-properties",onAction:t("mceTableCellProps"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Merge cells",icon:"table-merge-cells",onAction:t("mceTableMergeCells"),onSetup:e.onSetupMergeable},{type:"menuitem",text:"Split cell",icon:"table-split-cells",onAction:t("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}],s={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return f}};return!1===r.getParam("table_grid",!0,"boolean")?r.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:t("mceInsertTable")}):r.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:n}]}}),r.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:t("mceInsertTable")}),r.ui.registry.addMenuItem("tableprops",o),r.ui.registry.addMenuItem("deletetable",i),r.ui.registry.addNestedMenuItem("row",c),r.ui.registry.addNestedMenuItem("column",l),r.ui.registry.addNestedMenuItem("cell",s),r.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold(function(){return""},function(e){return"caption"===le(e.element())?"tableprops deletetable":"cell row column | tableprops deletetable"})}}),{rowItems:u,columnItems:a,cellItems:f}}},Kf=function(n,r,e,t,o){return{insertTable:function(e,t){return $c(n,e,t)},setClipboardRows:function(e){return t=r,n=k(e,Ae.fromDom),void t.set(x.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return k(e,function(e){return e.dom()})})},resizeHandler:e,menuItems:o,selectionTargets:t}};function Xf(t){var n=Ia(t),e=Uf(t,n.lazyResize),r=dc(t,n.lazyWire),o=qf(t),i=Vf(t,o),u=l(x.none());ia.registerCommands(t,r,e,o,u),Br.registerEvents(t,o,r,e);var c=Yf.addMenuItems(t,i);return Gf.addButtons(t,i),Gf.addToolbars(t),t.on("PreInit",function(){t.serializer.addTempAttr(xr.firstSelected()),t.serializer.addTempAttr(xr.lastSelected())}),tc(t)&&t.on("keydown",function(e){Tl.handle(e,t,r,n.lazyWire)}),t.on("remove",function(){n.destroy(),e.destroy()}),Kf(t,u,n,i,c)}!function Jf(){h.add("table",Xf)}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(){return e}};var n,r,a,o,u,c=t(!1),i=t(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.getParam("template_cdate_classes","cdate")},s=function(e){return e.getParam("template_mdate_classes","mdate")},f=function(e){return e.getParam("template_selected_content_classes","selcontent")},d=function(e){return e.getParam("template_preview_replace_values")},g=function(e){return e.getParam("template_replace_values")},y=function(e){return e.templates},v=function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},h=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},b=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},O=function(e,t,n){var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",b(n.getMonth()+1,2))).replace("%d",b(n.getDate(),2))).replace("%H",""+b(n.getHours(),2))).replace("%M",""+b(n.getMinutes(),2))).replace("%S",""+b(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},T=function(n,e){return p.each(e,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n},M=function(e,t){var r=e.dom,a=g(e);p.each(r.select("*",t),function(n){p.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeof a[t]&&a[t](n)})})},S=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},_=function(t,n){return function(){var e=y(t);"function"!=typeof e?"string"==typeof e?m.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=T,P=M,A=function(t,e,n){var r,a,o=t.dom,u=t.selection.getContent();n=T(n,g(t)),r=o.create("div",null,n),(a=o.select(".mceTmpl",r))&&0<a.length&&(r=o.create("div",null)).appendChild(a[0].cloneNode(!0)),p.each(o.select("*",r),function(e){S(e,l(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,v(t))),S(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,h(t))),S(e,f(t).replace(/\s+/g,"|"))&&(e.innerHTML=u)}),M(t,r),t.execCommand("mceInsertContent",!1,r.innerHTML),t.addVisual()},w=function(e){e.addCommand("mceInsertTemplate",function t(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}(A,e))},D=function(r){r.on("PreProcess",function(e){var t=r.dom,n=h(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=O(r,n))}),P(r,e))})})},C=c,N=i,H=function(){return k},k=(o={fold:function(e,t){return e()},is:C,isSome:C,isNone:N,getOr:a=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:r,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:C,forall:N,filter:H,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(o),o),I=function(n){var e=function(){return n},t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:N,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return I(e(n))},ap:function(e){return e.fold(H,function(e){return I(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?a:k},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(C,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},J={some:I,none:H,from:function(e){return null===e||e===undefined?k:I(e)}},L=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===u}),Y=Array.prototype.slice,j=(L(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),q=Object.hasOwnProperty,F=function(e,t){return q.call(e,t)},B={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},E=function(e){return e.replace(/["'<>&]/g,function(e){return(t=B,n=e,F(t,n)?J.from(t[n]):J.none()).getOr(e);var t,n})},R=function(l,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a,e)}return r}(e,function(e){return{text:e.text,value:e.text}})},s=function(e,t){return function(e,t){for(var n=0,r=e.length;n<r;n++){var a=e[n];if(t(a,n,e))return J.some(a)}return J.none()}(e,function(e){return e.text===t})},f=function(e){return new j(function(t,n){e.value.url?m.send({url:e.value.url,success:function(e){t(e)},error:function(e){n(e)}}):t(e.value.content)})};(function(){if(t&&0!==t.length)return J.from(p.map(t,function(e,t){return{selected:0===t,text:e.title,value:{url:e.url,content:e.content,description:e.description}}}));var e=l.translate("No templates defined.");return l.notificationManager.open({text:e,type:"info"}),J.none()})().each(function(o){var u=e(o),c=function(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:(n=o,function(t){var e=t.getData();s(n,e.template).each(function(e){f(e).then(function(e){A(l,!1,e),t.close()})})}),onChange:(r=o,a=i,function(n,e){if("template"===e.name){var t=n.getData().template;s(r,t).each(function(t){n.block("Loading..."),f(t).then(function(e){a(n,t,e),n.unblock()})})}})};var r,a,n},i=function(e,t,n){var r=function(t,e){if(-1===e.indexOf("<html>")){var n="";p.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+t.documentBaseURI.toAbsolute(e)+'">'});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var a=t.dom.encode,o=t.getBody().dir,u=o?' dir="'+a(o)+'"':"";e="<!DOCTYPE html><html><head>"+n+'</head><body class="'+a(r)+'"'+u+">"+e+"</body></html>"}return x(e,d(t))}(l,n),a=[{type:"selectbox",name:"template",label:"Templates",items:u},{type:"htmlpanel",html:'<p aria-live="polite">'+E(t.value.description)+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],o={template:t.text,preview:r};e.unblock(),e.redial(c(a,o)),e.focus("template")},t=l.windowManager.open(c([],{template:"",preview:""}));t.block("Loading..."),f(o[0]).then(function(e){i(t,o[0],e)})})},z=function(t){return function(e){R(t,e)}},U=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:_(e.settings,z(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:_(e.settings,z(e))})};!function W(){e.add("template",function(e){U(e),w(e),D(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(f){"use strict";var t,n,e,r,o,a=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return a(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){},c=function(t){return function(){return t}},s=function(t){return t},l=c(!1),d=c(!0),m=l,g=d,p=function(){return h},h=(r={fold:function(t,n){return t()},is:m,isSome:m,isNone:g,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:n,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:m,forall:g,filter:p,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),v=function(e){var t=function(){return e},n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:g,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return v(t(e))},ap:function(t){return t.fold(p,function(t){return v(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(e)?o:h},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(m,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},y={some:v,none:p,from:function(t){return null===t||t===undefined?h:v(t)}},k=function(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}},b=k("string"),O=k("object"),w=k("array"),E=k("function"),C=Array.prototype.slice,x=(o=Array.prototype.indexOf)===undefined?function(t,n){return S(t,n)}:function(t,n){return o.call(t,n)},T=function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var a=t[o];r[o]=n(a,o,t)}return r},N=function(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e,t)}},R=function(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var a=t[r];n(a,r,t)&&e.push(a)}return e},P=function(t,n,e){return function(t,n){for(var e=t.length-1;0<=e;e--)n(t[e],e,t)}(t,function(t){e=n(e,t)}),e},S=function(t,n){for(var e=0,r=t.length;e<r;++e)if(t[e]===n)return e;return-1},M=function(t,n){for(var e=0,r=t.length;e<r;++e){if(!0!==n(t[e],e,t))return!1}return!0},A=(E(Array.from)&&Array.from,Object.keys),D=Object.hasOwnProperty,j=function(t,n){return D.call(t,n)},B=function(i){if(!w(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var u=[],e={};return N(i,function(t,r){var n=A(t);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],a=t[o];if(e[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!w(a))throw new Error("case arguments must be an array");u.push(o),e[o]=function(){var t=arguments.length;if(t!==a.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);return arguments[r].apply(null,e)},match:function(t){var n=A(t);if(u.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!M(u,function(t){return-1<x(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));return t[o].apply(null,e)},log:function(t){f.console.log(t,{constructors:u,constructor:o,params:e})}}}}),e},I=(B([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var n=[],e=[];return N(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}),_=function(e){return{is:function(t){return e===t},isValue:d,isError:l,getOr:c(e),getOrThunk:c(e),getOrDie:c(e),or:function(t){return _(e)},orThunk:function(t){return _(e)},fold:function(t,n){return n(e)},map:function(t){return _(t(e))},mapError:function(t){return _(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return y.some(e)}}},L=function(e){return{is:l,isValue:l,isError:d,getOr:s,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(e),function(){throw new Error(t)}();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return L(e)},mapError:function(t){return L(t(e))},each:u,bind:function(t){return L(e)},exists:l,forall:d,toOption:y.none}},U={value:_,error:L,fromOption:function(t,n){return t.fold(function(){return L(n)},_)}},q=function(t){return"inline-command"===t.type||"inline-format"===t.type},V=function(t){return"block-command"===t.type||"block-format"===t.type},W=function(t){return n=t,e=function(t,n){return t.start.length===n.start.length?0:t.start.length>n.start.length?-1:1},(r=C.call(n,0)).sort(e),r;var n,e,r},X=function(o){var a=function(t){return U.error({message:t,pattern:o})},t=function(t,n,e){if(o.format===undefined)return o.cmd!==undefined?b(o.cmd)?U.value(e(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var r=void 0;if(w(o.format)){if(!M(o.format,b))return a(t+" pattern has non-string items in the `format` array");r=o.format}else{if(!b(o.format))return a(t+" pattern has non-string `format` parameter");r=[o.format]}return U.value(n(r))};if(!O(o))return a("Raw pattern is not an object");if(!b(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?b(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):U.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!b(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var e=o.start,r=o.end;return 0===r.length&&(r=e,e=""),t("Inline",function(t){return{type:"inline-format",start:e,end:r,format:t}},function(t,n){return{type:"inline-command",start:e,end:r,cmd:t,value:n}})},z=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},F=function(t){return{inlinePatterns:R(t,q),blockPatterns:W(R(t,V))}},J=function(r){return{setPatterns:function(t){var n=I(T(t,X));if(0<n.errors.length){var e=n.errors[0];throw new Error(e.message+":\n"+JSON.stringify(e.pattern,null,2))}r.set(F(n.values))},getPatterns:function(){return T(r.get().inlinePatterns,z).concat(T(r.get().blockPatterns,z))}}},K="undefined"!=typeof f.window?f.window:Function("return this;")(),G=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=K.console;e&&(e.error?e.error.apply(e,t):e.log.apply(e,t))},H=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],Q=function(t){var n,e,r=(n=t,e="textpattern_patterns",j(n,e)?y.from(n[e]):y.none()).getOr(H);if(!w(r))return G("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var o=I(T(r,X));return N(o.errors,function(t){return G(t.message,t.pattern)}),F(o.values)},Y=tinymce.util.Tools.resolve("tinymce.util.Delay"),Z=tinymce.util.Tools.resolve("tinymce.util.VK"),$=tinymce.util.Tools.resolve("tinymce.util.Tools"),tt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),nt=function(t){return t.nodeType===f.Node.TEXT_NODE},et=function(t,n,e){if(n&&t.isEmpty(n)&&!e(n)){var r=n.parentNode;t.remove(n),et(t,r,e)}},rt=function(t,n,e,r){void 0===r&&(r=!0);var o=n.startContainer.parentNode,a=n.endContainer.parentNode;n.deleteContents(),r&&!e(n.startContainer)&&(nt(n.startContainer)&&0===n.startContainer.data.length&&t.remove(n.startContainer),nt(n.endContainer)&&0===n.endContainer.data.length&&t.remove(n.endContainer),et(t,o,e),o!==a&&et(t,a,e))},ot=function(t,n){var e,r=n.get(t);return w(r)&&(e=r,0===e.length?y.none():y.some(e[0])).exists(function(t){return j(t,"block")})},at=function(t){return 0===t.start.length},it=function(t,n){return function(t,n){for(var e=0,r=t.length;e<r;e++){var o=t[e];if(n(o,e,t))return y.some(o)}return y.none()}(t,function(t){return 0===n.indexOf(t.start)&&(!j(t,"end")||!t.end||n.lastIndexOf(t.end)===n.length-t.end.length)})},ut=function(t,n){return{element:t,offset:n}},ft=function(t,n){var e=new tt(t,n),r=function(t){for(var n=e[t]();n&&n.nodeType!==f.Node.TEXT_NODE;)n=e[t]();return n&&n.nodeType===f.Node.TEXT_NODE?y.some(n):y.none()};return{next:function(){return r("next")},prev:function(){return r("prev")},prev2:function(){return r("prev2")}}},ct=function(t,n,e){return nt(t)&&0<=n?y.some(ut(t,n)):ft(t,e).prev().map(function(t){return ut(t,t.data.length)})},st=function(t,e,r){if(!nt(t))return y.none();var n=t.textContent;return 0<=e&&e<=n.length?y.some(ut(t,e)):ft(t,r).prev().bind(function(t){var n=t.textContent;return st(t,e+n.length,r)})},lt=function(t,n,e){if(!nt(t))return y.none();var r=t.textContent;return n<=r.length?y.some(ut(t,n)):ft(t,e).next().bind(function(t){return lt(t,n-r.length,e)})},dt=B([{aborted:[]},{edge:["element"]},{success:["info"]}]),mt=B([{abort:[]},{kontinue:[]},{finish:["info"]}]),gt=function(n,e,t,r,o,a){var i=function(){return a.fold(dt.aborted,dt.edge)},u=function(){var t=o();return t?gt(n,t,y.none(),r,o,y.some(e)):i()};if(n.isBlock(e))return i();if(nt(e)){var f=e.textContent;return r(mt,e,f,t).fold(dt.aborted,function(){return u()},dt.success)}return u()},pt=function(t,n,e){if(nt(n)&&(e<0||e>n.data.length))return[];for(var r=[e],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i<a.childNodes.length;i++)if(a.childNodes[i]===o){r.push(i);break}o=a}return o===t?r.reverse():[]},ht=function(t,n,e,r,o){return{start:pt(t,n,e),end:pt(t,r,o)}},vt=function(t,n){var e,r,o,a=n.slice(),i=a.pop();return(e=a,r=function(t,n){return t.bind(function(t){return y.from(t.childNodes[n])})},o=y.some(t),N(e,function(t){o=r(o,t)}),o).bind(function(t){return nt(t)&&0<=i&&t.data.length,y.some({node:t,offset:i})})},yt=function(n,e){return vt(n,e.start).bind(function(t){var o=t.node,a=t.offset;return vt(n,e.end).map(function(t){var n=t.node,e=t.offset,r=f.document.createRange();return r.setStart(o,a),r.setEnd(n,e),r})})},kt=function(r,o,t){ft(o,o).next().each(function(e){lt(e,t.start.length,o).each(function(t){var n=r.createRng();n.setStart(e,0),n.setEnd(t.element,t.offset),rt(r,n,function(t){return t===o})})})},bt=function(t,n){var e=t.dom,r=t.selection.getRng(),o=e.getParent(r.startContainer,e.isBlock);if(!e.is(o,"p")||o.nodeType!==f.Node.ELEMENT_NODE)return[];var a=o.textContent;return it(n,a).map(function(t){return $.trim(a).length===t.start.length?[]:[{pattern:t,range:ht(e.getRoot(),o,0,o,0)}]}).getOr([])},Ot=function(u,t){if(0!==t.length){var n=u.selection.getBookmark();N(t,function(t){return e=t,r=(n=u).dom,o=e.pattern,a=yt(r.getRoot(),e.range).getOrDie("Unable to resolve path range"),i=r.getParent(a.startContainer,r.isBlock),"block-format"===o.type?ot(o.format,n.formatter)&&n.undoManager.transact(function(){kt(n.dom,i,o),n.formatter.apply(o.format)}):"block-command"===o.type&&n.undoManager.transact(function(){kt(n.dom,i,o),n.execCommand(o.cmd,!1,o.value)}),!0;var n,e,r,o,a,i}),u.selection.moveToBookmark(n)}},wt=function(){return(wt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Et=0,Ct=function(t,n){return t.create("span",{"data-mce-type":"bookmark",id:n})},xt=function(t,n){var e=t.createRng();return e.setStartAfter(n.start),e.setEndBefore(n.end),e},Tt=function(t,n,e){var r=yt(t.getRoot(),e).getOrDie("Unable to resolve path range"),o=r.startContainer,a=r.endContainer,i=0===r.endOffset?a:a.splitText(r.endOffset),u=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:n,end:i.parentNode.insertBefore(Ct(t,n+"-end"),i),start:u.parentNode.insertBefore(Ct(t,n+"-start"),u)}},Nt=function(t,n,e){et(t,t.get(n.prefix+"-end"),e),et(t,t.get(n.prefix+"-start"),e)},Rt=function(i,u,t,n,l,d){if(void 0===d&&(d=!1),0!==u.start.length||d)return ct(t,n,l).bind(function(n){var t,e,r,o,a,f,c,s;return(t=i,e=n.element,r=n.offset,f=i,c=l,s=u.start,o=function(e,r,t,n){if(r===c)return e.abort();var o=t.substring(0,n.getOr(t.length)),a=o.lastIndexOf(s.charAt(s.length-1)),i=o.lastIndexOf(s);if(-1===i)return-1!==a?st(r,a+1-s.length,c).fold(function(){return e.kontinue()},function(t){var n=f.createRng();return n.setStart(t.element,t.offset),n.setEnd(r,a+1),n.toString()===s?e.finish(n):e.kontinue()}):e.kontinue();var u=f.createRng();return u.setStart(r,i),u.setEnd(r,i+s.length),e.finish(u)},a=new tt(e,l),gt(t,e,y.some(r),o,a.prev,y.none())).fold(y.none,y.none,y.some).bind(function(t){if(d){if(t.endContainer===n.element&&t.endOffset===n.offset)return y.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return y.none()}return y.some(t)})});var e=i.createRng();return e.setStart(t,n),e.setEnd(t,n),y.some(e)},Pt=function(a,i,u){var f=a.dom,c=f.getRoot(),s=u.pattern,l=u.position.element,d=u.position.offset;return st(l,d-u.pattern.end.length,i).bind(function(t){var r=ht(c,t.element,t.offset,l,d);if(at(s))return y.some({matches:[{pattern:s,startRng:r,endRng:r}],position:t});var n=St(a,u.remainingPatterns,t.element,t.offset,i),o=n.getOr({matches:[],position:t}),e=o.position;return Rt(f,s,e.element,e.offset,i,n.isNone()).map(function(t){var n,e=ht(c,(n=t).startContainer,n.startOffset,n.endContainer,n.endOffset);return{matches:o.matches.concat([{pattern:s,startRng:e,endRng:r}]),position:ut(t.startContainer,t.startOffset)}})})},St=function(d,m,g,p,h){var v=d.dom;return ct(g,p,v.getRoot()).bind(function(t){var n=v.createRng();n.setStart(h,0),n.setEnd(g,p);for(var e,r,o,a,i,u=n.toString(),f=0;f<m.length;f++){var c=m[f];if(e=u,r=c.end,i=a=o=void 0,a=r,i=(o=e).length-r.length,""===a||!(o.length<a.length||o.substr(i,i+a.length)!==a)){var s=m.slice();s.splice(f,1);var l=Pt(d,h,{pattern:c,remainingPatterns:s,position:t});if(l.isSome())return l}}return y.none()})},Mt=function(n,t,e){n.selection.setRng(e),"inline-format"===t.type?N(t.format,function(t){n.formatter.apply(t)}):n.execCommand(t.cmd,!1,t.value)},At=function(o,t){var n,e,a=(n="mce_textpattern",e=(new Date).getTime(),n+"_"+Math.floor(1e9*Math.random())+ ++Et+String(e)),i=P(t,function(t,n){var e=Tt(o,a+"_end"+t.length,n.endRng);return t.concat([wt({},n,{endMarker:e})])},[]);return P(i,function(t,n){var e=i.length-t.length-1,r=at(n.pattern)?n.endMarker:Tt(o,a+"_start"+e,n.startRng);return t.concat([wt({},n,{startMarker:r})])},[])},Dt=function(t,n,e){var r=t.selection.getRng();if(!1===r.collapsed)return[];var o=t.dom.getParent(r.startContainer,t.dom.isBlock),a=r.startOffset-(e?1:0);return St(t,n,r.startContainer,a,o).fold(function(){return[]},function(t){return t.matches})},jt=function(f,t){if(0!==t.length){var c=f.dom,n=f.selection.getBookmark(),e=At(c,t);N(e,function(t){var n,e,r,o,a,i=c.getParent(t.startMarker.start,c.isBlock),u=function(t){return t===i};at(t.pattern)?(n=f,e=t.pattern,r=t.endMarker,o=u,a=xt(n.dom,r),rt(n.dom,a,o),Mt(n,e,a)):function(t,n,e,r,o){var a=t.dom,i=xt(a,r),u=xt(a,e);rt(a,u,o),rt(a,i,o);var f={prefix:e.prefix,start:e.end,end:r.start},c=xt(a,f);Mt(t,n,c)}(f,t.pattern,t.startMarker,t.endMarker,u),Nt(c,t.endMarker,u),Nt(c,t.startMarker,u)}),f.selection.moveToBookmark(n)}},Bt=function(t,n,e){for(var r=0;r<t.length;r++)if(e(t[r],n))return!0},It=function(e,t){if(!e.selection.isCollapsed())return!1;var r=Dt(e,t.inlinePatterns,!1),o=bt(e,t.blockPatterns);return(0<o.length||0<r.length)&&(e.undoManager.add(),e.undoManager.extra(function(){e.execCommand("mceInsertNewLine")},function(){e.insertContent("\ufeff"),jt(e,r),Ot(e,o);var t=e.selection.getRng(),n=ct(t.startContainer,t.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),n.each(function(t){"\ufeff"===t.element.data.charAt(t.offset-1)&&(t.element.deleteData(t.offset-1,1),et(e.dom,t.element.parentNode,function(t){return t===e.dom.getRoot()}))})}),!0)},_t=function(t,n){var e=Dt(t,n.inlinePatterns,!0);0<e.length&&t.undoManager.transact(function(){jt(t,e)})},Lt=function(t,n){return Bt(t,n,function(t,n){return t.charCodeAt(0)===n.charCode})},Ut=function(t,n){return Bt(t,n,function(t,n){return t===n.keyCode&&!1===Z.modifierPressed(n)})},qt=function(n,e){var r=[",",".",";",":","!","?"],o=[32];n.on("keydown",function(t){13!==t.keyCode||Z.modifierPressed(t)||It(n,e.get())&&t.preventDefault()},!0),n.on("keyup",function(t){Ut(o,t)&&_t(n,e.get())}),n.on("keypress",function(t){Lt(r,t)&&Y.setEditorTimeout(n,function(){_t(n,e.get())})})};!function Vt(){i.add("textpattern",function(t){var n=a(Q(t.settings));return qt(t,n),J(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return t.getParam("toc_class","mce-toc")},m=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},c=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},l=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),u=function u(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},v=function(n){var o=a(n),t=m(n),e=u(c(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:l(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},d=function(t){var e,n,o,r,i,c,a,l="",u=v(t),d=function(t){var e,n=9;for(e=0;e<t.length;e++)if(t[e].level<n&&(n=t[e].level),1===n)return n;return n}(u)-1;if(!u.length)return"";for(l+=(i=m(t),c=f.translate("Table of Contents"),a="</"+i+">","<"+i+' contenteditable="true">'+s.DOM.encode(c)+a),e=0;e<u.length;e++){if((o=u[e]).element.id=o.id,r=u[e+1]&&u[e+1].level,d===o.level)l+="<li>";else for(n=d;n<o.level;n++)l+="<ul><li>";if(l+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)l+="</li></ul><li>";else l+="</li>",r||(l+="</ul>");d=o.level}return l},g=function(t){var e=a(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})},o={hasHeaders:function(t){return 0<v(t).length},insertToc:function(t){var e,n,o,r,i=a(t),c=t.$("."+i);o=t,!(r=c).length||0<o.dom.getParents(r[0],".mce-offscreen-selection").length?t.insertContent((n=d(e=t),'<div class="'+e.dom.encode(a(e))+'" contenteditable="false">'+n+"</div>")):g(t)},updateToc:g},e=function(t){t.addCommand("mceInsertToc",function(){o.insertToc(t)}),t.addCommand("mceUpdateToc",function(){o.updateToc(t)})},n=function(t){var n=t.$,o=a(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},r=function(n){return function(t){var e=function(){return t.setDisabled(n.readonly||!o.hasHeaders(n))};return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}},h=function(t){var e;t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:r(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:r(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(e=t,function(t){return t&&e.dom.is(t,"."+a(e))&&e.getBody().contains(t)}),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){e(t),h(t),n(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(){"use strict";var e=function(t){var n=t,o=function(){return n};return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,n){t.fire("VisualBlocks",{state:n})},u=function(t,n,o){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),i(t,o.get())},c=function(t,n,o){t.addCommand("mceVisualBlocks",function(){u(t,n,o)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},r=function(n,t,o){n.on("PreviewFormats AfterPreviewFormats",function(t){o.get()&&n.dom.toggleClass(n.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),n.on("init",function(){s(n)&&u(n,t,o)}),n.on("remove",function(){n.dom.removeClass(n.getBody(),"mce-visualblocks")})},o=function(o,e){return function(n){n.setActive(e.get());var t=function(t){return n.setActive(t.state)};return o.on("VisualBlocks",t),function(){return o.off("VisualBlocks",t)}}},a=function(t,n){t.ui.registry.addToggleButton("visualblocks",{icon:"paragraph",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:o(t,n)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:o(t,n)})};!function n(){t.add("visualblocks",function(t,n){var o=e(!1);c(t,n,o),a(t,o),r(t,n,o)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
9
  !function(r){"use strict";var n,e,t,o,u,i=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return i(t())}}},c=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n){return{isEnabled:function(){return n.get()}}},f=function(n,e){return n.fire("VisualChars",{state:e})},s=function(n){return function(){return n}},l=s(!1),d=s(!0),m=l,g=d,N=function(){return p},p=(o={fold:function(n,e){return n()},is:m,isSome:m,isNone:g,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:e,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:m,forall:g,filter:N,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(o),o),v=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:g,isNone:m,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return v(n(t))},ap:function(n){return n.fold(N,function(n){return v(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:p},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(m,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},h=function(n){return null===n||n===undefined?p:v(n)},E=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},T=E("string"),O=E("boolean"),y=E("function"),b=E("number"),D=Array.prototype.slice,C=function(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t,n)}},A=(y(Array.from)&&Array.from,r.Node.ATTRIBUTE_NODE,r.Node.CDATA_SECTION_NODE,r.Node.COMMENT_NODE,r.Node.DOCUMENT_NODE,r.Node.DOCUMENT_TYPE_NODE,r.Node.DOCUMENT_FRAGMENT_NODE,r.Node.ELEMENT_NODE,r.Node.TEXT_NODE),_=(r.Node.PROCESSING_INSTRUCTION_NODE,r.Node.ENTITY_REFERENCE_NODE,r.Node.ENTITY_NODE,r.Node.NOTATION_NODE,"undefined"!=typeof r.window?r.window:Function("return this;")(),function(n){return n.dom().nodeValue}),w=(u=A,function(n){return n.dom().nodeType===u}),M=function(n,e,t){!function(n,e,t){if(!(T(t)||O(t)||b(t)))throw r.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}(n.dom(),e,t)},S=function(n,e){n.dom().removeAttribute(e)},k=function(n,e){var t,r,o=(t=e,null===(r=n.dom().getAttribute(t))?undefined:r);return o===undefined||""===o?[]:o.split(" ")},x=function(n){return n.dom().classList!==undefined},I=function(n,e){return o=e,u=k(t=n,r="class").concat([o]),M(t,r,u.join(" ")),!0;var t,r,o,u},L=function(n,e){return o=e,0<(u=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var u=n[r];e(u,r,n)&&t.push(u)}return t}(k(t=n,r="class"),function(n){return n!==o})).length?M(t,r,u.join(" ")):S(t,r),!1;var t,r,o,u},P=function(n){0===(x(n)?n.dom().classList:k(n,"class")).length&&S(n,"class")},B=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:s(n)}},R={fromHtml:function(n,e){var t=(e||r.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw r.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return B(t.childNodes[0])},fromTag:function(n,e){var t=(e||r.document).createElement(n);return B(t)},fromText:function(n,e){var t=(e||r.document).createTextNode(n);return B(t)},fromDom:B,fromPoint:function(n,e,t){var r=n.dom();return h(r.elementFromPoint(e,t)).map(B)}},V={"\xa0":"nbsp","\xad":"shy"},U=function(n,e){var t,r="";for(t in n)r+=t;return new RegExp("["+r+"]",e?"g":"")},j=function(n){var e,t="";for(e in n)t&&(t+=","),t+="span.mce-"+n[e];return t},q={charMap:V,regExp:U(V),regExpGlobal:U(V,!0),selector:j(V),nbspClass:"mce-nbsp",charMapToRegExp:U,charMapToSelector:j},F=function(n){return'<span data-mce-bogus="1" class="mce-'+q.charMap[n]+'">'+n+"</span>"},G=function(n,e){var t=[],r=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o,n)}return r}(n.dom().childNodes,R.fromDom);return C(r,function(n){e(n)&&(t=t.concat([n])),t=t.concat(G(n,e))}),t},H={isMatch:function(n){return w(n)&&_(n)!==undefined&&q.regExp.test(_(n))},filterDescendants:G,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(q.regExpGlobal,F)}},Y=function(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")},z=function(c,n){var e=H.filterDescendants(R.fromDom(n),H.isMatch);C(e,function(n){var e,t,r=n.dom().parentNode;if(Y(r))e=R.fromDom(r),t=q.nbspClass,x(e)?e.dom().classList.add(t):I(e,t);else{for(var o=H.replaceWithSpans(_(n)),u=c.dom.create("div",null,o),i=void 0;i=u.lastChild;)c.dom.insertAfter(i,n.dom());c.dom.remove(n.dom())}})},W=function(e,n){var t=e.dom.select(q.selector,n);C(t,function(n){Y(n)?function(n,e){x(n)?n.dom().classList.remove(e):L(n,e);P(n)}(R.fromDom(n),q.nbspClass):e.dom.remove(n,!0)})},K=z,X=W,J=function(n){var e=n.getBody(),t=n.selection.getBookmark(),r=H.findParentElm(n.selection.getNode(),e);r=r!==undefined?r:e,W(n,r),z(n,r),n.selection.moveToBookmark(t)},Q=function(n,e){var t,r=n.getBody(),o=n.selection;e.set(!e.get()),f(n,e.get()),t=o.getBookmark(),!0===e.get()?K(n,r):X(n,r),o.moveToBookmark(t)},Z=function(n,e){n.addCommand("mceVisualChars",function(){Q(n,e)})},$=tinymce.util.Tools.resolve("tinymce.util.Delay"),nn=function(e,t){var r=$.debounce(function(){J(e)},300);!1!==e.settings.forced_root_block&&e.on("keydown",function(n){!0===t.get()&&(13===n.keyCode?J(e):r())})},en=function(n){return n.getParam("visualchars_default_state",!1)},tn=function(e,t){e.on("init",function(){var n=!en(e);t.set(n),Q(e,t)})},rn=function(t,r){return function(e){e.setActive(r.get());var n=function(n){return e.setActive(n.state)};return t.on("VisualChars",n),function(){return t.off("VisualChars",n)}}};!function on(){c.add("visualchars",function(n){var e,t,r=i(!1);return Z(n,r),t=r,(e=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"paragraph",onAction:function(){return e.execCommand("mceVisualChars")},onSetup:rn(e,t)}),e.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",onAction:function(){return e.execCommand("mceVisualChars")},onSetup:rn(e,t)}),nn(n,r),tn(n,r),a(r)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.0.14 (2019-08-19)
7
+ * Version: 5.0.15 (2019-09-02)
8
8
  */
9
- !function(){"use strict";var t,n,e,r,o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},c=function(t){return t},a=i(!1),f=i(!0),s=function(){return(s=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},l="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",g="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",p="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",d="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",h="\\r",y="\\n",C="[\x0B\f\x85\u2028\u2029]",v="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",w="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",m="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",b="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",E="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",S=0,x=1,W=2,R=3,O=4,A=5,j=6,D=7,T=8,k=9,P=10,B=11,F=12,N=13,U=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(l),new RegExp(g),new RegExp(p),new RegExp(d),new RegExp(h),new RegExp(y),new RegExp(C),new RegExp(v),new RegExp(w),new RegExp(m),new RegExp(b),new RegExp("@")],_=new RegExp("^"+E+"$"),z=function(){return M},M=(r={fold:function(t,n){return t()},is:a,isSome:a,isNone:f,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:n,map:z,ap:z,each:function(){},bind:z,flatten:z,exists:a,forall:f,filter:z,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r),q=(o="function",function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===o}),$=Array.prototype.slice,I=(q(Array.from)&&Array.from,U),Z=N,G=function(t){for(var n=Z,e=I.length,r=0;r<e;++r){var o=I[r];if(o&&o.test(t)){n=r;break}}return n},H=function(t){var e,r;return function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var u=t[o];r[o]=n(u,o,t)}return r}(t,(e=G,r={},function(t){if(r[t])return r[t];var n=e(t);return r[t]=n}))},J=/^\s+$/,K=_,L=function(t,n){var e=function(t,n){var e;for(e=n;e<t.length&&!J.test(t[e]);e++);return e}(t,n+1);return"://"===t.slice(n+1,e).join("").substr(0,3)?e:n},Q=function(t,n,e){e=s({},{includeWhitespace:!1,includePunctuation:!1},e);for(var r=[],o=[],u=0;u<t.length;u++){var i=n(t[u]);"\ufeff"!==i&&(r.push(t[u]),o.push(i))}return function(t,n,e,r){for(var o,u,i,c,a,f,s,l=[],g=[],p=0;p<e.length;++p)if(g.push(t[p]),a=c=void 0,f=(u=e)[i=p],s=u[i+1],!(i<0||i>u.length-1&&0!==i||f===S&&s===S||(a=u[i+2],f===S&&(s===W||s===x||s===F)&&a===S||(c=u[i-1],(f===W||f===x||s===F)&&s===S&&c===S||!(f!==O&&f!==S||s!==O&&s!==S)||(f===R||f===x)&&s===O&&c===O||f===O&&(s===R||s===x)&&a===O||f===T||f===k||c===T||c===k||s===T||s===k||f===A&&s===j||f!==D&&f!==A&&f!==j&&s!==D&&s!==A&&s!==j&&(f===P&&s===P||s===B&&(f===S||f===O||f===P||f===B)||f===B&&(s===S||s===O||s===P)||f===F))))){var d=n[p];if((r.includeWhitespace||!J.test(d))&&(r.includePunctuation||!K.test(d))){var h=p-g.length+1,y=p+1,C=n.slice(h,y).join("");if("http"===(o=C)||"https"===o){var v=L(n,p),w=t.slice(y,v);Array.prototype.push.apply(g,w),p=v}l.push(g)}g=[]}return l}(r,o,H(o),e)},V=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=function(t,n){for(var e,r=n.getBlockElements(),o=n.getShortEndedElements(),u=[],i="",c=new V(t,t);t=c.next();)3===t.nodeType?i+=t.data:(r[(e=t).nodeName]||o[e.nodeName])&&i.length&&(u.push(i),i="");return i.length&&u.push(i),u},Y=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},tt=function(t,n){var e=X(t,n).join("\n");return Q(e.split(""),c).length},nt=function(t,n){var e=X(t,n).join("");return Y(e)},et=function(t,n){var e=X(t,n).join("").replace(/\s/g,"");return Y(e)},rt=function(t,n){return function(){return n(t.getBody(),t.schema)}},ot=function(t,n){return function(){return n(t.selection.getRng().cloneContents(),t.schema)}},ut=function(t){return rt(t,tt)},it=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=function(t,n){var e;e=n,t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})},at=function(t,n){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(n.body.getWordCount()),String(n.selection.getWordCount())],["Characters (no spaces)",String(n.body.getCharacterCountWithoutSpaces()),String(n.selection.getCharacterCountWithoutSpaces())],["Characters",String(n.body.getCharacterCount()),String(n.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};!function ft(){u.add("wordcount",function(t){var n,e,r,o,u,i,c={body:{getWordCount:ut(n=t),getCharacterCount:rt(n,nt),getCharacterCountWithoutSpaces:rt(n,et)},selection:{getWordCount:ot(n,tt),getCharacterCount:ot(n,nt),getCharacterCountWithoutSpaces:ot(n,et)},getCount:ut(n)};return r=c,(e=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return at(e,r)}}),e.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return at(e,r)}}),o=t,u=c,i=it.debounce(function(){return ct(o,u)},300),o.on("init",function(){ct(o,u),it.setEditorTimeout(o,function(){o.on("SetContent BeforeAddUndo Undo Redo keyup",i)},0)}),c})}()}();
9
+ !function(){"use strict";var t,n,e,r,o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return function(){return t}},c=function(t){return t},a=i(!1),f=i(!0),s=function(){return(s=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},l="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",g="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",p="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",d="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",h="\\r",y="\\n",C="[\x0B\f\x85\u2028\u2029]",v="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",w="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",m="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",b="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",E="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",S=0,x=1,W=2,R=3,O=4,A=5,j=6,D=7,T=8,k=9,P=10,B=11,F=12,N=13,U=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(l),new RegExp(g),new RegExp(p),new RegExp(d),new RegExp(h),new RegExp(y),new RegExp(C),new RegExp(v),new RegExp(w),new RegExp(m),new RegExp(b),new RegExp("@")],_=new RegExp("^"+E+"$"),z=function(){return M},M=(r={fold:function(t,n){return t()},is:a,isSome:a,isNone:f,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:n,map:z,ap:z,each:function(){},bind:z,flatten:z,exists:a,forall:f,filter:z,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r),q=(o="function",function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===o}),$=Array.prototype.slice,I=(q(Array.from)&&Array.from,U),Z=N,G=function(t){for(var n=Z,e=I.length,r=0;r<e;++r){var o=I[r];if(o&&o.test(t)){n=r;break}}return n},H=function(t){var e,r;return function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var u=t[o];r[o]=n(u,o,t)}return r}(t,(e=G,r={},function(t){if(r[t])return r[t];var n=e(t);return r[t]=n}))},J=/^\s+$/,K=_,L=function(t,n){var e=function(t,n){var e;for(e=n;e<t.length&&!J.test(t[e]);e++);return e}(t,n+1);return"://"===t.slice(n+1,e).join("").substr(0,3)?e:n},Q=function(t,n,e){e=s({},{includeWhitespace:!1,includePunctuation:!1},e);for(var r=[],o=[],u=0;u<t.length;u++){var i=n(t[u]);"\ufeff"!==i&&(r.push(t[u]),o.push(i))}return function(t,n,e,r){for(var o,u,i,c,a,f,s,l=[],g=[],p=0;p<e.length;++p)if(g.push(t[p]),a=c=void 0,f=(u=e)[i=p],s=u[i+1],!(i<0||i>u.length-1&&0!==i||f===S&&s===S||(a=u[i+2],f===S&&(s===W||s===x||s===F)&&a===S||(c=u[i-1],(f===W||f===x||s===F)&&s===S&&c===S||!(f!==O&&f!==S||s!==O&&s!==S)||(f===R||f===x)&&s===O&&c===O||f===O&&(s===R||s===x)&&a===O||f===T||f===k||c===T||c===k||s===T||s===k||f===A&&s===j||f!==D&&f!==A&&f!==j&&s!==D&&s!==A&&s!==j&&(f===P&&s===P||s===B&&(f===S||f===O||f===P||f===B)||f===B&&(s===S||s===O||s===P)||f===F))))){var d=n[p];if((r.includeWhitespace||!J.test(d))&&(r.includePunctuation||!K.test(d))){var h=p-g.length+1,y=p+1,C=n.slice(h,y).join("");if("http"===(o=C)||"https"===o){var v=L(n,p),w=t.slice(y,v);Array.prototype.push.apply(g,w),p=v}l.push(g)}g=[]}return l}(r,o,H(o),e)},V=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=function(t,n){for(var e,r=n.getBlockElements(),o=n.getShortEndedElements(),u=[],i="",c=new V(t,t);t=c.next();)3===t.nodeType?i+=t.data:(r[(e=t).nodeName]||o[e.nodeName])&&i.length&&(u.push(i),i="");return i.length&&u.push(i),u},Y=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},tt=function(t,n){var e=X(t,n).join("\n");return Q(e.split(""),c).length},nt=function(t,n){var e=X(t,n).join("");return Y(e)},et=function(t,n){var e=X(t,n).join("").replace(/\s/g,"");return Y(e)},rt=function(t,n){return function(){return n(t.getBody(),t.schema)}},ot=function(t,n){return function(){return n(t.selection.getRng().cloneContents(),t.schema)}},ut=function(t){return rt(t,tt)},it=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=function(t,n){var e;e=n,t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})},at=function(t,n){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(n.body.getWordCount()),String(n.selection.getWordCount())],["Characters (no spaces)",String(n.body.getCharacterCountWithoutSpaces()),String(n.selection.getCharacterCountWithoutSpaces())],["Characters",String(n.body.getCharacterCount()),String(n.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};!function ft(f){void 0===f&&(f=300),u.add("wordcount",function(t){var n,e,r,o,u,i,c,a={body:{getWordCount:ut(n=t),getCharacterCount:rt(n,nt),getCharacterCountWithoutSpaces:rt(n,et)},selection:{getWordCount:ot(n,tt),getCharacterCount:ot(n,nt),getCharacterCountWithoutSpaces:ot(n,et)},getCount:ut(n)};return r=a,(e=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return at(e,r)}}),e.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return at(e,r)}}),o=t,u=a,i=f,c=it.debounce(function(){return ct(o,u)},i),o.on("init",function(){ct(o,u),it.setEditorTimeout(o,function(){o.on("SetContent BeforeAddUndo Undo Redo keyup",c)},0)}),a})}()}();
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ */
7
+ body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table td,table th{border:1px solid #6d737b;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}td[data-mce-selected],th[data-mce-selected]{color:#333}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}