From d89916179188fbcdcaaed956ad4b325b2b103e85 Mon Sep 17 00:00:00 2001 From: Marat Date: Wed, 7 Sep 2016 14:38:17 +0200 Subject: [PATCH] v2.0.1 --- README.md | 2 +- copy_this/modules/bla/bla-tinymce/README.md | 2 +- .../core/blatinymceoxviewconfig.php | 91 +- copy_this/modules/bla/bla-tinymce/changelog | 26 + .../bla/bla-tinymce/fileman/lang/de.json | 2 +- .../bla-tinymce/fileman/php/security.inc.php | 52 +- .../modules/bla/bla-tinymce/metadata.php | 2 +- .../bla-tinymce/plugins/oxwidget/plugin.js | 54 + .../tinymce/plugins/codesample/plugin.min.js | 2 +- .../tinymce/plugins/contextmenu/plugin.min.js | 2 +- .../tinymce/plugins/fullscreen/plugin.min.js | 2 +- .../tinymce/plugins/importcss/plugin.min.js | 2 +- .../tinymce/plugins/lists/plugin.min.js | 2 +- .../tinymce/plugins/paste/plugin.min.js | 2 +- .../plugins/spellchecker/plugin.min.js | 2 +- .../tinymce/plugins/table/plugin.min.js | 4 +- .../tinymce/plugins/template/plugin.min.js | 2 +- .../themes/inlite/config/bolt/atomic.js | 5 - .../inlite/config/bolt/bootstrap-atomic.js | 1491 --------------- .../inlite/config/bolt/bootstrap-browser.js | 1491 --------------- .../inlite/config/bolt/bootstrap-demo.js | 1491 --------------- .../inlite/config/bolt/bootstrap-prod.js | 1491 --------------- .../themes/inlite/config/bolt/browser.js | 10 - .../tinymce/themes/inlite/config/bolt/demo.js | 8 - .../tinymce/themes/inlite/config/bolt/prod.js | 5 - .../themes/inlite/config/dent/depend.js | 21 - .../inlite/scratch/compile/bootstrap.js | 1526 --------------- .../themes/inlite/scratch/compile/theme.js | 1594 ---------------- .../themes/inlite/scratch/inline/theme.js | 1679 ----------------- .../themes/inlite/scratch/inline/theme.raw.js | 1679 ----------------- .../themes/inlite/src/demo/css/demo.css | 25 - .../themes/inlite/src/demo/html/demo.html | 69 - .../inlite/src/demo/js/tinymce/inlite/Demo.js | 28 - .../src/main/js/tinymce/inlite/Theme.js | 150 -- .../src/main/js/tinymce/inlite/alien/Arr.js | 22 - .../main/js/tinymce/inlite/alien/Bookmark.js | 130 -- .../main/js/tinymce/inlite/alien/Unlink.js | 84 - .../src/main/js/tinymce/inlite/alien/Uuid.js | 34 - .../main/js/tinymce/inlite/core/Actions.js | 106 -- .../main/js/tinymce/inlite/core/Convert.js | 37 - .../js/tinymce/inlite/core/ElementMatcher.js | 47 - .../src/main/js/tinymce/inlite/core/Layout.js | 95 - .../main/js/tinymce/inlite/core/Matcher.js | 39 - .../main/js/tinymce/inlite/core/Measure.js | 61 - .../js/tinymce/inlite/core/PredicateId.js | 32 - .../tinymce/inlite/core/SelectionMatcher.js | 55 - .../main/js/tinymce/inlite/core/SkinLoader.js | 45 - .../main/js/tinymce/inlite/core/UrlType.js | 27 - .../js/tinymce/inlite/file/Conversions.js | 31 - .../src/main/js/tinymce/inlite/file/Picker.js | 40 - .../src/main/js/tinymce/inlite/ui/Buttons.js | 80 - .../src/main/js/tinymce/inlite/ui/Forms.js | 102 - .../src/main/js/tinymce/inlite/ui/Panel.js | 218 --- .../src/main/js/tinymce/inlite/ui/Toolbar.js | 126 -- .../tinymce/themes/inlite/src/test/.eslintrc | 14 - .../src/test/js/atomic/alien/ArrTest.js | 9 - .../src/test/js/atomic/alien/UuidTest.js | 10 - .../src/test/js/atomic/core/ConvertTest.js | 12 - .../src/test/js/atomic/core/MatcherTest.js | 51 - .../src/test/js/atomic/core/UrlTypeTest.js | 33 - .../inlite/src/test/js/browser/ThemeTest.js | 202 -- .../src/test/js/browser/alien/BookmarkTest.js | 65 - .../src/test/js/browser/alien/UnlinkTest.js | 38 - .../src/test/js/browser/core/ActionsTest.js | 177 -- .../test/js/browser/core/ElementMatcher.js | 69 - .../src/test/js/browser/core/LayoutTest.js | 118 -- .../src/test/js/browser/core/MeasureTest.js | 62 - .../test/js/browser/core/PredicateIdTest.js | 26 - .../js/browser/core/SelectionMatcherTest.js | 76 - .../test/js/browser/file/ConversionsTest.js | 41 - .../test/js/browser/file/SelectionMatcher.js | 55 - .../tinymce/themes/inlite/theme.min.js | 2 +- .../bla/bla-tinymce/tinymce/tinymce.min.js | 27 +- copy_this/modules/bla/bla-tinymce/version.jpg | Bin 2239 -> 135849 bytes 74 files changed, 184 insertions(+), 15328 deletions(-) create mode 100644 copy_this/modules/bla/bla-tinymce/changelog create mode 100644 copy_this/modules/bla/bla-tinymce/plugins/oxwidget/plugin.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/atomic.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-browser.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-demo.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-prod.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/browser.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/demo.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/prod.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/dent/depend.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/bootstrap.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/theme.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.raw.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/css/demo.css delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/html/demo.html delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/.eslintrc delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js delete mode 100644 copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js diff --git a/README.md b/README.md index 2b8ad89..65421e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## TinyMCE Editor for OXID eShop CE by Marat Bedoev, bestlife AG https://github.com/vanilla-thunder/bla-tinymce -### module version 2.0.0 +### module version 2.0.1 TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. More information here: http://www.tinymce.com/ diff --git a/copy_this/modules/bla/bla-tinymce/README.md b/copy_this/modules/bla/bla-tinymce/README.md index 2b8ad89..65421e6 100644 --- a/copy_this/modules/bla/bla-tinymce/README.md +++ b/copy_this/modules/bla/bla-tinymce/README.md @@ -1,7 +1,7 @@ ## TinyMCE Editor for OXID eShop CE by Marat Bedoev, bestlife AG https://github.com/vanilla-thunder/bla-tinymce -### module version 2.0.0 +### module version 2.0.1 TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. More information here: http://www.tinymce.com/ diff --git a/copy_this/modules/bla/bla-tinymce/application/core/blatinymceoxviewconfig.php b/copy_this/modules/bla/bla-tinymce/application/core/blatinymceoxviewconfig.php index 3d117c8..b35ec36 100644 --- a/copy_this/modules/bla/bla-tinymce/application/core/blatinymceoxviewconfig.php +++ b/copy_this/modules/bla/bla-tinymce/application/core/blatinymceoxviewconfig.php @@ -43,33 +43,37 @@ class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent // default config $aDefaultConfig = array( - 'selector' => '"textarea:not(.mceNoEditor)"', - 'language' => '"' . ( in_array($sLang, $aLang) ? $aLang[$sLang] : 'en' ) . '"', + 'force_br_newlines' => 'false', + 'force_p_newlines' => 'false', + 'forced_root_block' => '""', + 'selector' => '"textarea:not(.mceNoEditor)"', + 'language' => '"' . ( in_array($sLang, $aLang) ? $aLang[$sLang] : 'en' ) . '"', //'spellchecker_language' => '"' . (in_array($sLang, $aLang) ? $aLang[$sLang] : 'en') . '"', - 'nowrap' => 'false', - 'entity_encoding' => '"raw"', // http://www.tinymce.com/wiki.php/Configuration:entity_encoding - 'height' => 300, - 'menubar' => 'false', - 'document_base_url' => '"' . $this->getBaseDir() . '"', // http://www.tinymce.com/wiki.php/Configuration:document_base_url - 'relative_urls' => 'false', // http://www.tinymce.com/wiki.php/Configuration:relative_urls - 'plugin_preview_width' => 'window.innerWidth', - 'plugin_preview_height' => 'window.innerHeight-90', - 'code_dialog_width' => 'window.innerWidth-50', - 'code_dialog_height' => 'window.innerHeight-130', - 'image_advtab' => 'true', - 'imagetools_toolbar' => '"rotateleft rotateright | flipv fliph | editimage imageoptions"', - 'moxiemanager_fullscreen' => 'true', - 'insertdatetime_formats' => '[ "%d.%m.%Y", "%H:%M" ]', - 'nonbreaking_force_tab' => 'true', // http://www.tinymce.com/wiki.php/Plugin:nonbreaking - 'autoresize_max_height' => '400', - 'filemanager_access_key' => '"' . md5($_SERVER['HTTP_HOST']) . '"', - 'tinymcehelper' => '"' . $this->getSelfActionLink() . 'renderPartial=1"' + 'nowrap' => 'false', + 'entity_encoding' => '"raw"', // http://www.tinymce.com/wiki.php/Configuration:entity_encoding + 'height' => 300, + 'menubar' => 'false', + 'document_base_url' => '"' . $this->getBaseDir() . '"', // http://www.tinymce.com/wiki.php/Configuration:document_base_url + 'relative_urls' => 'false', // http://www.tinymce.com/wiki.php/Configuration:relative_urls + 'plugin_preview_width' => 'window.innerWidth', + 'plugin_preview_height' => 'window.innerHeight-90', + 'code_dialog_width' => 'window.innerWidth-50', + 'code_dialog_height' => 'window.innerHeight-130', + 'image_advtab' => 'true', + 'imagetools_toolbar' => '"rotateleft rotateright | flipv fliph | editimage imageoptions"', + 'moxiemanager_fullscreen' => 'true', + 'insertdatetime_formats' => '[ "%d.%m.%Y", "%H:%M" ]', + 'nonbreaking_force_tab' => 'true', // http://www.tinymce.com/wiki.php/Plugin:nonbreaking + 'autoresize_max_height' => '400', + 'urlconverter_callback' => '"urlconverter"', + 'filemanager_access_key' => '"' . md5($_SERVER['HTTP_HOST']) . '"', + 'tinymcehelper' => '"' . $this->getSelfActionLink() . 'renderPartial=1"' ); - if($blFilemanager) $aDefaultConfig['external_filemanager_path'] = '"../modules/bla/bla-tinymce/fileman/"'; - if($blFilemanager) $aDefaultConfig['filemanager_access_key'] = '"' . md5($_SERVER['HTTP_HOST']) . '"'; - if($blFilemanager) $oUS = oxRegistry::get("oxUtilsServer"); - if($blFilemanager) $oUS->setOxCookie("filemanagerkey", md5($_SERVER['HTTP_HOST'].$oUS->getOxCookie("admin_sid"))); - + if ($blFilemanager) $aDefaultConfig['external_filemanager_path'] = '"../modules/bla/bla-tinymce/fileman/"'; + if ($blFilemanager) $aDefaultConfig['filemanager_access_key'] = '"' . md5($_SERVER['HTTP_HOST']) . '"'; + if ($blFilemanager) $oUS = oxRegistry::get("oxUtilsServer"); + if ($blFilemanager) $oUS->setOxCookie("filemanagerkey", md5($_SERVER['HTTP_HOST'] . $oUS->getOxCookie("admin_sid"))); + //merging with onfig override $aConfig = ( $aOverrideConfig = $this->_getTinyCustConfig() ) ? array_merge($aDefaultConfig, $aOverrideConfig) : $aDefaultConfig; @@ -101,6 +105,7 @@ class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent //'visualchars' => 'visualchars', 'wordcount' => '', 'oxfullscreen' => 'fullscreen', //custom fullscreen plugin + //'oxwidget' => 'widget' //'oxgetseourl' => 'yolo' //custom seo url plugin // wip ); @@ -122,6 +127,7 @@ class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent // external plugins $aConfig['external_plugins'] = '{ "oxfullscreen":"' . $this->getModuleUrl('bla-tinymce', 'plugins/oxfullscreen/plugin.js') . '" '; + //$aConfig['external_plugins'] .= ', "oxwidget":"' . $this->getModuleUrl('bla-tinymce', 'plugins/oxwidget/plugin.js') . '" '; if ($blFilemanager) $aConfig['external_plugins'] .= ',"roxy":"' . $this->getModuleUrl('bla-tinymce', 'plugins/roxy/plugin.js') . '" '; //$aConfig['external_plugins'] .= ',"oxgetseourl":"' . $this->getModuleUrl('bla-tinymce', 'plugins/oxgetseourl/plugin.js') . '" '; @@ -171,26 +177,28 @@ class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent // add init script $sInit = 'tinymce.init({ ' . $sConfig . ' });'; - $sCopyLongDescFromTinyMCE = 'function copyLongDescFromTinyMCE(sIdent) -{ - var editor = tinymce.get("editor_"+sIdent); - if (editor && editor.isHidden() !== true) - { - console.log("copy content from tinymce"); - var content = editor.getContent().replace(/\[{([^\]]*?)}\]/g, function(m) { return m.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&") }); - document.getElementsByName("editval[" + sIdent + "]").item(0).value = content; - return true; - } - return false; + $sCopyLongDescFromTinyMCE = 'function copyLongDescFromTinyMCE(sIdent) { + var editor = tinymce.get("editor_"+sIdent); + if (editor) { /* && editor.isHidden() !== true */ + if(editor.isHidden()) editor.show(); + var content = editor.getContent().replace(/\[{([^\]]*?)}\]/g, function(m) { return m.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&") }); + document.getElementsByName("editval[" + sIdent + "]").item(0).value = content; + return true; + } + return false; } var origCopyLongDesc = copyLongDesc; -copyLongDesc = function(sIdent) -{ +copyLongDesc = function(sIdent) { if ( copyLongDescFromTinyMCE( sIdent ) ) return; console.log("tinymce disabled, copy content from regular textarea"); origCopyLongDesc( sIdent ); }'; + $sUrlConverter = 'function urlconverter(url, node, on_save) { + console.log(tinyMCE.activeEditor); + if(url.indexOf("[{") == 0) return url; + return (tinyMCE.activeEditor.settings.relative_urls) ? tinyMCE.activeEditor.documentBaseURI.toRelative(url) : tinyMCE.activeEditor.documentBaseURI.toAbsolute(url); +}'; // adding scripts to template $smarty = oxRegistry::get("oxUtilsView")->getSmarty(); @@ -198,14 +206,15 @@ copyLongDesc = function(sIdent) $aScript = (array)$cfg->getGlobalParameter('scripts' . $sSufix); $aScript[] = $sCopyLongDescFromTinyMCE; + $aScript[] = $sUrlConverter; $aScript[] = $sInit; $cfg->setGlobalParameter('scripts' . $sSufix, $aScript); $aInclude = (array)$cfg->getGlobalParameter('includes' . $sSufix); - + $aExtjs = $cfg->getConfigParam('aTinyMCE_extjs'); - if(!empty($aExtjs) && is_array($aExtjs)) foreach($aExtjs as $key => $js) $aInclude[3][] = $js; - + if (!empty( $aExtjs ) && is_array($aExtjs)) foreach ($aExtjs as $key => $js) $aInclude[3][] = $js; + $aInclude[3][] = $this->getModuleUrl('bla-tinymce', 'tinymce/tinymce.min.js'); $cfg->setGlobalParameter('includes' . $sSufix, $aInclude); diff --git a/copy_this/modules/bla/bla-tinymce/changelog b/copy_this/modules/bla/bla-tinymce/changelog new file mode 100644 index 0000000..70cd83d --- /dev/null +++ b/copy_this/modules/bla/bla-tinymce/changelog @@ -0,0 +1,26 @@ +# 2016-09-07 :: version 2.0.1 +- TinyMCE 4.4.3 +- link url conversion fixed. TinyMCE accepts smarty tags/variables as URL wirhout convertig them ti absolute URL. + +# 2016-09-07 :: version 2.0.0 +- TinyMCE 4.4.1 +- eingebauter Filemanager "Roxy Fileman" + +# 2015-07-29 :: version 1.5.0 +- TinyMCE 4.2.2 + +# 2015-05-06 :: version 1.4.0 +- TinyMCE 4.1.10 +- fix: data-mce attributes removed from html output + +# 2014-09-04 :: version 1.3.1 +- TinyMCE v4.1.4 +- fix: fullpage Plugin für Newsletter hinzugefügt + +# 2014-08-20 :: version 1.3.0 +- TinyMCE v4.1.3 +- feature: Support für eigene Text-Felder hinzugefügt + +# 2014-04-23 :: version 1.2.2 +- TinyMCE 4.0.10 +- fix: iframes werden nicht mehr ersetzt \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/fileman/lang/de.json b/copy_this/modules/bla/bla-tinymce/fileman/lang/de.json index 5715131..6dda27d 100644 --- a/copy_this/modules/bla/bla-tinymce/fileman/lang/de.json +++ b/copy_this/modules/bla/bla-tinymce/fileman/lang/de.json @@ -18,7 +18,7 @@ "Size":"Größe", "Date":"Datum", "Dimensions":"Dimensionen", -"Cancel":"Schließen", +"Cancel":"Stornieren", "LoadingDirectories":"Ordner laden...", "LoadingFiles":"Dateien laden...", "DirIsEmpty":"Ordner ist leer", diff --git a/copy_this/modules/bla/bla-tinymce/fileman/php/security.inc.php b/copy_this/modules/bla/bla-tinymce/fileman/php/security.inc.php index e36a171..2743a9a 100644 --- a/copy_this/modules/bla/bla-tinymce/fileman/php/security.inc.php +++ b/copy_this/modules/bla/bla-tinymce/fileman/php/security.inc.php @@ -1,27 +1,25 @@ -. - - Contact: Lyubomir Arsov, liubo (at) web-lobby.com -*/ -function checkAccess($action){ - if(!session_id()) - session_start(); -} -?> \ No newline at end of file + + */ + +function checkAccess($action) +{ + //if(!session_id()) die("Access Denied!"); + //if(!session_id()) session_start(); + //if(isset($_GET['akey'])) $_SESSION['akey'] = strip_tags(preg_replace( "/[^a-zA-Z0-9\._-]/", '', $_GET['akey'])); + if($_COOKIE['filemanagerkey'] !== md5($_SERVER['HTTP_HOST'].$_COOKIE['admin_sid'])) die('Access Denied!!'); +} \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/metadata.php b/copy_this/modules/bla/bla-tinymce/metadata.php index c82e537..2b4ef6b 100644 --- a/copy_this/modules/bla/bla-tinymce/metadata.php +++ b/copy_this/modules/bla/bla-tinymce/metadata.php @@ -24,7 +24,7 @@ $aModule = array( 'title' => 'bestlife TinyMCE', 'description' => 'TinyMCE Editor for OXID eShop CE 4.7 - 4.10
newest version:
(no need to update if you already have this version)', 'thumbnail' => 'tinymce.png', - 'version' => '2.0.0', + 'version' => '2.0.1', 'author' => 'Marat Bedoev, bestlife AG', 'email' => 'oxid@bestlife.ag', 'url' => 'https://github.com/vanilla-thunder/bla-tinymce', diff --git a/copy_this/modules/bla/bla-tinymce/plugins/oxwidget/plugin.js b/copy_this/modules/bla/bla-tinymce/plugins/oxwidget/plugin.js new file mode 100644 index 0000000..a8ef712 --- /dev/null +++ b/copy_this/modules/bla/bla-tinymce/plugins/oxwidget/plugin.js @@ -0,0 +1,54 @@ + +tinymce.PluginManager.add('oxwidget', function(editor, url) { + + // Add a button that opens a window + editor.addButton('widget', { + text: 'Widget', + icon: false, + onclick: function() { + // Open window + editor.windowManager.open({ + title: 'Example plugin', + body: [ + {type: 'textbox', name: 'title', label: 'Title'} + ], + onsubmit: function(e) { + // Insert content when the window form is submitted + editor.insertContent('Title: ' + e.data.title); + } + }); + } + }); + + // Adds a menu item to the tools menu + editor.addMenuItem('example', { + text: 'Example plugin', + context: 'tools', + onclick: function() { + // Open window with a specific url + editor.windowManager.open({ + title: 'TinyMCE site', + url: url + '/dialog.html', + width: 600, + height: 400, + buttons: [ + { + text: 'Insert', + onclick: function() { + // Top most window object + var win = editor.windowManager.getWindows()[0]; + + // Insert the contents of the dialog.html textarea into the editor + editor.insertContent(win.getContentWindow().document.getElementById('content').value); + + // Close the window + win.close(); + } + }, + + {text: 'Close', onclick: 'close'} + ] + }); + } + }); +}); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js index fc2fa2a..6cdbf9b 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js @@ -1 +1 @@ -!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;fa.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};return d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+""},b.document?void 0:b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://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},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.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:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:c.languages.markup.tag.inside},rest:c.languages.css},alias:"language-css"}}),c.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:c.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:c.languages.css}},alias:"language-css"}},c.languages.markup.tag)),c.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:/[{}[\];(),.:]/},c.languages.javascript=c.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}),c.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),c.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}}}),c.languages.markup&&c.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:c.languages.markup.tag.inside},rest:c.languages.javascript},alias:"language-javascript"}}),c.languages.js=c.languages.javascript,c.languages.c=c.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}),c.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 c.languages.c["class-name"],delete c.languages.c["boolean"],c.languages.csharp=c.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}),c.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),c.languages.cpp=c.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/}),c.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),c.languages.java=c.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}}),c.languages.php=c.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}}),c.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),c.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),c.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),c.languages.markup&&(c.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.backupCode=a.code,a.code=a.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(b){return a.tokenStack.push(b),"{{{PHP"+a.tokenStack.length+"}}}"}))}),c.hooks.add("before-insert",function(a){"php"===a.language&&(a.code=a.backupCode,delete a.backupCode)}),c.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b,d=0;b=a.tokenStack[d];d++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(d+1)+"}}}",c.highlight(b,a.grammar,"php").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}}),c.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),c.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:c.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),c.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(a){a.languages.ruby=a.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 b={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:a.util.clone(a.languages.ruby)}};a.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:b}},{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)/}),a.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)/}),a.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:b}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:b}}]}(c),c}),d("tinymce/codesampleplugin/Utils",[],function(){function a(a){return a&&"PRE"==a.nodeName&&-1!==a.className.indexOf("language-")}function b(a){return function(b,c){return a(c)}}return{isCodeSample:a,trimArg:b}}),d("tinymce/codesampleplugin/Dialog",["tinymce/dom/DOMUtils","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Prism"],function(a,b,c){function d(a,b,d){a.undoManager.transact(function(){var f=e(a);d=h.encode(d),f?(a.dom.setAttrib(f,"class","language-"+b),f.innerHTML=d,c.highlightElement(f),a.selection.select(f)):(a.insertContent('
'+d+"
"),a.selection.select(a.$("#__new").removeAttr("id")[0]))})}function e(a){var c=a.selection.getNode();return b.isCodeSample(c)?c:null}function f(a){var b=e(a);return b?b.textContent:""}function g(a){var b,c=e(a);return c?(b=c.className.match(/language-(\w+)/),b?b[1]:""):""}var h=a.DOM,i=[{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"}];return{open:function(a){a.windowManager.open({title:"Insert/Edit code sample",minWidth:Math.min(h.getViewPort().w,800),minHeight:Math.min(h.getViewPort().h,650),layout:"fit",body:[{type:"listbox",name:"language",label:"Language",maxWidth:200,value:g(a),values:i},{type:"textbox",name:"code",multiline:!0,spellcheck:!1,ariaLabel:"Code view",flex:1,style:"direction: ltr; text-align: left",classes:"monospace",value:f(a),autofocus:!0}],onSubmit:function(b){d(a,b.data.language,b.data.code)}})}}}),d("tinymce/codesampleplugin/Plugin",["tinymce/Env","tinymce/PluginManager","tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Utils"],function(a,b,c,d,e){var f,g=e.trimArg;b.add("codesample",function(b,h){function i(){var a;b.inline&&f||!b.inline&&j||(b.inline?f=!0:j=!0,a=b.dom.create("link",{rel:"stylesheet",href:h+"/css/prism.css"}),b.getDoc().getElementsByTagName("head")[0].appendChild(a))}var j,k=b.$;a.ceFalse&&(b.on("PreProcess",function(a){k("pre[contenteditable=false]",a.node).filter(g(e.isCodeSample)).each(function(a,b){var c=k(b),d=b.textContent;c.attr("class",k.trim(c.attr("class"))),c.removeAttr("contentEditable"),c.empty().append(k("").each(function(){this.textContent=d}))})}),b.on("SetContent",function(){var a=k("pre").filter(g(e.isCodeSample)).filter(function(a,b){return"false"!==b.contentEditable});a.length&&b.undoManager.transact(function(){a.each(function(a,d){k(d).find("br").each(function(a,c){c.parentNode.replaceChild(b.getDoc().createTextNode("\n"),c)}),d.contentEditable=!1,d.innerHTML=b.dom.encode(d.textContent),c.highlightElement(d),d.className=k.trim(d.className)})})}),b.addCommand("codesample",function(){d.open(b)}),b.addButton("codesample",{cmd:"codesample",title:"Insert/Edit code sample"}),b.on("init",i))})}),f(["tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Plugin"])}(this); \ No newline at end of file +!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;fa.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};return d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+""},b.document?void 0:b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://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},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.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:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:c.languages.markup.tag.inside},rest:c.languages.css},alias:"language-css"}}),c.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:c.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:c.languages.css}},alias:"language-css"}},c.languages.markup.tag)),c.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:/[{}[\];(),.:]/},c.languages.javascript=c.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}),c.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),c.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}}}),c.languages.markup&&c.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:c.languages.markup.tag.inside},rest:c.languages.javascript},alias:"language-javascript"}}),c.languages.js=c.languages.javascript,c.languages.c=c.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}),c.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 c.languages.c["class-name"],delete c.languages.c["boolean"],c.languages.csharp=c.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}),c.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),c.languages.cpp=c.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/}),c.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),c.languages.java=c.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}}),c.languages.php=c.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}}),c.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),c.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),c.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),c.languages.markup&&(c.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.backupCode=a.code,a.code=a.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(b){return a.tokenStack.push(b),"{{{PHP"+a.tokenStack.length+"}}}"}))}),c.hooks.add("before-insert",function(a){"php"===a.language&&(a.code=a.backupCode,delete a.backupCode)}),c.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b,d=0;b=a.tokenStack[d];d++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(d+1)+"}}}",c.highlight(b,a.grammar,"php").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}}),c.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),c.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:c.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),c.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(a){a.languages.ruby=a.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 b={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:a.util.clone(a.languages.ruby)}};a.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:b}},{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)/}),a.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)/}),a.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:b}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:b}}]}(c),c}),d("tinymce/codesampleplugin/Utils",[],function(){function a(a){return a&&"PRE"==a.nodeName&&-1!==a.className.indexOf("language-")}function b(a){return function(b,c){return a(c)}}return{isCodeSample:a,trimArg:b}}),d("tinymce/codesampleplugin/Dialog",["tinymce/dom/DOMUtils","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Prism"],function(a,b,c){function d(a){var b=[{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"}],c=a.settings.codesample_languages;return c?c:b}function e(a,b,d){a.undoManager.transact(function(){var e=f(a);d=i.encode(d),e?(a.dom.setAttrib(e,"class","language-"+b),e.innerHTML=d,c.highlightElement(e),a.selection.select(e)):(a.insertContent('
'+d+"
"),a.selection.select(a.$("#__new").removeAttr("id")[0]))})}function f(a){var c=a.selection.getNode();return b.isCodeSample(c)?c:null}function g(a){var b=f(a);return b?b.textContent:""}function h(a){var b,c=f(a);return c?(b=c.className.match(/language-(\w+)/),b?b[1]:""):""}var i=a.DOM;return{open:function(a){a.windowManager.open({title:"Insert/Edit code sample",minWidth:Math.min(i.getViewPort().w,a.getParam("codesample_dialog_width",800)),minHeight:Math.min(i.getViewPort().h,a.getParam("codesample_dialog_height",650)),layout:"flex",direction:"column",align:"stretch",body:[{type:"listbox",name:"language",label:"Language",maxWidth:200,value:h(a),values:d(a)},{type:"textbox",name:"code",multiline:!0,spellcheck:!1,ariaLabel:"Code view",flex:1,style:"direction: ltr; text-align: left",classes:"monospace",value:g(a),autofocus:!0}],onSubmit:function(b){e(a,b.data.language,b.data.code)}})}}}),d("tinymce/codesampleplugin/Plugin",["tinymce/Env","tinymce/PluginManager","tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Utils"],function(a,b,c,d,e){var f,g=e.trimArg;b.add("codesample",function(b,h){function i(){var a;b.inline&&f||!b.inline&&j||(b.inline?f=!0:j=!0,a=b.dom.create("link",{rel:"stylesheet",href:h+"/css/prism.css"}),b.getDoc().getElementsByTagName("head")[0].appendChild(a))}var j,k=b.$;a.ceFalse&&(b.on("PreProcess",function(a){k("pre[contenteditable=false]",a.node).filter(g(e.isCodeSample)).each(function(a,b){var c=k(b),d=b.textContent;c.attr("class",k.trim(c.attr("class"))),c.removeAttr("contentEditable"),c.empty().append(k("").each(function(){this.textContent=d}))})}),b.on("SetContent",function(){var a=k("pre").filter(g(e.isCodeSample)).filter(function(a,b){return"false"!==b.contentEditable});a.length&&b.undoManager.transact(function(){a.each(function(a,d){k(d).find("br").each(function(a,c){c.parentNode.replaceChild(b.getDoc().createTextNode("\n"),c)}),d.contentEditable=!1,d.innerHTML=b.dom.encode(d.textContent),c.highlightElement(d),d.className=k.trim(d.className)})})}),b.addCommand("codesample",function(){d.open(b)}),b.addButton("codesample",{cmd:"codesample",title:"Insert/Edit code sample"}),b.on("init",i))})}),f(["tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Plugin"])}(this); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/contextmenu/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/contextmenu/plugin.min.js index c25e98b..13cd3d2 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/contextmenu/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/contextmenu/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h0)tinymce.util.Tools.each(b,function(b){var c=q(a,b);c&&b.item.menu.push(c)});else{var c=q(a,null);c&&o.add(c)}}}),n(p,function(a){a.item.menu.length>0&&o.add(a.item)}),b.control.renderNew()}),m.convertSelectorToFormat=f}); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/lists/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/lists/plugin.min.js index cf72080..69b00ba 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/lists/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/lists/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("lists",function(a){function b(b){return a.$.contains(a.getBody(),b)}function c(a){return a&&"BR"==a.nodeName}function d(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)&&b(a)}function e(a){return a.parentNode.firstChild==a}function f(a){return a.parentNode.lastChild==a}function g(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}function h(b){return b===a.getBody()}var i=this;a.on("init",function(){function j(a,b){var c=A.isEmpty(a);return b&&A.select("span[data-mce-type=bookmark]").length>0?!1:c}function k(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=A.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):A.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function l(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,A.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=A.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),B.setRng(c)}function m(b,c){var d,e,f,g=A.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=A.create(c),e.tagName===a.settings.forced_root_block&&A.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=A.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(A.create("br",{"data-mce-bogus":"1"})):g.appendChild(A.create("br")),g}function n(){return tinymce.grep(B.getSelectedBlocks(),function(a){return/^(LI|DT|DD)$/.test(a.nodeName)})}function o(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),A.remove(a)}var e,f,g,h;for(g=A.select('span[data-mce-type="bookmark"]',a),c=c||m(b),e=A.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),h=f.firstChild;h;h=h.firstChild)if("LI"==h.nodeName&&A.isEmpty(h)){A.remove(h);break}A.isEmpty(f)||A.insertAfter(f,a),A.insertAfter(c,a),j(b.parentNode)&&d(b.parentNode),A.remove(b),j(a)&&A.remove(a)}function p(a){var b,c;if(b=a.nextSibling,b&&d(b)&&b.nodeName==a.nodeName&&C(a,b)){for(;c=b.firstChild;)a.appendChild(c);A.remove(b)}if(b=a.previousSibling,b&&d(b)&&b.nodeName==a.nodeName&&C(a,b)){for(;c=b.firstChild;)a.insertBefore(c,a.firstChild);A.remove(b)}}function q(a){tinymce.each(tinymce.grep(A.select("ol,ul",a)),function(a){var b,c=a.parentNode;"LI"==c.nodeName&&c.firstChild==a&&(b=c.previousSibling,b&&"LI"==b.nodeName&&(b.appendChild(a),j(c)&&A.remove(c))),d(c)&&(b=c.previousSibling,b&&"LI"==b.nodeName&&b.appendChild(a))})}function r(a){function b(a){j(a)&&A.remove(a)}var c,g=a.parentNode,i=g.parentNode;return h(g)?!0:"DD"==a.nodeName?(A.rename(a,"DT"),!0):e(a)&&f(a)?("LI"==i.nodeName?(A.insertAfter(a,i),b(i),A.remove(g)):d(i)?A.remove(g,!0):(i.insertBefore(m(a),g),A.remove(g)),!0):e(a)?("LI"==i.nodeName?(A.insertAfter(a,i),a.appendChild(g),b(i)):d(i)?i.insertBefore(a,g):(i.insertBefore(m(a),g),A.remove(a)),!0):f(a)?("LI"==i.nodeName?A.insertAfter(a,i):d(i)?A.insertAfter(a,g):(A.insertAfter(m(a),g),A.remove(a)),!0):("LI"==i.nodeName?(g=i,c=m(a,"LI")):c=d(i)?m(a,"LI"):m(a),o(g,a,c),q(g.parentNode),!0)}function s(a){function b(b,c){var e;if(d(b)){for(;e=a.lastChild.firstChild;)c.appendChild(e);A.remove(b)}}var c,e,f;return"DT"==a.nodeName?(A.rename(a,"DD"),!0):(c=a.previousSibling,c&&d(c)?(c.appendChild(a),!0):c&&"LI"==c.nodeName&&d(c.lastChild)?(c.lastChild.appendChild(a),b(a.lastChild,c.lastChild),!0):(c=a.nextSibling,c&&d(c)?(c.insertBefore(a,c.firstChild),!0):(c=a.previousSibling,c&&"LI"==c.nodeName?(e=A.create(a.parentNode.nodeName),f=A.getStyle(a.parentNode,"listStyleType"),f&&A.setStyle(e,"listStyleType",f),c.appendChild(e),e.appendChild(a),b(a.lastChild,e),!0):!1)))}function t(){var b=n();if(b.length){for(var c=k(B.getRng(!0)),d=0;d0))return f;for(d=a.schema.getNonEmptyElements(),1==f.nodeType&&(f=tinymce.dom.RangeUtils.getNode(f,g)),e=new tinymce.dom.TreeWalker(f,a.getBody()),c&&z(f)&&e.next();f=e[c?"next":"prev2"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function g(a,e){var f,g,i=a.parentNode;if(b(a)&&b(e)){if(d(e.lastChild)&&(g=e.lastChild),i==e.lastChild&&c(i.previousSibling)&&A.remove(i.previousSibling),f=e.lastChild,f&&c(f)&&a.hasChildNodes()&&A.remove(f),j(e,!0)&&A.$(e).empty(),!j(a,!0))for(;f=a.firstChild;)e.appendChild(f);g&&e.appendChild(g),A.remove(a),j(i)&&!h(i)&&A.remove(i)}}if(B.isCollapsed()){var i,m,n,o=A.getParent(B.getStart(),"LI");if(o){if(i=o.parentNode,h(i)&&A.isEmpty(i))return!0;if(m=B.getRng(!0),n=A.getParent(f(m,e),"LI"),n&&n!=o){var p=k(m);return e?g(n,o):g(o,n),l(p),!0}if(!n&&!e&&w(i.nodeName))return!0}}},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();return"indent"==d?t()&&(c=!0):"outdent"==d&&u()&&(c=!0),c?(a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0):void 0}),a.addCommand("InsertUnorderedList",function(a,b){x("UL",b)}),a.addCommand("InsertOrderedList",function(a,b){x("OL",b)}),a.addCommand("InsertDefinitionList",function(a,b){x("DL",b)}),a.addQueryStateHandler("InsertUnorderedList",y("UL")),a.addQueryStateHandler("InsertOrderedList",y("OL")),a.addQueryStateHandler("InsertDefinitionList",y("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?u():t())})}),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var c=a.selection.getSelectedBlocks(),d=!1,f=0,g=c.length;!d&&g>f;f++){var h=c[f].nodeName;d="LI"==h&&e(c[f])||"UL"==h||"OL"==h||"DD"==h}b.disabled(d)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?i.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&i.backspaceDelete(!0)&&a.preventDefault()})}); \ No newline at end of file +tinymce.PluginManager.add("lists",function(a){function b(b){return a.$.contains(a.getBody(),b)}function c(a){return a&&"BR"==a.nodeName}function d(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)&&b(a)}function e(a){return a&&/^(LI|DT|DD)$/.test(a.nodeName)}function f(a){return a.parentNode.firstChild==a}function g(a){return a.parentNode.lastChild==a}function h(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}function i(b){return b===a.getBody()}function j(a){return a&&3===a.nodeType}function k(a,b){var c=tinymce.dom.RangeUtils.getNode(a,b);if(e(a)&&j(c)){var d=b>=a.childNodes.length?c.data.length:0;return{container:c,offset:d}}return{container:a,offset:b}}function l(a){var b=a.cloneRange(),c=k(a.startContainer,a.startOffset);b.setStart(c.container,c.offset);var d=k(a.endContainer,a.endOffset);return b.setEnd(d.container,d.offset),b}var m=this;a.on("init",function(){function j(a,b){var c=H.isEmpty(a);return b&&H.select("span[data-mce-type=bookmark]").length>0?!1:c}function k(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=H.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):H.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function n(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,H.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=H.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),I.setRng(l(c))}function o(b,c){var d,e,f,g=H.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=H.create(c),e.tagName===a.settings.forced_root_block&&H.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=H.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(H.create("br",{"data-mce-bogus":"1"})):g.appendChild(H.create("br")),g}function p(){return tinymce.grep(I.getSelectedBlocks(),function(a){return e(a)})}function q(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),H.remove(a)}var e,f,g,h;for(g=H.select('span[data-mce-type="bookmark"]',a),c=c||o(b),e=H.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),h=f.firstChild;h;h=h.firstChild)if("LI"==h.nodeName&&H.isEmpty(h)){H.remove(h);break}H.isEmpty(f)||H.insertAfter(f,a),H.insertAfter(c,a),j(b.parentNode)&&d(b.parentNode),H.remove(b),j(a)&&H.remove(a)}function r(a){var b,c;if(b=a.nextSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.firstChild;)a.appendChild(c);H.remove(b)}if(b=a.previousSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.firstChild;)a.insertBefore(c,a.firstChild);H.remove(b)}}function s(a){tinymce.each(tinymce.grep(H.select("ol,ul",a)),t)}function t(a){var b,c=a.parentNode;"LI"==c.nodeName&&c.firstChild==a&&(b=c.previousSibling,b&&"LI"==b.nodeName?(b.appendChild(a),j(c)&&H.remove(c)):H.setStyle(c,"listStyleType","none")),d(c)&&(b=c.previousSibling,b&&"LI"==b.nodeName&&b.appendChild(a))}function u(a){function b(a){j(a)&&H.remove(a)}var c,e=a.parentNode,h=e.parentNode;return i(e)?!0:"DD"==a.nodeName?(H.rename(a,"DT"),!0):f(a)&&g(a)?("LI"==h.nodeName?(H.insertAfter(a,h),b(h),H.remove(e)):d(h)?H.remove(e,!0):(h.insertBefore(o(a),e),H.remove(e)),!0):f(a)?("LI"==h.nodeName?(H.insertAfter(a,h),a.appendChild(e),b(h)):d(h)?h.insertBefore(a,e):(h.insertBefore(o(a),e),H.remove(a)),!0):g(a)?("LI"==h.nodeName?H.insertAfter(a,h):d(h)?H.insertAfter(a,e):(H.insertAfter(o(a),e),H.remove(a)),!0):("LI"==h.nodeName?(e=h,c=o(a,"LI")):c=d(h)?o(a,"LI"):o(a),q(e,a,c),s(e.parentNode),!0)}function v(a){function b(b,c){var e;if(d(b)){for(;e=a.lastChild.firstChild;)c.appendChild(e);H.remove(b)}}var c,e,f;return"DT"==a.nodeName?(H.rename(a,"DD"),!0):(c=a.previousSibling,c&&d(c)?(c.appendChild(a),!0):c&&"LI"==c.nodeName&&d(c.lastChild)?(c.lastChild.appendChild(a),b(a.lastChild,c.lastChild),!0):(c=a.nextSibling,c&&d(c)?(c.insertBefore(a,c.firstChild),!0):(c=a.previousSibling,c&&"LI"==c.nodeName?(e=H.create(a.parentNode.nodeName),f=H.getStyle(a.parentNode,"listStyleType"),f&&H.setStyle(e,"listStyleType",f),c.appendChild(e),e.appendChild(a),b(a.lastChild,e),!0):!1)))}function w(){var b=p();if(b.length){for(var c=k(I.getRng(!0)),d=0;d0))return f;for(d=a.schema.getNonEmptyElements(),1==f.nodeType&&(f=tinymce.dom.RangeUtils.getNode(f,g)),e=new tinymce.dom.TreeWalker(f,a.getBody()),c&&C(f)&&e.next();f=e[c?"next":"prev2"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function E(a,e){var f,g,h=a.parentNode;if(b(a)&&b(e)){if(d(e.lastChild)&&(g=e.lastChild),h==e.lastChild&&c(h.previousSibling)&&H.remove(h.previousSibling),f=e.lastChild,f&&c(f)&&a.hasChildNodes()&&H.remove(f),j(e,!0)&&H.$(e).empty(),!j(a,!0))for(;f=a.firstChild;)e.appendChild(f);g&&e.appendChild(g),H.remove(a),j(h)&&!i(h)&&H.remove(h)}}function F(a){var b,c,d,e=H.getParent(I.getStart(),"LI");if(e){if(b=e.parentNode,i(b)&&H.isEmpty(b))return!0;if(c=l(I.getRng(!0)),d=H.getParent(D(c,a),"LI"),d&&d!=e){var f=k(c);return a?E(d,e):E(e,d),n(f),!0}if(!d&&!a&&z(b.nodeName))return!0}}function G(){var b=a.dom.getParent(a.selection.getStart(),"LI,DT,DD");return b||p().length>0?(a.undoManager.transact(function(){a.execCommand("Delete"),s(a.getBody())}),!0):!1}var H=a.dom,I=a.selection,J=function(b,c){var d=a.dom.getStyle(b,"list-style-type",!0),e=a.dom.getStyle(c,"list-style-type",!0);return d===e},K=function(a,b){H.setStyle(a,"list-style-type",b?b["list-style-type"]:null)};m.backspaceDelete=function(a){return I.isCollapsed()?F(a):G()},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();return"indent"==d?w()&&(c=!0):"outdent"==d&&x()&&(c=!0),c?(a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0):void 0}),a.addCommand("InsertUnorderedList",function(a,b){A("UL",b)}),a.addCommand("InsertOrderedList",function(a,b){A("OL",b)}),a.addCommand("InsertDefinitionList",function(a,b){A("DL",b)}),a.addQueryStateHandler("InsertUnorderedList",B("UL")),a.addQueryStateHandler("InsertOrderedList",B("OL")),a.addQueryStateHandler("InsertDefinitionList",B("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?x():w())})}),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var c=a.selection.getSelectedBlocks(),d=!1,e=0,g=c.length;!d&&g>e;e++){var h=c[e].nodeName;d="LI"==h&&f(c[e])||"UL"==h||"OL"==h||"DD"==h}b.disabled(d)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?m.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&m.backspaceDelete(!0)&&a.preventDefault()})}); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/paste/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/paste/plugin.min.js index 207f84d..e639da5 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/paste/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/paste/plugin.min.js @@ -1 +1 @@ -!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/|/g,[/( ?)\u00a0<\/span>( ?)/g,b],/
/g,/
$/i])}function g(a){var b=0;return function(){return a+b++}}return{filter:d,innerText:e,trimHtml:f,createIdGenerator:g}}),d("tinymce/pasteplugin/SmartPaste",["tinymce/util/Tools"],function(a){var b=function(a){return/^https?:\/\/[\w\?\-\/+=.&%]+$/i.test(a)},c=function(a){return b(a)&&/.(gif|jpe?g|png)$/.test(a)},d=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.insertContent('')}),!0},e=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.execCommand("mceInsertLink",!1,b)}),!0},f=function(a,c,d){return a.selection.isCollapsed()===!1&&b(c)?e(a,c,d):!1},g=function(a,b,e){return c(b)?d(a,b,e):!1},h=function(a,b){return a.insertContent(b,{merge:a.settings.paste_merge_formats!==!1,paste:!0}),!0},i=function(b,c){a.each([f,g,h],function(a){return a(b,c,h)!==!0})},j=function(a,b){a.settings.smart_paste===!1?h(a,b):i(a,b)};return{isImageUrl:c,isAbsoluteUrl:b,insertContent:j}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils","tinymce/pasteplugin/SmartPaste","tinymce/util/Delay"],function(a,b,c,d,e,f){return function(g){function h(a){var b,c=g.dom;if(b=g.fire("BeforePastePreProcess",{content:a}),b=g.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(g.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(g.getBody(),"div",{style:"display:none"},a);b=g.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(g,a)}}function i(a){a=g.dom.encode(a).replace(/\r\n/g,"\n");var b,c=g.dom.getParent(g.selection.getStart(),g.dom.isBlock),e=g.settings.forced_root_block;e&&(b=g.dom.createHTML(e,g.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!e?a=d.filter(a,[[/\n/g,"
"]]):(a=d.filter(a,[[/\n\n/g,"

"+b],[/^(.*<\/p>)(

)$/,b+"$1"],[/\n/g,"
"]]),-1!=a.indexOf("

")&&(a=b+a)),h(a)}function j(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[z.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=g.dom,e=g.getBody(),f=g.dom.getViewPort(g.getWin()),h=f.y,i=20;if(z=g.selection.getRng(),g.inline&&(c=g.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),z.getClientRects){var j=b(z);if(j)i=h+(j.top-d.getPos(e).y);else{i=h;var k=z.startContainer;k&&(3==k.nodeType&&k.parentNode!=e&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||e).y))}}y=d.add(g.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},E),(a.ie||a.gecko)&&d.setStyle(y,"left","rtl"==d.getStyle(e,"direction",!0)?65535:-65535),d.bind(y,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),y.focus(),g.selection.select(y,!0)}function k(){if(y){for(var a;a=g.dom.get("mcepastebin");)g.dom.remove(a),g.dom.unbind(a);z&&g.selection.setRng(z)}y=z=null}function l(){var a,b,c,d,e="";for(a=g.dom.select("div[id=mcepastebin]"),b=0;b0&&-1==c.indexOf(F)&&(b["text/plain"]=c)}if(a.types)for(var d=0;d')}else h('')}function s(a,b){function c(c){var d,e,f,g=!1;if(c)for(d=0;d0}function w(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function x(){function b(a,b,c){var e;return v(a,"text/html")?e=a["text/html"]:(e=l(),e==E&&(c=!0)),e=d.trimHtml(e),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(c=!0),k(),e.length||(c=!0),c&&(e=v(a,"text/plain")&&-1==e.indexOf("

")?a["text/plain"]:d.innerText(e)),e==E?void(b||g.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(c?i(e):h(e))}function c(a){return 0===a["text/plain"].indexOf("file://")}g.on("keydown",function(b){function c(a){w(a)&&!a.isDefaultPrevented()&&k()}if(w(b)&&!b.isDefaultPrevented()){if(A=b.shiftKey&&86==b.keyCode,A&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),C=(new Date).getTime(),a.ie&&A)return b.preventDefault(),void g.fire("paste",{ieFake:!0});k(),j(),g.once("keyup",c),g.once("paste",function(){g.off("keyup",c)})}});var e=function(){return z||g.selection.getRng()};g.on("paste",function(c){var d=(new Date).getTime(),h=n(c),i=(new Date).getTime()-d,m=(new Date).getTime()-C-i<1e3,p="text"==B.pasteFormat||A;return A=!1,c.isDefaultPrevented()||t(c)?void k():!o(h)&&s(c,e())?void k():(m||c.preventDefault(),!a.ie||m&&!c.ieFake||(j(),g.dom.bind(y,"paste",function(a){a.stopPropagation()}),g.getDoc().execCommand("Paste",!1,null),h["text/html"]=l()),void(v(h,"text/html")?(c.preventDefault(),b(h,m,p)):f.setEditorTimeout(g,function(){b(h,m,p)},0)))}),g.on("dragstart dragend",function(a){D="dragstart"==a.type}),g.on("drop",function(a){var b,e;if(e=u(a),!a.isDefaultPrevented()&&!D&&(b=m(a.dataTransfer),(o(b)&&!c(b)||!s(a,e))&&e&&g.settings.paste_filter_drop!==!1)){var j=b["mce-internal"]||b["text/html"]||b["text/plain"];j&&(a.preventDefault(),f.setEditorTimeout(g,function(){g.undoManager.transact(function(){b["mce-internal"]&&g.execCommand("Delete"),g.selection.setRng(e),j=d.trimHtml(j),b["text/html"]?h(j):i(j)})}))}}),g.on("dragover dragend",function(a){g.settings.paste_data_images&&a.preventDefault()})}var y,z,A,B=this,C=0,D=!1,E="%MCEPASTEBIN%",F="data:text/mce-internal,",G=d.createIdGenerator("mceclip");B.pasteHtml=h,B.pasteText=i,B.pasteImageData=s,g.on("preInit",function(){x(),g.parser.addNodeFilter("img",function(b,c,d){function e(a){return a.data&&a.data.paste===!0}function f(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}function h(a){return 0===a.indexOf("webkit-fake-url")}function i(a){return 0===a.indexOf("data:")}if(!g.settings.paste_data_images&&e(d))for(var j=b.length;j--;){var k=b[j].attributes.map.src;k&&(h(k)?f(b[j]):!g.settings.allow_html_data_urls&&i(k)&&f(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/
/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-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");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({validate:k.validate},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:
 [\\s\\r\\n]+|
)*(<\\/?("+f.join("|")+")[^>]*>)(?:
 [\\s\\r\\n]+|
)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/

/g,"

"],[/
/g," "],[/

/g,"
"]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(a){function f(){return e||a.settings.paste_plaintext_inform===!1}function g(){if("text"==h.pasteFormat)this.active(!1),h.pasteFormat="html",a.fire("PastePlainTextToggle",{state:!1});else if(h.pasteFormat="text",this.active(!0),!f()){var b=a.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");a.notificationManager.open({text:b,type:"info"}),e=!0,a.fire("PastePlainTextToggle",{state:!0})}a.focus()}var h,i=this,j=a.settings;i.clipboard=h=new b(a),i.quirks=new d(a),i.wordFilter=new c(a),a.settings.paste_as_text&&(i.clipboard.pasteFormat="text"),j.paste_preprocess&&a.on("PastePreProcess",function(a){j.paste_preprocess.call(i,i,a)}),j.paste_postprocess&&a.on("PastePostProcess",function(a){j.paste_postprocess.call(i,i,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&i.clipboard.pasteHtml(b.content),b.text&&i.clipboard.pasteText(b.text)}),a.settings.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:g,active:"text"==i.clipboard.pasteFormat}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:h.pasteFormat,onclick:g})})}),f(["tinymce/pasteplugin/Utils"])}(this); \ No newline at end of file +!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/|/g,[/( ?)\u00a0<\/span>( ?)/g,b],/
/g,/
$/i])}function g(a){var b=0;return function(){return a+b++}}return{filter:d,innerText:e,trimHtml:f,createIdGenerator:g}}),d("tinymce/pasteplugin/SmartPaste",["tinymce/util/Tools"],function(a){var b=function(a){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(a)},c=function(a){return b(a)&&/.(gif|jpe?g|png)$/.test(a)},d=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.insertContent('')}),!0},e=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.execCommand("mceInsertLink",!1,b)}),!0},f=function(a,c,d){return a.selection.isCollapsed()===!1&&b(c)?e(a,c,d):!1},g=function(a,b,e){return c(b)?d(a,b,e):!1},h=function(a,b){return a.insertContent(b,{merge:a.settings.paste_merge_formats!==!1,paste:!0}),!0},i=function(b,c){a.each([f,g,h],function(a){return a(b,c,h)!==!0})},j=function(a,b){a.settings.smart_paste===!1?h(a,b):i(a,b)};return{isImageUrl:c,isAbsoluteUrl:b,insertContent:j}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils","tinymce/pasteplugin/SmartPaste","tinymce/util/Delay"],function(a,b,c,d,e,f){return function(g){function h(a){var b,c=g.dom;if(b=g.fire("BeforePastePreProcess",{content:a}),b=g.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(g.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(g.getBody(),"div",{style:"display:none"},a);b=g.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(g,a)}}function i(a){a=g.dom.encode(a).replace(/\r\n/g,"\n");var b,c=g.dom.getParent(g.selection.getStart(),g.dom.isBlock),e=g.settings.forced_root_block;e&&(b=g.dom.createHTML(e,g.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!e?a=d.filter(a,[[/\n/g,"
"]]):(a=d.filter(a,[[/\n\n/g,"

"+b],[/^(.*<\/p>)(

)$/,b+"$1"],[/\n/g,"
"]]),-1!=a.indexOf("

")&&(a=b+a)),h(a)}function j(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[z.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=g.dom,e=g.getBody(),f=g.dom.getViewPort(g.getWin()),h=f.y,i=20;if(z=g.selection.getRng(),g.inline&&(c=g.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),z.getClientRects){var j=b(z);if(j)i=h+(j.top-d.getPos(e).y);else{i=h;var k=z.startContainer;k&&(3==k.nodeType&&k.parentNode!=e&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||e).y))}}y=d.add(g.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},E),(a.ie||a.gecko)&&d.setStyle(y,"left","rtl"==d.getStyle(e,"direction",!0)?65535:-65535),d.bind(y,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),y.focus(),g.selection.select(y,!0)}function k(){if(y){for(var a;a=g.dom.get("mcepastebin");)g.dom.remove(a),g.dom.unbind(a);z&&g.selection.setRng(z)}y=z=null}function l(){var a,b,c,d,e="";for(a=g.dom.select("div[id=mcepastebin]"),b=0;b0&&-1==c.indexOf(F)&&(b["text/plain"]=c)}if(a.types)for(var d=0;d')}else h('')}function s(a,b){function c(c){var d,e,f,g=!1;if(c)for(d=0;d0}function w(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function x(){function b(a,b,c){var e;return v(a,"text/html")?e=a["text/html"]:(e=l(),e==E&&(c=!0)),e=d.trimHtml(e),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(c=!0),k(),e.length||(c=!0),c&&(e=v(a,"text/plain")&&-1==e.indexOf("

")?a["text/plain"]:d.innerText(e)),e==E?void(b||g.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(c?i(e):h(e))}function c(a){return 0===a["text/plain"].indexOf("file://")}g.on("keydown",function(b){function c(a){w(a)&&!a.isDefaultPrevented()&&k()}if(w(b)&&!b.isDefaultPrevented()){if(A=b.shiftKey&&86==b.keyCode,A&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),C=(new Date).getTime(),a.ie&&A)return b.preventDefault(),void g.fire("paste",{ieFake:!0});k(),j(),g.once("keyup",c),g.once("paste",function(){g.off("keyup",c)})}});var e=function(){return z||g.selection.getRng()};g.on("paste",function(c){var d=(new Date).getTime(),h=n(c),i=(new Date).getTime()-d,m=(new Date).getTime()-C-i<1e3,p="text"==B.pasteFormat||A;return A=!1,c.isDefaultPrevented()||t(c)?void k():!o(h)&&s(c,e())?void k():(m||c.preventDefault(),!a.ie||m&&!c.ieFake||(j(),g.dom.bind(y,"paste",function(a){a.stopPropagation()}),g.getDoc().execCommand("Paste",!1,null),h["text/html"]=l()),void(v(h,"text/html")?(c.preventDefault(),b(h,m,p)):f.setEditorTimeout(g,function(){b(h,m,p)},0)))}),g.on("dragstart dragend",function(a){D="dragstart"==a.type}),g.on("drop",function(a){var b,e;if(e=u(a),!a.isDefaultPrevented()&&!D&&(b=m(a.dataTransfer),(o(b)&&!c(b)||!s(a,e))&&e&&g.settings.paste_filter_drop!==!1)){var j=b["mce-internal"]||b["text/html"]||b["text/plain"];j&&(a.preventDefault(),f.setEditorTimeout(g,function(){g.undoManager.transact(function(){b["mce-internal"]&&g.execCommand("Delete"),g.selection.setRng(e),j=d.trimHtml(j),b["text/html"]?h(j):i(j)})}))}}),g.on("dragover dragend",function(a){g.settings.paste_data_images&&a.preventDefault()})}var y,z,A,B=this,C=0,D=!1,E="%MCEPASTEBIN%",F="data:text/mce-internal,",G=d.createIdGenerator("mceclip");B.pasteHtml=h,B.pasteText=i,B.pasteImageData=s,g.on("preInit",function(){x(),g.parser.addNodeFilter("img",function(b,c,d){function e(a){return a.data&&a.data.paste===!0}function f(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}function h(a){return 0===a.indexOf("webkit-fake-url")}function i(a){return 0===a.indexOf("data:")}if(!g.settings.paste_data_images&&e(d))for(var j=b.length;j--;){var k=b[j].attributes.map.src;k&&(h(k)?f(b[j]):!g.settings.allow_html_data_urls&&i(k)&&f(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/
/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-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");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({validate:k.validate},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:
 [\\s\\r\\n]+|
)*(<\\/?("+f.join("|")+")[^>]*>)(?:
 [\\s\\r\\n]+|
)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/

/g,"

"],[/
/g," "],[/

/g,"
"]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(f){function g(){return e||f.settings.paste_plaintext_inform===!1}function h(){if("text"==i.pasteFormat)this.active(!1),i.pasteFormat="html",f.fire("PastePlainTextToggle",{state:!1});else if(i.pasteFormat="text",this.active(!0),!g()){var a=f.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");f.notificationManager.open({text:a,type:"info"}),e=!0,f.fire("PastePlainTextToggle",{state:!0})}f.focus()}var i,j=this,k=f.settings;return/(^|[ ,])powerpaste([, ]|$)/.test(k.plugins)&&a.get("powerpaste")?void("undefined"!=typeof console&&console.log&&console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option.")):(j.clipboard=i=new b(f),j.quirks=new d(f),j.wordFilter=new c(f),f.settings.paste_as_text&&(j.clipboard.pasteFormat="text"),k.paste_preprocess&&f.on("PastePreProcess",function(a){k.paste_preprocess.call(j,j,a)}),k.paste_postprocess&&f.on("PastePostProcess",function(a){k.paste_postprocess.call(j,j,a)}),f.addCommand("mceInsertClipboardContent",function(a,b){b.content&&j.clipboard.pasteHtml(b.content),b.text&&j.clipboard.pasteText(b.text)}),f.settings.paste_block_drop&&f.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),f.settings.paste_data_images||f.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),f.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:h,active:"text"==j.clipboard.pasteFormat}),void f.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:i.pasteFormat,onclick:h}))})}),f(["tinymce/pasteplugin/Utils"])}(this); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/spellchecker/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/spellchecker/plugin.min.js index 95011bb..5d8fe40 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/spellchecker/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/spellchecker/plugin.min.js @@ -1 +1 @@ -!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f=i.end?(f=l,h=i.end-k):e&&j.push(l),!e&&l.length+k>i.start&&(e=l,g=i.start-k),k+=l.length),e&&f){if(l=d({startNode:e,startNodeIndex:g,endNode:f,endNodeIndex:h,innerNodes:j,match:i.text,matchIndex:m}),k-=f.length-h,e=null,f=null,j=[],i=c.shift(),m++,!i)break}else if(y[l.nodeName]&&!x[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!a(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===b)break a;l=l.parentNode}}}function g(a){function b(b,c){var d=A[c];d.stencil||(d.stencil=a(d));var e=d.stencil.cloneNode(!1);return e.setAttribute("data-mce-index",c),b&&e.appendChild(B.doc.createTextNode(b)),e}return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex,i=B.doc;if(f===g){var j=f;e=j.parentNode,a.startNodeIndex>0&&(c=i.createTextNode(j.data.substring(0,a.startNodeIndex)),e.insertBefore(c,j));var k=b(a.match,h);return e.insertBefore(k,j),a.endNodeIndexn;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(l,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}function h(a){var b=a.parentNode;b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function i(a){var c=b.getElementsByTagName("*"),d=[];a="number"==typeof a?""+a:null;for(var e=0;eb&&a(A[b],b)!==!1;b++);return this}function m(a){return A.length&&f(b,A,g(a)),this}function n(a,b){if(w&&a.global)for(;v=a.exec(w);)A.push(d(v,b));return this}function o(a){var b,c=i(a?j(a):null);for(b=c.length;b--;)h(c[b]);return this}function p(a){return A[a.getAttribute("data-mce-index")]}function q(a){return i(j(a))[0]}function r(a,b,c){return A.push({start:a,end:a+b,text:w.substr(a,b),data:c}),this}function s(a){var b=i(j(a)),d=c.dom.createRng();return d.setStartBefore(b[0]),d.setEndAfter(b[b.length-1]),d}function t(a,b){var d=s(a);return d.deleteContents(),b.length>0&&d.insertNode(c.dom.doc.createTextNode(b)),d}function u(){return A.splice(0,A.length),o(),this}var v,w,x,y,z,A=[],B=c.dom;return x=c.schema.getBlockElements(),y=c.schema.getWhiteSpaceElements(),z=c.schema.getShortEndedElements(),w=e(b),{text:w,matches:A,each:l,filter:k,reset:u,matchFromElement:p,elementFromMatch:q,find:n,add:r,wrap:m,unwrap:o,replace:t,rangeFromMatch:s,indexOf:j}}}),d("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(a,b,c,d,e,f,g,h){b.add("spellchecker",function(b,i){function j(){return E.textMatcher||(E.textMatcher=new a(b.getBody(),b)),E.textMatcher}function k(a,b){var d=[];return c.each(b,function(a){d.push({selectable:!0,text:a.name,data:a.value})}),d}function l(a){for(var b in a)return!1;return!0}function m(a,f){var g=[],h=A[a];c.each(h,function(a){g.push({text:a,onclick:function(){b.insertContent(b.dom.encode(a)),b.dom.remove(f),r()}})}),g.push({text:"-"}),D&&g.push({text:"Add to Dictionary",onclick:function(){s(a,f)}}),g.push.apply(g,[{text:"Ignore",onclick:function(){t(a,f)}},{text:"Ignore all",onclick:function(){t(a,f,!0)}}]),C=new d({items:g,context:"contextmenu",onautohide:function(a){-1!=a.target.className.indexOf("spellchecker")&&a.preventDefault()},onhide:function(){C.remove(),C=null}}),C.renderTo(document.body);var i=e.DOM.getPos(b.getContentAreaContainer()),j=b.dom.getPos(f[0]),k=b.dom.getRoot();"BODY"==k.nodeName?(j.x-=k.ownerDocument.documentElement.scrollLeft||k.scrollLeft,j.y-=k.ownerDocument.documentElement.scrollTop||k.scrollTop):(j.x-=k.scrollLeft,j.y-=k.scrollTop),i.x+=j.x,i.y+=j.y,C.moveTo(i.x,i.y+f[0].offsetHeight)}function n(){return b.getParam("spellchecker_wordchar_pattern")||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")}function o(a,d,e,j){var k={method:a,lang:F.spellchecker_language},l="";k["addToDictionary"==a?"word":"text"]=d,c.each(k,function(a,b){l&&(l+="&"),l+=b+"="+encodeURIComponent(a)}),f.send({url:new g(i).toAbsolute(F.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:l,success:function(a){if(a=h.parse(a))a.error?j(a.error):e(a);else{var c=b.translate("Server response wasn't proper JSON.");j(c)}},error:function(){var a=b.translate("The spelling service was not found: (")+F.spellchecker_rpc_url+b.translate(")");j(a)}})}function p(a,b,c,d){var e=F.spellchecker_callback||o;e.call(E,a,b,c,d)}function q(){function a(a){b.notificationManager.open({text:a,type:"error"}),b.setProgressState(!1),u()}u()||(b.setProgressState(!0),p("spellcheck",j().text,y,a),b.focus())}function r(){b.dom.select("span.mce-spellchecker-word").length||u()}function s(a,c){b.setProgressState(!0),p("addToDictionary",a,function(){b.setProgressState(!1),b.dom.remove(c,!0),r()},function(a){b.notificationManager.open({text:a,type:"error"}),b.setProgressState(!1)})}function t(a,d,e){b.selection.collapse(),e?c.each(b.dom.select("span.mce-spellchecker-word"),function(c){c.getAttribute("data-mce-word")==a&&b.dom.remove(c,!0)}):b.dom.remove(d,!0),r()}function u(){return j().reset(),E.textMatcher=null,B?(B=!1,b.fire("SpellcheckEnd"),!0):void 0}function v(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function w(a){var d,e=[];if(d=c.toArray(b.getBody().getElementsByTagName("span")),d.length)for(var f=0;f0){var e=b.dom.createRng();e.setStartBefore(d[0]),e.setEndAfter(d[d.length-1]),b.selection.setRng(e),m(c.getAttribute("data-mce-word"),d)}}}),b.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:q,selectable:!0,onPostRender:function(){var a=this;a.active(B),b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}});var H={tooltip:"Spellcheck",onclick:q,onPostRender:function(){var a=this;b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}};z.length>1&&(H.type="splitbutton",H.menu=z,H.onshow=x,H.onselect=function(a){F.spellchecker_language=a.control.settings.data}),b.addButton("spellchecker",H),b.addCommand("mceSpellCheck",q),b.on("remove",function(){C&&(C.remove(),C=null)}),b.on("change",r),this.getTextMatcher=j,this.getWordCharPattern=n,this.markErrors=y,this.getLanguage=function(){return F.spellchecker_language},F.spellchecker_language=F.spellchecker_language||F.language||"en"})}),f(["tinymce/spellcheckerplugin/DomTextMatcher"])}(this); \ No newline at end of file +!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f=i.end?(f=l,h=i.end-k):e&&j.push(l),!e&&l.length+k>i.start&&(e=l,g=i.start-k),k+=l.length),e&&f){if(l=d({startNode:e,startNodeIndex:g,endNode:f,endNodeIndex:h,innerNodes:j,match:i.text,matchIndex:m}),k-=f.length-h,e=null,f=null,j=[],i=c.shift(),m++,!i)break}else if(y[l.nodeName]&&!x[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!a(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===b)break a;l=l.parentNode}}}function g(a){function b(b,c){var d=A[c];d.stencil||(d.stencil=a(d));var e=d.stencil.cloneNode(!1);return e.setAttribute("data-mce-index",c),b&&e.appendChild(B.doc.createTextNode(b)),e}return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex,i=B.doc;if(f===g){var j=f;e=j.parentNode,a.startNodeIndex>0&&(c=i.createTextNode(j.data.substring(0,a.startNodeIndex)),e.insertBefore(c,j));var k=b(a.match,h);return e.insertBefore(k,j),a.endNodeIndexn;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(l,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}function h(a){var b=a.parentNode;b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function i(a){var c=b.getElementsByTagName("*"),d=[];a="number"==typeof a?""+a:null;for(var e=0;eb&&a(A[b],b)!==!1;b++);return this}function m(a){return A.length&&f(b,A,g(a)),this}function n(a,b){if(w&&a.global)for(;v=a.exec(w);)A.push(d(v,b));return this}function o(a){var b,c=i(a?j(a):null);for(b=c.length;b--;)h(c[b]);return this}function p(a){return A[a.getAttribute("data-mce-index")]}function q(a){return i(j(a))[0]}function r(a,b,c){return A.push({start:a,end:a+b,text:w.substr(a,b),data:c}),this}function s(a){var b=i(j(a)),d=c.dom.createRng();return d.setStartBefore(b[0]),d.setEndAfter(b[b.length-1]),d}function t(a,b){var d=s(a);return d.deleteContents(),b.length>0&&d.insertNode(c.dom.doc.createTextNode(b)),d}function u(){return A.splice(0,A.length),o(),this}var v,w,x,y,z,A=[],B=c.dom;return x=c.schema.getBlockElements(),y=c.schema.getWhiteSpaceElements(),z=c.schema.getShortEndedElements(),w=e(b),{text:w,matches:A,each:l,filter:k,reset:u,matchFromElement:p,elementFromMatch:q,find:n,add:r,wrap:m,unwrap:o,replace:t,rangeFromMatch:s,indexOf:j}}}),d("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(a,b,c,d,e,f,g,h){b.add("spellchecker",function(i,j){function k(){return F.textMatcher||(F.textMatcher=new a(i.getBody(),i)),F.textMatcher}function l(a,b){var d=[];return c.each(b,function(a){d.push({selectable:!0,text:a.name,data:a.value})}),d}function m(a){for(var b in a)return!1;return!0}function n(a,b){var f=[],g=B[a];c.each(g,function(a){f.push({text:a,onclick:function(){i.insertContent(i.dom.encode(a)),i.dom.remove(b),s()}})}),f.push({text:"-"}),E&&f.push({text:"Add to Dictionary",onclick:function(){t(a,b)}}),f.push.apply(f,[{text:"Ignore",onclick:function(){u(a,b)}},{text:"Ignore all",onclick:function(){u(a,b,!0)}}]),D=new d({items:f,context:"contextmenu",onautohide:function(a){-1!=a.target.className.indexOf("spellchecker")&&a.preventDefault()},onhide:function(){D.remove(),D=null}}),D.renderTo(document.body);var h=e.DOM.getPos(i.getContentAreaContainer()),j=i.dom.getPos(b[0]),k=i.dom.getRoot();"BODY"==k.nodeName?(j.x-=k.ownerDocument.documentElement.scrollLeft||k.scrollLeft,j.y-=k.ownerDocument.documentElement.scrollTop||k.scrollTop):(j.x-=k.scrollLeft,j.y-=k.scrollTop),h.x+=j.x,h.y+=j.y,D.moveTo(h.x,h.y+b[0].offsetHeight)}function o(){return i.getParam("spellchecker_wordchar_pattern")||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")}function p(a,b,d,e){var k={method:a,lang:G.spellchecker_language},l="";k["addToDictionary"==a?"word":"text"]=b,c.each(k,function(a,b){l&&(l+="&"),l+=b+"="+encodeURIComponent(a)}),f.send({url:new g(j).toAbsolute(G.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:l,success:function(a){if(a=h.parse(a))a.error?e(a.error):d(a);else{var b=i.translate("Server response wasn't proper JSON.");e(b)}},error:function(){var a=i.translate("The spelling service was not found: (")+G.spellchecker_rpc_url+i.translate(")");e(a)}})}function q(a,b,c,d){var e=G.spellchecker_callback||p;e.call(F,a,b,c,d)}function r(){function a(a){i.notificationManager.open({text:a,type:"error"}),i.setProgressState(!1),v()}v()||(i.setProgressState(!0),q("spellcheck",k().text,z,a),i.focus())}function s(){i.dom.select("span.mce-spellchecker-word").length||v()}function t(a,b){i.setProgressState(!0),q("addToDictionary",a,function(){i.setProgressState(!1),i.dom.remove(b,!0),s()},function(a){i.notificationManager.open({text:a,type:"error"}),i.setProgressState(!1)})}function u(a,b,d){i.selection.collapse(),d?c.each(i.dom.select("span.mce-spellchecker-word"),function(b){b.getAttribute("data-mce-word")==a&&i.dom.remove(b,!0)}):i.dom.remove(b,!0),s()}function v(){return k().reset(),F.textMatcher=null,C?(C=!1,i.fire("SpellcheckEnd"),!0):void 0}function w(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function x(a){var b,d=[];if(b=c.toArray(i.getBody().getElementsByTagName("span")),b.length)for(var e=0;e0){var d=i.dom.createRng();d.setStartBefore(c[0]),d.setEndAfter(c[c.length-1]),i.selection.setRng(d),n(b.getAttribute("data-mce-word"),c)}}}),i.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:r,selectable:!0,onPostRender:function(){var a=this;a.active(C),i.on("SpellcheckStart SpellcheckEnd",function(){a.active(C)})}});var I={tooltip:"Spellcheck",onclick:r,onPostRender:function(){var a=this;i.on("SpellcheckStart SpellcheckEnd",function(){a.active(C)})}};A.length>1&&(I.type="splitbutton",I.menu=A,I.onshow=y,I.onselect=function(a){G.spellchecker_language=a.control.settings.data}),i.addButton("spellchecker",I),i.addCommand("mceSpellCheck",r),i.on("remove",function(){D&&(D.remove(),D=null)}),i.on("change",s),this.getTextMatcher=k,this.getWordCharPattern=o,this.markErrors=z,this.getLanguage=function(){return G.spellchecker_language},G.spellchecker_language=G.spellchecker_language||G.language||"en"})}),f(["tinymce/spellcheckerplugin/DomTextMatcher"])}(this); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/table/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/table/plugin.min.js index 019acc5..c38a060 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/table/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/table/plugin.min.js @@ -1,2 +1,2 @@ -!function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g9)&&(b.hasChildNodes()||(b.innerHTML='
'))}return{getSpanVal:b,paddCell:c}}),d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env","tinymce/tableplugin/Utils"],function(a,c,d){var e=a.each,f=d.getSpanVal;return function(g,h,i){function j(){g.$("td[data-mce-selected],th[data-mce-selected]").removeAttr("data-mce-selected")}function k(a){return a===g.getBody()}function l(b,c){return b?(c=a.map(c.split(","),function(a){return a.toLowerCase()}),a.grep(b.childNodes,function(b){return-1!==a.inArray(c,b.nodeName.toLowerCase())})):[]}function m(){var a=0;O=[],P=0,e(["thead","tbody","tfoot"],function(b){var c=l(h,b)[0],d=l(c,"tr");e(d,function(c,d){d+=a,e(l(c,"td,th"),function(a,c){var e,g,h,i;if(O[d])for(;O[d][c];)c++;for(h=f(a,"rowspan"),i=f(a,"colspan"),g=d;d+h>g;g++)for(O[g]||(O[g]=[]),e=c;c+i>e;e++)O[g][e]={part:b,real:g==d&&e==c,elm:a,rowspan:h,colspan:i};P=Math.max(P,c+1)})}),a+=d.length})}function n(a){return g.fire("newrow",{node:a}),a}function o(a){return g.fire("newcell",{node:a}),a}function p(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function q(a,b){var c;return c=O[b],c?c[a]:void 0}function r(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function s(a){return a&&(!!T.getAttrib(a.elm,"data-mce-selected")||a==i)}function t(){var a=[];return e(h.rows,function(b){e(b.cells,function(c){return T.getAttrib(c,"data-mce-selected")||i&&c==i.elm?(a.push(b),!1):void 0})}),a}function u(){var a=T.createRng();k(h)||(a.setStartAfter(h),a.setEndAfter(h),S.setRng(a),T.remove(h))}function v(b){var f,h={};return g.settings.table_clone_elements!==!1&&(h=a.makeMap((g.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var d;return 3==a.nodeType?(e(T.getParents(a.parentNode,null,b).reverse(),function(a){h[a.nodeName]&&(a=p(a,!1),f?d&&d.appendChild(a):f=d=a,d=a)}),d&&(d.innerHTML=c.ie&&c.ie<10?" ":'
'),!1):void 0},"childNodes"),b=p(b,!1),o(b),r(b,"rowSpan",1),r(b,"colSpan",1),f?b.appendChild(f):d.paddCell(b),b}function w(){var a,b=T.createRng();return e(T.select("tr",h),function(a){0===a.cells.length&&T.remove(a)}),0===T.select("tr",h).length?(b.setStartBefore(h),b.setEndBefore(h),S.setRng(b),void T.remove(h)):(e(T.select("thead,tbody,tfoot",h),function(a){0===a.rows.length&&T.remove(a)}),m(),void(Q&&(a=O[Math.min(O.length-1,Q.y)],a&&(S.select(a[Math.min(a.length-1,Q.x)].elm,!0),S.collapse(!0)))))}function x(a,b,c,d){var e,f,g,h,i;for(e=O[b][a].elm.parentNode,g=1;c>=g;g++)if(e=T.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=O[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)T.insertAfter(v(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(v(e.cells[0]),e.cells[0])}}function y(){e(O,function(a,b){e(a,function(a,c){var d,e,g;if(s(a)&&(a=a.elm,d=f(a,"colspan"),e=f(a,"rowspan"),d>1||e>1)){for(r(a,"rowSpan",1),r(a,"colSpan",1),g=0;d-1>g;g++)T.insertAfter(v(a),a);x(c,b,e-1,d)}})})}function z(b,c,d){var f,g,h,i,j,k,l,n,o,p,t;if(b?(f=J(b),g=f.x,h=f.y,i=g+(c-1),j=h+(d-1)):(Q=R=null,e(O,function(a,b){e(a,function(a,c){s(a)&&(Q||(Q={x:c,y:b}),R={x:c,y:b})})}),Q&&(g=Q.x,h=Q.y,i=R.x,j=R.y)),n=q(g,h),o=q(i,j),n&&o&&n.part==o.part){y(),m(),n=q(g,h).elm;var u=i-g+1,v=j-h+1;for(u===P&&v===O.length&&(u=1,v=1),u===P&&v>1&&(v=1),r(n,"colSpan",u),r(n,"rowSpan",v),l=h;j>=l;l++)for(k=g;i>=k;k++)O[l]&&O[l][k]&&(b=O[l][k].elm,b!=n&&(p=a.grep(b.childNodes),e(p,function(a){n.appendChild(a)}),p.length&&(p=a.grep(n.childNodes),t=0,e(p,function(a){"BR"==a.nodeName&&t++0&&O[c-1][h]&&(l=O[c-1][h].elm,m=f(l,"rowSpan"),m>1)){r(l,"rowSpan",m+1);continue}}else if(m=f(d,"rowspan"),m>1){r(d,"rowSpan",m+1);continue}k=v(d),r(k,"colSpan",d.colSpan),j.appendChild(k),g=d}j.hasChildNodes()&&(a?i.parentNode.insertBefore(j,i):T.insertAfter(j,i))}}function B(a){var b,c;e(O,function(c){return e(c,function(c,d){return s(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(O,function(d,e){var g,h,i;d[b]&&(g=d[b].elm,g!=c&&(i=f(g,"colspan"),h=f(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(v(g),g),x(b,e,h-1,i)):(T.insertAfter(v(g),g),x(b,e,h-1,i)):r(g,"colSpan",g.colSpan+1),c=g))})}function C(b){return a.grep(D(b),s)}function D(a){var b=[];return e(a,function(a){e(a,function(a){b.push(a)})}),b}function E(){var b=[];if(k(h)){if(1==O[0].length)return;if(C(O).length==D(O).length)return}e(O,function(c){e(c,function(c,d){s(c)&&-1===a.inArray(b,d)&&(e(O,function(a){var b,c=a[d].elm;b=f(c,"colSpan"),b>1?r(c,"colSpan",b-1):T.remove(c)}),b.push(d))})}),w()}function F(){function a(a){var b,c;e(a.cells,function(a){var c=f(a,"rowSpan");c>1&&(r(a,"rowSpan",c-1),b=J(a),x(b.x,b.y,1,1))}),b=J(a.cells[0]),e(O[b.y],function(a){var b;a=a.elm,a!=c&&(b=f(a,"rowSpan"),1>=b?T.remove(a):r(a,"rowSpan",b-1),c=a)})}var b;b=t(),k(h)&&b.length==h.rows.length||(e(b.reverse(),function(b){a(b)}),w())}function G(){var a=t();if(!k(h)||a.length!=h.rows.length)return T.remove(a),w(),a}function H(){var a=t();return e(a,function(b,c){a[c]=p(b,!0)}),a}function I(b,c){var d,f=t(),g=f[c?0:f.length-1],h=g.cells.length;b&&(d=a.map(b,function(a){return a.cloneNode(!0)}),e(O,function(a){var b;return h=0,e(a,function(a){a.real&&(h+=a.colspan),a.elm.parentNode==g&&(b=1)}),b?!1:void 0}),c||d.reverse(),e(d,function(a){var b,d,e=a.cells.length;for(n(a),b=0;e>b;b++)d=a.cells[b],o(d),r(d,"colSpan",1),r(d,"rowSpan",1);for(b=e;h>b;b++)a.appendChild(o(v(a.cells[e-1])));for(b=h;e>b;b++)T.remove(a.cells[b]);c?g.parentNode.insertBefore(a,g):T.insertAfter(a,g)}),j())}function J(a){var b;return e(O,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function K(a){Q=J(a)}function L(){var a,b;return a=b=0,e(O,function(c,d){e(c,function(c,e){var f,g;s(c)&&(c=O[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function M(a){var b,c,d,e,f,g,h,i,k,l;if(R=J(a),Q&&R){for(b=Math.min(Q.x,R.x),c=Math.min(Q.y,R.y),d=Math.max(Q.x,R.x),e=Math.max(Q.y,R.y),f=d,g=e,l=c;e>=l;l++)for(k=b;d>=k;k++)a=O[l][k],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&k+h>f&&(f=k+h),i&&l+i>g&&(g=l+i));for(j(),l=c;g>=l;l++)for(k=b;f>=k;k++)O[l][k]&&T.setAttrib(O[l][k].elm,"data-mce-selected","1")}}function N(a,b){var c,d,e;c=J(a),d=c.y*P+c.x;do{if(d+=b,e=q(d%P,Math.floor(d/P)),!e)break;if(e.elm!=a)return S.select(e.elm,!0),T.isEmpty(e.elm)&&S.collapse(!0),!0}while(e.elm==a);return!1}var O,P,Q,R,S=g.selection,T=S.dom;h=h||T.getParent(S.getStart(!0),"table"),m(),i=i||T.getParent(S.getStart(!0),"th,td"),i&&(Q=J(i),R=L(),i=q(Q.x,Q.y)),a.extend(this,{deleteTable:u,split:y,merge:z,insertRow:A,insertCol:B,deleteCols:E,deleteRows:F,cutRows:G,copyRows:H,pasteRows:I,getPos:J,setStartCell:K,setEndCell:M,moveRelIdx:N,refresh:m})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/util/Delay","tinymce/Env","tinymce/util/Tools","tinymce/tableplugin/Utils"],function(a,b,c,d,e){var f=d.each,g=e.getSpanVal;return function(h){function i(){function c(c){function d(a,b){var d=a?"previousSibling":"nextSibling",f=h.dom.getParent(b,"tr"),g=f[d];if(g)return r(h,b,g,a),c.preventDefault(),!0;var i=h.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=e(a,i,l,"tbody");if(null!==n)return j(a,n,b)}return k(a,f,d,i)}function e(a,b,c,d){var e=h.dom.select(">"+d,b),f=e.indexOf(c);if(a&&0===f||!a&&f===e.length-1)return i(a,b);if(-1===f){var g="thead"===c.tagName.toLowerCase()?0:e.length-1;return e[g]}return e[f+(a?-1:1)]}function i(a,b){var c=a?"thead":"tfoot",d=h.dom.select(">"+c,b);return 0!==d.length?d[0]:null}function j(a,b,d){var e=l(b,a);return e&&r(h,d,e,a),c.preventDefault(),!0}function k(a,b,e,f){var g=f[e];if(g)return m(g),!0;var i=h.dom.getParent(f,"td,th");if(i)return d(a,i,c);var j=l(b,!a);return m(j),c.preventDefault(),!1}function l(a,b){var c=a&&a[b?"lastChild":"firstChild"];return c&&"BR"===c.nodeName?h.dom.getParent(c,"td,th"):c}function m(a){h.selection.setCursorLocation(a,0)}function n(){return u==a.UP||u==a.DOWN}function o(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function p(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=g(c,"colspan");return b}function q(a,b){var c=0,d=0;return f(a.children,function(a,e){return c+=g(a,"colspan"),d=e,c>b?!1:void 0}),d}function r(a,b,c,d){var e=p(h.dom.getParent(b,"td,th")),f=q(c,e),g=c.childNodes[f],i=l(g,d);m(i||g)}function s(a){var b=h.selection.getNode(),c=h.dom.getParent(b,"td,th"),d=h.dom.getParent(a,"td,th");return c&&c!==d&&t(c,d)}function t(a,b){return h.dom.getParent(a,"TABLE")===h.dom.getParent(b,"TABLE")}var u=c.keyCode;if(n()&&o(h)){var v=h.selection.getNode();b.setEditorTimeout(h,function(){s(v)&&d(!c.shiftKey&&u===a.UP,v,c)},0)}}h.on("KeyDown",function(a){c(a)})}function j(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}h.on("KeyDown",function(b){var c,d,e=h.dom;37!=b.keyCode&&38!=b.keyCode||(c=h.selection.getRng(),d=e.getParent(c.startContainer,"table"),d&&h.getBody().firstChild==d&&a(c,d)&&(c=e.createRng(),c.setStartBefore(d),c.setEndBefore(d),h.selection.setRng(c),b.preventDefault()))})}function k(){h.on("KeyDown SetContent VisualAid",function(){var a;for(a=h.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(h.settings.forced_root_block?h.dom.add(h.getBody(),h.settings.forced_root_block,h.settings.forced_root_block_attrs,c.ie&&c.ie<10?" ":'
'):h.dom.add(h.getBody(),"br",{"data-mce-bogus":"1"}))}),h.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&h.dom.remove(b)})}function l(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=h.selection.getRng(),c=h.selection.getNode(),d=h.dom.getParent(b.startContainer,"TD,TH");if(a(h,b,c,d)){d||(d=c);for(var e=d.lastChild;e.lastChild;)e=e.lastChild;3==e.nodeType&&(b.setEnd(e,e.data.length),h.selection.setRng(b))}}h.on("KeyDown",function(){b()}),h.on("MouseDown",function(a){2!=a.button&&b()})}function m(){function b(a){h.selection.select(a,!0),h.selection.collapse(!0)}function c(a){h.$(a).empty(),e.paddCell(a)}h.on("keydown",function(e){if((e.keyCode==a.DELETE||e.keyCode==a.BACKSPACE)&&!e.isDefaultPrevented()){var f,g,i,j;if(f=h.dom.getParent(h.selection.getStart(),"table")){if(g=h.dom.select("td,th",f),i=d.grep(g,function(a){return!!h.dom.getAttrib(a,"data-mce-selected")}),0===i.length)return j=h.dom.getParent(h.selection.getStart(),"td,th"),void(h.selection.isCollapsed()&&j&&h.dom.isEmpty(j)&&(e.preventDefault(),c(j),b(j)));e.preventDefault(),h.undoManager.transact(function(){g.length==i.length?h.execCommand("mceTableDelete"):(d.each(i,c),b(i[0]))})}}})}m(),c.webkit&&(i(),l()),c.gecko&&(j(),k()),c.ie>9&&(j(),k())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d,e){function f(a){d.getBody().style.webkitUserSelect="",(a||o)&&(d.$("td[data-mce-selected],th[data-mce-selected]").removeAttr("data-mce-selected"),o=!1)}function g(a,b){return a&&b?a===n.getParent(b,"table"):!1}function h(b){var c,f,h=b.target;if(!m&&h!==l&&(l=h,k&&j)){if(f=n.getParent(h,"td,th"),g(k,f)||(f=n.getParent(k,"td,th")),j===f&&!o)return;if(e(!0),g(k,f)){b.preventDefault(),i||(i=new a(d,k,j),d.getBody().style.webkitUserSelect="none"),i.setEndCell(f),o=!0,c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(p){}}}}var i,j,k,l,m,n=d.dom,o=!0,p=function(){j=i=k=l=null,e(!1)};return d.on("SelectionChange",function(a){o&&a.stopImmediatePropagation()},!0),d.on("MouseDown",function(a){2==a.button||m||(f(),j=n.getParent(a.target,"td,th"),k=n.getParent(j,"table"))}),d.on("mouseover",h),d.on("remove",function(){n.unbind(d.getDoc(),"mouseover",h),f()}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,g,h,k,l=d.selection;if(j){if(i&&(d.getBody().style.webkitUserSelect=""),f=n.select("td[data-mce-selected],th[data-mce-selected]"),f.length>0){e=n.createRng(),h=f[0],e.setStartBefore(h),e.setEndAfter(h),a(h,1),g=new b(h,n.getParent(f[0],"table"));do if("TD"==h.nodeName||"TH"==h.nodeName){if(!n.getAttrib(h,"data-mce-selected"))break;k=h}while(h=g.next());a(k),l.setRng(e)}d.nodeChanged(),p()}}),d.on("KeyUp Drop SetContent",function(a){f("setcontent"==a.type),p(),m=!1}),d.on("ObjectResizeStart ObjectResized",function(a){m="objectresized"!=a.type}),{clear:f}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;dd;d++)c.push(d);return c}function C(a,b,c){for(var d,e=a(),f=0;f0?t(f,g,d):[],k=h.length>0?t(m,n,h):[];x(j,a.offsetWidth,i),y(k,a.offsetHeight,i)}function G(a,b,c,d){if(0>b||b>=a.length-1)return"";var e=a[b];if(e)e={value:e,delta:0};else for(var f=a.slice(0,b).reverse(),g=0;g0?e:f}function J(b,c,d){for(var e=D(b),f=a.map(e,function(a){return m(a.colIndex,a.element).x}),g=[],h=0;h1?G(f,h):I(e[h].element,c,d);j=j?j:wa,g.push(j)}return g}function K(a){var b=H(a,"height"),c=parseInt(b,10);return R(b)&&(c=0),!isNaN(c)&&c>0?c:p(a,"height")}function L(b){for(var c=E(b),d=a.map(c,function(a){return f(a.rowIndex,a.element).y}),e=[],g=0;g1?G(d,g):K(c[g].element);i=i?i:xa,e.push(i)}return e}function M(b,c,d,e,f){function g(b){return a.map(b,function(){return 0})}function h(){var a;if(f)a=[100-l[0]];else{var b=Math.max(e,l[0]+d);a=[b-l[0]]}return a}function i(a,b){var c,f=g(l.slice(0,a)),h=g(l.slice(b+1));if(d>=0){var i=Math.max(e,l[b]-d);c=f.concat([d,i-l[b]]).concat(h)}else{var j=Math.max(e,l[a]+d),k=l[a]-j;c=f.concat([j-l[a],k]).concat(h)}return c}function j(a,b){var c,f=g(l.slice(0,b));if(d>=0)c=f.concat([d]);else{var h=Math.max(e,l[b]+d);c=f.concat([h-l[b]])}return c}var k,l=b.slice(0);return k=0===b.length?[]:1===b.length?h():0===c?i(0,1):c>0&&ce;e++)d+=c[e];return d}function O(b,c){var d=b.getAllCells();return a.map(d,function(a){var b=N(a.colIndex,a.colIndex+a.colspan,c);return{element:a.element,width:b,colspan:a.colspan}})}function P(b,c){var d=b.getAllCells();return a.map(d,function(a){var b=N(a.rowIndex,a.rowIndex+a.rowspan,c);return{element:a.element,height:b,rowspan:a.rowspan}})}function Q(b,c){var d=b.getAllRows();return a.map(d,function(a,b){return{element:a.element,height:c[b]}})}function R(a){return za.test(a)}function S(a){return Aa.test(a)}function T(b,c,d){function f(b,c){a.each(b,function(a){e.dom.setStyle(a.element,"width",a.width+c),e.dom.setAttrib(a.element,"width",null)})}function g(){return dc;c++){for(e+="",d=0;a>d;d++)e+=""+(h.ie&&h.ie<10?" ":"
")+"";e+=""}return e+="",f.undoManager.transact(function(){f.insertContent(e),g=f.dom.get("__mce"),f.dom.setAttrib(g,"id",null),f.$("tr",g).each(function(a,b){f.fire("newrow",{node:b}),f.$("th,td",b).each(function(a,b){f.fire("newcell",{node:b})})}),f.dom.setAttribs(g,f.settings.table_default_attributes||{}),f.dom.setStyles(g,f.settings.table_default_styles||{})}),g}function j(a,b,c){function d(){var d,e,g,h={},i=0;e=f.dom.select("td[data-mce-selected],th[data-mce-selected]"),d=e[0],d||(d=f.selection.getStart()),c&&e.length>0?(k(e,function(a){return h[a.parentNode.parentNode.nodeName]=1}),k(h,function(a){i+=a}),g=1!==i):g=!f.dom.getParent(d,b),a.disabled(g),f.selection.selectorChanged(b,function(b){a.disabled(!b)})}f.initialized?d():f.on("init",d)}function l(){j(this,"table")}function m(){j(this,"td,th")}function n(){j(this,"td,th",!0)}function o(){var a="";a='';for(var b=0;10>b;b++){a+="";for(var c=0;10>c;c++)a+='';a+=""}return a+="
",a+=''}function p(a,b,c){var d,e,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),e=0;10>e;e++)for(d=0;10>d;d++)h=j.rows[e].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=e,f.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}function q(){f.addButton("tableprops",{title:"Table properties",onclick:y.tableProps,icon:"table"}),f.addButton("tabledelete",{title:"Delete table",onclick:g("mceTableDelete")}),f.addButton("tablecellprops",{title:"Cell properties",onclick:g("mceTableCellProps")}),f.addButton("tablemergecells",{title:"Merge cells",onclick:g("mceTableMergeCells")}),f.addButton("tablesplitcells",{title:"Split cell",onclick:g("mceTableSplitCells")}),f.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:g("mceTableInsertRowBefore")}),f.addButton("tableinsertrowafter",{title:"Insert row after",onclick:g("mceTableInsertRowAfter")}),f.addButton("tabledeleterow",{title:"Delete row",onclick:g("mceTableDeleteRow")}),f.addButton("tablerowprops",{title:"Row properties",onclick:g("mceTableRowProps")}),f.addButton("tablecutrow",{title:"Cut row",onclick:g("mceTableCutRow")}),f.addButton("tablecopyrow",{title:"Copy row",onclick:g("mceTableCopyRow")}),f.addButton("tablepasterowbefore",{title:"Paste row before",onclick:g("mceTablePasteRowBefore")}),f.addButton("tablepasterowafter",{title:"Paste row after",onclick:g("mceTablePasteRowAfter")}),f.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:g("mceTableInsertColBefore")}),f.addButton("tableinsertcolafter",{title:"Insert column after",onclick:g("mceTableInsertColAfter")}),f.addButton("tabledeletecol",{title:"Delete column",onclick:g("mceTableDeleteCol")})}function r(a){var b=f.dom.is(a,"table")&&f.getBody().contains(a);return b}function s(){var a=f.settings.table_toolbar;""!==a&&a!==!1&&(a||(a="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),f.addContextToolbar(r,a))}function t(){return v}function u(a){v=a}var v,w,x=this,y=new d(f);!f.settings.object_resizing||f.settings.table_resize_bars===!1||f.settings.object_resizing!==!0&&"table"!==f.settings.object_resizing||(w=e(f)),f.settings.table_grid===!1?f.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:y.table}):f.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),y.table())},onshow:function(){p(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");f.dom.removeClass(a,"mce-active"),f.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:o(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),b===this.lastX&&c===this.lastY||(p(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),f.undoManager.transact(function(){i(b.lastX+1,b.lastY+1)}),f.addVisual())}}]}),f.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:l,onclick:y.tableProps}),f.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:l,cmd:"mceTableDelete"}),f.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:g("mceTableCellProps"),onPostRender:m},{text:"Merge cells",onclick:g("mceTableMergeCells"),onPostRender:n},{text:"Split cell",onclick:g("mceTableSplitCells"),onPostRender:m}]}),f.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:g("mceTableInsertRowBefore"),onPostRender:m},{text:"Insert row after",onclick:g("mceTableInsertRowAfter"),onPostRender:m},{text:"Delete row",onclick:g("mceTableDeleteRow"),onPostRender:m},{text:"Row properties",onclick:g("mceTableRowProps"),onPostRender:m},{text:"-"},{text:"Cut row",onclick:g("mceTableCutRow"),onPostRender:m},{text:"Copy row",onclick:g("mceTableCopyRow"),onPostRender:m},{text:"Paste row before",onclick:g("mceTablePasteRowBefore"),onPostRender:m},{text:"Paste row after",onclick:g("mceTablePasteRowAfter"),onPostRender:m}]}),f.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:g("mceTableInsertColBefore"),onPostRender:m},{text:"Insert column after",onclick:g("mceTableInsertColAfter"),onPostRender:m},{text:"Delete column",onclick:g("mceTableDeleteCol"),onPostRender:m}]});var z=[];k("inserttable tableprops deletetable | cell row column".split(" "),function(a){"|"==a?z.push({text:"-"}):z.push(f.menuItems[a])}),f.addButton("table",{type:"menubutton",title:"Table",menu:z}),h.isIE||f.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(f.selection.select(a),f.nodeChanged())}),x.quirks=new b(f),f.on("Init",function(){x.cellSelection=new c(f,function(a){a&&w.clearBars()}),x.resizeBars=w}),f.on("PreInit",function(){f.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),k({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=f.dom.getParent(f.selection.getStart(),"th,td"),f.dom.select("td[data-mce-selected],th[data-mce-selected]").length?a.merge():y.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){v=a.cutRows()},mceTableCopyRow:function(a){v=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(v,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(v)},mceTableDelete:function(a){w&&w.clearBars(),a.deleteTable()}},function(b,c){f.addCommand(c,function(){var c=new a(f);c&&(b(c),f.execCommand("mceRepaint"),x.cellSelection.clear())})}),k({mceInsertTable:y.table,mceTableProps:function(){y.table(!0)},mceTableRowProps:y.row,mceTableCellProps:y.cell},function(a,b){f.addCommand(b,function(b,c){a(c)})}),q(),s(),f.settings.table_tab_navigation!==!1&&f.on("keydown",function(b){var c,d,e;9==b.keyCode&&(c=f.dom.getParent(f.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(f),e=b.shiftKey?-1:1,f.undoManager.transact(function(){!d.moveRelIdx(c,e)&&e>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,e))})))}),x.insertTable=i,x.setClipboardRows=u,x.getClipboardRows=t}var k=f.each;i.add("table",j)})}(this); \ No newline at end of file +!function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g9)&&(b.hasChildNodes()||(b.innerHTML='
'))}var c=function(a){return function(b,c){b&&(c=parseInt(c,10),1===c||0===c?b.removeAttribute(a,1):b.setAttribute(a,c,1))}},d=function(a){return function(b){return parseInt(b.getAttribute(a)||1,10)}};return{setColSpan:c("colSpan"),setRowSpan:c("rowspan"),getColSpan:d("colSpan"),getRowSpan:d("rowSpan"),setSpanVal:function(a,b,d){c(b)(a,d)},getSpanVal:function(a,b){return d(b)(a)},paddCell:b}}),d("tinymce/tableplugin/SplitCols",["tinymce/util/Tools","tinymce/tableplugin/Utils"],function(a,b){var c=function(a,b,c){return a[c]?a[c][b]:null},d=function(a,b,d){var e=c(a,b,d);return e?e.elm:null},e=function(a,b,e,f){var g,h,i=0,j=d(a,b,e);for(g=e;(f>0?g=0)&&(h=c(a,b,g),j===h.elm);g+=f)i++;return i},f=function(a,b,c){for(var d,e=a[c],f=b;ff;f++)for(X[f]||(X[f]=[]),e=c;c+i>e;e++)X[f][e]={part:b,real:f==d&&e==c,elm:a,rowspan:h,colspan:i};Y=Math.max(Y,c+1)})}),a+=d.length})}function p(a){return i.fire("newrow",{node:a}),a}function q(a){return i.fire("newcell",{node:a}),a}function r(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function s(a,b){var c;return c=X[b],c?c[a]:void 0}function t(a,b){return a[b]?a[b]:null}function u(a,b){for(var c=[],d=0;d'),!1):void 0},"childNodes"),b=r(b,!1),q(b),h(b,"rowSpan",1),h(b,"colSpan",1),e?b.appendChild(e):d.paddCell(b),b}function z(){var a,b=aa.createRng();return f(aa.select("tr",j),function(a){0===a.cells.length&&aa.remove(a)}),0===aa.select("tr",j).length?(b.setStartBefore(j),b.setEndBefore(j),_.setRng(b),void aa.remove(j)):(f(aa.select("thead,tbody,tfoot",j),function(a){0===a.rows.length&&aa.remove(a)}),o(),void(Z&&(a=X[Math.min(X.length-1,Z.y)],a&&(_.select(a[Math.min(a.length-1,Z.x)].elm,!0),_.collapse(!0)))))}function A(a,b,c,d){var e,f,g,h,i;for(e=X[b][a].elm.parentNode,g=1;c>=g;g++)if(e=aa.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=X[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)aa.insertAfter(y(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(y(e.cells[0]),e.cells[0])}}function B(){f(X,function(a,b){f(a,function(a,c){var d,e,f;if(v(a)&&(a=a.elm,d=g(a,"colspan"),e=g(a,"rowspan"),d>1||e>1)){for(h(a,"rowSpan",1),h(a,"colSpan",1),f=0;d-1>f;f++)aa.insertAfter(y(a),a);A(c,b,e-1,d)}})})}function C(a,b,c){for(var d=[],e=0;ee||e>c)&&d.push(a[e]);return d}function D(b){return a.grep(b,function(a){return a.real===!1})}function E(a){for(var b=[],c=0;c=i;i++){var j=C(t(b,i),c,f),k=D(j);j.length===k.length&&(a.each(E(k),function(a){d.setRowSpan(a,d.getRowSpan(a)-1)}),h++)}return h}function G(b,c,e,f,g){for(var h=0,i=c;f>=i;i++){var j=C(u(b,i),e,g),k=D(j);j.length===k.length&&(a.each(E(k),function(a){d.setColSpan(a,d.getColSpan(a)-1)}),h++)}return h}function H(b,c,d){var e,g,i,j,k,l,m,n,p,q,r,t,u;if(b?(e=R(b),g=e.x,i=e.y,j=g+(c-1),k=i+(d-1)):(Z=$=null,f(X,function(a,b){f(a,function(a,c){v(a)&&(Z||(Z={x:c,y:b}),$={x:c,y:b})})}),Z&&(g=Z.x,i=Z.y,j=$.x,k=$.y)),n=s(g,i),p=s(j,k),n&&p&&n.part==p.part){B(),o(),t=F(X,g,i,j,k),u=G(X,g,i,j,k),n=s(g,i).elm;var w=j-g-u+1,x=k-i-t+1;for(w===Y&&x===X.length&&(w=1,x=1),w===Y&&x>1&&(x=1),h(n,"colSpan",w),h(n,"rowSpan",x),m=i;k>=m;m++)for(l=g;j>=l;l++)X[m]&&X[m][l]&&(b=X[m][l].elm,b!=n&&(q=a.grep(b.childNodes),f(q,function(a){n.appendChild(a)}),q.length&&(q=a.grep(n.childNodes),r=0,f(q,function(a){"BR"==a.nodeName&&r++0&&X[c-1][i]&&(m=X[c-1][i].elm,n=g(m,"rowSpan"),n>1)){h(m,"rowSpan",n+1);continue}}else if(n=g(d,"rowspan"),n>1){h(d,"rowSpan",n+1);continue}l=y(d),h(l,"colSpan",d.colSpan),k.appendChild(l),e=d}k.hasChildNodes()&&(a?j.parentNode.insertBefore(k,j):aa.insertAfter(k,j))}}function J(a){var b,c;f(X,function(c){return f(c,function(c,d){return v(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),f(X,function(d,e){var f,i,j;d[b]&&(f=d[b].elm,f!=c&&(j=g(f,"colspan"),i=g(f,"rowspan"),1==j?a?(f.parentNode.insertBefore(y(f),f),A(b,e,i-1,j)):(aa.insertAfter(y(f),f),A(b,e,i-1,j)):h(f,"colSpan",f.colSpan+1),c=f))})}function K(b){return a.grep(L(b),v)}function L(a){var b=[];return f(a,function(a){f(a,function(a){b.push(a)})}),b}function M(){var b=[];if(m(j)){if(1==X[0].length)return;if(K(X).length==L(X).length)return}f(X,function(c){f(c,function(c,d){v(c)&&-1===a.inArray(b,d)&&(f(X,function(a){var b,c=a[d].elm;b=g(c,"colSpan"),b>1?h(c,"colSpan",b-1):aa.remove(c)}),b.push(d))})}),z()}function N(){function a(a){var b,c;f(a.cells,function(a){var c=g(a,"rowSpan");c>1&&(h(a,"rowSpan",c-1),b=R(a),A(b.x,b.y,1,1))}),b=R(a.cells[0]),f(X[b.y],function(a){var b;a=a.elm,a!=c&&(b=g(a,"rowSpan"),1>=b?aa.remove(a):h(a,"rowSpan",b-1),c=a)})}var b;b=w(),m(j)&&b.length==j.rows.length||(f(b.reverse(),function(b){a(b)}),z())}function O(){var a=w();if(!m(j)||a.length!=j.rows.length)return aa.remove(a),z(),a}function P(){var a=w();return f(a,function(b,c){a[c]=r(b,!0)}),a}function Q(b,c){var d,g,i;b&&(d=e.splitAt(X,Z.x,Z.y,c),g=d.row,a.each(d.cells,q),i=a.map(b,function(a){return a.cloneNode(!0)}),c||i.reverse(),f(i,function(a){var b,d,e=a.cells.length;for(p(a),b=0;e>b;b++)d=a.cells[b],q(d),h(d,"colSpan",1),h(d,"rowSpan",1);for(b=e;Y>b;b++)a.appendChild(q(y(a.cells[e-1])));for(b=Y;e>b;b++)aa.remove(a.cells[b]);c?g.parentNode.insertBefore(a,g):aa.insertAfter(a,g)}),l())}function R(a){var b;return f(X,function(c,d){return f(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function S(a){Z=R(a)}function T(){var a,b;return a=b=0,f(X,function(c,d){f(c,function(c,e){var f,g;v(c)&&(c=X[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function U(a){var b,c,d,e,f,g,h,i,j,k;if($=R(a),Z&&$){for(b=Math.min(Z.x,$.x),c=Math.min(Z.y,$.y),d=Math.max(Z.x,$.x),e=Math.max(Z.y,$.y),f=d,g=e,k=c;e>=k;k++)for(j=b;d>=j;j++)a=X[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(l(),k=c;g>=k;k++)for(j=b;f>=j;j++)X[k][j]&&aa.setAttrib(X[k][j].elm,"data-mce-selected","1")}}function V(a,b){var c,d,e;c=R(a),d=c.y*Y+c.x;do{if(d+=b,e=s(d%Y,Math.floor(d/Y)),!e)break;if(e.elm!=a)return _.select(e.elm,!0),aa.isEmpty(e.elm)&&_.collapse(!0),!0}while(e.elm==a);return!1}function W(b){if(Z){var c=e.splitAt(X,Z.x,Z.y,b);a.each(c.cells,q)}}var X,Y,Z,$,_=i.selection,aa=_.dom;j=j||aa.getParent(_.getStart(!0),"table"),o(),k=k||aa.getParent(_.getStart(!0),"th,td"),k&&(Z=R(k),$=T(),k=s(Z.x,Z.y)),a.extend(this,{deleteTable:x,split:B,merge:H,insertRow:I,insertCol:J,splitCols:W,deleteCols:M,deleteRows:N,cutRows:O,copyRows:P,pasteRows:Q,getPos:R,setStartCell:S,setEndCell:U,moveRelIdx:V,refresh:o})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/util/Delay","tinymce/Env","tinymce/util/Tools","tinymce/tableplugin/Utils"],function(a,b,c,d,e){var f=d.each,g=e.getSpanVal;return function(h){function i(){function c(c){function d(a,b){var d=a?"previousSibling":"nextSibling",f=h.dom.getParent(b,"tr"),g=f[d];if(g)return r(h,b,g,a),c.preventDefault(),!0;var i=h.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=e(a,i,l,"tbody");if(null!==n)return j(a,n,b)}return k(a,f,d,i)}function e(a,b,c,d){var e=h.dom.select(">"+d,b),f=e.indexOf(c);if(a&&0===f||!a&&f===e.length-1)return i(a,b);if(-1===f){var g="thead"===c.tagName.toLowerCase()?0:e.length-1;return e[g]}return e[f+(a?-1:1)]}function i(a,b){var c=a?"thead":"tfoot",d=h.dom.select(">"+c,b);return 0!==d.length?d[0]:null}function j(a,b,d){var e=l(b,a);return e&&r(h,d,e,a),c.preventDefault(),!0}function k(a,b,e,f){var g=f[e];if(g)return m(g),!0;var i=h.dom.getParent(f,"td,th");if(i)return d(a,i,c);var j=l(b,!a);return m(j),c.preventDefault(),!1}function l(a,b){var c=a&&a[b?"lastChild":"firstChild"];return c&&"BR"===c.nodeName?h.dom.getParent(c,"td,th"):c}function m(a){h.selection.setCursorLocation(a,0)}function n(){return u==a.UP||u==a.DOWN}function o(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function p(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=g(c,"colspan");return b}function q(a,b){var c=0,d=0;return f(a.children,function(a,e){return c+=g(a,"colspan"),d=e,c>b?!1:void 0}),d}function r(a,b,c,d){var e=p(h.dom.getParent(b,"td,th")),f=q(c,e),g=c.childNodes[f],i=l(g,d);m(i||g)}function s(a){var b=h.selection.getNode(),c=h.dom.getParent(b,"td,th"),d=h.dom.getParent(a,"td,th");return c&&c!==d&&t(c,d)}function t(a,b){return h.dom.getParent(a,"TABLE")===h.dom.getParent(b,"TABLE")}var u=c.keyCode;if(n()&&o(h)){var v=h.selection.getNode();b.setEditorTimeout(h,function(){s(v)&&d(!c.shiftKey&&u===a.UP,v,c)},0)}}h.on("KeyDown",function(a){c(a)})}function j(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}h.on("KeyDown",function(b){var c,d,e=h.dom;37!=b.keyCode&&38!=b.keyCode||(c=h.selection.getRng(),d=e.getParent(c.startContainer,"table"),d&&h.getBody().firstChild==d&&a(c,d)&&(c=e.createRng(),c.setStartBefore(d),c.setEndBefore(d),h.selection.setRng(c),b.preventDefault()))})}function k(){h.on("KeyDown SetContent VisualAid",function(){var a;for(a=h.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(h.settings.forced_root_block?h.dom.add(h.getBody(),h.settings.forced_root_block,h.settings.forced_root_block_attrs,c.ie&&c.ie<10?" ":'
'):h.dom.add(h.getBody(),"br",{"data-mce-bogus":"1"}))}),h.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&h.dom.remove(b)})}function l(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=h.selection.getRng(),c=h.selection.getNode(),d=h.dom.getParent(b.startContainer,"TD,TH");if(a(h,b,c,d)){d||(d=c);for(var e=d.lastChild;e.lastChild;)e=e.lastChild;3==e.nodeType&&(b.setEnd(e,e.data.length),h.selection.setRng(b))}}h.on("KeyDown",function(){b()}),h.on("MouseDown",function(a){2!=a.button&&b()})}function m(){function b(a){h.selection.select(a,!0),h.selection.collapse(!0)}function c(a){h.$(a).empty(),e.paddCell(a)}h.on("keydown",function(e){if((e.keyCode==a.DELETE||e.keyCode==a.BACKSPACE)&&!e.isDefaultPrevented()){var f,g,i,j;if(f=h.dom.getParent(h.selection.getStart(),"table")){if(g=h.dom.select("td,th",f),i=d.grep(g,function(a){return!!h.dom.getAttrib(a,"data-mce-selected")}),0===i.length)return j=h.dom.getParent(h.selection.getStart(),"td,th"),void(h.selection.isCollapsed()&&j&&h.dom.isEmpty(j)&&(e.preventDefault(),c(j),b(j)));e.preventDefault(),h.undoManager.transact(function(){g.length==i.length?h.execCommand("mceTableDelete"):(d.each(i,c),b(i[0]))})}}})}m(),c.webkit&&(i(),l()),c.gecko&&(j(),k()),c.ie>9&&(j(),k())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d,e){function f(a){d.getBody().style.webkitUserSelect="",(a||p)&&(d.$("td[data-mce-selected],th[data-mce-selected]").removeAttr("data-mce-selected"),p=!1)}function g(a,b){return a&&b?a===o.getParent(b,"table"):!1}function h(b){var c,f,h=b.target;if(!m&&!n&&h!==l&&(l=h,k&&j)){if(f=o.getParent(h,"td,th"),g(k,f)||(f=o.getParent(k,"td,th")),j===f&&!p)return;if(e(!0),g(k,f)){b.preventDefault(),i||(i=new a(d,k,j),d.getBody().style.webkitUserSelect="none"),i.setEndCell(f),p=!0,c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(q){}}}}var i,j,k,l,m,n,o=d.dom,p=!0,q=function(){j=i=k=l=null,e(!1)};return d.on("SelectionChange",function(a){p&&a.stopImmediatePropagation()},!0),d.on("MouseDown",function(a){2==a.button||m||n||(f(),j=o.getParent(a.target,"td,th"),k=o.getParent(j,"table"))}),d.on("mouseover",h),d.on("remove",function(){o.unbind(d.getDoc(),"mouseover",h),f()}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,g,h,k,l=d.selection;if(j){if(i&&(d.getBody().style.webkitUserSelect=""),f=o.select("td[data-mce-selected],th[data-mce-selected]"),f.length>0){e=o.createRng(),h=f[0],e.setStartBefore(h),e.setEndAfter(h),a(h,1),g=new b(h,o.getParent(f[0],"table"));do if("TD"==h.nodeName||"TH"==h.nodeName){if(!o.getAttrib(h,"data-mce-selected"))break;k=h}while(h=g.next());a(k),l.setRng(e)}d.nodeChanged(),q()}}),d.on("KeyUp Drop SetContent",function(a){f("setcontent"==a.type),q(),m=!1}),d.on("ObjectResizeStart ObjectResized",function(a){m="objectresized"!=a.type}),d.on("dragstart",function(){n=!0}),d.on("drop dragend",function(){n=!1}),{clear:f}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;dd;d++)c.push(d);return c}function C(a,b,c){for(var d,e=a(),f=0;f0?t(f,g,d):[],k=h.length>0?t(m,n,h):[];x(j,a.offsetWidth,i),y(k,a.offsetHeight,i)}function G(a,b,c,d){if(0>b||b>=a.length-1)return"";var e=a[b];if(e)e={value:e,delta:0};else for(var f=a.slice(0,b).reverse(),g=0;g0?e:f}function J(b,c,d){for(var e=D(b),f=a.map(e,function(a){return m(a.colIndex,a.element).x}),g=[],h=0;h1?G(f,h):I(e[h].element,c,d);j=j?j:wa,g.push(j)}return g}function K(a){var b=H(a,"height"),c=parseInt(b,10);return R(b)&&(c=0),!isNaN(c)&&c>0?c:p(a,"height")}function L(b){for(var c=E(b),d=a.map(c,function(a){return f(a.rowIndex,a.element).y}),e=[],g=0;g1?G(d,g):K(c[g].element);i=i?i:xa,e.push(i)}return e}function M(b,c,d,e,f){function g(b){return a.map(b,function(){return 0})}function h(){var a;if(f)a=[100-l[0]];else{var b=Math.max(e,l[0]+d);a=[b-l[0]]}return a}function i(a,b){var c,f=g(l.slice(0,a)),h=g(l.slice(b+1));if(d>=0){var i=Math.max(e,l[b]-d); +c=f.concat([d,i-l[b]]).concat(h)}else{var j=Math.max(e,l[a]+d),k=l[a]-j;c=f.concat([j-l[a],k]).concat(h)}return c}function j(a,b){var c,f=g(l.slice(0,b));if(d>=0)c=f.concat([d]);else{var h=Math.max(e,l[b]+d);c=f.concat([h-l[b]])}return c}var k,l=b.slice(0);return k=0===b.length?[]:1===b.length?h():0===c?i(0,1):c>0&&ce;e++)d+=c[e];return d}function O(b,c){var d=b.getAllCells();return a.map(d,function(a){var b=N(a.colIndex,a.colIndex+a.colspan,c);return{element:a.element,width:b,colspan:a.colspan}})}function P(b,c){var d=b.getAllCells();return a.map(d,function(a){var b=N(a.rowIndex,a.rowIndex+a.rowspan,c);return{element:a.element,height:b,rowspan:a.rowspan}})}function Q(b,c){var d=b.getAllRows();return a.map(d,function(a,b){return{element:a.element,height:c[b]}})}function R(a){return za.test(a)}function S(a){return Aa.test(a)}function T(b,c,d){function f(b,c){a.each(b,function(a){e.dom.setStyle(a.element,"width",a.width+c),e.dom.setAttrib(a.element,"width",null)})}function g(){return dc;c++){for(e+="",d=0;a>d;d++)e+=""+(h.ie&&h.ie<10?" ":"
")+"";e+=""}return e+="",f.undoManager.transact(function(){f.insertContent(e),g=f.dom.get("__mce"),f.dom.setAttrib(g,"id",null),f.$("tr",g).each(function(a,b){f.fire("newrow",{node:b}),f.$("th,td",b).each(function(a,b){f.fire("newcell",{node:b})})}),f.dom.setAttribs(g,f.settings.table_default_attributes||{}),f.dom.setStyles(g,f.settings.table_default_styles||{})}),g}function j(a,b,c){function d(){var d,e,g,h={},i=0;e=f.dom.select("td[data-mce-selected],th[data-mce-selected]"),d=e[0],d||(d=f.selection.getStart()),c&&e.length>0?(k(e,function(a){return h[a.parentNode.parentNode.nodeName]=1}),k(h,function(a){i+=a}),g=1!==i):g=!f.dom.getParent(d,b),a.disabled(g),f.selection.selectorChanged(b,function(b){a.disabled(!b)})}f.initialized?d():f.on("init",d)}function l(){j(this,"table")}function m(){j(this,"td,th")}function n(){j(this,"td,th",!0)}function o(){var a="";a='';for(var b=0;10>b;b++){a+="";for(var c=0;10>c;c++)a+='';a+=""}return a+="
",a+=''}function p(a,b,c){var d,e,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),e=0;10>e;e++)for(d=0;10>d;d++)h=j.rows[e].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=e,f.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}function q(){f.addButton("tableprops",{title:"Table properties",onclick:y.tableProps,icon:"table"}),f.addButton("tabledelete",{title:"Delete table",onclick:g("mceTableDelete")}),f.addButton("tablecellprops",{title:"Cell properties",onclick:g("mceTableCellProps")}),f.addButton("tablemergecells",{title:"Merge cells",onclick:g("mceTableMergeCells")}),f.addButton("tablesplitcells",{title:"Split cell",onclick:g("mceTableSplitCells")}),f.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:g("mceTableInsertRowBefore")}),f.addButton("tableinsertrowafter",{title:"Insert row after",onclick:g("mceTableInsertRowAfter")}),f.addButton("tabledeleterow",{title:"Delete row",onclick:g("mceTableDeleteRow")}),f.addButton("tablerowprops",{title:"Row properties",onclick:g("mceTableRowProps")}),f.addButton("tablecutrow",{title:"Cut row",onclick:g("mceTableCutRow")}),f.addButton("tablecopyrow",{title:"Copy row",onclick:g("mceTableCopyRow")}),f.addButton("tablepasterowbefore",{title:"Paste row before",onclick:g("mceTablePasteRowBefore")}),f.addButton("tablepasterowafter",{title:"Paste row after",onclick:g("mceTablePasteRowAfter")}),f.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:g("mceTableInsertColBefore")}),f.addButton("tableinsertcolafter",{title:"Insert column after",onclick:g("mceTableInsertColAfter")}),f.addButton("tabledeletecol",{title:"Delete column",onclick:g("mceTableDeleteCol")})}function r(a){var b=f.dom.is(a,"table")&&f.getBody().contains(a);return b}function s(){var a=f.settings.table_toolbar;""!==a&&a!==!1&&(a||(a="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),f.addContextToolbar(r,a))}function t(){return v}function u(a){v=a}var v,w,x=this,y=new d(f);!f.settings.object_resizing||f.settings.table_resize_bars===!1||f.settings.object_resizing!==!0&&"table"!==f.settings.object_resizing||(w=e(f)),f.settings.table_grid===!1?f.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:y.table}):f.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),y.table())},onshow:function(){p(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");f.dom.removeClass(a,"mce-active"),f.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:o(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),b===this.lastX&&c===this.lastY||(p(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),f.undoManager.transact(function(){i(b.lastX+1,b.lastY+1)}),f.addVisual())}}]}),f.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:l,onclick:y.tableProps}),f.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:l,cmd:"mceTableDelete"}),f.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:g("mceTableCellProps"),onPostRender:m},{text:"Merge cells",onclick:g("mceTableMergeCells"),onPostRender:n},{text:"Split cell",onclick:g("mceTableSplitCells"),onPostRender:m}]}),f.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:g("mceTableInsertRowBefore"),onPostRender:m},{text:"Insert row after",onclick:g("mceTableInsertRowAfter"),onPostRender:m},{text:"Delete row",onclick:g("mceTableDeleteRow"),onPostRender:m},{text:"Row properties",onclick:g("mceTableRowProps"),onPostRender:m},{text:"-"},{text:"Cut row",onclick:g("mceTableCutRow"),onPostRender:m},{text:"Copy row",onclick:g("mceTableCopyRow"),onPostRender:m},{text:"Paste row before",onclick:g("mceTablePasteRowBefore"),onPostRender:m},{text:"Paste row after",onclick:g("mceTablePasteRowAfter"),onPostRender:m}]}),f.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:g("mceTableInsertColBefore"),onPostRender:m},{text:"Insert column after",onclick:g("mceTableInsertColAfter"),onPostRender:m},{text:"Delete column",onclick:g("mceTableDeleteCol"),onPostRender:m}]});var z=[];k("inserttable tableprops deletetable | cell row column".split(" "),function(a){"|"==a?z.push({text:"-"}):z.push(f.menuItems[a])}),f.addButton("table",{type:"menubutton",title:"Table",menu:z}),h.isIE||f.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(f.selection.select(a),f.nodeChanged())}),x.quirks=new b(f),f.on("Init",function(){x.cellSelection=new c(f,function(a){a&&w.clearBars()}),x.resizeBars=w}),f.on("PreInit",function(){f.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),k({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=f.dom.getParent(f.selection.getStart(),"th,td"),f.dom.select("td[data-mce-selected],th[data-mce-selected]").length?a.merge():y.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){v=a.cutRows()},mceTableCopyRow:function(a){v=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(v,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(v)},mceSplitColsBefore:function(a){a.splitCols(!0)},mceSplitColsAfter:function(a){a.splitCols(!1)},mceTableDelete:function(a){w&&w.clearBars(),a.deleteTable()}},function(b,c){f.addCommand(c,function(){var c=new a(f);c&&(b(c),f.execCommand("mceRepaint"),x.cellSelection.clear())})}),k({mceInsertTable:y.table,mceTableProps:function(){y.table(!0)},mceTableRowProps:y.row,mceTableCellProps:y.cell},function(a,b){f.addCommand(b,function(b,c){a(c)})}),q(),s(),f.settings.table_tab_navigation!==!1&&f.on("keydown",function(b){var c,d,e;9==b.keyCode&&(c=f.dom.getParent(f.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(f),e=b.shiftKey?-1:1,f.undoManager.transact(function(){!d.moveRelIdx(c,e)&&e>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,e))})))}),x.insertTable=i,x.setClipboardRows=u,x.getClipboardRows=t}var k=f.each;i.add("table",j)})}(this); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/template/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/template/plugin.min.js index 892ee75..183201b 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/template/plugin.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/template/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;return"function"==typeof c?void c(b):void("string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c))}}function c(b){function c(b){function c(b){if(-1==b.indexOf("")){var c="";tinymce.each(a.contentCSS,function(b){c+=''});var e=a.settings.body_class||"";-1!=e.indexOf("=")&&(e=a.getParam("body_class","","hash"),e=e[a.id]||""),b=""+c+''+b+""}b=f(b,"template_preview_replace_values");var g=d.find("iframe")[0].getEl().contentWindow.document;g.open(),g.write(b),g.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];if(!b||0===b.length){var i=a.translate("No templates defined.");return void a.notificationManager.open({text:i,type:"info"})}tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),d.find("listbox")[0].fire("select")}function d(b,c){function d(a,b){if(a=""+a,a.length0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})}); \ No newline at end of file +tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;return"function"==typeof c?void c(b):void("string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c))}}function c(b){function c(b){function c(b){if(-1==b.indexOf("")){var c="";tinymce.each(a.contentCSS,function(b){c+=''});var e=a.settings.body_class||"";-1!=e.indexOf("=")&&(e=a.getParam("body_class","","hash"),e=e[a.id]||""),b=""+c+''+b+""}b=f(b,"template_preview_replace_values");var g=d.find("iframe")[0].getEl().contentWindow.document;g.open(),g.write(b),g.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];if(!b||0===b.length){var i=a.translate("No templates defined.");return void a.notificationManager.open({text:i,type:"info"})}tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},minWidth:Math.min(tinymce.DOM.getViewPort().w,a.getParam("template_popup_width",600)),minHeight:Math.min(tinymce.DOM.getViewPort().h,a.getParam("template_popup_height",500))}),d.find("listbox")[0].fire("select")}function d(b,c){function d(a,b){if(a=""+a,a.length0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})}); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/atomic.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/atomic.js deleted file mode 100644 index ba613f5..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/atomic.js +++ /dev/null @@ -1,5 +0,0 @@ -configure({ - configs: [ - './prod.js' - ] -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js deleted file mode 100644 index 08e925b..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js +++ /dev/null @@ -1,1491 +0,0 @@ -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var kernel = bolt.kernel = bolt.kernel || {}; -kernel.api = kernel.api || {}; -kernel.async = kernel.api || {}; -kernel.fp = kernel.fp || {}; -kernel.modulator = kernel.modulator || {}; -kernel.module = kernel.module || {}; -kernel.fp.array = def( - [ - ], - - function () { - var equals = function (a1, a2) { - if (a1.length !== a2.length) - return false; - for (var i = 0; i < a1.length; ++i) - if (a1[i] !== a2[i]) - return false; - return true; - }; - - var forall = function (a, f) { - var fn = f || function (x) { - return x === true; - }; - for (var i = 0; i < a.length; ++i) - if (fn(a[i]) !== true) - return false; - return true; - }; - - var map = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - r.push(f(a[i], i)); - return r; - }; - - var flatten = function (a) { - var r = []; - for (var i = 0; i < a.length; ++i) - r = r.concat(a[i]); - return r; - }; - - var flatmap = function (a, f) { - return flatten(map(a, f)); - }; - - var filter = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - if (f(a[i])) - r.push(a[i]); - return r; - }; - - var each = map; - - var contains = function (a, x) { - return !forall(a, function (v) { - return v !== x; - }); - }; - - var indexof = function (a, x) { - for (var i = 0; i < a.length; ++i) - if (a[i] === x) - return i; - return -1; - }; - - return { - equals: equals, - forall: forall, - map: map, - flatten: flatten, - flatmap: flatmap, - filter: filter, - each: each, - contains: contains, - indexof: indexof - }; - } -); -kernel.fp.object = def( - [ - ], - - function () { - var map = function (o, f) { - var r = {}; - for (var i in o) - if (o.hasOwnProperty(i)) - r[i] = f(i, o[i]); - return r; - }; - - var each = map; - - var merge = function (d, s) { - each(s, function (k, v) { - d[k] = v; - }); - }; - - var keys = function (o) { - var r = []; - each(o, function (k) { - r.push(k); - }); - return r; - }; - - return { - each: each, - keys: keys, - map: map, - merge: merge - }; - } -); -kernel.fp.functions = def( - [ - ], - - function () { - var curry = function (f) { - var slice = Array.prototype.slice; - var args = slice.call(arguments, 1); - return function () { - var all = args.concat(slice.call(arguments, 0)); - return f.apply(null, all); - }; - }; - - var not = function (z) { - return function () { - var slice = Array.prototype.slice; - return !z.apply(null, slice.call(arguments, 0)); - }; - }; - - var apply = function (f) { - var slice = Array.prototype.slice; - return f.apply(null, slice.call(arguments, 0)); - }; - - return { - curry: curry, - not: not, - apply: apply - }; - } -);kernel.async.map = def( - [ - kernel.fp.array - ], - - function (ar) { - var amap = function (data, f, oncomplete) { - var total = data.length; - var count = 0; - var results = []; - - ar.each(data, function (datum, i) { - f(datum, function (result) { - ++count; - results[i] = result; - if (count === total) - oncomplete(results); - }); - }); - }; - - return { - amap: amap - }; - } -); -/** - * This module has a dual responsibility: - * 1. Ensures that asynchronous function calls, 'f', that share the same - * 'key' are not executed in parallel. - * 2. In the case where an attempt to call in parallel is prevented, - * the 'action' callbacks are executed when the asynchronous call is - * completed. - * - * Example: - * When we async-map to remotely fetch module definition, it is - * important that only a single define is evaluated, but the - * notification that the definition has completed is propagated - * to all interested parties. - * - * 1. we require dependencies 'x' and 'y' - * - * 2. both x and y are defined in the same file (i.e. compiled together), 'a.js'. - * - * 3. we resolve x and y, to their load spec using a modulator - * x_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * y_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * - * 4. we make the piggyback call for x: - * piggybacker.piggyback(x_spec.url, x_spec.load, xdone); - * - * this will register the 'xdone' action, and actually - * trigger the load call, with a synthetic callback - * responsible for triggering all registered actions. - * - * 5. we make the piggyback call for y: - * piggybacker.piggyback(y_spec.url, y_spec.load, ydone); - * - * this will register the 'ydone' action, but NOT trigger - * the load call. - * - * 6. the load call completes, and calls the synthetic callback, - * which is responsible for triggering both 'xdone' and 'ydone'. - * - * 7. something else happens that means we have to load 'a.js' again, - * the piggybacker DOES NOT prevent this call, and will follow - * the above process. - */ -kernel.async.piggybacker = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function () { - var queue = {}; // key -> [actions] - - var process = function (key) { - var actions = queue[key]; - delete queue[key]; - ar.each(actions, fn.apply); - }; - - var piggyback = function (key, f, action) { - if (queue[key] === undefined) { - queue[key] = [ action ]; - f(fn.curry(process, key)); - } else { - queue[key].push(action); - } - }; - - return { - piggyback: piggyback - }; - }; - - return { - create: create - }; - } -); -kernel.modulator.globalator = def( - [ - ], - - function () { - var create = function () { - // FIX pull out - var resolve = function (name, scope) { - var parts = name.split('.'); - var r = scope; - for (var i = 0; i < parts.length && r !== undefined; ++i) - r = r[parts[i]]; - return r; - }; - - var global = Function('return this')(); - - var can = function (id) { - return id.indexOf('global!') === 0; - }; - - var get = function (id, define, require) { - var name = id.substring('global!'.length); - - var load = function (onsuccess, onfailure) { - var instance = resolve(name, global); - if (instance !== undefined) { - define(id, [], function () { return instance; }); - onsuccess(); - } else { - onfailure('Modulator error: could not resolve global [' + name + ']'); - } - }; - - return { - url: id, // this just needs to be unique, no download required. - load: load, - serial: true - }; - }; - - return { - can: can, - get: get - } - }; - return { - create: create - }; - } -); -kernel.modulator.bolt = def( - [ - kernel.fp.functions - ], - - function (fn) { - var create = function (loader, pather, namespace, path, idTransformer, options) { - var can = function (id) { - return id === namespace || id.indexOf(namespace + '.') === 0 || id.indexOf(namespace + '/') === 0; - }; - - var get = function (id) { - var before = options !== undefined && options.absolute === true ? path : pather(path); - var after = options !== undefined && options.fresh === true ? '?cachebuster=' + new Date().getTime() : ''; - var url = before + "/" + idTransformer(id) + '.js' + after; - var load = fn.curry(loader.load, url); - - return { - url: url, - load: load, - serial: false - }; - }; - - return { - can: can, - get: get - }; - }; - - return { - create: create - }; - } -);kernel.module.stratifier = def( - [ - kernel.fp.array - ], - - function (ar) { - var stratify = function (specs) { - var parallels = ar.filter(specs, function (spec) { - return !spec.serial; - }); - return parallels.length > 0 ? parallels : specs.slice(0, 1); - }; - - return { - stratify: stratify - }; - } -); -/** - * This module performs dependency analysis of strings that depend on sets of - * strings. - * - * The input is an array of root strings to start analysis from, and an object - * that contains a mapping of each string to the strings it depends on. - * - * Performing an analysis results in either: - * 1. an empty array, indicating that all dependencies are satisfied, - * 2. an array of strings that are, at the minimum, still needed in order to - * satisfy the given dependency trees, or - * 3. an array of strings that form a dependency cycle. - */ -kernel.module.analyser = def( - [ - kernel.fp.array - ], - - function (array) { - var collect = function (path, name) { - var i = array.indexof(path, name); - var p = path.slice(i); - return p.concat([name]); - }; - - /** - * @param {array} roots Contains a list of root ids - * @param {object} modules Contains dependency information in format: { id: [ 'id1', 'id2' ] } - */ - var analyse = function (roots, modules) { - var done = {}; - var path = []; - var missing = []; - var cycle; - - var children = function (name) { - array.each(modules[name], attempt); - }; - - var examine = function (name) { - if (modules[name]) - children(name); - else - missing.push(name); - }; - - var descend = function (name) { - path.push(name); - examine(name); - path.pop(); - }; - - var decycle = function (name) { - if (array.contains(path, name)) - cycle = collect(path, name); - else - descend(name); - }; - - var attempt = function (name) { - if (!done[name]) { - decycle(name); - done[name] = true; - } - }; - - array.each(roots, attempt); - - return cycle ? { cycle: cycle } : { load: missing }; - }; - - return { - analyse: analyse - }; - } -); -kernel.module.fetcher = def( - [ - kernel.fp.array, - kernel.fp.functions, - kernel.async.map, - kernel.async.piggybacker, - kernel.module.stratifier - ], - - function (ar, fn, map, piggybacker, stratifier) { - var create = function (regulator, validator, onerror, define, require, demand) { - var piggyback = piggybacker.create(); - - var validate = function (onsuccess, results) { - var failed = ar.filter(results, fn.not(validator)); - if (failed.length > 0) - onerror('Fetcher error: modules were not defined: ' + failed.join(', ')); - else - onsuccess(); - }; - - var mapper = function (spec, onresult) { - var action = fn.curry(onresult, spec.id); - var load = function (callback) { - spec.load(callback, onerror); - }; - piggyback.piggyback(spec.url, load, action); - }; - - var asyncfetch = function (specs, onsuccess) { - var oncomplete = fn.curry(validate, onsuccess); - var strata = stratifier.stratify(specs); - map.amap(strata, mapper, oncomplete); - }; - - var fetch = function (ids, onsuccess) { - regulator.regulate(ids, define, require, demand, function (specs) { - asyncfetch(specs, onsuccess); - }, onerror); - }; - - return { - fetch: fetch - }; - }; - - return { - create: create - }; - } -); -kernel.module.loader = def( - [ - kernel.module.analyser - ], - - function (analyser) { - var load = function (roots, deps, fetcher, oncontinue, onsuccess, onerror) { - var result = analyser.analyse(roots, deps); - - if (result.cycle) - onerror('Dependency error: a circular module dependency exists from ' + result.cycle.join(' ~> ')); - else if (result.load.length === 0) - onsuccess(); - else - fetcher.fetch(result.load, oncontinue); - }; - - return { - load: load - }; - } -); -kernel.module.manager = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.module.loader, - kernel.module.fetcher - ], - - function (ar, obj, loader, fetcher) { - var create = function (regulator, onerror) { - var blueprints = {}; // id -> { id: string, dependencies: [ string ], definition: function } - var modules = {}; // id -> module - - // Adds a module to the system. - var define = function (id, dependencies, definition) { - if (id === undefined) - onerror("Define error: module id can not be undefined"); - else if (blueprints[id] !== undefined) - onerror("Define error: module '" + id + "' is already defined"); - else - blueprints[id] = { id: id, dependencies: dependencies, definition: definition }; - }; - - // Loads a set of modules asynchronously. - var require = function (ids, callback) { - var onsuccess = function () { - var instances = ar.map(ids, demand); - callback.apply(null, instances); - }; - - var oncontinue = function () { - var deps = obj.map(blueprints, function (k, v) { - return v.dependencies; - }); - loader.load(ids, deps, fetch, oncontinue, onsuccess, onerror); - }; - - oncontinue(); - }; - - // Instantiates a module and all of its dependencies. - var demand = function (id) { - if (modules[id] !== undefined) - return modules[id]; - if (blueprints[id] === undefined) - throw "module '" + id + "' is not defined"; - var result = instantiate(id); - if (result === undefined) - throw "module '" + id + "' returned undefined from definition function"; - modules[id] = result; - return result; - }; - - var instantiate = function (id) { - var blueprint = blueprints[id]; - var args = ar.map(blueprint.dependencies, demand); // Instantiate dependencies - return blueprint.definition.apply(null, args); // Instantiate self - }; - - var validator = function (id) { return blueprints[id] !== undefined; }; - var fetch = fetcher.create(regulator, validator, onerror, define, require, demand); - - return { - define: define, - require: require, - demand: demand - }; - }; - - return { - create: create - }; - } -); -kernel.api.sources = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.modulator.globalator - ], - - function (ar, obj, globalator) { - var create = function (builtins, configuration) { - var data = { - 'global': { instance: globalator } - }; - obj.each(builtins, function (key, value) { - data[key] = { instance: value }; - }); - ar.each(configuration.types, function (spec) { - data[spec.type] = { id: spec.modulator }; - }); - var sourcespecs = configuration.sources.slice(0); - var sources = [ globalator.create() ]; - - var guard = function (type) { - if (data[type] === undefined) - throw 'Unknown modulator type [' + type + '].'; - }; - - var isResolved = function (type) { - guard(type); - return data[type].instance !== undefined; - }; - - var idOf = function (type) { - guard(type); - return data[type].id; - }; - - var instanceOf = function (type) { - guard(type); - return data[type].instance; - }; - - var register = function (type, instance) { - guard(type); - data[type].instance = instance; - }; - - var find = function (id) { - for (var i = 0; i < sources.length; ++i) - if (sources[i].can(id)) - return { found: sources[i] }; - return { notfound: true }; - }; - - var crank = function () { - var left = []; - ar.each(sourcespecs, function (spec) { - if (isResolved(spec.type)) { - var instance = instanceOf(spec.type); - var source = instance.create.apply(null, spec.args); - sources.push(source); - } else - left.push(spec); - }); - sourcespecs = left; - }; - - return { - isResolved: isResolved, - idOf: idOf, - instanceOf: instanceOf, - register: register, - find: find, - crank: crank - }; - }; - - return { - create: create - }; - } -); -kernel.api.regulator = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function (sources) { - /* - * 1. Resolve configuration as much as possible - * 2. Check for unresolved modulator types that are required to continue. - * a) Go ahead and resolve, if we have everything we need. - * b) Delay, requiring the modulators, then retry. - */ - var regulate = function (ids, define, require, demand, onsuccess, onerror) { - sources.crank(); - var required = ar.map(ids, determinetype); - var unresolved = ar.filter(required, fn.not(sources.isResolved)); - if (unresolved.length === 0) - resolve(ids, define, require, demand, onsuccess, onerror); - else - delay(unresolved, ids, define, require, demand, onsuccess, onerror); - }; - - var resolve = function (ids, define, require, demand, onsuccess, onerror) { - var r = []; - for (var i = 0; i < ids.length; ++i) { - var id = ids[i]; - var source = sources.find(id); - if (source.notfound) { - onerror('Could not find source for module [' + id + ']'); - return; - } - var spec = source.found.get(id, define, require, demand); - r[i] = build(id, spec); - } - onsuccess(r); - }; - - var build = function (id, spec) { - return { - id: id, - url: spec.url, - load: spec.load, - serial: spec.serial - }; - }; - - var delay = function (types, ids, define, require, demand, onsuccess, onerror) { - var modulatorids = ar.map(types, sources.idOf); - require(modulatorids, function (/* modulators */) { - var modulators = arguments; - ar.each(types, function (type, i) { - sources.register(type, modulators[i]); - }); - regulate(ids, define, require, demand, onsuccess, onerror); - }); - }; - - var determinetype = function (id) { - var index = id.indexOf('!'); - return index === -1 ? 'bolt' : id.substring(0, index); - }; - - return { - regulate: regulate - }; - }; - - return { - create: create - }; - } -); -kernel.api.config = def( - [ - kernel.module.manager, - kernel.api.regulator, - kernel.api.sources - ], - - function (manager, regulator, sources) { - var configure = function (configuration, builtins, onerror) { - var s = sources.create(builtins, configuration); - var r = regulator.create(s); - var engine = manager.create(r, onerror); - - return { - define: engine.define, - require: engine.require, - demand: engine.demand - }; - }; - - return { - configure: configure - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var loader = bolt.loader = bolt.loader || {}; -loader.executor = loader.executor || {}; -loader.api = loader.api || {}; -loader.transporter = loader.transporter || {}; -loader.tag = loader.tag || {}; -loader.tag.script = def( - [ - ], - - function () { - var guard = function (callback) { - return function (evt) { - if (evt.srcElement.readyState === "loaded" || evt.srcElement.readyState === "complete") - callback(); - }; - }; - - var ie = function (el) { - return el.attachEvent && !window.opera; - }; - - var onload = function (el, callback) { - if (ie(el)) - el.attachEvent("onreadystatechange", guard(callback)); - else - el.addEventListener("load", callback, false); - }; - - var createtag = function (callback) { - var el = document.createElement("script"); - el.type = "text/javascript"; - onload(el, callback); - return el; - }; - - var insert = function (decorator, callback) { - var el = createtag(callback); - decorator(el); - var head = document.getElementsByTagName("head")[0]; - head.appendChild(el); - }; - - return { - insert: insert - }; - } -); -loader.transporter.commonjs = def( - [ - ], - - function () { - var read = function (url, success, error) { - var fs = require('fs'); - fs.exists(url, function (exists) { - if (exists) - fs.readFile(url, 'UTF-8', function (err, data) { - if (err) - error('Error reading file [' + url + '], error [' + err + ']'); - else - success(data); - }); - else - error('File does not exist [' + url + ']'); - }); - }; - - return { - read: read - }; - } -); -loader.transporter.xhr = def( - [ - ], - - function () { - var requestObject = function () { - // Correct way to use XMLHttpRequest in IE: - // http://blogs.msdn.com/b/ie/archive/2006/01/23/516393.aspx - var factories = [ - function () { return new XMLHttpRequest() }, - function () { return new ActiveXObject("Microsoft.XMLHTTP") } - ]; - - return fallback(factories); - }; - - var fallback = function (items) { - for (var i = 0; i < items.length; ++i) { - try { - return items[i](); - } catch (e) { - } - } - }; - - var handler = function (req, url, success, error) { - return function () { - if (req.readyState === 4) - done(req, url, success, error); - }; - }; - - var done = function (req, url, success, error) { - if (req.status === 200 || req.status === 304) - success(req.responseText); - else - error('Transport error: ' + req.status + ' ' + req.statusText + ' for resource: "' + url + '"'); - }; - - var getUrl = function (req, url, success, error) { - req.open('GET', url, true); - req.onreadystatechange = handler(req, url, success, error); - req.send(); - }; - - var request = function (url, success, error) { - var req = requestObject(); - if (req) - getUrl(req, url, success, error); - else - error('Transport error: browser does not support XMLHttpRequest.'); - }; - - return { - request: request - }; - } -); -loader.executor.evaller = def( - [ - ], - - function () { - var execute = function (data, onsuccess, onfailure) { - try { - eval(data); - } catch(e) { - onfailure(e); - return; - } - - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.executor.injector = def( - [ - loader.tag.script - ], - - function (script) { - var execute = function (data, onsuccess, onfailure) { - var inject = function (tag) { - tag.text = data; - }; - - var noop = function () {}; - - // Injection does not fire events, but execution happens synchronously, - // so we just make an explicit callback - script.insert(inject, noop); - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.api.commonjsevaller = def( - [ - loader.transporter.commonjs, - loader.executor.evaller - ], - - function (commonjs, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - commonjs.read(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.scripttag = def( - [ - loader.tag.script - ], - - function (script) { - var load = function (url, onsuccess, onfailure) { - var sourcer = function (tag) { - tag.src = url; - }; - - script.insert(sourcer, onsuccess); - }; - - return { - load: load - }; - } -); -loader.api.xhrevaller = def( - [ - loader.transporter.xhr, - loader.executor.evaller - ], - - function (xhr, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.xhrinjector = def( - [ - loader.transporter.xhr, - loader.executor.injector - ], - - function (xhr, injector) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - injector.execute(data, onsuccess); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var module = bolt.module = bolt.module || {}; -module.bootstrap = module.bootstrap || {}; -module.config = module.config || {}; -module.error = module.error || {}; -module.modulator = module.modulator || {}; -module.reader = module.reader || {}; -module.runtime = module.runtime || {}; -module.util = module.util || {}; -module.error.error = def( - [ - ], - - function () { - var die = function (msg) { - throw msg || new Error('unknown error'); - }; - - return { - die: die - }; - } -); -module.config.mapper = def( - [ - ], - - function () { - var flat = function (id) { - return id; - }; - - var hierarchical = function (id) { - return id.replace(/\./g, '/'); - }; - - var constant = function (name) { - return function () { - return name; - }; - }; - - return { - flat: flat, - hierarchical: hierarchical, - constant: constant - }; - } -); -module.api = def( - [ - module.runtime - ], - - function (runtime) { - var delegate = function (method) { - return function () { - return runtime[method].apply(null, arguments); - }; - }; - - return { - define: delegate('define'), - require: delegate('require'), - demand: delegate('demand'), - main: delegate('main'), - load: delegate('load'), - loadscript: delegate('loadscript') - }; - } -); -module.util.path = def( - [ - ], - - function () { - var dirname = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(0, end); - }; - - var basename = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(end + 1); - }; - - return { - basename: basename, - dirname: dirname - }; - } -); -module.util.locator = def( - [ - ], - - function () { - var browser = function () { - var scripts = document.getElementsByTagName("script"); - return scripts[scripts.length - 1].src; - }; - - var runtime = module.runtime.locate; - - var locate = function () { - var f = runtime || browser; - return f(); - }; - - return { - locate: locate - }; - } -); -module.util.pather = def( - [ - module.util.path - ], - - function (path) { - var create = function (relativeto) { - var base = path.dirname(relativeto); - return function (path) { - return base + '/' + path; - }; - }; - - return { - create: create - }; - } -);module.modulator.modulators = def( - [ - ephox.bolt.kernel.fp.functions, - ephox.bolt.kernel.modulator.bolt, - ephox.bolt.loader.api.commonjsevaller, - ephox.bolt.loader.api.scripttag, - ephox.bolt.loader.api.xhrevaller, - ephox.bolt.loader.api.xhrinjector - ], - - function (fn, bolt, commonjsevaller, scripttag, xhrevaller, xhrinjector) { - var wrap = function (modulator, loader) { - var create = fn.curry(modulator.create, loader); - - return { - create: create - } - }; - - return { - boltcommonjs: wrap(bolt, commonjsevaller), - boltscripttag: wrap(bolt, scripttag), - boltxhreval: wrap(bolt, xhrevaller), - boltxhrinjector: wrap(bolt, xhrinjector) - }; - } -); -module.config.builtins = def( - [ - ephox.bolt.module.modulator.modulators.boltscripttag, - ephox.bolt.module.modulator.modulators.boltcommonjs - ], - - function (boltscripttag, boltcommonjs) { - return { - // TODO: 'amd' is maintained for backwards compatibility, will be removed - // at some point. - browser: { bolt: boltscripttag, amd: boltscripttag }, - commonjs: { bolt: boltcommonjs, amd: boltcommonjs } - }; - } -); -module.config.specs = def( - [ - module.util.pather - ], - - function (pather) { - var type = function (type, implementation) { - return { - type: type, - implementation: implementation, - modulator: implementation + '.Modulator', - compiler: implementation + '.Compiler' - }; - }; - - var source = function (relativeto) { - return function (type /*, args */) { - return { - type: type, - relativeto: relativeto, - args: [ pather.create(relativeto) ].concat(Array.prototype.slice.call(arguments, 1)) - }; - } - }; - - return { - type: type, - source: source - }; - } -); -module.reader.bouncing = def( - [ - ephox.bolt.kernel.fp.array, - module.error.error, - module.config.specs - ], - - function (ar, error, specs) { - var bounce = function (done, read, acc) { - var next = acc.configs.shift(); - read(next.relativeto, next.config, done, acc); - }; - - var tick = function (file, cfg, done, read, acc) { - var munged = ar.map(cfg.configs || [], function (config) { - return { relativeto: file, config: config }; - }); - var accumulated = { - sources: acc.sources.concat(cfg.sources || []), - types: acc.types.concat(cfg.types || []), - configs: munged.concat(acc.configs) - }; - if (accumulated.configs.length > 0) - bounce(done, read, accumulated); - else - done({ sources: accumulated.sources, types: accumulated.types }); - }; - - /* - * All precedence is depth-first, pre-order. Example: - * - * A - * /-\ - * B C - * /| |\ - * D E F G - * - * Configs are read in A, B, D, E, C, F, G. - * - * If configs mixed delegation and sources, the - * sources would be ordered the same: A, B, D, E, C, F, G. - */ - - var evaluate = function (file, payload, done, read, acc) { - var result = {}; - /* eval scope */ - var mapper = module.config.mapper; - var type = specs.type; - var source = specs.source(file); - var configure = function (configuration) { - result = configuration; - }; - try { - eval(payload); - } catch (e) { - throw 'Could not load configuration [' + file + '], with: ' + e; - } - tick(file, result, done, read, acc); - }; - - return { - evaluate: evaluate - }; - } -); -module.reader.browser = def( - [ - module.error.error, - module.reader.bouncing, - module.util.path, - ephox.bolt.loader.transporter.xhr - ], - - function (error, bouncing, path, xhr) { - var read = function (relativeto, file, done, acc) { - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = base + '/' + file; - xhr.request(absolute, function (payload) { - bouncing.evaluate(absolute, payload, done, read, accumulated); - }, error.die); - }; - - return { - read: read - }; - } -); -module.reader.node = def( - [ - module.reader.bouncing - ], - - function (bouncing, path, fs) { - var read = function (relativeto, file, done, acc) { - var fs = require('fs'); - var path = require('path'); - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = path.resolve(base, file); - var payload = fs.readFileSync(absolute, 'UTF-8'); - bouncing.evaluate(absolute, payload, done, read, accumulated); - }; - - return { - read: read - }; - } -); -module.reader.direct = def( - [ - ], - - function () { - var create = function (configuration) { - return function (done) { - done({ - sources: configuration.sources || [], - types: configuration.types || [], - configs: configuration.configs || [] - }); - }; - }; - - return { - create: create - }; - } -); -module.bootstrap.configloader = def( - [ - module.util.locator, - module.reader.browser - ], - - function (locator, browser) { - var create = function (file) { - var script = locator.locate(); - return function (done) { - browser.read(script, file, done); - }; - }; - - return { - create: create - }; - } -);module.bootstrap.deferred = def( - [ - ephox.bolt.kernel.fp.array - ], - - function (ar) { - var deferred = []; - - var require = function (ids, fn) { - var r = function (real) { - real(ids, fn); - }; - deferred.push(r); - }; - - var configured = function (require) { - ar.each(deferred, function (action) { - action(require); - }); - deferred = []; - }; - - return { - require: require, - configured: configured - }; - } -); -module.bootstrap.main = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.runtime - ], - - function (config, deferred, runtime) { - var main = function (id, args, configids, callback) { - runtime.require(configids || [], function () { - callback && callback.apply(null, arguments); - runtime.require([ id ], function (module) { - module.apply(null, args || []); - }); - }); - }; - - return { - main: main - }; - } -); -module.bootstrap.install = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.bootstrap.main, - module.runtime, - module.error.error - ], - - function (config, deferred, main, runtime, error) { - var notready = function () { throw 'bolt not initialised, can not call define or demand, did you mean to use require or main?'; }; - - var install = function (reader, builtins, load, loadscript) { - runtime.define = notready; - runtime.demand = notready; - runtime.require = deferred.require; - runtime.main = main.main; - runtime.load = load; - runtime.loadscript = loadscript; - - reader(function (configuration) { - var bolt = config.configure(configuration, builtins, error.die); - runtime.define = bolt.define; - runtime.require = bolt.require; - runtime.demand = bolt.demand; - - deferred.configured(runtime.require); - }); - }; - - return { - install: install - }; - } -); - -})(Function('return this')()); -(function (global) { - var obj = ephox.bolt.kernel.fp.object; - var api = ephox.bolt.module.api; - var builtins = ephox.bolt.module.config.builtins.browser; - var install = ephox.bolt.module.bootstrap.install; - var reader = ephox.bolt.module.bootstrap.configloader.create("atomic.js"); - var transport = ephox.bolt.loader.transporter.xhr.request; - var script = ephox.bolt.loader.api.scripttag.load; - install.install(reader, builtins, transport, script); - obj.merge(global, api); -})(Function("return this;")()); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-browser.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-browser.js deleted file mode 100644 index 0f787ca..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-browser.js +++ /dev/null @@ -1,1491 +0,0 @@ -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var kernel = bolt.kernel = bolt.kernel || {}; -kernel.api = kernel.api || {}; -kernel.async = kernel.api || {}; -kernel.fp = kernel.fp || {}; -kernel.modulator = kernel.modulator || {}; -kernel.module = kernel.module || {}; -kernel.fp.array = def( - [ - ], - - function () { - var equals = function (a1, a2) { - if (a1.length !== a2.length) - return false; - for (var i = 0; i < a1.length; ++i) - if (a1[i] !== a2[i]) - return false; - return true; - }; - - var forall = function (a, f) { - var fn = f || function (x) { - return x === true; - }; - for (var i = 0; i < a.length; ++i) - if (fn(a[i]) !== true) - return false; - return true; - }; - - var map = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - r.push(f(a[i], i)); - return r; - }; - - var flatten = function (a) { - var r = []; - for (var i = 0; i < a.length; ++i) - r = r.concat(a[i]); - return r; - }; - - var flatmap = function (a, f) { - return flatten(map(a, f)); - }; - - var filter = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - if (f(a[i])) - r.push(a[i]); - return r; - }; - - var each = map; - - var contains = function (a, x) { - return !forall(a, function (v) { - return v !== x; - }); - }; - - var indexof = function (a, x) { - for (var i = 0; i < a.length; ++i) - if (a[i] === x) - return i; - return -1; - }; - - return { - equals: equals, - forall: forall, - map: map, - flatten: flatten, - flatmap: flatmap, - filter: filter, - each: each, - contains: contains, - indexof: indexof - }; - } -); -kernel.fp.object = def( - [ - ], - - function () { - var map = function (o, f) { - var r = {}; - for (var i in o) - if (o.hasOwnProperty(i)) - r[i] = f(i, o[i]); - return r; - }; - - var each = map; - - var merge = function (d, s) { - each(s, function (k, v) { - d[k] = v; - }); - }; - - var keys = function (o) { - var r = []; - each(o, function (k) { - r.push(k); - }); - return r; - }; - - return { - each: each, - keys: keys, - map: map, - merge: merge - }; - } -); -kernel.fp.functions = def( - [ - ], - - function () { - var curry = function (f) { - var slice = Array.prototype.slice; - var args = slice.call(arguments, 1); - return function () { - var all = args.concat(slice.call(arguments, 0)); - return f.apply(null, all); - }; - }; - - var not = function (z) { - return function () { - var slice = Array.prototype.slice; - return !z.apply(null, slice.call(arguments, 0)); - }; - }; - - var apply = function (f) { - var slice = Array.prototype.slice; - return f.apply(null, slice.call(arguments, 0)); - }; - - return { - curry: curry, - not: not, - apply: apply - }; - } -);kernel.async.map = def( - [ - kernel.fp.array - ], - - function (ar) { - var amap = function (data, f, oncomplete) { - var total = data.length; - var count = 0; - var results = []; - - ar.each(data, function (datum, i) { - f(datum, function (result) { - ++count; - results[i] = result; - if (count === total) - oncomplete(results); - }); - }); - }; - - return { - amap: amap - }; - } -); -/** - * This module has a dual responsibility: - * 1. Ensures that asynchronous function calls, 'f', that share the same - * 'key' are not executed in parallel. - * 2. In the case where an attempt to call in parallel is prevented, - * the 'action' callbacks are executed when the asynchronous call is - * completed. - * - * Example: - * When we async-map to remotely fetch module definition, it is - * important that only a single define is evaluated, but the - * notification that the definition has completed is propagated - * to all interested parties. - * - * 1. we require dependencies 'x' and 'y' - * - * 2. both x and y are defined in the same file (i.e. compiled together), 'a.js'. - * - * 3. we resolve x and y, to their load spec using a modulator - * x_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * y_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * - * 4. we make the piggyback call for x: - * piggybacker.piggyback(x_spec.url, x_spec.load, xdone); - * - * this will register the 'xdone' action, and actually - * trigger the load call, with a synthetic callback - * responsible for triggering all registered actions. - * - * 5. we make the piggyback call for y: - * piggybacker.piggyback(y_spec.url, y_spec.load, ydone); - * - * this will register the 'ydone' action, but NOT trigger - * the load call. - * - * 6. the load call completes, and calls the synthetic callback, - * which is responsible for triggering both 'xdone' and 'ydone'. - * - * 7. something else happens that means we have to load 'a.js' again, - * the piggybacker DOES NOT prevent this call, and will follow - * the above process. - */ -kernel.async.piggybacker = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function () { - var queue = {}; // key -> [actions] - - var process = function (key) { - var actions = queue[key]; - delete queue[key]; - ar.each(actions, fn.apply); - }; - - var piggyback = function (key, f, action) { - if (queue[key] === undefined) { - queue[key] = [ action ]; - f(fn.curry(process, key)); - } else { - queue[key].push(action); - } - }; - - return { - piggyback: piggyback - }; - }; - - return { - create: create - }; - } -); -kernel.modulator.globalator = def( - [ - ], - - function () { - var create = function () { - // FIX pull out - var resolve = function (name, scope) { - var parts = name.split('.'); - var r = scope; - for (var i = 0; i < parts.length && r !== undefined; ++i) - r = r[parts[i]]; - return r; - }; - - var global = Function('return this')(); - - var can = function (id) { - return id.indexOf('global!') === 0; - }; - - var get = function (id, define, require) { - var name = id.substring('global!'.length); - - var load = function (onsuccess, onfailure) { - var instance = resolve(name, global); - if (instance !== undefined) { - define(id, [], function () { return instance; }); - onsuccess(); - } else { - onfailure('Modulator error: could not resolve global [' + name + ']'); - } - }; - - return { - url: id, // this just needs to be unique, no download required. - load: load, - serial: true - }; - }; - - return { - can: can, - get: get - } - }; - return { - create: create - }; - } -); -kernel.modulator.bolt = def( - [ - kernel.fp.functions - ], - - function (fn) { - var create = function (loader, pather, namespace, path, idTransformer, options) { - var can = function (id) { - return id === namespace || id.indexOf(namespace + '.') === 0 || id.indexOf(namespace + '/') === 0; - }; - - var get = function (id) { - var before = options !== undefined && options.absolute === true ? path : pather(path); - var after = options !== undefined && options.fresh === true ? '?cachebuster=' + new Date().getTime() : ''; - var url = before + "/" + idTransformer(id) + '.js' + after; - var load = fn.curry(loader.load, url); - - return { - url: url, - load: load, - serial: false - }; - }; - - return { - can: can, - get: get - }; - }; - - return { - create: create - }; - } -);kernel.module.stratifier = def( - [ - kernel.fp.array - ], - - function (ar) { - var stratify = function (specs) { - var parallels = ar.filter(specs, function (spec) { - return !spec.serial; - }); - return parallels.length > 0 ? parallels : specs.slice(0, 1); - }; - - return { - stratify: stratify - }; - } -); -/** - * This module performs dependency analysis of strings that depend on sets of - * strings. - * - * The input is an array of root strings to start analysis from, and an object - * that contains a mapping of each string to the strings it depends on. - * - * Performing an analysis results in either: - * 1. an empty array, indicating that all dependencies are satisfied, - * 2. an array of strings that are, at the minimum, still needed in order to - * satisfy the given dependency trees, or - * 3. an array of strings that form a dependency cycle. - */ -kernel.module.analyser = def( - [ - kernel.fp.array - ], - - function (array) { - var collect = function (path, name) { - var i = array.indexof(path, name); - var p = path.slice(i); - return p.concat([name]); - }; - - /** - * @param {array} roots Contains a list of root ids - * @param {object} modules Contains dependency information in format: { id: [ 'id1', 'id2' ] } - */ - var analyse = function (roots, modules) { - var done = {}; - var path = []; - var missing = []; - var cycle; - - var children = function (name) { - array.each(modules[name], attempt); - }; - - var examine = function (name) { - if (modules[name]) - children(name); - else - missing.push(name); - }; - - var descend = function (name) { - path.push(name); - examine(name); - path.pop(); - }; - - var decycle = function (name) { - if (array.contains(path, name)) - cycle = collect(path, name); - else - descend(name); - }; - - var attempt = function (name) { - if (!done[name]) { - decycle(name); - done[name] = true; - } - }; - - array.each(roots, attempt); - - return cycle ? { cycle: cycle } : { load: missing }; - }; - - return { - analyse: analyse - }; - } -); -kernel.module.fetcher = def( - [ - kernel.fp.array, - kernel.fp.functions, - kernel.async.map, - kernel.async.piggybacker, - kernel.module.stratifier - ], - - function (ar, fn, map, piggybacker, stratifier) { - var create = function (regulator, validator, onerror, define, require, demand) { - var piggyback = piggybacker.create(); - - var validate = function (onsuccess, results) { - var failed = ar.filter(results, fn.not(validator)); - if (failed.length > 0) - onerror('Fetcher error: modules were not defined: ' + failed.join(', ')); - else - onsuccess(); - }; - - var mapper = function (spec, onresult) { - var action = fn.curry(onresult, spec.id); - var load = function (callback) { - spec.load(callback, onerror); - }; - piggyback.piggyback(spec.url, load, action); - }; - - var asyncfetch = function (specs, onsuccess) { - var oncomplete = fn.curry(validate, onsuccess); - var strata = stratifier.stratify(specs); - map.amap(strata, mapper, oncomplete); - }; - - var fetch = function (ids, onsuccess) { - regulator.regulate(ids, define, require, demand, function (specs) { - asyncfetch(specs, onsuccess); - }, onerror); - }; - - return { - fetch: fetch - }; - }; - - return { - create: create - }; - } -); -kernel.module.loader = def( - [ - kernel.module.analyser - ], - - function (analyser) { - var load = function (roots, deps, fetcher, oncontinue, onsuccess, onerror) { - var result = analyser.analyse(roots, deps); - - if (result.cycle) - onerror('Dependency error: a circular module dependency exists from ' + result.cycle.join(' ~> ')); - else if (result.load.length === 0) - onsuccess(); - else - fetcher.fetch(result.load, oncontinue); - }; - - return { - load: load - }; - } -); -kernel.module.manager = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.module.loader, - kernel.module.fetcher - ], - - function (ar, obj, loader, fetcher) { - var create = function (regulator, onerror) { - var blueprints = {}; // id -> { id: string, dependencies: [ string ], definition: function } - var modules = {}; // id -> module - - // Adds a module to the system. - var define = function (id, dependencies, definition) { - if (id === undefined) - onerror("Define error: module id can not be undefined"); - else if (blueprints[id] !== undefined) - onerror("Define error: module '" + id + "' is already defined"); - else - blueprints[id] = { id: id, dependencies: dependencies, definition: definition }; - }; - - // Loads a set of modules asynchronously. - var require = function (ids, callback) { - var onsuccess = function () { - var instances = ar.map(ids, demand); - callback.apply(null, instances); - }; - - var oncontinue = function () { - var deps = obj.map(blueprints, function (k, v) { - return v.dependencies; - }); - loader.load(ids, deps, fetch, oncontinue, onsuccess, onerror); - }; - - oncontinue(); - }; - - // Instantiates a module and all of its dependencies. - var demand = function (id) { - if (modules[id] !== undefined) - return modules[id]; - if (blueprints[id] === undefined) - throw "module '" + id + "' is not defined"; - var result = instantiate(id); - if (result === undefined) - throw "module '" + id + "' returned undefined from definition function"; - modules[id] = result; - return result; - }; - - var instantiate = function (id) { - var blueprint = blueprints[id]; - var args = ar.map(blueprint.dependencies, demand); // Instantiate dependencies - return blueprint.definition.apply(null, args); // Instantiate self - }; - - var validator = function (id) { return blueprints[id] !== undefined; }; - var fetch = fetcher.create(regulator, validator, onerror, define, require, demand); - - return { - define: define, - require: require, - demand: demand - }; - }; - - return { - create: create - }; - } -); -kernel.api.sources = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.modulator.globalator - ], - - function (ar, obj, globalator) { - var create = function (builtins, configuration) { - var data = { - 'global': { instance: globalator } - }; - obj.each(builtins, function (key, value) { - data[key] = { instance: value }; - }); - ar.each(configuration.types, function (spec) { - data[spec.type] = { id: spec.modulator }; - }); - var sourcespecs = configuration.sources.slice(0); - var sources = [ globalator.create() ]; - - var guard = function (type) { - if (data[type] === undefined) - throw 'Unknown modulator type [' + type + '].'; - }; - - var isResolved = function (type) { - guard(type); - return data[type].instance !== undefined; - }; - - var idOf = function (type) { - guard(type); - return data[type].id; - }; - - var instanceOf = function (type) { - guard(type); - return data[type].instance; - }; - - var register = function (type, instance) { - guard(type); - data[type].instance = instance; - }; - - var find = function (id) { - for (var i = 0; i < sources.length; ++i) - if (sources[i].can(id)) - return { found: sources[i] }; - return { notfound: true }; - }; - - var crank = function () { - var left = []; - ar.each(sourcespecs, function (spec) { - if (isResolved(spec.type)) { - var instance = instanceOf(spec.type); - var source = instance.create.apply(null, spec.args); - sources.push(source); - } else - left.push(spec); - }); - sourcespecs = left; - }; - - return { - isResolved: isResolved, - idOf: idOf, - instanceOf: instanceOf, - register: register, - find: find, - crank: crank - }; - }; - - return { - create: create - }; - } -); -kernel.api.regulator = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function (sources) { - /* - * 1. Resolve configuration as much as possible - * 2. Check for unresolved modulator types that are required to continue. - * a) Go ahead and resolve, if we have everything we need. - * b) Delay, requiring the modulators, then retry. - */ - var regulate = function (ids, define, require, demand, onsuccess, onerror) { - sources.crank(); - var required = ar.map(ids, determinetype); - var unresolved = ar.filter(required, fn.not(sources.isResolved)); - if (unresolved.length === 0) - resolve(ids, define, require, demand, onsuccess, onerror); - else - delay(unresolved, ids, define, require, demand, onsuccess, onerror); - }; - - var resolve = function (ids, define, require, demand, onsuccess, onerror) { - var r = []; - for (var i = 0; i < ids.length; ++i) { - var id = ids[i]; - var source = sources.find(id); - if (source.notfound) { - onerror('Could not find source for module [' + id + ']'); - return; - } - var spec = source.found.get(id, define, require, demand); - r[i] = build(id, spec); - } - onsuccess(r); - }; - - var build = function (id, spec) { - return { - id: id, - url: spec.url, - load: spec.load, - serial: spec.serial - }; - }; - - var delay = function (types, ids, define, require, demand, onsuccess, onerror) { - var modulatorids = ar.map(types, sources.idOf); - require(modulatorids, function (/* modulators */) { - var modulators = arguments; - ar.each(types, function (type, i) { - sources.register(type, modulators[i]); - }); - regulate(ids, define, require, demand, onsuccess, onerror); - }); - }; - - var determinetype = function (id) { - var index = id.indexOf('!'); - return index === -1 ? 'bolt' : id.substring(0, index); - }; - - return { - regulate: regulate - }; - }; - - return { - create: create - }; - } -); -kernel.api.config = def( - [ - kernel.module.manager, - kernel.api.regulator, - kernel.api.sources - ], - - function (manager, regulator, sources) { - var configure = function (configuration, builtins, onerror) { - var s = sources.create(builtins, configuration); - var r = regulator.create(s); - var engine = manager.create(r, onerror); - - return { - define: engine.define, - require: engine.require, - demand: engine.demand - }; - }; - - return { - configure: configure - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var loader = bolt.loader = bolt.loader || {}; -loader.executor = loader.executor || {}; -loader.api = loader.api || {}; -loader.transporter = loader.transporter || {}; -loader.tag = loader.tag || {}; -loader.tag.script = def( - [ - ], - - function () { - var guard = function (callback) { - return function (evt) { - if (evt.srcElement.readyState === "loaded" || evt.srcElement.readyState === "complete") - callback(); - }; - }; - - var ie = function (el) { - return el.attachEvent && !window.opera; - }; - - var onload = function (el, callback) { - if (ie(el)) - el.attachEvent("onreadystatechange", guard(callback)); - else - el.addEventListener("load", callback, false); - }; - - var createtag = function (callback) { - var el = document.createElement("script"); - el.type = "text/javascript"; - onload(el, callback); - return el; - }; - - var insert = function (decorator, callback) { - var el = createtag(callback); - decorator(el); - var head = document.getElementsByTagName("head")[0]; - head.appendChild(el); - }; - - return { - insert: insert - }; - } -); -loader.transporter.commonjs = def( - [ - ], - - function () { - var read = function (url, success, error) { - var fs = require('fs'); - fs.exists(url, function (exists) { - if (exists) - fs.readFile(url, 'UTF-8', function (err, data) { - if (err) - error('Error reading file [' + url + '], error [' + err + ']'); - else - success(data); - }); - else - error('File does not exist [' + url + ']'); - }); - }; - - return { - read: read - }; - } -); -loader.transporter.xhr = def( - [ - ], - - function () { - var requestObject = function () { - // Correct way to use XMLHttpRequest in IE: - // http://blogs.msdn.com/b/ie/archive/2006/01/23/516393.aspx - var factories = [ - function () { return new XMLHttpRequest() }, - function () { return new ActiveXObject("Microsoft.XMLHTTP") } - ]; - - return fallback(factories); - }; - - var fallback = function (items) { - for (var i = 0; i < items.length; ++i) { - try { - return items[i](); - } catch (e) { - } - } - }; - - var handler = function (req, url, success, error) { - return function () { - if (req.readyState === 4) - done(req, url, success, error); - }; - }; - - var done = function (req, url, success, error) { - if (req.status === 200 || req.status === 304) - success(req.responseText); - else - error('Transport error: ' + req.status + ' ' + req.statusText + ' for resource: "' + url + '"'); - }; - - var getUrl = function (req, url, success, error) { - req.open('GET', url, true); - req.onreadystatechange = handler(req, url, success, error); - req.send(); - }; - - var request = function (url, success, error) { - var req = requestObject(); - if (req) - getUrl(req, url, success, error); - else - error('Transport error: browser does not support XMLHttpRequest.'); - }; - - return { - request: request - }; - } -); -loader.executor.evaller = def( - [ - ], - - function () { - var execute = function (data, onsuccess, onfailure) { - try { - eval(data); - } catch(e) { - onfailure(e); - return; - } - - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.executor.injector = def( - [ - loader.tag.script - ], - - function (script) { - var execute = function (data, onsuccess, onfailure) { - var inject = function (tag) { - tag.text = data; - }; - - var noop = function () {}; - - // Injection does not fire events, but execution happens synchronously, - // so we just make an explicit callback - script.insert(inject, noop); - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.api.commonjsevaller = def( - [ - loader.transporter.commonjs, - loader.executor.evaller - ], - - function (commonjs, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - commonjs.read(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.scripttag = def( - [ - loader.tag.script - ], - - function (script) { - var load = function (url, onsuccess, onfailure) { - var sourcer = function (tag) { - tag.src = url; - }; - - script.insert(sourcer, onsuccess); - }; - - return { - load: load - }; - } -); -loader.api.xhrevaller = def( - [ - loader.transporter.xhr, - loader.executor.evaller - ], - - function (xhr, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.xhrinjector = def( - [ - loader.transporter.xhr, - loader.executor.injector - ], - - function (xhr, injector) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - injector.execute(data, onsuccess); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var module = bolt.module = bolt.module || {}; -module.bootstrap = module.bootstrap || {}; -module.config = module.config || {}; -module.error = module.error || {}; -module.modulator = module.modulator || {}; -module.reader = module.reader || {}; -module.runtime = module.runtime || {}; -module.util = module.util || {}; -module.error.error = def( - [ - ], - - function () { - var die = function (msg) { - throw msg || new Error('unknown error'); - }; - - return { - die: die - }; - } -); -module.config.mapper = def( - [ - ], - - function () { - var flat = function (id) { - return id; - }; - - var hierarchical = function (id) { - return id.replace(/\./g, '/'); - }; - - var constant = function (name) { - return function () { - return name; - }; - }; - - return { - flat: flat, - hierarchical: hierarchical, - constant: constant - }; - } -); -module.api = def( - [ - module.runtime - ], - - function (runtime) { - var delegate = function (method) { - return function () { - return runtime[method].apply(null, arguments); - }; - }; - - return { - define: delegate('define'), - require: delegate('require'), - demand: delegate('demand'), - main: delegate('main'), - load: delegate('load'), - loadscript: delegate('loadscript') - }; - } -); -module.util.path = def( - [ - ], - - function () { - var dirname = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(0, end); - }; - - var basename = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(end + 1); - }; - - return { - basename: basename, - dirname: dirname - }; - } -); -module.util.locator = def( - [ - ], - - function () { - var browser = function () { - var scripts = document.getElementsByTagName("script"); - return scripts[scripts.length - 1].src; - }; - - var runtime = module.runtime.locate; - - var locate = function () { - var f = runtime || browser; - return f(); - }; - - return { - locate: locate - }; - } -); -module.util.pather = def( - [ - module.util.path - ], - - function (path) { - var create = function (relativeto) { - var base = path.dirname(relativeto); - return function (path) { - return base + '/' + path; - }; - }; - - return { - create: create - }; - } -);module.modulator.modulators = def( - [ - ephox.bolt.kernel.fp.functions, - ephox.bolt.kernel.modulator.bolt, - ephox.bolt.loader.api.commonjsevaller, - ephox.bolt.loader.api.scripttag, - ephox.bolt.loader.api.xhrevaller, - ephox.bolt.loader.api.xhrinjector - ], - - function (fn, bolt, commonjsevaller, scripttag, xhrevaller, xhrinjector) { - var wrap = function (modulator, loader) { - var create = fn.curry(modulator.create, loader); - - return { - create: create - } - }; - - return { - boltcommonjs: wrap(bolt, commonjsevaller), - boltscripttag: wrap(bolt, scripttag), - boltxhreval: wrap(bolt, xhrevaller), - boltxhrinjector: wrap(bolt, xhrinjector) - }; - } -); -module.config.builtins = def( - [ - ephox.bolt.module.modulator.modulators.boltscripttag, - ephox.bolt.module.modulator.modulators.boltcommonjs - ], - - function (boltscripttag, boltcommonjs) { - return { - // TODO: 'amd' is maintained for backwards compatibility, will be removed - // at some point. - browser: { bolt: boltscripttag, amd: boltscripttag }, - commonjs: { bolt: boltcommonjs, amd: boltcommonjs } - }; - } -); -module.config.specs = def( - [ - module.util.pather - ], - - function (pather) { - var type = function (type, implementation) { - return { - type: type, - implementation: implementation, - modulator: implementation + '.Modulator', - compiler: implementation + '.Compiler' - }; - }; - - var source = function (relativeto) { - return function (type /*, args */) { - return { - type: type, - relativeto: relativeto, - args: [ pather.create(relativeto) ].concat(Array.prototype.slice.call(arguments, 1)) - }; - } - }; - - return { - type: type, - source: source - }; - } -); -module.reader.bouncing = def( - [ - ephox.bolt.kernel.fp.array, - module.error.error, - module.config.specs - ], - - function (ar, error, specs) { - var bounce = function (done, read, acc) { - var next = acc.configs.shift(); - read(next.relativeto, next.config, done, acc); - }; - - var tick = function (file, cfg, done, read, acc) { - var munged = ar.map(cfg.configs || [], function (config) { - return { relativeto: file, config: config }; - }); - var accumulated = { - sources: acc.sources.concat(cfg.sources || []), - types: acc.types.concat(cfg.types || []), - configs: munged.concat(acc.configs) - }; - if (accumulated.configs.length > 0) - bounce(done, read, accumulated); - else - done({ sources: accumulated.sources, types: accumulated.types }); - }; - - /* - * All precedence is depth-first, pre-order. Example: - * - * A - * /-\ - * B C - * /| |\ - * D E F G - * - * Configs are read in A, B, D, E, C, F, G. - * - * If configs mixed delegation and sources, the - * sources would be ordered the same: A, B, D, E, C, F, G. - */ - - var evaluate = function (file, payload, done, read, acc) { - var result = {}; - /* eval scope */ - var mapper = module.config.mapper; - var type = specs.type; - var source = specs.source(file); - var configure = function (configuration) { - result = configuration; - }; - try { - eval(payload); - } catch (e) { - throw 'Could not load configuration [' + file + '], with: ' + e; - } - tick(file, result, done, read, acc); - }; - - return { - evaluate: evaluate - }; - } -); -module.reader.browser = def( - [ - module.error.error, - module.reader.bouncing, - module.util.path, - ephox.bolt.loader.transporter.xhr - ], - - function (error, bouncing, path, xhr) { - var read = function (relativeto, file, done, acc) { - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = base + '/' + file; - xhr.request(absolute, function (payload) { - bouncing.evaluate(absolute, payload, done, read, accumulated); - }, error.die); - }; - - return { - read: read - }; - } -); -module.reader.node = def( - [ - module.reader.bouncing - ], - - function (bouncing, path, fs) { - var read = function (relativeto, file, done, acc) { - var fs = require('fs'); - var path = require('path'); - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = path.resolve(base, file); - var payload = fs.readFileSync(absolute, 'UTF-8'); - bouncing.evaluate(absolute, payload, done, read, accumulated); - }; - - return { - read: read - }; - } -); -module.reader.direct = def( - [ - ], - - function () { - var create = function (configuration) { - return function (done) { - done({ - sources: configuration.sources || [], - types: configuration.types || [], - configs: configuration.configs || [] - }); - }; - }; - - return { - create: create - }; - } -); -module.bootstrap.configloader = def( - [ - module.util.locator, - module.reader.browser - ], - - function (locator, browser) { - var create = function (file) { - var script = locator.locate(); - return function (done) { - browser.read(script, file, done); - }; - }; - - return { - create: create - }; - } -);module.bootstrap.deferred = def( - [ - ephox.bolt.kernel.fp.array - ], - - function (ar) { - var deferred = []; - - var require = function (ids, fn) { - var r = function (real) { - real(ids, fn); - }; - deferred.push(r); - }; - - var configured = function (require) { - ar.each(deferred, function (action) { - action(require); - }); - deferred = []; - }; - - return { - require: require, - configured: configured - }; - } -); -module.bootstrap.main = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.runtime - ], - - function (config, deferred, runtime) { - var main = function (id, args, configids, callback) { - runtime.require(configids || [], function () { - callback && callback.apply(null, arguments); - runtime.require([ id ], function (module) { - module.apply(null, args || []); - }); - }); - }; - - return { - main: main - }; - } -); -module.bootstrap.install = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.bootstrap.main, - module.runtime, - module.error.error - ], - - function (config, deferred, main, runtime, error) { - var notready = function () { throw 'bolt not initialised, can not call define or demand, did you mean to use require or main?'; }; - - var install = function (reader, builtins, load, loadscript) { - runtime.define = notready; - runtime.demand = notready; - runtime.require = deferred.require; - runtime.main = main.main; - runtime.load = load; - runtime.loadscript = loadscript; - - reader(function (configuration) { - var bolt = config.configure(configuration, builtins, error.die); - runtime.define = bolt.define; - runtime.require = bolt.require; - runtime.demand = bolt.demand; - - deferred.configured(runtime.require); - }); - }; - - return { - install: install - }; - } -); - -})(Function('return this')()); -(function (global) { - var obj = ephox.bolt.kernel.fp.object; - var api = ephox.bolt.module.api; - var builtins = ephox.bolt.module.config.builtins.browser; - var install = ephox.bolt.module.bootstrap.install; - var reader = ephox.bolt.module.bootstrap.configloader.create("browser.js"); - var transport = ephox.bolt.loader.transporter.xhr.request; - var script = ephox.bolt.loader.api.scripttag.load; - install.install(reader, builtins, transport, script); - obj.merge(global, api); -})(Function("return this;")()); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-demo.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-demo.js deleted file mode 100644 index c07c094..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-demo.js +++ /dev/null @@ -1,1491 +0,0 @@ -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var kernel = bolt.kernel = bolt.kernel || {}; -kernel.api = kernel.api || {}; -kernel.async = kernel.api || {}; -kernel.fp = kernel.fp || {}; -kernel.modulator = kernel.modulator || {}; -kernel.module = kernel.module || {}; -kernel.fp.array = def( - [ - ], - - function () { - var equals = function (a1, a2) { - if (a1.length !== a2.length) - return false; - for (var i = 0; i < a1.length; ++i) - if (a1[i] !== a2[i]) - return false; - return true; - }; - - var forall = function (a, f) { - var fn = f || function (x) { - return x === true; - }; - for (var i = 0; i < a.length; ++i) - if (fn(a[i]) !== true) - return false; - return true; - }; - - var map = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - r.push(f(a[i], i)); - return r; - }; - - var flatten = function (a) { - var r = []; - for (var i = 0; i < a.length; ++i) - r = r.concat(a[i]); - return r; - }; - - var flatmap = function (a, f) { - return flatten(map(a, f)); - }; - - var filter = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - if (f(a[i])) - r.push(a[i]); - return r; - }; - - var each = map; - - var contains = function (a, x) { - return !forall(a, function (v) { - return v !== x; - }); - }; - - var indexof = function (a, x) { - for (var i = 0; i < a.length; ++i) - if (a[i] === x) - return i; - return -1; - }; - - return { - equals: equals, - forall: forall, - map: map, - flatten: flatten, - flatmap: flatmap, - filter: filter, - each: each, - contains: contains, - indexof: indexof - }; - } -); -kernel.fp.object = def( - [ - ], - - function () { - var map = function (o, f) { - var r = {}; - for (var i in o) - if (o.hasOwnProperty(i)) - r[i] = f(i, o[i]); - return r; - }; - - var each = map; - - var merge = function (d, s) { - each(s, function (k, v) { - d[k] = v; - }); - }; - - var keys = function (o) { - var r = []; - each(o, function (k) { - r.push(k); - }); - return r; - }; - - return { - each: each, - keys: keys, - map: map, - merge: merge - }; - } -); -kernel.fp.functions = def( - [ - ], - - function () { - var curry = function (f) { - var slice = Array.prototype.slice; - var args = slice.call(arguments, 1); - return function () { - var all = args.concat(slice.call(arguments, 0)); - return f.apply(null, all); - }; - }; - - var not = function (z) { - return function () { - var slice = Array.prototype.slice; - return !z.apply(null, slice.call(arguments, 0)); - }; - }; - - var apply = function (f) { - var slice = Array.prototype.slice; - return f.apply(null, slice.call(arguments, 0)); - }; - - return { - curry: curry, - not: not, - apply: apply - }; - } -);kernel.async.map = def( - [ - kernel.fp.array - ], - - function (ar) { - var amap = function (data, f, oncomplete) { - var total = data.length; - var count = 0; - var results = []; - - ar.each(data, function (datum, i) { - f(datum, function (result) { - ++count; - results[i] = result; - if (count === total) - oncomplete(results); - }); - }); - }; - - return { - amap: amap - }; - } -); -/** - * This module has a dual responsibility: - * 1. Ensures that asynchronous function calls, 'f', that share the same - * 'key' are not executed in parallel. - * 2. In the case where an attempt to call in parallel is prevented, - * the 'action' callbacks are executed when the asynchronous call is - * completed. - * - * Example: - * When we async-map to remotely fetch module definition, it is - * important that only a single define is evaluated, but the - * notification that the definition has completed is propagated - * to all interested parties. - * - * 1. we require dependencies 'x' and 'y' - * - * 2. both x and y are defined in the same file (i.e. compiled together), 'a.js'. - * - * 3. we resolve x and y, to their load spec using a modulator - * x_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * y_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * - * 4. we make the piggyback call for x: - * piggybacker.piggyback(x_spec.url, x_spec.load, xdone); - * - * this will register the 'xdone' action, and actually - * trigger the load call, with a synthetic callback - * responsible for triggering all registered actions. - * - * 5. we make the piggyback call for y: - * piggybacker.piggyback(y_spec.url, y_spec.load, ydone); - * - * this will register the 'ydone' action, but NOT trigger - * the load call. - * - * 6. the load call completes, and calls the synthetic callback, - * which is responsible for triggering both 'xdone' and 'ydone'. - * - * 7. something else happens that means we have to load 'a.js' again, - * the piggybacker DOES NOT prevent this call, and will follow - * the above process. - */ -kernel.async.piggybacker = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function () { - var queue = {}; // key -> [actions] - - var process = function (key) { - var actions = queue[key]; - delete queue[key]; - ar.each(actions, fn.apply); - }; - - var piggyback = function (key, f, action) { - if (queue[key] === undefined) { - queue[key] = [ action ]; - f(fn.curry(process, key)); - } else { - queue[key].push(action); - } - }; - - return { - piggyback: piggyback - }; - }; - - return { - create: create - }; - } -); -kernel.modulator.globalator = def( - [ - ], - - function () { - var create = function () { - // FIX pull out - var resolve = function (name, scope) { - var parts = name.split('.'); - var r = scope; - for (var i = 0; i < parts.length && r !== undefined; ++i) - r = r[parts[i]]; - return r; - }; - - var global = Function('return this')(); - - var can = function (id) { - return id.indexOf('global!') === 0; - }; - - var get = function (id, define, require) { - var name = id.substring('global!'.length); - - var load = function (onsuccess, onfailure) { - var instance = resolve(name, global); - if (instance !== undefined) { - define(id, [], function () { return instance; }); - onsuccess(); - } else { - onfailure('Modulator error: could not resolve global [' + name + ']'); - } - }; - - return { - url: id, // this just needs to be unique, no download required. - load: load, - serial: true - }; - }; - - return { - can: can, - get: get - } - }; - return { - create: create - }; - } -); -kernel.modulator.bolt = def( - [ - kernel.fp.functions - ], - - function (fn) { - var create = function (loader, pather, namespace, path, idTransformer, options) { - var can = function (id) { - return id === namespace || id.indexOf(namespace + '.') === 0 || id.indexOf(namespace + '/') === 0; - }; - - var get = function (id) { - var before = options !== undefined && options.absolute === true ? path : pather(path); - var after = options !== undefined && options.fresh === true ? '?cachebuster=' + new Date().getTime() : ''; - var url = before + "/" + idTransformer(id) + '.js' + after; - var load = fn.curry(loader.load, url); - - return { - url: url, - load: load, - serial: false - }; - }; - - return { - can: can, - get: get - }; - }; - - return { - create: create - }; - } -);kernel.module.stratifier = def( - [ - kernel.fp.array - ], - - function (ar) { - var stratify = function (specs) { - var parallels = ar.filter(specs, function (spec) { - return !spec.serial; - }); - return parallels.length > 0 ? parallels : specs.slice(0, 1); - }; - - return { - stratify: stratify - }; - } -); -/** - * This module performs dependency analysis of strings that depend on sets of - * strings. - * - * The input is an array of root strings to start analysis from, and an object - * that contains a mapping of each string to the strings it depends on. - * - * Performing an analysis results in either: - * 1. an empty array, indicating that all dependencies are satisfied, - * 2. an array of strings that are, at the minimum, still needed in order to - * satisfy the given dependency trees, or - * 3. an array of strings that form a dependency cycle. - */ -kernel.module.analyser = def( - [ - kernel.fp.array - ], - - function (array) { - var collect = function (path, name) { - var i = array.indexof(path, name); - var p = path.slice(i); - return p.concat([name]); - }; - - /** - * @param {array} roots Contains a list of root ids - * @param {object} modules Contains dependency information in format: { id: [ 'id1', 'id2' ] } - */ - var analyse = function (roots, modules) { - var done = {}; - var path = []; - var missing = []; - var cycle; - - var children = function (name) { - array.each(modules[name], attempt); - }; - - var examine = function (name) { - if (modules[name]) - children(name); - else - missing.push(name); - }; - - var descend = function (name) { - path.push(name); - examine(name); - path.pop(); - }; - - var decycle = function (name) { - if (array.contains(path, name)) - cycle = collect(path, name); - else - descend(name); - }; - - var attempt = function (name) { - if (!done[name]) { - decycle(name); - done[name] = true; - } - }; - - array.each(roots, attempt); - - return cycle ? { cycle: cycle } : { load: missing }; - }; - - return { - analyse: analyse - }; - } -); -kernel.module.fetcher = def( - [ - kernel.fp.array, - kernel.fp.functions, - kernel.async.map, - kernel.async.piggybacker, - kernel.module.stratifier - ], - - function (ar, fn, map, piggybacker, stratifier) { - var create = function (regulator, validator, onerror, define, require, demand) { - var piggyback = piggybacker.create(); - - var validate = function (onsuccess, results) { - var failed = ar.filter(results, fn.not(validator)); - if (failed.length > 0) - onerror('Fetcher error: modules were not defined: ' + failed.join(', ')); - else - onsuccess(); - }; - - var mapper = function (spec, onresult) { - var action = fn.curry(onresult, spec.id); - var load = function (callback) { - spec.load(callback, onerror); - }; - piggyback.piggyback(spec.url, load, action); - }; - - var asyncfetch = function (specs, onsuccess) { - var oncomplete = fn.curry(validate, onsuccess); - var strata = stratifier.stratify(specs); - map.amap(strata, mapper, oncomplete); - }; - - var fetch = function (ids, onsuccess) { - regulator.regulate(ids, define, require, demand, function (specs) { - asyncfetch(specs, onsuccess); - }, onerror); - }; - - return { - fetch: fetch - }; - }; - - return { - create: create - }; - } -); -kernel.module.loader = def( - [ - kernel.module.analyser - ], - - function (analyser) { - var load = function (roots, deps, fetcher, oncontinue, onsuccess, onerror) { - var result = analyser.analyse(roots, deps); - - if (result.cycle) - onerror('Dependency error: a circular module dependency exists from ' + result.cycle.join(' ~> ')); - else if (result.load.length === 0) - onsuccess(); - else - fetcher.fetch(result.load, oncontinue); - }; - - return { - load: load - }; - } -); -kernel.module.manager = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.module.loader, - kernel.module.fetcher - ], - - function (ar, obj, loader, fetcher) { - var create = function (regulator, onerror) { - var blueprints = {}; // id -> { id: string, dependencies: [ string ], definition: function } - var modules = {}; // id -> module - - // Adds a module to the system. - var define = function (id, dependencies, definition) { - if (id === undefined) - onerror("Define error: module id can not be undefined"); - else if (blueprints[id] !== undefined) - onerror("Define error: module '" + id + "' is already defined"); - else - blueprints[id] = { id: id, dependencies: dependencies, definition: definition }; - }; - - // Loads a set of modules asynchronously. - var require = function (ids, callback) { - var onsuccess = function () { - var instances = ar.map(ids, demand); - callback.apply(null, instances); - }; - - var oncontinue = function () { - var deps = obj.map(blueprints, function (k, v) { - return v.dependencies; - }); - loader.load(ids, deps, fetch, oncontinue, onsuccess, onerror); - }; - - oncontinue(); - }; - - // Instantiates a module and all of its dependencies. - var demand = function (id) { - if (modules[id] !== undefined) - return modules[id]; - if (blueprints[id] === undefined) - throw "module '" + id + "' is not defined"; - var result = instantiate(id); - if (result === undefined) - throw "module '" + id + "' returned undefined from definition function"; - modules[id] = result; - return result; - }; - - var instantiate = function (id) { - var blueprint = blueprints[id]; - var args = ar.map(blueprint.dependencies, demand); // Instantiate dependencies - return blueprint.definition.apply(null, args); // Instantiate self - }; - - var validator = function (id) { return blueprints[id] !== undefined; }; - var fetch = fetcher.create(regulator, validator, onerror, define, require, demand); - - return { - define: define, - require: require, - demand: demand - }; - }; - - return { - create: create - }; - } -); -kernel.api.sources = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.modulator.globalator - ], - - function (ar, obj, globalator) { - var create = function (builtins, configuration) { - var data = { - 'global': { instance: globalator } - }; - obj.each(builtins, function (key, value) { - data[key] = { instance: value }; - }); - ar.each(configuration.types, function (spec) { - data[spec.type] = { id: spec.modulator }; - }); - var sourcespecs = configuration.sources.slice(0); - var sources = [ globalator.create() ]; - - var guard = function (type) { - if (data[type] === undefined) - throw 'Unknown modulator type [' + type + '].'; - }; - - var isResolved = function (type) { - guard(type); - return data[type].instance !== undefined; - }; - - var idOf = function (type) { - guard(type); - return data[type].id; - }; - - var instanceOf = function (type) { - guard(type); - return data[type].instance; - }; - - var register = function (type, instance) { - guard(type); - data[type].instance = instance; - }; - - var find = function (id) { - for (var i = 0; i < sources.length; ++i) - if (sources[i].can(id)) - return { found: sources[i] }; - return { notfound: true }; - }; - - var crank = function () { - var left = []; - ar.each(sourcespecs, function (spec) { - if (isResolved(spec.type)) { - var instance = instanceOf(spec.type); - var source = instance.create.apply(null, spec.args); - sources.push(source); - } else - left.push(spec); - }); - sourcespecs = left; - }; - - return { - isResolved: isResolved, - idOf: idOf, - instanceOf: instanceOf, - register: register, - find: find, - crank: crank - }; - }; - - return { - create: create - }; - } -); -kernel.api.regulator = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function (sources) { - /* - * 1. Resolve configuration as much as possible - * 2. Check for unresolved modulator types that are required to continue. - * a) Go ahead and resolve, if we have everything we need. - * b) Delay, requiring the modulators, then retry. - */ - var regulate = function (ids, define, require, demand, onsuccess, onerror) { - sources.crank(); - var required = ar.map(ids, determinetype); - var unresolved = ar.filter(required, fn.not(sources.isResolved)); - if (unresolved.length === 0) - resolve(ids, define, require, demand, onsuccess, onerror); - else - delay(unresolved, ids, define, require, demand, onsuccess, onerror); - }; - - var resolve = function (ids, define, require, demand, onsuccess, onerror) { - var r = []; - for (var i = 0; i < ids.length; ++i) { - var id = ids[i]; - var source = sources.find(id); - if (source.notfound) { - onerror('Could not find source for module [' + id + ']'); - return; - } - var spec = source.found.get(id, define, require, demand); - r[i] = build(id, spec); - } - onsuccess(r); - }; - - var build = function (id, spec) { - return { - id: id, - url: spec.url, - load: spec.load, - serial: spec.serial - }; - }; - - var delay = function (types, ids, define, require, demand, onsuccess, onerror) { - var modulatorids = ar.map(types, sources.idOf); - require(modulatorids, function (/* modulators */) { - var modulators = arguments; - ar.each(types, function (type, i) { - sources.register(type, modulators[i]); - }); - regulate(ids, define, require, demand, onsuccess, onerror); - }); - }; - - var determinetype = function (id) { - var index = id.indexOf('!'); - return index === -1 ? 'bolt' : id.substring(0, index); - }; - - return { - regulate: regulate - }; - }; - - return { - create: create - }; - } -); -kernel.api.config = def( - [ - kernel.module.manager, - kernel.api.regulator, - kernel.api.sources - ], - - function (manager, regulator, sources) { - var configure = function (configuration, builtins, onerror) { - var s = sources.create(builtins, configuration); - var r = regulator.create(s); - var engine = manager.create(r, onerror); - - return { - define: engine.define, - require: engine.require, - demand: engine.demand - }; - }; - - return { - configure: configure - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var loader = bolt.loader = bolt.loader || {}; -loader.executor = loader.executor || {}; -loader.api = loader.api || {}; -loader.transporter = loader.transporter || {}; -loader.tag = loader.tag || {}; -loader.tag.script = def( - [ - ], - - function () { - var guard = function (callback) { - return function (evt) { - if (evt.srcElement.readyState === "loaded" || evt.srcElement.readyState === "complete") - callback(); - }; - }; - - var ie = function (el) { - return el.attachEvent && !window.opera; - }; - - var onload = function (el, callback) { - if (ie(el)) - el.attachEvent("onreadystatechange", guard(callback)); - else - el.addEventListener("load", callback, false); - }; - - var createtag = function (callback) { - var el = document.createElement("script"); - el.type = "text/javascript"; - onload(el, callback); - return el; - }; - - var insert = function (decorator, callback) { - var el = createtag(callback); - decorator(el); - var head = document.getElementsByTagName("head")[0]; - head.appendChild(el); - }; - - return { - insert: insert - }; - } -); -loader.transporter.commonjs = def( - [ - ], - - function () { - var read = function (url, success, error) { - var fs = require('fs'); - fs.exists(url, function (exists) { - if (exists) - fs.readFile(url, 'UTF-8', function (err, data) { - if (err) - error('Error reading file [' + url + '], error [' + err + ']'); - else - success(data); - }); - else - error('File does not exist [' + url + ']'); - }); - }; - - return { - read: read - }; - } -); -loader.transporter.xhr = def( - [ - ], - - function () { - var requestObject = function () { - // Correct way to use XMLHttpRequest in IE: - // http://blogs.msdn.com/b/ie/archive/2006/01/23/516393.aspx - var factories = [ - function () { return new XMLHttpRequest() }, - function () { return new ActiveXObject("Microsoft.XMLHTTP") } - ]; - - return fallback(factories); - }; - - var fallback = function (items) { - for (var i = 0; i < items.length; ++i) { - try { - return items[i](); - } catch (e) { - } - } - }; - - var handler = function (req, url, success, error) { - return function () { - if (req.readyState === 4) - done(req, url, success, error); - }; - }; - - var done = function (req, url, success, error) { - if (req.status === 200 || req.status === 304) - success(req.responseText); - else - error('Transport error: ' + req.status + ' ' + req.statusText + ' for resource: "' + url + '"'); - }; - - var getUrl = function (req, url, success, error) { - req.open('GET', url, true); - req.onreadystatechange = handler(req, url, success, error); - req.send(); - }; - - var request = function (url, success, error) { - var req = requestObject(); - if (req) - getUrl(req, url, success, error); - else - error('Transport error: browser does not support XMLHttpRequest.'); - }; - - return { - request: request - }; - } -); -loader.executor.evaller = def( - [ - ], - - function () { - var execute = function (data, onsuccess, onfailure) { - try { - eval(data); - } catch(e) { - onfailure(e); - return; - } - - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.executor.injector = def( - [ - loader.tag.script - ], - - function (script) { - var execute = function (data, onsuccess, onfailure) { - var inject = function (tag) { - tag.text = data; - }; - - var noop = function () {}; - - // Injection does not fire events, but execution happens synchronously, - // so we just make an explicit callback - script.insert(inject, noop); - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.api.commonjsevaller = def( - [ - loader.transporter.commonjs, - loader.executor.evaller - ], - - function (commonjs, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - commonjs.read(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.scripttag = def( - [ - loader.tag.script - ], - - function (script) { - var load = function (url, onsuccess, onfailure) { - var sourcer = function (tag) { - tag.src = url; - }; - - script.insert(sourcer, onsuccess); - }; - - return { - load: load - }; - } -); -loader.api.xhrevaller = def( - [ - loader.transporter.xhr, - loader.executor.evaller - ], - - function (xhr, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.xhrinjector = def( - [ - loader.transporter.xhr, - loader.executor.injector - ], - - function (xhr, injector) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - injector.execute(data, onsuccess); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var module = bolt.module = bolt.module || {}; -module.bootstrap = module.bootstrap || {}; -module.config = module.config || {}; -module.error = module.error || {}; -module.modulator = module.modulator || {}; -module.reader = module.reader || {}; -module.runtime = module.runtime || {}; -module.util = module.util || {}; -module.error.error = def( - [ - ], - - function () { - var die = function (msg) { - throw msg || new Error('unknown error'); - }; - - return { - die: die - }; - } -); -module.config.mapper = def( - [ - ], - - function () { - var flat = function (id) { - return id; - }; - - var hierarchical = function (id) { - return id.replace(/\./g, '/'); - }; - - var constant = function (name) { - return function () { - return name; - }; - }; - - return { - flat: flat, - hierarchical: hierarchical, - constant: constant - }; - } -); -module.api = def( - [ - module.runtime - ], - - function (runtime) { - var delegate = function (method) { - return function () { - return runtime[method].apply(null, arguments); - }; - }; - - return { - define: delegate('define'), - require: delegate('require'), - demand: delegate('demand'), - main: delegate('main'), - load: delegate('load'), - loadscript: delegate('loadscript') - }; - } -); -module.util.path = def( - [ - ], - - function () { - var dirname = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(0, end); - }; - - var basename = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(end + 1); - }; - - return { - basename: basename, - dirname: dirname - }; - } -); -module.util.locator = def( - [ - ], - - function () { - var browser = function () { - var scripts = document.getElementsByTagName("script"); - return scripts[scripts.length - 1].src; - }; - - var runtime = module.runtime.locate; - - var locate = function () { - var f = runtime || browser; - return f(); - }; - - return { - locate: locate - }; - } -); -module.util.pather = def( - [ - module.util.path - ], - - function (path) { - var create = function (relativeto) { - var base = path.dirname(relativeto); - return function (path) { - return base + '/' + path; - }; - }; - - return { - create: create - }; - } -);module.modulator.modulators = def( - [ - ephox.bolt.kernel.fp.functions, - ephox.bolt.kernel.modulator.bolt, - ephox.bolt.loader.api.commonjsevaller, - ephox.bolt.loader.api.scripttag, - ephox.bolt.loader.api.xhrevaller, - ephox.bolt.loader.api.xhrinjector - ], - - function (fn, bolt, commonjsevaller, scripttag, xhrevaller, xhrinjector) { - var wrap = function (modulator, loader) { - var create = fn.curry(modulator.create, loader); - - return { - create: create - } - }; - - return { - boltcommonjs: wrap(bolt, commonjsevaller), - boltscripttag: wrap(bolt, scripttag), - boltxhreval: wrap(bolt, xhrevaller), - boltxhrinjector: wrap(bolt, xhrinjector) - }; - } -); -module.config.builtins = def( - [ - ephox.bolt.module.modulator.modulators.boltscripttag, - ephox.bolt.module.modulator.modulators.boltcommonjs - ], - - function (boltscripttag, boltcommonjs) { - return { - // TODO: 'amd' is maintained for backwards compatibility, will be removed - // at some point. - browser: { bolt: boltscripttag, amd: boltscripttag }, - commonjs: { bolt: boltcommonjs, amd: boltcommonjs } - }; - } -); -module.config.specs = def( - [ - module.util.pather - ], - - function (pather) { - var type = function (type, implementation) { - return { - type: type, - implementation: implementation, - modulator: implementation + '.Modulator', - compiler: implementation + '.Compiler' - }; - }; - - var source = function (relativeto) { - return function (type /*, args */) { - return { - type: type, - relativeto: relativeto, - args: [ pather.create(relativeto) ].concat(Array.prototype.slice.call(arguments, 1)) - }; - } - }; - - return { - type: type, - source: source - }; - } -); -module.reader.bouncing = def( - [ - ephox.bolt.kernel.fp.array, - module.error.error, - module.config.specs - ], - - function (ar, error, specs) { - var bounce = function (done, read, acc) { - var next = acc.configs.shift(); - read(next.relativeto, next.config, done, acc); - }; - - var tick = function (file, cfg, done, read, acc) { - var munged = ar.map(cfg.configs || [], function (config) { - return { relativeto: file, config: config }; - }); - var accumulated = { - sources: acc.sources.concat(cfg.sources || []), - types: acc.types.concat(cfg.types || []), - configs: munged.concat(acc.configs) - }; - if (accumulated.configs.length > 0) - bounce(done, read, accumulated); - else - done({ sources: accumulated.sources, types: accumulated.types }); - }; - - /* - * All precedence is depth-first, pre-order. Example: - * - * A - * /-\ - * B C - * /| |\ - * D E F G - * - * Configs are read in A, B, D, E, C, F, G. - * - * If configs mixed delegation and sources, the - * sources would be ordered the same: A, B, D, E, C, F, G. - */ - - var evaluate = function (file, payload, done, read, acc) { - var result = {}; - /* eval scope */ - var mapper = module.config.mapper; - var type = specs.type; - var source = specs.source(file); - var configure = function (configuration) { - result = configuration; - }; - try { - eval(payload); - } catch (e) { - throw 'Could not load configuration [' + file + '], with: ' + e; - } - tick(file, result, done, read, acc); - }; - - return { - evaluate: evaluate - }; - } -); -module.reader.browser = def( - [ - module.error.error, - module.reader.bouncing, - module.util.path, - ephox.bolt.loader.transporter.xhr - ], - - function (error, bouncing, path, xhr) { - var read = function (relativeto, file, done, acc) { - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = base + '/' + file; - xhr.request(absolute, function (payload) { - bouncing.evaluate(absolute, payload, done, read, accumulated); - }, error.die); - }; - - return { - read: read - }; - } -); -module.reader.node = def( - [ - module.reader.bouncing - ], - - function (bouncing, path, fs) { - var read = function (relativeto, file, done, acc) { - var fs = require('fs'); - var path = require('path'); - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = path.resolve(base, file); - var payload = fs.readFileSync(absolute, 'UTF-8'); - bouncing.evaluate(absolute, payload, done, read, accumulated); - }; - - return { - read: read - }; - } -); -module.reader.direct = def( - [ - ], - - function () { - var create = function (configuration) { - return function (done) { - done({ - sources: configuration.sources || [], - types: configuration.types || [], - configs: configuration.configs || [] - }); - }; - }; - - return { - create: create - }; - } -); -module.bootstrap.configloader = def( - [ - module.util.locator, - module.reader.browser - ], - - function (locator, browser) { - var create = function (file) { - var script = locator.locate(); - return function (done) { - browser.read(script, file, done); - }; - }; - - return { - create: create - }; - } -);module.bootstrap.deferred = def( - [ - ephox.bolt.kernel.fp.array - ], - - function (ar) { - var deferred = []; - - var require = function (ids, fn) { - var r = function (real) { - real(ids, fn); - }; - deferred.push(r); - }; - - var configured = function (require) { - ar.each(deferred, function (action) { - action(require); - }); - deferred = []; - }; - - return { - require: require, - configured: configured - }; - } -); -module.bootstrap.main = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.runtime - ], - - function (config, deferred, runtime) { - var main = function (id, args, configids, callback) { - runtime.require(configids || [], function () { - callback && callback.apply(null, arguments); - runtime.require([ id ], function (module) { - module.apply(null, args || []); - }); - }); - }; - - return { - main: main - }; - } -); -module.bootstrap.install = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.bootstrap.main, - module.runtime, - module.error.error - ], - - function (config, deferred, main, runtime, error) { - var notready = function () { throw 'bolt not initialised, can not call define or demand, did you mean to use require or main?'; }; - - var install = function (reader, builtins, load, loadscript) { - runtime.define = notready; - runtime.demand = notready; - runtime.require = deferred.require; - runtime.main = main.main; - runtime.load = load; - runtime.loadscript = loadscript; - - reader(function (configuration) { - var bolt = config.configure(configuration, builtins, error.die); - runtime.define = bolt.define; - runtime.require = bolt.require; - runtime.demand = bolt.demand; - - deferred.configured(runtime.require); - }); - }; - - return { - install: install - }; - } -); - -})(Function('return this')()); -(function (global) { - var obj = ephox.bolt.kernel.fp.object; - var api = ephox.bolt.module.api; - var builtins = ephox.bolt.module.config.builtins.browser; - var install = ephox.bolt.module.bootstrap.install; - var reader = ephox.bolt.module.bootstrap.configloader.create("demo.js"); - var transport = ephox.bolt.loader.transporter.xhr.request; - var script = ephox.bolt.loader.api.scripttag.load; - install.install(reader, builtins, transport, script); - obj.merge(global, api); -})(Function("return this;")()); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-prod.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-prod.js deleted file mode 100644 index d999c52..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/bootstrap-prod.js +++ /dev/null @@ -1,1491 +0,0 @@ -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var kernel = bolt.kernel = bolt.kernel || {}; -kernel.api = kernel.api || {}; -kernel.async = kernel.api || {}; -kernel.fp = kernel.fp || {}; -kernel.modulator = kernel.modulator || {}; -kernel.module = kernel.module || {}; -kernel.fp.array = def( - [ - ], - - function () { - var equals = function (a1, a2) { - if (a1.length !== a2.length) - return false; - for (var i = 0; i < a1.length; ++i) - if (a1[i] !== a2[i]) - return false; - return true; - }; - - var forall = function (a, f) { - var fn = f || function (x) { - return x === true; - }; - for (var i = 0; i < a.length; ++i) - if (fn(a[i]) !== true) - return false; - return true; - }; - - var map = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - r.push(f(a[i], i)); - return r; - }; - - var flatten = function (a) { - var r = []; - for (var i = 0; i < a.length; ++i) - r = r.concat(a[i]); - return r; - }; - - var flatmap = function (a, f) { - return flatten(map(a, f)); - }; - - var filter = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - if (f(a[i])) - r.push(a[i]); - return r; - }; - - var each = map; - - var contains = function (a, x) { - return !forall(a, function (v) { - return v !== x; - }); - }; - - var indexof = function (a, x) { - for (var i = 0; i < a.length; ++i) - if (a[i] === x) - return i; - return -1; - }; - - return { - equals: equals, - forall: forall, - map: map, - flatten: flatten, - flatmap: flatmap, - filter: filter, - each: each, - contains: contains, - indexof: indexof - }; - } -); -kernel.fp.object = def( - [ - ], - - function () { - var map = function (o, f) { - var r = {}; - for (var i in o) - if (o.hasOwnProperty(i)) - r[i] = f(i, o[i]); - return r; - }; - - var each = map; - - var merge = function (d, s) { - each(s, function (k, v) { - d[k] = v; - }); - }; - - var keys = function (o) { - var r = []; - each(o, function (k) { - r.push(k); - }); - return r; - }; - - return { - each: each, - keys: keys, - map: map, - merge: merge - }; - } -); -kernel.fp.functions = def( - [ - ], - - function () { - var curry = function (f) { - var slice = Array.prototype.slice; - var args = slice.call(arguments, 1); - return function () { - var all = args.concat(slice.call(arguments, 0)); - return f.apply(null, all); - }; - }; - - var not = function (z) { - return function () { - var slice = Array.prototype.slice; - return !z.apply(null, slice.call(arguments, 0)); - }; - }; - - var apply = function (f) { - var slice = Array.prototype.slice; - return f.apply(null, slice.call(arguments, 0)); - }; - - return { - curry: curry, - not: not, - apply: apply - }; - } -);kernel.async.map = def( - [ - kernel.fp.array - ], - - function (ar) { - var amap = function (data, f, oncomplete) { - var total = data.length; - var count = 0; - var results = []; - - ar.each(data, function (datum, i) { - f(datum, function (result) { - ++count; - results[i] = result; - if (count === total) - oncomplete(results); - }); - }); - }; - - return { - amap: amap - }; - } -); -/** - * This module has a dual responsibility: - * 1. Ensures that asynchronous function calls, 'f', that share the same - * 'key' are not executed in parallel. - * 2. In the case where an attempt to call in parallel is prevented, - * the 'action' callbacks are executed when the asynchronous call is - * completed. - * - * Example: - * When we async-map to remotely fetch module definition, it is - * important that only a single define is evaluated, but the - * notification that the definition has completed is propagated - * to all interested parties. - * - * 1. we require dependencies 'x' and 'y' - * - * 2. both x and y are defined in the same file (i.e. compiled together), 'a.js'. - * - * 3. we resolve x and y, to their load spec using a modulator - * x_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * y_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * - * 4. we make the piggyback call for x: - * piggybacker.piggyback(x_spec.url, x_spec.load, xdone); - * - * this will register the 'xdone' action, and actually - * trigger the load call, with a synthetic callback - * responsible for triggering all registered actions. - * - * 5. we make the piggyback call for y: - * piggybacker.piggyback(y_spec.url, y_spec.load, ydone); - * - * this will register the 'ydone' action, but NOT trigger - * the load call. - * - * 6. the load call completes, and calls the synthetic callback, - * which is responsible for triggering both 'xdone' and 'ydone'. - * - * 7. something else happens that means we have to load 'a.js' again, - * the piggybacker DOES NOT prevent this call, and will follow - * the above process. - */ -kernel.async.piggybacker = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function () { - var queue = {}; // key -> [actions] - - var process = function (key) { - var actions = queue[key]; - delete queue[key]; - ar.each(actions, fn.apply); - }; - - var piggyback = function (key, f, action) { - if (queue[key] === undefined) { - queue[key] = [ action ]; - f(fn.curry(process, key)); - } else { - queue[key].push(action); - } - }; - - return { - piggyback: piggyback - }; - }; - - return { - create: create - }; - } -); -kernel.modulator.globalator = def( - [ - ], - - function () { - var create = function () { - // FIX pull out - var resolve = function (name, scope) { - var parts = name.split('.'); - var r = scope; - for (var i = 0; i < parts.length && r !== undefined; ++i) - r = r[parts[i]]; - return r; - }; - - var global = Function('return this')(); - - var can = function (id) { - return id.indexOf('global!') === 0; - }; - - var get = function (id, define, require) { - var name = id.substring('global!'.length); - - var load = function (onsuccess, onfailure) { - var instance = resolve(name, global); - if (instance !== undefined) { - define(id, [], function () { return instance; }); - onsuccess(); - } else { - onfailure('Modulator error: could not resolve global [' + name + ']'); - } - }; - - return { - url: id, // this just needs to be unique, no download required. - load: load, - serial: true - }; - }; - - return { - can: can, - get: get - } - }; - return { - create: create - }; - } -); -kernel.modulator.bolt = def( - [ - kernel.fp.functions - ], - - function (fn) { - var create = function (loader, pather, namespace, path, idTransformer, options) { - var can = function (id) { - return id === namespace || id.indexOf(namespace + '.') === 0 || id.indexOf(namespace + '/') === 0; - }; - - var get = function (id) { - var before = options !== undefined && options.absolute === true ? path : pather(path); - var after = options !== undefined && options.fresh === true ? '?cachebuster=' + new Date().getTime() : ''; - var url = before + "/" + idTransformer(id) + '.js' + after; - var load = fn.curry(loader.load, url); - - return { - url: url, - load: load, - serial: false - }; - }; - - return { - can: can, - get: get - }; - }; - - return { - create: create - }; - } -);kernel.module.stratifier = def( - [ - kernel.fp.array - ], - - function (ar) { - var stratify = function (specs) { - var parallels = ar.filter(specs, function (spec) { - return !spec.serial; - }); - return parallels.length > 0 ? parallels : specs.slice(0, 1); - }; - - return { - stratify: stratify - }; - } -); -/** - * This module performs dependency analysis of strings that depend on sets of - * strings. - * - * The input is an array of root strings to start analysis from, and an object - * that contains a mapping of each string to the strings it depends on. - * - * Performing an analysis results in either: - * 1. an empty array, indicating that all dependencies are satisfied, - * 2. an array of strings that are, at the minimum, still needed in order to - * satisfy the given dependency trees, or - * 3. an array of strings that form a dependency cycle. - */ -kernel.module.analyser = def( - [ - kernel.fp.array - ], - - function (array) { - var collect = function (path, name) { - var i = array.indexof(path, name); - var p = path.slice(i); - return p.concat([name]); - }; - - /** - * @param {array} roots Contains a list of root ids - * @param {object} modules Contains dependency information in format: { id: [ 'id1', 'id2' ] } - */ - var analyse = function (roots, modules) { - var done = {}; - var path = []; - var missing = []; - var cycle; - - var children = function (name) { - array.each(modules[name], attempt); - }; - - var examine = function (name) { - if (modules[name]) - children(name); - else - missing.push(name); - }; - - var descend = function (name) { - path.push(name); - examine(name); - path.pop(); - }; - - var decycle = function (name) { - if (array.contains(path, name)) - cycle = collect(path, name); - else - descend(name); - }; - - var attempt = function (name) { - if (!done[name]) { - decycle(name); - done[name] = true; - } - }; - - array.each(roots, attempt); - - return cycle ? { cycle: cycle } : { load: missing }; - }; - - return { - analyse: analyse - }; - } -); -kernel.module.fetcher = def( - [ - kernel.fp.array, - kernel.fp.functions, - kernel.async.map, - kernel.async.piggybacker, - kernel.module.stratifier - ], - - function (ar, fn, map, piggybacker, stratifier) { - var create = function (regulator, validator, onerror, define, require, demand) { - var piggyback = piggybacker.create(); - - var validate = function (onsuccess, results) { - var failed = ar.filter(results, fn.not(validator)); - if (failed.length > 0) - onerror('Fetcher error: modules were not defined: ' + failed.join(', ')); - else - onsuccess(); - }; - - var mapper = function (spec, onresult) { - var action = fn.curry(onresult, spec.id); - var load = function (callback) { - spec.load(callback, onerror); - }; - piggyback.piggyback(spec.url, load, action); - }; - - var asyncfetch = function (specs, onsuccess) { - var oncomplete = fn.curry(validate, onsuccess); - var strata = stratifier.stratify(specs); - map.amap(strata, mapper, oncomplete); - }; - - var fetch = function (ids, onsuccess) { - regulator.regulate(ids, define, require, demand, function (specs) { - asyncfetch(specs, onsuccess); - }, onerror); - }; - - return { - fetch: fetch - }; - }; - - return { - create: create - }; - } -); -kernel.module.loader = def( - [ - kernel.module.analyser - ], - - function (analyser) { - var load = function (roots, deps, fetcher, oncontinue, onsuccess, onerror) { - var result = analyser.analyse(roots, deps); - - if (result.cycle) - onerror('Dependency error: a circular module dependency exists from ' + result.cycle.join(' ~> ')); - else if (result.load.length === 0) - onsuccess(); - else - fetcher.fetch(result.load, oncontinue); - }; - - return { - load: load - }; - } -); -kernel.module.manager = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.module.loader, - kernel.module.fetcher - ], - - function (ar, obj, loader, fetcher) { - var create = function (regulator, onerror) { - var blueprints = {}; // id -> { id: string, dependencies: [ string ], definition: function } - var modules = {}; // id -> module - - // Adds a module to the system. - var define = function (id, dependencies, definition) { - if (id === undefined) - onerror("Define error: module id can not be undefined"); - else if (blueprints[id] !== undefined) - onerror("Define error: module '" + id + "' is already defined"); - else - blueprints[id] = { id: id, dependencies: dependencies, definition: definition }; - }; - - // Loads a set of modules asynchronously. - var require = function (ids, callback) { - var onsuccess = function () { - var instances = ar.map(ids, demand); - callback.apply(null, instances); - }; - - var oncontinue = function () { - var deps = obj.map(blueprints, function (k, v) { - return v.dependencies; - }); - loader.load(ids, deps, fetch, oncontinue, onsuccess, onerror); - }; - - oncontinue(); - }; - - // Instantiates a module and all of its dependencies. - var demand = function (id) { - if (modules[id] !== undefined) - return modules[id]; - if (blueprints[id] === undefined) - throw "module '" + id + "' is not defined"; - var result = instantiate(id); - if (result === undefined) - throw "module '" + id + "' returned undefined from definition function"; - modules[id] = result; - return result; - }; - - var instantiate = function (id) { - var blueprint = blueprints[id]; - var args = ar.map(blueprint.dependencies, demand); // Instantiate dependencies - return blueprint.definition.apply(null, args); // Instantiate self - }; - - var validator = function (id) { return blueprints[id] !== undefined; }; - var fetch = fetcher.create(regulator, validator, onerror, define, require, demand); - - return { - define: define, - require: require, - demand: demand - }; - }; - - return { - create: create - }; - } -); -kernel.api.sources = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.modulator.globalator - ], - - function (ar, obj, globalator) { - var create = function (builtins, configuration) { - var data = { - 'global': { instance: globalator } - }; - obj.each(builtins, function (key, value) { - data[key] = { instance: value }; - }); - ar.each(configuration.types, function (spec) { - data[spec.type] = { id: spec.modulator }; - }); - var sourcespecs = configuration.sources.slice(0); - var sources = [ globalator.create() ]; - - var guard = function (type) { - if (data[type] === undefined) - throw 'Unknown modulator type [' + type + '].'; - }; - - var isResolved = function (type) { - guard(type); - return data[type].instance !== undefined; - }; - - var idOf = function (type) { - guard(type); - return data[type].id; - }; - - var instanceOf = function (type) { - guard(type); - return data[type].instance; - }; - - var register = function (type, instance) { - guard(type); - data[type].instance = instance; - }; - - var find = function (id) { - for (var i = 0; i < sources.length; ++i) - if (sources[i].can(id)) - return { found: sources[i] }; - return { notfound: true }; - }; - - var crank = function () { - var left = []; - ar.each(sourcespecs, function (spec) { - if (isResolved(spec.type)) { - var instance = instanceOf(spec.type); - var source = instance.create.apply(null, spec.args); - sources.push(source); - } else - left.push(spec); - }); - sourcespecs = left; - }; - - return { - isResolved: isResolved, - idOf: idOf, - instanceOf: instanceOf, - register: register, - find: find, - crank: crank - }; - }; - - return { - create: create - }; - } -); -kernel.api.regulator = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function (sources) { - /* - * 1. Resolve configuration as much as possible - * 2. Check for unresolved modulator types that are required to continue. - * a) Go ahead and resolve, if we have everything we need. - * b) Delay, requiring the modulators, then retry. - */ - var regulate = function (ids, define, require, demand, onsuccess, onerror) { - sources.crank(); - var required = ar.map(ids, determinetype); - var unresolved = ar.filter(required, fn.not(sources.isResolved)); - if (unresolved.length === 0) - resolve(ids, define, require, demand, onsuccess, onerror); - else - delay(unresolved, ids, define, require, demand, onsuccess, onerror); - }; - - var resolve = function (ids, define, require, demand, onsuccess, onerror) { - var r = []; - for (var i = 0; i < ids.length; ++i) { - var id = ids[i]; - var source = sources.find(id); - if (source.notfound) { - onerror('Could not find source for module [' + id + ']'); - return; - } - var spec = source.found.get(id, define, require, demand); - r[i] = build(id, spec); - } - onsuccess(r); - }; - - var build = function (id, spec) { - return { - id: id, - url: spec.url, - load: spec.load, - serial: spec.serial - }; - }; - - var delay = function (types, ids, define, require, demand, onsuccess, onerror) { - var modulatorids = ar.map(types, sources.idOf); - require(modulatorids, function (/* modulators */) { - var modulators = arguments; - ar.each(types, function (type, i) { - sources.register(type, modulators[i]); - }); - regulate(ids, define, require, demand, onsuccess, onerror); - }); - }; - - var determinetype = function (id) { - var index = id.indexOf('!'); - return index === -1 ? 'bolt' : id.substring(0, index); - }; - - return { - regulate: regulate - }; - }; - - return { - create: create - }; - } -); -kernel.api.config = def( - [ - kernel.module.manager, - kernel.api.regulator, - kernel.api.sources - ], - - function (manager, regulator, sources) { - var configure = function (configuration, builtins, onerror) { - var s = sources.create(builtins, configuration); - var r = regulator.create(s); - var engine = manager.create(r, onerror); - - return { - define: engine.define, - require: engine.require, - demand: engine.demand - }; - }; - - return { - configure: configure - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var loader = bolt.loader = bolt.loader || {}; -loader.executor = loader.executor || {}; -loader.api = loader.api || {}; -loader.transporter = loader.transporter || {}; -loader.tag = loader.tag || {}; -loader.tag.script = def( - [ - ], - - function () { - var guard = function (callback) { - return function (evt) { - if (evt.srcElement.readyState === "loaded" || evt.srcElement.readyState === "complete") - callback(); - }; - }; - - var ie = function (el) { - return el.attachEvent && !window.opera; - }; - - var onload = function (el, callback) { - if (ie(el)) - el.attachEvent("onreadystatechange", guard(callback)); - else - el.addEventListener("load", callback, false); - }; - - var createtag = function (callback) { - var el = document.createElement("script"); - el.type = "text/javascript"; - onload(el, callback); - return el; - }; - - var insert = function (decorator, callback) { - var el = createtag(callback); - decorator(el); - var head = document.getElementsByTagName("head")[0]; - head.appendChild(el); - }; - - return { - insert: insert - }; - } -); -loader.transporter.commonjs = def( - [ - ], - - function () { - var read = function (url, success, error) { - var fs = require('fs'); - fs.exists(url, function (exists) { - if (exists) - fs.readFile(url, 'UTF-8', function (err, data) { - if (err) - error('Error reading file [' + url + '], error [' + err + ']'); - else - success(data); - }); - else - error('File does not exist [' + url + ']'); - }); - }; - - return { - read: read - }; - } -); -loader.transporter.xhr = def( - [ - ], - - function () { - var requestObject = function () { - // Correct way to use XMLHttpRequest in IE: - // http://blogs.msdn.com/b/ie/archive/2006/01/23/516393.aspx - var factories = [ - function () { return new XMLHttpRequest() }, - function () { return new ActiveXObject("Microsoft.XMLHTTP") } - ]; - - return fallback(factories); - }; - - var fallback = function (items) { - for (var i = 0; i < items.length; ++i) { - try { - return items[i](); - } catch (e) { - } - } - }; - - var handler = function (req, url, success, error) { - return function () { - if (req.readyState === 4) - done(req, url, success, error); - }; - }; - - var done = function (req, url, success, error) { - if (req.status === 200 || req.status === 304) - success(req.responseText); - else - error('Transport error: ' + req.status + ' ' + req.statusText + ' for resource: "' + url + '"'); - }; - - var getUrl = function (req, url, success, error) { - req.open('GET', url, true); - req.onreadystatechange = handler(req, url, success, error); - req.send(); - }; - - var request = function (url, success, error) { - var req = requestObject(); - if (req) - getUrl(req, url, success, error); - else - error('Transport error: browser does not support XMLHttpRequest.'); - }; - - return { - request: request - }; - } -); -loader.executor.evaller = def( - [ - ], - - function () { - var execute = function (data, onsuccess, onfailure) { - try { - eval(data); - } catch(e) { - onfailure(e); - return; - } - - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.executor.injector = def( - [ - loader.tag.script - ], - - function (script) { - var execute = function (data, onsuccess, onfailure) { - var inject = function (tag) { - tag.text = data; - }; - - var noop = function () {}; - - // Injection does not fire events, but execution happens synchronously, - // so we just make an explicit callback - script.insert(inject, noop); - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.api.commonjsevaller = def( - [ - loader.transporter.commonjs, - loader.executor.evaller - ], - - function (commonjs, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - commonjs.read(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.scripttag = def( - [ - loader.tag.script - ], - - function (script) { - var load = function (url, onsuccess, onfailure) { - var sourcer = function (tag) { - tag.src = url; - }; - - script.insert(sourcer, onsuccess); - }; - - return { - load: load - }; - } -); -loader.api.xhrevaller = def( - [ - loader.transporter.xhr, - loader.executor.evaller - ], - - function (xhr, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.xhrinjector = def( - [ - loader.transporter.xhr, - loader.executor.injector - ], - - function (xhr, injector) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - injector.execute(data, onsuccess); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var module = bolt.module = bolt.module || {}; -module.bootstrap = module.bootstrap || {}; -module.config = module.config || {}; -module.error = module.error || {}; -module.modulator = module.modulator || {}; -module.reader = module.reader || {}; -module.runtime = module.runtime || {}; -module.util = module.util || {}; -module.error.error = def( - [ - ], - - function () { - var die = function (msg) { - throw msg || new Error('unknown error'); - }; - - return { - die: die - }; - } -); -module.config.mapper = def( - [ - ], - - function () { - var flat = function (id) { - return id; - }; - - var hierarchical = function (id) { - return id.replace(/\./g, '/'); - }; - - var constant = function (name) { - return function () { - return name; - }; - }; - - return { - flat: flat, - hierarchical: hierarchical, - constant: constant - }; - } -); -module.api = def( - [ - module.runtime - ], - - function (runtime) { - var delegate = function (method) { - return function () { - return runtime[method].apply(null, arguments); - }; - }; - - return { - define: delegate('define'), - require: delegate('require'), - demand: delegate('demand'), - main: delegate('main'), - load: delegate('load'), - loadscript: delegate('loadscript') - }; - } -); -module.util.path = def( - [ - ], - - function () { - var dirname = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(0, end); - }; - - var basename = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(end + 1); - }; - - return { - basename: basename, - dirname: dirname - }; - } -); -module.util.locator = def( - [ - ], - - function () { - var browser = function () { - var scripts = document.getElementsByTagName("script"); - return scripts[scripts.length - 1].src; - }; - - var runtime = module.runtime.locate; - - var locate = function () { - var f = runtime || browser; - return f(); - }; - - return { - locate: locate - }; - } -); -module.util.pather = def( - [ - module.util.path - ], - - function (path) { - var create = function (relativeto) { - var base = path.dirname(relativeto); - return function (path) { - return base + '/' + path; - }; - }; - - return { - create: create - }; - } -);module.modulator.modulators = def( - [ - ephox.bolt.kernel.fp.functions, - ephox.bolt.kernel.modulator.bolt, - ephox.bolt.loader.api.commonjsevaller, - ephox.bolt.loader.api.scripttag, - ephox.bolt.loader.api.xhrevaller, - ephox.bolt.loader.api.xhrinjector - ], - - function (fn, bolt, commonjsevaller, scripttag, xhrevaller, xhrinjector) { - var wrap = function (modulator, loader) { - var create = fn.curry(modulator.create, loader); - - return { - create: create - } - }; - - return { - boltcommonjs: wrap(bolt, commonjsevaller), - boltscripttag: wrap(bolt, scripttag), - boltxhreval: wrap(bolt, xhrevaller), - boltxhrinjector: wrap(bolt, xhrinjector) - }; - } -); -module.config.builtins = def( - [ - ephox.bolt.module.modulator.modulators.boltscripttag, - ephox.bolt.module.modulator.modulators.boltcommonjs - ], - - function (boltscripttag, boltcommonjs) { - return { - // TODO: 'amd' is maintained for backwards compatibility, will be removed - // at some point. - browser: { bolt: boltscripttag, amd: boltscripttag }, - commonjs: { bolt: boltcommonjs, amd: boltcommonjs } - }; - } -); -module.config.specs = def( - [ - module.util.pather - ], - - function (pather) { - var type = function (type, implementation) { - return { - type: type, - implementation: implementation, - modulator: implementation + '.Modulator', - compiler: implementation + '.Compiler' - }; - }; - - var source = function (relativeto) { - return function (type /*, args */) { - return { - type: type, - relativeto: relativeto, - args: [ pather.create(relativeto) ].concat(Array.prototype.slice.call(arguments, 1)) - }; - } - }; - - return { - type: type, - source: source - }; - } -); -module.reader.bouncing = def( - [ - ephox.bolt.kernel.fp.array, - module.error.error, - module.config.specs - ], - - function (ar, error, specs) { - var bounce = function (done, read, acc) { - var next = acc.configs.shift(); - read(next.relativeto, next.config, done, acc); - }; - - var tick = function (file, cfg, done, read, acc) { - var munged = ar.map(cfg.configs || [], function (config) { - return { relativeto: file, config: config }; - }); - var accumulated = { - sources: acc.sources.concat(cfg.sources || []), - types: acc.types.concat(cfg.types || []), - configs: munged.concat(acc.configs) - }; - if (accumulated.configs.length > 0) - bounce(done, read, accumulated); - else - done({ sources: accumulated.sources, types: accumulated.types }); - }; - - /* - * All precedence is depth-first, pre-order. Example: - * - * A - * /-\ - * B C - * /| |\ - * D E F G - * - * Configs are read in A, B, D, E, C, F, G. - * - * If configs mixed delegation and sources, the - * sources would be ordered the same: A, B, D, E, C, F, G. - */ - - var evaluate = function (file, payload, done, read, acc) { - var result = {}; - /* eval scope */ - var mapper = module.config.mapper; - var type = specs.type; - var source = specs.source(file); - var configure = function (configuration) { - result = configuration; - }; - try { - eval(payload); - } catch (e) { - throw 'Could not load configuration [' + file + '], with: ' + e; - } - tick(file, result, done, read, acc); - }; - - return { - evaluate: evaluate - }; - } -); -module.reader.browser = def( - [ - module.error.error, - module.reader.bouncing, - module.util.path, - ephox.bolt.loader.transporter.xhr - ], - - function (error, bouncing, path, xhr) { - var read = function (relativeto, file, done, acc) { - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = base + '/' + file; - xhr.request(absolute, function (payload) { - bouncing.evaluate(absolute, payload, done, read, accumulated); - }, error.die); - }; - - return { - read: read - }; - } -); -module.reader.node = def( - [ - module.reader.bouncing - ], - - function (bouncing, path, fs) { - var read = function (relativeto, file, done, acc) { - var fs = require('fs'); - var path = require('path'); - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = path.resolve(base, file); - var payload = fs.readFileSync(absolute, 'UTF-8'); - bouncing.evaluate(absolute, payload, done, read, accumulated); - }; - - return { - read: read - }; - } -); -module.reader.direct = def( - [ - ], - - function () { - var create = function (configuration) { - return function (done) { - done({ - sources: configuration.sources || [], - types: configuration.types || [], - configs: configuration.configs || [] - }); - }; - }; - - return { - create: create - }; - } -); -module.bootstrap.configloader = def( - [ - module.util.locator, - module.reader.browser - ], - - function (locator, browser) { - var create = function (file) { - var script = locator.locate(); - return function (done) { - browser.read(script, file, done); - }; - }; - - return { - create: create - }; - } -);module.bootstrap.deferred = def( - [ - ephox.bolt.kernel.fp.array - ], - - function (ar) { - var deferred = []; - - var require = function (ids, fn) { - var r = function (real) { - real(ids, fn); - }; - deferred.push(r); - }; - - var configured = function (require) { - ar.each(deferred, function (action) { - action(require); - }); - deferred = []; - }; - - return { - require: require, - configured: configured - }; - } -); -module.bootstrap.main = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.runtime - ], - - function (config, deferred, runtime) { - var main = function (id, args, configids, callback) { - runtime.require(configids || [], function () { - callback && callback.apply(null, arguments); - runtime.require([ id ], function (module) { - module.apply(null, args || []); - }); - }); - }; - - return { - main: main - }; - } -); -module.bootstrap.install = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.bootstrap.main, - module.runtime, - module.error.error - ], - - function (config, deferred, main, runtime, error) { - var notready = function () { throw 'bolt not initialised, can not call define or demand, did you mean to use require or main?'; }; - - var install = function (reader, builtins, load, loadscript) { - runtime.define = notready; - runtime.demand = notready; - runtime.require = deferred.require; - runtime.main = main.main; - runtime.load = load; - runtime.loadscript = loadscript; - - reader(function (configuration) { - var bolt = config.configure(configuration, builtins, error.die); - runtime.define = bolt.define; - runtime.require = bolt.require; - runtime.demand = bolt.demand; - - deferred.configured(runtime.require); - }); - }; - - return { - install: install - }; - } -); - -})(Function('return this')()); -(function (global) { - var obj = ephox.bolt.kernel.fp.object; - var api = ephox.bolt.module.api; - var builtins = ephox.bolt.module.config.builtins.browser; - var install = ephox.bolt.module.bootstrap.install; - var reader = ephox.bolt.module.bootstrap.configloader.create("prod.js"); - var transport = ephox.bolt.loader.transporter.xhr.request; - var script = ephox.bolt.loader.api.scripttag.load; - install.install(reader, builtins, transport, script); - obj.merge(global, api); -})(Function("return this;")()); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/browser.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/browser.js deleted file mode 100644 index 6f437c5..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/browser.js +++ /dev/null @@ -1,10 +0,0 @@ -configure({ - configs: [ - './prod.js' - ], - sources: [ - source('amd', 'ephox/tinymce', '', mapper.constant('../../../../../tinymce')), - source('amd', 'ephox.mcagar', '../../lib/test', mapper.flat), - source('amd', 'ephox', '../../lib/test', mapper.flat) - ] -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/demo.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/demo.js deleted file mode 100644 index 385032c..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/demo.js +++ /dev/null @@ -1,8 +0,0 @@ -configure({ - configs: [ - './prod.js' - ], - sources: [ - source('amd', 'tinymce/inlite/Demo', '../../src/demo/js', mapper.hierarchical) - ] -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/prod.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/prod.js deleted file mode 100644 index a1ef542..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/bolt/prod.js +++ /dev/null @@ -1,5 +0,0 @@ -configure({ - sources: [ - source('amd', 'tinymce/inlite', '../../src/main/js', mapper.hierarchical) - ] -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/dent/depend.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/dent/depend.js deleted file mode 100644 index 9283c0a..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/config/dent/depend.js +++ /dev/null @@ -1,21 +0,0 @@ -var lib = 'lib'; -var run = lib + '/run'; -var depend = run + '/depend'; -var licenses = run + '/licenses'; -var demo = lib + '/demo'; -var test = lib + '/test'; -var config = lib + '/config'; - -var cleanDirs = [ lib ]; - -var dependencies = [ - { - name: 'mcagar', - repository: 'buildrepo2', - source: 'mcagar.zip', - targets: [ - { name: 'module/*.js', path: test }, - { name: 'depend/*.js', path: test } - ] - } -]; diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/bootstrap.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/bootstrap.js deleted file mode 100644 index 9e8c646..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/bootstrap.js +++ /dev/null @@ -1,1526 +0,0 @@ -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var kernel = bolt.kernel = bolt.kernel || {}; -kernel.api = kernel.api || {}; -kernel.async = kernel.api || {}; -kernel.fp = kernel.fp || {}; -kernel.modulator = kernel.modulator || {}; -kernel.module = kernel.module || {}; -kernel.fp.array = def( - [ - ], - - function () { - var equals = function (a1, a2) { - if (a1.length !== a2.length) - return false; - for (var i = 0; i < a1.length; ++i) - if (a1[i] !== a2[i]) - return false; - return true; - }; - - var forall = function (a, f) { - var fn = f || function (x) { - return x === true; - }; - for (var i = 0; i < a.length; ++i) - if (fn(a[i]) !== true) - return false; - return true; - }; - - var map = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - r.push(f(a[i], i)); - return r; - }; - - var flatten = function (a) { - var r = []; - for (var i = 0; i < a.length; ++i) - r = r.concat(a[i]); - return r; - }; - - var flatmap = function (a, f) { - return flatten(map(a, f)); - }; - - var filter = function (a, f) { - var r = []; - for (var i = 0; i < a.length; ++i) - if (f(a[i])) - r.push(a[i]); - return r; - }; - - var each = map; - - var contains = function (a, x) { - return !forall(a, function (v) { - return v !== x; - }); - }; - - var indexof = function (a, x) { - for (var i = 0; i < a.length; ++i) - if (a[i] === x) - return i; - return -1; - }; - - return { - equals: equals, - forall: forall, - map: map, - flatten: flatten, - flatmap: flatmap, - filter: filter, - each: each, - contains: contains, - indexof: indexof - }; - } -); -kernel.fp.object = def( - [ - ], - - function () { - var map = function (o, f) { - var r = {}; - for (var i in o) - if (o.hasOwnProperty(i)) - r[i] = f(i, o[i]); - return r; - }; - - var each = map; - - var merge = function (d, s) { - each(s, function (k, v) { - d[k] = v; - }); - }; - - var keys = function (o) { - var r = []; - each(o, function (k) { - r.push(k); - }); - return r; - }; - - return { - each: each, - keys: keys, - map: map, - merge: merge - }; - } -); -kernel.fp.functions = def( - [ - ], - - function () { - var curry = function (f) { - var slice = Array.prototype.slice; - var args = slice.call(arguments, 1); - return function () { - var all = args.concat(slice.call(arguments, 0)); - return f.apply(null, all); - }; - }; - - var not = function (z) { - return function () { - var slice = Array.prototype.slice; - return !z.apply(null, slice.call(arguments, 0)); - }; - }; - - var apply = function (f) { - var slice = Array.prototype.slice; - return f.apply(null, slice.call(arguments, 0)); - }; - - return { - curry: curry, - not: not, - apply: apply - }; - } -);kernel.async.map = def( - [ - kernel.fp.array - ], - - function (ar) { - var amap = function (data, f, oncomplete) { - var total = data.length; - var count = 0; - var results = []; - - ar.each(data, function (datum, i) { - f(datum, function (result) { - ++count; - results[i] = result; - if (count === total) - oncomplete(results); - }); - }); - }; - - return { - amap: amap - }; - } -); -/** - * This module has a dual responsibility: - * 1. Ensures that asynchronous function calls, 'f', that share the same - * 'key' are not executed in parallel. - * 2. In the case where an attempt to call in parallel is prevented, - * the 'action' callbacks are executed when the asynchronous call is - * completed. - * - * Example: - * When we async-map to remotely fetch module definition, it is - * important that only a single define is evaluated, but the - * notification that the definition has completed is propagated - * to all interested parties. - * - * 1. we require dependencies 'x' and 'y' - * - * 2. both x and y are defined in the same file (i.e. compiled together), 'a.js'. - * - * 3. we resolve x and y, to their load spec using a modulator - * x_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * y_spec = {load: function () { -- load a.js -- }, url: a.js, serial: false}; - * - * 4. we make the piggyback call for x: - * piggybacker.piggyback(x_spec.url, x_spec.load, xdone); - * - * this will register the 'xdone' action, and actually - * trigger the load call, with a synthetic callback - * responsible for triggering all registered actions. - * - * 5. we make the piggyback call for y: - * piggybacker.piggyback(y_spec.url, y_spec.load, ydone); - * - * this will register the 'ydone' action, but NOT trigger - * the load call. - * - * 6. the load call completes, and calls the synthetic callback, - * which is responsible for triggering both 'xdone' and 'ydone'. - * - * 7. something else happens that means we have to load 'a.js' again, - * the piggybacker DOES NOT prevent this call, and will follow - * the above process. - */ -kernel.async.piggybacker = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function () { - var queue = {}; // key -> [actions] - - var process = function (key) { - var actions = queue[key]; - delete queue[key]; - ar.each(actions, fn.apply); - }; - - var piggyback = function (key, f, action) { - if (queue[key] === undefined) { - queue[key] = [ action ]; - f(fn.curry(process, key)); - } else { - queue[key].push(action); - } - }; - - return { - piggyback: piggyback - }; - }; - - return { - create: create - }; - } -); -kernel.modulator.globalator = def( - [ - ], - - function () { - var create = function () { - // FIX pull out - var resolve = function (name, scope) { - var parts = name.split('.'); - var r = scope; - for (var i = 0; i < parts.length && r !== undefined; ++i) - r = r[parts[i]]; - return r; - }; - - var global = Function('return this')(); - - var can = function (id) { - return id.indexOf('global!') === 0; - }; - - var get = function (id, define, require) { - var name = id.substring('global!'.length); - - var load = function (onsuccess, onfailure) { - var instance = resolve(name, global); - if (instance !== undefined) { - define(id, [], function () { return instance; }); - onsuccess(); - } else { - onfailure('Modulator error: could not resolve global [' + name + ']'); - } - }; - - return { - url: id, // this just needs to be unique, no download required. - load: load, - serial: true - }; - }; - - return { - can: can, - get: get - } - }; - return { - create: create - }; - } -); -kernel.modulator.bolt = def( - [ - kernel.fp.functions - ], - - function (fn) { - var create = function (loader, pather, namespace, path, idTransformer, options) { - var can = function (id) { - return id === namespace || id.indexOf(namespace + '.') === 0 || id.indexOf(namespace + '/') === 0; - }; - - var get = function (id) { - var before = options !== undefined && options.absolute === true ? path : pather(path); - var after = options !== undefined && options.fresh === true ? '?cachebuster=' + new Date().getTime() : ''; - var url = before + "/" + idTransformer(id) + '.js' + after; - var load = fn.curry(loader.load, url); - - return { - url: url, - load: load, - serial: false - }; - }; - - return { - can: can, - get: get - }; - }; - - return { - create: create - }; - } -);kernel.module.stratifier = def( - [ - kernel.fp.array - ], - - function (ar) { - var stratify = function (specs) { - var parallels = ar.filter(specs, function (spec) { - return !spec.serial; - }); - return parallels.length > 0 ? parallels : specs.slice(0, 1); - }; - - return { - stratify: stratify - }; - } -); -/** - * This module performs dependency analysis of strings that depend on sets of - * strings. - * - * The input is an array of root strings to start analysis from, and an object - * that contains a mapping of each string to the strings it depends on. - * - * Performing an analysis results in either: - * 1. an empty array, indicating that all dependencies are satisfied, - * 2. an array of strings that are, at the minimum, still needed in order to - * satisfy the given dependency trees, or - * 3. an array of strings that form a dependency cycle. - */ -kernel.module.analyser = def( - [ - kernel.fp.array - ], - - function (array) { - var collect = function (path, name) { - var i = array.indexof(path, name); - var p = path.slice(i); - return p.concat([name]); - }; - - /** - * @param {array} roots Contains a list of root ids - * @param {object} modules Contains dependency information in format: { id: [ 'id1', 'id2' ] } - */ - var analyse = function (roots, modules) { - var done = {}; - var path = []; - var missing = []; - var cycle; - - var children = function (name) { - array.each(modules[name], attempt); - }; - - var examine = function (name) { - if (modules[name]) - children(name); - else - missing.push(name); - }; - - var descend = function (name) { - path.push(name); - examine(name); - path.pop(); - }; - - var decycle = function (name) { - if (array.contains(path, name)) - cycle = collect(path, name); - else - descend(name); - }; - - var attempt = function (name) { - if (!done[name]) { - decycle(name); - done[name] = true; - } - }; - - array.each(roots, attempt); - - return cycle ? { cycle: cycle } : { load: missing }; - }; - - return { - analyse: analyse - }; - } -); -kernel.module.fetcher = def( - [ - kernel.fp.array, - kernel.fp.functions, - kernel.async.map, - kernel.async.piggybacker, - kernel.module.stratifier - ], - - function (ar, fn, map, piggybacker, stratifier) { - var create = function (regulator, validator, onerror, define, require, demand) { - var piggyback = piggybacker.create(); - - var validate = function (onsuccess, results) { - var failed = ar.filter(results, fn.not(validator)); - if (failed.length > 0) - onerror('Fetcher error: modules were not defined: ' + failed.join(', ')); - else - onsuccess(); - }; - - var mapper = function (spec, onresult) { - var action = fn.curry(onresult, spec.id); - var load = function (callback) { - spec.load(callback, onerror); - }; - piggyback.piggyback(spec.url, load, action); - }; - - var asyncfetch = function (specs, onsuccess) { - var oncomplete = fn.curry(validate, onsuccess); - var strata = stratifier.stratify(specs); - map.amap(strata, mapper, oncomplete); - }; - - var fetch = function (ids, onsuccess) { - regulator.regulate(ids, define, require, demand, function (specs) { - asyncfetch(specs, onsuccess); - }, onerror); - }; - - return { - fetch: fetch - }; - }; - - return { - create: create - }; - } -); -kernel.module.loader = def( - [ - kernel.module.analyser - ], - - function (analyser) { - var load = function (roots, deps, fetcher, oncontinue, onsuccess, onerror) { - var result = analyser.analyse(roots, deps); - - if (result.cycle) - onerror('Dependency error: a circular module dependency exists from ' + result.cycle.join(' ~> ')); - else if (result.load.length === 0) - onsuccess(); - else - fetcher.fetch(result.load, oncontinue); - }; - - return { - load: load - }; - } -); -kernel.module.manager = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.module.loader, - kernel.module.fetcher - ], - - function (ar, obj, loader, fetcher) { - var create = function (regulator, onerror) { - var blueprints = {}; // id -> { id: string, dependencies: [ string ], definition: function } - var modules = {}; // id -> module - - // Adds a module to the system. - var define = function (id, dependencies, definition) { - if (id === undefined) - onerror("Define error: module id can not be undefined"); - else if (blueprints[id] !== undefined) - onerror("Define error: module '" + id + "' is already defined"); - else - blueprints[id] = { id: id, dependencies: dependencies, definition: definition }; - }; - - // Loads a set of modules asynchronously. - var require = function (ids, callback) { - var onsuccess = function () { - var instances = ar.map(ids, demand); - callback.apply(null, instances); - }; - - var oncontinue = function () { - var deps = obj.map(blueprints, function (k, v) { - return v.dependencies; - }); - loader.load(ids, deps, fetch, oncontinue, onsuccess, onerror); - }; - - oncontinue(); - }; - - // Instantiates a module and all of its dependencies. - var demand = function (id) { - if (modules[id] !== undefined) - return modules[id]; - if (blueprints[id] === undefined) - throw "module '" + id + "' is not defined"; - var result = instantiate(id); - if (result === undefined) - throw "module '" + id + "' returned undefined from definition function"; - modules[id] = result; - return result; - }; - - var instantiate = function (id) { - var blueprint = blueprints[id]; - var args = ar.map(blueprint.dependencies, demand); // Instantiate dependencies - return blueprint.definition.apply(null, args); // Instantiate self - }; - - var validator = function (id) { return blueprints[id] !== undefined; }; - var fetch = fetcher.create(regulator, validator, onerror, define, require, demand); - - return { - define: define, - require: require, - demand: demand - }; - }; - - return { - create: create - }; - } -); -kernel.api.sources = def( - [ - kernel.fp.array, - kernel.fp.object, - kernel.modulator.globalator - ], - - function (ar, obj, globalator) { - var create = function (builtins, configuration) { - var data = { - 'global': { instance: globalator } - }; - obj.each(builtins, function (key, value) { - data[key] = { instance: value }; - }); - ar.each(configuration.types, function (spec) { - data[spec.type] = { id: spec.modulator }; - }); - var sourcespecs = configuration.sources.slice(0); - var sources = [ globalator.create() ]; - - var guard = function (type) { - if (data[type] === undefined) - throw 'Unknown modulator type [' + type + '].'; - }; - - var isResolved = function (type) { - guard(type); - return data[type].instance !== undefined; - }; - - var idOf = function (type) { - guard(type); - return data[type].id; - }; - - var instanceOf = function (type) { - guard(type); - return data[type].instance; - }; - - var register = function (type, instance) { - guard(type); - data[type].instance = instance; - }; - - var find = function (id) { - for (var i = 0; i < sources.length; ++i) - if (sources[i].can(id)) - return { found: sources[i] }; - return { notfound: true }; - }; - - var crank = function () { - var left = []; - ar.each(sourcespecs, function (spec) { - if (isResolved(spec.type)) { - var instance = instanceOf(spec.type); - var source = instance.create.apply(null, spec.args); - sources.push(source); - } else - left.push(spec); - }); - sourcespecs = left; - }; - - return { - isResolved: isResolved, - idOf: idOf, - instanceOf: instanceOf, - register: register, - find: find, - crank: crank - }; - }; - - return { - create: create - }; - } -); -kernel.api.regulator = def( - [ - kernel.fp.array, - kernel.fp.functions - ], - - function (ar, fn) { - var create = function (sources) { - /* - * 1. Resolve configuration as much as possible - * 2. Check for unresolved modulator types that are required to continue. - * a) Go ahead and resolve, if we have everything we need. - * b) Delay, requiring the modulators, then retry. - */ - var regulate = function (ids, define, require, demand, onsuccess, onerror) { - sources.crank(); - var required = ar.map(ids, determinetype); - var unresolved = ar.filter(required, fn.not(sources.isResolved)); - if (unresolved.length === 0) - resolve(ids, define, require, demand, onsuccess, onerror); - else - delay(unresolved, ids, define, require, demand, onsuccess, onerror); - }; - - var resolve = function (ids, define, require, demand, onsuccess, onerror) { - var r = []; - for (var i = 0; i < ids.length; ++i) { - var id = ids[i]; - var source = sources.find(id); - if (source.notfound) { - onerror('Could not find source for module [' + id + ']'); - return; - } - var spec = source.found.get(id, define, require, demand); - r[i] = build(id, spec); - } - onsuccess(r); - }; - - var build = function (id, spec) { - return { - id: id, - url: spec.url, - load: spec.load, - serial: spec.serial - }; - }; - - var delay = function (types, ids, define, require, demand, onsuccess, onerror) { - var modulatorids = ar.map(types, sources.idOf); - require(modulatorids, function (/* modulators */) { - var modulators = arguments; - ar.each(types, function (type, i) { - sources.register(type, modulators[i]); - }); - regulate(ids, define, require, demand, onsuccess, onerror); - }); - }; - - var determinetype = function (id) { - var index = id.indexOf('!'); - return index === -1 ? 'bolt' : id.substring(0, index); - }; - - return { - regulate: regulate - }; - }; - - return { - create: create - }; - } -); -kernel.api.config = def( - [ - kernel.module.manager, - kernel.api.regulator, - kernel.api.sources - ], - - function (manager, regulator, sources) { - var configure = function (configuration, builtins, onerror) { - var s = sources.create(builtins, configuration); - var r = regulator.create(s); - var engine = manager.create(r, onerror); - - return { - define: engine.define, - require: engine.require, - demand: engine.demand - }; - }; - - return { - configure: configure - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var loader = bolt.loader = bolt.loader || {}; -loader.executor = loader.executor || {}; -loader.api = loader.api || {}; -loader.transporter = loader.transporter || {}; -loader.tag = loader.tag || {}; -loader.tag.script = def( - [ - ], - - function () { - var guard = function (callback) { - return function (evt) { - if (evt.srcElement.readyState === "loaded" || evt.srcElement.readyState === "complete") - callback(); - }; - }; - - var ie = function (el) { - return el.attachEvent && !window.opera; - }; - - var onload = function (el, callback) { - if (ie(el)) - el.attachEvent("onreadystatechange", guard(callback)); - else - el.addEventListener("load", callback, false); - }; - - var createtag = function (callback) { - var el = document.createElement("script"); - el.type = "text/javascript"; - onload(el, callback); - return el; - }; - - var insert = function (decorator, callback) { - var el = createtag(callback); - decorator(el); - var head = document.getElementsByTagName("head")[0]; - head.appendChild(el); - }; - - return { - insert: insert - }; - } -); -loader.transporter.commonjs = def( - [ - ], - - function () { - var read = function (url, success, error) { - var fs = require('fs'); - fs.exists(url, function (exists) { - if (exists) - fs.readFile(url, 'UTF-8', function (err, data) { - if (err) - error('Error reading file [' + url + '], error [' + err + ']'); - else - success(data); - }); - else - error('File does not exist [' + url + ']'); - }); - }; - - return { - read: read - }; - } -); -loader.transporter.xhr = def( - [ - ], - - function () { - var requestObject = function () { - // Correct way to use XMLHttpRequest in IE: - // http://blogs.msdn.com/b/ie/archive/2006/01/23/516393.aspx - var factories = [ - function () { return new XMLHttpRequest() }, - function () { return new ActiveXObject("Microsoft.XMLHTTP") } - ]; - - return fallback(factories); - }; - - var fallback = function (items) { - for (var i = 0; i < items.length; ++i) { - try { - return items[i](); - } catch (e) { - } - } - }; - - var handler = function (req, url, success, error) { - return function () { - if (req.readyState === 4) - done(req, url, success, error); - }; - }; - - var done = function (req, url, success, error) { - if (req.status === 200 || req.status === 304) - success(req.responseText); - else - error('Transport error: ' + req.status + ' ' + req.statusText + ' for resource: "' + url + '"'); - }; - - var getUrl = function (req, url, success, error) { - req.open('GET', url, true); - req.onreadystatechange = handler(req, url, success, error); - req.send(); - }; - - var request = function (url, success, error) { - var req = requestObject(); - if (req) - getUrl(req, url, success, error); - else - error('Transport error: browser does not support XMLHttpRequest.'); - }; - - return { - request: request - }; - } -); -loader.executor.evaller = def( - [ - ], - - function () { - var execute = function (data, onsuccess, onfailure) { - try { - eval(data); - } catch(e) { - onfailure(e); - return; - } - - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.executor.injector = def( - [ - loader.tag.script - ], - - function (script) { - var execute = function (data, onsuccess, onfailure) { - var inject = function (tag) { - tag.text = data; - }; - - var noop = function () {}; - - // Injection does not fire events, but execution happens synchronously, - // so we just make an explicit callback - script.insert(inject, noop); - onsuccess(); - }; - - return { - execute: execute - }; - } -); -loader.api.commonjsevaller = def( - [ - loader.transporter.commonjs, - loader.executor.evaller - ], - - function (commonjs, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - commonjs.read(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.scripttag = def( - [ - loader.tag.script - ], - - function (script) { - var load = function (url, onsuccess, onfailure) { - var sourcer = function (tag) { - tag.src = url; - }; - - script.insert(sourcer, onsuccess); - }; - - return { - load: load - }; - } -); -loader.api.xhrevaller = def( - [ - loader.transporter.xhr, - loader.executor.evaller - ], - - function (xhr, evaller) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - evaller.execute(data, onsuccess, onfailure); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -loader.api.xhrinjector = def( - [ - loader.transporter.xhr, - loader.executor.injector - ], - - function (xhr, injector) { - var load = function (url, onsuccess, onfailure) { - var inject = function (data) { - injector.execute(data, onsuccess); - }; - - xhr.request(url, inject, onfailure); - }; - - return { - load: load - }; - } -); -})(Function('return this')()); - -(function (scope) { -var ephox = scope.ephox = scope.ephox || {}; -var bolt = ephox.bolt = ephox.bolt || {}; - -var def = function (deps, factory) { - return factory.apply(null, deps); -}; -var module = bolt.module = bolt.module || {}; -module.bootstrap = module.bootstrap || {}; -module.config = module.config || {}; -module.error = module.error || {}; -module.modulator = module.modulator || {}; -module.reader = module.reader || {}; -module.runtime = module.runtime || {}; -module.util = module.util || {}; -module.error.error = def( - [ - ], - - function () { - var die = function (msg) { - throw msg || new Error('unknown error'); - }; - - return { - die: die - }; - } -); -module.config.mapper = def( - [ - ], - - function () { - var flat = function (id) { - return id; - }; - - var hierarchical = function (id) { - return id.replace(/\./g, '/'); - }; - - var constant = function (name) { - return function () { - return name; - }; - }; - - return { - flat: flat, - hierarchical: hierarchical, - constant: constant - }; - } -); -module.api = def( - [ - module.runtime - ], - - function (runtime) { - var delegate = function (method) { - return function () { - return runtime[method].apply(null, arguments); - }; - }; - - return { - define: delegate('define'), - require: delegate('require'), - demand: delegate('demand'), - main: delegate('main'), - load: delegate('load'), - loadscript: delegate('loadscript') - }; - } -); -module.util.path = def( - [ - ], - - function () { - var dirname = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(0, end); - }; - - var basename = function (file) { - var normalized = file.replace(/\\/g, '/'); - var end = normalized.lastIndexOf('/'); - return normalized.substring(end + 1); - }; - - return { - basename: basename, - dirname: dirname - }; - } -); -module.util.locator = def( - [ - ], - - function () { - var browser = function () { - var scripts = document.getElementsByTagName("script"); - return scripts[scripts.length - 1].src; - }; - - var runtime = module.runtime.locate; - - var locate = function () { - var f = runtime || browser; - return f(); - }; - - return { - locate: locate - }; - } -); -module.util.pather = def( - [ - module.util.path - ], - - function (path) { - var create = function (relativeto) { - var base = path.dirname(relativeto); - return function (path) { - return base + '/' + path; - }; - }; - - return { - create: create - }; - } -);module.modulator.modulators = def( - [ - ephox.bolt.kernel.fp.functions, - ephox.bolt.kernel.modulator.bolt, - ephox.bolt.loader.api.commonjsevaller, - ephox.bolt.loader.api.scripttag, - ephox.bolt.loader.api.xhrevaller, - ephox.bolt.loader.api.xhrinjector - ], - - function (fn, bolt, commonjsevaller, scripttag, xhrevaller, xhrinjector) { - var wrap = function (modulator, loader) { - var create = fn.curry(modulator.create, loader); - - return { - create: create - } - }; - - return { - boltcommonjs: wrap(bolt, commonjsevaller), - boltscripttag: wrap(bolt, scripttag), - boltxhreval: wrap(bolt, xhrevaller), - boltxhrinjector: wrap(bolt, xhrinjector) - }; - } -); -module.config.builtins = def( - [ - ephox.bolt.module.modulator.modulators.boltscripttag, - ephox.bolt.module.modulator.modulators.boltcommonjs - ], - - function (boltscripttag, boltcommonjs) { - return { - // TODO: 'amd' is maintained for backwards compatibility, will be removed - // at some point. - browser: { bolt: boltscripttag, amd: boltscripttag }, - commonjs: { bolt: boltcommonjs, amd: boltcommonjs } - }; - } -); -module.config.specs = def( - [ - module.util.pather - ], - - function (pather) { - var type = function (type, implementation) { - return { - type: type, - implementation: implementation, - modulator: implementation + '.Modulator', - compiler: implementation + '.Compiler' - }; - }; - - var source = function (relativeto) { - return function (type /*, args */) { - return { - type: type, - relativeto: relativeto, - args: [ pather.create(relativeto) ].concat(Array.prototype.slice.call(arguments, 1)) - }; - } - }; - - return { - type: type, - source: source - }; - } -); -module.reader.bouncing = def( - [ - ephox.bolt.kernel.fp.array, - module.error.error, - module.config.specs - ], - - function (ar, error, specs) { - var bounce = function (done, read, acc) { - var next = acc.configs.shift(); - read(next.relativeto, next.config, done, acc); - }; - - var tick = function (file, cfg, done, read, acc) { - var munged = ar.map(cfg.configs || [], function (config) { - return { relativeto: file, config: config }; - }); - var accumulated = { - sources: acc.sources.concat(cfg.sources || []), - types: acc.types.concat(cfg.types || []), - configs: munged.concat(acc.configs) - }; - if (accumulated.configs.length > 0) - bounce(done, read, accumulated); - else - done({ sources: accumulated.sources, types: accumulated.types }); - }; - - /* - * All precedence is depth-first, pre-order. Example: - * - * A - * /-\ - * B C - * /| |\ - * D E F G - * - * Configs are read in A, B, D, E, C, F, G. - * - * If configs mixed delegation and sources, the - * sources would be ordered the same: A, B, D, E, C, F, G. - */ - - var evaluate = function (file, payload, done, read, acc) { - var result = {}; - /* eval scope */ - var mapper = module.config.mapper; - var type = specs.type; - var source = specs.source(file); - var configure = function (configuration) { - result = configuration; - }; - try { - eval(payload); - } catch (e) { - throw 'Could not load configuration [' + file + '], with: ' + e; - } - tick(file, result, done, read, acc); - }; - - return { - evaluate: evaluate - }; - } -); -module.reader.browser = def( - [ - module.error.error, - module.reader.bouncing, - module.util.path, - ephox.bolt.loader.transporter.xhr - ], - - function (error, bouncing, path, xhr) { - var read = function (relativeto, file, done, acc) { - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = base + '/' + file; - xhr.request(absolute, function (payload) { - bouncing.evaluate(absolute, payload, done, read, accumulated); - }, error.die); - }; - - return { - read: read - }; - } -); -module.reader.node = def( - [ - module.reader.bouncing - ], - - function (bouncing, path, fs) { - var read = function (relativeto, file, done, acc) { - var fs = require('fs'); - var path = require('path'); - var accumulated = acc || { sources: [], types: [], configs: [] }; - var base = path.dirname(relativeto); - var absolute = path.resolve(base, file); - var payload = fs.readFileSync(absolute, 'UTF-8'); - bouncing.evaluate(absolute, payload, done, read, accumulated); - }; - - return { - read: read - }; - } -); -module.reader.direct = def( - [ - ], - - function () { - var create = function (configuration) { - return function (done) { - done({ - sources: configuration.sources || [], - types: configuration.types || [], - configs: configuration.configs || [] - }); - }; - }; - - return { - create: create - }; - } -); -module.bootstrap.configloader = def( - [ - module.util.locator, - module.reader.browser - ], - - function (locator, browser) { - var create = function (file) { - var script = locator.locate(); - return function (done) { - browser.read(script, file, done); - }; - }; - - return { - create: create - }; - } -);module.bootstrap.deferred = def( - [ - ephox.bolt.kernel.fp.array - ], - - function (ar) { - var deferred = []; - - var require = function (ids, fn) { - var r = function (real) { - real(ids, fn); - }; - deferred.push(r); - }; - - var configured = function (require) { - ar.each(deferred, function (action) { - action(require); - }); - deferred = []; - }; - - return { - require: require, - configured: configured - }; - } -); -module.bootstrap.main = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.runtime - ], - - function (config, deferred, runtime) { - var main = function (id, args, configids, callback) { - runtime.require(configids || [], function () { - callback && callback.apply(null, arguments); - runtime.require([ id ], function (module) { - module.apply(null, args || []); - }); - }); - }; - - return { - main: main - }; - } -); -module.bootstrap.install = def( - [ - ephox.bolt.kernel.api.config, - module.bootstrap.deferred, - module.bootstrap.main, - module.runtime, - module.error.error - ], - - function (config, deferred, main, runtime, error) { - var notready = function () { throw 'bolt not initialised, can not call define or demand, did you mean to use require or main?'; }; - - var install = function (reader, builtins, load, loadscript) { - runtime.define = notready; - runtime.demand = notready; - runtime.require = deferred.require; - runtime.main = main.main; - runtime.load = load; - runtime.loadscript = loadscript; - - reader(function (configuration) { - var bolt = config.configure(configuration, builtins, error.die); - runtime.define = bolt.define; - runtime.require = bolt.require; - runtime.demand = bolt.demand; - - deferred.configured(runtime.require); - }); - }; - - return { - install: install - }; - } -); - -})(Function('return this')()); -(function () { - var install = ephox.bolt.module.bootstrap.install; - var builtins = ephox.bolt.module.config.builtins.browser; - var transport = ephox.bolt.loader.transporter.xhr.request; - var script = ephox.bolt.loader.api.scripttag.load; - var direct = ephox.bolt.module.reader.direct; - var mapper = ephox.bolt.module.config.mapper; - var locator = ephox.bolt.module.util.locator; - var source = ephox.bolt.module.config.specs.source(locator.locate()); - var reader = direct.create({ - sources: [ - source("bolt", "tinymce/inlite/Theme", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.ThemeManager", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.util.Delay", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/ui/Panel", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/ui/Buttons", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/SkinLoader", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/SelectionMatcher", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/ElementMatcher", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/Matcher", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/alien/Arr", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/PredicateId", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.util.Tools", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.ui.Factory", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.DOM", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/ui/Toolbar", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/ui/Forms", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/Measure", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/Layout", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/file/Conversions", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/file/Picker", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/Actions", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.EditorManager", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.util.Promise", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/alien/Uuid", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/alien/Unlink", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/UrlType", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.geom.Rect", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/core/Convert", ".", mapper.constant("theme")), - source("bolt", "tinymce/inlite/alien/Bookmark", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.dom.TreeWalker", ".", mapper.constant("theme")), - source("bolt", "global!tinymce.dom.RangeUtils", ".", mapper.constant("theme")) - ] - }); - install.install(reader, builtins, transport, script); -})(); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/theme.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/theme.js deleted file mode 100644 index c05f0e4..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/compile/theme.js +++ /dev/null @@ -1,1594 +0,0 @@ -/*jsc -["tinymce/inlite/Theme","global!tinymce.ThemeManager","global!tinymce.util.Delay","tinymce/inlite/ui/Panel","tinymce/inlite/ui/Buttons","tinymce/inlite/core/SkinLoader","tinymce/inlite/core/SelectionMatcher","tinymce/inlite/core/ElementMatcher","tinymce/inlite/core/Matcher","tinymce/inlite/alien/Arr","tinymce/inlite/core/PredicateId","global!tinymce.util.Tools","global!tinymce.ui.Factory","global!tinymce.DOM","tinymce/inlite/ui/Toolbar","tinymce/inlite/ui/Forms","tinymce/inlite/core/Measure","tinymce/inlite/core/Layout","tinymce/inlite/file/Conversions","tinymce/inlite/file/Picker","tinymce/inlite/core/Actions","global!tinymce.EditorManager","global!tinymce.util.Promise","tinymce/inlite/alien/Uuid","tinymce/inlite/alien/Unlink","tinymce/inlite/core/UrlType","global!tinymce.geom.Rect","tinymce/inlite/core/Convert","tinymce/inlite/alien/Bookmark","global!tinymce.dom.TreeWalker","global!tinymce.dom.RangeUtils"] -jsc*/ -defineGlobal("global!tinymce.ThemeManager", tinymce.ThemeManager); -defineGlobal("global!tinymce.util.Delay", tinymce.util.Delay); -defineGlobal("global!tinymce.util.Tools", tinymce.util.Tools); -defineGlobal("global!tinymce.ui.Factory", tinymce.ui.Factory); -defineGlobal("global!tinymce.DOM", tinymce.DOM); -/** - * Toolbar.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Toolbar', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory' -], function (Tools, Factory) { - var setActiveItem = function (item, name) { - return function(state, args) { - var nodeName, i = args.parents.length; - - while (i--) { - nodeName = args.parents[i].nodeName; - if (nodeName == 'OL' || nodeName == 'UL') { - break; - } - } - - item.active(state && nodeName == name); - }; - }; - - var getSelectorStateResult = function (itemName, item) { - var result = function (selector, handler) { - return { - selector: selector, - handler: handler - }; - }; - - var activeHandler = function(state) { - item.active(state); - }; - - var disabledHandler = function (state) { - item.disabled(state); - }; - - if (itemName == 'bullist') { - return result('ul > li', setActiveItem(item, 'UL')); - } - - if (itemName == 'numlist') { - return result('ol > li', setActiveItem(item, 'OL')); - } - - if (item.settings.stateSelector) { - return result(item.settings.stateSelector, activeHandler); - } - - if (item.settings.disabledStateSelector) { - return result(item.settings.disabledStateSelector, disabledHandler); - } - - return null; - }; - - var bindSelectorChanged = function (editor, itemName, item) { - return function () { - var result = getSelectorStateResult(itemName, item); - if (result !== null) { - editor.selection.selectorChanged(result.selector, result.handler); - } - }; - }; - - var create = function (editor, name, items) { - var toolbarItems = [], buttonGroup; - - if (!items) { - return; - } - - Tools.each(items.split(/[ ,]/), function(item) { - var itemName; - - if (item == '|') { - buttonGroup = null; - } else { - if (Factory.has(item)) { - item = {type: item}; - toolbarItems.push(item); - buttonGroup = null; - } else { - if (!buttonGroup) { - buttonGroup = {type: 'buttongroup', items: []}; - toolbarItems.push(buttonGroup); - } - - if (editor.buttons[item]) { - itemName = item; - item = editor.buttons[itemName]; - - if (typeof item == 'function') { - item = item(); - } - - item.type = item.type || 'button'; - - item = Factory.create(item); - item.on('postRender', bindSelectorChanged(editor, itemName, item)); - buttonGroup.items.push(item); - } - } - } - }); - - return Factory.create({ - type: 'toolbar', - layout: 'flow', - name: name, - items: toolbarItems - }); - }; - - return { - create: create - }; -}); - -defineGlobal("global!tinymce.util.Promise", tinymce.util.Promise); -/** - * Uuid.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Generates unique ids this is the same as in core but since - * it's not exposed as a global we can't access it. - */ -define("tinymce/inlite/alien/Uuid", [ -], function() { - var count = 0; - - var seed = function () { - var rnd = function () { - return Math.round(Math.random() * 0xFFFFFFFF).toString(36); - }; - - return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); - }; - - var uuid = function (prefix) { - return prefix + (count++) + seed(); - }; - - return { - uuid: uuid - }; -}); - -/** - * Bookmark.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Bookmark', [ -], function () { - /** - * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with - * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans - * added to them since they can be restored after a dom operation. - * - * So this:

||

- * becomes:

||

- * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - var create = function (dom, rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - }; - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - var resolve = function (dom, bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - return rng; - }; - - return { - create: create, - resolve: resolve - }; -}); - - - -defineGlobal("global!tinymce.dom.TreeWalker", tinymce.dom.TreeWalker); -defineGlobal("global!tinymce.dom.RangeUtils", tinymce.dom.RangeUtils); -/** - * Unlink.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Unlink implementation that doesn't leave partial links for example it would produce: - * a[bc]de -> a[bc]de - * instead of: - * a[bc]de -> a[bc]de - */ -define("tinymce/inlite/alien/Unlink", [ - 'tinymce/inlite/alien/Bookmark', - 'global!tinymce.util.Tools', - 'global!tinymce.dom.TreeWalker', - 'global!tinymce.dom.RangeUtils' -], function (Bookmark, Tools, TreeWalker, RangeUtils) { - var getSelectedElements = function (rootElm, startNode, endNode) { - var walker, node, elms = []; - - walker = new TreeWalker(startNode, rootElm); - for (node = startNode; node; node = walker.next()) { - if (node.nodeType === 1) { - elms.push(node); - } - - if (node === endNode) { - break; - } - } - - return elms; - }; - - var unwrapElements = function (editor, elms) { - var bookmark, dom, selection; - - dom = editor.dom; - selection = editor.selection; - bookmark = Bookmark.create(dom, selection.getRng()); - - Tools.each(elms, function (elm) { - editor.dom.remove(elm, true); - }); - - selection.setRng(Bookmark.resolve(dom, bookmark)); - }; - - var isLink = function (elm) { - return elm.nodeName === 'A' && elm.hasAttribute('href'); - }; - - var getParentAnchorOrSelf = function (dom, elm) { - var anchorElm = dom.getParent(elm, isLink); - return anchorElm ? anchorElm : elm; - }; - - var getSelectedAnchors = function (editor) { - var startElm, endElm, rootElm, anchorElms, selection, dom, rng; - - selection = editor.selection; - dom = editor.dom; - rng = selection.getRng(); - startElm = getParentAnchorOrSelf(dom, RangeUtils.getNode(rng.startContainer, rng.startOffset)); - endElm = RangeUtils.getNode(rng.endContainer, rng.endOffset); - rootElm = editor.getBody(); - anchorElms = Tools.grep(getSelectedElements(rootElm, startElm, endElm), isLink); - - return anchorElms; - }; - - var unlinkSelection = function (editor) { - unwrapElements(editor, getSelectedAnchors(editor)); - }; - - return { - unlinkSelection: unlinkSelection - }; -}); - -/** - * Actions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Actions', [ - 'tinymce/inlite/alien/Uuid', - 'tinymce/inlite/alien/Unlink' -], function (Uuid, Unlink) { - var createTableHtml = function (cols, rows) { - var x, y, html; - - html = ''; - html += ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - html += '

'; - - return html; - }; - - var getInsertedElement = function (editor) { - var elms = editor.dom.select('*[data-mce-id]'); - return elms[0]; - }; - - var insertTable = function (editor, cols, rows) { - editor.undoManager.transact(function () { - var tableElm, cellElm; - - editor.insertContent(createTableHtml(cols, rows)); - - tableElm = getInsertedElement(editor); - tableElm.removeAttribute('data-mce-id'); - cellElm = editor.dom.select('td,th', tableElm); - editor.selection.setCursorLocation(cellElm[0], 0); - }); - }; - - var formatBlock = function (editor, formatName) { - editor.execCommand('FormatBlock', false, formatName); - }; - - var insertBlob = function (editor, base64, blob) { - var blobCache, blobInfo; - - blobCache = editor.editorUpload.blobCache; - blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64); - blobCache.add(blobInfo); - - editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()})); - }; - - var collapseSelectionToEnd = function (editor) { - editor.selection.collapse(false); - }; - - var unlink = function (editor) { - editor.focus(); - Unlink.unlinkSelection(editor); - collapseSelectionToEnd(editor); - }; - - var changeHref = function (editor, elm, url) { - editor.focus(); - editor.dom.setAttrib(elm, 'href', url); - collapseSelectionToEnd(editor); - }; - - var insertLink = function (editor, url) { - editor.execCommand('mceInsertLink', false, {href: url}); - collapseSelectionToEnd(editor); - }; - - var updateOrInsertLink = function (editor, url) { - var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - elm ? changeHref(editor, elm, url) : insertLink(editor, url); - }; - - var createLink = function (editor, url) { - url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url); - }; - - return { - insertTable: insertTable, - formatBlock: formatBlock, - insertBlob: insertBlob, - createLink: createLink, - unlink: unlink - }; -}); - -/** - * UrlType.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/UrlType', [ -], function () { - var isDomainLike = function (href) { - return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); - }; - - var isAbsolute = function (href) { - return /^https?:\/\//.test(href.trim()); - }; - - return { - isDomainLike: isDomainLike, - isAbsolute: isAbsolute - }; -}); - - - -/** - * Forms.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Forms', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.util.Promise', - 'tinymce/inlite/core/Actions', - 'tinymce/inlite/core/UrlType' -], function (Tools, Factory, Promise, Actions, UrlType) { - var focusFirstTextBox = function (form) { - form.find('textbox').eq(0).each(function (ctrl) { - ctrl.focus(); - }); - }; - - var createForm = function (name, spec) { - var form = Factory.create( - Tools.extend({ - type: 'form', - layout: 'flex', - direction: 'row', - padding: 5, - name: name, - spacing: 3 - }, spec) - ); - - form.on('show', function () { - focusFirstTextBox(form); - }); - - return form; - }; - - var toggleVisibility = function (ctrl, state) { - return state ? ctrl.show() : ctrl.hide(); - }; - - var askAboutPrefix = function (editor, href) { - return new Promise(function (resolve) { - editor.windowManager.confirm( - 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', - function (result) { - var output = result === true ? 'http://' + href : href; - resolve(output); - } - ); - }); - }; - - var convertLinkToAbsolute = function (editor, href) { - return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href); - }; - - var createQuickLinkForm = function (editor, hide) { - var unlink = function () { - editor.focus(); - Actions.unlink(editor); - hide(); - }; - - return createForm('quicklink', { - items: [ - {type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link'}, - {type: 'textbox', name: 'linkurl', placeholder: 'Paste or type a link'}, - {type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit'} - ], - onshow: function () { - var elm, linkurl = ''; - - elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - if (elm) { - linkurl = editor.dom.getAttrib(elm, 'href'); - } - - this.fromJSON({ - linkurl: linkurl - }); - - toggleVisibility(this.find('#unlink'), elm); - }, - onsubmit: function (e) { - convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) { - Actions.createLink(editor, url); - hide(); - }); - } - }); - }; - - return { - createQuickLinkForm: createQuickLinkForm - }; -}); - -defineGlobal("global!tinymce.geom.Rect", tinymce.geom.Rect); -/** - * Convert.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Convert', [ -], function () { - var fromClientRect = function (clientRect) { - return { - x: clientRect.left, - y: clientRect.top, - w: clientRect.width, - h: clientRect.height - }; - }; - - var toClientRect = function (geomRect) { - return { - left: geomRect.x, - top: geomRect.y, - width: geomRect.w, - height: geomRect.h, - right: geomRect.x + geomRect.w, - bottom: geomRect.y + geomRect.h - }; - }; - - return { - fromClientRect: fromClientRect, - toClientRect: toClientRect - }; -}); - -/** - * Measure.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Measure', [ - 'global!tinymce.DOM', - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (DOM, Rect, Convert) { - var toAbsolute = function (rect) { - var vp = DOM.getViewPort(); - - return { - x: rect.x + vp.x, - y: rect.y + vp.y, - w: rect.w, - h: rect.h - }; - }; - - var measureElement = function (elm) { - var clientRect = elm.getBoundingClientRect(); - - return toAbsolute({ - x: clientRect.left, - y: clientRect.top, - w: Math.max(elm.clientWidth, elm.offsetWidth), - h: Math.max(elm.clientHeight, elm.offsetHeight) - }); - }; - - var getElementRect = function (editor, elm) { - return measureElement(elm); - }; - - var getPageAreaRect = function (editor) { - return measureElement(editor.getElement().ownerDocument.body); - }; - - var getContentAreaRect = function (editor) { - return measureElement(editor.getContentAreaContainer() || editor.getBody()); - }; - - var getSelectionRect = function (editor) { - var clientRect = editor.selection.getBoundingClientRect(); - return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null; - }; - - return { - getElementRect: getElementRect, - getPageAreaRect: getPageAreaRect, - getContentAreaRect: getContentAreaRect, - getSelectionRect: getSelectionRect - }; -}); - -/** - * Layout.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Layout', [ - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (Rect, Convert) { - var result = function (rect, position) { - return { - rect: rect, - position: position - }; - }; - - var moveTo = function (rect, toRect) { - return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h}; - }; - - var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) { - var relPos, relRect, outputPanelRect; - - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1); - targetRect = Rect.clamp(targetRect, contentAreaRect); - - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - targetRect = Rect.intersect(contentAreaRect, targetRect); - if (targetRect) { - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2); - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - outputPanelRect = moveTo(panelRect, targetRect); - return result(outputPanelRect, relPos); - } - - return null; - }; - - var calcInsert = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['cr-cl', 'cl-cr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var calc = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) { - var userConstrainedPanelRect; - - if (typeof handler === 'function') { - userConstrainedPanelRect = handler({ - elementRect: Convert.toClientRect(targetRect), - contentAreaRect: Convert.toClientRect(contentAreaRect), - panelRect: Convert.toClientRect(panelRect) - }); - - return Convert.fromClientRect(userConstrainedPanelRect); - } - - return panelRect; - }; - - return { - calcInsert: calcInsert, - calc: calc, - userConstrain: userConstrain - }; -}); - -/** - * Panel.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Panel', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.DOM', - 'tinymce/inlite/ui/Toolbar', - 'tinymce/inlite/ui/Forms', - 'tinymce/inlite/core/Measure', - 'tinymce/inlite/core/Layout' -], function (Tools, Factory, DOM, Toolbar, Forms, Measure, Layout) { - return function () { - var DEFAULT_TEXT_SELECTION_ITEMS = 'bold italic | quicklink h2 h3 blockquote'; - var DEFAULT_INSERT_TOOLBAR_ITEMS = 'quickimage quicktable'; - var panel, currentRect; - - var createToolbars = function (editor, toolbars) { - return Tools.map(toolbars, function (toolbar) { - return Toolbar.create(editor, toolbar.id, toolbar.items); - }); - }; - - var getTextSelectionToolbarItems = function (settings) { - var value = settings.selection_toolbar; - return value ? value : DEFAULT_TEXT_SELECTION_ITEMS; - }; - - var getInsertToolbarItems = function (settings) { - var value = settings.insert_toolbar; - return value ? value : DEFAULT_INSERT_TOOLBAR_ITEMS; - }; - - var create = function (editor, toolbars) { - var items, settings = editor.settings; - - items = createToolbars(editor, toolbars); - items = items.concat([ - Toolbar.create(editor, 'text', getTextSelectionToolbarItems(settings)), - Toolbar.create(editor, 'insert', getInsertToolbarItems(settings)), - Forms.createQuickLinkForm(editor, hide) - ]); - - return Factory.create({ - type: 'floatpanel', - role: 'dialog', - classes: 'tinymce tinymce-inline arrow', - ariaLabel: 'Inline toolbar', - layout: 'flex', - direction: 'column', - align: 'stretch', - autohide: false, - autofix: true, - fixed: true, - border: 1, - items: items, - oncancel: function() { - editor.focus(); - } - }); - }; - - var showPanel = function (panel) { - if (panel) { - panel.show(); - } - }; - - var movePanelTo = function (panel, pos) { - panel.moveTo(pos.x, pos.y); - }; - - var togglePositionClass = function (panel, relPos) { - relPos = relPos ? relPos.substr(0, 2) : ''; - - Tools.each({ - t: 'down', - b: 'up', - c: 'center' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1)); - }); - - if (relPos === 'cr') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', false); - } else if (relPos === 'cl') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', true); - } else { - Tools.each({ - l: 'left', - r: 'right' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1)); - }); - } - }; - - var showToolbar = function (panel, id) { - var toolbars = panel.items().filter('#' + id); - - if (toolbars.length > 0) { - toolbars[0].show(); - panel.reflow(); - } - }; - - var showPanelAt = function (panel, id, editor, targetRect) { - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - if (id === 'insert') { - result = Layout.calcInsert(targetRect, contentAreaRect, panelRect); - } else { - result = Layout.calc(targetRect, contentAreaRect, panelRect); - } - - if (result) { - panelRect = result.rect; - currentRect = targetRect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } else { - hide(panel); - } - }; - - var hasFormVisible = function () { - return panel.items().filter('form:visible').length > 0; - }; - - var showForm = function (editor, id) { - if (panel) { - panel.items().hide(); - showToolbar(panel, id); - - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - result = Layout.calc(currentRect, contentAreaRect, panelRect); - - if (result) { - panelRect = result.rect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } - } - }; - - var show = function (editor, id, targetRect, toolbars) { - if (!panel) { - panel = create(editor, toolbars); - panel.renderTo(document.body).reflow().moveTo(targetRect.x, targetRect.y); - editor.nodeChanged(); - } - - showPanelAt(panel, id, editor, targetRect); - }; - - var hide = function () { - if (panel) { - panel.hide(); - } - }; - - var focus = function () { - if (panel) { - panel.find('toolbar:visible').eq(0).each(function (item) { - item.focus(true); - }); - } - }; - - var remove = function () { - if (panel) { - panel.remove(); - panel = null; - } - }; - - var inForm = function () { - return panel && panel.visible() && hasFormVisible(); - }; - - return { - show: show, - showForm: showForm, - inForm: inForm, - hide: hide, - focus: focus, - remove: remove - }; - }; -}); - -/** - * Conversions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Conversions', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var blobToBase64 = function (blob) { - return new Promise(function(resolve) { - var reader = new FileReader(); - - reader.onloadend = function() { - resolve(reader.result.split(',')[1]); - }; - - reader.readAsDataURL(blob); - }); - }; - - return { - blobToBase64: blobToBase64 - }; -}); - - - -/** - * Picker.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Picker', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var pickFile = function () { - return new Promise(function (resolve) { - var fileInput; - - fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.style.position = 'fixed'; - fileInput.style.left = 0; - fileInput.style.top = 0; - fileInput.style.opacity = 0.001; - document.body.appendChild(fileInput); - - fileInput.onchange = function(e) { - resolve(Array.prototype.slice.call(e.target.files)); - }; - - fileInput.click(); - fileInput.parentNode.removeChild(fileInput); - }); - }; - - return { - pickFile: pickFile - }; -}); - - - -/** - * Buttons.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Buttons', [ - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/file/Conversions', - 'tinymce/inlite/file/Picker', - 'tinymce/inlite/core/Actions' -], function (Panel, Conversions, Picker, Actions) { - var addHeaderButtons = function (editor) { - var formatBlock = function (name) { - return function () { - Actions.formatBlock(editor, name); - }; - }; - - for (var i = 1; i < 6; i++) { - var name = 'h' + i; - - editor.addButton(name, { - text: name.toUpperCase(), - tooltip: 'Heading ' + i, - stateSelector: name, - onclick: formatBlock(name), - onPostRender: function () { - // TODO: Remove this hack that produces bold H1-H6 when we have proper icons - var span = this.getEl().firstChild.firstChild; - span.style.fontWeight = 'bold'; - } - }); - } - }; - - var addToEditor = function (editor, panel) { - editor.addButton('quicklink', { - icon: 'link', - tooltip: 'Insert/Edit link', - stateSelector: 'a[href]', - onclick: function () { - panel.showForm(editor, 'quicklink'); - } - }); - - editor.addButton('quickimage', { - icon: 'image', - tooltip: 'Insert image', - onclick: function () { - Picker.pickFile().then(function (files) { - var blob = files[0]; - - Conversions.blobToBase64(blob).then(function (base64) { - Actions.insertBlob(editor, base64, blob); - }); - }); - } - }); - - editor.addButton('quicktable', { - icon: 'table', - tooltip: 'Insert table', - onclick: function () { - panel.hide(); - Actions.insertTable(editor, 2, 2); - } - }); - - addHeaderButtons(editor); - }; - - return { - addToEditor: addToEditor - }; -}); - -defineGlobal("global!tinymce.EditorManager", tinymce.EditorManager); -/** - * SkinLoader.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SkinLoader', [ - 'global!tinymce.EditorManager', - 'global!tinymce.DOM' -], function (EditorManager, DOM) { - var fireSkinLoaded = function (editor, callback) { - var done = function () { - editor.fire('SkinLoaded'); - callback(); - }; - - if (editor.initialized) { - done(); - } else { - editor.on('init', done); - } - }; - - var load = function (editor, skin, callback) { - var baseUrl = EditorManager.baseURL; - var skinUrl = baseUrl + '/skins/' + skin; - - var done = function () { - fireSkinLoaded(editor, callback); - }; - - DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); - editor.contentCSS.push(skinUrl + '/content.inline.min.css'); - }; - - return { - load: load - }; -}); - - - -/** - * Matcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Matcher', [ -], function () { - // result :: String, Rect -> Matcher.result - var result = function (id, rect) { - return { - id: id, - rect: rect - }; - }; - - // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null - var match = function (editor, matchers) { - for (var i = 0; i < matchers.length; i++) { - var f = matchers[i]; - var result = f(editor); - - if (result) { - return result; - } - } - - return null; - }; - - return { - match: match, - result: result - }; -}); - -/** - * SelectionMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SelectionMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // textSelection :: String -> (Editor -> Matcher.result | Null) - var textSelection = function (id) { - return function (editor) { - if (!editor.selection.isCollapsed()) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - }; - }; - - // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) - var emptyTextBlock = function (elements, id) { - return function (editor) { - var i, textBlockElementsMap = editor.schema.getTextBlockElements(); - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName === 'TABLE') { - return null; - } - } - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName in textBlockElementsMap) { - if (editor.dom.isEmpty(elements[i])) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - } - } - - return null; - }; - }; - - return { - textSelection: textSelection, - emptyTextBlock: emptyTextBlock - }; -}); - -/** - * ElementMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/ElementMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) - var element = function (element, predicateIds) { - return function (editor) { - for (var i = 0; i < predicateIds.length; i++) { - if (predicateIds[i].predicate(element)) { - return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); - } - } - - return null; - }; - }; - - // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) - var parent = function (elements, predicateIds) { - return function (editor) { - for (var i = 0; i < elements.length; i++) { - for (var x = 0; x < predicateIds.length; x++) { - if (predicateIds[x].predicate(elements[i])) { - return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); - } - } - } - - return null; - }; - }; - - return { - element: element, - parent: parent - }; -}); - -/** - * Arr.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Arr', [ -], function () { - var flatten = function (arr) { - return arr.reduce(function (results, item) { - return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item); - }, []); - }; - - return { - flatten: flatten - }; -}); - -/** - * PredicateId.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/PredicateId', [ - 'global!tinymce.util.Tools' -], function (Tools) { - var create = function (id, predicate) { - return { - id: id, - predicate: predicate - }; - }; - - // fromContextToolbars :: [ContextToolbar] -> [PredicateId] - var fromContextToolbars = function (toolbars) { - return Tools.map(toolbars, function (toolbar) { - return create(toolbar.id, toolbar.predicate); - }); - }; - - return { - create: create, - fromContextToolbars: fromContextToolbars - }; -}); - -/** - * Theme.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/Theme', [ - 'global!tinymce.ThemeManager', - 'global!tinymce.util.Delay', - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/ui/Buttons', - 'tinymce/inlite/core/SkinLoader', - 'tinymce/inlite/core/SelectionMatcher', - 'tinymce/inlite/core/ElementMatcher', - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/alien/Arr', - 'tinymce/inlite/core/PredicateId' -], function(ThemeManager, Delay, Panel, Buttons, SkinLoader, SelectionMatcher, ElementMatcher, Matcher, Arr, PredicateId) { - var getSelectionElements = function (editor) { - var node = editor.selection.getNode(); - var elms = editor.dom.getParents(node); - return elms; - }; - - var createToolbar = function (editor, selector, id, items) { - var selectorPredicate = function (elm) { - return editor.dom.is(elm, selector); - }; - - return { - predicate: selectorPredicate, - id: id, - items: items - }; - }; - - var getToolbars = function (editor) { - var contextToolbars = editor.contextToolbars; - - return Arr.flatten([ - contextToolbars ? contextToolbars : [], - createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright') - ]); - }; - - var findMatchResult = function (editor, toolbars) { - var result, elements, contextToolbarsPredicateIds; - - elements = getSelectionElements(editor); - contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars); - - result = Matcher.match(editor, [ - ElementMatcher.element(elements[0], contextToolbarsPredicateIds), - SelectionMatcher.textSelection('text'), - SelectionMatcher.emptyTextBlock(elements, 'insert'), - ElementMatcher.parent(elements, contextToolbarsPredicateIds) - ]); - - return result && result.rect ? result : null; - }; - - var togglePanel = function (editor, panel) { - var toggle = function () { - var toolbars = getToolbars(editor); - var result = findMatchResult(editor, toolbars); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } else { - panel.hide(); - } - }; - - return function () { - if (!editor.removed) { - toggle(); - } - }; - }; - - var ignoreWhenFormIsVisible = function (panel, f) { - return function () { - if (!panel.inForm()) { - f(); - } - }; - }; - - var bindContextualToolbarsEvents = function (editor, panel) { - var throttledTogglePanel = Delay.throttle(togglePanel(editor, panel), 0); - var throttledTogglePanelWhenNotInForm = Delay.throttle(ignoreWhenFormIsVisible(panel, togglePanel(editor, panel)), 0); - - editor.on('blur hide ObjectResizeStart', panel.hide); - editor.on('click', throttledTogglePanel); - editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm); - editor.on('ResizeEditor ResizeWindow keyup', throttledTogglePanel); - editor.on('remove', panel.remove); - - editor.shortcuts.add('Alt+F10', '', panel.focus); - }; - - var overrideLinkShortcut = function (editor, panel) { - editor.shortcuts.remove('meta+k'); - editor.shortcuts.add('meta+k', '', function () { - var toolbars = getToolbars(editor); - var result = result = Matcher.match(editor, [ - SelectionMatcher.textSelection('quicklink') - ]); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } - }); - }; - - var renderInlineUI = function (editor, panel) { - var skinName = editor.settings.skin || 'lightgray'; - - SkinLoader.load(editor, skinName, function () { - bindContextualToolbarsEvents(editor, panel); - overrideLinkShortcut(editor, panel); - }); - - return {}; - }; - - var fail = function (message) { - throw new Error(message); - }; - - ThemeManager.add('inlite', function (editor) { - var panel = new Panel(); - - Buttons.addToEditor(editor, panel); - - var renderUI = function () { - return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.'); - }; - - return { - renderUI: renderUI - }; - }); - - return function() {}; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.js deleted file mode 100644 index d052cd2..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.js +++ /dev/null @@ -1,1679 +0,0 @@ -(function () { - -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} - -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined - }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u"] -jsc*/ -defineGlobal("1", tinymce.ThemeManager); -defineGlobal("2", tinymce.util.Delay); -defineGlobal("b", tinymce.util.Tools); -defineGlobal("c", tinymce.ui.Factory); -defineGlobal("d", tinymce.DOM); -/** - * Toolbar.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("e", [ - "b", - "c" -], function (Tools, Factory) { - var setActiveItem = function (item, name) { - return function(state, args) { - var nodeName, i = args.parents.length; - - while (i--) { - nodeName = args.parents[i].nodeName; - if (nodeName == 'OL' || nodeName == 'UL') { - break; - } - } - - item.active(state && nodeName == name); - }; - }; - - var getSelectorStateResult = function (itemName, item) { - var result = function (selector, handler) { - return { - selector: selector, - handler: handler - }; - }; - - var activeHandler = function(state) { - item.active(state); - }; - - var disabledHandler = function (state) { - item.disabled(state); - }; - - if (itemName == 'bullist') { - return result('ul > li', setActiveItem(item, 'UL')); - } - - if (itemName == 'numlist') { - return result('ol > li', setActiveItem(item, 'OL')); - } - - if (item.settings.stateSelector) { - return result(item.settings.stateSelector, activeHandler); - } - - if (item.settings.disabledStateSelector) { - return result(item.settings.disabledStateSelector, disabledHandler); - } - - return null; - }; - - var bindSelectorChanged = function (editor, itemName, item) { - return function () { - var result = getSelectorStateResult(itemName, item); - if (result !== null) { - editor.selection.selectorChanged(result.selector, result.handler); - } - }; - }; - - var create = function (editor, name, items) { - var toolbarItems = [], buttonGroup; - - if (!items) { - return; - } - - Tools.each(items.split(/[ ,]/), function(item) { - var itemName; - - if (item == '|') { - buttonGroup = null; - } else { - if (Factory.has(item)) { - item = {type: item}; - toolbarItems.push(item); - buttonGroup = null; - } else { - if (!buttonGroup) { - buttonGroup = {type: 'buttongroup', items: []}; - toolbarItems.push(buttonGroup); - } - - if (editor.buttons[item]) { - itemName = item; - item = editor.buttons[itemName]; - - if (typeof item == 'function') { - item = item(); - } - - item.type = item.type || 'button'; - - item = Factory.create(item); - item.on('postRender', bindSelectorChanged(editor, itemName, item)); - buttonGroup.items.push(item); - } - } - } - }); - - return Factory.create({ - type: 'toolbar', - layout: 'flow', - name: name, - items: toolbarItems - }); - }; - - return { - create: create - }; -}); - -defineGlobal("m", tinymce.util.Promise); -/** - * Uuid.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Generates unique ids this is the same as in core but since - * it's not exposed as a global we can't access it. - */ -define("n", [ -], function() { - var count = 0; - - var seed = function () { - var rnd = function () { - return Math.round(Math.random() * 0xFFFFFFFF).toString(36); - }; - - return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); - }; - - var uuid = function (prefix) { - return prefix + (count++) + seed(); - }; - - return { - uuid: uuid - }; -}); - -/** - * Bookmark.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("s", [ -], function () { - /** - * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with - * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans - * added to them since they can be restored after a dom operation. - * - * So this:

||

- * becomes:

||

- * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - var create = function (dom, rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - }; - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - var resolve = function (dom, bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - return rng; - }; - - return { - create: create, - resolve: resolve - }; -}); - - - -defineGlobal("t", tinymce.dom.TreeWalker); -defineGlobal("u", tinymce.dom.RangeUtils); -/** - * Unlink.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Unlink implementation that doesn't leave partial links for example it would produce: - * a[bc]de -> a[bc]de - * instead of: - * a[bc]de -> a[bc]de - */ -define("o", [ - "s", - "b", - "t", - "u" -], function (Bookmark, Tools, TreeWalker, RangeUtils) { - var getSelectedElements = function (rootElm, startNode, endNode) { - var walker, node, elms = []; - - walker = new TreeWalker(startNode, rootElm); - for (node = startNode; node; node = walker.next()) { - if (node.nodeType === 1) { - elms.push(node); - } - - if (node === endNode) { - break; - } - } - - return elms; - }; - - var unwrapElements = function (editor, elms) { - var bookmark, dom, selection; - - dom = editor.dom; - selection = editor.selection; - bookmark = Bookmark.create(dom, selection.getRng()); - - Tools.each(elms, function (elm) { - editor.dom.remove(elm, true); - }); - - selection.setRng(Bookmark.resolve(dom, bookmark)); - }; - - var isLink = function (elm) { - return elm.nodeName === 'A' && elm.hasAttribute('href'); - }; - - var getParentAnchorOrSelf = function (dom, elm) { - var anchorElm = dom.getParent(elm, isLink); - return anchorElm ? anchorElm : elm; - }; - - var getSelectedAnchors = function (editor) { - var startElm, endElm, rootElm, anchorElms, selection, dom, rng; - - selection = editor.selection; - dom = editor.dom; - rng = selection.getRng(); - startElm = getParentAnchorOrSelf(dom, RangeUtils.getNode(rng.startContainer, rng.startOffset)); - endElm = RangeUtils.getNode(rng.endContainer, rng.endOffset); - rootElm = editor.getBody(); - anchorElms = Tools.grep(getSelectedElements(rootElm, startElm, endElm), isLink); - - return anchorElms; - }; - - var unlinkSelection = function (editor) { - unwrapElements(editor, getSelectedAnchors(editor)); - }; - - return { - unlinkSelection: unlinkSelection - }; -}); - -/** - * Actions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("k", [ - "n", - "o" -], function (Uuid, Unlink) { - var createTableHtml = function (cols, rows) { - var x, y, html; - - html = ''; - html += ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - html += '

'; - - return html; - }; - - var getInsertedElement = function (editor) { - var elms = editor.dom.select('*[data-mce-id]'); - return elms[0]; - }; - - var insertTable = function (editor, cols, rows) { - editor.undoManager.transact(function () { - var tableElm, cellElm; - - editor.insertContent(createTableHtml(cols, rows)); - - tableElm = getInsertedElement(editor); - tableElm.removeAttribute('data-mce-id'); - cellElm = editor.dom.select('td,th', tableElm); - editor.selection.setCursorLocation(cellElm[0], 0); - }); - }; - - var formatBlock = function (editor, formatName) { - editor.execCommand('FormatBlock', false, formatName); - }; - - var insertBlob = function (editor, base64, blob) { - var blobCache, blobInfo; - - blobCache = editor.editorUpload.blobCache; - blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64); - blobCache.add(blobInfo); - - editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()})); - }; - - var collapseSelectionToEnd = function (editor) { - editor.selection.collapse(false); - }; - - var unlink = function (editor) { - editor.focus(); - Unlink.unlinkSelection(editor); - collapseSelectionToEnd(editor); - }; - - var changeHref = function (editor, elm, url) { - editor.focus(); - editor.dom.setAttrib(elm, 'href', url); - collapseSelectionToEnd(editor); - }; - - var insertLink = function (editor, url) { - editor.execCommand('mceInsertLink', false, {href: url}); - collapseSelectionToEnd(editor); - }; - - var updateOrInsertLink = function (editor, url) { - var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - elm ? changeHref(editor, elm, url) : insertLink(editor, url); - }; - - var createLink = function (editor, url) { - url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url); - }; - - return { - insertTable: insertTable, - formatBlock: formatBlock, - insertBlob: insertBlob, - createLink: createLink, - unlink: unlink - }; -}); - -/** - * UrlType.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("p", [ -], function () { - var isDomainLike = function (href) { - return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); - }; - - var isAbsolute = function (href) { - return /^https?:\/\//.test(href.trim()); - }; - - return { - isDomainLike: isDomainLike, - isAbsolute: isAbsolute - }; -}); - - - -/** - * Forms.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("f", [ - "b", - "c", - "m", - "k", - "p" -], function (Tools, Factory, Promise, Actions, UrlType) { - var focusFirstTextBox = function (form) { - form.find('textbox').eq(0).each(function (ctrl) { - ctrl.focus(); - }); - }; - - var createForm = function (name, spec) { - var form = Factory.create( - Tools.extend({ - type: 'form', - layout: 'flex', - direction: 'row', - padding: 5, - name: name, - spacing: 3 - }, spec) - ); - - form.on('show', function () { - focusFirstTextBox(form); - }); - - return form; - }; - - var toggleVisibility = function (ctrl, state) { - return state ? ctrl.show() : ctrl.hide(); - }; - - var askAboutPrefix = function (editor, href) { - return new Promise(function (resolve) { - editor.windowManager.confirm( - 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', - function (result) { - var output = result === true ? 'http://' + href : href; - resolve(output); - } - ); - }); - }; - - var convertLinkToAbsolute = function (editor, href) { - return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href); - }; - - var createQuickLinkForm = function (editor, hide) { - var unlink = function () { - editor.focus(); - Actions.unlink(editor); - hide(); - }; - - return createForm('quicklink', { - items: [ - {type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link'}, - {type: 'textbox', name: 'linkurl', placeholder: 'Paste or type a link'}, - {type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit'} - ], - onshow: function () { - var elm, linkurl = ''; - - elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - if (elm) { - linkurl = editor.dom.getAttrib(elm, 'href'); - } - - this.fromJSON({ - linkurl: linkurl - }); - - toggleVisibility(this.find('#unlink'), elm); - }, - onsubmit: function (e) { - convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) { - Actions.createLink(editor, url); - hide(); - }); - } - }); - }; - - return { - createQuickLinkForm: createQuickLinkForm - }; -}); - -defineGlobal("q", tinymce.geom.Rect); -/** - * Convert.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("r", [ -], function () { - var fromClientRect = function (clientRect) { - return { - x: clientRect.left, - y: clientRect.top, - w: clientRect.width, - h: clientRect.height - }; - }; - - var toClientRect = function (geomRect) { - return { - left: geomRect.x, - top: geomRect.y, - width: geomRect.w, - height: geomRect.h, - right: geomRect.x + geomRect.w, - bottom: geomRect.y + geomRect.h - }; - }; - - return { - fromClientRect: fromClientRect, - toClientRect: toClientRect - }; -}); - -/** - * Measure.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("g", [ - "d", - "q", - "r" -], function (DOM, Rect, Convert) { - var toAbsolute = function (rect) { - var vp = DOM.getViewPort(); - - return { - x: rect.x + vp.x, - y: rect.y + vp.y, - w: rect.w, - h: rect.h - }; - }; - - var measureElement = function (elm) { - var clientRect = elm.getBoundingClientRect(); - - return toAbsolute({ - x: clientRect.left, - y: clientRect.top, - w: Math.max(elm.clientWidth, elm.offsetWidth), - h: Math.max(elm.clientHeight, elm.offsetHeight) - }); - }; - - var getElementRect = function (editor, elm) { - return measureElement(elm); - }; - - var getPageAreaRect = function (editor) { - return measureElement(editor.getElement().ownerDocument.body); - }; - - var getContentAreaRect = function (editor) { - return measureElement(editor.getContentAreaContainer() || editor.getBody()); - }; - - var getSelectionRect = function (editor) { - var clientRect = editor.selection.getBoundingClientRect(); - return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null; - }; - - return { - getElementRect: getElementRect, - getPageAreaRect: getPageAreaRect, - getContentAreaRect: getContentAreaRect, - getSelectionRect: getSelectionRect - }; -}); - -/** - * Layout.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("h", [ - "q", - "r" -], function (Rect, Convert) { - var result = function (rect, position) { - return { - rect: rect, - position: position - }; - }; - - var moveTo = function (rect, toRect) { - return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h}; - }; - - var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) { - var relPos, relRect, outputPanelRect; - - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1); - targetRect = Rect.clamp(targetRect, contentAreaRect); - - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - targetRect = Rect.intersect(contentAreaRect, targetRect); - if (targetRect) { - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2); - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - outputPanelRect = moveTo(panelRect, targetRect); - return result(outputPanelRect, relPos); - } - - return null; - }; - - var calcInsert = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['cr-cl', 'cl-cr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var calc = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) { - var userConstrainedPanelRect; - - if (typeof handler === 'function') { - userConstrainedPanelRect = handler({ - elementRect: Convert.toClientRect(targetRect), - contentAreaRect: Convert.toClientRect(contentAreaRect), - panelRect: Convert.toClientRect(panelRect) - }); - - return Convert.fromClientRect(userConstrainedPanelRect); - } - - return panelRect; - }; - - return { - calcInsert: calcInsert, - calc: calc, - userConstrain: userConstrain - }; -}); - -/** - * Panel.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("3", [ - "b", - "c", - "d", - "e", - "f", - "g", - "h" -], function (Tools, Factory, DOM, Toolbar, Forms, Measure, Layout) { - return function () { - var DEFAULT_TEXT_SELECTION_ITEMS = 'bold italic | quicklink h2 h3 blockquote'; - var DEFAULT_INSERT_TOOLBAR_ITEMS = 'quickimage quicktable'; - var panel, currentRect; - - var createToolbars = function (editor, toolbars) { - return Tools.map(toolbars, function (toolbar) { - return Toolbar.create(editor, toolbar.id, toolbar.items); - }); - }; - - var getTextSelectionToolbarItems = function (settings) { - var value = settings.selection_toolbar; - return value ? value : DEFAULT_TEXT_SELECTION_ITEMS; - }; - - var getInsertToolbarItems = function (settings) { - var value = settings.insert_toolbar; - return value ? value : DEFAULT_INSERT_TOOLBAR_ITEMS; - }; - - var create = function (editor, toolbars) { - var items, settings = editor.settings; - - items = createToolbars(editor, toolbars); - items = items.concat([ - Toolbar.create(editor, 'text', getTextSelectionToolbarItems(settings)), - Toolbar.create(editor, 'insert', getInsertToolbarItems(settings)), - Forms.createQuickLinkForm(editor, hide) - ]); - - return Factory.create({ - type: 'floatpanel', - role: 'dialog', - classes: 'tinymce tinymce-inline arrow', - ariaLabel: 'Inline toolbar', - layout: 'flex', - direction: 'column', - align: 'stretch', - autohide: false, - autofix: true, - fixed: true, - border: 1, - items: items, - oncancel: function() { - editor.focus(); - } - }); - }; - - var showPanel = function (panel) { - if (panel) { - panel.show(); - } - }; - - var movePanelTo = function (panel, pos) { - panel.moveTo(pos.x, pos.y); - }; - - var togglePositionClass = function (panel, relPos) { - relPos = relPos ? relPos.substr(0, 2) : ''; - - Tools.each({ - t: 'down', - b: 'up', - c: 'center' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1)); - }); - - if (relPos === 'cr') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', false); - } else if (relPos === 'cl') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', true); - } else { - Tools.each({ - l: 'left', - r: 'right' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1)); - }); - } - }; - - var showToolbar = function (panel, id) { - var toolbars = panel.items().filter('#' + id); - - if (toolbars.length > 0) { - toolbars[0].show(); - panel.reflow(); - } - }; - - var showPanelAt = function (panel, id, editor, targetRect) { - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - if (id === 'insert') { - result = Layout.calcInsert(targetRect, contentAreaRect, panelRect); - } else { - result = Layout.calc(targetRect, contentAreaRect, panelRect); - } - - if (result) { - panelRect = result.rect; - currentRect = targetRect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } else { - hide(panel); - } - }; - - var hasFormVisible = function () { - return panel.items().filter('form:visible').length > 0; - }; - - var showForm = function (editor, id) { - if (panel) { - panel.items().hide(); - showToolbar(panel, id); - - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - result = Layout.calc(currentRect, contentAreaRect, panelRect); - - if (result) { - panelRect = result.rect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } - } - }; - - var show = function (editor, id, targetRect, toolbars) { - if (!panel) { - panel = create(editor, toolbars); - panel.renderTo(document.body).reflow().moveTo(targetRect.x, targetRect.y); - editor.nodeChanged(); - } - - showPanelAt(panel, id, editor, targetRect); - }; - - var hide = function () { - if (panel) { - panel.hide(); - } - }; - - var focus = function () { - if (panel) { - panel.find('toolbar:visible').eq(0).each(function (item) { - item.focus(true); - }); - } - }; - - var remove = function () { - if (panel) { - panel.remove(); - panel = null; - } - }; - - var inForm = function () { - return panel && panel.visible() && hasFormVisible(); - }; - - return { - show: show, - showForm: showForm, - inForm: inForm, - hide: hide, - focus: focus, - remove: remove - }; - }; -}); - -/** - * Conversions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("i", [ - "m" -], function (Promise) { - var blobToBase64 = function (blob) { - return new Promise(function(resolve) { - var reader = new FileReader(); - - reader.onloadend = function() { - resolve(reader.result.split(',')[1]); - }; - - reader.readAsDataURL(blob); - }); - }; - - return { - blobToBase64: blobToBase64 - }; -}); - - - -/** - * Picker.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("j", [ - "m" -], function (Promise) { - var pickFile = function () { - return new Promise(function (resolve) { - var fileInput; - - fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.style.position = 'fixed'; - fileInput.style.left = 0; - fileInput.style.top = 0; - fileInput.style.opacity = 0.001; - document.body.appendChild(fileInput); - - fileInput.onchange = function(e) { - resolve(Array.prototype.slice.call(e.target.files)); - }; - - fileInput.click(); - fileInput.parentNode.removeChild(fileInput); - }); - }; - - return { - pickFile: pickFile - }; -}); - - - -/** - * Buttons.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("4", [ - "3", - "i", - "j", - "k" -], function (Panel, Conversions, Picker, Actions) { - var addHeaderButtons = function (editor) { - var formatBlock = function (name) { - return function () { - Actions.formatBlock(editor, name); - }; - }; - - for (var i = 1; i < 6; i++) { - var name = 'h' + i; - - editor.addButton(name, { - text: name.toUpperCase(), - tooltip: 'Heading ' + i, - stateSelector: name, - onclick: formatBlock(name), - onPostRender: function () { - // TODO: Remove this hack that produces bold H1-H6 when we have proper icons - var span = this.getEl().firstChild.firstChild; - span.style.fontWeight = 'bold'; - } - }); - } - }; - - var addToEditor = function (editor, panel) { - editor.addButton('quicklink', { - icon: 'link', - tooltip: 'Insert/Edit link', - stateSelector: 'a[href]', - onclick: function () { - panel.showForm(editor, 'quicklink'); - } - }); - - editor.addButton('quickimage', { - icon: 'image', - tooltip: 'Insert image', - onclick: function () { - Picker.pickFile().then(function (files) { - var blob = files[0]; - - Conversions.blobToBase64(blob).then(function (base64) { - Actions.insertBlob(editor, base64, blob); - }); - }); - } - }); - - editor.addButton('quicktable', { - icon: 'table', - tooltip: 'Insert table', - onclick: function () { - panel.hide(); - Actions.insertTable(editor, 2, 2); - } - }); - - addHeaderButtons(editor); - }; - - return { - addToEditor: addToEditor - }; -}); - -defineGlobal("l", tinymce.EditorManager); -/** - * SkinLoader.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("5", [ - "l", - "d" -], function (EditorManager, DOM) { - var fireSkinLoaded = function (editor, callback) { - var done = function () { - editor.fire('SkinLoaded'); - callback(); - }; - - if (editor.initialized) { - done(); - } else { - editor.on('init', done); - } - }; - - var load = function (editor, skin, callback) { - var baseUrl = EditorManager.baseURL; - var skinUrl = baseUrl + '/skins/' + skin; - - var done = function () { - fireSkinLoaded(editor, callback); - }; - - DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); - editor.contentCSS.push(skinUrl + '/content.inline.min.css'); - }; - - return { - load: load - }; -}); - - - -/** - * Matcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("8", [ -], function () { - // result :: String, Rect -> Matcher.result - var result = function (id, rect) { - return { - id: id, - rect: rect - }; - }; - - // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null - var match = function (editor, matchers) { - for (var i = 0; i < matchers.length; i++) { - var f = matchers[i]; - var result = f(editor); - - if (result) { - return result; - } - } - - return null; - }; - - return { - match: match, - result: result - }; -}); - -/** - * SelectionMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("6", [ - "8", - "g" -], function (Matcher, Measure) { - // textSelection :: String -> (Editor -> Matcher.result | Null) - var textSelection = function (id) { - return function (editor) { - if (!editor.selection.isCollapsed()) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - }; - }; - - // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) - var emptyTextBlock = function (elements, id) { - return function (editor) { - var i, textBlockElementsMap = editor.schema.getTextBlockElements(); - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName === 'TABLE') { - return null; - } - } - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName in textBlockElementsMap) { - if (editor.dom.isEmpty(elements[i])) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - } - } - - return null; - }; - }; - - return { - textSelection: textSelection, - emptyTextBlock: emptyTextBlock - }; -}); - -/** - * ElementMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("7", [ - "8", - "g" -], function (Matcher, Measure) { - // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) - var element = function (element, predicateIds) { - return function (editor) { - for (var i = 0; i < predicateIds.length; i++) { - if (predicateIds[i].predicate(element)) { - return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); - } - } - - return null; - }; - }; - - // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) - var parent = function (elements, predicateIds) { - return function (editor) { - for (var i = 0; i < elements.length; i++) { - for (var x = 0; x < predicateIds.length; x++) { - if (predicateIds[x].predicate(elements[i])) { - return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); - } - } - } - - return null; - }; - }; - - return { - element: element, - parent: parent - }; -}); - -/** - * Arr.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("9", [ -], function () { - var flatten = function (arr) { - return arr.reduce(function (results, item) { - return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item); - }, []); - }; - - return { - flatten: flatten - }; -}); - -/** - * PredicateId.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("a", [ - "b" -], function (Tools) { - var create = function (id, predicate) { - return { - id: id, - predicate: predicate - }; - }; - - // fromContextToolbars :: [ContextToolbar] -> [PredicateId] - var fromContextToolbars = function (toolbars) { - return Tools.map(toolbars, function (toolbar) { - return create(toolbar.id, toolbar.predicate); - }); - }; - - return { - create: create, - fromContextToolbars: fromContextToolbars - }; -}); - -/** - * Theme.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("0", [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "a" -], function(ThemeManager, Delay, Panel, Buttons, SkinLoader, SelectionMatcher, ElementMatcher, Matcher, Arr, PredicateId) { - var getSelectionElements = function (editor) { - var node = editor.selection.getNode(); - var elms = editor.dom.getParents(node); - return elms; - }; - - var createToolbar = function (editor, selector, id, items) { - var selectorPredicate = function (elm) { - return editor.dom.is(elm, selector); - }; - - return { - predicate: selectorPredicate, - id: id, - items: items - }; - }; - - var getToolbars = function (editor) { - var contextToolbars = editor.contextToolbars; - - return Arr.flatten([ - contextToolbars ? contextToolbars : [], - createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright') - ]); - }; - - var findMatchResult = function (editor, toolbars) { - var result, elements, contextToolbarsPredicateIds; - - elements = getSelectionElements(editor); - contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars); - - result = Matcher.match(editor, [ - ElementMatcher.element(elements[0], contextToolbarsPredicateIds), - SelectionMatcher.textSelection('text'), - SelectionMatcher.emptyTextBlock(elements, 'insert'), - ElementMatcher.parent(elements, contextToolbarsPredicateIds) - ]); - - return result && result.rect ? result : null; - }; - - var togglePanel = function (editor, panel) { - var toggle = function () { - var toolbars = getToolbars(editor); - var result = findMatchResult(editor, toolbars); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } else { - panel.hide(); - } - }; - - return function () { - if (!editor.removed) { - toggle(); - } - }; - }; - - var ignoreWhenFormIsVisible = function (panel, f) { - return function () { - if (!panel.inForm()) { - f(); - } - }; - }; - - var bindContextualToolbarsEvents = function (editor, panel) { - var throttledTogglePanel = Delay.throttle(togglePanel(editor, panel), 0); - var throttledTogglePanelWhenNotInForm = Delay.throttle(ignoreWhenFormIsVisible(panel, togglePanel(editor, panel)), 0); - - editor.on('blur hide ObjectResizeStart', panel.hide); - editor.on('click', throttledTogglePanel); - editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm); - editor.on('ResizeEditor ResizeWindow keyup', throttledTogglePanel); - editor.on('remove', panel.remove); - - editor.shortcuts.add('Alt+F10', '', panel.focus); - }; - - var overrideLinkShortcut = function (editor, panel) { - editor.shortcuts.remove('meta+k'); - editor.shortcuts.add('meta+k', '', function () { - var toolbars = getToolbars(editor); - var result = result = Matcher.match(editor, [ - SelectionMatcher.textSelection('quicklink') - ]); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } - }); - }; - - var renderInlineUI = function (editor, panel) { - var skinName = editor.settings.skin || 'lightgray'; - - SkinLoader.load(editor, skinName, function () { - bindContextualToolbarsEvents(editor, panel); - overrideLinkShortcut(editor, panel); - }); - - return {}; - }; - - var fail = function (message) { - throw new Error(message); - }; - - ThemeManager.add('inlite', function (editor) { - var panel = new Panel(); - - Buttons.addToEditor(editor, panel); - - var renderUI = function () { - return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.'); - }; - - return { - renderUI: renderUI - }; - }); - - return function() {}; -}); - -dem("0")(); -})(); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.raw.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.raw.js deleted file mode 100644 index 13152a5..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/scratch/inline/theme.raw.js +++ /dev/null @@ -1,1679 +0,0 @@ -(function () { - -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} - -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined - }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce/inlite/Theme","global!tinymce.ThemeManager","global!tinymce.util.Delay","tinymce/inlite/ui/Panel","tinymce/inlite/ui/Buttons","tinymce/inlite/core/SkinLoader","tinymce/inlite/core/SelectionMatcher","tinymce/inlite/core/ElementMatcher","tinymce/inlite/core/Matcher","tinymce/inlite/alien/Arr","tinymce/inlite/core/PredicateId","global!tinymce.util.Tools","global!tinymce.ui.Factory","global!tinymce.DOM","tinymce/inlite/ui/Toolbar","tinymce/inlite/ui/Forms","tinymce/inlite/core/Measure","tinymce/inlite/core/Layout","tinymce/inlite/file/Conversions","tinymce/inlite/file/Picker","tinymce/inlite/core/Actions","global!tinymce.EditorManager","global!tinymce.util.Promise","tinymce/inlite/alien/Uuid","tinymce/inlite/alien/Unlink","tinymce/inlite/core/UrlType","global!tinymce.geom.Rect","tinymce/inlite/core/Convert","tinymce/inlite/alien/Bookmark","global!tinymce.dom.TreeWalker","global!tinymce.dom.RangeUtils"] -jsc*/ -defineGlobal("global!tinymce.ThemeManager", tinymce.ThemeManager); -defineGlobal("global!tinymce.util.Delay", tinymce.util.Delay); -defineGlobal("global!tinymce.util.Tools", tinymce.util.Tools); -defineGlobal("global!tinymce.ui.Factory", tinymce.ui.Factory); -defineGlobal("global!tinymce.DOM", tinymce.DOM); -/** - * Toolbar.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Toolbar', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory' -], function (Tools, Factory) { - var setActiveItem = function (item, name) { - return function(state, args) { - var nodeName, i = args.parents.length; - - while (i--) { - nodeName = args.parents[i].nodeName; - if (nodeName == 'OL' || nodeName == 'UL') { - break; - } - } - - item.active(state && nodeName == name); - }; - }; - - var getSelectorStateResult = function (itemName, item) { - var result = function (selector, handler) { - return { - selector: selector, - handler: handler - }; - }; - - var activeHandler = function(state) { - item.active(state); - }; - - var disabledHandler = function (state) { - item.disabled(state); - }; - - if (itemName == 'bullist') { - return result('ul > li', setActiveItem(item, 'UL')); - } - - if (itemName == 'numlist') { - return result('ol > li', setActiveItem(item, 'OL')); - } - - if (item.settings.stateSelector) { - return result(item.settings.stateSelector, activeHandler); - } - - if (item.settings.disabledStateSelector) { - return result(item.settings.disabledStateSelector, disabledHandler); - } - - return null; - }; - - var bindSelectorChanged = function (editor, itemName, item) { - return function () { - var result = getSelectorStateResult(itemName, item); - if (result !== null) { - editor.selection.selectorChanged(result.selector, result.handler); - } - }; - }; - - var create = function (editor, name, items) { - var toolbarItems = [], buttonGroup; - - if (!items) { - return; - } - - Tools.each(items.split(/[ ,]/), function(item) { - var itemName; - - if (item == '|') { - buttonGroup = null; - } else { - if (Factory.has(item)) { - item = {type: item}; - toolbarItems.push(item); - buttonGroup = null; - } else { - if (!buttonGroup) { - buttonGroup = {type: 'buttongroup', items: []}; - toolbarItems.push(buttonGroup); - } - - if (editor.buttons[item]) { - itemName = item; - item = editor.buttons[itemName]; - - if (typeof item == 'function') { - item = item(); - } - - item.type = item.type || 'button'; - - item = Factory.create(item); - item.on('postRender', bindSelectorChanged(editor, itemName, item)); - buttonGroup.items.push(item); - } - } - } - }); - - return Factory.create({ - type: 'toolbar', - layout: 'flow', - name: name, - items: toolbarItems - }); - }; - - return { - create: create - }; -}); - -defineGlobal("global!tinymce.util.Promise", tinymce.util.Promise); -/** - * Uuid.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Generates unique ids this is the same as in core but since - * it's not exposed as a global we can't access it. - */ -define("tinymce/inlite/alien/Uuid", [ -], function() { - var count = 0; - - var seed = function () { - var rnd = function () { - return Math.round(Math.random() * 0xFFFFFFFF).toString(36); - }; - - return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); - }; - - var uuid = function (prefix) { - return prefix + (count++) + seed(); - }; - - return { - uuid: uuid - }; -}); - -/** - * Bookmark.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Bookmark', [ -], function () { - /** - * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with - * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans - * added to them since they can be restored after a dom operation. - * - * So this:

||

- * becomes:

||

- * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - var create = function (dom, rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - }; - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - var resolve = function (dom, bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - return rng; - }; - - return { - create: create, - resolve: resolve - }; -}); - - - -defineGlobal("global!tinymce.dom.TreeWalker", tinymce.dom.TreeWalker); -defineGlobal("global!tinymce.dom.RangeUtils", tinymce.dom.RangeUtils); -/** - * Unlink.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Unlink implementation that doesn't leave partial links for example it would produce: - * a[bc]de -> a[bc]de - * instead of: - * a[bc]de -> a[bc]de - */ -define("tinymce/inlite/alien/Unlink", [ - 'tinymce/inlite/alien/Bookmark', - 'global!tinymce.util.Tools', - 'global!tinymce.dom.TreeWalker', - 'global!tinymce.dom.RangeUtils' -], function (Bookmark, Tools, TreeWalker, RangeUtils) { - var getSelectedElements = function (rootElm, startNode, endNode) { - var walker, node, elms = []; - - walker = new TreeWalker(startNode, rootElm); - for (node = startNode; node; node = walker.next()) { - if (node.nodeType === 1) { - elms.push(node); - } - - if (node === endNode) { - break; - } - } - - return elms; - }; - - var unwrapElements = function (editor, elms) { - var bookmark, dom, selection; - - dom = editor.dom; - selection = editor.selection; - bookmark = Bookmark.create(dom, selection.getRng()); - - Tools.each(elms, function (elm) { - editor.dom.remove(elm, true); - }); - - selection.setRng(Bookmark.resolve(dom, bookmark)); - }; - - var isLink = function (elm) { - return elm.nodeName === 'A' && elm.hasAttribute('href'); - }; - - var getParentAnchorOrSelf = function (dom, elm) { - var anchorElm = dom.getParent(elm, isLink); - return anchorElm ? anchorElm : elm; - }; - - var getSelectedAnchors = function (editor) { - var startElm, endElm, rootElm, anchorElms, selection, dom, rng; - - selection = editor.selection; - dom = editor.dom; - rng = selection.getRng(); - startElm = getParentAnchorOrSelf(dom, RangeUtils.getNode(rng.startContainer, rng.startOffset)); - endElm = RangeUtils.getNode(rng.endContainer, rng.endOffset); - rootElm = editor.getBody(); - anchorElms = Tools.grep(getSelectedElements(rootElm, startElm, endElm), isLink); - - return anchorElms; - }; - - var unlinkSelection = function (editor) { - unwrapElements(editor, getSelectedAnchors(editor)); - }; - - return { - unlinkSelection: unlinkSelection - }; -}); - -/** - * Actions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Actions', [ - 'tinymce/inlite/alien/Uuid', - 'tinymce/inlite/alien/Unlink' -], function (Uuid, Unlink) { - var createTableHtml = function (cols, rows) { - var x, y, html; - - html = ''; - html += ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - html += '

'; - - return html; - }; - - var getInsertedElement = function (editor) { - var elms = editor.dom.select('*[data-mce-id]'); - return elms[0]; - }; - - var insertTable = function (editor, cols, rows) { - editor.undoManager.transact(function () { - var tableElm, cellElm; - - editor.insertContent(createTableHtml(cols, rows)); - - tableElm = getInsertedElement(editor); - tableElm.removeAttribute('data-mce-id'); - cellElm = editor.dom.select('td,th', tableElm); - editor.selection.setCursorLocation(cellElm[0], 0); - }); - }; - - var formatBlock = function (editor, formatName) { - editor.execCommand('FormatBlock', false, formatName); - }; - - var insertBlob = function (editor, base64, blob) { - var blobCache, blobInfo; - - blobCache = editor.editorUpload.blobCache; - blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64); - blobCache.add(blobInfo); - - editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()})); - }; - - var collapseSelectionToEnd = function (editor) { - editor.selection.collapse(false); - }; - - var unlink = function (editor) { - editor.focus(); - Unlink.unlinkSelection(editor); - collapseSelectionToEnd(editor); - }; - - var changeHref = function (editor, elm, url) { - editor.focus(); - editor.dom.setAttrib(elm, 'href', url); - collapseSelectionToEnd(editor); - }; - - var insertLink = function (editor, url) { - editor.execCommand('mceInsertLink', false, {href: url}); - collapseSelectionToEnd(editor); - }; - - var updateOrInsertLink = function (editor, url) { - var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - elm ? changeHref(editor, elm, url) : insertLink(editor, url); - }; - - var createLink = function (editor, url) { - url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url); - }; - - return { - insertTable: insertTable, - formatBlock: formatBlock, - insertBlob: insertBlob, - createLink: createLink, - unlink: unlink - }; -}); - -/** - * UrlType.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/UrlType', [ -], function () { - var isDomainLike = function (href) { - return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); - }; - - var isAbsolute = function (href) { - return /^https?:\/\//.test(href.trim()); - }; - - return { - isDomainLike: isDomainLike, - isAbsolute: isAbsolute - }; -}); - - - -/** - * Forms.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Forms', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.util.Promise', - 'tinymce/inlite/core/Actions', - 'tinymce/inlite/core/UrlType' -], function (Tools, Factory, Promise, Actions, UrlType) { - var focusFirstTextBox = function (form) { - form.find('textbox').eq(0).each(function (ctrl) { - ctrl.focus(); - }); - }; - - var createForm = function (name, spec) { - var form = Factory.create( - Tools.extend({ - type: 'form', - layout: 'flex', - direction: 'row', - padding: 5, - name: name, - spacing: 3 - }, spec) - ); - - form.on('show', function () { - focusFirstTextBox(form); - }); - - return form; - }; - - var toggleVisibility = function (ctrl, state) { - return state ? ctrl.show() : ctrl.hide(); - }; - - var askAboutPrefix = function (editor, href) { - return new Promise(function (resolve) { - editor.windowManager.confirm( - 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', - function (result) { - var output = result === true ? 'http://' + href : href; - resolve(output); - } - ); - }); - }; - - var convertLinkToAbsolute = function (editor, href) { - return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href); - }; - - var createQuickLinkForm = function (editor, hide) { - var unlink = function () { - editor.focus(); - Actions.unlink(editor); - hide(); - }; - - return createForm('quicklink', { - items: [ - {type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link'}, - {type: 'textbox', name: 'linkurl', placeholder: 'Paste or type a link'}, - {type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit'} - ], - onshow: function () { - var elm, linkurl = ''; - - elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - if (elm) { - linkurl = editor.dom.getAttrib(elm, 'href'); - } - - this.fromJSON({ - linkurl: linkurl - }); - - toggleVisibility(this.find('#unlink'), elm); - }, - onsubmit: function (e) { - convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) { - Actions.createLink(editor, url); - hide(); - }); - } - }); - }; - - return { - createQuickLinkForm: createQuickLinkForm - }; -}); - -defineGlobal("global!tinymce.geom.Rect", tinymce.geom.Rect); -/** - * Convert.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Convert', [ -], function () { - var fromClientRect = function (clientRect) { - return { - x: clientRect.left, - y: clientRect.top, - w: clientRect.width, - h: clientRect.height - }; - }; - - var toClientRect = function (geomRect) { - return { - left: geomRect.x, - top: geomRect.y, - width: geomRect.w, - height: geomRect.h, - right: geomRect.x + geomRect.w, - bottom: geomRect.y + geomRect.h - }; - }; - - return { - fromClientRect: fromClientRect, - toClientRect: toClientRect - }; -}); - -/** - * Measure.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Measure', [ - 'global!tinymce.DOM', - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (DOM, Rect, Convert) { - var toAbsolute = function (rect) { - var vp = DOM.getViewPort(); - - return { - x: rect.x + vp.x, - y: rect.y + vp.y, - w: rect.w, - h: rect.h - }; - }; - - var measureElement = function (elm) { - var clientRect = elm.getBoundingClientRect(); - - return toAbsolute({ - x: clientRect.left, - y: clientRect.top, - w: Math.max(elm.clientWidth, elm.offsetWidth), - h: Math.max(elm.clientHeight, elm.offsetHeight) - }); - }; - - var getElementRect = function (editor, elm) { - return measureElement(elm); - }; - - var getPageAreaRect = function (editor) { - return measureElement(editor.getElement().ownerDocument.body); - }; - - var getContentAreaRect = function (editor) { - return measureElement(editor.getContentAreaContainer() || editor.getBody()); - }; - - var getSelectionRect = function (editor) { - var clientRect = editor.selection.getBoundingClientRect(); - return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null; - }; - - return { - getElementRect: getElementRect, - getPageAreaRect: getPageAreaRect, - getContentAreaRect: getContentAreaRect, - getSelectionRect: getSelectionRect - }; -}); - -/** - * Layout.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Layout', [ - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (Rect, Convert) { - var result = function (rect, position) { - return { - rect: rect, - position: position - }; - }; - - var moveTo = function (rect, toRect) { - return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h}; - }; - - var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) { - var relPos, relRect, outputPanelRect; - - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1); - targetRect = Rect.clamp(targetRect, contentAreaRect); - - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - targetRect = Rect.intersect(contentAreaRect, targetRect); - if (targetRect) { - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2); - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - outputPanelRect = moveTo(panelRect, targetRect); - return result(outputPanelRect, relPos); - } - - return null; - }; - - var calcInsert = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['cr-cl', 'cl-cr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var calc = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) { - var userConstrainedPanelRect; - - if (typeof handler === 'function') { - userConstrainedPanelRect = handler({ - elementRect: Convert.toClientRect(targetRect), - contentAreaRect: Convert.toClientRect(contentAreaRect), - panelRect: Convert.toClientRect(panelRect) - }); - - return Convert.fromClientRect(userConstrainedPanelRect); - } - - return panelRect; - }; - - return { - calcInsert: calcInsert, - calc: calc, - userConstrain: userConstrain - }; -}); - -/** - * Panel.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Panel', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.DOM', - 'tinymce/inlite/ui/Toolbar', - 'tinymce/inlite/ui/Forms', - 'tinymce/inlite/core/Measure', - 'tinymce/inlite/core/Layout' -], function (Tools, Factory, DOM, Toolbar, Forms, Measure, Layout) { - return function () { - var DEFAULT_TEXT_SELECTION_ITEMS = 'bold italic | quicklink h2 h3 blockquote'; - var DEFAULT_INSERT_TOOLBAR_ITEMS = 'quickimage quicktable'; - var panel, currentRect; - - var createToolbars = function (editor, toolbars) { - return Tools.map(toolbars, function (toolbar) { - return Toolbar.create(editor, toolbar.id, toolbar.items); - }); - }; - - var getTextSelectionToolbarItems = function (settings) { - var value = settings.selection_toolbar; - return value ? value : DEFAULT_TEXT_SELECTION_ITEMS; - }; - - var getInsertToolbarItems = function (settings) { - var value = settings.insert_toolbar; - return value ? value : DEFAULT_INSERT_TOOLBAR_ITEMS; - }; - - var create = function (editor, toolbars) { - var items, settings = editor.settings; - - items = createToolbars(editor, toolbars); - items = items.concat([ - Toolbar.create(editor, 'text', getTextSelectionToolbarItems(settings)), - Toolbar.create(editor, 'insert', getInsertToolbarItems(settings)), - Forms.createQuickLinkForm(editor, hide) - ]); - - return Factory.create({ - type: 'floatpanel', - role: 'dialog', - classes: 'tinymce tinymce-inline arrow', - ariaLabel: 'Inline toolbar', - layout: 'flex', - direction: 'column', - align: 'stretch', - autohide: false, - autofix: true, - fixed: true, - border: 1, - items: items, - oncancel: function() { - editor.focus(); - } - }); - }; - - var showPanel = function (panel) { - if (panel) { - panel.show(); - } - }; - - var movePanelTo = function (panel, pos) { - panel.moveTo(pos.x, pos.y); - }; - - var togglePositionClass = function (panel, relPos) { - relPos = relPos ? relPos.substr(0, 2) : ''; - - Tools.each({ - t: 'down', - b: 'up', - c: 'center' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1)); - }); - - if (relPos === 'cr') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', false); - } else if (relPos === 'cl') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', true); - } else { - Tools.each({ - l: 'left', - r: 'right' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1)); - }); - } - }; - - var showToolbar = function (panel, id) { - var toolbars = panel.items().filter('#' + id); - - if (toolbars.length > 0) { - toolbars[0].show(); - panel.reflow(); - } - }; - - var showPanelAt = function (panel, id, editor, targetRect) { - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - if (id === 'insert') { - result = Layout.calcInsert(targetRect, contentAreaRect, panelRect); - } else { - result = Layout.calc(targetRect, contentAreaRect, panelRect); - } - - if (result) { - panelRect = result.rect; - currentRect = targetRect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } else { - hide(panel); - } - }; - - var hasFormVisible = function () { - return panel.items().filter('form:visible').length > 0; - }; - - var showForm = function (editor, id) { - if (panel) { - panel.items().hide(); - showToolbar(panel, id); - - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - result = Layout.calc(currentRect, contentAreaRect, panelRect); - - if (result) { - panelRect = result.rect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } - } - }; - - var show = function (editor, id, targetRect, toolbars) { - if (!panel) { - panel = create(editor, toolbars); - panel.renderTo(document.body).reflow().moveTo(targetRect.x, targetRect.y); - editor.nodeChanged(); - } - - showPanelAt(panel, id, editor, targetRect); - }; - - var hide = function () { - if (panel) { - panel.hide(); - } - }; - - var focus = function () { - if (panel) { - panel.find('toolbar:visible').eq(0).each(function (item) { - item.focus(true); - }); - } - }; - - var remove = function () { - if (panel) { - panel.remove(); - panel = null; - } - }; - - var inForm = function () { - return panel && panel.visible() && hasFormVisible(); - }; - - return { - show: show, - showForm: showForm, - inForm: inForm, - hide: hide, - focus: focus, - remove: remove - }; - }; -}); - -/** - * Conversions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Conversions', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var blobToBase64 = function (blob) { - return new Promise(function(resolve) { - var reader = new FileReader(); - - reader.onloadend = function() { - resolve(reader.result.split(',')[1]); - }; - - reader.readAsDataURL(blob); - }); - }; - - return { - blobToBase64: blobToBase64 - }; -}); - - - -/** - * Picker.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Picker', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var pickFile = function () { - return new Promise(function (resolve) { - var fileInput; - - fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.style.position = 'fixed'; - fileInput.style.left = 0; - fileInput.style.top = 0; - fileInput.style.opacity = 0.001; - document.body.appendChild(fileInput); - - fileInput.onchange = function(e) { - resolve(Array.prototype.slice.call(e.target.files)); - }; - - fileInput.click(); - fileInput.parentNode.removeChild(fileInput); - }); - }; - - return { - pickFile: pickFile - }; -}); - - - -/** - * Buttons.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Buttons', [ - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/file/Conversions', - 'tinymce/inlite/file/Picker', - 'tinymce/inlite/core/Actions' -], function (Panel, Conversions, Picker, Actions) { - var addHeaderButtons = function (editor) { - var formatBlock = function (name) { - return function () { - Actions.formatBlock(editor, name); - }; - }; - - for (var i = 1; i < 6; i++) { - var name = 'h' + i; - - editor.addButton(name, { - text: name.toUpperCase(), - tooltip: 'Heading ' + i, - stateSelector: name, - onclick: formatBlock(name), - onPostRender: function () { - // TODO: Remove this hack that produces bold H1-H6 when we have proper icons - var span = this.getEl().firstChild.firstChild; - span.style.fontWeight = 'bold'; - } - }); - } - }; - - var addToEditor = function (editor, panel) { - editor.addButton('quicklink', { - icon: 'link', - tooltip: 'Insert/Edit link', - stateSelector: 'a[href]', - onclick: function () { - panel.showForm(editor, 'quicklink'); - } - }); - - editor.addButton('quickimage', { - icon: 'image', - tooltip: 'Insert image', - onclick: function () { - Picker.pickFile().then(function (files) { - var blob = files[0]; - - Conversions.blobToBase64(blob).then(function (base64) { - Actions.insertBlob(editor, base64, blob); - }); - }); - } - }); - - editor.addButton('quicktable', { - icon: 'table', - tooltip: 'Insert table', - onclick: function () { - panel.hide(); - Actions.insertTable(editor, 2, 2); - } - }); - - addHeaderButtons(editor); - }; - - return { - addToEditor: addToEditor - }; -}); - -defineGlobal("global!tinymce.EditorManager", tinymce.EditorManager); -/** - * SkinLoader.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SkinLoader', [ - 'global!tinymce.EditorManager', - 'global!tinymce.DOM' -], function (EditorManager, DOM) { - var fireSkinLoaded = function (editor, callback) { - var done = function () { - editor.fire('SkinLoaded'); - callback(); - }; - - if (editor.initialized) { - done(); - } else { - editor.on('init', done); - } - }; - - var load = function (editor, skin, callback) { - var baseUrl = EditorManager.baseURL; - var skinUrl = baseUrl + '/skins/' + skin; - - var done = function () { - fireSkinLoaded(editor, callback); - }; - - DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); - editor.contentCSS.push(skinUrl + '/content.inline.min.css'); - }; - - return { - load: load - }; -}); - - - -/** - * Matcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Matcher', [ -], function () { - // result :: String, Rect -> Matcher.result - var result = function (id, rect) { - return { - id: id, - rect: rect - }; - }; - - // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null - var match = function (editor, matchers) { - for (var i = 0; i < matchers.length; i++) { - var f = matchers[i]; - var result = f(editor); - - if (result) { - return result; - } - } - - return null; - }; - - return { - match: match, - result: result - }; -}); - -/** - * SelectionMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SelectionMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // textSelection :: String -> (Editor -> Matcher.result | Null) - var textSelection = function (id) { - return function (editor) { - if (!editor.selection.isCollapsed()) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - }; - }; - - // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) - var emptyTextBlock = function (elements, id) { - return function (editor) { - var i, textBlockElementsMap = editor.schema.getTextBlockElements(); - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName === 'TABLE') { - return null; - } - } - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName in textBlockElementsMap) { - if (editor.dom.isEmpty(elements[i])) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - } - } - - return null; - }; - }; - - return { - textSelection: textSelection, - emptyTextBlock: emptyTextBlock - }; -}); - -/** - * ElementMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/ElementMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) - var element = function (element, predicateIds) { - return function (editor) { - for (var i = 0; i < predicateIds.length; i++) { - if (predicateIds[i].predicate(element)) { - return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); - } - } - - return null; - }; - }; - - // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) - var parent = function (elements, predicateIds) { - return function (editor) { - for (var i = 0; i < elements.length; i++) { - for (var x = 0; x < predicateIds.length; x++) { - if (predicateIds[x].predicate(elements[i])) { - return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); - } - } - } - - return null; - }; - }; - - return { - element: element, - parent: parent - }; -}); - -/** - * Arr.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Arr', [ -], function () { - var flatten = function (arr) { - return arr.reduce(function (results, item) { - return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item); - }, []); - }; - - return { - flatten: flatten - }; -}); - -/** - * PredicateId.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/PredicateId', [ - 'global!tinymce.util.Tools' -], function (Tools) { - var create = function (id, predicate) { - return { - id: id, - predicate: predicate - }; - }; - - // fromContextToolbars :: [ContextToolbar] -> [PredicateId] - var fromContextToolbars = function (toolbars) { - return Tools.map(toolbars, function (toolbar) { - return create(toolbar.id, toolbar.predicate); - }); - }; - - return { - create: create, - fromContextToolbars: fromContextToolbars - }; -}); - -/** - * Theme.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/Theme', [ - 'global!tinymce.ThemeManager', - 'global!tinymce.util.Delay', - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/ui/Buttons', - 'tinymce/inlite/core/SkinLoader', - 'tinymce/inlite/core/SelectionMatcher', - 'tinymce/inlite/core/ElementMatcher', - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/alien/Arr', - 'tinymce/inlite/core/PredicateId' -], function(ThemeManager, Delay, Panel, Buttons, SkinLoader, SelectionMatcher, ElementMatcher, Matcher, Arr, PredicateId) { - var getSelectionElements = function (editor) { - var node = editor.selection.getNode(); - var elms = editor.dom.getParents(node); - return elms; - }; - - var createToolbar = function (editor, selector, id, items) { - var selectorPredicate = function (elm) { - return editor.dom.is(elm, selector); - }; - - return { - predicate: selectorPredicate, - id: id, - items: items - }; - }; - - var getToolbars = function (editor) { - var contextToolbars = editor.contextToolbars; - - return Arr.flatten([ - contextToolbars ? contextToolbars : [], - createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright') - ]); - }; - - var findMatchResult = function (editor, toolbars) { - var result, elements, contextToolbarsPredicateIds; - - elements = getSelectionElements(editor); - contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars); - - result = Matcher.match(editor, [ - ElementMatcher.element(elements[0], contextToolbarsPredicateIds), - SelectionMatcher.textSelection('text'), - SelectionMatcher.emptyTextBlock(elements, 'insert'), - ElementMatcher.parent(elements, contextToolbarsPredicateIds) - ]); - - return result && result.rect ? result : null; - }; - - var togglePanel = function (editor, panel) { - var toggle = function () { - var toolbars = getToolbars(editor); - var result = findMatchResult(editor, toolbars); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } else { - panel.hide(); - } - }; - - return function () { - if (!editor.removed) { - toggle(); - } - }; - }; - - var ignoreWhenFormIsVisible = function (panel, f) { - return function () { - if (!panel.inForm()) { - f(); - } - }; - }; - - var bindContextualToolbarsEvents = function (editor, panel) { - var throttledTogglePanel = Delay.throttle(togglePanel(editor, panel), 0); - var throttledTogglePanelWhenNotInForm = Delay.throttle(ignoreWhenFormIsVisible(panel, togglePanel(editor, panel)), 0); - - editor.on('blur hide ObjectResizeStart', panel.hide); - editor.on('click', throttledTogglePanel); - editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm); - editor.on('ResizeEditor ResizeWindow keyup', throttledTogglePanel); - editor.on('remove', panel.remove); - - editor.shortcuts.add('Alt+F10', '', panel.focus); - }; - - var overrideLinkShortcut = function (editor, panel) { - editor.shortcuts.remove('meta+k'); - editor.shortcuts.add('meta+k', '', function () { - var toolbars = getToolbars(editor); - var result = result = Matcher.match(editor, [ - SelectionMatcher.textSelection('quicklink') - ]); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } - }); - }; - - var renderInlineUI = function (editor, panel) { - var skinName = editor.settings.skin || 'lightgray'; - - SkinLoader.load(editor, skinName, function () { - bindContextualToolbarsEvents(editor, panel); - overrideLinkShortcut(editor, panel); - }); - - return {}; - }; - - var fail = function (message) { - throw new Error(message); - }; - - ThemeManager.add('inlite', function (editor) { - var panel = new Panel(); - - Buttons.addToEditor(editor, panel); - - var renderUI = function () { - return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.'); - }; - - return { - renderUI: renderUI - }; - }); - - return function() {}; -}); - -dem('tinymce/inlite/Theme')(); -})(); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/css/demo.css b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/css/demo.css deleted file mode 100644 index 3e6c242..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/css/demo.css +++ /dev/null @@ -1,25 +0,0 @@ -blockquote { - border-left: 3px solid rgba(0,0,0,.8); - padding-left: 20px; - margin: 0; -} - -.mce-edit-focus { - outline: 1px solid blue; -} - -.tinymce { - margin: 10px; - padding: 10px; - overflow: auto; - border: 1px solid gray; -} - -table, td { - border: 1px dashed gray; -} - -/*.mce-tinymce-inline { - transition: left 50ms ease-in-out, top 50ms ease-in-out; -} -*/ \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/html/demo.html b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/html/demo.html deleted file mode 100644 index 84b60db..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/html/demo.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -inlite-theme Demo Page - - - - - - - -

inlite-theme Demo Page

-
-
-

- - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ultricies posuere felis sed interdum. Quisque nec diam - nec purus gravida dapibus -

-

- eget non nulla. Ut eu vestibulum libero. Vestibulum pretium est vitae metus auctor, quis fermentum mi - luctus. Fusce aliquet tincidunt massa vitae scelerisque. Vivamus in tellus risus. Mauris auctor metus ut gravida feugiat. - Nunc consequat urna eu augue commodo, eget malesuada odio fringilla. Morbi vitae turpis in elit laoreet malesuada a nec massa. -

- - - - - - - - - - - -
Lorem ipsum dolor sit ametLorem ipsum dolor sit amet
Vivamus in tellus risusVivamus in tellus risus
-
- -
- -
-

- - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ultricies posuere felis sed interdum. Quisque nec diam - nec purus gravida dapibus -

-

- eget non nulla. Ut eu vestibulum libero. Vestibulum pretium est vitae metus auctor, quis fermentum mi - luctus. Fusce aliquet tincidunt massa vitae scelerisque. Vivamus in tellus risus. Mauris auctor metus ut gravida feugiat. - Nunc consequat urna eu augue commodo, eget malesuada odio fringilla. Morbi vitae turpis in elit laoreet malesuada a nec massa. -

- - - - - - - - - - - -
Lorem ipsum dolor sit ametLorem ipsum dolor sit amet
Vivamus in tellus risusVivamus in tellus risus
-
-
- - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js deleted file mode 100644 index 6140a3d..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Demo.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint no-console:0 */ - -define('tinymce/inlite/Demo', [ - 'tinymce/inlite/Theme', - 'global!tinymce' -], function(Theme, tinymce) { - tinymce.init({ - selector: 'div.tinymce', - theme: 'inlite', - plugins: 'image table link paste contextmenu textpattern autolink', - insert_toolbar: 'quickimage quicktable', - selection_toolbar: 'bold italic | quicklink h2 h3 blockquote', - inline: true, - paste_data_images: true - }); - - return function() {}; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js deleted file mode 100644 index 28ded12..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Theme.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/Theme', [ - 'global!tinymce.ThemeManager', - 'global!tinymce.util.Delay', - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/ui/Buttons', - 'tinymce/inlite/core/SkinLoader', - 'tinymce/inlite/core/SelectionMatcher', - 'tinymce/inlite/core/ElementMatcher', - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/alien/Arr', - 'tinymce/inlite/core/PredicateId' -], function(ThemeManager, Delay, Panel, Buttons, SkinLoader, SelectionMatcher, ElementMatcher, Matcher, Arr, PredicateId) { - var getSelectionElements = function (editor) { - var node = editor.selection.getNode(); - var elms = editor.dom.getParents(node); - return elms; - }; - - var createToolbar = function (editor, selector, id, items) { - var selectorPredicate = function (elm) { - return editor.dom.is(elm, selector); - }; - - return { - predicate: selectorPredicate, - id: id, - items: items - }; - }; - - var getToolbars = function (editor) { - var contextToolbars = editor.contextToolbars; - - return Arr.flatten([ - contextToolbars ? contextToolbars : [], - createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright') - ]); - }; - - var findMatchResult = function (editor, toolbars) { - var result, elements, contextToolbarsPredicateIds; - - elements = getSelectionElements(editor); - contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars); - - result = Matcher.match(editor, [ - ElementMatcher.element(elements[0], contextToolbarsPredicateIds), - SelectionMatcher.textSelection('text'), - SelectionMatcher.emptyTextBlock(elements, 'insert'), - ElementMatcher.parent(elements, contextToolbarsPredicateIds) - ]); - - return result && result.rect ? result : null; - }; - - var togglePanel = function (editor, panel) { - var toggle = function () { - var toolbars = getToolbars(editor); - var result = findMatchResult(editor, toolbars); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } else { - panel.hide(); - } - }; - - return function () { - if (!editor.removed) { - toggle(); - } - }; - }; - - var ignoreWhenFormIsVisible = function (panel, f) { - return function () { - if (!panel.inForm()) { - f(); - } - }; - }; - - var bindContextualToolbarsEvents = function (editor, panel) { - var throttledTogglePanel = Delay.throttle(togglePanel(editor, panel), 0); - var throttledTogglePanelWhenNotInForm = Delay.throttle(ignoreWhenFormIsVisible(panel, togglePanel(editor, panel)), 0); - - editor.on('blur hide ObjectResizeStart', panel.hide); - editor.on('click', throttledTogglePanel); - editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm); - editor.on('ResizeEditor ResizeWindow keyup', throttledTogglePanel); - editor.on('remove', panel.remove); - - editor.shortcuts.add('Alt+F10', '', panel.focus); - }; - - var overrideLinkShortcut = function (editor, panel) { - editor.shortcuts.remove('meta+k'); - editor.shortcuts.add('meta+k', '', function () { - var toolbars = getToolbars(editor); - var result = result = Matcher.match(editor, [ - SelectionMatcher.textSelection('quicklink') - ]); - - if (result) { - panel.show(editor, result.id, result.rect, toolbars); - } - }); - }; - - var renderInlineUI = function (editor, panel) { - var skinName = editor.settings.skin || 'lightgray'; - - SkinLoader.load(editor, skinName, function () { - bindContextualToolbarsEvents(editor, panel); - overrideLinkShortcut(editor, panel); - }); - - return {}; - }; - - var fail = function (message) { - throw new Error(message); - }; - - ThemeManager.add('inlite', function (editor) { - var panel = new Panel(); - - Buttons.addToEditor(editor, panel); - - var renderUI = function () { - return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.'); - }; - - return { - renderUI: renderUI - }; - }); - - return function() {}; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js deleted file mode 100644 index 3e88845..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Arr.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Arr', [ -], function () { - var flatten = function (arr) { - return arr.reduce(function (results, item) { - return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item); - }, []); - }; - - return { - flatten: flatten - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js deleted file mode 100644 index 7446f36..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Bookmark.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/alien/Bookmark', [ -], function () { - /** - * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with - * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans - * added to them since they can be restored after a dom operation. - * - * So this:

||

- * becomes:

||

- * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - var create = function (dom, rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - }; - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - var resolve = function (dom, bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - return rng; - }; - - return { - create: create, - resolve: resolve - }; -}); - - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js deleted file mode 100644 index aa595a1..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Unlink.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Unlink implementation that doesn't leave partial links for example it would produce: - * a[bc]de -> a[bc]de - * instead of: - * a[bc]de -> a[bc]de - */ -define("tinymce/inlite/alien/Unlink", [ - 'tinymce/inlite/alien/Bookmark', - 'global!tinymce.util.Tools', - 'global!tinymce.dom.TreeWalker', - 'global!tinymce.dom.RangeUtils' -], function (Bookmark, Tools, TreeWalker, RangeUtils) { - var getSelectedElements = function (rootElm, startNode, endNode) { - var walker, node, elms = []; - - walker = new TreeWalker(startNode, rootElm); - for (node = startNode; node; node = walker.next()) { - if (node.nodeType === 1) { - elms.push(node); - } - - if (node === endNode) { - break; - } - } - - return elms; - }; - - var unwrapElements = function (editor, elms) { - var bookmark, dom, selection; - - dom = editor.dom; - selection = editor.selection; - bookmark = Bookmark.create(dom, selection.getRng()); - - Tools.each(elms, function (elm) { - editor.dom.remove(elm, true); - }); - - selection.setRng(Bookmark.resolve(dom, bookmark)); - }; - - var isLink = function (elm) { - return elm.nodeName === 'A' && elm.hasAttribute('href'); - }; - - var getParentAnchorOrSelf = function (dom, elm) { - var anchorElm = dom.getParent(elm, isLink); - return anchorElm ? anchorElm : elm; - }; - - var getSelectedAnchors = function (editor) { - var startElm, endElm, rootElm, anchorElms, selection, dom, rng; - - selection = editor.selection; - dom = editor.dom; - rng = selection.getRng(); - startElm = getParentAnchorOrSelf(dom, RangeUtils.getNode(rng.startContainer, rng.startOffset)); - endElm = RangeUtils.getNode(rng.endContainer, rng.endOffset); - rootElm = editor.getBody(); - anchorElms = Tools.grep(getSelectedElements(rootElm, startElm, endElm), isLink); - - return anchorElms; - }; - - var unlinkSelection = function (editor) { - unwrapElements(editor, getSelectedAnchors(editor)); - }; - - return { - unlinkSelection: unlinkSelection - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js deleted file mode 100644 index a863c2e..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Uuid.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Generates unique ids this is the same as in core but since - * it's not exposed as a global we can't access it. - */ -define("tinymce/inlite/alien/Uuid", [ -], function() { - var count = 0; - - var seed = function () { - var rnd = function () { - return Math.round(Math.random() * 0xFFFFFFFF).toString(36); - }; - - return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); - }; - - var uuid = function (prefix) { - return prefix + (count++) + seed(); - }; - - return { - uuid: uuid - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js deleted file mode 100644 index 9a95e2d..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Actions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Actions', [ - 'tinymce/inlite/alien/Uuid', - 'tinymce/inlite/alien/Unlink' -], function (Uuid, Unlink) { - var createTableHtml = function (cols, rows) { - var x, y, html; - - html = ''; - html += ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - html += '

'; - - return html; - }; - - var getInsertedElement = function (editor) { - var elms = editor.dom.select('*[data-mce-id]'); - return elms[0]; - }; - - var insertTable = function (editor, cols, rows) { - editor.undoManager.transact(function () { - var tableElm, cellElm; - - editor.insertContent(createTableHtml(cols, rows)); - - tableElm = getInsertedElement(editor); - tableElm.removeAttribute('data-mce-id'); - cellElm = editor.dom.select('td,th', tableElm); - editor.selection.setCursorLocation(cellElm[0], 0); - }); - }; - - var formatBlock = function (editor, formatName) { - editor.execCommand('FormatBlock', false, formatName); - }; - - var insertBlob = function (editor, base64, blob) { - var blobCache, blobInfo; - - blobCache = editor.editorUpload.blobCache; - blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64); - blobCache.add(blobInfo); - - editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()})); - }; - - var collapseSelectionToEnd = function (editor) { - editor.selection.collapse(false); - }; - - var unlink = function (editor) { - editor.focus(); - Unlink.unlinkSelection(editor); - collapseSelectionToEnd(editor); - }; - - var changeHref = function (editor, elm, url) { - editor.focus(); - editor.dom.setAttrib(elm, 'href', url); - collapseSelectionToEnd(editor); - }; - - var insertLink = function (editor, url) { - editor.execCommand('mceInsertLink', false, {href: url}); - collapseSelectionToEnd(editor); - }; - - var updateOrInsertLink = function (editor, url) { - var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - elm ? changeHref(editor, elm, url) : insertLink(editor, url); - }; - - var createLink = function (editor, url) { - url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url); - }; - - return { - insertTable: insertTable, - formatBlock: formatBlock, - insertBlob: insertBlob, - createLink: createLink, - unlink: unlink - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js deleted file mode 100644 index 01c6c2e..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Convert.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Convert', [ -], function () { - var fromClientRect = function (clientRect) { - return { - x: clientRect.left, - y: clientRect.top, - w: clientRect.width, - h: clientRect.height - }; - }; - - var toClientRect = function (geomRect) { - return { - left: geomRect.x, - top: geomRect.y, - width: geomRect.w, - height: geomRect.h, - right: geomRect.x + geomRect.w, - bottom: geomRect.y + geomRect.h - }; - }; - - return { - fromClientRect: fromClientRect, - toClientRect: toClientRect - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js deleted file mode 100644 index 4a39bda..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * ElementMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/ElementMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) - var element = function (element, predicateIds) { - return function (editor) { - for (var i = 0; i < predicateIds.length; i++) { - if (predicateIds[i].predicate(element)) { - return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); - } - } - - return null; - }; - }; - - // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) - var parent = function (elements, predicateIds) { - return function (editor) { - for (var i = 0; i < elements.length; i++) { - for (var x = 0; x < predicateIds.length; x++) { - if (predicateIds[x].predicate(elements[i])) { - return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); - } - } - } - - return null; - }; - }; - - return { - element: element, - parent: parent - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js deleted file mode 100644 index 7967f16..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Layout.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Layout', [ - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (Rect, Convert) { - var result = function (rect, position) { - return { - rect: rect, - position: position - }; - }; - - var moveTo = function (rect, toRect) { - return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h}; - }; - - var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) { - var relPos, relRect, outputPanelRect; - - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1); - targetRect = Rect.clamp(targetRect, contentAreaRect); - - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - targetRect = Rect.intersect(contentAreaRect, targetRect); - if (targetRect) { - relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2); - if (relPos) { - relRect = Rect.relativePosition(panelRect, targetRect, relPos); - outputPanelRect = moveTo(panelRect, relRect); - return result(outputPanelRect, relPos); - } - - outputPanelRect = moveTo(panelRect, targetRect); - return result(outputPanelRect, relPos); - } - - return null; - }; - - var calcInsert = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['cr-cl', 'cl-cr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var calc = function (targetRect, contentAreaRect, panelRect) { - return calcByPositions( - ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'], - ['bc-tc', 'bl-tl', 'br-tr'], - targetRect, - contentAreaRect, - panelRect - ); - }; - - var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) { - var userConstrainedPanelRect; - - if (typeof handler === 'function') { - userConstrainedPanelRect = handler({ - elementRect: Convert.toClientRect(targetRect), - contentAreaRect: Convert.toClientRect(contentAreaRect), - panelRect: Convert.toClientRect(panelRect) - }); - - return Convert.fromClientRect(userConstrainedPanelRect); - } - - return panelRect; - }; - - return { - calcInsert: calcInsert, - calc: calc, - userConstrain: userConstrain - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js deleted file mode 100644 index 8183323..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Matcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Matcher', [ -], function () { - // result :: String, Rect -> Matcher.result - var result = function (id, rect) { - return { - id: id, - rect: rect - }; - }; - - // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null - var match = function (editor, matchers) { - for (var i = 0; i < matchers.length; i++) { - var f = matchers[i]; - var result = f(editor); - - if (result) { - return result; - } - } - - return null; - }; - - return { - match: match, - result: result - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js deleted file mode 100644 index 76c9d4f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Measure.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/Measure', [ - 'global!tinymce.DOM', - 'global!tinymce.geom.Rect', - 'tinymce/inlite/core/Convert' -], function (DOM, Rect, Convert) { - var toAbsolute = function (rect) { - var vp = DOM.getViewPort(); - - return { - x: rect.x + vp.x, - y: rect.y + vp.y, - w: rect.w, - h: rect.h - }; - }; - - var measureElement = function (elm) { - var clientRect = elm.getBoundingClientRect(); - - return toAbsolute({ - x: clientRect.left, - y: clientRect.top, - w: Math.max(elm.clientWidth, elm.offsetWidth), - h: Math.max(elm.clientHeight, elm.offsetHeight) - }); - }; - - var getElementRect = function (editor, elm) { - return measureElement(elm); - }; - - var getPageAreaRect = function (editor) { - return measureElement(editor.getElement().ownerDocument.body); - }; - - var getContentAreaRect = function (editor) { - return measureElement(editor.getContentAreaContainer() || editor.getBody()); - }; - - var getSelectionRect = function (editor) { - var clientRect = editor.selection.getBoundingClientRect(); - return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null; - }; - - return { - getElementRect: getElementRect, - getPageAreaRect: getPageAreaRect, - getContentAreaRect: getContentAreaRect, - getSelectionRect: getSelectionRect - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js deleted file mode 100644 index 6524edd..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * PredicateId.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/PredicateId', [ - 'global!tinymce.util.Tools' -], function (Tools) { - var create = function (id, predicate) { - return { - id: id, - predicate: predicate - }; - }; - - // fromContextToolbars :: [ContextToolbar] -> [PredicateId] - var fromContextToolbars = function (toolbars) { - return Tools.map(toolbars, function (toolbar) { - return create(toolbar.id, toolbar.predicate); - }); - }; - - return { - create: create, - fromContextToolbars: fromContextToolbars - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js deleted file mode 100644 index 94aeb47..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * SelectionMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SelectionMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // textSelection :: String -> (Editor -> Matcher.result | Null) - var textSelection = function (id) { - return function (editor) { - if (!editor.selection.isCollapsed()) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - }; - }; - - // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) - var emptyTextBlock = function (elements, id) { - return function (editor) { - var i, textBlockElementsMap = editor.schema.getTextBlockElements(); - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName === 'TABLE') { - return null; - } - } - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName in textBlockElementsMap) { - if (editor.dom.isEmpty(elements[i])) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - } - } - - return null; - }; - }; - - return { - textSelection: textSelection, - emptyTextBlock: emptyTextBlock - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js deleted file mode 100644 index fb97920..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * SkinLoader.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SkinLoader', [ - 'global!tinymce.EditorManager', - 'global!tinymce.DOM' -], function (EditorManager, DOM) { - var fireSkinLoaded = function (editor, callback) { - var done = function () { - editor.fire('SkinLoaded'); - callback(); - }; - - if (editor.initialized) { - done(); - } else { - editor.on('init', done); - } - }; - - var load = function (editor, skin, callback) { - var baseUrl = EditorManager.baseURL; - var skinUrl = baseUrl + '/skins/' + skin; - - var done = function () { - fireSkinLoaded(editor, callback); - }; - - DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); - editor.contentCSS.push(skinUrl + '/content.inline.min.css'); - }; - - return { - load: load - }; -}); - - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js deleted file mode 100644 index c37fa2f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * UrlType.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/UrlType', [ -], function () { - var isDomainLike = function (href) { - return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); - }; - - var isAbsolute = function (href) { - return /^https?:\/\//.test(href.trim()); - }; - - return { - isDomainLike: isDomainLike, - isAbsolute: isAbsolute - }; -}); - - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js deleted file mode 100644 index 8c1aeb0..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Conversions.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Conversions', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var blobToBase64 = function (blob) { - return new Promise(function(resolve) { - var reader = new FileReader(); - - reader.onloadend = function() { - resolve(reader.result.split(',')[1]); - }; - - reader.readAsDataURL(blob); - }); - }; - - return { - blobToBase64: blobToBase64 - }; -}); - - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js deleted file mode 100644 index 0b937ea..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Picker.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/file/Picker', [ - 'global!tinymce.util.Promise' -], function (Promise) { - var pickFile = function () { - return new Promise(function (resolve) { - var fileInput; - - fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.style.position = 'fixed'; - fileInput.style.left = 0; - fileInput.style.top = 0; - fileInput.style.opacity = 0.001; - document.body.appendChild(fileInput); - - fileInput.onchange = function(e) { - resolve(Array.prototype.slice.call(e.target.files)); - }; - - fileInput.click(); - fileInput.parentNode.removeChild(fileInput); - }); - }; - - return { - pickFile: pickFile - }; -}); - - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js deleted file mode 100644 index 8fac642..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Buttons.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Buttons', [ - 'tinymce/inlite/ui/Panel', - 'tinymce/inlite/file/Conversions', - 'tinymce/inlite/file/Picker', - 'tinymce/inlite/core/Actions' -], function (Panel, Conversions, Picker, Actions) { - var addHeaderButtons = function (editor) { - var formatBlock = function (name) { - return function () { - Actions.formatBlock(editor, name); - }; - }; - - for (var i = 1; i < 6; i++) { - var name = 'h' + i; - - editor.addButton(name, { - text: name.toUpperCase(), - tooltip: 'Heading ' + i, - stateSelector: name, - onclick: formatBlock(name), - onPostRender: function () { - // TODO: Remove this hack that produces bold H1-H6 when we have proper icons - var span = this.getEl().firstChild.firstChild; - span.style.fontWeight = 'bold'; - } - }); - } - }; - - var addToEditor = function (editor, panel) { - editor.addButton('quicklink', { - icon: 'link', - tooltip: 'Insert/Edit link', - stateSelector: 'a[href]', - onclick: function () { - panel.showForm(editor, 'quicklink'); - } - }); - - editor.addButton('quickimage', { - icon: 'image', - tooltip: 'Insert image', - onclick: function () { - Picker.pickFile().then(function (files) { - var blob = files[0]; - - Conversions.blobToBase64(blob).then(function (base64) { - Actions.insertBlob(editor, base64, blob); - }); - }); - } - }); - - editor.addButton('quicktable', { - icon: 'table', - tooltip: 'Insert table', - onclick: function () { - panel.hide(); - Actions.insertTable(editor, 2, 2); - } - }); - - addHeaderButtons(editor); - }; - - return { - addToEditor: addToEditor - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js deleted file mode 100644 index b8cb3a4..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Forms.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Forms', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.util.Promise', - 'tinymce/inlite/core/Actions', - 'tinymce/inlite/core/UrlType' -], function (Tools, Factory, Promise, Actions, UrlType) { - var focusFirstTextBox = function (form) { - form.find('textbox').eq(0).each(function (ctrl) { - ctrl.focus(); - }); - }; - - var createForm = function (name, spec) { - var form = Factory.create( - Tools.extend({ - type: 'form', - layout: 'flex', - direction: 'row', - padding: 5, - name: name, - spacing: 3 - }, spec) - ); - - form.on('show', function () { - focusFirstTextBox(form); - }); - - return form; - }; - - var toggleVisibility = function (ctrl, state) { - return state ? ctrl.show() : ctrl.hide(); - }; - - var askAboutPrefix = function (editor, href) { - return new Promise(function (resolve) { - editor.windowManager.confirm( - 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', - function (result) { - var output = result === true ? 'http://' + href : href; - resolve(output); - } - ); - }); - }; - - var convertLinkToAbsolute = function (editor, href) { - return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href); - }; - - var createQuickLinkForm = function (editor, hide) { - var unlink = function () { - editor.focus(); - Actions.unlink(editor); - hide(); - }; - - return createForm('quicklink', { - items: [ - {type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link'}, - {type: 'textbox', name: 'linkurl', placeholder: 'Paste or type a link'}, - {type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit'} - ], - onshow: function () { - var elm, linkurl = ''; - - elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); - if (elm) { - linkurl = editor.dom.getAttrib(elm, 'href'); - } - - this.fromJSON({ - linkurl: linkurl - }); - - toggleVisibility(this.find('#unlink'), elm); - }, - onsubmit: function (e) { - convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) { - Actions.createLink(editor, url); - hide(); - }); - } - }); - }; - - return { - createQuickLinkForm: createQuickLinkForm - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js deleted file mode 100644 index 5eb074e..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Panel.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Panel', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory', - 'global!tinymce.DOM', - 'tinymce/inlite/ui/Toolbar', - 'tinymce/inlite/ui/Forms', - 'tinymce/inlite/core/Measure', - 'tinymce/inlite/core/Layout' -], function (Tools, Factory, DOM, Toolbar, Forms, Measure, Layout) { - return function () { - var DEFAULT_TEXT_SELECTION_ITEMS = 'bold italic | quicklink h2 h3 blockquote'; - var DEFAULT_INSERT_TOOLBAR_ITEMS = 'quickimage quicktable'; - var panel, currentRect; - - var createToolbars = function (editor, toolbars) { - return Tools.map(toolbars, function (toolbar) { - return Toolbar.create(editor, toolbar.id, toolbar.items); - }); - }; - - var getTextSelectionToolbarItems = function (settings) { - var value = settings.selection_toolbar; - return value ? value : DEFAULT_TEXT_SELECTION_ITEMS; - }; - - var getInsertToolbarItems = function (settings) { - var value = settings.insert_toolbar; - return value ? value : DEFAULT_INSERT_TOOLBAR_ITEMS; - }; - - var create = function (editor, toolbars) { - var items, settings = editor.settings; - - items = createToolbars(editor, toolbars); - items = items.concat([ - Toolbar.create(editor, 'text', getTextSelectionToolbarItems(settings)), - Toolbar.create(editor, 'insert', getInsertToolbarItems(settings)), - Forms.createQuickLinkForm(editor, hide) - ]); - - return Factory.create({ - type: 'floatpanel', - role: 'dialog', - classes: 'tinymce tinymce-inline arrow', - ariaLabel: 'Inline toolbar', - layout: 'flex', - direction: 'column', - align: 'stretch', - autohide: false, - autofix: true, - fixed: true, - border: 1, - items: items, - oncancel: function() { - editor.focus(); - } - }); - }; - - var showPanel = function (panel) { - if (panel) { - panel.show(); - } - }; - - var movePanelTo = function (panel, pos) { - panel.moveTo(pos.x, pos.y); - }; - - var togglePositionClass = function (panel, relPos) { - relPos = relPos ? relPos.substr(0, 2) : ''; - - Tools.each({ - t: 'down', - b: 'up', - c: 'center' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1)); - }); - - if (relPos === 'cr') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', false); - } else if (relPos === 'cl') { - panel.classes.toggle('arrow-left', true); - panel.classes.toggle('arrow-right', true); - } else { - Tools.each({ - l: 'left', - r: 'right' - }, function(cls, pos) { - panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1)); - }); - } - }; - - var showToolbar = function (panel, id) { - var toolbars = panel.items().filter('#' + id); - - if (toolbars.length > 0) { - toolbars[0].show(); - panel.reflow(); - } - }; - - var showPanelAt = function (panel, id, editor, targetRect) { - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - if (id === 'insert') { - result = Layout.calcInsert(targetRect, contentAreaRect, panelRect); - } else { - result = Layout.calc(targetRect, contentAreaRect, panelRect); - } - - if (result) { - panelRect = result.rect; - currentRect = targetRect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } else { - hide(panel); - } - }; - - var hasFormVisible = function () { - return panel.items().filter('form:visible').length > 0; - }; - - var showForm = function (editor, id) { - if (panel) { - panel.items().hide(); - showToolbar(panel, id); - - var contentAreaRect, panelRect, result, userConstainHandler; - - showPanel(panel); - panel.items().hide(); - showToolbar(panel, id); - - userConstainHandler = editor.settings.inline_toolbar_position_handler; - contentAreaRect = Measure.getContentAreaRect(editor); - panelRect = DOM.getRect(panel.getEl()); - - result = Layout.calc(currentRect, contentAreaRect, panelRect); - - if (result) { - panelRect = result.rect; - movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect)); - - togglePositionClass(panel, result.position); - } - } - }; - - var show = function (editor, id, targetRect, toolbars) { - if (!panel) { - panel = create(editor, toolbars); - panel.renderTo(document.body).reflow().moveTo(targetRect.x, targetRect.y); - editor.nodeChanged(); - } - - showPanelAt(panel, id, editor, targetRect); - }; - - var hide = function () { - if (panel) { - panel.hide(); - } - }; - - var focus = function () { - if (panel) { - panel.find('toolbar:visible').eq(0).each(function (item) { - item.focus(true); - }); - } - }; - - var remove = function () { - if (panel) { - panel.remove(); - panel = null; - } - }; - - var inForm = function () { - return panel && panel.visible() && hasFormVisible(); - }; - - return { - show: show, - showForm: showForm, - inForm: inForm, - hide: hide, - focus: focus, - remove: remove - }; - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js deleted file mode 100644 index a6b2c7f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Toolbar.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/ui/Toolbar', [ - 'global!tinymce.util.Tools', - 'global!tinymce.ui.Factory' -], function (Tools, Factory) { - var setActiveItem = function (item, name) { - return function(state, args) { - var nodeName, i = args.parents.length; - - while (i--) { - nodeName = args.parents[i].nodeName; - if (nodeName == 'OL' || nodeName == 'UL') { - break; - } - } - - item.active(state && nodeName == name); - }; - }; - - var getSelectorStateResult = function (itemName, item) { - var result = function (selector, handler) { - return { - selector: selector, - handler: handler - }; - }; - - var activeHandler = function(state) { - item.active(state); - }; - - var disabledHandler = function (state) { - item.disabled(state); - }; - - if (itemName == 'bullist') { - return result('ul > li', setActiveItem(item, 'UL')); - } - - if (itemName == 'numlist') { - return result('ol > li', setActiveItem(item, 'OL')); - } - - if (item.settings.stateSelector) { - return result(item.settings.stateSelector, activeHandler); - } - - if (item.settings.disabledStateSelector) { - return result(item.settings.disabledStateSelector, disabledHandler); - } - - return null; - }; - - var bindSelectorChanged = function (editor, itemName, item) { - return function () { - var result = getSelectorStateResult(itemName, item); - if (result !== null) { - editor.selection.selectorChanged(result.selector, result.handler); - } - }; - }; - - var create = function (editor, name, items) { - var toolbarItems = [], buttonGroup; - - if (!items) { - return; - } - - Tools.each(items.split(/[ ,]/), function(item) { - var itemName; - - if (item == '|') { - buttonGroup = null; - } else { - if (Factory.has(item)) { - item = {type: item}; - toolbarItems.push(item); - buttonGroup = null; - } else { - if (!buttonGroup) { - buttonGroup = {type: 'buttongroup', items: []}; - toolbarItems.push(buttonGroup); - } - - if (editor.buttons[item]) { - itemName = item; - item = editor.buttons[itemName]; - - if (typeof item == 'function') { - item = item(); - } - - item.type = item.type || 'button'; - - item = Factory.create(item); - item.on('postRender', bindSelectorChanged(editor, itemName, item)); - buttonGroup.items.push(item); - } - } - } - }); - - return Factory.create({ - type: 'toolbar', - layout: 'flow', - name: name, - items: toolbarItems - }); - }; - - return { - create: create - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/.eslintrc b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/.eslintrc deleted file mode 100644 index c0ccd9b..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/.eslintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "env": { - "browser": true, - "amd": true - }, - - "globals": { - "assert": true, - "test": true, - "asynctest": true - }, - - "extends": "../../../../../../.eslintrc" -} diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js deleted file mode 100644 index eef3d61..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js +++ /dev/null @@ -1,9 +0,0 @@ -test('atomic/alien/ArrTest', [ - 'tinymce/inlite/alien/Arr' -], function (Arr) { - var testFlatten = function () { - assert.eq(Arr.flatten([1, 2, [3, 4, [5, 6]], [7, 8], 9]), [1, 2, 3, 4, 5, 6, 7, 8, 9]); - }; - - testFlatten(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js deleted file mode 100644 index 93e8d72..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js +++ /dev/null @@ -1,10 +0,0 @@ -test('atomic/alien/UuidTest', [ - 'tinymce/inlite/alien/Uuid' -], function (Uuid) { - var testUuid = function () { - assert.eq(Uuid.uuid('mce').indexOf('mce'), 0); - assert.eq(Uuid.uuid('mce') !== Uuid.uuid('mce'), true); - }; - - testUuid(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js deleted file mode 100644 index f74e35f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js +++ /dev/null @@ -1,12 +0,0 @@ -test('atomic/core/ConvertTest', [ - 'tinymce/inlite/core/Convert' -], function (Convert) { - var testConvert = function () { - assert.eq({x: 1, y: 2, w: 3, h: 4}, Convert.fromClientRect({left: 1, top: 2, width: 3, height: 4})); - assert.eq({x: 2, y: 3, w: 4, h: 5}, Convert.fromClientRect({left: 2, top: 3, width: 4, height: 5})); - assert.eq({left: 1, top: 2, width: 3, height: 4, bottom: 2 + 4, right: 1 + 3}, Convert.toClientRect({x: 1, y: 2, w: 3, h: 4})); - assert.eq({left: 2, top: 3, width: 4, height: 5, bottom: 3 + 5, right: 2 + 4}, Convert.toClientRect({x: 2, y: 3, w: 4, h: 5})); - }; - - testConvert(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js deleted file mode 100644 index d606156..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js +++ /dev/null @@ -1,51 +0,0 @@ -test('browser/atomic/MatcherTest', [ - 'tinymce/inlite/core/Matcher' -], function (Matcher) { - var testMatch = function (mockEditor, matches, expectedResult) { - var result; - - result = Matcher.match(mockEditor, matches); - assert.eq(expectedResult, result); - }; - - var match = function (key) { - return function (editor) { - return editor[key]; - }; - }; - - var testMatcher = function () { - var mockEditor = { - success1: 'success1', - success2: 'success2', - failure: null - }; - - testMatch(mockEditor, [ - match('success1') - ], 'success1'); - - testMatch(mockEditor, [ - match(null), - match('success2') - ], 'success2'); - - testMatch(mockEditor, [ - match('success1'), - match('success2') - ], 'success1'); - - testMatch(mockEditor, [ - match(null) - ], null); - - testMatch(mockEditor, [ - match(null), - match(null) - ], null); - - testMatch(mockEditor, [], null); - }; - - testMatcher(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js deleted file mode 100644 index 2d1ec52..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js +++ /dev/null @@ -1,33 +0,0 @@ -test('atomic/core/UrlTypeTest', [ - 'tinymce/inlite/core/UrlType' -], function (UrlType) { - var testIsDomainLike = function () { - var mostUsedTopLevelDomains = [ - 'com', 'org', 'edu', 'gov', 'uk', 'net', 'ca', 'de', 'jp', - 'fr', 'au', 'us', 'ru', 'ch', 'it', 'nl', 'se', 'no', 'es', 'mil' - ]; - - assert.eq(UrlType.isDomainLike('www.site.com'), true); - assert.eq(UrlType.isDomainLike('www.site.xyz'), true); - assert.eq(UrlType.isDomainLike(' www.site.xyz'), true); - assert.eq(UrlType.isDomainLike('site.xyz'), false); - - mostUsedTopLevelDomains.forEach(function (tld) { - assert.eq(UrlType.isDomainLike('site.' + tld), true); - assert.eq(UrlType.isDomainLike(' site.' + tld), true); - assert.eq(UrlType.isDomainLike('site.' + tld + ' '), true); - }); - - assert.eq(UrlType.isDomainLike('/a/b'), false); - }; - - var testIsAbsoluteUrl = function () { - assert.eq(UrlType.isAbsolute('http://www.site.com'), true); - assert.eq(UrlType.isAbsolute('https://www.site.com'), true); - assert.eq(UrlType.isAbsolute('www.site.com'), false); - assert.eq(UrlType.isAbsolute('file.gif'), false); - }; - - testIsDomainLike(); - testIsAbsoluteUrl(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js deleted file mode 100644 index fa53ac2..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js +++ /dev/null @@ -1,202 +0,0 @@ -asynctest('browser/core/ThemeTest', [ - 'ephox.mcagar.api.TinyLoader', - 'ephox.mcagar.api.TinyApis', - 'ephox.mcagar.api.TinyActions', - 'ephox.mcagar.api.TinyDom', - 'tinymce/inlite/Theme', - 'ephox.agar.api.Pipeline', - 'ephox.agar.api.Chain', - 'ephox.agar.api.UiFinder', - 'ephox.agar.api.Mouse', - 'ephox.agar.api.GeneralSteps', - 'ephox.agar.api.UiControls', - 'ephox.agar.api.FocusTools' -], function (TinyLoader, TinyApis, TinyActions, TinyDom, Theme, Pipeline, Chain, UiFinder, Mouse, GeneralSteps, UiControls, FocusTools) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - var dialogRoot = TinyDom.fromDom(document.body); - - var cWaitForContextToolbar = Chain.fromChainsWith(dialogRoot, [ - UiFinder.cWaitForState('label', '.mce-tinymce-inline', function (elm) { - return elm.dom().style.display === ""; - }) - ]); - - var cClickToolbarButton = function (ariaLabel) { - return Chain.fromChains([ - UiFinder.cFindIn('div[aria-label="' + ariaLabel + '"]'), - Mouse.cTrueClick - ]); - }; - - var sClickFocusedButton = Chain.asStep(TinyDom.fromDom(document), [ - FocusTools.cGetFocused, - Mouse.cTrueClick - ]); - - var sClickContextButton = function (ariaLabel) { - return Chain.asStep({}, [ - cWaitForContextToolbar, - cClickToolbarButton(ariaLabel) - ]); - }; - - var sWaitForToolbar = function () { - return Chain.asStep({}, [ - cWaitForContextToolbar - ]); - }; - - var sBoldTests = function (tinyApis) { - return GeneralSteps.sequence([ - tinyApis.sSetContent('

a

'), - tinyApis.sSetSelection([0, 0], 0, [0, 0], 1), - sClickContextButton('Bold'), - tinyApis.sAssertContent('

a

') - ]); - }; - - var sH2Tests = function (tinyApis) { - return GeneralSteps.sequence([ - tinyApis.sSetContent('

a

'), - tinyApis.sSetSelection([0, 0], 0, [0, 0], 1), - sClickContextButton('Heading 2'), - tinyApis.sAssertContent('

a

') - ]); - }; - - var sInsertLink = function (url) { - return Chain.asStep({}, [ - cWaitForContextToolbar, - cClickToolbarButton('Insert/Edit link'), - cWaitForContextToolbar, - UiFinder.cFindIn('input'), - UiControls.cSetValue(url), - cWaitForContextToolbar, - cClickToolbarButton('Ok') - ]); - }; - - var cWaitForConfirmDialog = Chain.fromChainsWith(dialogRoot, [ - UiFinder.cWaitForState('window element', '.mce-window', function () { - return true; - }) - ]); - - var cClickButton = function (btnText) { - return Chain.fromChains([ - UiFinder.cFindIn('button:contains("' + btnText + '")'), - Mouse.cTrueClick - ]); - }; - - var sClickConfirmButton = function (btnText) { - return Chain.asStep({}, [ - cWaitForConfirmDialog, - cClickButton(btnText) - ]); - }; - - var sInsertLinkConfirmPrefix = function (url, btnText) { - return GeneralSteps.sequence([ - sInsertLink(url), - sClickConfirmButton(btnText) - ]); - }; - - var sUnlink = Chain.asStep({}, [ - cWaitForContextToolbar, - cClickToolbarButton('Insert/Edit link'), - cWaitForContextToolbar, - cClickToolbarButton('Remove link') - ]); - - var sLinkTests = function (tinyApis) { - var sContentActionTest = function (inputHtml, spath, soffset, fpath, foffset, expectedHtml, sAction) { - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(spath, soffset, fpath, foffset), - sAction, - tinyApis.sAssertContent(expectedHtml) - ]); - }; - - var sLinkTest = function (inputHtml, spath, soffset, fpath, foffset, url, expectedHtml) { - return sContentActionTest(inputHtml, spath, soffset, fpath, foffset, expectedHtml, sInsertLink(url)); - }; - - var sUnlinkTest = function (inputHtml, spath, soffset, fpath, foffset, expectedHtml) { - return sContentActionTest(inputHtml, spath, soffset, fpath, foffset, expectedHtml, sUnlink); - }; - - var sLinkWithConfirmOkTest = function (inputHtml, spath, soffset, fpath, foffset, url, expectedHtml) { - return sContentActionTest(inputHtml, spath, soffset, fpath, foffset, expectedHtml, sInsertLinkConfirmPrefix(url, 'Ok')); - }; - - var sLinkWithConfirmCancelTest = function (inputHtml, spath, soffset, fpath, foffset, url, expectedHtml) { - return sContentActionTest(inputHtml, spath, soffset, fpath, foffset, expectedHtml, sInsertLinkConfirmPrefix(url, 'Cancel')); - }; - - return GeneralSteps.sequence([ - sLinkWithConfirmOkTest('

a

', [0, 0], 0, [0, 0], 1, 'www.site.com', '

a

'), - sLinkWithConfirmCancelTest('

a

', [0, 0], 0, [0, 0], 1, 'www.site.com', '

a

'), - sLinkTest('

a

', [0, 0], 0, [0, 0], 1, '#1', '

a

'), - sLinkTest('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '#2', '

a

'), - sLinkTest('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '', '

a

'), - sUnlinkTest('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '

a

') - ]); - }; - - var sInsertTableTests = function (tinyApis) { - return GeneralSteps.sequence([ - tinyApis.sSetContent('


b

'), - tinyApis.sSetCursor([0], 0), - sClickContextButton('Insert table'), - tinyApis.sAssertContent([ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '
  
  
', - '

b

' - ].join('\n') - ) - ]); - }; - - var sAriaTests = function (tinyApis, tinyActions) { - return GeneralSteps.sequence([ - tinyApis.sSetContent('

a

'), - tinyApis.sSetSelection([0, 0], 0, [0, 0], 1), - sWaitForToolbar(), - tinyActions.sContentKeydown(121, {alt: true}), - sClickFocusedButton, - tinyApis.sAssertContent('

a

') - ]); - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor), tinyActions = TinyActions(editor); - - Pipeline.async({}, [ - sBoldTests(tinyApis), - sH2Tests(tinyApis), - sLinkTests(tinyApis), - sInsertTableTests(tinyApis), - sAriaTests(tinyApis, tinyActions) - ], onSuccess, onFailure); - }, { - theme: 'inlite', - plugins: 'image table link paste contextmenu textpattern', - insert_toolbar: 'quickimage media quicktable', - selection_toolbar: 'bold italic | quicklink h1 h2 blockquote', - inline: true - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js deleted file mode 100644 index c07413f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js +++ /dev/null @@ -1,65 +0,0 @@ -asynctest('browser/alien/BookmarkTest', [ - 'ephox/tinymce', - 'ephox.agar.api.Pipeline', - 'ephox.agar.api.Chain', - 'ephox.agar.api.Cursors', - 'ephox.agar.api.Assertions', - 'ephox.mcagar.api.TinyDom', - 'tinymce/inlite/alien/Bookmark' -], function (tinymce, Pipeline, Chain, Cursors, Assertions, TinyDom, Bookmark) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var toNativeRange = function (range) { - var domRange = document.createRange(); - domRange.setStart(range.start().dom(), range.soffset()); - domRange.setEnd(range.finish().dom(), range.foffset()); - return domRange; - }; - - var rangeToBookmark = function (dom) { - return function (range) { - return Bookmark.create(dom, range); - }; - }; - - var bookmarkToRange = function (dom) { - return function (bookmark) { - return Bookmark.resolve(dom, bookmark); - }; - }; - - var cAssertRangeEq = function (expected) { - return Chain.op(function (actual) { - Assertions.assertEq('Not equal startContainer', expected.start().dom(), actual.startContainer); - Assertions.assertEq('Not equal startOffset', expected.soffset(), actual.startOffset); - Assertions.assertEq('Not equal endContainer', expected.finish().dom(), actual.endContainer); - Assertions.assertEq('Not equal endOffset', expected.foffset(), actual.endOffset); - }); - }; - - var sTestBookmark = function (html, path) { - var dom = tinymce.DOM; - var elm = TinyDom.fromDom(dom.create('div', {}, html)); - - return Chain.asStep(elm, [ - Cursors.cFollowPath(Cursors.pathFrom(path)), - Chain.mapper(toNativeRange), - Chain.mapper(rangeToBookmark(dom)), - Chain.mapper(bookmarkToRange(dom)), - cAssertRangeEq(Cursors.calculate(elm, Cursors.pathFrom(path))) - ]); - }; - - Pipeline.async({}, [ - sTestBookmark('abc', {element: [0], offset: 0}), - sTestBookmark('abc', {element: [0], offset: 1}), - sTestBookmark('abc', {start: {element: [0], offset: 0}, finish: {element: [0], offset: 1}}), - sTestBookmark('a', {element: [0, 0], offset: 0}), - sTestBookmark('a', {element: [0, 0], offset: 0}), - sTestBookmark('a', {start: {element: [0, 0], offset: 0}, finish: {element: [0, 0], offset: 1}}), - sTestBookmark('ab', {start: {element: [0, 0], offset: 0}, finish: {element: [1, 0], offset: 1}}) - ], function () { - success(); - }, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js deleted file mode 100644 index 4f20eb0..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js +++ /dev/null @@ -1,38 +0,0 @@ -asynctest('browser/alien/UnlinkTest', [ - 'ephox.mcagar.api.TinyLoader', - 'ephox.mcagar.api.TinyApis', - 'tinymce/inlite/alien/Unlink', - 'ephox.agar.api.Pipeline', - 'ephox.agar.api.Step', - 'ephox.agar.api.GeneralSteps' -], function (TinyLoader, TinyApis, Unlink, Pipeline, Step, GeneralSteps) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var sUnlinkSelection = function (editor) { - return Step.sync(function () { - Unlink.unlinkSelection(editor); - }); - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor); - - var sAssertUnlink = function (inputHtml, startPath, startOffset, finishPath, finishOffset, expectedHtml) { - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(startPath, startOffset, finishPath, finishOffset), - sUnlinkSelection(editor), - tinyApis.sAssertContent(expectedHtml, 'Should match expected anchor less html') - ]); - }; - - Pipeline.async({}, [ - sAssertUnlink('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '

a

'), - sAssertUnlink('

ab

', [0, 0, 0], 0, [0, 1], 1, '

ab

'), - sAssertUnlink('

a

b', [0, 0, 0], 0, [0, 0, 0], 1, '

a

\n

b

'), - sAssertUnlink('

a

b', [0, 0, 0], 0, [1, 0, 0], 1, '

a

\n

b

') - ], onSuccess, onFailure); - }, { - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js deleted file mode 100644 index 51e6e54..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js +++ /dev/null @@ -1,177 +0,0 @@ -asynctest('browser/core/ActionsTest', [ - 'ephox.mcagar.api.TinyLoader', - 'ephox.mcagar.api.TinyApis', - 'tinymce/inlite/core/Actions', - 'ephox.agar.api.Pipeline', - 'ephox.agar.api.Step', - 'ephox.agar.api.GeneralSteps' -], function (TinyLoader, TinyApis, Actions, Pipeline, Step, GeneralSteps) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var wrap = function (f, args) { - return function () { - var currentArgs = Array.prototype.slice.call(arguments); - return Step.sync(function () { - f.apply(null, [].concat(args).concat(currentArgs)); - }); - }; - }; - - var sInsertTableTests = function (editor, tinyApis) { - var sInsertTableTest = function (cols, rows, expectedHtml, message) { - var sInsertTable = wrap(Actions.insertTable, editor); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(''), - sInsertTable(cols, rows), - tinyApis.sAssertContent(expectedHtml, message) - ]); - }; - - return GeneralSteps.sequence([ - sInsertTableTest(2, 3, [ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '
  
  
  
' - ].join('\n'), - 'Should be a 2x3 table' - ), - - sInsertTableTest(3, 2, [ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '
   
   
' - ].join('\n'), - 'Should be a 3x2 table' - ) - ]); - }; - - var sFormatBlockTests = function (editor, tinyApis) { - var sFormatBlockTest = function (name) { - var sFormatBlock = wrap(Actions.formatBlock, editor); - - return GeneralSteps.sequence([ - tinyApis.sSetContent('

a

'), - tinyApis.sSetCursor([0], 0), - sFormatBlock(name), - tinyApis.sAssertContent('<' + name + '>a', 'Should be a ' + name + ' block') - ]); - }; - - return GeneralSteps.sequence([ - sFormatBlockTest('h1'), - sFormatBlockTest('h2'), - sFormatBlockTest('pre') - ]); - }; - - var sCreateLinkTests = function (editor, tinyApis) { - var sCreateLinkTest = function (inputHtml, url, sPath, sOffset, fPath, fOffset, expectedHtml) { - var sCreateLink = wrap(Actions.createLink, editor); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(sPath, sOffset, fPath, fOffset), - sCreateLink(url), - tinyApis.sAssertContent(expectedHtml, 'Should have a link') - ]); - }; - - return GeneralSteps.sequence([ - sCreateLinkTest('

a

', '#1', [0, 0], 0, [0, 0], 1, '

a

'), - sCreateLinkTest('

a

', '#2', [0, 0], 0, [0, 0], 1, '

a

'), - sCreateLinkTest('

a

', '#2', [0, 0, 0], 0, [0, 0, 0], 1, '

a

') - ]); - }; - - var sUnlinkTests = function (editor, tinyApis) { - var sUnlinkTest = function (inputHtml, sPath, sOffset, fPath, fOffset, expectedHtml) { - var sUnlink = wrap(Actions.unlink, editor); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(sPath, sOffset, fPath, fOffset), - sUnlink(), - tinyApis.sAssertContent(expectedHtml, 'Should not have a link') - ]); - }; - - return GeneralSteps.sequence([ - sUnlinkTest('

a

', [0, 0], 0, [0, 0], 1, '

a

'), - sUnlinkTest('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '

a

'), - sUnlinkTest('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '

a

'), - sUnlinkTest('

ab

', [0, 0, 0], 0, [0, 1], 1, '

ab

') - ]); - }; - - var base64ToBlob = function (base64, type) { - var buff = atob(base64); - var bytes = new Uint8Array(buff.length); - - for (var i = 0; i < bytes.length; i++) { - bytes[i] = buff.charCodeAt(i); - } - - return new Blob([bytes], {type: type}); - }; - - var sInsertBlobTests = function (editor, tinyApis) { - var sInsertBlobTest = function (inputHtml, path, offset, blob, base64, expectedHtml) { - var sInsertBlob = wrap(Actions.insertBlob, editor); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetCursor(path, offset), - sInsertBlob(blob, base64), - tinyApis.sAssertContent(expectedHtml, 'Should have a image') - ]); - }; - - var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; - var blob = base64ToBlob(base64, 'image/gif'); - - return GeneralSteps.sequence([ - sInsertBlobTest('

a

', [0, 0], 0, base64, blob, '

a

') - ]); - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor); - - Pipeline.async({}, [ - sInsertTableTests(editor, tinyApis), - sFormatBlockTests(editor, tinyApis), - sInsertBlobTests(editor, tinyApis), - sCreateLinkTests(editor, tinyApis), - sUnlinkTests(editor, tinyApis) - ], onSuccess, onFailure); - }, { - inline: true - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js deleted file mode 100644 index a534804..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js +++ /dev/null @@ -1,69 +0,0 @@ -asynctest('browser/core/ElementMatcherTest', [ - 'ephox.mcagar.api.TinyLoader', - 'ephox.mcagar.api.TinyApis', - 'ephox.agar.api.Step', - 'ephox.agar.api.Assertions', - 'tinymce/inlite/core/ElementMatcher', - 'tinymce/inlite/core/PredicateId', - 'ephox.agar.api.Pipeline' -], function (TinyLoader, TinyApis, Step, Assertions, ElementMatcher, PredicateId, Pipeline) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var eq = function (target) { - return function (elm) { - return elm === target; - }; - }; - - var constantFalse = function (/*elm*/) { - return false; - }; - - var sElementTest = function (tinyApis, editor, inputHtml, selector) { - return Step.sync(function () { - var target, result; - - editor.setContent(inputHtml); - target = editor.dom.select(selector)[0]; - - result = ElementMatcher.element(target, [ - PredicateId.create('a', constantFalse), - PredicateId.create('b', eq(target)) - ])(editor); - - Assertions.assertEq(result.id, 'b', 'Should be matching B'); - Assertions.assertEq(result.rect.w > 0, true, 'Should be have width'); - }); - }; - - var sParentTest = function (tinyApis, editor, inputHtml, selector) { - return Step.sync(function () { - var target, parents, result; - - editor.setContent(inputHtml); - target = editor.dom.select(selector)[0]; - parents = editor.dom.getParents(target); - - result = ElementMatcher.parent(parents, [ - PredicateId.create('a', constantFalse), - PredicateId.create('b', eq(parents[1])), - PredicateId.create('c', eq(parents[0])) - ])(editor); - - Assertions.assertEq(result.id, 'c', 'Should be matching C the closest one'); - Assertions.assertEq(result.rect.w > 0, true, 'Should be have width'); - }); - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor); - - Pipeline.async({}, [ - sElementTest(tinyApis, editor, '

a

', 'p'), - sParentTest(tinyApis, editor, '

a

', 'em') - ], onSuccess, onFailure); - }, { - inline: true - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js deleted file mode 100644 index 5ee5c7f..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js +++ /dev/null @@ -1,118 +0,0 @@ -test('browser/core/LayoutTest', [ - 'ephox/tinymce', - 'tinymce/inlite/core/Layout' -], function (tinymce, Layout) { - // TODO: Move this to atomic test when we can require parts of tinymce core using bolt - - var rect = function (x, y, w, h) { - return {x: x, y: y, w: w, h: h}; - }; - - var clientRect = function (x, y, w, h) { - return {left: x, top: y, width: w, height: h, bottom: y + h, right: x + w}; - }; - - var assertLayout = function (expected, rects) { - var result; - - result = Layout.calc( - rects.targetRect, - rects.contentAreaRect, - rects.panelRect - ); - - assert.eq(expected, result); - }; - - var testCalcPanelAtBottomLeft = function () { - assertLayout({ - rect: rect(0, 10, 20, 10), - position: 'bl-tl' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(0, 0, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testCalcPanelAtBottomRight = function () { - assertLayout({ - rect: rect(80, 10, 20, 10), - position: 'br-tr' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(90, 0, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testCalcPanelAtTopLeft = function () { - assertLayout({ - rect: rect(0, 10, 20, 10), - position: 'tl-bl' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(0, 20, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testCalcPanelAtTopRight = function () { - assertLayout({ - rect: rect(80, 10, 20, 10), - position: 'tr-br' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(90, 20, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testCalcPanelAtTopCenter = function () { - assertLayout({ - rect: rect(35, 10, 20, 10), - position: 'tc-bc' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(40, 20, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testCalcPanelAtBottomCenter = function () { - assertLayout({ - rect: rect(35, 10, 20, 10), - position: 'bc-tc' - }, { - contentAreaRect: rect(0, 0, 100, 100), - targetRect: rect(40, 0, 10, 10), - panelRect: rect(0, 0, 20, 10) - }); - }; - - var testUserConstrain = function () { - var targetRect, contentAreaRect, panelRect, userConstrainedPanelRect, handler; - - contentAreaRect = rect(0, 0, 100, 100); - targetRect = rect(40, 0, 10, 10); - panelRect = rect(0, 0, 20, 10); - - handler = function (rects) { - assert.eq(rects.elementRect, clientRect(40, 0, 10, 10)); - assert.eq(rects.contentAreaRect, clientRect(0, 0, 100, 100)); - assert.eq(rects.panelRect, clientRect(0, 0, 20, 10)); - return clientRect(1, 2, 3, 4); - }; - - userConstrainedPanelRect = Layout.userConstrain(handler, targetRect, contentAreaRect, panelRect); - assert.eq(userConstrainedPanelRect, rect(1, 2, 3, 4)); - }; - - testCalcPanelAtBottomLeft(); - testCalcPanelAtBottomRight(); - testCalcPanelAtTopLeft(); - testCalcPanelAtTopRight(); - testCalcPanelAtTopCenter(); - testCalcPanelAtBottomCenter(); - testUserConstrain(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js deleted file mode 100644 index b233870..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js +++ /dev/null @@ -1,62 +0,0 @@ -asynctest('browser/core/MeasureTest', [ - 'ephox.mcagar.api.TinyLoader', - 'tinymce/inlite/core/Measure', - 'ephox.agar.api.Pipeline', - 'ephox.mcagar.api.TinyApis', - 'ephox.agar.api.Step', - 'ephox.agar.api.Chain', - 'ephox.agar.api.UiFinder', - 'ephox.agar.api.Assertions' -], function (TinyLoader, Measure, Pipeline, TinyApis, Step, Chain, UiFinder, Assertions) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var containsXY = function (r, x, y) { - return x >= r.x && x <= r.x + r.w && y >= r.y && y <= r.y + r.h; - }; - - var contains = function (a, b) { - return containsXY(a, b.x, b.y) && containsXY(a, b.x + b.w, b.y + b.h); - }; - - var sAssertRect = function (editor, measure) { - return Step.sync(function () { - var elementRect = measure(); - var pageAreaRect = Measure.getPageAreaRect(editor); - var contentAreaRect = Measure.getContentAreaRect(editor); - - Assertions.assertEq('Rect is not in page area rect', contains(pageAreaRect, elementRect), true); - Assertions.assertEq('Rect is not in content area rect', contains(contentAreaRect, elementRect), true); - Assertions.assertEq('Rect should have width', elementRect.w > 0, true); - Assertions.assertEq('Rect should have height', elementRect.h > 0, true); - }); - }; - - var getElementRectFromSelector = function (editor, selector) { - return function () { - var elm = editor.dom.select(selector)[0]; - var rect = Measure.getElementRect(editor, elm); - return rect; - }; - }; - - var getSelectionRectFromSelector = function (editor) { - return function () { - var rect = Measure.getSelectionRect(editor); - return rect; - }; - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor); - - Pipeline.async({}, [ - tinyApis.sSetContent('

a

b

c

'), - sAssertRect(editor, getElementRectFromSelector(editor, 'p:nth-child(1)')), - tinyApis.sSetCursor([0, 0], 0), - sAssertRect(editor, getSelectionRectFromSelector(editor)) - ], onSuccess, onFailure); - }, { - inline: true - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js deleted file mode 100644 index 4f76b83..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js +++ /dev/null @@ -1,26 +0,0 @@ -test('browser/core/PredicateIdTest', [ - 'ephox/tinymce', - 'tinymce/inlite/core/PredicateId' -], function (tinymce, PredicateId) { - var testFromContextToolbars = function () { - var isTrue = function () { - return true; - }; - - var isFalse = function () { - return false; - }; - - var predIds = PredicateId.fromContextToolbars([ - {toolbar: 'a b c', predicate: isTrue, id: 'a'}, - {toolbar: 'd e', predicate: isFalse, id: 'b'} - ]); - - assert.eq([ - PredicateId.create('a', isTrue), - PredicateId.create('b', isFalse) - ], predIds); - }; - - testFromContextToolbars(); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js deleted file mode 100644 index 6be70da..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js +++ /dev/null @@ -1,76 +0,0 @@ -asynctest('browser/core/SelectionMatcherTest', [ - 'ephox.mcagar.api.TinyLoader', - 'ephox.mcagar.api.TinyApis', - 'ephox.agar.api.Step', - 'ephox.agar.api.Assertions', - 'tinymce/inlite/core/SelectionMatcher', - 'tinymce/inlite/core/PredicateId', - 'ephox.agar.api.GeneralSteps', - 'ephox.agar.api.Pipeline' -], function (TinyLoader, TinyApis, Step, Assertions, SelectionMatcher, PredicateId, GeneralSteps, Pipeline) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var assertResult = function (expectedResultState, result) { - Assertions.assertEq('Should not be null', result !== null, expectedResultState); - - if (expectedResultState === true) { - Assertions.assertEq('Should be matching a', result.id, 'a'); - Assertions.assertEq('Should be have width', result.rect.w > 0, true); - } - }; - - var sTextSelectionTest = function (tinyApis, editor, inputHtml, spath, soffset, fpath, foffset, expectedResultState) { - var sAssertTextSelectionResult = Step.sync(function () { - var result = SelectionMatcher.textSelection('a')(editor); - assertResult(expectedResultState, result); - }); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(spath, soffset, fpath, foffset), - sAssertTextSelectionResult - ]); - }; - - var sTextSelectionTests = function (tinyApis, editor) { - return GeneralSteps.sequence([ - sTextSelectionTest(tinyApis, editor, '

a

', [0], 0, [0], 1, true), - sTextSelectionTest(tinyApis, editor, '

a

', [0], 0, [0], 0, false) - ]); - }; - - var sEmptyTextBlockTest = function (tinyApis, editor, inputHtml, spath, soffset, fpath, foffset, expectedResultState) { - var sAssertTextSelectionResult = Step.sync(function () { - var elements = editor.dom.getParents(editor.selection.getStart()); - var result = SelectionMatcher.emptyTextBlock(elements, 'a')(editor); - assertResult(expectedResultState, result); - }); - - return GeneralSteps.sequence([ - tinyApis.sSetContent(inputHtml), - tinyApis.sSetSelection(spath, soffset, fpath, foffset), - sAssertTextSelectionResult - ]); - }; - - var sEmptyTextBlockTests = function (tinyApis, editor) { - return GeneralSteps.sequence([ - sEmptyTextBlockTest(tinyApis, editor, '

a

', [0], 0, [0], 0, false), - sEmptyTextBlockTest(tinyApis, editor, '

a

', [0], 0, [0], 1, false), - sEmptyTextBlockTest(tinyApis, editor, '


', [0], 0, [0], 0, true), - sEmptyTextBlockTest(tinyApis, editor, '


', [0, 0], 0, [0, 0], 0, true) - ]); - }; - - TinyLoader.setup(function (editor, onSuccess, onFailure) { - var tinyApis = TinyApis(editor); - - Pipeline.async({}, [ - sTextSelectionTests(tinyApis, editor), - sEmptyTextBlockTests(tinyApis, editor) - ], onSuccess, onFailure); - }, { - inline: true - }, success, failure); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js deleted file mode 100644 index 99ad1cc..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js +++ /dev/null @@ -1,41 +0,0 @@ -asynctest('atomic/core/ConvertTest', [ - 'ephox/tinymce', - 'tinymce/inlite/file/Conversions', - 'ephox.agar.api.Step', - 'ephox.agar.api.Pipeline', - 'ephox.agar.api.Assertions' -], function (tinymce, Conversions, Step, Pipeline, Assertions) { - var success = arguments[arguments.length - 2]; - var failure = arguments[arguments.length - 1]; - - var base64ToBlob = function (base64, type) { - var buff = atob(base64); - var bytes = new Uint8Array(buff.length); - - for (var i = 0; i < bytes.length; i++) { - bytes[i] = buff.charCodeAt(i); - } - - return new Blob([bytes], {type: type}); - }; - - var sBlobToBase64 = function () { - return Step.async(function (next) { - var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; - var blob = base64ToBlob(base64, 'image/gif'); - - Conversions.blobToBase64(blob).then(function (convertedBase64) { - Assertions.assertEq('Not the correct base64', base64, convertedBase64); - next(); - }); - }); - }; - - Pipeline.async({}, [ - sBlobToBase64() - ], function () { - success(); - }, function () { - failure(); - }); -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js deleted file mode 100644 index 94aeb47..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * SelectionMatcher.js - * - * Released under LGPL License. - * Copyright (c) 1999-2016 Ephox Corp. All rights reserved - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define('tinymce/inlite/core/SelectionMatcher', [ - 'tinymce/inlite/core/Matcher', - 'tinymce/inlite/core/Measure' -], function (Matcher, Measure) { - // textSelection :: String -> (Editor -> Matcher.result | Null) - var textSelection = function (id) { - return function (editor) { - if (!editor.selection.isCollapsed()) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - }; - }; - - // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) - var emptyTextBlock = function (elements, id) { - return function (editor) { - var i, textBlockElementsMap = editor.schema.getTextBlockElements(); - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName === 'TABLE') { - return null; - } - } - - for (i = 0; i < elements.length; i++) { - if (elements[i].nodeName in textBlockElementsMap) { - if (editor.dom.isEmpty(elements[i])) { - return Matcher.result(id, Measure.getSelectionRect(editor)); - } - - return null; - } - } - - return null; - }; - }; - - return { - textSelection: textSelection, - emptyTextBlock: emptyTextBlock - }; -}); diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/theme.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/theme.min.js index 4d3f267..09f7100 100644 --- a/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/theme.min.js +++ b/copy_this/modules/bla/bla-tinymce/tinymce/themes/inlite/theme.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;g>i;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.ThemeManager),h("2",tinymce.util.Delay),h("b",tinymce.util.Tools),h("c",tinymce.ui.Factory),h("d",tinymce.DOM),g("e",["b","c"],function(a,b){var c=function(a,b){return function(c,d){for(var e,f=d.parents.length;f--&&(e=d.parents[f].nodeName,"OL"!=e&&"UL"!=e););a.active(c&&e==b)}},d=function(a,b){var d=function(a,b){return{selector:a,handler:b}},e=function(a){b.active(a)},f=function(a){b.disabled(a)};return"bullist"==a?d("ul > li",c(b,"UL")):"numlist"==a?d("ol > li",c(b,"OL")):b.settings.stateSelector?d(b.settings.stateSelector,e):b.settings.disabledStateSelector?d(b.settings.disabledStateSelector,f):null},e=function(a,b,c){return function(){var e=d(b,c);null!==e&&a.selection.selectorChanged(e.selector,e.handler)}},f=function(c,d,f){var g,h=[];if(f)return a.each(f.split(/[ ,]/),function(a){var d;"|"==a?g=null:b.has(a)?(a={type:a},h.push(a),g=null):(g||(g={type:"buttongroup",items:[]},h.push(g)),c.buttons[a]&&(d=a,a=c.buttons[d],"function"==typeof a&&(a=a()),a.type=a.type||"button",a=b.create(a),a.on("postRender",e(c,d,a)),g.items.push(a)))}),b.create({type:"toolbar",layout:"flow",name:d,items:h})};return{create:f}}),h("m",tinymce.util.Promise),g("n",[],function(){var a=0,b=function(){var a=function(){return Math.round(4294967295*Math.random()).toString(36)};return"s"+Date.now().toString(36)+a()+a()+a()},c=function(c){return c+a++ +b()};return{uuid:c}}),g("s",[],function(){var a=function(a,b){function c(c){var e,f,g;f=b[c?"startContainer":"endContainer"],g=b[c?"startOffset":"endOffset"],1==f.nodeType&&(e=a.create("span",{"data-mce-type":"bookmark"}),f.hasChildNodes()?(g=Math.min(g,f.childNodes.length-1),c?f.insertBefore(e,f.childNodes[g]):a.insertAfter(e,f.childNodes[g])):f.appendChild(e),f=e,g=0),d[c?"startContainer":"endContainer"]=f,d[c?"startOffset":"endOffset"]=g}var d={};return c(!0),b.collapsed||c(),d},b=function(a,b){function c(c){function d(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var e,f,g;e=g=b[c?"startContainer":"endContainer"],f=b[c?"startOffset":"endOffset"],e&&(1==e.nodeType&&(f=d(e),e=e.parentNode,a.remove(g)),b[c?"startContainer":"endContainer"]=e,b[c?"startOffset":"endOffset"]=f)}c(!0),c();var d=a.createRng();return d.setStart(b.startContainer,b.startOffset),b.endContainer&&d.setEnd(b.endContainer,b.endOffset),d};return{create:a,resolve:b}}),h("t",tinymce.dom.TreeWalker),h("u",tinymce.dom.RangeUtils),g("o",["s","b","t","u"],function(a,b,c,d){var e=function(a,b,d){var e,f,g=[];for(e=new c(b,a),f=b;f&&(1===f.nodeType&&g.push(f),f!==d);f=e.next());return g},f=function(c,d){var e,f,g;f=c.dom,g=c.selection,e=a.create(f,g.getRng()),b.each(d,function(a){c.dom.remove(a,!0)}),g.setRng(a.resolve(f,e))},g=function(a){return"A"===a.nodeName&&a.hasAttribute("href")},h=function(a,b){var c=a.getParent(b,g);return c?c:b},i=function(a){var c,f,i,j,k,l,m;return k=a.selection,l=a.dom,m=k.getRng(),c=h(l,d.getNode(m.startContainer,m.startOffset)),f=d.getNode(m.endContainer,m.endOffset),i=a.getBody(),j=b.grep(e(i,c,f),g)},j=function(a){f(a,i(a))};return{unlinkSelection:j}}),g("k",["n","o"],function(a,b){var c=function(a,b){var c,d,e;for(e='',e+="",d=0;b>d;d++){for(e+="",c=0;a>c;c++)e+="";e+=""}return e+="",e+="

"},d=function(a){var b=a.dom.select("*[data-mce-id]");return b[0]},e=function(a,b,e){a.undoManager.transact(function(){var f,g;a.insertContent(c(b,e)),f=d(a),f.removeAttribute("data-mce-id"),g=a.dom.select("td,th",f),a.selection.setCursorLocation(g[0],0)})},f=function(a,b){a.execCommand("FormatBlock",!1,b)},g=function(b,c,d){var e,f;e=b.editorUpload.blobCache,f=e.create(a.uuid("mceu"),d,c),e.add(f),b.insertContent(b.dom.createHTML("img",{src:f.blobUri()}))},h=function(a){a.selection.collapse(!1)},i=function(a){a.focus(),b.unlinkSelection(a),h(a)},j=function(a,b,c){a.focus(),a.dom.setAttrib(b,"href",c),h(a)},k=function(a,b){a.execCommand("mceInsertLink",!1,{href:b}),h(a)},l=function(a,b){var c=a.dom.getParent(a.selection.getStart(),"a[href]");c?j(a,c,b):k(a,b)},m=function(a,b){0===b.trim().length?i(a):l(a,b)};return{insertTable:e,formatBlock:f,insertBlob:g,createLink:m,unlink:i}}),g("p",[],function(){var a=function(a){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(a.trim())},b=function(a){return/^https?:\/\//.test(a.trim())};return{isDomainLike:a,isAbsolute:b}}),g("f",["b","c","m","k","p"],function(a,b,c,d,e){var f=function(a){a.find("textbox").eq(0).each(function(a){a.focus()})},g=function(c,d){var e=b.create(a.extend({type:"form",layout:"flex",direction:"row",padding:5,name:c,spacing:3},d));return e.on("show",function(){f(e)}),e},h=function(a,b){return b?a.show():a.hide()},i=function(a,b){return new c(function(c){a.windowManager.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){var d=a===!0?"http://"+b:b;c(d)})})},j=function(a,b){return!e.isAbsolute(b)&&e.isDomainLike(b)?i(a,b):c.resolve(b)},k=function(a,b){var c=function(){a.focus(),d.unlink(a),b()};return g("quicklink",{items:[{type:"button",name:"unlink",icon:"unlink",onclick:c,tooltip:"Remove link"},{type:"textbox",name:"linkurl",placeholder:"Paste or type a link"},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(){var b,c="";b=a.dom.getParent(a.selection.getStart(),"a[href]"),b&&(c=a.dom.getAttrib(b,"href")),this.fromJSON({linkurl:c}),h(this.find("#unlink"),b)},onsubmit:function(c){j(a,c.data.linkurl).then(function(c){d.createLink(a,c),b()})}})};return{createQuickLinkForm:k}}),h("q",tinymce.geom.Rect),g("r",[],function(){var a=function(a){return{x:a.left,y:a.top,w:a.width,h:a.height}},b=function(a){return{left:a.x,top:a.y,width:a.w,height:a.h,right:a.x+a.w,bottom:a.y+a.h}};return{fromClientRect:a,toClientRect:b}}),g("g",["d","q","r"],function(a,b,c){var d=function(b){var c=a.getViewPort();return{x:b.x+c.x,y:b.y+c.y,w:b.w,h:b.h}},e=function(a){var b=a.getBoundingClientRect();return d({x:b.left,y:b.top,w:Math.max(a.clientWidth,a.offsetWidth),h:Math.max(a.clientHeight,a.offsetHeight)})},f=function(a,b){return e(b)},g=function(a){return e(a.getElement().ownerDocument.body)},h=function(a){return e(a.getContentAreaContainer()||a.getBody())},i=function(a){var b=a.selection.getBoundingClientRect();return b?d(c.fromClientRect(b)):null};return{getElementRect:f,getPageAreaRect:g,getContentAreaRect:h,getSelectionRect:i}}),g("h",["q","r"],function(a,b){var c=function(a,b){return{rect:a,position:b}},d=function(a,b){return{x:b.x,y:b.y,w:a.w,h:a.h}},e=function(b,e,f,g,h){var i,j,k;return i=a.findBestRelativePosition(h,f,g,b),f=a.clamp(f,g),i?(j=a.relativePosition(h,f,i),k=d(h,j),c(k,i)):(f=a.intersect(g,f),f?(i=a.findBestRelativePosition(h,f,g,e))?(j=a.relativePosition(h,f,i),k=d(h,j),c(k,i)):(k=d(h,f),c(k,i)):null)},f=function(a,b,c){return e(["cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr"],a,b,c)},g=function(a,b,c){return e(["tc-bc","bc-tc","tl-bl","bl-tl","tr-br","br-tr"],["bc-tc","bl-tl","br-tr"],a,b,c)},h=function(a,c,d,e){var f;return"function"==typeof a?(f=a({elementRect:b.toClientRect(c),contentAreaRect:b.toClientRect(d),panelRect:b.toClientRect(e)}),b.fromClientRect(f)):e};return{calcInsert:f,calc:g,userConstrain:h}}),g("3",["b","c","d","e","f","g","h"],function(a,b,c,d,e,f,g){return function(){var h,i,j="bold italic | quicklink h2 h3 blockquote",k="quickimage quicktable",l=function(b,c){return a.map(c,function(a){return d.create(b,a.id,a.items)})},m=function(a){var b=a.selection_toolbar;return b?b:j},n=function(a){var b=a.insert_toolbar;return b?b:k},o=function(a,c){var f,g=a.settings;return f=l(a,c),f=f.concat([d.create(a,"text",m(g)),d.create(a,"insert",n(g)),e.createQuickLinkForm(a,x)]),b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:f,oncancel:function(){a.focus()}})},p=function(a){a&&a.show()},q=function(a,b){a.moveTo(b.x,b.y)},r=function(b,c){c=c?c.substr(0,2):"",a.each({t:"down",b:"up",c:"center"},function(a,d){b.classes.toggle("arrow-"+a,d===c.substr(0,1))}),"cr"===c?(b.classes.toggle("arrow-left",!0),b.classes.toggle("arrow-right",!1)):"cl"===c?(b.classes.toggle("arrow-left",!0),b.classes.toggle("arrow-right",!0)):a.each({l:"left",r:"right"},function(a,d){b.classes.toggle("arrow-"+a,d===c.substr(1,1))})},s=function(a,b){var c=a.items().filter("#"+b);c.length>0&&(c[0].show(),a.reflow())},t=function(a,b,d,e){var h,j,k,l;p(a),a.items().hide(),s(a,b),l=d.settings.inline_toolbar_position_handler,h=f.getContentAreaRect(d),j=c.getRect(a.getEl()),k="insert"===b?g.calcInsert(e,h,j):g.calc(e,h,j),k?(j=k.rect,i=e,q(a,g.userConstrain(l,e,h,j)),r(a,k.position)):x(a)},u=function(){return h.items().filter("form:visible").length>0},v=function(a,b){if(h){h.items().hide(),s(h,b);var d,e,j,k;p(h),h.items().hide(),s(h,b),k=a.settings.inline_toolbar_position_handler,d=f.getContentAreaRect(a),e=c.getRect(h.getEl()),j=g.calc(i,d,e),j&&(e=j.rect,q(h,g.userConstrain(k,i,d,e)),r(h,j.position))}},w=function(a,b,c,d){h||(h=o(a,d),h.renderTo(document.body).reflow().moveTo(c.x,c.y),a.nodeChanged()),t(h,b,a,c)},x=function(){h&&h.hide()},y=function(){h&&h.find("toolbar:visible").eq(0).each(function(a){a.focus(!0)})},z=function(){h&&(h.remove(),h=null)},A=function(){return h&&h.visible()&&u()};return{show:w,showForm:v,inForm:A,hide:x,focus:y,remove:z}}}),g("i",["m"],function(a){var b=function(b){return new a(function(a){var c=new FileReader;c.onloadend=function(){a(c.result.split(",")[1])},c.readAsDataURL(b)})};return{blobToBase64:b}}),g("j",["m"],function(a){var b=function(){return new a(function(a){var b;b=document.createElement("input"),b.type="file",b.style.position="fixed",b.style.left=0,b.style.top=0,b.style.opacity=.001,document.body.appendChild(b),b.onchange=function(b){a(Array.prototype.slice.call(b.target.files))},b.click(),b.parentNode.removeChild(b)})};return{pickFile:b}}),g("4",["3","i","j","k"],function(a,b,c,d){var e=function(a){for(var b=function(b){return function(){d.formatBlock(a,b)}},c=1;6>c;c++){var e="h"+c;a.addButton(e,{text:e.toUpperCase(),tooltip:"Heading "+c,stateSelector:e,onclick:b(e),onPostRender:function(){var a=this.getEl().firstChild.firstChild;a.style.fontWeight="bold"}})}},f=function(a,f){a.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){f.showForm(a,"quicklink")}}),a.addButton("quickimage",{icon:"image",tooltip:"Insert image",onclick:function(){c.pickFile().then(function(c){var e=c[0];b.blobToBase64(e).then(function(b){d.insertBlob(a,b,e)})})}}),a.addButton("quicktable",{icon:"table",tooltip:"Insert table",onclick:function(){f.hide(),d.insertTable(a,2,2)}}),e(a)};return{addToEditor:f}}),h("l",tinymce.EditorManager),g("5",["l","d"],function(a,b){var c=function(a,b){var c=function(){a.fire("SkinLoaded"),b()};a.initialized?c():a.on("init",c)},d=function(d,e,f){var g=a.baseURL,h=g+"/skins/"+e,i=function(){c(d,f)};b.styleSheetLoader.load(h+"/skin.min.css",i),d.contentCSS.push(h+"/content.inline.min.css")};return{load:d}}),g("8",[],function(){var a=function(a,b){return{id:a,rect:b}},b=function(a,b){for(var c=0;ci;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.ThemeManager),h("2",tinymce.util.Delay),h("c",tinymce.util.Tools),h("d",tinymce.ui.Factory),h("e",tinymce.DOM),g("j",[],function(){var a=function(a){return function(b){return typeof b===a}},b=function(a){return Array.isArray(a)},c=function(a){return null===a},d=function(a){return function(d){return!c(d)&&!b(d)&&a(d)}};return{isString:a("string"),isNumber:a("number"),isBoolean:a("boolean"),isFunction:a("function"),isObject:d(a("object")),isNull:c,isArray:b}}),g("f",["c","d","j"],function(a,b,c){var d=function(a,b){return function(c,d){for(var e,f=d.parents.length;f--&&(e=d.parents[f].nodeName,"OL"!=e&&"UL"!=e););a.active(c&&e==b)}},e=function(a,b){var c=function(a,b){return{selector:a,handler:b}},e=function(a){b.active(a)},f=function(a){b.disabled(a)};return"bullist"==a?c("ul > li",d(b,"UL")):"numlist"==a?c("ol > li",d(b,"OL")):b.settings.stateSelector?c(b.settings.stateSelector,e):b.settings.disabledStateSelector?c(b.settings.disabledStateSelector,f):null},f=function(a,b,c){return function(){var d=e(b,c);null!==d&&a.selection.selectorChanged(d.selector,d.handler)}},g=function(a){return c.isArray(a)?a:c.isString(a)?a.split(/[ ,]/):[]},h=function(c,d,e){var h,i=[];if(e)return a.each(g(e),function(a){var d;"|"==a?h=null:b.has(a)?(a={type:a},i.push(a),h=null):c.buttons[a]&&(h||(h={type:"buttongroup",items:[]},i.push(h)),d=a,a=c.buttons[d],"function"==typeof a&&(a=a()),a.type=a.type||"button",a=b.create(a),a.on("postRender",f(c,d,a)),h.items.push(a))}),b.create({type:"toolbar",layout:"flow",name:d,items:i})};return{create:h}}),h("o",tinymce.util.Promise),g("p",[],function(){var a=0,b=function(){var a=function(){return Math.round(4294967295*Math.random()).toString(36)};return"s"+Date.now().toString(36)+a()+a()+a()},c=function(c){return c+a++ +b()};return{uuid:c}}),g("u",[],function(){var a=function(a,b){function c(c){var e,f,g;f=b[c?"startContainer":"endContainer"],g=b[c?"startOffset":"endOffset"],1==f.nodeType&&(e=a.create("span",{"data-mce-type":"bookmark"}),f.hasChildNodes()?(g=Math.min(g,f.childNodes.length-1),c?f.insertBefore(e,f.childNodes[g]):a.insertAfter(e,f.childNodes[g])):f.appendChild(e),f=e,g=0),d[c?"startContainer":"endContainer"]=f,d[c?"startOffset":"endOffset"]=g}var d={};return c(!0),b.collapsed||c(),d},b=function(a,b){function c(c){function d(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var e,f,g;e=g=b[c?"startContainer":"endContainer"],f=b[c?"startOffset":"endOffset"],e&&(1==e.nodeType&&(f=d(e),e=e.parentNode,a.remove(g)),b[c?"startContainer":"endContainer"]=e,b[c?"startOffset":"endOffset"]=f)}c(!0),c();var d=a.createRng();return d.setStart(b.startContainer,b.startOffset),b.endContainer&&d.setEnd(b.endContainer,b.endOffset),d};return{create:a,resolve:b}}),h("v",tinymce.dom.TreeWalker),h("w",tinymce.dom.RangeUtils),g("q",["u","c","v","w"],function(a,b,c,d){var e=function(a,b,d){var e,f,g=[];for(e=new c(b,a),f=b;f&&(1===f.nodeType&&g.push(f),f!==d);f=e.next());return g},f=function(c,d){var e,f,g;f=c.dom,g=c.selection,e=a.create(f,g.getRng()),b.each(d,function(a){c.dom.remove(a,!0)}),g.setRng(a.resolve(f,e))},g=function(a){return"A"===a.nodeName&&a.hasAttribute("href")},h=function(a,b){var c=a.getParent(b,g);return c?c:b},i=function(a){var c,f,i,j,k,l,m;return k=a.selection,l=a.dom,m=k.getRng(),c=h(l,d.getNode(m.startContainer,m.startOffset)),f=d.getNode(m.endContainer,m.endOffset),i=a.getBody(),j=b.grep(e(i,c,f),g)},j=function(a){f(a,i(a))};return{unlinkSelection:j}}),g("m",["p","q"],function(a,b){var c=function(a,b){var c,d,e;for(e='',e+="",d=0;b>d;d++){for(e+="",c=0;a>c;c++)e+="";e+=""}return e+="",e+="

"},d=function(a){var b=a.dom.select("*[data-mce-id]");return b[0]},e=function(a,b,e){a.undoManager.transact(function(){var f,g;a.insertContent(c(b,e)),f=d(a),f.removeAttribute("data-mce-id"),g=a.dom.select("td,th",f),a.selection.setCursorLocation(g[0],0)})},f=function(a,b){a.execCommand("FormatBlock",!1,b)},g=function(b,c,d){var e,f;e=b.editorUpload.blobCache,f=e.create(a.uuid("mceu"),d,c),e.add(f),b.insertContent(b.dom.createHTML("img",{src:f.blobUri()}))},h=function(a){a.selection.collapse(!1)},i=function(a){a.focus(),b.unlinkSelection(a),h(a)},j=function(a,b,c){a.focus(),a.dom.setAttrib(b,"href",c),h(a)},k=function(a,b){a.execCommand("mceInsertLink",!1,{href:b}),h(a)},l=function(a,b){var c=a.dom.getParent(a.selection.getStart(),"a[href]");c?j(a,c,b):k(a,b)},m=function(a,b){0===b.trim().length?i(a):l(a,b)};return{insertTable:e,formatBlock:f,insertBlob:g,createLink:m,unlink:i}}),g("r",[],function(){var a=function(a){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(a.trim())},b=function(a){return/^https?:\/\//.test(a.trim())};return{isDomainLike:a,isAbsolute:b}}),g("g",["c","d","o","m","r"],function(a,b,c,d,e){var f=function(a){a.find("textbox").eq(0).each(function(a){a.focus()})},g=function(c,d){var e=b.create(a.extend({type:"form",layout:"flex",direction:"row",padding:5,name:c,spacing:3},d));return e.on("show",function(){f(e)}),e},h=function(a,b){return b?a.show():a.hide()},i=function(a,b){return new c(function(c){a.windowManager.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){var d=a===!0?"http://"+b:b;c(d)})})},j=function(a,b){return!e.isAbsolute(b)&&e.isDomainLike(b)?i(a,b):c.resolve(b)},k=function(a,b){var c=function(){a.focus(),d.unlink(a),b()};return g("quicklink",{items:[{type:"button",name:"unlink",icon:"unlink",onclick:c,tooltip:"Remove link"},{type:"textbox",name:"linkurl",placeholder:"Paste or type a link"},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(){var b,c="";b=a.dom.getParent(a.selection.getStart(),"a[href]"),b&&(c=a.dom.getAttrib(b,"href")),this.fromJSON({linkurl:c}),h(this.find("#unlink"),b)},onsubmit:function(c){j(a,c.data.linkurl).then(function(c){d.createLink(a,c),b()})}})};return{createQuickLinkForm:k}}),h("s",tinymce.geom.Rect),g("t",[],function(){var a=function(a){return{x:a.left,y:a.top,w:a.width,h:a.height}},b=function(a){return{left:a.x,top:a.y,width:a.w,height:a.h,right:a.x+a.w,bottom:a.y+a.h}};return{fromClientRect:a,toClientRect:b}}),g("h",["e","s","t"],function(a,b,c){var d=function(b){var c=a.getViewPort();return{x:b.x+c.x,y:b.y+c.y,w:b.w,h:b.h}},e=function(a){var b=a.getBoundingClientRect();return d({x:b.left,y:b.top,w:Math.max(a.clientWidth,a.offsetWidth),h:Math.max(a.clientHeight,a.offsetHeight)})},f=function(a,b){return e(b)},g=function(a){return e(a.getElement().ownerDocument.body)},h=function(a){return e(a.getContentAreaContainer()||a.getBody())},i=function(a){var b=a.selection.getBoundingClientRect();return b?d(c.fromClientRect(b)):null};return{getElementRect:f,getPageAreaRect:g,getContentAreaRect:h,getSelectionRect:i}}),g("i",["s","t"],function(a,b){var c=function(a,b){return{rect:a,position:b}},d=function(a,b){return{x:b.x,y:b.y,w:a.w,h:a.h}},e=function(b,e,f,g,h){var i,j,k;return i=a.findBestRelativePosition(h,f,g,b),f=a.clamp(f,g),i?(j=a.relativePosition(h,f,i),k=d(h,j),c(k,i)):(f=a.intersect(g,f),f?(i=a.findBestRelativePosition(h,f,g,e))?(j=a.relativePosition(h,f,i),k=d(h,j),c(k,i)):(k=d(h,f),c(k,i)):null)},f=function(a,b,c){return e(["cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr"],a,b,c)},g=function(a,b,c){return e(["tc-bc","bc-tc","tl-bl","bl-tl","tr-br","br-tr"],["bc-tc","bl-tl","br-tr"],a,b,c)},h=function(a,c,d,e){var f;return"function"==typeof a?(f=a({elementRect:b.toClientRect(c),contentAreaRect:b.toClientRect(d),panelRect:b.toClientRect(e)}),b.fromClientRect(f)):e},i=function(a){return a.panelRect};return{calcInsert:f,calc:g,userConstrain:h,defaultHandler:i}}),g("a",["j"],function(a){var b=function(a,b){if(b(a))return!0;throw new Error("Default value doesn't match requested type.")},c=function(a){return function(c,d,e){var f=c.settings;return b(e,a),d in f&&a(f[d])?f[d]:e}},d=function(a,b){return a.split(b).filter(function(a){return a.length>0})},e=function(b,c){var e=function(a){return"string"==typeof a?d(a,/[ ,]/):a},f=function(a,b){return a===!1?[]:b};return a.isArray(b)?b:a.isString(b)?e(b):a.isBoolean(b)?f(b,c):c},f=function(a){return function(c,d,f){var g=d in c.settings?c.settings[d]:f;return b(f,a),e(g,f)}};return{getStringOr:c(a.isString),getBoolOr:c(a.isBoolean),getNumberOr:c(a.isNumber),getHandlerOr:c(a.isFunction),getToolbarItemsOr:f(a.isArray)}}),g("3",["c","d","e","f","g","h","i","a"],function(a,b,c,d,e,f,g,h){return function(){var i,j,k=["bold","italic","|","quicklink","h2","h3","blockquote"],l=["quickimage","quicktable"],m=function(b,c){return a.map(c,function(a){return d.create(b,a.id,a.items)})},n=function(a){return h.getToolbarItemsOr(a,"selection_toolbar",k)},o=function(a){return h.getToolbarItemsOr(a,"insert_toolbar",l)},p=function(a){return a.items().length>0},q=function(c,f){var g=m(c,f).concat([d.create(c,"text",n(c)),d.create(c,"insert",o(c)),e.createQuickLinkForm(c,z)]);return b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:a.grep(g,p),oncancel:function(){c.focus()}})},r=function(a){a&&a.show()},s=function(a,b){a.moveTo(b.x,b.y)},t=function(b,c){c=c?c.substr(0,2):"",a.each({t:"down",b:"up",c:"center"},function(a,d){b.classes.toggle("arrow-"+a,d===c.substr(0,1))}),"cr"===c?(b.classes.toggle("arrow-left",!0),b.classes.toggle("arrow-right",!1)):"cl"===c?(b.classes.toggle("arrow-left",!0),b.classes.toggle("arrow-right",!0)):a.each({l:"left",r:"right"},function(a,d){b.classes.toggle("arrow-"+a,d===c.substr(1,1))})},u=function(a,b){var c=a.items().filter("#"+b);return c.length>0?(c[0].show(),a.reflow(),!0):!1},v=function(a,b,d,e){var i,k,l,m;return r(a),a.items().hide(),u(a,b)?(m=h.getHandlerOr(d,"inline_toolbar_position_handler",g.defaultHandler),i=f.getContentAreaRect(d),k=c.getRect(a.getEl()),l="insert"===b?g.calcInsert(e,i,k):g.calc(e,i,k),void(l?(k=l.rect,j=e,s(a,g.userConstrain(m,e,i,k)),t(a,l.position)):z(a))):void z(a)},w=function(){return i.items().filter("form:visible").length>0},x=function(a,b){if(i){if(i.items().hide(),!u(i,b))return void z(i);var d,e,k,l;r(i),i.items().hide(),u(i,b),l=h.getHandlerOr(a,"inline_toolbar_position_handler",g.defaultHandler),d=f.getContentAreaRect(a),e=c.getRect(i.getEl()),k=g.calc(j,d,e),k&&(e=k.rect,s(i,g.userConstrain(l,j,d,e)),t(i,k.position))}},y=function(a,b,c,d){i||(i=q(a,d),i.renderTo(document.body).reflow().moveTo(c.x,c.y),a.nodeChanged()),v(i,b,a,c)},z=function(){i&&i.hide()},A=function(){i&&i.find("toolbar:visible").eq(0).each(function(a){a.focus(!0)})},B=function(){i&&(i.remove(),i=null)},C=function(){return i&&i.visible()&&w()};return{show:y,showForm:x,inForm:C,hide:z,focus:A,remove:B}}}),g("k",["o"],function(a){var b=function(b){return new a(function(a){var c=new FileReader;c.onloadend=function(){a(c.result.split(",")[1])},c.readAsDataURL(b)})};return{blobToBase64:b}}),g("l",["o"],function(a){var b=function(){return new a(function(a){var b;b=document.createElement("input"),b.type="file",b.style.position="fixed",b.style.left=0,b.style.top=0,b.style.opacity=.001,document.body.appendChild(b),b.onchange=function(b){a(Array.prototype.slice.call(b.target.files))},b.click(),b.parentNode.removeChild(b)})};return{pickFile:b}}),g("4",["3","k","l","m"],function(a,b,c,d){var e=function(a){for(var b=function(b){return function(){d.formatBlock(a,b)}},c=1;6>c;c++){var e="h"+c;a.addButton(e,{text:e.toUpperCase(),tooltip:"Heading "+c,stateSelector:e,onclick:b(e),onPostRender:function(){var a=this.getEl().firstChild.firstChild;a.style.fontWeight="bold"}})}},f=function(a,f){a.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){f.showForm(a,"quicklink")}}),a.addButton("quickimage",{icon:"image",tooltip:"Insert image",onclick:function(){c.pickFile().then(function(c){var e=c[0];b.blobToBase64(e).then(function(b){d.insertBlob(a,b,e)})})}}),a.addButton("quicktable",{icon:"table",tooltip:"Insert table",onclick:function(){f.hide(),d.insertTable(a,2,2)}}),e(a)};return{addToEditor:f}}),h("n",tinymce.EditorManager),g("5",["n","e"],function(a,b){var c=function(a,b){var c=function(){a.fire("SkinLoaded"),b()};a.initialized?c():a.on("init",c)},d=function(b){var c=a.baseURL+"/skins/";return b?c+b:c+"lightgray"},e=function(a,b){return a.documentBaseURI.toAbsolute(b)},f=function(a,f){var g=a.settings,h=g.skin_url?e(a,g.skin_url):d(g.skin),i=function(){c(a,f)};b.styleSheetLoader.load(h+"/skin.min.css",i),a.contentCSS.push(h+"/content.inline.min.css")};return{load:f}}),g("8",[],function(){var a=function(a,b){return{id:a,rect:b}},b=function(a,b){for(var c=0;c=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(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=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;or;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,H,O,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},H=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(O=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),H.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),H=H.length&&new RegExp(H.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!H||!H.test(n))&&(!P||!P.test(n)))try{var r=O.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode), -e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);ir;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;ii&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;it;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(H)}function g(){return E(O)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=O&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,H=0,O=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n,n="*"===n?function(e){ -return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="
"+t,r.removeChild(r.firstChild)}catch(i){n("
").html("
"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("
").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;nn.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;co;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))),T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p), -l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,H,O,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),H=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,O=a.getSpecialElements();c=P.exec(e);){if(u0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(H,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=O[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,H,O,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),H=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=H[b.name],s&&H[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(H,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// ")):o.length>0&&(i.firstChild.value="")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(O,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+O,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(O-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",H+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:O,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,H=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,O=k.clientWidth,I=k.clientHeight,F=I/O,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+H},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:H,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},O+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+H-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,H,O,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottomt.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottomt.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\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\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML(''+C+""),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML(''+C+""))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='
'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,O,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(rc+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&"data-mce-style"!==i&&"data-mce-fragment"!=i&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("

").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(O(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(O(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){ -for(a=Y.clone(o,ne),c=0;cC&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function H(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function O(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:bo?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;oh?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;io?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return aP)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'
'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='
'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:LD.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!H||E());if((W&&!H||!W&&H)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&H)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!H)return void E()}else if(!W&&!H&&"LI"!=z||W&&H)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(O=M.parentNode.insertBefore(C(),M),m(O),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),O=I.firstChild,a.insertAfter(I,M),g(O),k(M),a.isEmpty(M)&&b(M),O.normalize(),a.isEmpty(O)?(a.remove(O),T()):v(O)),a.setAttrib(O,"id",""),i.fire("NewBlock",{newBlock:O}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t0)return n(C,--x);if(m(e)&&x0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='​',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null),f()),x=D.getNode();var H={context:x.nodeName.toLowerCase(), -data:u.data};if(N=b.parse(c,H),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),H.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(//i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[m,w],function(e,t){var n=0;return{id:function(){return"mceu_"+n++},create:function(n,r,i){var o=document.createElement(n);return t.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:e.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},getRuntimeStyle:function(e,n){return t.DOM.getStyle(e,n,!0)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;oo;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;tn.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i;if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t); -}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
'+(e.settings.html||"")+t.renderHtml(e)+"
"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('
'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
'+t.renderHtml(e)+"
":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
'+(e._preBodyHtml||"")+n+"
"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;in&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='
',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;tr.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
'+e.encode(i.title)+'
'),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
'+o+'
'+s+"
"+a+"
"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'
0%
'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n=''),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r=''),e.progressBar&&(i=e.progressBar.renderHtml()),'"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(He,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(Oe,[I,T,y,He,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock),r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(), -i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function H(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function O(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),H(),O(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[_,p,z],function(e,t,n){function r(e){function r(e){return i(e)}function a(t){f(e.getBody()).css("cursor",t)}function s(t){return t==g.element||e.dom.isChildOf(t,g.element)?!1:!i(t)}function l(t){var n,r,i,o,s=0,l=0,c,u,d,h;0===t.button&&(n=t.screenX-g.screenX,r=t.screenY-g.screenY,c=Math.max(Math.abs(n),Math.abs(r)),!g.dragging&&c>10&&(g.dragging=!0,a("default"),g.clone=g.element.cloneNode(!0),i=m.getPos(g.element),g.relX=g.clientX-i.x,g.relY=g.clientY-i.y,g.width=g.element.offsetWidth,g.height=g.element.offsetHeight,f(g.clone).css({width:g.width,height:g.height}).removeAttr("data-mce-selected"),g.ghost=f("
").css({position:"absolute",opacity:.5,overflow:"hidden",width:g.width,height:g.height}).attr({"data-mce-bogus":"all",unselectable:"on",contenteditable:"false"}).addClass("mce-drag-container mce-reset").append(g.clone).appendTo(e.getBody())[0],o=e.dom.getViewPort(e.getWin()),g.maxX=o.w,g.maxY=o.h),g.dragging&&(e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t.clientX,t.clientY),u=g.clientX+n-g.relX,d=g.clientY+r+5,u+g.width>g.maxX&&(s=u+g.width-g.maxX),d+g.height>g.maxY&&(l=d+g.height-g.maxY),h="BODY"!=e.getBody().nodeName?e.getBody().getBoundingClientRect():{left:0,top:0},f(g.ghost).css({left:u-h.left,top:d-h.top,width:g.width-s,height:g.height-l})))}function c(t){var n;if(g.dragging&&(e.selection.setRng(e.selection.getSel().getRangeAt(0)),s(e.selection.getNode()))){var r=g.element;if(n=e.fire("drop",{targetClone:r,clientX:t.clientX,clientY:t.clientY}),n.isDefaultPrevented())return;r=n.targetClone,e.undoManager.transact(function(){e.insertContent(m.getOuterHTML(r)),f(g.element).remove()})}d()}function u(a){var s,u;if(d(),0===a.button&&(s=t.find(e.dom.getParents(a.target),n.or(i,o)),r(s))){if(u=e.fire("dragstart",{target:s}),u.isDefaultPrevented())return;e.on("mousemove",l),e.on("mouseup",c),h!=p&&(m.bind(h,"mousemove",l),m.bind(h,"mouseup",c)),g={screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,element:s -}}}function d(){f(g.ghost).remove(),a(null),e.off("mousemove",l),e.off("mouseup",d),h!=p&&(m.unbind(h,"mousemove",l),m.unbind(h,"mouseup",d)),g={}}var f=e.$,h=document,p=e.getDoc(),m=e.dom,g={};e.on("mousedown",u),e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(i(n)||i(e.dom.getContentEditableParent(n)))&&t.preventDefault()})}var i=e.isContentEditableFalse,o=e.isContentEditableTrue;return{init:r}}),r(Qe,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Je,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(e){return c.dom.isBlock(e)}function S(e){e&&c.selection.setRng(e)}function k(){return c.selection.getRng()}function T(e,t){c.selection.scrollIntoView(e,t)}function R(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(T(t,-1===e),ie.show(n,t))}function A(e){var t;return ie.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:B(e)}function B(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function D(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function L(e,t){return t=i.normalizeRange(e,ee,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function M(e){return r.isCaretContainerBlock(e.startContainer)}function P(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?R(e,i,-1==e):(s=M(r),o=L(e,r),n(o)?A(o.getNode(-1==e)):(o=t(o))?n(o)?R(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&D(o,a)?R(e,a.getNode(-1==e),1==e):s?V(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=L(e,n),i=t(ee,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),R(e,l.node,f>d);if(p){var m=a.positionsUntil(e,ee,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return V(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return V(l.position.toRange())}}function O(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='
'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?ne(n.fromRangeStart(r)):re(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function I(e,t,n,r){var i;return(i=P(e,t,n,r))?i:(i=O(e,r),i?i:null)}function F(e,t,n){var r;return(r=H(e,t,n))?r:(r=O(e,n),r?r:null)}function z(){return se("*[data-mce-caret]")[0]}function U(e){e=se(e),e.attr("data-mce-caret")&&(ie.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),S(k()),T(e[0]))}function W(e){var t,r;return e=i.normalizeRange(1,ee,e),t=n.fromRangeStart(e),x(t.getNode())?R(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?R(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?R(1,r,!1):(ie.hide(),null))}function V(e){var t;return e&&e.collapsed?(t=W(e),t?t:e):e}function $(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=re(n.before(e)),i||(t=ne(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),J(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function q(e,t,n){var r=c.dom,i,o,a,s;if(-1===e){if(N(n)&&y(n.getNode(!0)))return $(n.getNode(!0))}else if(E(t)&&y(t.getNode()))return $(t.getNode());if(s=c.schema.getTextBlockElements(),i=r.getParent(t.getNode(),r.isBlock),o=r.getParent(n.getNode(),r.isBlock),i===o||!s[i.nodeName]||!s[o.nodeName])return null;for(;a=i.firstChild;)o.appendChild(a);return c.dom.remove(i),n.toRange()}function j(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?V($(o)):(a=L(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?te.prev(a):te.next(a),l?V(l.toRange()):i):t(a)?V($(a.getNode(-1==e))):(s=-1==e?te.prev(a):te.next(a),t(s)?-1===e?q(e,a,s):q(e,s,a):void 0))}function Y(){function e(e,t){var n=t(k());n&&!e.isDefaultPrevented()&&(e.preventDefault(),S(n))}function r(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function i(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function o(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=r(e.target);x(n)?t||(e.preventDefault(),G(A(n))):J()})}function l(){var e,t=r(c.selection.getNode());C(t)&&y(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function f(e){var t=z();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void U(t)):void(" "!=t.innerHTML&&U(t))}function g(e){var t;switch(e.keyCode){case d.DELETE:t=l();break;case d.BACKSPACE:t=l()}t&&e.preventDefault()}var v=b(I,1,ne,E),w=b(I,-1,re,N),_=b(j,1,E,N),T=b(j,-1,N,E),B=b(F,-1,a.upUntil),D=b(F,1,a.downUntil);c.on("mouseup",function(){var e=k();e.collapsed&&S(W(e))}),c.on("click",function(e){var t;t=r(e.target),t&&x(t)&&e.preventDefault()});var L=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},M=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},P=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!M(n,r)&&L(n)};o(c),c.on("mousedown",function(e){var t;if(t=r(e.target))x(t)?(e.preventDefault(),G(A(t))):(J(),i(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{J(),ie.hide();var n=s.closestCaret(ee,e.clientX,e.clientY);n&&(P(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),S(R(1,n.node,n.before))))}}),c.on("keydown",function(t){if(!d.modifierPressed(t))switch(t.keyCode){case d.RIGHT:e(t,v);break;case d.DOWN:e(t,D);break;case d.LEFT:e(t,w);break;case d.UP:e(t,B);break;case d.DELETE:e(t,_);break;case d.BACKSPACE:e(t,T);break;default:x(c.selection.getNode())&&t.preventDefault()}}),c.on("keyup compositionstart",function(e){f(e),g(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){S(V($(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ae){if(!ae.parentNode)return void(ae=null);t=t.cloneRange(),t.selectNode(ae),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=G(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng(V(c.selection.getRng()))},0)}),m.init(c)}function X(){var e=c.contentStyles,t=".mce-content-body";e.push(ie.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;width: 100px;height: 100px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function K(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function G(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return J(),null;if(t.collapsed){if(J(),!K(t)){if(f=L(1,t),x(f.getNode()))return R(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return R(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(J(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(J(),null):(h=d.targetClone,o=r("#"+oe),0===o.length&&(o=r('
').attr("id",oe),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ae=n,t)):(J(),null))}function J(){ae&&(ae.removeAttribute("data-mce-selected"),c.$("#"+oe).remove(),ae=null)}function Q(){ie.destroy(),ae=null}function Z(){ie.hide()}var ee=c.getBody(),te=new t(ee),ne=b(v,te.next),re=b(v,te.prev),ie=new o(c.getBody(),y),oe="sel-"+c.dom.uniqueId(),ae,se=c.$;return e.ceFalse&&(Y(),X()),{showBlockCaretContainer:U,hideFakeCaret:Z,destroy:Q}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(Ze,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(et,[w,g,E,R,A,H,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,Oe,d,m,u,Ie,Fe,ze,je,Qe,Ze],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,H=N.each,O=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),H(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),H(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);H(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(H(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(this.editorManager.i18n.setCode(n.language),t.rtl=n.rtl_ui||this.editorManager.i18n.rtl,n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),H(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&H(O(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',!/#$/.test(document.location.href))for(p=0;p',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){H(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",H(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),H(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?H(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&H(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'
',"TABLE"==r.nodeName?e=""+o+"":/^(UL|OL)$/.test(r.nodeName)&&(e="
  • "+o+"
  • "),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='
    '),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),H(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(tt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(nt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i), -s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(rt,[et,g,w,ae,d,m,c,ue,tt,nt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(it,[rt,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ot,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(at,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(st,[at,ot,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(lt,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ct,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(ut,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(dt,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ft,[dt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(ht,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append(''),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(pt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(mt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+"
    "},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(gt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='
    ",e.classes.add("has-open")),'
    '+s+"
    "},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(vt,[gt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(yt,[ht,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(bt,[yt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a=''+e.encode(r)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Ct,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(xt,[De,we,pe,Ct],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
    ';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
    '+e()+'
    ','
    '+i+"
    "}})}),r(wt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'
    '+e._getDataPathHtml(e.state.get("row"))+"
    "},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'":"")+'
    '+n[r].name+"
    ";return o||(o='
    \xa0
    '),o}})}),r(Nt,[wt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(Et,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(_t,[xe,Et,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(St,[_t],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(kt,[gt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Tt,[ft],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Rt,[ft],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,H,O,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",H="left",M="w",D="x",L="innerW",P="minW",O="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",H="top",M="h",D="y",L="innerH",P="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[H]+p[P]+o[O],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[H],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[H]-o[O]),x[D]=o[H]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(At,[dt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Bt,[ye,De,ke,m,rt,d],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{ -var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&c(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function l(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function c(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var u;u=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){c(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:l,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:u}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:c,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="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",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:u})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Dt,[ft],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;dd;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var H=e.parent();H&&(H._lastRect=null,H.recalc())}}})}),r(Lt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Mt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+'
    '},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Pt,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'":''+e.encode(e.state.get("text"))+""},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(Ot,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(It,[ht,be,Ot],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s=''+e.encode(a)+""),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(Ft,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t'+("-"!==a?'\xa0":"")+("-"!==a?''+a+"":"")+(c?'
    '+c+"
    ":"")+(i.menu?'
    ':"")+"
    "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(zt,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('
    '),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Ut,[ke,Ft,zt,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Wt,[It,Ut],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(qt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(jt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Yt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
    '}})}),r(Xt,[It,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Kt,[At],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Gt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Jt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Qt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,H,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,et,tt,nt,rt,ot,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ht,Ot,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt])}(this); \ No newline at end of file +// 4.4.3 (2016-09-01) +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(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=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;or;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], +!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);ir;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;ii&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;it;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, +n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="
    "+t,r.removeChild(r.firstChild)}catch(i){n("
    ").html("
    "+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("
    ").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;nn.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;co;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), +T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// ")):o.length>0&&(i.firstChild.value="")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottomt.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottomt.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\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\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML(''+C+""),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML(''+C+""))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='
    '),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(rc+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("

    ").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, +o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;cC&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:bo?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;oh?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;io?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return aP)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'
    '}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='
    '),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:LD.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t0)return n(C,--x);if(m(e)&&x0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='​',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), +f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(//i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;oo;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;tn.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; +if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
    '},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('
    '),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;in&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
    ').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='
    ',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;tr.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'
    0%
    '},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n=''),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r=''),e.progressBar&&(i=e.progressBar.renderHtml()),'"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), +r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), +t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='
    '),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('
    ').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',!/#$/.test(document.location.href))for(p=0;p',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
    ';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'
    ',"TABLE"==r.nodeName?e=""+o+"":/^(UL|OL)$/.test(r.nodeName)&&(e="
  • "+o+"
  • "),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='
    '),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, +startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append(''),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+"
    "},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='
    ",e.classes.add("has-open")),'
    '+s+"
    "},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a=''+e.encode(r)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
    ';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
    '+e()+'
    ','
    '+i+"
    "}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'
    '+e._getDataPathHtml(e.state.get("row"))+"
    "},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'":"")+'
    '+n[r].name+"
    ";return o||(o='
    \xa0
    '),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", +P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="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",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;dd;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+'
    '},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'":''+e.encode(e.state.get("text"))+""},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s=''+e.encode(a)+""),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t'+("-"!==a?'\xa0":"")+("-"!==a?''+a+"":"")+(c?'
    '+c+"
    ":"")+(i.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('
    '),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
    '}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ +e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/version.jpg b/copy_this/modules/bla/bla-tinymce/version.jpg index 04a683c22899eee9d114831ca82ae015102a3975..541c1511b2865749a7b077872c05ee15bec53c32 100644 GIT binary patch literal 135849 zcmeIbZ*v>Ru`m4Es(QY|8md@ij0OKw6euc3v6XvVCppQDeV%h}*)G-+SP*N00D=W2 z(F(uTef7M%U+npHPxt)Uodp&kmH5=Plvw1>OixdDPft%zPtVKGzy9-A-~F$@yh+B( zo5`yuFX^9TFv-gDqSHwx+4TCNGtASk-*l4sA|DkWE;_U8K58%L{k^@}^}KhJ?@i06 z$>^&7b#HX_v_nAiZ20QQXHPzRd6O?QZk*bbiSHRm-%#=es?#|JITQOcF|ep zAC`NB%Xu;wXNxjlUfeE6=~-v*)e{Evd76G-jFQPRPriARoc##!FU!HAm@kthKnaAO zvUi#J+DXdA;G!dV-(-ty*?V8^y`QJj=iYLh-{j@q>v!2O+r#+tWx4lL$w-`(gY-F^OjJ{=aLAJbHD;=xU`8}$CJ$luRri={WD_r-8Iz8L23ib0<8FWsb= z7Rw@=q~#!+1jGC6<+4~#@>k#H1qL@Q2IFONosVv(!+e^2@$~HQ;NU#b0leHZ zm7jdZe}n`8V*c#?Hu+z(+hmYUlWaIlZf1*|Xgn&eZ$W@!Hce)8`ln2mv*dk#H3I!7 zvuv0zlB+vn_`70uTTbqhAy_{xrq>Cml>BFY^#@c0>i{TuUo6MT-RyQ@Vf}Vb`v-@1 zm>;uIrPam7Mbe=$0d79*B)iE+ZS+|P|00>@?~^}Y{ge-uJGt25dYJdOidN#YB zg^@CXj%MUjb6w$Q1=xA@r z7mMs~x3lx)4><`aBg6WGIH#5NMkw6ldFxPnV1NHMyCEUU7U{~KAuLp_^iTjfUqUe^ zf0!+j;xE}S`D+e&&XQqK&L`PjLYj)|SR!_a5P7zt2us47({jkT4f7mQ_fQWGCf@PnORM!7Mi$^gXOm2sS>QDGTK5+FE!klA#y_;f+ z3H!Tu`QqZZciOp!Vgcnow>l;3UUdh%ANBWSxRdREq)9pG4!e1G)V=PGFRm)er2}=2 zWv#Q@EiT4A%vdO5n*CpV;s3VNIUJ(OPZ!@V7a)3Xw3yv|g{AZ>OxE*awDWoK_rHH$ z^hU*G@*NuQF7oB=V*2^Pc?pF+81EE4g86%l0@6b3>1^KVqCWb%=$!8FCr5|#56SBV zmak41SPxLMGn!=AoxTB;IN&=!?VOw(ot$=0PS5u7U;X*;bho?T-QVqgzBBGEXJ2Q_ z>_7hc$DQ5YB%fX{$1jiaqunpQ04f8JbMaSN08qU_(F*m1b7o*x|@ zbWczAk6v`o4);&A*XR2$wATU1=k*FGTlXVF@_-L3zz3gSTnu;5nM}h15>Xb*yOp$h zet38w^vN#@V)QpOEr?1x2d7>7U-w|QH^lGV(M1l`{3Yb~%l!KT{ozo5IQlV8BJ^PC za&&yuwzuoGy^S#1YctrgxPgvo9_e$EilYj&iDE(7rPZALuSK8)*bL#U$<<#S0o$tWxGRWcV`#$ z>OsxJR{d&ROolsy-Fwn7tXsOpIo9i);^OsUk=^ZdgjZcNk-IR^gv8yBlUe)u1@sG$ zyPcDzTV8z3A=P)wF|Fy`o$OSvwcMfO`upE^uERC~xSid5 zNDsCKZ{ER__+wFGFP1NUw^RSN(*ahz(4Zde5QZHrPM>1}WVQA?9oj=k`EGv)HI~b4 zFy>BnI7Bs3&I17hk}te$NXzWQOX=Z@XRkMQZKt?%wYh1E;II zfNq1q!*;N5_P#8acaz-TsSZl)E}s-P*MOgv*tX<%UH+Bvpv{pOaeZtWX+=&xhhD|J z%ce^h6<4zbHf{Z6I;)p_NXu~sJ1kae7SMijkl%y=d4-L9hxKz^O#8`x(%XMtZG`!c zT^07T*`&BerF6en158qUy_jL^7sF=`StR`d`2P6rpMZKqvS0_mU&?WwFP|mF@Z#A3 zIt(T(Nck+0&BKcQ{(N$ak(7JV3Ol4__8}d^paAk?Y#8g)L>%{pV*qaJnTL1 z9bR6+o$<`D(QLrD@0)yBWEamcWuMW8-kICasu;sPG0al;wJq*}uY#NR6tm;re(z{K zPS_@R{*xE*pR7l73~{3sx7-d*+k9hOJx9w5EXg#@-sk1)Cf^D{@%a!KY^oeE{y7!M z8{@t?oxgdLdcFUGhT^j!lppfHt>BCi^KagqJ!CL68;ksGV+KU9{^m_Pd>@YPgRr&R z^aj0A{E-yZ)$GGoc)~MgT5pQuI<&GWw(sm!+zKz(d{e}X#q6tN&mYGA-)E8aK)3MZ z?EUF)w=iMlAKkeh^bQVt$Im?9Z{Yf+ch|V9Ch;idV#Md1(v0FTDSpP2tz@Rx<1!i}ErXV$DOrK7J(!W4SQbY!Yt=Ti^^Bra~?T?34NgC~-j zqZ#>TlI(W$^X=OSZ`lY9@b$+ZUlB*01-YdF!v3Yhmc8|+59UI}@)0+dCoX|-I;CKp z+w;QsV)xXOt0gKyx;j{^VY5 z@i=rc#XE!Bayh$6ov}|#0X8^Sv*BH@R+xND{F<}L3|pC}`x*T`PkiH_ZCy6@Yo@c= z7MUf7+376uSN}o=RXWNB`A7K)JFL6@IUFl}ctBA0o;``QC0X2L6Z4Hbv!CvJd^C7@ zynpm@z$jiX@_c%JPh;xRStb7`i4XB(ZGcaY;08T9Ilq5;lNHnM({fVK*5@i)bbE%) zFau}Uhv0;Aeg`ErUZyy1$*QH;slojd7R})&O!+(mEO78j@N_!N7I!JRhH?~`f75rz z$8p8RU|mfhZRRHifp93A%fUp-jme=)**@lken=_DU5 z`$zlp59j)Yhi5+B8}Dv<03Wjw0*I4Af#m=vPBekKekE*r$JkFU@?kp9;k+kS-%cjH zg>Ba-G!piL2CtM6lP?A@^QnTEbdbXS3a}C0)lmLe>%`mP*1Pix@0AQUvnx0TQXKo- zVt$s`W2ZM*G8R)yD5(K1rsLU!m@z4mtQ`>^)J+9NLIB6tHx{uO9FQqaSqXQGj&S`1 zg78T?|7Q+7LiZP+YMkh+-re!pr|quZBGRqQueL;C4YLUj6Y5 zRxT9NY&KaIaH^^Qp_`c^(c(|@7ungN>fxl9UCnNxPH&f}pY&LXCeotIsygZ6cyyVJ z58Y>{yHirpR_e0>7Ew5ZFhS?pG@lrqyrP{^=HMp$nWV_z@#I5ZgK__gkJtUR!t{4L zVF8dKKYhO->k-(CF7lR$1gr0Y4(*K=;W_#$$+}y#vDmcf?vj?I%gwqA+tj=JY59Jc z^yt5r@X+QFs zo9DsGMy;l61VRhULfxx0pUlXhBra7!%x816FbTcr;0k8kA{QN>jljxok7M6o=i!7}_JzEX*d<6*!>)M3_^`?mL zquz>ZCPk8cPqAY}kRPi($Ey-~w5rmlwt_dyTeYfXFwQL(DeajNCs|^>x0Bv0u;1!t z$@m1e$~6XOMggJ_klt`Hn-8*i)ml+OTRmYhuQP0h$Z0?TR)1>jgKnpX*=mpVCw^Y6VlnNCRv> zv;B^iRq5QQgQCDItSKTpbNl#0YIMBWzqSNidzP621^-$>+ zl(q7Mj~Rk=4GV>Aq~PJiDogSb=}5aAN&y{43Ip4x%3S#vQx9-rSq@l59@XKQwl@x~ zK*^j7XmSsQ>Id+bv+ri}8oNux1tN463`RIbPky_)T`m#YUQFk=%kPb6mpl)}vLjl* z+Zz-M#QLRou=IGMS+y+ct3j*kya~0cRQ{l@Q<0HcN2f<;M=wYTUm;YORwz~M%1i`@D#Nt06$lS@xH+a- z88sBC0K-w>A|n>Cu;}_GGnY5mw`jKJW@ijbn1xviL^3UxtP?TmamcflTR(1$1mdgJ zRkyxS)Eh0}%iTFVIqB;E_jgsoWk_%(kB&zAk%$PZV>#~oo>6@5A0NTTp{~-a8KnCL zw-(6nVX54Vm|bf(qjwB@yYkEML&tQT0#6Um4zt569iWc-_s3ryf2|+gs1LkB(x?x} zfmIpxf${c$g`}Ox;S0N#>@D%H&?LdH5mW}p+0p5t_A02zM;aG=-vLA=sB~ae3<9o( za1d2GOvXo6zA7z@+efe}5%DyeBa~Y^+6}%R*iLsN9hybAkIPBeVGa9V|JOGZ z6#d;Io0haS?)|A4EN10wwCq`w$aX}KJUT9yiwhZCH=&4F`_YUNhzQ(d1>o0{`8eD8 z^E?|Mg!_VKbrV${OkFY%9}a}J-4A5*Y*P^Tz3Ge&^*qc5xN0Hc6{X^=FiURZp?Ts`nlSBsRS_L*u4Cw>JY&pV+I~f6}>iz9cP< z8?m!#A7{}?@33@x=SUIno@3w3GzMuF`+DC42j8Z&OGss|U@v56gmun!Yw9dMq3hM+ zGrXo8s}r@Mg3|%D3N4gEt&OOIwVk(88#U;y^+>JdI>pk_4P8vN#C5Ii9b^2^{cuQ! z@T*c@zpf>>R*cfPQb>{fP5M}?wxp(3Z%sneARwesfajk`N2^j69W4gthC12+v8Lj7 zI=T&z)jGNrgjG7a4S-cTy59c5I$D>%z(6+rz>ukHxR_<5QdphYQG=(ca>Wj6tk!xe zR>^!D8-D6?c1&*X}jLVZ5Wa{lmZd_VEg5U z(RiqH4J!`u^ma3{X?voIC!yBGXby#puMF4C20I4`AxnOnAWZ*Y_gwC@)eEfqYEwMq zpv#UJTg%}s4oZ!=P~wb6WnfD}RXfnVZ0Z6jwkBc=*j{MBLrG&Xm%yoqqiuXcs-=db7U7-S&g9k&x#cQ$I(PGDSW2kpSl$*M2D! z8Ykl9?qv_Toz78jG{rgye-M(e3dNwJjZG!bLg0uu!K&Pg(HH7H=JVwI3jGV5iH;EwJK0SR-3E@BAy+q5pqOpEI1I5PLDLm#6R`y zg;l}@dBlI5cg{?C6EaDm+Lq{CfYZ5oN*SLP#9N?ZlqfmHMVs;nE7ON4XJ|Lh2XDpk zen&Bpi19**<`9O_JTo6a*2)O|LtC@&OWddAZ>xAEva>{pN^vur;#v_!%5YSup_C#D zmr;!?Y=bG8U5|9MO76Z837NE6mc7Vu%I2N^OK6ev58SVxIK8}ZfT>;3LH!(wuuEzdo(lCk+9>6e_B-rec%}dH~BU4fZ@`C(fa=Bs_Ix* zr4oB=3&>+bQJF5JMcdM%W@Luq5Lj-m$+K<3#Ef?L9ni+?`Vld5lub~f7#X6lxs8+n z@|q+#7Me}3qq7qy?(KZsT{__l*1G>UUktNp)=mBgu6@13za6@_0MhjqU3smt&=28K95LwSa-WBm&bmnD+lj@6j$h4U z2LoOaT0K5)SbIomGr{Uz*`k`5xP^%FH}(&XIZ&u+<*>t6gSROvYaI_yYMB#lJ3SiB^KIA!y@2R-jzcs? ziiu_SPZ1mCS|Z&v{@t?L17S?Aq;i3wR>8aKQ!jIdFzmW|F_?m61;a}UEsmDUWt@6T zHo#&{07~!R)LW6gM*)7360;Qy?+?|h)vno)m4@W4Ded&x5}^Me9#p5#I@z{-P#4c= zK!1b4NTYJeEwbgtNRWuANzd0(H{iFFNo&-uvtQj&s_%oj!tG(~>?0O-`x?EN*YE+~i(gm8D4t+^RM%Me}ftimb#^vaM`pLs*Yh zsS_)io8x027J0MmAe}0EMS;c?MNb#yB5IIZq8jGboTE`kCo z>zKf(T{sV?`0?mlIt9^jOP`^(Kqg|c2sC5b);x~t3p4{DIt5lxKsXm#YA(q66h`7% z8&4%Xr-@(dPem%?|8wAj`?`^uGNi_8p0si67I_dV2@;SP;DZGI9vtq6q9{QoD%mzl zK$bFg1NG>-;hmULb``F+^sX|%;Tbw)Ql8VoH8luU0vI2z?3LiHz)cy$m$tDb)|=VZ zE|3D&KI225_Y@QCOUV)H8@pFjqf@Tvd;zJ(EkpXJuB|1%w1==YQ^uQnFa6)%qpEE|>u-tt4c zhw*`(TGbNGTJ+S;`*pV{pf9aG?2dX`UX(D`9^^iT2kG_e*DqevF$bAOW@E;wG+Iq*y8lIXISBYG~tJWB~iB}OhRXtmp^jTH-8Vx+Nt|CWX#0C`JbCr6rlkg$`sqgse zZFE>hsYlAmS<~>@PgfGDVr8=`(eOk~uBYyR#u~Kx(2lIJ zg6|$^tVGhpZi40-QFlRO^_ts21?=prvlnO3Nl15A@vzo>e3+y4N;36phZ06Ez2rKL zOHc@dA*l1F)0mYD9lASFKY-nsW{~xs~)>Q?KtsT4(W7f)&W->a0mX1Dl=WgLS-hJ;uLBlJ6LMS+cIaMKB30N}N89f5w9g8X}Y$ z`xDsGXY)&&I(VQ=VNtdlI@ILRavK$#IaZY*@^?y-As} zVrLgr&fsvVA#g~!+(GmisZ7QHFZ9Gma`~%tdhSP#aJ)3i@KQ83YI_-P__r0&5j8&v zwkam<5BnSBX9^gkf;l2s@Foya1_M&!R1Y0&S5Vm}EiHrT)qu zBu0Y1z@enb){_fi1oY9?DN{|N#ggVle)8{^mi+)x3fUrU&31HmVtPAx+g&U!UzmRuW<`sz=qyM)9af!7(z<)z)2MBGlc zth)QJ!!%WW+pDooXmB-FtL*Qa>*=n(v4)ypjTL;mtFe+bwwh~1ck7MSD+U=~j8F|@ zvKe7l!YMLO_D>E@4(qOCyBs#{HR^qP`qJ*~>a}FHv(6PEU^~F1{C8WrOGDbsniphfQ$_9o5Jc&I-#u zUdj?mKe$<~)~_)u^*0V$)&Nv-)9|xelopeo*E)258t>D1hKzI?(r7ArrRv!6K5>J? zumxqLqieIKebwV5?jZ5(v~d`TuZv82_53834oG5(yq-)T+yJ6$O|&2Kb^%HR-c^NJ ztT=GnluKezE$`quQNyl6;BmLTvdjNU>m2=0(A57%h~ksbLeZ|9a@M%Cie4Cnvu%zf z^O>j=4yvqz846c#KEc~Zx;%tsj5{2Vo`caGE=1etcpN``^drewf0av0Q0o%4nVoVa zyV|44We>qdKHq%7+(1}GRSozLxwl0)7@V08{l2C^&wKd&HI%t z4GPrT%4!>Ggq5(2vS7aU%2hQPx2Nl?tbn1%J}dcwYo9;2=3|>{Ky@rC31|A6`rJK?)0wN@0y@FD)p`<>@R&-2} zlF$sTrAml5SVPZ-MjlNYYHUH**m%TP(D@(lObNWA6ts_kZ$s!6;`xiR6`k!Ev1?o* zIpIv60kLsluNqs^)rkOz8b<$2>l6t~-ytoqjRwC^LjVMkT^?mwCnWGjpMFsB*K`#DB=Q%-%9>^X<@ z?4U+U1Jgv;OMEH(%xfNbvgcU-xhwmF;I@gl5#;HlFq4_Srv%H)oWSEa z+k0J6<=$5F`-=1-IE8&EqRy!xo@9POW%YY_U7QLcY##69;&F9E2~Ci{6i*xQm81lz z5D_#(Q0$L)^eA^TVs`FnT#>jw^^(&n`Y_I2xLX$#@vL0W6Ow z{ijC<_-kK=aW>Jz`tvZa%@Xu!(%Omgd-OgvP(tqbJO%?S$dGpNamcv5)OfloJV>nN zy-=sDWFcxZCG@S)RY#oFKn)23!drgypfp92d4tFD$)~@%WGRuGqBcbnvj4%xLCHtI zjmB@8SW-LI#+$VgEeC9H*VI(pdKDxt_f_O6A+RNp?I;S+mQowt zKlOA$Eh9u|n-K$hMyUVrmO*MBOn&4&9Y`FQ`76o)4YDx^NgNV_8U$O5;}`za~m z#Qb;P{0kGbB@inoytXk|-M@-%|JyB+Xd*BM5A)1s6S}C*E-imNp?*T2CW|gP3 zSTVSl`3$w|FY_5Hz(w-lXGTm9m3R0A{Fd+Vu}iw|Z9&8dCrVGxPkRmW*leg)N-PQPN7U-1KxH%Sw)BQ+E4&#i0RxGmlNE}jdOx8L-&A*)D?`_s;2 ze&SXiEQ!VxFx1NPw+O;slg-v;0}B<4KE6>Igm@3^RW*MoQr7TpiD=DL!%_gORy0t@ z3#F(GPOG;bqG?cB7}%{zTSX^gytWG2zr-)^%he0<1c2bUI} z%1$7-`ei<;eE8e)F7Q;xK#Bv2os!0{Wc-tr!OE}c(NKTlD|Hnb1ZDcm5$+bOVl6-h z#i>AU%`~u!lILf`+53JmE%RkUD;G_9`uC{`tM2kIaDAJPhNoSwMQ(BWKNYgu70-~$ z|9VHe_Px1J+zTx)Vlrlnzy);}6HR1O&$=df+sn$gl? z1Abc}_@w;as+Z09y-gSE`F)cQi(A~03fQI0HHG@y#Jss zD06eGUN+;^HeIykm7O%LSk_QGXiF+R{9riuNR#c+85o@j>w4LYf!lPko`DnWtK5?o zV&#Zd<+81(8n@nHrqN;-ooRSV{qbhnR=sS-sBOAv$*6{@6X#b$<#1Zn<{7i?k)|1O z?oqiHodfH7*^GPJbg`a$A6CsXQ@Hg+GtD=cX{48GGYy7)LjQlXHEpY2HsjScU9{y@ z!|ai%R%Ka3?KN}FK-qk9vTD?lt%nCoOY4igMSt4$y8gqelgoceekw)oD()uIs-^zZwhwo%)qE=|Mr0 z70O*Ns`$hz47I;jFaK}AxNh(LY{nfg1|T#7hL&^`PWi4E{7BwFUh1L-2fgE! zuWr`RZG{v^tRBIXcO0t$s*J`8?V1iqhVcjpjo(suaIpUzo_7;|NpSfcCG)GNQruVM zV)Ij}+r9-!l!~5~zTAfZJA9^2Qi>o$JTbzdD2Ew`O;TSKhT(&PdnDGyA55*L^j|DT zh}4?7(VHwjl#foM&yp(bw7~mrM^>Ya1rx2UV|KkY1E^8Vg0`fytf}#;!kX~$0)M(v z70P)wa5*kNhQO82#)Al{rW&T^2q{LEUBBt@aAOrH%#BfO7m^_@vfXOCbd zPaU_i1d-?dZ~#kZfcCQ)QIG$ryu>Ag#bY-j?vz7^)?c}#puhSLX6QGm!YJ^IJPJdG z;(!K(!RO{FgTj#9^r7;m7QLdQ;q8)(mhz6bea@uzm`b1v;}c3pwh1MxgKjY{UqrDh zcg(M|2`bJ`NAFpowWNnpRL-WUh>uQkJhzNch87scC~sxAmPOvpT~(${kB+(MPbGCN z2wqdny9A%LD&cI<5a)`>i+a|iP#j-NDUk)m(WIEukqt#SnVjo%0eLY0i5(Cc{i7u7*gA+i)?UiK(Xo`0gCUL7<( zC^bpk<}+j+qnI=PK`9Z6Auy{d0Q-Rw>YH@dh}_JXYv3e0fpxGPe^QNLPr`LSrcX8N zl=6mLimY*{u#Hb;;sn_@x07cT({%#7j?)#DpaMXbCoF3#!qLzqlrR@BM~tWjwFP0PUMMdMh^K$Nyo&rxmqH3;Q|bpgoFp-(JzGn%uioJ%gaz{G z!s1Q%2K84LgJ3Cfih$+QP2;t+Vg~rct`V==(T4L{O{99Ndf}D~?Zk>}fB`;-n&l)= z5YJvu;Uh}EMT(AR=UdnaUQh@5IIP`PL#l#=MONt78hg9!o~X&#u+coVT?F*N=Ma_C zfF9d#C!;2mM;@FI)X3v-tl(sE7xK7@YX)PKj$f8ySms;%AG;DjQab% z)93k(-XheC8|I_stp{QGe%8ecWk^Ml?2zC~M)7dbFE^4n8g0VmxzwI0oG7hSyI z;B|h`J36YjHy>jNjEZ;Y|0Dzvp};{i1cYNwYIE*17A1x9{q(1W-9g%p*NX$(m za{GjY@ayoKP=RMic0pC$iY<%=XQj50-k0`!sy@=E3xvRZhda%paLgAgqFUi-U4`Ry z6;3J@)R$}o0gGU8BPD$EU2rRNtgE;ed6%+BTDF_Tbc&ZB#kUSQuYw9kX0h;T$Fl=0 zQPSz$@MpE_+|a}e0M;JmqL8N-NNvi<4@Nnw&lw?!8Sv_(=SGN1UbwQg) z>l>qG!D$^IJ^!AA8!7M33H{Yr_);gqurv)-ELMq$-xOXma+=9lT&TAP5)Y8NDwXTALDI(k}B_@A>hXyY#cwed= zVodsvOp}z&BF^97HEspY^6M6qxiNGKUQhqXlM!D2(Gr))Nl~vsP$62bO5R1w?#74O zRcFxJ0t*cpI;cNS(t`utC>ow7s!gj3%Y90zUkA^zc%MUcp>+7b>u;_5ukui-j_K+>JR1WyuSm-9iZ9)u^O)`n1tkj*X2vb_32 zxK&TDn}*P2`?c<8OrF`6y@fV)%^bFUS{=zF;U09g5Pa9RRq`0RVvbAfK@&uuYnJam zZKt?eOdBG2_OJ0m^>kQS-x~<&gHZNlh7KAWuy#nRRtgm%OS`bLYEZlLbaD_@lzh!( zD_PRjU|!OBSj1U^{g~)7ExDu)!)6 zz=4Ux;uj-IyOzyU!y;q5-nd7=#BRH5aP%Mdm8?Bdx>*gSa&33J76_ z;@zwbt%VR#T!%-8XNSXcp)aq*(FN_PfM*AcL}G2?^Yw1E!NTV&ca*QHcAsbeGog(BqZt4>HhQK*;U}~pu3%F za7Y9CB)ZezYHUGo&r#NT(vbP!yM>w>21AzRyuKtJozdTz{bc14VS={{dLqDWLTPD^ zsSMj^*ktvJRclmPyEZ~vSl_&r-F9lkB(W-IyiKu6q7jD}R5Y~n+JyGU-6XsB$k31F!&wGJsZ-H81 z_Dijs`U>}vyl6&&hB=EY5DT`3W3cQotMmi$$nRo-L%SQENGDx{*sj8-vj9SKK)>%8Yhm)j+dYu*(Ojrar z#e*9)Gsa*cQWhxYe-1rXVq&RpajQ+EwS3{dtQ^W&wPxWxMh_mvKTQY0Y*XI?^w0J) zil(TV$D%T;bEQtAW>PaaW87Zl2rbQLE7nBT53*IzO0HD<1*TL8!DhiUi4-6%+o&dAix9l6dz9Rzhj1sjsfrS2Xg; zCygnRVj(LQyJiZ?{oI$EcgcS5xJ>e_%#(d&Il?v^|H|(uiCoNU-7>tR*S?v5U9WX3 z|K?uXMr)1C6-!c#{wgKDdTj<#=U=70=*Tz(kGK09vUOXgqTS{!rAC`F6m2$TXX$(( zO=s2WHxippQ#~rto0^fcL^oB(v?=h9m-vGfqY4P?fSaq?AV>ZE~LBsCLXxPp($E=JP<+ei2qbvdQAZR z122c8{mJ)8Hi1xHHadtRIIbdLOG-2|*(#C-=?XvlZhPsvy2^zOtnjie<&N@Qw9Yyv z3hH6|Cc#)o_6ig_#NA9X8?b5iv2Gw=X42K2Es`6y6}=6E_#mW#v!+J4o2>GX!fLQ` zq;wxA$W0ikEPDmXJWyI8Wp(SOwPO-~#Ah78;3Eh<`>zHe>!4ET8WOGw4XnF#v2@WP zw#_{N<*aX+gqr@hx1Brcy1fyUI>DdMypOCv%f0wh4zysSFY5(ZHb_y>? z4x!d+yRqSV-lcc`-Myq_=e|Xi!}&cYGrM&frcv0)si*4Hu=TEPClf?diu&+F39A~- zHoRBlZy11dRAYwZRTluJ)@4z?X$z|@Cp{z zbe7V-xzcOe8oO=VZ-l07Z2AY4G|9==|Mkrc!YaO7WYdy1?Y%!0gT<_zjh4OFlleH? z`Ljtza)G@P`~gbZI>Mi@um(B=;f^Im&SDPB)a^&>h<4j|BnC<>O-0ic=- z_{Euj_ur4%k6$T}8g%K_EUqjqc8bP}RT;@ps}I?EjW{?+Wt0LK?E2L}rfORoY%Th+ z!il;OvxEZ!TNn(PwyZ$pIv zj^51@<2?7s+AJ|rb&ZS#T&=LD9l?DFLTix@HSL`LFSz9wJTynE2`<}Lm*M;HvSPGJ zgDjGDN+Ag_7tNDg=2tda5xu$4RaGt>SurSQgCd*IIo;b*f{5*6BxTba_x=`dORWDM z$%51k8$jt1hC?>E38E z<+1Q~&o6C*@A}p&@N`V~z~D+{gGl)#P6Dv1Ln;EIW=q4snCEhfX$_OZnIjfih)?*@ z$tW^*`@l&-#AEKka&_OaUuUOzOytu_|y(Sk?;zbioj?s13Sg z7~XafQ#p+Fcf(s{e5(k#OQfqzcJkT1mV`>m5xf9{U1DULC@&HCmjh@wWaZE38X{0(cbu4_*^>H#e=@0Q~<|1iiGbCS*aTc!>H z!I%=|#Ole6uD$FUY#7MU^Gt{!AP8>I*)8@9c8chS=)<&P=ULldE3a?OFPw@NT#ww< z)f|%)5}wf!A6CKOcVjjs8D6$BXG&eJ0Hsh2f@Yiy%|w>t!WRE#)+5l@1MdU!^GteG zOk)A1YKRh!QVwlc_aTA}2x~NIfC{d}dT0iCx%y35$+lo?gxm;`Bs6~)_FgM&!h&DW zRf}>{ns~jKw|hfU3a=@N7@p5w8a7(Fs5NdvkwDj}^e^;qL6*#>le?rGAWg+oJQ!v@suteg zHxkPRv?ebOdDBp%A&%^shO+Xz^i0U>Vae&fl6vj-=nXh|+%I(@y=)%x^KfQeIK+eN z9`T%+h6PevGbESx!h*1B%ymtpNhBBUM8Hi>8f&D%k`f#>z?Ug-Qkep+MB#v3 zAGJwqB;=Ee0?TpBx$~?B4eVK+8cpPMfJ*RMdNu~XA!DV0-X`aW1^dOOU$V^e$=Rwk8)nhw=KU?( z*QUL?i!p z@cy}QpHmZ=KKaL}1<3S8W+S+(v88m21wHqi!d&GCL9=D4tk$T5AnYIz6n_v+(0Md+ zLJ$)?Pkam=d<@4~39SZYVxK6t{H;()Uy&`Qys>WJOls`<{d2duIe0-=NTUQJ4Hovt zHaB`ULAT`+JM+PL$m^OPgP(a255}-q$ZiBKD8FEy!T&(d;9A*|2~BxcP2ydgO(P0f z_9uE>7P<*zp_iv+Xa|N{<`oD!p-L5bO0O4rSsIe@ei4uSXCh8#F{g7hj!Lf&*SY+{`m?32T1;~PaCiE(do z)+^>fz`8DIIQtK0dcVA*R@WozAXehO53Th3(d_FPYDPiYjz)FYk|Fs>rs{eWE~#2EBaW<4o@9LBjtcq3_!z$TCC0sHf~u`8+-M`HZ({TO3Osh=Fy7AbdV z5d-t^F^~ihizI%IcgXLr!2aY@|CHV~5J$F2Rg4vkPj~#IKX=dqX`yuLzC>XJBbCMP zVTon1#PCD``BX1DETWwsRhVi12W_23c3Kc;>Z-?TMi8qoyBdcx!&A`v>V5??<+HaO zJ6p-m0k1l{qJw?wHAKs^n!Jpgq-}7{DQcuaZUraSiM9DnM}A~SIQTxvoH6Zx4FLKD z(A*iabj_AyH|jBEp2Tu&f|4w;D;qG+tkuOs)g~X@dKbuiD_ZN?HPBeUvi$hebmMcV zt%RhYQ?mDUJr=%NKGPBrZ0~FD=S;g)Nq1fYF0+npW>K?gV}cur@PICN2>~tR~4R2cNHVucv<6E zCTLBk^>7451|cgi*^;t7Lx)$YLS(X;Vc`%OKg8#TKbg%ehrMQY&sew~*&4A&TeRa? zxdJ%OtdBlEY~Ftx6Pn&?BX^J$&ntS6ZLmP*y|PL%oNpF+;8Td{5kJ}qET8~4D;`w^ zuPiZ(ji<^bd9vMEM}T@V;3yKQXGhl5dDE`H+PTJDsVZh+kS()lHV7o_NZX_NH7!lg z)z3CFxN`y3Dd71U0)J4uo~lEx!?%On3ZNZQ*b#45eRZf4xvE;iW~I%r#xbD%PUk!n zkl2b^0YT=wTc>UNfX8;s-rIv_4@m*1iT}!}|8r`D(hBp2tyzhE^f+M56bf2q8`>_d@-z(dsO~9E-=>~o z=a@}4rj6^cQM9~qIck{@Hrg6iFm2K}6(}tz;334d8^L9bq@VDm=q+#{^) zQ`m>@W!>lKU3LSdB*b1=wl_MBE)0NU@=qq`@N>Xvi?DN(;{T=?4ktN=rG5cKA{h?> zf^J|6@^b003hW6R^HD#%kzEMFMLiFN{zeMUfP}`zlLEf~)_B_VIpShEzg?>4wYIu@ zV4TYnQ_DbnffENOr~$gB8-ZfnK>D^Czo$)`*@PHQKL~;Zj$L&UZKSx6f{{2==V~Ai zvFD61cUt(pJzt-DBNrC?RPglE`Th8$XA;`5cSe3T=U;-~8R6$`gL8gbkiw13Gn*7w zHqDJM0})7W-S=CO-DaG`u9;ZOD?yt&{@8?-K8@v*ESpY}KvuhHSIx?V@P}i4o7mMm zt_C-us+wFp)7ZLu9Z-5suRS^Y@ay|N_Oio#>bCm{8=LCf)?tuLh6{_CFF#S}wQSXS z+VBT@&~Q<(w)gt_)s`JskOy{2Xrp*j+>zwz^qz~15k z9a#plV!fzKdY3{50&a!hgBKxsBLNI8RE6y8(v$ex2I+=qIwkPR_1n)M`96F81_7w>{;C+$1wxq+Rk|*rUytg3n2zU z^*SH@91z!MR+ETWm$P|^)57D2C`+g3YYT)iv(`2@k>Yq{>aDqWz`Hy}+I1pqF?1sN z@o~TJ={=3I#F0yoKHz|DId5*0Hu1xxnd<_9Q^6)Z98^MK8lSsQc-0!B>8xSuo#Hf- z(OV=vH@+;MJ{f~UI8Rf?jv&vir?ciHbn2$Q$W&ONb;nI<{`Y=7c8y|m_ z{NAtx1}{!!^!)IV&p34{kkjO&V0B%O4Y^cmD`%wHhNqcIe0!*deyqu_2W#YW5mNd_ zgk2AlaG$>pmVbjg1WPL`Uevvv2P!+9a&~F2>nhKrW-V*Z;+~e+IZRmVy(`KBFPs(2 zyFUMj(?kEzvSCq;%N8-@F;Cn`OQ*MZ(E-odBL&BwD8q*985(*y`))SJVG%7zeSghZ z;MVDF*{6FKGB4SF{238K!~8=Z8WI<>^?XegnrkDF^^UE->pG(Qn_4az?CXgxOx_pH zdLTRNMUyt*l>+mam$9s_W?PswXWzoenEyRzsKcF2`UpyB#LQXn{9X z0+zbTM^Or8T6Kfljk%fleg%CwSx>ubRjZEg6&0$m1jkB9pHa3nuY4-lk=9W(U)U8s z8>P#;dA@U0b7`*{)7qxhF;*LVjJd=V(dscmjX~S^-2g zM(|^Om*wW2Y{7~n(xmiPwsg*KdWkuSZ9rjM~XI(oh6WZNr z?`&NgOEFbM&wFe8@fatqPR@Fu&zezL$(BaXU-S;wHR2&Lm$C0hs1N^c`HTozm-V^*3QVH~fALHCi27HNcXx)usunpy*d zJ;2&Uqy8X3%du9gaSZnv*U`j`XEm7TYr)tV(uj(8cW*6DI&T_*omxp;D~E&`&89|J zu(a3E$gI`4aEco~#;D~Pb^h}Vd%*)${A=c1xZr!7s&2yFwlg&KZ!_7iVT+0lUAN~x z=-4EB4-k<4kN0muE$<)+4mZDu+;%GiI|5YHUFjZtrsNM#C7oX-=N}aXwo=$iQ8$gP zA!S;bw^QvgVl|f%9kc1~(NI6!Bx;%Hzp&6cU90%G2uNhZQ1pC!{t2iWh6iyt))tE~ zy~63u*xMYr=5CK6%N*SvBf$P^t%;s1sR?Y@;!97sCix}7+tQolo-vu9?=`#|z9Afx zHDm@mNMe**BL-spY+}1NXcFW@Z!!8X8+wZd0jYJO*-Vdh zHa$h|Ue568v&ftuh-N^vm_ElE_%K7RR+`KfLmZ%ney-*o^aNgYi_&q-Z6!XsJD6Ro!G}X6Z)Z~J*b`_AUIj1k%?0h0A>t$C zEQ69la)6bvEGTJ>QP4O#n0emYbI%j3!E$^qq{_k3Vw@oxrexS^)Fp|}4Zg`kWaOqX zR;nx2G9)q^*?nv}XK$!ZtJ-&aNyDogkjWCk20T_+8=-!B0FRSDsBjp1u5h$M2$b|K zxMLCXU9`eEX->{>Nv*B(z=Q^gvZkmA_SFVMe_R~g@n{tlswbMX z6p5|IXRaP&HiO48T_W!cv@KO4xEc3>05ewQL!g=I_6WH7a%FOhhJx`BBw3a4Sl#5Q zCMflXP@Tx1x^K$K$#Jg_W^S92CaZ!`w-gFUh><6>75m zT-->p1^TwdeD}12p7MCx0k=?{~0F6my;>_~!7Vn}fCUudtiz*g0{ z=2~o{>P@b{a9Zp6WN|$v#>lV2Ci%@;Jkfb*?Kj0*^g7eYT}x?Rc$&5SW}w%tCyJl1 z>BPRN=xN7nW2WhzvrjQ4%5y^_-+b2+!|Tw{+P-r;n`4__i;eV2=f@j#RZm-tZJZ_& z<)E;-W#?H49C|6gi;(aM_Jc5}-t=cPBr#w?u}yCEi{pvsr$4CWQ0Ta+B@p_NY}w*h*0y=SPKXMpl;^JC5}fa;TFEVWoxt zAktVV6WpJOM?rfC&^&dMV(YJ!``&m`(>&amdAroYUt@|%^MKdWY?KNpR+w`vVO84RfvD7l3EomBRc{Ei! zr7ocQj+>oE4Z!NlUv=?=tre_Y7NR&z2ebJd3wp{I1meElx^vaD0$bozuMj#9LIy*qzRtjAN>zy-7%@-@ik=fV)!iA1)4Z;Q97!Y)D6F8Q~Tk_$V0e+I>F)*pW$S znXg=a8d&4FOGt0Q+YmtFl6U(EhmKLDs#3v;$CfyR0Jg%x$=8-RgaE9Mgr~b_Ux~xl z%*^oY!s^2Ilyk(loBb_V=*agFD2@OYidEceO_{aQDKv4O*oTeN_|qN)%^PnOnjLq8 zmslr2Go!64sV*+6_YgR}X7?&2ZG>bCYNXXwlT@p>W;SE17YXXJplZASGp&kv~jHu{4qvZN5lEkW4q?#=9TPoiM_k|vu#WwLG|c!IL%ixwE`NeaQ z6KA_TU^veBus|9##};HZgx`E*j>g+Ua0K2Kf}`%X5FBX@gkU4F)pjT@OwOTT`mw7J z+^`R){llPD`S37kRh~QyT9rROw6^x(I*zQ{62#j(`QNU+qxyF39i6vp?OUQDu;bGK2d_RIa4@nhaNV4Eu6#do#9Dq^ zEF;pSo#)TstI}XJV*1X_s7C&jXOFb zV6_Di>RNdV#HGnY%!QgzIAFm#YIE^#vWTueo{JODvBmT9ZSOj8)VT>pf?mHMVVdd3Ert(GaWn(Kbw^W(}wv%qX8*0U@Gr2JA)bOl&1Phs) zbzW49yt=${-}0c&BteR<*6r1RGg4NKMH8mPy z*_~`4BLN-}C^6SWdjNNN8I3nE>Gl3^d-<}oQ_zgxBaMHc?76!*!%^+U=^+16z0_tw zsufug5c*f}!F$Hb9hCu7h0`eN^O=Zq*iX!pH(sjclrLmbQg2Gk&e^@Yz3g2!%>29- zVKIJ7k;(f2DZu4N_tTO6c5Ht-g=yqv`U`QalGU0~(r1c|DfRM@l;i$6L~KfoiV2>l zEcHUT94dRdC73g&whz;&B$vcP0Jtm%Pv1O$bNc4gEnBf=uIc`F(0RBj1WtbnZLQn^ zp-%)>vg3L0o+T6wx~tD9gkhdxAC1rIt$Q4gG@zAH52hWvWwlpGFVnGVkF{LaV`D?x zWyNOkCaWhGevIs|&+)la0xZPwTizc3{43Uc2f}xcH;5v|9C{HO9yF2$bIUO%4%C-n zTciBSseolWqqO=FKMC0gLgi&z^$+r!gdZgFMdYA&lHa(g9ZXl4#+yC$W9P&MV8&UQ z;sWmy39#{A?-VbcIchb$BILzRTjiy?!`_0n3l7NZzh_%{Yt<6h>;uF;<7+g*&5B?| zYe0G?zos?RWy7?@^_Xj7LZx$WLf1hwiLWLBr0eb_78`zcR^Ce@LP3AxE%2Y|aTie5 zE5{Nk?-Q8hj9yU#AkCQ)1Eb3iYcb6P0tIf_5P%OMc&~uzJMZx=20vMZM3C-bb^FB% zjs1f0-GUek4Rg1`X=_B9zdm!C)xWlX*%R`gO3o}DTkR*ChDeoTymo$S3vJ#%^BhN&s*SB9deSjrzeO_1+ zH#|P=T=od?&A7JKvb}J_q1f?l*=e>KbRpZ^5TD_SEsZ@r6Np6$lmQhKIaA zrWgp;6!d7bEMZl_))cMY8s={#?l*bGzTKPbfq(@WKa73u&2P=uf=xv+sA}02A{2q@ zjnBzOq@JDEP3udLeah4H-ii}Uh{_o3q`^L@`i@&zwc-S-;3KJ(L>sqzp4=tCF$6_Y zElcbQc*?is4Ng@@FnBA`4}G!Qe`8E!H~^_zp+GP>CqCAnY_Ux9oB8t2$G0vUlKPDe z0%YArevx8$9_EAN6UCJlxQ~FB>)Zbv(ayd}W0D*Q?u&eRyO`qs7m^#}tvQe09=42C zh^XDt`DSf>$i8`Kb`U~D<_dSdguPWe~*+G6a zo4v(&-sbgp<-*={YeHP}OMZQN8ZRv(D6{sewJ~0O*^jVHK8ZKeo1)&!(7|)U-pixz z0n7GJPfLHKENpHxj(u~$eqrxWmoRoGdCESsOZ(2U|A=|?N$2Qe*U9)uXEz(2CYN00 zF=)F^>UY>a`daoc{H5#4ytI!}M=9i~grMD;N3S2}HEDf!MRe$|&qO0J7%e2S9Gcam zu4*@ZCc53T(E9u|d4?*FN9&>~3d$Nr|FjpQeNmN#{*WGU@xNOvF@xJa9<95DVBeqr z`k=G=C`xkJSk=gTU(PrD-}FJ}9zv&ke7=U-oJhRq2xJod~p zE~?@o?mXpyZ+L0tIK>Yv2oh`>%}V=Ne{c5i_n+Bqt=iIbQhfwT)m7zPD_Ut!~7k*An6?O{*!c(VcPW* zxczs#35CKZm=bwDHO-upIWZ4+$!9=8;t|TNi8+hb$H&8Y@elyLli{4+1@qsnu=>vz zx>`Ifi{ilt>wsueIZztmn+Y3qdbmlahaYUGq4T4elQx64(Eg(eQG?sg`y99;jnmlo zMONL&UQ6E(=zR_V@`Ur@@dxJ)^V<2~Ry#MhcTHNtvWvr-BMn%Prz_^i47ozH(SM)L z9OFhFit`25-Po{+XU*2nq)7H(24RY=0f&7qJRy}UL6JW0SBj9#cC*<{j`(=eP42Mt zlwO?1B-DdO(})}`{t9Vhu|D+2#c&8+@p*AWd&O+(`O78Z!Oo}p2HowyeE??9?BY8f zJMN?&E+TRnM;Lm=Y4plqs?i?eec*EgGq@LLzwyULvN@S>5gB;x)xEbEFK3Xcqz7jo z{&mxVgp|0NP3c!ur(iRvyqAQTvd7xD*R4F2>N$eQKXRPOPg{f04C%NzWsBD+7bm}cV`0t~y8m?`O_l_Pe0M0^arL;8QBi}wZI>|II0s=xY% zwh5^^b`$+UXhPtAb?~P1MKOR{ffq2F!lu;a!)gMUSn`cDC|v&(oG^6FjOy*WO20aI z`DLL)4taB#T%jr;Zt5wOIUM!9dJ5T}gptOw`YF&~-LG@RAtU^h_rSkU_bZ$wq?LH- z<(obwXXn&Iqf_>@R~LIsy$SA^FD|b#oJU=GqYToUCpbC$W)Zu9>x-&i-Eyzmzh}Kuh4e-n8VC?8qA!SGA&@6#hQYKc7`|a0#VK@^B`sF#)-hZIN=TGePrcB3pua$iWi>zGs zlMH7t?{fHYcOr!((V+YFB70XX?^1JXH=RSLO>wXzzh(=HV^`lh*&%_$-Gl%LCD{TQ zEwY=uD+fdTOUkM3HO$b3my+@81Jlb4_y3~K?YH?ILx43zcYeN|O|!+D(Fi9?ANPOr zaW>BeK)k=-J37BV4nCZm-;+J@Q2|+1iu0jtlJAgr{M@#usfF~YKc^4xkD#pY?7{u4 z>0;%ud8APQBqQ+x_@)-ww4}wzr{Mj4ub9va!L-7ftFpbDYyjrluLV89fMsvIJjiLYf1bpe2#E4_Fv!ai5Jat*R_B03kH_{CGMzbm zFnO9~!{;Z%b33@FRn|yro**h%c z*awu|r06E^&)tXQBGHyTM6kV?QY0@K zU~iI7uZe8MmtQ8_)o1TfgZlcu_>n-qUM?2}oNEM%7e52+Gp(|Kb@49Wyp~Zw2H5?R z&+Z9B5R<9(>WL#?frzqbe8X3O6Dau56$lWuQ0#*oXs*Q8GNva-yV<=#)_ zUjAW_O+n}0Pi5y-0Qd9n^Xae{{g|fQO~|tskH)hnpY81>U(If=Al->Mxky-4N=Wqr zA~w8BaHqryz%%;tY`2%=+#EkN5LgwUaL|5)n`Wv)dzkZHHK8;hXP93QP&H5)~q#p6P6fVmM#q zbFgLybBw8GM@s#%eAI=c!pwD(jR}bf<4+r%KQeb{Z1{xL(i8n>!)%$Qh=y2TiJvZ? zbrS?Z6xSJy>K=W4O<$`LO!7>ZQ(irJ$=v2V0T&$(SvuZ7P6oFy%5Pwz4BlQN)B=>};o#eQ=;U|SlyiC@lRT9EP$Bxn9Mm=j$xiaW!$p=G+5WQF_#7@ z@)S?D4zNnV)P_)-D@oYhzlX(fT};^^WU!>>@aN^Qc$XBzi;g%NJ5b!1uooRJx25CR zP2Mq6<)UNXiCp9p0DPC9)7}A5(dRU)0nmVUuq($WwvWnpMHfVXj!WsJg|M(lxatl$ z!Bz$eBg%}6+k|C$PK7$!k$g%IX$9e{&-RM}Llmn1X#`C`=!Wts|8O&uA8<+f)Izgk zxyd2B$CeVxC@Uot`R9@vgVbY)t6`Q@=Ec7Aii#oS$FG3;%iD=?J6887mYQQl=mdm|*EnD*x5dFR#Z=}kVt5#`Ih3@k-M5|-5fMtMHm>%97XUciXC zF4I5Y_hjc~c6GH#7_p1aU-N8&NQrN8>^aGkZ||V;2P~1DSAYHXTl9sxuXZ=+6H1Af z);;O`-^}ljoFto+$>yD}?;Fm;A(UcS_GXLgy^ap;FSGag0t3FfOa2oz{z5gnm@wHg zPiG@s%0zJRVwsfr4NiNDK{Chmgq=M}=C@aqq8!sP06eHmvi*9UR~82KVv!;q>^*?T5}{R|(?#kEsfm(7o=e$s9PL3n}9ozm6Ej=m!V31GD8@53PH9Z4DM@G#QhX{197q(zUT1s^cS zr1K=w-E-TWqo#sr(HqR_w>ctiqV$Z-hBMorrKg3_rawfQPVxvXk7JYJh3)LQ6&08* zfY72V<8+I3brPfF!M^Rw4$MGk(G{|}kygcCq^?purx$6ow3%CVP0 zJ1`0AA8RGkT2aDy(Jf=`At$tzjIut0K(VnNo@iB{KL=Y{3cdH zgu3X!3luisV+-@$SejO>>Kw2hXbkao!h07c7j6C!qgyp^s0=kHMdGSblE?Jm=(Lll zgfRsAZ1!DTfxJVh*$;YOXIDSLF$5^WMNl?n!6<5Q|HyUxCXf_VK_s3TKQ$O zJBs)77I-hS53}j)<}QLc)Zz7P;g?YE5YCeZpS0KD;OM!^_G()ys{K$UXXllc_`{}sTTFnCvG08B zVIDu`Fm)SH5t@#(?klr|Hbu?z(-SB&wLhN$hk@ z4;bF6;lTYs+w$DlcX&b$GU~_w;B{~<`Wq}6|A0mBG12{pu5j4+#}+wrCD#}ZIJm|cE%^rMk2;P!PpfMh z-O|-Xk$$FFCO*q1e}i=|nBD7>C(XTLvnr7sv|FKNm`>Lto88)*p|b4}=YcHD5pWUj zhvx{1bj61VP3|2K1>@sZbXaKoZ`d?yq=?ea>%tH-(oq$M9+e{+`viYTj9Nt#ZP`BL8_gKF|pQ5C7uM#JY7}y&=DNLPyJg!7(*XMh^V; z42k|@g}}nZSEZ)>tG|kz2^N+qWQtjNRcOJNeGF@#9NHSLgWi5 zIA~msE%B)u>8KRLBcgH_eh*xzfQ)CSF5@OdNqEh_a9+d|SLASBHcy8$9Fe)xXXkqA zQ)rv~Dj~zd zzoLnrT;n_$N7y*IHb3Cx`dHfrI2&XT;Zrix!F?;5PLx@YVaYDQ=&LeZxOPJ64vDQr<4OQlR>cn zBU0qN2Or3%0JovY5t06qJ%scV-yTU1PC*~LSkz85!(Cdi8v*)$TAL0}`ja|{x987UkUh}C@cvjdV)B z&cdxBh64IgaQWithtdB2;d!MW>F?zp5zMke4+cU#V{!Aal$sU{gifK@#z{iqp=yFq zWDo@)R*Ox#NGYLG|Nr=v{?Mm@RicDVNIEFP6{wQ_kq?lU8L}&@nhBa|5D-N|DUuTE zL!S)237*dqfuQz}=`K=1mIsBatA*W~Mmv&$>KIo1+t{OO{v%y%%nw*>>_Sxs>lj=w zi+uUDa|+=L?0}HZe2Dyy;6#l%ZXU##6ggsM2!{W`Y*qP{c}dkGwY)ja70hgV6+o(A z8&Ne75%GgL}Yt8;(OO@1mbCo|mAxkP)4TmRVM>wcHnPuU05 zH^%G_dq3Ft{vRm7pX>avXKpJ}RSp;JdTlSUb06e@kRJ?(Cx>ST`^TMb2iN46Gt5|g z$8UT+;PQ4szw#}DT0bJ+KgdmjANKev0h;P@@8vZBqB)O?jFfK2xI`}D3%R7M)F}KG zX`Sa3S@{+H4lKxqFK-~Fsx9&nq=32n@`c8n8LJ# z>4}S!v+GOxxg6)i%bSvFyv%Q2y+(pO+5ne{r0>p$y_Y}ip~P?9(2#Z-s~d8+96w;X z`y*tH#tP!X%mw=qET7Cq1_e;ac5TzsLIAkQWdzD!G%aiL4PoN9A7y_d*=cP0hu8nJ z-iR;nT+&53^0f6kUn54jn3SLd-#NQP3LUvafx>w8Yn)d##|0=OTarH9HQ(m_6zE0Dn+!#rU0dfC;QY^vPNFwvXw2OE5lsGE|E)m ze(x>P{1$MJ^gGD#hBEM&ZU$V66lPNd;zKy-?uQvrr2@z4Uz#|5)Syv0#;ie|EaJ;6 zMD)_7E;N36l+#~;FkwuWe2t8+7!K~Fdnu7iRTv#*%AhjD;@EatinyLykzDn~chVxZ ziSa<77y7SSQ^;ib6`fePfGy`;;(fFW?Tm+=Ct4yL7aUX+j` zzJG=*3GQ22lA6(JUX+vvDp!fP$qC>{^ldckm#a z1a;^Rr%I@6iNk$LjRBxU2K)UgA0uFi*@vKbzl2hW2>Q16Fwf_-#u^zXQrn_yG{m1-%&qfza^V zv9k;xgOR)g(Px+D4jRgy9|lcKsc}G};h`B6Leehz;wx?C(ddul90qmhyKxOVQRhIl zu*?X$6x`(3*c3zDkhJ5{c7(YPfHJMQ*aYUGGZK~stp&8^SiH}U^b3|4W)o1LyNhT+ zMZ5|z0WL?ZMDd-v@Fu+(D-%}=`Kk?;7hX^-u|;J`MA0QTnB5W`h_I9f4`@-)WK?BQ zIbrUJ;=j_pA#MuYWl6xfi|H$ZEddKS6r{(|4f{&8gyn#;-if?34%8$Nkmp7~%rbll zqXmg%jaU;A=*Gk?mKVA1sv|L9Ift8Q*s$as9y}s*zyondWT4*>{ktq~W>bp7v6MSD zSS&|*=_WTC5KU-RG6msS_#1S7zJTWfb&ot4x`>#?fNNUvoiG-Z-OMa;s(i$;jn24C z#MOwTQOiMrRoNo0P?Sg@o5wMFcpA$iPr!+cOjOP_7W)2e5J3-0& z8O$_Xs#y$xEX*fP)*`Dc>4ZuZ1o{l#LgFsjy^3;jqC+9U?FKJYnLx+o$ra^A#e<0x z+>a>`)H_>H*5b(>8Ew9dD#7;2MunOCo$F z&P{sAbb(u`zk~E&9QSb5{aKQgchdpFqO|wq$(G%VozFL5VM6COS1<&F{!X8{ZfK7n u+l1=1Wo#Z+-lb#$Y;i5uteV5htz6owc(-z~xuz?SxK*=9_f20t`TqeGS@lW) literal 2239 zcmbu9`8U)L7so$?tb-@6}N9TFYdH#Usb?>?7+;i`F-}g_KImDarD6>vd6PnT=JaLeFc*O z^zD5ek*SvQ7qNEr3K1vK?t(U6C;Av1qhf6-dm(8f#F>{rB)rz7$(~w#UH8bCjK%`Y zQ95dh9Nh`aALamQ;pnqaL#LFwM5|7#C7yyzeub~vPxjpeZqAO_`ULq8DUaYqpfVbg z3W%}E#P8o1TN=ykqEvT>RMn0_&Ac}}9^%K{u{ z-*S**M9}N zqQn!UScWeLn+?8Dnb(+>s|%D1t+NY~#m--wcW@CiO@G2q^-`Sp+ksZFt_VtBXoL}( zM9Ns+pa0~>1gvxS**)jUoion&C2Hl&h8a`kx4^XAqy**q2Qru!*Z=axut`gi8qR24 zNdhY4g=TA~ISZF6A7*rd9qh9p~S4oNSd<%_-gv~dyYx59Tm_;b?!!E zdhz0jlV`nwTGnFnw2ov!Hr&$eqh7b!%8)QMETvvEIo*CR!y5XnnzF&J1;2q4VRYO) zGxucyXp_nR#rKXCRHx2DHnrP__11x}icFHWZ)W;y65F}amv24tpC1X72L-HNdC^Ms znWKp6YKVkcM@SjV(XZUOL)^~t?V?jv_ZOo1kntr0xl#z>M96A;g`cI6tqb*7vmW2erN4JwCS@$-bOJjh_mm(0c5%H9+-?Ig~*ou>tq?t9qNv$(d+1eo5N<^ zR2nYyl&97DX0cLvr736)3JGiB-A(h9Qt?THVm4$4I+u|p*uGhnGV`D9-p(X@oZtFy zb9C76y|RO~joIXDy^`TEP0+Yq&R_6;Zc#;){C-%eU3-`f!KZ3uvsMR_-a^!!J-B)-;s^taO^iJhZ3guIU#E&;p3Qx~nbh?m#uF>b9f#Qno} zG^zyRa!|L=ZQ8j^@6RL75K0Ryw;gp&lnCeNLpU9!BeCVBA8a9e9BiUFn&Qp7F|DWe z`w78iZ7GW!ebwcAYX0Q$VScSR%c`7PHky9zDx!I-nY`!x1bqY=b*8AVBilCv=oXbV z+n=q$!gmW|y`y4eMQw_I=%>D9ym}I^dqux#I;*p_Mv-LhR;2mrZ+bgK;6SY7=Tgqs z3y?=g>4772w)d>ie$F(dwqO1{1p*megWW%Sd9&OrOGCJg;w&niPz2$LalSVpgFoc| ziEYj!Syj1-BN^bTiM1fz=hF&r@5|1G>gn0TJh;#L3aDtSU-wYk$X#-lk=AfzQF@6l zlrS5siVCzgVk3VXh`>%Igy1xnB7}_#mpga;Os6g*cZNaUc*wBwK*_rMKVNgvSRB^;TGA~ac{^%WGr(v<`wD9}Cx0l`_3!&`f ztG_`IxnU{xOCu^;*NFb7?Sy|AVqDXz=}~$%>1it{ZisKp)E<-x&;%oNQHt|Byh=A0 zILJHYaplwlaM+dCeCtbt4HaxtTw+jHqe9nJ%R|%KOhC+J!e;q%Ph7(5urM^mM9^R; zvOa&5+NI!y$+o@A>B?xvr&)c&SAACwHEP#vERN6Jr;4YjJ<`SEUBztmikJW;(6X?e z)Bp2TN)lRq^;JEq7;y=zkt%EOrprH=t5)s&2N~g}%=Alf6^c)%tzdcH-xt&V<%wbf z8u#}ix2|rE&B4|6E#eN@o$)f>g=rGa?%URgNrKWa-D3Nw!i=&EvfsZ{h^j#>RujS}*NWGzKKV8m zI7mJVC+w;P-LQ+Txsl-&$OMGuWyb2YRE3rs9`jg-uX9H+%(e!LJ75u%J#-TjfX)7_ zE+I!V0oTN%q?4TvOA|W!uEXAeT&T?3B|N-oQ0#lHj{#g2=Py$<)L-iy5%@GamqIer z)@put8GP?44&%9Q@NRgeTf1L7BQhd%c|!pqxA1uP>w(?nN0FR~*t^mGWvntn2+y5Q z3a5#6&2{nKL5Hl>dDv*l?3|-To@EpJFREbNxxJp>8oT8l4-}kIlS8+XCgs1SPRJA} z2P`zlQ>WH{hHFa*y+eaWopDh{0iC9p18<7p(=bbvEKk0d5Fz+WpLsj{P#5{o*2p}x zHc2nE(mE!n|8d{rHO0f@ukarU7Y8)(Ld6aKpg|Pb5mdBdG_y-G@$6U6?vhCutq%!P lmA`e-BW;v%u}br06#nR`&H`J2A(ewVwZ$Cf