Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1041 → Rev 1042

/trunk/composer.json
119,7 → 119,7
"emn178/js-sha3": "*@dev",
"danielmarschall/php-sha3": "*@dev",
"tweeb/tinymce-i18n": "^2.0",
"phpseclib/phpseclib": "<=3.0.14",
"phpseclib/phpseclib": "~3.0",
"script47/bs5-utils": "*"
},
"config": {
/trunk/doc/developer_notes/php7_compat.txt
20,8 → 20,9
because this would require PHP 7.1
Therefore in composer.json we write:
"symfony/polyfill-mbstring": "<=1.19",
the same thing with phpseclib which also now requires PHP 7.1:
"phpseclib/phpseclib": "<=3.0.14"
the same thing with phpseclib which also now requires PHP 7.1,
therefore we stay with 3.0 LTS:
"phpseclib/phpseclib": "~3.0"
Once PHP 7.1 is OK, we can go with the latest versions again.
- In dev/vendor_update.sh we patch composer packages pulled from GitHub
to achieve PHP 7.0 compat
/trunk/vendor/composer/installed.json
516,17 → 516,17
},
{
"name": "matthiasmullie/minify",
"version": "1.3.69",
"version_normalized": "1.3.69.0",
"version": "1.3.70",
"version_normalized": "1.3.70.0",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "a61c949cccd086808063611ef9698eabe42ef22f"
"reference": "2807d9f9bece6877577ad44acb5c801bb3ae536b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a61c949cccd086808063611ef9698eabe42ef22f",
"reference": "a61c949cccd086808063611ef9698eabe42ef22f",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/2807d9f9bece6877577ad44acb5c801bb3ae536b",
"reference": "2807d9f9bece6877577ad44acb5c801bb3ae536b",
"shasum": ""
},
"require": {
535,14 → 535,15
"php": ">=5.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.0",
"matthiasmullie/scrapbook": "dev-master",
"phpunit/phpunit": ">=4.8"
"friendsofphp/php-cs-fixer": ">=2.0",
"matthiasmullie/scrapbook": ">=1.3",
"phpunit/phpunit": ">=4.8",
"squizlabs/php_codesniffer": ">=3.0"
},
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
},
"time": "2022-08-01T09:00:18+00:00",
"time": "2022-12-09T12:56:44+00:00",
"bin": [
"bin/minifycss",
"bin/minifyjs"
562,12 → 563,12
{
"name": "Matthias Mullie",
"email": "minify@mullie.eu",
"homepage": "http://www.mullie.eu",
"homepage": "https://www.mullie.eu",
"role": "Developer"
}
],
"description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
"homepage": "http://www.minifier.org",
"homepage": "https://github.com/matthiasmullie/minify",
"keywords": [
"JS",
"css",
577,7 → 578,7
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.69"
"source": "https://github.com/matthiasmullie/minify/tree/1.3.70"
},
"funding": [
{
768,17 → 769,17
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.14",
"version_normalized": "3.0.14.0",
"version": "3.0.x-dev",
"version_normalized": "3.0.9999999.9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "2f0b7af658cbea265cbb4a791d6c29a6613f98ef"
"reference": "8568af7f9bd6487c3283a24d7b546f9b30597cb9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/2f0b7af658cbea265cbb4a791d6c29a6613f98ef",
"reference": "2f0b7af658cbea265cbb4a791d6c29a6613f98ef",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/8568af7f9bd6487c3283a24d7b546f9b30597cb9",
"reference": "8568af7f9bd6487c3283a24d7b546f9b30597cb9",
"shasum": ""
},
"require": {
790,12 → 791,13
"phpunit/phpunit": "*"
},
"suggest": {
"ext-dom": "Install the DOM extension to load XML formatted public keys.",
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"time": "2022-04-04T05:15:45+00:00",
"time": "2022-12-07T14:38:06+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
860,7 → 862,7
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.14"
"source": "https://github.com/phpseclib/phpseclib/tree/3.0"
},
"funding": [
{
1000,15 → 1002,15
"source": {
"type": "git",
"url": "https://github.com/tinymce/tinymce-dist.git",
"reference": "8ba44292a57da4c06463e50ae54a4e82a071c6d1"
"reference": "f078d8eb7de81f20d34b2ae4326870d20e22d4ff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/8ba44292a57da4c06463e50ae54a4e82a071c6d1",
"reference": "8ba44292a57da4c06463e50ae54a4e82a071c6d1",
"url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/f078d8eb7de81f20d34b2ae4326870d20e22d4ff",
"reference": "f078d8eb7de81f20d34b2ae4326870d20e22d4ff",
"shasum": ""
},
"time": "2022-10-19T02:16:29+00:00",
"time": "2022-12-07T03:50:54+00:00",
"type": "component",
"extra": {
"component": {
1049,7 → 1051,7
"wysiwyg"
],
"support": {
"source": "https://github.com/tinymce/tinymce-dist/tree/5.10.6"
"source": "https://github.com/tinymce/tinymce-dist/tree/5.10.7"
},
"install-path": "../tinymce/tinymce"
},
/trunk/vendor/composer/installed.php
140,9 → 140,9
'dev_requirement' => false,
),
'matthiasmullie/minify' => array(
'pretty_version' => '1.3.69',
'version' => '1.3.69.0',
'reference' => 'a61c949cccd086808063611ef9698eabe42ef22f',
'pretty_version' => '1.3.70',
'version' => '1.3.70.0',
'reference' => '2807d9f9bece6877577ad44acb5c801bb3ae536b',
'type' => 'library',
'install_path' => __DIR__ . '/../matthiasmullie/minify',
'aliases' => array(),
176,9 → 176,9
'dev_requirement' => false,
),
'phpseclib/phpseclib' => array(
'pretty_version' => '3.0.14',
'version' => '3.0.14.0',
'reference' => '2f0b7af658cbea265cbb4a791d6c29a6613f98ef',
'pretty_version' => '3.0.x-dev',
'version' => '3.0.9999999.9999999-dev',
'reference' => '8568af7f9bd6487c3283a24d7b546f9b30597cb9',
'type' => 'library',
'install_path' => __DIR__ . '/../phpseclib/phpseclib',
'aliases' => array(),
214,7 → 214,7
'tinymce/tinymce' => array(
'pretty_version' => '5.x-dev',
'version' => '5.9999999.9999999.9999999-dev',
'reference' => '8ba44292a57da4c06463e50ae54a4e82a071c6d1',
'reference' => 'f078d8eb7de81f20d34b2ae4326870d20e22d4ff',
'type' => 'component',
'install_path' => __DIR__ . '/../tinymce/tinymce',
'aliases' => array(),
/trunk/vendor/licenses
22,15 → 22,15
emn178/js-sha3 master master MIT
firebase/php-jwt v5.5.1 BSD-3-Clause
gedmarc/layout master master GPL-3.0-or-later, MIT
matthiasmullie/minify 1.3.69 MIT
matthiasmullie/minify 1.3.70 MIT
matthiasmullie/path-converter 1.1.3 MIT
paragonie/constant_time_encoding v2.6.3 MIT
paragonie/random_compat v9.99.100 MIT
phpseclib/phpseclib 3.0.14 MIT
phpseclib/phpseclib 3.0.x-dev 8568af7 MIT
script47/bs5-utils master master MIT
spamspan/spamspan master GPL-2.0-only
symfony/polyfill-mbstring v1.19.0 MIT
tinymce/tinymce 5.x-dev 8ba4429 LGPL-2.1-only
tinymce/tinymce 5.x-dev f078d8e LGPL-2.1-only
twbs/bootstrap v5.2.3 MIT
tweeb/tinymce-i18n 2.0.4 MIT
vakata/jstree 3.3.12 MIT
/trunk/vendor/matthiasmullie/minify/CONTRIBUTING.md
File deleted
/trunk/vendor/matthiasmullie/minify/composer.json
3,12 → 3,12
"type": "library",
"description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
"keywords": ["minify", "minifier", "css", "js", "javascript"],
"homepage": "http://www.minifier.org",
"homepage": "https://github.com/matthiasmullie/minify",
"license": "MIT",
"authors": [
{
"name": "Matthias Mullie",
"homepage": "http://www.mullie.eu",
"homepage": "https://www.mullie.eu",
"email": "minify@mullie.eu",
"role": "Developer"
}
19,9 → 19,10
"matthiasmullie/path-converter": "~1.1"
},
"require-dev": {
"matthiasmullie/scrapbook": "dev-master",
"friendsofphp/php-cs-fixer": ">=2.0",
"matthiasmullie/scrapbook": ">=1.3",
"phpunit/phpunit": ">=4.8",
"friendsofphp/php-cs-fixer": "~2.0"
"squizlabs/php_codesniffer": ">=3.0"
},
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
31,6 → 32,11
"MatthiasMullie\\Minify\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MatthiasMullie\\Minify\\Tests\\": "tests/"
}
},
"bin": [
"bin/minifycss",
"bin/minifyjs"
/trunk/vendor/matthiasmullie/minify/ruleset.xml
0,0 → 1,10
<?xml version="1.0"?>
<ruleset>
<rule ref="PSR12" />
 
<file>./src</file>
<file>./tests</file>
 
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
</ruleset>
/trunk/vendor/matthiasmullie/minify/src/CSS.php
1,6 → 1,7
<?php
 
/**
* CSS Minifier
* CSS Minifier.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
12,15 → 13,14
namespace MatthiasMullie\Minify;
 
use MatthiasMullie\Minify\Exceptions\FileImportException;
use MatthiasMullie\PathConverter\Converter;
use MatthiasMullie\PathConverter\ConverterInterface;
use MatthiasMullie\PathConverter\Converter;
 
/**
* CSS minifier
* CSS minifier.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
* @author Tijs Verkoyen <minify@verkoyen.eu>
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
106,8 → 106,8
/**
* Combine CSS from import statements.
*
* @import's will be loaded and their content merged into the original file,
* to save HTTP requests.
* Import statements will be loaded and their content merged into the original
* file, to save HTTP requests.
*
* @param string $source The file to combine imports for
* @param string $content The CSS content to combine imports for
684,7 → 684,7
 
/**
* Replace all occurrences of functions that may contain math, where
* whitespace around operators needs to be preserved (e.g. calc, clamp)
* whitespace around operators needs to be preserved (e.g. calc, clamp).
*/
protected function extractMath()
{
704,11 → 704,11
// instead, it'll match a larger portion of code to where it's certain that
// the calc() musts have ended, and we'll figure out which is the correct
// closing parenthesis here, by counting how many have opened
for ($i = 0; $i < $length; $i++) {
for ($i = 0; $i < $length; ++$i) {
$char = $match[2][$i];
$expr .= $char;
if ($char === '(') {
$opened++;
++$opened;
} elseif ($char === ')' && --$opened === 0) {
break;
}
733,7 → 733,7
 
/**
* Replace custom properties, whose values may be used in scenarios where
* we wouldn't want them to be minified (e.g. inside calc)
* we wouldn't want them to be minified (e.g. inside calc).
*/
protected function extractCustomProperties()
{
740,13 → 740,12
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$this->registerPattern(
 
'/(?<=^|[;}{])\s*(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m',
function ($match) use ($minifier) {
$placeholder = '--custom-'. count($minifier->extracted) . ':0';
$minifier->extracted[$placeholder] = $match[1] .':'. trim($match[2]);
 
return $placeholder;
 
}
);
}
/trunk/vendor/matthiasmullie/minify/src/Exception.php
1,18 → 1,20
<?php
 
/**
* Base Exception
* Base Exception.
*
* @deprecated Use Exceptions\BasicException instead
*
* @author Matthias Mullie <minify@mullie.eu>
*/
 
namespace MatthiasMullie\Minify;
 
/**
* Base Exception Class
* Base Exception Class.
*
* @deprecated Use Exceptions\BasicException instead
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class Exception extends \Exception
/trunk/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php
1,6 → 1,7
<?php
 
/**
* Basic exception
* Basic exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
8,14 → 9,14
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
 
namespace MatthiasMullie\Minify\Exceptions;
 
use MatthiasMullie\Minify\Exception;
 
/**
* Basic Exception Class
* Basic Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class BasicException extends Exception
/trunk/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php
1,6 → 1,7
<?php
 
/**
* File Import Exception
* File Import Exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
8,12 → 9,12
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
 
namespace MatthiasMullie\Minify\Exceptions;
 
/**
* File Import Exception Class
* File Import Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
class FileImportException extends BasicException
/trunk/vendor/matthiasmullie/minify/src/Exceptions/IOException.php
1,6 → 1,7
<?php
 
/**
* IO Exception
* IO Exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
8,12 → 9,12
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
 
namespace MatthiasMullie\Minify\Exceptions;
 
/**
* IO Exception Class
* IO Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
class IOException extends BasicException
/trunk/vendor/matthiasmullie/minify/src/JS.php
1,6 → 1,7
<?php
 
/**
* JavaScript minifier
* JavaScript minifier.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
8,14 → 9,14
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
 
namespace MatthiasMullie\Minify;
 
/**
* JavaScript Minifier Class
* JavaScript Minifier Class.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
* @author Tijs Verkoyen <minify@verkoyen.eu>
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
29,6 → 30,8
* Note that regular expressions using that bit must have the PCRE_UTF8
* pattern modifier (/u) set.
*
* @internal
*
* @var string
*/
const REGEX_VARIABLE = '\b[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}0-9\x{0300}-\x{036f}\x{0483}-\x{0487}\x{0591}-\x{05bd}\x{05bf}\x{05c1}\x{05c2}\x{05c4}\x{05c5}\x{05c7}\x{0610}-\x{061a}\x{064b}-\x{0669}\x{0670}\x{06d6}-\x{06dc}\x{06df}-\x{06e4}\x{06e7}\x{06e8}\x{06ea}-\x{06ed}\x{06f0}-\x{06f9}\x{0711}\x{0730}-\x{074a}\x{07a6}-\x{07b0}\x{07c0}-\x{07c9}\x{07eb}-\x{07f3}\x{0816}-\x{0819}\x{081b}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082d}\x{0859}-\x{085b}\x{08e4}-\x{08fe}\x{0900}-\x{0903}\x{093a}-\x{093c}\x{093e}-\x{094f}\x{0951}-\x{0957}\x{0962}\x{0963}\x{0966}-\x{096f}\x{0981}-\x{0983}\x{09bc}\x{09be}-\x{09c4}\x{09c7}\x{09c8}\x{09cb}-\x{09cd}\x{09d7}\x{09e2}\x{09e3}\x{09e6}-\x{09ef}\x{0a01}-\x{0a03}\x{0a3c}\x{0a3e}-\x{0a42}\x{0a47}\x{0a48}\x{0a4b}-\x{0a4d}\x{0a51}\x{0a66}-\x{0a71}\x{0a75}\x{0a81}-\x{0a83}\x{0abc}\x{0abe}-\x{0ac5}\x{0ac7}-\x{0ac9}\x{0acb}-\x{0acd}\x{0ae2}\x{0ae3}\x{0ae6}-\x{0aef}\x{0b01}-\x{0b03}\x{0b3c}\x{0b3e}-\x{0b44}\x{0b47}\x{0b48}\x{0b4b}-\x{0b4d}\x{0b56}\x{0b57}\x{0b62}\x{0b63}\x{0b66}-\x{0b6f}\x{0b82}\x{0bbe}-\x{0bc2}\x{0bc6}-\x{0bc8}\x{0bca}-\x{0bcd}\x{0bd7}\x{0be6}-\x{0bef}\x{0c01}-\x{0c03}\x{0c3e}-\x{0c44}\x{0c46}-\x{0c48}\x{0c4a}-\x{0c4d}\x{0c55}\x{0c56}\x{0c62}\x{0c63}\x{0c66}-\x{0c6f}\x{0c82}\x{0c83}\x{0cbc}\x{0cbe}-\x{0cc4}\x{0cc6}-\x{0cc8}\x{0cca}-\x{0ccd}\x{0cd5}\x{0cd6}\x{0ce2}\x{0ce3}\x{0ce6}-\x{0cef}\x{0d02}\x{0d03}\x{0d3e}-\x{0d44}\x{0d46}-\x{0d48}\x{0d4a}-\x{0d4d}\x{0d57}\x{0d62}\x{0d63}\x{0d66}-\x{0d6f}\x{0d82}\x{0d83}\x{0dca}\x{0dcf}-\x{0dd4}\x{0dd6}\x{0dd8}-\x{0ddf}\x{0df2}\x{0df3}\x{0e31}\x{0e34}-\x{0e3a}\x{0e47}-\x{0e4e}\x{0e50}-\x{0e59}\x{0eb1}\x{0eb4}-\x{0eb9}\x{0ebb}\x{0ebc}\x{0ec8}-\x{0ecd}\x{0ed0}-\x{0ed9}\x{0f18}\x{0f19}\x{0f20}-\x{0f29}\x{0f35}\x{0f37}\x{0f39}\x{0f3e}\x{0f3f}\x{0f71}-\x{0f84}\x{0f86}\x{0f87}\x{0f8d}-\x{0f97}\x{0f99}-\x{0fbc}\x{0fc6}\x{102b}-\x{103e}\x{1040}-\x{1049}\x{1056}-\x{1059}\x{105e}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106d}\x{1071}-\x{1074}\x{1082}-\x{108d}\x{108f}-\x{109d}\x{135d}-\x{135f}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17d3}\x{17dd}\x{17e0}-\x{17e9}\x{180b}-\x{180d}\x{1810}-\x{1819}\x{18a9}\x{1920}-\x{192b}\x{1930}-\x{193b}\x{1946}-\x{194f}\x{19b0}-\x{19c0}\x{19c8}\x{19c9}\x{19d0}-\x{19d9}\x{1a17}-\x{1a1b}\x{1a55}-\x{1a5e}\x{1a60}-\x{1a7c}\x{1a7f}-\x{1a89}\x{1a90}-\x{1a99}\x{1b00}-\x{1b04}\x{1b34}-\x{1b44}\x{1b50}-\x{1b59}\x{1b6b}-\x{1b73}\x{1b80}-\x{1b82}\x{1ba1}-\x{1bad}\x{1bb0}-\x{1bb9}\x{1be6}-\x{1bf3}\x{1c24}-\x{1c37}\x{1c40}-\x{1c49}\x{1c50}-\x{1c59}\x{1cd0}-\x{1cd2}\x{1cd4}-\x{1ce8}\x{1ced}\x{1cf2}-\x{1cf4}\x{1dc0}-\x{1de6}\x{1dfc}-\x{1dff}\x{200c}\x{200d}\x{203f}\x{2040}\x{2054}\x{20d0}-\x{20dc}\x{20e1}\x{20e5}-\x{20f0}\x{2cef}-\x{2cf1}\x{2d7f}\x{2de0}-\x{2dff}\x{302a}-\x{302f}\x{3099}\x{309a}\x{a620}-\x{a629}\x{a66f}\x{a674}-\x{a67d}\x{a69f}\x{a6f0}\x{a6f1}\x{a802}\x{a806}\x{a80b}\x{a823}-\x{a827}\x{a880}\x{a881}\x{a8b4}-\x{a8c4}\x{a8d0}-\x{a8d9}\x{a8e0}-\x{a8f1}\x{a900}-\x{a909}\x{a926}-\x{a92d}\x{a947}-\x{a953}\x{a980}-\x{a983}\x{a9b3}-\x{a9c0}\x{a9d0}-\x{a9d9}\x{aa29}-\x{aa36}\x{aa43}\x{aa4c}\x{aa4d}\x{aa50}-\x{aa59}\x{aa7b}\x{aab0}\x{aab2}-\x{aab4}\x{aab7}\x{aab8}\x{aabe}\x{aabf}\x{aac1}\x{aaeb}-\x{aaef}\x{aaf5}\x{aaf6}\x{abe3}-\x{abea}\x{abec}\x{abed}\x{abf0}-\x{abf9}\x{fb1e}\x{fe00}-\x{fe0f}\x{fe20}-\x{fe26}\x{fe33}\x{fe34}\x{fe4d}-\x{fe4f}\x{ff10}-\x{ff19}\x{ff3f}]*\b';
124,7 → 127,7
*/
public function __construct()
{
call_user_func_array(array('parent', '__construct'), func_get_args());
call_user_func_array(array('\\MatthiasMullie\Minify\\Minify', '__construct'), func_get_args());
 
$dataDir = __DIR__.'/../data/js/';
$options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES;
174,7 → 177,7
$js = $this->stripWhitespace($js);
 
// combine js: separating the scripts by a ;
$content .= $js.";";
$content .= $js . ';';
}
 
// clean up leftover `;`s from the combination of multiple scripts
/trunk/vendor/matthiasmullie/minify/src/Minify.php
1,6 → 1,7
<?php
 
/**
* Abstract minifier class
* Abstract minifier class.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
8,6 → 9,7
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
 
namespace MatthiasMullie\Minify;
 
use MatthiasMullie\Minify\Exceptions\IOException;
18,7 → 20,6
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
44,6 → 45,8
* been extracted from the JS source code, so we can reliably match "code",
* without having to worry about potential "code-like" characters inside.
*
* @internal
*
* @var string[]
*/
public $extracted = array();
357,6 → 360,7
foreach ($match as &$matchItem) {
$matchItem = $matchItem[0];
}
 
return $replacement($match);
}
 
495,11 → 499,13
}
}
 
protected static function str_replace_first($search, $replace, $subject) {
protected static function str_replace_first($search, $replace, $subject)
{
$pos = strpos($subject, $search);
if ($pos !== false) {
return substr_replace($subject, $replace, $pos, strlen($search));
}
 
return $subject;
}
}
/trunk/vendor/phpseclib/phpseclib/AUTHORS
4,3 → 4,4
bantu (Andreas Fischer)
petrich (Hans-Jürgen Petrich)
GrahamCampbell (Graham Campbell)
hc-jworman
/trunk/vendor/phpseclib/phpseclib/BACKERS.md
10,4 → 10,5
- Zane Hooper
- [Setasign](https://www.setasign.com/)
- [Charles Severance](https://github.com/csev)
- [Rachel Fish](https://github.com/itsrachelfish)
- [Rachel Fish](https://github.com/itsrachelfish)
- Tharyrok
/trunk/vendor/phpseclib/phpseclib/composer.json
Cannot display: file marked as a binary type.
svn:mime-type = application/json
/trunk/vendor/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php
5,8 → 5,6
*
* PHP version 5
*
* @category Common
* @package Functions\Strings
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,6 → 13,9
 
namespace phpseclib3\Common\Functions;
 
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Base64UrlSafe;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\Common\FiniteField;
 
21,7 → 22,6
/**
* Common String Functions
*
* @package Functions\Strings
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class Strings
33,7 → 33,6
*
* @param string $string
* @param int $index
* @access public
* @return string
*/
public static function shift(&$string, $index = 1)
50,7 → 49,6
*
* @param string $string
* @param int $index
* @access public
* @return string
*/
public static function pop(&$string, $index = 1)
160,7 → 158,6
*
* @param string $format
* @param string|int|float|array|bool ...$elements
* @access public
* @return string
*/
public static function packSSH2($format, ...$elements)
233,7 → 230,6
*
* Converts C5 to CCCCC, for example.
*
* @access private
* @param string $format
* @return string
*/
257,7 → 253,6
* of this function, bin refers to base-256 encoded data whilst bits refers
* to base-2 encoded data
*
* @access public
* @param string $x
* @return string
*/
304,7 → 299,6
/**
* Convert bits to binary data
*
* @access public
* @param string $x
* @return string
*/
343,7 → 337,6
/**
* Switch Endianness Bit Order
*
* @access public
* @param string $x
* @return string
*/
374,7 → 367,6
*
* @param string $var
* @return string
* @access public
*/
public static function increment_str(&$var)
{
425,4 → 417,89
{
return is_string($var) || (is_object($var) && method_exists($var, '__toString'));
}
 
/**
* Constant Time Base64-decoding
*
* ParagoneIE\ConstantTime doesn't use libsodium if it's available so we'll do so
* ourselves. see https://github.com/paragonie/constant_time_encoding/issues/39
*
* @param string $data
* @return string
*/
public static function base64_decode($data)
{
return function_exists('sodium_base642bin') ?
sodium_base642bin($data, SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING, '=') :
Base64::decode($data);
}
 
/**
* Constant Time Base64-decoding (URL safe)
*
* @param string $data
* @return string
*/
public static function base64url_decode($data)
{
// return self::base64_decode(str_replace(['-', '_'], ['+', '/'], $data));
 
return function_exists('sodium_base642bin') ?
sodium_base642bin($data, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING, '=') :
Base64UrlSafe::decode($data);
}
 
/**
* Constant Time Base64-encoding
*
* @param string $data
* @return string
*/
public static function base64_encode($data)
{
return function_exists('sodium_bin2base64') ?
sodium_bin2base64($data, SODIUM_BASE64_VARIANT_ORIGINAL) :
Base64::encode($data);
}
 
/**
* Constant Time Base64-encoding (URL safe)
*
* @param string $data
* @return string
*/
public static function base64url_encode($data)
{
// return str_replace(['+', '/'], ['-', '_'], self::base64_encode($data));
 
return function_exists('sodium_bin2base64') ?
sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE) :
Base64UrlSafe::encode($data);
}
 
/**
* Constant Time Hex Decoder
*
* @param string $data
* @return string
*/
public static function hex2bin($data)
{
return function_exists('sodium_hex2bin') ?
sodium_hex2bin($data) :
Hex::decode($data);
}
 
/**
* Constant Time Hex Encoder
*
* @param string $data
* @return string
*/
public static function bin2hex($data)
{
return function_exists('sodium_bin2hex') ?
sodium_bin2hex($data) :
Hex::encode($data);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php
39,8 → 39,6
* ?>
* </code>
*
* @category Crypt
* @package AES
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2008 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
52,9 → 50,7
/**
* Pure-PHP implementation of AES.
*
* @package AES
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class AES extends Rijndael
{
64,7 → 60,6
* Since \phpseclib3\Crypt\AES extends \phpseclib3\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything.
*
* @see \phpseclib3\Crypt\Rijndael::setBlockLength()
* @access public
* @param int $length
* @throws \BadMethodCallException anytime it's called
*/
79,7 → 74,6
* Valid key lengths are 128, 192, and 256. Set the link to bool(false) to disable a fixed key length
*
* @see \phpseclib3\Crypt\Rijndael:setKeyLength()
* @access public
* @param int $length
* @throws \LengthException if the key length isn't supported
*/
103,7 → 97,6
*
* @see \phpseclib3\Crypt\Rijndael:setKey()
* @see setKeyLength()
* @access public
* @param string $key
* @throws \LengthException if the key length isn't supported
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
11,6 → 11,87
*
* - {@link http://en.wikipedia.org/wiki/Blowfish_(cipher) Wikipedia description of Blowfish}
*
* # An overview of bcrypt vs Blowfish
*
* OpenSSH private keys use a customized version of bcrypt. Specifically, instead of
* encrypting OrpheanBeholderScryDoubt 64 times OpenSSH's bcrypt variant encrypts
* OxychromaticBlowfishSwatDynamite 64 times. so we can't use crypt().
*
* bcrypt is basically Blowfish but instead of performing the key expansion once it performs
* the expansion 129 times for each round, with the first key expansion interleaving the salt
* and password. This renders OpenSSL unusable and forces us to use a pure-PHP implementation
* of blowfish.
*
* # phpseclib's four different _encryptBlock() implementations
*
* When using Blowfish as an encryption algorithm, _encryptBlock() is called 9 + 512 +
* (the number of blocks in the plaintext) times.
*
* Each of the first 9 calls to _encryptBlock() modify the P-array. Each of the next 512
* calls modify the S-boxes. The remaining _encryptBlock() calls operate on the plaintext to
* produce the ciphertext. In the pure-PHP implementation of Blowfish these remaining
* _encryptBlock() calls are highly optimized through the use of eval(). Among other things,
* P-array lookups are eliminated by hard-coding the key-dependent P-array values, and thus we
* have explained 2 of the 4 different _encryptBlock() implementations.
*
* With bcrypt things are a bit different. _encryptBlock() is called 1,079,296 times,
* assuming 16 rounds (which is what OpenSSH's bcrypt defaults to). The eval()-optimized
* _encryptBlock() isn't as beneficial because the P-array values are not constant. Well, they
* are constant, but only for, at most, 777 _encryptBlock() calls, which is equivalent to ~6KB
* of data. The average length of back to back _encryptBlock() calls with a fixed P-array is
* 514.12, which is ~4KB of data. Creating an eval()-optimized _encryptBlock() has an upfront
* cost, which is CPU dependent and is probably not going to be worth it for just ~4KB of
* data. Conseqeuently, bcrypt does not benefit from the eval()-optimized _encryptBlock().
*
* The regular _encryptBlock() does unpack() and pack() on every call, as well, and that can
* begin to add up after one million function calls.
*
* In theory, one might think that it might be beneficial to rewrite all block ciphers so
* that, instead of passing strings to _encryptBlock(), you convert the string to an array of
* integers and then pass successive subarrays of that array to _encryptBlock. This, however,
* kills PHP's memory use. Like let's say you have a 1MB long string. After doing
* $in = str_repeat('a', 1024 * 1024); PHP's memory utilization jumps up by ~1MB. After doing
* $blocks = str_split($in, 4); it jumps up by an additional ~16MB. After
* $blocks = array_map(fn($x) => unpack('N*', $x), $blocks); it jumps up by an additional
* ~90MB, yielding a 106x increase in memory usage. Consequently, it bcrypt calls a different
* _encryptBlock() then the regular Blowfish does. That said, the Blowfish _encryptBlock() is
* basically just a thin wrapper around the bcrypt _encryptBlock(), so there's that.
*
* This explains 3 of the 4 _encryptBlock() implementations. the last _encryptBlock()
* implementation can best be understood by doing Ctrl + F and searching for where
* self::$use_reg_intval is defined.
*
* # phpseclib's three different _setupKey() implementations
*
* Every bcrypt round is the equivalent of encrypting 512KB of data. Since OpenSSH uses 16
* rounds by default that's ~8MB of data that's essentially being encrypted whenever
* you use bcrypt. That's a lot of data, however, bcrypt operates within tighter constraints
* than regular Blowfish, so we can use that to our advantage. In particular, whereas Blowfish
* supports variable length keys, in bcrypt, the initial "key" is the sha512 hash of the
* password. sha512 hashes are 512 bits or 64 bytes long and thus the bcrypt keys are of a
* fixed length whereas Blowfish keys are not of a fixed length.
*
* bcrypt actually has two different key expansion steps. The first one (expandstate) is
* constantly XOR'ing every _encryptBlock() parameter against the salt prior _encryptBlock()'s
* being called. The second one (expand0state) is more similar to Blowfish's _setupKey()
* but it can still use the fixed length key optimization discussed above and can do away with
* the pack() / unpack() calls.
*
* I suppose _setupKey() could be made to be a thin wrapper around expandstate() but idk it's
* just a lot of work for very marginal benefits as _setupKey() is only called once for
* regular Blowfish vs the 128 times it's called --per round-- with bcrypt.
*
* # blowfish + bcrypt in the same class
*
* Altho there's a lot of Blowfish code that bcrypt doesn't re-use, bcrypt does re-use the
* initial S-boxes, the initial P-array and the int-only _encryptBlock() implementation.
*
* # Credit
*
* phpseclib's bcrypt implementation is based losely off of OpenSSH's implementation:
*
* https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bcrypt_pbkdf.c
*
* Here's a short example of how to use this library:
* <code>
* <?php
26,8 → 107,6
* ?>
* </code>
*
* @category Crypt
* @package Blowfish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @copyright 2007 Jim Wigginton
42,10 → 121,8
/**
* Pure-PHP implementation of Blowfish.
*
* @package Blowfish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @access public
*/
class Blowfish extends BlockCipher
{
54,7 → 131,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 8;
 
63,7 → 139,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'blowfish';
 
72,7 → 147,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
* @var int
* @access private
*/
protected $cfb_init_len = 500;
 
81,7 → 155,6
*
* S-Box 0
*
* @access private
* @var array
*/
private static $sbox0 = [
122,7 → 195,6
/**
* S-Box 1
*
* @access private
* @var array
*/
private static $sbox1 = [
163,7 → 235,6
/**
* S-Box 2
*
* @access private
* @var array
*/
private static $sbox2 = [
204,7 → 275,6
/**
* S-Box 3
*
* @access private
* @var array
*/
private static $sbox3 = [
246,7 → 316,6
* P-Array consists of 18 32-bit subkeys
*
* @var array
* @access private
*/
private static $parray = [
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
260,7 → 329,6
* Holds the expanded key [p] and the key-depended s-boxes [sb]
*
* @var array
* @access private
*/
private $bctx;
 
268,7 → 336,6
* Holds the last used key
*
* @var array
* @access private
*/
private $kl;
 
281,7 → 348,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 16;
 
289,7 → 355,6
* Default Constructor.
*
* @param string $mode
* @access public
* @throws \InvalidArgumentException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
306,7 → 371,6
*
* Key lengths can be between 32 and 448 bits.
*
* @access public
* @param int $length
*/
public function setKeyLength($length)
327,7 → 391,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
350,7 → 413,6
* Setup the key (expansion)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey()
* @access private
*/
protected function setupKey()
{
374,6 → 436,7
// unpack binary string in unsigned chars
$key = array_values(unpack('C*', $this->key));
$keyl = count($key);
// with bcrypt $keyl will always be 16 (because the key is the sha512 of the key you provide)
for ($j = 0, $i = 0; $i < 18; ++$i) {
// xor P1 with the first 32-bits of the key, xor P2 with the second 32-bits ...
for ($data = 0, $k = 0; $k < 4; ++$k) {
382,7 → 445,7
$j = 0;
}
}
$this->bctx['p'][] = self::$parray[$i] ^ $data;
$this->bctx['p'][] = self::$parray[$i] ^ intval($data);
}
 
// encrypt the zero-string, replace P1 and P2 with the encrypted data,
403,9 → 466,241
}
 
/**
* Initialize Static Variables
*/
protected static function initialize_static_variables()
{
if (is_float(self::$sbox2[0])) {
self::$sbox0 = array_map('intval', self::$sbox0);
self::$sbox1 = array_map('intval', self::$sbox1);
self::$sbox2 = array_map('intval', self::$sbox2);
self::$sbox3 = array_map('intval', self::$sbox3);
self::$parray = array_map('intval', self::$parray);
}
 
parent::initialize_static_variables();
}
 
/**
* bcrypt
*
* @param string $sha2pass
* @param string $sha2salt
* @access private
* @return string
*/
private static function bcrypt_hash($sha2pass, $sha2salt)
{
$p = self::$parray;
$sbox0 = self::$sbox0;
$sbox1 = self::$sbox1;
$sbox2 = self::$sbox2;
$sbox3 = self::$sbox3;
 
$cdata = array_values(unpack('N*', 'OxychromaticBlowfishSwatDynamite'));
$sha2pass = array_values(unpack('N*', $sha2pass));
$sha2salt = array_values(unpack('N*', $sha2salt));
 
self::expandstate($sha2salt, $sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 0; $i < 64; $i++) {
self::expand0state($sha2salt, $sbox0, $sbox1, $sbox2, $sbox3, $p);
self::expand0state($sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
for ($i = 0; $i < 64; $i++) {
for ($j = 0; $j < 8; $j += 2) { // count($cdata) == 8
list($cdata[$j], $cdata[$j + 1]) = self::encryptBlockHelperFast($cdata[$j], $cdata[$j + 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
}
 
return pack('L*', ...$cdata);
}
 
/**
* Performs OpenSSH-style bcrypt
*
* @param string $pass
* @param string $salt
* @param int $keylen
* @param int $rounds
* @access public
* @return string
*/
public static function bcrypt_pbkdf($pass, $salt, $keylen, $rounds)
{
self::initialize_static_variables();
 
if (PHP_INT_SIZE == 4) {
throw new \RuntimeException('bcrypt is far too slow to be practical on 32-bit versions of PHP');
}
 
$sha2pass = hash('sha512', $pass, true);
$results = [];
$count = 1;
while (32 * count($results) < $keylen) {
$countsalt = $salt . pack('N', $count++);
$sha2salt = hash('sha512', $countsalt, true);
$out = $tmpout = self::bcrypt_hash($sha2pass, $sha2salt);
for ($i = 1; $i < $rounds; $i++) {
$sha2salt = hash('sha512', $tmpout, true);
$tmpout = self::bcrypt_hash($sha2pass, $sha2salt);
$out ^= $tmpout;
}
$results[] = $out;
}
$output = '';
for ($i = 0; $i < 32; $i++) {
foreach ($results as $result) {
$output .= $result[$i];
}
}
return substr($output, 0, $keylen);
}
 
/**
* Key expansion without salt
*
* @access private
* @param int[] $key
* @param int[] $sbox0
* @param int[] $sbox1
* @param int[] $sbox2
* @param int[] $sbox3
* @param int[] $p
* @see self::_bcrypt_hash()
*/
private static function expand0state(array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p)
{
// expand0state is basically the same thing as this:
//return self::expandstate(array_fill(0, 16, 0), $key);
// but this separate function eliminates a bunch of XORs and array lookups
 
$p = [
$p[0] ^ $key[0],
$p[1] ^ $key[1],
$p[2] ^ $key[2],
$p[3] ^ $key[3],
$p[4] ^ $key[4],
$p[5] ^ $key[5],
$p[6] ^ $key[6],
$p[7] ^ $key[7],
$p[8] ^ $key[8],
$p[9] ^ $key[9],
$p[10] ^ $key[10],
$p[11] ^ $key[11],
$p[12] ^ $key[12],
$p[13] ^ $key[13],
$p[14] ^ $key[14],
$p[15] ^ $key[15],
$p[16] ^ $key[0],
$p[17] ^ $key[1]
];
 
// @codingStandardsIgnoreStart
list( $p[0], $p[1]) = self::encryptBlockHelperFast( 0, 0, $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[2], $p[3]) = self::encryptBlockHelperFast($p[ 0], $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[4], $p[5]) = self::encryptBlockHelperFast($p[ 2], $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[6], $p[7]) = self::encryptBlockHelperFast($p[ 4], $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[8], $p[9]) = self::encryptBlockHelperFast($p[ 6], $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[10], $p[11]) = self::encryptBlockHelperFast($p[ 8], $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[12], $p[13]) = self::encryptBlockHelperFast($p[10], $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[14], $p[15]) = self::encryptBlockHelperFast($p[12], $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[16], $p[17]) = self::encryptBlockHelperFast($p[14], $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p);
// @codingStandardsIgnoreEnd
 
list($sbox0[0], $sbox0[1]) = self::encryptBlockHelperFast($p[16], $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2; $i < 256; $i += 2) {
list($sbox0[$i], $sbox0[$i + 1]) = self::encryptBlockHelperFast($sbox0[$i - 2], $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox1[0], $sbox1[1]) = self::encryptBlockHelperFast($sbox0[254], $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2; $i < 256; $i += 2) {
list($sbox1[$i], $sbox1[$i + 1]) = self::encryptBlockHelperFast($sbox1[$i - 2], $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox2[0], $sbox2[1]) = self::encryptBlockHelperFast($sbox1[254], $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2; $i < 256; $i += 2) {
list($sbox2[$i], $sbox2[$i + 1]) = self::encryptBlockHelperFast($sbox2[$i - 2], $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox3[0], $sbox3[1]) = self::encryptBlockHelperFast($sbox2[254], $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2; $i < 256; $i += 2) {
list($sbox3[$i], $sbox3[$i + 1]) = self::encryptBlockHelperFast($sbox3[$i - 2], $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
}
 
/**
* Key expansion with salt
*
* @access private
* @param int[] $data
* @param int[] $key
* @param int[] $sbox0
* @param int[] $sbox1
* @param int[] $sbox2
* @param int[] $sbox3
* @param int[] $p
* @see self::_bcrypt_hash()
*/
private static function expandstate(array $data, array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p)
{
$p = [
$p[0] ^ $key[0],
$p[1] ^ $key[1],
$p[2] ^ $key[2],
$p[3] ^ $key[3],
$p[4] ^ $key[4],
$p[5] ^ $key[5],
$p[6] ^ $key[6],
$p[7] ^ $key[7],
$p[8] ^ $key[8],
$p[9] ^ $key[9],
$p[10] ^ $key[10],
$p[11] ^ $key[11],
$p[12] ^ $key[12],
$p[13] ^ $key[13],
$p[14] ^ $key[14],
$p[15] ^ $key[15],
$p[16] ^ $key[0],
$p[17] ^ $key[1]
];
 
// @codingStandardsIgnoreStart
list( $p[0], $p[1]) = self::encryptBlockHelperFast($data[ 0] , $data[ 1] , $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[2], $p[3]) = self::encryptBlockHelperFast($data[ 2] ^ $p[ 0], $data[ 3] ^ $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[4], $p[5]) = self::encryptBlockHelperFast($data[ 4] ^ $p[ 2], $data[ 5] ^ $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[6], $p[7]) = self::encryptBlockHelperFast($data[ 6] ^ $p[ 4], $data[ 7] ^ $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list( $p[8], $p[9]) = self::encryptBlockHelperFast($data[ 8] ^ $p[ 6], $data[ 9] ^ $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[10], $p[11]) = self::encryptBlockHelperFast($data[10] ^ $p[ 8], $data[11] ^ $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[12], $p[13]) = self::encryptBlockHelperFast($data[12] ^ $p[10], $data[13] ^ $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[14], $p[15]) = self::encryptBlockHelperFast($data[14] ^ $p[12], $data[15] ^ $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p);
list($p[16], $p[17]) = self::encryptBlockHelperFast($data[ 0] ^ $p[14], $data[ 1] ^ $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p);
// @codingStandardsIgnoreEnd
 
list($sbox0[0], $sbox0[1]) = self::encryptBlockHelperFast($data[2] ^ $p[16], $data[3] ^ $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) { // instead of 16 maybe count($data) would be better?
list($sbox0[$i], $sbox0[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox0[$i - 2], $data[$j + 1] ^ $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox1[0], $sbox1[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox0[254], $data[3] ^ $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) {
list($sbox1[$i], $sbox1[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox1[$i - 2], $data[$j + 1] ^ $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox2[0], $sbox2[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox1[254], $data[3] ^ $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) {
list($sbox2[$i], $sbox2[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox2[$i - 2], $data[$j + 1] ^ $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
 
list($sbox3[0], $sbox3[1]) = self::encryptBlockHelperFast($data[2] ^ $sbox2[254], $data[3] ^ $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
for ($i = 2, $j = 4; $i < 256; $i += 2, $j = ($j + 2) % 16) {
list($sbox3[$i], $sbox3[$i + 1]) = self::encryptBlockHelperFast($data[$j] ^ $sbox3[$i - 2], $data[$j + 1] ^ $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
}
}
 
/**
* Encrypts a block
*
* @access private
* @param string $in
* @return string
*/
422,24 → 717,89
$l = $in[1];
$r = $in[2];
 
for ($i = 0; $i < 16; $i += 2) {
$l ^= $p[$i];
$r ^= self::safe_intval((self::safe_intval($sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff]) ^
$sb_2[$l >> 8 & 0xff]) +
$sb_3[$l & 0xff]);
list($r, $l) = PHP_INT_SIZE == 4 ?
self::encryptBlockHelperSlow($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p) :
self::encryptBlockHelperFast($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p);
 
$r ^= $p[$i + 1];
$l ^= self::safe_intval((self::safe_intval($sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff]) ^
$sb_2[$r >> 8 & 0xff]) +
$sb_3[$r & 0xff]);
return pack("N*", $r, $l);
}
return pack('N*', $r ^ $p[17], $l ^ $p[16]);
 
/**
* Fast helper function for block encryption
*
* @access private
* @param int $x0
* @param int $x1
* @param int[] $sbox0
* @param int[] $sbox1
* @param int[] $sbox2
* @param int[] $sbox3
* @param int[] $p
* @return int[]
*/
private static function encryptBlockHelperFast($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p)
{
$x0 ^= $p[0];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14];
$x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15];
$x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16];
 
return [$x1 & 0xFFFFFFFF ^ $p[17], $x0 & 0xFFFFFFFF];
}
 
/**
* Slow helper function for block encryption
*
* @access private
* @param int $x0
* @param int $x1
* @param int[] $sbox0
* @param int[] $sbox1
* @param int[] $sbox2
* @param int[] $sbox3
* @param int[] $p
* @return int[]
*/
private static function encryptBlockHelperSlow($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p)
{
// -16777216 == intval(0xFF000000) on 32-bit PHP installs
$x0 ^= $p[0];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14];
$x1 ^= self::safe_intval((self::safe_intval($sbox0[(($x0 & -16777216) >> 24) & 0xFF] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15];
$x0 ^= self::safe_intval((self::safe_intval($sbox0[(($x1 & -16777216) >> 24) & 0xFF] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16];
 
return [$x1 ^ $p[17], $x0];
}
 
/**
* Decrypts a block
*
* @access private
* @param string $in
* @return string
*/
473,7 → 833,6
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt()
* @access private
*/
protected function setupInlineCrypt()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/ChaCha20.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package ChaCha20
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2019 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* Pure-PHP implementation of ChaCha20.
*
* @package ChaCha20
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class ChaCha20 extends Salsa20
{
41,7 → 37,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
284,10 → 279,10
// xor'ing and rotation are all on the same line so i'm keeping it on the same
// line here as well
// @codingStandardsIgnoreStart
$a+= $b; $d = self::leftRotate($d ^ $a, 16);
$c+= $d; $b = self::leftRotate($b ^ $c, 12);
$a+= $b; $d = self::leftRotate($d ^ $a, 8);
$c+= $d; $b = self::leftRotate($b ^ $c, 7);
$a+= $b; $d = self::leftRotate(intval($d) ^ intval($a), 16);
$c+= $d; $b = self::leftRotate(intval($b) ^ intval($c), 12);
$a+= $b; $d = self::leftRotate(intval($d) ^ intval($a), 8);
$c+= $d; $b = self::leftRotate(intval($b) ^ intval($c), 7);
// @codingStandardsIgnoreEnd
}
 
362,424 → 357,424
 
// @codingStandardsIgnoreStart
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
 
// columnRound
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 16);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 12);
$x0+= $x4; $x12 = self::leftRotate($x12 ^ $x0, 8);
$x8+= $x12; $x4 = self::leftRotate($x4 ^ $x8, 7);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 16);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 12);
$x0+= $x4; $x12 = self::leftRotate(intval($x12) ^ intval($x0), 8);
$x8+= $x12; $x4 = self::leftRotate(intval($x4) ^ intval($x8), 7);
 
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 16);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 12);
$x1+= $x5; $x13 = self::leftRotate($x13 ^ $x1, 8);
$x9+= $x13; $x5 = self::leftRotate($x5 ^ $x9, 7);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 16);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 12);
$x1+= $x5; $x13 = self::leftRotate(intval($x13) ^ intval($x1), 8);
$x9+= $x13; $x5 = self::leftRotate(intval($x5) ^ intval($x9), 7);
 
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 16);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 12);
$x2+= $x6; $x14 = self::leftRotate($x14 ^ $x2, 8);
$x10+= $x14; $x6 = self::leftRotate($x6 ^ $x10, 7);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 16);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 12);
$x2+= $x6; $x14 = self::leftRotate(intval($x14) ^ intval($x2), 8);
$x10+= $x14; $x6 = self::leftRotate(intval($x6) ^ intval($x10), 7);
 
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 16);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 12);
$x3+= $x7; $x15 = self::leftRotate($x15 ^ $x3, 8);
$x11+= $x15; $x7 = self::leftRotate($x7 ^ $x11, 7);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 16);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 12);
$x3+= $x7; $x15 = self::leftRotate(intval($x15) ^ intval($x3), 8);
$x11+= $x15; $x7 = self::leftRotate(intval($x7) ^ intval($x11), 7);
 
// rowRound
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 16);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 12);
$x0+= $x5; $x15 = self::leftRotate($x15 ^ $x0, 8);
$x10+= $x15; $x5 = self::leftRotate($x5 ^ $x10, 7);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 16);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 12);
$x0+= $x5; $x15 = self::leftRotate(intval($x15) ^ intval($x0), 8);
$x10+= $x15; $x5 = self::leftRotate(intval($x5) ^ intval($x10), 7);
 
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 16);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 12);
$x1+= $x6; $x12 = self::leftRotate($x12 ^ $x1, 8);
$x11+= $x12; $x6 = self::leftRotate($x6 ^ $x11, 7);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 16);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 12);
$x1+= $x6; $x12 = self::leftRotate(intval($x12) ^ intval($x1), 8);
$x11+= $x12; $x6 = self::leftRotate(intval($x6) ^ intval($x11), 7);
 
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 16);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 12);
$x2+= $x7; $x13 = self::leftRotate($x13 ^ $x2, 8);
$x8+= $x13; $x7 = self::leftRotate($x7 ^ $x8, 7);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 16);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 12);
$x2+= $x7; $x13 = self::leftRotate(intval($x13) ^ intval($x2), 8);
$x8+= $x13; $x7 = self::leftRotate(intval($x7) ^ intval($x8), 7);
 
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 16);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 12);
$x3+= $x4; $x14 = self::leftRotate($x14 ^ $x3, 8);
$x9+= $x14; $x4 = self::leftRotate($x4 ^ $x9, 7);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 16);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 12);
$x3+= $x4; $x14 = self::leftRotate(intval($x14) ^ intval($x3), 8);
$x9+= $x14; $x4 = self::leftRotate(intval($x4) ^ intval($x9), 7);
// @codingStandardsIgnoreEnd
 
$x0 += $z0;
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package AsymmetricKey
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
25,7 → 23,6
/**
* Base Class for all asymmetric cipher classes
*
* @package AsymmetricKey
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AsymmetricKey
34,7 → 31,6
* Precomputed Zero
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected static $zero;
 
42,7 → 38,6
* Precomputed One
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected static $one;
 
50,7 → 45,6
* Format of the loaded key
*
* @var string
* @access private
*/
protected $format;
 
58,7 → 52,6
* Hash function
*
* @var \phpseclib3\Crypt\Hash
* @access private
*/
protected $hash;
 
66,7 → 59,6
* HMAC function
*
* @var \phpseclib3\Crypt\Hash
* @access private
*/
private $hmac;
 
75,7 → 67,6
*
* @see self::initialize_static_variables()
* @var array
* @access private
*/
private static $plugins = [];
 
84,33 → 75,13
*
* @see self::initialize_static_variables()
* @var array
* @access private
*/
private static $invisiblePlugins = [];
 
/**
* Supported signature formats (lower case)
*
* @see self::initialize_static_variables()
* @var array
* @access private
*/
private static $signatureFormats = [];
 
/**
* Supported signature formats (original case)
*
* @see self::initialize_static_variables()
* @var array
* @access private
*/
private static $signatureFileFormats = [];
 
/**
* Available Engines
*
* @var boolean[]
* @access private
*/
protected static $engines = [];
 
118,7 → 89,6
* Key Comment
*
* @var null|string
* @access private
*/
private $comment;
 
186,6 → 156,7
}
 
$components['format'] = $format;
$components['secret'] = isset($components['secret']) ? $components['secret'] : '';
$comment = isset($components['comment']) ? $components['comment'] : null;
$new = static::onLoad($components);
$new->format = $format;
199,7 → 170,6
* Loads a private key
*
* @return PrivateKey
* @access public
* @param string|array $key
* @param string $password optional
*/
216,7 → 186,6
* Loads a public key
*
* @return PublicKey
* @access public
* @param string|array $key
*/
public static function loadPublicKey($key)
232,7 → 201,6
* Loads parameters
*
* @return AsymmetricKey
* @access public
* @param string|array $key
*/
public static function loadParameters($key)
268,6 → 236,7
}
 
$components['format'] = $format;
$components['secret'] = isset($components['secret']) ? $components['secret'] : '';
 
$new = static::onLoad($components);
$new->format = $format;
280,7 → 249,6
* Loads a private key
*
* @return PrivateKey
* @access public
* @param string $type
* @param string $key
* @param string $password optional
298,7 → 266,6
* Loads a public key
*
* @return PublicKey
* @access public
* @param string $type
* @param string $key
*/
315,7 → 282,6
* Loads parameters
*
* @return AsymmetricKey
* @access public
* @param string $type
* @param string|array $key
*/
331,7 → 297,6
/**
* Validate Plugin
*
* @access private
* @param string $format
* @param string $type
* @param string $method optional
354,7 → 319,6
/**
* Load Plugins
*
* @access private
* @param string $format
*/
private static function loadPlugins($format)
385,7 → 349,6
/**
* Returns a list of supported formats.
*
* @access public
* @return array
*/
public static function getSupportedKeyFormats()
403,7 → 366,6
*
* @see self::load()
* @param string $fullname
* @access public
* @return bool
*/
public static function addFileFormat($fullname)
427,7 → 389,6
* with RSA::createKey() then this will throw an exception.
*
* @see self::load()
* @access public
* @return mixed
*/
public function getLoadedFormat()
445,7 → 406,6
*
* Not all key formats support comments. If you want to set a comment use toString()
*
* @access public
* @return null|string
*/
public function getComment()
456,7 → 416,6
/**
* Tests engine validity
*
* @access public
*/
public static function useBestEngine()
{
475,7 → 434,6
/**
* Flag to use internal engine only (useful for unit testing)
*
* @access public
*/
public static function useInternalEngine()
{
499,7 → 457,6
/**
* Determines which hashing function should be used
*
* @access public
* @param string $hash
*/
public function withHash($hash)
515,7 → 472,6
/**
* Returns the hash algorithm currently being used
*
* @access public
*/
public function getHash()
{
526,7 → 482,6
* Compute the pseudorandom k for signature generation,
* using the process specified for deterministic DSA.
*
* @access public
* @param string $h1
* @return string
*/
571,7 → 526,6
/**
* Integer to Octet String
*
* @access private
* @param \phpseclib3\Math\BigInteger $v
* @return string
*/
591,7 → 545,6
/**
* Bit String to Integer
*
* @access private
* @param string $in
* @return \phpseclib3\Math\BigInteger
*/
609,7 → 562,6
/**
* Bit String to Octet String
*
* @access private
* @param string $in
* @return string
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/BlockCipher.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package BlockCipher
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @copyright 2007 Jim Wigginton
19,7 → 17,6
/**
* Base Class for all block cipher classes
*
* @package BlockCipher
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class BlockCipher extends SymmetricKey
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/JWK.php
0,0 → 1,69
<?php
 
/**
* JSON Web Key (RFC7517) Handler
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
 
namespace phpseclib3\Crypt\Common\Formats\Keys;
 
use phpseclib3\Common\Functions\Strings;
 
/**
* JSON Web Key Formatted Key Handler
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class JWK
{
/**
* Break a public or private key down into its constituent components
*
* @param string $key
* @param string $password
* @return array
*/
public static function load($key, $password = '')
{
if (!Strings::is_stringable($key)) {
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
}
 
$key = preg_replace('#\s#', '', $key); // remove whitespace
 
if (PHP_VERSION_ID >= 73000) {
$key = json_decode($key, null, 512, JSON_THROW_ON_ERROR);
} else {
$key = json_decode($key);
if (!$key) {
throw new \RuntimeException('Unable to decode JSON');
}
}
 
if (isset($key->kty)) {
return $key;
}
 
if (count($key->keys) != 1) {
throw new \RuntimeException('Although the JWK key format supports multiple keys phpseclib does not');
}
 
return $key->keys[0];
}
 
/**
* Wrap a key appropriately
*
* @return string
*/
protected static function wrapKey(array $key, array $options)
{
return json_encode(['keys' => [$key + $options]]);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php
7,8 → 7,6
*
* Place in $HOME/.ssh/authorized_keys
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
17,17 → 15,14
 
namespace phpseclib3\Crypt\Common\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\Random;
use phpseclib3\Exception\UnsupportedFormatException;
 
/**
* OpenSSH Formatted RSA Key Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSH
{
35,7 → 30,6
* Default comment
*
* @var string
* @access private
*/
protected static $comment = 'phpseclib-generated-key';
 
43,7 → 37,6
* Binary key flag
*
* @var bool
* @access private
*/
protected static $binary = false;
 
50,7 → 43,6
/**
* Sets the default comment
*
* @access public
* @param string $comment
*/
public static function setComment($comment)
63,7 → 55,6
*
* $type can be either ssh-dss or ssh-rsa
*
* @access public
* @param string $key
* @param string $password
* @return array
79,7 → 70,7
 
if (strpos($key, 'BEGIN OPENSSH PRIVATE KEY') !== false) {
$key = preg_replace('#(?:^-.*?-[\r\n]*$)|\s#ms', '', $key);
$key = Base64::decode($key);
$key = Strings::base64_decode($key);
$magic = Strings::shift($key, 15);
if ($magic != "openssh-key-v1\0") {
throw new \RuntimeException('Expected openssh-key-v1');
91,39 → 82,28
// that to the appropriate key loading parser $numKey times or something
throw new \RuntimeException('Although the OpenSSH private key format supports multiple keys phpseclib does not');
}
if (strlen($kdfoptions) || $kdfname != 'none' || $ciphername != 'none') {
/*
OpenSSH private keys use a customized version of bcrypt. specifically, instead of encrypting
OrpheanBeholderScryDoubt 64 times OpenSSH's bcrypt variant encrypts
OxychromaticBlowfishSwatDynamite 64 times. so we can't use crypt().
 
bcrypt is basically Blowfish with an altered key expansion. whereas Blowfish just runs the
key through the key expansion bcrypt interleaves the key expansion with the salt and
password. this renders openssl / mcrypt unusuable. this forces us to use a pure-PHP implementation
of bcrypt. the problem with that is that pure-PHP is too slow to be practically useful.
 
in addition to encrypting a different string 64 times the OpenSSH implementation also performs bcrypt
from scratch $rounds times. calling crypt() 64x with bcrypt takes 0.7s. PHP is going to be naturally
slower. pure-PHP is 215x slower than OpenSSL for AES and pure-PHP is 43x slower for bcrypt.
43 * 0.7 = 30s. no one wants to wait 30s to load a private key.
 
another way to think about this.. according to wikipedia's article on Blowfish,
"Each new key requires pre-processing equivalent to encrypting about 4 kilobytes of text".
key expansion is done (9+64*2)*160 times. multiply that by 4 and it turns out that Blowfish,
OpenSSH style, is the equivalent of encrypting ~80mb of text.
 
more supporting evidence: sodium_compat does not implement Argon2 (another password hashing
algorithm) because "It's not feasible to polyfill scrypt or Argon2 into PHP and get reasonable
performance. Users would feel motivated to select parameters that downgrade security to avoid
denial of service (DoS) attacks. The only winning move is not to play"
-- https://github.com/paragonie/sodium_compat/blob/master/README.md
*/
throw new \RuntimeException('Encrypted OpenSSH private keys are not supported');
//list($salt, $rounds) = Strings::unpackSSH2('sN', $kdfoptions);
switch ($ciphername) {
case 'none':
break;
case 'aes256-ctr':
if ($kdfname != 'bcrypt') {
throw new \RuntimeException('Only the bcrypt kdf is supported (' . $kdfname . ' encountered)');
}
list($salt, $rounds) = Strings::unpackSSH2('sN', $kdfoptions);
$crypto = new AES('ctr');
//$crypto->setKeyLength(256);
//$crypto->disablePadding();
$crypto->setPassword($password, 'bcrypt', $salt, $rounds, 32);
break;
default:
throw new \RuntimeException('The only supported cipherse are: none, aes256-ctr (' . $ciphername . ' is being used)');
}
 
list($publicKey, $paddedKey) = Strings::unpackSSH2('ss', $key);
list($type) = Strings::unpackSSH2('s', $publicKey);
if (isset($crypto)) {
$paddedKey = $crypto->decrypt($paddedKey);
}
list($checkint1, $checkint2) = Strings::unpackSSH2('NN', $paddedKey);
// any leftover bytes in $paddedKey are for padding? but they should be sequential bytes. eg. 1, 2, 3, etc.
if ($checkint1 != $checkint2) {
138,7 → 118,7
 
if (!isset($parts[1])) {
$key = base64_decode($parts[0]);
$comment = isset($parts[1]) ? $parts[1] : false;
$comment = false;
} else {
$asciiType = $parts[0];
self::checkType($parts[0]);
169,7 → 149,6
* Printable keys are what are generated by default. These are the ones that go in
* $HOME/.ssh/authorized_key.
*
* @access public
* @param bool $enabled
*/
public static function setBinaryOutput($enabled)
180,7 → 159,6
/**
* Checks to see if the type is valid
*
* @access private
* @param string $candidate
*/
private static function checkType($candidate)
193,7 → 171,6
/**
* Wrap a private key appropriately
*
* @access public
* @param string $publicKey
* @param string $privateKey
* @param string $password
202,10 → 179,6
*/
protected static function wrapPrivateKey($publicKey, $privateKey, $password, $options)
{
if (!empty($password) && is_string($password)) {
throw new UnsupportedFormatException('Encrypted OpenSSH private keys are not supported');
}
 
list(, $checkint) = unpack('N', Random::string(4));
 
$comment = isset($options['comment']) ? $options['comment'] : self::$comment;
213,6 → 186,8
$privateKey .
Strings::packSSH2('s', $comment);
 
$usesEncryption = !empty($password) && is_string($password);
 
/*
from http://tools.ietf.org/html/rfc4253#section-6 :
 
220,15 → 195,26
'padding_length', 'payload', and 'random padding' MUST be a multiple
of the cipher block size or 8, whichever is larger.
*/
$paddingLength = (7 * strlen($paddedKey)) % 8;
$blockSize = $usesEncryption ? 16 : 8;
$paddingLength = (($blockSize - 1) * strlen($paddedKey)) % $blockSize;
for ($i = 1; $i <= $paddingLength; $i++) {
$paddedKey .= chr($i);
}
if (!$usesEncryption) {
$key = Strings::packSSH2('sssNss', 'none', 'none', '', 1, $publicKey, $paddedKey);
} else {
$rounds = isset($options['rounds']) ? $options['rounds'] : 16;
$salt = Random::string(16);
$kdfoptions = Strings::packSSH2('sN', $salt, $rounds);
$crypto = new AES('ctr');
$crypto->setPassword($password, 'bcrypt', $salt, $rounds, 32);
$paddedKey = $crypto->encrypt($paddedKey);
$key = Strings::packSSH2('sssNss', 'aes256-ctr', 'bcrypt', $kdfoptions, 1, $publicKey, $paddedKey);
}
$key = "openssh-key-v1\0$key";
 
return "-----BEGIN OPENSSH PRIVATE KEY-----\n" .
chunk_split(Base64::encode($key), 70, "\n") .
chunk_split(Strings::base64_encode($key), 70, "\n") .
"-----END OPENSSH PRIVATE KEY-----\n";
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* PKCS1 Formatted Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS
{
41,7 → 37,6
/**
* Is the key a base-64 encoded PEM, DER or should it be auto-detected?
*
* @access private
* @var int
*/
protected static $format = self::MODE_ANY;
49,7 → 44,6
/**
* Require base64-encoded PEM's be supplied
*
* @access public
*/
public static function requirePEM()
{
59,7 → 53,6
/**
* Require raw DER's be supplied
*
* @access public
*/
public static function requireDER()
{
71,7 → 64,6
*
* This is the default setting
*
* @access public
*/
public static function requireAny()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,8 → 13,6
 
namespace phpseclib3\Crypt\Common\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\DES;
28,9 → 24,7
/**
* PKCS1 Formatted Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS1 extends PKCS
{
38,7 → 32,6
* Default encryption algorithm
*
* @var string
* @access private
*/
private static $defaultEncryptionAlgorithm = 'AES-128-CBC';
 
45,7 → 38,6
/**
* Sets the default encryption algorithm
*
* @access public
* @param string $algo
*/
public static function setEncryptionAlgorithm($algo)
56,7 → 48,6
/**
* Returns the mode constant corresponding to the mode string
*
* @access public
* @param string $mode
* @return int
* @throws \UnexpectedValueException if the block cipher mode is unsupported
77,7 → 68,6
/**
* Returns a cipher object corresponding to a string
*
* @access public
* @param string $algo
* @return string
* @throws \UnexpectedValueException if the encryption algorithm is unsupported
102,7 → 92,6
/**
* Generate a symmetric key for PKCS#1 keys
*
* @access private
* @param string $password
* @param string $iv
* @param int $length
121,7 → 110,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
148,7 → 136,7
 
* OpenSSL is the de facto standard. It's utilized by OpenSSH and other projects */
if (preg_match('#DEK-Info: (.+),(.+)#', $key, $matches)) {
$iv = Hex::decode(trim($matches[2]));
$iv = Strings::hex2bin(trim($matches[2]));
// remove the Proc-Type / DEK-Info sections as they're no longer needed
$key = preg_replace('#^(?:Proc-Type|DEK-Info): .*#m', '', $key);
$ciphertext = ASN1::extractBER($key);
176,7 → 164,6
/**
* Wrap a private key appropriately
*
* @access public
* @param string $key
* @param string $type
* @param string $password
187,7 → 174,7
{
if (empty($password) || !is_string($password)) {
return "-----BEGIN $type PRIVATE KEY-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END $type PRIVATE KEY-----";
}
 
197,12 → 184,12
$iv = Random::string($cipher->getBlockLength() >> 3);
$cipher->setKey(self::generateSymmetricKey($password, $iv, $cipher->getKeyLength() >> 3));
$cipher->setIV($iv);
$iv = strtoupper(Hex::encode($iv));
$iv = strtoupper(Strings::bin2hex($iv));
return "-----BEGIN $type PRIVATE KEY-----\r\n" .
"Proc-Type: 4,ENCRYPTED\r\n" .
"DEK-Info: " . $encryptionAlgorithm . ",$iv\r\n" .
"\r\n" .
chunk_split(Base64::encode($cipher->encrypt($key)), 64) .
chunk_split(Strings::base64_encode($cipher->encrypt($key)), 64) .
"-----END $type PRIVATE KEY-----";
}
 
209,7 → 196,6
/**
* Wrap a public key appropriately
*
* @access public
* @param string $key
* @param string $type
* @return string
217,7 → 203,7
protected static function wrapPublicKey($key, $type)
{
return "-----BEGIN $type PUBLIC KEY-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END $type PUBLIC KEY-----";
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php
17,8 → 17,6
* is specific to private keys it's basically creating a DER-encoded wrapper
* for keys. This just extends that same concept to public keys (much like ssh-keygen)
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
27,7 → 25,6
 
namespace phpseclib3\Crypt\Common\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\DES;
43,9 → 40,7
/**
* PKCS#8 Formatted Key Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS8 extends PKCS
{
53,7 → 48,6
* Default encryption algorithm
*
* @var string
* @access private
*/
private static $defaultEncryptionAlgorithm = 'id-PBES2';
 
63,7 → 57,6
* Only used when defaultEncryptionAlgorithm is id-PBES2
*
* @var string
* @access private
*/
private static $defaultEncryptionScheme = 'aes128-CBC-PAD';
 
73,7 → 66,6
* Only used when defaultEncryptionAlgorithm is id-PBES2
*
* @var string
* @access private
*/
private static $defaultPRF = 'id-hmacWithSHA256';
 
81,7 → 73,6
* Default Iteration Count
*
* @var int
* @access private
*/
private static $defaultIterationCount = 2048;
 
89,7 → 80,6
* OIDs loaded
*
* @var bool
* @access private
*/
private static $oidsLoaded = false;
 
96,7 → 86,6
/**
* Sets the default encryption algorithm
*
* @access public
* @param string $algo
*/
public static function setEncryptionAlgorithm($algo)
107,7 → 96,6
/**
* Sets the default encryption algorithm for PBES2
*
* @access public
* @param string $algo
*/
public static function setEncryptionScheme($algo)
118,7 → 106,6
/**
* Sets the iteration count
*
* @access public
* @param int $count
*/
public static function setIterationCount($count)
129,7 → 116,6
/**
* Sets the PRF for PBES2
*
* @access public
* @param string $algo
*/
public static function setPRF($algo)
141,7 → 127,6
* Returns a SymmetricKey object based on a PBES1 $algo
*
* @return \phpseclib3\Crypt\Common\SymmetricKey
* @access public
* @param string $algo
*/
private static function getPBES1EncryptionObject($algo)
191,7 → 176,6
* Returns a hash based on a PBES1 $algo
*
* @return string
* @access public
* @param string $algo
*/
private static function getPBES1Hash($algo)
207,7 → 191,6
* Returns a KDF baesd on a PBES1 $algo
*
* @return string
* @access public
* @param string $algo
*/
private static function getPBES1KDF($algo)
229,7 → 212,6
* Returns a SymmetricKey object baesd on a PBES2 $algo
*
* @return SymmetricKey
* @access public
* @param string $algo
*/
private static function getPBES2EncryptionObject($algo)
264,7 → 246,6
/**
* Initialize static variables
*
* @access private
*/
private static function initialize_static_variables()
{
328,7 → 309,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
363,12 → 343,15
$meta['meta']['algorithm'] = $algorithm;
 
$temp = ASN1::decodeBER($decrypted['encryptionAlgorithm']['parameters']);
if (!$temp) {
throw new \RuntimeException('Unable to decode BER');
}
extract(ASN1::asn1map($temp[0], Maps\PBEParameter::MAP));
$iterationCount = (int) $iterationCount->toString();
$cipher->setPassword($password, $kdf, $hash, $salt, $iterationCount);
$key = $cipher->decrypt($decrypted['encryptedData']);
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER 2');
}
 
377,6 → 360,9
$meta['meta']['algorithm'] = $algorithm;
 
$temp = ASN1::decodeBER($decrypted['encryptionAlgorithm']['parameters']);
if (!$temp) {
throw new \RuntimeException('Unable to decode BER');
}
$temp = ASN1::asn1map($temp[0], Maps\PBES2params::MAP);
extract($temp);
 
384,6 → 370,9
$meta['meta']['cipher'] = $encryptionScheme['algorithm'];
 
$temp = ASN1::decodeBER($decrypted['encryptionAlgorithm']['parameters']);
if (!$temp) {
throw new \RuntimeException('Unable to decode BER');
}
$temp = ASN1::asn1map($temp[0], Maps\PBES2params::MAP);
extract($temp);
 
391,6 → 380,9
$cipher->setIV($encryptionScheme['parameters']['octetString']);
} else {
$temp = ASN1::decodeBER($encryptionScheme['parameters']);
if (!$temp) {
throw new \RuntimeException('Unable to decode BER');
}
extract(ASN1::asn1map($temp[0], Maps\RC2CBCParameter::MAP));
$effectiveKeyLength = (int) $rc2ParametersVersion->toString();
switch ($effectiveKeyLength) {
413,6 → 405,9
switch ($keyDerivationFunc['algorithm']) {
case 'id-PBKDF2':
$temp = ASN1::decodeBER($keyDerivationFunc['parameters']);
if (!$temp) {
throw new \RuntimeException('Unable to decode BER');
}
$prf = ['algorithm' => 'id-hmacWithSHA1'];
$params = ASN1::asn1map($temp[0], Maps\PBKDF2params::MAP);
extract($params);
431,7 → 426,7
$cipher->setPassword(...$params);
$key = $cipher->decrypt($decrypted['encryptedData']);
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER 3');
}
break;
505,7 → 500,6
/**
* Wrap a private key appropriately
*
* @access public
* @param string $key
* @param string $attr
* @param mixed $params
607,12 → 601,12
$key = ASN1::encodeDER($key, Maps\EncryptedPrivateKeyInfo::MAP);
 
return "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END ENCRYPTED PRIVATE KEY-----";
}
 
return "-----BEGIN PRIVATE KEY-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END PRIVATE KEY-----";
}
 
619,7 → 613,6
/**
* Wrap a public key appropriately
*
* @access public
* @param string $key
* @param mixed $params
* @param string $oid
631,16 → 624,19
 
$key = [
'publicKeyAlgorithm' => [
'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid,
'parameters' => $params
'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid
],
'publicKey' => "\0" . $key
];
 
if ($oid != 'id-Ed25519' && $oid != 'id-Ed448') {
$key['publicKeyAlgorithm']['parameters'] = $params;
}
 
$key = ASN1::encodeDER($key, Maps\PublicKeyInfo::MAP);
 
return "-----BEGIN PUBLIC KEY-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END PUBLIC KEY-----";
}
 
668,7 → 664,7
}
 
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
692,6 → 688,9
 
if ($r['encryptionAlgorithm']['algorithm'] == 'id-PBES2') {
$decoded = ASN1::decodeBER($r['encryptionAlgorithm']['parameters']->element);
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
$r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], ASN1\Maps\PBES2params::MAP);
 
$kdf = &$r['encryptionAlgorithm']['parameters']['keyDerivationFunc'];
698,6 → 697,9
switch ($kdf['algorithm']) {
case 'id-PBKDF2':
$decoded = ASN1::decodeBER($kdf['parameters']->element);
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
$kdf['parameters'] = ASN1::asn1map($decoded[0], Maps\PBKDF2params::MAP);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PuTTY.php
7,8 → 7,6
*
* PHP version 5
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
17,8 → 15,6
 
namespace phpseclib3\Crypt\Common\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\Hash;
28,9 → 24,7
/**
* PuTTY Formatted Key Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PuTTY
{
38,7 → 32,6
* Default comment
*
* @var string
* @access private
*/
private static $comment = 'phpseclib-generated-key';
 
46,7 → 39,6
* Default version
*
* @var int
* @access private
*/
private static $version = 2;
 
53,7 → 45,6
/**
* Sets the default comment
*
* @access public
* @param string $comment
*/
public static function setComment($comment)
64,7 → 55,6
/**
* Sets the default version
*
* @access public
* @param int $version
*/
public static function setVersion($version)
78,7 → 68,6
/**
* Generate a symmetric key for PuTTY v2 keys
*
* @access private
* @param string $password
* @param int $length
* @return string
89,7 → 78,7
$sequence = 0;
while (strlen($symkey) < $length) {
$temp = pack('Na*', $sequence++, $password);
$symkey .= Hex::decode(sha1($temp));
$symkey .= Strings::hex2bin(sha1($temp));
}
return substr($symkey, 0, $length);
}
97,7 → 86,6
/**
* Generate a symmetric key for PuTTY v3 keys
*
* @access private
* @param string $password
* @param string $flavour
* @param int $memory
135,7 → 123,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password
* @return array
208,7 → 195,7
$components['comment'] = trim(preg_replace('#Comment: (.+)#', '$1', $key[2]));
 
$publicLength = trim(preg_replace('#Public-Lines: (\d+)#', '$1', $key[3]));
$public = Base64::decode(implode('', array_map('trim', array_slice($key, 4, $publicLength))));
$public = Strings::base64_decode(implode('', array_map('trim', array_slice($key, 4, $publicLength))));
 
$source = Strings::packSSH2('ssss', $type, $encryption, $components['comment'], $public);
 
238,7 → 225,7
$memory = trim(preg_replace('#Argon2-Memory: (\d+)#', '$1', $key[$offset++]));
$passes = trim(preg_replace('#Argon2-Passes: (\d+)#', '$1', $key[$offset++]));
$parallelism = trim(preg_replace('#Argon2-Parallelism: (\d+)#', '$1', $key[$offset++]));
$salt = Hex::decode(trim(preg_replace('#Argon2-Salt: ([0-9a-f]+)#', '$1', $key[$offset++])));
$salt = Strings::hex2bin(trim(preg_replace('#Argon2-Salt: ([0-9a-f]+)#', '$1', $key[$offset++])));
 
extract(self::generateV3Key($password, $flavour, $memory, $passes, $salt));
 
261,7 → 248,7
}
 
$privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$offset++]));
$private = Base64::decode(implode('', array_map('trim', array_slice($key, $offset, $privateLength))));
$private = Strings::base64_decode(implode('', array_map('trim', array_slice($key, $offset, $privateLength))));
 
if ($encryption != 'none') {
$crypto->setKey($symkey);
273,7 → 260,7
$source .= Strings::packSSH2('s', $private);
 
$hmac = trim(preg_replace('#Private-MAC: (.+)#', '$1', $key[$offset + $privateLength]));
$hmac = Hex::decode($hmac);
$hmac = Strings::hex2bin($hmac);
 
if (!hash_equals($hash->hash($source), $hmac)) {
throw new \UnexpectedValueException('MAC validation error');
287,7 → 274,6
/**
* Wrap a private key appropriately
*
* @access private
* @param string $public
* @param string $private
* @param string $type
309,7 → 295,7
 
$source = Strings::packSSH2('ssss', $type, $encryption, $comment, $public);
 
$public = Base64::encode($public);
$public = Strings::base64_encode($public);
$key .= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n";
$key .= chunk_split($public, 64);
 
336,7 → 322,7
$key .= "Argon2-Memory: 8192\r\n";
$key .= "Argon2-Passes: 13\r\n";
$key .= "Argon2-Parallelism: 1\r\n";
$key .= "Argon2-Salt: " . Hex::encode($salt) . "\r\n";
$key .= "Argon2-Salt: " . Strings::bin2hex($salt) . "\r\n";
extract(self::generateV3Key($password, 'Argon2id', 8192, 13, $salt));
 
$hash = new Hash('sha256');
359,10 → 345,10
$mac = $hash->hash($source);
}
 
$private = Base64::encode($private);
$private = Strings::base64_encode($private);
$key .= 'Private-Lines: ' . ((strlen($private) + 63) >> 6) . "\r\n";
$key .= chunk_split($private, 64);
$key .= 'Private-MAC: ' . Hex::encode($hash->hash($source)) . "\r\n";
$key .= 'Private-MAC: ' . Strings::bin2hex($hash->hash($source)) . "\r\n";
 
return $key;
}
372,7 → 358,6
*
* This is basically the format described in RFC 4716 (https://tools.ietf.org/html/rfc4716)
*
* @access private
* @param string $key
* @param string $type
* @return string
382,7 → 367,7
$key = pack('Na*a*', strlen($type), $type, $key);
$key = "---- BEGIN SSH2 PUBLIC KEY ----\r\n" .
'Comment: "' . str_replace(['\\', '"'], ['\\\\', '\"'], self::$comment) . "\"\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
'---- END SSH2 PUBLIC KEY ----';
return $key;
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php
7,8 → 7,6
*
* Handles signatures as arrays
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* Raw Signature Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Raw
{
31,7 → 27,6
/**
* Loads a signature
*
* @access public
* @param array $sig
* @return array|bool
*/
54,7 → 49,6
/**
* Returns a signature in the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $r
* @param \phpseclib3\Math\BigInteger $s
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/PrivateKey.php
3,8 → 3,6
/**
* PrivateKey interface
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
16,9 → 14,7
/**
* PrivateKey interface
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
interface PrivateKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/PublicKey.php
3,8 → 3,6
/**
* PublicKey interface
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
16,9 → 14,7
/**
* PublicKey interface
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
interface PublicKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package StreamCipher
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @copyright 2007 Jim Wigginton
19,7 → 17,6
/**
* Base Class for all stream cipher classes
*
* @package StreamCipher
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class StreamCipher extends SymmetricKey
31,7 → 28,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 0;
 
49,7 → 45,6
/**
* Stream ciphers not use an IV
*
* @access public
* @return bool
*/
public function usesIV()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php
25,8 → 25,6
*
* - Please read all the other comments/notes/hints here also for each class var/method
*
* @category Crypt
* @package Base
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @copyright 2007 Jim Wigginton
37,6 → 35,7
namespace phpseclib3\Crypt\Common;
 
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Blowfish;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\BadModeException;
50,7 → 49,6
/**
* Base Class for all \phpseclib3\Crypt\* cipher classes
*
* @package Base
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
*/
62,7 → 60,6
* Set to -1 since that's what Crypt/Random.php uses to index the CTR mode.
*
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
71,7 → 68,6
* Encrypt / decrypt using the Electronic Code Book mode.
*
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
80,7 → 76,6
* Encrypt / decrypt using the Code Book Chaining mode.
*
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
89,7 → 84,6
* Encrypt / decrypt using the Cipher Feedback mode.
*
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
97,7 → 91,6
/**
* Encrypt / decrypt using the Cipher Feedback mode (8bit)
*
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
105,7 → 98,6
/**
* Encrypt / decrypt using the Output Feedback mode (8bit)
*
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
114,7 → 106,6
* Encrypt / decrypt using the Output Feedback mode.
*
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
123,7 → 114,6
* Encrypt / decrypt using Galois/Counter mode.
*
* @link https://en.wikipedia.org/wiki/Galois/Counter_Mode
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
131,7 → 121,6
/**
* Encrypt / decrypt using streaming mode.
*
* @access public
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
*/
140,7 → 129,6
/**
* Mode Map
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const MODE_MAP = [
158,7 → 146,6
/**
* Base value for the internal implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_INTERNAL = 1;
165,7 → 152,6
/**
* Base value for the eval() implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_EVAL = 2;
172,7 → 158,6
/**
* Base value for the mcrypt implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_MCRYPT = 3;
179,7 → 164,6
/**
* Base value for the openssl implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_OPENSSL = 4;
186,7 → 170,6
/**
* Base value for the libsodium implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_LIBSODIUM = 5;
193,7 → 176,6
/**
* Base value for the openssl / gcm implementation $engine switch
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
*/
const ENGINE_OPENSSL_GCM = 6;
201,7 → 183,6
/**
* Engine Reverse Map
*
* @access private
* @see \phpseclib3\Crypt\Common\SymmetricKey::getEngine()
*/
const ENGINE_MAP = [
218,7 → 199,6
*
* @see self::__construct()
* @var int
* @access private
*/
protected $mode;
 
226,7 → 206,6
* The Block Length of the block cipher
*
* @var int
* @access private
*/
protected $block_size = 16;
 
235,16 → 214,22
*
* @see self::setKey()
* @var string
* @access private
*/
protected $key = false;
 
/**
* HMAC Key
*
* @see self::setupGCM()
* @var ?string
*/
protected $hKey = false;
 
/**
* The Initialization Vector
*
* @see self::setIV()
* @var string
* @access private
*/
protected $iv = false;
 
254,7 → 239,6
* @see self::enableContinuousBuffer()
* @see self::clearBuffers()
* @var string
* @access private
*/
protected $encryptIV;
 
264,7 → 248,6
* @see self::enableContinuousBuffer()
* @see self::clearBuffers()
* @var string
* @access private
*/
protected $decryptIV;
 
273,7 → 256,6
*
* @see self::enableContinuousBuffer()
* @var bool
* @access private
*/
protected $continuousBuffer = false;
 
283,7 → 265,6
* @see self::encrypt()
* @see self::clearBuffers()
* @var array
* @access private
*/
protected $enbuffer;
 
293,7 → 274,6
* @see self::decrypt()
* @see self::clearBuffers()
* @var array
* @access private
*/
protected $debuffer;
 
305,7 → 285,6
*
* @see self::encrypt()
* @var resource
* @access private
*/
private $enmcrypt;
 
317,7 → 296,6
*
* @see self::decrypt()
* @var resource
* @access private
*/
private $demcrypt;
 
327,7 → 305,6
* @see \phpseclib3\Crypt\Twofish::setKey()
* @see \phpseclib3\Crypt\Twofish::setIV()
* @var bool
* @access private
*/
private $enchanged = true;
 
337,7 → 314,6
* @see \phpseclib3\Crypt\Twofish::setKey()
* @see \phpseclib3\Crypt\Twofish::setIV()
* @var bool
* @access private
*/
private $dechanged = true;
 
356,7 → 332,6
* @see self::decrypt()
* @see self::setupMcrypt()
* @var resource
* @access private
*/
private $ecb;
 
378,7 → 353,6
*
* @see self::encrypt()
* @var int
* @access private
*/
protected $cfb_init_len = 600;
 
389,7 → 363,6
* @see self::setIV()
* @see self::disableContinuousBuffer()
* @var bool
* @access private
*/
protected $changed = true;
 
398,7 → 371,6
*
* @see self::setup()
* @var bool
* @access private
*/
protected $nonIVChanged = true;
 
407,7 → 379,6
*
* @see self::enablePadding()
* @var bool
* @access private
*/
private $padding = true;
 
416,7 → 387,6
*
* @see self::__construct()
* @var bool
* @access private
*/
private $paddable = false;
 
436,7 → 406,6
* @see self::encrypt()
* @see self::decrypt()
* @var int
* @access private
*/
protected $engine;
 
446,7 → 415,6
* @see self::setEngine()
* @see self::setPreferredEngine()
* @var int
* @access private
*/
private $preferredEngine;
 
459,7 → 427,6
* @link http://www.php.net/mcrypt_list_algorithms
* @see self::setupMcrypt()
* @var string
* @access private
*/
protected $cipher_name_mcrypt;
 
470,7 → 437,6
*
* @link http://www.php.net/openssl-get-cipher-methods
* @var string
* @access private
*/
protected $cipher_name_openssl;
 
482,7 → 448,6
*
* @link http://www.php.net/openssl-get-cipher-methods
* @var string
* @access private
*/
protected $cipher_name_openssl_ecb;
 
491,7 → 456,6
*
* @see self::setPassword()
* @var string
* @access private
*/
private $password_default_salt = 'phpseclib/salt';
 
505,7 → 469,6
* @see self::decrypt()
* @see self::setupInlineCrypt()
* @var Callback
* @access private
*/
protected $inline_crypt;
 
514,7 → 477,6
*
* @see self::openssl_ctr_process()
* @var bool
* @access private
*/
private $openssl_emulate_ctr = false;
 
523,7 → 485,6
*
* @see self::clearBuffers()
* @var bool
* @access private
*/
private $skip_key_adjustment = false;
 
532,7 → 493,6
*
* @see self::setKeyLength()
* @var bool
* @access private
*/
protected $explicit_key_length = false;
 
542,7 → 502,6
* @see self::setupGCM()
* @see self::ghash()
* @var BinaryField\Integer
* @access private
*/
private $h;
 
550,7 → 509,6
* Additional authenticated data
*
* @var string
* @access private
*/
protected $aad = '';
 
558,7 → 516,6
* Authentication Tag produced after a round of encryption
*
* @var string
* @access private
*/
protected $newtag = false;
 
566,7 → 523,6
* Authentication Tag to be verified during decryption
*
* @var string
* @access private
*/
protected $oldtag = false;
 
576,7 → 532,6
* @see self::__construct()
* @see self::ghash()
* @var BinaryField
* @access private
*/
private static $gcmField;
 
586,17 → 541,23
* @see self::enablePoly1305()
* @see self::poly1305()
* @var PrimeField
* @access private
*/
private static $poly1305Field;
 
/**
* Flag for using regular vs "safe" intval
*
* @see self::initialize_static_variables()
* @var boolean
*/
protected static $use_reg_intval;
 
/**
* Poly1305 Key
*
* @see self::setPoly1305Key()
* @see self::poly1305()
* @var string
* @access private
*/
protected $poly1305Key;
 
606,7 → 567,6
* @see self::setPoly1305Key()
* @see self::enablePoly1305()
* @var boolean
* @access private
*/
protected $usePoly1305 = false;
 
618,7 → 578,6
*
* @see self::setIV()
* @var string
* @access private
*/
private $origIV = false;
 
630,7 → 589,6
*
* @see self::setNonce()
* @var string
* @access private
*/
protected $nonce = false;
 
656,7 → 614,6
* - gcm
*
* @param string $mode
* @access public
* @throws BadModeException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
698,9 → 655,46
}
 
$this->mode = $mode;
 
static::initialize_static_variables();
}
 
/**
* Initialize static variables
*/
protected static function initialize_static_variables()
{
if (!isset(self::$use_reg_intval)) {
switch (true) {
// PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster
case (PHP_OS & "\xDF\xDF\xDF") === 'WIN':
case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
case defined('PHP_INT_SIZE') && PHP_INT_SIZE == 8:
self::$use_reg_intval = true;
break;
case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
switch (true) {
/* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors:
 
https://github.com/php/php-src/commit/716da71446ebbd40fa6cf2cea8a4b70f504cc3cd
 
altho the changelogs make no mention of it, this bug was fixed with this commit:
 
https://github.com/php/php-src/commit/c1729272b17a1fe893d1a54e423d3b71470f3ee8
 
affected versions of PHP are: 7.0.x, 7.1.0 - 7.1.23 and 7.2.0 - 7.2.11 */
case PHP_VERSION_ID >= 70000 && PHP_VERSION_ID <= 70123:
case PHP_VERSION_ID >= 70200 && PHP_VERSION_ID <= 70211:
self::$use_reg_intval = false;
break;
default:
self::$use_reg_intval = true;
}
}
}
}
 
/**
* Sets the initialization vector.
*
* setIV() is not required when ecb or gcm modes are being used.
707,7 → 701,6
*
* {@internal Can be overwritten by a sub class, but does not have to be}
*
* @access public
* @param string $iv
* @throws \LengthException if the IV length isn't equal to the block size
* @throws \BadMethodCallException if an IV is provided when one shouldn't be
739,7 → 732,6
*
* Once enabled Poly1305 cannot be disabled.
*
* @access public
* @throws \BadMethodCallException if Poly1305 is enabled whilst in GCM mode
*/
public function enablePoly1305()
757,7 → 749,6
* Once enabled Poly1305 cannot be disabled. If $key is not passed then an attempt to call createPoly1305Key
* will be made.
*
* @access public
* @param string $key optional
* @throws \LengthException if the key isn't long enough
* @throws \BadMethodCallException if Poly1305 is enabled whilst in GCM mode
786,7 → 777,6
*
* setNonce() is only required when gcm is used
*
* @access public
* @param string $nonce
* @throws \BadMethodCallException if an nonce is provided when one shouldn't be
*/
805,7 → 795,6
*
* setAAD() is only used by gcm or in poly1305 mode
*
* @access public
* @param string $aad
* @throws \BadMethodCallException if mode isn't GCM or if poly1305 isn't being utilized
*/
821,7 → 810,6
/**
* Returns whether or not the algorithm uses an IV
*
* @access public
* @return bool
*/
public function usesIV()
832,7 → 820,6
/**
* Returns whether or not the algorithm uses a nonce
*
* @access public
* @return bool
*/
public function usesNonce()
843,7 → 830,6
/**
* Returns the current key length in bits
*
* @access public
* @return int
*/
public function getKeyLength()
854,7 → 840,6
/**
* Returns the current block length in bits
*
* @access public
* @return int
*/
public function getBlockLength()
865,7 → 850,6
/**
* Returns the current block length in bytes
*
* @access public
* @return int
*/
public function getBlockLengthInBytes()
878,7 → 862,6
*
* Keys with explicitly set lengths need to be treated accordingly
*
* @access public
* @param int $length
*/
public function setKeyLength($length)
903,7 → 886,6
*
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @access public
* @param string $key
*/
public function setKey($key)
925,7 → 907,11
* $hash, $salt, $count, $dkLen
*
* Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php
* {@link https://en.wikipedia.org/wiki/Bcrypt bcypt}:
* $salt, $rounds, $keylen
*
* This is a modified version of bcrypt used by OpenSSH.
*
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @see Crypt/Hash.php
933,8 → 919,8
* @param string $method
* @param string[] ...$func_args
* @throws \LengthException if pbkdf1 is being used and the derived key length exceeds the hash length
* @throws \RuntimeException if bcrypt is being used and a salt isn't provided
* @return bool
* @access public
*/
public function setPassword($password, $method = 'pbkdf2', ...$func_args)
{
942,6 → 928,22
 
$method = strtolower($method);
switch ($method) {
case 'bcrypt':
if (!isset($func_args[2])) {
throw new \RuntimeException('A salt must be provided for bcrypt to work');
}
 
$salt = $func_args[0];
 
$rounds = isset($func_args[1]) ? $func_args[1] : 16;
$keylen = isset($func_args[2]) ? $func_args[2] : $this->key_length;
 
$key = Blowfish::bcrypt_pbkdf($password, $salt, $keylen + $this->block_size, $rounds);
 
$this->setKey(substr($key, 0, $keylen));
$this->setIV(substr($key, $keylen));
 
return true;
case 'pkcs12': // from https://tools.ietf.org/html/rfc7292#appendix-B.2
case 'pbkdf1':
case 'pbkdf2':
1074,7 → 1076,6
* {@link https://tools.ietf.org/html/rfc7292#appendix-B}
*
* @see self::setPassword()
* @access private
* @param int $n
* @param \phpseclib3\Crypt\Hash $hashObj
* @param string $i
1137,7 → 1138,6
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @see self::decrypt()
* @access public
* @param string $plaintext
* @return string $ciphertext
*/
1517,7 → 1517,6
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @see self::encrypt()
* @access public
* @param string $ciphertext
* @return string $plaintext
* @throws \LengthException if we're inside a block cipher and the ciphertext length is not a multiple of the block size
1589,7 → 1588,7
$plaintext = '';
if ($this->continuousBuffer) {
$iv = &$this->decryptIV;
$pos = &$this->buffer['pos'];
$pos = &$this->debuffer['pos'];
} else {
$iv = $this->decryptIV;
$pos = 0;
1888,7 → 1887,6
* @see self::encrypt()
* @param int $length optional
* @return string
* @access public
* @throws \LengthException if $length isn't of a sufficient length
* @throws \RuntimeException if GCM mode isn't being used
*/
1923,7 → 1921,6
*
* @see self::decrypt()
* @param string $tag
* @access public
* @throws \LengthException if $length isn't of a sufficient length
* @throws \RuntimeException if GCM mode isn't being used
*/
1953,7 → 1950,6
* @see self::decrypt()
* @param string $iv
* @return string
* @access private
*/
protected function getIV($iv)
{
1974,7 → 1970,6
* @param string $encryptIV
* @param array $buffer
* @return string
* @access private
*/
private function openssl_ctr_process($plaintext, &$encryptIV, &$buffer)
{
2062,7 → 2057,6
* @param string $encryptIV
* @param array $buffer
* @return string
* @access private
*/
private function openssl_ofb_process($plaintext, &$encryptIV, &$buffer)
{
2108,7 → 2102,6
* May need to be overwritten by classes extending this one in some cases
*
* @return string
* @access private
*/
protected function openssl_translate_mode()
{
2142,7 → 2135,6
* transmitted separately)
*
* @see self::disablePadding()
* @access public
*/
public function enablePadding()
{
2153,7 → 2145,6
* Do not pad packets.
*
* @see self::enablePadding()
* @access public
*/
public function disablePadding()
{
2197,7 → 2188,6
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @see self::disableContinuousBuffer()
* @access public
*/
public function enableContinuousBuffer()
{
2222,7 → 2212,6
* {@internal Could, but not must, extend by the child Crypt_* class}
*
* @see self::enableContinuousBuffer()
* @access public
*/
public function disableContinuousBuffer()
{
2243,7 → 2232,6
*
* @see self::__construct()
* @param int $engine
* @access private
* @return bool
*/
protected function isValidEngineHelper($engine)
2293,7 → 2281,6
*
* @see self::__construct()
* @param string $engine
* @access public
* @return bool
*/
public function isValidEngine($engine)
2330,7 → 2317,6
*
* @see self::__construct()
* @param string $engine
* @access public
*/
public function setPreferredEngine($engine)
{
2339,7 → 2325,7
$reverseMap = array_map('strtolower', self::ENGINE_MAP);
$reverseMap = array_flip($reverseMap);
}
$engine = strtolower($engine);
$engine = is_string($engine) ? strtolower($engine) : '';
$this->preferredEngine = isset($reverseMap[$engine]) ? $reverseMap[$engine] : self::ENGINE_LIBSODIUM;
 
$this->setEngine();
2349,7 → 2335,6
* Returns the engine currently being utilized
*
* @see self::setEngine()
* @access public
*/
public function getEngine()
{
2360,7 → 2345,6
* Sets the engine as appropriate
*
* @see self::__construct()
* @access private
*/
protected function setEngine()
{
2415,7 → 2399,6
*
* Note: Must be extended by the child \phpseclib3\Crypt\* class
*
* @access private
* @param string $in
* @return string
*/
2426,7 → 2409,6
*
* Note: Must be extended by the child \phpseclib3\Crypt\* class
*
* @access private
* @param string $in
* @return string
*/
2440,7 → 2422,6
* Note: Must extend by the child \phpseclib3\Crypt\* class
*
* @see self::setup()
* @access private
*/
abstract protected function setupKey();
 
2468,7 → 2449,6
* @see self::setKey()
* @see self::setIV()
* @see self::disableContinuousBuffer()
* @access private
*/
protected function setup()
{
2571,7 → 2551,6
* @see self::unpad()
* @param string $text
* @throws \LengthException if padding is disabled and the plaintext's length is not a multiple of the block size
* @access private
* @return string
*/
protected function pad($text)
2600,7 → 2579,6
* @see self::pad()
* @param string $text
* @throws \LengthException if the ciphertext's length is not a multiple of the block size
* @access private
* @return string
*/
protected function unpad($text)
2674,7 → 2652,6
* @see self::createInlineCryptFunction()
* @see self::encrypt()
* @see self::decrypt()
* @access private
*/
//protected function setupInlineCrypt();
 
2786,7 → 2763,6
* @see self::encrypt()
* @see self::decrypt()
* @param array $cipher_code
* @access private
* @return string (the name of the created callback function)
*/
protected function createInlineCryptFunction($cipher_code)
3234,18 → 3210,19
*
* On ARM CPUs converting floats to ints doesn't always work
*
* @access private
* @param string $x
* @return int
*/
protected static function safe_intval($x)
{
switch (true) {
case is_int($x):
// PHP 5.3, per http://php.net/releases/5_3_0.php, introduced "more consistent float rounding"
case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
if (is_int($x)) {
return $x;
}
 
if (self::$use_reg_intval) {
return PHP_INT_SIZE == 4 && PHP_VERSION_ID >= 80100 ? intval($x) : $x;
}
 
return (fmod($x, 0x80000000) & 0x7FFFFFFF) |
((fmod(floor($x / 0x80000000), 2) & 1) << 31);
}
3253,21 → 3230,17
/**
* eval()'able string for in-line float to int
*
* @access private
* @return string
*/
protected static function safe_intval_inline()
{
switch (true) {
case defined('PHP_INT_SIZE') && PHP_INT_SIZE == 8:
case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
return '%s';
break;
default:
if (self::$use_reg_intval) {
return PHP_INT_SIZE == 4 && PHP_VERSION_ID >= 80100 ? 'intval(%s)' : '%s';
}
 
$safeint = '(is_int($temp = %s) ? $temp : (fmod($temp, 0x80000000) & 0x7FFFFFFF) | ';
return $safeint . '((fmod(floor($temp / 0x80000000), 2) & 1) << 31))';
}
}
 
/**
* Sets up GCM parameters
3275,12 → 3248,11
* See steps 1-2 of https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf#page=23
* for more info
*
* @access private
*/
private function setupGCM()
{
// don't keep on re-calculating $this->h
if (!$this->h || $this->h->key != $this->key) {
if (!$this->h || $this->hKey != $this->key) {
$cipher = new static('ecb');
$cipher->setKey($this->key);
$cipher->disablePadding();
3288,7 → 3260,7
$this->h = self::$gcmField->newInteger(
Strings::switchEndianness($cipher->encrypt("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"))
);
$this->h->key = $this->key;
$this->hKey = $this->key;
}
 
if (strlen($this->nonce) == 12) {
3308,7 → 3280,6
*
* @see self::decrypt()
* @see self::encrypt()
* @access private
* @param string $x
* @return string
*/
3343,7 → 3314,6
* @see self::decrypt()
* @see self::encrypt()
* @see self::setupGCM()
* @access private
* @param string $str
* @return string
*/
3358,7 → 3328,6
* @see self::decrypt()
* @see self::encrypt()
* @see self::setupGCM()
* @access private
* @param string $str
* @return string
*/
3376,7 → 3345,6
*
* @see self::decrypt()
* @see self::encrypt()
* @access private
* @param string $text
* @return string
*/
3409,7 → 3377,6
*
* You can do $obj instanceof AES or whatever to get the cipher but you can't do that to get the mode
*
* @access public
* @return string
*/
public function getMode()
3416,4 → 3383,14
{
return array_flip(self::MODE_MAP)[$this->mode];
}
 
/**
* Is the continuous buffer enabled?
*
* @return boolean
*/
public function continuousBufferEnabled()
{
return $this->continuousBuffer;
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Traits/Fingerprint.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Fingerprint Trait for Private Keys
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
trait Fingerprint
{
33,7 → 29,6
* no public key currently loaded, false is returned.
* Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716)
*
* @access public
* @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned
* for invalid values.
* @return mixed
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Traits/PasswordProtected.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* Password Protected Trait for Private Keys
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
trait PasswordProtected
{
39,7 → 35,6
*
* @see self::createKey()
* @see self::load()
* @access public
* @param string|bool $password
*/
public function withPassword($password = false)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php
32,8 → 32,6
* ?>
* </code>
*
* @category Crypt
* @package DES
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
48,9 → 46,7
/**
* Pure-PHP implementation of DES.
*
* @package DES
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class DES extends BlockCipher
{
57,7 → 53,6
/**
* Contains $keys[self::ENCRYPT]
*
* @access private
* @see \phpseclib3\Crypt\DES::setupKey()
* @see \phpseclib3\Crypt\DES::processBlock()
*/
65,7 → 60,6
/**
* Contains $keys[self::DECRYPT]
*
* @access private
* @see \phpseclib3\Crypt\DES::setupKey()
* @see \phpseclib3\Crypt\DES::processBlock()
*/
76,7 → 70,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 8;
 
85,7 → 78,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 8;
 
94,7 → 86,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'des';
 
103,7 → 94,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::openssl_mode_names
* @var array
* @access private
*/
protected $openssl_mode_names = [
self::MODE_ECB => 'des-ecb',
118,7 → 108,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
* @var int
* @access private
*/
protected $cfb_init_len = 500;
 
130,7 → 119,6
* @see self::setupKey()
* @see self::processBlock()
* @var int
* @access private
*/
protected $des_rounds = 1;
 
139,7 → 127,6
*
* @see self::setKey()
* @var string
* @access private
*/
protected $key_length_max = 8;
 
148,11 → 135,18
*
* @see self::setupKey()
* @var array
* @access private
*/
private $keys;
 
/**
* Key Cache "key"
*
* @see self::setupKey()
* @var array
*/
private $kl;
 
/**
* Shuffle table.
*
* For each byte value index, the entry holds an 8-byte string
162,7 → 156,6
* @see self::processBlock()
* @see self::setupKey()
* @var array
* @access private
*/
protected static $shuffle = [
"\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\xFF",
301,7 → 294,6
* Indexing this table with each source byte performs the initial bit permutation.
*
* @var array
* @access private
*/
protected static $ipmap = [
0x00, 0x10, 0x01, 0x11, 0x20, 0x30, 0x21, 0x31,
343,7 → 335,6
* Indexing this table with a byte value reverses the bit order.
*
* @var array
* @access private
*/
protected static $invipmap = [
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
387,7 → 378,6
* P table: concatenation can then be replaced by exclusive ORs.
*
* @var array
* @access private
*/
protected static $sbox1 = [
0x00808200, 0x00000000, 0x00008000, 0x00808202,
412,7 → 402,6
* Pre-permuted S-box2
*
* @var array
* @access private
*/
protected static $sbox2 = [
0x40084010, 0x40004000, 0x00004000, 0x00084010,
437,7 → 426,6
* Pre-permuted S-box3
*
* @var array
* @access private
*/
protected static $sbox3 = [
0x00000104, 0x04010100, 0x00000000, 0x04010004,
462,7 → 450,6
* Pre-permuted S-box4
*
* @var array
* @access private
*/
protected static $sbox4 = [
0x80401000, 0x80001040, 0x80001040, 0x00000040,
487,7 → 474,6
* Pre-permuted S-box5
*
* @var array
* @access private
*/
protected static $sbox5 = [
0x00000080, 0x01040080, 0x01040000, 0x21000080,
512,7 → 498,6
* Pre-permuted S-box6
*
* @var array
* @access private
*/
protected static $sbox6 = [
0x10000008, 0x10200000, 0x00002000, 0x10202008,
537,7 → 522,6
* Pre-permuted S-box7
*
* @var array
* @access private
*/
protected static $sbox7 = [
0x00100000, 0x02100001, 0x02000401, 0x00000000,
562,7 → 546,6
* Pre-permuted S-box8
*
* @var array
* @access private
*/
protected static $sbox8 = [
0x08000820, 0x00000800, 0x00020000, 0x08020820,
587,7 → 570,6
* Default Constructor.
*
* @param string $mode
* @access public
* @throws BadModeException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
606,7 → 588,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
629,7 → 610,6
* DES also requires that every eighth bit be a parity bit, however, we'll ignore that.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKey()
* @access public
* @param string $key
*/
public function setKey($key)
648,7 → 628,6
* @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see self::encrypt()
* @access private
* @param string $in
* @return string
*/
663,7 → 642,6
* @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
* @see self::decrypt()
* @access private
* @param string $in
* @return string
*/
681,7 → 659,6
*
* @see self::encryptBlock()
* @see self::decryptBlock()
* @access private
* @param string $block
* @param int $mode
* @return string
765,7 → 742,6
* Creates the key schedule
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
* @access private
*/
protected function setupKey()
{
1261,9 → 1237,9
$pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
 
// Reorder: odd bytes/even bytes. Push the result in key schedule.
$val1 = ( $cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
$val1 = ( $cp & intval(0xFF000000)) | (($cp << 8) & 0x00FF0000) |
(($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
$val2 = (($cp << 8) & 0xFF000000) | (($cp << 16) & 0x00FF0000) |
$val2 = (($cp << 8) & intval(0xFF000000)) | (($cp << 16) & 0x00FF0000) |
(($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
$keys[$des_round][self::ENCRYPT][ ] = $val1;
$keys[$des_round][self::DECRYPT][$ki - 1] = $val1;
1300,7 → 1276,6
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()
* @access private
*/
protected function setupInlineCrypt()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php
13,8 → 13,6
* DSA, whose format isn't really formally described anywhere, so might as well
* use it to describe this, too.
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
31,9 → 29,7
/**
* "PKCS1" Formatted DH Key Handler
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS1 extends Progenitor
{
40,7 → 36,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
50,7 → 45,7
$key = parent::load($key, $password);
 
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
65,7 → 60,6
/**
* Convert EC parameters to the appropriate format
*
* @access public
* @return string
*/
public static function saveParameters(BigInteger $prime, BigInteger $base, array $options = [])
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php
11,8 → 11,6
* -----BEGIN PRIVATE KEY-----
* -----BEGIN PUBLIC KEY-----
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
30,9 → 28,7
/**
* PKCS#8 Formatted DH Key Handler
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS8 extends Progenitor
{
40,7 → 36,6
* OID Name
*
* @var string
* @access private
*/
const OID_NAME = 'dhKeyAgreement';
 
48,7 → 43,6
* OID Value
*
* @var string
* @access private
*/
const OID_VALUE = '1.2.840.113549.1.3.1';
 
56,7 → 50,6
* Child OIDs loaded
*
* @var bool
* @access private
*/
protected static $childOIDsLoaded = false;
 
63,7 → 56,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
98,8 → 90,7
 
$decoded = ASN1::decodeBER($key[$type]);
switch (true) {
case empty($decoded):
case !is_array($decoded):
case !isset($decoded):
case !isset($decoded[0]['content']):
case !$decoded[0]['content'] instanceof BigInteger:
throw new \RuntimeException('Unable to decode BER of parameters');
112,7 → 103,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $prime
* @param \phpseclib3\Math\BigInteger $base
* @param \phpseclib3\Math\BigInteger $privateKey
136,7 → 126,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $prime
* @param \phpseclib3\Math\BigInteger $base
* @param \phpseclib3\Math\BigInteger $publicKey
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Parameters.php
3,8 → 3,6
/**
* DH Parameters
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* DH Parameters
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Parameters extends DH
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php
3,8 → 3,6
/**
* DH Private Key
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
19,9 → 17,7
/**
* DH Private Key
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrivateKey extends DH
{
31,7 → 27,6
* Private Key
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $privateKey;
 
39,7 → 34,6
* Public Key
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $publicKey;
 
46,7 → 40,6
/**
* Returns the public key
*
* @access public
* @return DH\PublicKey
*/
public function getPublicKey()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PublicKey.php
3,8 → 3,6
/**
* DH Public Key
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
19,9 → 17,7
/**
* DH Public Key
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PublicKey extends DH
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php
16,8 → 16,6
* ?>
* </code>
*
* @category Crypt
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
37,9 → 35,7
/**
* Pure-PHP (EC)DH implementation
*
* @package DH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DH extends AsymmetricKey
{
47,7 → 43,6
* Algorithm Name
*
* @var string
* @access private
*/
const ALGORITHM = 'DH';
 
55,7 → 50,6
* DH prime
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $prime;
 
65,11 → 59,17
* Prime divisor of p-1
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $base;
 
/**
* Public Key
*
* @var \phpseclib3\Math\BigInteger
*/
protected $publicKey;
 
/**
* Create DH parameters
*
* This method is a bit polymorphic. It can take any of the following:
77,7 → 77,6
* - an integer representing the size of the prime in bits (the base is assumed to be 2)
* - a string (eg. diffie-hellman-group14-sha1)
*
* @access public
* @return Parameters
*/
public static function createParameters(...$args)
239,7 → 238,6
*
* @param Parameters $params
* @param int $length optional
* @access public
* @return DH\PrivateKey
*/
public static function createKey(Parameters $params, $length = 0)
265,7 → 263,6
*
* @param PrivateKey|EC $private
* @param PublicKey|BigInteger|string $public
* @access public
* @return mixed
*/
public static function computeSecret($private, $public)
336,10 → 333,8
* OnLoad Handler
*
* @return bool
* @access protected
* @param array $components
*/
protected static function onLoad($components)
protected static function onLoad(array $components)
{
if (!isset($components['privateKey']) && !isset($components['publicKey'])) {
$new = new Parameters();
365,7 → 360,6
/**
* Determines which hashing function should be used
*
* @access public
* @param string $hash
*/
public function withHash($hash)
376,7 → 370,6
/**
* Returns the hash algorithm currently being used
*
* @access public
*/
public function getHash()
{
390,7 → 383,6
* value.
*
* @see self::getPublicKey()
* @access public
* @return mixed
*/
public function getParameters()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php
7,8 → 7,6
*
* Place in $HOME/.ssh/authorized_keys
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
24,9 → 22,7
/**
* OpenSSH Formatted DSA Key Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSH extends Progenitor
{
40,7 → 36,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
70,7 → 65,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
105,7 → 99,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php
19,8 → 19,6
* The DSA private key format seems to have been adapted from the RSA private key format so
* we're just re-using that as the name.
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
29,7 → 27,7
 
namespace phpseclib3\Crypt\DSA\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
38,9 → 36,7
/**
* PKCS#1 Formatted DSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS1 extends Progenitor
{
47,7 → 43,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
57,7 → 52,7
$key = parent::load($key, $password);
 
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
82,7 → 77,6
/**
* Convert DSA parameters to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
99,7 → 93,7
$key = ASN1::encodeDER($key, Maps\DSAParams::MAP);
 
return "-----BEGIN DSA PARAMETERS-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END DSA PARAMETERS-----\r\n";
}
 
106,7 → 100,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
135,7 → 128,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php
15,8 → 15,6
* is specific to private keys it's basically creating a DER-encoded wrapper
* for keys. This just extends that same concept to public keys (much like ssh-keygen)
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
34,9 → 32,7
/**
* PKCS#8 Formatted DSA Key Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS8 extends Progenitor
{
44,7 → 40,6
* OID Name
*
* @var string
* @access private
*/
const OID_NAME = 'id-dsa';
 
52,7 → 47,6
* OID Value
*
* @var string
* @access private
*/
const OID_VALUE = '1.2.840.10040.4.1';
 
60,7 → 54,6
* Child OIDs loaded
*
* @var bool
* @access private
*/
protected static $childOIDsLoaded = false;
 
67,7 → 60,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
92,7 → 84,7
}
 
$decoded = ASN1::decodeBER($key[$type . 'Algorithm']['parameters']->element);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER of parameters');
}
$components = ASN1::asn1map($decoded[0], Maps\DSAParams::MAP);
121,7 → 113,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
147,7 → 138,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php
10,8 → 10,6
*
* PHP version 5
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
27,9 → 25,7
/**
* PuTTY Formatted DSA Key Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PuTTY extends Progenitor
{
37,7 → 33,6
* Public Handler
*
* @var string
* @access private
*/
const PUBLIC_HANDLER = 'phpseclib3\Crypt\DSA\Formats\Keys\OpenSSH';
 
45,7 → 40,6
* Algorithm Identifier
*
* @var array
* @access private
*/
protected static $types = ['ssh-dss'];
 
52,7 → 46,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
75,7 → 68,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
94,13 → 86,12
$public = Strings::packSSH2('iiii', $p, $q, $g, $y);
$private = Strings::packSSH2('i', $x);
 
return self::wrapPrivateKey($public, $private, 'ssh-dsa', $password, $options);
return self::wrapPrivateKey($public, $private, 'ssh-dss', $password, $options);
}
 
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
113,6 → 104,6
throw new \InvalidArgumentException('SSH only supports keys with an N (length of Group Order q) of 160');
}
 
return self::wrapPublicKey(Strings::packSSH2('iiii', $p, $q, $g, $y), 'ssh-dsa');
return self::wrapPublicKey(Strings::packSSH2('iiii', $p, $q, $g, $y), 'ssh-dss');
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php
7,8 → 7,6
*
* Reads and creates arrays as DSA keys
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* Raw DSA Key Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Raw
{
31,7 → 27,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param array $key
* @param string $password optional
* @return array
61,7 → 56,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
78,7 → 72,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php
11,8 → 11,6
*
* PHP version 5
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,7 → 19,6
 
namespace phpseclib3\Crypt\DSA\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\Math\BigInteger;
29,9 → 26,7
/**
* XML Formatted DSA Key Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class XML
{
38,7 → 33,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
71,7 → 65,7
if (!$temp->length) {
continue;
}
$value = new BigInteger(Base64::decode($temp->item(0)->nodeValue), 256);
$value = new BigInteger(Strings::base64_decode($temp->item(0)->nodeValue), 256);
switch ($key) {
case 'p': // a prime modulus meeting the [DSS] requirements
// Parameters P, Q, and G can be public and common to a group of users. They might be known
120,7 → 114,6
*
* See https://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue
*
* @access public
* @param \phpseclib3\Math\BigInteger $p
* @param \phpseclib3\Math\BigInteger $q
* @param \phpseclib3\Math\BigInteger $g
130,10 → 123,10
public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y)
{
return "<DSAKeyValue>\r\n" .
' <P>' . Base64::encode($p->toBytes()) . "</P>\r\n" .
' <Q>' . Base64::encode($q->toBytes()) . "</Q>\r\n" .
' <G>' . Base64::encode($g->toBytes()) . "</G>\r\n" .
' <Y>' . Base64::encode($y->toBytes()) . "</Y>\r\n" .
' <P>' . Strings::base64_encode($p->toBytes()) . "</P>\r\n" .
' <Q>' . Strings::base64_encode($q->toBytes()) . "</Q>\r\n" .
' <G>' . Strings::base64_encode($g->toBytes()) . "</G>\r\n" .
' <Y>' . Strings::base64_encode($y->toBytes()) . "</Y>\r\n" .
'</DSAKeyValue>';
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php
8,8 → 8,6
* Handles signatures in the format described in
* https://tools.ietf.org/html/rfc3279#section-2.2.2
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
25,9 → 23,7
/**
* ASN1 Signature Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ASN1
{
34,7 → 30,6
/**
* Loads a signature
*
* @access public
* @param string $sig
* @return array|bool
*/
56,7 → 51,6
/**
* Returns a signature in the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $r
* @param \phpseclib3\Math\BigInteger $s
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/Raw.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Raw DSA Signature Handler
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Raw extends Progenitor
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php
7,8 → 7,6
*
* Handles signatures in the format used by SSH2
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* SSH2 Signature Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SSH2
{
32,7 → 28,6
/**
* Loads a signature
*
* @access public
* @param string $sig
* @return mixed
*/
60,7 → 55,6
/**
* Returns a signature in the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $r
* @param \phpseclib3\Math\BigInteger $s
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Parameters.php
3,8 → 3,6
/**
* DSA Parameters
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* DSA Parameters
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Parameters extends DSA
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php
3,8 → 3,6
/**
* DSA Private Key
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* DSA Private Key
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrivateKey extends DSA implements Common\PrivateKey
{
33,7 → 29,6
* DSA secret exponent x
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $x;
 
56,7 → 51,6
* without the parameters and the PKCS1 DSA public key format does not include the parameters.
*
* @see self::getPrivateKey()
* @access public
* @return mixed
*/
public function getPublicKey()
78,7 → 72,6
* Create a signature
*
* @see self::verify()
* @access public
* @param string $message
* @return mixed
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PublicKey.php
3,8 → 3,6
/**
* DSA Public Key
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DSA Public Key
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PublicKey extends DSA implements Common\PublicKey
{
32,7 → 28,6
* Verify a signature
*
* @see self::verify()
* @access public
* @param string $message
* @param string $signature
* @return mixed
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php
21,8 → 21,6
* ?>
* </code>
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
41,9 → 39,7
/**
* Pure-PHP FIPS 186-4 compliant implementation of DSA.
*
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DSA extends AsymmetricKey
{
51,7 → 47,6
* Algorithm Name
*
* @var string
* @access private
*/
const ALGORITHM = 'DSA';
 
59,7 → 54,6
* DSA Prime P
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $p;
 
69,7 → 63,6
* Prime divisor of p-1
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $q;
 
77,7 → 70,6
* DSA Group Generator G
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $g;
 
85,7 → 77,6
* DSA public key value y
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $y;
 
93,7 → 84,6
* Signature Format
*
* @var string
* @access private
*/
protected $sigFormat;
 
101,7 → 91,6
* Signature Format (Short)
*
* @var string
* @access private
*/
protected $shortFormat;
 
108,7 → 97,6
/**
* Create DSA parameters
*
* @access public
* @param int $L
* @param int $N
* @return \phpseclib3\Crypt\DSA|bool
186,7 → 174,6
* Returns the private key, from which the publickey can be extracted
*
* @param int[] ...$args
* @access public
* @return DSA\PrivateKey
*/
public static function createKey(...$args)
227,10 → 214,8
* OnLoad Handler
*
* @return bool
* @access protected
* @param array $components
*/
protected static function onLoad($components)
protected static function onLoad(array $components)
{
if (!isset(self::$engines['PHP'])) {
self::useBestEngine();
274,7 → 259,6
*
* More specifically, this L (the length of DSA Prime P) and N (the length of DSA Group Order q)
*
* @access public
* @return array
*/
public function getLength()
287,7 → 271,6
*
* @see self::useInternalEngine()
* @see self::useBestEngine()
* @access public
* @return string
*/
public function getEngine()
306,7 → 289,6
* value.
*
* @see self::getPublicKey()
* @access public
* @return mixed
*/
public function getParameters()
324,7 → 306,6
*
* Valid values are: ASN1, SSH2, Raw
*
* @access public
* @param string $format
*/
public function withSignatureFormat($format)
338,7 → 319,6
/**
* Returns the signature format currently being used
*
* @access public
*/
public function getSignatureFormat()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,27 → 18,11
/**
* Base
*
* @package Prime
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Base
{
/**
* Doubles
*
* @var object[]
*/
protected $doubles;
 
/**
* NAF Points
*
* @var int[]
*/
private $naf;
 
/**
* The Order
*
* @var BigInteger
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php
13,8 → 13,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
30,9 → 28,7
/**
* Curves over y^2 + x*y = x^3 + a*x^2 + b
*
* @package Binary
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Binary extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php
20,8 → 20,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
36,12 → 34,24
/**
* Curves over y^2 = x^3 + b
*
* @package KoblitzPrime
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class KoblitzPrime extends Prime
{
/**
* Basis
*
* @var list<array{a: BigInteger, b: BigInteger}>
*/
protected $basis;
 
/**
* Beta
*
* @var PrimeField\Integer
*/
protected $beta;
 
// don't overwrite setCoefficients() with one that only accepts one parameter so that
// one might be able to switch between KoblitzPrime and Prime more easily (for benchmarking
// purposes).
51,7 → 61,8
*
* Uses a efficiently computable endomorphism to achieve a slight speedup
*
* Adapted from https://git.io/vxbrP
* Adapted from:
* https://github.com/indutny/elliptic/blob/725bd91/lib/elliptic/curve/short.js#L219
*
* @return int[]
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php
16,8 → 16,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2019 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
34,9 → 32,7
/**
* Curves over y^2 = x^3 + a*x + x
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Montgomery extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php
13,8 → 13,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
32,9 → 30,7
/**
* Curves over y^2 = x^3 + a*x + b
*
* @package Prime
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Prime extends Base
{
517,7 → 513,8
/**
* Multiply and Add Points
*
* Adapted from https://git.io/vxPUH
* Adapted from:
* https://github.com/indutny/elliptic/blob/725bd91/lib/elliptic/curve/base.js#L125
*
* @return int[]
*/
643,11 → 640,12
/**
* Precomputes NAF points
*
* Adapted from https://git.io/vxY1f
* Adapted from:
* https://github.com/indutny/elliptic/blob/725bd91/lib/elliptic/curve/base.js#L351
*
* @return int[]
*/
private function getNAFPoints($point, $wnd)
private function getNAFPoints(array $point, $wnd)
{
if (isset($point['naf'])) {
return $point['naf'];
679,7 → 677,8
/**
* Precomputes points in Joint Sparse Form
*
* Adapted from https://git.io/vxrpD
* Adapted from:
* https://github.com/indutny/elliptic/blob/725bd91/lib/elliptic/utils.js#L96
*
* @return int[]
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php
18,8 → 18,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
35,9 → 33,7
/**
* Curves over a*x^2 + y^2 = 1 + d*x^2*y^2
*
* @package Prime
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class TwistedEdwards extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/Curve25519.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2019 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/Curve448.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2019 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/Ed25519.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
158,7 → 156,7
* Used by the various key handlers
*
* @param string $str
* @return \phpseclib3\Math\PrimeField\Integer
* @return array
*/
public function extractSecret($str)
{
181,8 → 179,10
// secret scalar s.
$dA = new BigInteger($h, 256);
 
$dA->secret = $str;
return $dA;
return [
'dA' => $dA,
'secret' => $str
];
}
 
/**
211,7 → 211,7
*/
public function createRandomMultiplier()
{
return $this->extractSecret(Random::string(32));
return $this->extractSecret(Random::string(32))['dA'];
}
 
/**
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/Ed448.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
99,7 → 97,7
* Used by the various key handlers
*
* @param string $str
* @return \phpseclib3\Math\PrimeField\Integer
* @return array
*/
public function extractSecret($str)
{
123,6 → 121,11
// secret scalar s.
$dA = new BigInteger($h, 256);
 
return [
'dA' => $dA,
'secret' => $str
];
 
$dA->secret = $str;
return $dA;
}
152,7 → 155,7
*/
public function createRandomMultiplier()
{
return $this->extractSecret(Random::string(57));
return $this->extractSecret(Random::string(57))['dA'];
}
 
/**
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP160r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP160t1.php
18,8 → 18,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP192r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP192t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP224r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP224t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP256r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP256t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP320r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP384t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP512t1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistb233.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistb409.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk163.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk233.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk283.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk409.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp192.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp224.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp256.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp384.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp521.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistt571.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v3.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime239v1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime239v2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime239v3.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime256v1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp112r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp112r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp128r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp128r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp160k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp160r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp160r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp192k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp192r1.php
7,8 → 7,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp224k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp224r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp256k1.php
7,8 → 7,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp256r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp384r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp521r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect113r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect113r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect131r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect131r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect163k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect163r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect163r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect193r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect193r2.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect233k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect233r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect239k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect283k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect283r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect409k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect409r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect571k1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect571r1.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wiggint on <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,7 → 13,6
 
namespace phpseclib3\Crypt\EC\Formats\Keys;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Binary as BinaryCurve;
29,9 → 26,7
/**
* Generic EC Key Parsing Helper functions
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
trait Common
{
254,8 → 249,8
$curve->setModulo(...$modulo);
$len = ceil($modulo[0] / 8);
$curve->setCoefficients(
Hex::encode($data['curve']['a']),
Hex::encode($data['curve']['b'])
Strings::bin2hex($data['curve']['a']),
Strings::bin2hex($data['curve']['b'])
);
$point = self::extractPoint("\0" . $data['base'], $curve);
$curve->setBasePoint(...$point);
301,7 → 296,7
// the first byte of a bit string represents the number of bits in the last byte that are to be ignored but,
// currently, bit strings wanting a non-zero amount of bits trimmed are not supported
if (($val = Strings::shift($str)) != "\0") {
throw new \UnexpectedValueException('extractPoint expects the first byte to be null - not ' . Hex::encode($val));
throw new \UnexpectedValueException('extractPoint expects the first byte to be null - not ' . Strings::bin2hex($val));
}
if ($str == "\0") {
return [];
319,7 → 314,7
preg_match("#(.)(.{{$order}})(.{{$order}})#s", $str, $matches);
list(, $w, $x, $y) = $matches;
if ($w != "\4") {
throw new \UnexpectedValueException('The first byte of an uncompressed point should be 04 - not ' . Hex::encode($val));
throw new \UnexpectedValueException('The first byte of an uncompressed point should be 04 - not ' . Strings::bin2hex($val));
}
$point = [
$curve->convertInteger(new BigInteger($x, 256)),
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php
0,0 → 1,189
<?php
 
/**
* JSON Web Key (RFC7517 / RFC8037) Formatted EC Handler
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
 
namespace phpseclib3\Crypt\EC\Formats\Keys;
 
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\JWK as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Curves\secp256k1;
use phpseclib3\Crypt\EC\Curves\secp256r1;
use phpseclib3\Crypt\EC\Curves\secp384r1;
use phpseclib3\Crypt\EC\Curves\secp521r1;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Math\BigInteger;
 
/**
* JWK Formatted EC Handler
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class JWK extends Progenitor
{
use Common;
 
/**
* Break a public or private key down into its constituent components
*
* @param string $key
* @param string $password optional
* @return array
*/
public static function load($key, $password = '')
{
$key = parent::load($key, $password);
 
switch ($key->kty) {
case 'EC':
switch ($key->crv) {
case 'P-256':
case 'P-384':
case 'P-521':
case 'secp256k1':
break;
default:
throw new UnsupportedCurveException('Only P-256, P-384, P-521 and secp256k1 curves are accepted (' . $key->crv . ' provided)');
}
break;
case 'OKP':
switch ($key->crv) {
case 'Ed25519':
case 'Ed448':
break;
default:
throw new UnsupportedCurveException('Only Ed25519 and Ed448 curves are accepted (' . $key->crv . ' provided)');
}
break;
default:
throw new \Exception('Only EC and OKP JWK keys are supported');
}
 
$curve = '\phpseclib3\Crypt\EC\Curves\\' . str_replace('P-', 'nistp', $key->crv);
$curve = new $curve();
 
if ($curve instanceof TwistedEdwardsCurve) {
$QA = self::extractPoint(Strings::base64url_decode($key->x), $curve);
if (!isset($key->d)) {
return compact('curve', 'QA');
}
$arr = $curve->extractSecret(Strings::base64url_decode($key->d));
return compact('curve', 'QA') + $arr;
}
 
$QA = [
$curve->convertInteger(new BigInteger(Strings::base64url_decode($key->x), 256)),
$curve->convertInteger(new BigInteger(Strings::base64url_decode($key->y), 256))
];
 
if (!$curve->verifyPoint($QA)) {
throw new \RuntimeException('Unable to verify that point exists on curve');
}
 
if (!isset($key->d)) {
return compact('curve', 'QA');
}
 
$dA = new BigInteger(Strings::base64url_decode($key->d), 256);
 
$curve->rangeCheck($dA);
 
return compact('curve', 'dA', 'QA');
}
 
/**
* Returns the alias that corresponds to a curve
*
* @return string
*/
private static function getAlias(BaseCurve $curve)
{
switch (true) {
case $curve instanceof secp256r1:
return 'P-256';
case $curve instanceof secp384r1:
return 'P-384';
case $curve instanceof secp521r1:
return 'P-521';
case $curve instanceof secp256k1:
return 'secp256k1';
}
 
$reflect = new \ReflectionClass($curve);
$curveName = $reflect->isFinal() ?
$reflect->getParentClass()->getShortName() :
$reflect->getShortName();
throw new UnsupportedCurveException("$curveName is not a supported curve");
}
 
/**
* Return the array superstructure for an EC public key
*
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return array
*/
private static function savePublicKeyHelper(BaseCurve $curve, array $publicKey)
{
if ($curve instanceof TwistedEdwardsCurve) {
return [
'kty' => 'OKP',
'crv' => $curve instanceof Ed25519 ? 'Ed25519' : 'Ed448',
'x' => Strings::base64url_encode($curve->encodePoint($publicKey))
];
}
 
return [
'kty' => 'EC',
'crv' => self::getAlias($curve),
'x' => Strings::base64url_encode($publicKey[0]->toBytes()),
'y' => Strings::base64url_encode($publicKey[1]->toBytes())
];
}
 
/**
* Convert an EC public key to the appropriate format
*
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
*/
public static function savePublicKey(BaseCurve $curve, array $publicKey, array $options = [])
{
$key = self::savePublicKeyHelper($curve, $publicKey);
 
return self::wrapKey($key, $options);
}
 
/**
* Convert a private key to the appropriate format.
*
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $secret = null, $password = '', array $options = [])
{
$key = self::savePublicKeyHelper($curve, $publicKey);
$key['d'] = $curve instanceof TwistedEdwardsCurve ? $secret : $privateKey->toBytes();
$key['d'] = Strings::base64url_encode($key['d']);
 
return self::wrapKey($key, $options);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php
12,8 → 12,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
31,9 → 29,7
/**
* Montgomery Curve Private Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class MontgomeryPrivate
{
40,7 → 36,6
/**
* Is invisible flag
*
* @access private
*/
const IS_INVISIBLE = true;
 
47,7 → 42,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
77,7 → 71,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
90,14 → 83,14
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, MontgomeryCurve $curve, array $publicKey, $password = '')
public static function savePrivateKey(BigInteger $privateKey, MontgomeryCurve $curve, array $publicKey, $secret = null, $password = '')
{
if (!empty($password) && is_string($password)) {
throw new UnsupportedFormatException('MontgomeryPrivate private keys do not support encryption');
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Montgomery Public Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class MontgomeryPublic
{
32,7 → 28,6
/**
* Is invisible flag
*
* @access private
*/
const IS_INVISIBLE = true;
 
39,7 → 34,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
66,7 → 60,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php
7,8 → 7,6
*
* Place in $HOME/.ssh/authorized_keys
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
27,9 → 25,7
/**
* OpenSSH Formatted EC Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSH extends Progenitor
{
50,7 → 46,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
139,7 → 134,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
177,21 → 171,21
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = '', array $options = [])
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $secret = null, $password = '', array $options = [])
{
if ($curve instanceof Ed25519) {
if (!isset($privateKey->secret)) {
if (!isset($secret)) {
throw new \RuntimeException('Private Key does not have a secret set');
}
if (strlen($privateKey->secret) != 32) {
if (strlen($secret) != 32) {
throw new \RuntimeException('Private Key secret is not of the correct length');
}
 
198,7 → 192,7
$pubKey = $curve->encodePoint($publicKey);
 
$publicKey = Strings::packSSH2('ss', 'ssh-ed25519', $pubKey);
$privateKey = Strings::packSSH2('sss', 'ssh-ed25519', $pubKey, $privateKey->secret . $pubKey);
$privateKey = Strings::packSSH2('sss', 'ssh-ed25519', $pubKey, $secret . $pubKey);
 
return self::wrapPrivateKey($publicKey, $privateKey, $password, $options);
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php
17,8 → 17,6
* use it to describe this, too. PKCS1 is easier to remember than RFC5915, after
* all. I suppose this could also be named IETF but idk
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
27,7 → 25,6
 
namespace phpseclib3\Crypt\EC\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
41,9 → 38,7
/**
* "PKCS1" (RFC5915) Formatted EC Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS1 extends Progenitor
{
52,7 → 47,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
71,7 → 65,7
preg_match('#-*BEGIN EC PRIVATE KEY-*[^-]*-*END EC PRIVATE KEY-*#s', $key, $matches);
$decoded = parent::load($matches[0], $password);
$decoded = ASN1::decodeBER($decoded);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
87,7 → 81,7
preg_match('#-*BEGIN EC PARAMETERS-*[^-]*-*END EC PARAMETERS-*#s', $key, $matches);
$decoded = parent::load($matches[0], '');
$decoded = ASN1::decodeBER($decoded);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
$ecParams = ASN1::asn1map($decoded[0], Maps\ECParameters::MAP);
118,7 → 112,7
$key = parent::load($key, $password);
 
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
148,7 → 142,6
/**
* Convert EC parameters to the appropriate format
*
* @access public
* @return string
*/
public static function saveParameters(BaseCurve $curve, array $options = [])
162,7 → 155,7
$key = self::encodeParameters($curve, false, $options);
 
return "-----BEGIN EC PARAMETERS-----\r\n" .
chunk_split(Base64::encode($key), 64) .
chunk_split(Strings::base64_encode($key), 64) .
"-----END EC PARAMETERS-----\r\n";
}
 
169,15 → 162,15
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = '', array $options = [])
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $secret = null, $password = '', array $options = [])
{
self::initialize_static_variables();
 
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php
15,8 → 15,6
* is specific to private keys it's basically creating a DER-encoded wrapper
* for keys. This just extends that same concept to public keys (much like ssh-keygen)
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
40,9 → 38,7
/**
* PKCS#8 Formatted EC Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS8 extends Progenitor
{
52,7 → 48,6
* OID Name
*
* @var array
* @access private
*/
const OID_NAME = ['id-ecPublicKey', 'id-Ed25519', 'id-Ed448'];
 
60,7 → 55,6
* OID Value
*
* @var string
* @access private
*/
const OID_VALUE = ['1.2.840.10045.2.1', '1.3.101.112', '1.3.101.113'];
 
67,7 → 61,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
105,6 → 98,9
}
 
$decoded = ASN1::decodeBER($key[$type . 'Algorithm']['parameters']->element);
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
$params = ASN1::asn1map($decoded[0], Maps\ECParameters::MAP);
if (!$params) {
throw new \RuntimeException('Unable to decode the parameters using Maps\ECParameters');
120,6 → 116,9
}
 
$decoded = ASN1::decodeBER($key['privateKey']);
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
$key = ASN1::asn1map($decoded[0], Maps\ECPrivateKey::MAP);
if (isset($key['parameters']) && $params != $key['parameters']) {
throw new \RuntimeException('The PKCS8 parameter field does not match the private key parameter field');
151,7 → 150,9
if (substr($key['privateKey'], 0, 2) != "\x04\x20") {
throw new \RuntimeException('The first two bytes of the private key field should be 0x0420');
}
$components['dA'] = $components['curve']->extractSecret(substr($key['privateKey'], 2));
$arr = $components['curve']->extractSecret(substr($key['privateKey'], 2));
$components['dA'] = $arr['dA'];
$components['secret'] = $arr['secret'];
}
 
if (isset($key['publicKey'])) {
172,7 → 173,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
204,15 → 204,15
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = '', array $options = [])
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $secret = null, $password = '', array $options = [])
{
self::initialize_static_variables();
 
222,7 → 222,7
 
if ($curve instanceof TwistedEdwardsCurve) {
return self::wrapPrivateKey(
"\x04\x20" . $privateKey->secret,
"\x04\x20" . $secret,
[],
null,
$password,
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,7 → 13,6
 
namespace phpseclib3\Crypt\EC\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
25,9 → 22,7
/**
* PuTTY Formatted EC Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PuTTY extends Progenitor
{
37,7 → 32,6
* Public Handler
*
* @var string
* @access private
*/
const PUBLIC_HANDLER = 'phpseclib3\Crypt\EC\Formats\Keys\OpenSSH';
 
45,7 → 39,6
* Supported Key Types
*
* @var array
* @access private
*/
protected static $types = [
'ecdsa-sha2-nistp256',
57,7 → 50,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
71,7 → 63,7
 
$private = $components['private'];
 
$temp = Base64::encode(Strings::packSSH2('s', $components['type']) . $components['public']);
$temp = Strings::base64_encode(Strings::packSSH2('s', $components['type']) . $components['public']);
$components = OpenSSH::load($components['type'] . ' ' . $temp . ' ' . $components['comment']);
 
if ($components['curve'] instanceof TwistedEdwardsCurve) {
78,7 → 70,9
if (Strings::shift($private, 4) != "\0\0\0\x20") {
throw new \RuntimeException('Length of ssh-ed25519 key should be 32');
}
$components['dA'] = $components['curve']->extractSecret($private);
$arr = $components['curve']->extractSecret($private);
$components['dA'] = $arr['dA'];
$components['secret'] = $arr['secret'];
} else {
list($components['dA']) = Strings::unpackSSH2('i', $private);
$components['curve']->rangeCheck($components['dA']);
90,21 → 84,21
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = false, array $options = [])
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $secret = null, $password = false, array $options = [])
{
self::initialize_static_variables();
 
$public = explode(' ', OpenSSH::savePublicKey($curve, $publicKey));
$name = $public[0];
$public = Base64::decode($public[1]);
$public = Strings::base64_decode($public[1]);
list(, $length) = unpack('N', Strings::shift($public, 4));
Strings::shift($public, $length);
 
118,7 → 112,7
}
 
$private = $curve instanceof TwistedEdwardsCurve ?
Strings::packSSH2('s', $privateKey->secret) :
Strings::packSSH2('s', $secret) :
Strings::packSSH2('s', $private);
 
return self::wrapPrivateKey($public, $private, $name, $password, $options);
127,7 → 121,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib3\Math\Common\FiniteField[] $publicKey
* @return string
136,7 → 129,7
{
$public = explode(' ', OpenSSH::savePublicKey($curve, $publicKey));
$type = $public[0];
$public = Base64::decode($public[1]);
$public = Strings::base64_decode($public[1]);
list(, $length) = unpack('N', Strings::shift($public, 4));
Strings::shift($public, $length);
 
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php
10,8 → 10,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,7 → 18,6
 
namespace phpseclib3\Crypt\EC\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
33,9 → 30,7
/**
* XML Formatted EC Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class XML
{
58,7 → 53,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
120,7 → 114,7
* @param bool $decode optional
* @return \DOMNodeList
*/
private static function query($xpath, $name, $error = null, $decode = true)
private static function query(\DOMXPath $xpath, $name, $error = null, $decode = true)
{
$query = '/';
$names = explode('/', $name);
170,7 → 164,7
*/
private static function decodeValue($value)
{
return Base64::decode(str_replace(["\r", "\n", ' ', "\t"], '', $value));
return Strings::base64_decode(str_replace(["\r", "\n", ' ', "\t"], '', $value));
}
 
/**
406,7 → 400,7
 
return '<' . $pre . 'ECDSAKeyValue xmlns' . $post . '="http://www.w3.org/2009/xmldsig11#">' . "\r\n" .
self::encodeXMLParameters($curve, $pre, $options) . "\r\n" .
'<' . $pre . 'PublicKey>' . Base64::encode($publicKey) . '</' . $pre . 'PublicKey>' . "\r\n" .
'<' . $pre . 'PublicKey>' . Strings::base64_encode($publicKey) . '</' . $pre . 'PublicKey>' . "\r\n" .
'</' . $pre . 'ECDSAKeyValue>';
}
 
471,7 → 465,7
switch ($temp['fieldID']['fieldType']) {
case 'prime-field':
$xml .= '<' . $pre . 'Prime>' . "\r\n" .
'<' . $pre . 'P>' . Base64::encode($temp['fieldID']['parameters']->toBytes()) . '</' . $pre . 'P>' . "\r\n" .
'<' . $pre . 'P>' . Strings::base64_encode($temp['fieldID']['parameters']->toBytes()) . '</' . $pre . 'P>' . "\r\n" .
'</' . $pre . 'Prime>' . "\r\n" ;
break;
default:
479,11 → 473,11
}
$xml .= '</' . $pre . 'FieldID>' . "\r\n" .
'<' . $pre . 'Curve>' . "\r\n" .
'<' . $pre . 'A>' . Base64::encode($temp['curve']['a']) . '</' . $pre . 'A>' . "\r\n" .
'<' . $pre . 'B>' . Base64::encode($temp['curve']['b']) . '</' . $pre . 'B>' . "\r\n" .
'<' . $pre . 'A>' . Strings::base64_encode($temp['curve']['a']) . '</' . $pre . 'A>' . "\r\n" .
'<' . $pre . 'B>' . Strings::base64_encode($temp['curve']['b']) . '</' . $pre . 'B>' . "\r\n" .
'</' . $pre . 'Curve>' . "\r\n" .
'<' . $pre . 'Base>' . Base64::encode($temp['base']) . '</' . $pre . 'Base>' . "\r\n" .
'<' . $pre . 'Order>' . Base64::encode($temp['order']) . '</' . $pre . 'Order>' . "\r\n" .
'<' . $pre . 'Base>' . Strings::base64_encode($temp['base']) . '</' . $pre . 'Base>' . "\r\n" .
'<' . $pre . 'Order>' . Strings::base64_encode($temp['order']) . '</' . $pre . 'Order>' . "\r\n" .
'</' . $pre . 'ECParameters>';
return $xml;
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php
9,8 → 9,6
*
* PHP version 5
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
26,9 → 24,7
/**
* libsodium Key Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class libsodium
{
37,7 → 33,6
/**
* Is invisible flag
*
* @access private
*/
const IS_INVISIBLE = true;
 
44,7 → 39,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
73,7 → 67,9
$curve = new Ed25519();
$components = ['curve' => $curve];
if (isset($private)) {
$components['dA'] = $curve->extractSecret($private);
$arr = $curve->extractSecret($private);
$components['dA'] = $arr['dA'];
$components['secret'] = $arr['secret'];
}
$components['QA'] = isset($public) ?
self::extractPoint($public, $curve) :
85,7 → 81,6
/**
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
98,24 → 93,24
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $privateKey
* @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
* @return string
*/
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, $password = '')
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, $secret = null, $password = '')
{
if (!isset($privateKey->secret)) {
if (!isset($secret)) {
throw new \RuntimeException('Private Key does not have a secret set');
}
if (strlen($privateKey->secret) != 32) {
if (strlen($secret) != 32) {
throw new \RuntimeException('Private Key secret is not of the correct length');
}
if (!empty($password) && is_string($password)) {
throw new UnsupportedFormatException('libsodium private keys do not support encryption');
}
return $privateKey->secret . $curve->encodePoint($publicKey);
return $secret . $curve->encodePoint($publicKey);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php
8,8 → 8,6
* Handles signatures in the format described in
* https://tools.ietf.org/html/rfc3279#section-2.2.3
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
25,9 → 23,7
/**
* ASN1 Signature Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ASN1
{
34,7 → 30,6
/**
* Loads a signature
*
* @access public
* @param string $sig
* @return array
*/
56,7 → 51,6
/**
* Returns a signature in the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $r
* @param \phpseclib3\Math\BigInteger $s
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/Raw.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package DSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Raw DSA Signature Handler
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Raw extends Progenitor
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php
7,8 → 7,6
*
* Handles signatures in the format used by SSH2
*
* @category Crypt
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* SSH2 Signature Handler
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SSH2
{
32,7 → 28,6
/**
* Loads a signature
*
* @access public
* @param string $sig
* @return mixed
*/
71,7 → 66,6
/**
* Returns a signature in the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $r
* @param \phpseclib3\Math\BigInteger $s
* @param string $curve
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Parameters.php
3,8 → 3,6
/**
* EC Parameters
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* EC Parameters
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Parameters extends EC
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php
3,8 → 3,6
/**
* EC Private Key
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
29,9 → 27,7
/**
* EC Private Key
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrivateKey extends EC implements Common\PrivateKey
{
49,6 → 45,11
protected $dA;
 
/**
* @var string
*/
protected $secret;
 
/**
* Multiplies an encoded point by the private key
*
* Used by ECDH
85,7 → 86,6
* Create a signature
*
* @see self::verify()
* @access public
* @param string $message
* @return mixed
*/
117,7 → 117,7
$curve = $this->curve;
$hash = new Hash($curve::HASH);
 
$secret = substr($hash->hash($this->dA->secret), $curve::SIZE);
$secret = substr($hash->hash($this->secret), $curve::SIZE);
 
if ($curve instanceof Ed25519) {
$dom = !isset($this->context) ? '' :
222,7 → 222,7
{
$type = self::validatePlugin('Keys', $type, 'savePrivateKey');
 
return $type::savePrivateKey($this->dA, $this->curve, $this->QA, $this->password, $options);
return $type::savePrivateKey($this->dA, $this->curve, $this->QA, $this->secret, $this->password, $options);
}
 
/**
229,7 → 229,6
* Returns the public key
*
* @see self::getPrivateKey()
* @access public
* @return mixed
*/
public function getPublicKey()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PublicKey.php
3,8 → 3,6
/**
* EC Public Key
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
28,9 → 26,7
/**
* EC Public Key
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PublicKey extends EC implements Common\PublicKey
{
40,7 → 36,6
* Verify a signature
*
* @see self::verify()
* @access public
* @param string $message
* @param string $signature
* @return mixed
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php
21,8 → 21,6
* ?>
* </code>
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
51,9 → 49,7
/**
* Pure-PHP implementation of EC.
*
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EC extends AsymmetricKey
{
61,7 → 57,6
* Algorithm Name
*
* @var string
* @access private
*/
const ALGORITHM = 'EC';
 
83,7 → 78,6
* Signature Format
*
* @var string
* @access private
*/
protected $format;
 
91,7 → 85,6
* Signature Format (Short)
*
* @var string
* @access private
*/
protected $shortFormat;
 
131,9 → 124,15
protected $context;
 
/**
* Signature Format
*
* @var string
*/
protected $sigFormat;
 
/**
* Create public / private key pair.
*
* @access public
* @param string $curve
* @return \phpseclib3\Crypt\EC\PrivateKey
*/
178,7 → 177,13
$reflect->getShortName();
 
$curve = new $curve();
if ($curve instanceof TwistedEdwardsCurve) {
$arr = $curve->extractSecret(Random::string($curve instanceof Ed448 ? 57 : 32));
$privatekey->dA = $dA = $arr['dA'];
$privatekey->secret = $arr['secret'];
} else {
$privatekey->dA = $dA = $curve->createRandomMultiplier();
}
if ($curve instanceof Curve25519 && self::$engines['libsodium']) {
//$r = pack('H*', '0900000000000000000000000000000000000000000000000000000000000000');
//$QA = sodium_crypto_scalarmult($dA->toBytes(), $r);
207,10 → 212,8
* OnLoad Handler
*
* @return bool
* @access protected
* @param array $components
*/
protected static function onLoad($components)
protected static function onLoad(array $components)
{
if (!isset(self::$engines['PHP'])) {
self::useBestEngine();
230,6 → 233,7
 
if (isset($components['dA'])) {
$new->dA = $components['dA'];
$new->secret = $components['secret'];
}
 
if ($new->curve instanceof TwistedEdwardsCurve) {
257,7 → 261,6
*
* Returns a string if it's a named curve, an array if not
*
* @access public
* @return string|array
*/
public function getCurve()
305,7 → 308,6
* elliptic curve domain parameters defines a group of order n generated
* by a base point P"
*
* @access public
* @return int
*/
public function getLength()
318,7 → 320,6
*
* @see self::useInternalEngine()
* @see self::useBestEngine()
* @access public
* @return string
*/
public function getEngine()
357,7 → 358,6
* Returns the parameters
*
* @see self::getPublicKey()
* @access public
* @param string $type optional
* @return mixed
*/
377,7 → 377,6
*
* Valid values are: ASN1, SSH2, Raw
*
* @access public
* @param string $format
*/
public function withSignatureFormat($format)
395,7 → 394,6
/**
* Returns the signature format currently being used
*
* @access public
*/
public function getSignatureFormat()
{
409,7 → 407,6
*
* @see self::sign()
* @see self::verify()
* @access public
* @param string $context optional
*/
public function withContext($context = null)
436,7 → 433,6
/**
* Returns the signature format currently being used
*
* @access public
*/
public function getContext()
{
446,7 → 442,6
/**
* Determines which hashing function should be used
*
* @access public
* @param string $hash
*/
public function withHash($hash)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
21,8 → 21,6
* ?>
* </code>
*
* @category Crypt
* @package Hash
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @author Andreas Fischer <bantu@phpbb.com>
40,10 → 38,8
use phpseclib3\Math\PrimeField;
 
/**
* @package Hash
* @author Jim Wigginton <terrafrost@php.net>
* @author Andreas Fischer <bantu@phpbb.com>
* @access public
*/
class Hash
{
50,7 → 46,6
/**
* Padding Types
*
* @access private
*/
const PADDING_KECCAK = 1;
 
57,7 → 52,6
/**
* Padding Types
*
* @access private
*/
const PADDING_SHA3 = 2;
 
64,7 → 58,6
/**
* Padding Types
*
* @access private
*/
const PADDING_SHAKE = 3;
 
74,7 → 67,6
* Only used by SHA3
*
* @var int
* @access private
*/
private $paddingType = 0;
 
83,7 → 75,6
*
* @see self::setHash()
* @var int
* @access private
*/
private $hashParam;
 
92,7 → 83,6
*
* @see self::setHash()
* @var int
* @access private
*/
private $length;
 
101,7 → 91,6
*
* @see self::setHash()
* @var string
* @access private
*/
private $algo;
 
110,7 → 99,6
*
* @see self::setKey()
* @var string
* @access private
*/
private $key = false;
 
119,7 → 107,6
*
* @see self::setNonce()
* @var string
* @access private
*/
private $nonce = false;
 
127,7 → 114,6
* Hash Parameters
*
* @var array
* @access private
*/
private $parameters = [];
 
136,7 → 122,6
*
* @see self::_computeKey()
* @var string
* @access private
*/
private $computedKey = false;
 
147,7 → 132,6
*
* @see self::hash()
* @var string
* @access private
*/
private $opad;
 
158,7 → 142,6
*
* @see self::hash()
* @var string
* @access private
*/
private $ipad;
 
169,7 → 152,6
*
* @see self::hash()
* @var boolean
* @access private
*/
private $recomputeAESKey;
 
178,7 → 160,6
*
* @see self::hash()
* @var \phpseclib3\Crypt\AES
* @access private
*/
private $c;
 
187,10 → 168,16
*
* @see self::hash()
* @var string
* @access private
*/
private $pad;
 
/**
* Block Size
*
* @var int
*/
private $blockSize;
 
/**#@+
* UMAC variables
*
211,7 → 198,6
* Default Constructor.
*
* @param string $hash
* @access public
*/
public function __construct($hash = 'sha256')
{
223,7 → 209,6
*
* Keys can be of any length.
*
* @access public
* @param string $key
*/
public function setKey($key = false)
238,7 → 223,6
*
* Keys can be of any length.
*
* @access public
* @param string $nonce
*/
public function setNonce($nonce = false)
264,7 → 248,6
* when doing an HMAC multiple times it's faster to compute the hash once instead of computing it during
* every call
*
* @access private
*/
private function computeKey()
{
288,7 → 271,6
*
* As set by the constructor or by the setHash() method.
*
* @access public
* @return string
*/
public function getHash()
299,7 → 281,6
/**
* Sets the hash function.
*
* @access public
* @param string $hash
*/
public function setHash($hash)
594,10 → 575,10
// For the last chunk: pad to 32-byte boundary, endian-adjust,
// NH hash and add bit-length. Concatenate the result to Y.
//
$length = strlen($m[$i]);
$length = count($m) ? strlen($m[$i]) : 0;
$pad = 32 - ($length % 32);
$pad = max(32, $length + $pad % 32);
$m[$i] = str_pad($m[$i], $pad, "\0"); // zeropad
$m[$i] = str_pad(isset($m[$i]) ? $m[$i] : '', $pad, "\0"); // zeropad
$m[$i] = pack('N*', ...unpack('V*', $m[$i])); // ENDIAN-SWAP
 
$y .= static::nh($k, $m[$i], new BigInteger($length * 8));
793,7 → 774,6
/**
* Compute the Hash / HMAC / UMAC.
*
* @access public
* @param string $text
* @return string
*/
882,7 → 862,6
/**
* Returns the hash length (in bits)
*
* @access public
* @return int
*/
public function getLength()
893,7 → 872,6
/**
* Returns the hash length (in bytes)
*
* @access public
* @return int
*/
public function getLengthInBytes()
904,7 → 882,6
/**
* Returns the block length (in bits)
*
* @access public
* @return int
*/
public function getBlockLength()
915,7 → 892,6
/**
* Returns the block length (in bytes)
*
* @access public
* @return int
*/
public function getBlockLengthInBytes()
926,7 → 902,6
/**
* Pads SHA3 based on the mode
*
* @access private
* @param int $padLength
* @param int $padType
* @return string
969,7 → 944,6
* capacity c". This is relevant because, altho the KECCAK standard defines a mode
* (KECCAK-f[800]) designed for 32-bit machines that mode is incompatible with SHA3
*
* @access private
* @param string $p
* @param int $c
* @param int $r
1030,7 → 1004,6
/**
* 32-bit block processing method for SHA3
*
* @access private
* @param array $s
*/
private static function processSHA3Block32(&$s)
1140,7 → 1113,6
/**
* Rotate 32-bit int
*
* @access private
* @param array $x
* @param int $shift
*/
1162,7 → 1134,6
/**
* Pure-PHP 64-bit implementation of SHA3
*
* @access private
* @param string $p
* @param int $c
* @param int $r
1222,7 → 1193,6
/**
* 64-bit block processing method for SHA3
*
* @access private
* @param array $s
*/
private static function processSHA3Block64(&$s)
1309,7 → 1279,6
/**
* Rotate 64-bit int
*
* @access private
* @param int $x
* @param int $shift
*/
1321,7 → 1290,6
/**
* Pure-PHP implementation of SHA512
*
* @access private
* @param string $m
* @param array $hash
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/PublicKeyLoader.php
5,8 → 5,6
*
* Returns a PublicKey or PrivateKey object.
*
* @category Crypt
* @package PublicKeyLoader
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
24,9 → 22,7
/**
* PublicKeyLoader
*
* @package Common
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PublicKeyLoader
{
34,7 → 30,6
* Loads a public or private key
*
* @return AsymmetricKey
* @access public
* @param string|array $key
* @param string $password optional
*/
72,7 → 67,6
* Loads a private key
*
* @return PrivateKey
* @access public
* @param string|array $key
* @param string $password optional
*/
89,7 → 83,6
* Loads a public key
*
* @return PublicKey
* @access public
* @param string|array $key
*/
public static function loadPublicKey($key)
105,7 → 98,6
* Loads parameters
*
* @return AsymmetricKey
* @access public
* @param string|array $key
*/
public static function loadParameters($key)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php
26,8 → 26,6
* ?>
* </code>
*
* @category Crypt
* @package RC2
* @author Patrick Monnerat <pm@datasphere.ch>
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
41,8 → 39,6
/**
* Pure-PHP implementation of RC2.
*
* @package RC2
* @access public
*/
class RC2 extends BlockCipher
{
51,7 → 47,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 8;
 
61,7 → 56,6
* @see \phpseclib3\Crypt\Common\SymmetricKey::key
* @see self::setKey()
* @var string
* @access private
*/
protected $key;
 
73,25 → 67,14
* @see self::encrypt()
* @see self::decrypt()
* @var string
* @access private
*/
private $orig_key;
 
/**
* Don't truncate / null pad key
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::clearBuffers()
* @var bool
* @access private
*/
private $skip_key_adjustment = true;
 
/**
* Key Length (in bytes)
*
* @see \phpseclib3\Crypt\RC2::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 16; // = 128 bits
 
100,7 → 83,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'rc2';
 
109,7 → 91,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
* @var int
* @access private
*/
protected $cfb_init_len = 500;
 
123,7 → 104,6
* @see self::setKeyLength()
* @see self::setKey()
* @var int
* @access private
*/
private $default_key_length = 1024;
 
135,7 → 115,6
* @see self::isValidEnine()
* @see self::setKey()
* @var int
* @access private
*/
private $current_key_length;
 
144,7 → 123,6
*
* @see self::setupKey()
* @var array
* @access private
*/
private $keys;
 
154,7 → 132,6
*
* @see self::setKey()
* @var array
* @access private
*/
private static $pitable = [
0xD9, 0x78, 0xF9, 0xC4, 0x19, 0xDD, 0xB5, 0xED,
228,7 → 205,6
*
* @see self::setKey()
* @var array
* @access private
*/
private static $invpitable = [
0xD1, 0xDA, 0xB9, 0x6F, 0x9C, 0xC8, 0x78, 0x66,
269,7 → 245,6
* Default Constructor.
*
* @param string $mode
* @access public
* @throws \InvalidArgumentException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
288,7 → 263,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
312,7 → 286,6
* Calling this function after setting the key has no effect until the next
* \phpseclib3\Crypt\RC2::setKey() call.
*
* @access public
* @param int $length in bits
* @throws \LengthException if the key length isn't supported
*/
329,7 → 302,6
/**
* Returns the current key length
*
* @access public
* @return int
*/
public function getKeyLength()
346,7 → 318,6
* it is empty.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKey()
* @access public
* @param string $key
* @param int|boolean $t1 optional Effective key length in bits.
* @throws \LengthException if the key length isn't supported
408,7 → 379,6
* Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::encrypt, with some additional OpenSSL handling code
*
* @see self::decrypt()
* @access public
* @param string $plaintext
* @return string $ciphertext
*/
431,7 → 401,6
* Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::decrypt, with some additional OpenSSL handling code
*
* @see self::encrypt()
* @access public
* @param string $ciphertext
* @return string $plaintext
*/
453,7 → 422,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @access private
* @param string $in
* @return string
*/
498,7 → 466,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
* @access private
* @param string $in
* @return string
*/
542,7 → 509,6
* Creates the key schedule
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
* @access private
*/
protected function setupKey()
{
563,7 → 529,6
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()
* @access private
*/
protected function setupInlineCrypt()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php
34,8 → 34,6
* ?>
* </code>
*
* @category Crypt
* @package RC4
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
49,20 → 47,16
/**
* Pure-PHP implementation of RC4.
*
* @package RC4
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class RC4 extends StreamCipher
{
/**
* @access private
* @see \phpseclib3\Crypt\RC4::_crypt()
*/
const ENCRYPT = 0;
 
/**
* @access private
* @see \phpseclib3\Crypt\RC4::_crypt()
*/
const DECRYPT = 1;
72,7 → 66,6
*
* @see \phpseclib3\Crypt\RC4::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 128; // = 1024 bits
 
81,7 → 74,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'arcfour';
 
90,7 → 82,6
*
* @see self::setKey()
* @var string
* @access private
*/
protected $key;
 
99,7 → 90,6
*
* @see self::setKey()
* @var array
* @access private
*/
private $stream;
 
110,7 → 100,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
146,7 → 135,6
*
* Keys can be between 1 and 256 bytes long.
*
* @access public
* @param int $length
* @throws \LengthException if the key length is invalid
*/
166,7 → 154,6
*
* Keys can be between 1 and 256 bytes long.
*
* @access public
* @param string $key
*/
public function setKey($key)
184,7 → 171,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
* @see self::crypt()
* @access public
* @param string $plaintext
* @return string $ciphertext
*/
204,7 → 190,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see self::crypt()
* @access public
* @param string $ciphertext
* @return string $plaintext
*/
219,7 → 204,6
/**
* Encrypts a block
*
* @access private
* @param string $in
*/
protected function encryptBlock($in)
230,7 → 214,6
/**
* Decrypts a block
*
* @access private
* @param string $in
*/
protected function decryptBlock($in)
242,7 → 225,6
* Setup the key (expansion)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey()
* @access private
*/
protected function setupKey()
{
270,7 → 252,6
*
* @see self::encrypt()
* @see self::decrypt()
* @access private
* @param string $text
* @param int $mode
* @return string $text
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php
0,0 → 1,142
<?php
 
/**
* JSON Web Key (RFC7517) Formatted RSA Handler
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
 
namespace phpseclib3\Crypt\RSA\Formats\Keys;
 
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\JWK as Progenitor;
use phpseclib3\Math\BigInteger;
 
/**
* JWK Formatted RSA Handler
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class JWK extends Progenitor
{
/**
* Break a public or private key down into its constituent components
*
* @param string $key
* @param string $password optional
* @return array
*/
public static function load($key, $password = '')
{
$key = parent::load($key, $password);
 
if ($key->kty != 'RSA') {
throw new \RuntimeException('Only RSA JWK keys are supported');
}
 
$count = $publicCount = 0;
$vars = ['n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi'];
foreach ($vars as $var) {
if (!isset($key->$var) || !is_string($key->$var)) {
continue;
}
$count++;
$value = new BigInteger(Strings::base64url_decode($key->$var), 256);
switch ($var) {
case 'n':
$publicCount++;
$components['modulus'] = $value;
break;
case 'e':
$publicCount++;
$components['publicExponent'] = $value;
break;
case 'd':
$components['privateExponent'] = $value;
break;
case 'p':
$components['primes'][1] = $value;
break;
case 'q':
$components['primes'][2] = $value;
break;
case 'dp':
$components['exponents'][1] = $value;
break;
case 'dq':
$components['exponents'][2] = $value;
break;
case 'qi':
$components['coefficients'][2] = $value;
}
}
 
if ($count == count($vars)) {
return $components + ['isPublicKey' => false];
}
 
if ($count == 2 && $publicCount == 2) {
return $components + ['isPublicKey' => true];
}
 
throw new \UnexpectedValueException('Key does not have an appropriate number of RSA parameters');
}
 
/**
* Convert a private key to the appropriate format.
*
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
* @param string $password optional
* @param array $options optional
* @return string
*/
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = [])
{
if (count($primes) != 2) {
throw new \InvalidArgumentException('JWK does not support multi-prime RSA keys');
}
 
$key = [
'kty' => 'RSA',
'n' => Strings::base64url_encode($n->toBytes()),
'e' => Strings::base64url_encode($e->toBytes()),
'd' => Strings::base64url_encode($d->toBytes()),
'p' => Strings::base64url_encode($primes[1]->toBytes()),
'q' => Strings::base64url_encode($primes[2]->toBytes()),
'dp' => Strings::base64url_encode($exponents[1]->toBytes()),
'dq' => Strings::base64url_encode($exponents[2]->toBytes()),
'qi' => Strings::base64url_encode($coefficients[2]->toBytes())
];
 
return self::wrapKey($key, $options);
}
 
/**
* Convert a public key to the appropriate format
*
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param array $options optional
* @return string
*/
public static function savePublicKey(BigInteger $n, BigInteger $e, array $options = [])
{
$key = [
'kty' => 'RSA',
'n' => Strings::base64url_encode($n->toBytes()),
'e' => Strings::base64url_encode($e->toBytes())
];
 
return self::wrapKey($key, $options);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php
9,8 → 9,6
*
* PHP version 5
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
19,7 → 17,6
 
namespace phpseclib3\Crypt\RSA\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
27,9 → 24,7
/**
* Microsoft BLOB Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class MSBLOB
{
36,43 → 31,36
/**
* Public/Private Key Pair
*
* @access private
*/
const PRIVATEKEYBLOB = 0x7;
/**
* Public Key
*
* @access private
*/
const PUBLICKEYBLOB = 0x6;
/**
* Public Key
*
* @access private
*/
const PUBLICKEYBLOBEX = 0xA;
/**
* RSA public key exchange algorithm
*
* @access private
*/
const CALG_RSA_KEYX = 0x0000A400;
/**
* RSA public key exchange algorithm
*
* @access private
*/
const CALG_RSA_SIGN = 0x00002400;
/**
* Public Key
*
* @access private
*/
const RSA1 = 0x31415352;
/**
* Private Key
*
* @access private
*/
const RSA2 = 0x32415352;
 
79,7 → 67,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
90,7 → 77,7
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
}
 
$key = Base64::decode($key);
$key = Strings::base64_decode($key);
 
if (!is_string($key)) {
throw new \UnexpectedValueException('Base64 decoding produced an error');
187,7 → 174,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
219,13 → 205,12
$key .= strrev($coefficients[2]->toBytes());
$key .= strrev($d->toBytes());
 
return Base64::encode($key);
return Strings::base64_encode($key);
}
 
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @return string
238,6 → 223,6
$key .= pack('VVa*', self::RSA1, 8 * strlen($n), $e);
$key .= $n;
 
return Base64::encode($key);
return Strings::base64_encode($key);
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php
7,8 → 7,6
*
* Place in $HOME/.ssh/authorized_keys
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
24,9 → 22,7
/**
* OpenSSH Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSH extends Progenitor
{
40,7 → 36,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
95,7 → 90,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param array $options optional
118,7 → 112,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php
14,8 → 14,6
*
* Analogous to ssh-keygen's pem format (as specified by -m)
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
33,9 → 31,7
/**
* PKCS#1 Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS1 extends Progenitor
{
42,7 → 38,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
64,7 → 59,7
$key = parent::load($key, $password);
 
$decoded = ASN1::decodeBER($key);
if (empty($decoded)) {
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
 
107,7 → 102,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
148,7 → 142,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php
17,8 → 17,6
* is specific to private keys it's basically creating a DER-encoded wrapper
* for keys. This just extends that same concept to public keys (much like ssh-keygen)
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
35,9 → 33,7
/**
* PKCS#8 Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS8 extends Progenitor
{
45,7 → 41,6
* OID Name
*
* @var string
* @access private
*/
const OID_NAME = 'rsaEncryption';
 
53,7 → 48,6
* OID Value
*
* @var string
* @access private
*/
const OID_VALUE = '1.2.840.113549.1.1.1';
 
61,7 → 55,6
* Child OIDs loaded
*
* @var bool
* @access private
*/
protected static $childOIDsLoaded = false;
 
68,7 → 61,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
113,7 → 105,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
134,7 → 125,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param array $options optional
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php
15,8 → 15,6
*
* Analogous to "openssl genpkey -algorithm rsa-pss".
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
34,9 → 32,7
/**
* PKCS#8 Formatted RSA-PSS Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PSS extends Progenitor
{
44,7 → 40,6
* OID Name
*
* @var string
* @access private
*/
const OID_NAME = 'id-RSASSA-PSS';
 
52,7 → 47,6
* OID Value
*
* @var string
* @access private
*/
const OID_VALUE = '1.2.840.113549.1.1.10';
 
60,7 → 54,6
* OIDs loaded
*
* @var bool
* @access private
*/
private static $oidsLoaded = false;
 
68,7 → 61,6
* Child OIDs loaded
*
* @var bool
* @access private
*/
protected static $childOIDsLoaded = false;
 
99,7 → 91,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
163,7 → 154,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
187,7 → 177,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param array $options optional
206,7 → 195,6
/**
* Encodes PSS parameters
*
* @access public
* @param array $options
* @return string
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* PuTTY Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PuTTY extends Progenitor
{
32,7 → 28,6
* Public Handler
*
* @var string
* @access private
*/
const PUBLIC_HANDLER = 'phpseclib3\Crypt\RSA\Formats\Keys\OpenSSH';
 
40,7 → 35,6
* Algorithm Identifier
*
* @var array
* @access private
*/
protected static $types = ['ssh-rsa'];
 
47,7 → 41,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
92,7 → 85,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
118,7 → 110,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @return string
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php
15,8 → 15,6
*
* 1, n, modulo, modulus
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
30,9 → 28,7
/**
* Raw RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Raw
{
39,7 → 35,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
143,7 → 138,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
179,7 → 173,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @return array
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php
12,8 → 12,6
*
* PHP version 5
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,7 → 20,6
 
namespace phpseclib3\Crypt\RSA\Formats\Keys;
 
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\Exception\UnsupportedFormatException;
31,9 → 28,7
/**
* XML Formatted RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class XML
{
40,7 → 35,6
/**
* Break a public or private key down into its constituent components
*
* @access public
* @param string $key
* @param string $password optional
* @return array
80,7 → 74,7
if (!$temp->length) {
continue;
}
$value = new BigInteger(Base64::decode($temp->item(0)->nodeValue), 256);
$value = new BigInteger(Strings::base64_decode($temp->item(0)->nodeValue), 256);
switch ($key) {
case 'modulus':
$components['modulus'] = $value;
129,7 → 123,6
/**
* Convert a private key to the appropriate format.
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @param \phpseclib3\Math\BigInteger $d
150,14 → 143,14
}
 
return "<RSAKeyPair>\r\n" .
' <Modulus>' . Base64::encode($n->toBytes()) . "</Modulus>\r\n" .
' <Exponent>' . Base64::encode($e->toBytes()) . "</Exponent>\r\n" .
' <P>' . Base64::encode($primes[1]->toBytes()) . "</P>\r\n" .
' <Q>' . Base64::encode($primes[2]->toBytes()) . "</Q>\r\n" .
' <DP>' . Base64::encode($exponents[1]->toBytes()) . "</DP>\r\n" .
' <DQ>' . Base64::encode($exponents[2]->toBytes()) . "</DQ>\r\n" .
' <InverseQ>' . Base64::encode($coefficients[2]->toBytes()) . "</InverseQ>\r\n" .
' <D>' . Base64::encode($d->toBytes()) . "</D>\r\n" .
' <Modulus>' . Strings::base64_encode($n->toBytes()) . "</Modulus>\r\n" .
' <Exponent>' . Strings::base64_encode($e->toBytes()) . "</Exponent>\r\n" .
' <P>' . Strings::base64_encode($primes[1]->toBytes()) . "</P>\r\n" .
' <Q>' . Strings::base64_encode($primes[2]->toBytes()) . "</Q>\r\n" .
' <DP>' . Strings::base64_encode($exponents[1]->toBytes()) . "</DP>\r\n" .
' <DQ>' . Strings::base64_encode($exponents[2]->toBytes()) . "</DQ>\r\n" .
' <InverseQ>' . Strings::base64_encode($coefficients[2]->toBytes()) . "</InverseQ>\r\n" .
' <D>' . Strings::base64_encode($d->toBytes()) . "</D>\r\n" .
'</RSAKeyPair>';
}
 
164,7 → 157,6
/**
* Convert a public key to the appropriate format
*
* @access public
* @param \phpseclib3\Math\BigInteger $n
* @param \phpseclib3\Math\BigInteger $e
* @return string
172,8 → 164,8
public static function savePublicKey(BigInteger $n, BigInteger $e)
{
return "<RSAKeyValue>\r\n" .
' <Modulus>' . Base64::encode($n->toBytes()) . "</Modulus>\r\n" .
' <Exponent>' . Base64::encode($e->toBytes()) . "</Exponent>\r\n" .
' <Modulus>' . Strings::base64_encode($n->toBytes()) . "</Modulus>\r\n" .
' <Exponent>' . Strings::base64_encode($e->toBytes()) . "</Exponent>\r\n" .
'</RSAKeyValue>';
}
}
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php
3,8 → 3,6
/**
* RSA Private Key
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Raw RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrivateKey extends RSA implements Common\PrivateKey
{
35,7 → 31,6
* Primes for Chinese Remainder Theorem (ie. p and q)
*
* @var array
* @access private
*/
protected $primes;
 
43,7 → 38,6
* Exponents for Chinese Remainder Theorem (ie. dP and dQ)
*
* @var array
* @access private
*/
protected $exponents;
 
51,17 → 45,15
* Coefficients for Chinese Remainder Theorem (ie. qInv)
*
* @var array
* @access private
*/
protected $coefficients;
 
/**
* Public Exponent
* Private Exponent
*
* @var mixed
* @access private
* @var \phpseclib3\Math\BigInteger
*/
protected $publicExponent = false;
protected $privateExponent;
 
/**
* RSADP
68,11 → 60,9
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}.
*
* @access private
* @param \phpseclib3\Math\BigInteger $c
* @return bool|\phpseclib3\Math\BigInteger
*/
private function rsadp($c)
private function rsadp(BigInteger $c)
{
if ($c->compare(self::$zero) < 0 || $c->compare($this->modulus) > 0) {
throw new \OutOfRangeException('Ciphertext representative out of range');
85,11 → 75,9
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}.
*
* @access private
* @param \phpseclib3\Math\BigInteger $m
* @return bool|\phpseclib3\Math\BigInteger
*/
private function rsasp1($m)
private function rsasp1(BigInteger $m)
{
if ($m->compare(self::$zero) < 0 || $m->compare($this->modulus) > 0) {
throw new \OutOfRangeException('Signature representative out of range');
181,13 → 169,12
* Protects against timing attacks by employing RSA Blinding.
* Returns $x->modPow($this->exponents[$i], $this->primes[$i])
*
* @access private
* @param \phpseclib3\Math\BigInteger $x
* @param \phpseclib3\Math\BigInteger $r
* @param int $i
* @return \phpseclib3\Math\BigInteger
*/
private function blind($x, $r, $i)
private function blind(BigInteger $x, BigInteger $r, $i)
{
$x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i]));
$x = $x->modPow($this->exponents[$i], $this->primes[$i]);
205,7 → 192,6
* See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}.
*
* @return string
* @access private
* @param string $m
* @throws \RuntimeException on encoding error
* @param int $emBits
241,7 → 227,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}.
*
* @access private
* @param string $m
* @return bool|string
*/
267,7 → 252,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}.
*
* @access private
* @param string $m
* @throws \LengthException if the RSA modulus is too short
* @return bool|string
299,7 → 283,6
* Create a signature
*
* @see self::verify()
* @access public
* @param string $message
* @return string
*/
320,7 → 303,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}.
*
* @access private
* @param string $c
* @return bool|string
*/
370,7 → 352,6
* ciphertext C, leading to a chosen-ciphertext attack such as the one
* observed by Manger [36].
*
* @access private
* @param string $c
* @return bool|string
*/
429,7 → 410,6
*
* Doesn't use padding and is not recommended.
*
* @access private
* @param string $m
* @return bool|string
* @throws \LengthException if strlen($m) > $this->k
449,7 → 429,6
* Decryption
*
* @see self::encrypt()
* @access public
* @param string $ciphertext
* @return bool|string
*/
469,7 → 448,6
/**
* Returns the public key
*
* @access public
* @return mixed
*/
public function getPublicKey()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php
3,8 → 3,6
/**
* RSA Public Key
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
28,9 → 26,7
/**
* Raw RSA Key Handler
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PublicKey extends RSA implements Common\PublicKey
{
52,7 → 48,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}.
*
* @access private
* @param \phpseclib3\Math\BigInteger $s
* @return bool|\phpseclib3\Math\BigInteger
*/
69,7 → 64,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}.
*
* @access private
* @param string $m
* @param string $s
* @throws \LengthException if the RSA modulus is too short
138,7 → 132,6
* $rsa->getLastPadding() and get RSA::PADDING_RELAXED_PKCS1 back instead of
* RSA::PADDING_PKCS1... that means BER encoding was used.
*
* @access private
* @param string $m
* @param string $s
* @return bool
224,7 → 217,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}.
*
* @access private
* @param string $m
* @param string $em
* @param int $emBits
271,7 → 263,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}.
*
* @access private
* @param string $m
* @param string $s
* @return bool|string
326,7 → 317,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}.
*
* @access private
* @param string $m
* @param bool $pkcs15_compat optional
* @throws \LengthException if strlen($m) > $this->k - 11
370,7 → 360,6
* See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and
* {http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}.
*
* @access private
* @param string $m
* @throws \LengthException if strlen($m) > $this->k - 2 * $this->hLen - 2
* @return string
416,7 → 405,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}.
*
* @access private
* @param \phpseclib3\Math\BigInteger $m
* @return bool|\phpseclib3\Math\BigInteger
*/
433,7 → 421,6
*
* Doesn't use padding and is not recommended.
*
* @access private
* @param string $m
* @return bool|string
* @throws \LengthException if strlen($m) > $this->k
457,7 → 444,6
* be concatenated together.
*
* @see self::decrypt()
* @access public
* @param string $plaintext
* @return bool|string
* @throws \LengthException if the RSA modulus is too short
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
45,8 → 45,6
* decode an id-RSASSA-PSS key. For X.509 certificates the id-RSASSA-PSS
* format is used by default (unless you change it up to use PKCS1 instead)
*
* @category Crypt
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
66,9 → 64,7
/**
* Pure-PHP PKCS#1 compliant implementation of RSA.
*
* @package RSA
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RSA extends AsymmetricKey
{
76,7 → 72,6
* Algorithm Name
*
* @var string
* @access private
*/
const ALGORITHM = 'RSA';
 
88,7 → 83,6
*
* @see self::setHash()
* @see self::setMGFHash()
* @access public
* @see self::encrypt()
* @see self::decrypt()
*/
100,7 → 94,6
* Although self::PADDING_OAEP / self::PADDING_PSS offers more security, including PKCS#1 padding is necessary for purposes of backwards
* compatibility with protocols (like SSH-1) written before OAEP's introduction.
*
* @access public
* @see self::encrypt()
* @see self::decrypt()
*/
112,7 → 105,6
* Although this method is not recommended it can none-the-less sometimes be useful if you're trying to decrypt some legacy
* stuff, if you're trying to diagnose why an encrypted message isn't decrypting, etc.
*
* @access public
* @see self::encrypt()
* @see self::decrypt()
*/
129,7 → 121,6
* @see self::sign()
* @see self::verify()
* @see self::setHash()
* @access public
*/
const SIGNATURE_PSS = 16;
 
139,7 → 130,6
* @see self::sign()
* @see self::verify()
* @see self::setHash()
* @access public
*/
const SIGNATURE_RELAXED_PKCS1 = 32;
 
149,7 → 139,6
* @see self::sign()
* @see self::verify()
* @see self::setHash()
* @access public
*/
const SIGNATURE_PKCS1 = 64;
 
157,7 → 146,6
* Encryption padding mode
*
* @var int
* @access private
*/
protected $encryptionPadding = self::ENCRYPTION_OAEP;
 
165,7 → 153,6
* Signature padding mode
*
* @var int
* @access private
*/
protected $signaturePadding = self::SIGNATURE_PSS;
 
173,7 → 160,6
* Length of hash function output
*
* @var int
* @access private
*/
protected $hLen;
 
181,7 → 167,6
* Length of salt
*
* @var int
* @access private
*/
protected $sLen;
 
189,7 → 174,6
* Label
*
* @var string
* @access private
*/
protected $label = '';
 
197,7 → 181,6
* Hash function for the Mask Generation Function
*
* @var \phpseclib3\Crypt\Hash
* @access private
*/
protected $mgfHash;
 
205,7 → 188,6
* Length of MGF hash function output
*
* @var int
* @access private
*/
protected $mgfHLen;
 
213,7 → 195,6
* Modulus (ie. n)
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $modulus;
 
221,7 → 202,6
* Modulus length
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $k;
 
229,7 → 209,6
* Exponent (ie. e or d)
*
* @var \phpseclib3\Math\BigInteger
* @access private
*/
protected $exponent;
 
238,7 → 217,6
*
* @var int
* @link http://en.wikipedia.org/wiki/65537_%28number%29
* @access private
*/
private static $defaultExponent = 65537;
 
246,7 → 224,6
* Enable Blinding?
*
* @var bool
* @access private
*/
protected static $enableBlinding = true;
 
269,16 → 246,21
* a chance neither gmp nor OpenSSL are installed)
*
* @var int
* @access private
*/
private static $smallestPrime = 4096;
 
/**
* Public Exponent
*
* @var \phpseclib3\Math\BigInteger
*/
protected $publicExponent;
 
/**
* Sets the public exponent for key generation
*
* This will be 65537 unless changed.
*
* @access public
* @param int $val
*/
public static function setExponent($val)
291,7 → 273,6
*
* This will be 4096 unless changed.
*
* @access public
* @param int $val
*/
public static function setSmallestPrime($val)
304,7 → 285,6
*
* Set to the empty string to use the default config file
*
* @access public
* @param string $val
*/
public static function setOpenSSLConfigPath($val)
317,8 → 297,7
*
* The public key can be extracted from the private key
*
* @return RSA
* @access public
* @return RSA\PrivateKey
* @param int $bits
*/
public static function createKey($bits = 2048)
450,10 → 429,8
* OnLoad Handler
*
* @return bool
* @access protected
* @param array $components
*/
protected static function onLoad($components)
protected static function onLoad(array $components)
{
$key = $components['isPublicKey'] ?
new PublicKey() :
527,7 → 504,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}.
*
* @access private
* @param bool|\phpseclib3\Math\BigInteger $x
* @param int $xLen
* @return bool|string
549,7 → 525,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
*
* @access private
* @param string $x
* @return \phpseclib3\Math\BigInteger
*/
563,7 → 538,6
*
* See {@link http://tools.ietf.org/html/rfc3447#section-9.2 RFC3447#section-9.2}.
*
* @access private
* @param string $m
* @param int $emLen
* @throws \LengthException if the intended encoded message length is too short
627,7 → 601,6
* generally be omitted, but if present, it shall have a value of type
* NULL"
*
* @access private
* @param string $m
* @param int $emLen
* @return string
682,7 → 655,6
*
* See {@link http://tools.ietf.org/html/rfc3447#appendix-B.2.1 RFC3447#appendix-B.2.1}.
*
* @access private
* @param string $mgfSeed
* @param int $maskLen
* @return string
706,7 → 678,6
*
* More specifically, this returns the size of the modulo in bits.
*
* @access public
* @return int
*/
public function getLength()
720,7 → 691,6
* Used with signature production / verification and (if the encryption mode is self::PADDING_OAEP) encryption and
* decryption.
*
* @access public
* @param string $hash
*/
public function withHash($hash)
756,7 → 726,6
* The mask generation function is used by self::PADDING_OAEP and self::PADDING_PSS and although it's
* best if Hash and MGFHash are set to the same thing this is not a requirement.
*
* @access public
* @param string $hash
*/
public function withMGFHash($hash)
789,7 → 758,6
/**
* Returns the MGF hash algorithm currently being used
*
* @access public
*/
public function getMGFHash()
{
806,7 → 774,6
* Typical salt lengths in octets are hLen (the length of the output
* of the hash function Hash) and 0.
*
* @access public
* @param int $sLen
*/
public function withSaltLength($sLen)
819,7 → 786,6
/**
* Returns the salt length currently being used
*
* @access public
*/
public function getSaltLength()
{
838,7 → 804,6
* the empty string; other uses of the label are outside the scope of
* this document.
*
* @access public
* @param string $label
*/
public function withLabel($label)
851,7 → 816,6
/**
* Returns the label currently being used
*
* @access public
*/
public function getLabel()
{
863,7 → 827,6
*
* Example: $key->withPadding(RSA::ENCRYPTION_PKCS1 | RSA::SIGNATURE_PKCS1);
*
* @access public
* @param int $padding
*/
public function withPadding($padding)
913,7 → 876,6
/**
* Returns the padding currently being used
*
* @access public
*/
public function getPadding()
{
930,7 → 892,6
*
* @see self::useInternalEngine()
* @see self::useBestEngine()
* @access public
* @return string
*/
public function getEngine()
946,7 → 907,6
/**
* Enable RSA Blinding
*
* @access public
*/
public static function enableBlinding()
{
956,7 → 916,6
/**
* Disable RSA Blinding
*
* @access public
*/
public static function disableBlinding()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php
14,8 → 14,6
* ?>
* </code>
*
* @category Crypt
* @package Random
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
27,9 → 25,7
/**
* Pure-PHP Random Number Generator
*
* @package Random
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Random
{
101,7 → 97,10
(isset($_POST) ? self::safe_serialize($_POST) : '') .
(isset($_GET) ? self::safe_serialize($_GET) : '') .
(isset($_COOKIE) ? self::safe_serialize($_COOKIE) : '') .
self::safe_serialize($GLOBALS) .
// as of PHP 8.1 $GLOBALS can't be accessed by reference, which eliminates
// the need for phpseclib_safe_serialize. see https://wiki.php.net/rfc/restrict_globals_usage
// for more info
(version_compare(PHP_VERSION, '8.1.0', '>=') ? serialize($GLOBALS) : self::safe_serialize($GLOBALS)) .
self::safe_serialize($_SESSION) .
self::safe_serialize($_OLD_SESSION);
$v = $seed = $_SESSION['seed'] = sha1($v, true);
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php
44,8 → 44,6
* ?>
* </code>
*
* @category Crypt
* @package Rijndael
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2008 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
64,9 → 62,7
/**
* Pure-PHP implementation of Rijndael.
*
* @package Rijndael
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Rijndael extends BlockCipher
{
82,7 → 78,6
* @see \phpseclib3\Crypt\Common\SymmetricKey::engine
* @see self::isValidEngine()
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'rijndael-128';
 
91,7 → 86,6
*
* @see self::setup()
* @var array
* @access private
*/
private $w;
 
100,7 → 94,6
*
* @see self::setup()
* @var array
* @access private
*/
private $dw;
 
114,7 → 107,6
*
* @see self::setBlockLength()
* @var int
* @access private
*/
private $Nb = 4;
 
128,7 → 120,6
*
* @see self::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 16;
 
137,7 → 128,6
*
* @see self::setKeyLength()
* @var int
* @access private
* @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4
*/
private $Nk = 4;
148,7 → 138,6
* {@internal The max value is 14, the min value is 10.}
*
* @var int
* @access private
*/
private $Nr;
 
156,7 → 145,6
* Shift offsets
*
* @var array
* @access private
*/
private $c;
 
164,7 → 152,6
* Holds the last used key- and block_size information
*
* @var array
* @access private
*/
private $kl;
 
172,7 → 159,6
* Default Constructor.
*
* @param string $mode
* @access public
* @throws \InvalidArgumentException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
200,7 → 186,6
* the mcrypt php extension, even if available.
* This results then in slower encryption.
*
* @access public
* @throws \LengthException if the key length is invalid
* @param int $length
*/
227,7 → 212,6
* Rijndael supports five different key lengths
*
* @see setKeyLength()
* @access public
* @param string $key
* @throws \LengthException if the key length isn't supported
*/
252,7 → 236,6
*
* Valid block lengths are 128, 160, 192, 224, and 256.
*
* @access public
* @param int $length
*/
public function setBlockLength($length)
281,7 → 264,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
324,7 → 306,6
/**
* Encrypts a block
*
* @access private
* @param string $in
* @return string
*/
397,7 → 378,7
$k = $c[2];
$l = $c[3];
while ($i < $Nb) {
$temp[$i] = ($state[$i] & 0xFF000000) ^
$temp[$i] = ($state[$i] & intval(0xFF000000)) ^
($state[$j] & 0x00FF0000) ^
($state[$k] & 0x0000FF00) ^
($state[$l] & 0x000000FF) ^
414,7 → 395,6
/**
* Decrypts a block
*
* @access private
* @param string $in
* @return string
*/
472,7 → 452,7
$l = $Nb - $c[3];
 
while ($i < $Nb) {
$word = ($state[$i] & 0xFF000000) |
$word = ($state[$i] & intval(0xFF000000)) |
($state[$j] & 0x00FF0000) |
($state[$k] & 0x0000FF00) |
($state[$l] & 0x000000FF);
514,7 → 494,6
* @see self::setKey()
* @see self::setIV()
* @see self::disableContinuousBuffer()
* @access private
*/
protected function setup()
{
533,13 → 512,15
* Setup the key (expansion)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
* @access private
*/
protected function setupKey()
{
// Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.
// See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse
static $rcon = [0,
static $rcon;
 
if (!isset($rcon)) {
$rcon = [0,
0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,
0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,
547,6 → 528,8
0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,
0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000
];
$rcon = array_map('intval', $rcon);
}
 
if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) {
// already expanded
585,7 → 568,7
// on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,
// 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'
// with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.
$temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord
$temp = (($temp << 8) & intval(0xFFFFFF00)) | (($temp >> 24) & 0x000000FF); // rotWord
$temp = $this->subWord($temp) ^ $rcon[$i / $this->Nk];
} elseif ($this->Nk > 6 && $i % $this->Nk == 4) {
$temp = $this->subWord($temp);
646,7 → 629,6
* Performs S-Box substitutions
*
* @return array
* @access private
* @param int $word
*/
private function subWord($word)
668,7 → 650,6
* @see self::encryptBlock()
* @see self::setupInlineCrypt()
* @see self::subWord()
* @access private
* @return array &$tables
*/
protected function &getTables()
716,9 → 697,9
]);
 
foreach ($t3 as $t3i) {
$t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF);
$t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF);
$t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF);
$t0[] = (($t3i << 24) & intval(0xFF000000)) | (($t3i >> 8) & 0x00FFFFFF);
$t1[] = (($t3i << 16) & intval(0xFFFF0000)) | (($t3i >> 16) & 0x0000FFFF);
$t2[] = (($t3i << 8) & intval(0xFFFFFF00)) | (($t3i >> 24) & 0x000000FF);
}
 
$tables = [
757,7 → 738,6
* @see self::decryptBlock()
* @see self::setupInlineCrypt()
* @see self::setupKey()
* @access private
* @return array &$tables
*/
protected function &getInvTables()
800,9 → 780,9
]);
 
foreach ($dt3 as $dt3i) {
$dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF);
$dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF);
$dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF);
$dt0[] = (($dt3i << 24) & intval(0xFF000000)) | (($dt3i >> 8) & 0x00FFFFFF);
$dt1[] = (($dt3i << 16) & intval(0xFFFF0000)) | (($dt3i >> 16) & 0x0000FFFF);
$dt2[] = (($dt3i << 8) & intval(0xFFFFFF00)) | (($dt3i >> 24) & 0x000000FF);
};
 
$tables = [
839,7 → 819,6
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()
* @access private
*/
protected function setupInlineCrypt()
{
982,7 → 961,6
*
* @see self::decrypt()
* @see parent::encrypt()
* @access public
* @param string $plaintext
* @return string
*/
1014,7 → 992,6
*
* @see self::encrypt()
* @see parent::decrypt()
* @access public
* @param string $ciphertext
* @return string
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php
5,8 → 5,6
*
* PHP version 5
*
* @category Crypt
* @package Salsa20
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2019 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Pure-PHP implementation of Salsa20.
*
* @package Salsa20
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Salsa20 extends StreamCipher
{
51,13 → 47,11
protected $key_length = 32; // = 256 bits
 
/**
* @access private
* @see \phpseclib3\Crypt\Salsa20::crypt()
*/
const ENCRYPT = 0;
 
/**
* @access private
* @see \phpseclib3\Crypt\Salsa20::crypt()
*/
const DECRYPT = 1;
410,11 → 404,13
*/
protected static function leftRotate($x, $n)
{
if (PHP_INT_SIZE == 8) {
$r1 = $x << $n;
if (PHP_INT_SIZE == 8) {
$r1 &= 0xFFFFFFFF;
$r2 = ($x & 0xFFFFFFFF) >> (32 - $n);
} else {
$x = (int) $x;
$r1 = $x << $n;
$r2 = $x >> (32 - $n);
$r2 &= (1 << $n) - 1;
}
495,7 → 491,6
*
* @see self::decrypt()
* @see self::encrypt()
* @access private
* @param string $ciphertext
* @return string
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php
26,8 → 26,6
* ?>
* </code>
*
* @category Crypt
* @package TripleDES
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
39,9 → 37,7
/**
* Pure-PHP implementation of Triple DES.
*
* @package TripleDES
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class TripleDES extends DES
{
64,7 → 60,6
*
* @see \phpseclib3\Crypt\TripleDES::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 24;
 
74,7 → 69,6
* @see \phpseclib3\Crypt\DES::cipher_name_mcrypt
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'tripledes';
 
83,7 → 77,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
* @var int
* @access private
*/
protected $cfb_init_len = 750;
 
93,7 → 86,6
* @see self::setKey()
* @see \phpseclib3\Crypt\DES::setKey()
* @var string
* @access private
*/
protected $key_length_max = 24;
 
101,7 → 93,6
* Internal flag whether using self::MODE_3CBC or not
*
* @var bool
* @access private
*/
private $mode_3cbc;
 
111,7 → 102,6
* Used only if $mode_3cbc === true
*
* @var array
* @access private
*/
private $des;
 
139,7 → 129,6
* @see \phpseclib3\Crypt\DES::__construct()
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param string $mode
* @access public
*/
public function __construct($mode)
{
182,7 → 171,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @param int $engine
* @access protected
* @return bool
*/
protected function isValidEngineHelper($engine)
202,7 → 190,6
* SetIV is not required when \phpseclib3\Crypt\Common\SymmetricKey::MODE_ECB is being used.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setIV()
* @access public
* @param string $iv
*/
public function setIV($iv)
223,7 → 210,6
* If you want to use a 64-bit key use DES.php
*
* @see \phpseclib3\Crypt\Common\SymmetricKey:setKeyLength()
* @access public
* @throws \LengthException if the key length is invalid
* @param int $length
*/
247,7 → 233,6
*
* DES also requires that every eighth bit be a parity bit, however, we'll ignore that.
*
* @access public
* @see \phpseclib3\Crypt\DES::setKey()
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKey()
* @throws \LengthException if the key length is invalid
286,7 → 271,6
* Encrypts a message.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @access public
* @param string $plaintext
* @return string $cipertext
*/
313,7 → 297,6
* Decrypts a message.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
* @access public
* @param string $ciphertext
* @return string $plaintext
*/
370,7 → 353,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::enableContinuousBuffer()
* @see self::disableContinuousBuffer()
* @access public
*/
public function enableContinuousBuffer()
{
389,7 → 371,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::disableContinuousBuffer()
* @see self::enableContinuousBuffer()
* @access public
*/
public function disableContinuousBuffer()
{
406,7 → 387,6
*
* @see \phpseclib3\Crypt\DES::setupKey()
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
* @access private
*/
protected function setupKey()
{
442,7 → 422,6
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @see \phpseclib3\Crypt\Common\SymmetricKey::setPreferredEngine()
* @param int $engine
* @access public
*/
public function setPreferredEngine($engine)
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
26,8 → 26,6
* ?>
* </code>
*
* @category Crypt
* @package Twofish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @copyright 2007 Jim Wigginton
43,10 → 41,8
/**
* Pure-PHP implementation of Twofish.
*
* @package Twofish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
* @access public
*/
class Twofish extends BlockCipher
{
55,7 → 51,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt
* @var string
* @access private
*/
protected $cipher_name_mcrypt = 'twofish';
 
64,7 → 59,6
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len
* @var int
* @access private
*/
protected $cfb_init_len = 800;
 
72,7 → 66,6
* Q-Table
*
* @var array
* @access private
*/
private static $q0 = [
0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76,
113,7 → 106,6
* Q-Table
*
* @var array
* @access private
*/
private static $q1 = [
0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8,
154,7 → 146,6
* M-Table
*
* @var array
* @access private
*/
private static $m0 = [
0xBCBC3275, 0xECEC21F3, 0x202043C6, 0xB3B3C9F4, 0xDADA03DB, 0x02028B7B, 0xE2E22BFB, 0x9E9EFAC8,
195,7 → 186,6
* M-Table
*
* @var array
* @access private
*/
private static $m1 = [
0xA9D93939, 0x67901717, 0xB3719C9C, 0xE8D2A6A6, 0x04050707, 0xFD985252, 0xA3658080, 0x76DFE4E4,
236,7 → 226,6
* M-Table
*
* @var array
* @access private
*/
private static $m2 = [
0xBC75BC32, 0xECF3EC21, 0x20C62043, 0xB3F4B3C9, 0xDADBDA03, 0x027B028B, 0xE2FBE22B, 0x9EC89EFA,
277,7 → 266,6
* M-Table
*
* @var array
* @access private
*/
private static $m3 = [
0xD939A9D9, 0x90176790, 0x719CB371, 0xD2A6E8D2, 0x05070405, 0x9852FD98, 0x6580A365, 0xDFE476DF,
318,7 → 306,6
* The Key Schedule Array
*
* @var array
* @access private
*/
private $K = [];
 
326,7 → 313,6
* The Key depended S-Table 0
*
* @var array
* @access private
*/
private $S0 = [];
 
334,7 → 320,6
* The Key depended S-Table 1
*
* @var array
* @access private
*/
private $S1 = [];
 
342,7 → 327,6
* The Key depended S-Table 2
*
* @var array
* @access private
*/
private $S2 = [];
 
350,7 → 334,6
* The Key depended S-Table 3
*
* @var array
* @access private
*/
private $S3 = [];
 
358,7 → 341,6
* Holds the last used key
*
* @var array
* @access private
*/
private $kl;
 
367,7 → 349,6
*
* @see Crypt_Twofish::setKeyLength()
* @var int
* @access private
*/
protected $key_length = 16;
 
375,7 → 356,6
* Default Constructor.
*
* @param string $mode
* @access public
* @throws BadModeException if an invalid / unsupported mode is provided
*/
public function __construct($mode)
388,11 → 368,27
}
 
/**
* Initialize Static Variables
*/
protected static function initialize_static_variables()
{
if (is_float(self::$m3[0])) {
self::$m0 = array_map('intval', self::$m0);
self::$m1 = array_map('intval', self::$m1);
self::$m2 = array_map('intval', self::$m2);
self::$m3 = array_map('intval', self::$m3);
self::$q0 = array_map('intval', self::$q0);
self::$q1 = array_map('intval', self::$q1);
}
 
parent::initialize_static_variables();
}
 
/**
* Sets the key length.
*
* Valid key lengths are 128, 192 or 256 bits
*
* @access public
* @param int $length
*/
public function setKeyLength($length)
415,7 → 411,6
* Rijndael supports five different key lengths
*
* @see setKeyLength()
* @access public
* @param string $key
* @throws \LengthException if the key length isn't supported
*/
437,7 → 432,6
* Setup the key (expansion)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey()
* @access private
*/
protected function setupKey()
{
549,7 → 543,6
/**
* _mdsrem function using by the twofish cipher algorithm
*
* @access private
* @param string $A
* @param string $B
* @return array
597,7 → 590,6
/**
* Encrypts a block
*
* @access private
* @param string $in
* @return string
*/
653,7 → 645,6
/**
* Decrypts a block
*
* @access private
* @param string $in
* @return string
*/
710,7 → 701,6
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt()
* @access private
*/
protected function setupInlineCrypt()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/BadConfigurationException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package BadConfigurationException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* BadConfigurationException
*
* @package BadConfigurationException
* @author Jim Wigginton <terrafrost@php.net>
*/
class BadConfigurationException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/BadDecryptionException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package BadDecryptionException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* BadDecryptionException
*
* @package BadDecryptionException
* @author Jim Wigginton <terrafrost@php.net>
*/
class BadDecryptionException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/BadModeException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package BadModeException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* BadModeException
*
* @package BadModeException
* @author Jim Wigginton <terrafrost@php.net>
*/
class BadModeException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/ConnectionClosedException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package ConnectionClosedException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* ConnectionClosedException
*
* @package ConnectionClosedException
* @author Jim Wigginton <terrafrost@php.net>
*/
class ConnectionClosedException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/FileNotFoundException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package FileNotFoundException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* FileNotFoundException
*
* @package FileNotFoundException
* @author Jim Wigginton <terrafrost@php.net>
*/
class FileNotFoundException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/InconsistentSetupException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package InconsistentSetupException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* InconsistentSetupException
*
* @package InconsistentSetupException
* @author Jim Wigginton <terrafrost@php.net>
*/
class InconsistentSetupException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/InsufficientSetupException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package InsufficientSetupException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* InsufficientSetupException
*
* @package InsufficientSetupException
* @author Jim Wigginton <terrafrost@php.net>
*/
class InsufficientSetupException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/NoKeyLoadedException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package NoKeyLoadedException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* NoKeyLoadedException
*
* @package NoKeyLoadedException
* @author Jim Wigginton <terrafrost@php.net>
*/
class NoKeyLoadedException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/NoSupportedAlgorithmsException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package NoSupportedAlgorithmsException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* NoSupportedAlgorithmsException
*
* @package NoSupportedAlgorithmsException
* @author Jim Wigginton <terrafrost@php.net>
*/
class NoSupportedAlgorithmsException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/UnableToConnectException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package UnableToConnectException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* UnableToConnectException
*
* @package UnableToConnectException
* @author Jim Wigginton <terrafrost@php.net>
*/
class UnableToConnectException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/UnsupportedAlgorithmException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package UnsupportedAlgorithmException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* UnsupportedAlgorithmException
*
* @package UnsupportedAlgorithmException
* @author Jim Wigginton <terrafrost@php.net>
*/
class UnsupportedAlgorithmException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/UnsupportedCurveException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package UnsupportedCurveException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* UnsupportedCurveException
*
* @package UnsupportedCurveException
* @author Jim Wigginton <terrafrost@php.net>
*/
class UnsupportedCurveException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/UnsupportedFormatException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package UnsupportedFormatException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* UnsupportedFormatException
*
* @package UnsupportedFormatException
* @author Jim Wigginton <terrafrost@php.net>
*/
class UnsupportedFormatException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/Exception/UnsupportedOperationException.php
5,8 → 5,6
*
* PHP version 5
*
* @category Exception
* @package UnsupportedOperationException
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,7 → 16,6
/**
* UnsupportedOperationException
*
* @package UnsupportedOperationException
* @author Jim Wigginton <terrafrost@php.net>
*/
class UnsupportedOperationException extends \RuntimeException
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php
10,8 → 10,6
* {@link http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator} how to format the characters, what
* color to display them in, etc. \phpseclib3\File\ANSI is a {@link http://en.wikipedia.org/wiki/VT100 VT100} terminal emulator.
*
* @category File
* @package ANSI
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Pure-PHP ANSI Decoder
*
* @package ANSI
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class ANSI
{
33,7 → 29,6
* Max Width
*
* @var int
* @access private
*/
private $max_x;
 
41,7 → 36,6
* Max Height
*
* @var int
* @access private
*/
private $max_y;
 
49,7 → 43,6
* Max History
*
* @var int
* @access private
*/
private $max_history;
 
57,7 → 50,6
* History
*
* @var array
* @access private
*/
private $history;
 
65,7 → 57,6
* History Attributes
*
* @var array
* @access private
*/
private $history_attrs;
 
73,7 → 64,6
* Current Column
*
* @var int
* @access private
*/
private $x;
 
81,7 → 71,6
* Current Row
*
* @var int
* @access private
*/
private $y;
 
89,7 → 78,6
* Old Column
*
* @var int
* @access private
*/
private $old_x;
 
97,7 → 85,6
* Old Row
*
* @var int
* @access private
*/
private $old_y;
 
105,7 → 92,6
* An empty attribute cell
*
* @var object
* @access private
*/
private $base_attr_cell;
 
113,7 → 99,6
* The current attribute cell
*
* @var object
* @access private
*/
private $attr_cell;
 
121,7 → 106,6
* An empty attribute row
*
* @var array
* @access private
*/
private $attr_row;
 
129,7 → 113,6
* The current screen text
*
* @var list<string>
* @access private
*/
private $screen;
 
137,7 → 120,6
* The current screen attributes
*
* @var array
* @access private
*/
private $attrs;
 
145,7 → 127,6
* Current ANSI code
*
* @var string
* @access private
*/
private $ansi;
 
153,7 → 134,6
* Tokenization
*
* @var array
* @access private
*/
private $tokenization;
 
161,7 → 141,6
* Default Constructor.
*
* @return \phpseclib3\File\ANSI
* @access public
*/
public function __construct()
{
186,7 → 165,6
*
* @param int $x
* @param int $y
* @access public
*/
public function setDimensions($x, $y)
{
204,7 → 182,6
* Set the number of lines that should be logged past the terminal height
*
* @param int $history
* @access public
*/
public function setHistory($history)
{
215,7 → 192,6
* Load a string
*
* @param string $source
* @access public
*/
public function loadString($source)
{
227,7 → 203,6
* Appdend a string
*
* @param string $source
* @access public
*/
public function appendString($source)
{
433,7 → 408,6
*
* Also update the $this->screen and $this->history buffers
*
* @access private
*/
private function newLine()
{
461,13 → 435,12
/**
* Returns the current coordinate without preformating
*
* @access private
* @param \stdClass $last_attr
* @param \stdClass $cur_attr
* @param string $char
* @return string
*/
private function processCoordinate($last_attr, $cur_attr, $char)
private function processCoordinate(\stdClass $last_attr, \stdClass $cur_attr, $char)
{
$output = '';
 
521,7 → 494,6
/**
* Returns the current screen without preformating
*
* @access private
* @return string
*/
private function getScreenHelper()
545,7 → 517,6
/**
* Returns the current screen
*
* @access public
* @return string
*/
public function getScreen()
556,7 → 527,6
/**
* Returns the current screen and the x previous lines
*
* @access public
* @return string
*/
public function getHistory()
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
* An ASN.1 ANY mapping will return an ASN1\Element object. Use of this object
* will also bypass the normal encoding rules in ASN1::encodeDER()
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Element
{
31,7 → 27,6
* Raw element value
*
* @var string
* @access private
*/
public $element;
 
40,7 → 35,6
*
* @param string $encoded
* @return \phpseclib3\File\ASN1\Element
* @access public
*/
public function __construct($encoded)
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AccessDescription.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AccessDescription
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AccessDescription
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AdministrationDomainName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AdministrationDomainName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AdministrationDomainName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AlgorithmIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AlgorithmIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AnotherName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AnotherName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AnotherName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Attribute.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Attribute
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Attribute
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AttributeType.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AttributeType
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AttributeType
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AttributeTypeAndValue
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AttributeTypeAndValue
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AttributeValue.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AttributeValue
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AttributeValue
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Attributes.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Attributes
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Attributes
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AuthorityInfoAccessSyntax
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AuthorityInfoAccessSyntax
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* AuthorityKeyIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class AuthorityKeyIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/BaseDistance.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* BaseDistance
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BaseDistance
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/BasicConstraints.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* BasicConstraints
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BasicConstraints
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* BuiltInDomainDefinedAttribute
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BuiltInDomainDefinedAttribute
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* BuiltInDomainDefinedAttributes
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BuiltInDomainDefinedAttributes
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* BuiltInStandardAttributes
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BuiltInStandardAttributes
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CPSuri.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CPSuri
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CPSuri
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CRLDistributionPoints
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CRLDistributionPoints
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CRLNumber.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CRLNumber
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CRLNumber
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CRLReason.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CRLReason
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CRLReason
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertPolicyId.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertPolicyId
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertPolicyId
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Certificate.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Certificate
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Certificate
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificateIssuer.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,14 → 13,10
 
namespace phpseclib3\File\ASN1\Maps;
 
use phpseclib3\File\ASN1;
 
/**
* CertificateIssuer
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificateIssuer
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificateList.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertificateList
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificateList
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificatePolicies.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertificatePolicies
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificatePolicies
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificateSerialNumber.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertificateSerialNumber
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificateSerialNumber
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificationRequest.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertificationRequest
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificationRequest
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CertificationRequestInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CertificationRequestInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Characteristic_two.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Characteristic_two
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Characteristic_two
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/CountryName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* CountryName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class CountryName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Curve.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Curve
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Curve
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DHParameter.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* DHParameter
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DHParameter
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DSAParams.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DSAParams
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DSAParams
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DSAPrivateKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DSAPrivateKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DSAPrivateKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DSAPublicKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DSAPublicKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DSAPublicKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DigestInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DigestInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DirectoryString.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DirectoryString
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DirectoryString
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DisplayText.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DisplayText
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DisplayText
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DistributionPoint.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DistributionPoint
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DistributionPoint
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DistributionPointName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DistributionPointName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DistributionPointName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/DssSigValue.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* DssSigValue
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DssSigValue
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ECParameters.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
32,9 → 30,7
* -- Any future additions to this CHOICE should be coordinated
* -- with ANSI X9.
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ECParameters
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ECPoint.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ECPoint
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ECPoint
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ECPrivateKey.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* ECPrivateKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ECPrivateKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/EDIPartyName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* EDIPartyName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EDIPartyName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/EcdsaSigValue.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* EcdsaSigValue
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EcdsaSigValue
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/EncryptedData.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* EncryptedData
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EncryptedData
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* EncryptedPrivateKeyInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EncryptedPrivateKeyInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ExtKeyUsageSyntax
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ExtKeyUsageSyntax
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Extension.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
26,9 → 24,7
*
* http://tools.ietf.org/html/rfc5280#section-4.2
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Extension
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ExtensionAttribute.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ExtensionAttribute
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ExtensionAttribute
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ExtensionAttributes.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ExtensionAttributes
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ExtensionAttributes
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Extensions.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Extensions
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Extensions
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/FieldElement.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* FieldElement
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class FieldElement
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/FieldID.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* FieldID
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class FieldID
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/GeneralName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GeneralName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class GeneralName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/GeneralNames.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GeneralNames
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class GeneralNames
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/GeneralSubtree.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GeneralSubtree
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class GeneralSubtree
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/GeneralSubtrees.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GeneralSubtrees
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class GeneralSubtrees
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/HashAlgorithm.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,14 → 13,10
 
namespace phpseclib3\File\ASN1\Maps;
 
use phpseclib3\File\ASN1;
 
/**
* HashAglorithm
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class HashAlgorithm
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/HoldInstructionCode.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* HoldInstructionCode
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class HoldInstructionCode
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/InvalidityDate.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* InvalidityDate
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class InvalidityDate
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/IssuerAltName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,14 → 13,10
 
namespace phpseclib3\File\ASN1\Maps;
 
use phpseclib3\File\ASN1;
 
/**
* IssuerAltName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class IssuerAltName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* IssuingDistributionPoint
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class IssuingDistributionPoint
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/KeyIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* KeyIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class KeyIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/KeyPurposeId.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* KeyPurposeId
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class KeyPurposeId
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/KeyUsage.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* KeyUsage
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class KeyUsage
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/MaskGenAlgorithm.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,14 → 13,10
 
namespace phpseclib3\File\ASN1\Maps;
 
use phpseclib3\File\ASN1;
 
/**
* MaskGenAglorithm
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class MaskGenAlgorithm
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Name.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Name
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Name
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/NameConstraints.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* NameConstraints
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class NameConstraints
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/NetworkAddress.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* NetworkAddress
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class NetworkAddress
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/NoticeReference.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* NoticeReference
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class NoticeReference
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/NumericUserIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* NumericUserIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class NumericUserIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ORAddress.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ORAddress
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ORAddress
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* OneAsymmetricKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OneAsymmetricKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/OrganizationName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OrganizationName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OrganizationName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OrganizationalUnitNames
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OrganizationalUnitNames
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OtherPrimeInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OtherPrimeInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OtherPrimeInfos
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OtherPrimeInfos
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PBEParameter.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PBEParameter
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PBES2params.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PBES2params
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PBKDF2params.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PBKDF2params
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PBMAC1params.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PBMAC1params
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PKCS9String.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PKCS9String
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PKCS9String
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Pentanomial.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Pentanomial
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Pentanomial
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PersonalName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PersonalName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PersonalName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PolicyInformation.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PolicyInformation
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PolicyInformation
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PolicyMappings.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PolicyMappings
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PolicyMappings
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PolicyQualifierId.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PolicyQualifierId
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PolicyQualifierId
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PolicyQualifierInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PolicyQualifierInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PostalAddress.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PostalAddress
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PostalAddress
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Prime_p.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Prime_p
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Prime_p
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PrivateDomainName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PrivateDomainName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PrivateDomainName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PrivateKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PrivateKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PrivateKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PrivateKeyInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PrivateKeyInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PrivateKeyUsagePeriod
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PrivateKeyUsagePeriod
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PublicKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PublicKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PublicKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PublicKeyAndChallenge
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PublicKeyAndChallenge
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/PublicKeyInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
* this format is not formally defined anywhere but is none-the-less the form you
* get when you do "openssl rsa -in private.pem -outform PEM -pubout"
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PublicKeyInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RC2CBCParameter.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* from https://tools.ietf.org/html/rfc2898#appendix-A.3
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RC2CBCParameter
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RDNSequence.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
26,9 → 24,7
*
* - https://www.opends.org/wiki/page/DefinitionRelativeDistinguishedName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RDNSequence
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RSAPrivateKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* RSAPrivateKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RSAPrivateKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RSAPublicKey.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* RSAPublicKey
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RSAPublicKey
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* RSASSA_PSS_params
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RSASSA_PSS_params
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ReasonFlags.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* ReasonFlags
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ReasonFlags
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
26,9 → 24,7
*
* - https://www.opends.org/wiki/page/DefinitionRelativeDistinguishedName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RelativeDistinguishedName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/RevokedCertificate.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* RevokedCertificate
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class RevokedCertificate
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* SignedPublicKeyAndChallenge
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SignedPublicKeyAndChallenge
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php
7,8 → 7,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* SpecifiedECDomain
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SpecifiedECDomain
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SubjectAltName.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,14 → 13,10
 
namespace phpseclib3\File\ASN1\Maps;
 
use phpseclib3\File\ASN1;
 
/**
* SubjectAltName
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SubjectAltName
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* SubjectDirectoryAttributes
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SubjectDirectoryAttributes
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* SubjectInfoAccessSyntax
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SubjectInfoAccessSyntax
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* SubjectPublicKeyInfo
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class SubjectPublicKeyInfo
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/TBSCertList.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* TBSCertList
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class TBSCertList
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/TBSCertificate.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* TBSCertificate
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class TBSCertificate
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/TerminalIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* TerminalIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class TerminalIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Time.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Time
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Time
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Trinomial.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Trinomial
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Trinomial
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/UniqueIdentifier.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* UniqueIdentifier
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class UniqueIdentifier
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/UserNotice.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* UserNotice
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class UserNotice
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/Validity.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Validity
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Validity
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/netscape_ca_policy_url.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* netscape_ca_policy_url
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class netscape_ca_policy_url
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/netscape_cert_type.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
*
* mapping is from <http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn3.html>
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class netscape_cert_type
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/netscape_comment.php
5,8 → 5,6
*
* PHP version 5
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* netscape_comment
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class netscape_comment
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php
13,8 → 13,6
*
* Uses the 1988 ASN.1 syntax.
*
* @category File
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
24,7 → 22,6
namespace phpseclib3\File;
 
use DateTime;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\File\ASN1\Element;
use phpseclib3\Math\BigInteger;
32,9 → 29,7
/**
* Pure-PHP ASN.1 Parser
*
* @package ASN1
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ASN1
{
88,7 → 83,6
* ASN.1 object identifiers
*
* @var array
* @access private
* @link http://en.wikipedia.org/wiki/Object_identifier
*/
private static $oids = [];
97,7 → 91,6
* ASN.1 object identifier reverse mapping
*
* @var array
* @access private
*/
private static $reverseOIDs = [];
 
105,7 → 98,6
* Default date format
*
* @var string
* @access private
* @link http://php.net/class.datetime
*/
private static $format = 'D, d M Y H:i:s O';
116,7 → 108,6
* If the mapping type is self::TYPE_ANY what do we actually encode it as?
*
* @var array
* @access private
* @see self::encode_der()
*/
private static $filters;
127,7 → 118,6
* Useful for debug purposes
*
* @var array
* @access private
* @see self::encode_der()
*/
private static $location;
138,7 → 128,6
* In case we need to create ASN1\Element object's..
*
* @var string
* @access private
* @see self::decodeDER()
*/
private static $encoded;
151,7 → 140,6
* Others are mapped as a choice, with an extra indexing level.
*
* @var array
* @access public
*/
const ANY_MAP = [
self::TYPE_BOOLEAN => true,
185,7 → 173,6
* size == 0 indicates variable length encoding.
*
* @var array
* @access public
*/
const STRING_TYPE_SIZE = [
self::TYPE_UTF8_STRING => 0,
203,8 → 190,7
* Serves a similar purpose to openssl's asn1parse
*
* @param Element|string $encoded
* @return array
* @access public
* @return ?array
*/
public static function decodeBER($encoded)
{
214,10 → 200,12
 
self::$encoded = $encoded;
 
$decoded = [self::decode_ber($encoded)];
$decoded = self::decode_ber($encoded);
if ($decoded === false) {
return null;
}
 
// encapsulate in an array for BC with the old decodeBER
return $decoded;
return [self::decode_ber($encoded)];
}
 
/**
231,7 → 219,6
* @param int $start
* @param int $encoded_pos
* @return array|bool
* @access private
*/
private static function decode_ber($encoded, $start = 0, $encoded_pos = 0)
{
529,14 → 516,9
* @param array $mapping
* @param array $special
* @return array|bool|Element|string|null
* @access public
*/
public static function asn1map($decoded, $mapping, $special = [])
public static function asn1map(array $decoded, $mapping, $special = [])
{
if (!is_array($decoded)) {
return false;
}
 
if (isset($mapping['explicit']) && is_array($decoded['content'])) {
$decoded = $decoded['content'][0];
}
827,7 → 809,6
* DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
*
* @access public
* @param string $string
* @return int
*/
854,7 → 835,6
* @param array $mapping
* @param array $special
* @return string
* @access public
*/
public static function encodeDER($source, $mapping, $special = [])
{
870,9 → 850,8
* @param int $idx
* @param array $special
* @return string
* @access private
*/
private static function encode_der($source, $mapping, $idx = null, $special = [])
private static function encode_der($source, array $mapping, $idx = null, array $special = [])
{
if ($source instanceof Element) {
return $source->element;
1157,7 → 1136,6
*
* Called by _decode_ber()
*
* @access public
* @param string $content
* @return string
*/
1210,7 → 1188,6
*
* Called by _encode_der()
*
* @access public
* @param string $source
* @return string
*/
1268,7 → 1245,6
*
* Called by _decode_ber() and in the case of implicit tags asn1map().
*
* @access private
* @param string $content
* @param int $tag
* @return \DateTime|false
1316,7 → 1292,6
*
* Sets the time / date format for asn1map().
*
* @access public
* @param string $format
*/
public static function setTimeFormat($format)
1330,10 → 1305,9
* Load the relevant OIDs for a particular ASN.1 semantic mapping.
* Previously loaded OIDs are retained.
*
* @access public
* @param array $oids
*/
public static function loadOIDs($oids)
public static function loadOIDs(array $oids)
{
self::$reverseOIDs += $oids;
self::$oids = array_flip(self::$reverseOIDs);
1345,10 → 1319,9
* See \phpseclib3\File\X509, etc, for an example.
* Previously loaded filters are not retained.
*
* @access public
* @param array $filters
*/
public static function setFilters($filters)
public static function setFilters(array $filters)
{
self::$filters = $filters;
}
1363,7 → 1336,6
* @param int $from
* @param int $to
* @return string
* @access public
*/
public static function convert($in, $from = self::TYPE_UTF8_STRING, $to = self::TYPE_UTF8_STRING)
{
1465,7 → 1437,6
/**
* Extract raw BER from Base64 encoding
*
* @access private
* @param string $str
* @return string
*/
1490,7 → 1461,7
$temp = str_replace(["\r", "\n", ' '], '', $temp);
// remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff
$temp = preg_replace('#^-+[^-]+-+|-+[^-]+-+$#', '', $temp);
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? Base64::decode($temp) : false;
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? Strings::base64_decode($temp) : false;
return $temp != false ? $temp : $str;
}
 
1500,7 → 1471,6
* DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
*
* @access public
* @param int $length
* @return string
*/
1529,7 → 1499,6
* getOID('id-sha256') == '2.16.840.1.101.3.4.2.1'
* getOID('zzz') == 'zzz'
*
* @access public
* @param string $name
* @return string
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
16,8 → 16,6
* be encoded. It can be encoded explicitly or left out all together. This would effect the signature value and thus may invalidate the
* the certificate all together unless the certificate is re-signed.
*
* @category File
* @package X509
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
26,8 → 24,7
 
namespace phpseclib3\File;
 
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\DSA;
45,9 → 42,7
/**
* Pure-PHP X.509 Parser
*
* @package X509
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class X509
{
56,7 → 51,6
*
* Not really used anymore but retained all the same to suppress E_NOTICEs from old installs
*
* @access public
*/
const VALIDATE_SIGNATURE_BY_CA = 1;
 
63,7 → 57,6
/**
* Return internal array representation
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_ARRAY = 0;
70,7 → 63,6
/**
* Return string
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_STRING = 1;
77,7 → 69,6
/**
* Return ASN.1 name string
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_ASN1 = 2;
84,7 → 75,6
/**
* Return OpenSSL compatible array
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_OPENSSL = 3;
91,7 → 81,6
/**
* Return canonical ASN.1 RDNs string
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_CANON = 4;
98,7 → 87,6
/**
* Return name hash for file indexing
*
* @access public
* @see \phpseclib3\File\X509::getDN()
*/
const DN_HASH = 5;
108,7 → 96,6
*
* ie. a base64-encoded PEM with a header and a footer
*
* @access public
* @see \phpseclib3\File\X509::saveX509()
* @see \phpseclib3\File\X509::saveCSR()
* @see \phpseclib3\File\X509::saveCRL()
117,7 → 104,6
/**
* Save as DER
*
* @access public
* @see \phpseclib3\File\X509::saveX509()
* @see \phpseclib3\File\X509::saveCSR()
* @see \phpseclib3\File\X509::saveCRL()
126,7 → 112,6
/**
* Save as a SPKAC
*
* @access public
* @see \phpseclib3\File\X509::saveX509()
* @see \phpseclib3\File\X509::saveCSR()
* @see \phpseclib3\File\X509::saveCRL()
139,7 → 124,6
*
* Used only by the load*() functions
*
* @access public
* @see \phpseclib3\File\X509::saveX509()
* @see \phpseclib3\File\X509::saveCSR()
* @see \phpseclib3\File\X509::saveCRL()
158,7 → 142,6
* Distinguished Name
*
* @var array
* @access private
*/
private $dn;
 
166,7 → 149,6
* Public key
*
* @var string|PublicKey
* @access private
*/
private $publicKey;
 
174,24 → 156,13
* Private key
*
* @var string|PrivateKey
* @access private
*/
private $privateKey;
 
/**
* Object identifiers for X.509 certificates
*
* @var array
* @access private
* @link http://en.wikipedia.org/wiki/Object_identifier
*/
private $oids;
 
/**
* The certificate authorities
*
* @var array
* @access private
*/
private $CAs;
 
199,7 → 170,6
* The currently loaded certificate
*
* @var array
* @access private
*/
private $currentCert;
 
210,7 → 180,6
* encoded so we take save the portion of the original cert that the signature would have made for.
*
* @var string
* @access private
*/
private $signatureSubject;
 
218,7 → 187,6
* Certificate Start Date
*
* @var string
* @access private
*/
private $startDate;
 
226,7 → 194,6
* Certificate End Date
*
* @var string|Element
* @access private
*/
private $endDate;
 
234,7 → 201,6
* Serial Number
*
* @var string
* @access private
*/
private $serialNumber;
 
245,7 → 211,6
* {@link http://tools.ietf.org/html/rfc5280#section-4.2.1.2 RFC5280#section-4.2.1.2}.
*
* @var string
* @access private
*/
private $currentKeyIdentifier;
 
253,7 → 218,6
* CA Flag
*
* @var bool
* @access private
*/
private $caFlag = false;
 
261,13 → 225,11
* SPKAC Challenge
*
* @var string
* @access private
*/
private $challenge;
 
/**
* @var array
* @access private
*/
private $extensionValues = [];
 
275,7 → 237,6
* OIDs loaded
*
* @var bool
* @access private
*/
private static $oidsLoaded = false;
 
283,7 → 244,6
* Recursion Limit
*
* @var int
* @access private
*/
private static $recur_limit = 5;
 
291,25 → 251,21
* URL fetch flag
*
* @var bool
* @access private
*/
private static $disable_url_fetch = false;
 
/**
* @var array
* @access private
*/
private static $extensions = [];
 
/**
* @var ?array
* @access private
*/
private $ipAddresses = null;
 
/**
* @var ?array
* @access private
*/
private $domains = null;
 
317,7 → 273,6
* Default Constructor.
*
* @return \phpseclib3\File\X509
* @access public
*/
public function __construct()
{
466,9 → 421,8
*
* Returns an associative array describing the X.509 cert or a false if the cert failed to load
*
* @param string $cert
* @param array|string $cert
* @param int $mode
* @access public
* @return mixed
*/
public function loadX509($cert, $mode = self::FORMAT_AUTO_DETECT)
505,7 → 459,7
 
$decoded = ASN1::decodeBER($cert);
 
if (!empty($decoded)) {
if ($decoded) {
$x509 = ASN1::asn1map($decoded[0], Maps\Certificate::MAP);
}
if (!isset($x509) || $x509 === false) {
542,10 → 496,9
*
* @param array $cert
* @param int $format optional
* @access public
* @return string
*/
public function saveX509($cert, $format = self::FORMAT_PEM)
public function saveX509(array $cert, $format = self::FORMAT_PEM)
{
if (!is_array($cert) || !isset($cert['tbsCertificate'])) {
return false;
604,7 → 557,7
return $cert;
// case self::FORMAT_PEM:
default:
return "-----BEGIN CERTIFICATE-----\r\n" . chunk_split(Base64::encode($cert), 64) . '-----END CERTIFICATE-----';
return "-----BEGIN CERTIFICATE-----\r\n" . chunk_split(Strings::base64_encode($cert), 64) . '-----END CERTIFICATE-----';
}
}
 
614,9 → 567,8
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapInExtensions(&$root, $path)
private function mapInExtensions(array &$root, $path)
{
$extensions = &$this->subArrayUnchecked($root, $path);
 
632,6 → 584,9
[static::class, 'decodeNameConstraintIP'] :
[static::class, 'decodeIP'];
$decoded = ASN1::decodeBER($value);
if (!$decoded) {
continue;
}
$mapped = ASN1::asn1map($decoded[0], $map, ['iPAddress' => $decoder]);
$value = $mapped === false ? $decoded[0] : $mapped;
 
646,6 → 601,9
$subvalue = &$value[$j]['policyQualifiers'][$k]['qualifier'];
if ($map !== false) {
$decoded = ASN1::decodeBER($subvalue);
if (!$decoded) {
continue;
}
$mapped = ASN1::asn1map($decoded[0], $map);
$subvalue = $mapped === false ? $decoded[0] : $mapped;
}
663,9 → 621,8
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapOutExtensions(&$root, $path)
private function mapOutExtensions(array &$root, $path)
{
$extensions = &$this->subArray($root, $path, !empty($this->extensionValues));
 
745,7 → 702,6
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapInAttributes(&$root, $path)
{
763,6 → 719,9
$value = ASN1::encodeDER($values[$j], Maps\AttributeValue::MAP);
$decoded = ASN1::decodeBER($value);
if (!is_bool($map)) {
if (!$decoded) {
continue;
}
$mapped = ASN1::asn1map($decoded[0], $map);
if ($mapped !== false) {
$values[$j] = $mapped;
785,7 → 744,6
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapOutAttributes(&$root, $path)
{
813,6 → 771,9
if (!is_bool($map)) {
$temp = ASN1::encodeDER($values[$j], $map);
$decoded = ASN1::decodeBER($temp);
if (!$decoded) {
continue;
}
$values[$j] = ASN1::asn1map($decoded[0], Maps\AttributeValue::MAP);
}
}
827,9 → 788,8
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapInDNs(&$root, $path)
private function mapInDNs(array &$root, $path)
{
$dns = &$this->subArray($root, $path);
 
842,6 → 802,9
$map = $this->getMapping($type);
if (!is_bool($map)) {
$decoded = ASN1::decodeBER($value);
if (!$decoded) {
continue;
}
$value = ASN1::asn1map($decoded[0], $map);
}
}
856,9 → 819,8
*
* @param array $root (by reference)
* @param string $path
* @access private
*/
private function mapOutDNs(&$root, $path)
private function mapOutDNs(array &$root, $path)
{
$dns = &$this->subArray($root, $path);
 
885,7 → 847,6
* Associate an extension ID to an extension mapping
*
* @param string $extnId
* @access private
* @return mixed
*/
private function getMapping($extnId)
995,7 → 956,6
* Load an X.509 certificate as a certificate authority
*
* @param string $cert
* @access public
* @return bool
*/
public function loadCA($cert)
1062,7 → 1022,6
* not bar.foo.a.com. f*.com matches foo.com but not bar.com.
*
* @param string $url
* @access public
* @return bool
*/
public function validateURL($url)
1122,7 → 1081,6
* If $date isn't defined it is assumed to be the current date.
*
* @param \DateTimeInterface|string $date optional
* @access public
* @return bool
*/
public function validateDate($date = null)
1155,7 → 1113,6
* Fetches a URL
*
* @param string $url
* @access private
* @return bool|string
*/
private static function fetchURL($url)
1172,7 → 1129,11
if (!$fsock) {
return false;
}
fputs($fsock, "GET $parts[path] HTTP/1.0\r\n");
$path = $parts['path'];
if (isset($parts['query'])) {
$path .= '?' . $parts['query'];
}
fputs($fsock, "GET $path HTTP/1.0\r\n");
fputs($fsock, "Host: $parts[host]\r\n\r\n");
$line = fgets($fsock, 1024);
if (strlen($line) < 3) {
1211,7 → 1172,6
*
* @param bool $caonly
* @param int $count
* @access private
* @return bool
*/
private function testForIntermediate($caonly, $count)
1278,7 → 1238,6
* The behavior of this function is inspired by {@link http://php.net/openssl-verify openssl_verify}.
*
* @param bool $caonly optional
* @access public
* @return mixed
*/
public function validateSignature($caonly = true)
1293,7 → 1252,6
*
* @param bool $caonly
* @param int $count
* @access private
* @return mixed
*/
private function validateSignatureCountable($caonly, $count)
1427,7 → 1385,6
* @param string $signatureAlgorithm
* @param string $signature
* @param string $signatureSubject
* @access private
* @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
* @return bool
*/
1440,6 → 1397,8
case 'rsaEncryption':
$key = RSA::loadFormat('PKCS8', $publicKey);
switch ($signatureAlgorithm) {
case 'id-RSASSA-PSS':
break;
case 'md2WithRSAEncryption':
case 'md5WithRSAEncryption':
case 'sha1WithRSAEncryption':
1502,7 → 1461,6
* that we set a recursion limit. A negative number means that there is no recursion limit.
*
* @param int $count
* @access public
*/
public static function setRecurLimit($count)
{
1512,7 → 1470,6
/**
* Prevents URIs from being automatically retrieved
*
* @access public
*/
public static function disableURLFetch()
{
1522,7 → 1479,6
/**
* Allows URIs to be automatically retrieved
*
* @access public
*/
public static function enableURLFetch()
{
1535,7 → 1491,6
* Takes in a base64 encoded "blob" and returns a human readable IP address
*
* @param string $ip
* @access private
* @return string
*/
public static function decodeIP($ip)
1549,7 → 1504,6
* Takes in a base64 encoded "blob" and returns a human readable IP address / mask
*
* @param string $ip
* @access private
* @return array
*/
public static function decodeNameConstraintIP($ip)
1566,7 → 1520,6
* Takes a human readable IP address into a base64-encoded "blob"
*
* @param string|array $ip
* @access private
* @return string
*/
public static function encodeIP($ip)
1580,7 → 1533,6
* "Normalizes" a Distinguished Name property
*
* @param string $propName
* @access private
* @return mixed
*/
private function translateDNProp($propName)
1674,7 → 1626,6
* @param string $propName
* @param mixed $propValue
* @param string $type optional
* @access public
* @return bool
*/
public function setDNProp($propName, $propValue, $type = 'utf8String')
1706,7 → 1657,6
* Remove Distinguished Name properties
*
* @param string $propName
* @access public
*/
public function removeDNProp($propName)
{
1740,9 → 1690,8
* @param array $dn optional
* @param bool $withType optional
* @return mixed
* @access public
*/
public function getDNProp($propName, $dn = null, $withType = false)
public function getDNProp($propName, array $dn = null, $withType = false)
{
if (!isset($dn)) {
$dn = $this->dn;
1784,6 → 1733,9
$map = $this->getMapping($propName);
if (!is_bool($map)) {
$decoded = ASN1::decodeBER($v);
if (!$decoded) {
return false;
}
$v = ASN1::asn1map($decoded[0], $map);
}
}
1801,7 → 1753,6
* @param mixed $dn
* @param bool $merge optional
* @param string $type optional
* @access public
* @return bool
*/
public function setDN($dn, $merge = false, $type = 'utf8String')
1843,10 → 1794,9
*
* @param mixed $format optional
* @param array $dn optional
* @access public
* @return array|bool|string
*/
public function getDN($format = self::DN_ARRAY, $dn = null)
public function getDN($format = self::DN_ARRAY, array $dn = null)
{
if (!isset($dn)) {
$dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
1895,7 → 1845,7
$hash = new Hash('sha1');
$hash = $hash->hash($dn);
extract(unpack('Vhash', $hash));
return strtolower(Hex::encode(pack('N', $hash)));
return strtolower(Strings::bin2hex(pack('N', $hash)));
}
 
// Default is to return a string.
1985,7 → 1935,6
* Get the Distinguished Name for a certificate/crl issuer
*
* @param int $format optional
* @access public
* @return mixed
*/
public function getIssuerDN($format = self::DN_ARRAY)
2007,7 → 1956,6
* Alias of getDN()
*
* @param int $format optional
* @access public
* @return mixed
*/
public function getSubjectDN($format = self::DN_ARRAY)
2031,7 → 1979,6
*
* @param string $propName
* @param bool $withType optional
* @access public
* @return mixed
*/
public function getIssuerDNProp($propName, $withType = false)
2053,7 → 2000,6
*
* @param string $propName
* @param bool $withType optional
* @access public
* @return mixed
*/
public function getSubjectDNProp($propName, $withType = false)
2075,7 → 2021,6
/**
* Get the certificate chain for the current cert
*
* @access public
* @return mixed
*/
public function getChain()
2120,7 → 2065,6
/**
* Returns the current cert
*
* @access public
* @return array|bool
*/
public function &getCurrentCert()
2134,7 → 2078,6
* Key needs to be a \phpseclib3\Crypt\RSA object
*
* @param PublicKey $key
* @access public
* @return void
*/
public function setPublicKey(PublicKey $key)
2148,7 → 2091,6
* Key needs to be a \phpseclib3\Crypt\RSA object
*
* @param PrivateKey $key
* @access public
*/
public function setPrivateKey(PrivateKey $key)
{
2161,7 → 2103,6
* Used for SPKAC CSR's
*
* @param string $challenge
* @access public
*/
public function setChallenge($challenge)
{
2173,7 → 2114,6
*
* Returns a \phpseclib3\Crypt\RSA object or a false.
*
* @access public
* @return mixed
*/
public function getPublicKey()
2223,7 → 2163,6
* @param string $csr
* @param int $mode
* @return mixed
* @access public
*/
public function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT)
{
2258,7 → 2197,7
 
$decoded = ASN1::decodeBER($csr);
 
if (empty($decoded)) {
if (!$decoded) {
$this->currentCert = false;
return false;
}
2297,10 → 2236,9
*
* @param array $csr
* @param int $format optional
* @access public
* @return string
*/
public function saveCSR($csr, $format = self::FORMAT_PEM)
public function saveCSR(array $csr, $format = self::FORMAT_PEM)
{
if (!is_array($csr) || !isset($csr['certificationRequestInfo'])) {
return false;
2331,7 → 2269,7
return $csr;
// case self::FORMAT_PEM:
default:
return "-----BEGIN CERTIFICATE REQUEST-----\r\n" . chunk_split(Base64::encode($csr), 64) . '-----END CERTIFICATE REQUEST-----';
return "-----BEGIN CERTIFICATE REQUEST-----\r\n" . chunk_split(Strings::base64_encode($csr), 64) . '-----END CERTIFICATE REQUEST-----';
}
}
 
2343,7 → 2281,6
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
*
* @param string $spkac
* @access public
* @return mixed
*/
public function loadSPKAC($spkac)
2360,7 → 2297,7
 
// OpenSSL produces SPKAC's that are preceded by the string SPKAC=
$temp = preg_replace('#(?:SPKAC=)|[ \r\n\\\]#', '', $spkac);
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? Base64::decode($temp) : false;
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? Strings::base64_decode($temp) : false;
if ($temp != false) {
$spkac = $temp;
}
2373,7 → 2310,7
 
$decoded = ASN1::decodeBER($spkac);
 
if (empty($decoded)) {
if (!$decoded) {
$this->currentCert = false;
return false;
}
2408,10 → 2345,9
*
* @param array $spkac
* @param int $format optional
* @access public
* @return string
*/
public function saveSPKAC($spkac, $format = self::FORMAT_PEM)
public function saveSPKAC(array $spkac, $format = self::FORMAT_PEM)
{
if (!is_array($spkac) || !isset($spkac['publicKeyAndChallenge'])) {
return false;
2437,7 → 2373,7
default:
// OpenSSL's implementation of SPKAC requires the SPKAC be preceded by SPKAC= and since there are pretty much
// no other SPKAC decoders phpseclib will use that same format
return 'SPKAC=' . Base64::encode($spkac);
return 'SPKAC=' . Strings::base64_encode($spkac);
}
}
 
2447,7 → 2383,6
* @param string $crl
* @param int $mode
* @return mixed
* @access public
*/
public function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT)
{
2473,7 → 2408,7
 
$decoded = ASN1::decodeBER($crl);
 
if (empty($decoded)) {
if (!$decoded) {
$this->currentCert = false;
return false;
}
2513,10 → 2448,9
*
* @param array $crl
* @param int $format optional
* @access public
* @return string
*/
public function saveCRL($crl, $format = self::FORMAT_PEM)
public function saveCRL(array $crl, $format = self::FORMAT_PEM)
{
if (!is_array($crl) || !isset($crl['tbsCertList'])) {
return false;
2558,7 → 2492,7
return $crl;
// case self::FORMAT_PEM:
default:
return "-----BEGIN X509 CRL-----\r\n" . chunk_split(Base64::encode($crl), 64) . '-----END X509 CRL-----';
return "-----BEGIN X509 CRL-----\r\n" . chunk_split(Strings::base64_encode($crl), 64) . '-----END X509 CRL-----';
}
}
 
2571,7 → 2505,6
* by choosing utcTime iff year of date given is before 2050 and generalTime else.
*
* @param string $date in format date('D, d M Y H:i:s O')
* @access private
* @return array|Element
*/
private function timeField($date)
2595,12 → 2528,9
* $subject can be either an existing X.509 cert (if you want to resign it),
* a CSR or something with the DN and public key explicitly set.
*
* @param \phpseclib3\File\X509 $issuer
* @param \phpseclib3\File\X509 $subject
* @access public
* @return mixed
*/
public function sign($issuer, $subject)
public function sign(X509 $issuer, X509 $subject)
{
if (!is_object($issuer->privateKey) || empty($issuer->dn)) {
return false;
2613,15 → 2543,6
$currentCert = isset($this->currentCert) ? $this->currentCert : null;
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
$signatureAlgorithm = self::identifySignatureAlgorithm($issuer->privateKey);
if ($signatureAlgorithm != 'id-RSASSA-PSS') {
$signatureAlgorithm = ['algorithm' => $signatureAlgorithm];
} else {
$r = PSS::load($issuer->privateKey->withPassword()->toString('PSS'));
$signatureAlgorithm = [
'algorithm' => 'id-RSASSA-PSS',
'parameters' => PSS::savePSSParams($r)
];
}
 
if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
$this->currentCert = $subject->currentCert;
2628,7 → 2549,6
$this->currentCert['tbsCertificate']['signature'] = $signatureAlgorithm;
$this->currentCert['signatureAlgorithm'] = $signatureAlgorithm;
 
 
if (!empty($this->startDate)) {
$this->currentCert['tbsCertificate']['validity']['notBefore'] = $this->timeField($this->startDate);
}
2790,7 → 2710,6
/**
* Sign a CSR
*
* @access public
* @return mixed
*/
public function signCSR()
2809,7 → 2728,7
$signatureAlgorithm = self::identifySignatureAlgorithm($this->privateKey);
 
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
$this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
$this->currentCert['signatureAlgorithm'] = $signatureAlgorithm;
if (!empty($this->dn)) {
$this->currentCert['certificationRequestInfo']['subject'] = $this->dn;
}
2822,7 → 2741,7
'subject' => $this->dn,
'subjectPKInfo' => $publicKey
],
'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm],
'signatureAlgorithm' => $signatureAlgorithm,
'signature' => false // this is going to be overwritten later
];
}
2845,7 → 2764,6
/**
* Sign a SPKAC
*
* @access public
* @return mixed
*/
public function signSPKAC()
2865,7 → 2783,7
 
// re-signing a SPKAC seems silly but since everything else supports re-signing why not?
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['publicKeyAndChallenge'])) {
$this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
$this->currentCert['signatureAlgorithm'] = $signatureAlgorithm;
$this->currentCert['publicKeyAndChallenge']['spki'] = $publicKey;
if (!empty($this->challenge)) {
// the bitwise AND ensures that the output is a valid IA5String
2883,7 → 2801,7
// Random::string(8) & str_repeat("\x7F", 8)
'challenge' => !empty($this->challenge) ? $this->challenge : ''
],
'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm],
'signatureAlgorithm' => $signatureAlgorithm,
'signature' => false // this is going to be overwritten later
];
}
2908,12 → 2826,9
*
* $issuer's private key needs to be loaded.
*
* @param \phpseclib3\File\X509 $issuer
* @param \phpseclib3\File\X509 $crl
* @access public
* @return mixed
*/
public function signCRL($issuer, $crl)
public function signCRL(X509 $issuer, X509 $crl)
{
if (!is_object($issuer->privateKey) || empty($issuer->dn)) {
return false;
2928,18 → 2843,18
 
if (isset($crl->currentCert) && is_array($crl->currentCert) && isset($crl->currentCert['tbsCertList'])) {
$this->currentCert = $crl->currentCert;
$this->currentCert['tbsCertList']['signature']['algorithm'] = $signatureAlgorithm;
$this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
$this->currentCert['tbsCertList']['signature'] = $signatureAlgorithm;
$this->currentCert['signatureAlgorithm'] = $signatureAlgorithm;
} else {
$this->currentCert = [
'tbsCertList' =>
[
'version' => 'v2',
'signature' => ['algorithm' => $signatureAlgorithm],
'signature' => $signatureAlgorithm,
'issuer' => false, // this is going to be overwritten later
'thisUpdate' => $this->timeField($thisUpdate) // $this->setStartDate()
],
'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm],
'signatureAlgorithm' => $signatureAlgorithm,
'signature' => false // this is going to be overwritten later
];
}
3041,15 → 2956,18
* Identify signature algorithm from key settings
*
* @param PrivateKey $key
* @access private
* @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
* @return string
* @return array
*/
private static function identifySignatureAlgorithm(PrivateKey $key)
{
if ($key instanceof RSA) {
if ($key->getPadding() & RSA::SIGNATURE_PSS) {
return 'id-RSASSA-PSS';
$r = PSS::load($key->withPassword()->toString('PSS'));
return [
'algorithm' => 'id-RSASSA-PSS',
'parameters' => PSS::savePSSParams($r)
];
}
switch ($key->getHash()) {
case 'md2':
3059,7 → 2977,7
case 'sha256':
case 'sha384':
case 'sha512':
return $key->getHash() . 'WithRSAEncryption';
return ['algorithm' => $key->getHash() . 'WithRSAEncryption'];
}
throw new UnsupportedAlgorithmException('The only supported hash algorithms for RSA are: md2, md5, sha1, sha224, sha256, sha384, sha512');
}
3069,7 → 2987,7
case 'sha1':
case 'sha224':
case 'sha256':
return 'id-dsa-with-' . $key->getHash();
return ['algorithm' => 'id-dsa-with-' . $key->getHash()];
}
throw new UnsupportedAlgorithmException('The only supported hash algorithms for DSA are: sha1, sha224, sha256');
}
3078,7 → 2996,7
switch ($key->getCurve()) {
case 'Ed25519':
case 'Ed448':
return 'id-' . $key->getCurve();
return ['algorithm' => 'id-' . $key->getCurve()];
}
switch ($key->getHash()) {
case 'sha1':
3086,7 → 3004,7
case 'sha256':
case 'sha384':
case 'sha512':
return 'ecdsa-with-' . strtoupper($key->getHash());
return ['algorithm' => 'ecdsa-with-' . strtoupper($key->getHash())];
}
throw new UnsupportedAlgorithmException('The only supported hash algorithms for EC are: sha1, sha224, sha256, sha384, sha512');
}
3098,7 → 3016,6
* Set certificate start date
*
* @param \DateTimeInterface|string $date
* @access public
*/
public function setStartDate($date)
{
3113,7 → 3030,6
* Set certificate end date
*
* @param \DateTimeInterface|string $date
* @access public
*/
public function setEndDate($date)
{
3142,7 → 3058,6
*
* @param string $serial
* @param int $base optional
* @access public
*/
public function setSerialNumber($serial, $base = -256)
{
3152,7 → 3067,6
/**
* Turns the certificate into a certificate authority
*
* @access public
*/
public function makeCA()
{
3169,9 → 3083,8
* @param array $root
* @param string $path
* @return boolean
* @access private
*/
private function isSubArrayValid($root, $path)
private function isSubArrayValid(array $root, $path)
{
if (!is_array($root)) {
return false;
3205,10 → 3118,9
* @param array $root
* @param string $path absolute path with / as component separator
* @param bool $create optional
* @access private
* @return array|false
*/
private function &subArrayUnchecked(&$root, $path, $create = false)
private function &subArrayUnchecked(array &$root, $path, $create = false)
{
$false = false;
 
3233,10 → 3145,9
* @param array $root
* @param string $path absolute path with / as component separator
* @param bool $create optional
* @access private
* @return array|false
*/
private function &subArray(&$root, $path, $create = false)
private function &subArray(array &$root = null, $path, $create = false)
{
$false = false;
 
3269,10 → 3180,9
* @param array $root
* @param string $path optional absolute path with / as component separator
* @param bool $create optional
* @access private
* @return array|false
*/
private function &extensions(&$root, $path = null, $create = false)
private function &extensions(array &$root = null, $path = null, $create = false)
{
if (!isset($root)) {
$root = $this->currentCert;
3323,7 → 3233,6
*
* @param string $id
* @param string $path optional
* @access private
* @return bool
*/
private function removeExtensionHelper($id, $path = null)
3358,10 → 3267,9
* @param string $id
* @param array $cert optional
* @param string $path optional
* @access private
* @return mixed
*/
private function getExtensionHelper($id, $cert = null, $path = null)
private function getExtensionHelper($id, array $cert = null, $path = null)
{
$extensions = $this->extensions($cert, $path);
 
3383,10 → 3291,9
*
* @param array $cert optional
* @param string $path optional
* @access private
* @return array
*/
private function getExtensionsHelper($cert = null, $path = null)
private function getExtensionsHelper(array $cert = null, $path = null)
{
$exts = $this->extensions($cert, $path);
$extensions = [];
3408,7 → 3315,6
* @param bool $critical optional
* @param bool $replace optional
* @param string $path optional
* @access private
* @return bool
*/
private function setExtensionHelper($id, $value, $critical = false, $replace = true, $path = null)
3440,7 → 3346,6
* Remove a certificate, CSR or CRL Extension
*
* @param string $id
* @access public
* @return bool
*/
public function removeExtension($id)
3456,10 → 3361,9
* @param string $id
* @param array $cert optional
* @param string $path
* @access public
* @return mixed
*/
public function getExtension($id, $cert = null, $path = null)
public function getExtension($id, array $cert = null, $path = null)
{
return $this->getExtensionHelper($id, $cert, $path);
}
3469,10 → 3373,9
*
* @param array $cert optional
* @param string $path optional
* @access public
* @return array
*/
public function getExtensions($cert = null, $path = null)
public function getExtensions(array $cert = null, $path = null)
{
return $this->getExtensionsHelper($cert, $path);
}
3484,7 → 3387,6
* @param mixed $value
* @param bool $critical optional
* @param bool $replace optional
* @access public
* @return bool
*/
public function setExtension($id, $value, $critical = false, $replace = true)
3497,7 → 3399,6
*
* @param string $id
* @param int $disposition optional
* @access public
* @return bool
*/
public function removeAttribute($id, $disposition = self::ATTR_ALL)
3548,10 → 3449,9
* @param string $id
* @param int $disposition optional
* @param array $csr optional
* @access public
* @return mixed
*/
public function getAttribute($id, $disposition = self::ATTR_ALL, $csr = null)
public function getAttribute($id, $disposition = self::ATTR_ALL, array $csr = null)
{
if (empty($csr)) {
$csr = $this->currentCert;
3588,10 → 3488,9
* Returns a list of all CSR attributes in use
*
* @param array $csr optional
* @access public
* @return array
*/
public function getAttributes($csr = null)
public function getAttributes(array $csr = null)
{
if (empty($csr)) {
$csr = $this->currentCert;
3615,7 → 3514,6
* @param string $id
* @param mixed $value
* @param int $disposition optional
* @access public
* @return bool
*/
public function setAttribute($id, $value, $disposition = self::ATTR_ALL)
3672,7 → 3570,6
* This is used by the id-ce-authorityKeyIdentifier and the id-ce-subjectKeyIdentifier extensions.
*
* @param string $value
* @access public
*/
public function setKeyIdentifier($value)
{
3698,7 → 3595,6
*
* @param mixed $key optional
* @param int $method optional
* @access public
* @return string binary key identifier
*/
public function computeKeyIdentifier($key = null, $method = 1)
3719,7 → 3615,7
case $key instanceof Element:
// Assume the element is a bitstring-packed key.
$decoded = ASN1::decodeBER($key->element);
if (empty($decoded)) {
if (!$decoded) {
return false;
}
$raw = ASN1::asn1map($decoded[0], ['type' => ASN1::TYPE_BIT_STRING]);
3767,7 → 3663,6
/**
* Format a public key as appropriate
*
* @access private
* @return array|false
*/
private function formatSubjectPublicKey()
3779,6 → 3674,9
$publicKey = base64_decode(preg_replace('#-.+-|[\r\n]#', '', $this->publicKey->toString($format)));
 
$decoded = ASN1::decodeBER($publicKey);
if (!$decoded) {
return false;
}
$mapped = ASN1::asn1map($decoded[0], Maps\SubjectPublicKeyInfo::MAP);
if (!is_array($mapped)) {
return false;
3793,7 → 3691,6
* Set the domain name's which the cert is to be valid for
*
* @param mixed ...$domains
* @access public
* @return void
*/
public function setDomain(...$domains)
3806,7 → 3703,6
/**
* Set the IP Addresses's which the cert is to be valid for
*
* @access public
* @param mixed[] ...$ipAddresses
*/
public function setIPAddress(...$ipAddresses)
3823,11 → 3719,10
/**
* Helper function to build domain array
*
* @access private
* @param string $domain
* @return array
*/
private function dnsName($domain)
private static function dnsName($domain)
{
return ['dNSName' => $domain];
}
3837,7 → 3732,6
*
* (IPv6 is not currently supported)
*
* @access private
* @param string $address
* @return array
*/
3852,10 → 3746,9
* @param array $rclist
* @param string $serial
* @param bool $create optional
* @access private
* @return int|false
*/
private function revokedCertificate(&$rclist, $serial, $create = false)
private function revokedCertificate(array &$rclist, $serial, $create = false)
{
$serial = new BigInteger($serial);
 
3881,7 → 3774,6
*
* @param string $serial
* @param string $date optional
* @access public
* @return bool
*/
public function revoke($serial, $date = null)
3907,7 → 3799,6
* Unrevoke a certificate.
*
* @param string $serial
* @access public
* @return bool
*/
public function unrevoke($serial)
3927,7 → 3818,6
* Get a revoked certificate.
*
* @param string $serial
* @access public
* @return mixed
*/
public function getRevoked($serial)
3945,10 → 3835,9
* List revoked certificates
*
* @param array $crl optional
* @access public
* @return array|bool
*/
public function listRevoked($crl = null)
public function listRevoked(array $crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
3974,7 → 3863,6
*
* @param string $serial
* @param string $id
* @access public
* @return bool
*/
public function removeRevokedCertificateExtension($serial, $id)
3996,10 → 3884,9
* @param string $serial
* @param string $id
* @param array $crl optional
* @access public
* @return mixed
*/
public function getRevokedCertificateExtension($serial, $id, $crl = null)
public function getRevokedCertificateExtension($serial, $id, array $crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
4019,10 → 3906,9
*
* @param string $serial
* @param array $crl optional
* @access public
* @return array|bool
*/
public function getRevokedCertificateExtensions($serial, $crl = null)
public function getRevokedCertificateExtensions($serial, array $crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
4045,7 → 3931,6
* @param mixed $value
* @param bool $critical optional
* @param bool $replace optional
* @access public
* @return bool
*/
public function setRevokedCertificateExtension($serial, $id, $value, $critical = false, $replace = true)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Base.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Sliding Window Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Base extends BCMath
{
31,13 → 27,11
*
* $cache[self::VARIABLE] tells us whether or not the cached data is still valid.
*
* @access private
*/
const VARIABLE = 0;
/**
* $cache[self::DATA] contains the cached data.
*
* @access private
*/
const DATA = 1;
 
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* Built-In BCMath Modular Exponentiation Engine
*
* @package BCMath
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class BuiltIn extends BCMath
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Default Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DefaultEngine extends Barrett
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/OpenSSL.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OpenSSL Modular Exponentiation Engine
*
* @package BCMath
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSL extends Progenitor
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Barrett Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Barrett extends Base
{
31,13 → 27,11
*
* $cache[self::VARIABLE] tells us whether or not the cached data is still valid.
*
* @access private
*/
const VARIABLE = 0;
/**
* $cache[self::DATA] contains the cached data.
*
* @access private
*/
const DATA = 1;
 
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* PHP Barrett Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EvalBarrett extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,15 → 13,13
 
namespace phpseclib3\Math\BigInteger\Engines;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\BadConfigurationException;
 
/**
* BCMath Engine.
*
* @package BCMath
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class BCMath extends Engine
{
32,7 → 28,6
*
* @see parent::bitwise_leftRotate()
* @see parent::bitwise_rightRotate()
* @access protected
*/
const FAST_BITWISE = false;
 
40,7 → 35,6
* Engine Directory
*
* @see parent::setModExpEngine
* @access protected
*/
const ENGINE_DIR = 'BCMath';
 
87,7 → 81,7
switch (abs($base)) {
case 256:
// round $len to the nearest 4
$len = (strlen($this->value) + 3) & 0xFFFFFFFC;
$len = (strlen($this->value) + 3) & ~3;
 
$x = str_pad($this->value, $len, chr(0), STR_PAD_LEFT);
 
109,7 → 103,7
break;
case 16:
$x = (strlen($this->value) & 1) ? '0' . $this->value : $this->value;
$temp = new self(Hex::decode($x), 256);
$temp = new self(Strings::hex2bin($x), 256);
$this->value = $this->is_negative ? '-' . $temp->value : $temp->value;
$this->is_negative = false;
break;
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,7 → 13,6
 
namespace phpseclib3\Math\BigInteger\Engines;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Random;
use phpseclib3\Exception\BadConfigurationException;
24,9 → 21,7
/**
* Base Engine.
*
* @package Engine
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Engine implements \JsonSerializable
{
176,7 → 171,7
$is_negative = false;
if ($base < 0 && hexdec($x[0]) >= 8) {
$this->is_negative = $is_negative = true;
$x = Hex::encode(~Hex::decode($x));
$x = Strings::bin2hex(~Strings::hex2bin($x));
}
 
$this->value = $x;
274,7 → 269,7
*/
public function toHex($twos_compliment = false)
{
return Hex::encode($this->toBytes($twos_compliment));
return Strings::bin2hex($this->toBytes($twos_compliment));
}
 
/**
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GMP Modular Exponentiation Engine
*
* @package GMP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DefaultEngine extends GMP
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/GMP.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* GMP Engine.
*
* @package GMP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class GMP extends Engine
{
31,7 → 27,6
*
* @see parent::bitwise_leftRotate()
* @see parent::bitwise_rightRotate()
* @access protected
*/
const FAST_BITWISE = true;
 
39,7 → 34,6
* Engine Directory
*
* @see parent::setModExpEngine
* @access protected
*/
const ENGINE_DIR = 'GMP';
 
246,7 → 240,6
*
* @param GMP $y
* @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
*/
public function compare(GMP $y)
330,7 → 323,6
* Absolute value.
*
* @return GMP
* @access public
*/
public function abs()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/OpenSSL.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* OpenSSL Modular Exponentiation Engine
*
* @package Engines
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSL
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Base.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Base extends PHP
{
31,13 → 27,11
*
* $cache[self::VARIABLE] tells us whether or not the cached data is still valid.
*
* @access private
*/
const VARIABLE = 0;
/**
* $cache[self::DATA] contains the cached data.
*
* @access private
*/
const DATA = 1;
 
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/DefaultEngine.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Default Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class DefaultEngine extends EvalBarrett
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,9 → 20,7
/**
* PHP Montgomery Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Montgomery extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/OpenSSL.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* OpenSSL Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class OpenSSL extends Progenitor
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* PHP Barrett Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Barrett extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Classic Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Classic extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
21,9 → 19,7
/**
* PHP Dynamic Barrett Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class EvalBarrett extends Base
{
68,7 → 64,7
$lhs->value = $x;
$rhs = new ' . $class . '();
$rhs->value = [' .
implode(',', array_map('self::float2string', $m->value)) . '];
implode(',', array_map(self::class . '::float2string', $m->value)) . '];
list(, $temp) = $lhs->divide($rhs);
return $temp->value;
';
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Montgomery Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Montgomery extends Progenitor
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Montgomery Modular Exponentiation Engine with interleaved multiplication
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class MontgomeryMult extends Montgomery
{
34,7 → 30,6
*
* @see self::_prepMontgomery()
* @see self::_montgomery()
* @access private
* @param array $x
* @param array $y
* @param array $m
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/PowerOfTwo.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
/**
* PHP Power Of Two Modular Exponentiation Engine
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PowerOfTwo extends Base
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
15,15 → 13,13
 
namespace phpseclib3\Math\BigInteger\Engines;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\BadConfigurationException;
 
/**
* Pure-PHP Engine.
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class PHP extends Engine
{
33,7 → 29,6
* Rather than create a thousands and thousands of new BigInteger objects in repeated function calls to add() and
* multiply() or whatever, we'll just work directly on arrays, taking them in as parameters and returning them.
*
* @access protected
*/
/**
* $result[self::VALUE] contains the value.
50,7 → 45,6
*
* At what point do we switch between Karatsuba multiplication and schoolbook long multiplication?
*
* @access private
*/
const KARATSUBA_CUTOFF = 25;
 
59,7 → 53,6
*
* @see parent::bitwise_leftRotate()
* @see parent::bitwise_rightRotate()
* @access protected
*/
const FAST_BITWISE = true;
 
67,7 → 60,6
* Engine Directory
*
* @see parent::setModExpEngine
* @access protected
*/
const ENGINE_DIR = 'PHP';
 
103,7 → 95,7
switch (abs($base)) {
case 16:
$x = (strlen($this->value) & 1) ? '0' . $this->value : $this->value;
$temp = new static(Hex::decode($x), 256);
$temp = new static(Strings::hex2bin($x), 256);
$this->value = $temp->value;
break;
case 10:
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
*
* Uses 64-bit floats if int size is 4 bits
*
* @package PHP32
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PHP32 extends PHP
{
79,9 → 75,12
$i = 0;
}
list(, $digit) = unpack('N', substr($val, $i, 4));
if ($digit < 0) {
$digit += 0xFFFFFFFF + 1;
}
$step = count($vals) & 3;
if ($step) {
$digit >>= 2 * $step;
$digit = floor($digit / pow(2, 2 * $step));
}
if ($step != 3) {
$digit &= static::MAX_DIGIT;
247,7 → 246,6
*
* @param PHP32 $y
* @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
*/
public function compare(PHP32 $y)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP64.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
20,9 → 18,7
*
* Uses 64-bit integers if int size is 8 bits
*
* @package PHP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PHP64 extends PHP
{
251,7 → 247,6
*
* @param PHP64 $y
* @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
*/
public function compare(PHP64 $y)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
20,8 → 20,6
* ?>
* </code>
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
36,9 → 34,7
* Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256
* numbers.
*
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class BigInteger implements \JsonSerializable
{
366,7 → 362,6
* Absolute value.
*
* @return BigInteger
* @access public
*/
public function abs()
{
493,7 → 488,6
*
* @param BigInteger $y
* @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
*/
public function compare(BigInteger $y)
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BinaryField/Integer.php
13,8 → 13,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
22,7 → 20,7
 
namespace phpseclib3\Math\BinaryField;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
30,9 → 28,7
/**
* Binary Finite Fields
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Integer extends Base
{
476,7 → 472,7
*/
public function toHex()
{
return Hex::encode($this->toBytes());
return Strings::bin2hex($this->toBytes());
}
 
/**
503,7 → 499,6
/**
* __toString() magic method
*
* @access public
*/
public function __toString()
{
513,7 → 508,6
/**
* __debugInfo() magic method
*
* @access public
*/
public function __debugInfo()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/BinaryField.php
7,8 → 7,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Binary Finite Fields
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class BinaryField extends FiniteField
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/Common/FiniteField/Integer.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
17,9 → 15,7
/**
* Finite Field Integer
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class Integer implements \JsonSerializable
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/Common/FiniteField.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
17,9 → 15,7
/**
* Finite Fields
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class FiniteField
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php
5,8 → 5,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
14,7 → 12,7
 
namespace phpseclib3\Math\PrimeField;
 
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
 
21,9 → 19,7
/**
* Prime Finite Fields
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Integer extends Base
{
327,7 → 323,7
*/
public function toHex()
{
return Hex::encode($this->toBytes());
return Strings::bin2hex($this->toBytes());
}
 
/**
401,7 → 397,6
/**
* __toString() magic method
*
* @access public
* @return string
*/
public function __toString()
412,7 → 407,6
/**
* __debugInfo() magic method
*
* @access public
* @return array
*/
public function __debugInfo()
/trunk/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField.php
7,8 → 7,6
*
* PHP version 5 and 7
*
* @category Math
* @package BigInteger
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2017 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
23,9 → 21,7
/**
* Prime Finite Fields
*
* @package Math
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrimeField extends FiniteField
{
52,8 → 48,6
// throw new \UnexpectedValueException('PrimeField requires a prime number be passed to the constructor');
//}
 
$this->modulo = $modulo;
 
$this->instanceID = self::$instanceCounter++;
Integer::setModulo($this->instanceID, $modulo);
Integer::setRecurringModuloFunction($this->instanceID, $modulo->createRecurringModuloFunction());
/trunk/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php
7,8 → 7,6
*
* PHP version 5
*
* @category Net
* @package SFTP
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2013 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
24,9 → 22,7
/**
* SFTP Stream Wrapper
*
* @package SFTP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Stream
{
43,7 → 39,6
* SFTP instance
*
* @var object
* @access private
*/
private $sftp;
 
51,7 → 46,6
* Path
*
* @var string
* @access private
*/
private $path;
 
59,7 → 53,6
* Mode
*
* @var string
* @access private
*/
private $mode;
 
67,7 → 60,6
* Position
*
* @var int
* @access private
*/
private $pos;
 
75,7 → 67,6
* Size
*
* @var int
* @access private
*/
private $size;
 
83,7 → 74,6
* Directory entries
*
* @var array
* @access private
*/
private $entries;
 
91,7 → 81,6
* EOF flag
*
* @var bool
* @access private
*/
private $eof;
 
101,7 → 90,6
* Technically this needs to be publicly accessible so PHP can set it directly
*
* @var resource
* @access public
*/
public $context;
 
109,7 → 97,6
* Notification callback function
*
* @var callable
* @access public
*/
private $notification;
 
118,7 → 105,6
*
* @param string $protocol The wrapper name to be registered.
* @return bool True on success, false otherwise.
* @access public
*/
public static function register($protocol = 'sftp')
{
131,7 → 117,6
/**
* The Constructor
*
* @access public
*/
public function __construct()
{
150,7 → 135,6
*
* @param string $path
* @return string
* @access private
*/
protected function parse_path($path)
{
255,7 → 239,6
* @param int $options
* @param string $opened_path
* @return bool
* @access public
*/
private function _stream_open($path, $mode, $options, &$opened_path)
{
297,7 → 280,6
*
* @param int $count
* @return mixed
* @access public
*/
private function _stream_read($count)
{
339,7 → 321,6
*
* @param string $data
* @return int|false
* @access public
*/
private function _stream_write($data)
{
373,7 → 354,6
* Retrieve the current position of a stream
*
* @return int
* @access public
*/
private function _stream_tell()
{
391,7 → 371,6
* will return false. do fread($fp, 1) and feof() will then return true.
*
* @return bool
* @access public
*/
private function _stream_eof()
{
404,7 → 383,6
* @param int $offset
* @param int $whence
* @return bool
* @access public
*/
private function _stream_seek($offset, $whence)
{
433,7 → 411,6
* @param int $option
* @param mixed $var
* @return bool
* @access public
*/
private function _stream_metadata($path, $option, $var)
{
467,7 → 444,6
*
* @param int $cast_as
* @return resource
* @access public
*/
private function _stream_cast($cast_as)
{
479,7 → 455,6
*
* @param int $operation
* @return bool
* @access public
*/
private function _stream_lock($operation)
{
496,7 → 471,6
* @param string $path_from
* @param string $path_to
* @return bool
* @access public
*/
private function _rename($path_from, $path_to)
{
548,7 → 522,6
* @param string $path
* @param int $options
* @return bool
* @access public
*/
private function _dir_opendir($path, $options)
{
565,7 → 538,6
* Read entry from directory handle
*
* @return mixed
* @access public
*/
private function _dir_readdir()
{
579,7 → 551,6
* Rewind directory handle
*
* @return bool
* @access public
*/
private function _dir_rewinddir()
{
591,7 → 562,6
* Close directory handle
*
* @return bool
* @access public
*/
private function _dir_closedir()
{
607,7 → 577,6
* @param int $mode
* @param int $options
* @return bool
* @access public
*/
private function _mkdir($path, $mode, $options)
{
630,7 → 599,6
* @param string $path
* @param int $options
* @return bool
* @access public
*/
private function _rmdir($path, $options)
{
648,7 → 616,6
* See <http://php.net/fflush>. Always returns true because \phpseclib3\Net\SFTP doesn't cache stuff before writing
*
* @return bool
* @access public
*/
private function _stream_flush()
{
659,7 → 626,6
* Retrieve information about a file resource
*
* @return mixed
* @access public
*/
private function _stream_stat()
{
675,7 → 641,6
*
* @param string $path
* @return bool
* @access public
*/
private function _unlink($path)
{
697,7 → 662,6
* @param string $path
* @param int $flags
* @return mixed
* @access public
*/
private function _url_stat($path, $flags)
{
719,7 → 683,6
*
* @param int $new_size
* @return bool
* @access public
*/
private function _stream_truncate($new_size)
{
743,7 → 706,6
* @param int $arg1
* @param int $arg2
* @return bool
* @access public
*/
private function _stream_set_option($option, $arg1, $arg2)
{
753,7 → 715,6
/**
* Close an resource
*
* @access public
*/
private function _stream_close()
{
772,9 → 733,8
* @param string $name
* @param array $arguments
* @return mixed
* @access public
*/
public function __call($name, $arguments)
public function __call($name, array $arguments)
{
if (defined('NET_SFTP_STREAM_LOGGING')) {
echo $name . '(';
/trunk/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
25,8 → 25,6
* ?>
* </code>
*
* @category Net
* @package SFTP
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
41,9 → 39,7
/**
* Pure-PHP implementations of SFTP.
*
* @package SFTP
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class SFTP extends SSH2
{
54,7 → 50,6
*
* @see \phpseclib3\Net\SSH2::send_channel_packet()
* @see \phpseclib3\Net\SSH2::get_channel_packet()
* @access private
*/
const CHANNEL = 0x100;
 
61,7 → 56,6
/**
* Reads data from a local file.
*
* @access public
* @see \phpseclib3\Net\SFTP::put()
*/
const SOURCE_LOCAL_FILE = 1;
68,7 → 62,6
/**
* Reads data from a string.
*
* @access public
* @see \phpseclib3\Net\SFTP::put()
*/
// this value isn't really used anymore but i'm keeping it reserved for historical reasons
77,7 → 70,6
* Reads data from callback:
* function callback($length) returns string to proceed, null for EOF
*
* @access public
* @see \phpseclib3\Net\SFTP::put()
*/
const SOURCE_CALLBACK = 16;
84,7 → 76,6
/**
* Resumes an upload
*
* @access public
* @see \phpseclib3\Net\SFTP::put()
*/
const RESUME = 4;
91,7 → 82,6
/**
* Append a local file to an already existing remote file
*
* @access public
* @see \phpseclib3\Net\SFTP::put()
*/
const RESUME_START = 8;
134,7 → 124,6
*
* @var boolean
* @see self::_send_sftp_packet()
* @access private
*/
private $use_request_id = false;
 
146,7 → 135,6
*
* @var int
* @see self::_get_sftp_packet()
* @access private
*/
private $packet_type = -1;
 
155,7 → 143,6
*
* @var string
* @see self::_get_sftp_packet()
* @access private
*/
private $packet_buffer = '';
 
164,7 → 151,6
*
* @var array
* @see self::_initChannel()
* @access private
*/
private $extensions = [];
 
173,7 → 159,6
*
* @var int
* @see self::_initChannel()
* @access private
*/
private $version;
 
182,7 → 167,6
*
* @var int
* @see self::_initChannel()
* @access private
*/
private $defaultVersion;
 
191,7 → 175,6
*
* @var int
* @see self::_initChannel()
* @access private
*/
private $preferredVersion = 3;
 
201,7 → 184,6
* @var string|bool
* @see self::realpath()
* @see self::chdir()
* @access private
*/
private $pwd = false;
 
210,7 → 192,6
*
* @see self::getLog()
* @var array
* @access private
*/
private $packet_type_log = [];
 
219,17 → 200,48
*
* @see self::getLog()
* @var array
* @access private
*/
private $packet_log = [];
 
/**
* Real-time log file pointer
*
* @see self::_append_log()
* @var resource|closed-resource
*/
private $realtime_log_file;
 
/**
* Real-time log file size
*
* @see self::_append_log()
* @var int
*/
private $realtime_log_size;
 
/**
* Real-time log file wrap boolean
*
* @see self::_append_log()
* @var bool
*/
private $realtime_log_wrap;
 
/**
* Current log size
*
* Should never exceed self::LOG_MAX_SIZE
*
* @var int
*/
private $log_size;
 
/**
* Error information
*
* @see self::getSFTPErrors()
* @see self::getLastSFTPError()
* @var array
* @access private
*/
private $sftp_errors = [];
 
243,7 → 255,6
* @see self::_remove_from_stat_cache()
* @see self::_query_stat_cache()
* @var array
* @access private
*/
private $stat_cache = [];
 
253,7 → 264,6
* @see self::__construct()
* @see self::get()
* @var int
* @access private
*/
private $max_sftp_packet;
 
263,7 → 273,6
* @see self::disableStatCache()
* @see self::enableStatCache()
* @var bool
* @access private
*/
private $use_stat_cache = true;
 
273,7 → 282,6
* @see self::_comparator()
* @see self::setListOrder()
* @var array
* @access private
*/
protected $sortOptions = [];
 
287,7 → 295,6
* @see self::disablePathCanonicalization()
* @see self::realpath()
* @var bool
* @access private
*/
private $canonicalize_paths = true;
 
296,7 → 303,6
*
* @see self::_get_sftp_packet()
* @var array
* @access private
*/
private $requestBuffer = [];
 
306,7 → 312,6
* @see self::get()
* @see self::put()
* @var bool
* @access private
*/
private $preserveTime = false;
 
321,7 → 326,6
* @see self::enableArbitraryLengthPackets()
* @see self::_get_sftp_packet()
* @var bool
* @access private
*/
private $allow_arbitrary_length_packets = false;
 
331,7 → 335,6
* @see self::get()
* @see self::get_sftp_packet()
* @var bool
* @access private
*/
private $channel_close = false;
 
339,7 → 342,6
* Has the SFTP channel been partially negotiated?
*
* @var bool
* @access private
*/
private $partial_init = false;
 
351,7 → 353,6
* @param string $host
* @param int $port
* @param int $timeout
* @access public
*/
public function __construct($host, $port = 22, $timeout = 10)
{
446,7 → 447,7
// yields inconsistent behavior depending on how php is compiled. so we left shift -1 (which, in
// two's compliment, consists of all 1 bits) by 31. on 64-bit systems this'll yield 0xFFFFFFFF80000000.
// that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored.
(-1 << 31) & 0xFFFFFFFF => 'NET_SFTP_ATTR_EXTENDED'
(PHP_INT_SIZE == 4 ? -1 : 0xFFFFFFFF) => 'NET_SFTP_ATTR_EXTENDED'
];
// http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-6.3
// the flag definitions change somewhat in SFTPv5+. if SFTPv5+ support is added to this library, maybe name
520,7 → 521,6
* Check a few things before SFTP functions are called
*
* @return bool
* @access public
*/
private function precheck()
{
540,7 → 540,6
*
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access public
*/
private function partial_init_sftp_connection()
{
630,7 → 629,6
* (Re)initializes the SFTP channel
*
* @return bool
* @access private
*/
private function init_sftp_connection()
{
711,7 → 709,15
}
 
$this->pwd = true;
try {
$this->pwd = $this->realpath('.');
} catch (\UnexpectedValueException $e) {
if (!$this->canonicalize_paths) {
throw $e;
}
$this->$this->canonicalize_paths = false;
$this->reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
}
 
$this->update_stat_cache($this->pwd, []);
 
721,7 → 727,6
/**
* Disable the stat cache
*
* @access public
*/
public function disableStatCache()
{
731,7 → 736,6
/**
* Enable the stat cache
*
* @access public
*/
public function enableStatCache()
{
741,7 → 745,6
/**
* Clear the stat cache
*
* @access public
*/
public function clearStatCache()
{
751,7 → 754,6
/**
* Enable path canonicalization
*
* @access public
*/
public function enablePathCanonicalization()
{
759,9 → 761,10
}
 
/**
* Enable path canonicalization
* Disable path canonicalization
*
* @access public
* If this is enabled then $sftp->pwd() will not return the canonicalized absolute path
*
*/
public function disablePathCanonicalization()
{
771,7 → 774,6
/**
* Enable arbitrary length packets
*
* @access public
*/
public function enableArbitraryLengthPackets()
{
781,7 → 783,6
/**
* Disable arbitrary length packets
*
* @access public
*/
public function disableArbitraryLengthPackets()
{
792,7 → 793,6
* Returns the current directory name
*
* @return string|bool
* @access public
*/
public function pwd()
{
808,7 → 808,6
*
* @param string $response
* @param int $status
* @access private
*/
private function logError($response, $status = -1)
{
839,7 → 838,6
* @param string $path
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return mixed
* @access public
*/
public function realpath($path)
{
848,8 → 846,33
}
 
if (!$this->canonicalize_paths) {
return $path;
if ($this->pwd === true) {
return '.';
}
if (!strlen($path) || $path[0] != '/') {
$path = $this->pwd . '/' . $path;
}
$parts = explode('/', $path);
$afterPWD = $beforePWD = [];
foreach ($parts as $part) {
switch ($part) {
//case '': // some SFTP servers /require/ double /'s. see https://github.com/phpseclib/phpseclib/pull/1137
case '.':
break;
case '..':
if (!empty($afterPWD)) {
array_pop($afterPWD);
} else {
$beforePWD[] = '..';
}
break;
default:
$afterPWD[] = $part;
}
}
$beforePWD = count($beforePWD) ? implode('/', $beforePWD) : '.';
return $beforePWD . '/' . implode('/', $afterPWD);
}
 
if ($this->pwd === true) {
// http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.9
902,7 → 925,6
* @param string $dir
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access public
*/
public function chdir($dir)
{
963,7 → 985,6
* @param string $dir
* @param bool $recursive
* @return array|false
* @access public
*/
public function nlist($dir = '.', $recursive = false)
{
977,12 → 998,17
* @param bool $recursive
* @param string $relativeDir
* @return array|false
* @access private
*/
private function nlist_helper($dir, $recursive, $relativeDir)
{
$files = $this->readlist($dir, false);
 
// If we get an int back, then that is an "unexpected" status.
// We do not have a file list, so return false.
if (is_int($files)) {
return false;
}
 
if (!$recursive || $files === false) {
return $files;
}
1011,11 → 1037,17
* @param string $dir
* @param bool $recursive
* @return array|false
* @access public
*/
public function rawlist($dir = '.', $recursive = false)
{
$files = $this->readlist($dir, true);
 
// If we get an int back, then that is an "unexpected" status.
// We do not have a file list, so return false.
if (is_int($files)) {
return false;
}
 
if (!$recursive || $files === false) {
return $files;
}
1056,7 → 1088,6
* @param bool $raw
* @return array|false
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access private
*/
private function readlist($dir, $raw = true)
{
1082,8 → 1113,9
break;
case NET_SFTP_STATUS:
// presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
$this->logError($response);
return false;
list($status) = Strings::unpackSSH2('N', $response);
$this->logError($response, $status);
return $status;
default:
throw new \UnexpectedValueException('Expected NET_SFTP_HANDLE or NET_SFTP_STATUS. '
. 'Got packet type: ' . $this->packet_type);
1136,7 → 1168,7
list($status) = Strings::unpackSSH2('N', $response);
if ($status != NET_SFTP_STATUS_EOF) {
$this->logError($response, $status);
return false;
return $status;
}
break 2;
default:
1164,9 → 1196,8
* @param array $a
* @param array $b
* @return int
* @access private
*/
private function comparator($a, $b)
private function comparator(array $a, array $b)
{
switch (true) {
case $a['filename'] === '.' || $b['filename'] === '.':
1239,7 → 1270,6
* Don't do any sort of sorting
*
* @param string ...$args
* @access public
*/
public function setListOrder(...$args)
{
1261,7 → 1291,6
*
* @param string $path
* @param mixed $value
* @access private
*/
private function update_stat_cache($path, $value)
{
1305,7 → 1334,6
*
* @param string $path
* @return bool
* @access private
*/
private function remove_from_stat_cache($path)
{
1335,7 → 1363,6
*
* @param string $path
* @return mixed
* @access private
*/
private function query_stat_cache($path)
{
1361,7 → 1388,6
*
* @param string $filename
* @return array|false
* @access public
*/
public function stat($filename)
{
1418,7 → 1444,6
*
* @param string $filename
* @return array|false
* @access public
*/
public function lstat($filename)
{
1486,7 → 1511,6
* @param int $type
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return array|false
* @access private
*/
private function stat_helper($filename, $type)
{
1513,7 → 1537,6
* @param string $filename
* @param int $new_size
* @return bool
* @access public
*/
public function truncate($filename, $new_size)
{
1532,7 → 1555,6
* @param int $atime
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access public
*/
public function touch($filename, $time = null, $atime = null)
{
1593,7 → 1615,6
* @param int|string $uid
* @param bool $recursive
* @return bool
* @access public
*/
public function chown($filename, $uid, $recursive = false)
{
1641,7 → 1662,6
* @param int|string $gid
* @param bool $recursive
* @return bool
* @access public
*/
public function chgrp($filename, $gid, $recursive = false)
{
1663,7 → 1683,6
* @param bool $recursive
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return mixed
* @access public
*/
public function chmod($mode, $filename, $recursive = false)
{
1710,7 → 1729,6
* @param bool $recursive
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access private
*/
private function setstat($filename, $attr, $recursive)
{
1769,7 → 1787,6
* @param string $attr
* @param int $i
* @return bool
* @access private
*/
private function setstat_recursive($path, $attr, &$i)
{
1779,7 → 1796,7
$i = 0;
$entries = $this->readlist($path, true);
 
if ($entries === false) {
if ($entries === false || is_int($entries)) {
return $this->setstat($path, $attr, false);
}
 
1842,7 → 1859,6
* @param string $link
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return mixed
* @access public
*/
public function readlink($link)
{
1886,7 → 1902,6
* @param string $link
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access public
*/
public function symlink($target, $link)
{
1951,7 → 1966,6
* @param int $mode
* @param bool $recursive
* @return bool
* @access public
*/
public function mkdir($dir, $mode = -1, $recursive = false)
{
1984,7 → 1998,6
* @param string $dir
* @param int $mode
* @return bool
* @access private
*/
private function mkdir_helper($dir, $mode)
{
2016,7 → 2029,6
* @param string $dir
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return bool
* @access public
*/
public function rmdir($dir)
{
2101,7 → 2113,6
* @throws \BadFunctionCallException if you're uploading via a callback and the callback function is invalid
* @throws \phpseclib3\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist
* @return bool
* @access public
*/
public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null)
{
2174,7 → 2185,7
case is_resource($data):
$mode = $mode & ~self::SOURCE_LOCAL_FILE;
$info = stream_get_meta_data($data);
if ($info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
if (isset($info['wrapper_type']) && $info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
$fp = fopen('php://memory', 'w+');
stream_copy_to_stream($data, $fp);
rewind($fp);
2270,8 → 2281,8
if ($this->preserveTime) {
$stat = stat($data);
$attr = $this->version < 4 ?
pack('N3', NET_SFTP_ATTR_ACCESSTIME, $stat['atime'], $stat['time']) :
Strings::packSSH2('NQ2', NET_SFTP_ATTR_ACCESSTIME | NET_SFTP_ATTR_MODIFYTIME, $stat['atime'], $stat['time']);
pack('N3', NET_SFTP_ATTR_ACCESSTIME, $stat['atime'], $stat['mtime']) :
Strings::packSSH2('NQ2', NET_SFTP_ATTR_ACCESSTIME | NET_SFTP_ATTR_MODIFYTIME, $stat['atime'], $stat['mtime']);
if (!$this->setstat($remote_file, $attr, false)) {
throw new \RuntimeException('Error setting file time');
}
2290,7 → 2301,6
* @param int $i
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access private
*/
private function read_put_responses($i)
{
2317,7 → 2327,6
* @param string $handle
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access private
*/
private function close_handle($handle)
{
2355,8 → 2364,7
* @param int $length
* @param callable|null $progressCallback
* @throws \UnexpectedValueException on receipt of unexpected packets
* @return string|false
* @access public
* @return string|bool
*/
public function get($remote_file, $local_file = false, $offset = 0, $length = -1, $progressCallback = null)
{
2521,7 → 2529,6
* @param bool $recursive
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access public
*/
public function delete($path, $recursive = true)
{
2579,7 → 2586,6
* @param string $path
* @param int $i
* @return bool
* @access private
*/
private function delete_recursive($path, &$i)
{
2589,12 → 2595,17
$i = 0;
$entries = $this->readlist($path, true);
 
// normally $entries would have at least . and .. but it might not if the directories
// permissions didn't allow reading
if (empty($entries)) {
// The folder does not exist at all, so we cannot delete it.
if ($entries === NET_SFTP_STATUS_NO_SUCH_FILE) {
return false;
}
 
// Normally $entries would have at least . and .. but it might not if the directories
// permissions didn't allow reading. If this happens then default to an empty list of files.
if ($entries === false || is_int($entries)) {
$entries = [];
}
 
unset($entries['.'], $entries['..']);
foreach ($entries as $filename => $props) {
if (!isset($props['type'])) {
2641,7 → 2652,6
*
* @param string $path
* @return bool
* @access public
*/
public function file_exists($path)
{
2668,7 → 2678,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_dir($path)
{
2684,7 → 2693,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_file($path)
{
2700,7 → 2708,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_link($path)
{
2716,7 → 2723,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_readable($path)
{
2744,7 → 2750,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_writable($path)
{
2774,7 → 2779,6
*
* @param string $path
* @return bool
* @access public
*/
public function is_writeable($path)
{
2786,7 → 2790,6
*
* @param string $path
* @return mixed
* @access public
*/
public function fileatime($path)
{
2798,7 → 2801,6
*
* @param string $path
* @return mixed
* @access public
*/
public function filemtime($path)
{
2810,7 → 2812,6
*
* @param string $path
* @return mixed
* @access public
*/
public function fileperms($path)
{
2822,7 → 2823,6
*
* @param string $path
* @return mixed
* @access public
*/
public function fileowner($path)
{
2834,7 → 2834,6
*
* @param string $path
* @return mixed
* @access public
*/
public function filegroup($path)
{
2846,7 → 2845,6
*
* @param string $path
* @return mixed
* @access public
*/
public function filesize($path)
{
2858,7 → 2856,6
*
* @param string $path
* @return string|false
* @access public
*/
public function filetype($path)
{
2893,7 → 2890,6
* @param string $path
* @param string $prop
* @return mixed
* @access private
*/
private function get_stat_cache_prop($path, $prop)
{
2908,7 → 2904,6
* @param string $path
* @param string $prop
* @return mixed
* @access private
*/
private function get_lstat_cache_prop($path, $prop)
{
2924,7 → 2919,6
* @param string $prop
* @param string $type
* @return mixed
* @access private
*/
private function get_xstat_cache_prop($path, $prop, $type)
{
2960,7 → 2954,6
* @param string $newname
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access public
*/
public function rename($oldname, $newname)
{
3021,7 → 3014,6
* @param int $flags
* @param string $response
* @return array
* @access private
*/
private function parseTime($key, $flags, &$response)
{
3040,7 → 3032,6
*
* @param string $response
* @return array
* @access private
*/
protected function parseAttributes(&$response)
{
3187,7 → 3178,6
*
* @param int $mode
* @return int
* @access private
*/
private function parseMode($mode)
{
3234,7 → 3224,6
*
* @param string $longname
* @return mixed
* @access private
*/
private function parseLongname($longname)
{
3267,7 → 3256,6
* @see self::_get_sftp_packet()
* @see self::send_channel_packet()
* @return void
* @access private
*/
private function send_sftp_packet($type, $data, $request_id = 1)
{
3286,32 → 3274,14
if (defined('NET_SFTP_LOGGING')) {
$packet_type = '-> ' . $this->packet_types[$type] .
' (' . round($stop - $start, 4) . 's)';
if (NET_SFTP_LOGGING == self::LOG_REALTIME) {
switch (PHP_SAPI) {
case 'cli':
$start = $stop = "\r\n";
break;
default:
$start = '<pre>';
$stop = '</pre>';
$this->append_log($packet_type, $data);
}
echo $start . $this->format_log([$data], [$packet_type]) . $stop;
@flush();
@ob_flush();
} else {
$this->packet_type_log[] = $packet_type;
if (NET_SFTP_LOGGING == self::LOG_COMPLEX) {
$this->packet_log[] = $data;
}
}
}
}
 
/**
* Resets a connection for re-use
*
* @param int $reason
* @access private
*/
protected function reset_connection($reason)
{
3332,7 → 3302,6
*
* @see self::_send_sftp_packet()
* @return string
* @access private
*/
private function get_sftp_packet($request_id = null)
{
3381,7 → 3350,10
// SFTP packet type and data payload
while ($tempLength > 0) {
$temp = $this->get_channel_packet(self::CHANNEL, true);
if (is_bool($temp)) {
if ($temp === true) {
if ($this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) {
$this->channel_close = true;
}
$this->packet_type = false;
$this->packet_buffer = '';
return false;
3406,25 → 3378,8
if (defined('NET_SFTP_LOGGING')) {
$packet_type = '<- ' . $this->packet_types[$this->packet_type] .
' (' . round($stop - $start, 4) . 's)';
if (NET_SFTP_LOGGING == self::LOG_REALTIME) {
switch (PHP_SAPI) {
case 'cli':
$start = $stop = "\r\n";
break;
default:
$start = '<pre>';
$stop = '</pre>';
$this->append_log($packet_type, $packet);
}
echo $start . $this->format_log([$packet], [$packet_type]) . $stop;
@flush();
@ob_flush();
} else {
$this->packet_type_log[] = $packet_type;
if (NET_SFTP_LOGGING == self::LOG_COMPLEX) {
$this->packet_log[] = $packet;
}
}
}
 
if (isset($request_id) && $this->use_request_id && $packet_id != $request_id) {
$this->requestBuffer[$packet_id] = [
3438,11 → 3393,33
}
 
/**
* Logs data packets
*
* Makes sure that only the last 1MB worth of packets will be logged
*
* @param string $message_number
* @param string $message
*/
private function append_log($message_number, $message)
{
$this->append_log_helper(
NET_SFTP_LOGGING,
$message_number,
$message,
$this->packet_type_log,
$this->packet_log,
$this->log_size,
$this->realtime_log_file,
$this->realtime_log_wrap,
$this->realtime_log_size
);
}
 
/**
* Returns a log of the packets that have been sent and received.
*
* Returns a string if NET_SFTP_LOGGING == self::LOG_COMPLEX, an array if NET_SFTP_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SFTP_LOGGING')
*
* @access public
* @return array|string
*/
public function getSFTPLog()
3465,7 → 3442,6
* Returns all errors
*
* @return array
* @access public
*/
public function getSFTPErrors()
{
3476,7 → 3452,6
* Returns the last error
*
* @return string
* @access public
*/
public function getLastSFTPError()
{
3487,7 → 3462,6
* Get supported SFTP versions
*
* @return array
* @access public
*/
public function getSupportedVersions()
{
3510,7 → 3484,6
* Get supported SFTP versions
*
* @return int|false
* @access public
*/
public function getNegotiatedVersion()
{
3529,7 → 3502,6
* unset the preferred version
*
* @param int $version
* @access public
*/
public function setPreferredVersion($version)
{
3541,7 → 3513,6
*
* @param int $reason
* @return false
* @access protected
*/
protected function disconnect_helper($reason)
{
3552,7 → 3523,6
/**
* Enable Date Preservation
*
* @access public
*/
public function enableDatePreservation()
{
3562,7 → 3532,6
/**
* Disable Date Preservation
*
* @access public
*/
public function disableDatePreservation()
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
37,8 → 37,6
* ?>
* </code>
*
* @category Net
* @package SSH2
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
76,9 → 74,7
/**
* Pure-PHP implementation of SSHv2.
*
* @package SSH2
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class SSH2
{
85,7 → 81,6
/**#@+
* Compression Types
*
* @access private
*/
/**
* No compression
123,7 → 118,6
*
* @see \phpseclib3\Net\SSH2::send_channel_packet()
* @see \phpseclib3\Net\SSH2::get_channel_packet()
* @access private
*/
const CHANNEL_EXEC = 1; // PuTTy uses 0x100
const CHANNEL_SHELL = 2;
134,7 → 128,6
/**
* Returns the message numbers
*
* @access public
* @see \phpseclib3\Net\SSH2::getLog()
*/
const LOG_SIMPLE = 1;
141,28 → 134,24
/**
* Returns the message content
*
* @access public
* @see \phpseclib3\Net\SSH2::getLog()
*/
const LOG_COMPLEX = 2;
/**
* Outputs the content real-time
*
* @access public
* @see \phpseclib3\Net\SSH2::getLog()
*/
const LOG_REALTIME = 3;
/**
* Dumps the content real-time to a file
*
* @access public
* @see \phpseclib3\Net\SSH2::getLog()
*/
const LOG_REALTIME_FILE = 4;
/**
* Outputs the message numbers real-time
*/
const LOG_SIMPLE_REALTIME = 5;
/**
* Make sure that the log never gets larger than this
*
* @access public
* @see \phpseclib3\Net\SSH2::getLog()
*/
const LOG_MAX_SIZE = 1048576; // 1024 * 1024
170,7 → 159,6
/**
* Returns when a string matching $expect exactly is found
*
* @access public
* @see \phpseclib3\Net\SSH2::read()
*/
const READ_SIMPLE = 1;
177,7 → 165,6
/**
* Returns when a string matching the regular expression $expect is found
*
* @access public
* @see \phpseclib3\Net\SSH2::read()
*/
const READ_REGEX = 2;
187,7 → 174,6
* Some data packets may only contain a single character so it may be necessary
* to call read() multiple times when using this option
*
* @access public
* @see \phpseclib3\Net\SSH2::read()
*/
const READ_NEXT = 3;
196,7 → 182,6
* The SSH identifier
*
* @var string
* @access private
*/
private $identifier;
 
204,7 → 189,6
* The Socket Object
*
* @var resource|closed-resource|null
* @access private
*/
public $fsock;
 
215,7 → 199,6
* if a requisite function has been successfully executed. If not, an error should be thrown.
*
* @var int
* @access private
*/
protected $bitmap = 0;
 
225,7 → 208,6
* @see self::getErrors()
* @see self::getLastError()
* @var array
* @access private
*/
private $errors = [];
 
234,7 → 216,6
*
* @see self::getServerIdentification()
* @var string|false
* @access private
*/
protected $server_identifier = false;
 
243,7 → 224,6
*
* @see self::getKexAlgorithims()
* @var array|false
* @access private
*/
private $kex_algorithms = false;
 
252,7 → 232,6
*
* @see self::getMethodsNegotiated()
* @var string|false
* @access private
*/
private $kex_algorithm = false;
 
261,7 → 240,6
*
* @see self::_key_exchange()
* @var int
* @access private
*/
private $kex_dh_group_size_min = 1536;
 
270,7 → 248,6
*
* @see self::_key_exchange()
* @var int
* @access private
*/
private $kex_dh_group_size_preferred = 2048;
 
279,7 → 256,6
*
* @see self::_key_exchange()
* @var int
* @access private
*/
private $kex_dh_group_size_max = 4096;
 
288,7 → 264,6
*
* @see self::getServerHostKeyAlgorithms()
* @var array|false
* @access private
*/
private $server_host_key_algorithms = false;
 
297,7 → 272,6
*
* @see self::getEncryptionAlgorithmsClient2Server()
* @var array|false
* @access private
*/
private $encryption_algorithms_client_to_server = false;
 
306,7 → 280,6
*
* @see self::getEncryptionAlgorithmsServer2Client()
* @var array|false
* @access private
*/
private $encryption_algorithms_server_to_client = false;
 
315,7 → 288,6
*
* @see self::getMACAlgorithmsClient2Server()
* @var array|false
* @access private
*/
private $mac_algorithms_client_to_server = false;
 
324,7 → 296,6
*
* @see self::getMACAlgorithmsServer2Client()
* @var array|false
* @access private
*/
private $mac_algorithms_server_to_client = false;
 
333,7 → 304,6
*
* @see self::getCompressionAlgorithmsClient2Server()
* @var array|false
* @access private
*/
private $compression_algorithms_client_to_server = false;
 
342,7 → 312,6
*
* @see self::getCompressionAlgorithmsServer2Client()
* @var array|false
* @access private
*/
private $compression_algorithms_server_to_client = false;
 
351,7 → 320,6
*
* @see self::getLanguagesServer2Client()
* @var array|false
* @access private
*/
private $languages_server_to_client = false;
 
360,7 → 328,6
*
* @see self::getLanguagesClient2Server()
* @var array|false
* @access private
*/
private $languages_client_to_server = false;
 
369,7 → 336,6
*
* @see self::setPreferredAlgorithms()
* @var array
* @access private
*/
private $preferred = [];
 
386,7 → 352,6
* @see self::__construct()
* @see self::_send_binary_packet()
* @var int
* @access private
*/
private $encrypt_block_size = 8;
 
396,7 → 361,6
* @see self::__construct()
* @see self::_get_binary_packet()
* @var int
* @access private
*/
private $decrypt_block_size = 8;
 
405,7 → 369,6
*
* @see self::_get_binary_packet()
* @var SymmetricKey|false
* @access private
*/
private $decrypt = false;
 
413,7 → 376,6
* Decryption Algorithm Name
*
* @var string|null
* @access private
*/
private $decryptName;
 
423,7 → 385,6
* Used by GCM
*
* @var string|null
* @access private
*/
private $decryptInvocationCounter;
 
433,7 → 394,6
* Used by GCM
*
* @var string|null
* @access private
*/
private $decryptFixedPart;
 
442,7 → 402,6
*
* @see self::_get_binary_packet()
* @var object
* @access private
*/
private $lengthDecrypt = false;
 
451,7 → 410,6
*
* @see self::_send_binary_packet()
* @var SymmetricKey|false
* @access private
*/
private $encrypt = false;
 
459,7 → 417,6
* Encryption Algorithm Name
*
* @var string|null
* @access private
*/
private $encryptName;
 
469,7 → 426,6
* Used by GCM
*
* @var string|null
* @access private
*/
private $encryptInvocationCounter;
 
479,7 → 435,6
* Used by GCM
*
* @var string|null
* @access private
*/
private $encryptFixedPart;
 
488,7 → 443,6
*
* @see self::_send_binary_packet()
* @var object
* @access private
*/
private $lengthEncrypt = false;
 
497,7 → 451,6
*
* @see self::_send_binary_packet()
* @var object
* @access private
*/
private $hmac_create = false;
 
505,7 → 458,6
* Client to Server HMAC Name
*
* @var string|false
* @access private
*/
private $hmac_create_name;
 
513,7 → 465,6
* Client to Server ETM
*
* @var int|false
* @access private
*/
private $hmac_create_etm;
 
522,7 → 473,6
*
* @see self::_get_binary_packet()
* @var object
* @access private
*/
private $hmac_check = false;
 
530,7 → 480,6
* Server to Client HMAC Name
*
* @var string|false
* @access private
*/
private $hmac_check_name;
 
538,7 → 487,6
* Server to Client ETM
*
* @var int|false
* @access private
*/
private $hmac_check_etm;
 
551,7 → 499,6
*
* @see self::_get_binary_packet()
* @var int
* @access private
*/
private $hmac_size = false;
 
560,7 → 507,6
*
* @see self::getServerPublicHostKey()
* @var string
* @access private
*/
private $server_public_host_key;
 
575,7 → 521,6
*
* @see self::_key_exchange()
* @var string
* @access private
*/
private $session_id = false;
 
586,7 → 531,6
*
* @see self::_key_exchange()
* @var string
* @access private
*/
private $exchange_hash = false;
 
644,7 → 588,6
*
* @see self::_send_binary_packet()
* @var int
* @access private
*/
private $send_seq_no = 0;
 
655,7 → 598,6
*
* @see self::_get_binary_packet()
* @var int
* @access private
*/
private $get_seq_no = 0;
 
667,7 → 609,6
* @see self::get_channel_packet()
* @see self::exec()
* @var array
* @access private
*/
protected $server_channels = [];
 
680,7 → 621,6
* @see self::get_channel_packet()
* @see self::exec()
* @var array
* @access private
*/
private $channel_buffers = [];
 
691,7 → 631,6
*
* @see self::get_channel_packet()
* @var array
* @access private
*/
protected $channel_status = [];
 
702,7 → 641,6
*
* @see self::send_channel_packet()
* @var array
* @access private
*/
private $packet_size_client_to_server = [];
 
711,7 → 649,6
*
* @see self::getLog()
* @var array
* @access private
*/
private $message_number_log = [];
 
720,7 → 657,6
*
* @see self::getLog()
* @var array
* @access private
*/
private $message_log = [];
 
732,7 → 668,6
* @var int
* @see self::send_channel_packet()
* @see self::exec()
* @access private
*/
protected $window_size = 0x7FFFFFFF;
 
746,7 → 681,6
* @var int
* @see self::_send_channel_packet()
* @see self::exec()
* @access private
*/
private $window_resize = 0x40000000;
 
757,7 → 691,6
*
* @see self::send_channel_packet()
* @var array
* @access private
*/
protected $window_size_server_to_client = [];
 
768,7 → 701,6
*
* @see self::get_channel_packet()
* @var array
* @access private
*/
private $window_size_client_to_server = [];
 
779,7 → 711,6
*
* @see self::getServerPublicHostKey()
* @var string
* @access private
*/
private $signature = '';
 
790,7 → 721,6
*
* @see self::getServerPublicHostKey()
* @var string
* @access private
*/
private $signature_format = '';
 
799,7 → 729,6
*
* @see self::read()
* @var string
* @access private
*/
private $interactiveBuffer = '';
 
811,7 → 740,6
* @see self::_send_binary_packet()
* @see self::_get_binary_packet()
* @var int
* @access private
*/
private $log_size;
 
819,7 → 747,6
* Timeout
*
* @see self::setTimeout()
* @access private
*/
protected $timeout;
 
827,7 → 754,6
* Current Timeout
*
* @see self::get_channel_packet()
* @access private
*/
protected $curTimeout;
 
835,7 → 761,6
* Keep Alive Interval
*
* @see self::setKeepAlive()
* @access private
*/
private $keepAlive;
 
844,7 → 769,6
*
* @see self::_append_log()
* @var resource|closed-resource
* @access private
*/
private $realtime_log_file;
 
853,7 → 777,6
*
* @see self::_append_log()
* @var int
* @access private
*/
private $realtime_log_size;
 
862,7 → 785,6
*
* @see self::getServerPublicHostKey()
* @var bool
* @access private
*/
private $signature_validated = false;
 
870,7 → 792,7
* Real-time log file wrap boolean
*
* @see self::_append_log()
* @access private
* @var bool
*/
private $realtime_log_wrap;
 
878,7 → 800,6
* Flag to suppress stderr from output
*
* @see self::enableQuietMode()
* @access private
*/
private $quiet_mode = false;
 
886,7 → 807,6
* Time of first network activity
*
* @var float
* @access private
*/
private $last_packet;
 
894,7 → 814,6
* Exit status returned from ssh if any
*
* @var int
* @access private
*/
private $exit_status;
 
903,7 → 822,6
*
* @var bool
* @see self::enablePTY()
* @access private
*/
private $request_pty = false;
 
911,7 → 829,6
* Flag set while exec() is running when using enablePTY()
*
* @var bool
* @access private
*/
private $in_request_pty_exec = false;
 
919,7 → 836,6
* Flag set after startSubsystem() is called
*
* @var bool
* @access private
*/
private $in_subsystem;
 
927,7 → 843,6
* Contents of stdError
*
* @var string
* @access private
*/
private $stdErrorLog;
 
936,7 → 851,6
*
* @see self::_keyboard_interactive_process()
* @var string
* @access private
*/
private $last_interactive_response = '';
 
945,7 → 859,6
*
* @see self::_keyboard_interactive_process()
* @var array
* @access private
*/
private $keyboard_requests_responses = [];
 
958,7 → 871,6
* @see self::_filter()
* @see self::getBannerMessage()
* @var string
* @access private
*/
private $banner_message = '';
 
967,7 → 879,6
*
* @see self::isTimeout()
* @var bool
* @access private
*/
private $is_timeout = false;
 
976,7 → 887,6
*
* @see self::_format_log()
* @var string
* @access private
*/
private $log_boundary = ':';
 
985,7 → 895,6
*
* @see self::_format_log()
* @var int
* @access private
*/
private $log_long_width = 65;
 
994,7 → 903,6
*
* @see self::_format_log()
* @var int
* @access private
*/
private $log_short_width = 16;
 
1004,7 → 912,6
* @see self::__construct()
* @see self::_connect()
* @var string
* @access private
*/
private $host;
 
1014,7 → 921,6
* @see self::__construct()
* @see self::_connect()
* @var int
* @access private
*/
private $port;
 
1025,7 → 931,6
* @see self::setWindowColumns()
* @see self::setWindowSize()
* @var int
* @access private
*/
private $windowColumns = 80;
 
1036,7 → 941,6
* @see self::setWindowRows()
* @see self::setWindowSize()
* @var int
* @access private
*/
private $windowRows = 24;
 
1046,7 → 950,6
* @see self::setCryptoEngine()
* @see self::_key_exchange()
* @var int
* @access private
*/
private static $crypto_engine = false;
 
1054,7 → 957,6
* A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario
*
* @var Agent
* @access private
*/
private $agent;
 
1070,7 → 972,6
* Send the identification string first?
*
* @var bool
* @access private
*/
private $send_id_string_first = true;
 
1078,7 → 979,6
* Send the key exchange initiation packet first?
*
* @var bool
* @access private
*/
private $send_kex_first = true;
 
1086,7 → 986,6
* Some versions of OpenSSH incorrectly calculate the key size
*
* @var bool
* @access private
*/
private $bad_key_size_fix = false;
 
1094,7 → 993,6
* Should we try to re-connect to re-establish keys?
*
* @var bool
* @access private
*/
private $retry_connect = false;
 
1102,7 → 1000,6
* Binary Packet Buffer
*
* @var string|false
* @access private
*/
private $binary_packet_buffer = false;
 
1110,7 → 1007,6
* Preferred Signature Format
*
* @var string|false
* @access private
*/
protected $preferred_signature_format = false;
 
1118,7 → 1014,6
* Authentication Credentials
*
* @var array
* @access private
*/
protected $auth = [];
 
1126,7 → 1021,6
* Terminal
*
* @var string
* @access private
*/
private $term = 'vt100';
 
1135,7 → 1029,6
*
* @see https://tools.ietf.org/html/rfc4252#section-5.1
* @var array|null
* @access private
*/
private $auth_methods_to_continue = null;
 
1143,7 → 1036,6
* Compression method
*
* @var int
* @access private
*/
private $compress = self::NET_SSH2_COMPRESSION_NONE;
 
1151,7 → 1043,6
* Decompression method
*
* @var int
* @access private
*/
private $decompress = self::NET_SSH2_COMPRESSION_NONE;
 
1159,7 → 1050,6
* Compression context
*
* @var resource|false|null
* @access private
*/
private $compress_context;
 
1167,7 → 1057,6
* Decompression context
*
* @var resource|object
* @access private
*/
private $decompress_context;
 
1175,7 → 1064,6
* Regenerate Compression Context
*
* @var bool
* @access private
*/
private $regenerate_compression_context = false;
 
1183,7 → 1071,6
* Regenerate Decompression Context
*
* @var bool
* @access private
*/
private $regenerate_decompression_context = false;
 
1191,7 → 1078,6
* Smart multi-factor authentication flag
*
* @var bool
* @access private
*/
private $smartMFA = true;
 
1204,7 → 1090,6
* @param int $port
* @param int $timeout
* @see self::login()
* @access public
*/
public function __construct($host, $port = 22, $timeout = 10)
{
1314,7 → 1199,6
* OpenSSL, mcrypt, Eval, PHP
*
* @param int $engine
* @access public
*/
public static function setCryptoEngine($engine)
{
1328,7 → 1212,6
* both sides MUST send an identification string". It does not say which side sends it first. In
* theory it shouldn't matter but it is a fact of life that some SSH servers are simply buggy
*
* @access public
*/
public function sendIdentificationStringFirst()
{
1342,7 → 1225,6
* both sides MUST send an identification string". It does not say which side sends it first. In
* theory it shouldn't matter but it is a fact of life that some SSH servers are simply buggy
*
* @access public
*/
public function sendIdentificationStringLast()
{
1356,7 → 1238,6
* sending the [SSH_MSG_KEXINIT] packet". It does not say which side sends it first. In theory
* it shouldn't matter but it is a fact of life that some SSH servers are simply buggy
*
* @access public
*/
public function sendKEXINITFirst()
{
1370,7 → 1251,6
* sending the [SSH_MSG_KEXINIT] packet". It does not say which side sends it first. In theory
* it shouldn't matter but it is a fact of life that some SSH servers are simply buggy
*
* @access public
*/
public function sendKEXINITLast()
{
1382,7 → 1262,6
*
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
* @access private
*/
private function connect()
{
1526,7 → 1405,6
*
* You should overwrite this method in your own class if you want to use another identifier
*
* @access protected
* @return string
*/
private function generate_identifier()
1565,7 → 1443,6
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
* @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible
* @access private
*/
private function key_exchange($kexinit_payload_server = false)
{
2081,7 → 1958,6
*
* @param string $algorithm Name of the encryption algorithm
* @return int|null Number of bytes as an integer or null for unknown
* @access private
*/
private function encryption_algorithm_to_key_size($algorithm)
{
2129,7 → 2005,6
*
* @param string $algorithm Name of the encryption algorithm
* @return SymmetricKey|null
* @access private
*/
private static function encryption_algorithm_to_crypt_instance($algorithm)
{
2178,7 → 2053,6
*
* @param string $algorithm Name of the encryption algorithm
* @return array{Hash, int}|null
* @access private
*/
private static function mac_algorithm_to_hash_instance($algorithm)
{
2214,7 → 2088,6
* @link https://bugzilla.mindrot.org/show_bug.cgi?id=1291
* @param string $algorithm Name of the encryption algorithm
* @return bool
* @access private
*/
private static function bad_algorithm_candidate($algorithm)
{
2237,7 → 2110,6
* @param string|AsymmetricKey|array[]|Agent|null ...$args
* @return bool
* @see self::_login()
* @access public
*/
public function login($username, ...$args)
{
2263,7 → 2135,6
* @param string ...$args
* @return bool
* @see self::_login_helper()
* @access private
*/
protected function sublogin($username, ...$args)
{
2361,7 → 2232,6
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
* @access private
*/
private function login_helper($username, $password = null)
{
2468,7 → 2338,9
$this->send_binary_packet($packet, $logged);
 
$response = $this->get_binary_packet();
 
if ($response === false) {
return false;
}
list($type) = Strings::unpackSSH2('C', $response);
switch ($type) {
case NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ: // in theory, the password can be changed
2507,7 → 2379,6
* @param string $username
* @param string|array $password
* @return bool
* @access private
*/
private function keyboard_interactive_login($username, $password)
{
2531,7 → 2402,6
* @param string|array ...$responses
* @return bool
* @throws \RuntimeException on connection error
* @access private
*/
private function keyboard_interactive_process(...$responses)
{
2628,7 → 2498,6
* @param string $username
* @param \phpseclib3\System\SSH\Agent $agent
* @return bool
* @access private
*/
private function ssh_agent_login($username, Agent $agent)
{
2653,7 → 2522,6
* @param \phpseclib3\Crypt\Common\PrivateKey $privatekey
* @return bool
* @throws \RuntimeException on connection error
* @access private
*/
private function privatekey_login($username, PrivateKey $privatekey)
{
2785,7 → 2653,6
* Setting $timeout to false or 0 will mean there is no timeout.
*
* @param mixed $timeout
* @access public
*/
public function setTimeout($timeout)
{
2798,7 → 2665,6
* Sends an SSH2_MSG_IGNORE message every x seconds, if x is a positive non-zero number.
*
* @param int $interval
* @access public
*/
public function setKeepAlive($interval)
{
2808,7 → 2674,6
/**
* Get the output from stdError
*
* @access public
*/
public function getStdError()
{
2825,7 → 2690,6
* @return string|bool
* @psalm-return ($callback is callable ? bool : string|bool)
* @throws \RuntimeException on connection error
* @access public
*/
public function exec($command, callable $callback = null)
{
2918,7 → 2782,7
 
$this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_DATA;
 
if ($callback === false || $this->in_request_pty_exec) {
if ($this->in_request_pty_exec) {
return true;
}
 
2951,7 → 2815,6
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
* @access private
*/
private function initShell()
{
3027,7 → 2890,6
* @see self::read()
* @see self::write()
* @return int
* @access public
*/
private function get_interactive_channel()
{
3045,7 → 2907,6
* Return an available open channel
*
* @return int
* @access public
*/
private function get_open_channel()
{
3063,7 → 2924,6
* Request agent forwarding of remote server
*
* @return bool
* @access public
*/
public function requestAgentForwarding()
{
3104,7 → 2964,6
* @param int $mode
* @return string|bool|null
* @throws \RuntimeException on connection error
* @access public
*/
public function read($expect = '', $mode = self::READ_SIMPLE)
{
3178,7 → 3037,6
* @see self::stopSubsystem()
* @param string $subsystem
* @return bool
* @access public
*/
public function startSubsystem($subsystem)
{
3228,7 → 3086,6
*
* @see self::startSubsystem()
* @return bool
* @access public
*/
public function stopSubsystem()
{
3242,7 → 3099,6
*
* If read() timed out you might want to just close the channel and have it auto-restart on the next read() call
*
* @access public
*/
public function reset()
{
3254,7 → 3110,6
*
* Did exec() or read() return because they timed out or because they encountered the end?
*
* @access public
*/
public function isTimeout()
{
3264,7 → 3119,6
/**
* Disconnect
*
* @access public
*/
public function disconnect()
{
3281,7 → 3135,6
* Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call
* disconnect().
*
* @access public
*/
public function __destruct()
{
3292,7 → 3145,6
* Is the connection still active?
*
* @return bool
* @access public
*/
public function isConnected()
{
3303,7 → 3155,6
* Have you successfully been logged in?
*
* @return bool
* @access public
*/
public function isAuthenticated()
{
3371,7 → 3222,6
* Resets a connection for re-use
*
* @param int $reason
* @access private
*/
protected function reset_connection($reason)
{
3393,7 → 3243,6
* @see self::_send_binary_packet()
* @param bool $skip_channel_filter
* @return bool|string
* @access private
*/
private function get_binary_packet($skip_channel_filter = false)
{
3447,8 → 3296,12
 
if (!is_resource($this->fsock) || feof($this->fsock)) {
$this->bitmap = 0;
throw new ConnectionClosedException('Connection closed (by server) prematurely ' . $elapsed . 's');
$str = 'Connection closed (by server) prematurely';
if (isset($elapsed)) {
$str .= ' ' . $elapsed . 's';
}
throw new ConnectionClosedException($str);
}
 
$start = microtime(true);
$raw = stream_get_contents($this->fsock, $this->decrypt_block_size);
3639,7 → 3492,6
* @see self::get_binary_packet()
* @param int $remaining_length
* @return string
* @access private
*/
private function read_remaining_bytes($remaining_length)
{
3699,7 → 3551,6
* @param string $payload
* @param bool $skip_channel_filter
* @return string|bool
* @access private
*/
private function filter($payload, $skip_channel_filter)
{
3850,7 → 3701,6
*
* Suppress stderr from output
*
* @access public
*/
public function enableQuietMode()
{
3862,7 → 3712,6
*
* Show stderr in output
*
* @access public
*/
public function disableQuietMode()
{
3874,7 → 3723,6
*
* @see self::enableQuietMode()
* @see self::disableQuietMode()
* @access public
* @return bool
*/
public function isQuietModeEnabled()
3885,7 → 3733,6
/**
* Enable request-pty when using exec()
*
* @access public
*/
public function enablePTY()
{
3895,7 → 3742,6
/**
* Disable request-pty when using exec()
*
* @access public
*/
public function disablePTY()
{
3911,7 → 3757,6
*
* @see self::enablePTY()
* @see self::disablePTY()
* @access public
* @return bool
*/
public function isPTYEnabled()
3937,7 → 3782,6
* @param bool $skip_extended
* @return mixed
* @throws \RuntimeException on connection error
* @access private
*/
protected function get_channel_packet($client_channel, $skip_extended = false)
{
4161,7 → 4005,6
* @param string $logged
* @see self::_get_binary_packet()
* @return void
* @access private
*/
protected function send_binary_packet($data, $logged = null)
{
4306,28 → 4149,61
*
* @param string $message_number
* @param string $message
* @access private
*/
private function append_log($message_number, $message)
{
$this->append_log_helper(
NET_SSH2_LOGGING,
$message_number,
$message,
$this->message_number_log,
$this->message_log,
$this->log_size,
$this->realtime_log_file,
$this->realtime_log_wrap,
$this->realtime_log_size
);
}
 
/**
* Logs data packet helper
*
* @param int $constant
* @param string $message_number
* @param string $message
* @param array &$message_number_log
* @param array &$message_log
* @param int &$log_size
* @param resource &$realtime_log_file
* @param bool &$realtime_log_wrap
* @param int &$realtime_log_size
*/
protected function append_log_helper($constant, $message_number, $message, array &$message_number_log, array &$message_log, &$log_size, &$realtime_log_file, &$realtime_log_wrap, &$realtime_log_size)
{
// remove the byte identifying the message type from all but the first two messages (ie. the identification strings)
if (strlen($message_number) > 2) {
Strings::shift($message);
}
 
switch (NET_SSH2_LOGGING) {
switch ($constant) {
// useful for benchmarks
case self::LOG_SIMPLE:
$this->message_number_log[] = $message_number;
$message_number_log[] = $message_number;
break;
case self::LOG_SIMPLE_REALTIME:
echo $message_number;
echo PHP_SAPI == 'cli' ? "\r\n" : '<br>';
@flush();
@ob_flush();
break;
// the most useful log for SSH2
case self::LOG_COMPLEX:
$this->message_number_log[] = $message_number;
$this->log_size += strlen($message);
$this->message_log[] = $message;
while ($this->log_size > self::LOG_MAX_SIZE) {
$this->log_size -= strlen(array_shift($this->message_log));
array_shift($this->message_number_log);
$message_number_log[] = $message_number;
$log_size += strlen($message);
$message_log[] = $message;
while ($log_size > self::LOG_MAX_SIZE) {
$log_size -= strlen(array_shift($message_log));
array_shift($message_number_log);
}
break;
// dump the output out realtime; packets may be interspersed with non packets,
4351,28 → 4227,28
// the earliest part of the log file is denoted by the first <<< START >>> and is not going to necessarily
// at the beginning of the file
case self::LOG_REALTIME_FILE:
if (!isset($this->realtime_log_file)) {
if (!isset($realtime_log_file)) {
// PHP doesn't seem to like using constants in fopen()
$filename = NET_SSH2_LOG_REALTIME_FILENAME;
$fp = fopen($filename, 'w');
$this->realtime_log_file = $fp;
$realtime_log_file = $fp;
}
if (!is_resource($this->realtime_log_file)) {
if (!is_resource($realtime_log_file)) {
break;
}
$entry = $this->format_log([$message], [$message_number]);
if ($this->realtime_log_wrap) {
if ($realtime_log_wrap) {
$temp = "<<< START >>>\r\n";
$entry .= $temp;
fseek($this->realtime_log_file, ftell($this->realtime_log_file) - strlen($temp));
fseek($realtime_log_file, ftell($realtime_log_file) - strlen($temp));
}
$this->realtime_log_size += strlen($entry);
if ($this->realtime_log_size > self::LOG_MAX_SIZE) {
fseek($this->realtime_log_file, 0);
$this->realtime_log_size = strlen($entry);
$this->realtime_log_wrap = true;
$realtime_log_size += strlen($entry);
if ($realtime_log_size > self::LOG_MAX_SIZE) {
fseek($realtime_log_file, 0);
$realtime_log_size = strlen($entry);
$realtime_log_wrap = true;
}
fputs($this->realtime_log_file, $entry);
fputs($realtime_log_file, $entry);
}
}
 
4426,7 → 4302,6
* @param int $client_channel
* @param bool $want_reply
* @return void
* @access private
*/
private function close_channel($client_channel, $want_reply = false)
{
4463,7 → 4338,6
*
* @param int $reason
* @return false
* @access protected
*/
protected function disconnect_helper($reason)
{
4511,7 → 4385,6
*
* Returns a string if NET_SSH2_LOGGING == self::LOG_COMPLEX, an array if NET_SSH2_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING')
*
* @access public
* @return array|false|string
*/
public function getLog()
4536,10 → 4409,9
*
* @param array $message_log
* @param array $message_number_log
* @access private
* @return string
*/
protected function format_log($message_log, $message_number_log)
protected function format_log(array $message_log, array $message_number_log)
{
$output = '';
for ($i = 0; $i < count($message_log); $i++) {
4574,7 → 4446,6
* of said channel opening. Must be called after
* channel open confirmation received
*
* @access private
*/
private function on_channel_open()
{
4590,9 → 4461,8
* @param array $array1
* @param array $array2
* @return mixed False if intersection is empty, else intersected value.
* @access private
*/
private static function array_intersect_first($array1, $array2)
private static function array_intersect_first(array $array1, array $array2)
{
foreach ($array1 as $value) {
if (in_array($value, $array2)) {
4606,7 → 4476,6
* Returns all errors
*
* @return string[]
* @access public
*/
public function getErrors()
{
4617,7 → 4486,6
* Returns the last error
*
* @return string
* @access public
*/
public function getLastError()
{
4632,7 → 4500,6
* Return the server identification.
*
* @return string|false
* @access public
*/
public function getServerIdentification()
{
4645,7 → 4512,6
* Returns a list of algorithms the server supports
*
* @return array
* @access public
*/
public function getServerAlgorithms()
{
4673,7 → 4539,6
* Returns a list of KEX algorithms that phpseclib supports
*
* @return array
* @access public
*/
public static function getSupportedKEXAlgorithms()
{
4710,7 → 4575,6
* Returns a list of host key algorithms that phpseclib supports
*
* @return array
* @access public
*/
public static function getSupportedHostKeyAlgorithms()
{
4730,7 → 4594,6
* Returns a list of symmetric key algorithms that phpseclib supports
*
* @return array
* @access public
*/
public static function getSupportedEncryptionAlgorithms()
{
4750,7 → 4613,7
'aes192-ctr', // RECOMMENDED AES with 192-bit key
'aes256-ctr', // RECOMMENDED AES with 256-bit key
 
// from <https://git.io/fhxOl>:
// from <https://github.com/openssh/openssh-portable/blob/001aa55/PROTOCOL.chacha20poly1305>:
// one of the big benefits of chacha20-poly1305 is speed. the problem is...
// libsodium doesn't generate the poly1305 keys in the way ssh does and openssl's PHP bindings don't even
// seem to support poly1305 currently. so even if libsodium or openssl are being used for the chacha20
4835,7 → 4698,6
* Returns a list of MAC algorithms that phpseclib supports
*
* @return array
* @access public
*/
public static function getSupportedMACAlgorithms()
{
4866,7 → 4728,6
* Returns a list of compression algorithms that phpseclib supports
*
* @return array
* @access public
*/
public static function getSupportedCompressionAlgorithms()
{
4884,7 → 4745,6
* Uses the same format as https://www.php.net/ssh2-methods-negotiated
*
* @return array
* @access public
*/
public function getAlgorithmsNegotiated()
{
4916,7 → 4776,6
* Allows you to set the terminal
*
* @param string $term
* @access public
*/
public function setTerminal($term)
{
4928,7 → 4787,6
* <https://www.php.net/manual/en/function.ssh2-connect.php>
*
* @param array $methods
* @access public
*/
public function setPreferredAlgorithms(array $methods)
{
5015,7 → 4873,6
* authentication may be relevant for getting legal protection."
*
* @return string
* @access public
*/
public function getBannerMessage()
{
5031,7 → 4888,6
* @return string|false
* @throws \RuntimeException on badly formatted keys
* @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format
* @access public
*/
public function getServerPublicHostKey()
{
5116,7 → 4972,6
* Returns the exit status of an SSH command or false.
*
* @return false|int
* @access public
*/
public function getExitStatus()
{
5130,7 → 4985,6
* Returns the number of columns for the terminal window size.
*
* @return int
* @access public
*/
public function getWindowColumns()
{
5141,7 → 4995,6
* Returns the number of rows for the terminal window size.
*
* @return int
* @access public
*/
public function getWindowRows()
{
5152,7 → 5005,6
* Sets the number of columns for the terminal window size.
*
* @param int $value
* @access public
*/
public function setWindowColumns($value)
{
5163,7 → 5015,6
* Sets the number of rows for the terminal window size.
*
* @param int $value
* @access public
*/
public function setWindowRows($value)
{
5175,7 → 5026,6
*
* @param int $columns
* @param int $rows
* @access public
*/
public function setWindowSize($columns = 80, $rows = 24)
{
5187,7 → 5037,6
* To String Magic Method
*
* @return string
* @access public
*/
#[\ReturnTypeWillChange]
public function __toString()
5248,7 → 5097,6
*
* @param string $old
* @param string $new
* @access private
*/
private function updateLogHistory($old, $new)
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
7,8 → 7,6
*
* PHP version 5
*
* @category System
* @package SSH\Agent
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
25,6 → 23,7
use phpseclib3\Crypt\RSA;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\System\SSH\Agent;
use phpseclib3\System\SSH\Common\Traits\ReadBytes;
 
/**
* Pure-PHP ssh-agent client identity object
35,13 → 34,12
* The methods in this interface would be getPublicKey and sign since those are the
* methods phpseclib looks for to perform public key authentication.
*
* @package SSH\Agent
* @author Jim Wigginton <terrafrost@php.net>
* @access internal
* @internal
*/
class Identity implements PrivateKey
{
use \phpseclib3\System\SSH\Common\Traits\ReadBytes;
use ReadBytes;
 
// Signature Flags
// See https://tools.ietf.org/html/draft-miller-ssh-agent-00#section-5.3
52,7 → 50,6
* Key Object
*
* @var PublicKey
* @access private
* @see self::getPublicKey()
*/
private $key;
61,7 → 58,6
* Key Blob
*
* @var string
* @access private
* @see self::sign()
*/
private $key_blob;
70,7 → 66,6
* Socket Resource
*
* @var resource
* @access private
* @see self::sign()
*/
private $fsock;
79,7 → 74,6
* Signature flags
*
* @var int
* @access private
* @see self::sign()
* @see self::setHash()
*/
89,7 → 83,6
* Curve Aliases
*
* @var array
* @access private
*/
private static $curveAliases = [
'secp256r1' => 'nistp256',
102,7 → 95,6
* Default Constructor.
*
* @param resource $fsock
* @access private
*/
public function __construct($fsock)
{
115,9 → 107,8
* Called by \phpseclib3\System\SSH\Agent::requestIdentities()
*
* @param \phpseclib3\Crypt\Common\PublicKey $key
* @access private
*/
public function withPublicKey($key)
public function withPublicKey(PublicKey $key)
{
if ($key instanceof EC) {
if (is_array($key->getCurve()) || !isset(self::$curveAliases[$key->getCurve()])) {
137,7 → 128,6
* but this saves a small amount of computation.
*
* @param string $key_blob
* @access private
*/
public function withPublicKeyBlob($key_blob)
{
153,7 → 143,6
*
* @param string $type optional
* @return mixed
* @access public
*/
public function getPublicKey($type = 'PKCS8')
{
164,7 → 153,6
* Sets the hash
*
* @param string $hash
* @access public
*/
public function withHash($hash)
{
218,7 → 206,6
* Only PKCS1 padding is supported
*
* @param string $padding
* @access public
*/
public function withPadding($padding)
{
236,7 → 223,6
*
* Valid values are: ASN1, SSH2, Raw
*
* @access public
* @param string $format
*/
public function withSignatureFormat($format)
256,7 → 242,6
*
* Returns a string if it's a named curve, an array if not
*
* @access public
* @return string|array
*/
public function getCurve()
277,7 → 262,6
* @return string
* @throws \RuntimeException on connection errors
* @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
* @access public
*/
public function sign($message)
{
326,7 → 310,6
/**
* Sets the password
*
* @access public
* @param string|bool $password
* @return never
*/
/trunk/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
24,8 → 24,6
* ?>
* </code>
*
* @category System
* @package SSH\Agent
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2014 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
38,6 → 36,7
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\Net\SSH2;
use phpseclib3\System\SSH\Agent\Identity;
 
/**
45,9 → 44,7
*
* requestIdentities() method pumps out \phpseclib3\System\SSH\Agent\Identity objects
*
* @package SSH\Agent
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Agent
{
82,7 → 79,6
* Socket Resource
*
* @var resource
* @access private
*/
private $fsock;
 
90,7 → 86,6
* Agent forwarding status
*
* @var int
* @access private
*/
private $forward_status = self::FORWARD_NONE;
 
100,7 → 95,6
* for agent unix socket
*
* @var string
* @access private
*/
private $socket_buffer = '';
 
110,25 → 104,15
* channel
*
* @var int
* @access private
*/
private $expected_bytes = 0;
 
/**
* The current request channel
*
* @var int
* @access private
*/
private $request_channel;
 
/**
* Default Constructor
*
* @return \phpseclib3\System\SSH\Agent
* @throws \phpseclib3\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found
* @throws \RuntimeException on connection errors
* @access public
*/
public function __construct($address = null)
{
145,12 → 129,23
}
}
 
if (in_array('unix', stream_get_transports())) {
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
if (!$this->fsock) {
throw new \RuntimeException("Unable to connect to ssh-agent (Error $errno: $errstr)");
}
} else {
if (substr($address, 0, 9) != '\\\\.\\pipe\\' || strpos(substr($address, 9), '\\') !== false) {
throw new \RuntimeException('Address is not formatted as a named pipe should be');
}
 
$this->fsock = fopen($address, 'r+b');
if (!$this->fsock) {
throw new \RuntimeException('Unable to open address');
}
}
}
 
/**
* Request Identities
*
159,7 → 154,6
*
* @return array
* @throws \RuntimeException on receipt of unexpected packets
* @access public
*/
public function requestIdentities()
{
212,7 → 206,6
* be requested when a channel is opened
*
* @return void
* @access public
*/
public function startSSHForwarding()
{
226,9 → 219,8
*
* @param \phpseclib3\Net\SSH2 $ssh
* @return bool
* @access private
*/
private function request_forwarding($ssh)
private function request_forwarding(SSH2 $ssh)
{
if (!$ssh->requestAgentForwarding()) {
return false;
247,9 → 239,8
* to take further action. i.e. request agent forwarding
*
* @param \phpseclib3\Net\SSH2 $ssh
* @access private
*/
public function registerChannelOpen($ssh)
public function registerChannelOpen(SSH2 $ssh)
{
if ($this->forward_status == self::FORWARD_REQUEST) {
$this->request_forwarding($ssh);
262,7 → 253,6
* @param string $data
* @return string Data from SSH Agent
* @throws \RuntimeException on connection errors
* @access public
*/
public function forwardData($data)
{
/trunk/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Common/Traits/ReadBytes.php
5,8 → 5,6
*
* PHP version 5
*
* @category System
* @package SSH
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
18,9 → 16,7
/**
* ReadBytes trait
*
* @package SSH
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
trait ReadBytes
{
29,7 → 25,6
*
* @param int $length
* @throws \RuntimeException on connection errors
* @access public
*/
public function readBytes($length)
{
/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php
79,7 → 79,9
 
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
// Daniel Marschall Hotfix 09 Dec 2022 to support PHP 8.2
//if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
if (!is_null($fromEncoding) && ((\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')))) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
$fromEncoding = self::getEncoding($fromEncoding);
/trunk/vendor/tinymce/tinymce/CHANGELOG.md
6,6 → 6,11
 
## Unreleased
 
## 5.10.7 - 2022-12-06
 
### Fixed
- HTML in messages for the `WindowManager.alert` and `WindowManager.confirm` APIs were not properly sanitized. #TINY-3548
 
## 5.10.6 - 2022-10-19
 
### Fixed
/trunk/vendor/tinymce/tinymce/composer.json
1,6 → 1,6
{
"name": "tinymce/tinymce",
"version": "5.10.6",
"version": "5.10.7",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": [
"LGPL-2.1-only"
/trunk/vendor/tinymce/tinymce/package.json
1,6 → 1,6
{
"name": "tinymce",
"version": "5.10.6",
"version": "5.10.7",
"repository": {
"type": "git",
"url": "https://github.com/tinymce/tinymce.git",
/trunk/vendor/tinymce/tinymce/plugins/advlist/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/advlist/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function f(t,e,n){t.execCommand("UL"===e?"InsertUnorderedList":"InsertOrderedList",!1,!1===n?null:{"list-style-type":n})}function i(t){return function(){return t}}function t(t){return t}function e(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=i(!1),l=i(!0),s={fold:function(t,e){return t()},isSome:u,isNone:l,getOr:t,getOrThunk:r,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:r,map:e,each:function(){},bind:e,exists:u,forall:l,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function r(t){return t()}function d(t){return t&&/^(TH|TD)$/.test(t.nodeName)}function m(c,a){return function(s){function t(t){var e,n,r,o,i,u,l;s.setActive((e=c,r=a,i=-1!==(o=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}((n=t).parents,d))?n.parents.slice(0,o):n.parents,0<(u=g.grep(i,(l=e,function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(e=t,l.$.contains(l.getBody(),e));var e}))).length&&u[0].nodeName===r))}return c.on("NodeChange",t),function(){return c.off("NodeChange",t)}}}function c(t,e,n,r,o,i){var u,l,s,c,a,d;1<i.length?(c=r,a=o,d=i,(s=t).ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(g.map(d,function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})}}))},onAction:function(){return s.execCommand(c)},onItemAction:function(t,e){f(s,a,e)},select:function(e){var t,n=(t=s).dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(n,"listStyleType");return p(r).map(function(t){return e===t}).getOr(!1)},onSetup:m(s,a)})):(l=r,(u=t).ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:m(u,o),onAction:function(){return u.execCommand(l)}}))}var a=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return a(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p=function(t){return null==t?s:a(t)};n.add("advlist",function(t){var n,e,r,o;t.hasPlugin("lists")?(c(e=t,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),c(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(n=t).addCommand("ApplyUnorderedListStyle",function(t,e){f(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){f(n,"OL",e["list-style-type"])})):console.error("Please use the Lists plugin together with the Advanced List plugin.")})}();
/trunk/vendor/tinymce/tinymce/plugins/anchor/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/anchor/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function a(e){return e.getAttribute("id")||e.getAttribute("name")||""}function c(e){return e&&"a"===e.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==a(e)}function d(e){return e.dom.getParent(e.selection.getStart(),l)}function r(e,t){var o,a,n,r,i,l=d(e);l?(n=e,r=t,(i=l).removeAttribute("name"),i.id=r,n.addVisual(),n.undoManager.add()):(a=t,(o=e).undoManager.transact(function(){var e,n;o.getParam("allow_html_in_named_anchor",!1,"boolean")||o.selection.collapse(!0),o.selection.isCollapsed()?o.insertContent(o.dom.createHTML("a",{id:a})):(n=(e=o).dom,u(n).walk(e.selection.getRng(),function(e){s.each(e,function(e){var t;c(t=e)&&!t.firstChild&&n.remove(e,!1)})}),o.formatter.remove("namedAnchor",null,null,!0),o.formatter.apply("namedAnchor",{value:a}),o.addVisual())})),e.focus()}function i(r){return function(e){for(var t,n=0;n<e.length;n++){var o=e[n],a=void 0;!(a=t=o)||a.attr("href")||!a.attr("id")&&!a.attr("name")||t.firstChild||o.attr("contenteditable",r)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l="a:not([href])";e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",i("false")),t.serializer.addNodeFilter("a",i(null))}),(n=e).addCommand("mceAnchor",function(){var o,e,t;t=(e=d(o=n))?a(e):"",o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t=o,n=e.getData().id;(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:l,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:c})})})}();
/trunk/vendor/tinymce/tinymce/plugins/autolink/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/autolink/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function k(e){return/^[(\[{ \u00a0]$/.test(e)}function w(e){return 3===e.nodeType}function i(e){return 1===e.nodeType}function o(e,t){var n;return t<0&&(t=0),!w(e)||(n=e.data.length)<t&&(t=n),t}function y(e,t,n){!i(t)||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function v(e,t,n){!i(t)||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function r(e,t){var n,i,o,r,a,f=e.getParam("autolink_pattern",A),s=e.getParam("default_link_target",!1);if(null===e.dom.getParent(e.selection.getNode(),"a[href]")){var d=e.selection.getRng().cloneRange();if(d.startOffset<5){if(!(r=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;r=d.endContainer.firstChild.nextSibling}if(y(d,r,a=r.length),v(d,r,a),d.endOffset<5)return;n=d.endOffset,i=r}else{if(!w(i=d.endContainer)&&i.firstChild){for(;!w(i)&&i.firstChild;)i=i.firstChild;w(i)&&(y(d,i,0),v(d,i,i.nodeValue.length))}n=1===d.endOffset?2:d.endOffset-1-t}for(var l=n;y(d,i,2<=n?n-2:0),v(d,i,1<=n?n-1:0),--n,!k(d.toString())&&0<=n-2;);k(d.toString())?(y(d,i,n),v(d,i,l),n+=1):(0===d.startOffset?y(d,i,0):y(d,i,n),v(d,i,l)),u=d.toString(),/[?!,.;:]/.test(u.charAt(u.length-1))&&v(d,i,l-1);var u,c,g,h,C=(u=d.toString().trim()).match(f),m=e.getParam("link_default_protocol","http","string");C&&((g=c=C[0]).length>=(h="www.").length&&g.substr(0,0+h.length)===h?c=m+"://"+c:-1===c.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(c)||(c="mailto:"+c),o=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,c),!1!==s&&e.dom.setAttrib(e.selection.getNode(),"target",s),e.selection.moveToBookmark(o),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),A=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i");e.add("autolink",function(e){var t,n;(t=e).on("keydown",function(e){if(13===e.keyCode)return r(t,-1)}),a.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return r(t,-1)}),t.on("keyup",function(e){if(32===e.keyCode)return r(t,0)}))})}();
/trunk/vendor/tinymce/tinymce/plugins/autoresize/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/autoresize/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function y(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")}function p(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function v(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var l=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),b=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t,n){var i,o,r,s,a,l,u,g,c,m,f,d=e.dom,h=e.getDoc();h&&(e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()?p(e,!0):(i=h.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(d,i,"margin-top",!0),a=v(d,i,"margin-bottom",!0),(l=(l=i.offsetHeight+s+a+o)<0?0:l)+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=l+u),(g=e.getParam("max_height",0,"number"))&&g<r?(r=g,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),d.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),b.browser.isSafari()&&b.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),!e.hasFocus()||"setcontent"!==(null==(f=n)?void 0:f.type.toLowerCase())||!0!==f.selection&&!0!==f.paste||e.selection.scrollIntoView(),b.webkit&&c<0&&C(e,t,n))))};e.add("autoresize",function(e){var t,n,i,o,r,s,a=e.settings;l.call(a,"resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){C(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(n,i,e)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){u(n,i,20,100,function(){u(n,i,5,1e3)})}))})}();
/trunk/vendor/tinymce/tinymce/plugins/autosave/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/autosave/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function o(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)}function n(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)}function i(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=d.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)}function u(t){var e=parseInt(v.getItem(n(t)+"time"),10)||0;return!((new Date).getTime()-e>o(t.getParam("autosave_retention"),"20m")&&(g(t,!1),1))}function s(t){var e=n(t);!i(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))}function f(t){var e=n(t);u(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))}function c(t){t.undoManager.transact(function(){f(t),g(t)}),t.focus()}function m(r){return function(t){function e(){return t.setDisabled(!u(r))}return t.setDisabled(!u(r)),r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return void 0===t},l=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var r=n(t);v.removeItem(r+"draft"),v.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},y=tinymce.util.Tools.resolve("tinymce.EditorManager");t.add("autosave",function(t){var e,r,n,a;return t.editorManager.on("BeforeUnload",function(t){var e;d.each(y.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),n=e=t,a=o(n.getParam("autosave_interval"),"30s"),l.setEditorInterval(n,function(){s(n)},a),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&f(t)}),r=t,{hasDraft:function(){return u(r)},storeDraft:function(){return s(r)},restoreDraft:function(){return f(r)},removeDraft:function(t){return g(r,t)},isEmpty:function(t){return i(r,t)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/bbcode/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/bbcode/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function i(t){function o(o,e){t=t.replace(o,e)}return t=n.trim(t),o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t}var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){function e(o,e){t=t.replace(o,e)}var t;o.set&&(o.content=i(o.content)),o.get&&(o.content=(t=o.content,t=n.trim(t),e(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/<font>(.*?)<\/font>/gi,"$1"),e(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),e(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),e(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),e(/<u>/gi,"[u]"),e(/<blockquote[^>]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/<br \/>/gi,"\n"),e(/<br\/>/gi,"\n"),e(/<br>/gi,"\n"),e(/<p>/gi,""),e(/<\/p>/gi,"\n"),e(/&nbsp;|\u00a0/gi," "),e(/&quot;/gi,'"'),e(/&lt;/gi,"<"),e(/&gt;/gi,">"),e(/&amp;/gi,"&"),t))})})}();
/trunk/vendor/tinymce/tinymce/plugins/charmap/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/charmap/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function l(e,r){var n=e.fire("insertCustomChar",{chr:r}).chr;e.execCommand("mceInsertContent",!1,n)}function i(e){return function(){return e}}function e(e){return e}function r(){return c}var t,g,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return n=typeof(r=e),(null===r?"null":"object"==n&&(Array.prototype.isPrototypeOf(r)||r.constructor&&"Array"===r.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(r)||r.constructor&&"String"===r.constructor.name)?"string":n)===t;var r,n},m=i(!(t="array")),o=i(!(g=null)),c={fold:function(e,r){return e()},isSome:m,isNone:o,getOr:e,getOrThunk:u,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:u,map:r,each:function(){},bind:r,exists:m,forall:o,filter:function(){return c},toArray:function(){return[]},toString:i("none()")};function u(e){return e()}function f(e,r){for(var n=e.length,t=new Array(n),a=0;a<n;a++){var i=e[a];t[a]=r(i,a)}return t}function s(e){return A(e)?x.grep(e,function(e){return A(e)&&2===e.length}):"function"==typeof e?e():[]}function h(e){var r=function(e,r){var n=e.getParam("charmap");n&&(r=[{name:O,characters:s(n)}]);var t=e.getParam("charmap_append");if(t){var a=x.grep(r,function(e){return e.name===O});return a.length?(a[0].characters=[].concat(a[0].characters).concat(s(t)),r):r.concat({name:O,characters:s(t)})}return r}(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<r.length?[{name:"All",characters:function(e){for(var r=[],n=0,t=e.length;n<t;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);C.apply(r,e[n])}return r}(f(r,function(e){return e.characters}))}].concat(r):r}function p(e){var r=e;return{get:function(){return r},set:function(e){r=e}}}function d(e,r){return-1!==e.indexOf(r)}function y(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(q)return q.apply(void 0,e);for(var n=[],t="",a=0,i=e.length;a!==i;++a){var o=+e[a];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);16383<=(o<=65535?n.push(o):(o-=65536,n.push(55296+(o>>10),o%1024+56320)))&&(t+=String.fromCharCode.apply(null,n),n.length=0)}return t+String.fromCharCode.apply(null,n)}function v(e,r){var c=[],u=r.toLowerCase();return function(e){for(var r,n,t,a,i=0,o=e.length;i<o;i++)r=e[i],a=t=n=a=t=n=void 0,n=r[0],t=r[1],a=u,(d(y(n).toLowerCase(),a)||d(t.toLowerCase(),a)||d(t.toLowerCase().replace(/\s+/g,""),a))&&c.push(r)}(e.characters),f(c,function(e){return{text:e[1],value:y(e[0]),icon:y(e[0])}})}function w(n,a){function r(){return[{label:"Search",type:"input",name:S},{type:"collection",name:"results"}]}var t,i,o=1===a.length?p(O):p("All"),c=(t=function(e){var r=e.getData().pattern,n=e,t=r;(function(e,r,n){for(var t=0,a=e.length;t<a;t++){var i=e[t];if(r(i,t))return k.some(i);if(n(i,t))break}return k.none()})(a,function(e){return e.name===o.get()},m).each(function(e){var r=v(e,t);n.setData({results:r})})},i=null,{cancel:u,throttle:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];u(),i=setTimeout(function(){i=null,t.apply(null,e)},40)}});function u(){g===i||(clearTimeout(i),i=null)}var e=1===a.length?{type:"panel",items:r()}:{type:"tabpanel",tabs:f(a,function(e){return{title:e.name,name:e.name,items:r()}})},s={pattern:"",results:v(a[0],"")};n.windowManager.open({title:"Special Character",size:"normal",body:e,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:s,onAction:function(e,r){"results"===r.name&&(l(n,r.value),e.close())},onTabChange:function(e,r){o.set(r.newTabName),c.throttle(e)},onChange:function(e,r){r.name===S&&c.throttle(e)}}).focus(S)}var b=function(n){function e(){return a}function r(e){return e(n)}var t=i(n),a={fold:function(e,r){return r(n)},isSome:o,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return b(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:c},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},k={some:b,none:r,from:function(e){return null==e?c:b(e)}},C=Array.prototype.push,x=tinymce.util.Tools.resolve("tinymce.util.Tools"),A=x.isArray,O="User Defined",q=String.fromCodePoint,S="pattern",T=tinymce.util.Tools.resolve("tinymce.util.Promise");n.add("charmap",function(e){var r,n,t,a,i,o=h(e),c=o;return(r=e).addCommand("mceShowCharmap",function(){w(r,c)}),(n=e).ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}}),t=e,a=o[0],t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(n,e){return new T(function(e,r){e(v(a,n))})},onAction:function(e,r,n){t.selection.setRng(r),t.insertContent(n),e.hide()}}),i=e,{getCharMap:function(){return h(i)},insertChar:function(e){l(i,e)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/code/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/code/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",function(e){var t,o;function n(){return o.execCommand("mceCodeEditor")}return(t=e).addCommand("mceCodeEditor",function(){var n,e;e=(n=t).getContent({source_view:!0}),n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t=n,o=e.getData().code;t.focus(),t.undoManager.transact(function(){t.setContent(o)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})}),(o=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:n}),o.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:n}),{}})}();
/trunk/vendor/tinymce/tinymce/plugins/codesample/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/codesample/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function o(e){return function(){return e}}function e(e){return e}function n(){return l}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=o(!1),i=o(!0),l={fold:function(e,n){return e()},isSome:s,isNone:i,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:e,orThunk:a,map:n,each:function(){},bind:n,exists:s,forall:i,filter:function(){return l},toArray:function(){return[]},toString:o("none()")};function a(e){return e()}function u(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")}function c(t){return function(e,n){return t(n)}}var d=function(t){function e(){return r}function n(e){return e(t)}var a=o(t),r={fold:function(e,n){return n(t)},isSome:i,isNone:s,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return d(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?r:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return r},p={some:d,none:n,from:function(e){return null==e?l:d(e)}},g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),r="undefined"!=typeof window?window:Function("return this;")(),b={},m={exports:b},f={};function h(e){return r.Prism&&e.getParam("codesample_global_prismjs",!1,"boolean")?r.Prism:k}function y(e){var n=e.selection?e.selection.getNode():null;return u(n)?p.some(n):p.none()}function w(s){var t,e,n=s.getParam("codesample_languages")||[{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"}],a=(0<(e=n).length?p.some(e[0]):p.none()).fold(o(""),function(e){return e.value}),r=(t=a,y(s).fold(function(){return t},function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t})),i=y(s).fold(o(""),function(e){return e.textContent});s.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:n},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:function(e){var n=e.getData(),t=s,a=n.language,r=n.code;t.undoManager.transact(function(){var e=y(t);return r=g.DOM.encode(r),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+a+'">'+r+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+a),e.innerHTML=r,h(t).highlightElement(e),t.selection.select(e)})}),e.close()}})}!function(e,n){var t,a,r=window.Prism;window.Prism={manual:!0},t=this,a=function(){var e,n,h,t,a,r,s,i,o,l,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:f,c={exports:{}};function y(e,n){return"___"+e.toUpperCase()+n+"___"}return e=c,n=function(u){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,e={},j={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof T?new T(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function t(e,a){var r,n;switch(a=a||{},j.util.type(e)){case"Object":if(n=j.util.objId(e),a[n])return a[n];for(var s in r={},a[n]=r,e)e.hasOwnProperty(s)&&(r[s]=t(e[s],a));return r;case"Array":return n=j.util.objId(e),a[n]||(r=[],a[n]=r,e.forEach(function(e,n){r[n]=t(e,a)}),r);default:return e}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t.source,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(e){var n=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(e.stack)||[])[1];if(n){var t,a=document.getElementsByTagName("script");for(t in a)if(a[t].src==n)return a[t]}return null}},isActive:function(e,n,t){for(var a="no-"+n;e;){var r=e.classList;if(r.contains(n))return!0;if(r.contains(a))return!1;e=e.parentElement}return!!t}},languages:{plain:e,plaintext:e,text:e,txt:e,extend:function(e,n){var t,a=j.util.clone(j.languages[e]);for(t in n)a[t]=n[t];return a},insertBefore:function(t,e,n,a){var r,s=(a=a||j.languages)[t],i={};for(r in s)if(s.hasOwnProperty(r)){if(r==e)for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);n.hasOwnProperty(r)||(i[r]=s[r])}var l=a[t];return a[t]=i,j.languages.DFS(j.languages,function(e,n){n===l&&e!=t&&(this[e]=i)}),i},DFS:function e(n,t,a,r){r=r||{};var s,i,o,l=j.util.objId;for(s in n)n.hasOwnProperty(s)&&(t.call(n,s,n[s],a||s),i=n[s],"Object"!==(o=j.util.type(i))||r[l(i)]?"Array"!==o||r[l(i)]||(r[l(i)]=!0,e(i,t,s,r)):(r[l(i)]=!0,e(i,t,null,r)))}},plugins:{},highlightAll:function(e,n){j.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,t){var a={callback:t,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};j.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),j.hooks.run("before-all-elements-highlight",a);for(var r,s=0;r=a.elements[s++];)j.highlightElement(r,!0===n,a.callback)},highlightElement:function(e,n,t){var a=j.util.getLanguage(e),r=j.languages[a];j.util.setLanguage(e,a);var s=e.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&j.util.setLanguage(s,a);var i,o={element:e,language:a,grammar:r,code:e.textContent};function l(e){o.highlightedCode=e,j.hooks.run("before-insert",o),o.element.innerHTML=o.highlightedCode,j.hooks.run("after-highlight",o),j.hooks.run("complete",o),t&&t.call(o.element)}if(j.hooks.run("before-sanity-check",o),(s=o.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!o.code)return j.hooks.run("complete",o),void(t&&t.call(o.element));j.hooks.run("before-highlight",o),o.grammar?n&&u.Worker?((i=new Worker(j.filename)).onmessage=function(e){l(e.data)},i.postMessage(JSON.stringify({language:o.language,code:o.code,immediateClose:!0}))):l(j.highlight(o.code,o.grammar,o.language)):l(j.util.encode(o.code))},highlight:function(e,n,t){var a={code:e,grammar:n,language:t};if(j.hooks.run("before-tokenize",a),!a.grammar)throw new Error('The language "'+a.language+'" has no grammar.');return a.tokens=j.tokenize(a.code,a.grammar),j.hooks.run("after-tokenize",a),T.stringify(j.util.encode(a.tokens),a.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var a in t)n[a]=t[a];delete n.rest}var r=new s;return O(r,r.head,e),function e(n,t,a,r,s,i){for(var o in a)if(a.hasOwnProperty(o)&&a[o])for(var l=a[o],l=Array.isArray(l)?l:[l],u=0;u<l.length;++u){if(i&&i.cause==o+","+u)return;var c,d=l[u],p=d.inside,g=!!d.lookbehind,b=!!d.greedy,m=d.alias;b&&!d.pattern.global&&(c=d.pattern.toString().match(/[imsuy]*$/)[0],d.pattern=RegExp(d.pattern.source,c+"g"));for(var f=d.pattern||d,h=r.next,y=s;h!==t.tail&&!(i&&y>=i.reach);y+=h.value.length,h=h.next){var w=h.value;if(t.length>n.length)return;if(!(w instanceof T)){var k,v=1;if(b){if(!(k=B(f,y,n,g))||k.index>=n.length)break;var x=k.index,_=k.index+k[0].length,F=y;for(F+=h.value.length;F<=x;)F+=(h=h.next).value.length;if(y=F-=h.value.length,h.value instanceof T)continue;for(var S=h;S!==t.tail&&(F<_||"string"==typeof S.value);S=S.next)v++,F+=S.value.length;v--,w=n.slice(y,F),k.index-=y}else if(!(k=B(f,0,w,g)))continue;var x=k.index,A=k[0],P=w.slice(0,x),$=w.slice(x+A.length),z=y+w.length;i&&z>i.reach&&(i.reach=z);var E=h.prev;P&&(E=O(t,E,P),y+=P.length),function(e,n,t){for(var a=n.next,r=0;r<t&&a!==e.tail;r++)a=a.next;(n.next=a).prev=n,e.length-=r}(t,E,v);var C,h=O(t,E,new T(o,p?j.tokenize(A,p):A,m,A));$&&O(t,h,$),1<v&&(e(n,t,a,h.prev,y,C={cause:o+","+u,reach:z}),i&&C.reach>i.reach&&(i.reach=C.reach))}}}}(e,r,n,r.head,0),function(e){for(var n=[],t=e.head.next;t!==e.tail;)n.push(t.value),t=t.next;return n}(r)},hooks:{all:{},add:function(e,n){var t=j.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=j.hooks.all[e];if(t&&t.length)for(var a,r=0;a=t[r++];)a(n)}},Token:T};function T(e,n,t,a){this.type=e,this.content=n,this.alias=t,this.length=0|(a||"").length}function B(e,n,t,a){e.lastIndex=n;var r,s=e.exec(t);return s&&a&&s[1]&&(r=s[1].length,s.index+=r,s[0]=s[0].slice(r)),s}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function O(e,n,t){var a=n.next,r={value:t,prev:n,next:a};return n.next=r,a.prev=r,e.length++,r}if(u.Prism=j,T.stringify=function n(e,t){if("string"==typeof e)return e;if(Array.isArray(e)){var a="";return e.forEach(function(e){a+=n(e,t)}),a}var r={type:e.type,content:n(e.content,t),tag:"span",classes:["token",e.type],attributes:{},language:t},s=e.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(r.classes,s):r.classes.push(s)),j.hooks.run("wrap",r);var i,o="";for(i in r.attributes)o+=" "+i+'="'+(r.attributes[i]||"").replace(/"/g,"&quot;")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+o+">"+r.content+"</"+r.tag+">"},!u.document)return u.addEventListener&&(j.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,a=n.code,r=n.immediateClose;u.postMessage(j.highlight(a,j.languages[t],t)),r&&u.close()},!1)),j;var a,r=j.util.currentScript();function i(){j.manual||j.highlightAll()}return r&&(j.filename=r.src,r.hasAttribute("data-manual")&&(j.manual=!0)),j.manual||("loading"===(a=document.readyState)||"interactive"===a&&r&&r.defer?document.addEventListener("DOMContentLoaded",i):window.requestAnimationFrame?window.requestAnimationFrame(i):window.setTimeout(i,16)),j}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}),e.exports&&(e.exports=n),void 0!==u&&(u.Prism=n),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},h=Prism,Object.defineProperties(h.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,s){var i;a.language===r&&(i=a.tokenStack=[],a.code=a.code.replace(e,function(e){if("function"==typeof s&&!s(e))return e;for(var n,t=i.length;-1!==a.code.indexOf(n=y(r,t));)++t;return i[t]=e,n}),a.grammar=h.languages.markup)}},tokenizePlaceholders:{value:function(g,b){var m,f;g.language===b&&g.tokenStack&&(g.grammar=h.languages[b],m=0,f=Object.keys(g.tokenStack),function e(n){for(var t=0;t<n.length&&!(m>=f.length);t++){var a,r,s,i,o,l,u,c,d,p=n[t];"string"==typeof p||p.content&&"string"==typeof p.content?(a=f[m],r=g.tokenStack[a],s="string"==typeof p?p:p.content,i=y(b,a),-1<(o=s.indexOf(i))&&(++m,l=s.substring(0,o),u=new h.Token(b,h.tokenize(r,g.grammar),"language-"+b,r),c=s.substring(o+i.length),d=[],l&&d.push.apply(d,e([l])),d.push(u),c&&d.push.apply(d,e([c])),"string"==typeof p?n.splice.apply(n,[t,1].concat(d)):p.content=d)):p.content&&e(p.content)}return n}(g.tokens))}}}),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,t=Prism,a=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return a.source}),t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:a,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"]),function(t){function a(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function r(e,n,t){return RegExp(a(e,n),t||"")}function e(e,n){for(var t=0;t<n;t++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var n="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",s="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var u=l(s),c=RegExp(l(n+" "+s+" "+i+" "+o)),d=l(s+" "+i+" "+o),p=l(n+" "+s+" "+o),g=e(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),b=e(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,f=a(/<<0>>(?:\s*<<1>>)?/.source,[m,g]),h=a(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,f]),y=/\[\s*(?:,\s*)*\]/.source,w=a(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[h,y]),k=a(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[g,b,y]),v=a(/\(<<0>>+(?:,<<0>>+)+\)/.source,[k]),x=a(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,h,y]),_={keyword:c,punctuation:/[<>()?,.:[\]]/},F=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,S=/"(?:\\.|[^\\"\r\n])*"/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[h]),lookbehind:!0,inside:_},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,x]),lookbehind:!0,inside:_},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[u,f]),lookbehind:!0,inside:_},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[h]),lookbehind:!0,inside:_},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[w]),lookbehind:!0,inside:_},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[x,p,m]),inside:_}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[b]),lookbehind:!0,alias:"class-name",inside:_},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[x,h]),inside:_,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[x]),lookbehind:!0,inside:_,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,g]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(g),alias:"class-name",inside:_}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,f,m,x,c.source,b,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[f,b]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(x),greedy:!0,inside:_},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var A=S+"|"+F,P=a(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[A]),$=e(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[P]),2),z=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,E=a(/<<0>>(?:\s*\(<<1>>*\))?/.source,[h,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[z,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[z]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(h),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var C=/:[^}\r\n]+/.source,j=e(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[P]),2),T=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[j,C]),B=e(a(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[A]),2),O=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[B,C]);function R(e,n){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[e]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,C]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[T]),lookbehind:!0,greedy:!0,inside:R(T,j)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[O]),lookbehind:!0,greedy:!0,inside:R(O,B)}],char:{pattern:RegExp(F),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp}(Prism),function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var t=e.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism),s=Prism,i=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,o=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,l={pattern:RegExp(/(^|[^\w.])/.source+o+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}},s.languages.java=s.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[l,{pattern:RegExp(/(^|[^\w.])/.source+o+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:l.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+o+/[A-Z]\w*\b/.source),lookbehind:!0,inside:l.inside}],keyword:i,function:[s.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),s.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),s.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":l,keyword:i,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+o+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:l.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+o+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:l.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return i.source})),lookbehind:!0,inside:{punctuation:/\./}}}),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|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|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var t={};t["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},t.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:t}};a["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,n){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:Prism.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(n){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:r,punctuation:s};var i={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:i}}];n.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:e,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:a,operator:r,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(e){/<\?/.test(e.code)&&n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var t="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+t+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+t),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+t),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),{boltExport:c.exports}},"object"==typeof e&&void 0!==n?n.exports=a():(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=a();window.Prism;window.Prism=r}(b,m);var k=m.exports.boltExport;t.add("codesample",function(n){var t,r,a,s;function e(){return s.execCommand("codesample")}r=(t=n).$,t.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(c(u)).each(function(e,n){var t=r(n),a=n.textContent;t.attr("class",r.trim(t.attr("class"))),t.removeAttr("contentEditable"),t.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),t.on("SetContent",function(){var e=r("pre").filter(c(u)).filter(function(e,n){return"false"!==n.contentEditable});e.length&&t.undoManager.transact(function(){e.each(function(e,n){r(n).find("br").each(function(e,n){n.parentNode.replaceChild(t.getDoc().createTextNode("\n"),n)}),n.contentEditable="false",n.innerHTML=t.dom.encode(n.textContent),h(t).highlightElement(n),n.className=r.trim(n.className)})})}),(s=n).ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:e,onSetup:function(t){function e(){var e,n;t.setActive((n=(e=s).selection.getStart(),e.dom.is(n,'pre[class*="language-"]')))}return s.on("NodeChange",e),function(){return s.off("NodeChange",e)}}}),s.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:e}),(a=n).addCommand("codesample",function(){var e=a.selection.getNode();a.selection.isCollapsed()||u(e)?w(a):a.formatter.toggle("code")}),n.on("dblclick",function(e){u(e.target)&&w(n)})})}();
/trunk/vendor/tinymce/tinymce/plugins/colorpicker/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/colorpicker/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){})}();
/trunk/vendor/tinymce/tinymce/plugins/contextmenu/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/contextmenu/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){})}();
/trunk/vendor/tinymce/tinymce/plugins/directionality/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/directionality/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function n(t){return function(n){return typeof n===t}}function u(n){return function(){return n}}function t(n){return n}function r(){return d}var o,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return r=typeof(t=n),(null===t?"null":"object"==r&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":r)===o;var t,r},c=n("boolean"),f=n("function"),l=n("number"),a=u(!(o="string")),m=u(!0),d={fold:function(n,t){return n()},isSome:a,isNone:m,getOr:t,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:t,orThunk:s,map:r,each:function(){},bind:r,exists:a,forall:m,filter:function(){return d},toArray:function(){return[]},toString:u("none()")};function s(n){return n()}function g(n,t){for(var r=0,o=n.length;r<o;r++)t(n[r],r)}function h(n,t){var r=n.dom;if(1!==r.nodeType)return!1;var o=r;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function v(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:n}}var p=function(r){function n(){return e}function t(n){return n(r)}var o=u(r),e={fold:function(n,t){return t(r)},isSome:m,isNone:a,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return p(n(r))},each:function(n){n(r)},bind:t,exists:t,forall:t,filter:function(n){return n(r)?e:d},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return e},y={some:p,none:r,from:function(n){return null==n?d:p(n)}},w={fromHtml:function(n,t){var r=(t||document).createElement("div");if(r.innerHTML=n,!r.hasChildNodes()||1<r.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return v(r.childNodes[0])},fromTag:function(n,t){var r=(t||document).createElement(n);return v(r)},fromText:function(n,t){var r=(t||document).createTextNode(n);return v(r)},fromDom:v,fromPoint:function(n,t,r){return y.from(n.dom.elementFromPoint(t,r)).map(v)}};function D(t){return function(n){return n.dom.nodeType===t}}function N(n,t,r){!function(n,t,r){if(!(i(r)||c(r)||l(r)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",r,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,r+"")}(n.dom,t,r)}function T(n,t){n.dom.removeAttribute(t)}function S(n){return w.fromDom(n.dom.host)}function b(e,u,n){return function(n){for(var t=e.dom,r=f(n)?n:a;t.parentNode;){var t=t.parentNode,o=w.fromDom(t);if(h(o,u))return y.some(o);if(r(o))break}return y.none()}(n)}function O(n){return"rtl"===(r="direction",o=(t=n).dom,""!==(e=window.getComputedStyle(o).getPropertyValue(r))||B(t)?e:H(o,r))?"rtl":"ltr";var t,r,o,e}function A(n,t){return r=function(n){return h(n,t)},function(n,t){for(var r=[],o=0,e=n.length;o<e;o++){var u=n[o];t(u,o)&&r.push(u)}return r}(function(n,t){for(var r=n.length,o=new Array(r),e=0;e<r;e++){var u=n[e];o[e]=t(u,e)}return o}(n.dom.childNodes,w.fromDom),r);var r}function C(n,u){var t=n.selection.getSelectedBlocks();0<t.length&&(g(t,function(n){var t,r=w.fromDom(n),o=k(r),e=(t=r,(o?b(t,"ol,ul"):y.some(t)).getOr(t));y.from(e.dom.parentNode).map(w.fromDom).filter(E).each(function(n){O(n)!==u?N(e,"dir",u):O(e)!==u&&T(e,"dir"),o&&g(A(e,"li[dir]"),function(n){return T(n,"dir"),0})})}),n.nodeChanged())}function M(t,o){return function(r){function n(n){var t=w.fromDom(n.element);r.setActive(O(t)===o)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}"undefined"!=typeof window||Function("return this;")();function k(n){return E(n)&&"li"===n.dom.nodeName.toLowerCase()}var E=D(1),L=D(3),P=D(9),R=D(11),x=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode)?function(n){return w.fromDom(n.dom.getRootNode())}:function(n){return P(n)?n:w.fromDom(n.dom.ownerDocument)},B=function(n){var t=L(n)?n.dom.parentNode:n.dom;if(null==t||null===t.ownerDocument)return!1;var r,o,e,u,i,c=t.ownerDocument;return e=w.fromDom(t),i=x(e),(R(u=i)&&null!=u.dom.host?y.some(i):y.none()).fold(function(){return c.body.contains(t)},(r=B,o=S,function(n){return r(o(n))}))},H=function(n,t){return void 0!==n.style&&f(n.style.getPropertyValue)?n.style.getPropertyValue(t):""};e.add("directionality",function(n){var t,r;(t=n).addCommand("mceDirectionLTR",function(){C(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){C(t,"rtl")}),(r=n).ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return r.execCommand("mceDirectionLTR")},onSetup:M(r,"ltr")}),r.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return r.execCommand("mceDirectionRTL")},onSetup:M(r,"rtl")})})}();
/trunk/vendor/tinymce/tinymce/plugins/emoticons/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/emoticons/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function r(){}function i(t){return function(){return t}}function t(t){return t}function n(){return c}var m,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=i(!1),a=i(!(m=null)),c={fold:function(t,n){return t()},isSome:l,isNone:a,getOr:t,getOrThunk:o,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:o,map:n,each:r,bind:n,exists:l,forall:a,filter:function(){return c},toArray:function(){return[]},toString:i("none()")};function o(t){return t()}function g(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}function d(t,n){for(var e=k(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}}function h(t,n){return j.call(t,n)}function s(){var t,n,e=(t=r,n=g(O.none()),{clear:function(){o(),n.set(O.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){o(),n.set(O.some(t))}});function o(){return n.get().each(t)}return C(C({},e),{on:function(t){return e.get().each(t)}})}function f(t,n){return-1!==t.indexOf(n)}function v(i,r,t){var a=s(),c=s(),f=i.getParam("emoticons_images_url","https://twemoji.maxcdn.com/v/13.0.1/72x72/","string");i.on("init",function(){_.load(t,r).then(function(t){var n,e,o,l,s,r=(n=i.getParam("emoticons_append",{},"object"),e=function(t){return C({keywords:[],category:"user"},t)},A(n,function(t,n){return{k:n,v:e(t)}}));o=w(t,r),l={},s=[],d(o,function(t,n){var e,o,r,i,a,c={title:n,keywords:t.keywords,char:(i=(r=t).char).length>=(a="<img").length&&i.substr(0,0+a.length)===a?r.char.replace(/src="([^"]+)"/,function(t,n){return'src="'+f+n+'"'}):r.char,category:h(e=D,o=t.category)?e[o]:o},u=void 0!==l[c.category]?l[c.category]:[];l[c.category]=u.concat([c]),s.push(c)}),a.set(l),c.set(s)},function(t){console.log("Failed to load emoticons: "+t),a.set({}),c.set([])})});function e(){return c.get().getOr([])}function u(){return a.isSet()&&c.isSet()}return{listCategories:function(){return[P].concat(k(a.get().getOr({})))},hasLoaded:u,waitForLoad:function(){return u()?x.resolve(!0):new x(function(t,n){var e=15,o=T.setInterval(function(){u()?(T.clearInterval(o),t(!0)):--e<0&&(console.log("Could not load emojis from url: "+r),T.clearInterval(o),n(!1))},100)})},listAll:e,listCategory:function(n){return n===P?e():a.get().bind(function(t){return O.from(t[n])}).getOr([])}}}function y(t,n,e){for(var o,r,i=[],a=n.toLowerCase(),c=e.fold(function(){return l},function(n){return function(t){return n<=t}}),u=0;u<t.length&&(0!==n.length&&(o=t[u],r=a,!f(o.title.toLowerCase(),r)&&!function(t){for(var n=0,e=t.length;n<e;n++)if(f(t[n].toLowerCase(),r))return 1}(o.keywords))||(i.push({value:t[u].char,text:t[u].title,icon:t[u].char}),!c(i.length)));u++);return i}function p(o,i){var e,r,t={pattern:"",results:y(i.listAll(),"",O.some(300))},a=g(P),c=(e=function(t){var n,e=(n=t).getData(),o=a.get(),r=y(i.listCategory(o),e[S],o===P?O.some(300):O.none());n.setData({results:r})},r=null,{cancel:u,throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];u(),r=setTimeout(function(){r=null,e.apply(null,t)},200)}});function u(){m===r||(clearTimeout(r),r=null)}function n(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(t){for(var n=t.length,e=new Array(n),o=0;o<n;o++){var r=t[o];e[o]={title:r,name:r,items:[l,s]}}return e}(i.listCategories())},initialData:t,onTabChange:function(t,n){a.set(n.newTabName),c.throttle(t)},onChange:c.throttle,onAction:function(t,n){var e;"results"===n.name&&(e=n.value,o.insertContent(e),t.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}}var l={label:"Search",type:"input",name:S},s={type:"collection",name:"results"},f=o.windowManager.open(n());f.focus(S),i.hasLoaded()||(f.block("Loading emoticons..."),i.waitForLoad().then(function(){f.redial(n()),c.throttle(f),f.focus(S),f.unblock()}).catch(function(t){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(S),f.unblock()}))}function b(t){t.on("PreInit",function(){t.parser.addAttributeFilter("data-emoticon",function(t){!function(t){for(var n,e=0,o=t.length;e<o;e++)(n=t[e]).attr("data-mce-resize","false"),n.attr("data-mce-placeholder","1")}(t)})})}function w(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)h(i,r)&&(e[r]=(e[r],i[r]))}return e}var u=function(e){function t(){return r}function n(t){return t(e)}var o=i(e),r={fold:function(t,n){return n(e)},isSome:a,isNone:l,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return u(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?r:c},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},O={some:u,none:n,from:function(t){return null==t?c:u(t)}},C=function(){return(C=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},k=Object.keys,j=Object.hasOwnProperty,A=function(t,o){var r={};return d(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},_=tinymce.util.Tools.resolve("tinymce.Resource"),T=tinymce.util.Tools.resolve("tinymce.util.Delay"),x=tinymce.util.Tools.resolve("tinymce.util.Promise"),P="All",D={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},S="pattern";e.add("emoticons",function(t,n){var e,o,r,i,a,c,u,l,s=(o=n,r=(e=t).getParam("emoticons_database","emojis","string"),e.getParam("emoticons_database_url",o+"/js/"+r+e.suffix+".js","string")),f=t.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),m=v(t,s,f);function g(){return c.execCommand("mceEmoticons")}a=m,(i=t).addCommand("mceEmoticons",function(){return p(i,a)}),(c=t).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:g}),c.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:g}),l=m,(u=t).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,n){return l.waitForLoad().then(function(){return y(l.listAll(),t,O.some(n))})},onAction:function(t,n,e){u.selection.setRng(n),u.insertContent(e),t.hide()}}),b(t)})}();
/trunk/vendor/tinymce/tinymce/plugins/fullpage/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/fullpage/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function i(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function _(e){return e.getParam("fullpage_hide_in_source_view")}function b(e){return e.getParam("fullpage_default_encoding")}function x(e){return e.getParam("fullpage_default_font_family")}function k(e){return e.getParam("fullpage_default_font_size")}function C(e,t){return n({validate:!1,root_name:"#document"},e.schema).parse(t,{format:"xhtml"})}function c(u,m){u.addCommand("mceFullPageProperties",function(){var l,i,o,e,t,n,r,a,c,s;function d(e,t){return e.attr(t)||""}t=l=u,n=(i=m).get(),c=C(t,n),(s={}).fontface=x(t),s.fontsize=k(t),7===(r=c.firstChild).type&&(s.xml_pi=!0,(a=/encoding="([^"]+)"/.exec(r.value))&&(s.docencoding=a[1])),(r=c.getAll("#doctype")[0])&&(s.doctype="<!DOCTYPE"+r.value+">"),(r=c.getAll("title")[0])&&r.firstChild&&(s.title=r.firstChild.value),w.each(c.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?s[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(s.docencoding=t[1])}),(r=c.getAll("html")[0])&&(s.langcode=d(r,"lang")||d(r,"xml:lang")),s.stylesheets=[],w.each(c.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&s.stylesheets.push(e.attr("href"))}),(r=c.getAll("body")[0])&&(s.langdir=d(r,"dir"),s.style=d(r,"style"),s.visited_color=d(r,"vlink"),s.link_color=d(r,"link"),s.active_color=d(r,"alink")),o=s,e=g(g({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),o),l.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:e,onSubmit:function(e){var t=e.getData(),n=function(e,o,t){function n(e,t,n){e.attr(t,n||void 0)}function r(e){s.firstChild?s.insert(e,s.firstChild):s.append(e)}var a,l,i=e.dom,c=C(e,t),s=c.getAll("head")[0];s||(a=c.getAll("html")[0],s=new f("head",1),a.firstChild?a.insert(s,a.firstChild,!0):a.append(s)),a=c.firstChild,o.xml_pi?(l='version="1.0"',o.docencoding&&(l+=' encoding="'+o.docencoding+'"'),7!==a.type&&(a=new f("xml",7),c.insert(a,c.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=c.getAll("#doctype")[0],o.doctype?(a||(a=new f("#doctype",10),o.xml_pi?c.insert(a,c.firstChild):r(a)),a.value=o.doctype.substring(9,o.doctype.length-1)):a&&a.remove(),a=null,w.each(c.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(a=e)}),o.docencoding?(a||((a=new f("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,r(a)),a.attr("content","text/html; charset="+o.docencoding)):a&&a.remove(),a=c.getAll("title")[0],o.title?(a?a.empty():r(a=new f("title",1)),a.append(new f("#text",3)).value=o.title):a&&a.remove(),w.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=c.getAll("meta"),l=o[e],i=0;i<n.length;i++)if((t=n[i]).attr("name")===e)return void(l?t.attr("content",l):t.remove());l&&((a=new f("meta",1)).attr("name",e),a.attr("content",l),a.shortEnded=!0,r(a))});var d={};w.each(c.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&(d[e.attr("href")]=e)}),w.each(o.stylesheets,function(e){d[e]||((a=new f("link",1)).attr({rel:"stylesheet",text:"text/css",href:e}),a.shortEnded=!0,r(a)),delete d[e]}),w.each(d,function(e){e.remove()}),(a=c.getAll("body")[0])&&(n(a,"dir",o.langdir),n(a,"style",o.style),n(a,"vlink",o.visited_color),n(a,"link",o.link_color),n(a,"alink",o.active_color),i.setAttribs(e.getBody(),{style:o.style,dir:o.dir,vLink:o.visited_color,link:o.link_color,aLink:o.active_color})),(a=c.getAll("html")[0])&&(n(a,"lang",o.langcode),n(a,"xml:lang",o.langcode)),s.firstChild||s.remove();var u=p({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(c);return u.substring(0,u.indexOf("</body>"))}(l,w.extend(o,t),i.get());i.set(n),e.close()}})})}function A(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}function s(e,t,n,l){var i,o,r,a,c,s,d,u,m,g,f,p,h,y="",v=e.dom;l.selection||(a=e.getParam("protect"),c=l.content,w.each(a,function(e){c=c.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=c,"raw"===l.format&&t.get()||l.source_view&&_(e)||(-1!==(i=(r=(r=0!==r.length||l.source_view?r:w.trim(t.get())+"\n"+w.trim(r)+"\n"+w.trim(n.get())).replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(i=r.indexOf(">",i),t.set(A(r.substring(0,i+1))),-1===(o=r.indexOf("</body",i))&&(o=r.length),l.content=w.trim(r.substring(i+1,o)),n.set(A(r.substring(o)))):(t.set((h=p="",(g=e).getParam("fullpage_default_xml_pi")&&(p+='<?xml version="1.0" encoding="'+(b(g)||"ISO-8859-1")+'" ?>\n'),p+=g.getParam("fullpage_default_doctype","<!DOCTYPE html>"),p+="\n<html>\n<head>\n",(f=g.getParam("fullpage_default_title"))&&(p+="<title>"+f+"</title>\n"),(f=b(g))&&(p+='<meta http-equiv="Content-Type" content="text/html; charset='+f+'" />\n'),(f=x(g))&&(h+="font-family: "+f+";"),(f=k(g))&&(h+="font-size: "+f+";"),(f=g.getParam("fullpage_default_text_color"))&&(h+="color: "+f+";"),p+="</head>\n<body"+(h?' style="'+h+'"':"")+">\n")),n.set("\n</body>\n</html>")),s=C(e,t.get()),P(s.getAll("style"),function(e){e.firstChild&&(y+=e.firstChild.value)}),(d=s.getAll("body")[0])&&v.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),v.remove("fullpage_styles"),u=e.getDoc().getElementsByTagName("head")[0],y&&v.add(u,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(y)),m={},w.each(u.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),w.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||v.add(u,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),w.each(m,function(e){e.parentNode.removeChild(e)})))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},w=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=tinymce.util.Tools.resolve("tinymce.html.DomParser"),f=tinymce.util.Tools.resolve("tinymce.html.Node"),p=tinymce.util.Tools.resolve("tinymce.html.Serializer"),P=w.each;e.add("fullpage",function(e){var t,o,r,a,n=i(""),l=i("");c(e,n),(t=e).ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),r=n,a=l,(o=e).on("BeforeSetContent",function(e){s(o,r,a,e)}),o.on("GetContent",function(e){var t,n,l,i;t=o,n=r.get(),l=a.get(),"html"!==(i=e).format||i.selection||i.source_view&&_(t)||(i.content=(w.trim(n)+"\n"+w.trim(i.content)+"\n"+w.trim(l)).replace(/<!--mce:protected ([\s\S]*?)-->/g,function(e,t){return unescape(t)}))})})}();
/trunk/vendor/tinymce/tinymce/plugins/fullscreen/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/fullscreen/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function a(e){var n=e;return{get:function(){return n},set:function(e){n=e}}}function e(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}}function n(n){return function(e){return typeof e===n}}function c(e){return!(null==e)}function s(){}function y(e){return function(){return e}}function r(e){return e}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=e("string"),d=e("array"),o=n("boolean"),h=n("function"),i=n("number");function u(){return m}var v=y(!1),f=y(!0),m={fold:function(e,n){return e()},isSome:v,isNone:f,getOr:r,getOrThunk:g,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(void 0),or:r,orThunk:g,map:u,each:s,bind:u,exists:v,forall:f,filter:function(){return m},toArray:function(){return[]},toString:y("none()")};function g(e){return e()}function p(e){function n(){return r.get().each(e)}var r=a(A.none());return{clear:function(){n(),r.set(A.none())},isSet:function(){return r.get().isSome()},get:function(){return r.get()},set:function(e){n(),r.set(A.some(e))}}}function w(){return p(function(e){return e.unbind()})}function C(e,n){for(var r=e.length,t=new Array(r),o=0;o<r;o++){var i=e[o];t[o]=n(i,o)}return t}function D(e,n){for(var r=0,t=e.length;r<t;r++)n(e[r],r)}function b(e,n){for(var r=[],t=0,o=e.length;t<o;t++){var i=e[t];n(i,t)&&r.push(i)}return r}function S(e,n){return function(e,n,r){for(var t=0,o=e.length;t<o;t++){var i=e[t];if(n(i,t))return A.some(i);if(r(i,t))break}return A.none()}(e,n,v)}function x(e,n){return-1!==e.indexOf(n)}function E(e){return void 0!==e.style&&h(e.style.getPropertyValue)}function O(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var F=function(r){function e(){return o}function n(e){return e(r)}var t=y(r),o={fold:function(e,n){return n(r)},isSome:f,isNone:v,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return F(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},A={some:F,none:u,from:function(e){return null==e?m:F(e)}},T=function(){return(T=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},k=Array.prototype.push,R=Object.keys,L={fromHtml:function(e,n){var r=(n||document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return O(r.childNodes[0])},fromTag:function(e,n){var r=(n||document).createElement(e);return O(r)},fromText:function(e,n){var r=(n||document).createTextNode(e);return O(r)},fromDom:O,fromPoint:function(e,n,r){return A.from(e.dom.elementFromPoint(n,r)).map(O)}};function P(n){return function(e){return e.dom.nodeType===n}}function M(t,e){return function(e){for(var n=0;n<e.length;n++){var r=function(n){var r=n.brand.toLowerCase();return S(t,function(e){var n;return r===(null===(n=e.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(e){return{current:e.name,version:he.nu(parseInt(n.version,10),0)}})}(e[n]);if(r.isSome())return r}return A.none()}(e.brands)}function N(e,n){var r=String(n).toLowerCase();return S(e,function(e){return e.search(r)})}function H(n){return function(e){return x(e,n)}}function W(e){return window.matchMedia(e).matches}function q(e,n){var r=e.dom;if(1!==r.nodeType)return!1;var t=r;if(void 0!==t.matches)return t.matches(n);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(n);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(n);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function I(e){return L.fromDom(e.dom.ownerDocument)}function j(e){var n,r=Re(e);return me(n=r)&&c(n.dom.host)?A.some(r):A.none()}function B(e){return L.fromDom(e.dom.host)}function V(e,n,r){!function(e,n,r){if(!(l(r)||o(r)||i(r)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}(e.dom,n,r)}function X(e,n){var r=e.dom.getAttribute(n);return null===r?void 0:r}function _(e,n){e.dom.removeAttribute(n)}function z(e,n){var u=e.dom;!function(e){for(var n,r=R(e),t=0,o=r.length;t<o;t++){var i=r[t];n=e[i],function(e,n,r){if(!l(r))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);E(e)&&e.style.setProperty(n,r)}(u,i,n)}}(n)}function U(e){function n(){return e.stopPropagation()}function r(){return e.preventDefault()}var t,o,i=L.fromDom(function(e){if(Ae()&&c(e.target)){var n=L.fromDom(e.target);if(se(n)&&Le(n)&&e.composed&&e.composedPath){var r=e.composedPath();if(r)return 0<(t=r).length?A.some(t[0]):A.none()}}var t;return A.from(e.target)}(e).getOr(e.target)),u=(t=r,o=n,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(o.apply(null,e))});return{target:i,x:e.clientX,y:e.clientY,stop:n,prevent:r,kill:u,raw:e}}function $(e,n,r){return o=n,i=!1,u=He,c=r,a=function(e){u(e)&&c(U(e))},(t=e).dom.addEventListener(o,a,i),{unbind:function(t){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=o.concat(e);return t.apply(null,r)}}(Ne,t,o,a,i)};var t,o,i,u,c,a}function K(e){var n=void 0===e?window:e;return ke().browser.isFirefox()?A.none():A.from(n.visualViewport)}function Y(e,n,r,t){return{x:e,y:n,width:r,height:t,right:e+r,bottom:n+t}}function G(r,t,e){return K(e).map(function(e){function n(e){return t(U(e))}return e.addEventListener(r,n),{unbind:function(){return e.removeEventListener(r,n)}}}).getOrThunk(function(){return{unbind:s}})}function J(e,n){e.fire("FullscreenStateChanged",{state:n}),e.fire("ResizeEditor")}function Q(e){return e.getParam("fullscreen_native",!1,"boolean")}function Z(e){return e.dom===(void 0!==(n=I(e).dom).fullscreenElement?n.fullscreenElement:void 0!==n.msFullscreenElement?n.msFullscreenElement:void 0!==n.webkitFullscreenElement?n.webkitFullscreenElement:null);var n}function ee(e,n){return t=function(e){return q(e,n)},b((r=e,A.from(r.dom.parentNode).map(L.fromDom).map(Ce).map(function(e){return b(e,function(e){return r.dom!==e.dom})}).getOr([])),t);var r,t}function ne(o,e,n){function r(t){return function(e){var n=X(e,"style"),r=void 0===n?"no-styles":n.trim();r===t||(V(e,Ve,r),z(e,o.parseStyle(t)))}}var t,i,u,c,a,s,l=(s=function(e){return q(e,"*")},b(function(e,n){for(var r=h(n)?n:v,t=e.dom,o=[];null!==t.parentNode&&void 0!==t.parentNode;){var i=t.parentNode,u=L.fromDom(i);if(o.push(u),!0===r(u))break;t=i}return o}(e,void 0),s)),f=function(e){for(var n=[],r=0,t=e.length;r<t;++r){if(!d(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);k.apply(n,e[r])}return n}(C(l,function(e){return ee(e,"*:not(.tox-silver-sink)")})),m=(i="background-color",u=(t=n).dom,void 0!==(a=""!==(c=window.getComputedStyle(u).getPropertyValue(i))||Pe(t)?c:Me(u,i))&&""!==a?"background-color:"+a+"!important":"background-color:rgb(255,255,255)!important;");D(f,r("display:none!important;")),D(l,r(Xe+_e+m)),r((!0===ze?"":Xe)+_e+m)(e)}function re(r,t){return function(n){function e(e){return n.setActive(e.state)}return n.setActive(null!==t.get()),r.on("FullscreenStateChanged",e),function(){return r.off("FullscreenStateChanged",e)}}}"undefined"!=typeof window||Function("return this;")();function te(){return de(0,0)}function oe(e){function n(e){return function(){return r===e}}var r=e.current,t=e.version;return{current:r,version:t,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(pe),isSafari:n("Safari")}}function ie(e){function n(e){return function(){return r===e}}var r=e.current,t=e.version;return{current:r,version:t,isWindows:n(be),isiOS:n("iOS"),isAndroid:n(Se),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(xe),isFreeBSD:n(Ee),isChromeOS:n(Oe)}}var ue,ce,ae,se=P(1),le=P(3),fe=P(9),me=P(11),de=function(e,n){return{major:e,minor:n}},he={nu:de,detect:function(e,n){var r,t,o=String(n).toLowerCase();return 0===e.length?te():(t=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}}(e,r=o))?de(i(1),i(2)):{major:0,minor:0};function i(e){return Number(r.replace(t,"$"+e))}},unknown:te},ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ge={browsers:y([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return x(e,"edge/")&&x(e,"chrome")&&x(e,"safari")&&x(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ve],search:function(e){return x(e,"chrome")&&!x(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return x(e,"msie")||x(e,"trident")}},{name:"Opera",versionRegexes:[ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:H("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:H("firefox")},{name:"Safari",versionRegexes:[ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(x(e,"safari")||x(e,"mobile/"))&&x(e,"applewebkit")}}]),oses:y([{name:"Windows",search:H("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return x(e,"iphone")||x(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:H("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:H("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:H("linux"),versionRegexes:[]},{name:"Solaris",search:H("sunos"),versionRegexes:[]},{name:"FreeBSD",search:H("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:H("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},pe="Firefox",we=function(){return oe({current:void 0,version:he.unknown()})},ye=oe,be=(y("Edge"),y("Chrome"),y("IE"),y("Opera"),y(pe),y("Safari"),"Windows"),Se="Android",xe="Solaris",Ee="FreeBSD",Oe="ChromeOS",Fe=function(){return ie({current:void 0,version:he.unknown()})},Te=ie,ke=(y(be),y("iOS"),y(Se),y("Linux"),y("OSX"),y(xe),y(Ee),y(Oe),ae=!(ue=function(){return e=navigator.userAgent,n=A.from(navigator.userAgentData),r=W,v=ge.browsers(),g=ge.oses(),p=n.bind(function(e){return M(v,e)}).orThunk(function(){return N(v,r=e).map(function(e){var n=he.detect(e.versionRegexes,r);return{current:e.name,version:n}});var r}).fold(we,ye),w=N(g,t=e).map(function(e){var n=he.detect(e.versionRegexes,t);return{current:e.name,version:n}}).fold(Fe,Te),{browser:p,os:w,deviceType:(i=p,u=e,c=r,a=(o=w).isiOS()&&!0===/ipad/i.test(u),s=o.isiOS()&&!a,f=(l=o.isiOS()||o.isAndroid())||c("(pointer:coarse)"),m=a||!s&&l&&c("(min-device-width:768px)"),d=s||l&&!m,h=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(u),{isiPad:y(a),isiPhone:y(s),isTablet:y(m),isPhone:y(d),isTouch:y(f),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:y(h),isDesktop:y(!d&&!m&&!h)})};var e,n,r,t,o,i,u,c,a,s,l,f,m,d,h,v,g,p,w}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ae||(ae=!0,ce=ue.apply(null,e)),ce}),Ce=function(e){return C(e.dom.childNodes,L.fromDom)},De=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode),Ae=y(De),Re=De?function(e){return L.fromDom(e.dom.getRootNode())}:function(e){return fe(e)?e:I(e)},Le=function(e){return c(e.dom.shadowRoot)},Pe=function(e){var n=le(e)?e.dom.parentNode:e.dom;if(null==n||null===n.ownerDocument)return!1;var r,t,o=n.ownerDocument;return j(L.fromDom(n)).fold(function(){return o.body.contains(n)},(r=Pe,t=B,function(e){return r(t(e))}))},Me=function(e,n){return E(e)?e.style.getPropertyValue(n):""},Ne=function(e,n,r,t){e.dom.removeEventListener(n,r,t)},He=f,We=function(r,t){return{left:r,top:t,translate:function(e,n){return We(r+e,t+n)}}},qe=We,Ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),je=tinymce.util.Tools.resolve("tinymce.Env"),Be=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ve="data-ephox-mobile-fullscreen-style",Xe="position:absolute!important;",_e="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",ze=je.os.isAndroid(),Ue=Ie.DOM,$e=K().fold(function(){return{bind:s,unbind:s}},function(n){var r,t=(r=p(s),T(T({},r),{on:function(e){return r.get().each(e)}})),o=w(),i=w(),u=Be.throttle(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame(function(){t.on(function(e){return z(e,{top:n.offsetTop+"px",left:n.offsetLeft+"px",height:n.height+"px",width:n.width+"px"})})})},50);return{bind:function(e){t.set(e),u(),o.set(G("resize",u)),i.set(G("scroll",u))},unbind:function(){t.on(function(){o.clear(),i.clear()}),t.clear()}}}),Ke=function(o,i){function u(n){n(w,"tox-fullscreen"),n(y,"tox-fullscreen"),n(b,"tox-fullscreen"),j(S).map(function(e){return B(e).dom}).each(function(e){n(e,"tox-fullscreen"),n(e,"tox-shadowhost")})}function e(){var r,e,n,t;F&&(r=o.dom,e="["+Ve+"]",D(1!==(n=t=document).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:C(t.querySelectorAll(e),L.fromDom),function(e){var n=X(e,Ve);"no-styles"!==n?z(e,r.parseStyle(n)):_(e,"style"),_(e,Ve)})),u(Ue.removeClass),$e.unbind(),A.from(i.get()).each(function(e){return e.fullscreenChangeHandler.unbind()})}var n,r,t,c,a,s,l,f,m,d,h,v,g,p,w=document.body,y=document.documentElement,b=o.getContainer(),S=L.fromDom(b),x=j(s=L.fromDom(o.getElement())).map(B).getOrThunk(function(){var e=I(s).dom.body;if(null==e)throw new Error("Body is not available yet");return L.fromDom(e)}),E=i.get(),O=L.fromDom(o.getBody()),F=je.deviceType.isTouch(),T=b.style,k=o.iframeElement.style;E?(E.fullscreenChangeHandler.unbind(),Q(o)&&Z(x)&&((c=I(x).dom).exitFullscreen?c.exitFullscreen():c.msExitFullscreen?c.msExitFullscreen():c.webkitCancelFullScreen&&c.webkitCancelFullScreen()),k.width=E.iframeWidth,k.height=E.iframeHeight,T.width=E.containerWidth,T.height=E.containerHeight,T.top=E.containerTop,T.left=E.containerLeft,e(),t=E.scrollPos,window.scrollTo(t.x,t.y),i.set(null),J(o,!1),o.off("remove",e)):(n=$(I(x),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",function(e){Q(o)&&(Z(x)||null===i.get()||Ke(o,i))}),r={scrollPos:(l=window,v=void 0===l?window:l,g=v.document,d=(m=void 0!==(f=L.fromDom(g))?f.dom:document).body.scrollLeft||m.documentElement.scrollLeft,h=m.body.scrollTop||m.documentElement.scrollTop,p=qe(d,h),K(v).fold(function(){var e=v.document.documentElement,n=e.clientWidth,r=e.clientHeight;return Y(p.left,p.top,n,r)},function(e){return Y(Math.max(e.pageLeft,p.left),Math.max(e.pageTop,p.top),e.width,e.height)})),containerWidth:T.width,containerHeight:T.height,containerTop:T.top,containerLeft:T.left,iframeWidth:k.width,iframeHeight:k.height,fullscreenChangeHandler:n},F&&ne(o.dom,S,O),k.width=k.height="100%",T.width=T.height="",u(Ue.addClass),$e.bind(S),o.on("remove",e),i.set(r),Q(o)&&((a=x.dom).requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.webkitRequestFullScreen&&a.webkitRequestFullScreen()),J(o,!0))};t.add("fullscreen",function(e){var n,r,t,o,i,u=a(null);return e.inline||(r=u,(n=e).addCommand("mceFullScreen",function(){Ke(n,r)}),(t=e).ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:c,onSetup:re(t,o=u)}),t.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:c,onSetup:re(t,o)}),e.addShortcut("Meta+Shift+F","","mceFullScreen")),i=u,{isFullscreen:function(){return null!==i.get()}};function c(){return t.execCommand("mceFullScreen")}})}();
/trunk/vendor/tinymce/tinymce/plugins/help/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/help/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function i(e){return function(){return e}}function e(e){return e}function t(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=i(!1),r=i(!0),s={fold:function(e,t){return e()},isSome:u,isNone:r,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:a,map:t,each:function(){},bind:t,exists:u,forall:r,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function a(e){return e()}function b(e,t){for(var n=e.length,a=new Array(n),o=0;o<n;o++){var i=e[o];a[o]=t(i,o)}return a}function m(e,t){for(var n=[],a=0,o=e.length;a<o;a++){var i=e[a];t(i,a)&&n.push(i)}return n}function f(e){var n=p.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=b(e.split("+"),function(e){var t=e.toLowerCase().trim();return A(n,t)?n[t]:e});return p.mac?t.join("").replace(/\s/,""):t.join("+")}function k(e){function a(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"}var t,o,n,i,r,s,l,c;return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+(s=b((i=w((n=o=e).plugins),void 0===(r=n.getParam("forced_plugins"))?i:m(i,function(e){return!(-1<h.call(r,e))})),function(e){return"<li>"+(t=o,n=e,function(e,t,n){for(var a=0,o=e.length;a<o;a++){var i=e[a];if(t(i,a))return v.some(i);if(n(i,a))break}return v.none()}(d,function(e){return e.key===n},u).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?a(e()):n},function(e){return a({name:"premium"===e.type?e.name+"*":e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.type+"/"+e.slug})}))+"</li>";var t,n}),l=s.length,c=s.join(""),"<p><b>"+T.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>",(t=b(m(d,function(e){var t=e.key,n=e.type;return"autocorrect"!==t&&"premium"===n}),function(e){return"<li>"+T.translate(e.name)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+T.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+T.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}}function l(d,y){return function(){var e,t,n,a,o,i,r,s,l,c,u,m=(e=d,t=y,r={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(x,function(e){var t=b(e.shortcuts,f).join(" or ");return[e.action,t]})}]},s={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]},l=k(e),a=C.majorVersion,o=C.minorVersion,i=0===a.indexOf("@")?"X.X.X":a+"."+o,c={name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+T.translate(["You are using {0}",'<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+i+"</a>"])+"</p>",presets:"document"}]},u=g(((n={})[r.name]=r,n[s.name]=s,n[l.name]=l,n[c.name]=c,n),t.get()),v.from(e.getParam("help_tabs")).fold(function(){return-1!==(n=(t=w(e=u)).indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=u,n={},a=b(e,function(e){return"string"==typeof e?(A(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})),h=m.tabs,p=function(e){for(var t=[],n=function(e){t.push(e)},a=0;a<e.length;a++)e[a].each(n);return t}(b(m.names,function(e){return A(t=h,n=e)?v.from(t[n]):v.none();var t,n}));d.windowManager.open({title:"Help",size:"medium",body:{type:"tabpanel",tabs:p},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var c=function(n){function e(){return o}function t(e){return e(n)}var a=i(n),o={fold:function(e,t){return t(n)},isSome:r,isNone:u,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return c(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},v={some:c,none:t,from:function(e){return null==e?s:c(e)}},h=Array.prototype.indexOf,w=Object.keys,o=Object.hasOwnProperty,A=function(e,t){return o.call(e,t)},p=tinymce.util.Tools.resolve("tinymce.Env"),x=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],T=tinymce.util.Tools.resolve("tinymce.util.I18n"),d=b([{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"autocorrect",name:"Autocorrect",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"export",name:"Export",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium"},{key:"rtc",name:"Real-Time Collaboration",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium"}],function(e){return g(g({},e),{type:e.type||"opensource",slug:e.slug||e.key})}),C=tinymce.util.Tools.resolve("tinymce.EditorManager");n.add("help",function(e){var t,n,a,o=(t={},{get:function(){return t},set:function(e){t=e}}),i={addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}},r=l(e,n=o),s=r;return(a=e).ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:s}),a.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:s}),e.addCommand("mceHelp",r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),i})}();
/trunk/vendor/tinymce/tinymce/plugins/hr/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/hr/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}();
/trunk/vendor/tinymce/tinymce/plugins/image/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/image/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function D(e){return!(null==e)}function l(){}function a(e){return function(){return e}}function n(e){return e}function r(){return g}var i,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},T=e("string"),s=e("object"),c=e("array"),N=t("boolean"),w=t("function"),u=t("number"),m=a(!1),d=a(!(i=null)),g={fold:function(e,t){return e()},isSome:m,isNone:d,getOr:n,getOrThunk:p,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:n,orThunk:p,map:r,each:l,bind:r,exists:m,forall:d,filter:function(){return g},toArray:function(){return[]},toString:a("none()")};function p(e){return e()}function f(e,a,o,l){return function(e){for(var t=y(e),n=0,r=t.length;n<r;n++){var i=t[n];!function(e,t){(a(e,t)?o:l)(e,t)}(e[i],i)}}(e),1}function h(e,t){return A.call(e,t)}function S(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n])}return t}var b=function(n){function e(){return i}function t(e){return e(n)}var r=a(n),i={fold:function(e,t){return t(n)},isSome:d,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return b(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?i:g},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return i},L={some:b,none:r,from:function(e){return null==e?g:b(e)}},y=Object.keys,A=Object.hasOwnProperty,U=Array.prototype.push;function I(e,t,n){!function(e,t,n){if(!(T(n)||N(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}function C(e){return e.getParam("image_dimensions",!0,"boolean")}function x(e,t){return Math.max(parseInt(e,10),parseInt(t,10))}function O(e){return e&&e.replace(/px$/,"")}function P(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e}function _(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e}function E(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))}function R(e,t){return we.isDomSafe(t,"img",e.settings)}function k(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?O(e.style.marginLeft):""}function z(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?O(e.style.marginTop):""}function M(e){return e.style.borderWidth?O(e.style.borderWidth):""}function j(e,t){return e.hasAttribute(t)?e.getAttribute(t):""}function B(e,t){return e.style[t]||""}function H(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName}function F(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)}function G(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")}function W(e,r){return function(e,t,n){e.style[t]?(e.style[t]=P(n),G(e,r)):F(e,t,n)}}function V(e,t){return e.style[t]?O(e.style[t]):j(e,t)}function $(e,t){var n=P(t);e.style.marginLeft=n,e.style.marginRight=n}function J(e,t){var n=P(t);e.style.marginTop=n,e.style.marginBottom=n}function K(e,t){var n=P(t);e.style.borderWidth=n}function X(e,t){e.style.borderStyle=t}function Z(e){return"FIGURE"===e.nodeName}function q(e){return 0===Ue.getAttrib(e,"alt").length&&"presentation"===Ue.getAttrib(e,"role")}function Q(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}function Y(e,t){return{src:j(t,"src"),alt:q(n=t)?"":j(n,"alt"),title:j(t,"title"),width:V(t,"width"),height:V(t,"height"),class:j(t,"class"),style:e(j(t,"style")),caption:H(t),hspace:k(t),vspace:z(t),border:M(t),borderStyle:B(t,"borderStyle"),isDecorative:q(t)};var n}function ee(e,t,n,r,i){n[r]!==t[r]&&i(e,r,n[r])}function te(r,i){return function(e,t,n){r(e,n),G(e,i)}}function ne(e,t){var n=_(e.dom.styles.parse(t)),r=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(r)}function re(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||E(t))?null:t}function ie(n,e){var r,t,i=n.dom,a=(f(n.schema.getTextBlockElements(),function(e,t){return!n.schema.isValidChild(t,"figure")},(r=t={},function(e,t){r[t]=e}),l),t),o=i.getParent(e.parentNode,function(e){return h(t=a,n=e.nodeName)&&null!=t[n];var t,n},n.getBody());return o?i.split(o,e):e}function ae(r,e){var t=function(e){var t=document.createElement("img");if(Ce(function(e){return ne(r,e)},v(v({},e),{caption:!1}),t),Ie(t,e.alt,e.isDecorative),e.caption){var n=Ue.create("figure",{class:"image"});return n.appendChild(t),n.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false",n}return t}(e);r.dom.setAttrib(t,"data-mce-id","__mcenew"),r.focus(),r.selection.setContent(t.outerHTML);var n,i=r.dom.select('*[data-mce-id="__mcenew"]')[0];r.dom.setAttrib(i,"data-mce-id",null),Z(i)?(n=ie(r,i),r.selection.select(n)):r.selection.select(i)}function oe(t,e){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b=re(t);function y(){f.onload=f.onerror=null,g.selection&&(g.selection.select(f),g.nodeChanged())}b?(n=Y(function(e){return ne(t,e)},b),r=v(v({},n),e),s=t,c=r.src,i=v(v({},r),{src:R(s,c)?c:""}),r.src?(m=i,h=re(u=t),Ce(function(e){return ne(u,e)},m,h),u.dom.setAttrib(h,"src",h.getAttribute("src")),Z(h.parentNode)?(d=h.parentNode,ie(u,d),u.selection.select(h.parentNode)):(u.selection.select(h),g=u,p=m,(f=h).onload=function(){p.width||p.height||!C(g)||g.dom.setAttribs(f,{width:String(f.clientWidth),height:String(f.clientHeight)}),y()},f.onerror=y)):(a=t,(o=b)&&(l=a.dom.is(o.parentNode,"figure.image")?o.parentNode:o,a.dom.remove(l),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&ae(t,v(v({},Q()),e))}function le(e){return T(e.value)?e.value:""}function se(t){return void 0===t&&(t=le),function(e){return e?L.from(e).map(function(e){return Ne(e,t)}):L.none()}}function ce(e){var t=e.imageList.map(function(e){return{name:"images",type:"listbox",label:"Image list",items:e}}),n={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},r=e.classList.map(function(e){return{name:"classes",type:"listbox",label:"Class",items:e}});return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[n]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[v(v({},e.classList.isSome()&&e.hasImageCaption?{type:"grid",columns:2}:{type:"panel"}),{items:S([r.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])}function ue(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}}function me(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}}function de(e,t,n,r){var i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w,S,U,I,C,x,O;U=t,C=(I=r).getData(),x=U,O=C.src.value,(/^(?:[a-zA-Z]+:)?\/\//.test(O)?L.none():x.prependURL.bind(function(e){return O.substring(0,e.length)!==e?L.some(e+O):L.none()})).each(function(e){I.setData({src:{value:e,meta:C.src.meta}})}),h=t,w=(b=r).getData(),void 0!==(S=w.src.meta)&&(y=xe({},w),A=y,D=S,(v=h).hasDescription&&T(D.alt)&&(A.alt=D.alt),v.hasAccessibilityOptions&&(A.isDecorative=D.isDecorative||A.isDecorative||!1),v.hasImageTitle&&T(D.title)&&(A.title=D.title),v.hasDimensions&&(T(D.width)&&(A.dimensions.width=D.width),T(D.height)&&(A.dimensions.height=D.height)),T(D.class)&&Ee(v.classList,D.class).each(function(e){A.classes=e.value}),v.hasImageCaption&&N(D.caption)&&(A.caption=D.caption),v.hasAdvTab&&(T(D.style)&&(A.style=D.style),T(D.vspace)&&(A.vspace=D.vspace),T(D.border)&&(A.border=D.border),T(D.hspace)&&(A.hspace=D.hspace),T(D.borderstyle)&&(A.borderstyle=D.borderstyle)),b.setData(y)),i=e,a=t,o=n,c=(s=(l=r).getData()).src.value,(u=s.src.meta||{}).width||u.height||!a.hasDimensions||(0<c.length?i.imageSize(c).then(function(e){o.open&&l.setData({dimensions:e})}).catch(function(e){return console.error(e)}):l.setData({dimensions:{width:"",height:""}})),m=t,d=n,p=(g=r).getData(),f=Ee(m.imageList,p.src.value),d.prevImage=f,g.setData({images:f.map(function(e){return e.value}).getOr("")})}function ge(l,s,t,c){var e,n=c.getData();c.block("Uploading image"),(0<(e=n.fileinput).length?L.some(e[0]):L.none()).fold(function(){c.unblock()},function(n){function r(){c.unblock(),URL.revokeObjectURL(a)}function i(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),de(l,s,t,c)}var a=URL.createObjectURL(n),o=n;new De(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(o)}).then(function(e){var t=l.createBlobCache(n,a,e);s.automaticUploads?l.uploadImage(t).then(function(e){i(e.url),r()}).catch(function(e){r(),l.alertErr(e)}):(l.addToBlobCache(t),i(t.blobUri()),c.unblock())})})}function pe(S,U,I){return function(e,t){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w;"src"===t.name?de(S,U,I,e):"images"===t.name?(c=S,u=U,m=I,g=(d=e).getData(),(p=Ee(u.imageList,g.images)).each(function(e){""===g.alt||m.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?d.setData({src:e,alt:m.prevAlt}):d.setData({src:e,alt:e.text}):d.setData({src:e})}),m.prevImage=p,de(c,u,m,d)):"alt"===t.name?I.prevAlt=e.getData().alt:"style"===t.name?(o=S,s=(l=e).getData(),y=o.parseStyle,v=o.serializeStyle,D=_(y((A=s).style)),(w=xe({},A)).vspace=D["margin-top"]&&D["margin-bottom"]&&D["margin-top"]===D["margin-bottom"]?O(String(D["margin-top"])):"",w.hspace=D["margin-right"]&&D["margin-left"]&&D["margin-right"]===D["margin-left"]?O(String(D["margin-right"])):"",w.border=D["border-width"]?O(String(D["border-width"])):"",w.borderstyle=D["border-style"]?String(D["border-style"]):"",w.style=v(y(v(D))),l.setData(w)):"vspace"===t.name||"hspace"===t.name||"border"===t.name||"borderstyle"===t.name?(n=S,i=xe(ue(U.image),(r=e).getData()),f=n.normalizeCss,h=me(i,!1),F(b=document.createElement("img"),"style",h.style),!k(b)&&""===h.hspace||$(b,h.hspace),!z(b)&&""===h.vspace||J(b,h.vspace),!M(b)&&""===h.border||K(b,h.border),!B(b,"borderStyle")&&""===h.borderStyle||X(b,h.borderStyle),a=f(b.getAttribute("style")),r.setData({style:a})):"fileinput"===t.name?ge(S,U,I,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}}function fe(v){var t,n,r,i,a,o,l,s,c,A={onSubmit:function(n){return function(e){var t=xe(ue(n.image),e.getData());c.execCommand("mceUpdateImage",!1,me(t,n.hasAccessibilityOptions)),c.editorUpload.uploadImagesAuto(),e.close()}},imageSize:function(e){return R(s,e)?(i=s.documentBaseURI.toAbsolute(e),new De(function(t){function n(e){r.onload=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),t(e)}var r=document.createElement("img");r.onload=function(){var e=x(r.width,r.clientWidth),t=x(r.height,r.clientHeight);n(De.resolve({width:e,height:t}))},r.onerror=function(){n(De.reject("Failed to get image dimensions for: "+i))};var e=r.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left="0px",e.width=e.height="auto",document.body.appendChild(r),r.src=i}).then(function(e){return{width:String(e.width),height:String(e.height)}})):De.resolve({width:"",height:""});var i},addToBlobCache:function(e){l.editorUpload.blobCache.add(e)},createBlobCache:function(e,t,n){return o.editorUpload.blobCache.create({blob:e,blobUri:t,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:n.split(",")[1]})},alertErr:function(e){a.windowManager.alert(e)},normalizeCss:function(e){return ne(i,e)},parseStyle:function(e){return r.dom.parseStyle(e)},serializeStyle:function(e,t){return n.dom.serializeStyle(e,t)},uploadImage:(t=n=r=i=a=o=l=s=c=v,function(e){return Oe(t).upload([e],!1).then(function(e){return 0===e.length?De.reject("Failed to upload image"):!1===e[0].status?De.reject(e[0].error.message):e[0]})})};return{open:function(){var a,r,t,e,i,n,o,l,s,c,u,m,d,g,p,f,h,b,y;r=v,i=Pe(function(e){return r.convertURL(e.value||e.url,"src")}),n=new De(function(t){var n=function(e){t(i(e).map(function(e){return S([[{text:"None",value:""}],e])}))},e=r.getParam("image_list",!1);T(e)?Se.send({url:e,success:function(e){n(JSON.parse(e))}}):w(e)?e(n):n(e)}),o=_e(r.getParam("image_class_list")),l=r.getParam("image_advtab",!1,"boolean"),s=r.getParam("image_uploadtab",!0,"boolean"),c=D(r.getParam("images_upload_url")),u=D(r.getParam("images_upload_handler")),m=(e=re(t=r))?Y(function(e){return ne(t,e)},e):Q(),d=r.getParam("image_description",!0,"boolean"),g=r.getParam("image_title",!1,"boolean"),p=C(r),f=r.getParam("image_caption",!1,"boolean"),h=r.getParam("a11y_advanced_options",!1,"boolean"),b=r.getParam("automatic_uploads",!0,"boolean"),y=L.some(r.getParam("image_prepend_url","","string")).filter(function(e){return T(e)&&0<e.length}),n.then(function(e){return{image:m,imageList:e,classList:o,hasAdvTab:l,hasUploadTab:s,hasUploadUrl:c,hasUploadHandler:u,hasDescription:d,hasImageTitle:g,hasDimensions:p,hasImageCaption:f,prependURL:y,hasAccessibilityOptions:h,automaticUploads:b}}).then((a=A,function(e){var t,n,r,i={prevImage:Ee((t=e).imageList,t.image.src),prevAlt:t.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e).hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:S([[ke(r)],r.hasAdvTab?[Re(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[Me(r)]:[]])}:{type:"panel",items:ze(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ue(e.image),onSubmit:a.onSubmit(e),onChange:pe(a,e,i),onClose:(n=i,function(){n.open=!1})}})).then(v.windowManager.open)}}}function he(a){return function(e){for(var t=e.length,n=function(e){e.attr("contenteditable",a?"true":null)};t--;){var r,i=e[t];(r=i.attr("class"))&&/\bimage\b/.test(r)&&(i.attr("contenteditable",a?"false":null),Te.each(i.getAll("figcaption"),n))}}}"undefined"!=typeof window||Function("return this;")();function be(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var ye,ve=be,Ae=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),De=tinymce.util.Tools.resolve("tinymce.util.Promise"),we=tinymce.util.Tools.resolve("tinymce.util.URI"),Se=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ue=Ae.DOM,Ie=function(e,t,n){n?(Ue.setAttrib(e,"role","presentation"),I(ve(e),"alt","")):(i===t?ve(e).dom.removeAttribute("alt"):I(ve(e),"alt",t),"presentation"===Ue.getAttrib(e,"role")&&Ue.setAttrib(e,"role",""))},Ce=function(e,t,n){var r=Y(e,n);ee(n,r,t,"caption",function(e,t,n){return H(r=e)?(o=r.parentNode,Ue.insertAfter(r,o),Ue.remove(o)):(i=r,a=Ue.create("figure",{class:"image"}),Ue.insertAfter(a,i),a.appendChild(i),a.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),a.contentEditable="false"),0;var r,i,a,o}),ee(n,r,t,"src",F),ee(n,r,t,"title",F),ee(n,r,t,"width",W(0,e)),ee(n,r,t,"height",W(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t),0},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(J,e)),ee(n,r,t,"border",te(K,e)),ee(n,r,t,"borderStyle",te(X,e)),t.alt===r.alt&&t.isDecorative===r.isDecorative||Ie(n,t.alt,t.isDecorative)},xe=(ye=function(e,t){return s(e)&&s(t)?xe(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var i,a=e[r];for(i in a)h(a,i)&&(n[i]=ye(n[i],a[i]))}return n}),Oe=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Te=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ne=function(e,a){var o=[];return Te.each(e,function(e){var t,n,r,i=T((t=e).text)?t.text:T(t.title)?t.title:"";void 0!==e.menu?(n=Ne(e.menu,a),o.push({text:i,items:n})):(r=a(e),o.push({text:i,value:r}))}),o},Le=function(e,i){return function(e){for(var t,n=0;n<e.length;n++){var r=h(t=e[n],"items")?Le(t.items,i):t.value===i?L.some(t):L.none();if(r.isSome())return r}return L.none()}(e)},Pe=se,_e=function(e){return se(le)(e)},Ee=function(e,t){return e.bind(function(e){return Le(e,t)})},Re=function(e){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},ke=function(e){return{title:"General",name:"general",items:ce(e)}},ze=ce,Me=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}};o.add("image",function(e){var t,n,r;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",he(!0)),t.serializer.addNodeFilter("figure",he(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:fe(n).open,onSetup:function(e){return e.setActive(D(re(n))),n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),n.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:fe(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return Z(e)||"IMG"===e.nodeName&&!E(e)?["image"]:[]}}),(r=e).addCommand("mceImage",fe(r).open),r.addCommand("mceUpdateImage",function(e,t){r.undoManager.transact(function(){return oe(r,t)})})})}();
/trunk/vendor/tinymce/tinymce/plugins/imagetools/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/imagetools/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function c(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function h(e){return null!=e}function r(){}function i(e){return function(){return e}}function e(e){return e}function t(){return d}function s(e){return n=typeof(t=e),"array"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e){return typeof e===n},u=i(!(n="function")),l=i(!0),d={fold:function(e,t){return e()},isSome:u,isNone:l,getOr:e,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:m,map:t,each:r,bind:t,exists:u,forall:l,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(e){return e()}var g=function(n){function e(){return o}function t(e){return e(n)}var r=i(n),o={fold:function(e,t){return t(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return g(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p={some:g,none:t,from:function(e){return null==e?d:g(e)}},v={},y={exports:v};function w(e,t){return U(document.createElement("canvas"),e,t)}function b(e){var t=w(e.width,e.height);return R(t).drawImage(e,0,0),t}function _(u){return new I(function(e,t){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),e(o)},a=function(){n(),t("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function E(e,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new I(function(t,n){e.toBlob(function(e){e?t(e):n()},r,o)}):j(e.toDataURL(r,o))}function T(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function x(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return p.some(i);if(n(i,r))break}return p.none()}(e,t,u)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void c(r.promise,e)}u(r.promise,e)}else(1===n._state?u:c)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new f(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof v&&void 0!==y?y.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var I=y.exports.boltExport,R=function(e){return e.getContext("2d")},U=function(e,t,n){return e.width=t,e.height=n,e},A=function(r){return new I(function(e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+this.status+" downloading image"))},n.send()})},j=function(h){return new I(function(e,t){!function(){var e=h.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return p.none();for(var n=t[1],r=e[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,f=Math.min(1024+s,i),l=new Array(f-s),d=s,m=0;d<f;++m,++d)l[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(l)}return p.some(new Blob(u,{type:n}))}().fold(function(){t("uri is not base64: "+h)},e)})},S=function(e){URL.revokeObjectURL(e.src)},M=_,P=Array.prototype.indexOf,O=Object.keys;function L(e,t,n){function r(t,n){return e.then(function(e){return e.toDataURL(t||"image/png",n)})}return{getType:i(t.type),toBlob:function(){return I.resolve(t)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then(function(e){return E(e,t,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(e,t){return r(e,t).then(function(e){return e.split(",")[1]})},toCanvas:function(){return e.then(b)}}}function k(t,e){return E(t,e).then(function(e){return L(I.resolve(t),e,t.toDataURL())})}function C(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)}function F(t,n,r){return void 0===r&&(r=!1),new I(function(e){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&e({status:a.status,blob:a.response})},a.open("GET",t,!0),a.withCredentials=r,function(e){for(var t,n=O(e),r=0,o=n.length;r<o;r++){var i=n[r];t=e[i],a.setRequestHeader(i,t)}}(n),a.responseType="blob",a.send()})}function B(e){var t,n=(t=e,"ImageProxy HTTP error: "+x(J,function(e){return t===e.code}).fold(i("Unknown ImageProxy error"),function(e){return e.message}));return I.reject(n)}function N(t){return x(K,function(e){return e.type===t}).fold(i("Unknown service error"),function(e){return e.message})}function D(e){return"ImageProxy Service error: "+function(e){try{return p.some(JSON.parse(e))}catch(e){return p.none()}}(e).bind(function(e){return n=function(e,t){return h(e)?e[t]:void 0},r=e,T(["error","type"],function(e,t){r=n(r,e)}),t=r,p.from(t).map(N);var n,r,t}).getOr("Invalid JSON in service error message")}function H(e){return e<200||300<=e}function z(e,t){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return F((r=t,o=-1===(n=e).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(e){return H(e.status)?(t=e.status,"application/json"!==(null==(n=e.blob)?void 0:n.type)||400!==t&&403!==t&&404!==t&&500!==t?B(t):(r=n,new I(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(e){t(e)},n.readAsText(r)}).then(function(e){var t=D(e);return I.reject(t)}))):I.resolve(e.blob);var r,t,n})}function q(e,t,n){return void 0===n&&(n=!1),t?z(e,t):F(e,{},n).then(function(e){return H(e.status)?B(e.status):I.resolve(e.blob)})}function W(t){return n=t,new I(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){return L(_(t).then(function(e){S(e);var t=w(e.naturalWidth||e.width,e.naturalHeight||e.height);return R(t).drawImage(e,0,0),t}),t,e)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};T(a,function(e,r){var t=O(e);if(1!==t.length)throw new Error("one and only one name per case");var i=t[0],o=e[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var o=O(e);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(e){for(var t,n=0,r=e.length;n<r;++n)if(!0!==(t=e[n],function(e,t){return-1<P.call(e,t)}(o,t)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return e[i].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function $(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var V=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=C(Math.abs(o*u)+Math.abs(i*a)),s=C(Math.abs(o*a)+Math.abs(i*u)),f=w(c,s),l=R(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(e,-o/2,-i/2),k(f,t)},G=function(e,t,n){var r=w(e.width,e.height),o=R(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),k(r,t)},J=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return p.from(e.dom.elementFromPoint(t,n)).map($)}};function Q(e){return e.getParam("imagetools_proxy")}function Y(e){function t(e){return/^[0-9\.]+px$/.test(e)}var n=e.style.width,r=e.style.height;return n||r?t(n)&&t(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=e.width,r=e.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function Z(e){return{w:e.naturalWidth,h:e.naturalHeight}}function ee(e){return t=X.fromDom(e),n="img",r=function(r){return function(e){var t=r.dom;if(1!==t.nodeType)return!1;var n=t;if(void 0!==n.matches)return n.matches(e);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(e);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(e);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(n)},x(t.dom.childNodes,function(e){return r(X.fromDom(e))}).map(X.fromDom);var t,n,r}function te(e,t){return e.dom.is(t,"figure")}function ne(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")}function re(t,e){function n(e){return ne(t,e)&&(be(t,e)||_e(t,e)||h(Q(t)))}return te(t,e)?ee(e).bind(function(e){return n(e.dom)?p.some(e.dom):p.none()}):n(e)?p.some(e):p.none()}function oe(e,t){e.notificationManager.open({text:t,type:"error"})}function ie(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&te(e,n)?ee(n):ne(e,t)?p.some(X.fromDom(t)):p.none()}function ae(e,t,n){var r=t.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?e.dom.encode(r[n]):null}function ue(e,t){if(_e(e,t))return q(t.src,null,(n=t,-1!==f.inArray(e.getParam("imagetools_credentials_hosts",[],"string[]"),new ye(n.src).host)));var n,r;if(be(e,t))return(0===(r=t.src).indexOf("data:")?j:A)(r);var o=Q(e);return q(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string"),!1)}function ce(e,t){var n,r,o=e.editorUpload.blobCache.getByUri(t.src);return o?ve.resolve(o.blob()):(n=e,r=t,p.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return ue(n,r)},function(e){return e(r)}))}function se(e){pe.clearTimeout(e.get())}function fe(u,c,s,f,l,d,m){return s.toBlob().then(function(e){var t,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===e.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),t=o.name(),o.filename()):(t=ae(u,i,2),ae(u,i,1))),o=r.create({id:"imagetools"+we++,blob:e,base64:s.toBase64(),uri:i,name:t,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var e,t,n;u.$(d).off("load",r),u.nodeChanged(),f?u.editorUpload.uploadImagesAuto():(se(l),e=u,t=l,n=pe.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),t.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function le(r,o,e,i){return function(){return ie(r).fold(function(){oe(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return ce(r,n.dom)}).then(function(t){return W(t).then(e).then(function(e){return fe(r,t,e,!1,o,n.dom,i)})}).catch(function(e){oe(r,e)})})}}function de(t,n,r){return function(){var e=ie(t).map(function(e){var t=Y(e.dom);return t?{w:t.h,h:t.w}:null}).getOrNull();return le(t,n,function(e){return n=r,(t=e).toCanvas().then(function(e){return V(e,t.getType(),n)});var t,n},e)()}}function me(e,t,r){return function(){return le(e,t,function(e){return n=r,(t=e).toCanvas().then(function(e){return G(e,t.getType(),n)});var t,n})()}}function he(s,f){return function(){var n=ie(s),i=n.map(function(e){return Z(e.dom)});n.each(function(t){re(s,t.dom).each(function(e){ce(s,t.dom).then(function(e){var t={blob:e,url:URL.createObjectURL(e)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var o=e.getData().imagetools.blob;n.each(function(r){i.each(function(e){var t,n,a,u,c;t=s,n=f,a=r.dom,u=e,M(c=o).then(function(e){var t,n,r,o,i=Z(e);return u.w===i.w&&u.h===i.h||Y(a)&&(t=a,(n=i)&&(r=t.style.width,o=t.style.height,(r||o)&&(t.style.width=n.w+"px",t.style.height=n.h+"px",t.removeAttribute("data-mce-style")),r=t.width,o=t.height,(r||o)&&(t.setAttribute("width",String(n.w)),t.setAttribute("height",String(n.h))))),URL.revokeObjectURL(e.src),c}).then(W).then(function(e){return fe(t,c,e,!0,n,a)})})}),e.close()},onCancel:r,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})})})})}}function ge(t){function n(e){return function(){return t.execCommand(e)}}function e(){return ie(t).exists(function(e){return re(t,e.dom).isSome()})}function r(t){function i(e){return t.setDisabled(!e)}return i(e()),o=o.concat([i]),function(){o=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];o!==i&&t.push(o)}return t}(o)}}var o=[];t.on("NodeChange",function(){var t=e();T(o,function(e){return e(t)})}),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return re(t,e).map(function(e){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var pe=tinymce.util.Tools.resolve("tinymce.util.Delay"),ve=tinymce.util.Tools.resolve("tinymce.util.Promise"),ye=tinymce.util.Tools.resolve("tinymce.util.URI"),we=0,be=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ye(n).host===e.documentBaseURI.host},_e=function(e,t){return-1!==f.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new ye(t.src).host)};o.add("imagetools",function(e){var t,r,o,i,n=c(0),a=c(null),u=e;f.each({mceImageRotateLeft:de(u,n,-90),mceImageRotateRight:de(u,n,90),mceImageFlipVertical:me(u,n,"v"),mceImageFlipHorizontal:me(u,n,"h"),mceEditImage:he(u,n)},function(e,t){u.addCommand(t,e)}),ge(e),(t=e).ui.registry.addContextToolbar("imagetools",{items:t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(e){return re(t,e).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=e).on("NodeChange",function(e){var t=i.get(),n=re(r,e.element);t&&!n.exists(function(e){return t.src===e.src})&&(se(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
/trunk/vendor/tinymce/tinymce/plugins/importcss/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/importcss/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;T.test(r)||c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push,T=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();
/trunk/vendor/tinymce/tinymce/plugins/insertdatetime/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/insertdatetime/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function l(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function s(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function d(e,t,n){return void 0===n&&(n=new Date),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")}function p(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=d(e,t),r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=(i=e).dom.create("time",{datetime:r},n),o.parentNode.insertBefore(u,o),i.dom.remove(o),i.selection.select(u,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}();
/trunk/vendor/tinymce/tinymce/plugins/legacyoutput/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/legacyoutput/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="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"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();
/trunk/vendor/tinymce/tinymce/plugins/link/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/link/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function t(r){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===r;var n,e}}function n(n){return function(t){return typeof t===n}}function h(){}function i(t){return function(){return t}}function e(t){return t}function r(t,n){return t===n}function o(){return v}var u,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK"),l=t("string"),d=t("array"),p=function(t){return u===t},f=n("boolean"),s=n("function"),m=i(!1),g=i(!(u=null)),v={fold:function(t,n){return t()},isSome:m,isNone:g,getOr:e,getOrThunk:y,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:y,map:o,each:h,bind:o,exists:m,forall:g,filter:function(){return v},toArray:function(){return[]},toString:i("none()")};function y(t){return t()}function k(t,o,i){return function(t){for(var n,e=0,r=t.length;e<r;e++)n=t[e],i=o(i,n,e)}(t),i}function x(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!d(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);at.apply(n,t[e])}return n}function b(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return it.none()}function O(t,n,e){return void 0===e&&(e=r),t.exists(function(t){return e(t,n)})}function w(t,n){return t?it.some(n):it.none()}function C(t){var n=t.getParam("link_assume_external_targets",!1);return f(n)&&n?1:!l(n)||"http"!==n&&"https"!==n?0:n}function N(t){return t.getParam("default_link_target")}function A(t){return t.getParam("target_list",!0)}function T(t){return t.getParam("rel_list",[],"array")}function P(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")}function S(t){return l(t.value)?t.value:""}function _(n){return void 0===n&&(n=S),function(t){return it.from(t).map(function(t){return ct(t,n)})}}function R(t,i,u,a){return function(t){for(var n=mt(t),e=0,r=n.length;e<r;e++){var o=n[e];!function(t,n){(i(t,n)?u:a)(t,n)}(t[o],o)}}(t),1}function D(t,n){return gt.call(t,n)}function L(t){return t&&"a"===t.nodeName.toLowerCase()}function E(t){return L(t)&&!!pt(t)}function M(t,n){if(t.collapsed)return[];for(var e=t.cloneContents(),r=new dt(e.firstChild,e),o=[],i=e.firstChild;n(i)&&o.push(i),i=r.next(););return o}function U(t){return/^\w+:/i.test(t)}function B(t,n){function e(t){return t.filter(function(t){return-1===lt.inArray(o,t)})}var r,o=["noopener"],i=t?t.split(/\s+/):[],u=n?0<(r=e(r=i)).length?r.concat(o):o:e(i);return 0<u.length?lt.trim(u.sort().join(" ")):""}function I(t,n){return n=n||t.selection.getNode(),vt(n)?t.dom.select("a[href]",n)[0]:t.dom.getParent(n,"a[href]")}function K(t,n){return(n?n.innerText||n.textContent:t.getContent({format:"text"})).replace(/\uFEFF/g,"")}function z(t){return 0<lt.grep(t,E).length}function j(t){var n=t.schema.getTextInlineElements();return 0===M(t.selection.getRng(),function(t){return 1===t.nodeType&&!L(t)&&!D(n,t.nodeName.toLowerCase())}).length}function V(l,c,f){var t,n,e,r,o,i,u,s=l.selection.getNode(),m=I(l,s),g=(n=l,e=k(["title","rel","class","target"],function(n,e){return t[e].each(function(t){n[e]=0<t.length?t:null}),n},{href:(t=f).href}),u=st({},e),0<T(n).length||!1!==P(n)||(r=B(u.rel,"_blank"===u.target),u.rel=r||null),it.from(u.target).isNone()&&!1===A(n)&&(u.target=N(n)),u.href=(o=u.href,"http"!==(i=C(n))&&"https"!==i||U(o)?o:i+"://"+o),u);l.undoManager.transact(function(){var n,t,e,r,o,i,u,a;f.href===c.href&&c.attach(),m?(l.focus(),o=l,i=m,u=f.text,a=g,u.each(function(t){D(i,"innerText")?i.innerText=t:i.textContent=t}),o.dom.setAttribs(i,a),o.selection.select(i)):(n=l,e=f.text,r=g,vt(t=s)?kt(n,t,r):e.fold(function(){n.execCommand("mceInsertLink",!1,r)},function(t){n.insertContent(n.dom.createHTML("a",r,n.dom.encode(t)))}))})}function q(t,n,e){var r,o,i,u,a,l,c,f,s,m,g=(r=t,o=e.href,st(st({},e),{href:ht.isDomSafe(o,"a",r.settings)?o:""}));t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,(a=g.class,l=g.href,c=g.rel,f=g.target,s=g.text,m=g.title,R({class:a.getOrNull(),href:l,rel:c.getOrNull(),target:f.getOrNull(),text:s.getOrNull(),title:m.getOrNull()},function(t,n){return!1===p(t)},(i=u={},function(t,n){i[n]=t}),h),u)):V(t,n,g)}function F(t){var l;t.hasPlugin("rtc",!0)?t.execCommand("unlink"):(l=t).undoManager.transact(function(){var t,n,e,r,o,i,u,a=l.selection.getNode();vt(a)?yt(l,a):(n=(t=l).dom,r=(e=t.selection).getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody()),i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)),l.focus()})}function W(t){var n=t.href;return 0<n.indexOf("@")&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?it.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return st(st({},t),{href:"mailto:"+n})}}):it.none()}function H(t,n,e){var r=t.getAttrib(n,e);return null!==r&&0<r.length?it.some(r):it.none()}function G(d){var t,n=I(t=d);Tt(t,n).then(function(t){var n,e,i,u,r=function(t){var e=t.getData();if(!e.url.value)return F(i),void t.close();function n(n){return it.from(e[n]).filter(function(t){return!O(u.anchor[n],t)})}var r={href:e.url.value,text:n("text"),target:n("target"),rel:n("rel"),class:n("linkClass"),title:n("title")},o={href:e.url.value,attach:void 0!==e.url.meta&&e.url.meta.attach?e.url.meta.attach:h};Ct(i,r).then(function(t){q(i,o,t)}),t.close()},o=i=d,a=(n=u=t).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),l=n.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],c=it.from(N(o)),f=n.anchor,s={url:{value:e=f.url.getOr(""),meta:{original:{value:e}}},text:f.text.getOr(""),title:f.title.getOr(""),anchor:e,link:e,rel:f.rel.getOr(""),target:f.target.or(c).getOr(""),linkClass:f.linkClass.getOr("")},m=n.catalogs,g=bt(s,m);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:x([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],a,l,function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n}([m.anchor.map(ft.createUi("anchor","Anchors")),m.rels.map(ft.createUi("rel","Rel")),m.targets.map(ft.createUi("target","Open link in...")),m.link.map(ft.createUi("link","Link list")),m.classes.map(ft.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s,onChange:function(n,t){var e=t.name;g.onChange(n.getData,{name:e}).each(function(t){n.setData(t)})},onSubmit:r}}).then(function(t){d.windowManager.open(t)})}function J(t,n){return t.dom.getParent(n,"a[href]")}function X(t){return J(t,t.selection.getStart())}function $(t,n){var e,r;n&&(e=pt(n),/^#/.test(e)?(r=t.$(e)).length&&t.selection.scrollIntoView(r[0],!0):function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e,r,o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e=n,r=o,document.body.appendChild(e),e.dispatchEvent(r),document.body.removeChild(e)}(n.href))}function Q(t){return function(){G(t)}}function Y(t){return function(){$(t,X(t))}}function Z(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}function tt(e){return function(t){function n(){return t.setActive(!e.mode.isReadOnly()&&null!==I(e,e.selection.getNode()))}return n(),Z(e,n)}}function nt(e){return function(t){function n(){return t.setDisabled(null===I(e,e.selection.getNode()))}return n(),Z(e,n)}}function et(r){return function(n){function e(t){return z(t)||0<M(r.selection.getRng(),E).length}var t=r.dom.getParents(r.selection.getStart());return n.setDisabled(!e(t)),Z(r,function(t){return n.setDisabled(!e(t.parents))})}}function rt(t){var n=x(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t.dom.select("a:not([href])"),function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return 0<n.length?it.some([{text:"None",value:""}].concat(n)):it.none()}var ot=function(e){function t(){return o}function n(t){return t(e)}var r=i(e),o={fold:function(t,n){return n(e)},isSome:g,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return ot(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:v},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},it={some:ot,none:o,from:function(t){return null==t?v:ot(t)}},ut=Array.prototype.indexOf,at=Array.prototype.push,lt=tinymce.util.Tools.resolve("tinymce.util.Tools"),ct=function(t,i){var u=[];return lt.each(t,function(t){var n,e,r,o=l((n=t).text)?n.text:l(n.title)?n.title:"";void 0!==t.menu?(e=ct(t.menu,i),u.push({text:o,items:e})):(r=i(t),u.push({text:o,value:r}))}),u},ft={sanitize:function(t){return _(S)(t)},sanitizeWith:_,createUi:function(n,e){return function(t){return{name:n,type:"listbox",label:e,items:t}}},getValue:S},st=function(){return(st=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},mt=Object.keys,gt=Object.hasOwnProperty,dt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ht=tinymce.util.Tools.resolve("tinymce.util.URI"),pt=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},vt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},yt=function(t,n){var e,r=t.dom.select("img",n)[0];!r||(e=t.dom.getParents(r,"a[href]",n)[0])&&(e.parentNode.insertBefore(r,e),t.dom.remove(e))},kt=function(t,n,e){var r,o=t.dom.select("img",n)[0];o&&(r=t.dom.create("a",e),o.parentNode.insertBefore(r,o),r.appendChild(o))},xt=function(e,t){return b(t,function(t){return D(n=t,"items")&&void 0!==n.items&&null!==n.items?xt(e,t.items):w(t.value===e,t);var n})},bt=function(t,c){function f(t,n){var e,r,o,i,u,a,l=("link"===(e=n.name)?c.link:"anchor"===e?c.anchor:it.none()).getOr([]);return r=s.text,o=n.name,i=l,u=t[o],a=0<r.length,void 0!==u?xt(u,i).map(function(t){return{url:{value:t.value,meta:{text:a?r:t.text,attach:h}},text:a?r:t.text}}):it.none()}var s={text:t.text,title:t.title};return{onChange:function(t,n){var e,r,o,i,u,a,l=n.name;return"url"===l?(r=t(),o=r.url,u=w(s.text.length<=0,it.from(o.meta.text).getOr(o.value)),i=r.url,a=w(s.title.length<=0,it.from(i.meta.title).getOr("")),u.isSome()||a.isSome()?it.some(st(st({},u.map(function(t){return{text:t}}).getOr({})),a.map(function(t){return{title:t}}).getOr({}))):it.none()):(e=["anchor","link"],-1<ut.call(e,l)?f(t(),n):("text"!==l&&"title"!==l||(s[l]=t()[l]),it.none()))}}},Ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),wt=tinymce.util.Tools.resolve("tinymce.util.Promise"),Ct=function(u,a){return b([W,(e=C(u),r=u.getParam("link_default_protocol","http","string"),function(t){var n=t.href;return 1===e&&!U(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?it.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+r+":// prefix?",preprocess:function(t){return st(st({},t),{href:r+"://"+n})}}):it.none()})],function(t){return t(a)}).fold(function(){return wt.resolve(a)},function(i){return new wt(function(n){var e=u,t=i.message,r=function(t){n(t?i.preprocess(a):a)},o=e.selection.getRng();Ot.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),r(t)})})})});var e,r},Nt=tinymce.util.Tools.resolve("tinymce.util.XHR"),At=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Tt=function(m,g){return t=(e=m).getParam("link_list"),new wt(function(n){l(t)?Nt.send({url:t,success:function(t){return n(function(t){try{return it.some(JSON.parse(t))}catch(t){return it.none()}}(t))},error:function(t){return n(it.none())}}):s(t)?t(function(t){return n(it.some(t))}):n(it.from(t))}).then(function(t){return t.bind(ft.sanitizeWith(n)).map(function(t){return 0<t.length?[{text:"None",value:""}].concat(t):t})}).then(function(t){var n,e,r,o,i,u,a,l,c,f,s=(e=g,r=(n=m).dom,o=j(n)?it.some(K(n.selection,e)):it.none(),i=e?it.some(r.getAttrib(e,"href")):it.none(),u=e?it.from(r.getAttrib(e,"target")):it.none(),a=H(r,e,"rel"),l=H(r,e,"class"),{url:i,text:o,title:H(r,e,"title"),target:u,rel:a,linkClass:l});return{anchor:s,catalogs:{targets:(f=A(m),d(f)?ft.sanitize(f).orThunk(function(){return it.some(At)}):!1===f?it.none():it.some(At)),rels:function(t,n){var e=T(t);if(0<e.length){var r=O(n,"_blank");return(!1===P(t)?ft.sanitizeWith(function(t){return B(ft.getValue(t),r)}):ft.sanitize)(e)}return it.none()}(m,s.target),classes:0<(c=m.getParam("link_class_list",[],"array")).length?ft.sanitize(c):it.none(),anchor:rt(m),link:t},optNode:it.from(g),flags:{titleEnabled:m.getParam("link_title",!0,"boolean")}}});function n(t){return e.convertURL(t.value||t.url,"href")}var e,t};a.add("link",function(t){var n,e,r,o,i,u,a;function l(t){var n=a.selection.getNode();return t.setDisabled(!I(a,n)),h}(n=t).ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Q(n),onSetup:tt(n)}),n.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Y(n),onSetup:nt(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return F(n)},onSetup:et(n)}),(e=t).ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Y(e),onSetup:nt(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Q(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return F(e)},onSetup:et(e)}),(r=t).ui.registry.addContextMenu("link",{update:function(t){return z(r.dom.getParents(t,"a"))?"link unlink openlink":"link"}}),(a=t).ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:tt(a)},label:"Link",predicate:function(t){return!!I(a,t)&&a.getParam("link_context_toolbar",!1,"boolean")},initValue:function(){var t=I(a);return t?pt(t):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(t){var n=a.selection.getNode();return t.setActive(!!I(a,n)),tt(a)(t)},onAction:function(t){var n=t.getValue(),e=function(t){var n=I(a),e=j(a);if(n||!e)return it.none();var r=K(a.selection,n);return it.some(0<r.length?r:t)}(n);q(a,{href:n,attach:h},{href:n,text:e,title:it.none(),rel:it.none(),target:it.none(),class:it.none()}),a.selection.collapse(!1),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:l,onAction:function(t){F(a),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:l,onAction:function(t){Y(a)(),t.hide()}}]}),(u=t).on("click",function(t){var n=J(u,t.target);n&&c.metaKeyPressed(t)&&(t.preventDefault(),$(u,n))}),u.on("keydown",function(t){var n=X(u);n&&13===t.keyCode&&!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey&&(t.preventDefault(),$(u,n))}),(o=t).addCommand("mceLink",function(){o.getParam("link_quicklink",!1,"boolean")?o.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Q(o)()}),(i=t).addShortcut("Meta+K","",function(){i.execCommand("mceLink")})})}();
/trunk/vendor/tinymce/tinymce/plugins/lists/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/lists/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function u(){}function S(e){return function(){return e}}function n(e){return e}function r(e,t){return e===t}function y(t){return function(e){return!t(e)}}function o(){return p}var i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=e("string"),O=e("object"),s=e("array"),c=t("boolean"),f=t("function"),d=t("number"),l=S(!1),m=S(!0),p={fold:function(e,t){return e()},isSome:l,isNone:m,getOr:n,getOrThunk:g,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:S(null),getOrUndefined:S(void 0),or:n,orThunk:g,map:o,each:u,bind:o,exists:l,forall:m,filter:function(){return p},toArray:function(){return[]},toString:S("none()")};function g(e){return e()}function C(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}function b(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function L(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}function v(e,n,r){return b(e,function(e,t){r=n(r,e,t)}),r}function h(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return E.some(i);if(n(i,r))break}return E.none()}function N(e,t){return h(e,t,l)}function T(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!s(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);P.apply(t,e[n])}return t}(C(e,t))}function D(e){var t=I.call(e,0);return t.reverse(),t}function x(e,t){return 0<=t&&t<e.length?E.some(e[t]):E.none()}function A(e){return x(e,0)}function w(e){return x(e,e.length-1)}var k=function(n){function e(){return o}function t(e){return e(n)}var r=S(n),o={fold:function(e,t){return t(n)},isSome:m,isNone:l,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:p},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},E={some:k,none:o,from:function(e){return null==e?p:k(e)}},I=Array.prototype.slice,P=Array.prototype.push,B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function R(r,e){return function(e){for(var t=0;t<e.length;t++){var n=function(t){var n=t.brand.toLowerCase();return N(r,function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(function(e){return{current:e.name,version:G.nu(parseInt(t.version,10),0)}})}(e[t]);if(n.isSome())return n}return E.none()}(e.brands)}function M(e,t){var n=String(t).toLowerCase();return N(e,function(e){return e.search(n)})}function U(e,t){return-1!==e.indexOf(t)}function _(t){return function(e){return U(e,t)}}function $(e){return window.matchMedia(e).matches}function F(e,t){return e.dom===t.dom}function H(e,t){return le().browser.isIE()?(n=e.dom,r=t.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o)):(i=e.dom)!==(a=t.dom)&&i.contains(a);var n,r,o,i,a}function j(e,t){for(var n=ye(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}function K(){return Z(0,0)}function V(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isEdge:t("Edge"),isChrome:t("Chrome"),isIE:t("IE"),isOpera:t("Opera"),isFirefox:t(ne),isSafari:t("Safari")}}function W(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isWindows:t(ie),isiOS:t("iOS"),isAndroid:t(ae),isOSX:t("OSX"),isLinux:t("Linux"),isSolaris:t(se),isFreeBSD:t(ue),isChromeOS:t(ce)}}function Q(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var X,q,z,Y,Z=function(e,t){return{major:e,minor:t}},G={nu:Z,detect:function(e,t){var n,r,o=String(t).toLowerCase();return 0===e.length?K():(r=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,n=o))?Z(i(1),i(2)):{major:0,minor:0};function i(e){return Number(n.replace(r,"$"+e))}},unknown:K},J=(X=/^\s+|\s+$/g,function(e){return e.replace(X,"")}),ee=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,te={browsers:S([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return U(e,"edge/")&&U(e,"chrome")&&U(e,"safari")&&U(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ee],search:function(e){return U(e,"chrome")&&!U(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return U(e,"msie")||U(e,"trident")}},{name:"Opera",versionRegexes:[ee,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:_("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:_("firefox")},{name:"Safari",versionRegexes:[ee,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(U(e,"safari")||U(e,"mobile/"))&&U(e,"applewebkit")}}]),oses:S([{name:"Windows",search:_("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return U(e,"iphone")||U(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:_("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:_("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:_("linux"),versionRegexes:[]},{name:"Solaris",search:_("sunos"),versionRegexes:[]},{name:"FreeBSD",search:_("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:_("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},ne="Firefox",re=function(){return V({current:void 0,version:G.unknown()})},oe=V,ie=(S("Edge"),S("Chrome"),S("IE"),S("Opera"),S(ne),S("Safari"),"Windows"),ae="Android",se="Solaris",ue="FreeBSD",ce="ChromeOS",fe=function(){return W({current:void 0,version:G.unknown()})},de=W,le=(S(ie),S("iOS"),S(ae),S("Linux"),S("OSX"),S(se),S(ue),S(ce),Y=!(q=function(){return e=navigator.userAgent,t=E.from(navigator.userAgentData),n=$,g=te.browsers(),v=te.oses(),h=t.bind(function(e){return R(g,e)}).orThunk(function(){return M(g,n=e).map(function(e){var t=G.detect(e.versionRegexes,n);return{current:e.name,version:t}});var n}).fold(re,oe),y=M(v,r=e).map(function(e){var t=G.detect(e.versionRegexes,r);return{current:e.name,version:t}}).fold(fe,de),{browser:h,os:y,deviceType:(i=h,a=e,s=n,u=(o=y).isiOS()&&!0===/ipad/i.test(a),c=o.isiOS()&&!u,d=(f=o.isiOS()||o.isAndroid())||s("(pointer:coarse)"),l=u||!c&&f&&s("(min-device-width:768px)"),m=c||f&&!l,p=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(a),{isiPad:S(u),isiPhone:S(c),isTablet:S(l),isPhone:S(m),isTouch:S(d),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:S(p),isDesktop:S(!m&&!l&&!p)})};var e,t,n,r,o,i,a,s,u,c,f,d,l,m,p,g,v,h,y}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Y||(Y=!0,z=q.apply(null,e)),z}),me={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Q(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Q(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Q(n)},fromDom:Q,fromPoint:function(e,t,n){return E.from(e.dom.elementFromPoint(t,n)).map(Q)}},pe=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ge=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ve=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),he=tinymce.util.Tools.resolve("tinymce.util.VK"),ye=Object.keys;function Se(e){return e.dom.nodeName.toLowerCase()}function Ce(t){return function(e){return Bt(e)&&Se(e)===t}}function be(e,t){var n=e.dom;j(t,function(e,t){!function(e,t,n){if(!(a(n)||c(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(n,t,e)})}function Ne(e){return v(e.dom.attributes,function(e,t){return e[t.name]=t.value,e},{})}function Oe(e){return E.from(e.dom.parentNode).map(me.fromDom)}function Le(e){return C(e.dom.childNodes,me.fromDom)}function Te(e,t){var n=e.dom.childNodes;return E.from(n[t]).map(me.fromDom)}function De(e){return Te(e,0)}function xe(e){return Te(e,e.dom.childNodes.length-1)}function Ae(t,n){Oe(t).each(function(e){e.dom.insertBefore(n.dom,t.dom)})}function we(e,t){e.dom.appendChild(t.dom)}function ke(t,e){b(e,function(e){we(t,e)})}function Ee(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)}function Ie(e){return me.fromDom(e.dom.cloneNode(!0))}function Pe(e,t){var n,r,o=(n=e,be(r=me.fromTag(t),Ne(n)),r);return Ae(e,o),ke(o,Le(e)),Ee(e),o}function Be(t){return function(e){return e&&e.nodeName.toLowerCase()===t}}function Re(t){return function(e){return e&&t.test(e.nodeName)}}function Me(e){return e&&3===e.nodeType}function Ue(e,t){return t&&e.schema.getTextBlockElements()[t.nodeName]}function _e(e,t){return e&&e.nodeName in t}function $e(e,t,n){var r=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&r}function Fe(e,t){return e.isChildOf(t,e.getRoot())}function He(e,t){var n,r,o,i,a=e.dom,s=e.schema.getBlockElements(),u=a.createFragment(),c=!1===(n=e.getParam("forced_root_block","p"))?"":!0===n?"p":n;if(c&&((o=a.create(c)).tagName===c.toUpperCase()&&a.setAttribs(o,e.getParam("forced_root_block_attrs",{})),_e(t.firstChild,s)||u.appendChild(o)),t)for(;r=t.firstChild;){var f=r.nodeName;i||"SPAN"===f&&"bookmark"===r.getAttribute("data-mce-type")||(i=!0),_e(r,s)?(u.appendChild(r),o=null):c?(o||(o=a.create(c),u.appendChild(o)),o.appendChild(r)):u.appendChild(r)}return c?i||o.appendChild(a.create("br",{"data-mce-bogus":"1"})):u.appendChild(a.create("br")),u}function je(e){Qt(e)&&Pe(e,"dd")}function Ke(r,e,t){b(t,"Indent"===e?je:function(e){return t=r,Wt(n=e)?Pe(n,"dt"):Qt(n)&&Oe(n).each(function(e){return function(e,t,n){var r=Vt.select('span[data-mce-type="bookmark"]',t),o=He(e,n),i=Vt.createRng();i.setStartAfter(n),i.setEndAfter(t);for(var a,s=i.extractContents(),u=s.firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){Vt.remove(u);break}e.dom.isEmpty(s)||Vt.insertAfter(s,t),Vt.insertAfter(o,t),$e(e.dom,n.parentNode)&&(a=n.parentNode,Mt.each(r,function(e){a.parentNode.insertBefore(e,n.parentNode)}),Vt.remove(a)),Vt.remove(n),$e(e.dom,t)&&Vt.remove(t)}(t,e.dom,n.dom)}),0;var t,n})}function Ve(e,t){if(Me(e))return{container:e,offset:t};var n=ge.getNode(e,t);return Me(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&Me(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Me(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}}function We(e){var t=e.cloneRange(),n=Ve(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var r=Ve(e.endContainer,e.endOffset);return t.setEnd(r.container,r.offset),t}function Qe(e,t){var n=t||e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",qt(e,n))}function Xe(e){var t,n,r=e.selection.getSelectedBlocks();return L((t=e,n=Mt.map(r,function(e){return t.dom.getParent(e,"li,dd,dt",qt(t,e))||e}),Xt.unique(n)),Ft)}function qe(e,t){return w(e.dom.getParents(t,"ol,ul",qt(e,t)))}function ze(e,t,n){return void 0===n&&(n=r),e.exists(function(e){return n(e,t)})}function Ye(e,t,n){return e.isSome()&&t.isSome()?E.some(n(e.getOrDie(),t.getOrDie())):E.none()}function Ze(e,t,n){return e.fire("ListMutation",{action:t,element:n})}function Ge(e,t){we(e.item,t.list)}function Je(e,t){for(var n=0;n<e.length-1;n++)(function(e,t,n){if(!a(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);void 0!==e.style&&f(e.style.getPropertyValue)&&e.style.setProperty(t,n)})(e[n].item.dom,"list-style-type","none");w(e).each(function(e){be(e.list,t.listAttributes),be(e.item,t.itemAttributes),ke(e.item,t.content)})}function et(u,e,c){var t=e.slice(0,c.depth);return w(t).each(function(e){var t,n,r,o,i,a,s=(t=c.itemAttributes,n=c.content,be(r=me.fromTag("li",u),t),ke(r,n),r);we((o=e).list,s),o.item=s,a=c,Se((i=e).list)!==a.listType&&(i.list=Pe(i.list,a.listType)),be(i.list,a.listAttributes)}),t}function tt(e,t,n){var r,o=function(e,t,n){for(var r,o,i,a=[],s=0;s<n;s++)a.push((o=t.listType,we((i={list:me.fromTag(o,r=e),item:me.fromTag("li",r)}).list,i.item),i));return a}(e,n,n.depth-t.length);return function(e){for(var t=1;t<e.length;t++)Ge(e[t-1],e[t])}(o),Je(o,n),r=o,Ye(w(t),A(r),Ge),t.concat(o)}function nt(e){return pe(e,"OL,UL")}function rt(e){return De(e).exists(nt)}function ot(e){return 0<e.depth}function it(e){return e.isSelected}function at(s){return b(s,function(a,e){function t(e){return e.depth===i&&!e.dirty}function n(e){return e.depth<i}var r,o,i;i=(r=s)[o=e].depth,h(D(r.slice(0,o)),t,n).orThunk(function(){return h(r.slice(o+1),t,n)}).fold(function(){var e,t,n,r,o,i;a.dirty&&(a.listAttributes=(e=a.listAttributes,n=function(e,t){return"start"!==t},r=t={},o=function(e,t){r[t]=e},i=u,j(e,function(e,t){(n(e,t)?o:i)(e,t)}),t))},function(e){var t=e;a.listType=t.listType,a.listAttributes=B({},t.listAttributes)})}),s}function st(n,a,s,u){return De(u).filter(nt).fold(function(){a.each(function(e){F(e.start,u)&&s.set(!0)});var r,o,i,e=(r=u,o=n,i=s.get(),Oe(r).filter(Bt).map(function(e){return{depth:o,dirty:!1,isSelected:i,content:(n=Le(t=r),C(xe(t).exists(nt)?n.slice(0,-1):n,Ie)),itemAttributes:Ne(r),listAttributes:Ne(e),listType:Se(e)};var t,n}));a.each(function(e){F(e.end,u)&&s.set(!1)});var t=xe(u).filter(nt).map(function(e){return Yt(n,a,s,e)}).getOr([]);return e.toArray().concat(t)},function(e){return Yt(n,a,s,e)})}function ut(o,e){return C(at(e),function(e){var t,n,r=(t=e.content,n=document.createDocumentFragment(),b(t,function(e){n.appendChild(e.dom)}),me.fromDom(n));return me.fromDom(He(o,r.dom))})}function ct(e,t){var n=at(t),r=e.contentDocument;return A(v(n,function(e,t){return(t.depth>e.length?tt:et)(r,e,t)},[])).map(function(e){return e.list}).toArray()}function ft(e,t){b(L(e,it),function(e){return function(e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e),0})}function dt(e,t){var n,r,o,i,a,s,u,c,f,d,l,m,p,g=C((i=qe(o=r=e,o.selection.getStart()),a=L(o.selection.getSelectedBlocks(),_t),s=i.toArray().concat(a),zt(r,s)),me.fromDom),v=C(L(Xe(e),Ht),me.fromDom),h=!1;return(g.length||v.length)&&(n=e.selection.getBookmark(),c=t,b((f=g,p=C(Xe(u=e),me.fromDom),d=Ye(N(p,y(rt)),N(D(p),y(rt)),function(e,t){return{start:e,end:t}}),l=!1,m={get:function(){return l},set:function(e){l=e}},C(f,function(e){return{sourceList:e,entries:Yt(0,d,m,e)}})),function(e){ft(e.entries,c);var t,n,r=(t=u,T(function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var s=e[i],u=t(s);u!==n&&(r.push(o),o=[]),n=u,o.push(s)}return 0!==o.length&&r.push(o),r}(e.entries,ot),function(e){return(A(e).exists(ot)?ct:ut)(t,e)}));b(r,function(e){Ze(u,"Indent"===c?"IndentList":"OutdentList",e.dom)}),n=e.sourceList,b(r,function(e){Ae(n,e)}),Ee(e.sourceList)}),Ke(e,t,v),e.selection.moveToBookmark(n),e.selection.setRng(We(e.selection.getRng())),e.nodeChanged(),h=!0),h}function lt(e){return dt(e,"Indent")}function mt(e){return dt(e,"Outdent")}function pt(e){return dt(e,"Flatten")}function gt(o){function e(e){var t,n=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"];1===n.nodeType&&(t=Gt.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[r]):Gt.insertAfter(t,n.childNodes[r])):n.appendChild(t),n=t,r=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=r}var i={};return e(!0),o.collapsed||e(),i}function vt(o){function e(e){var t,n=t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"];n&&(1===n.nodeType&&(r=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(n),n=n.parentNode,Gt.remove(t),!n.hasChildNodes()&&Gt.isBlock(n)&&n.appendChild(Gt.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=r)}e(!0),e();var t=Gt.createRng();return t.setStart(o.startContainer,o.startOffset),o.endContainer&&t.setEnd(o.endContainer,o.endOffset),We(t)}function ht(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function yt(e){return/\btox\-/.test(e.className)}function St(e,n,r){function t(e){var t=h(e.parents,Ut,jt).filter(function(e){return e.nodeName===n&&!yt(e)}).isSome();r(t)}return t({parents:e.dom.getParents(e.selection.getNode())}),e.on("NodeChange",t),function(){return e.off("NodeChange",t)}}function Ct(n,e){Mt.each(e,function(e,t){n.setAttribute(t,e)})}function bt(e,t,n){var r,o,i,a=n["list-style-type"]||null;e.setStyle(t,"list-style-type",a),r=e,Ct(o=t,(i=n)["list-attributes"]),Mt.each(r.select("li",o),function(e){Ct(e,i["list-item-attributes"])})}function Nt(e,t,n,r){var o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Kt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Ue(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Ot(u,c,f){var e,t,n=u.selection.getRng(),d="LI",r=qt(u,u.selection.getStart(!0)),l=u.dom;"false"!==l.getContentEditable(u.selection.getNode())&&("DL"===(c=c.toUpperCase())&&(d="DT"),e=gt(n),t=function(n,e,r){for(var o,i=[],a=n.dom,t=Nt(n,e,!0,r),s=Nt(n,e,!1,r),u=[],c=t;c&&(u.push(c),c!==s);c=c.nextSibling);return Mt.each(u,function(e){if(Ue(n,e))return i.push(e),void(o=null);if(a.isBlock(e)||Kt(e))return Kt(e)&&a.remove(e),void(o=null);var t=e.nextSibling;Zt.isBookmarkNode(e)&&(Ut(t)||Ue(n,t)||!t&&e.parentNode===r)?o=null:(o||(o=a.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(u,n,r),Mt.each(t,function(e){var t,n,r,o,i,a=e.previousSibling,s=e.parentNode;Ft(s)||(a&&Ut(a)&&a.nodeName===c&&(o=f,l.getStyle(a,"list-style-type")===(i=null===(i=o?o["list-style-type"]:"")?"":i))?(t=a,e=l.rename(e,d),a.appendChild(e)):(t=l.create(c),e.parentNode.insertBefore(t,e),t.appendChild(e),e=l.rename(e,d)),n=l,r=e,Mt.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],function(e){var t;return n.setStyle(r,((t={})[e]="",t))}),bt(l,t,f),Jt(u.dom,t))}),u.selection.setRng(vt(e)))}function Lt(e,t,n){return a=n,(i=t)&&a&&Ut(i)&&i.nodeName===a.nodeName&&(o=n,(r=e).getStyle(t,"list-style-type",!0)===r.getStyle(o,"list-style-type",!0))&&t.className===n.className;var r,o,i,a}function Tt(e,t,n){var r,o,i,a,s,u,c,f,d,l,m,p,g,v,h,y,S,C=Qe(e),b=(f=Qe(c=e),d=c.selection.getSelectedBlocks(),f&&1===d.length&&d[0]===f?L(f.querySelectorAll("ol,ul,dl"),Ut):L(d,function(e){return Ut(e)&&f!==e})),N=O(n)?n:{};0<b.length?(l=e,p=b,g=t,v=N,(S=Ut(m=C))&&m.nodeName===g&&!en(v)?pt(l):(Ot(l,g,v),h=gt(l.selection.getRng()),y=S?function(e,t){for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||((n=n||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([m],p,!0):p,Mt.each(y,function(e){var t,n,r=l,o=g,i=v;(t=e).nodeName!==o?(n=r.dom.rename(t,o),bt(r.dom,n,i),Ze(r,ht(o),n)):(bt(r.dom,t,i),Ze(r,ht(o),t))}),l.selection.setRng(vt(h)))):(i=t,a=N,(o=C)!==(r=e).getBody()&&(o?o.nodeName!==i||en(a)||yt(o)?(s=gt(r.selection.getRng()),bt(r.dom,o,a),u=r.dom.rename(o,i),Jt(r.dom,u),r.selection.setRng(vt(s)),Ot(r,i,a),Ze(r,ht(i),u)):pt(r):(Ot(r,i,a),Ze(r,ht(i),o))))}function Dt(e,t,n,r){var o=t.startContainer,i=t.startOffset;if(Me(o)&&(n?i<o.data.length:0<i))return o;var a=e.schema.getNonEmptyElements();1===o.nodeType&&(o=ge.getNode(o,i));var s,u,c=new ve(o,r);for(n&&(s=e.dom,Kt(u=o)&&s.isBlock(u.nextSibling)&&!Kt(u.previousSibling)&&c.next());o=c[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if(Me(o)&&0<o.data.length)return o}}function xt(e,t){var n=t.childNodes;return 1===n.length&&!Ut(n[0])&&e.isBlock(n[0])}function At(t,e,n){var r,o,i,a=e.parentNode;Fe(t,e)&&Fe(t,n)&&(Ut(n.lastChild)&&(r=n.lastChild),a===n.lastChild&&Kt(a.previousSibling)&&t.remove(a.previousSibling),(o=n.lastChild)&&Kt(o)&&e.hasChildNodes()&&t.remove(o),$e(t,n,!0)&&t.$(n).empty(),function(e,t,n){var r,o,i,a=xt(e,n)?n.firstChild:n;if(xt(o=e,i=t)&&o.remove(i.firstChild,!0),!$e(e,t,!0))for(;r=t.firstChild;)a.appendChild(r)}(t,e,n),r&&n.appendChild(r),i=H(me.fromDom(n),me.fromDom(e))?t.getParents(e,Ut,n):[],t.remove(e),b(i,function(e){$e(t,e)&&e!==t.getRoot()&&t.remove(e)}))}function wt(c,f){var e=c.dom,t=c.selection,n=t.getStart(),r=qt(c,n),d=e.getParent(t.getStart(),"LI",r);if(d){var o=d.parentNode;if(o===c.getBody()&&$e(e,o))return 1;var l=We(t.getRng()),m=e.getParent(Dt(c,l,f,r),"LI",r);if(m&&m!==d)return c.undoManager.transact(function(){var e,t,n,r,o,i,a,s,u;f?(t=l,n=m,r=d,(u=(e=c).dom).isEmpty(r)?(a=n,(i=e).dom.$(s=r).empty(),At(i.dom,a,s),i.selection.setCursorLocation(s,0)):(o=gt(t),At(u,n,r),e.selection.setRng(vt(o)))):d.parentNode.firstChild===d?mt(c):function(e,t,n){var r=gt(l);At(e.dom,t,n);var o=vt(r);e.selection.setRng(o)}(c,d,m)}),1;if(!m&&!f&&0===l.startOffset&&0===l.endOffset)return c.undoManager.transact(function(){pt(c)}),1}}function kt(e,t){return e.selection.isCollapsed()?wt(i=e,a=t)||function(r,o){var i=r.dom,e=r.selection.getStart(),a=qt(r,e),s=i.getParent(e,i.isBlock,a);if(s&&i.isEmpty(s)){var t=We(r.selection.getRng()),u=i.getParent(Dt(r,t,o,a),"LI",a);if(u)return r.undoManager.transact(function(){var e,t=s,n=(e=i).getParent(t.parentNode,e.isBlock,a);e.remove(t),n&&e.isEmpty(n)&&e.remove(n),Jt(i,u.parentNode),r.selection.select(u,!0),r.selection.collapse(o)}),1}}(i,a):(r=(n=e).selection.getStart(),o=qt(n,r),(n.dom.getParent(r,"LI,DT,DD",o)||0<Xe(n).length)&&(n.undoManager.transact(function(){var i,e,t;n.execCommand("Delete"),i=n.dom,e=n.getBody(),t=Mt.grep(i.select("ol,ul",e)),Mt.each(t,function(e){var t,n,r,o=i;"LI"===(r=(t=e).parentNode).nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),$e(o,r)&&tn.remove(r)):tn.setStyle(r,"listStyleType","none")),Ut(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)})}),1));var n,r,o,i,a}function Et(e){return v(C(D(J(e).split("")),function(e,t){var n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*n}),function(e,t){return e+t},0)}function It(t,n){return function(){var e=Qe(t);return e&&e.nodeName===n}}function Pt(o){o.addCommand("mceListProps",function(){var t,e,n,r;r=Qe(t=o),$t(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:E.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),ze(e.listStyleType,"upper-alpha")?nn(n):ze(e.listStyleType,"lower-alpha")?nn(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){!function(e){switch(/^[0-9]+$/.test(t=e)?2:/^[A-Z]+$/.test(t)?0:/^[a-z]+$/.test(t)?1:0<t.length?4:3){case 2:return E.some({listStyleType:E.none(),start:e});case 0:return E.some({listStyleType:E.some("upper-alpha"),start:Et(e).toString()});case 1:return E.some({listStyleType:E.some("lower-alpha"),start:Et(e).toString()});case 3:return E.some({listStyleType:E.none(),start:""});case 4:return E.none()}var t}(e.getData().start).each(function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})}),e.close()}})})}"undefined"!=typeof window||Function("return this;")();function Bt(e){return 1===e.dom.nodeType}var Rt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Mt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ut=Re(/^(OL|UL|DL)$/),_t=Re(/^(OL|UL)$/),$t=Be("ol"),Ft=Re(/^(LI|DT|DD)$/),Ht=Re(/^(DT|DD)$/),jt=Re(/^(TH|TD)$/),Kt=Be("br"),Vt=Rt.DOM,Wt=Ce("dd"),Qt=Ce("dt"),Xt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),qt=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},zt=function(t,e){var n=C(e,function(e){return qe(t,e).getOr(e)});return Xt.unique(n)},Yt=function(t,n,r,e){return T(Le(e),function(e){return(nt(e)?Yt:st)(t+1,n,r,e)})},Zt=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Gt=Rt.DOM,Jt=function(e,t){var n,r=t.nextSibling;if(Lt(e,t,r)){for(;n=r.firstChild;)t.appendChild(n);e.remove(r)}if(Lt(e,t,r=t.previousSibling)){for(;n=r.lastChild;)t.insertBefore(n,t.firstChild);e.remove(r)}},en=function(e){return"list-style-type"in e},tn=Rt.DOM,nn=function(e){if(--e<0)return"";var t=e%26,n=Math.floor(e/26);return nn(n)+String.fromCharCode("A".charCodeAt(0)+t)};i.add("lists",function(e){var n,t,r,o,i,a,s,u;return!1===e.hasPlugin("rtc",!0)?((a=e).getParam("lists_indent_on_tab",!0)&&(s=a).on("keydown",function(e){e.keyCode!==he.TAB||he.metaKeyPressed(e)||s.undoManager.transact(function(){(e.shiftKey?mt:lt)(s)&&e.preventDefault()})}),(u=a).on("keydown",function(e){e.keyCode===he.BACKSPACE?kt(u,!1)&&e.preventDefault():e.keyCode===he.DELETE&&kt(u,!0)&&e.preventDefault()}),(i=e).on("BeforeExecCommand",function(e){var t=e.command.toLowerCase();"indent"===t?lt(i):"outdent"===t&&mt(i)}),i.addCommand("InsertUnorderedList",function(e,t){Tt(i,"UL",t)}),i.addCommand("InsertOrderedList",function(e,t){Tt(i,"OL",t)}),i.addCommand("InsertDefinitionList",function(e,t){Tt(i,"DL",t)}),i.addCommand("RemoveList",function(){pt(i)}),Pt(i),i.addCommand("mceListUpdate",function(e,t){var n,r,o;O(t)&&(r=t,o=Qe(n=i),n.undoManager.transact(function(){O(r.styles)&&n.dom.setStyles(o,r.styles),O(r.attrs)&&j(r.attrs,function(e,t){return n.dom.setAttrib(o,t,e)})}))}),i.addQueryStateHandler("InsertUnorderedList",It(i,"UL")),i.addQueryStateHandler("InsertOrderedList",It(i,"OL")),i.addQueryStateHandler("InsertDefinitionList",It(i,"DL"))):Pt(e),(o=e).hasPlugin("advlist")||(o.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:c("InsertOrderedList"),onSetup:function(e){return St(o,"OL",e.setActive)}}),o.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:c("InsertUnorderedList"),onSetup:function(e){return St(o,"UL",e.setActive)}})),t={text:"List properties...",icon:"ordered-list",onAction:function(){return n.execCommand("mceListProps")},onSetup:function(t){return St(n,"OL",function(e){return t.setDisabled(!e)})}},(n=e).ui.registry.addMenuItem("listprops",t),n.ui.registry.addContextMenu("lists",{update:function(e){var t=Qe(n,e);return $t(t)?["listprops"]:[]}}),r=e,{backspaceDelete:function(e){kt(r,e)}};function c(e){return function(){return o.execCommand(e)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/media/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/media/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function e(n){return function(e){return r=typeof(t=e),(null===t?"null":"object"==r&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":r)===n;var t,r}}function s(e){return null!=e}function o(e){return function(){return e}}function t(e){return e}function r(){return d}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},i=e("string"),u=e("object"),l=e("array"),c=o(!1),m=o(!0),d={fold:function(e,t){return e()},isSome:c,isNone:m,getOr:t,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:t,orThunk:a,map:r,each:function(){},bind:r,exists:c,forall:m,filter:function(){return d},toArray:function(){return[]},toString:o("none()")};function a(e){return e()}function h(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function f(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function g(e,t){return J(e,t)?W.from(e[t]):W.none()}function v(e){return e.getParam("media_scripts")}function b(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]}function w(e){return e.replace(/px$/,"")}function y(i,e){var c=f(!1),s={};return V({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(!c.get())if(J(t.map,"data-ephox-embed-iri"))c.set(!0),o=(a=(n=t).map.style)?X.parseStyle(a):{},s={type:"ephox-embed-iri",source:n.map["data-ephox-embed-iri"],altsource:"",poster:"",width:g(o,"max-width").map(w).getOr(""),height:g(o,"max-height").map(w).getOr("")};else{if(s.source||"param"!==e||(s.source=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(s.type||(s.type=e),s=K.extend(t.map,s)),"script"===e){var r=b(i,t.map.src);if(!r)return;s={type:"script",source:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(s.source?s.altsource||(s.altsource=t.map.src):s.source=t.map.src),"img"!==e||s.poster||(s.poster=t.map.src)}var n,a,o}}).parse(e),s.source=s.source||s.src||s.data,s.altsource=s.altsource||"",s.poster=s.poster||"",s}function x(e){return{mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()]||""}function j(e){return/^[0-9.]+$/.test(e)?e+"px":e}function O(o,e){!function(e){for(var t=q(e),r=0,n=t.length;r<n;r++){var a=t[r];!function(e,t){var r=""+e;if(o.map[t])for(var n=o.length;n--;){var a=o[n];a.name===t&&(r?(o.map[t]=r,a.value=r):(delete o.map[t],o.splice(n,1)))}else r&&(o.push({name:t,value:r}),o.map[t]=r)}(e[a],a)}}(e)}function S(e,c,s){var u,l=Z(),m=f(!1),d=0;return V({validate:!1,allow_conditional_comments:!0,comment:function(e){l.comment(e)},cdata:function(e){l.cdata(e)},text:function(e,t){l.text(e,t)},start:function(e,t,r){if(!m.get())if(J(t.map,"data-ephox-embed-iri"))m.set(!0),n=c,(i=(o=(a=t).map.style)?ee.parseStyle(o):{})["max-width"]=j(n.width),i["max-height"]=j(n.height),O(a,{style:ee.serializeStyle(i)});else{switch(e){case"video":case"object":case"embed":case"img":case"iframe":void 0!==c.height&&void 0!==c.width&&O(t,{width:c.width,height:c.height})}if(s)switch(e){case"video":O(t,{poster:c.poster,src:""}),c.altsource&&O(t,{src:""});break;case"iframe":O(t,{src:c.source});break;case"source":if(d<2&&(O(t,{src:c[te[d]],type:c[te[d]+"mime"]}),!c[te[d]]))return;d++;break;case"img":if(!c.poster)return;u=!0}}var n,a,o,i;l.start(e,t,r)},end:function(e){if(!m.get()){if("video"===e&&s)for(var t,r=0;r<2;r++)c[te[r]]&&((t=[]).map={},d<=r&&(O(t,{src:c[te[r]],type:c[te[r]+"mime"]}),l.start("source",t,!0)));var n;c.poster&&"object"===e&&s&&!u&&((n=[]).map={},O(n,{src:c.poster,width:c.width,height:c.height}),l.start("img",n,!0))}l.end(e)}},Y({})).parse(e),l.getContent()}function _(e,t){for(var r,n=(r=t.match(/^(https?:\/\/|www\.)(.+)$/i))&&1<r.length&&"www."!==r[1]?r[1]:"https://",a=e.regex.exec(t),o=n+e.url,i=0;i<a.length;i++)!function(e){o=o.replace("$"+e,function(){return a[e]||""})}(i);return o.replace(/\?$/,"")}function k(r,e){var n=K.extend({},e);if(!n.source&&(K.extend(n,y(v(r),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=r.convertURL(n.source,"source"),n.altsource=r.convertURL(n.altsource,"source"),n.sourcemime=x(n.source),n.altsourcemime=x(n.altsource),n.poster=r.convertURL(n.poster,"poster");var t,a,o=(t=n.source,0<(a=re.filter(function(e){return e.regex.test(t)})).length?K.extend({},a[0],{url:_(a[0],t)}):null);if(o&&(n.source=o.url,n.type=o.type,n.allowfullscreen=o.allowFullscreen,n.width=n.width||String(o.w),n.height=n.height||String(o.h)),n.embed)return S(n.embed,n,!0);var i=b(v(r),n.source);i&&(n.type="script",n.width=String(i.width),n.height=String(i.height));var c,s,u,l,m=r.getParam("audio_template_callback"),d=r.getParam("video_template_callback");return n.width=n.width||"300",n.height=n.height||"150",K.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?(l=n.allowfullscreen?' allowFullscreen="1"':"",'<iframe src="'+n.source+'" width="'+n.width+'" height="'+n.height+'"'+l+"></iframe>"):"application/x-shockwave-flash"===n.sourcemime?(u='<object data="'+n.source+'" width="'+n.width+'" height="'+n.height+'" type="application/x-shockwave-flash">',n.poster&&(u+='<img src="'+n.poster+'" width="'+n.width+'" height="'+n.height+'" />'),u+"</object>"):-1!==n.sourcemime.indexOf("audio")?(s=n,m?m(s):'<audio controls="controls" src="'+s.source+'">'+(s.altsource?'\n<source src="'+s.altsource+'"'+(s.altsourcemime?' type="'+s.altsourcemime+'"':"")+" />\n":"")+"</audio>"):"script"===n.type?'<script src="'+n.source+'"><\/script>':(c=n,d?d(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+' controls="controls">\n<source src="'+c.source+'"'+(c.sourcemime?' type="'+c.sourcemime+'"':"")+" />\n"+(c.altsource?'<source src="'+c.altsource+'"'+(c.altsourcemime?' type="'+c.altsourcemime+'"':"")+" />\n":"")+"</video>")}function A(e){return e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri")}function T(t){return function(e){return k(t,e)}}function C(e,t){var r,n,a,o,i,c=e.getParam("media_url_resolver");return c?(a=t,o=T(e),i=c,new ne(function(t,e){function r(e){return e.html&&(ae[a.source]=e),t({url:a.source,html:e.html||o(a)})}ae[a.source]?r(ae[a.source]):i({url:a.source},r,e)})):(n=T(e),ne.resolve({html:n(r=t),url:r.source}))}function D(e,t){var r,n,o,i,c,a=t?g(e,t).bind(function(e){return g(e,"meta")}).getOr({}):{},s=(o=e,i=a,c=t,function(e){function t(){return g(o,e)}function r(){return g(i,e)}function n(e){return g(e,"value").bind(function(e){return 0<e.length?W.some(e):W.none()})}var a={};return a[e]=(e===c?t().bind(function(e){return u(e)?n(e).orThunk(r):r().orThunk(function(){return W.from(e)})}):r().orThunk(function(){return t().bind(function(e){return u(e)?n(e):W.from(e)})})).getOr(""),a});return p(p(p(p(p({},s("source")),s("altsource")),s("poster")),s("embed")),(r=a,n={},g(e,"dimensions").each(function(e){h(["width","height"],function(t){g(r,t).orThunk(function(){return g(e,t)}).each(function(e){return n[t]=e})})}),n))}function P(e){var n=p(p({},e),{source:{value:g(e,"source").getOr("")},altsource:{value:g(e,"altsource").getOr("")},poster:{value:g(e,"poster").getOr("")}});return h(["width","height"],function(r){g(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n}function $(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}}function M(e,t){return y(v(e),t)}function F(a,o){return function(e){var t,r,n;i(e.url)&&0<e.url.trim().length&&(t=e.html,r=M(o,t),n=p(p({},r),{source:e.url,embed:t}),a.setData(P(n)))}}function z(e,t){var r=e.dom.select("*[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("*[data-mce-object]"),n=0;n<t.length;n++)for(var a=r.length-1;0<=a;a--)t[n]===r[a]&&r.splice(a,1);e.selection.select(r[0])}(e,r),e.nodeChanged()}function N(m){var e,t,r,n=(r=A(t=(e=m).selection.getNode())?e.serializer.serialize(t,{selection:!0}):"",p({embed:r},y(v(e),r))),d=f(n),a=P(n),o={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!l(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);G.apply(t,e[r])}return t}([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],m.getParam("media_dimensions",!0)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},i=[];m.getParam("media_alt_source",!0)&&i.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),m.getParam("media_poster",!0)&&i.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var c=[o,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];0<i.length&&c.push({title:"Advanced",name:"advanced",items:i});var h=m.windowManager.open({title:"Insert/Edit Media",size:"normal",body:{type:"tabpanel",tabs:c},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t,r,n,a,o=D(e.getData());t=d.get(),n=m,(r=o).embed=S(r.embed,r),r.embed&&(t.source===r.source||(a=r.source,J(ae,a)))?z(n,r.embed):C(n,r).then(function(e){z(n,e.html)}).catch($(n)),e.close()},onChange:function(e,t){switch(t.name){case"source":u=d.get(),l=D(e.getData(),"source"),u.source!==l.source&&(F(h,m)({url:l.source,html:""}),C(m,l).then(F(h,m)).catch($(m)));break;case"embed":c=D((i=e).getData()),s=M(m,c.embed),i.setData(P(s));break;case"dimensions":case"altsource":case"poster":n=t.name,a=D((r=e).getData(),n),o=k(m,a),r.setData(P(p(p({},a),{embed:o})))}var r,n,a,o,i,c,s,u,l;d.set(D(e.getData()))},initialData:a})}function U(o,e){if(!1===o.getParam("media_filter_html",!0))return e;var i,c=Z();return V({validate:!1,allow_conditional_comments:!1,comment:function(e){i||c.comment(e)},cdata:function(e){i||c.cdata(e)},text:function(e,t){i||c.text(e,t)},start:function(e,t,r){if(i=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var n=t.length-1;0<=n;n--){var a=t[n].name;0===a.indexOf("on")&&(delete t.map[a],t.splice(n,1)),"style"===a&&(t[n].value=o.dom.serializeStyle(o.dom.parseStyle(t[n].value),e))}c.start(e,t,r),i=!1}},end:function(e){i||c.end(e)}},Y({})).parse(e),c.getContent()}function E(e,t,r,n){void 0===n&&(n=null);var a=e.attr(r);return s(a)?a:J(t,r)?null:n}function R(e,t,r){var n="img"===t.name||"video"===e.name,a="audio"===e.name?"30":"150",o=n?a:null;t.attr({width:E(e,r,"width",n?"300":null),height:E(e,r,"height",o)})}function L(e,t){var r=t.name,n=new oe("span",1);n.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":r,class:"mce-preview-object mce-object-"+r}),se(e,t,n);var a,o=e.dom.parseStyle(t.attr("style")),i=new oe(r,1);R(t,i,o),i.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===r?i.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0"}):(h(["controls","crossorigin","currentTime","loop","muted","poster","preload"],function(e){i.attr(e,t.attr(e))}),s(a=n.attr("data-mce-html"))&&function(e,t,r,n){for(var a=ce({forced_root_block:!1,validate:!1},e.schema).parse(n,{context:t});a.firstChild;)r.append(a.firstChild)}(e,r,i,unescape(a)));var c=new oe("span",1);return c.attr("class","mce-shim"),n.append(i),n.append(c),n}function I(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t))return 1;var t}var B=function(r){function e(){return a}function t(e){return e(r)}var n=o(r),a={fold:function(e,t){return t(r)},isSome:m,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(e){return B(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?a:d},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return a},W={some:B,none:r,from:function(e){return null==e?d:B(e)}},G=Array.prototype.push,q=Object.keys,H=Object.hasOwnProperty,J=function(e,t){return H.call(e,t)},K=tinymce.util.Tools.resolve("tinymce.util.Tools"),Q=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),V=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),X=Q.DOM,Y=tinymce.util.Tools.resolve("tinymce.html.Schema"),Z=tinymce.util.Tools.resolve("tinymce.html.Writer"),ee=Q.DOM,te=["source","altsource"],re=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],ne=tinymce.util.Tools.resolve("tinymce.util.Promise"),ae={},oe=tinymce.util.Tools.resolve("tinymce.html.Node"),ie=tinymce.util.Tools.resolve("tinymce.Env"),ce=tinymce.util.Tools.resolve("tinymce.html.DomParser"),se=function(e,t,r){for(var n=t.attributes,a=n.length;a--;){var o=n[a].name,i=n[a].value;"width"!==o&&"height"!==o&&"style"!==o&&("data"!==o&&"src"!==o||(i=e.convertURL(i,o)),r.attr("data-mce-p-"+o,i))}var c=t.firstChild&&t.firstChild.value;c&&(r.attr("data-mce-html",escape(U(e,c))),r.firstChild=null)};n.add("media",function(e){var t,r,d,n,a;function o(){return r.execCommand("mceMedia")}return(t=e).addCommand("mceMedia",function(){N(t)}),(r=e).ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:o,onSetup:function(e){var t=r.selection;return e.setActive(A(t.getNode())),t.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",e.setActive).unbind}}),r.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:o}),e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),(d=e).on("preInit",function(){var t=d.schema.getSpecialElements();K.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var u,r=d.schema.getBoolAttrs();K.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",(u=d,function(e){for(var t,r,n,a,o,i,c,s=e.length;s--;)(t=e[s]).parent&&(t.parent.attr("data-mce-object")||"script"===t.name&&!(r=b(v(u),t.attr("src")))||(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),("iframe"===(c=t.name)||"video"===c||"audio"===c)&&u.getParam("media_live_embeds",!0)&&ie.ceFalse?I(t)||t.replace(L(u,t)):I(t)||t.replace((n=u,i=void 0,o=(a=t).name,(i=new oe("img",1)).shortEnded=!0,se(n,a,i),R(a,i,{}),i.attr({style:a.attr("style"),src:ie.transparentSrc,"data-mce-object":o,class:"mce-object mce-object-"+o}),i))))})),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,a,o,i,c,s,u,l=e.length;l--;)if((r=e[l]).parent){for(s=r.attr(t),n=new oe(s,1),"audio"!==s&&"script"!==s&&((u=r.attr("class"))&&-1!==u.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),a=(o=r.attributes).length;a--;){var m=o[a].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[a].value)}"script"===s&&n.attr("type","text/javascript"),(i=r.attr("data-mce-html"))&&((c=new oe("#text",3)).raw=!0,c.value=U(d,unescape(i)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})}),(n=e).on("click keyup touchend",function(){var e=n.selection.getNode();e&&n.dom.hasClass(e,"mce-preview-object")&&n.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),n.on("ObjectSelected",function(e){"script"===e.target.getAttribute("data-mce-object")&&e.preventDefault()}),n.on("ObjectResized",function(e){var t,r=e.target;!r.getAttribute("data-mce-object")||(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(S(t,{width:String(e.width),height:String(e.height)}))))}),a=e,{showDialog:function(){N(a)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/nonbreaking/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/nonbreaking/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function o(n,e){for(var a="",o=0;o<e;o++)a+=n;return a}function s(n,e){var a=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+(n.plugins.visualchars&&n.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o("&nbsp;",e)+"</span>":o("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(a)})}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,t,i;function r(){return a.execCommand("mceNonBreaking")}(e=n).addCommand("mceNonBreaking",function(){s(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:r}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:r}),0<(i="boolean"==typeof(t=(o=n).getParam("nonbreaking_force_tab",0))?!0===t?3:0:t)&&o.on("keydown",function(n){n.keyCode!==c.TAB||n.isDefaultPrevented()||n.shiftKey||(n.preventDefault(),n.stopImmediatePropagation(),s(o,i))})})}();
/trunk/vendor/tinymce/tinymce/plugins/noneditable/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/noneditable/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function l(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")}function u(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}}function e(e){var t,r="contenteditable",n=" "+f.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+f.trim(l(e))+" ",i=u(n),o=u(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0<c.length&&e.on("BeforeSetContent",function(t){!function(t,e,n){var r=e.length,a=n.content;if("raw"!==n.format){for(;r--;)a=a.replace(e[r],function(i,o,c){return function(t){var e=arguments,n=e[e.length-2],r=0<n?o.charAt(n-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",n);if(-1!==a&&-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(e[0])+'">'+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+"</span>"}}(t,a,l(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0<c.length&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(r,null))})})}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools");t.add("noneditable",function(t){e(t)})}();
/trunk/vendor/tinymce/tinymce/plugins/pagebreak/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/pagebreak/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function u(e){return e.getParam("pagebreak_split_block",!1)}function l(e){var a='<img src="'+n.transparentSrc+'" class="'+m+'" data-mce-resize="false" data-mce-placeholder />';return e?"<p>"+a+"</p>":a}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),m="mce-pagebreak";e.add("pagebreak",function(e){var a,n,o,i,t,r;function c(){return n.execCommand("mcePageBreak")}function g(){return u(o)}(a=e).addCommand("mcePageBreak",function(){a.insertContent(l(u(a)))}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:c}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:c}),i=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,l(g()))}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t,r=e.length;r--;)(t=(n=e[r]).attr("class"))&&-1!==t.indexOf(m)&&(a=n.parent,o.schema.getBlockElements()[a.name]&&g()?(a.type=3,a.value=i,a.raw=!0,n.remove()):(n.type=3,n.value=i,n.raw=!0))})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,m)&&(e.name="pagebreak")})})}();
/trunk/vendor/tinymce/tinymce/plugins/paste/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/paste/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function w(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function P(e){return!(null==e)}function _(){}function o(e){return function(){return e}}function e(e){return e}function t(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return n=typeof(t=e),"array"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n},i=o(!(n="function")),s=o(!0),l={fold:function(e,t){return e()},isSome:i,isNone:s,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:e,orThunk:a,map:t,each:_,bind:t,exists:i,forall:s,filter:function(){return l},toArray:function(){return[]},toString:o("none()")};function a(e){return e()}function c(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1}function f(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a)}return r}function d(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function p(){var e,t,n=(e=_,t=w(le.none()),{clear:function(){r(),t.set(le.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){r(),t.set(le.some(e))}});function r(){return t.get().each(e)}return de(de({},n),{on:function(e){return n.get().each(e)}})}function m(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}function C(e,t){return e.fire("PastePlainTextToggle",{state:t})}function T(e){return e.getParam("paste_data_images",!1)}function g(e){return e.getParam("paste_retain_style_properties")}function h(e){return e.getParam("validate")}function y(e){return e.getParam("paste_data_images",!1,"boolean")}function v(e){return he.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))}function b(e){return-1!==e.indexOf(be)}function x(e,t,n){return t?(r=!0===t?"p":t,a=n,o=e.split(/\n\n/),i=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(var o in t)n=o,we.call(t,n)&&r.push(o+'="'+Pe.encodeAllRaw(t[o])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(r,a),s="</"+r+">",1===(l=he.map(o,function(e){return e.split(/\n/).join("<br />")})).length?l[0]:he.map(l,function(e){return i+e+s}).join("")):e.replace(/\r?\n/g,"<br>");var r,a,o,i,s,l}function D(t,e){return he.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function k(e){return D(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function O(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}function S(r,e){var a,t=g(r);t&&(a=he.makeMap(t.split(/[, ]/))),e=D(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var n=r.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody"),o=De({valid_elements:n,valid_children:"-li[p]"});he.each(o.elements,function(e){e.attributes.class||(e.attributes.class={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var i=_e({},o);i.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",function(r,a,o,i){var s={},e=r.dom.parseStyle(i);return he.each(e,function(e,t){switch(t){case"mso-list":var n=/\w+ \w+([0-9]+)/i.exec(i);n&&(o._listLevel=parseInt(n[1],10)),/Ignore/i.test(e)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void o.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===g(r)||a&&a[t])&&(s[t]=e):o.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],o.wrap(new Te("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],o.wrap(new Te("i",1))),r.dom.serializeStyle(s,o.name)||null}(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),i.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),i.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),i.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_")?t.remove():!(n=n&&0===n.indexOf("file://")?(n=n.split("#")[1])&&"#"+n:n)&&!r||r&&!/^_?(?:toc|edn|ftn)/i.test(r)?t.unwrap():t.attr({href:n,name:r})});var s=i.parse(e);return r.getParam("paste_convert_word_fake_lists",!0)&&function(e){for(var a,o,i=1,n=function(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return t},s=function(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!s(e,t))return!1}while(e=e.next);return!0},l=function(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)for(;l(e),e=e.next;);},t=function(e,t,n){var r=e._listLevel||i;(a=r!==i?r<i?a&&a.parent.parent:(o=a,null):a)&&a.name===t?a.append(e):(o=o||a,a=new Te(t,1),1<n&&a.attr("start",""+n),e.wrap(a)),e.name="li",i<r&&o&&o.lastChild.append(a),i=r,l(e),s(e,/^\u00a0+/),s(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(e,/^\u00a0+/)},r=[],u=e.firstChild;null!=u;)if(r.push(u),null!==(u=u.walk()))for(;void 0!==u&&u.parent!==e;)u=u.walk();for(var c,f,d,p=0;p<r.length;p++)"p"===(e=r[p]).name&&e.firstChild?(c=n(e),/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)?t(e,"ul"):function(t){var n=!1;return t=c.replace(/^[\u00a0 ]+/,""),he.each([/^[IVXLMCD]+\.[ \u00a0]/,/^[ivxlmcd]+\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],function(e){if(e.test(t))return!(n=!0)}),n}(c)?(d=1,t(e,"ol",d=(f=/([0-9]+)\./.exec(c))?parseInt(f[1],10):d)):e._listLevel?t(e,"ul",1):a=null):(o=a,a=null)}(s),Ce({validate:h(r)},o).serialize(s)}function j(e,t){return{content:e,cancelled:t}}function A(e,t,n){var r,a,o,i,s,l,u,c,f,d,p,m,g=O(t),v=g?(a=t,(r=e).getParam("paste_enable_default_filters",!0)?S(r,a):a):t;return i=n,s=g,p=(o=e).fire("PastePreProcess",{content:v,internal:i,wordContent:s}),m=function(e,t){var n=_e({},e.schema);n.addNodeFilter("meta",function(e){he.each(e,function(e){e.remove()})});var r=n.parse(t,{forced_root_block:!1,isRootContent:!0});return Ce({validate:h(e)},e.schema).serialize(r)}(o,p.content),o.hasEventListeners("PastePostProcess")&&!p.isDefaultPrevented()?(u=i,c=s,f=(l=o).dom.create("div",{style:"display:none"},m),j((d=l.fire("PastePostProcess",{node:f,internal:u,wordContent:c})).node.innerHTML,d.isDefaultPrevented())):j(m,p.isDefaultPrevented())}function R(e,t){return e.insertContent(t,{merge:e.getParam("paste_merge_formats",!0),paste:!0}),!0}function I(e){return/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e)}function F(e,t,n){return!(!1!==e.selection.isCollapsed()||!I(t)||(a=t,o=n,(r=e).undoManager.extra(function(){o(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,o}function E(e,t,n){return r=e,!(!I(a=t)||!c(v(r),function(e){return m(t=a.toLowerCase(),n="."+e.toLowerCase(),t.length-n.length);var t,n})||(i=t,s=n,(o=e).undoManager.extra(function(){s(o,i)},function(){o.insertContent('<img src="'+i+'">')}),0));var r,a,o,i,s}function M(e){return"\n"===e||"\r"===e}function B(e,t,n,r){var a,o,i,s,l=A(e,t,n);!1===l.cancelled&&(a=e,o=l.content,r||!1===a.getParam("smart_paste",!0)?R(a,o):(i=a,s=o,he.each([F,E,R],function(e){return!0!==e(i,s,R)})))}function L(e,t,n){var r=n||b(t);B(e,t.replace(be,""),r,!1)}function N(e,t){var n,r,a,o,i,s,l=e.dom.encode(t).replace(/\r\n/g,"\n"),u=x((n=l,o=(r=e.getParam("paste_tab_spaces",4,"number"))<=0?"":new Array(r+1).join(" "),i=n.replace(/\t/g,o),s={pcIsSpace:!(a=function(e,t){return-1!==" \f\t\v".indexOf(t)||"\xa0"===t?e.pcIsSpace||""===e.str||e.str.length===i.length-1||(n=e.str.length+1)<i.length&&0<=n&&M(i[n])?{pcIsSpace:!1,str:e.str+"\xa0"}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:M(t),str:e.str+t};var n}),str:""},d(i,function(e,t){s=a(s,e)}),s.str),e.getParam("forced_root_block"),e.getParam("forced_root_block_attrs"));B(e,u,!1,!0)}function H(e){var t,n={};if(e&&(!e.getData||(t=e.getData("Text"))&&0<t.length&&-1===t.indexOf("data:text/mce-internal,")&&(n["text/plain"]=t),e.types))for(var r=0;r<e.types.length;r++){var a=e.types[r];try{n[a]=e.getData(a)}catch(e){n[a]=""}}return n}function $(e,t){return t in e&&0<e[t].length}function z(e){return $(e,"text/html")||$(e,"text/plain")}function U(w,e,t){var n,r,a,o,i,s="paste"===e.type?e.clipboardData:e.dataTransfer;if(y(w)&&s){var l=(n=w,a=(r=s).items?function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);ce.apply(t,e[n])}return t}(f(fe(r.items),function(e){return"file"===e.kind?[e.getAsFile()]:[]})):[],o=r.files?fe(r.files):[],function(e,t){for(var n=[],r=0,a=e.length;r<a;r++){var o=e[r];t(o,r)&&n.push(o)}return n}(0<a.length?a:o,(i=v(n),function(r){return m(r.type,"image/",0)&&c(i,function(e){return t=e.toLowerCase(),(he.hasOwn(n={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},t)?"image/"+n[t]:"image/"+t)===r.type;var t,n})})));if(0<l.length)return e.preventDefault(),ge.all(f(l,function(r){return new ge(function(e){var t=P(r.getAsFile)?r.getAsFile():r,n=new window.FileReader;n.onload=function(){e({blob:t,uri:n.result})},n.readAsDataURL(t)})})).then(function(e){t&&w.selection.setRng(t),d(e,function(e){var t,n,r,a,o,i,s,l,u,c,f,d,p,m,g,v,h,y,b,x;t=w,r=(n=e).uri,g=(a=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r))?{type:a[1],data:decodeURIComponent(a[2])}:{type:null,data:null},v=g.data,h=g.type,y=ke(),b=n.blob,(x=new Image).src=n.uri,p=x,!(m=t.getParam("images_dataimg_filter"))||m(p)?(c=void 0,(i=(o=t.editorUpload.blobCache).getByData(v,h))?c=i:(l=(s=t.getParam("images_reuse_filename")&&P(b.name))?(f=t,P(d=b.name.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i))?f.dom.encode(d[1]):null):y,u=s?b.name:void 0,c=o.create(y,b,v,l,u),o.add(c)),L(t,'<img src="'+c.blobUri()+'">',!1)):L(t,'<img src="'+n.uri+'">',!1)})}),!0}return!1}function V(e){return ve.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode}function K(o,e,t){var i,s,v,l,u,c,f;function d(e,t,n,r,a){var o;$(t,"text/html")?o=t["text/html"]:(o=v.getHtml(),a=a||b(o),v.isDefaultContent(o)&&(r=!0)),o=k(o),v.remove();var i,s,l,u,c,f,d,p,m=!1===a&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(o),g=I(o);((r=!o.length||m&&!g||r)||g)&&(o=$(t,"text/plain")&&m?t["text/plain"]:(i=o,s=De(),l=_e({},s),u="",c=s.getShortEndedElements(),f=he.makeMap("script noscript style textarea video audio iframe object"," "),d=s.getBlockElements(),p=function(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(c[t]&&(u+=" "),f[t])u+=" ";else{if(3===e.type&&(u+=e.value),!e.shortEnded&&(e=e.firstChild))for(;p(e),e=e.next;);d[t]&&n.next&&(u+="\n","p"===t&&(u+="\n"))}}else u+="\n"},i=D(i,[/<!\[[^\]]+\]>/g]),p(l.parse(i)),u)),v.isDefaultContent(o)?n||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):r?N(e,o):L(e,o,a)}s=o,v=e,l=t,c=p(),f=p(),s.on("keyup",f.clear),s.on("keydown",function(e){function t(e){V(e)&&!e.isDefaultPrevented()&&v.remove()}if(V(e)&&!e.isDefaultPrevented()&&(!(u=e.shiftKey&&86===e.keyCode)||!pe.webkit||-1===navigator.userAgent.indexOf("Version/"))){if(e.stopImmediatePropagation(),c.set(e),f.set(!0),pe.ie&&u)return e.preventDefault(),void s.fire("paste",{ieFake:!0});v.remove(),v.create(),s.once("keyup",t),s.once("paste",function(){s.off("keyup",t)})}}),s.on("paste",function(e){var t=c.isSet()||f.isSet();t&&c.clear();var n,r=H(e.clipboardData||s.getDoc().dataTransfer),a="text"===l.get()||u,o=$(r,xe());u=!1,e.isDefaultPrevented()||(n=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&n&&n.items&&0===n.items.length)||!z(r)&&U(s,e,v.getLastRng()||s.selection.getRng())?v.remove():(t||e.preventDefault(),!pe.ie||t&&!e.ieFake||$(r,"text/html")||(v.create(),s.dom.bind(v.getEl(),"paste",function(e){e.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),r["text/html"]=v.getHtml()),$(r,"text/html")?(e.preventDefault(),o=o||b(r["text/html"]),d(s,r,t,a,o)):me.setEditorTimeout(s,function(){d(s,r,t,a,o)},0))}),o.parser.addNodeFilter("img",function(e,t,n){var r;if(!y(o)&&n.data&&!0===n.data.paste)for(var a=e.length;a--;)(i=e[a].attr("src"))&&(0!==i.indexOf("webkit-fake-url")&&(o.getParam("allow_html_data_urls",!1,"boolean")||0!==i.indexOf("data:"))||((r=e[a]).attr("data-mce-object")||i===pe.transparentSrc||r.remove()))})}function X(e){return pe.ie&&e.inline?document.body:e.getBody()}function W(e){var t=w(null),n="%MCEPASTEBIN%";return{create:function(){return function(e,t,n){var r=e.dom,a=e.getBody();t.set(e.selection.getRng());var o,i,s,l,u=e.dom.add(X(e),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(pe.ie||pe.gecko)&&r.setStyle(u,"left","rtl"===r.getStyle(a,"direction",!0)?65535:-65535),r.bind(u,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),i=u,s=n,X(l=o=e)!==l.getBody()&&o.dom.bind(i,"paste keyup",function(e){Oe(o,s)||o.fire("paste")}),u.focus(),e.selection.select(u,!0)}(e,t,n)},remove:function(){return function(e,t){if(oe(e)){for(var n,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(e,t)},getEl:function(){return oe(e)},getHtml:function(){return function(n){function t(e,t){e.appendChild(t),n.dom.remove(t,!0)}var e=he.grep(X(n).childNodes,function(e){return"mcepastebin"===e.id}),r=e.shift();he.each(e,function(e){t(r,e)});for(var a=n.dom.select("div[id=mcepastebin]",r),o=a.length-1;0<=o;o--){var i=n.dom.create("div");r.insertBefore(i,a[o]),t(i,a[o])}return r?r.innerHTML:""}(e)},getLastRng:t.get,isDefault:function(){return Oe(e,n)},isDefaultContent:function(e){return e===n}}}function Y(e,t,n,r){!function(e,t,n){if(!1===pe.iOS&&"function"==typeof(null==e?void 0:e.setData))try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(xe(),t),1}catch(e){return}}(e.clipboardData,t.html,t.text)?n(t.html,r):(e.preventDefault(),r())}function Z(s){return function(e,t){var n=be+e,r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var o=s.selection.getRng();a.focus();var i=s.dom.createRng();i.selectNodeContents(a),s.selection.setRng(i),me.setTimeout(function(){s.selection.setRng(o),r.parentNode.removeChild(r),t()},0)}}function q(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}}function G(e){return!e.selection.isCollapsed()||(t=e).dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody());var t}function J(e,t){return Se.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())}function Q(e,t){e.focus(),e.selection.setRng(t)}function ee(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function te(e,t){if(!O(t))return t;var n=[];return he.each(e.schema.getBlockElements(),function(e,t){n.push(t)}),t=D(t,[[new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g"),"$1"]]),D(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function ne(e,t,n,r){if(r||n)return t;var c,f,d,a=e.getParam("paste_webkit_styles");return!1===e.getParam("paste_remove_styles_if_webkit",!0)||"all"===a?t:(t=(c=a?a.split(/[, ]/):c)?(f=e.dom,d=e.selection.getNode(),t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=f.parseStyle(f.decode(n)),o={};if("none"===c)return t+r;for(var i=0;i<c.length;i++){var s=a[c[i]],l=f.getStyle(d,c[i],!0);/color/.test(c[i])&&(s=f.toHex(s),l=f.toHex(l)),l!==s&&(o[c[i]]=s)}var u=f.serializeStyle(o,"span");return u?t+' style="'+u+'"'+r:t+r})):t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3")).replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function re(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}function ae(n,r){return function(t){function e(e){return t.setActive(e.state)}return t.setActive("text"===r.pasteFormat.get()),n.on("PastePlainTextToggle",e),function(){return n.off("PastePlainTextToggle",e)}}}function oe(e){return e.dom.get("mcepastebin")}var ie,se=function(n){function e(){return a}function t(e){return e(n)}var r=o(n),a={fold:function(e,t){return t(n)},isSome:s,isNone:i,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return se(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},le={some:se,none:t,from:function(e){return null==e?l:se(e)}},ue=Array.prototype.slice,ce=Array.prototype.push,fe=typeof Array.from===n?Array.from:function(e){return ue.call(e)},de=function(){return(de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},pe=tinymce.util.Tools.resolve("tinymce.Env"),me=tinymce.util.Tools.resolve("tinymce.util.Delay"),ge=tinymce.util.Tools.resolve("tinymce.util.Promise"),ve=tinymce.util.Tools.resolve("tinymce.util.VK"),he=tinymce.util.Tools.resolve("tinymce.util.Tools"),ye="x-tinymce/html",be="\x3c!-- "+ye+" --\x3e",xe=o(ye),we=Object.hasOwnProperty,Pe=tinymce.util.Tools.resolve("tinymce.html.Entities"),_e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),Ce=tinymce.util.Tools.resolve("tinymce.html.Serializer"),Te=tinymce.util.Tools.resolve("tinymce.html.Node"),De=tinymce.util.Tools.resolve("tinymce.html.Schema"),ke=(ie=0,function(){return"mceclip"+ie++}),Oe=function(e,t){var n=oe(e);return n&&"mcepastebin"===n.id&&n.innerHTML===t},Se=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils");r.add("paste",function(e){if(0==(!!e.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0))){var t=w(!1),n=w(e.getParam("paste_as_text",!1)?"text":"html"),r=(y=n,b=W(h=e),h.on("PreInit",function(){return K(h,b,y)}),{pasteFormat:y,pasteHtml:function(e,t){return L(h,e,t)},pasteText:function(e){return N(h,e)},pasteImageData:function(e,t){return U(h,e,t)},getDataTransferItems:H,hasHtmlOrText:z,hasContentType:$}),a=e;return pe.webkit&&ee(a,ne),pe.ie&&(ee(a,te),v=re,(g=a).on("PastePostProcess",function(e){v(g,e.node)})),(p=e).ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:x,onSetup:ae(p,m=r)}),p.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:x,onSetup:ae(p,m)}),d=r,(f=e).addCommand("mceTogglePlainTextPaste",function(){var e,t=f;"text"===(e=d).pasteFormat.get()?(e.pasteFormat.set("html"),C(t,!1)):(e.pasteFormat.set("text"),C(t,!0)),t.focus()}),f.addCommand("mceInsertClipboardContent",function(e,t){t.content&&d.pasteHtml(t.content,t.internal),t.text&&d.pasteText(t.text)}),function(e){var t=e.plugins.paste,n=e.getParam("paste_preprocess");n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=e.getParam("paste_postprocess");r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})}(e),(o=e).on("cut",(u=o,function(e){G(u)&&Y(e,q(u),Z(u),function(){var e;pe.browser.isChrome()||pe.browser.isFirefox()?(e=u.selection.getRng(),me.setEditorTimeout(u,function(){u.selection.setRng(e),u.execCommand("Delete")},0)):u.execCommand("Delete")})})),o.on("copy",(c=o,function(e){G(c)&&Y(e,q(c),Z(c),_)})),s=r,l=t,(i=e).getParam("paste_block_drop",!1)&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),T(i)||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),i.on("drop",function(e){var t,n,r,a,o=J(i,e);e.isDefaultPrevented()||l.get()||(t=s.getDataTransferItems(e.dataTransfer),n=s.hasContentType(t,xe()),(!s.hasHtmlOrText(t)||(r=t["text/plain"])&&0===r.indexOf("file://"))&&s.pasteImageData(e,o)||!o||!i.getParam("paste_filter_drop",!0)||(a=t["mce-internal"]||t["text/html"]||t["text/plain"])&&(e.preventDefault(),me.setEditorTimeout(i,function(){i.undoManager.transact(function(){t["mce-internal"]&&i.execCommand("Delete"),Q(i,o),a=k(a),t["text/html"]?s.pasteHtml(a,n):s.pasteText(a)})})))}),i.on("dragstart",function(e){l.set(!0)}),i.on("dragover dragend",function(e){T(i)&&!1===l.get()&&(e.preventDefault(),Q(i,J(i,e))),"dragend"===e.type&&l.set(!1)}),{clipboard:r}}var i,s,l,o,u,c,f,d,p,m,a,g,v,h,y,b;function x(){return p.execCommand("mceTogglePlainTextPaste")}})}();
/trunk/vendor/tinymce/tinymce/plugins/preview/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/preview/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("preview",function(e){var n,t;function i(){return t.execCommand("mcePreview")}(n=e).addCommand("mcePreview",function(){var e,t;t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">';var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"}),e&&(n+='<style type="text/css">'+e+"</style>");var a,r,s,c,d,l,m,y=-1===(c=(a=t).getParam("body_id","tinymce","string")).indexOf("=")?c:(s=(r=a).getParam("body_id","","hash"))[r.id]||s,u=-1===(m=(d=t).getParam("body_class","","string")).indexOf("=")?m:(l=d).getParam("body_class","","hash")[l.id]||"",v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(f.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",g=t.getBody().dir,p=g?' dir="'+i(g)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(y)+'" class="mce-content-body '+i(u)+'"'+p+">"+t.getContent()+v+"</body></html>"}(e=n),e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}),(t=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:i}),t.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:i})})}();
/trunk/vendor/tinymce/tinymce/plugins/print/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/print/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env");n.add("print",function(n){var t,i;function e(){return i.execCommand("mcePrint")}(t=n).addCommand("mcePrint",function(){r.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:e}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:e}),n.addShortcut("Meta+P","","mcePrint")})}();
/trunk/vendor/tinymce/tinymce/plugins/quickbars/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/quickbars/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function n(a){a.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){var i=a;new s(function(n){var r=document.createElement("input");r.type="file",r.accept="image/*",r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.opacity="0.001",document.body.appendChild(r),r.addEventListener("change",function(t){n(Array.prototype.slice.call(t.target.files))});var o=function(t){function e(){n([]),r.parentNode.removeChild(r)}d.os.isAndroid()&&"remove"!==t.type?f.setEditorTimeout(i,e,0):e(),i.off("focusin remove",o)};i.on("focusin remove",o),r.click()}).then(function(t){var c,n;0<t.length&&(c=t[0],n=c,new s(function(t){var e=new FileReader;e.onloadend=function(){t(e.result.split(",")[1])},e.readAsDataURL(n)}).then(function(t){var e,n,r,o,i,u;n=t,r=c,i=(e=a).editorUpload.blobCache,u=i.create((o=(new Date).getTime(),"mceu_"+Math.floor(1e9*Math.random())+ ++l+String(o)),r,n),i.add(u),e.insertContent(e.dom.createHTML("img",{src:u.blobUri()}))}))})}}),a.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){var t,n;(t=a).plugins.table?t.plugins.table.insertTable(2,2):(n=t).undoManager.transact(function(){n.insertContent(function(){var t='<table data-mce-id="mce" style="width: 100%">';t+="<tbody>";for(var e=0;e<2;e++){t+="<tr>";for(var n=0;n<2;n++)t+="<td><br></td>";t+="</tr>"}return(t+="</tbody>")+"</table>"}());var t=n.dom.select("*[data-mce-id]")[0];t.removeAttribute("data-mce-id");var e=n.dom.select("td,th",t);n.selection.setCursorLocation(e[0],0)})}})}function t(r){return function(t){return n=typeof(e=t),(null===e?"null":"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n)===r;var e,n}}function e(e){return function(t){return typeof t===e}}function i(t){return function(){return t}}function r(t){return t}function o(){return y}var u,c=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=0,s=tinymce.util.Tools.resolve("tinymce.util.Promise"),d=tinymce.util.Tools.resolve("tinymce.Env"),f=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=t("string"),m=t("object"),g=t("array"),v=e("boolean"),h=e("function"),p=i(!1),b=i(!(u=void 0)),y={fold:function(t,e){return t()},isSome:p,isNone:b,getOr:r,getOrThunk:k,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:r,orThunk:k,map:o,each:function(){},bind:o,exists:p,forall:b,filter:function(){return y},toArray:function(){return[]},toString:i("none()")};function k(t){return t()}var w=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:b,isNone:p,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return w(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:y},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:w,none:o,from:function(t){return null==t?y:w(t)}};function E(t,e,n,r,o){return t(n,r)?T.some(n):h(o)&&o(n)?T.none():e(n,r,o)}function N(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}function M(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var S={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return M(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return M(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return M(n)},fromDom:M,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(M)}};function C(t,e,n){for(var r=t.dom,o=h(n)?n:p;r.parentNode;){var r=r.parentNode,i=S.fromDom(r);if(e(i))return T.some(i);if(o(i))break}return T.none()}function O(t,e,n){return C(t,function(t){return N(t,e)},n)}"undefined"!=typeof window||Function("return this;")();var q,x=(q=a,function(t,e,n){return function(){if(!q(n))throw new Error("Default value doesn't match requested type.")}(),function(t,e){if(g(t)||m(t))throw new Error("expected a string but found: "+t);return u===t?e:v(t)?!1===t?"":e:t}(t.getParam(e,n),n)});c.add("quickbars",function(t){var o,e;n(t),0<(e=x(o=t,"quickbars_insert_toolbar","quickimage quicktable")).trim().length&&o.ui.registry.addContextToolbar("quickblock",{predicate:function(t){function e(t){return t.dom===o.getBody()}var n=S.fromDom(t),r=o.schema.getTextBlockElements();return E(N,O,n,"table",e).fold(function(){return E(function(t,e){return e(t)},C,n,function(t){return t.dom.nodeName.toLowerCase()in r&&o.dom.isEmpty(t.dom)},e).isSome()},p)},items:e,position:"line",scope:"editor"}),function(e){function n(t){return"IMG"===t.nodeName||"FIGURE"===t.nodeName&&/image/i.test(t.className)}var t=x(e,"quickbars_image_toolbar","alignleft aligncenter alignright");0<t.trim().length&&e.ui.registry.addContextToolbar("imageselection",{predicate:n,items:t,position:"node"});var r=x(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote");0<r.trim().length&&e.ui.registry.addContextToolbar("textselection",{predicate:function(t){return!n(t)&&!e.selection.isCollapsed()&&"false"!==e.dom.getContentEditableParent(t)},items:r,position:"selection",scope:"editor"})}(t)})}();
/trunk/vendor/tinymce/tinymce/plugins/save/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/save/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function o(e){return e.getParam("save_enablewhendirty",!0)}function a(e,n){e.notificationManager.open({text:n,type:"error"})}function t(t){t.addCommand("mceSave",function(){!function(e){var n=c.DOM.getParent(e.id,"form");if(!o(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():a(e,"Error: Form submit field collision.")),e.nodeChanged()):a(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e=t,n=r.trim(e.startContent);e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})}function i(t){return function(e){function n(){e.setDisabled(o(t)&&!t.isDirty())}return n(),t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),r=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:i(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:i(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}();
/trunk/vendor/tinymce/tinymce/plugins/searchreplace/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/searchreplace/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function g(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function p(){}function i(e){return function(){return e}}function n(e){return e}function r(){return m}var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},a=e("string"),c=e("array"),u=t("boolean"),l=t("number"),s=i(!1),f=i(!0),d=i("[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]"),m={fold:function(e,t){return e()},isSome:s,isNone:f,getOr:n,getOrThunk:h,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:h,map:r,each:p,bind:r,exists:s,forall:f,filter:function(){return m},toArray:function(){return[]},toString:i("none()")};function h(e){return e()}function y(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}function x(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function b(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}function w(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);A.apply(t,e[n])}return t}(y(e,t))}function O(e,t){return D.call(e,t)}var C=function(n){function e(){return o}function t(e){return e(n)}var r=i(n),o={fold:function(e,t){return t(n)},isSome:f,isNone:s,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return C(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:m},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:C,none:r,from:function(e){return null==e?m:C(e)}},E=d,N=tinymce.util.Tools.resolve("tinymce.Env"),k=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=Array.prototype.slice,A=Array.prototype.push,D=Object.hasOwnProperty;function M(e,t,n){!function(e,t,n){if(!(a(n)||u(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}function B(e,t){return{element:e,offset:t}}function F(e,t){var n,r;n=e,r=t,T.from(n.dom.parentNode).map(fe.fromDom).each(function(e){e.dom.insertBefore(r.dom,n.dom)}),t.dom.appendChild(e.dom)}function I(e){return de.get(e)}function P(e,t){return e.isBlock(t)||O(e.schema.getShortEndedElements(),t.nodeName)}function R(e,t){return"false"===e.getContentEditable(t)}function W(e,t){return!e.isBlock(t)&&O(e.schema.getWhiteSpaceElements(),t.nodeName)}function j(){return{sOffset:0,fOffset:0,elements:[]}}function V(e,t){return n=fe.fromDom(e),r=t,0<(o=y(n.dom.childNodes,fe.fromDom)).length&&r<o.length?B(o[r],0):B(n,r);var n,r,o}function H(e,t,n,r,o,i){for(var a=(i=void 0===i||i)?t(!1):n;a;){var c=R(e,a);if(c||W(e,a)){if(c?r.cef(a):r.boundary(a))break;a=t(!0)}else{if(P(e,a)){if(r.boundary(a))break}else 3===a.nodeType&&r.text(a);if(a===o)break;a=t(!1)}}}function L(e,t,n,r,o){var i,a,c,u,l,s;P(i=e,a=n)||R(i,a)||W(i,a)||"true"===(c=i).getContentEditable(u=a)&&"false"===c.getContentEditableParent(u.parentNode)||(l=e.getParent(r,e.isBlock),s=new me(n,l),H(e,(o?s.next:s.prev).bind(s),n,{boundary:f,cef:f,text:function(e){o?t.fOffset+=e.length:t.sOffset+=e.length,t.elements.push(fe.fromDom(e))}}))}function U(e,t,n,r,o,i){void 0===i&&(i=!0);var a=new me(n,t),c=[],u=j();function l(){return 0<u.elements.length&&(c.push(u),u=j()),!1}return L(e,u,n,t,!1),H(e,a.next.bind(a),n,{boundary:l,cef:function(e){return l(),o&&c.push.apply(c,o.cef(e)),!1},text:function(e){u.elements.push(fe.fromDom(e)),o&&o.text(e,u)}},r,i),r&&L(e,u,r,t,!0),l(),c}function $(u,e){var n=V(e.startContainer,e.startOffset),r=n.element.dom,o=V(e.endContainer,e.endOffset),i=o.element.dom;return U(u,e.commonAncestorContainer,r,i,{text:function(e,t){e===i?t.fOffset+=e.length-o.offset:e===r&&(t.sOffset+=n.offset)},cef:function(e){var t,n,r,o,i,a=w((n=fe.fromDom(e),r="*[contenteditable=true]",1!==(o=i=void 0===n?document:n.dom).nodeType&&9!==o.nodeType&&11!==o.nodeType||0===o.childElementCount?[]:y(i.querySelectorAll(r),fe.fromDom)),function(e){var t=e.dom;return U(u,t,t)}),c=function(e,t){return n=e.elements[0].dom,r=t.elements[0].dom,o=Node.DOCUMENT_POSITION_PRECEDING,0!=(n.compareDocumentPosition(r)&o)?1:-1;var n,r,o};return(t=S.call(a,0)).sort(c),t}},!1)}function _(e,t){return t.collapsed?[]:$(e,t)}function z(e,t){var n=e.createRng();return n.selectNode(t),_(e,n)}function q(c,e){return w(e,function(e){var a,n,r,t=e.elements,o=y(t,I).join(""),i=function(e,t,n,r){void 0===r&&(r=e.length);var o=t.regex;o.lastIndex=n=void 0===n?0:n;for(var i,a=[];i=o.exec(e);){var c=i[t.matchIndex],u=i.index+i[0].indexOf(c),l=u+c.length;if(r<l)break;a.push({start:u,finish:l}),o.lastIndex=l}return a}(o,c,e.sOffset,o.length-e.fOffset);return a=i,function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var c=e[i],u=t(c);u!==n&&(r.push(o),o=[]),n=u,o.push(c)}return 0!==o.length&&r.push(o),r}((n=function(e,n){var t=I(n),r=e.last,o=r+t.length,i=w(a,function(e,t){return e.start<o&&e.finish>r?[{element:n,start:Math.max(r,e.start)-r,finish:Math.min(o,e.finish)-r,matchId:t}]:[]});return{results:e.results.concat(i),last:o}},r={results:[],last:0},x(t,function(e,t){r=n(r,e)}),r.results),function(e){return e.matchId})})}function G(e,i){b(e,function(e,o){b(e,function(e){var t=fe.fromDom(i.cloneNode(!1));M(t,"data-mce-index",o);var n,r=e.element.dom;r.length===e.finish&&0===e.start?F(e.element,t):(r.length!==e.finish&&r.splitText(e.finish),n=r.splitText(e.start),F(fe.fromDom(n),t))})})}function K(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function J(e,t,n,r){var o=e.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i,a,c,u,l,s,f,d,m,h,g=e.getBody();return he(e,t,!1),r?(c=e.dom,u=n,l=e.selection,s=o,d=l.getBookmark(),m=c.select("td[data-mce-selected],th[data-mce-selected]"),G(h=q(u,0<m.length?(f=c,w(m,function(e){return z(f,e)})):_(c,l.getRng())),s),l.moveToBookmark(d),h.length):(i=o,G(a=q(n,z(e.dom,g)),i),a.length)}function Q(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function X(e,t){var n=[],r=k.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=K(r[o]);null!==i&&i.length&&i===t.toString()&&n.push(r[o])}return n}function Y(e,t,n){var r=t.get(),o=r.index,i=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(X(e,r.index),"mce-match-marker-selected");var a=X(e,o);return a.length?(i.addClass(X(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(a[0]),o):-1}function Z(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)}function ee(e,t,n,r,o,i){var a,c,u,l=e.selection,s=(a=o,c="("+n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")",a?"(?:^|\\s|"+E()+")"+c+"(?=$|\\s|"+E()+")":c),f=l.isForward(),d=J(e,t,{regex:new RegExp(s,r?"g":"gi"),matchIndex:1},i);return N.browser.isSafari()&&l.setRng(l.getRng(),f),d&&(u=Y(e,t,!0),t.set({index:u,count:d,text:n,matchCase:r,wholeWord:o,inSelection:i})),d}function te(e,t){var n=Y(e,t,!0);t.set(v(v({},t.get()),{index:n}))}function ne(e,t){var n=Y(e,t,!1);t.set(v(v({},t.get()),{index:n}))}function re(e){var t=K(e);return null!==t&&0<t.length}function oe(e,t,n,r,o){var i,a=t.get(),c=a.index,u=c;r=!1!==r;for(var l=e.getBody(),s=k.grep(k.toArray(l.getElementsByTagName("span")),re),f=0;f<s.length;f++){var d=K(s[f]),m=i=parseInt(d,10);if(o||m===a.index){for(n.length?(s[f].firstChild.nodeValue=n,Q(s[f])):Z(e.dom,s[f]);s[++f];){if((m=parseInt(K(s[f]),10))!==i){f--;break}Z(e.dom,s[f])}r&&u--}else c<i&&s[f].setAttribute("data-mce-index",String(i-1))}return t.set(v(v({},a),{count:o?0:a.count-1,index:u})),(r?te:ne)(e,t),!o&&0<t.get().count}function ie(i,a){var e,t,n,r=(e=p,t=g(T.none()),v(v({},n={clear:function(){o(),t.set(T.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){o(),t.set(T.some(e))}}),{on:function(e){return n.get().each(e)}}));function o(){return t.get().each(e)}function c(e){(1<a.get().count?e.enable:e.disable)("next"),(1<a.get().count?e.enable:e.disable)("prev")}function u(e,t){x(["replace","replaceall","prev","next"],t?e.disable:e.enable)}function l(e,t){N.browser.isSafari()&&N.deviceType.isTouch()&&("find"===t||"replace"===t||"replaceall"===t)&&e.focus(t)}function s(e){he(i,a,!1),u(e,!0),c(e)}function f(e){var t,n,r=e.getData(),o=a.get();r.findtext.length?(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords?te(i,a):((t=ee(i,a,r.findtext,r.matchcase,r.wholewords,r.inselection))<=0&&(n=e,i.windowManager.alert("Could not find the specified string.",function(){n.focus("findtext")})),u(e,0===t)),c(e)):s(e)}i.undoManager.add();var d=k.trim(i.selection.getContent({format:"text"})),m=a.get(),h={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:d,replacetext:"",wholewords:m.wholeWord,matchcase:m.matchCase,inselection:m.inSelection},onChange:function(e,t){"findtext"===t.name&&0<a.get().count&&s(e)},onAction:function(e,t){var n,r,o=e.getData();switch(t.name){case"find":f(e);break;case"replace":(oe(i,a,o.replacetext)?c:s)(e);break;case"replaceall":oe(i,a,o.replacetext,!0,!0),s(e);break;case"prev":ne(i,a),c(e);break;case"next":te(i,a),c(e);break;case"matchcase":case"wholewords":case"inselection":n=e.getData(),r=a.get(),a.set(v(v({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection})),s(e)}l(e,t.name)},onSubmit:function(e){f(e),l(e,"find")},onClose:function(){i.focus(),he(i,a),i.undoManager.add()}};r.set(i.windowManager.open(h,{inline:"toolbar"}))}function ae(e,t){return function(){ie(e,t)}}"undefined"!=typeof window||Function("return this;")();function ce(e){return 3===e.dom.nodeType}function ue(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var le,se,fe={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ue(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return ue(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return ue(n)},fromDom:ue,fromPoint:function(e,t,n){return T.from(e.dom.elementFromPoint(t,n)).map(ue)}},de=(le=ce,{get:function(e){if(!le(e))throw new Error("Can only get text value of a text node");return se(e).getOr("")},getOption:se=function(e){return le(e)?T.from(e.dom.nodeValue):T.none()},set:function(e,t){if(!le(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=t}}),me=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),he=function(e,t,n){for(var r,o,i=t.get(),a=k.toArray(e.getBody().getElementsByTagName("span")),c=0;c<a.length;c++){var u=K(a[c]);null!==u&&u.length&&(u===i.index.toString()&&(r=r||a[c].firstChild,o=a[c].firstChild),Q(a[c]))}if(t.set(v(v({},i),{index:-1,count:0,text:""})),r&&o){var l=e.dom.createRng();return l.setStart(r,0),l.setEnd(o,o.data.length),!1!==n&&e.selection.setRng(l),l}};o.add("searchreplace",function(e){var t,n,r,o,i,a=g({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1}),c=a;return(t=e).addCommand("SearchReplace",function(){ie(t,c)}),(n=e).ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:ae(n,r=a),icon:"search"}),n.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:ae(n,r),icon:"search"}),n.shortcuts.add("Meta+F","",ae(n,r)),o=e,i=a,{done:function(e){return he(o,i,e)},find:function(e,t,n,r){return ee(o,i,e,t,n,r=void 0!==r&&r)},next:function(){return te(o,i)},prev:function(){return ne(o,i)},replace:function(e,t,n){return oe(o,i,e,t,n)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/spellchecker/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/spellchecker/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function C(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function u(e){return e.getParam("spellchecker_rpc_url")}function E(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)}function p(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function r(i,r){function o(e){var t=i.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],a=o.getAttribute("data-mce-index");null!==a&&a.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(a!==e&&null!==e||n.push(o))}return n}function a(e){for(var t=c.length;t--;)if(c[t]===e)return t;return-1}var n,c=[],v=r.dom,f=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),g=r.schema.getShortEndedElements(),s=function(e){if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!f[e.nodeName])return"";if(p(e))return"\n";var t="";if((f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=s(e),e=e.nextSibling;);return t};function e(e){for(var t=0,n=c.length;t<n&&!1!==e(c[t],t);t++);return this}function t(e){for(var t=o(e?a(e):null),n=t.length;n--;)!function(e){for(var t=e.parentNode;0<e.childNodes.length;)t.insertBefore(e.childNodes[0],e);t.removeChild(e)}(t[n]);return this}function l(e){var t=o(a(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}var u=s(i);return{text:u,matches:c,each:e,filter:function(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),c=r,this},reset:function(){return c.splice(0,c.length),t(),this},matchFromElement:function(e){return c[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return o(a(e))[0]},find:function(e,t){if(u&&e.global)for(;n=e.exec(u);)c.push(function(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}(n,t));return this},add:function(e,t,n){return c.push({start:e,end:e+t,text:u.substr(e,t),data:n}),this},wrap:function(e){return c.length&&function(e,t,n){var r,o,a,i,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((f[u.nodeName]||g[u.nodeName]||p(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,i=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,a=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-i,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!f[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!p(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(i,c,(o=e,function(e){var t=e.startNode,n=e.endNode,r=e.matchIndex,o=v.doc;if(t===n){var a=t,i=a.parentNode;0<e.startNodeIndex&&(s=o.createTextNode(a.data.substring(0,e.startNodeIndex)),i.insertBefore(s,a));var c=m(e.match,r);return i.insertBefore(c,a),e.endNodeIndex<a.length&&(l=o.createTextNode(a.data.substring(e.endNodeIndex)),i.insertBefore(l,a)),a.parentNode.removeChild(a),c}for(var s=o.createTextNode(t.data.substring(0,e.startNodeIndex)),l=o.createTextNode(n.data.substring(e.endNodeIndex)),u=m(t.data.substring(e.startNodeIndex),r),d=0,f=e.innerNodes.length;d<f;++d){var h=e.innerNodes[d],g=m(h.data,r);h.parentNode.replaceChild(g,h)}var p=m(n.data.substring(0,e.endNodeIndex),r);return(i=t.parentNode).insertBefore(s,t),i.insertBefore(u,t),i.removeChild(t),(i=n.parentNode).insertBefore(p,n),i.insertBefore(l,n),i.removeChild(n),p})),this;function m(e,t){var n=c[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",""+t),e&&r.appendChild(v.doc.createTextNode(e)),r}var o},unwrap:t,replace:function(e,t){var n=l(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:l,indexOf:a}}function l(e,t){var n;return t.get()||(n=r(e.getBody(),e),t.set(n)),t.get()}function k(e,t,n,r,o,a,i){var c,s,l;(e.getParam("spellchecker_callback")||(c=e,s=t,l=n,function(e,t,r,o){var n={method:e,lang:l.get()},a="";n["addToDictionary"===e?"word":"text"]=t,M.each(n,function(e,t){a&&(a+="&"),a+=t+"="+encodeURIComponent(e)}),h.send({url:new f(s).toAbsolute(u(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:a,success:function(e){var t,n=JSON.parse(e);n?n.error?o(n.error):r(n):(t=c.translate("Server response wasn't proper JSON."),o(t))},error:function(){var e=c.translate("The spelling service was not found: (")+u(c)+c.translate(")");o(e)}})})).call(e.plugins.spellchecker,r,o,a,i)}function R(t,e,n,r,o,a){i(t,n,r)||(t.setProgressState(!0),k(t,e,a,"spellcheck",l(t,r).text,function(e){O(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),i(t,n,r)}),t.focus())}function y(e,t,n){e.dom.select("span.mce-spellchecker-word").length||i(e,t,n)}function S(t,e,n,r,o,a){t.selection.collapse(),a?M.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),y(t,e,n)}function b(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function _(g,p,m,v,x,N){g.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var c,s,n,l,u,d,f,h,r,o,a=function(e,t){var n=[],r=M.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var a=b(r[o]);null!==a&&a.length&&a===t.toString()&&n.push(r[o])}return n}(g,b(t));if(0<a.length){var i=g.dom.createRng();return i.setStartBefore(a[0]),i.setEndAfter(a[a.length-1]),g.selection.setRng(i),c=g,s=p,n=m,l=v,u=x,d=N,f=t.getAttribute("data-mce-word"),h=a,r=[],o=n.get().suggestions[f],M.each(o,function(e){r.push({text:e,onAction:function(){c.insertContent(c.dom.encode(e)),c.dom.remove(h),y(c,l,u)}})}),n.get().hasDictionarySupport&&(r.push({type:"separator"}),r.push({text:"Add to dictionary",onAction:function(){var t,e=s,n=l,r=u,o=d,a=f,i=h;(t=c).setProgressState(!0),k(t,e,o,"addToDictionary",a,function(){t.setProgressState(!1),t.dom.remove(i,!0),y(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})}})),r.push.apply(r,[{type:"separator"},{text:"Ignore",onAction:function(){S(c,l,u,f,h)}},{text:"Ignore all",onAction:function(){S(c,l,u,f,h,!0)}}]),r}}})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=Object.hasOwnProperty,M=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.URI"),h=tinymce.util.Tools.resolve("tinymce.util.XHR"),i=function(e,t,n){var r=e.selection.getBookmark();if(l(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),e.fire("SpellcheckEnd"),!0},O=function(t,e,n,r,o){var a=!!o.dictionary,i=o.words;if(t.setProgressState(!1),function(e){for(var t in e)if(d.call(e,t))return;return 1}(i)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:i,hasDictionarySupport:a});var s=t.selection.getBookmark();l(t,n).find(E(t)).filter(function(e){return!!i[e.text]}).wrap(function(e){return t.dom.create("span",{class:"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),t.fire("SpellcheckStart")},D=function(){return(D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},F="SpellcheckStart SpellcheckEnd";e.add("spellchecker",function(e,t){if(0==(!!e.hasPlugin("tinymcespellchecker",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0))){var n=C(!1),r=C((I=(P=e).getParam("language","en"),P.getParam("spellchecker_language",I))),o=C(null),a=C(null);return c=e,s=t,l=n,u=o,d=r,f=a,h=M.map(c.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv").split(","),function(e){var t=e.split("=");return{name:t[0],value:t[1]}}),g=[],M.each(h,function(e){g.push({selectable:!0,text:e.name,data:e.value})}),p=g,v=D(D({},m={tooltip:"Spellcheck",onAction:i,icon:"spell-check",onSetup:function(e){function t(){e.setActive(l.get())}return c.on(F,t),function(){c.off(F,t)}}}),{type:"splitbutton",select:function(e){return e===d.get()},fetch:function(e){e(M.map(p,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){d.set(t)}}),1<p.length?c.ui.registry.addSplitButton("spellchecker",v):c.ui.registry.addToggleButton("spellchecker",m),c.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(e){function t(){e.setActive(l.get())}return e.setActive(l.get()),c.on(F,t),function(){c.off(F,t)}},onAction:i}),_(e,t,a,n,o,r),b=t,w=n,T=o,A=a,B=r,(S=e).addCommand("mceSpellCheck",function(){R(S,b,w,T,A,B)}),x=e,N=n,k=a,{getTextMatcher:(y=o).get,getWordCharPattern:function(){return E(x)},markErrors:function(e){O(x,N,y,k,e)},getLanguage:r.get}}function i(){R(c,s,l,u,f,d)}var c,s,l,u,d,f,h,g,p,m,v,x,N,k,y,S,b,w,T,A,B,P,I})}();
/trunk/vendor/tinymce/tinymce/plugins/tabfocus/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/tabfocus/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function n(e){e.keyCode!==y.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=tinymce.util.Tools.resolve("tinymce.util.VK"),d=t.DOM;e.add("tabfocus",function(e){function t(l){var r,e,t,n,i;l.keyCode!==y.TAB||l.ctrlKey||l.altKey||l.metaKey||l.isDefaultPrevented()||(e=function(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(l.id)&&-1!==e.tabIndex&&i(e)}var n=d.select(":input:enabled,*[tabindex]:not(iframe)"),i=function(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&i(e.parentNode)};if(c.each(n,function(e,t){if(e.id===u.id)return r=t,!1}),0<e){for(var o=r+1;o<n.length;o++)if(t(n[o]))return n[o]}else for(o=r-1;0<=o;o--)if(t(n[o]))return n[o];return null},1===(t=c.explode(u.getParam("tab_focus",u.getParam("tabfocus_elements",":prev,:next")))).length&&(t[1]=t[0],t[0]=":prev"),(n=l.shiftKey?":prev"===t[0]?e(-1):d.get(t[0]):":next"===t[1]?e(1):d.get(t[1]))&&(i=s.get(n.id||n.name),n.id&&i?i.focus():a.setTimeout(function(){o.webkit||window.focus(),n.focus()},10),l.preventDefault()))}var u;(u=e).on("init",function(){u.inline&&d.setAttrib(u.getBody(),"tabIndex",null),u.on("keyup",n),o.gecko?u.on("keypress keydown",t):u.on("keydown",t)})})}();
/trunk/vendor/tinymce/tinymce/plugins/table/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/table/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function e(r){return function(e){return t=typeof(n=e),(null===n?"null":"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t)===r;var n,t}}function n(n){return function(e){return typeof e===n}}function t(n){return function(e){return n===e}}function l(e){return!(null==e)}function E(){}function C(e){return function(){return e}}function S(e){return e}function r(e,n){return e===n}var T=e("string"),g=e("object"),a=e("array"),h=t(null),o=n("boolean"),u=t(void 0),c=n("function"),f=n("number");function P(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=o.concat(e);return r.apply(null,t)}}function p(n){return function(e){return!n(e)}}function i(){return s}var v=C(!1),x=C(!0),s={fold:function(e,n){return e()},isSome:v,isNone:x,getOr:S,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:C(null),getOrUndefined:C(void 0),or:S,orThunk:m,map:i,each:E,bind:i,exists:v,forall:x,filter:function(){return s},toArray:function(){return[]},toString:C("none()")};function m(e){return e()}function y(e,n){return-1<G.call(e,n)}function R(e,n){for(var t=0,r=e.length;t<r;t++)if(n(e[t],t))return!0;return!1}function D(e,n){for(var t=[],r=0;r<e;r++)t.push(n(r));return t}function O(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var u=e[o];r[o]=n(u,o)}return r}function A(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t)}function d(e,n){for(var t=[],r=[],o=0,u=e.length;o<u;o++){var i=e[o];(n(i,o)?t:r).push(i)}return{pass:t,fail:r}}function k(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var u=e[r];n(u,r)&&t.push(u)}return t}function I(e,r,o){return function(e){for(var n,t=e.length-1;0<=t;t--)n=e[t],o=r(o,n,t)}(e),o}function B(e,t,r){return A(e,function(e,n){r=t(r,e,n)}),r}function w(e,n){return function(e,n,t){for(var r=0,o=e.length;r<o;r++){var u=e[r];if(n(u,r))return q.some(u);if(t(u,r))break}return q.none()}(e,n,v)}function b(e,n){for(var t=0,r=e.length;t<r;t++)if(n(e[t],t))return q.some(t);return q.none()}function M(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!a(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);$.apply(n,e[t])}return n}function N(e,n){return M(O(e,n))}function z(e,n){for(var t=0,r=e.length;t<r;++t)if(!0!==n(e[t],t))return!1;return!0}function L(e,n){for(var t={},r=0,o=e.length;r<o;r++){var u=e[r];t[String(u)]=n(u,r)}return t}function _(e){return[e]}function W(e,n){return 0<=n&&n<e.length?q.some(e[n]):q.none()}function j(e){return W(e,0)}function F(e){return W(e,e.length-1)}function H(e,n){for(var t=0;t<e.length;t++){var r=n(e[t],t);if(r.isSome())return r}return q.none()}var V=function(t){function e(){return o}function n(e){return e(t)}var r=C(t),o={fold:function(e,n){return n(t)},isSome:x,isNone:v,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return V(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:s},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},q={some:V,none:i,from:function(e){return null==e?s:V(e)}},U=Array.prototype.slice,G=Array.prototype.indexOf,$=Array.prototype.push,K=function(){return(K=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function X(e,n,t){if(t||2===arguments.length)for(var r,o=0,u=n.length;o<u;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function Y(t){var r,o=!1;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o||(o=!0,r=t.apply(null,e)),r}}function J(e,n){var t=String(n).toLowerCase();return w(e,function(e){return e.search(t)})}function Q(e,n,t){return""===n||e.length>=n.length&&e.substr(t,t+n.length)===n}function Z(e,n){return-1!==e.indexOf(n)}function ee(e,n){return Q(e,n,e.length-n.length)}function ne(e){return 0<e.length}function te(n){return function(e){return Z(e,n)}}function re(e){return window.matchMedia(e).matches}function oe(e,n){var t=e.dom;if(1!==t.nodeType)return!1;var r=t;if(void 0!==r.matches)return r.matches(n);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(n);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(n);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function ue(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount}function ie(e,n){var t=void 0===n?document:n.dom;return ue(t)?q.none():q.from(t.querySelector(e)).map(Ve.fromDom)}function ce(e,n){return e.dom===n.dom}function le(e,n){return He().browser.isIE()?(t=e.dom,r=n.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(t.compareDocumentPosition(r)&o)):(u=e.dom)!==(i=n.dom)&&u.contains(i);var t,r,o,u,i}function ae(e,n){for(var t=Ue(e),r=0,o=t.length;r<o;r++){var u=t[r];n(e[u],u)}}function fe(e,t){return $e(e,function(e,n){return{k:n,v:t(e,n)}})}function se(e,n){var t={},r=n,o=t,u=function(e,n){o[n]=e},i=E;return ae(e,function(e,n){(r(e,n)?u:i)(e,n)}),t}function me(e,t){var r=[];return ae(e,function(e,n){r.push(t(e,n))}),r}function de(e){return me(e,S)}function ge(e){return Ue(e).length}function pe(e,n){return Ke(e,n)?q.from(e[n]):q.none()}function be(e,n){return Ke(e,n)&&void 0!==e[n]&&null!==e[n]}function he(e,n,t){return{element:e,rowspan:n,colspan:t}}function ve(e,n,t){return{element:e,cells:n,section:t}}function we(e,n,t){return{element:e,isNew:n,isLocked:t}}function ye(e,n,t,r){return{element:e,cells:n,section:t,isNew:r}}function Ce(){return De(0,0)}function Se(e){function n(e){return function(){return t===e}}var t=e.current,r=e.version;return{current:t,version:r,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(Me),isSafari:n("Safari")}}function Te(e){function n(e){return function(){return t===e}}var t=e.current,r=e.version;return{current:t,version:r,isWindows:n(Ne),isiOS:n("iOS"),isAndroid:n(ze),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(Le),isFreeBSD:n(_e),isChromeOS:n(We)}}function xe(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var Re,De=function(e,n){return{major:e,minor:n}},Oe={nu:De,detect:function(e,n){var t,r,o=String(n).toLowerCase();return 0===e.length?Ce():(r=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}}(e,t=o))?De(u(1),u(2)):{major:0,minor:0};function u(e){return Number(t.replace(r,"$"+e))}},unknown:Ce},Ae=function(e,n){return Q(e,n,0)},ke=(Re=/^\s+|\s+$/g,function(e){return e.replace(Re,"")}),Ie=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Be={browsers:C([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Z(e,"edge/")&&Z(e,"chrome")&&Z(e,"safari")&&Z(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ie],search:function(e){return Z(e,"chrome")&&!Z(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Z(e,"msie")||Z(e,"trident")}},{name:"Opera",versionRegexes:[Ie,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:te("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:te("firefox")},{name:"Safari",versionRegexes:[Ie,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Z(e,"safari")||Z(e,"mobile/"))&&Z(e,"applewebkit")}}]),oses:C([{name:"Windows",search:te("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Z(e,"iphone")||Z(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:te("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:te("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:te("linux"),versionRegexes:[]},{name:"Solaris",search:te("sunos"),versionRegexes:[]},{name:"FreeBSD",search:te("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:te("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},Me="Firefox",Ee=function(){return Se({current:void 0,version:Oe.unknown()})},Pe=Se,Ne=(C("Edge"),C("Chrome"),C("IE"),C("Opera"),C(Me),C("Safari"),"Windows"),ze="Android",Le="Solaris",_e="FreeBSD",We="ChromeOS",je=function(){return Te({current:void 0,version:Oe.unknown()})},Fe=Te,He=(C(Ne),C("iOS"),C(ze),C("Linux"),C("OSX"),C(Le),C(_e),C(We),Y(function(){return e=navigator.userAgent,n=q.from(navigator.userAgentData),t=re,p=Be.browsers(),b=Be.oses(),h=n.bind(function(e){return r=p,H(e.brands,function(n){var t=n.brand.toLowerCase();return w(r,function(e){var n;return t===(null===(n=e.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(e){return{current:e.name,version:Oe.nu(parseInt(n.version,10),0)}})});var r}).orThunk(function(){return J(p,t=e).map(function(e){var n=Oe.detect(e.versionRegexes,t);return{current:e.name,version:n}});var t}).fold(Ee,Pe),v=J(b,r=e).map(function(e){var n=Oe.detect(e.versionRegexes,r);return{current:e.name,version:n}}).fold(je,Fe),{browser:h,os:v,deviceType:(u=h,i=e,c=t,l=(o=v).isiOS()&&!0===/ipad/i.test(i),a=o.isiOS()&&!l,s=(f=o.isiOS()||o.isAndroid())||c("(pointer:coarse)"),m=l||!a&&f&&c("(min-device-width:768px)"),d=a||f&&!m,g=u.isSafari()&&o.isiOS()&&!1===/safari/i.test(i),{isiPad:C(l),isiPhone:C(a),isTablet:C(m),isPhone:C(d),isTouch:C(s),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:C(g),isDesktop:C(!d&&!m&&!g)})};var e,n,t,r,o,u,i,c,l,a,f,s,m,d,g,p,b,h,v})),Ve={fromHtml:function(e,n){var t=(n||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return xe(t.childNodes[0])},fromTag:function(e,n){var t=(n||document).createElement(e);return xe(t)},fromText:function(e,n){var t=(n||document).createTextNode(e);return xe(t)},fromDom:xe,fromPoint:function(e,n,t){return q.from(e.dom.elementFromPoint(n,t)).map(xe)}},qe=oe,Ue=Object.keys,Ge=Object.hasOwnProperty,$e=function(e,r){var o={};return ae(e,function(e,n){var t=r(e,n);o[t.k]=t.v}),o},Ke=function(e,n){return Ge.call(e,n)},Xe=["tfoot","thead","tbody","colgroup"];function Ye(e){return e.dom.nodeName.toLowerCase()}function Je(e){return e.dom.nodeType}function Qe(n){return function(e){return Je(e)===n}}function Ze(e){return 8===Je(e)||"#comment"===Ye(e)}function en(n){return function(e){return gn(e)&&Ye(e)===n}}function nn(e){return Ve.fromDom(e.dom.ownerDocument)}function tn(e){return bn(e)?e:nn(e)}function rn(e){return q.from(e.dom.parentNode).map(Ve.fromDom)}function on(e,n){for(var t=c(n)?n:v,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var u=r.parentNode,i=Ve.fromDom(u);if(o.push(i),!0===t(i))break;r=u}return o}function un(e){return q.from(e.dom.previousSibling).map(Ve.fromDom)}function cn(e){return q.from(e.dom.nextSibling).map(Ve.fromDom)}function ln(e){return O(e.dom.childNodes,Ve.fromDom)}function an(e,n){var t=e.dom.childNodes;return q.from(t[n]).map(Ve.fromDom)}function fn(e){return Ve.fromDom(e.dom.host)}function sn(e,n,t){return r=function(e){return oe(e,n)},k(on(e,t),r);var r}function mn(e,n){return t=function(e){return oe(e,n)},k(ln(e),t);var t}function dn(e,n){return ue(t=void 0===e?document:e.dom)?[]:O(t.querySelectorAll(n),Ve.fromDom);var t}"undefined"!=typeof window||Function("return this;")();var gn=Qe(1),pn=Qe(3),bn=Qe(9),hn=Qe(11),vn=c(Element.prototype.attachShadow)&&c(Node.prototype.getRootNode),wn=C(vn),yn=vn?function(e){return Ve.fromDom(e.dom.getRootNode())}:tn,Cn=function(e){return l(e.dom.shadowRoot)},Sn=function(e){var n=pn(e)?e.dom.parentNode:e.dom;if(null==n||null===n.ownerDocument)return!1;var t,r,o,u,i,c=n.ownerDocument;return o=Ve.fromDom(n),i=yn(o),(hn(u=i)&&l(u.dom.host)?q.some(i):q.none()).fold(function(){return c.body.contains(n)},(t=Sn,r=fn,function(e){return t(r(e))}))},Tn=function(e){var n=e.dom.body;if(null==n)throw new Error("Body is not available yet");return Ve.fromDom(n)},xn=function(e,n){var t=[];return A(ln(e),function(e){t=(t=n(e)?t.concat([e]):t).concat(xn(e,n))}),t};function Rn(e,n,t,r,o){return e(t,r)?q.some(t):c(o)&&o(t)?q.none():n(t,r,o)}function Dn(e,n,t){for(var r=e.dom,o=c(t)?t:v;r.parentNode;){var r=r.parentNode,u=Ve.fromDom(r);if(n(u))return q.some(u);if(o(u))break}return q.none()}function On(e,n,t){return Dn(e,function(e){return oe(e,n)},t)}function An(e,n){return t=function(e){return oe(e,n)},w(e.dom.childNodes,function(e){return t(Ve.fromDom(e))}).map(Ve.fromDom);var t}function kn(e,n){return ie(n,e)}function In(e,n,t){return Rn(oe,On,e,n,t)}function Bn(e,n,t){if(!(T(t)||o(t)||f(t)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}function Mn(e,n,t){Bn(e.dom,n,t)}function En(e,n){var t=e.dom;ae(n,function(e,n){Bn(t,n,e)})}function Pn(e,n){var t=e.dom.getAttribute(n);return null===t?void 0:t}function Nn(e,n){return q.from(Pn(e,n))}function zn(e){return B(e.dom.attributes,function(e,n){return e[n.name]=n.value,e},{})}function Ln(e,n,t){return void 0===t&&(t=r),e.exists(function(e){return t(e,n)})}function _n(e){for(var n=[],t=function(e){n.push(e)},r=0;r<e.length;r++)e[r].each(t);return n}function Wn(e,n,t){return e.isSome()&&n.isSome()?q.some(t(e.getOrDie(),n.getOrDie())):q.none()}function jn(e,n){return e?q.some(n):q.none()}function Fn(e){return void 0!==e.style&&c(e.style.getPropertyValue)}function Hn(e,n,t){if(!T(t))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);Fn(e)&&e.style.setProperty(n,t)}function Vn(e,n,t){Hn(e.dom,n,t)}function qn(e,n){var t=e.dom;ae(n,function(e,n){Hn(t,n,e)})}function Un(e,n){var t=e.dom,r=window.getComputedStyle(t).getPropertyValue(n);return""!==r||Sn(e)?r:jt(t,n)}function Gn(e,n){var t=e.dom,r=jt(t,n);return q.from(r).filter(function(e){return 0<e.length})}function $n(e,n){var t,r=n;Fn(t=e.dom)&&t.style.removeProperty(r),Ln(Nn(e,"style").map(ke),"")&&Wt(e,"style")}function Kn(e,n,t){return void 0===t&&(t=0),Nn(e,n).map(function(e){return parseInt(e,10)}).getOr(t)}function Xn(e,n){return Kn(e,n,1)}function Yn(e){return en("col")(e)?1<Kn(e,"span",1):1<Xn(e,"colspan")}function Jn(e){return 1<Xn(e,"rowspan")}function Qn(e,n){return parseInt(Un(e,n),10)}function Zn(e,n){return Vt(e,n,x)}function et(e,n){return t=["td","th"],(o=void 0===(o=n)?v:n)(r=e)?q.none():y(t,Ye(r))?q.some(r):On(r,t.join(","),function(e){return oe(e,"table")||o(e)});var t,r,o}function nt(e){return Zn(e,"th,td")}function tt(e){return oe(e,"colgroup")?mn(e,"col"):N(qt(e),function(e){return mn(e,"col")})}function rt(e,n){return In(e,"table",n)}function ot(e){return Zn(e,"tr")}function ut(e,t){return O(e,function(e){if("colgroup"!==Ye(e))return ve(e,n=O(nt(e),function(e){return he(e,Kn(e,"rowspan",1),Kn(e,"colspan",1))}),t(e));var n=O(tt(e),function(e){return he(e,1,Kn(e,"span",1))});return ve(e,n,"colgroup")})}function it(e){return rn(e).map(function(e){var n=Ye(e);return y(Xe,n)?n:"tbody"}).getOr("tbody")}function ct(e){var n=ot(e);return ut(X(X([],qt(e),!0),n,!0),it)}function lt(e,n,t){var r=e.cells,o=r.slice(0,n),u=r.slice(n),i=o.concat(t).concat(u);return Ut(e,i)}function at(e,n,t){return lt(e,n,[t])}function ft(e,n,t){e.cells[n]=t}function st(e,n){return e.cells[n]}function mt(e,n){return st(e,n).element}function dt(e){return e.cells.length}function gt(e){var n=d(e,function(e){return"colgroup"===e.section});return{rows:n.fail,cols:n.pass}}function pt(e,n,t){var r=O(e.cells,t);return ye(n(e.element),r,e.section,!0)}function bt(e){return Nn(e,Gt).bind(function(e){return q.from(e.match(/\d+/g))}).map(function(e){return L(e,x)})}function ht(e){var n,t=me(B(gt(e).rows,function(t,e){return A(e.cells,function(e,n){e.isLocked&&(t[n]=!0)}),t},{}),function(e,n){return parseInt(n,10)});return(n=U.call(t,0)).sort(void 0),n}function vt(e){var l={},n=[],a=j(e).map(function(e){return e.element}).bind(rt).bind(bt).getOr({}),t=0,f=0,s=0,r=d(e,function(e){return"colgroup"===e.section}),o=r.pass;A(r.fail,function(e){var c=[];A(e.cells,function(e){for(var n=0;void 0!==l[s+","+n];)n++;for(var t=be(a,n.toString()),r={element:e.element,rowspan:e.rowspan,colspan:e.colspan,row:s,column:n,isLocked:t},o=0;o<e.colspan;o++)for(var u=0;u<e.rowspan;u++){var i=n+o;l[s+u+","+i]=r,f=Math.max(f,i+1)}c.push(r)}),t++,n.push(ve(e.element,c,e.section)),s++});var u=F(o).map(function(e){var o,u,n=(o={},u=0,A(e.cells,function(t){var r=t.colspan;D(r,function(e){var n=u+e;o[n]={element:t.element,colspan:r,column:n}}),u+=r}),o);return{colgroups:[{element:e.element,columns:de(n)}],columns:n}}).getOrThunk(function(){return{colgroups:[],columns:{}}}),i=u.columns,c=u.colgroups;return{grid:{rows:t,columns:f},access:l,all:n,columns:i,colgroups:c}}function wt(e,n){var t=n.column,r=n.column+n.colspan-1,o=n.row,u=n.row+n.rowspan-1;return t<=e.finishCol&&r>=e.startCol&&o<=e.finishRow&&u>=e.startRow}function yt(e,n){return n.column>=e.startCol&&n.column+n.colspan-1<=e.finishCol&&n.row>=e.startRow&&n.row+n.rowspan-1<=e.finishRow}function Ct(e,n,t){var r=$t.findItem(e,n,ce),o=$t.findItem(e,t,ce);return r.bind(function(r){return o.map(function(e){return n=r,t=e,{startRow:Math.min(n.row,t.row),startCol:Math.min(n.column,t.column),finishRow:Math.max(n.row+n.rowspan-1,t.row+t.rowspan-1),finishCol:Math.max(n.column+n.colspan-1,t.column+t.colspan-1)};var n,t})})}function St(n,e,t){return Ct(n,e,t).map(function(e){return O($t.filterItems(n,P(wt,e)),function(e){return e.element})})}function Tt(e,n){return $t.findItem(e,n,function(e,n){return le(n,e)}).map(function(e){return e.element})}function xt(e,n,t,r,o){var u=Kt(e),i=ce(e,t)?q.some(n):Tt(u,n),c=ce(e,o)?q.some(r):Tt(u,r);return i.bind(function(n){return c.bind(function(e){return St(u,n,e)})})}function Rt(n,t){rn(n).each(function(e){e.dom.insertBefore(t.dom,n.dom)})}function Dt(e,n){cn(e).fold(function(){rn(e).each(function(e){Xt(e,n)})},function(e){Rt(e,n)})}function Ot(n,t){an(n,0).fold(function(){Xt(n,t)},function(e){n.dom.insertBefore(t.dom,e.dom)})}function At(e,n){Rt(e,n),Xt(n,e)}function kt(t,r){A(r,function(e,n){Dt(0===n?t:r[n-1],e)})}function It(n,e){A(e,function(e){Xt(n,e)})}function Bt(e){e.dom.textContent="",A(ln(e),function(e){Yt(e)})}function Mt(e){var n,t=ln(e);0<t.length&&(n=e,A(t,function(e){Rt(n,e)})),Yt(e)}function Et(e){return Jt.get(e)}function Pt(e){return Jt.getOption(e)}function Nt(e,n){return Jt.set(e,n)}function zt(e,n){return k(N(e.all,function(e){return e.cells}),n)}var Lt,_t,Wt=function(e,n){e.dom.removeAttribute(n)},jt=function(e,n){return Fn(e)?e.style.getPropertyValue(n):""},Ft=C(10),Ht=C(10),Vt=function(e,n,t){return N(ln(e),function(e){return oe(e,n)?t(e)?[e]:[]:Vt(e,n,t)})},qt=function(e){return rt(e).fold(C([]),function(e){return mn(e,"colgroup")})},Ut=function(e,n){return ye(e.element,n,e.section,e.isNew)},Gt="data-snooker-locked-cols",$t={fromTable:function(e){return vt(ct(e))},generate:vt,getAt:function(e,n,t){return q.from(e.access[n+","+t])},findItem:function(e,n,t){var r=zt(e,function(e){return t(n,e.element)});return 0<r.length?q.some(r[0]):q.none()},filterItems:zt,justCells:function(e){return N(e.all,function(e){return e.cells})},justColumns:function(e){return de(e.columns)},hasColumns:function(e){return 0<Ue(e.columns).length},getColumnAt:function(e,n){return q.from(e.columns[n])}},Kt=$t.fromTable,Xt=function(e,n){e.dom.appendChild(n.dom)},Yt=function(e){var n=e.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Jt=(Lt=pn,{get:function(e){if(!Lt(e))throw new Error("Can only get text value of a text node");return _t(e).getOr("")},getOption:_t=function(e){return Lt(e)?q.from(e.dom.nodeValue):q.none()},set:function(e,n){if(!Lt(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=n}}),Qt=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Zt(){return{up:C({selector:On,closest:In,predicate:Dn,all:on}),down:C({selector:dn,predicate:xn}),styles:C({get:Un,getRaw:Gn,set:Vn,remove:$n}),attrs:C({get:Pn,set:Mn,remove:Wt,copyTo:function(e,n){En(n,zn(e))}}),insert:C({before:Rt,after:Dt,afterAll:kt,append:Xt,appendAll:It,prepend:Ot,wrap:At}),remove:C({unwrap:Mt,remove:Yt}),create:C({nu:Ve.fromTag,clone:function(e){return Ve.fromDom(e.dom.cloneNode(!1))},text:Ve.fromText}),query:C({comparePosition:function(e,n){return e.dom.compareDocumentPosition(n.dom)},prevSibling:un,nextSibling:cn}),property:C({children:ln,name:Ye,parent:rn,document:function(e){return tn(e).dom},isText:pn,isComment:Ze,isElement:gn,isSpecial:function(e){return y(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],Ye(e))},getLanguage:function(e){return gn(e)?Nn(e,"lang"):q.none()},getText:Et,setText:Nt,isBoundary:function(e){return!!gn(e)&&("body"===Ye(e)||y(Qt,Ye(e)))},isEmptyTag:function(e){return!!gn(e)&&y(["br","img","hr","input"],Ye(e))},isNonEditable:function(e){return gn(e)&&"false"===Pn(e,"contenteditable")}}),eq:ce,is:qe}}function er(t,e){return Hr(qr,function(e,n){return t(n)},e)}function nr(e){return On(e,"table")}function tr(c,l,a){function f(n){return function(e){return void 0!==a&&a(e)||ce(e,n)}}return ce(c,l)?q.some({boxes:q.some([c]),start:c,finish:l}):nr(c).bind(function(i){return nr(l).bind(function(u){if(ce(i,u))return q.some({boxes:(r=c,o=l,St(Kt(i),r,o)),start:c,finish:l});if(le(i,u)){var e=0<(n=sn(l,"td,th",f(i))).length?n[n.length-1]:l;return q.some({boxes:xt(i,c,i,l,u),start:c,finish:e})}if(le(u,i)){var n,t=0<(n=sn(c,"td,th",f(u))).length?n[n.length-1]:c;return q.some({boxes:xt(u,c,i,l,u),start:c,finish:t})}return Vr(qr,c,l,void 0).shared.bind(function(e){return In(e,"table",a).bind(function(e){var n=sn(l,"td,th",f(e)),t=0<n.length?n[n.length-1]:l,r=sn(c,"td,th",f(e)),o=0<r.length?r[r.length-1]:c;return q.some({boxes:xt(e,c,i,l,u),start:o,finish:t})})});var r,o})})}function rr(e,n){var t=dn(e,n);return 0<t.length?q.some(t):q.none()}function or(e,n,r){return kn(e,n).bind(function(t){return kn(e,r).bind(function(n){return er(nr,[t,n]).map(function(e){return{first:t,last:n,table:e}})})})}function ur(e,r,o,u,n){return t=n,w(e,function(e){return oe(e,t)}).bind(function(e){return t=r,i=o,rt(n=e).bind(function(e){var r=Kt(e),o=t,u=i;return $t.findItem(r,n,ce).bind(function(e){var n=0<o?e.row+e.rowspan-1:e.row,t=0<u?e.column+e.colspan-1:e.column;return $t.getAt(r,n+o,t+u).map(function(e){return e.element})})}).bind(function(e){return t=u,On(n=e,"table").bind(function(e){return kn(e,t).bind(function(e){return tr(e,n).bind(function(n){return n.boxes.map(function(e){return{boxes:e,start:n.start,finish:n.finish}})})})});var n,t});var n,t,i});var t}function ir(o,e,n){return or(o,e,n).bind(function(c){function e(e){return ce(o,e)}var n="thead,tfoot,tbody,table",t=On(c.first,n,e),r=On(c.last,n,e);return t.bind(function(i){return r.bind(function(e){return ce(i,e)?(t=c.table,r=c.first,o=c.last,u=Kt(t),Ct(n=u,r,o).bind(function(e){return function(e,n){for(var t=!0,r=P(yt,n),o=n.startRow;o<=n.finishRow;o++)for(var u=n.startCol;u<=n.finishCol;u++)t=t&&$t.getAt(e,o,u).exists(r);return t?q.some(n):q.none()}(n,e)})):q.none();var n,t,r,o,u})})})}function cr(e,n,t,r){return e.fold(n,t,r)}function lr(e,n){return Ve.fromDom(e.dom.cloneNode(n))}function ar(e){return lr(e,!1)}function fr(e){return lr(e,!0)}function sr(e,n){var t=Ve.fromTag(n);return En(t,zn(e)),t}function mr(r,o){function e(e){var n=o(e);if(n<=0||null===n){var t=Un(e,r);return parseFloat(t)||0}return n}function u(o,e){return B(e,function(e,n){var t=Un(o,n),r=void 0===t?0:parseInt(t,10);return isNaN(r)?e:e+r},0)}return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+n);var t=e.dom;Fn(t)&&(t.style[r]=n+"px")},get:e,getOuter:e,aggregate:u,max:function(e,n,t){var r=u(e,t);return r<n?n-r:0}}}function dr(){var e=He().browser;return e.isIE()||e.isEdge()}function gr(e,n,t){return r=Un(e,n),o=t,u=parseFloat(r),(isNaN(u)?q.none():q.some(u)).getOr(o);var r,o,u}function pr(e){return Un(e,"box-sizing")}function br(e,n,t,r){return n-gr(e,"padding-"+t,0)-gr(e,"padding-"+r,0)-gr(e,"border-"+t+"-width",0)-gr(e,"border-"+r+"-width",0)}function hr(e,n){var t=e.dom,r=t.getBoundingClientRect().width||t.offsetWidth;return"border-box"===n?r:br(e,r,"left","right")}function vr(e){return Jr.get(e)}function wr(e){return Jr.getOuter(e)}function yr(t,r){void 0===r&&(r=x);var e=t.grid,n=D(e.columns,S),o=D(e.rows,S);return O(n,function(n){return eo(function(){return N(o,function(e){return $t.getAt(t,e,n).filter(function(e){return e.column===n}).toArray()})},function(e){return 1===e.colspan&&r(e.element)},function(){return $t.getAt(t,0,n)})})}function Cr(t){var e=t.grid,n=D(e.rows,S),r=D(e.columns,S);return O(n,function(n){return eo(function(){return N(r,function(e){return $t.getAt(t,n,e).filter(function(e){return e.row===n}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan},function(){return $t.getAt(t,n,0)})})}function Sr(n,t){return function(e){return"rtl"===no(e)?t:n}}function Tr(e){return to.get(e)}function xr(e){return to.getOuter(e)}function Rr(e,n){return void 0!==e?e:void 0!==n?n:0}function Dr(e){var n=e.dom.ownerDocument,t=n.body,r=n.defaultView,o=n.documentElement;if(t===e.dom)return uo(t.offsetLeft,t.offsetTop);var u=Rr(null==r?void 0:r.pageYOffset,o.scrollTop),i=Rr(null==r?void 0:r.pageXOffset,o.scrollLeft),c=Rr(o.clientTop,t.clientTop),l=Rr(o.clientLeft,t.clientLeft);return io(e).translate(i-l,u-c)}function Or(e,n){return{row:e,y:n}}function Ar(e,n){return{col:e,x:n}}function kr(e){return Dr(e).left+wr(e)}function Ir(e){return Dr(e).left}function Br(e,n){return Ar(e,Ir(n))}function Mr(e,n){return Ar(e,kr(n))}function Er(e){return Dr(e).top}function Pr(e,n){return Or(e,Er(n))}function Nr(e,n){return Or(e,Er(n)+xr(n))}function zr(t,n,r){if(0===r.length)return[];var e=O(r.slice(1),function(e,n){return e.map(function(e){return t(n,e)})}),o=r[r.length-1].map(function(e){return n(r.length-1,e)});return e.concat([o])}function Lr(i){if(!a(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var c=[],t={};return A(i,function(e,r){var n=Ue(e);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],u=e[o];if(void 0!==t[o])throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!a(u))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(n!==u.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+u.length+" ("+u+"), got "+n);return{fold:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(e.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+e.length);return e[r].apply(null,t)},match:function(e){var n=Ue(e);if(c.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+n.join(","));if(!z(c,function(e){return y(n,e)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,t)},log:function(e){console.log(e,{constructors:c,constructor:o,params:t})}}}}),t}var _r,Wr,jr,Fr=function(n,e,t){return e.bind(function(e){return t.filter(P(n.eq,e))})},Hr=function(e,n,t){return 0<t.length?(r=e,o=n,u=t[0],I(t.slice(1),function(e,n){var t=o(r,n);return Fr(r,e,t)},o(r,u))):q.none();var r,o,u},Vr=function(n,e,t,r){function o(n){return b(n,r).fold(function(){return n},function(e){return n.slice(0,e+1)})}void 0===r&&(r=v);var u=[e].concat(n.up().all(e)),i=[t].concat(n.up().all(t)),c=o(u),l=o(i),a=w(c,function(e){return R(l,P(n.eq,e))});return{firstpath:c,secondpath:l,shared:a}},qr=Zt(),Ur=rr,Gr=Lr([{none:[]},{multiple:["elements"]},{single:["element"]}]),$r=Gr.none,Kr=Gr.multiple,Xr=Gr.single,Yr=tinymce.util.Tools.resolve("tinymce.PluginManager"),Jr=mr("width",function(e){return e.dom.offsetWidth}),Qr=function(e){return hr(e,"content-box")},Zr=function(e){return dr()?hr(e,pr(e)):gr(e,"width",e.dom.offsetWidth)},eo=function(e,n,t){var r=e();return w(r,n).orThunk(function(){return q.from(r[0]).orThunk(t)}).map(function(e){return e.element})},no=function(e){return"rtl"===Un(e,"direction")?"rtl":"ltr"},to=mr("height",function(e){var n=e.dom;return Sn(e)?n.getBoundingClientRect().height:n.offsetHeight}),ro=function(e){return dr()?(t=pr(n=e),o=(r=n.dom).getBoundingClientRect().height||r.offsetHeight,"border-box"===t?o:br(n,o,"top","bottom")):gr(e,"height",e.dom.offsetHeight);var n,t,r,o},oo=function(t,r){return{left:t,top:r,translate:function(e,n){return oo(t+e,r+n)}}},uo=oo,io=function(e){var n,t=e.dom,r=t.ownerDocument.body;return r===t?uo(r.offsetLeft,r.offsetTop):Sn(e)?(n=t.getBoundingClientRect(),uo(n.left,n.top)):uo(0,0)},co={delta:S,positions:function(e){return zr(Pr,Nr,e)},edge:Er},lo=Sr({delta:S,edge:Ir,positions:function(e){return zr(Br,Mr,e)}},{delta:function(e){return-e},edge:kr,positions:function(e){return zr(Mr,Br,e)}}),ao={delta:function(e,n){return lo(n).delta(e,n)},positions:function(e,n){return lo(n).positions(e,n)},edge:function(e){return lo(e).edge(e)}},fo={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},so=(jr=["Infinity",(_r="[0-9]+")+"\\."+mo(_r)+mo(Wr="[eE][+-]?[0-9]+"),"\\."+_r+mo(Wr),_r+mo(Wr)].join("|"),new RegExp("^([+-]?(?:"+jr+"))(.*)$"));function mo(e){return"(?:"+e+")?"}function go(e,n,t){var r=q.from(e.dom.parentElement).map(Ve.fromDom).getOrThunk(function(){return Tn(nn(e))});return n(e)/t(r)*100}function po(e,n){Vn(e,"width",n+"px")}function bo(e,n){Vn(e,"width",n+"%")}function ho(e,n){Vn(e,"height",n+"px")}function vo(e){var n,t,r,o,u,i,c,l,a,f,s=ro(e)+"px";return s?(n=s,t=e,r=Tr,o=ho,f=parseFloat(n),ee(n,"%")&&"table"!==Ye(t)?(i=f,c=r,l=o,a=rt(u=t).map(function(e){var n=c(e);return Math.floor(i/100*n)}).getOr(i),l(u,a),a):f):Tr(e)}function wo(e,n){return Gn(e,n).orThunk(function(){return Nn(e,n).map(function(e){return e+"px"})})}function yo(e){return wo(e,"width")}function Co(e){return go(e,vr,Qr)}function So(e){return(jl(e)?vr:Zr)(e)}function To(e){return vo(n=e)/Xn(n,"rowspan");var n}function xo(e,n,t){Vn(e,"width",n+t)}function Ro(e){return go(e,vr,Qr)+"%"}function Do(e){return yo(e).getOrThunk(function(){return So(e)+"px"})}function Oo(e){return wo(e,"height").getOrThunk(function(){return To(e)+"px"})}function Ao(e,n,t,r,o,u){return e.filter(r).fold(function(){return u(function(t,r){if(r<0||r>=t.length-1)return q.none();var e=t[r].fold(function(){var e,n;return H((e=t.slice(0,r),(n=U.call(e,0)).reverse(),n),function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return q.some({value:e,delta:0})}),n=t[r+1].fold(function(){return H(t.slice(r+1),function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return q.some({value:e,delta:1})});return e.bind(function(t){return n.map(function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n})})}(t,n))},function(e){return o(e)})}function ko(e,n,i,c){var l=yr(e),t=$t.hasColumns(e)?O($t.justColumns(e),function(e){return q.from(e.element)}):l,a=[q.some(ao.edge(n))].concat(O(ao.positions(l,n),function(e){return e.map(function(e){return e.x})})),f=p(Yn);return O(t,function(e,u){return Ao(e,u,a,f,function(e){return t=e,o=(r=He().browser).isChrome()||r.isFirefox(),!Hl(t)||o?i(e):Ao(null!=(n=l[u])?S(n):q.none(),u,a,f,function(e){return c(q.some(vr(e)))},c);var n,t,r,o},c)})}function Io(e){return e.map(function(e){return e+"px"}).getOr("")}function Bo(e,n,t){return ko(e,n,So,function(e){return e.getOrThunk(t.minCellWidth)})}function Mo(e,n,t,r,o){var u=Cr(e),i=[q.some(t.edge(n))].concat(O(t.positions(u,n),function(e){return e.map(function(e){return e.y})}));return O(u,function(e,n){return Ao(e,n,i,p(Jn),r,o)})}function Eo(e,n){return function(){return Sn(e)?n(e):parseFloat(Gn(e,"width").getOr("0"))}}function Po(r){var t=Eo(r,function(e){return parseFloat(Ro(e))}),n=Eo(r,vr);return{width:t,pixelWidth:n,getWidths:function(e,n){return t=n,ko(e,r,Co,function(e){return e.fold(function(){return t.minCellWidth()},function(e){return e/t.pixelWidth()*100})});var t},getCellDelta:function(e){return e/n()*100},singleColumnWidth:function(e,n){return[100-e]},minCellWidth:function(){return Ft()/n()*100},setElementWidth:bo,adjustTableWidth:function(e){var n=t();bo(r,n+e/100*n)},isRelative:!0,label:"percent"}}function No(t){var r=Eo(t,vr);return{width:r,pixelWidth:r,getWidths:function(e,n){return Bo(e,t,n)},getCellDelta:S,singleColumnWidth:function(e,n){return[Math.max(Ft(),e+n)-e]},minCellWidth:Ft,setElementWidth:po,adjustTableWidth:function(e){var n=r()+e;po(t,n)},isRelative:!1,label:"pixel"}}function zo(e,n){function t(e){return oe(e.element,n)}var u,r,i,c,l,a,f,s,o,m,d,g,p=fr(e),b=ct(p),h=Vl(e),v=$t.generate(b),w=(u=t,r=v.grid.columns,i=v.grid.rows,c=r,a=l=0,f=[],s=[],ae(v.access,function(e){var n,t,r,o;f.push(e),u(e)&&(s.push(e),t=(n=e.row)+e.rowspan-1,o=(r=e.column)+e.colspan-1,n<i?i=n:l<t&&(l=t),r<c?c=r:a<o&&(a=o))}),{minRow:i,minCol:c,maxRow:l,maxCol:a,allCells:f,selectedCells:s}),y="th:not("+n+"),td:not("+n+")";return A(Vt(p,"th,td",function(e){return oe(e,y)}),Yt),function(e,n,t,r){for(var o,u,i,c=n.grid.columns,l=n.grid.rows,a=0;a<l;a++)for(var f=!1,s=0;s<c;s++)a<t.minRow||a>t.maxRow||s<t.minCol||s>t.maxCol||($t.getAt(n,a,s).filter(r).isNone()?(o=f,0,u=e[a].element,i=Ve.fromTag("td"),Xt(i,Ve.fromTag("br")),(o?Xt:Ot)(u,i)):f=!0)}(b,v,w,t),o=p,m=w,d=v,g=function(e,n,t,r){if(0===r.minCol&&n.grid.columns===r.maxCol+1)return 0;var o=Bo(n,e,t),u=B(o,function(e,n){return e+n},0),i=B(o.slice(r.minCol,r.maxCol+1),function(e,n){return e+n},0)/u*t.pixelWidth()-t.pixelWidth();return t.getCellDelta(i)}(e,$t.fromTable(e),h,w),ae(d.columns,function(e){(e.column<m.minCol||e.column>m.maxCol)&&Yt(e.element)}),A(k(Zn(o,"tr"),function(e){return 0===e.dom.childElementCount}),Yt),m.minCol!==m.maxCol&&m.minRow!==m.maxRow||A(Zn(o,"th,td"),function(e){Wt(e,"rowspan"),Wt(e,"colspan")}),Wt(o,Gt),Wt(o,"data-snooker-col-series"),Vl(o).adjustTableWidth(g),p}function Lo(e){return"img"===Ye(e)?1:Pt(e).fold(function(){return ln(e).length},function(e){return e.length})}function _o(e){return Pt(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||y(Gl,Ye(e))}function Wo(e){return o=_o,(u=function(e){for(var n=0;n<e.childNodes.length;n++){var t=Ve.fromDom(e.childNodes[n]);if(o(t))return q.some(t);var r=u(e.childNodes[n]);if(r.isSome())return r}return q.none()})(e.dom);var o,u}function jo(e){return $l(e,_o)}function Fo(n){return function(){var e=Ve.fromTag("td",n.dom);return Xt(e,Ve.fromTag("br",n.dom)),e}}function Ho(e){return function(){return Ve.fromTag("col",e.dom)}}function Vo(e){return function(){return Ve.fromTag("colgroup",e.dom)}}function qo(e){return function(){return Ve.fromTag("tr",e.dom)}}function Uo(e,n,t){var r,o,u=(It(o=sr(r=e,n),ln(fr(r))),o);return ae(t,function(e,n){null===e?Wt(u,n):Mn(u,n,e)}),u}function Go(e){return e}function $o(a,f,s){function m(e,n){var t=e.element.dom,r=n.dom;Fn(t)&&Fn(r)&&(r.style.cssText=t.style.cssText),$n(n,"height"),1!==e.colspan&&$n(n,"width")}return{col:function(e){var n=Ve.fromTag(Ye(e.element),f.dom);return m(e,n),a(e.element,n),n},colgroup:Vo(f),row:qo(f),cell:function(e){var n,t,r,o,u,i=Ve.fromTag(Ye(e.element),f.dom),c=s.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=0<c.length?(n=e.element,t=i,r=c,Wo(n).map(function(e){return I(sn(e,r.join(","),function(e){return ce(e,n)}),function(e,n){var t=ar(n);return Wt(t,"contenteditable"),Xt(e,t),t},t)}).getOr(t)):i;return Xt(l,Ve.fromTag("br")),m(e,i),o=e.element,u=i,ae(Kl,function(n,t){return Nn(o,t).filter(function(e){return y(n,e)}).each(function(e){return Mn(u,t,e)})}),a(e.element,i),i},replace:Uo,colGap:Ho(f),gap:Fo(f)}}function Ko(e){return{col:Ho(e),colgroup:Vo(e),row:qo(e),cell:Fo(e),replace:Go,colGap:Ho(e),gap:Fo(e)}}function Xo(e){return O(e,Ve.fromDom)}function Yo(e){return Ve.fromDom(e.getBody())}function Jo(e){return e.getBoundingClientRect().width}function Qo(e){return e.getBoundingClientRect().height}function Zo(n){return function(e){return ce(e,Yo(n))}}function eu(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e}function nu(e){function n(e){return Wt(e,"data-mce-style")}Wt(e,"data-mce-style"),A(nt(e),n),A(tt(e),n),A(ot(e),n)}function tu(e){return Ve.fromDom(e.selection.getStart())}function ru(e){return cr(e.get(),C([]),S,_)}function ou(e,n,t){return{element:t,mergable:(u=n,i=Xl,cr(e.get(),q.none,function(n){return n.length<=1?q.none():ir(u,i.firstSelectedSelector,i.lastSelectedSelector).map(function(e){return{bounds:e,cells:n}})},q.none)),unmergable:0<(o=ru(e)).length&&z(o,function(e){return r(e,"rowspan")||r(e,"colspan")})?q.some(o):q.none(),selection:ru(e)};function r(e,n){return Nn(e,n).exists(function(e){return 1<parseInt(e,10)})}var o,u,i}function uu(o){return function(e,n){var t,r=Ye(e);return In("col"===r||"colgroup"===r?rt(t=e).bind(function(e){return Ur(e,Xl.firstSelectedSelector)}).fold(C(t),function(e){return e[0]}):e,o,n)}}function iu(a,e,f){a.on("BeforeGetContent",function(t){!0===t.selection&&cr(e.get(),E,function(e){t.preventDefault(),rt(e[0]).map(function(e){var n=zo(e,"[data-mce-selected]");return nu(n),[n]}).each(function(e){var n;t.content="text"===t.format?O(e,function(e){return e.dom.innerText}).join(""):(n=a,O(e,function(e){return n.selection.serializer.serialize(e.dom,{})}).join(""))})},E)}),a.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&j(Ql(e)).each(function(c){rt(c).each(function(e){var n,t,r,o,u=k((n=l.content,(t=document.createElement("div")).innerHTML=n,ln(Ve.fromDom(t))),function(e){return"meta"!==Ye(e)}),i=en("table");1===u.length&&i(u[0])&&(l.preventDefault(),r=Ko(Ve.fromDom(a.getDoc())),o={element:c,clipboard:u[0],generators:r},f.pasteCells(e,o).each(function(){a.focus()}))})})})}function cu(e,n,t){for(var r=0,o=e;o<n;o++)r+=void 0!==t[o]?t[o]:0;return r}function lu(e,n,t){var r,o,u,i;A((r=e,o=n,$t.hasColumns(r)?(i=o,O($t.justColumns(r),function(e,n){return{element:e.element,width:i[n],colspan:e.colspan}})):(u=o,O($t.justCells(r),function(e){var n=cu(e.column,e.column+e.colspan,u);return{element:e.element,width:n,colspan:e.colspan}}))),function(e){t.setElementWidth(e.element,e.width)})}function au(e,n,t,r,o){var u,i,c,l,a,f,s,m,d,g,p=$t.fromTable(e),b=o.getCellDelta(n),h=o.getWidths(p,o),v=t===p.grid.columns-1,w=r.clampTableDelta(h,t,b,o.minCellWidth(),v),y=(i=t,c=w,l=o,a=r,m=(u=h).slice(0),s=i,d=0===(f=u).length?ea.none():1===f.length?ea.only(0):0===s?ea.left(0,1):s===f.length-1?ea.right(s-1,s):0<s&&s<f.length-1?ea.middle(s-1,s,s+1):ea.none(),g=C(O(m,C(0))),d.fold(g,function(e){return l.singleColumnWidth(m[e],c)},function(e,n){return a.calcLeftEdgeDeltas(m,e,n,c,l.minCellWidth(),l.isRelative)},function(e,n,t){return a.calcMiddleDeltas(m,e,n,t,c,l.minCellWidth(),l.isRelative)},function(e,n){return a.calcRightEdgeDeltas(m,e,n,c,l.minCellWidth(),l.isRelative)}));lu(p,O(y,function(e,n){return e+h[n]}),o),r.resizeTable(o.adjustTableWidth,w,v)}function fu(e){return O(e,C(0))}function su(e,n,t,r,o){return o(e.slice(0,n)).concat(r).concat(o(e.slice(t)))}function mu(i){return function(e,n,t,r){if(i(t)){var o=Math.max(r,e[n]-Math.abs(t)),u=Math.abs(o-e[n]);return 0<=t?u:-u}return t}}function du(){function f(e,t,n,r){var o=(100+n)/100,u=Math.max(r,(e[t]+n)/o);return O(e,function(e,n){return(n===t?u:e/o)-e})}function c(e,n,t,r,o,u){return u?f(e,n,r,o):(l=t,a=na(i=e,c=n,r,o),su(i,c,l+1,[a,0],fu));var i,c,l,a}return{resizeTable:function(e,n){return e(n)},clampTableDelta:na,calcLeftEdgeDeltas:c,calcMiddleDeltas:function(e,n,t,r,o,u,i){return c(e,t,r,o,u,i)},calcRightEdgeDeltas:function(e,n,t,r,o,u){if(u)return f(e,t,r,o);var i=na(e,t,r,o);return fu(e.slice(0,t)).concat([i])},calcRedestributedWidths:function(e,n,t,r){if(r){var o=(n+t)/n,u=O(e,function(e){return e/o});return{delta:100*o-100,newSizes:u}}return{delta:t,newSizes:e}}}}function gu(){function i(e,n,t,r,o){var u=ta(e,0<=r?t:n,r,o);return su(e,n,t+1,[u,-u],fu)}return{resizeTable:function(e,n,t){t&&e(n)},clampTableDelta:function(e,n,t,r,o){if(o){if(0<=t)return t;var u=B(e,function(e,n){return e+n-r},0);return Math.max(-u,t)}return na(e,n,t,r)},calcLeftEdgeDeltas:i,calcMiddleDeltas:function(e,n,t,r,o,u){return i(e,t,r,o,u)},calcRightEdgeDeltas:function(e,n,t,r,o,u){return u?fu(e):O(e,C(r/e.length))},calcRedestributedWidths:function(e,n,t,r){return{delta:0,newSizes:e}}}}function pu(e,n,t){var r=t.substring(0,t.length-e.length),o=parseFloat(r);return r===o.toString()?n(o):ra.invalid(t)}function bu(e,n,t){var r,o,u,i,c=oa.from(t),l=z(e,function(e){return"0px"===e})?(r=e.length,o=c.fold(function(){return C("")},function(e){return C(e/r+"px")},function(){return C(100/r+"%")}),D(r,o)):(u=e,i=n,c.fold(function(){return u},function(e){return t=(n=e)/i,O(u,function(e){return oa.from(e).fold(function(){return e},function(e){return e*t+"px"},function(e){return e/100*n+"px"})});var n,t},function(e){return n=i,O(u,function(e){return oa.from(e).fold(function(){return e},function(e){return e/n*100+"%"},function(e){return e+"%"})});var n}));return ua(l)}function hu(e,n){return 0===e.length?n:I(e,function(e,n){return oa.from(n).fold(C(0),S,S)+e},0)}function vu(e){return ia(e).fold(C("px"),C("px"),C("%"))}function wu(l,e,n){var a=$t.fromTable(l),i=a.all,f=$t.justCells(a),s=$t.justColumns(a);e.each(function(e){var t,r,o,u,n=vu(e),i=vr(l),c=bu(ko(a,l,Do,Io),i,e);$t.hasColumns(a)?(o=c,u=n,A(s,function(e,n){var t=hu([o[n]],Ft());Vn(e.element,"width",t+u)})):(t=c,r=n,A(f,function(e){var n=hu(t.slice(e.column,e.colspan+e.column),Ft());Vn(e.element,"width",n+r)})),Vn(l,"width",e)}),n.each(function(e){var n=vu(e),t=Tr(l),r=bu(Mo(a,l,co,Oo,Io),t,e),o=i,u=n;A(f,function(e){var n=hu(r.slice(e.row,e.rowspan+e.row),Ht());Vn(e.element,"height",n+u)}),A(o,function(e,n){Vn(e.element,"height",r[n])}),Vn(l,"height",e)})}function yu(e){return $t.fromTable(e).grid}function Cu(n){var o=[];return{bind:function(e){if(void 0===e)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(n){o=k(o,function(e){return e!==n})},trigger:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r={};A(n,function(e,n){r[e]=t[n]}),A(o,function(e){e(r)})}}}function Su(e){return{registry:fe(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:fe(e,function(e){return e.trigger})}}function Tu(e){return e.slice(0).sort()}function xu(n,e){var t=k(e,function(e){return!y(n,e)});0<t.length&&function(){throw new Error("Unsupported keys for object: "+Tu(t).join(", "))}()}function Ru(e){return function(r,o,u){if(0===o.length)throw new Error("You must specify at least one required field.");var t;return function(n,e){if(!a(e))throw new Error("The "+n+" fields must be an array. Was: "+e+".");A(e,function(e){if(!T(e))throw new Error("The value "+e+" in the "+n+" fields was not a string.")})}("required",o),w(t=Tu(o),function(e,n){return n<t.length-1&&e===t[n+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}),function(n){var t=Ue(n);z(o,function(e){return y(t,e)})||function(e,n){throw new Error("All required keys ("+Tu(e).join(", ")+") were not specified. Specified keys were: "+Tu(n).join(", ")+".")}(o,t),r(o,t);var e=k(o,function(e){return!u.validate(n[e],e)});return 0<e.length&&function(e,n){throw new Error("All values need to be of type: "+n+". Keys ("+Tu(e).join(", ")+") were not.")}(e,u.label),n}}(xu,e,{validate:c,label:"function"})}function Du(){var u,i,e={onEvent:E,reset:E,events:Su({move:Cu(["info"])}).registry},n=(u=q.none(),{onEvent:function(e,o){o.extract(e).each(function(e){var n=o,t=e,r=u.map(function(e){return n.compare(e,t)});u=q.some(t),r.each(function(e){i.trigger.move(e)})})},reset:function(){u=q.none()},events:(i=Su({move:Cu(["info"])})).registry}),t=e;return{on:function(){t.reset(),t=n},off:function(){t.reset(),t=e},isOn:function(){return t===n},onEvent:function(e,n){t.onEvent(e,n)},events:n.events}}function Ou(e){function n(){return e.stopPropagation()}function t(){return e.preventDefault()}var r,o,u=Ve.fromDom(function(e){if(wn()&&l(e.target)){var n=Ve.fromDom(e.target);if(gn(n)&&Cn(n)&&e.composed&&e.composedPath){var t=e.composedPath();if(t)return j(t)}}return q.from(e.target)}(e).getOr(e.target)),i=(r=t,o=n,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r(o.apply(null,e))});return{target:u,x:e.clientX,y:e.clientY,stop:n,prevent:t,kill:i,raw:e}}function Au(e,n,t){return o=n,u=!1,i=sa,c=t,l=function(e){i(e)&&c(Ou(e))},(r=e).dom.addEventListener(o,l,u),{unbind:P(fa,r,o,l,u)};var r,o,u,i,c,l}function ku(e){return void 0!==e.dom.classList}function Iu(e,n){return o=n,Mn(e,t="class",(void 0===(r=Pn(e,t))||""===r?[]:r.split(" ")).concat([o]).join(" ")),1;var t,r,o}function Bu(e,n){ku(e)?e.dom.classList.add(n):Iu(e,n)}function Mu(e,n){return ku(e)&&e.dom.classList.contains(n)}function Eu(e){var n=e.replace(/\./g,"-");return{resolve:function(e){return n+"-"+e}}}function Pu(e){return In(e,"[contenteditable]")}function Nu(e,n){return void 0===n&&(n=!1),!He().browser.isIE()&&Sn(e)?e.dom.isContentEditable:Pu(e).fold(C(n),function(e){return"true"===pa(e)})}function zu(e){A(dn(e.parent(),"."+ha),Yt)}function Lu(t,e,r){var o=t.origin();A(e,function(e){e.each(function(e){var n=r(o,e);Bu(n,ha),Xt(t.parent(),n)})})}function _u(e,n,t,r,o){var u,i,c,l,a,f=Dr(t),s=n.isResizable,m=0<r.length?co.positions(r,t):[],d=0<m.length?(u=s,N(e.all,function(e,n){return u(e.element)?[n]:[]})):[],g=k(m,function(e,n){return R(d,function(e){return n===e})});i=n,c=g,l=f,a=wr(t),Lu(i,c,function(e,n){var t,r,o,u,i,c=(t=n.row,r=l.left-e.left,o=n.y-e.top,u=a,qn(i=Ve.fromTag("div"),{position:"absolute",left:r+"px",top:o-3.5+"px",height:"7px",width:u+"px"}),En(i,{"data-row":t,role:"presentation"}),i);return Bu(c,va),c});var p,b,h,v,w,y,C,S=0<o.length?ao.positions(o,t):[],T=0<S.length?(b=s,h=[],D((p=e).grid.columns,function(e){$t.getColumnAt(p,e).map(function(e){return e.element}).forall(b)&&h.push(e)}),k(h,function(n){return z($t.filterItems(p,function(e){return e.column===n}),function(e){return b(e.element)})})):[],x=k(S,function(e,n){return R(T,function(e){return n===e})});v=n,w=x,y=f,C=xr(t),Lu(v,w,function(e,n){var t,r,o,u,i,c=(t=n.col,r=n.x-e.left,o=y.top-e.top,u=C,qn(i=Ve.fromTag("div"),{position:"absolute",left:r-3.5+"px",top:o+"px",height:u+"px",width:"7px"}),En(i,{"data-column":t,role:"presentation"}),i);return Bu(c,wa),c})}function Wu(e,n){var t;zu(e),e.isResizable(n)&&_u(t=$t.fromTable(n),e,n,Cr(t),yr(t))}function ju(e,n){A(dn(e.parent(),"."+ha),n)}function Fu(e){ju(e,function(e){Vn(e,"display","none")})}function Hu(e){ju(e,function(e){Vn(e,"display","block")})}function Vu(o){function e(e,n){return q.from(Pn(e,n))}var n,t,r,u,i,c,l=(u=Su({drag:Cu(["xDelta","yDelta","target"])}),i=q.none(),(c={mutate:function(e,n){r.trigger.drag(e,n)},events:(r=Su({drag:Cu(["xDelta","yDelta"])})).registry}).events.drag.bind(function(n){i.each(function(e){u.trigger.drag(n.xDelta,n.yDelta,e)})}),{assign:function(e){i=q.some(e)},get:function(){return i},mutate:c.mutate,events:u.registry}),a=(t=void 0!==(n={}).mode?n.mode:ga,function(n,t,e){function r(){m.stop(),l.isOn()&&(l.off(),c.trigger.stop())}var o,u,i=!1,c=Su({start:Cu([]),stop:Cu([])}),l=Du(),a=(o=r,u=null,{cancel:f,throttle:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];f(),u=setTimeout(function(){u=null,o.apply(null,e)},200)}});function f(){h(u)||(clearTimeout(u),u=null)}function s(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i&&t.apply(null,e)}}l.events.move.bind(function(e){t.mutate(n,e.info)});var m=t.sink(aa({forceDrop:r,drop:s(r),move:s(function(e){a.cancel(),l.onEvent(e,t)}),delayDrop:s(a.throttle)}),e);return{element:m.element,go:function(e){m.start(e),l.on(),c.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){m.destroy()},events:c.registry}}(l,t,n)),f=q.none();function s(e,n){return Qn(e,n)-Kn(e,"data-initial-"+n,0)}function m(e,n){b.trigger.startAdjust(),l.assign(e),Mn(e,"data-initial-"+n,Qn(e,n)),Bu(e,ya),Vn(e,"opacity","0.2"),a.go(o.parent())}function d(e){return ce(e,o.view())}l.events.drag.bind(function(t){e(t.target,"data-row").each(function(e){var n=Qn(t.target,"top");Vn(t.target,"top",n+t.yDelta+"px")}),e(t.target,"data-column").each(function(e){var n=Qn(t.target,"left");Vn(t.target,"left",n+t.xDelta+"px")})}),a.events.stop.bind(function(){l.get().each(function(r){f.each(function(t){e(r,"data-row").each(function(e){var n=s(r,"top");Wt(r,"data-initial-top"),b.trigger.adjustHeight(t,n,parseInt(e,10))}),e(r,"data-column").each(function(e){var n=s(r,"left");Wt(r,"data-initial-left"),b.trigger.adjustWidth(t,n,parseInt(e,10))}),Wu(o,t)})})});var g=Au(o.parent(),"mousedown",function(e){Mu(e.target,va)&&m(e.target,"top"),Mu(e.target,wa)&&m(e.target,"left")}),p=Au(o.view(),"mouseover",function(e){In(e.target,"table",d).filter(Nu).fold(function(){Sn(e.target)&&zu(o)},function(e){f=q.some(e),Wu(o,e)})}),b=Su({adjustHeight:Cu(["table","delta","row"]),adjustWidth:Cu(["table","delta","column"]),startAdjust:Cu([])});return{destroy:function(){g.unbind(),p.unbind(),a.destroy(),zu(o)},refresh:function(e){Wu(o,e)},on:a.on,off:a.off,hideBars:P(Fu,o),showBars:P(Hu,o),events:b.registry}}function qu(e,n){return e.fire("newrow",{node:n})}function Uu(e,n){return e.fire("newcell",{node:n})}function Gu(e,n,t){e.fire("TableModified",K(K({},t),{table:n}))}function $u(e){return e.getParam("table_sizing_mode","auto")}function Ku(e){return e.getParam("table_responsive_width")}function Xu(e){return e.getParam("table_border_widths",Ra,"array")}function Yu(e){return e.getParam("table_border_styles",Da,"array")}function Ju(e){return e.getParam("table_default_attributes",Oa,"object")}function Qu(e){return e.getParam("table_default_styles",function(e){var n;if(ka(e)){var t=e.dom,r=null!==(n=t.getParent(e.selection.getStart(),t.isBlock))&&void 0!==n?n:e.getBody(),o=Qr(Ve.fromDom(r));return K(K({},xa),{width:o+"px"})}return Ia(e)?se(xa,function(e,n){return"width"!==n}):xa}(e),"object")}function Zu(e){return e.getParam("table_cell_advtab",!0,"boolean")}function ei(e){return e.getParam("table_row_advtab",!0,"boolean")}function ni(e){return e.getParam("table_advtab",!0,"boolean")}function ti(e){return e.getParam("table_style_by_css",!1,"boolean")}function ri(e){return e.getParam("table_cell_class_list",[],"array")}function oi(e){return e.getParam("table_class_list",[],"array")}function ui(e){return"relative"===$u(e)||!0===Ku(e)}function ii(e){var n="section",t=e.getParam("table_header_type",n,"string");return y(["section","cells","sectionCells","auto"],t)?t:n}function ci(e){var n=e.getParam("table_column_resizing",Aa,"string");return w(["preservetable","resizetable"],function(e){return e===n}).getOr(Aa)}function li(e){return"preservetable"===ci(e)}function ai(e){return"resizetable"===ci(e)}function fi(e){var n=e.getParam("table_clone_elements");return T(n)?q.some(n.split(/[ ,]/)):Array.isArray(n)?q.some(n):q.none()}function si(e){return e.getParam("table_background_color_map",[],"array")}function mi(e){return e.getParam("table_border_color_map",[],"array")}function di(e,n){return(ui(e)?Ul:ka(e)?ql:Vl)(n)}function gi(e){Wt(e,"width")}function pi(e){return"false"!==Pn(e,"data-mce-resize")}function bi(p){function m(e){return"TABLE"===e.nodeName}function b(e){return di(p,e)}function h(){return(li(p)?gu:du)()}var d,g,v=q.none(),w=q.none(),y=q.none();return p.on("init",function(){var e,n,t,r,o,u,i,c,l,a,m,f,s,d,g=(n=pi,(e=p).inline?(u=Yo(e),qn(c=Ve.fromTag("div"),{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Xt(Tn(Ve.fromDom(document)),c),c,i=n,{parent:C(c),view:C(u),origin:C(uo(0,0)),isResizable:i}):Il(Ve.fromDom(e.getDoc()),n));y=q.some(g),o=p.getParam("object_resizing",!0),(T(o)?"table"===o:o)&&p.getParam("table_resize_bars",!0,"boolean")&&(t=h(),l=t,a=b,m=co,f=ao,s=Vu(g),d=Su({beforeResize:Cu(["table","type"]),afterResize:Cu(["table","type"]),startDrag:Cu([])}),s.events.adjustHeight.bind(function(e){var n=e.table;d.trigger.beforeResize(n,"row");var t,r,o,u,i,c,l,a,f,s=m.delta(e.delta,n);t=n,r=s,o=e.row,u=m,l=$t.fromTable(t),a=O(Mo(l,t,u,To,function(e){return e.getOrThunk(Ht)}),function(e,n){return o===n?Math.max(r+e,Ht()):e}),i=a,f=O($t.justCells(l),function(e){var n=cu(e.row,e.row+e.rowspan,i);return{element:e.element,height:n,rowspan:e.rowspan}}),A((c=a,O(l.all,function(e,n){return{element:e.element,height:c[n]}})),function(e){ho(e.element,e.height)}),A(f,function(e){ho(e.element,e.height)}),ho(t,I(a,function(e,n){return e+n},0)),d.trigger.afterResize(n,"row")}),s.events.startAdjust.bind(function(e){d.trigger.startDrag()}),s.events.adjustWidth.bind(function(e){var n=e.table;d.trigger.beforeResize(n,"col");var t=f.delta(e.delta,n),r=a(n);au(n,t,e.column,l,r),d.trigger.afterResize(n,"col")}),(r={on:s.on,off:s.off,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:d.registry}).on(),r.events.startDrag.bind(function(e){v=q.some(p.selection.getRng())}),r.events.beforeResize.bind(function(e){var n,t=e.table.dom,r=p,o=Jo(n=t),u=Qo(t),i=Pa+e.type;r.fire("ObjectResizeStart",{target:n,width:o,height:u,origin:i})}),r.events.afterResize.bind(function(e){var n,t,r,o,u,i=e.table,c=i.dom;nu(i),v.each(function(e){p.selection.setRng(e),p.focus()}),n=p,r=Jo(t=c),o=Qo(c),u=Pa+e.type,n.fire("ObjectResized",{target:t,width:r,height:o,origin:u}),p.undoManager.add()}),w=q.some(r))}),p.on("ObjectResizeStart",function(e){var n,t,r,o,u=e.target;m(u)&&(n=Ve.fromDom(u),A(p.dom.select(".mce-clonedresizable"),function(e){p.dom.addClass(e,"mce-"+ci(p)+"-columns")}),!Ml(n)&&ka(p)?Ma(n):!Bl(n)&&ui(p)&&Ba(n),El(n)&&Ae(e.origin,Pa)&&Ba(n),d=e.width,g=Ia(p)?"":(o=(t=p).dom.getStyle(r=u,"width")||t.dom.getAttrib(r,"width"),q.from(o).filter(ne).getOr("")))}),p.on("ObjectResized",function(e){var n,t,r,o,u,i,c,l,a,f,s=e.target;m(s)&&(n=Ve.fromDom(s),t=e.origin,Ae(t,"corner-")&&(r=n,o=e.width,f=ee(t,"e"),""===g&&Ba(r),o!==d&&""!==g?(Vn(r,"width",g),u=h(),i=b(r),c=li(p)||f?yu(r).columns-1:0,au(r,o-d,c,u,i)):/^(\d+(\.\d+)?)%$/.test(g)&&Vn(r,"width",o*parseFloat(g.replace("%",""))/d+"%"),/^(\d+(\.\d+)?)px$/.test(g)&&(a=$t.fromTable(l=r),$t.hasColumns(a)||A(nt(l),function(e){Vn(e,"width",Un(e,"width")),Wt(e,"width")}))),nu(n),Gu(p,n.dom,Ca))}),p.on("SwitchMode",function(){w.each(function(e){p.mode.isReadOnly()?e.hideBars():e.showBars()})}),{lazyResize:function(){return w},lazyWire:function(){return y.getOr(Il(Ve.fromDom(p.getBody()),pi))},destroy:function(){w.each(function(e){e.destroy()}),y.each(function(e){var n=e;p.inline&&Yt(n.parent())})}}}function hi(e,n){return{element:e,offset:n}}function vi(e,n){return(e.property().isText(n)?e.property().getText(n):e.property().children(n)).length}function wi(t,r){1===Xn(t,"colspan")&&yo(t).bind(function(e){return o=["fixed","relative","empty"],q.from(so.exec(e)).bind(function(e){var n=Number(e[1]),t=e[2],r=t;return R(o,function(e){return R(fo[e],function(e){return r===e})})?q.some({value:n,unit:t}):q.none()});var o}).each(function(e){var n=e.value/2;xo(t,n,e.unit),xo(r,n,e.unit)})}function yi(e){return z(e,function(e){return Wa(e.element)})}function Ci(e){var n="thead"===e.section,t=Ln(ja(e.cells),"th");return n||t?{type:"header",subType:n&&t?"sectionCells":n?"section":"cells"}:"tfoot"===e.section?{type:"footer"}:{type:"body"}}function Si(e,n,t){return we(t(e.element,n),!0,e.isLocked)}function Ti(e,n){return e.section!==n?ye(e.element,e.cells,n,e.isNew):e}function xi(){return{transformRow:Ti,transformCell:function(e,n,t){var r,o,u=t(e.element,n);return we("td"!==Ye(u)?(o=sr(r=u,"td"),Rt(r,o),It(o,ln(r)),Yt(r),o):u,e.isNew,e.isLocked)}}}function Ri(){return{transformRow:Ti,transformCell:Si}}function Di(){return{transformRow:function(e,n){return Ti(e,"thead"===n?"tbody":n)},transformCell:Si}}function Oi(e,n,t,r){t===r?Wt(e,n):Mn(e,n,t)}function Ai(e,n,t){F(mn(e,n)).fold(function(){return Ot(e,t)},function(e){return Dt(e,t)})}function ki(u,e){function t(e,n){var t,r,o;It((Bt(o=An(t=u,r=n).getOrThunk(function(){var e=Ve.fromTag(r,nn(t).dom);return"thead"===r?Ai(t,"caption,colgroup",e):"colgroup"===r?Ai(t,"caption",e):Xt(t,e),e})),o),("colgroup"===n?function(e){return N(e,function(e){return O(e.cells,function(e){return Oi(e.element,"span",e.colspan,1),e.element})})}:function(e){return O(e,function(e){e.isNew&&i.push(e.element);var n=e.element;return Bt(n),A(e.cells,function(e){e.isNew&&c.push(e.element),Oi(e.element,"colspan",e.colspan,1),Oi(e.element,"rowspan",e.rowspan,1),Xt(n,e.element)}),n})})(e))}function n(e,n){0<e.length?t(e,n):An(u,n).each(Yt)}var i=[],c=[],r=[],o=[],l=[],a=[];return A(e,function(e){switch(e.section){case"thead":r.push(e);break;case"tbody":o.push(e);break;case"tfoot":l.push(e);break;case"colgroup":a.push(e)}}),n(a,"colgroup"),n(r,"thead"),n(o,"tbody"),n(l,"tfoot"),{newRows:i,newCells:c}}function Ii(e,n){if(0===e.length)return 0;var t=e[0];return b(e,function(e){return!n(t.element,e.element)}).getOr(e.length)}function Bi(m,d){var g=O(m,function(e){return O(e.cells,v)});return O(m,function(e,s){var n=N(e.cells,function(e,n){if(!1!==g[s][n])return[];var t,r,o,u,i,c,l,a,f=(o=n,u=d,l=(t=m)[r=s],a="colgroup"===l.section,{colspan:Ii(l.cells.slice(o),u),rowspan:a?1:Ii((i=t.slice(r),c=o,O(i,function(e){return st(e,c)})),u)});return function(e,n,t,r){for(var o=e;o<e+t;o++)for(var u=n;u<n+r;u++)g[o][u]=!0}(s,n,f.rowspan,f.colspan),[{element:e.element,rowspan:f.rowspan,colspan:f.colspan,isNew:e.isNew}]});return{element:e.element,cells:n,section:e.section,isNew:e.isNew}})}function Mi(o,u,i){var c=[];A(o.colgroups,function(e){for(var n=[],t=0;t<o.grid.columns;t++){var r=$t.getColumnAt(o,t).map(function(e){return we(e.element,i,!1)}).getOrThunk(function(){return we(u.colGap(),!0,!1)});n.push(r)}c.push(ye(e.element,n,"colgroup",i))});for(var e=0;e<o.grid.rows;e++){for(var n=[],t=0;t<o.grid.columns;t++){var r=$t.getAt(o,e,t).map(function(e){return we(e.element,i,e.isLocked)}).getOrThunk(function(){return we(u.gap(),!0,!1)});n.push(r)}var l=o.all[e],a=ye(l.element,n,l.section,i);c.push(a)}return c}function Ei(e){return Bi(e,ce)}function Pi(e,n){return H(e.all,function(e){return w(e.cells,function(e){return ce(n,e.element)})})}function Ni(n,e,t){var r=_n(O(e.selection,function(e){return et(e).bind(function(e){return Pi(n,e)}).filter(t)}));return jn(0<r.length,r)}function zi(f,n,s,m,d){return function(o,u,e,i,c){var l=$t.fromTable(u),a=q.from(null==c?void 0:c.section).getOrThunk(Pl);return n(l,e).map(function(e){var n=Mi(l,i,!1),t=f(n,e,ce,d(i),a),r=ht(t.grid);return{info:e,grid:Ei(t.grid),cursor:t.cursor,lockedColumns:r}}).bind(function(e){var n=ki(u,e.grid),t=q.from(null==c?void 0:c.sizing).getOrThunk(function(){return Vl(u)}),r=q.from(null==c?void 0:c.resize).getOrThunk(gu);return s(u,e.grid,e.info,{sizing:t,resize:r,section:a}),m(u),Wu(o,u),Wt(u,Gt),0<e.lockedColumns.length&&Mn(u,Gt,e.lockedColumns.join(",")),q.some({cursor:e.cursor,newRows:n.newRows,newCells:n.newCells})})}}function Li(e,n){return Ni(e,n,x).map(function(e){return{cells:e,generators:n.generators,clipboard:n.clipboard}})}function _i(e,n){return Ni(e,n,x)}function Wi(e,n){return Ni(e,n,function(e){return!e.isLocked})}function ji(n,e){return z(e,function(e){return Pi(n,e).exists(function(e){return!e.isLocked})})}function Fi(n,e){return e.mergable.filter(function(e){return ji(n,e.cells)})}function Hi(n,e){return e.unmergable.filter(function(e){return ji(n,e)})}function Vi(e,n,t,r){for(var o=gt(e).rows,u=!0,i=0;i<o.length;i++)for(var c=0;c<dt(o[0]);c++){var l=o[i],a=st(l,c),f=t(a.element,n);!0===f&&!1===u?ft(l,c,we(r(),!0,a.isLocked)):!0===f&&(u=!1)}return e}function qi(e,t,i,c){var n,r,l=gt(e).rows;return 0<t&&t<l.length&&(n=l[t-1].cells,r=i,A(B(n,function(e,n){return R(e,function(e){return r(e.element,n.element)})?e:e.concat([n])},[]),function(e){for(var o=q.none(),u=t;u<l.length;u++)for(var n=0;n<dt(l[0]);n++)!function(n){var t=l[u],r=st(t,n);i(r.element,e.element)&&(o=o.isNone()?q.some(c()):o).each(function(e){ft(t,n,we(e,!0,r.isLocked))})}(n)})),e}function Ui(e,n){return{rowDelta:0,colDelta:dt(e[0])-dt(n[0])}}function Gi(e,n){return{rowDelta:e.length-n.length,colDelta:0}}function $i(e,n,t,r){var o="colgroup"===n.section?t.col:t.cell;return D(e,function(e){return we(o(),!0,r(e))})}function Ki(e,n,r,o){var u=e[e.length-1];return e.concat(D(n,function(){var e="colgroup"===u.section?r.colgroup:r.row,n=pt(u,e,S),t=$i(n.cells.length,n,r,function(e){return Ke(o,e.toString())});return Ut(n,t)}))}function Xi(e,t,r,o){return O(e,function(e){var n=$i(t,e,r,v);return lt(e,o,n)})}function Yi(e,n,t){var r=n.colDelta<0?Xi:S,o=n.rowDelta<0?Ki:S,u=ht(e),i=dt(e[0]),c=R(u,function(e){return e===i-1}),l=r(e,Math.abs(n.colDelta),t,c?i-1:i),a=ht(l);return o(l,Math.abs(n.rowDelta),t,L(a,x))}function Ji(n,t,e){return k(e,function(e){return e>=n.column&&e<=dt(t[0])+n.column})}function Qi(e,u,n,i,c){var t,r,o,l=ht(u),a=(t=e,r=l,o=dt(u[0]),{row:gt(u).cols.length+t.row,column:w(D(o-t.column,function(e){return e+t.column}),function(n){return z(r,function(e){return e!==n})}).getOr(o-1)}),f=gt(n).rows,s=Ji(a,f,l);return function(e,n,t){if(e.row>=n.length||e.column>dt(n[0]))return Ga.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);var r=n.slice(e.row),o=r[0].cells.slice(e.column),u=dt(t[0]),i=t.length;return Ga.value({rowDelta:r.length-i,colDelta:o.length-u})}(a,u,f).map(function(e){var n=K(K({},e),{colDelta:e.colDelta-s.length}),t=Yi(u,n,i),r=ht(t),o=Ji(a,f,r);return function(e,n,t,r,o,u){for(var i,c,l,a,f,s=e.row,m=e.column,d=s+t.length,g=m+dt(t[0])+u.length,p=L(u,x),b=s;b<d;b++)for(var h,v,w,y=0,C=m;C<g;C++)p[C]?y++:(l=C,a=void 0,a=P(o,st((i=n)[c=b],l).element),f=i[c],1<i.length&&1<dt(f)&&(0<l&&a(mt(f,l-1))||l<f.cells.length-1&&a(mt(f,l+1))||0<c&&a(mt(i[c-1],l))||c<i.length-1&&a(mt(i[c+1],l)))&&Vi(n,mt(n[b],C),o,r.cell),v=(h=st(t[b-s],C-m-y)).element,w=r.replace(v),ft(n[b],C,we(w,!0,h.isLocked)));return n}(a,t,f,i,c,o)})}function Zi(t,e,n,r,o){var u=t,i=o,c=r.cell;0<u&&u<e[0].cells.length&&A(e,function(e){var n=e.cells[u-1],t=e.cells[u];i(t.element,n.element)&&ft(e,u,we(c(),!0,t.isLocked))});var l=Yi(n,Gi(n,e),r);return O(Yi(e,Gi(e,l),r),function(e,n){return lt(e,t,l[n].cells)})}function ec(e,n,t,r,o){qi(n,e,o,r.cell);var u,i,c=ht(n),l=Ui(n,t),a=Yi(n,K(K({},l),{colDelta:l.colDelta-c.length}),r),f=gt(a),s=f.cols,m=f.rows,d=ht(a),g=Ui(t,n),p=K(K({},g),{colDelta:g.colDelta+d.length}),b=Yi((u=r,i=d,O(t,function(t){return B(i,function(e,n){return at(e,n,$i(1,t,u,x)[0])},t)})),p,r);return s.concat(m.slice(0,e)).concat(b).concat(m.slice(e,m.length))}function nc(e,t,n,r,o){var u,i,c,l,a=gt(e),f=a.rows,s=a.cols,m=f.slice(0,t),d=f.slice(t),g=(u=f[n],i=function(e,n){return 0<t&&t<f.length&&r(mt(f[t-1],n),mt(f[t],n))?st(f[t],n):we(o(e.element,r),!0,e.isLocked)},c=r,l=o,pt(u,function(e){return l(e,c)},i));return s.concat(m).concat([g]).concat(d)}function tc(e,u,i,c,l){return O(e,function(e){var n,t,r=0<u&&u<dt(e)&&c(mt(e,u-1),mt(e,u)),o=(n=e.section,t=l,"colgroup"!==n&&r?st(e,u):we(t(st(e,i).element,c),!0,!1));return at(e,u,o)})}function rc(e,n,t,r){return void 0!==mt((u=e)[i=n],t)&&0<i&&r(mt(u[i-1],t),mt(u[i],t))||(o=e[n],0<t&&r(mt(o,t-1),mt(o,t)));var o,u,i}function oc(e,n,t,r){function o(e){return("row"===e?Jn:Yn)(n)?e+"group":e}return e?Wa(n)?o(t):null:r&&Wa(n)?o("row"===t?"col":"row"):null}function uc(e,n,t){return we(t(e.element,n),!0,e.isLocked)}function ic(e,u,i,c,l,a,f){return O(e,function(e,o){return t=function(e,n){if(t=e,R(u,function(e){return i(t.element,e.element)})){var r=f(e,o,n)?l(e,i,c):e;return a(r,o,n).each(function(e){var t=r.element;ae({scope:q.from(e)},function(e,n){e.fold(function(){Wt(t,n)},function(e){Bn(t.dom,n,e)})})}),r}return e;var t},r=O((n=e).cells,t),ye(n.element,r,n.section,n.isNew);var n,t,r})}function cc(t,r,o){return N(t,function(e,n){return rc(t,n,r,o)?[]:[st(e,r)]})}function lc(e,n,t,r,o){var u,i,c,l,a=gt(e).rows,f=N(n,function(e){return cc(a,e,r)}),s=O(e,function(e){return yi(e.cells)}),m=(u=f,z(i=s,S)&&yi(u)?x:function(e,n,t){return!("th"===Ye(e.element)&&i[n])}),d=(c=t,l=s,function(e,n){return q.some(oc(c,e.element,"row",l[n]))});return ic(e,f,r,o,uc,d,m)}function ac(e,n,t,r){var o=gt(e).rows;return ic(e,O(n,function(e){return st(o[e.row],e.column)}),t,r,uc,q.none,x)}function fc(e){return B(e,function(e,n){return R(e,function(e){return e.column===n.column})?e:e.concat([n])},[]).sort(function(e,n){return e.column-n.column})}function sc(e){return"tr"===Ye(e)||Ka(e)}function mc(e){return{element:e,colspan:Kn(e,"colspan",1),rowspan:Kn(e,"rowspan",1)}}function dc(e){return Nn(e,"scope").map(function(e){return e.substr(0,3)})}function gc(e){return n=e,t=Ya.property().name(n),y(Xa,t);var n,t}function pc(e){return n=e,y(["ol","ul"],Ya.property().name(n));var n}function bc(e){function u(e){return"br"===Ye(e)}function t(o){return jo(o).bind(function(t){var r=cn(t).map(function(e){return!!gc(e)||(n=e,!!y(["br","img","hr","input"],Ya.property().name(n))&&"img"!==Ye(e));var n}).getOr(!1);return rn(t).map(function(e){return!0===r||"li"===Ye(n=e)||Dn(n,pc).isSome()||u(t)||gc(e)&&!ce(o,e)?[]:[Ve.fromTag("br")];var n})}).getOr([])}var n,r=0===(n=N(e,function(e){var n=ln(e);return z(n,function(e){return u(e)||pn(e)&&0===Et(e).trim().length})?[]:n.concat(t(e))})).length?[Ve.fromTag("br")]:n;Bt(e[0]),It(e[0],r)}function hc(e){return Nu(e,!0)}function vc(e){0===nt(e).length&&Yt(e)}function wc(e,n){return{grid:e,cursor:n}}function yc(e,n,t){var r,o,u,i,c,l=(r=n,o=t,c=gt(e).rows,q.from(null===(i=null===(u=c[r])||void 0===u?void 0:u.cells[o])||void 0===i?void 0:i.element).filter(hc).orThunk(function(){return H(c,function(e){return H(e.cells,function(e){var n=e.element;return jn(hc(n),n)})})}));return wc(e,l)}function Cc(e){return B(e,function(e,n){return R(e,function(e){return e.row===n.row})?e:e.concat([n])},[]).sort(function(e,n){return e.row-n.row})}function Sc(u,i){return function(e,n,t,r,o){return yc(function(e,n,t,r,u,o,i){var c=gt(e),l=c.cols,a=c.rows,f=a[n[0]],s=N(n,function(e){return o=u,N((t=a)[r=e].cells,function(e,n){return rc(t,r,n,o)?[]:[e]});var t,r,o}),m=O(f.cells,function(e,n){return yi(cc(a,n,u))}),d=X([],a,!0);A(n,function(e){d[e]=i.transformRow(a[e],t)});var g,p,b,h,v=l.concat(d),w=(g=f,z(p=m,S)&&yi(g.cells)?x:function(e,n,t){return!("th"===Ye(e.element)&&p[t])}),y=(b=r,h=m,function(e,n,t){return q.some(oc(b,e.element,"col",h[t]))});return ic(v,s,u,o,i.transformCell,y,w)}(e,O(Cc(n),function(e){return e.row}),u,i,t,r.replaceOrInit,o),n[0].row,n[0].column)}}function Tc(e,n,t){var r,o=(r=t.section,ut(e,function(){return r}));return Mi($t.generate(o),n,!0)}function xc(e,n,t,r){var o=r.sizing,u=$t.generate(n);lu(u,o.getWidths(u,o),o)}function Rc(e,n,t,r){var o=t,u=r.sizing,i=r.resize,c=$t.generate(n),l=u.getWidths(c,u),a=u.pixelWidth(),f=i.calcRedestributedWidths(l,a,o.pixelDelta,u.isRelative),s=f.newSizes,m=f.delta;lu(c,s,u),u.adjustTableWidth(m)}function Dc(e,n){return R(n,function(e){return 0===e.column&&e.isLocked})}function Oc(n,e){return R(e,function(e){return e.column+e.colspan>=n.grid.columns&&e.isLocked})}function Ac(e,n){var t=yr(e);return B(fc(n),function(e,n){return e+t[n.column].map(wr).getOr(0)},0)}function kc(t){return function(n,e){return _i(n,e).filter(function(e){return!(t?Dc:Oc)(n,e)}).map(function(e){return{details:e,pixelDelta:Ac(n,e)}})}}function Ic(t){return function(n,e){return Li(n,e).filter(function(e){return!(t?Dc:Oc)(n,e.cells)})}}function Bc(e,n){var u=$t.fromTable(e);return _i(u,n).bind(function(e){var n=e[e.length-1],t=e[0].column,r=n.column+n.colspan,o=M(O(u.all,function(e){return k(e.cells,function(e){return e.column>=t&&e.column<r})}));return ja(o)}).getOr("")}function Mc(e,n){return _i($t.fromTable(e),n).bind(ja).getOr("")}function Ec(m,d,e){function n(e){return"table"===Ye(Yo(e))}function t(c,l,a,f,s){return function(t,e,o){void 0===o&&(o=!1),nu(t);var n=f(),r=Ve.fromDom(m.getDoc()),u=$o(a,r,g),i={sizing:di(m,t),resize:(ai(m)?du:gu)(),section:function(e){switch(ii(m)){case"section":return Fa();case"sectionCells":return Ha();case"cells":return Va();default:return function(e,n){var t;switch(H($t.fromTable(e).all,function(e){var n=Ci(e);return"header"===n.type?q.from(n.subType):q.none()}).getOr(n)){case"section":return xi();case"sectionCells":return Ri();case"cells":return Di()}}(e,"section")}}(t)};return l(t)?c(n,t,e,u,i).bind(function(e){A(e.newRows,function(e){qu(m,e.dom)}),A(e.newCells,function(e){Uu(m,e.dom)});var r,n=(r=t,e.cursor.fold(function(){return j(nt(r)).filter(Sn).map(function(e){d.clear(r);var n=m.dom.createRng();return n.selectNode(e.dom),m.selection.setRng(n),Mn(e,"data-mce-selected","1"),n})},function(e){var n=La(_a,e),t=m.dom.createRng();return t.setStart(n.element.dom,n.offset),t.setEnd(n.element.dom,n.offset),m.selection.setRng(t),d.clear(r),q.some(t)}));return Sn(t)&&(nu(t),o||Gu(m,t.dom,s)),n.map(function(e){return{rng:e,effect:s}})}):q.none()}}var g=fi(m),r=ai(m)?E:wi;return{deleteRow:t(lf,function(e){return!1===n(m)||1<yu(e).rows},E,e,Sa),deleteColumn:t(cf,function(e){return!1===n(m)||1<yu(e).columns},E,e,Sa),insertRowsBefore:t(tf,x,E,e,Sa),insertRowsAfter:t(rf,x,E,e,Sa),insertColumnsBefore:t(of,x,r,e,Sa),insertColumnsAfter:t(uf,x,r,e,Sa),mergeCells:t(bf,x,E,e,Sa),unmergeCells:t(hf,x,E,e,Sa),pasteColsBefore:t(wf,x,E,e,Sa),pasteColsAfter:t(yf,x,E,e,Sa),pasteRowsBefore:t(Cf,x,E,e,Sa),pasteRowsAfter:t(Sf,x,E,e,Sa),pasteCells:t(vf,x,E,e,Ta),makeCellsHeader:t(gf,x,E,e,Sa),unmakeCellsHeader:t(pf,x,E,e,Sa),makeColumnsHeader:t(af,x,E,e,Sa),unmakeColumnsHeader:t(ff,x,E,e,Sa),makeRowsHeader:t(sf,x,E,e,Sa),makeRowsBody:t(mf,x,E,e,Sa),makeRowsFooter:t(df,x,E,e,Sa),getTableRowType:Tf,getTableCellType:Mc,getTableColType:Bc}}function Pc(e,n,t,r){return D(e,function(e){return function(e,n,t,r){for(var o=Ve.fromTag("tr"),u=0;u<e;u++){var i=r<n||u<t?Ve.fromTag("th"):Ve.fromTag("td");u<t&&Mn(i,"scope","row"),r<n&&Mn(i,"scope","col"),Xt(i,Ve.fromTag("br")),Xt(o,i)}return o}(n,t,r,e)})}function Nc(e,n){e.selection.select(n.dom,!0),e.selection.collapse(!0)}function zc(u,i,c,l,a){var o=Qu(u),f={styles:o,attributes:Ju(u),colGroups:u.getParam("table_use_colgroups",!1,"boolean")};return u.undoManager.ignore(function(){var e=function(e,n,t,r,o,u){void 0===u&&(u=xf);var i,c,l=Ve.fromTag("table"),a="cells"!==o;qn(l,u.styles),En(l,u.attributes),u.colGroups&&Xt(l,(i=n,c=Ve.fromTag("colgroup"),D(i,function(){return Xt(c,Ve.fromTag("col"))}),c));var f,s=Math.min(e,t);a&&0<t&&(f=Ve.fromTag("thead"),Xt(l,f),It(f,Pc(t,n,"sectionCells"===o?s:0,r)));var m=Ve.fromTag("tbody");return Xt(l,m),It(m,Pc(a?e-s:e,n,a?0:t,r)),l}(c,i,a,l,ii(u),f);Mn(e,"data-mce-id","__mce");var n,t,r,o=(n=e,t=Ve.fromTag("div"),r=Ve.fromDom(n.dom.cloneNode(!0)),Xt(t,r),t.dom.innerHTML);u.insertContent(o),u.addVisual()}),kn(Yo(u),'table[data-mce-id="__mce"]').map(function(e){var n,t,r;return ka(u)?Ma(e):Ia(u)?Ea(e):(ui(u)||(n=o.width,T(n)&&-1!==n.indexOf("%")))&&Ba(e),nu(e),Wt(e,"data-mce-id"),t=u,A(dn(e,"tr"),function(e){qu(t,e.dom),A(dn(e,"th,td"),function(e){Uu(t,e.dom)})}),r=u,kn(e,"td,th").each(P(Nc,r)),e.dom}).getOr(null)}function Lc(e,n,t,r,o){function u(e){return f(e)&&0<e}if(void 0===r&&(r={}),u(n)&&u(t)){var i=r.headerRows||0;return zc(e,t,n,r.headerColumns||0,i)}return console.error(o),null}function _c(e){return function(){return e().fold(function(){return[]},function(e){return O(e,function(e){return e.dom})})}}function Wc(t){return function(e){var n=0<e.length?q.some(Xo(e)):q.none();t(n)}}function jc(e,n,t){var r=Kn(e,n,1);1===t||r<=1?Wt(e,n):Mn(e,n,Math.min(t,r))}function Fc(o,e,u){return function(e,n){for(var t=0;t<n.length;t++){var r=o.getStyle(n[t],u);if((e=void 0===e?r:e)!==r)return""}return e}(void 0,o.select("td,th",e))}function Hc(e,n,t){t&&e.formatter.apply("align"+t,{},n)}function Vc(n,t){Rf.each("left center right".split(" "),function(e){n.formatter.remove("align"+e,{},t)})}function qc(e){return Of.test(t=e)||Af.test(t)?q.some({value:(Ae(n=e,"#")?n.substring("#".length):n).toUpperCase()}):q.none();var n,t}function Uc(e){var n=e.toString(16);return(1===n.length?"0"+n:n).toUpperCase()}function Gc(e){return{value:Uc(e.red)+Uc(e.green)+Uc(e.blue)}}function $c(e,n,t,r){return{red:e,green:n,blue:t,alpha:r}}function Kc(e,n,t,r){return $c(parseInt(e,10),parseInt(n,10),parseInt(t,10),parseFloat(r))}function Xc(e){var n=e;return{get:function(){return n},set:function(e){n=e}}}function Yc(e){function n(){return t.get().each(e)}var t=Xc(q.none());return{clear:function(){n(),t.set(q.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(q.some(e))}}}function Jc(){var n=Yc(E);return K(K({},n),{on:function(e){return n.get().each(e)}})}function Qc(e){return be(e,"menu")}function Zc(t,r){return function(e){var n;t.execCommand("mceTableApplyCellStyle",!1,((n={})[r]=e,n))}}function el(n,t,r,o,u){return function(e){return e(Mf(n,t,r,o,u))}}function nl(r,e,o){var n=O(e,function(e){return{text:e.title,value:"#"+qc(r=e.value).orThunk(function(){return function(e){if("transparent"===e)return q.some($c(0,0,0,0));var n=kf.exec(e);if(null!==n)return q.some(Kc(n[1],n[2],n[3],"1"));var t=If.exec(e);return null!==t?q.some(Kc(t[1],t[2],t[3],t[4])):q.none()}(r).map(Gc)}).getOrThunk(function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=r,n.fillRect(0,0,1,1);var t=n.getImageData(0,0,1,1).data;return Gc($c(t[0],t[1],t[2],t[3]))}).value,type:"choiceitem"};var r});return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:0<n.length?n:void 0,allowCustomColors:!1},onAction:function(e){var n,t="remove"===e.value?"":e.value;r.execCommand("mceTableApplyCellStyle",!1,((n={})[o]=t,n))}}]}function tl(n){return function(){var e=n.queryCommandValue("mceTableRowType");n.execCommand("mceTableRowType",!1,{type:"header"===e?"body":"header"})}}function rl(n){return function(){var e=n.queryCommandValue("mceTableColType");n.execCommand("mceTableColType",!1,{type:"th"===e?"td":"th"})}}function ol(e){return Pf.concat((0<(n=Bf(ri(e))).length?q.some({name:"class",type:"listbox",label:"Class",items:n}):q.none()).toArray());var n}function ul(e,n){var t=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Bf(Yu(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===n?[{name:"borderwidth",type:"input",label:"Border width"}].concat(t):t}}function il(u){return function(t,r){var o=t.dom;return{setAttrib:function(e,n){u&&!n||o.setAttrib(r,e,n)},setStyle:function(e,n){u&&!n||o.setStyle(r,e,n)},setFormat:function(e,n){u&&!n||(""===n?t.formatter.remove(e,{value:null},r,!0):t.formatter.apply(e,{value:n},r))}}}}function cl(n){return function(e){return Ae(e,"rgb")?n.toHex(e):e}}function ll(e,n){var t=Ve.fromDom(n);return{borderwidth:Gn(t,"border-width").getOr(""),borderstyle:Gn(t,"border-style").getOr(""),bordercolor:Gn(t,"border-color").map(cl(e)).getOr(""),backgroundcolor:Gn(t,"background-color").map(cl(e)).getOr("")}}function al(e){var o=e[0];return A(e.slice(1),function(e){A(Ue(o),function(r){ae(e,function(e,n){var t=o[r];""!==t&&r===n&&t!==e&&(o[r]="")})})}),o}function fl(e,n,t,r){return w(e,function(e){return!u(t.formatter.matchNode(r,n+e))}).getOr("")}function sl(e,t){var n=$t.fromTable(e);return O(k($t.justCells(n),function(n){return R(t,function(e){return ce(n.element,e)})}),function(e){return{element:e.element.dom,column:$t.getColumnAt(n,e.column).map(function(e){return e.element.dom})}})}function ml(e,n,r,t){var l=t.getData();t.close(),e.undoManager.transact(function(){var o,u=e,i=n,t=r,c=se(o=l,function(e,n){return t[n]!==e});0<ge(c)&&1<=i.length&&rt(i[0]).each(function(e){var s,m,d,n=sl(e,i),t=0<ge(se(c,function(e,n){return"scope"!==n&&"celltype"!==n})),r=Ke(c,"celltype");(t||Ke(c,"scope"))&&(s=u,m=o,d=1===n.length,A(n,function(e){var n,t,r,o,u,i,c=e.element,l=d?Nf.normal(s,c):Nf.ifTruthy(s,c),a=e.column.map(function(e){return d?Nf.normal(s,e):Nf.ifTruthy(s,e)}).getOr(l),f=m;(n=l).setAttrib("scope",f.scope),n.setAttrib("class",f.class),n.setStyle("height",eu(f.height)),a.setStyle("width",eu(f.width)),Zu(s)&&((t=l).setFormat("tablecellbackgroundcolor",(r=m).backgroundcolor),t.setFormat("tablecellbordercolor",r.bordercolor),t.setFormat("tablecellborderstyle",r.borderstyle),t.setFormat("tablecellborderwidth",eu(r.borderwidth))),d&&(Vc(s,c),o=s,u=c,Rf.each("top middle bottom".split(" "),function(e){o.formatter.remove("valign"+e,{},u)})),m.halign&&Hc(s,c,m.halign),!m.valign||(i=m.valign)&&s.formatter.apply("valign"+i,{},c)})),r&&u.execCommand("mceTableCellType",!1,{type:o.celltype,no_events:!0}),Gu(u,e.dom,{structure:r,style:t})}),e.focus()})}function dl(e,n){var t,l,r,o,u,i=Ql(n);0!==i.length&&(l=e,t=al(rt((r=i)[0]).map(function(e){return O(sl(e,r),function(e){return t=l,r=e.element,o=Zu(l),u=e.column,i=t.dom,c=u.getOr(r),K({width:n(c,"width"),height:n(r,"height"),scope:i.getAttrib(r,"scope"),celltype:r.nodeName.toLowerCase(),class:i.getAttrib(r,"class",""),halign:zf(t,r),valign:Lf(t,r)},o?ll(i,r):{});function n(e,n){return i.getStyle(e,n)||i.getAttrib(e,n)}var t,r,o,u,i,c})}).getOrDie()),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:ol(e)},ul(e,"cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:ol(e)}]},e.windowManager.open({title:"Cell Properties",size:"normal",body:Zu(e)?o:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:t,onSubmit:P(ml,e,i,t)}))}function gl(e){return _f.concat((0<(n=Bf(e.getParam("table_row_class_list",[],"array"))).length?q.some({name:"class",type:"listbox",label:"Class",items:n}):q.none()).toArray());var n}function pl(s,m,d,e){var g=e.getData();e.close(),s.undoManager.transact(function(){var e,n,t,i,c,l,a,r=s,o=m,u=d,f=se(e=g,function(e,n){return u[n]!==e});0<ge(f)&&(n=Ke(f,"type"),(t=!n||1<ge(f))&&(i=r,c=e,l=u,a=1===o.length,A(o,function(e){var n,t,r,o=a?Nf.normal(i,e):Nf.ifTruthy(i,e),u=c;(n=o).setAttrib("class",u.class),n.setStyle("height",eu(u.height)),ei(i)&&((t=o).setStyle("background-color",(r=c).backgroundcolor),t.setStyle("border-color",r.bordercolor),t.setStyle("border-style",r.borderstyle)),c.align!==l.align&&(Vc(i,e),Hc(i,e,c.align))})),n&&r.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0}),rt(Ve.fromDom(o[0])).each(function(e){return Gu(r,e.dom,{structure:n,style:t})})),s.focus()})}function bl(i){var e,t,n,r,o,u,c,l=(e=tu(i),t=Xl.selected,r=(n=Jl(e)).bind(function(e){return rt(e)}).map(ot),Wn(n,r,function(n,e){return k(e,function(e){return R(Xo(e.dom.cells),function(e){return"1"===Pn(e,t)||ce(e,n)})})}).getOr([]));0!==l.length&&(o=al(O(l,function(e){return n=i,t=e.dom,r=ei(i),u=n.dom,K({height:u.getStyle(t,"height")||u.getAttrib(t,"height"),class:u.getAttrib(t,"class",""),type:rt(Ve.fromDom(o=t)).map(function(e){var n={selection:Xo(o.cells)};return Tf(e,n)}).getOr(""),align:zf(n,t)},r?ll(u,t):{});var n,t,r,o,u})),u={type:"tabpanel",tabs:[{title:"General",name:"general",items:gl(i)},ul(i,"row")]},c={type:"panel",items:[{type:"grid",columns:2,items:gl(i)}]},i.windowManager.open({title:"Row Properties",size:"normal",body:ei(i)?u:c,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:P(pl,i,O(l,function(e){return e.dom}),o)}))}function hl(u,i,t,e){var c=u.dom,l=e.getData(),a=se(l,function(e,n){return t[n]!==e});e.close(),""===l.class&&delete l.class,u.undoManager.transact(function(){var e,n,t,r,o;i||(e=parseInt(l.cols,10)||1,n=parseInt(l.rows,10)||1,i=zc(u,e,n,0,0)),0<ge(a)&&(function(e,n,t){var r,o=e.dom,u={},i={};if(u.class=t.class,i.height=eu(t.height),o.getAttrib(n,"width")&&!ti(e)?u.width=(r=t.width)?r.replace(/px$/,""):"":i.width=eu(t.width),ti(e)?(i["border-width"]=eu(t.border),i["border-spacing"]=eu(t.cellspacing)):(u.border=t.border,u.cellpadding=t.cellpadding,u.cellspacing=t.cellspacing),ti(e)&&n.children)for(var c=0;c<n.children.length;c++)Wf(o,n.children[c],{"border-width":eu(t.border),padding:eu(t.cellpadding)}),ni(e)&&Wf(o,n.children[c],{"border-color":t.bordercolor});ni(e)&&(i["background-color"]=t.backgroundcolor,i["border-color"]=t.bordercolor,i["border-style"]=t.borderstyle),u.style=o.serializeStyle(K(K({},Qu(e)),i)),o.setAttribs(n,K(K({},Ju(e)),u))}(u,i,l),((t=c.select("caption",i)[0])&&!l.caption||!t&&l.caption)&&u.execCommand("mceTableToggleCaption"),""===l.align?Vc(u,i):Hc(u,i,l.align)),u.focus(),u.addVisual(),0<ge(a)&&(o=!(r=Ke(a,"caption"))||1<ge(a),Gu(u,i,{structure:r,style:o}))})}function vl(e,n){var t,r,o,u,i,c,l,a,f,s,m,d,g,p,b,h,v,w,y,C=e.dom,S=(o=ni(r=e),a=Qu(r),f=Ju(r),s=o?(u=r.dom,{borderstyle:pe(a,"border-style").getOr(""),bordercolor:cl(u)(pe(a,"border-color").getOr("")),backgroundcolor:cl(u)(pe(a,"background-color").getOr(""))}):{},K(K(K(K(K(K({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),a),f),s),(l=a["border-width"],ti(r)&&l?{border:l}:pe(f,"border").fold(function(){return{}},function(e){return{border:e}}))),(i=pe(a,"border-spacing").or(pe(f,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),c=pe(a,"border-padding").or(pe(f,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),K(K({},i),c))));!1===n?(t=C.getParent(e.selection.getStart(),"table",e.getBody()))?(d=t,g=ni(m=e),v=m.dom,w=ti(m)?v.getStyle(d,"border-spacing")||v.getAttrib(d,"cellspacing"):v.getAttrib(d,"cellspacing")||v.getStyle(d,"border-spacing"),y=ti(m)?Fc(v,d,"padding")||v.getAttrib(d,"cellpadding"):v.getAttrib(d,"cellpadding")||Fc(v,d,"padding"),S=K({width:v.getStyle(d,"width")||v.getAttrib(d,"width"),height:v.getStyle(d,"height")||v.getAttrib(d,"height"),cellspacing:w,cellpadding:y,border:(p=v,h=Gn(Ve.fromDom(b=d),"border-width"),ti(m)&&h.isSome()?h.getOr(""):p.getAttrib(b,"border")||Fc(m.dom,b,"border-width")||Fc(m.dom,b,"border")),caption:!!v.select("caption",d)[0],class:v.getAttrib(d,"class",""),align:zf(m,d)},g?ll(v,d):{})):ni(e)&&(S.borderstyle="",S.bordercolor="",S.backgroundcolor=""):(S.cols="1",S.rows="1",ni(e)&&(S.borderstyle="",S.bordercolor="",S.backgroundcolor=""));var T=Bf(oi(e));0<T.length&&S.class&&(S.class=S.class.replace(/\s*mce\-item\-table\s*/g,""));var x,R,D,O,A={type:"grid",columns:2,items:(x=T,R=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],D=e.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],O=0<x.length?[{type:"listbox",name:"class",label:"Class",items:x}]:[],R.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(D).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(O))},k=ni(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[A]},ul(e,"table")]}:{type:"panel",items:[A]};e.windowManager.open({title:"Table Properties",size:"normal",body:k,onSubmit:P(hl,e,t,S),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:S})}function wl(e){return Yl(tu(e),Zo(e))}function yl(l,n,e,a,t){function u(e){return rt(e,d)}function f(t){return Jl(tu(e=l),Zo(e)).bind(function(n){return u(n).map(function(e){return t(e,n)})});var e}function s(e){l.focus()}function r(r,o){return void 0===o&&(o=!1),f(function(e,n){var t=ou(a,e,n);r(e,t,o).each(s)})}function o(){return f(function(e,n){var t,r,o,u=ou(a,e,n),i=$o(E,Ve.fromDom(l.getDoc()),q.none());return t=u,r=i,_i(o=$t.fromTable(e),t).bind(function(e){var n=Ei(N(gt(Mi(o,r,!1)).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),function(e){var n=k(e.cells,function(e){return!e.isLocked});return 0<n.length?[K(K({},e),{cells:n})]:[]}));return jn(0<n.length,n)}).map(function(e){return O(e,function(e){var t=ar(e.element);return A(e.cells,function(e){var n=fr(e.element);Oi(n,"colspan",e.colspan,1),Oi(n,"rowspan",e.rowspan,1),Xt(t,n)}),t})})})}function i(){return f(function(e,n){var t,l,r=ou(a,e,n);return t=r,Wi(l=$t.fromTable(e),t).map(function(e){var r,o,n=e[e.length-1],t=e[0].column,u=n.column+n.colspan,i=function(e,t,r){if($t.hasColumns(e)){var n=O(k($t.justColumns(e),function(e){return e.column>=t&&e.column<r}),function(e){var n=fr(e.element);return jc(n,"span",r-t),n}),o=Ve.fromTag("colgroup");return It(o,n),[o]}return[]}(l,t,u),c=(r=t,o=u,O(l.all,function(e){var n=O(k(e.cells,function(e){return e.column>=r&&e.column<o}),function(e){var n=fr(e.element);return jc(n,"colspan",o-r),n}),t=Ve.fromTag("tr");return It(t,n),t}));return X(X([],i,!0),c,!0)})})}function c(c,e){return e().each(function(e){var i=O(e,fr);f(function(e,n){var t,r,o=Ko(Ve.fromDom(l.getDoc())),u=(t=i,r=o,{selection:ru(a),clipboard:t,generators:r});c(e,u).each(s)})})}function m(t){return function(e,n){return pe(n,"type").each(function(e){r(t(e),n.no_events)})}}var d=Zo(l);ae({mceTableSplitCells:function(){return r(n.unmergeCells)},mceTableMergeCells:function(){return r(n.mergeCells)},mceTableInsertRowBefore:function(){return r(n.insertRowsBefore)},mceTableInsertRowAfter:function(){return r(n.insertRowsAfter)},mceTableInsertColBefore:function(){return r(n.insertColumnsBefore)},mceTableInsertColAfter:function(){return r(n.insertColumnsAfter)},mceTableDeleteCol:function(){return r(n.deleteColumn)},mceTableDeleteRow:function(){return r(n.deleteRow)},mceTableCutCol:function(){return i().each(function(e){t.setColumns(e),r(n.deleteColumn)})},mceTableCutRow:function(){return o().each(function(e){t.setRows(e),r(n.deleteRow)})},mceTableCopyCol:function(){return i().each(function(e){return t.setColumns(e)})},mceTableCopyRow:function(){return o().each(function(e){return t.setRows(e)})},mceTablePasteColBefore:function(){return c(n.pasteColsBefore,t.getColumns)},mceTablePasteColAfter:function(){return c(n.pasteColsAfter,t.getColumns)},mceTablePasteRowBefore:function(){return c(n.pasteRowsBefore,t.getRows)},mceTablePasteRowAfter:function(){return c(n.pasteRowsAfter,t.getRows)},mceTableDelete:function(){return wl(l).each(function(e){rt(e,d).filter(p(d)).each(function(e){var n,t=Ve.fromText("");Dt(e,t),Yt(e),l.dom.isEmpty(l.getBody())?(l.setContent(""),l.selection.setCursorLocation()):((n=l.dom.createRng()).setStart(t.dom,0),n.setEnd(t.dom,0),l.selection.setRng(n),l.nodeChanged())})})},mceTableCellToggleClass:function(e,r){f(function(e){var n=Ql(a),t=z(n,function(e){return l.formatter.match("tablecellclass",{value:r},e.dom)})?l.formatter.remove:l.formatter.apply;A(n,function(e){return t("tablecellclass",{value:r},e.dom)}),Gu(l,e.dom,Ca)})},mceTableToggleClass:function(e,n){f(function(e){l.formatter.toggle("tableclass",{value:n},e.dom),Gu(l,e.dom,Ca)})},mceTableToggleCaption:function(){wl(l).each(function(n){rt(n,d).each(function(r){An(r,"caption").fold(function(){var e,n,t=Ve.fromTag("caption");Xt(t,Ve.fromText("Caption")),n=t,an(e=r,0).fold(function(){Xt(e,n)},function(e){Rt(e,n)}),l.selection.setCursorLocation(t.dom,0)},function(e){en("caption")(n)&&ie("td",r).each(function(e){return l.selection.setCursorLocation(e.dom,0)}),Yt(e)}),Gu(l,r.dom,Sa)})})},mceTableSizingMode:function(e,n){return t=n,wl(l).each(function(e){Ia(l)||ka(l)||ui(l)||rt(e,d).each(function(e){"relative"!==t||Bl(e)?"fixed"!==t||Ml(e)?"responsive"!==t||El(e)||Ea(e):Ma(e):Ba(e),nu(e),Gu(l,e.dom,Sa)})});var t},mceTableCellType:m(function(e){return"th"===e?n.makeCellsHeader:n.unmakeCellsHeader}),mceTableColType:m(function(e){return"th"===e?n.makeColumnsHeader:n.unmakeColumnsHeader}),mceTableRowType:m(function(e){switch(e){case"header":return n.makeRowsHeader;case"footer":return n.makeRowsFooter;default:return n.makeRowsBody}})},function(e,n){return l.addCommand(n,e)}),ae({mceTableProps:P(vl,l,!1),mceTableRowProps:P(bl,l),mceTableCellProps:P(dl,l,a)},function(e,n){return l.addCommand(n,function(){return e()})}),l.addCommand("mceInsertTable",function(e,n){g(n)&&0<Ue(n).length?Lc(l,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):vl(l,!0)}),l.addCommand("mceTableApplyCellStyle",function(e,n){function r(e){return"tablecell"+e.toLowerCase().replace("-","")}var o,t;!g(n)||0!==(o=Ql(a)).length&&(function(e){for(var n in e)if(Ge.call(e,n))return;return 1}(t=se(n,function(e,n){return l.formatter.has(r(n))&&T(e)}))||(ae(t,function(n,t){A(o,function(e){Nf.normal(l,e.dom).setFormat(r(t),n)})}),u(o[0]).each(function(e){return Gu(l,e.dom,Ca)})))})}function Cl(t,e){return rt(t,e).bind(function(e){var n=nt(e);return b(n,function(e){return ce(t,e)}).map(function(e){return{index:e,all:n}})})}function Sl(e,n){var t=e.document.createRange();return t.selectNode(n.dom),t}function Tl(e,n){var t=e.document.createRange();return Jf(t,n),t}function xl(e,n,t){var r,o=e.document.createRange(),u=o;return n.fold(function(e){u.setStartBefore(e.dom)},function(e,n){u.setStart(e.dom,n)},function(e){u.setStartAfter(e.dom)}),r=o,t.fold(function(e){r.setEndBefore(e.dom)},function(e,n){r.setEnd(e.dom,n)},function(e){r.setEndAfter(e.dom)}),o}function Rl(e,n,t,r,o){var u=e.document.createRange();return u.setStart(n.dom,t),u.setEnd(r.dom,o),u}function Dl(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function Ol(e,n,t){return n(Ve.fromDom(t.startContainer),t.startOffset,Ve.fromDom(t.endContainer),t.endOffset)}function Al(e,n){var o,t,r,u=(o=e,n.match({domRange:function(e){return{ltr:C(e),rtl:q.none}},relative:function(e,n){return{ltr:Y(function(){return xl(o,e,n)}),rtl:Y(function(){return q.some(xl(o,n,e))})}},exact:function(e,n,t,r){return{ltr:Y(function(){return Rl(o,e,n,t,r)}),rtl:Y(function(){return q.some(Rl(o,t,r,e,n))})}}}));return(r=(t=u).ltr()).collapsed?t.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Qf.rtl(Ve.fromDom(e.endContainer),e.endOffset,Ve.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Ol(0,Qf.ltr,r)}):Ol(0,Qf.ltr,r)}function kl(u,e){return Al(u,e).match({ltr:function(e,n,t,r){var o=u.document.createRange();return o.setStart(e.dom,n),o.setEnd(t.dom,r),o},rtl:function(e,n,t,r){var o=u.document.createRange();return o.setStart(t.dom,r),o.setEnd(e.dom,n),o}})}function Il(e,n){return{parent:C(q.from(e.dom.documentElement).map(Ve.fromDom).getOr(e)),view:C(e),origin:C(uo(0,0)),isResizable:n}}function Bl(e){return yo(e).exists(function(e){return _l.test(e)})}function Ml(e){return yo(e).exists(function(e){return Wl.test(e)})}function El(e){return yo(e).isNone()}function Pl(){return{transformRow:S,transformCell:Si}}function Nl(o,u){function r(e){if(sc(e))return Ka((t={element:e}).element)?o.colgroup(t):o.row(t);var n,t,r=(n=u(e),$a(n.element)?o.col(n):o.cell(n));return i=q.some({item:e,replacement:r}),r}void 0===u&&(u=mc);var i=q.none();return{getOrInit:function(n,t){return i.fold(function(){return r(n)},function(e){return t(n,e.item)?e.replacement:r(n)})}}}function zl(r){return function(t){function u(e){var n=t.replace(e,r,"td"===r?{scope:null}:{});return i.push({item:e,sub:n}),n}var i=[];return{replaceOrInit:function(n,t){return sc(n)||$a(n)?n:(r=n,o=t,w(i,function(e){return o(e.item,r)}).fold(function(){return u(n)},function(e){return t(n,e.item)?e.sub:u(n)}));var r,o}}}}function Ll(r){return{unmerge:function(t){var e=dc(t);return e.each(function(e){return Mn(t,"scope",e)}),function(){var n=r.cell({element:t,colspan:1,rowspan:1});return $n(n,"width"),$n(t,"width"),e.each(function(e){return Mn(n,"scope",e)}),n}},merge:function(r){return $n(r[0],"width"),function(){var e=_n(O(r,dc));if(0===e.length)return q.none();var n=e[0],t=["row","col"];return R(e,function(e){return e!==n&&y(t,e)})?q.none():q.from(n)}().fold(function(){return Wt(r[0],"scope")},function(e){return Mn(r[0],"scope",e+"group")}),C(r[0])}}}var _l=/(\d+(\.\d+)?)%/,Wl=/(\d+(\.\d+)?)px|em/,jl=en("col"),Fl=C(_l),Hl=en("col"),Vl=function(r){return yo(r).fold(function(){return e=Eo(t=r,vr),n=C(0),{width:e,pixelWidth:e,getWidths:function(e,n){return Bo(e,t,n)},getCellDelta:n,singleColumnWidth:C([0]),minCellWidth:n,setElementWidth:E,adjustTableWidth:E,isRelative:!0,label:"none"};var t,e,n},function(e){return n=r,t=e,(null!==Fl().exec(t)?Po:No)(n);var n,t})},ql=No,Ul=Po,Gl=["img","br"],$l=function(e,u){var i=function(e){for(var n=ln(e),t=n.length-1;0<=t;t--){var r=n[t];if(u(r))return q.some(r);var o=i(r);if(o.isSome())return o}return q.none()};return i(e)},Kl={scope:["row","col"]},Xl={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Yl=uu("th,td,caption"),Jl=uu("th,td"),Ql=ru,Zl=Lr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),ea=K({},Zl),na=mu(function(e){return e<0}),ta=mu(x),ra=Lr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),oa=K(K({},ra),{from:function(e){return ee(e,"%")?pu("%",ra.percent,e):ee(e,"px")?pu("px",ra.pixels,e):ra.invalid(e)}}),ua=function(e){if(0===e.length)return e;var n,t,r=I(e,function(e,n){var t=oa.from(n).fold(function(){return{value:n,remainder:0}},function(e){return n=e,{value:(t=Math.floor(n))+"px",remainder:n-t};var n,t},function(e){return{value:e+"%",remainder:0}});return{output:[t.value].concat(e.output),remainder:e.remainder+t.remainder}},{output:[],remainder:0}),o=r.output;return o.slice(0,o.length-1).concat([(n=o[o.length-1],t=Math.round(r.remainder),oa.from(n).fold(C(n),function(e){return e+t+"px"},function(e){return e+t+"%"}))])},ia=oa.from,ca=Ru(["compare","extract","mutate","sink"]),la=Ru(["element","start","stop","destroy"]),aa=Ru(["forceDrop","drop","move","delayDrop"]),fa=function(e,n,t,r){e.dom.removeEventListener(n,t,r)},sa=x,ma=Ou,da=Eu("ephox-dragster").resolve,ga=ca({compare:function(e,n){return uo(n.left-e.left,n.top-e.top)},extract:function(e){return q.some(uo(e.x,e.y))},sink:function(e,n){var t,r,o,u=(t=n,r=K({layerClass:da("blocker")},t),Mn(o=Ve.fromTag("div"),"role","presentation"),qn(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Bu(o,da("blocker")),Bu(o,r.layerClass),{element:C(o),destroy:function(){Yt(o)}}),i=Au(u.element(),"mousedown",e.forceDrop),c=Au(u.element(),"mouseup",e.drop),l=Au(u.element(),"mousemove",e.move),a=Au(u.element(),"mouseout",e.delayDrop);return la({element:u.element,start:function(e){Xt(e,u.element())},stop:function(){Yt(u.element())},destroy:function(){u.destroy(),c.unbind(),l.unbind(),a.unbind(),i.unbind()}})},mutate:function(e,n){e.mutate(n.left,n.top)}}),pa=function(e){return e.dom.contentEditable},ba=Eu("ephox-snooker").resolve,ha=ba("resizer-bar"),va=ba("resizer-rows"),wa=ba("resizer-cols"),ya=ba("resizer-bar-dragging"),Ca={structure:!1,style:!0},Sa={structure:!0,style:!1},Ta={structure:!0,style:!0},xa={"border-collapse":"collapse",width:"100%"},Ra=D(5,function(e){var n=e+1+"px";return{title:n,value:n}}),Da=O(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],function(e){return{title:e,value:e.toLowerCase()}}),Oa={border:"1"},Aa="preservetable",ka=function(e){return"fixed"===$u(e)||!1===Ku(e)},Ia=function(e){return"responsive"===$u(e)},Ba=function(e){var n=Ro(e);wu(e,q.some(n),q.none()),gi(e)},Ma=function(e){var n=vr(e)+"px";wu(e,q.some(n),q.none()),gi(e)},Ea=function(e){$n(e,"width");var n=tt(e);A(0<n.length?n:nt(e),function(e){$n(e,"width"),gi(e)}),gi(e)},Pa="bar-",Na=function(n,e,t){return n.property().isText(e)&&0===n.property().getText(e).trim().length||n.property().isComment(e)?t(e).bind(function(e){return Na(n,e,t).orThunk(function(){return q.some(e)})}):q.none()},za=function(e,n){var t=Na(e,n,e.query().prevSibling).getOr(n);if(e.property().isText(t))return hi(t,vi(e,t));var r=e.property().children(t);return 0<r.length?za(e,r[r.length-1]):hi(t,vi(e,t))},La=za,_a=Zt(),Wa=en("th"),ja=function(e){var n=k(e,function(e){return Wa(e.element)});return 0===n.length?q.some("td"):n.length===e.length?q.some("th"):q.none()},Fa=xi,Ha=Ri,Va=Di,qa=function(t){return{isValue:x,isError:v,getOr:C(t),getOrThunk:C(t),getOrDie:C(t),or:function(e){return qa(t)},orThunk:function(e){return qa(t)},fold:function(e,n){return n(t)},map:function(e){return qa(e(t))},mapError:function(e){return qa(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return q.some(t)}}},Ua=function(t){return{isValue:v,isError:x,getOr:S,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(t),function(){throw new Error(e)}();var e},or:S,orThunk:function(e){return e()},fold:function(e,n){return e(t)},map:function(e){return Ua(t)},mapError:function(e){return Ua(e(t))},each:E,bind:function(e){return Ua(t)},exists:v,forall:x,toOptional:q.none}},Ga={value:qa,error:Ua,fromOption:function(e,n){return e.fold(function(){return Ua(n)},qa)}},$a=en("col"),Ka=en("colgroup"),Xa=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ya=Zt(),Ja=Sc("thead",!0),Qa=Sc("tbody",!1),Za=Sc("tfoot",!1),ef=zl("th"),nf=zl("td"),tf=zi(function(e,n,t,r){var o=n[0].row;return yc(I(Cc(n),function(e,n){return{grid:nc(e.grid,o,n.row+e.delta,t,r.getOrInit),delta:e.delta+1}},{grid:e,delta:0}).grid,o,n[0].column)},_i,E,E,Nl),rf=zi(function(e,n,t,r){var o=Cc(n),u=o[o.length-1],i=u.row+u.rowspan;return yc(I(o,function(e,n){return nc(e,i,n.row,t,r.getOrInit)},e),i,n[0].column)},_i,E,E,Nl),of=zi(function(e,n,t,r){var o=n.details,u=fc(o),i=u[0].column;return yc(I(u,function(e,n){return{grid:tc(e.grid,i,n.column+e.delta,t,r.getOrInit),delta:e.delta+1}},{grid:e,delta:0}).grid,o[0].row,i)},kc(!0),Rc,E,Nl),uf=zi(function(e,n,t,r){var o=n.details,u=o[o.length-1],i=u.column+u.colspan;return yc(I(fc(o),function(e,n){return tc(e,i,n.column,t,r.getOrInit)},e),o[0].row,i)},kc(!1),Rc,E,Nl),cf=zi(function(e,n,t,r){var o,u,i=fc(n.details),c=(o=e,u=O(i,function(e){return e.column}),N(o,function(e){var n=e.cells,t=I(u,function(e,n){return 0<=n&&n<e.length?e.slice(0,n).concat(e.slice(n+1)):e},n);return 0<t.length?[ye(e.element,t,e.section,e.isNew)]:[]})),l=0<c.length?c[0].cells.length-1:0;return yc(c,i[0].row,Math.min(i[0].column,l))},function(n,e){return Wi(n,e).map(function(e){return{details:e,pixelDelta:-Ac(n,e)}})},Rc,vc,Nl),lf=zi(function(e,n,t,r){var o,u,i,c,l=Cc(n),a=(o=l[0].row,u=l[l.length-1].row,c=(i=gt(e)).rows,i.cols.concat(c.slice(0,o)).concat(c.slice(u+1))),f=0<a.length?a.length-1:0;return yc(a,Math.min(n[0].row,f),n[0].column)},_i,E,vc,Nl),af=zi(function(e,n,t,r){return yc(lc(e,O(fc(n),function(e){return e.column}),!0,t,r.replaceOrInit),n[0].row,n[0].column)},Wi,E,E,ef),ff=zi(function(e,n,t,r){return yc(lc(e,O(fc(n),function(e){return e.column}),!1,t,r.replaceOrInit),n[0].row,n[0].column)},Wi,E,E,nf),sf=zi(Ja,Wi,E,E,ef),mf=zi(Qa,Wi,E,E,nf),df=zi(Za,Wi,E,E,nf),gf=zi(function(e,n,t,r){return yc(ac(e,n,t,r.replaceOrInit),n[0].row,n[0].column)},Wi,E,E,ef),pf=zi(function(e,n,t,r){return yc(ac(e,n,t,r.replaceOrInit),n[0].row,n[0].column)},Wi,E,E,nf),bf=zi(function(e,n,t,r){var o=n.cells;return bc(o),wc(function(e,n,t){var r=gt(e).rows;if(0===r.length)return e;for(var o=n.startRow;o<=n.finishRow;o++)for(var u=n.startCol;u<=n.finishCol;u++){var i=r[o],c=st(i,u).isLocked;ft(i,u,we(t(),!1,c))}return e}(e,n.bounds,r.merge(o)),q.from(o[0]))},Fi,xc,E,Ll),hf=zi(function(e,n,t,r){return wc(I(n,function(e,n){return Vi(e,n,t,r.unmerge(n))},e),q.from(n[0]))},Hi,xc,E,Ll),vf=zi(function(e,n,t,r){var o,u,i=(o=n.clipboard,u=n.generators,Mi($t.fromTable(o),u,!0));return Qi({row:n.row,column:n.column},e,i,n.generators,t).fold(function(){return wc(e,q.some(n.element))},function(e){return yc(e,n.row,n.column)})},function(n,t){return et(t.element).bind(function(e){return Pi(n,e).map(function(e){return K(K({},e),{generators:t.generators,clipboard:t.clipboard})})})},xc,E,Nl),wf=zi(function(e,n,t,r){var o=gt(e).rows,u=n.cells[0].column,i=o[n.cells[0].row];return yc(Zi(u,e,Tc(n.clipboard,n.generators,i),n.generators,t),n.cells[0].row,n.cells[0].column)},Ic(!0),E,E,Nl),yf=zi(function(e,n,t,r){var o=gt(e).rows,u=n.cells[n.cells.length-1].column+n.cells[n.cells.length-1].colspan,i=o[n.cells[0].row];return yc(Zi(u,e,Tc(n.clipboard,n.generators,i),n.generators,t),n.cells[0].row,n.cells[0].column)},Ic(!1),E,E,Nl),Cf=zi(function(e,n,t,r){var o=gt(e).rows,u=n.cells[0].row,i=o[u];return yc(ec(u,e,Tc(n.clipboard,n.generators,i),n.generators,t),n.cells[0].row,n.cells[0].column)},Li,E,E,Nl),Sf=zi(function(e,n,t,r){var o=gt(e).rows,u=n.cells[n.cells.length-1].row+n.cells[n.cells.length-1].rowspan,i=o[n.cells[0].row];return yc(ec(u,e,Tc(n.clipboard,n.generators,i),n.generators,t),n.cells[0].row,n.cells[0].column)},Li,E,E,Nl),Tf=function(e,n){var i=$t.fromTable(e);return _i(i,n).bind(function(e){var n=e[e.length-1],o=e[0].row,u=n.row+n.rowspan;return function(){var e=O(i.all.slice(o,u),function(e){return Ci(e).type}),n=y(e,"header"),t=y(e,"footer");if(n||t){var r=y(e,"body");return!n||r||t?n||r||!t?q.none():q.some("footer"):q.some("header")}return q.some("body")}()}).getOr("")},xf={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Rf=tinymce.util.Tools.resolve("tinymce.util.Tools"),Df=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Of=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Af=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,kf=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,If=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Bf=function(e){return O(e,function(e){var n=e.text||e.title;return Qc(e)?{text:n,items:Bf(e.menu)}:{text:n,value:e.value}})},Mf=function(t,r,e,o,a){return O(e,function(e){var u,i,c,l,n=e.text||e.title;return Qc(e)?{type:"nestedmenuitem",text:n,getSubmenuItems:function(){return Mf(t,r,e.menu,o,a)}}:{text:n,type:"togglemenuitem",onAction:function(){return a(e.value)},onSetup:(u=t,i=r,c=o,l=e.value,function(t){function e(){function e(e){return u.formatter.match(c,{value:l},e.dom,o)}var n=Ql(i);o?(t.setActive(!R(n,e)),r.set(u.formatter.formatChanged(c,function(e){return t.setActive(!e)},!0))):(t.setActive(z(n,e)),r.set(u.formatter.formatChanged(c,t.setActive,!1,{value:l})))}var r=Yc(function(e){return e.unbind()}),o=!ne(l);return u.initialized?e():u.on("init",e),r.clear})}})},Ef=function(e){return N(e,function(e){return Qc(e)?[K(K({},e),{menu:Ef(e.menu)})]:ne(e.value)?[e]:[]})},Pf=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Df}],Nf={normal:il(!1),ifTruthy:il(!0)},zf=P(fl,["left","center","right"],"align"),Lf=P(fl,["top","middle","bottom"],"valign"),_f=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Wf=function(e,n,t,r){if("TD"===n.tagName||"TH"===n.tagName)T(t)?e.setStyle(n,t,r):e.setStyle(n,t);else if(n.children)for(var o=0;o<n.children.length;o++)Wf(e,n.children[o],t,r)},jf={remove_similar:!0,inherit:!1},Ff=K({selector:"td,th"},jf),Hf={tablecellbackgroundcolor:K({styles:{backgroundColor:"%value"}},Ff),tablecellverticalalign:K({styles:{"vertical-align":"%value"}},Ff),tablecellbordercolor:K({styles:{borderColor:"%value"}},Ff),tablecellclass:K({classes:["%value"]},Ff),tableclass:K({selector:"table",classes:["%value"]},jf),tablecellborderstyle:K({styles:{borderStyle:"%value"}},Ff),tablecellborderwidth:K({styles:{borderWidth:"%value"}},Ff)},Vf=Lr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),qf=K(K({},Vf),{none:function(e){return Vf.none(e=void 0===e?void 0:e)}}),Uf=function(e,n,t,r,o){void 0===o&&(o=x);var u=1===r;if(!u&&t<=0)return qf.first(e[0]);if(u&&t>=e.length-1)return qf.last(e[e.length-1]);var i=t+r,c=e[i];return o(c)?qf.middle(n,c):Uf(e,n,i,r,o)},Gf=function(e,n,t,r){return{start:e,soffset:n,finish:t,foffset:r}},$f=Lr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Kf={before:$f.before,on:$f.on,after:$f.after,cata:function(e,n,t,r){return e.fold(n,t,r)},getStart:function(e){return e.fold(S,S,S)}},Xf=Lr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Yf={domRange:Xf.domRange,relative:Xf.relative,exact:Xf.exact,exactFromRange:function(e){return Xf.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var n=e.match({domRange:function(e){return Ve.fromDom(e.startContainer)},relative:function(e,n){return Kf.getStart(e)},exact:function(e,n,t,r){return e}});return Ve.fromDom(tn(n).dom.defaultView)},range:Gf},Jf=function(e,n){return e.selectNodeContents(n.dom)},Qf=Lr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function Zf(e,n,t){return n>=e.left&&n<=e.right&&t>=e.top&&t<=e.bottom}function es(t,r,e,n,o){function l(e){var n=t.dom.createRange();return n.setStart(r.dom,e),n.collapse(!0),n}var u=Et(r).length,i=function(e,n,t,r){if(0===r)return 0;if(e===t)return r-1;for(var o=t,u=1;u<r;u++){var i=l(u).getBoundingClientRect(),c=Math.abs(e-i.left);if(n<=i.bottom){if(n<i.top||o<c)return u-1;o=c}}return 0}(e,n,o.right,u);return l(i)}function ns(e,n){return n-e.left<e.right-n}function ts(e,n,t){var r=e.dom.createRange();return r.selectNode(n.dom),r.collapse(t),r}function rs(n,e,t){var r=n.dom.createRange();r.selectNode(e.dom);var o=ns(r.getBoundingClientRect(),t);return(!0===o?Wo:jo)(e).map(function(e){return ts(n,e,o)})}function os(e,n,t){var r=ns(n.dom.getBoundingClientRect(),t);return q.some(ts(e,n,r))}function us(e,n){var t=Ye(e);return"input"===t?Kf.after(e):y(["br","img"],t)?0===n?Kf.before(e):Kf.after(e):Kf.on(e,n)}function is(e,n){var t=e.fold(Kf.before,us,Kf.after),r=n.fold(Kf.before,us,Kf.after);return Yf.relative(t,r)}function cs(e,n,t,r){var o=us(e,n),u=us(t,r);return Yf.relative(o,u)}function ls(e){return q.from(e.getSelection())}function as(e,n){ls(e).each(function(e){e.removeAllRanges(),e.addRange(n)})}function fs(e,n,t,r,o){as(e,Rl(e,n,t,r,o))}function ss(l,e){return Al(l,e).match({ltr:function(e,n,t,r){fs(l,e,n,t,r)},rtl:function(o,u,i,c){ls(l).each(function(e){if(e.setBaseAndExtent)e.setBaseAndExtent(o.dom,u,i.dom,c);else if(e.extend)try{t=i,r=c,(n=e).collapse(o.dom,u),n.extend(t.dom,r)}catch(e){fs(l,i,c,o,u)}else fs(l,i,c,o,u);var n,t,r})}})}function ms(e,n,t,r,o){ss(e,cs(n,t,r,o))}function ds(e,n,t){ss(e,is(n,t))}function gs(e){if(0<e.rangeCount){var n=e.getRangeAt(0),t=e.getRangeAt(e.rangeCount-1);return q.some(Gf(Ve.fromDom(n.startContainer),n.startOffset,Ve.fromDom(t.endContainer),t.endOffset))}return q.none()}function ps(e){if(null===e.anchorNode||null===e.focusNode)return gs(e);var n,t,r,o,u,i,c,l,a,f,s,m=Ve.fromDom(e.anchorNode),d=Ve.fromDom(e.focusNode);return n=m,t=e.anchorOffset,r=d,o=e.focusOffset,i=t,c=r,l=o,(a=nn(u=n).dom.createRange()).setStart(u.dom,i),a.setEnd(c.dom,l),f=a,s=ce(n,r)&&t===o,f.collapsed&&!s?q.some(Gf(m,e.anchorOffset,d,e.focusOffset)):gs(e)}function bs(e,n,t){as(e,((t=void 0===t||t)?Tl:Sl)(e,n))}function hs(e){return ls(e).filter(function(e){return 0<e.rangeCount}).bind(ps).map(function(e){return Yf.exact(e.start,e.soffset,e.finish,e.foffset)})}function vs(e,n,t){return Zs(e,n,(o=Nu,Cl(r=t,void 0).fold(function(){return qf.none(r)},function(e){return Uf(e.all,r,e.index,1,o)})));var r,o}function ws(e,n){var t=kl(e,n);return Gf(Ve.fromDom(t.startContainer),t.startOffset,Ve.fromDom(t.endContainer),t.endOffset)}function ys(e,n){return{item:e,mode:n}}function Cs(e,n,t,r){return void 0===r&&(r=Ks),e.property().parent(n).map(function(e){return ys(e,r)})}function Ss(n){return function(e){return 0===n.property().children(e).length}}function Ts(e,n){return am(sm,e,Ss(sm),n)}function xs(e,n){return fm(sm,e,Ss(sm),n)}function Rs(e){return In(e,"tr")}function Ds(e){return"br"===Ye(e)}function Os(e,n,t,r){var o,u,i,c,l,a,f;return(Ds(n)?(o=e,(i=r).traverse(u=n).orThunk(function(){return pm(u,i.gather,o)}).map(i.relative)):(c=e,l=r,an(a=n,f=t).filter(Ds).orThunk(function(){return an(a,f-1).filter(Ds)}).bind(function(e){return l.traverse(e).fold(function(){return pm(e,l.gather,c).map(l.relative)},function(e){return rn(r=e).bind(function(n){var t=ln(n);return gm(t,r).map(function(e){return{parent:n,children:t,element:r,index:e}})}).map(function(e){return Kf.on(e.parent,e.index)});var r})}))).map(function(e){return{start:e,finish:e}})}function As(e,n){return{left:e.left,top:e.top+n,right:e.right,bottom:e.bottom+n}}function ks(e,n){return{left:e.left,top:e.top-n,right:e.right,bottom:e.bottom-n}}function Is(e,n,t){return{left:e.left+n,top:e.top+t,right:e.right+n,bottom:e.bottom+t}}function Bs(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Ms(e,n){return q.some(e.getRect(n))}function Es(e,n,t){return gn(n)?Ms(e,n).map(Bs):pn(n)?(r=e,o=n,(0<=(u=t)&&u<Lo(o)?r.getRangedRect(o,u,o,u+1):0<u?r.getRangedRect(o,u-1,o,u):q.none()).map(Bs)):q.none();var r,o,u}function Ps(e,n){return gn(n)?Ms(e,n).map(Bs):pn(n)?e.getRangedRect(n,0,n,Lo(n)).map(Bs):q.none()}function Ns(n,e,r){return Rn(function(e,n){return n(e)},Dn,e,gc,void 0).fold(v,function(e){return Ps(n,e).exists(function(e){return(n=r).left<(t=e).left||Math.abs(t.right-n.left)<1||n.left>t.right;var n,t})})}function zs(n,t,e){var r,o=n.move(e,5),u=vm(t,n,e,o,100).getOr(o),i=u,c=t;return((r=n).point(i)>c.getInnerHeight()?q.some(r.point(i)-c.getInnerHeight()):r.point(i)<0?q.some(-r.point(i)):q.none()).fold(function(){return t.situsFromPoint(u.left,n.point(u))},function(e){return t.scrollBy(0,e),t.situsFromPoint(u.left,n.point(u)-e)})}function Ls(a,f,s,e,m){return In(e,"td,th",f).bind(function(l){return In(l,"table",f).bind(function(e){return n=e,Dn(m,function(e){return rn(e).exists(function(e){return ce(e,n)})},void 0).isSome()?(o=t=a,u=r=f,i=c=s,o.getSelection().bind(function(r){return Os(u,r.finish,r.foffset,i).fold(function(){return q.some(hi(r.finish,r.foffset))},function(e){var n=o.fromSitus(e),t=dm.verify(o,r.finish,r.foffset,n.finish,n.foffset,i.failure,u);return dm.cata(t,function(e){return q.none()},function(){return q.none()},function(e){return q.some(hi(e,0))},function(e){return q.some(hi(e,Lo(e)))})})}).bind(function(e){return ym(t,r,e.element,e.offset,c,20).map(t.fromSitus)}).bind(function(n){return In(n.finish,"td,th",f).map(function(e){return{start:l,finish:e,range:n}})})):q.none();var o,u,i,n,t,r,c})})}function _s(e,n,t,r,o,u){return He().browser.isIE()?q.none():u(r,n).orThunk(function(){return Ls(e,n,t,r,o).map(function(e){var n=e.range;return nm(q.some(rm(n.start,n.soffset,n.finish,n.foffset)),!0)})})}function Ws(e,r){return In(e,"tr",r).bind(function(t){return In(t,"table",r).bind(function(e){var n=dn(e,"tr");return ce(t,n[0])?am(sm,e,function(e){return jo(e).isSome()},r).map(function(e){var n=Lo(e);return nm(q.some(rm(e,n,e,n)),!0)}):q.none()})})}function js(e,r){return In(e,"tr",r).bind(function(t){return In(t,"table",r).bind(function(e){var n=dn(e,"tr");return ce(t,n[n.length-1])?fm(sm,e,function(e){return Wo(e).isSome()},r).map(function(e){return nm(q.some(rm(e,0,e,0)),!0)}):q.none()})})}function Fs(e,n,t,r,o,u,i){return Ls(e,t,r,o,u).bind(function(e){return om(n,t,e.start,e.finish,i)})}function Hs(e,n){return In(e,"td,th",n)}function Vs(n){return function(e){return e===n}}function qs(e){return 37<=e&&e<=40}function Us(l){return{elementFromPoint:function(e,n){return Ve.fromPoint(Ve.fromDom(l.document),e,n)},getRect:function(e){return e.dom.getBoundingClientRect()},getRangedRect:function(e,n,t,r){var o,u,i,c=Yf.exact(e,n,t,r);return i=(o=kl(l,c)).getClientRects(),0<(u=0<i.length?i[0]:o.getBoundingClientRect()).width||0<u.height?q.some(u).map(Dl):q.none()},getSelection:function(){return hs(l).map(function(e){return ws(l,e)})},fromSitus:function(e){var n=Yf.relative(e.start,e.finish);return ws(l,n)},situsFromPoint:function(e,n){return t=e,r=n,o=Ve.fromDom(l.document),Js(o,t,r).map(function(e){return Gf(Ve.fromDom(e.startContainer),e.startOffset,Ve.fromDom(e.endContainer),e.endOffset)}).map(function(e){return tm(e.start,e.soffset,e.finish,e.foffset)});var t,r,o},clearSelection:function(){ls(l).each(function(e){return e.removeAllRanges()})},collapseSelection:function(i){void 0===i&&(i=!1),hs(l).each(function(e){return e.fold(function(e){return e.collapse(i)},function(e,n){var t=i?e:n;ds(l,t,t)},function(e,n,t,r){var o=i?e:t,u=i?n:r;ms(l,o,u,o,u)})})},setSelection:function(e){ms(l,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){ds(l,e,n)},selectNode:function(e){bs(l,e,!1)},selectContents:function(e){bs(l,e)},getInnerHeight:function(){return l.innerHeight},getScrollY:function(){var e=Ve.fromDom(l.document),n=void 0!==e?e.dom:document,t=n.body.scrollLeft||n.documentElement.scrollLeft,r=n.body.scrollTop||n.documentElement.scrollTop;return uo(t,r).top},scrollBy:function(e,n){var t,r=e,o=n,u=Ve.fromDom(l.document);(t=(void 0!==u?u.dom:document).defaultView)&&t.scrollBy(r,o)}}}function Gs(e,n){return{rows:e,cols:n}}function $s(e){return!1===Mu(Ve.fromDom(e.target),"ephox-snooker-resizer-bar")}Qf.ltr,Qf.rtl;function Ks(e,n,t,r){return void 0===r&&(r=um),t.sibling(e,n).map(function(e){return ys(e,r)})}function Xs(o,u,n){function t(e){Wt(e,o.selected),Wt(e,o.firstSelected),Wt(e,o.lastSelected)}function i(e){Mn(e,o.selected,"1")}function c(e){r(e),n()}function r(e){A(dn(e,o.selectedSelector+","+o.firstSelectedSelector+","+o.lastSelectedSelector),t)}return{clearBeforeUpdate:r,clear:c,selectRange:function(e,n,t,r){c(e),A(n,i),Mn(t,o.firstSelected,"1"),Mn(r,o.lastSelected,"1"),u(n,t,r)},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}var Ys=function(e,n,t,r){return pn(n)?(u=n,i=t,c=r,(l=(o=e).dom.createRange()).selectNode(u.dom),H(l.getClientRects(),function(e){return Zf(e,i,c)?q.some(e):q.none()}).map(function(e){return es(o,u,i,c,e)})):(f=n,s=t,m=r,d=(a=e).dom.createRange(),H(ln(f),function(e){return d.selectNode(e.dom),Zf(d.getBoundingClientRect(),s,m)?Ys(a,e,s,m):q.none()}));var o,u,i,c,l,a,f,s,m,d},Js=document.caretPositionFromPoint?function(t,e,n){var r,o;return q.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind(function(e){if(null===e.offsetNode)return q.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),q.some(n)})}:document.caretRangeFromPoint?function(e,n,t){var r,o;return q.from(null===(o=(r=e.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,n,t))}:function(o,u,n){return Ve.fromPoint(o,u,n).bind(function(r){function e(){return e=o,t=u,(0===ln(n=r).length?os:rs)(e,n,t);var e,n,t}return 0===ln(r).length?e():function(e,n,t,r){var o=e.dom.createRange();o.selectNode(n.dom);var u=o.getBoundingClientRect();return function(e,n,t,r){var o=e.dom.createRange();o.selectNode(n.dom);var u=o.getBoundingClientRect(),i=Math.max(u.left,Math.min(u.right,t)),c=Math.max(u.top,Math.min(u.bottom,r));return Ys(e,n,i,c)}(e,n,Math.max(u.left,Math.min(u.right,t)),Math.max(u.top,Math.min(u.bottom,r)))}(o,r,u,n).orThunk(e)})},Qs=tinymce.util.Tools.resolve("tinymce.util.VK"),Zs=function(n,t,e){return e.fold(q.none,q.none,function(e,n){return Wo(n).map(function(e){return u=Yf.exact(e,0,e,0),t=u,o=Yf.getWin(t).dom,r=t.match({domRange:function(e){var n=Ve.fromDom(e.startContainer),t=Ve.fromDom(e.endContainer);return cs(n,e.startOffset,t,e.endOffset)},relative:is,exact:cs}),Al(o,r).match({ltr:n,rtl:n});function n(e,n,t,r){return Rl(o,e,n,t,r)}var t,o,r,u})},function(e){return n.execCommand("mceTableInsertRowAfter"),vs(n,t,e)})},em=["table","li","dl"],nm=function(e,n){return{selection:e,kill:n}},tm=function(e,n,t,r){return{start:Kf.on(e,n),finish:Kf.on(t,r)}},rm=tm,om=function(t,e,r,n,o){return ce(r,n)?q.none():tr(r,n,e).bind(function(e){var n=e.boxes.getOr([]);return 1<n.length?(o(t,n,e.start,e.finish),q.some(nm(q.some(rm(r,0,r,Lo(r))),!0))):q.none()})},um=function(e,n,t,r){void 0===r&&(r=um);var o=e.property().children(n);return t.first(o).map(function(e){return ys(e,r)})},im=[{current:Cs,next:Ks,fallback:q.none()},{current:Ks,next:um,fallback:q.some(Cs)},{current:um,next:um,fallback:q.some(Ks)}],cm=function(n,t,r,o,e){return w(e=void 0===e?im:e,function(e){return e.current===r}).bind(function(e){return e.current(n,t,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return cm(n,t,e,o)})})})},lm=function(n,e,t,r,o,u){return cm(n,e,r,o).bind(function(e){return u(e.item)?q.none():t(e.item)?q.some(e.item):lm(n,e.item,t,e.mode,o,u)})},am=function(e,n,t,r){return lm(e,n,t,Ks,{sibling:function(e,n){return e.query().prevSibling(n)},first:function(e){return 0<e.length?q.some(e[e.length-1]):q.none()}},r)},fm=function(e,n,t,r){return lm(e,n,t,Ks,{sibling:function(e,n){return e.query().nextSibling(n)},first:function(e){return 0<e.length?q.some(e[0]):q.none()}},r)},sm=Zt(),mm=Lr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),dm=K(K({},mm),{verify:function(i,e,n,t,r,c,o){return In(t,"td,th",o).bind(function(u){return In(e,"td,th",o).map(function(o){return ce(u,o)?ce(t,u)&&Lo(u)===r?c(o):mm.none("in same cell"):er(Rs,[u,o]).fold(function(){return n=u,t=(e=i).getRect(o),(r=e.getRect(n)).right>t.left&&r.left<t.right?mm.success():c(o);var e,n,t,r},function(e){return c(o)})})}).getOr(mm.none("default"))},cata:function(e,n,t,r,o){return e.fold(n,t,r,o)}}),gm=function(e,n){return b(e,P(ce,n))},pm=function(e,n,t){return n(e,t).bind(function(e){return pn(e)&&0===Et(e).trim().length?pm(e,n,t):q.some(e)})},bm=Lr([{none:[]},{retry:["caret"]}]),hm={point:function(e){return e.bottom},adjuster:function(e,n,t,r,o){var u=As(o,5);return Math.abs(t.bottom-r.bottom)<1||t.top>o.bottom?bm.retry(u):t.top===o.bottom?bm.retry(As(o,1)):Ns(e,n,o)?bm.retry(Is(u,5,0)):bm.none()},move:As,gather:xs},vm=function(t,r,o,u,i){return 0===i?q.some(u):(n=t,c=u.left,l=r.point(u),n.elementFromPoint(c,l).filter(function(e){return"table"===Ye(e)}).isSome()?(e=i-1,vm(t,r,o,r.move(u,5),e)):t.situsFromPoint(u.left,r.point(u)).bind(function(e){return e.start.fold(q.none,function(n){return Ps(t,n).bind(function(e){return r.adjuster(t,n,e,o,u).fold(q.none,function(e){return vm(t,r,o,e,i-1)})}).orThunk(function(){return q.some(u)})},q.none)}));var e,n,c,l},wm={tryUp:P(zs,{point:function(e){return e.top},adjuster:function(e,n,t,r,o){var u=ks(o,5);return Math.abs(t.top-r.top)<1||t.bottom<o.top?bm.retry(u):t.bottom===o.top?bm.retry(ks(o,1)):Ns(e,n,o)?bm.retry(Is(u,5,0)):bm.none()},move:ks,gather:Ts}),tryDown:P(zs,hm),ieTryUp:function(e,n){return e.situsFromPoint(n.left,n.top-5)},ieTryDown:function(e,n){return e.situsFromPoint(n.left,n.bottom+5)},getJumpSize:C(5)},ym=function(r,o,u,i,c,l){return 0===l?q.none():Tm(r,o,u,i,c).bind(function(e){var n=r.fromSitus(e),t=dm.verify(r,u,i,n.finish,n.foffset,c.failure,o);return dm.cata(t,function(){return q.none()},function(){return q.some(e)},function(e){return ce(u,e)&&0===i?Cm(r,u,i,ks,c):ym(r,o,e,0,c,l-1)},function(e){return ce(u,e)&&i===Lo(e)?Cm(r,u,i,As,c):ym(r,o,e,Lo(e),c,l-1)})})},Cm=function(n,e,t,r,o){return Es(n,e,t).bind(function(e){return Sm(n,o,r(e,wm.getJumpSize()))})},Sm=function(e,n,t){var r=He().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?n.otherRetry(e,t):r.isIE()?n.ieRetry(e,t):q.none()},Tm=function(n,e,t,r,o){return Es(n,t,r).bind(function(e){return Sm(n,o,e)})},xm={traverse:cn,gather:xs,relative:Kf.before,otherRetry:wm.tryDown,ieRetry:wm.ieTryDown,failure:dm.failedDown},Rm={traverse:un,gather:Ts,relative:Kf.before,otherRetry:wm.tryUp,ieRetry:wm.ieTryUp,failure:dm.failedUp},Dm=Vs(38),Om=Vs(40),Am={isBackward:Vs(37),isForward:Vs(39)},km={isBackward:Vs(39),isForward:Vs(37)},Im=tinymce.util.Tools.resolve("tinymce.Env");function Bm(I,B,e){var M=Xs(Xl,function(l,a,f){e.targets().each(function(c){rt(a).each(function(e){var n,o,u,t=fi(I),r=$o(E,Ve.fromDom(I.getDoc()),t),i=(n=c,o=r,_i(u=$t.fromTable(e),n).map(function(e){var n,t,r=Mi(u,o,!1);return{upOrLeftCells:N(Ei(r.slice(0,(n=e)[n.length-1].row+1)),function(e){return O(e.cells.slice(0,n[n.length-1].column+1),function(e){return e.element})}),downOrRightCells:N(Ei(r.slice((t=e)[0].row+t[0].rowspan-1,r.length)),function(e){return O(e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length),function(e){return e.element})})}}));I.fire("TableSelectionChange",{cells:l,start:a,finish:f,otherCells:i})})})},function(){I.fire("TableSelectionClear")});return I.on("init",function(e){var n,t,r,o,u,i,m,d,g,a,c,l,f,s,p,b,h=I.getWin(),v=Yo(I),w=Zo(I),y=(n=Us(h),{clearstate:(c=n,l=v,f=w,s=M,p=Jc(),(t={clearstate:b=p.clear,mousedown:function(e){s.clear(l),Hs(e.target,f).each(p.set)},mouseover:function(e){x(e)},mouseup:function(e){x(e),b()}}).clearstate),mousedown:t.mousedown,mouseover:t.mouseover,mouseup:t.mouseup}),C=(a=Us(h),{keydown:function(e,n,t,r,o,i){var u=e.raw,c=u.which,l=!0===u.shiftKey;return rr(m,g.selectedSelector).fold(function(){return qs(c)&&!l&&g.clearBeforeUpdate(m),Om(c)&&l?P(Fs,a,m,d,xm,r,n,g.selectRange):Dm(c)&&l?P(Fs,a,m,d,Rm,r,n,g.selectRange):Om(c)?P(_s,a,d,xm,r,n,js):Dm(c)?P(_s,a,d,Rm,r,n,Ws):q.none},function(u){function e(e){return function(){return H(e,function(e){return n=e.rows,t=e.cols,r=m,ur(u,n,t,(o=g).firstSelectedSelector,o.lastSelectedSelector).map(function(e){return o.clearBeforeUpdate(r),o.selectRange(r,e.boxes,e.start,e.finish),e.boxes});var n,t,r,o}).fold(function(){return or(m,g.firstSelectedSelector,g.lastSelectedSelector).map(function(e){var n=Om(c)||i.isForward(c)?Kf.after:Kf.before;return a.setRelativeSelection(Kf.on(e.first,0),n(e.table)),g.clear(m),nm(q.none(),!0)})},function(e){return q.some(nm(q.none(),!0))})}}return Om(c)&&l?e([Gs(1,0)]):Dm(c)&&l?e([Gs(-1,0)]):i.isBackward(c)&&l?e([Gs(0,-1),Gs(-1,0)]):i.isForward(c)&&l?e([Gs(0,1),Gs(1,0)]):qs(c)&&!l?T:q.none})()},keyup:function(c,l,a,f,s){return rr(m,g.selectedSelector).fold(function(){var t,r,e,o,u,n=c.raw,i=n.which;return!0===n.shiftKey&&qs(i)?(t=m,r=d,u=g.selectRange,ce(e=l,o=f)&&a===s?q.none():In(e,"td,th",r).bind(function(n){return In(o,"td,th",r).bind(function(e){return om(t,r,n,e,u)})})):q.none()},q.none)}}),S=(r=m=v,o=d=w,u=g=M,i=Us(h),function(e,t){u.clearBeforeUpdate(r),tr(e,t,o).each(function(e){var n=e.boxes.getOr([]);u.selectRange(r,n,e.start,e.finish),i.selectContents(t),i.collapseSelection()})});function T(){return g.clear(m),q.none()}function x(i){p.on(function(e){s.clearBeforeUpdate(l),Hs(i.target,f).each(function(u){tr(e,u,f).each(function(e){var n,t,r,o=e.boxes.getOr([]);1===o.length?(n=o[0],t="false"===pa(n),r=Ln(Pu(i.target),n,ce),t&&r&&(s.selectRange(l,o,n,n),c.selectContents(n))):1<o.length&&(s.selectRange(l,o,e.start,e.finish),c.selectContents(u))})})})}function R(e,n){!0===e.raw.shiftKey&&(n.kill&&e.kill(),n.selection.each(function(e){var n=Yf.relative(e.start,e.finish),t=kl(h,n);I.selection.setRng(t)}))}function D(e){return 0===e.button}I.on("TableSelectorChange",function(e){return S(e.start,e.finish)});var O,A,k=(O=Xc(Ve.fromDom(v)),A=Xc(0),{touchEnd:function(e){var n,t,r=Ve.fromDom(e.target);"td"!==Ye(r)&&"th"!==Ye(r)||(n=O.get(),t=A.get(),ce(n,r)&&e.timeStamp-t<300&&(e.preventDefault(),S(r,r))),O.set(r),A.set(e.timeStamp)}});I.on("dragstart",function(e){y.clearstate()}),I.on("mousedown",function(e){D(e)&&$s(e)&&y.mousedown(ma(e))}),I.on("mouseover",function(e){var n;(void 0===(n=e).buttons||Im.browser.isEdge()&&0===n.buttons||0!=(1&n.buttons))&&$s(e)&&y.mouseover(ma(e))}),I.on("mouseup",function(e){D(e)&&$s(e)&&y.mouseup(ma(e))}),I.on("touchend",k.touchEnd),I.on("keyup",function(e){var n,t,r,o=ma(e);o.raw.shiftKey&&qs(o.raw.which)&&(n=I.selection.getRng(),t=Ve.fromDom(n.startContainer),r=Ve.fromDom(n.endContainer),C.keyup(o,t,n.startOffset,r,n.endOffset).each(function(e){R(o,e)}))}),I.on("keydown",function(e){var n=ma(e);B().each(function(e){return e.hideBars()});var t=I.selection.getRng(),r=Ve.fromDom(t.startContainer),o=Ve.fromDom(t.endContainer),u=Sr(Am,km)(Ve.fromDom(I.selection.getStart()));C.keydown(n,r,t.startOffset,o,t.endOffset,u).each(function(e){R(n,e)}),B().each(function(e){return e.showBars()})}),I.on("NodeChange",function(){var e=I.selection;er(rt,[Ve.fromDom(e.getStart()),Ve.fromDom(e.getEnd())]).fold(function(){return M.clear(v)},E)})}),{clear:M.clear}}function Mm(o,u){function n(n){return d.forall(function(e){return!e[n]})}function e(){return Yl(tu(o),Zo(o)).bind(function(r){return Wn(rt(r),Yl(Ve.fromDom(o.selection.getEnd()),Zo(o)).bind(rt),function(e,n){return ce(e,n)?g(r)?q.some({element:t=r,mergable:q.none(),unmergable:q.none(),selection:[t]}):q.some(ou(u,e,r)):q.none();var t}).bind(S)})}function t(r){return rt(r.element).map(function(e){var t=$t.fromTable(e),n=B(_i(t,r).getOr([]),function(e,n){return n.isLocked&&(e.onAny=!0,0===n.column?e.onFirst=!0:n.column+n.colspan>=t.grid.columns&&(e.onLast=!0)),e},{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Fi(t,r).isSome(),unmergeable:Hi(t,r).isSome(),locked:n}})}function r(){s.set(Y(e)()),d=s.get().bind(t),A(m.get(),function(e){return e()})}function i(n){return n(),m.set(m.get().concat([n])),function(){m.set(k(m.get(),function(e){return e!==n}))}}function c(n,t){return i(function(){return s.get().fold(function(){n.setDisabled(!0)},function(e){n.setDisabled(t(e))})})}function l(n,t,r){return i(function(){return s.get().fold(function(){n.setDisabled(!0),n.setActive(!1)},function(e){n.setDisabled(t(e)),n.setActive(r(e))})})}function a(n){return d.exists(function(e){return e.locked[n]})}function f(n,t){return function(e){return l(e,function(e){return g(e.element)},function(){return o.queryCommandValue(n)===t})}}var s=Xc(q.none()),m=Xc([]),d=q.none(),g=en("caption"),p=f("mceTableRowType","header"),b=f("mceTableColType","th");return o.on("NodeChange ExecCommand TableSelectorChange",r),{onSetupTable:function(e){return c(e,function(e){return!1})},onSetupCellOrRow:function(e){return c(e,function(e){return g(e.element)})},onSetupColumn:function(n){return function(e){return c(e,function(e){return g(e.element)||a(n)})}},onSetupPasteable:function(n){return function(e){return c(e,function(e){return g(e.element)||n().isNone()})}},onSetupPasteableColumn:function(n,t){return function(e){return c(e,function(e){return g(e.element)||n().isNone()||a(t)})}},onSetupMergeable:function(e){return c(e,function(e){return n("mergeable")})},onSetupUnmergeable:function(e){return c(e,function(e){return n("unmergeable")})},resetTargets:r,onSetupTableWithCaption:function(e){return l(e,v,function(e){return rt(e.element,Zo(o)).exists(function(e){return An(e,"caption").isSome()})})},onSetupTableRowHeaders:p,onSetupTableColumnHeaders:b,targets:s.get}}Yr.add("table",function(c){var e,n,t,r,o,u,i,l,a,f,s,m,d=(e=function(){return Yo(c)},n=function(){return Jl(tu(c),Zo(c))},t=Xl.selectedSelector,{get:function(){return Ur(e(),t).fold(function(){return n().fold($r,Xr)},function(e){return Kr(e)})}}),g=Mm(c,d),p=bi(c),b=Bm(c,p.lazyResize,g),h=Ec(c,b,p.lazyWire),v=(r=Jc(),o=Jc(),{getRows:r.get,setRows:function(e){e.fold(r.clear,r.set),o.clear()},clearRows:r.clear,getColumns:o.get,setColumns:function(e){e.fold(o.clear,o.set),r.clear()},clearColumns:o.clear});return yl(c,h,0,d,v),f=h,s=d,m=Zo(a=c),ae({mceTableRowType:function(){return w(f.getTableRowType)},mceTableCellType:function(){return w(f.getTableCellType)},mceTableColType:function(){return w(f.getTableColType)}},function(e,n){return a.addQueryValueHandler(n,e)}),iu(c,d,h),function(n,e,t,r){function o(e){return function(){return n.execCommand(e)}}function u(e){n.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})}var i={text:"Table properties",onSetup:t.onSetupTable,onAction:o("mceTableProps")},c={text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,onAction:o("mceTableDelete")};n.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:t.onSetupPasteable(r.getRows)}),n.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:t.onSetupPasteable(r.getRows)});var l={type:"nestedmenuitem",text:"Row",getSubmenuItems:C("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};n.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:t.onSetupColumn("onFirst")}),n.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:t.onSetupColumn("onLast")}),n.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:t.onSetupPasteableColumn(r.getColumns,"onFirst")}),n.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:t.onSetupPasteableColumn(r.getColumns,"onLast")});var a={type:"nestedmenuitem",text:"Column",getSubmenuItems:C("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};n.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:t.onSetupMergeable}),n.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:t.onSetupUnmergeable});var f={type:"nestedmenuitem",text:"Cell",getSubmenuItems:C("tablecellprops tablemergecells tablesplitcells")};!1===n.getParam("table_grid",!0,"boolean")?n.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):n.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:u}]}}),n.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),n.ui.registry.addMenuItem("tableprops",i),n.ui.registry.addMenuItem("deletetable",c),n.ui.registry.addNestedMenuItem("row",l),n.ui.registry.addNestedMenuItem("column",a),n.ui.registry.addNestedMenuItem("cell",f),n.ui.registry.addContextMenu("table",{update:function(){return t.resetTargets(),t.targets().fold(C(""),function(e){return"caption"===Ye(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"})}});var s=Ef(oi(n));0!==s.length&&n.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Mf(n,e,s,"tableclass",function(e){return n.execCommand("mceTableToggleClass",!1,e)})},onSetup:t.onSetupTable});var m=Ef(ri(n));0!==m.length&&n.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Mf(n,e,m,"tablecellclass",function(e){return n.execCommand("mceTableCellToggleClass",!1,e)})},onSetup:t.onSetupCellOrRow}),n.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Mf(n,e,Df,"tablecellverticalalign",Zc(n,"vertical-align"))},onSetup:t.onSetupCellOrRow}),n.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Mf(n,e,Xu(n),"tablecellborderwidth",Zc(n,"border-width"))},onSetup:t.onSetupCellOrRow}),n.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Mf(n,e,Yu(n),"tablecellborderstyle",Zc(n,"border-style"))},onSetup:t.onSetupCellOrRow}),n.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:t.onSetupTableWithCaption}),n.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return nl(n,si(n),"background-color")},onSetup:t.onSetupCellOrRow}),n.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return nl(n,mi(n),"border-color")},onSetup:t.onSetupCellOrRow}),n.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:tl(n),onSetup:t.onSetupTableRowHeaders}),n.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:rl(n),onSetup:t.onSetupTableColumnHeaders})}(c,d,g,v),function(n,e,t,r){function o(e){return function(){return n.execCommand(e)}}n.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}}),n.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:t.onSetupTable}),n.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:t.onSetupTable}),n.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:t.onSetupMergeable}),n.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),n.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),n.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),n.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:t.onSetupCellOrRow}),n.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:t.onSetupPasteable(r.getRows)}),n.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:t.onSetupPasteable(r.getRows)}),n.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:t.onSetupColumn("onAny")}),n.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:t.onSetupPasteableColumn(r.getColumns,"onFirst")}),n.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:t.onSetupPasteableColumn(r.getColumns,"onLast")}),n.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var u=Ef(oi(n));0!==u.length&&n.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:el(n,e,u,"tableclass",function(e){return n.execCommand("mceTableToggleClass",!1,e)}),onSetup:t.onSetupTable});var i=Ef(ri(n));0!==i.length&&n.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:el(n,e,i,"tablecellclass",function(e){return n.execCommand("mceTableCellToggleClass",!1,e)}),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:el(n,e,Df,"tablecellverticalalign",Zc(n,"vertical-align")),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:el(n,e,Xu(n),"tablecellborderwidth",Zc(n,"border-width")),onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:el(n,e,Yu(n),"tablecellborderstyle",Zc(n,"border-style")),onSetup:t.onSetupCellOrRow}),n.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:t.onSetupTableWithCaption}),n.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(nl(n,si(n),"background-color"))},onSetup:t.onSetupCellOrRow}),n.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(nl(n,mi(n),"border-color"))},onSetup:t.onSetupCellOrRow}),n.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:tl(n),onSetup:t.onSetupTableRowHeaders}),n.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:rl(n),onSetup:t.onSetupTableColumnHeaders})}(c,d,g,v),0<(l=(i=c).getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")).length&&i.ui.registry.addContextToolbar("table",{predicate:function(e){return i.dom.is(e,"table")&&i.getBody().contains(e)},items:l,scope:"node",position:"node"}),c.on("PreInit",function(){c.serializer.addTempAttr(Xl.firstSelected),c.serializer.addTempAttr(Xl.lastSelected),c.formatter.register(Hf)}),c.getParam("table_tab_navigation",!0,"boolean")&&c.on("keydown",function(e){var n,t,r,o,u=c,i=b;(n=e).keyCode===Qs.TAB&&(t=Yo(u),r=function(e){var n=Ye(e);return ce(e,t)||y(em,n)},o=u.selection.getRng(),et(Ve.fromDom(n.shiftKey?o.startContainer:o.endContainer),r).each(function(e){n.preventDefault(),rt(e,r).each(i.clear),u.selection.collapse(n.shiftKey),(n.shiftKey?function(e,n,t){return Zs(e,n,(o=Nu,Cl(r=t,void 0).fold(function(){return qf.none()},function(e){return Uf(e.all,r,e.index,-1,o)})));var r,o}:vs)(u,r,e).each(function(e){u.selection.setRng(e)})}))}),c.on("remove",function(){p.destroy()}),{insertTable:(u=c,function(e,n,t){var r=Lc(u,n,e,t=void 0===t?{}:t,"Invalid values for insertTable - rows and columns values are required to insert a table.");return u.undoManager.add(),r}),setClipboardRows:Wc(v.setRows),getClipboardRows:_c(v.getRows),setClipboardCols:Wc(v.setColumns),getClipboardCols:_c(v.getColumns),resizeHandler:p,selectionTargets:g};function w(r){return Jl(tu(a)).bind(function(t){return rt(t,m).map(function(e){var n=ou(s,e,t);return r(e,n)})}).getOr("")}})}();
/trunk/vendor/tinymce/tinymce/plugins/template/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/template/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function o(e){return function(){return e}}function e(e){return e}function i(e){return n=typeof(t=e),"string"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n}var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return typeof e===t};function s(e){return e.getParam("template_mdate_classes","mdate")}function l(e){return e.getParam("template_replace_values")}function m(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))}function f(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function p(e,t,n){void 0===n&&(n=new Date);var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),c="January February March April May June July August September October November December".split(" ");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",f(n.getMonth()+1,2))).replace("%d",f(n.getDate(),2))).replace("%H",""+f(n.getHours(),2))).replace("%M",""+f(n.getMinutes(),2))).replace("%S",""+f(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(c[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")}function x(n,e){return O.each(e,function(e,t){u(e)&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n}function d(e,t){var r=e.dom,a=l(e);O.each(r.select("*",t),function(n){O.each(a,function(e,t){r.hasClass(n,t)&&u(e)&&e(n)})})}function g(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}function y(t,e,n){var r=t.dom,a=t.selection.getContent();n=x(n,l(t));var o=r.create("div",null,n),c=r.select(".mceTmpl",o);c&&0<c.length&&(o=r.create("div",null)).appendChild(c[0].cloneNode(!0)),O.each(r.select("*",o),function(e){g(e,t.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(e.innerHTML=p(t,t.getParam("template_cdate_format",t.translate("%Y-%m-%d")))),g(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=p(t,m(t))),g(e,t.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(e.innerHTML=a)}),d(t,o),t.execCommand("mceInsertContent",!1,o.innerHTML),t.addVisual()}function r(){return b}var c=o(!(t="function")),v=o(!0),O=tinymce.util.Tools.resolve("tinymce.util.Tools"),h=tinymce.util.Tools.resolve("tinymce.util.XHR"),b={fold:function(e,t){return e()},isSome:c,isNone:v,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:e,orThunk:a,map:r,each:function(){},bind:r,exists:c,forall:v,filter:function(){return b},toArray:function(){return[]},toString:o("none()")};function a(e){return e()}function T(M,t){function l(e,t){return function(e,t,n){for(var r=0,a=e.length;r<a;r++){var o=e[r];if(t(o,r))return P.some(o);if(n(o,r))break}return P.none()}(e,function(e){return e.text===t},c)}function i(e){M.windowManager.alert("Could not load the specified template.",function(){return e.focus("template")})}function u(e){return new _(function(t,n){e.value.url.fold(function(){return t(e.value.content.getOr(""))},function(e){return h.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})})})}!function(){if(t&&0!==t.length)return P.from(O.map(t,function(e,t){function n(e){return void 0!==e.url}return{selected:0===t,text:e.title,value:{url:n(e)?P.from(e.url):P.none(),content:n(e)?P.none():P.from(e.content),description:e.description}}}));var e=M.translate("No templates defined.");return M.notificationManager.open({text:e,type:"info"}),P.none()}().each(function(o){function b(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){var e=t.getData();l(n,e.template).each(function(e){u(e).then(function(e){M.execCommand("mceInsertTemplate",!1,e),t.close()}).catch(function(){t.disable("save"),i(t)})})},onChange:(r=n=o,a=c,function(n,e){var t;"template"===e.name&&(t=n.getData().template,l(r,t).each(function(t){n.block("Loading..."),u(t).then(function(e){a(n,t,e)}).catch(function(){a(n,t,""),n.disable("save"),i(n)})}))})};var r,a,n}var T=function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r++){var a=e[r];n[r]={text:a.text,value:a.text}}return n}(o),c=function(e,t,n){var r,a,o,c,l,i,u,s,m,f,p,d,g,y=(r=M,-1===(a=n).indexOf("<html>")&&(o="",c=r.getParam("content_style","","string"),l=r.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"",O.each(r.contentCSS,function(e){o+='<link type="text/css" rel="stylesheet" href="'+r.documentBaseURI.toAbsolute(e)+'"'+l+">"}),c&&(o+='<style type="text/css">'+c+"</style>"),i=-1===(g=(p=r).getParam("body_class","","string")).indexOf("=")?g:(d=p).getParam("body_class","","hash")[d.id]||"",u=r.dom.encode,s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(S.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",f=(m=r.getBody().dir)?' dir="'+u(m)+'"':"",a='<!DOCTYPE html><html><head><base href="'+u(r.documentBaseURI.getURI())+'">'+o+s+'</head><body class="'+u(i)+'"'+f+">"+a+"</body></html>"),x(a,r.getParam("template_preview_replace_values"))),v=[{type:"selectbox",name:"template",label:"Templates",items:T},{type:"htmlpanel",html:'<p aria-live="polite">'+t.value.description.replace(/["'<>&]/g,function(e){return(C(t=A,n=e)?P.from(t[n]):P.none()).getOr(e);var t,n})+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],h={template:t.text,preview:y};e.unblock(),e.redial(b(v,h)),e.focus("template")},t=M.windowManager.open(b([],{template:"",preview:""}));t.block("Loading..."),u(o[0]).then(function(e){c(t,o[0],e)}).catch(function(){c(t,o[0],""),t.disable("save"),i(t)})})}var M=function(n){function e(){return a}function t(e){return e(n)}var r=o(n),a={fold:function(e,t){return t(n)},isSome:v,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return M(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:b},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},P={some:M,none:r,from:function(e){return null==e?b:M(e)}},S=tinymce.util.Tools.resolve("tinymce.Env"),_=tinymce.util.Tools.resolve("tinymce.util.Promise"),w=Object.hasOwnProperty,C=function(e,t){return w.call(e,t)},A={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"};n.add("template",function(e){function t(){return n.execCommand("mceTemplate")}var n,r,a,o,c,l;(n=e).ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:t}),n.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:t}),(a=e).addCommand("mceInsertTemplate",function(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}(y,a)),a.addCommand("mceTemplate",(l=o=a,c=function(e){T(l,e)},function(){var e=o.getParam("templates");u(e)?e(c):i(e)?h.send({url:e,success:function(e){c(JSON.parse(e))}}):c(e)})),(r=e).on("PreProcess",function(e){var t=r.dom,n=m(r);O.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(O.each(t.select("*",e),function(e){t.hasClass(e,s(r).replace(/\s+/g,"|"))&&(e.innerHTML=p(r,n))}),d(r,e))})})})}();
/trunk/vendor/tinymce/tinymce/plugins/textcolor/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/textcolor/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){})}();
/trunk/vendor/tinymce/tinymce/plugins/textpattern/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/textpattern/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function a(t,n,r){if(r||2===arguments.length)for(var e,o=0,a=n.length;o<a;o++)!e&&o in n||((e=e||Array.prototype.slice.call(n,0,o))[o]=n[o]);return t.concat(e||Array.prototype.slice.call(n))}function n(e){return function(t){return r=typeof(n=t),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r}}function e(){}function i(t){return function(){return t}}function o(t){return t}function r(){return m}var f=n("string"),c=n("object"),s=n("array"),l=i(!1),d=i(!0),m={fold:function(t,n){return t()},isSome:l,isNone:d,getOr:o,getOrThunk:g,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:o,orThunk:g,map:r,each:e,bind:r,exists:l,forall:d,filter:function(){return m},toArray:function(){return[]},toString:i("none()")};function g(t){return t()}function p(t,n){return-1<E.call(t,n)}function h(t,n){for(var r=t.length,e=new Array(r),o=0;o<r;o++){var a=t[o];e[o]=n(a,o)}return e}function v(t,n){for(var r=0,e=t.length;r<e;r++)n(t[r],r)}function y(t,n){for(var r=[],e=0,o=t.length;e<o;e++){var a=t[e];n(a,e)&&r.push(a)}return r}function b(t,e,o){return function(t){for(var n,r=t.length-1;0<=r;r--)n=t[r],o=e(o,n,r)}(t),o}function k(t,n){for(var r=0,e=t.length;r<e;++r)if(!0!==n(t[r],r))return;return 1}var O=function(r){function t(){return o}function n(t){return t(r)}var e=i(r),o={fold:function(t,n){return n(r)},isSome:d,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(t){return O(t(r))},each:function(t){t(r)},bind:n,exists:n,forall:n,filter:function(t){return t(r)?o:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},w={some:O,none:r,from:function(t){return null==t?m:O(t)}},C=Array.prototype.slice,E=Array.prototype.indexOf,x=Object.keys,R=Object.hasOwnProperty;function T(t){var n=[],r=[];return v(t,function(t){t.fold(function(t){n.push(t)},function(t){r.push(t)})}),{errors:n,values:r}}function P(t){return"inline-command"===t.type||"inline-format"===t.type}function N(t){return"block-command"===t.type||"block-format"===t.type}function S(o){function a(t){return ut.error({message:t,pattern:o})}function t(t,n,r){if(void 0===o.format)return void 0!==o.cmd?f(o.cmd)?ut.value(r(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var e=void 0;if(s(o.format)){if(!k(o.format,f))return a(t+" pattern has non-string items in the `format` array");e=o.format}else{if(!f(o.format))return a(t+" pattern has non-string `format` parameter");e=[o.format]}return ut.value(n(e))}if(!c(o))return a("Raw pattern is not an object");if(!f(o.start))return a("Raw pattern is missing `start` parameter");if(void 0===o.end)return void 0!==o.replacement?f(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):ut.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!f(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var r=o.start,e=o.end;return 0===e.length&&(e=r,r=""),t("Inline",function(t){return{type:"inline-format",start:r,end:e,format:t}},function(t,n){return{type:"inline-command",start:r,end:e,cmd:t,value:n}})}function M(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0}function A(t){return{inlinePatterns:y(t,P),blockPatterns:(n=y(t,N),r=function(t,n){return t.start.length===n.start.length?0:t.start.length>n.start.length?-1:1},(e=C.call(n,0)).sort(r),e)};var n,r,e}function B(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=ft.console;r&&(r.error||r.log).apply(r,t)}function D(t){var n=t.getParam("forced_root_block","p");return!1===n?"":!0===n?"p":n}function I(t,n){return{container:t,offset:n}}function j(t){return t.nodeType===Node.TEXT_NODE}function _(t,n,r,e){void 0===e&&(e=!0);var o=n.startContainer.parentNode,a=n.endContainer.parentNode;n.deleteContents(),e&&!r(n.startContainer)&&(j(n.startContainer)&&0===n.startContainer.data.length&&t.remove(n.startContainer),j(n.endContainer)&&0===n.endContainer.data.length&&t.remove(n.endContainer),pt(t,o,r),o!==a&&pt(t,a,r))}function U(t,n){var r,e=n.get(t);return s(e)&&(0<(r=e).length?w.some(r[0]):w.none()).exists(function(t){return R.call(t,"block")})}function L(t){return 0===t.start.length}function V(t,n){var r=w.from(t.dom.getParent(n.startContainer,t.dom.isBlock));return""===D(t)?r.orThunk(function(){return w.some(t.getBody())}):r}function W(n){return function(t){return n===t?-1:0}}function q(t,n,r){if(j(t)&&0<=n)return w.some(I(t,n));var e=gt(ht);return w.from(e.backwards(t,n,W(t),r)).map(function(t){return I(t.container,t.container.data.length)})}function F(t,n,r){if(j(n)&&(r<0||r>n.data.length))return[];for(var e=[r],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i<a.childNodes.length;i++)if(a.childNodes[i]===o){e.push(i);break}o=a}return o===t?e.reverse():[]}function G(t,n,r,e,o){return{start:F(t,n,r),end:F(t,e,o)}}function H(t,n){var r=n.slice(),e=r.pop(),o=r,a=function(t,n){return t.bind(function(t){return w.from(t.childNodes[n])})},i=w.some(t);return v(o,function(t,n){i=a(i,t)}),i.bind(function(t){return j(t)&&(e<0||e>t.data.length)?w.none():w.some({node:t,offset:e})})}function J(n,r){return H(n,r.start).bind(function(t){var o=t.node,a=t.offset;return H(n,r.end).map(function(t){var n=t.node,r=t.offset,e=document.createRange();return e.setStart(o,a),e.setEnd(n,r),e})})}function K(e,o,n){!function(t,n){if(j(t)&&t.length<=0)return w.some(I(t,0));var r=gt(ht);return w.from(r.forwards(t,0,W(t),n)).map(function(t){return I(t.container,0)})}(o,o).each(function(t){var r=t.container;yt(r,n.start.length,o).each(function(t){var n=e.createRng();n.setStart(r,0),n.setEnd(t.container,t.offset),_(e,n,function(t){return t===o})})})}function X(e,a){var i=e.dom,t=e.selection.getRng();return V(e,t).filter(function(t){var n=D(e),r=""===n&&i.is(t,"body")||i.is(t,n);return null!==t&&r}).bind(function(n){var r,e=n.textContent,t=a,o=(r=e).replace("\xa0"," ");return function(t,n,r){for(var e=0,o=t.length;e<o;e++){var a=t[e];if(n(a,e))return w.some(a);if(r(a,e))break}return w.none()}(t,function(t){return 0===r.indexOf(t.start)||0===o.indexOf(t.start)},l).map(function(t){return dt.trim(e).length===t.start.length?[]:[{pattern:t,range:G(i.getRoot(),n,0,n,0)}]})}).getOr([])}function z(t,n){return t.create("span",{"data-mce-type":"bookmark",id:n})}function Q(t,n){var r=t.createRng();return r.setStartAfter(n.start),r.setEndBefore(n.end),r}function Y(t,n,r){var e=J(t.getRoot(),r).getOrDie("Unable to resolve path range"),o=e.startContainer,a=e.endContainer,i=0===e.endOffset?a:a.splitText(e.endOffset),u=0===e.startOffset?o:o.splitText(e.startOffset);return{prefix:n,end:i.parentNode.insertBefore(z(t,n+"-end"),i),start:u.parentNode.insertBefore(z(t,n+"-start"),u)}}function Z(t,n,r){pt(t,t.get(n.prefix+"-end"),r),pt(t,t.get(n.prefix+"-start"),r)}function $(n,t,r){n.selection.setRng(r),"inline-format"===t.type?v(t.format,function(t){n.formatter.apply(t)}):n.execCommand(t.cmd,!1,t.value)}function tt(r,e,o){var a=r.selection.getRng();return!1===a.collapsed?[]:V(r,a).bind(function(t){var n=a.startOffset-(o?1:0);return Ot(r,e,a.startContainer,n,t)}).fold(function(){return[]},function(t){return t.matches})}function nt(p,t){var h,n,o,r,e,a,i;0!==t.length&&(h=p.dom,n=p.selection.getBookmark(),o=h,r=t,e=(new Date).getTime(),a="mce_textpattern_"+Math.floor(1e9*Math.random())+ ++bt+String(e),i=b(r,function(t,n){var r=Y(o,a+"_end"+t.length,n.endRng);return t.concat([u(u({},n),{endMarker:r})])},[]),v(b(i,function(t,n){var r=i.length-t.length-1,e=L(n.pattern)?n.endMarker:Y(o,a+"_start"+r,n.startRng);return t.concat([u(u({},n),{startMarker:e})])},[]),function(t){function n(t){return t===g}var r,e,o,a,i,u,f,c,s,l,d,m,g=h.getParent(t.startMarker.start,h.isBlock);L(t.pattern)?(e=t.pattern,o=t.endMarker,a=n,i=Q((r=p).dom,o),_(r.dom,i,a),$(r,e,i)):(u=p,f=t.pattern,c=t.startMarker,s=t.endMarker,l=n,d=u.dom,m=Q(d,s),_(d,Q(d,c),l),_(d,m,l),$(u,f,Q(d,{prefix:c.prefix,start:c.end,end:s.start}))),Z(h,t.endMarker,n),Z(h,t.startMarker,n)}),p.selection.moveToBookmark(n))}function rt(t,n){var r=tt(t,n.inlinePatterns,!0);0<r.length&&t.undoManager.transact(function(){nt(t,r)})}function et(t,n,r){for(var e=0;e<t.length;e++)if(r(t[e],n))return 1}function ot(n,r){var e=[",",".",";",":","!","?"],o=[32];n.on("keydown",function(t){13!==t.keyCode||lt.modifierPressed(t)||!function(o,t){if(o.selection.isCollapsed()){var a=tt(o,t.inlinePatterns,!1),u=X(o,t.blockPatterns);return(0<u.length||0<a.length)&&(o.undoManager.add(),o.undoManager.extra(function(){o.execCommand("mceInsertNewLine")},function(){var i,t,n;o.insertContent("\ufeff"),nt(o,a),i=o,0!==(t=u).length&&(n=i.selection.getBookmark(),v(t,function(t){return e=(n=i).dom,o=(r=t).pattern,a=J(e.getRoot(),r.range).getOrDie("Unable to resolve path range"),V(n,a).each(function(t){"block-format"===o.type?U(o.format,n.formatter)&&n.undoManager.transact(function(){K(n.dom,t,o),n.formatter.apply(o.format)}):"block-command"===o.type&&n.undoManager.transact(function(){K(n.dom,t,o),n.execCommand(o.cmd,!1,o.value)})}),1;var n,r,e,o,a}),i.selection.moveToBookmark(n));var r=o.selection.getRng(),e=q(r.startContainer,r.startOffset,o.dom.getRoot());o.execCommand("mceInsertNewLine"),e.each(function(t){var n=t.container;"\ufeff"===n.data.charAt(t.offset-1)&&(n.deleteData(t.offset-1,1),pt(o.dom,n.parentNode,function(t){return t===o.dom.getRoot()}))})}),1)}}(n,r.get())||t.preventDefault()},!0),n.on("keyup",function(t){et(o,t,function(t,n){return t===n.keyCode&&!1===lt.modifierPressed(n)})&&rt(n,r.get())}),n.on("keypress",function(t){et(e,t,function(t,n){return t.charCodeAt(0)===n.charCode})&&st.setEditorTimeout(n,function(){rt(n,r.get())})})}!function(i){if(!s(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var u=[],r={};v(i,function(t,e){var n=x(t);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],a=t[o];if(void 0!==r[o])throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!s(a))throw new Error("case arguments must be an array");u.push(o),r[o]=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+n);return{fold:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+t.length);return t[e].apply(null,r)},match:function(t){var n=x(t);if(u.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!k(u,function(t){return p(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));return t[o].apply(null,r)},log:function(t){console.log(t,{constructors:u,constructor:o,params:r})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var at=function(r){return{isValue:d,isError:l,getOr:i(r),getOrThunk:i(r),getOrDie:i(r),or:function(t){return at(r)},orThunk:function(t){return at(r)},fold:function(t,n){return n(r)},map:function(t){return at(t(r))},mapError:function(t){return at(r)},each:function(t){t(r)},bind:function(t){return t(r)},exists:function(t){return t(r)},forall:function(t){return t(r)},toOptional:function(){return w.some(r)}}},it=function(r){return{isValue:l,isError:d,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(r),function(){throw new Error(t)}();var t},or:o,orThunk:function(t){return t()},fold:function(t,n){return t(r)},map:function(t){return it(r)},mapError:function(t){return it(t(r))},each:e,bind:function(t){return it(r)},exists:l,forall:d,toOptional:w.none}},ut={value:at,error:it,fromOption:function(t,n){return t.fold(function(){return it(n)},at)}},ft="undefined"!=typeof window?window:Function("return this;")(),ct=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],st=tinymce.util.Tools.resolve("tinymce.util.Delay"),lt=tinymce.util.Tools.resolve("tinymce.util.VK"),dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),mt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),gt=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),pt=function(t,n,r){var e;n&&t.isEmpty(n)&&!r(n)&&(e=n.parentNode,t.remove(n),pt(t,e,r))},ht=mt.DOM,vt=function(t,r,e){if(!j(t))return w.none();var n=t.textContent;if(0<=r&&r<=n.length)return w.some(I(t,r));var o=gt(ht);return w.from(o.backwards(t,r,W(t),e)).bind(function(t){var n=t.container.data;return vt(t.container,r+n.length,e)})},yt=function(t,n,r){if(!j(t))return w.none();var e=t.textContent;if(n<=e.length)return w.some(I(t,n));var o=gt(ht);return w.from(o.forwards(t,n,W(t),r)).bind(function(t){return yt(t.container,n-e.length,r)})},bt=0,kt=function(e,o,a,t){var i,n,r,u,f,c,s,l=o.start;return n=t.container,r=t.offset,i=l,u=function(t,n){var r=t.data.substring(0,n),e=r.lastIndexOf(i.charAt(i.length-1)),o=r.lastIndexOf(i);return-1!==o?o+i.length:-1!==e?e+1:-1},f=a,s=gt(e,(c=e,function(t){return c.isBlock(t)||p(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===c.getContentEditable(t)})),w.from(s.backwards(n,r,u,f)).bind(function(r){if(r.offset>=l.length){var t=e.createRng();return t.setStart(r.container,r.offset-l.length),t.setEnd(r.container,r.offset),w.some(t)}var n=r.offset-l.length;return vt(r.container,n,a).map(function(t){var n=e.createRng();return n.setStart(t.container,t.offset),n.setEnd(r.container,r.offset),n}).filter(function(t){return t.toString()===l}).orThunk(function(){return kt(e,o,a,I(r.container,0))})})},Ot=function(l,d,m,g,p){var h=l.dom;return q(m,g,h.getRoot()).bind(function(t){var n=h.createRng();n.setStart(p,0),n.setEnd(m,g);for(var r,e=n.toString(),o=0;o<d.length;o++){var a,i,u=d[o],f=u.end;i=r=void 0;if(a=(r=e).length-f.length,""===(i=f)||r.length>=i.length&&r.substr(a,a+i.length)===i){var c=d.slice();c.splice(o,1);var s=function(a,i,u){var f=a.dom,c=f.getRoot(),s=u.pattern,l=u.position.container,d=u.position.offset;return vt(l,d-u.pattern.end.length,i).bind(function(t){var r=G(c,t.container,t.offset,l,d);if(L(s))return w.some({matches:[{pattern:s,startRng:r,endRng:r}],position:t});var n=Ot(a,u.remainingPatterns,t.container,t.offset,i),e=n.getOr({matches:[],position:t}),o=e.position;return function(t,r,n,e,o,a){if(void 0===a&&(a=!1),0!==r.start.length||a)return q(n,e,o).bind(function(n){return kt(t,r,o,n).bind(function(t){if(a){if(t.endContainer===n.container&&t.endOffset===n.offset)return w.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return w.none()}return w.some(t)})});var i=t.createRng();return i.setStart(n,e),i.setEnd(n,e),w.some(i)}(f,s,o.container,o.offset,i,n.isNone()).map(function(t){var n=G(c,t.startContainer,t.startOffset,t.endContainer,t.endOffset);return{matches:e.matches.concat([{pattern:s,startRng:n,endRng:r}]),position:I(t.startContainer,t.startOffset)}})})}(l,p,{pattern:u,remainingPatterns:c,position:t});if(s.isSome())return s}}return w.none()})};t.add("textpattern",function(r){var t,n,e,o=(t=function(){var t=r.getParam("textpattern_patterns",ct,"array");if(!s(t))return B("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=T(h(t,S));return v(n.errors,function(t){return B(t.message,t.pattern),0}),A(n.values)}(),n=t,{get:function(){return n},set:function(t){n=t}});return ot(r,o),e=o,{setPatterns:function(t){var n=T(h(t,S));if(0<n.errors.length){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}e.set(A(n.values))},getPatterns:function(){return a(a([],h(e.get().inlinePatterns,M),!0),h(e.get().blockPatterns,M),!0)}}})}();
/trunk/vendor/tinymce/tinymce/plugins/toc/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/toc/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function a(t){return t.getParam("toc_class","mce-toc")}function s(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"}function u(n){return function(t){function e(){return t.setDisabled(n.mode.isReadOnly()||!(0<g(n).length))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}function d(t){var e,n,o,i="",r=g(t),c=function(t){for(var e=9,n=0;n<t.length;n++)if(1===(e=t[n].level<e?t[n].level:e))return e;return e}(r)-1;if(!r.length)return"";i+=(e=s(t),n=v.translate("Table of Contents"),o="</"+e+">","<"+e+' contenteditable="true">'+m.DOM.encode(n)+o);for(var l=0;l<r.length;l++){var a=r[l];a.element.id=a.id;var u=r[l+1]&&r[l+1].level;if(c===a.level)i+="<li>";else for(var d=c;d<a.level;d++)i+="<ul><li>";if(i+='<a href="#'+a.id+'">'+a.title+"</a>",u!==a.level&&u)for(d=a.level;u<d;d--)i+=d===u+1?"</li></ul><li>":"</li></ul>";else i+="</li>",u||(i+="</ul>");c=a.level}return i}function f(t){var e=a(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})}var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.util.I18n"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=(t=0,function(){return"mcetoc_"+(new Date).getTime().toString(32)+(t++).toString(32)}),g=function(n){var t,o=a(n),e=s(n),i=function(t){for(var e=[],n=1;n<=t;n++)e.push("h"+n);return e.join(",")}(1<=(t=parseInt(n.getParam("toc_depth","3"),10))&&t<=9?t:3),r=n.$(i);return r.length&&/^h[1-9]$/i.test(e)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),c.map(r,function(t){return{id:t.id||l(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})};e.add("toc",function(t){var c,e,n,o,i,r;function l(){return i.execCommand("mceInsertToc")}(c=t).addCommand("mceInsertToc",function(){var t,e,n,o,i,r;o=a(t=c),i=t.$("."+o),r=t,!i.length||0<r.dom.getParents(i[0],".mce-offscreen-selection").length?t.insertContent((n=d(e=t),'<div class="'+e.dom.encode(a(e))+'" contenteditable="false">'+n+"</div>")):f(t)}),c.addCommand("mceUpdateToc",function(){f(c)}),(i=t).ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:l,onSetup:u(i)}),i.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return i.execCommand("mceUpdateToc")}}),i.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:l,onSetup:u(i)}),i.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(r=i,function(t){return t&&r.dom.is(t,"."+a(r))&&r.getBody().contains(t)}),scope:"node",position:"node"}),n=(e=t).$,o=a(e),e.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),e.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})})}();
/trunk/vendor/tinymce/tinymce/plugins/visualblocks/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/visualblocks/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function f(t,o,e){var n,i;t.dom.toggleClass(t.getBody(),"mce-visualblocks"),e.set(!e.get()),n=t,i=e.get(),n.fire("VisualBlocks",{state:i})}function g(e,n){return function(o){function t(t){return o.setActive(t.state)}return o.setActive(n.get()),e.on("VisualBlocks",t),function(){return e.off("VisualBlocks",t)}}}tinymce.util.Tools.resolve("tinymce.PluginManager").add("visualblocks",function(t,o){var e,n,i,s,c,u,l,a=(e=!1,{get:function(){return e},set:function(t){e=t}});function r(){return s.execCommand("mceVisualBlocks")}i=a,(n=t).addCommand("mceVisualBlocks",function(){f(n,0,i)}),(s=t).ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:r,onSetup:g(s,c=a)}),s.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:r,onSetup:g(s,c)}),l=a,(u=t).on("PreviewFormats AfterPreviewFormats",function(t){l.get()&&u.dom.toggleClass(u.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),u.on("init",function(){u.getParam("visualblocks_default_state",!1,"boolean")&&f(u,0,l)})})}();
/trunk/vendor/tinymce/tinymce/plugins/visualchars/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/visualchars/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function n(t){return function(n){return typeof n===t}}function i(n){return function(){return n}}function t(n){return n}function e(){return l}var o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n){return e=typeof(t=n),(null===t?"null":"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e)===o;var t,e},c=n("boolean"),a=n("number"),s=i(!(o="string")),f=i(!0),l={fold:function(n,t){return n()},isSome:s,isNone:f,getOr:t,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:d,map:e,each:function(){},bind:e,exists:s,forall:f,filter:function(){return l},toArray:function(){return[]},toString:i("none()")};function d(n){return n()}function m(n,t){for(var e=0,o=n.length;e<o;e++)t(n[e],e)}function v(n,t){for(var e=h(n),o=0,r=e.length;o<r;o++){var i=e[o];t(n[i],i)}}var g=function(e){function n(){return r}function t(n){return n(e)}var o=i(e),r={fold:function(n,t){return t(e)},isSome:f,isNone:s,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return g(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?r:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},h=Object.keys;function p(n){return n.dom.nodeValue}function y(n,t,e){!function(n,t,e){if(!(u(e)||c(e)||a(e)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}(n.dom,t,e)}function b(n,t){n.dom.removeAttribute(t)}function w(n,t){var e,o=null===(e=n.dom.getAttribute(t))?void 0:e;return void 0===o||""===o?[]:o.split(" ")}function T(n){return void 0!==n.dom.classList}function k(n,t){return i=t,0<(o=function(n){for(var t=[],e=0,o=n.length;e<o;e++){var r=n[e];r!==i&&t.push(r)}return t}(w(e=n,"class"))).length?y(e,"class",o.join(" ")):b(e,"class"),0;var e,i,o}function N(n,t){var e="";return v(n,function(n,t){e+=t}),new RegExp("["+e+"]",t?"g":"")}function A(n){return'<span data-mce-bogus="1" class="mce-'+H[n]+'">'+n+"</span>"}function O(n){var t=p(n);return j(n)&&void 0!==t&&_.test(t)}function C(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")}function S(f,n){m(K(M.fromDom(n),O),function(n){var t,e,o,r,i,u=n.dom.parentNode;if(C(u))t=M.fromDom(u),e=U,T(t)?t.dom.classList.add(e):(r=e,i=w(o=t,"class").concat([r]),y(o,"class",i.join(" ")));else{for(var c,a=f.dom.encode(p(n)).replace(F,A),s=f.dom.create("div",null,a);c=s.lastChild;)f.dom.insertAfter(c,n.dom);f.dom.remove(n.dom)}})}function D(r,n){m(r.dom.select(I,n),function(n){var t,e,o;C(n)?(t=M.fromDom(n),e=U,T(t)?t.dom.classList.remove(e):k(t,e),0===(T(o=t)?o.dom.classList:w(o,"class")).length&&b(o,"class")):r.dom.remove(n,!0)})}function E(n){var t=n.getBody(),e=n.selection.getBookmark(),o=function(n,t){for(;n.parentNode;){if(n.parentNode===t)return n;n=n.parentNode}}(n.selection.getNode(),t);D(n,o=void 0!==o?o:t),S(n,o),n.selection.moveToBookmark(e)}function L(n,t){var e=n,o=t.get();e.fire("VisualChars",{state:o});var r=n.getBody();(!0===t.get()?S:D)(n,r)}function x(n,t){n.addCommand("mceVisualChars",function(){!function(n,t){t.set(!t.get());var e=n.selection.getBookmark();L(n,t),n.selection.moveToBookmark(e)}(n,t)})}function B(e,o){return function(t){function n(n){return t.setActive(n.state)}return t.setActive(o.get()),e.on("VisualChars",n),function(){return e.off("VisualChars",n)}}}"undefined"!=typeof window||Function("return this;")();function P(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:n}}var V,j=function(n){return 3===n.dom.nodeType},M={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return P(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return P(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return P(e)},fromDom:P,fromPoint:function(n,t,e){return(null==(o=n.dom.elementFromPoint(t,e))?l:g(o)).map(P);var o}},H={"\xa0":"nbsp","\xad":"shy"},_=N(H),F=N(H,!0),I=(V="",v(H,function(n){V&&(V+=","),V+="span.mce-"+n}),V),U="mce-nbsp",K=function(n,t){var e=[];return m(function(n,t){for(var e=n.length,o=new Array(e),r=0;r<e;r++){var i=n[r];o[r]=t(i,r)}return o}(n.dom.childNodes,M.fromDom),function(n){e=(e=t(n)?e.concat([n]):e).concat(K(n,t))}),e},R=tinymce.util.Tools.resolve("tinymce.util.Delay");r.add("visualchars",function(n){var t,e,o,r,i,u,c,a,s,f,l=(t=n.getParam("visualchars_default_state",!1),e=t,{get:function(){return e},set:function(n){e=n}});function d(){return o.execCommand("mceVisualChars")}return x(n,l),(o=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:d,onSetup:B(o,r=l)}),o.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:d,onSetup:B(o,r)}),i=n,u=l,c=R.debounce(function(){E(i)},300),!1!==i.getParam("forced_root_block")&&i.on("keydown",function(n){!0===u.get()&&(13===n.keyCode?E(i):c())}),i.on("remove",c.stop),s=l,(a=n).on("init",function(){L(a,s)}),f=l,{isEnabled:function(){return f.get()}}})}();
/trunk/vendor/tinymce/tinymce/plugins/wordcount/plugin.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/plugins/wordcount/plugin.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function r(t){return t}function g(t){for(var e=a,n=c.length,r=0;r<n;++r){var o=c[r];if(o&&o.test(t)){e=r;break}}return e}function d(t,e,n,r){for(var o,u,c,a,i,s,g,d,l,p=[],h=[],f=0;f<n.length;++f)h.push(t[f]),function(t,e){var n=t[e],r=t[e+1];if(!(e<0||e>t.length-1&&0!==e||0===n&&0===r)){var o=t[e+2];if(0!==n||2!==r&&1!==r&&12!==r||0!==o){var u=t[e-1];return(2!==n&&1!==n&&12!==r||0!==r||0!==u)&&(4!==n&&0!==n||4!==r&&0!==r)&&(3!==n&&1!==n||4!==r||4!==u)&&(4!==n||3!==r&&1!==r||4!==o)&&8!==n&&9!==n&&8!==u&&9!==u&&8!==r&&9!==r&&(5!==n||6!==r)&&(7===n||5===n||6===n||7===r||5===r||6===r||(10!==n||10!==r)&&(11!==r||0!==n&&4!==n&&10!==n&&11!==n)&&(11!==n||0!==r&&4!==r&&10!==r)&&12!==n)}}}(n,f)&&(o=e[f],!r.includeWhitespace&&W.test(o)||!r.includePunctuation&&E.test(o)||(u=f-h.length+1,"http"!==(a=e.slice(u,c=f+1).join(""))&&"https"!==a||(d=f,l=void 0,l=function(t){for(var e=d+1;e<t.length&&!W.test(t[e]);e++);return e}(g=e),i="://"===g.slice(d+1,l).join("").substr(0,3)?l:d,s=t.slice(c,i),Array.prototype.push.apply(h,s),f=i),p.push(h)),h=[]);return p}function o(t,e){for(var n,r=e.getBlockElements(),o=e.getShortEndedElements(),u=[],c="",a=new s(t,t);t=a.next();)3===t.nodeType?c+=t.data.replace(/\uFEFF/g,""):(r[(n=t).nodeName]||o[n.nodeName])&&c.length&&(u.push(c),c="");return c.length&&u.push(c),u}function n(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length}function l(t,e){var n=o(t,e).join("\n").replace(/\u200B/g,"");return i(n.split(""),r).length}function p(t,e){return n(o(t,e).join(""))}function h(t,e){return n(o(t,e).join("").replace(/\s/g,""))}function f(t,e){return function(){return e(t.getBody(),t.schema)}}function C(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}}function y(t){return f(t,l)}function v(t,e){var n=e;t.fire("wordCountUpdate",{wordCount:{words:n.body.getWordCount(),characters:n.body.getCharacterCount(),charactersWithoutSpaces:n.body.getCharacterCountWithoutSpaces()}})}var w,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=function(){return(m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},e=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp("[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]"),new RegExp("[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]"),new RegExp("[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]"),new RegExp("[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]"),new RegExp("\\r"),new RegExp("\\n"),new RegExp("[\v\f\x85\u2028\u2029]"),new RegExp("[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]"),new RegExp("[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]"),new RegExp("[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]"),new RegExp("[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]"),new RegExp("@")],u=new RegExp("^[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]$"),c=e,a=13,W=/^\s+$/,E=u,i=function(t,e,n){n=m(m({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var r=[],o=[],u=0;u<t.length;u++){var c=e(t[u]);"\ufeff"!==c&&(r.push(t[u]),o.push(c))}var a,i,s=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var u=t[o];r[o]=e(u,o)}return r}(o,(a=g,i={},function(t){if(i[t])return i[t];var e=a(t);return i[t]=e}));return d(r,o,s,n)},s=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),x=tinymce.util.Tools.resolve("tinymce.util.Delay");void 0===w&&(w=300),t.add("wordcount",function(t){var e,n,r,o,u,c,a,i={body:{getWordCount:y(t),getCharacterCount:f(t,p),getCharacterCountWithoutSpaces:f(t,h)},selection:{getWordCount:C(t,l),getCharacterCount:C(t,p),getCharacterCountWithoutSpaces:C(t,h)},getCount:y(t)};function s(){return e.execCommand("mceWordCount")}return a=i,(c=t).addCommand("mceWordCount",function(){var t=a;c.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(t.body.getWordCount()),String(t.selection.getWordCount())],["Characters (no spaces)",String(t.body.getCharacterCountWithoutSpaces()),String(t.selection.getCharacterCountWithoutSpaces())],["Characters",String(t.body.getCharacterCount()),String(t.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}),(e=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:s}),e.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:s}),n=t,r=i,o=w,u=x.debounce(function(){return v(n,r)},o),n.on("init",function(){v(n,r),x.setEditorTimeout(n,function(){n.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",u)},0)}),i})}();
/trunk/vendor/tinymce/tinymce/themes/mobile/theme.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
/trunk/vendor/tinymce/tinymce/themes/mobile/theme.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";var y=function(){return(y=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)};function c(n,e){var t={};for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t}function u(n,e,t){if(t||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||((o=o||Array.prototype.slice.call(e,0,r))[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))}function n(o){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===o;var e,t}}function e(e){return function(n){return typeof n===e}}function t(e){return function(n){return e===n}}function l(n){return!(null==n)}function Y(){}function i(t,o){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(o.apply(null,n))}}function w(n){return function(){return n}}function K(n){return n}function o(n,e){return n===e}var r=n("string"),a=n("object"),D=n("array"),s=t(null),d=e("boolean"),f=t(void 0),m=e("function"),g=e("number");function J(o){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=r.concat(n);return o.apply(null,t)}}function Q(e){return function(n){return!e(n)}}function h(n){return function(){throw new Error(n)}}function p(n){return n()}function v(){return b}var S=w(!1),x=w(!0),b={fold:function(n,e){return n()},isSome:S,isNone:x,getOr:K,getOrThunk:O,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:w(null),getOrUndefined:w(void 0),or:K,orThunk:O,map:v,each:Y,bind:v,exists:S,forall:x,filter:function(){return b},toArray:function(){return[]},toString:w("none()")};function O(n){return n()}function k(t){var o,r=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return r||(r=!0,o=t.apply(null,n)),o}}function T(n,e){return-1<pn.call(n,e)}function C(n,e){for(var t=0,o=n.length;t<o;t++)if(e(n[t],t))return 1}function Z(n,e){for(var t=n.length,o=new Array(t),r=0;r<t;r++){var i=n[r];o[r]=e(i,r)}return o}function M(n,e){for(var t=0,o=n.length;t<o;t++)e(n[t],t)}function E(n,e){for(var t=[],o=0,r=n.length;o<r;o++){var i=n[o];e(i,o)&&t.push(i)}return t}function _(n,o,r){return function(n){for(var e,t=n.length-1;0<=t;t--)e=n[t],r=o(r,e,t)}(n),r}function R(n,t,o){return M(n,function(n,e){o=t(o,n,e)}),o}function F(n,e){return function(n,e,t){for(var o=0,r=n.length;o<r;o++){var i=n[o];if(e(i,o))return mn.some(i);if(t(i,o))break}return mn.none()}(n,e,S)}function I(n,e){for(var t=0,o=n.length;t<o;t++)if(e(n[t],t))return mn.some(t);return mn.none()}function V(n){for(var e=[],t=0,o=n.length;t<o;++t){if(!D(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);hn.apply(e,n[t])}return e}function B(n,e){return V(Z(n,e))}function A(n,e){for(var t=0,o=n.length;t<o;++t)if(!0!==e(n[t],t))return!1;return!0}function N(n){var e=gn.call(n,0);return e.reverse(),e}function H(n,e){return E(n,function(n){return!T(e,n)})}function P(n){return[n]}function z(n,e){for(var t=0;t<n.length;t++){var o=e(n[t],t);if(o.isSome())return o}return mn.none()}function j(n,e){var t=String(e).toLowerCase();return F(n,function(n){return n.search(t)})}function L(n,e){return-1!==n.indexOf(e)}function $(e){return function(n){return L(n,e)}}function G(n){return window.matchMedia(n).matches}function U(n){return w("alloy."+n)}function W(n,e){se(n,n.element,e,{})}function X(n,e,t){se(n,n.element,e,t)}function q(n){W(n,Zn())}function nn(n,e,t){se(n,e,t,{})}function en(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var o=t;if(void 0!==o.matches)return o.matches(e);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(e);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(e);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}function tn(n){return 1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount}function on(n,e){var t=void 0===e?document:e.dom;return tn(t)?[]:Z(t.querySelectorAll(n),fe.fromDom)}function rn(n,e){var t=void 0===e?document:e.dom;return tn(t)?mn.none():mn.from(t.querySelector(n)).map(fe.fromDom)}function un(n,e){return n.dom===e.dom}function cn(){return vn(0,0)}function an(n){function e(n){return function(){return t===n}}var t=n.current,o=n.version;return{current:t,version:o,isEdge:e("Edge"),isChrome:e("Chrome"),isIE:e("IE"),isOpera:e("Opera"),isFirefox:e(Sn),isSafari:e("Safari")}}function sn(n){function e(n){return function(){return t===n}}var t=n.current,o=n.version;return{current:t,version:o,isWindows:e(Tn),isiOS:e("iOS"),isAndroid:e(Cn),isOSX:e("OSX"),isLinux:e("Linux"),isSolaris:e(En),isFreeBSD:e(Dn),isChromeOS:e(Mn)}}function fn(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:n}}var ln,dn=function(t){function n(){return r}function e(n){return n(t)}var o=w(t),r={fold:function(n,e){return e(t)},isSome:x,isNone:S,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return dn(n(t))},each:function(n){n(t)},bind:e,exists:e,forall:e,filter:function(n){return n(t)?r:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return r},mn={some:dn,none:v,from:function(n){return null==n?b:dn(n)}},gn=Array.prototype.slice,pn=Array.prototype.indexOf,hn=Array.prototype.push,vn=function(n,e){return{major:n,minor:e}},bn={nu:vn,detect:function(n,e){var t,o,r=String(e).toLowerCase();return 0===n.length?cn():(o=function(n,e){for(var t=0;t<n.length;t++){var o=n[t];if(o.test(e))return o}}(n,t=r))?vn(i(1),i(2)):{major:0,minor:0};function i(n){return Number(t.replace(o,"$"+n))}},unknown:cn},yn=(ln=/^\s+|\s+$/g,function(n){return n.replace(ln,"")}),xn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,wn={browsers:w([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return L(n,"edge/")&&L(n,"chrome")&&L(n,"safari")&&L(n,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,xn],search:function(n){return L(n,"chrome")&&!L(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return L(n,"msie")||L(n,"trident")}},{name:"Opera",versionRegexes:[xn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$("firefox")},{name:"Safari",versionRegexes:[xn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(L(n,"safari")||L(n,"mobile/"))&&L(n,"applewebkit")}}]),oses:w([{name:"Windows",search:$("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return L(n,"iphone")||L(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$("linux"),versionRegexes:[]},{name:"Solaris",search:$("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},Sn="Firefox",On=function(){return an({current:void 0,version:bn.unknown()})},kn=an,Tn=(w("Edge"),w("Chrome"),w("IE"),w("Opera"),w(Sn),w("Safari"),"Windows"),Cn="Android",En="Solaris",Dn="FreeBSD",Mn="ChromeOS",_n=function(){return sn({current:void 0,version:bn.unknown()})},Rn=sn,Fn=(w(Tn),w("iOS"),w(Cn),w("Linux"),w("OSX"),w(En),w(Dn),w(Mn),k(function(){return n=navigator.userAgent,e=mn.from(navigator.userAgentData),t=G,p=wn.browsers(),h=wn.oses(),v=e.bind(function(n){return o=p,z(n.brands,function(e){var t=e.brand.toLowerCase();return F(o,function(n){var e;return t===(null===(e=n.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(n){return{current:n.name,version:bn.nu(parseInt(e.version,10),0)}})});var o}).orThunk(function(){return j(p,t=n).map(function(n){var e=bn.detect(n.versionRegexes,t);return{current:n.name,version:e}});var t}).fold(On,kn),b=j(h,o=n).map(function(n){var e=bn.detect(n.versionRegexes,o);return{current:n.name,version:e}}).fold(_n,Rn),{browser:v,os:b,deviceType:(i=v,u=n,c=t,a=(r=b).isiOS()&&!0===/ipad/i.test(u),s=r.isiOS()&&!a,l=(f=r.isiOS()||r.isAndroid())||c("(pointer:coarse)"),d=a||!s&&f&&c("(min-device-width:768px)"),m=s||f&&!d,g=i.isSafari()&&r.isiOS()&&!1===/safari/i.test(u),{isiPad:w(a),isiPhone:w(s),isTablet:w(d),isPhone:w(m),isTouch:w(l),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:w(g),isDesktop:w(!m&&!d&&!g)})};var n,e,t,o,r,i,u,c,a,s,f,l,d,m,g,p,h,v,b})),In=w,Vn=In("touchstart"),Bn=In("touchmove"),An=In("touchend"),Nn=In("mousedown"),Hn=In("mousemove"),Pn=In("mouseup"),zn=In("mouseover"),jn=In("keydown"),Ln=In("keyup"),$n=In("input"),Gn=In("change"),Un=In("click"),Wn=In("transitionend"),Xn=In("selectstart"),qn={tap:U("tap")},Yn=U("focus"),Kn=U("blur.post"),Jn=U("paste.post"),Qn=U("receive"),Zn=U("execute"),ne=U("focus.item"),ee=qn.tap,te=U("longpress"),oe=U("system.init"),re=U("system.attached"),ie=U("system.detached"),ue=U("focusmanager.shifted"),ce=U("highlight"),ae=U("dehighlight"),se=function(n,e,t,o){var r=y({target:e},o);n.getSystem().triggerEvent(t,e,r)},fe={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return fn(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return fn(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return fn(t)},fromDom:fn,fromPoint:function(n,e,t){return mn.from(n.dom.elementFromPoint(e,t)).map(fn)}};function le(n){return n.dom.nodeName.toLowerCase()}function de(e){return function(n){return n.dom.nodeType===e}}function me(n){return fe.fromDom(n.dom.ownerDocument)}function ge(n){return Ye(n)?n:me(n)}function pe(n){return mn.from(n.dom.parentNode).map(fe.fromDom)}function he(n,e){var t=n.dom.childNodes;return mn.from(t[e]).map(fe.fromDom)}function ve(e,t){pe(e).each(function(n){n.dom.insertBefore(t.dom,e.dom)})}function be(n,e){mn.from(n.dom.nextSibling).map(fe.fromDom).fold(function(){pe(n).each(function(n){Qe(n,e)})},function(n){ve(n,e)})}function ye(e,t){he(e,0).fold(function(){Qe(e,t)},function(n){e.dom.insertBefore(t.dom,n.dom)})}function xe(e,n){M(n,function(n){Qe(e,n)})}function we(n){n.dom.textContent="",M(Je(n),function(n){Ze(n)})}function Se(n){return Ke(n)&&l(n.dom.host)}function Oe(n){return fe.fromDom(n.dom.host)}function ke(){return it(fe.fromDom(document))}function Te(n,e){Qe(n.element,e.element)}function Ce(e){var n,t=pe(e.element).bind(function(n){return e.getSystem().getByDom(n).toOptional()});ut(n=e),Ze(n.element),n.getSystem().removeFromWorld(n),t.each(function(n){n.syncComponents()})}function Ee(n,e){for(var t=st(n),o=0,r=t.length;o<r;o++){var i=t[o];e(n[i],i)}}function De(n,t){return lt(n,function(n,e){return{k:e,v:t(n,e)}})}function Me(n,t){var o=[];return Ee(n,function(n,e){o.push(t(n,e))}),o}function _e(n,e){return dt(n,e)?mn.from(n[e]):mn.none()}function Re(n,e){return dt(n,e)&&void 0!==n[e]&&null!==n[e]}function Fe(n,e,t){if(!(r(t)||d(t)||g(t)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}function Ie(n,e,t){Fe(n.dom,e,t)}function Ve(n,e){var t=n.dom;Ee(e,function(n,e){Fe(t,e,n)})}function Be(n,e){var t=n.dom.getAttribute(e);return null===t?void 0:t}function Ae(n,e){return mn.from(Be(n,e))}function Ne(n,e){var t=n.dom;return!(!t||!t.hasAttribute)&&t.hasAttribute(e)}function He(n,e){n.dom.removeAttribute(e)}function Pe(n,e){var t=Be(n,e);return void 0===t||""===t?[]:t.split(" ")}function ze(n){return void 0!==n.dom.classList}function je(n,e){var t,o,r;ze(n)?n.dom.classList.add(e):(o=e,r=Pe(t=n,"class").concat([o]),Ie(t,"class",r.join(" ")))}function Le(n,e){var t,o,r,i;ze(n)?n.dom.classList.remove(e):(r=e,0<(i=E(Pe(o=n,"class"),function(n){return n!==r})).length?Ie(o,"class",i.join(" ")):He(o,"class")),0===(ze(t=n)?t.dom.classList:Pe(t,"class")).length&&He(t,"class")}function $e(n,e){return ze(n)&&n.dom.classList.contains(e)}function Ge(n,e,t){Le(n,t),je(n,e)}"undefined"!=typeof window||Function("return this;")();var Ue,We,Xe=de(1),qe=de(3),Ye=de(9),Ke=de(11),Je=function(n){return Z(n.dom.childNodes,fe.fromDom)},Qe=function(n,e){n.dom.appendChild(e.dom)},Ze=function(n){var e=n.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},nt=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),et=w(nt),tt=nt?function(n){return fe.fromDom(n.dom.getRootNode())}:ge,ot=function(n){return l(n.dom.shadowRoot)},rt=function(n){var e=qe(n)?n.dom.parentNode:n.dom;if(null==e||null===e.ownerDocument)return!1;var t,o,r=e.ownerDocument,i=fe.fromDom(e),u=tt(i);return(Se(u)?mn.some(u):mn.none()).fold(function(){return r.body.contains(e)},(t=rt,o=Oe,function(n){return t(o(n))}))},it=function(n){var e=n.dom.body;if(null==e)throw new Error("Body is not available yet");return fe.fromDom(e)},ut=function(n){W(n,ie()),M(n.components(),ut)},ct=function(n){M(n.components(),ct),W(n,re())},at=function(n,e,t){n.getSystem().addToWorld(e),t(n.element,e.element),rt(n.element)&&ct(e),n.syncComponents()},st=Object.keys,ft=Object.hasOwnProperty,lt=function(n,o){var r={};return Ee(n,function(n,e){var t=o(n,e);r[t.k]=t.v}),r},dt=function(n,e){return ft.call(n,e)},mt=Object.freeze({__proto__:null,toAlpha:function(n,e,t){Ge(n.element,e.alpha,e.omega)},toOmega:function(n,e,t){Ge(n.element,e.omega,e.alpha)},isAlpha:function(n,e,t){return $e(n.element,e.alpha)},isOmega:function(n,e,t){return $e(n.element,e.omega)},clear:function(n,e,t){Le(n.element,e.alpha),Le(n.element,e.omega)}}),gt=function(t){return{isValue:x,isError:S,getOr:w(t),getOrThunk:w(t),getOrDie:w(t),or:function(n){return gt(t)},orThunk:function(n){return gt(t)},fold:function(n,e){return e(t)},map:function(n){return gt(n(t))},mapError:function(n){return gt(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOptional:function(){return mn.some(t)}}},pt=function(t){return{isValue:S,isError:x,getOr:K,getOrThunk:function(n){return n()},getOrDie:function(){return h(String(t))()},or:K,orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return pt(t)},mapError:function(n){return pt(n(t))},each:Y,bind:function(n){return pt(t)},exists:S,forall:x,toOptional:mn.none}},ht={value:gt,error:pt,fromOption:function(n,e){return n.fold(function(){return pt(e)},gt)}};function vt(n,e,t){return n.stype===Ue.Error?e(n.serror):t(n.svalue)}function bt(n){return{stype:Ue.Value,svalue:n}}function yt(n){return{stype:Ue.Error,serror:n}}function xt(n,e,t,o){return{tag:"field",key:n,newKey:e,presence:t,prop:o}}function wt(n,e,t){switch(n.tag){case"field":return e(n.key,n.newKey,n.presence,n.prop);case"custom":return t(n.newKey,n.instantiator)}}function St(u){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},o=0;o<n.length;o++){var r,i=n[o];for(r in i)dt(i,r)&&(t[r]=u(t[r],i[r]))}return t}}function Ot(){return{tag:"required",process:{}}}function kt(n){return{tag:"defaultedThunk",process:n}}function Tt(n){return kt(w(n))}function Ct(){return{tag:"option",process:{}}}function Et(n){return{tag:"mergeWithThunk",process:n}}function Dt(n){return a(n)&&100<st(n).length?" removed due to size":JSON.stringify(n,null,2)}function Mt(n,e){return eo([{path:n,getErrorInfo:e}])}function _t(t){return{extract:function(e,n){return oo(t(n),function(n){return Mt(e,w(n))})},toString:w("val")}}function Rt(n,e,t,o){return o(_e(n,e).getOrThunk(function(){return t(n)}))}function Ft(e,t,o,r,i){function u(n){return i.extract(t.concat([r]),n)}function n(n){return n.fold(function(){return no(mn.none())},function(n){var e=i.extract(t.concat([r]),n);return ro(e,mn.some)})}var c,a,s,f,l,d;switch(e.tag){case"required":return s=t,d=u,_e(f=o,l=r).fold(function(){return n=l,e=f,Mt(s,function(){return'Could not find valid *required* value for "'+n+'" in '+Dt(e)});var n,e},d);case"defaultedThunk":return Rt(o,r,e.process,u);case"option":return n(_e(o,r));case"defaultedOptionThunk":return a=e.process,n(_e(c=o,r).map(function(n){return!0===n?a(c):n}));case"mergeWithThunk":return Rt(o,r,w({}),function(n){return u(co(e.process(o),n))})}}function It(n){var s=lo(n),f=_(n,function(t,n){return wt(n,function(n){var e;return co(t,((e={})[n]=!0,e))},w(t))},{});return{extract:function(n,e){var t,o,r,i,u,c,a=E(d(e)?[]:st((r=l,i=o={},u=function(n,e){i[e]=n},c=Y,Ee(e,function(n,e){(r(n,e)?u:c)(n,e)}),o)),function(n){return!Re(f,n)});return 0===a.length?s.extract(n,e):(t=a,Mt(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"}))},toString:s.toString}}function Vt(c,a){return{extract:function(t,o){var r,n,i,e=st(o),u=(i=_t(c),r=t,n=Z(e,function(n,e){return i.extract(r.concat(["["+e+"]"]),n)}),so(n));return to(u,function(n){var e=Z(n,function(n){return xt(n,n,Ot(),a)});return lo(e).extract(t,o)})},toString:function(){return"setOf("+a.toString()+")"}}}function Bt(e,c){return{extract:function(i,u){return _e(u,e).fold(function(){return n=e,Mt(i,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return t=i,e=u,_e(o=c,r=n).fold(function(){return n=o,e=r,Mt(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Dt(n)});var n,e},function(n){return n.extract(t.concat(["branch: "+r]),e)});var t,e,o,r})},toString:function(){return"chooseOn("+e+"). Possible values: "+st(c)}}}function At(e){return _t(function(n){return e(n).fold(eo,no)})}function Nt(e,n){return Vt(function(n){return e(n).fold(yt,bt)},n)}function Ht(n,e,t){return Zt((r=e.extract([n],o=t),io(r,function(n){return{input:o,errors:n}})));var o,r}function Pt(n){return n.fold(function(n){throw new Error(po(n))},K)}function zt(n,e,t){return Pt(Ht(n,e,t))}function jt(n,e){return Bt(n,De(e,lo))}function Lt(n){return ho(n,n,Ot(),mo())}function $t(n,e){return ho(n,n,Ot(),e)}function Gt(n,e){return ho(n,n,Ot(),lo(e))}function Ut(n){return ho(n,n,Ct(),mo())}function Wt(n,e){return ho(n,n,Ct(),e)}function Xt(n,e){return Wt(n,lo(e))}function qt(n,e){return Wt(n,It(e))}function Yt(n,e){return ho(n,n,Tt(e),mo())}function Kt(n,e,t){return ho(n,n,Tt(e),t)}(We=Ue={})[We.Error=0]="Error",We[We.Value=1]="Value";function Jt(u){if(!D(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return M(u,function(n,o){var e=st(n);if(1!==e.length)throw new Error("one and only one name per case");var r=e[0],i=n[r];if(void 0!==t[r])throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!D(i))throw new Error("case arguments must be an array");c.push(r),t[r]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=t.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+e);return{fold:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(n.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+n.length);return n[o].apply(null,t)},match:function(n){var e=st(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!A(c,function(n){return T(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[r].apply(null,t)},log:function(n){console.log(n,{constructors:c,constructor:r,params:t})}}}}),t}var Qt,Zt=function(n){return vt(n,ht.error,ht.value)},no=bt,eo=yt,to=function(n,e){return n.stype===Ue.Value?e(n.svalue):n},oo=function(n,e){return n.stype===Ue.Error?e(n.serror):n},ro=function(n,e){return n.stype===Ue.Value?{stype:Ue.Value,svalue:e(n.svalue)}:n},io=function(n,e){return n.stype===Ue.Error?{stype:Ue.Error,serror:e(n.serror)}:n},uo=vt,co=St(function(n,e){return a(n)&&a(e)?co(n,e):e}),ao=St(function(n,e){return e}),so=function(n){var e,t,o=(e=[],t=[],M(n,function(n){vt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t});return 0<o.errors.length?i(eo,V)(o.errors):no(o.values)},fo=_t(no),lo=function(t){return{extract:function(i,u){for(var c={},a=[],n=0,e=t;n<e.length;n++)wt(e[n],function(n,e,t,o){var r=Ft(t,i,u,n,o);uo(r,function(n){a.push.apply(a,n)},function(n){c[e]=n})},function(n,e){c[n]=e(u)});return 0<a.length?eo(a):no(c)},toString:function(){return"obj{\n"+Z(t,function(n){return wt(n,function(n,e,t,o){return n+" -> "+o.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},mo=w(fo),go=(Qt=m,_t(function(n){var e=typeof n;return Qt(n)?no(n):eo("Expected type: function but got: "+e)})),po=function(n){return"Errors: \n"+Z(10<(e=n.errors).length?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}).join("\n")+"\n\nInput object: "+Dt(n.input);var e},ho=xt,vo=function(n,e){return{tag:"custom",newKey:n,instantiator:e}},bo=[Lt("alpha"),Lt("omega")];function yo(n,e){return(t={})[n]=e,t;var t}function xo(n){return e={},M(n,function(n){e[n.key]=n.value}),e;var e}function wo(n,e,t){return void 0===t&&(t=o),n.exists(function(n){return t(n,e)})}function So(n){for(var e=[],t=function(n){e.push(n)},o=0;o<n.length;o++)n[o].each(t);return e}function Oo(n){return m(n)?n:S}function ko(n,e){return un(n.element,e.event.target)}function To(n){if(!Re(n,"can")&&!Re(n,"abort")&&!Re(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return y(y({},Xo),n)}function Co(n,e){return{key:n,value:To({abort:e})}}function Eo(n,e){return{key:n,value:To({run:e})}}function Do(n,t,o){return{key:n,value:To({run:function(n,e){t.apply(void 0,[n,e].concat(o))}})}}function Mo(n){return function(t){return{key:n,value:To({run:function(n,e){ko(n,e)&&t(n,e)}})}}}function _o(n,e,t){var i,o,r=e.partUids[t];return o=r,Eo(i=n,function(n,r){n.getSystem().getByUid(o).each(function(n){var e=n.element,t=i,o=r;n.getSystem().triggerEvent(t,e,o.event)})})}function Ro(n){return Eo(n,function(n,e){e.cut()})}function Fo(n,e){var t=n.toString(),o=t.indexOf(")")+1,r=t.indexOf("("),i=t.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Zo(i)}},n}function Io(n){return{classes:f(n.classes)?[]:n.classes,attributes:f(n.attributes)?{}:n.attributes,styles:f(n.styles)?{}:n.styles}}function Vo(t,o,r){return Jo(function(n,e){r(n,t,o)})}function Bo(n){return{key:n,value:void 0}}function Ao(n){var e=zt("Creating behaviour: "+n.name,rr,n),t=e.fields,o=e.name,r=e.active,i=e.apis,u=e.extra,c=e.state,a=It(t),s=Xt(o,[qt("config",t)]);return nr(a,s,o,r,i,u,c)}function No(n){var e=n;return{get:function(){return e},set:function(n){e=n}}}function Ho(n){return n.dom.focus()}function Po(n){return n.dom.blur()}function zo(n){return void 0===n&&(n=fe.fromDom(document)),mn.from(n.dom.activeElement).map(fe.fromDom)}function jo(e){return zo(tt(e)).filter(function(n){return e.dom.contains(n.dom)})}function Lo(n){return n.dom.innerHTML}function $o(n){if(Se(n))return"#shadow-root";var e=fe.fromDom(n.dom.cloneNode(!1)),t=fe.fromTag("div"),o=fe.fromDom(e.dom.cloneNode(!0));return Qe(t,o),Lo(t)}Jt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Go,Uo,Wo,Xo={can:x,abort:S,run:Y},qo=xo,Yo=Mo(re()),Ko=Mo(ie()),Jo=Mo(oe()),Qo=(Go=Zn(),function(n){return Eo(Go,n)}),Zo=function(n){return Z(n,function(n){return 0,e=n.length-"/*".length,n.length>="/*".length&&"/*"===n.substr(e,e+"/*".length)?n.substring(0,n.length-"/*".length):n;var e})},nr=function(t,n,l,i,e,o,r){function u(n){return Re(n,l)?n[l]():mn.none()}var c=De(e,function(n,e){return r=l,t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var o=[t].concat(n);return t.config({name:w(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(o,1);return i.apply(void 0,[t,n.config,n.state].concat(e))})},o=u=e,c=(i=n).toString(),a=c.indexOf(")")+1,s=c.indexOf("("),f=c.substring(s+1,a-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:o,parameters:Zo(f.slice(0,1).concat(f.slice(3)))}},t;var r,i,u,t,o,c,a,s,f}),a=De(o,Fo),s=y(y(y({},a),c),{revoke:J(Bo,l),config:function(n){var e=zt(l+"-config",t,n);return{key:l,value:{config:e,me:s,configAsRaw:k(function(){return zt(l+"-config",t,n)}),initialConfig:n,state:r}}},schema:w(n),exhibit:function(n,t){return e=u(n),o=_e(i,"exhibit"),r=function(n,e){return e(t,n.config,n.state)},(e.isSome()&&o.isSome()?mn.some(r(e.getOrDie(),o.getOrDie())):mn.none()).getOrThunk(function(){return Io({})});var e,o,r},name:w(l),handlers:function(n){return u(n).map(function(n){return _e(i,"events").getOr(function(){return{}})(n.config,n.state)}).getOr({})}});return s},er={init:function(){return tr({readState:w("No State required")})}},tr=function(n){return n},or=xo,rr=It([Lt("fields"),Lt("name"),Yt("active",{}),Yt("apis",{}),Yt("state",er),Yt("extra",{})]),ir=It([Lt("branchKey"),Lt("branches"),Lt("name"),Yt("active",{}),Yt("apis",{}),Yt("state",er),Yt("extra",{})]),ur=w(void 0),cr=Ao({fields:bo,name:"swapping",apis:mt}),ar=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),sr=tinymce.util.Tools.resolve("tinymce.ThemeManager"),fr=[{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"}]}],lr=["undo","bold","italic","link","image","bullist","styleselect"],dr="formatChanged",mr="orientationChanged",gr="dropupDismissed",pr=Object.freeze({__proto__:null,events:function(o){return qo([Eo(Qn(),function(r,n){var e,i=o.channels,t=st(i),u=n;M((e=u).universal?t:E(t,function(n){return T(e.channels,n)}),function(n){var e=i[n],t=e.schema,o=zt("channel["+n+"] data\nReceiver: "+$o(r.element),t,u.data);e.onReceive(r,o)})})])}}),hr="unknown";function vr(e,n,t){var o,r,i,u;switch(_e(br.get(),e).orThunk(function(){return z(st(br.get()),function(n){return-1<e.indexOf(n)?mn.some(br.get()[n]):mn.none()})}).getOr(Uo.NORMAL)){case Uo.NORMAL:return t(xr());case Uo.LOGGING:var c=(o=e,r=n,i=[],u=(new Date).getTime(),{logEventCut:function(n,e,t){i.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){i.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){i.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){i.push({outcome:"response",purpose:t,target:e})},write:function(){var n=(new Date).getTime();T(["mousemove","mouseover","mouseout",oe()],o)||console.log(o,{event:o,time:n-u,target:r.dom,sequence:Z(i,function(n){return T(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+$o(n.target)+")":n.outcome})})}}),a=t(c);return c.write(),a;case Uo.STOP:return!0}}(Wo=Uo={})[Wo.STOP=0]="STOP",Wo[Wo.NORMAL=1]="NORMAL",Wo[Wo.LOGGING=2]="LOGGING";var br=No({}),yr=["alloy/data/Fields","alloy/debugging/Debugging"],xr=w({logEventCut:Y,logEventStopped:Y,logNoParent:Y,logEventNoHandlers:Y,logEventResponse:Y,write:Y}),wr=w([Lt("menu"),Lt("selectedMenu")]),Sr=w([Lt("item"),Lt("selectedItem")]);function Or(n,e,t){return void 0!==(o=new Error).stack&&F(o.stack.split("\n"),function(e){return 0<e.indexOf("alloy")&&!C(yr,function(n){return-1<e.indexOf(n)})}).getOr(hr),ho(e,e,t,At(function(t){return ht.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(void 0,n)})}));var o}function kr(n){return Or(0,n,Tt(Y))}function Tr(n){return Or(0,n,Tt(mn.none))}function Cr(n){return Or(0,n,Ot())}function Er(n){return Or(0,n,Ot())}function Dr(n,e){return vo(n,w(e))}function Mr(n){return vo(n,K)}function _r(n,e,t){var o=e.aria;o.update(n,o,t.get())}function Rr(e,n,t){n.toggleClass.each(function(n){(t.get()?je:Le)(e.element,n)})}function Fr(n,e,t){Qr(n,e,t,!t.get())}function Ir(n,e,t){t.set(!0),Rr(n,e,t),_r(n,e,t)}function Vr(n,e,t){t.set(!1),Rr(n,e,t),_r(n,e,t)}function Br(n,e,t){Qr(n,e,t,e.selected)}function Ar(t,o){return ti.config({channels:yo(dr,{onReceive:function(n,e){e.command===t&&o(n,e.state)}})})}function Nr(n){return ti.config({channels:yo(mr,{onReceive:n})})}function Hr(n,e){return{key:n,value:{onReceive:e}}}function Pr(){function n(n,e){e.stop(),q(n)}return[Eo(Un(),n),Eo(ee(),n),Ro(Vn()),Ro(Nn())]}function zr(n,e){e.ignore||(Ho(n.element),e.onFocus(n))}function jr(n){return void 0!==n.style&&m(n.style.getPropertyValue)}function Lr(n,e,t){if(!r(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);jr(n)&&n.style.setProperty(e,t)}function $r(n,e,t){Lr(n.dom,e,t)}function Gr(n,e){var t=n.dom;Ee(e,function(n,e){Lr(t,e,n)})}function Ur(n,e){var t=n.dom,o=window.getComputedStyle(t).getPropertyValue(e);return""!==o||rt(n)?o:li(t,e)}function Wr(n,e){var t=n.dom,o=li(t,e);return mn.from(o).filter(function(n){return 0<n.length})}function Xr(n,e){var t,o=e;jr(t=n.dom)&&t.style.removeProperty(o),wo(Ae(n,"style").map(yn),"")&&He(n,"style")}function qr(n){return n.dom.offsetWidth}function Yr(o,r){function n(n){var e=r(n);if(e<=0||null===e){var t=Ur(n,o);return parseFloat(t)||0}return e}function i(r,n){return R(n,function(n,e){var t=Ur(r,e),o=void 0===t?0:parseInt(t,10);return isNaN(o)?n:n+o},0)}return{set:function(n,e){if(!g(e)&&!e.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+e);var t=n.dom;jr(t)&&(t.style[o]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var o=i(n,t);return o<e?e-o:0}}}function Kr(n){return di.get(n)}function Jr(n,e){return on(e,n)}w(lo(Sr().concat(wr())));function Qr(n,e,t,o){(o?Ir:Vr)(n,e,t)}function Zr(n,e,t){Ie(n.element,"aria-expanded",t)}var ni=w(lo(Sr())),ei=w(Gt("initSize",[Lt("numColumns"),Lt("numRows")])),ti=Ao({fields:[$t("channels",Nt(ht.value,It([Cr("onReceive"),Yt("schema",mo())])))],name:"receiving",active:pr}),oi=Object.freeze({__proto__:null,onLoad:Br,toggle:Fr,isOn:function(n,e,t){return t.get()},on:Ir,off:Vr,set:Qr}),ri=Object.freeze({__proto__:null,exhibit:function(){return Io({})},events:function(n,e){var t,o,r,i=(t=n,o=e,r=Fr,Qo(function(n){r(n,t,o)})),u=Vo(n,e,Br);return qo(V([n.toggleOnExecute?[i]:[],[u]]))}}),ii=Ao({fields:[Yt("selected",!1),Ut("toggleClass"),Yt("toggleOnExecute",!0),Kt("aria",{mode:"none"},jt("mode",{pressed:[Yt("syncWithExpanded",!1),Dr("update",function(n,e,t){Ie(n.element,"aria-pressed",t),e.syncWithExpanded&&Zr(n,0,t)})],checked:[Dr("update",function(n,e,t){Ie(n.element,"aria-checked",t)})],expanded:[Dr("update",Zr)],selected:[Dr("update",function(n,e,t){Ie(n.element,"aria-selected",t)})],none:[Dr("update",Y)]}))],name:"toggling",active:ri,apis:oi,state:{init:function(){var e=No(!1);return{get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(!1)},readState:function(){return e.get()}}}}}),ui="tinymce-mobile",ci=function(n){return ui+"-"+n},ai=Object.freeze({__proto__:null,focus:zr,blur:function(n,e){e.ignore||Po(n.element)},isFocused:function(n){return e=n.element,t=tt(e).dom,e.dom===t.activeElement;var e,t}}),si=Object.freeze({__proto__:null,exhibit:function(n,e){return Io(e.ignore?{}:{attributes:{tabindex:"-1"}})},events:function(t){return qo([Eo(Yn(),function(n,e){zr(n,t),e.stop()})].concat(t.stopMousedown?[Eo(Nn(),function(n,e){e.event.prevent()})]:[]))}}),fi=Ao({fields:[kr("onFocus"),Yt("stopMousedown",!1),Yt("ignore",!1)],name:"focusing",active:si,apis:ai}),li=function(n,e){return jr(n)?n.style.getPropertyValue(e):""},di=Yr("height",function(n){var e=n.dom;return rt(n)?e.getBoundingClientRect().height:e.offsetHeight});function mi(n,e,t,o,r){return n(t,o)?mn.some(t):m(r)&&r(t)?mn.none():e(t,o,r)}function gi(n,e,t){for(var o=n.dom,r=m(t)?t:S;o.parentNode;){var o=o.parentNode,i=fe.fromDom(o);if(e(i))return mn.some(i);if(r(i))break}return mn.none()}function pi(n,e,t){return gi(n,function(n){return en(n,e)},t)}function hi(n,e){return rn(e,n)}function vi(n,e,t){return mi(en,pi,n,e,t)}function bi(n,e,t){var o=N(n.slice(0,e)),r=N(n.slice(e+1));return F(o.concat(r),t)}function yi(n,e,t){return F(N(n.slice(0,e)),t)}function xi(n,e,t){var o=n.slice(0,e);return F(n.slice(e+1).concat(o),t)}function wi(n,e,t){return F(n.slice(e+1),t)}function Si(t){return function(n){var e=n.raw;return T(t,e.which)}}function Oi(n){return function(e){return A(n,function(n){return n(e)})}}function ki(n){return!0===n.raw.shiftKey}function Ti(n){return!0===n.raw.ctrlKey}function Ci(n,e){return{matches:n,classification:e}}function Ei(n,e,t,o){var r=n+e;return o<r?t:r<t?o:r}function Di(n,e,t){return Math.min(Math.max(n,e),t)}function Mi(t,o,n,r){M(Jr(t.element,"."+o.highlightClass),function(e){C(r,function(n){return n.element===e})||(Le(e,o.highlightClass),t.getSystem().getByDom(e).each(function(n){o.onDehighlight(t,n),W(n,ae())}))})}function _i(n,e,t,o){Mi(n,e,0,[o]),Bi(0,e,0,o)||(je(o.element,e.highlightClass),e.onHighlight(n,o),W(o,ce()))}function Ri(t,e,n,o){var r=Jr(t.element,"."+e.itemClass);return I(r,function(n){return $e(n,e.highlightClass)}).bind(function(n){var e=Ei(n,o,0,r.length-1);return t.getSystem().getByDom(r[e]).toOptional()})}function Fi(n,e,t){e.exists(function(e){return t.exists(function(n){return un(n,e)})})||X(n,ue(),{prevFocus:e,newFocus:t})}function Ii(){function o(n){return jo(n.element)}return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element),Fi(n,t,o(n))}}}function Vi(){function r(n){return Qi.getHighlighted(n).map(function(n){return n.element})}return{get:r,set:function(e,n){var t=r(e);e.getSystem().getByDom(n).fold(Y,function(n){Qi.highlight(e,n)});var o=r(e);Fi(e,t,o)}}}function Bi(n,e,t,o){return $e(o.element,e.highlightClass)}function Ai(e,n,t){return hi(e.element,"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOptional()})}function Ni(e,n,t){var o=Jr(e.element,"."+n.itemClass);return(0<o.length?mn.some(o[o.length-1]):mn.none()).bind(function(n){return e.getSystem().getByDom(n).toOptional()})}function Hi(e,n,t){return So(Z(Jr(e.element,"."+n.itemClass),function(n){return e.getSystem().getByDom(n).toOptional()}))}var Pi,zi,ji=[8],Li=[9],$i=[13],Gi=[27],Ui=[32],Wi=[37],Xi=[38],qi=[39],Yi=[40],Ki=Q(ki),Ji=Object.freeze({__proto__:null,dehighlightAll:function(n,e,t){return Mi(n,e,0,[])},dehighlight:function(n,e,t,o){Bi(0,e,0,o)&&(Le(o.element,e.highlightClass),e.onDehighlight(n,o),W(o,ae()))},highlight:_i,highlightFirst:function(e,t,n){Ai(e,t).each(function(n){_i(e,t,0,n)})},highlightLast:function(e,t,n){Ni(e,t).each(function(n){_i(e,t,0,n)})},highlightAt:function(e,t,n,o){var r,i,u;i=o,u=Jr((r=e).element,"."+t.itemClass),mn.from(u[i]).fold(function(){return ht.error(new Error("No element found with index "+i))},r.getSystem().getByDom).fold(function(n){throw n},function(n){_i(e,t,0,n)})},highlightBy:function(e,t,n,o){F(Hi(e,t),o).each(function(n){_i(e,t,0,n)})},isHighlighted:Bi,getHighlighted:function(e,n,t){return hi(e.element,"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOptional()})},getFirst:Ai,getLast:Ni,getPrevious:function(n,e,t){return Ri(n,e,0,-1)},getNext:function(n,e,t){return Ri(n,e,0,1)},getCandidates:Hi}),Qi=Ao({fields:[Lt("highlightClass"),Lt("itemClass"),kr("onHighlight"),kr("onDehighlight")],name:"highlighting",apis:Ji});function Zi(n,e,t,o,c){function a(e,t,n,o,r){var i=n(e,t,o,r),u=t.event;return F(i,function(n){return n.matches(u)}).map(function(n){return n.classification}).bind(function(n){return n(e,t,o,r)})}var r={schema:function(){return n.concat([Yt("focusManager",Ii()),Kt("focusInside","onFocus",At(function(n){return T(["onFocus","onEnterOrSpace","onApi"],n)?ht.value(n):ht.error("Invalid value for focusInside")})),Dr("handler",r),Dr("state",e),Dr("sendFocusIn",c)])},processKey:a,toEvents:function(i,u){var n=i.focusInside!==Pi.OnFocusMode?mn.none():c(i).map(function(t){return Eo(Yn(),function(n,e){t(n,i,u),e.stop()})}),e=[Eo(jn(),function(o,r){a(o,r,t,i,u).fold(function(){var e=o,t=r,n=Si(Ui.concat($i))(t.event);i.focusInside===Pi.OnEnterOrSpaceMode&&n&&ko(e,t)&&c(i).each(function(n){n(e,i,u),t.stop()})},function(n){r.stop()})}),Eo(Ln(),function(n,e){a(n,e,o,i,u).each(function(n){e.stop()})})];return qo(n.toArray().concat(e))}};return r}function nu(n){function c(n,e){return 0<Kr(n.visibilitySelector.bind(function(n){return vi(e,n)}).getOr(e))}function e(e,t,n){var o=t,r=E(Jr(e.element,o.selector),function(n){return c(o,n)});mn.from(r[o.firstTabstop]).each(function(n){t.focusManager.set(e,n)})}function o(t,n,r,i){var e,u=Jr(t.element,r.selector);return(e=r).focusManager.get(t).bind(function(n){return vi(n,e.selector)}).bind(function(n){return I(u,J(un,n)).bind(function(n){return e=t,o=r,i(u,n,function(n){return c(e=o,t=n)&&e.useTabstopAt(t);var e,t}).fold(function(){return o.cyclic?mn.some(!0):mn.none()},function(n){return o.focusManager.set(e,n),mn.some(!0)});var e,o})})}var t=[Ut("onEscape"),Ut("onEnter"),Yt("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Yt("firstTabstop",0),Yt("useTabstopAt",x),Ut("visibilitySelector")].concat([n]),r=w([Ci(Oi([ki,Si(Li)]),function(n,e,t){return o(n,0,t,t.cyclic?bi:yi)}),Ci(Si(Li),function(n,e,t){return o(n,0,t,t.cyclic?xi:wi)}),Ci(Si(Gi),function(e,t,n){return n.onEscape.bind(function(n){return n(e,t)})}),Ci(Oi([Ki,Si($i)]),function(e,t,n){return n.onEnter.bind(function(n){return n(e,t)})})]),i=w([]);return Zi(t,er.init,r,i,function(){return mn.some(e)})}function eu(n){return"input"===le(n)&&"radio"!==Be(n,"type")||"textarea"===le(n)}function tu(n,e,t){return eu(t)&&Si(Ui)(e.event)?mn.none():(nn(n,t,Zn()),mn.some(!0))}function ou(n,e){return mn.some(!0)}function ru(n,e,t){return t.execute(n,e,n.element)}function iu(n){function e(){return t.get().each(n)}var t=No(mn.none());return{clear:function(){e(),t.set(mn.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(n){e(),t.set(mn.some(n))}}}function uu(){var e=iu(function(n){return n.destroy()});return y(y({},e),{run:function(n){return e.get().each(n)}})}function cu(){var e=iu(Y);return y(y({},e),{on:function(n){return e.get().each(n)}})}function au(){var t=cu();return tr({readState:function(){return t.get().map(function(n){return{numRows:String(n.numRows),numColumns:String(n.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set({numRows:n,numColumns:e})},getNumRows:function(){return t.get().map(function(n){return n.numRows})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns})}})}function su(e,t){return function(n){return"rtl"===cc(n)?t:e}}function fu(i){return function(n,e,t,o){var r=i(n.element);return ac(r,n,e,t,o)}}function lu(n,e){return fu(su(n,e))}function du(n,e){return fu(su(e,n))}function mu(r){return function(n,e,t,o){return ac(r,n,e,t,o)}}function gu(n){return!((e=n.dom).offsetWidth<=0&&e.offsetHeight<=0);var e}function pu(n,e,t){var o,r=E(Jr(n,t),gu);return I(o=r,function(n){return un(n,e)}).map(function(n){return{index:n,candidates:o}})}function hu(n,e){return I(n,function(n){return un(e,n)})}function vu(t,n,o,e){return e(Math.floor(n/o),n%o).bind(function(n){var e=n.row*o+n.column;return 0<=e&&e<t.length?mn.some(t[e]):mn.none()})}function bu(r,n,i,u,c){return vu(r,n,u,function(n,e){var t=n===i-1?r.length-n*u:u,o=Ei(e,c,0,t-1);return mn.some({row:n,column:o})})}function yu(r,n,i,u,c){return vu(r,n,u,function(n,e){var t=Ei(n,c,0,i-1),o=Di(e,0,(t===i-1?r.length-t*u:u)-1);return mn.some({row:t,column:o})})}function xu(e,t,n){hi(e.element,t.selector).each(function(n){t.focusManager.set(e,n)})}function wu(r){return function(n,e,t,o){return pu(n,e,t.selector).bind(function(n){return r(n.candidates,n.index,o.getNumRows().getOr(t.initSize.numRows),o.getNumColumns().getOr(t.initSize.numColumns))})}}function Su(n,e,t){return t.captureTab?mn.some(!0):mn.none()}function Ou(n,e,t,i){var u=function(n,e,t){var o,r=Ei(e,i,0,t.length-1);return r===n?mn.none():"button"===le(o=t[r])&&"disabled"===Be(o,"disabled")?u(n,r,t):mn.from(t[r])};return pu(n,t,e).bind(function(n){var e=n.index,t=n.candidates;return u(e,e,t)})}function ku(e,t,o){return(r=o).focusManager.get(e).bind(function(n){return vi(n,r.selector)}).bind(function(n){return o.execute(e,t,n)});var r}function Tu(e,t,n){t.getInitial(e).orThunk(function(){return hi(e.element,t.selector)}).each(function(n){t.focusManager.set(e,n)})}function Cu(n,e,t){return Ou(n,t.selector,e,-1)}function Eu(n,e,t){return Ou(n,t.selector,e,1)}function Du(r){return function(n,e,t,o){return r(n,e,t,o).bind(function(){return t.executeOnMove?ku(n,e,t):mn.some(!0)})}}function Mu(n,e,t){return t.onEscape(n,e)}function _u(n,e,t){return mn.from(n[e]).bind(function(n){return mn.from(n[t]).map(function(n){return{rowIndex:e,columnIndex:t,cell:n}})})}function Ru(n,e,t,o){return _u(n,e,Ei(t,o,0,n[e].length-1))}function Fu(n,e,t,o){var r=Ei(t,o,0,n.length-1);return _u(n,r,Di(e,0,n[r].length-1))}function Iu(n,e,t,o){return _u(n,e,Di(t+o,0,n[e].length-1))}function Vu(n,e,t,o){var r=Di(t+o,0,n.length-1);return _u(n,r,Di(e,0,n[r].length-1))}function Bu(e,t,n){t.previousSelector(e).orThunk(function(){var n=t.selectors;return hi(e.element,n.cell)}).each(function(n){t.focusManager.set(e,n)})}function Au(n,o){return function(e,t,i){var u=i.cycles?n:o;return vi(t,i.selectors.row).bind(function(n){return hu(Jr(n,i.selectors.cell),t).bind(function(o){var r=Jr(e,i.selectors.row);return hu(r,n).bind(function(n){var e,t=(e=i,Z(r,function(n){return Jr(n,e.selectors.cell)}));return u(t,n,o).map(function(n){return n.cell})})})})}}function Nu(e,t,o){return o.focusManager.get(e).bind(function(n){return o.execute(e,t,n)})}function Hu(e,t,n){hi(e.element,t.selector).each(function(n){t.focusManager.set(e,n)})}function Pu(n,e,t){return Ou(n,t.selector,e,-1)}function zu(n,e,t){return Ou(n,t.selector,e,1)}function ju(o,n){return e=o,t={},r=Z(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+o,ho(e,e,Ct(),_t(function(n){return eo("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([vo("dump",K)]),Kt(e,t,lo(r));var e,t,r}function Lu(n,e){return y(y({},or(e)),n.dump)}function $u(n){return dt(n,"uiType")}function Gu(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Kc+String(e)}function Uu(n){function e(n){return n.name}return n.fold(e,e,e,e)}function Wu(t,o){return function(n){var e=zt("Converting part type",o,n);return t(e)}}(zi=Pi=Pi||{}).OnFocusMode="onFocus",zi.OnEnterOrSpaceMode="onEnterOrSpace",zi.OnApiMode="onApi";var Xu,qu,Yu,Ku,Ju,Qu,Zu,nc,ec,tc,oc=nu(vo("cyclic",S)),rc=nu(vo("cyclic",x)),ic=Zi([Yt("execute",tu),Yt("useSpace",!1),Yt("useEnter",!0),Yt("useControlEnter",!1),Yt("useDown",!1)],er.init,function(n,e,t,o){var r=t.useSpace&&!eu(n.element)?Ui:[],i=t.useEnter?$i:[],u=t.useDown?Yi:[];return[Ci(Si(r.concat(i).concat(u)),ru)].concat(t.useControlEnter?[Ci(Oi([Ti,Si($i)]),ru)]:[])},function(n,e,t,o){return t.useSpace&&!eu(n.element)?[Ci(Si(Ui),ou)]:[]},function(){return mn.none()}),uc=Object.freeze({__proto__:null,flatgrid:au,init:function(n){return n.state(n)}}),cc=function(n){return"rtl"===Ur(n,"direction")?"rtl":"ltr"},ac=function(e,t,n,o,r){return o.focusManager.get(t).bind(function(n){return e(t.element,n,o,r)}).map(function(n){return o.focusManager.set(t,n),!0})},sc=mu,fc=mu,lc=mu,dc=wu(function(n,e,t,o){return bu(n,e,t,o,-1)}),mc=wu(function(n,e,t,o){return bu(n,e,t,o,1)}),gc=wu(function(n,e,t,o){return yu(n,e,t,o,-1)}),pc=wu(function(n,e,t,o){return yu(n,e,t,o,1)}),hc=Zi([Lt("selector"),Yt("execute",tu),Tr("onEscape"),Yt("captureTab",!1),ei()],au,w([Ci(Si(Wi),lu(dc,mc)),Ci(Si(qi),du(dc,mc)),Ci(Si(Xi),sc(gc)),Ci(Si(Yi),fc(pc)),Ci(Oi([ki,Si(Li)]),Su),Ci(Oi([Ki,Si(Li)]),Su),Ci(Si(Gi),function(n,e,t){return t.onEscape(n,e)}),Ci(Si(Ui.concat($i)),function(e,t,o,n){return(r=o).focusManager.get(e).bind(function(n){return vi(n,r.selector)}).bind(function(n){return o.execute(e,t,n)});var r})]),w([Ci(Si(Ui),ou)]),function(){return mn.some(xu)}),vc=[Lt("selector"),Yt("getInitial",mn.none),Yt("execute",tu),Tr("onEscape"),Yt("executeOnMove",!1),Yt("allowVertical",!0)],bc=w([Ci(Si(Ui),ou)]),yc=Zi(vc,er.init,function(n,e,t,o){var r=Wi.concat(t.allowVertical?Xi:[]),i=qi.concat(t.allowVertical?Yi:[]);return[Ci(Si(r),Du(lu(Cu,Eu))),Ci(Si(i),Du(du(Cu,Eu))),Ci(Si($i),ku),Ci(Si(Ui),ku),Ci(Si(Gi),Mu)]},bc,function(){return mn.some(Tu)}),xc=[Gt("selectors",[Lt("row"),Lt("cell")]),Yt("cycles",!0),Yt("previousSelector",mn.none),Yt("execute",tu)],wc=Au(function(n,e,t){return Ru(n,e,t,-1)},function(n,e,t){return Iu(n,e,t,-1)}),Sc=Au(function(n,e,t){return Ru(n,e,t,1)},function(n,e,t){return Iu(n,e,t,1)}),Oc=Au(function(n,e,t){return Fu(n,t,e,-1)},function(n,e,t){return Vu(n,t,e,-1)}),kc=Au(function(n,e,t){return Fu(n,t,e,1)},function(n,e,t){return Vu(n,t,e,1)}),Tc=w([Ci(Si(Wi),lu(wc,Sc)),Ci(Si(qi),du(wc,Sc)),Ci(Si(Xi),sc(Oc)),Ci(Si(Yi),fc(kc)),Ci(Si(Ui.concat($i)),function(e,t,o){return jo(e.element).bind(function(n){return o.execute(e,t,n)})})]),Cc=w([Ci(Si(Ui),ou)]),Ec=Zi(xc,er.init,Tc,Cc,function(){return mn.some(Bu)}),Dc=[Lt("selector"),Yt("execute",tu),Yt("moveOnTab",!1)],Mc=w([Ci(Si(Xi),lc(Pu)),Ci(Si(Yi),lc(zu)),Ci(Oi([ki,Si(Li)]),function(n,e,t,o){return t.moveOnTab?lc(Pu)(n,e,t,o):mn.none()}),Ci(Oi([Ki,Si(Li)]),function(n,e,t,o){return t.moveOnTab?lc(zu)(n,e,t,o):mn.none()}),Ci(Si($i),Nu),Ci(Si(Ui),Nu)]),_c=w([Ci(Si(Ui),ou)]),Rc=Zi(Dc,er.init,Mc,_c,function(){return mn.some(Hu)}),Fc=Zi([Tr("onSpace"),Tr("onEnter"),Tr("onShiftEnter"),Tr("onLeft"),Tr("onRight"),Tr("onTab"),Tr("onShiftTab"),Tr("onUp"),Tr("onDown"),Tr("onEscape"),Yt("stopSpaceKeyup",!1),Ut("focusIn")],er.init,function(n,e,t){return[Ci(Si(Ui),t.onSpace),Ci(Oi([Ki,Si($i)]),t.onEnter),Ci(Oi([ki,Si($i)]),t.onShiftEnter),Ci(Oi([ki,Si(Li)]),t.onShiftTab),Ci(Oi([Ki,Si(Li)]),t.onTab),Ci(Si(Xi),t.onUp),Ci(Si(Yi),t.onDown),Ci(Si(Wi),t.onLeft),Ci(Si(qi),t.onRight),Ci(Si(Ui),t.onSpace),Ci(Si(Gi),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[Ci(Si(Ui),ou)]:[]},function(n){return n.focusIn}),Ic=oc.schema(),Vc=rc.schema(),Bc=yc.schema(),Ac=hc.schema(),Nc=Ec.schema(),Hc=ic.schema(),Pc=Rc.schema(),zc=Fc.schema(),jc=(qu=jt((tc=zt("Creating behaviour: "+(Xu={branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Ic,cyclic:Vc,flow:Bc,flatgrid:Ac,matrix:Nc,execution:Hc,menu:Pc,special:zc}),name:"keying",active:{events:function(n,e){return n.handler.toEvents(n,e)}},apis:{focusIn:function(e,t,o){t.sendFocusIn(t).fold(function(){e.getSystem().triggerFocus(e.element,e.element)},function(n){n(e,t,o)})},setGridSize:function(n,e,t,o,r){Re(t,"setGridSize")?t.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:uc}).name,ir,Xu)).branchKey,tc.branches),Yu=tc.name,Ku=tc.active,Ju=tc.apis,Qu=tc.extra,Zu=tc.state,ec=Xt(Yu,[Wt("config",nc=qu)]),nr(nc,ec,Yu,Ku,Ju,Qu,Zu)),Lc=ju,$c=Lu,Gc="placeholder",Uc=Jt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Wc=function(r,i,u,c){return n=r,t=c,($u(e=u)&&e.uiType===Gc?(a=e,s=t,(o=n).exists(function(n){return n!==a.owner})?Uc.single(!0,w(a)):_e(s,a.name).fold(function(){throw new Error("Unknown placeholder component: "+a.name+"\nKnown: ["+st(s)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+JSON.stringify(a,null,2))},function(n){return n.replace()})):Uc.single(!1,w(e))).fold(function(n,e){var t=$u(u)?e(i,u.config,u.validated):e(i),o=B(_e(t,"components").getOr([]),function(n){return Wc(r,i,n,c)});return[y(y({},t),{components:o})]},function(n,e){if($u(u)){var t=e(i,u.config,u.validated);return u.validated.preprocess.getOr(K)(t)}return e(i)});var n,e,t,o,a,s},Xc=Uc.single,qc=Uc.multiple,Yc=w(Gc),Kc=0,Jc=Jt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Qc=Yt("factory",{sketch:K}),Zc=Yt("schema",[]),na=Lt("name"),ea=ho("pname","pname",kt(function(n){return"<alloy."+Gu(n.name)+">"}),mo()),ta=vo("schema",function(){return[Ut("preprocess")]}),oa=Yt("defaults",w({})),ra=Yt("overrides",w({})),ia=lo([Qc,Zc,na,ea,oa,ra]),ua=lo([Qc,Zc,na,oa,ra]),ca=lo([Qc,Zc,na,ea,oa,ra]),aa=lo([Qc,ta,na,Lt("unit"),ea,oa,ra]),sa=Wu(Jc.required,ia);function fa(n,e,t,o){return co(e.defaults(n,t,o),t,{uid:n.partUids[e.name]},e.overrides(n,t,o))}function la(n,e,t){return o=e,r={},i={},M(t,function(n){n.fold(function(o){r[o.pname]=Xc(!0,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(n){var e=o.parts[n.name];i[n.name]=w(n.factory.sketch(fa(o,n,e[zs()]),e))},function(o){r[o.pname]=Xc(!1,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(o){r[o.pname]=qc(!0,function(e,n,t){return Z(e[o.name],function(n){return o.factory.sketch(co(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:w(r),externals:w(i)};var o,r,i}function da(n,e,t){return o=mn.some(n),i=(r=e).components,s=De(t,function(n,e){return o=n,r=!1,{name:w(t=e),required:function(){return o.fold(function(n,e){return n},function(n,e){return n})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+t);return r=!0,o}};var t,o,r}),u=o,c=r,a=s,f=B(i,function(n){return Wc(u,c,n,a)}),Ee(s,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),f;var o,r,i,u,c,a,s,f}function ma(n,e,t){var o=e.partUids[t];return n.getSystem().getByUid(o).toOptional()}function ga(n,e,t){return ma(n,e,t).getOrDie("Could not find part: "+t)}function pa(o){return ho("partUids","partUids",Et(function(n){return e=n.uid,t=Z(o,Uu),xo(Z(t,function(n){return{key:n,value:e+"-"+n}}));var e,t}),mo())}function ha(n){return yo(Ls,n)}function va(o){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return o.apply(void 0,u([n.getApis(),n],e,!1))},t=(e=o.toString()).indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Zo(i.slice(1))}},n;var n,e,t,r,i}function ba(n){var e=Xe(n)?n.dom[Ws]:null;return mn.from(e)}function ya(n,e,t,o,r){var i;return zt(n+" [SpecSchema]",It((i=r,(0<o.length?[Gt("parts",o)]:[]).concat([Lt("uid"),Yt("dom",{}),Yt("components",[]),Mr("originalSpec"),Yt("debug.sketcher",{})]).concat(i)).concat(e)),t)}function xa(n,e,t,o,r){var i=Ys(r),u=ya(n,e,i,B(t,function(n){return n.fold(mn.none,mn.some,mn.none,mn.none).map(function(n){return Gt(n.name,n.schema.concat([Mr(zs())]))}).toArray()}),[pa(t)]),c=la(0,u,t);return o(u,da(n,u,c.internals()),i,c.externals())}function wa(n){var r=zt("Sketcher for "+n.name,Ks,n),e=De(r.apis,va),t=De(r.extraApis,Fo);return y(y({name:r.name,configFields:r.configFields,sketch:function(n){return e=r.name,t=r.configFields,(0,r.factory)(ya(e,t,o=Ys(n),[],[]),o);var e,t,o}},e),t)}function Sa(n){var r,e,i,t=zt("Sketcher for "+n.name,Js,n),o=(r=t.name,e=t.partFields,i={},M(e,function(n){n.fold(mn.some,mn.none,mn.some,mn.some).each(function(t){var o=js(r,t.pname);i[t.name]=function(n){var e=zt("Part: "+t.name+" in "+r,lo(t.schema),n);return y(y({},o),{config:n,validated:e})}})}),i),u=De(t.apis,va),c=De(t.extraApis,Fo);return y(y({name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:function(n){return xa(t.name,t.configFields,t.partFields,t.factory,n)},parts:o},u),c)}function Oa(n){var r,e,t,o,i,u,c=(r={prefix:ui},n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,o=r[e];return"string"==(t=typeof o)||"number"==t?o.toString():n}));return e=fe.fromHtml(c),t=Je(e),o=R(void 0!==e.dom.attributes?e.dom.attributes:[],function(n,e){var t;return"class"===e.name?n:y(y({},n),((t={})[e.name]=e.value,t))},{}),i=Array.prototype.slice.call(e.dom.classList,0),u=0===t.length?{}:{innerHtml:Lo(e)},y({tag:le(e),classes:i,attributes:o},u)}function ka(n){return{dom:Oa(n)}}function Ta(n){return or([ii.config({toggleClass:ci("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ar(n,function(n,e){(e?ii.on:ii.off)(n)})])}function Ca(n,e,t,o){var r=Ta(t);return nf(e,o,r,n)}function Ea(n,e){var t=e.ui.registry.getAll().icons;return mn.from(t[n]).fold(function(){return Oa('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return Oa('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})}function Da(e){return Hs({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(o){return{events:qo([Do(Vn(),function(n,e,t){return o(n,t)},[n]),Do(Nn(),function(n,e,t){return o(n,t)},[n]),Do(Hn(),function(n,e,t){t.mouseIsDown.get()&&o(n,t)},[n])])}})}})}function Ma(n,e,t){e.store.manager.onLoad(n,e,t)}function _a(n,e,t){e.store.manager.onUnload(n,e,t)}function Ra(){var n=No(null);return tr({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function Fa(){var i=No({}),u=No({});return tr({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return _e(i.get(),n).orThunk(function(){return _e(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),o={},r={};M(n,function(e){_e(o[e.value]=e,"meta").each(function(n){_e(n,"text").each(function(n){r[n]=e})})}),i.set(y(y({},e),o)),u.set(y(y({},t),r))},clear:function(){i.set({}),u.set({})}})}function Ia(n,e,t,o){var r=e.store;t.update([o]),r.setValue(n,o),e.onSetValue(n,o)}function Va(n,e){return vf.set(n,e)}function Ba(n){return vf.get(n)}function Aa(n){var e=n.event.raw;return-1===e.type.indexOf("touch")?void 0!==e.clientX?mn.some(e).map(function(n){return yf(n.clientX,n.clientY)}):mn.none():void 0!==e.touches&&1===e.touches.length?mn.some(e.touches[0]).map(function(n){return yf(n.clientX,n.clientY)}):mn.none()}function Na(n){return n.model.minX}function Ha(n){return n.model.minY}function Pa(n){return n.model.minX-1}function za(n){return n.model.minY-1}function ja(n){return n.model.maxX}function La(n){return n.model.maxY}function $a(n){return n.model.maxX+1}function Ga(n){return n.model.maxY+1}function Ua(n,e,t){return e(n)-t(n)}function Wa(n){return Ua(n,ja,Na)}function Xa(n){return Ua(n,La,Ha)}function qa(n){return Wa(n)/2}function Ya(n){return Xa(n)/2}function Ka(n){return n.stepSize}function Ja(n){return n.snapToGrid}function Qa(n){return n.snapStart}function Za(n){return n.rounded}function ns(n,e){return void 0!==n[e+"-edge"]}function es(n){return ns(n,"left")}function ts(n){return ns(n,"right")}function os(n){return ns(n,"top")}function rs(n){return ns(n,"bottom")}function is(n){return n.model.value.get()}function us(n,e){return{x:n,y:e}}function cs(n,e){X(n,xf(),{value:e})}function as(n,e,t,o){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-o)}function ss(n,e,t,o){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+o)}function fs(n,e,t){return Math.max(e,Math.min(t,n))}function ls(n){var e=n.min,t=n.max,o=n.range,r=n.value,i=n.step,u=n.snap,c=n.snapStart,a=n.rounded,s=n.hasMinEdge,f=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=s?e-1:e,p=f?t+1:t;if(r<l)return g;if(d<r)return p;var h,v,b,y,x,w=fs((x=l,Math.min(d,Math.max(r,x))-x)/m*o+e,g,p);return u&&e<=w&&w<=t?(h=w,v=e,b=t,y=i,c.fold(function(){var n=Math.round((h-v)/y)*y;return fs(v+n,v-1,b+1)},function(n){var e=Math.round((h-n)%y/y),t=Math.floor((h-n)/y),o=Math.floor((b-n)/y),r=Math.min(o,t+e);return Math.max(n,n+r*y)})):a?Math.round(w):w}function ds(n){var e=n.min,t=n.max,o=n.range,r=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,c=n.maxBound,a=n.maxOffset,s=n.centerMinEdge,f=n.centerMaxEdge;return r<e?i?0:s:t<r?u?c:f:(r-e)/o*a}function ms(n){return n.element.dom.getBoundingClientRect()}function gs(n){return ms(n)[wf]}function ps(n){return ms(n).right}function hs(n){return ms(n).top}function vs(n){return ms(n).bottom}function bs(n){return ms(n).width}function ys(n){return ms(n).height}function xs(n,e){var t=ms(n),o=ms(e);return(t[wf]+t.right)/2-o[wf]}function ws(n,e){var t=ms(n),o=ms(e);return(t.top+t.bottom)/2-o.top}function Ss(n,e){X(n,xf(),{value:e})}function Os(n,e,t){return ls({min:Na(e),max:ja(e),range:Wa(e),value:t,step:Ka(e),snap:Ja(e),snapStart:Qa(e),rounded:Za(e),hasMinEdge:es(e),hasMaxEdge:ts(e),minBound:gs(n),maxBound:ps(n),screenRange:bs(n)})}function ks(r){return function(n,e){return Ss(n,{x:o=(0<r?ss:as)(is(t=e).x,Na(t),ja(t),Ka(t))}),mn.some(o).map(x);var t,o}}function Ts(n,e,t,o,r,i){var u,c,a,s,f,l,d,m,g=(c=i,a=t,s=o,f=r,l=bs(u=e),d=s.bind(function(n){return mn.some(xs(n,u))}).getOr(0),m=f.bind(function(n){return mn.some(xs(n,u))}).getOr(l),ds({min:Na(c),max:ja(c),range:Wa(c),value:a,hasMinEdge:es(c),hasMaxEdge:ts(c),minBound:gs(u),minOffset:0,maxBound:ps(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m}));return gs(e)-gs(n)+g}function Cs(n,e){X(n,xf(),{value:e})}function Es(n,e,t){return ls({min:Ha(e),max:La(e),range:Xa(e),value:t,step:Ka(e),snap:Ja(e),snapStart:Qa(e),rounded:Za(e),hasMinEdge:os(e),hasMaxEdge:rs(e),minBound:hs(n),maxBound:vs(n),screenRange:ys(n)})}function Ds(r){return function(n,e){return Cs(n,{y:o=(0<r?ss:as)(is(t=e).y,Ha(t),La(t),Ka(t))}),mn.some(o).map(x);var t,o}}function Ms(n,e,t,o,r,i){var u,c,a,s,f,l,d,m,g=(c=i,a=t,s=o,f=r,l=ys(u=e),d=s.bind(function(n){return mn.some(ws(n,u))}).getOr(0),m=f.bind(function(n){return mn.some(ws(n,u))}).getOr(l),ds({min:Ha(c),max:La(c),range:Xa(c),value:a,hasMinEdge:os(c),hasMaxEdge:rs(c),minBound:hs(u),minOffset:0,maxBound:vs(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m}));return hs(e)-hs(n)+g}function _s(n,e){X(n,xf(),{value:e})}function Rs(n,e){return{x:n,y:e}}function Fs(u,c){return function(n,e){return o=e,r=0<u?ss:as,_s(n,Rs(i=(t=c)?is(o).x:r(is(o).x,Na(o),ja(o),Ka(o)),t?r(is(o).y,Ha(o),La(o),Ka(o)):is(o).y)),mn.some(i).map(x);var t,o,r,i}}function Is(e,t,o,n){return nf(t,function(){var n=o();e.setContextToolbar([{label:t+" group",items:n}])},{},n)}function Vs(n,o){var e={onChange:function(n,e,t){o.undoManager.transact(function(){o.formatter.apply("forecolor",{value:t}),o.nodeChanged()})},getInitialValue:w(-1)};return Is(n,"color-levels",function(){return[(r=e,$f.sketch({dom:Oa('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[$f.parts["left-edge"](ka('<div class="${prefix}-hue-slider-black"></div>')),$f.parts.spectrum({dom:Oa('<div class="${prefix}-slider-gradient-container"></div>'),components:[ka('<div class="${prefix}-slider-gradient"></div>')],behaviours:or([ii.config({toggleClass:ci("thumb-active")})])}),$f.parts["right-edge"](ka('<div class="${prefix}-hue-slider-white"></div>')),$f.parts.thumb({dom:Oa('<div class="${prefix}-slider-thumb"></div>'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})],onChange:function(n,e,t){var o=i(t.x());$r(e.element,"background-color",o),r.onChange(n,e,o)},onDragStart:function(n,e){ii.on(e)},onDragEnd:function(n,e){ii.off(e)},onInit:function(n,e,t,o){var r=i(o.x());$r(e.element,"background-color",r)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:r.getInitialValue()}}},sliderBehaviours:or([Nr($f.refresh)])}))];function i(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"}var r},o)}function Bs(n){var e,t,o=n.selection.getStart(),r=fe.fromDom(o),i=fe.fromDom(n.getBody()),u=(e=function(n){return un(i,n)},(Xe(t=r)?mn.some(t):pe(t).filter(Xe)).map(function(n){return mi(function(n,e){return e(n)},gi,n,function(n){return Wr(n,"font-size").isSome()},e).bind(function(n){return Wr(n,"font-size")}).getOrThunk(function(){return Ur(n,"font-size")})}).getOr(""));return F(Gf,function(n){return u===n}).getOr("medium")}function As(n){return[ka('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e={onChange:n.onChange,sizes:Xf,category:"font",getInitialValue:n.getInitialValue},r=zt("SizeSlider",Wf,e),$f.sketch({dom:{tag:"div",classes:[ci("slider-"+r.category+"-size-container"),ci("slider"),ci("slider-size-container")]},onChange:function(n,e,t){var o=t.x();0<=o&&o<r.sizes.length&&r.onChange(o)},onDragStart:function(n,e){ii.on(e)},onDragEnd:function(n,e){ii.off(e)},model:{mode:"x",minX:0,maxX:r.sizes.length-1,getInitialValue:function(){return{x:r.getInitialValue()}}},stepSize:1,snapToGrid:!0,sliderBehaviours:or([Nr($f.refresh)]),components:[$f.parts.spectrum({dom:Oa('<div class="${prefix}-slider-size-container"></div>'),components:[ka('<div class="${prefix}-slider-size-line"></div>')]}),$f.parts.thumb({dom:Oa('<div class="${prefix}-slider-thumb"></div>'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})]})),ka('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e,r}function Ns(n){var e=void 0!==n.uid&&Re(n,"uid")?n.uid:qs("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOptional()},asSpec:function(){return y(y({},n),{uid:e})}}}Wu(Jc.external,ua);var Hs=Wu(Jc.optional,ca),Ps=Wu(Jc.group,aa),zs=w("entirety"),js=function(n,e){return{uiType:Yc(),owner:n,name:e}},Ls=Gu("alloy-premade"),$s=w("alloy-id-"),Gs=w("data-alloy-id"),Us=$s(),Ws=Gs(),Xs=function(n,e){Object.defineProperty(n.dom,Ws,{value:e,writable:!0})},qs=Gu,Ys=function(n){return dt(n,"uid")?n:y(y({},n),{uid:qs("uid")})},Ks=It([Lt("name"),Lt("factory"),Lt("configFields"),Yt("apis",{}),Yt("extraApis",{})]),Js=It([Lt("name"),Lt("factory"),Lt("configFields"),Lt("partFields"),Yt("apis",{}),Yt("extraApis",{})]),Qs=wa({name:"Button",factory:function(n){function t(e){return _e(n.dom,"attributes").bind(function(n){return _e(n,e)})}var e,o=(e=n.action,qo(V([e.map(function(t){return Qo(function(n,e){t(n),e.stop()})}).toArray(),Pr()]))),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:$c(n.buttonBehaviours,[fi.config({}),jc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return y({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Yt("uid",void 0),Lt("dom"),Yt("components",[]),Lc("buttonBehaviours",[fi,jc]),Ut("action"),Ut("role"),Yt("eventOrder",{})]}),Zs=Ao({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return qo([Co(Xn(),x)])},exhibit:function(){return Io({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),nf=function(n,e,t,o){return Qs.sketch({dom:Ea(n,o),action:e,buttonBehaviours:co(or([Zs.config({})]),t)})},ef=Hs({schema:[Lt("dom")],name:"label"}),tf=Da("top-left"),of=Da("top"),rf=Da("top-right"),uf=Da("right"),cf=Da("bottom-right"),af=Da("bottom"),sf=Da("bottom-left"),ff=[ef,Da("left"),uf,of,af,tf,rf,sf,cf,sa({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:qo([_o(Vn(),n,"spectrum"),_o(Bn(),n,"spectrum"),_o(An(),n,"spectrum"),_o(Nn(),n,"spectrum"),_o(Hn(),n,"spectrum"),_o(Pn(),n,"spectrum")])}}}),sa({schema:[vo("mouseIsDown",function(){return No(!1)})],name:"spectrum",overrides:function(t){function o(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})}var r=t.model.manager;return{behaviours:or([jc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),fi.config({})]),events:qo([Eo(Vn(),o),Eo(Bn(),o),Eo(Nn(),o),Eo(Hn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],lf=Object.freeze({__proto__:null,onLoad:Ma,onUnload:_a,setValue:function(n,e,t,o){e.store.manager.setValue(n,e,t,o)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),df=Object.freeze({__proto__:null,events:function(t,o){var n=t.resetOnDom?[Yo(function(n,e){Ma(n,t,o)}),Ko(function(n,e){_a(n,t,o)})]:[Vo(t,o,Ma)];return qo(n)}}),mf=Object.freeze({__proto__:null,memory:Ra,dataset:Fa,manual:function(){return tr({readState:Y})},init:function(n){return n.store.manager.state(n)}}),gf=[Ut("initialValue"),Lt("getFallbackEntry"),Lt("getDataKey"),Lt("setValue"),Dr("manager",{setValue:Ia,getValue:function(n,e,t){var o=e.store,r=o.getDataKey(n);return t.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(e,t,o){t.store.initialValue.each(function(n){Ia(e,t,o,n)})},onUnload:function(n,e,t){t.clear()},state:Fa})],pf=[Lt("getValue"),Yt("setValue",Y),Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){e.store.setValue(n,o),e.onSetValue(n,o)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:Y,state:er.init})],hf=Ao({fields:[Kt("store",{mode:"memory"},jt("mode",{memory:[Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){t.set(o),e.onSetValue(n,o)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Ra})],manual:pf,dataset:gf})),kr("onSetValue"),Yt("resetOnDom",!1)],name:"representing",active:df,apis:lf,extra:{setValueFrom:function(n,e){var t=hf.getValue(e);hf.setValue(n,t)}},state:mf}),vf=Yr("width",function(n){return n.dom.offsetWidth}),bf=function(t,o){return{left:t,top:o,translate:function(n,e){return bf(t+n,o+e)}}},yf=bf,xf=w("slider.change.value"),wf="left",Sf=ks(-1),Of=ks(1),kf=mn.none,Tf=mn.none,Cf={"top-left":mn.none(),top:mn.none(),"top-right":mn.none(),right:mn.some(function(n,e){cs(n,{x:$a(e)})}),"bottom-right":mn.none(),bottom:mn.none(),"bottom-left":mn.none(),left:mn.some(function(n,e){cs(n,{x:Pa(e)})})},Ef=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Os(n,e,t);return Ss(n,{x:o}),o},setToMin:function(n,e){Ss(n,{x:Na(e)})},setToMax:function(n,e){Ss(n,{x:ja(e)})},findValueOfOffset:Os,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.left})},findPositionOfValue:Ts,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ts(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ba(e.element)/2;$r(e.element,"left",i-u+"px")},onLeft:Sf,onRight:Of,onUp:kf,onDown:Tf,edgeActions:Cf}),Df=mn.none,Mf=mn.none,_f=Ds(-1),Rf=Ds(1),Ff={"top-left":mn.none(),top:mn.some(function(n,e){cs(n,{y:za(e)})}),"top-right":mn.none(),right:mn.none(),"bottom-right":mn.none(),bottom:mn.some(function(n,e){cs(n,{y:Ga(e)})}),"bottom-left":mn.none(),left:mn.none()},If=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Es(n,e,t);return Cs(n,{y:o}),o},setToMin:function(n,e){Cs(n,{y:Ha(e)})},setToMax:function(n,e){Cs(n,{y:La(e)})},findValueOfOffset:Es,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.top})},findPositionOfValue:Ms,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),u=Kr(e.element)/2;$r(e.element,"top",i-u+"px")},onLeft:Df,onRight:Mf,onUp:_f,onDown:Rf,edgeActions:Ff}),Vf=Aa,Bf=Fs(-1,!1),Af=Fs(1,!1),Nf=Fs(-1,!0),Hf=Fs(1,!0),Pf={"top-left":mn.some(function(n,e){cs(n,us(Pa(e),za(e)))}),top:mn.some(function(n,e){cs(n,us(qa(e),za(e)))}),"top-right":mn.some(function(n,e){cs(n,us($a(e),za(e)))}),right:mn.some(function(n,e){cs(n,us($a(e),Ya(e)))}),"bottom-right":mn.some(function(n,e){cs(n,us($a(e),Ga(e)))}),bottom:mn.some(function(n,e){cs(n,us(qa(e),Ga(e)))}),"bottom-left":mn.some(function(n,e){cs(n,us(Pa(e),Ga(e)))}),left:mn.some(function(n,e){cs(n,us(Pa(e),Ya(e)))})},zf=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Rs(Os(n,e,t.left),Es(n,e,t.top));return _s(n,o),o},setToMin:function(n,e){_s(n,Rs(Na(e),Ha(e)))},setToMax:function(n,e){_s(n,Rs(ja(e),La(e)))},getValueFromEvent:Vf,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ts(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),c=Ba(e.element)/2,a=Kr(e.element)/2;$r(e.element,"left",i-c+"px"),$r(e.element,"top",u-a+"px")},onLeft:Bf,onRight:Af,onUp:Nf,onDown:Hf,edgeActions:Pf}),jf=[Yt("stepSize",1),Yt("onChange",Y),Yt("onChoose",Y),Yt("onInit",Y),Yt("onDragStart",Y),Yt("onDragEnd",Y),Yt("snapToGrid",!1),Yt("rounded",!0),Ut("snapStart"),$t("model",jt("mode",{x:[Yt("minX",0),Yt("maxX",100),vo("value",function(n){return No(n.mode.minX)}),Lt("getInitialValue"),Dr("manager",Ef)],y:[Yt("minY",0),Yt("maxY",100),vo("value",function(n){return No(n.mode.minY)}),Lt("getInitialValue"),Dr("manager",If)],xy:[Yt("minX",0),Yt("maxX",100),Yt("minY",0),Yt("maxY",100),vo("value",function(n){return No({x:n.mode.minX,y:n.mode.minY})}),Lt("getInitialValue"),Dr("manager",zf)]})),ju("sliderBehaviours",[jc,hf]),vo("mouseIsDown",function(){return No(!1)})],Lf=w("mouse.released"),$f=Sa({name:"Slider",configFields:jf,partFields:ff,factory:function(i,n,e,t){function u(n){return ga(n,i,"thumb")}function c(n){return ga(n,i,"spectrum")}function o(n){return ma(n,i,"left-edge")}function r(n){return ma(n,i,"right-edge")}function a(n){return ma(n,i,"top-edge")}function s(n){return ma(n,i,"bottom-edge")}function f(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:a,getBottomEdge:s,getSpectrum:c})}function l(n,e){h.value.set(e),f(n,u(n))}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&ma(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Lu(i.sliderBehaviours,[jc.config({mode:"special",focusIn:function(n){return ma(n,i,"spectrum").map(jc.focusIn).map(x)}}),hf.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),ti.config({channels:((p={})[Lf()]={onReceive:d},p)})]),events:qo([Eo(xf(),function(n,e){!function(n,e){l(n,e);var t=u(n);i.onChange(n,t,e),mn.some(!0)}(n,e.event.value)}),Yo(function(n,e){var t=h.getInitialValue();h.value.set(t);var o=u(n);f(n,o);var r=c(n);i.onInit(n,o,r,h.value.get())}),Eo(Vn(),m),Eo(An(),g),Eo(Nn(),m),Eo(Pn(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},setValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(n,e,t){n.setValue(e,t)},resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Gf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Uf=w(Gf),Wf=It([Lt("getInitialValue"),Lt("onChange"),Lt("category"),Lt("sizes")]),Xf=Uf(),qf={},Yf={exports:qf};function Kf(u){var e=Ns({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:qo([Ro(Un()),Eo(Gn(),function(n,e){var t=e.event.raw,o=t.target.files||t.dataTransfer.files;mn.from(o[0]).each(function(n){var r,t,i=u;r=n,t=r,new Jl(function(n){var e=new FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)}).then(function(n){return n.split(",")[1]}).then(function(o){i.undoManager.transact(function(){var n=i.editorUpload.blobCache,e=n.create(Gu("mceu"),r,o);n.add(e);var t=i.dom.createHTML("img",{src:e.blobUri()});i.insertContent(t)})})})})])});return Qs.sketch({dom:Ea("image",u),components:[e.asSpec()],action:function(n){e.get(n).element.dom.click()}})}function Jf(n){return n.dom.textContent}function Qf(n){return 0<n.length}function Zf(n){return null==n?"":n}function nl(t,u){u.url.toOptional().filter(Qf).fold(function(){var e=t;u.link.bind(K).each(function(n){e.execCommand("unlink")})},function(r){var n,e,i=(n=u,(e={}).href=r,n.title.toOptional().filter(Qf).each(function(n){e.title=n}),n.target.toOptional().filter(Qf).each(function(n){e.target=n}),e);u.link.bind(K).fold(function(){var n=u.text.toOptional().filter(Qf).getOr(r);t.insertContent(t.dom.createHTML("a",i,t.dom.encode(n)))},function(e){var t,o,n=(t=e,o=r,u.text.toOptional().filter(Qf).fold(function(){return Be(n=t,"href")===Jf(n)?mn.some(o):mn.none();var n},mn.some));Ve(e,i),n.each(function(n){e.dom.textContent=n})})})}function el(n,e){var t,o;return{key:n,value:{config:{},me:(t=n,o=qo(e),Ao({fields:[Lt("enabled")],name:t,active:{events:w(o)}})),configAsRaw:w({}),initialConfig:{},state:er}}}function tl(n){return n.dom.value}function ol(n,e){if(void 0===e)throw new Error("Value.set was undefined");n.dom.value=e}function rl(n,e){var t=Ns(rd.sketch({inputAttributes:{placeholder:cd.translate(e)},onSetValue:function(n,e){W(n,$n())},inputBehaviours:or([ed.config({find:mn.some}),ud.config({}),jc.config({mode:"execution"})]),selectOnFocus:!1})),o=Ns(Qs.sketch({dom:Oa('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);hf.setValue(e,"")}}));return{name:n,spec:td.sketch({dom:Oa('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),o.asSpec()],containerBehaviours:or([ii.config({toggleClass:ci("input-container-empty")}),ed.config({find:function(n){return mn.some(t.get(n))}}),el("input-clearing",[Eo($n(),function(n){var e=t.get(n);(0<hf.getValue(e).length?ii.off:ii.on)(n)})])])})}}function il(n,e,t){(e.disabled()?sd:fd)(n,e)}function ul(n,e){return!0===e.useNative&&T(ad,le(n.element))}function cl(n,e){return ul(n,e)?Ne(n.element,"disabled"):"true"===Be(n.element,"aria-disabled")}function al(n){return"<alloy.field."+n+">"}function sl(o,r){return Ca(r,"link","link",function(){var n,e,t=hd(o,r);o.setContextToolbar(t),n=r,e=function(){o.focusToolbar()},(Zl.os.isAndroid()?function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)}:p)(e,n),Ql(r).each(function(n){r.selection.select(n.dom)})})}function fl(e){function t(n){return"The component must be in a context to execute: "+n+(e?"\n"+$o(e().element)+" is not in context.":"")}function n(n){return function(){throw new Error(t(n))}}function o(n){return function(){console.warn(t(n))}}return{debugInfo:w("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}}function ll(n,r){var i={};return Ee(n,function(n,o){Ee(n,function(n,e){var t=_e(i,e).getOr([]);i[e]=t.concat([r(o,n)])})}),i}function dl(n){return n.cHandler}function ml(n,e){return{name:n,handler:e}}function gl(n,e,t){var o=e[t];return o?function(u,c,n,a){try{var e=(t=function(n,e){var t=n[c],o=e[c],r=a.indexOf(t),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r<i?-1:i<r?1:0},(o=gn.call(n,0)).sort(t),o);return ht.value(e)}catch(n){return ht.error([n])}var t,o}("Event: "+t,"name",n,o).map(function(n){var t,e,o,r,i=Z(n,function(n){return n.handler});return{can:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return R(e,function(n,e){return n&&e.can.apply(void 0,t)},!0)},abort:(o=e=t=i,r=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return R(o,function(n,e){return n||r(e).apply(void 0,t)},!1)}),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];M(t,function(n){n.run.apply(void 0,e)})}}}):ht.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(Z(n,function(n){return n.name}),null,2)])}function pl(e,n){M(n,function(n){je(e,n)})}function hl(e,n){M(n,function(n){Le(e,n)})}function vl(n){var t,e,o,r,i=(t=_e(n,"behaviours").getOr({}),B(st(t),function(n){var e=t[n];return l(e)?[e.me]:[]}));return e=n,r=Z(o=i,function(n){return Xt(n.name(),[Lt("config"),Yt("state",er)])}),{list:o,data:De(Ht("component.behaviours",lo(r),e.behaviours).fold(function(n){throw new Error(po(n)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},K),function(n){return w(n.map(function(n){return{config:n.config,state:n.state.init(n.config)}}))})}}function bl(n,e,t){var o,r,i=y(y({},(o=n).dom),{uid:o.uid,domChildren:Z(o.components,function(n){return n.element})}),u=n.domModification.fold(function(){return Io({})},Io),c=0<e.length?function(e,n,t,o){var r=y({},n);function i(n){return _(n,function(n,e){return y(y({},e.modification),n)},{})}M(t,function(n){r[n.name()]=n.exhibit(e,o)});var u=ll(r,function(n,e){return{name:n,modification:e}});return Io({classes:_(u.classes,function(n,e){return e.modification.concat(n)},[]),attributes:i(u.attributes),styles:i(u.styles)})}(t,{"alloy.base.modification":u},e,i):u;return y(y({},r=i),{attributes:y(y({},r.attributes),c.attributes),styles:y(y({},r.styles),c.styles),classes:r.classes.concat(c.classes)})}function yl(n,e,t){var o,r,i,u,c,a={"alloy.base.behaviour":n.events},s=n.eventOrder;return r=t,i=e,o=ll(y(y({},a),(u=r,c={},M(i,function(n){c[n.name()]=n.handlers(u)}),c)),ml),wd(o,s).getOrDie()}function xl(t){function n(){return f}var e=No(xd),o=Pt(Ht("custom.definition",Od,t)),r=vl(t),i=r.list,u=r.data,c=function(n){var c=fe.fromTag(n.tag);Ve(c,n.attributes),pl(c,n.classes),Gr(c,n.styles),n.innerHtml.each(function(n){return t=n,i=me(e=c).dom,xe(u=fe.fromDom(i.createDocumentFragment()),(o=t,(r=(i||document).createElement("div")).innerHTML=o,Je(fe.fromDom(r)))),we(e),void Qe(e,u);var e,t,o,r,i,u});var e=n.domChildren;return xe(c,e),n.value.each(function(n){ol(c,n)}),n.uid,Xs(c,n.uid),c}(bl(o,i,u)),a=yl(o,i,u),s=No(o.components),f={uid:t.uid,getSystem:e.get,config:function(n){var e=u;return(m(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(n){return m(u[n.name()])},spec:t,readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(n){e.set(n)},disconnect:function(){e.set(fl(n))},element:c,syncComponents:function(){var n=B(Je(c),function(n){return e.get().getByDom(n).fold(function(){return[]},P)});s.set(n)},components:s.get,events:a};return f}function wl(n){return function(n){var e=zt("external.component",It([Lt("element"),Ut("uid")]),n),t=No(fl()),o=e.uid.getOrThunk(function(){return qs("external")});Xs(e.element,o);var r={uid:o,getSystem:t.get,config:mn.none,hasConfigured:S,connect:function(n){t.set(n)},disconnect:function(){t.set(fl(function(){return r}))},getApis:function(){return{}},element:e.element,spec:n,readState:w("No state"),syncComponents:Y,components:w([]),events:{}};return ha(r)}({element:fe.fromText(n)})}function Sl(n){(jo(n.element).isNone()||fi.isFocused(n))&&(fi.isFocused(n)||fi.focus(n),X(n,Ed,{item:n}))}function Ol(n){X(n,Dd,{item:n})}function kl(n,e,t,o){var r=n.getSystem().build(o);at(n,r,t)}function Tl(n,e,t,o){F(zd(n),function(n){return un(o.element,n.element)}).each(Ce)}function Cl(e,n,t,r,o){var i=zd(e);return mn.from(i[r]).map(function(n){return Tl(e,0,0,n),o.each(function(n){kl(e,0,function(n,e){var t,o=e;he(t=n,r).fold(function(){Qe(t,o)},function(n){ve(n,o)})},n)}),n})}function El(n,e,t,o){return _e(e.routes,o.start).bind(function(n){return _e(n,o.destination)})}function Dl(t,o,n){var e,r,i=n;qd(e=t,r=o).bind(function(n){return Xd(e,r,i,n)}).each(function(n){var e=n.transition;Le(t.element,e.transitionClass),He(t.element,o.destinationAttr)})}function Ml(n,e,t,o){Dl(n,e,t),Ne(n.element,e.stateAttr)&&Be(n.element,e.stateAttr)!==o&&e.onFinish(n,o),Ie(n.element,e.stateAttr,o)}function _l(n){je(n,Qd)}function Rl(n){Le(n,Qd)}function Fl(n){return _e(n,"format").getOr(n.title)}function Il(n){return Re(n,"items")?(r=co((e=n,t=["items"],o={},Ee(e,function(n,e){T(t,e)||(o[e]=n)}),o),{menu:!0}),i=tm(e.items),{item:r,menus:co(i.menus,yo(e.title,i.items)),expansions:co(i.expansions,yo(e.title,e.title))}):{item:n,menus:{},expansions:{}};var t,o,e,r,i}function Vl(t,n,o){var e,r,i,u,c,a,s,f,l,d,m,g=(e=t,i=(r=function(n){return B(n,function(n){return void 0===n.items?!Re(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<r(n.items).length?[n]:[]})})(n),tm(i));return c=(u={formats:g,handle:function(n,e){t.undoManager.transact(function(){ii.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),o()}}).formats,a=function(){return m},s=em("Styles",[].concat(Z(c.items,function(n){return nm(Fl(n),n.title,n.isSelected(),n.getPreview(),Re(c.expansions,Fl(n)))})),a,!1),f=De(c.menus,function(n,e){var t=Z(n,function(n){return nm(Fl(n),n.title,void 0!==n.isSelected&&n.isSelected(),void 0!==n.getPreview?n.getPreview():"",Re(c.expansions,Fl(n)))});return em(e,t,a,!0)}),l=co(f,yo("styles",s)),d={tmenu:Wd.tieredData("styles",l,c.expansions)},(m=Ns(Wd.sketch({dom:{tag:"div",classes:[ci("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=hf.getValue(e);return u.handle(e,t.value),mn.none()},onEscape:function(){return mn.none()},onOpenMenu:function(n,e){var t=Ba(n.element);Va(e.element,t),Jd.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var o=Ba(n.element),r=pi(e.element,'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(r).getOrDie();Va(t.element,o),Jd.progressTo(i,"before"),Jd.jumpTo(t,"after"),Jd.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var o=pi(e.element,'[role="menu"]').getOrDie("hacky"),r=n.getSystem().getByDom(o).getOrDie();Jd.progressTo(r,"after"),Jd.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:d.tmenu,markers:{backgroundMenu:ci("styles-background-menu"),menu:ci("styles-menu"),selectedMenu:ci("styles-selected-menu"),item:ci("styles-item"),selectedItem:ci("styles-selected-item")}}))).asSpec()}function Bl(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]}function Al(e,r){function n(t){return function(){return nf(e=t,function(){n.execCommand(e)},{},n=r);var n,e}}function t(o){return function(){return n=r,t=Ta(e=o),nf(e,function(){n.execCommand(e)},t,n);var n,e,t}}function o(n,e,t){return function(){return Ca(r,n,e,t)}}function i(){return Vl(r,b,function(){r.fire("scrollIntoView")})}function u(n,e){return{isSupported:function(){var e=r.ui.registry.getAll().buttons;return n.forall(function(n){return Re(e,n)})},sketch:e}}var c,a,s=n("undo"),f=n("redo"),l=t("bold"),d=t("italic"),m=t("underline"),g=n("removeformat"),p=o("unlink","link",function(){r.execCommand("unlink",null,!1)}),h=o("unordered-list","ul",function(){r.execCommand("InsertUnorderedList",null,!1)}),v=o("ordered-list","ol",function(){r.execCommand("InsertOrderedList",null,!1)}),b=(a=function(n){return Z(n,function(n){if(Re(n,"items")){var e=a(n.items);return co(co(n,{isSelected:S,getPreview:w("")}),{items:e})}return Re(n,"format")?co(n,{isSelected:y(n.format),getPreview:x(n.format)}):(o=Gu((t=n).title),r=co(t,{format:o,isSelected:y(o),getPreview:x(o)}),c.formatter.register(o,r),r);var t,o,r})})((c=r).getParam("style_formats",fr,"array"));function y(n){return function(){return c.formatter.match(n)}}function x(n){return function(){return c.formatter.getCssText(n)}}return{undo:u(mn.none(),s),redo:u(mn.none(),f),bold:u(mn.none(),l),italic:u(mn.none(),d),underline:u(mn.none(),m),removeformat:u(mn.none(),g),link:u(mn.none(),function(){return sl(e,r)}),unlink:u(mn.none(),p),image:u(mn.none(),function(){return Kf(r)}),bullist:u(mn.some("bullist"),h),numlist:u(mn.some("numlist"),v),fontsizeselect:u(mn.none(),function(){return n={onChange:function(n){var o;o=t,mn.from(Gf[n]).each(function(n){var e,t=n;Bs(e=o)!==t&&e.execCommand("fontSize",!1,t)})},getInitialValue:function(){return e=Bs(t),I(Gf,function(n){return n===e}).getOr(2);var e}},Is(e,"font-size",function(){return As(n)},t=r);var t,n}),forecolor:u(mn.none(),function(){return Vs(e,r)}),styleselect:u(mn.none(),function(){return nf("style-formats",function(n){r.fire("toReading"),e.dropup.appear(i,ii.on,n)},or([ii.config({toggleClass:ci("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),ti.config({channels:xo([Hr(mr,ii.off),Hr(gr,ii.off)])})]),r)})}}function Nl(n){function e(){return n.stopPropagation()}function t(){return n.preventDefault()}var o=i(t,e);return{target:fe.fromDom(function(n){if(et()&&l(n.target)){var e=fe.fromDom(n.target);if(Xe(e)&&ot(e)&&n.composed&&n.composedPath){var t=n.composedPath();if(t)return 0<(o=t).length?mn.some(o[0]):mn.none()}}var o;return mn.from(n.target)}(n).getOr(n.target)),x:n.clientX,y:n.clientY,stop:e,prevent:t,kill:o,raw:n}}function Hl(n,e,t,o,r){var i,u,c=(i=t,u=o,function(n){i(n)&&u(Nl(n))});return n.dom.addEventListener(e,c,r),{unbind:J(rm,n,e,c,r)}}function Pl(n,e,t){return Hl(n,e,im,t,!1)}function zl(n,e,t){return Hl(n,e,im,t,!0)}function jl(n){return{isPortrait:w(n.matchMedia("(orientation: portrait)").matches)}}function Ll(o,e){var n=fe.fromDom(o),r=null,t=Pl(n,"orientationchange",function(){um.clearInterval(r);var n=jl(o);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){um.clearInterval(r);var e=o.innerHeight,t=0;r=um.setInterval(function(){e!==o.innerHeight?(um.clearInterval(r),n(mn.some(o.innerHeight))):20<t&&(um.clearInterval(r),n(mn.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}}function $l(n,e,t){var o,r=n.document.createRange(),i=r;return e.fold(function(n){i.setStartBefore(n.dom)},function(n,e){i.setStart(n.dom,e)},function(n){i.setStartAfter(n.dom)}),o=r,t.fold(function(n){o.setEndBefore(n.dom)},function(n,e){o.setEnd(n.dom,e)},function(n){o.setEndAfter(n.dom)}),r}function Gl(n,e,t,o,r){var i=n.document.createRange();return i.setStart(e.dom,t),i.setEnd(o.dom,r),i}function Ul(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:n.width,height:n.height}}function Wl(n,e,t){return e(fe.fromDom(t.startContainer),t.startOffset,fe.fromDom(t.endContainer),t.endOffset)}function Xl(n,e){var r,t,o,i=(r=n,e.match({domRange:function(n){return{ltr:w(n),rtl:mn.none}},relative:function(n,e){return{ltr:k(function(){return $l(r,n,e)}),rtl:k(function(){return mn.some($l(r,e,n))})}},exact:function(n,e,t,o){return{ltr:k(function(){return Gl(r,n,e,t,o)}),rtl:k(function(){return mn.some(Gl(r,t,o,n,e))})}}}));return(o=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return cm.rtl(fe.fromDom(n.endContainer),n.endOffset,fe.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Wl(0,cm.ltr,o)}):Wl(0,cm.ltr,o)}!function(){var n=this,e=function(){var n,e,t,o={exports:{}};function r(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(n,this)}function u(t,o){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn(function(){var n,e=1===t._state?o.onFulfilled:o.onRejected;if(null!==e){try{n=e(t._value)}catch(n){return void a(o.promise,n)}c(o.promise,n)}else(1===t._state?c:a)(o.promise,t._value)})):t._deferreds.push(o)}function c(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if(n instanceof i)return e._state=3,e._value=n,void s(e);if("function"==typeof t)return void l((o=t,r=n,function(){o.apply(r,arguments)}),e)}e._state=1,e._value=n,s(e)}catch(n){a(e,n)}var o,r}function a(n,e){n._state=2,n._value=e,s(n)}function s(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)u(n,n._deferreds[e]);n._deferreds=null}function f(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function l(n,e){var t=!1;try{n(function(n){t||(t=!0,c(e,n))},function(n){t||(t=!0,a(e,n))})}catch(n){if(t)return;t=!0,a(e,n)}}n=o,e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=setTimeout,i.prototype.catch=function(n){return this.then(null,n)},i.prototype.then=function(n,e){var t=new this.constructor(r);return u(this,new f(n,e,t)),t},i.all=function(n){var c=Array.prototype.slice.call(n);return new i(function(r,i){if(0===c.length)return r([]);for(var u=c.length,n=0;n<c.length;n++)!function e(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var o=n.then;if("function"==typeof o)return o.call(n,function(n){e(t,n)},i),0}c[t]=n,0==--u&&r(c)}catch(n){i(n)}}(n,c[n])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(t){return new i(function(n,e){e(t)})},i.race=function(r){return new i(function(n,e){for(var t=0,o=r.length;t<o;t++)r[t].then(n,e)})},i._immediateFn="function"==typeof setImmediate?function(n){setImmediate(n)}:function(n){t(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},n.exports?n.exports=i:e.Promise||(e.Promise=i);var d=o.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof qf&&void 0!==Yf?Yf.exports=e():(n="undefined"!=typeof globalThis?globalThis:n||self).EphoxContactWrapper=e()}();function ql(r,n){return{uid:r.uid,dom:r.dom,components:n,behaviours:Lu(r.formBehaviours,[hf.config({store:{mode:"manual",getValue:function(n){var e,t,o=(e=r,t=n.getSystem(),De(e.partUids,function(n,e){return w(t.getByUid(n))}));return De(o,function(n,o){return n().bind(function(n){var e=ed.getCurrent(n),t=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+$o(n.element));return e.fold(function(){return ht.error(t)},ht.value)}).map(hf.getValue)})},setValue:function(t,n){Ee(n,function(e,n){ma(t,r,n).each(function(n){ed.getCurrent(n).each(function(n){hf.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return ma(n,r,e).bind(ed.getCurrent)}}}}function Yl(n){return"prepared"===n.type?mn.some(n.menu):mn.none()}var Kl,Jl=Yf.exports.boltExport,Ql=function(n){return vi(fe.fromDom(n.selection.getStart()),"a")},Zl=Fn(),nd=Object.freeze({__proto__:null,getCurrent:function(n,e,t){return e.find(n)}}),ed=Ao({fields:[Lt("find")],name:"composing",apis:nd}),td=wa({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,o=c(e,["attributes"]);return{uid:n.uid,dom:y({tag:"div",attributes:y({role:"presentation"},t)},o),components:n.components,behaviours:n.containerBehaviours.dump,events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Yt("components",[]),ju("containerBehaviours",[]),Yt("events",{}),Yt("domModification",{}),Yt("eventOrder",{})]}),od=wa({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:$c(t.dataBehaviours,[hf.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),ed.config({find:mn.some})]),events:qo([Yo(function(n,e){hf.setValue(n,t.getInitialValue())})])}},configFields:[Lt("uid"),Lt("dom"),Lt("getInitialValue"),Lc("dataBehaviours",[hf,ed])]}),rd=wa({name:"Input",configFields:w([Ut("data"),Yt("inputAttributes",{}),Yt("inputStyles",{}),Yt("tag","input"),Yt("inputClasses",[]),kr("onSetValue"),Yt("styles",{}),Yt("eventOrder",{}),ju("inputBehaviours",[hf,fi]),Yt("selectOnFocus",!0)])(),factory:function(n,e){return{uid:n.uid,dom:{tag:(o=n).tag,attributes:y({type:"text"},o.inputAttributes),styles:o.inputStyles,classes:o.inputClasses},components:[],behaviours:(t=n,y(y({},or([fi.config({onFocus:t.selectOnFocus?function(n){var e=n.element,t=tl(e);e.dom.setSelectionRange(0,t.length)}:Y})])),Lu(t.inputBehaviours,[hf.config({store:y(y({mode:"manual"},t.data.map(function(n){return{initialValue:n}}).getOr({})),{getValue:function(n){return tl(n.element)},setValue:function(n,e){tl(n.element)!==e&&ol(n.element,e)}}),onSetValue:t.onSetValue})]))),eventOrder:n.eventOrder};var t,o}}),id=Object.freeze({__proto__:null,exhibit:function(n,e){return Io({attributes:xo([{key:e.tabAttr,value:"true"}])})}}),ud=Ao({fields:[Yt("tabAttr","data-alloy-tabstop")],name:"tabstopping",active:id}),cd=tinymce.util.Tools.resolve("tinymce.util.I18n"),ad=["input","button","textarea","select"],sd=function(e,n,t){n.disableClass.each(function(n){je(e.element,n)}),(ul(e,n)?function(n){Ie(n.element,"disabled","disabled")}:function(n){Ie(n.element,"aria-disabled","true")})(e),n.onDisabled(e)},fd=function(e,n,t){n.disableClass.each(function(n){Le(e.element,n)}),(ul(e,n)?function(n){He(n.element,"disabled")}:function(n){Ie(n.element,"aria-disabled","false")})(e),n.onEnabled(e)},ld=Object.freeze({__proto__:null,enable:fd,disable:sd,isDisabled:cl,onLoad:il,set:function(n,e,t,o){(o?sd:fd)(n,e)}}),dd=Object.freeze({__proto__:null,exhibit:function(n,e){return Io({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,n){return qo([Co(Zn(),function(n,e){return cl(n,t)}),Vo(t,n,il)])}}),md=Ao({fields:[Kt("disabled",S,go),Yt("useNative",!0),Ut("disableClass"),kr("onDisabled"),kr("onEnabled")],name:"disabling",active:dd,apis:ld}),gd=[ju("formBehaviours",[hf])],pd=(va(function(n,e,t){return n.getField(e,t)}),function(n){var r,e={field:function(n,e){return r.push(n),t=al(n),o=e,{uiType:Yc(),owner:"form",name:t,config:o,validated:{}};var t,o},record:w(r=[])},t=n(e),o=Z(e.record(),function(n){return sa({name:n,pname:al(n)})});return xa("form",gd,o,ql,t)}),hd=k(function(o,r){return[{label:"the link group",items:[(n={fields:[rl("url","Type or paste URL"),rl("text","Link text"),rl("title","Link title"),rl("target","Link target"),{name:"link",spec:od.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return mn.none()}})}],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return mn.some(Ql(n=r).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:mn.none()}},function(n){return t=Jf(e=n),o=Be(e,"href"),r=Be(e,"title"),i=Be(e,"target"),{url:Zf(o),text:t!==o?Zf(t):"",title:Zf(r),target:Zf(i),link:mn.some(e)};var e,t,o,r,i}));var n},onExecute:function(n,e){var t=hf.getValue(n);nl(r,t),o.restoreToolbar(),r.focus()}},a="navigateEvent",s=zt("SerialisedDialog",lo([Lt("fields"),Yt("maxFieldIndex",n.fields.length-1),Lt("onExecute"),Lt("getInitialValue"),vo("state",function(){return{dialogSwipeState:cu(),currentScreen:No(0)}})]),n),f=Ns(pd(function(t){return{dom:Oa('<div class="${prefix}-serialised-dialog"></div>'),components:[td.sketch({dom:Oa('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:Z(s.fields,function(n,e){return e<=s.maxFieldIndex?td.sketch({dom:Oa('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[i(-1,"previous",0<e),t.field(n.name,n.spec),i(1,"next",e<s.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:or([Nr(function(n,e){var t=e;hi(n.element,"."+ci("serialised-dialog-chain")).each(function(n){$r(n,"left",-s.state.currentScreen.get()*t.width+"px")})}),jc.config({mode:"special",focusIn:function(n,e){c(n)},onTab:function(n,e){return u(n,1),mn.some(!0)},onShiftTab:function(n,e){return u(n,-1),mn.some(!0)}}),el("form-events",[Yo(function(e,n){s.state.currentScreen.set(0),s.state.dialogSwipeState.clear();var t=l.get(e);Qi.highlightFirst(t),s.getInitialValue(e).each(function(n){hf.setValue(e,n)})}),Qo(s.onExecute),Eo(Wn(),function(n,e){"left"===e.event.raw.propertyName&&c(n)}),Eo(a,function(n,e){u(n,e.event.direction)})])])}})),l=Ns({dom:Oa('<div class="${prefix}-dot-container"></div>'),behaviours:or([Qi.config({highlightClass:ci("dot-active"),itemClass:ci("dot-item")})]),components:B(s.fields,function(n,e){return e<=s.maxFieldIndex?[ka('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})}),{dom:Oa('<div class="${prefix}-serializer-wrapper"></div>'),components:[f.asSpec(),l.asSpec()],behaviours:or([jc.config({mode:"special",focusIn:function(n){var e=f.get(n);jc.focusIn(e)}}),el("serializer-wrapper-events",[Eo(Vn(),function(n,e){var t=e.event;s.state.dialogSwipeState.set({xValue:t.raw.touches[0].clientX,points:[]})}),Eo(Bn(),function(n,e){var t=e.event;s.state.dialogSwipeState.on(function(n){e.event.prevent(),s.state.dialogSwipeState.set(function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,o={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([o])}}(n,t.raw.touches[0].clientX))})}),Eo(An(),function(n,e){s.state.dialogSwipeState.on(function(t){u(f.get(n),-1*function(){if(0===t.points.length)return 0;var n=t.points[0].direction,e=t.points[t.points.length-1].direction;return-1===n&&-1===e?-1:1===n&&1===e?1:0}())})})])])})]}];function i(e,n,t){return Qs.sketch({dom:Oa('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){X(n,a,{direction:e})},buttonBehaviours:or([md.config({disableClass:ci("toolbar-navigation-disabled"),disabled:function(){return!t}})])})}function u(n,r){var i=Jr(n.element,"."+ci("serialised-dialog-screen"));hi(n.element,"."+ci("serialised-dialog-chain")).each(function(o){0<=s.state.currentScreen.get()+r&&s.state.currentScreen.get()+r<i.length&&(Wr(o,"left").each(function(n){var e=parseInt(n,10),t=Ba(i[0]);$r(o,"left",e-r*t+"px")}),s.state.currentScreen.set(s.state.currentScreen.get()+r))})}function c(o){var n=Jr(o.element,"input");mn.from(n[s.state.currentScreen.get()]).each(function(n){o.getSystem().getByDom(n).each(function(n){var e=o,t=n.element;e.getSystem().triggerFocus(t,e.element)})});var e=l.get(o);Qi.highlightAt(e,s.state.currentScreen.get())}var n,a,s,f,l}),vd=qo([{key:Yn(),value:To({can:function(n,e){var t,o=e.event,r=o.originator,i=o.target;return!(un(t=r,n.element)&&!un(t,i)&&(console.warn(Yn()+" did not get interpreted by the desired target. \nOriginator: "+$o(r)+"\nTarget: "+$o(i)+"\nCheck the "+Yn()+" event handlers"),1))}})}]),bd=Object.freeze({__proto__:null,events:vd}),yd=K,xd=fl(),wd=function(n,c){var e,t,o,r,i,u,a=Me(n,function(r,u){return(1===r.length?ht.value(r[0].handler):gl(r,c,u)).map(function(n){var e,i,t=(i=m(e=n)?{can:x,abort:S,run:e}:e,function(n,e){for(var t=[],o=2;o<arguments.length;o++)t[o-2]=arguments[o];var r=[n,e].concat(t);i.abort.apply(void 0,r)?e.stop():i.can.apply(void 0,r)&&i.run.apply(void 0,r)}),o=1<r.length?E(c[u],function(e){return C(r,function(n){return n.name===e})}).join(" > "):r[0].name;return yo(u,{handler:t,purpose:o})})});return e={},t=[],o=[],M(a,function(n){n.fold(function(n){t.push(n)},function(n){o.push(n)})}),0<(u={errors:t,values:o}).errors.length?ht.error(V(u.errors)):(i=e,0===(r=u.values).length?ht.value(i):ht.value(co(i,ao.apply(void 0,r))))},Sd="alloy.base.behaviour",Od=lo([ho("dom","dom",Ot(),lo([Lt("tag"),Yt("styles",{}),Yt("classes",[]),Yt("attributes",{}),Ut("value"),Ut("innerHtml")])),Lt("components"),Lt("uid"),Yt("events",{}),Yt("apis",{}),ho("eventOrder","eventOrder",((Kl={})[Zn()]=["disabling",Sd,"toggling","typeaheadevents"],Kl[Yn()]=[Sd,"focusing","keying"],Kl[oe()]=[Sd,"disabling","toggling","representing"],Kl[$n()]=[Sd,"representing","streaming","invalidating"],Kl[ie()]=[Sd,"representing","item-events","tooltipping"],Kl[Nn()]=["focusing",Sd,"item-type-events"],Kl[Vn()]=["focusing",Sd,"item-type-events"],Kl[zn()]=["item-type-events","tooltipping"],Kl[Qn()]=["receiving","reflecting","tooltipping"],Et(w(Kl))),mo()),Ut("domModification")]),kd=qs,Td=function(u){return _e(u,Ls).getOrThunk(function(){var n,e,t,o,r,i=dt(u,"uid")?u:y({uid:kd("")},u);return n=yd(i),e=n.events,t=c(n,["events"]),o=Z(_e(t,"components").getOr([]),Td),r=y(y({},t),{events:y(y({},bd),e),components:o}),ht.value(xl(r)).getOrDie()})},Cd=ha,Ed="alloy.item-hover",Dd="alloy.item-focus",Md=w(Ed),_d=w(Dd),Rd=[Lt("data"),Lt("components"),Lt("dom"),Yt("hasSubmenu",!1),Ut("toggling"),Lc("itemBehaviours",[ii,fi,jc,hf]),Yt("ignoreFocus",!1),Yt("domModification",{}),Dr("builder",function(n){return{dom:n.dom,domModification:y(y({},n.domModification),{attributes:y(y(y({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:$c(n.itemBehaviours,[n.toggling.fold(ii.revoke,function(n){return ii.config(y({aria:{mode:"checked"}},n))}),fi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Ol(n)}}),jc.config({mode:"execution"}),hf.config({store:{mode:"memory",initialValue:n.data}}),el("item-type-events",u(u([],Pr(),!0),[Eo(zn(),Sl),Eo(ne(),fi.focus)],!1))]),components:n.components,eventOrder:n.eventOrder}}),Yt("eventOrder",{})],Fd=[Lt("dom"),Lt("components"),Dr("builder",function(n){return{dom:n.dom,components:n.components,events:qo([Eo(ne(),function(n,e){e.stop()})])}})],Id=w("item-widget"),Vd=w([sa({name:"widget",overrides:function(e){return{behaviours:or([hf.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:Y}})])}}})]),Bd=jt("type",{widget:[Lt("uid"),Lt("data"),Lt("components"),Lt("dom"),Yt("autofocus",!1),Yt("ignoreFocus",!1),Lc("widgetBehaviours",[hf,fi,jc]),Yt("domModification",{}),pa(Vd()),Dr("builder",function(t){function o(n){return ma(n,t,"widget").map(function(n){return jc.focusIn(n),n})}function n(n,e){return eu(e.event.target)||t.autofocus&&e.setSource(n.element),mn.none()}var e=la(Id(),t,Vd()),r=da(Id(),t,e.internals());return{dom:t.dom,components:r,domModification:t.domModification,events:qo([Qo(function(n,e){o(n).each(function(n){e.stop()})}),Eo(zn(),Sl),Eo(ne(),function(n,e){t.autofocus?o(n):fi.focus(n)})]),behaviours:$c(t.widgetBehaviours,[hf.config({store:{mode:"memory",initialValue:t.data}}),fi.config({ignore:t.ignoreFocus,onFocus:function(n){Ol(n)}}),jc.config({mode:"special",focusIn:t.autofocus?function(n){o(n)}:ur(),onLeft:n,onRight:n,onEscape:function(n,e){return fi.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element),mn.none()):(fi.focus(n),mn.some(!0))}})])}})],item:Rd,separator:Fd}),Ad=w([Ps({factory:{sketch:function(n){var e=zt("menu.spec item",Bd,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return dt(e,"uid")?e:y(y({},e),{uid:qs("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Nd=w([Lt("value"),Lt("items"),Lt("dom"),Lt("components"),Yt("eventOrder",{}),ju("menuBehaviours",[Qi,hf,ed,jc]),Kt("movement",{mode:"menu",moveOnTab:!0},jt("mode",{grid:[ei(),Dr("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[Dr("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Lt("rowSelector")],menu:[Yt("moveOnTab",!0),Dr("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),$t("markers",ni()),Yt("fakeFocus",!1),Yt("focusManager",Ii()),kr("onHighlight")]),Hd=w("alloy.menu-focus"),Pd=Sa({name:"Menu",configFields:Nd(),partFields:Ad(),factory:function(n,e,t,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Lu(n.menuBehaviours,[Qi.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),hf.config({store:{mode:"memory",initialValue:n.value}}),ed.config({find:mn.some}),jc.config(n.movement.config(n,n.movement))]),events:qo([Eo(_d(),function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each(function(n){Qi.highlight(e,n),t.stop(),X(e,Hd(),{menu:e,item:n})})}),Eo(Md(),function(n,e){var t=e.event.item;Qi.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),zd=function(n,e){return n.components()},jd=Ao({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(n,e,t,o){kl(n,0,Qe,o)},prepend:function(n,e,t,o){kl(n,0,ye,o)},remove:Tl,replaceAt:Cl,replaceBy:function(e,n,t,o,r){return I(zd(e),o).bind(function(n){return Cl(e,0,0,n,r)})},set:function(i,n,e,u){var t,o,r,c;t=function(){var e,n,t,o,r=Z(u,i.getSystem().build);n=r,o=(e=i).components(),M((t=e).components(),function(n){return Ze(n.element)}),we(t.element),t.syncComponents(),M(H(o,n),function(n){ut(n),e.getSystem().removeFromWorld(n)}),M(n,function(n){n.getSystem().isConnected()?Te(e,n):(e.getSystem().addToWorld(n),Te(e,n),rt(e.element)&&ct(n)),e.syncComponents()})},o=i.element,r=tt(o),c=zo(r).bind(function(e){function n(n){return un(e,n)}var r,i;return n(o)?mn.some(o):(r=n,(i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=fe.fromDom(n.childNodes[e]);if(r(t))return mn.some(t);var o=i(n.childNodes[e]);if(o.isSome())return o}return mn.none()})(o.dom))}),t(o),c.each(function(e){zo(r).filter(function(n){return un(n,e)}).fold(function(){Ho(e)},Y)})},contents:zd})}),Ld=function(t,o,r,n){return _e(r,n).bind(function(n){return _e(t,n).bind(function(n){var e=Ld(t,o,r,n);return mn.some([n].concat(e))})}).getOr([])},$d=function(){function c(u){return function(n){for(var e=st(n),t=0,o=e.length;t<o;t++){var r=e[t],i=n[r];if(i===u)return mn.some(i)}return mn.none()}(i.get())}function a(n){return e(n).bind(Yl)}function t(n){return _e(i.get(),n)}var i=No({}),u=No({}),s=No({}),f=cu(),l=No({}),e=function(n){return _e(u.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(y(y({},u.get()),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,o){f.set(n),i.set(t),u.set(e),l.set(o);var r=function(n,e){var t={};Ee(n,function(n,e){M(n,function(n){t[n]=e})});var o=e,r=lt(e,function(n,e){return{k:n,v:e}}),i=De(r,function(n,e){return[e].concat(Ld(t,o,r,e))});return De(t,function(n){return _e(i,n).getOr([n])})}(o,t);s.set(r)},expand:function(t){return _e(i.get(),t).map(function(n){var e=_e(s.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return _e(s.get(),n)},collapse:function(n){return _e(s.get(),n).bind(function(n){return 1<n.length?mn.some(n.slice(1)):mn.none()})},lookupMenu:e,lookupItem:t,otherMenus:function(n){var e=l.get();return H(st(e),n)},getPrimary:function(){return f.get().bind(a)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),s.set({}),f.clear()},isClear:function(){return f.get().isNone()},getTriggeringPath:function(n,u){var e=E(t(n).toArray(),function(n){return a(n).isSome()});return _e(s.get(),n).bind(function(n){var i=N(e.concat(n));return function(n){for(var e=[],t=0;t<n.length;t++){var o=n[t];if(!o.isSome())return mn.none();e.push(o.getOrDie())}return mn.some(e)}(B(i,function(n,e){return t=n,o=u,r=i.slice(0,e+1),a(t).bind(function(e){return c(t).bind(function(n){return o(n).map(function(n){return{triggeredMenu:e,triggeringItem:n,triggeringPath:r}})})}).fold(function(){return wo(f.get(),n)?[]:[mn.none()]},function(n){return[mn.some(n)]});var t,o,r}))})}}},Gd=Yl,Ud=w("collapse-item"),Wd=wa({name:"TieredMenu",configFields:[Er("onExecute"),Er("onEscape"),Cr("onOpenMenu"),Cr("onOpenSubmenu"),kr("onRepositionMenu"),kr("onCollapseMenu"),Yt("highlightImmediately",!0),Gt("data",[Lt("primary"),Lt("menus"),Lt("expansions")]),Yt("fakeFocus",!1),kr("onHighlight"),kr("onHover"),Gt("markers",[Lt("backgroundMenu")].concat(wr()).concat(Sr())),Lt("dom"),Yt("navigateOnHover",!0),Yt("stayInDom",!1),ju("tmenuBehaviours",[jc,Qi,ed,jd]),Yt("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)},repositionMenus:function(n,e){n.repositionMenus(e)}},factory:function(c,n){function t(n){var o,r,e=(o=n,r=c.data.primary,De(c.data.menus,function(n,e){function t(){return Pd.sketch(y(y({},n),{value:e,markers:c.markers,fakeFocus:c.fakeFocus,onHighlight:c.onHighlight,focusManager:(c.fakeFocus?Vi:Ii)()}))}return e===r?{type:"prepared",menu:o.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})),t=De(c.data.menus,function(n,e){return B(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})});return m.setContents(c.data.primary,e,c.data.expansions,t),m.getPrimary()}function a(n){return hf.getValue(n).value}function i(e,n){Qi.highlight(e,n),Qi.getHighlighted(n).orThunk(function(){return Qi.getFirst(n)}).each(function(n){nn(e,n.element,ne())})}function u(e,n){return So(Z(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?mn.some(n.menu):mn.none()})}))}function s(e,n,t){M(u(n,n.otherMenus(t)),function(n){hl(n.element,[c.markers.backgroundMenu]),c.stayInDom||jd.remove(e,n)})}function f(n,o){var e;Ee((e=n,r.get().getOrThunk(function(){var t={};return M(E(Jr(e.element,"."+c.markers.item),function(n){return"true"===Be(n,"aria-haspopup")}),function(n){e.getSystem().getByDom(n).each(function(n){var e=a(n);t[e]=n})}),r.set(t),t})),function(n,e){var t=T(o,e);Ie(n.element,"aria-expanded",t)})}function l(t,o,r){return mn.from(r[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return mn.none();var e=n.menu;return M(u(o,r.slice(1)),function(n){je(n.element,c.markers.backgroundMenu)}),rt(e.element)||jd.append(t,Cd(e)),hl(e.element,[c.markers.backgroundMenu]),i(t,e),s(t,o,r),mn.some(e)})})}var d,e,r=cu(),m=$d();function g(r,i,u){if(void 0===u&&(u=d.HighlightSubmenu),i.hasConfigured(md)&&md.isDisabled(i))return mn.some(i);var n=a(i);return m.expand(n).bind(function(o){return f(r,o),mn.from(o[0]).bind(function(t){return m.lookupMenu(t).bind(function(n){var e=function(n,e,t){if("notbuilt"!==t.type)return t.menu;var o=n.getSystem().build(t.nbMenu());return m.setMenuBuilt(e,o),o}(r,t,n);return rt(e.element)||jd.append(r,Cd(e)),c.onOpenSubmenu(r,i,e,N(o)),u===d.HighlightSubmenu?(Qi.highlightFirst(e),l(r,m,o)):(Qi.dehighlightAll(e),mn.some(i))})})})}function o(e,t){var n=a(t);return m.collapse(n).bind(function(n){return f(e,n),l(e,m,n).map(function(n){return c.onCollapseMenu(e,t,n),n})})}function p(t){return function(e,n){return vi(n.getSource(),"."+c.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOptional().bind(function(n){return t(e,n).map(x)})})}}function h(n){return Qi.getHighlighted(n).bind(Qi.getHighlighted)}(e=d={})[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var v=qo([Eo(Hd(),function(t,o){var n=o.event.item;m.lookupItem(a(n)).each(function(){var n=o.event.menu;Qi.highlight(t,n);var e=a(o.event.item);m.refresh(e).each(function(n){return s(t,m,n)})})}),Qo(function(e,n){var t=n.event.target;e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&o(e,n),g(e,n,d.HighlightSubmenu).fold(function(){c.onExecute(e,n)},Y)})}),Yo(function(e,n){t(e).each(function(n){jd.append(e,Cd(n)),c.onOpenMenu(e,n),c.highlightImmediately&&i(e,n)})})].concat(c.navigateOnHover?[Eo(Md(),function(n,e){var t=e.event.item,o=n,r=a(t);m.refresh(r).bind(function(n){return f(o,n),l(o,m,n)}),g(n,t,d.HighlightParent),c.onHover(n,t)})]:[])),b={collapseMenu:function(e){h(e).each(function(n){o(e,n)})},highlightPrimary:function(e){m.getPrimary().each(function(n){i(e,n)})},repositionMenus:function(o){m.getPrimary().bind(function(e){return h(o).bind(function(n){var e=a(n),t=So(Z(Me(m.getMenus(),K),Gd));return m.getTriggeringPath(e,function(n){return e=n,z(t,function(n){return n.getSystem().isConnected()?F(Qi.getCandidates(n),function(n){return a(n)===e}):mn.none()});var e})}).map(function(n){return{primary:e,triggeringPath:n}})}).fold(function(){mn.from(o.components()[0]).filter(function(n){return"menu"===Be(n.element,"role")}).each(function(n){c.onRepositionMenu(o,n,[])})},function(n){var e=n.primary,t=n.triggeringPath;c.onRepositionMenu(o,e,t)})}};return{uid:c.uid,dom:c.dom,markers:c.markers,behaviours:Lu(c.tmenuBehaviours,[jc.config({mode:"special",onRight:p(function(n,e){return eu(e.element)?mn.none():g(n,e,d.HighlightSubmenu)}),onLeft:p(function(n,e){return eu(e.element)?mn.none():o(n,e)}),onEscape:p(function(n,e){return o(n,e).orThunk(function(){return c.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){m.getPrimary().each(function(n){nn(e,n.element,ne())})}}),Qi.config({highlightClass:c.markers.selectedMenu,itemClass:c.markers.menu}),ed.config({find:function(n){return Qi.getHighlighted(n)}}),jd.config({})]),eventOrder:c.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:yo(n,e),expansions:{}}},collapseItem:function(n){return{value:Gu(Ud()),meta:{text:n}}}}}),Xd=function(n,e,t,o){return El(0,e,0,o).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},qd=function(e,t,n){return Ae(e.element,t.destinationAttr).map(function(n){return{start:Be(e.element,t.stateAttr),destination:n}})},Yd=Object.freeze({__proto__:null,findRoute:El,disableTransition:Dl,getCurrentRoute:qd,jumpTo:Ml,progressTo:function(t,o,r,i){var e,u=o;Ne((e=t).element,u.destinationAttr)&&(Ae(e.element,u.destinationAttr).each(function(n){Ie(e.element,u.stateAttr,n)}),He(e.element,u.destinationAttr));var n,c=(n=i,{start:Be(t.element,o.stateAttr),destination:n});Xd(t,o,r,c).fold(function(){Ml(t,o,r,i)},function(n){Dl(t,o,r);var e=n.transition;je(t.element,e.transitionClass),Ie(t.element,o.destinationAttr,i)})},getState:function(n,e,t){return Ae(n.element,e.stateAttr)}}),Kd=Object.freeze({__proto__:null,events:function(r,i){return qo([Eo(Wn(),function(t,n){var o=n.event.raw;qd(t,r).each(function(e){El(0,r,0,e).each(function(n){n.transition.each(function(n){o.propertyName===n.property&&(Ml(t,r,i,e.destination),r.onTransition(t,e))})})})}),Yo(function(n,e){Ml(n,r,i,r.initialState)})])}}),Jd=Ao({fields:[Yt("destinationAttr","data-transitioning-destination"),Yt("stateAttr","data-transitioning-state"),Lt("initialState"),kr("onTransition"),kr("onFinish"),$t("routes",Nt(ht.value,Nt(ht.value,It([qt("transition",[Lt("property"),Lt("transitionClass")])]))))],name:"transitioning",active:Kd,apis:Yd,extra:{createRoutes:function(n){var o={};return Ee(n,function(n,e){var t=e.split("<->");o[t[0]]=yo(t[1],n),o[t[1]]=yo(t[0],n)}),o},createBistate:function(n,e,t){return xo([{key:n,value:yo(e,t)},{key:e,value:yo(n,t)}])},createTristate:function(n,e,t,o){return xo([{key:n,value:xo([{key:e,value:o},{key:t,value:o}])},{key:e,value:xo([{key:n,value:o},{key:t,value:o}])},{key:t,value:xo([{key:n,value:o},{key:e,value:o}])}])}}}),Qd=ci("scrollable"),Zd=Qd,nm=function(n,e,t,o,r){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:r?[ci("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ci("format-matches"),selected:t},itemBehaviours:or(r?[]:[Ar(n,function(n,e){(e?ii.on:ii.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:o},innerHtml:e}}]}},em=function(n,e,t,o){return{value:n,dom:{tag:"div"},components:[Qs.sketch({dom:{tag:"div",classes:[ci("styles-collapser")]},components:o?[{dom:{tag:"span",classes:[ci("styles-collapse-icon")]}},wl(n)]:[wl(n)],action:function(n){var e;o&&(e=t().get(n),Wd.collapseMenu(e))}}),{dom:{tag:"div",classes:[ci("styles-menu-items-container")]},components:[Pd.parts.items({})],behaviours:or([el("adhoc-scrollable-menu",[Yo(function(n,e){$r(n.element,"overflow-y","auto"),$r(n.element,"-webkit-overflow-scrolling","touch"),_l(n.element)}),Ko(function(n){Xr(n.element,"overflow-y"),Xr(n.element,"-webkit-overflow-scrolling"),Rl(n.element)})])])}],items:e,menuBehaviours:or([Jd.config({initialState:"after",routes:Jd.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},tm=function(n){return _(n,function(n,e){var t=Il(e);return{menus:co(n.menus,t.menus),items:[t.item].concat(n.items),expansions:co(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},om=function(n){return B(n,function(n){return(D(n)?om:Bl)(n)})},rm=function(n,e,t,o){n.dom.removeEventListener(e,t,o)},im=x,um=tinymce.util.Tools.resolve("tinymce.util.Delay"),cm=Jt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function am(n,e){var t=le(n);return"input"===t?mg.after(n):T(["br","img"],t)?0===e?mg.before(n):mg.after(n):mg.on(n,e)}function sm(n){return mn.from(n.getSelection())}function fm(n,e,t,o,r){var i=Gl(n,e,t,o,r);sm(n).each(function(n){n.removeAllRanges(),n.addRange(i)})}function lm(n,e,t,o,r){var i,u,c,a,s,f=(i=o,u=r,c=am(e,t),a=am(i,u),pg.relative(c,a));Xl(s=n,f).match({ltr:function(n,e,t,o){fm(s,n,e,t,o)},rtl:function(r,i,u,c){sm(s).each(function(n){if(n.setBaseAndExtent)n.setBaseAndExtent(r.dom,i,u.dom,c);else if(n.extend)try{t=u,o=c,(e=n).collapse(r.dom,i),e.extend(t.dom,o)}catch(n){fm(s,u,c,r,i)}else fm(s,u,c,r,i);var e,t,o})}})}function dm(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return mn.some(fg(fe.fromDom(e.startContainer),e.startOffset,fe.fromDom(t.endContainer),t.endOffset))}return mn.none()}function mm(n){if(null===n.anchorNode||null===n.focusNode)return dm(n);var e,t,o,r,i,u,c,a,s,f,l,d=fe.fromDom(n.anchorNode),m=fe.fromDom(n.focusNode);return e=d,t=n.anchorOffset,o=m,r=n.focusOffset,u=t,c=o,a=r,(s=me(i=e).dom.createRange()).setStart(i.dom,u),s.setEnd(c.dom,a),f=s,l=un(e,o)&&t===r,f.collapsed&&!l?mn.some(fg(d,n.anchorOffset,m,n.focusOffset)):dm(n)}function gm(n){return sm(n).filter(function(n){return 0<n.rangeCount}).bind(mm)}function pm(n,e){var i,t,o,r=(t=Xl(i=n,e).match({ltr:function(n,e,t,o){var r=i.document.createRange();return r.setStart(n.dom,e),r.setEnd(t.dom,o),r},rtl:function(n,e,t,o){var r=i.document.createRange();return r.setStart(t.dom,o),r.setEnd(n.dom,e),r}})).getClientRects();return 0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?mn.some(o).map(Ul):mn.none()}function hm(n){return mn.from(n.dom.contentWindow)}function vm(n){return hm(n).bind(gm)}function bm(n){return n.getFrame()}function ym(n,e,t,o){return n[t].getOrThunk(function(){return function(n){return Pl(e,o,n)}})}function xm(c){var a=bm(c);return mn.some(fe.fromDom(a.dom.contentWindow.document.body)).bind(function(u){return mn.some(fe.fromDom(a.dom.contentWindow.document)).bind(function(i){return hm(a).map(function(r){var n=fe.fromDom(i.dom.documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return gm(r).map(function(n){return pg.exact(n.start,n.soffset,n.finish,n.foffset)}).bind(function(n){return pm(r,n).orThunk(function(){return gm(r).filter(function(n){return un(n.start,n.finish)&&n.soffset===n.foffset}).bind(function(n){var e=n.start.dom.getBoundingClientRect();return 0<e.width||0<e.height?mn.some(e):mn.none()})})})}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,o){lm(r,n,e,t,o)}}),o=c.clearSelection.getOrThunk(function(){return function(){sm(r).each(function(n){return n.removeAllRanges()})}});return{body:u,doc:i,win:r,html:n,getSelection:J(vm,a),setSelection:t,clearSelection:o,frame:a,onKeyup:ym(c,i,"onKeyup","keyup"),onNodeChanged:ym(c,i,"onNodeChanged","SelectionChange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})})})}function wm(){var e=rn("head").getOrDie(),n=rn('meta[name="viewport"]').getOrThunk(function(){var n=fe.fromTag("meta");return Ie(n,"name","viewport"),Qe(e,n),n}),t=Be(n,"content");return{maximize:function(){Ie(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){null!=t&&0<t.length?Ie(n,"content",t):Ie(n,"content","user-scalable=yes")}}}function Sm(n,e){function t(o){return function(n){var e=Be(n,"style"),t=void 0===e?"no-styles":e.trim();t===o||(Ie(n,vg,t),Ie(n,"style",o))}}var o,r,i=(r=function(n){return en(n,"*")},E(function(n,e){for(var t=m(e)?e:S,o=n.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var i=o.parentNode,u=fe.fromDom(i);if(r.push(u),!0===t(u))break;o=i}return r}(n,void 0),r)),u=B(i,function(n){return e=function(n){return en(n,"*")},E(pe(t=n).map(Je).map(function(n){return E(n,function(n){return!un(t,n)})}).getOr([]),e);var e,t}),c=void 0!==(o=Ur(e,"background-color"))&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";M(u,t("display:none!important;")),M(i,t(bg+yg+c)),t((!0===xg?"":bg)+yg+c)(n)}function Om(){M(on("["+vg+"]"),function(n){var e=Be(n,vg);"no-styles"!==e?Ie(n,"style",e):He(n,"style"),He(n,vg)})}function km(n){var e=n.raw;return void 0===e.touches||1!==e.touches.length?mn.none():mn.some(e.touches[0])}function Tm(t){var o,r,u=cu(),i=No(!1),c=(o=function(n){t.triggerEvent(te(),n),i.set(!0)},r=null,{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r=setTimeout(function(){o.apply(null,n),r=null},400)}}),a=xo([{key:Vn(),value:function(t){return km(t).each(function(n){c.cancel();var e={x:n.clientX,y:n.clientY,target:t.target};c.schedule(t),i.set(!1),u.set(e)}),mn.none()}},{key:Bn(),value:function(n){return c.cancel(),km(n).each(function(i){u.on(function(n){var e=i,t=n,o=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);(5<o||5<r)&&u.clear()})}),mn.none()}},{key:An(),value:function(e){return c.cancel(),u.get().filter(function(n){return un(n.target,e.target)}).map(function(n){return i.get()?(e.prevent(),!1):t.triggerEvent(ee(),e)})}}]);return{fireIfReady:function(e,n){return _e(a,n).bind(function(n){return n(e)})}}}function Cm(t){var e=Tm({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return Pl(t.body,"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return Pl(t.body,"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}}function Em(n,e){var t=parseInt(Be(n,e),10);return isNaN(t)?0:t}function Dm(n){return y(y({},n),{width:2})}function Mm(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:n.width,height:n.height}}function _m(n){var e=n.getSelection();return void 0!==e&&0<e.rangeCount?function(o){if(o.collapsed){var r=fe.fromDom(o.startContainer);return pe(r).bind(function(n){var e,t=pg.exact(r,o.startOffset,n,"img"===le(e=n)?1:lg.getOption(e).fold(function(){return Je(e).length},function(n){return n.length}));return pm(o.startContainer.ownerDocument.defaultView,t).map(Dm).map(P)}).getOr([])}return Z(o.getClientRects(),Mm)}(e.getRangeAt(0)):[]}function Rm(n,e){Ie(n,Sg,e)}function Fm(n){return{top:n.top,bottom:n.top+n.height}}function Im(o,r){var i=fe.fromDom(r.document.body),n=Pl(fe.fromDom(o),"resize",function(){var n,e,t;n=o,e=Em(i,Sg),((t=n.innerHeight)<e?mn.some(e-t):mn.none()).each(function(t){var n;(0<(n=_m(r)).length?mn.some(n[0]).map(Fm):mn.none()).each(function(n){var e=n.top>r.innerHeight||n.bottom>r.innerHeight?Math.min(t,n.bottom-r.innerHeight+50):0;0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),Rm(i,o.innerHeight)});return Rm(i,o.innerHeight),{toEditing:function(){!function(n){n.focus();var e=fe.fromDom(n.document.body);(zo().exists(function(n){return T(["input","textarea"],le(n))})?function(n){um.setTimeout(function(){n()},0)}:p)(function(){zo().each(Po),Ho(e)})}(r)},destroy:function(){n.unbind()}}}function Vm(t,o){function r(){s(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r(),i=setTimeout(function(){i=null,t.apply(null,n)},o)}}}function Bm(n){var t,o,e=Ns(td.sketch({dom:Oa('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:or([ii.config({toggleClass:ci("mask-tap-icon-selected"),toggleOnExecute:!1})])})),r=(t=n,o=null,{cancel:function(){s(o)||(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];s(o)&&(o=setTimeout(function(){o=null,t.apply(null,n)},200))}});return td.sketch({dom:Oa('<div class="${prefix}-disabled-mask"></div>'),components:[td.sketch({dom:Oa('<div class="${prefix}-content-container"></div>'),components:[Qs.sketch({dom:Oa('<div class="${prefix}-content-tap-section"></div>'),components:[e.asSpec()],action:function(n){r.throttle()},buttonBehaviours:or([ii.config({toggleClass:ci("mask-tap-icon-selected")})])})]})]})}function Am(n){var e=zt("Getting AndroidWebapp schema",kg,n);$r(e.toolstrip,"width","100%");var t=Td(Bm(function(){e.setReadOnly(e.readOnlyOnInit()),c.enter()},e.translate));e.alloy.add(t);var o={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Qe(e.container,t.element);var s,r,i,u,f,c=(s=e,r=o,i=wm(),u=uu(),f=uu(),{enter:function(){r.hide(),je(s.container,ci("fullscreen-maximized")),je(s.container,ci("android-maximized")),i.maximize(),je(s.body,ci("android-scroll-reload")),u.set(Im(s.win,hg(s.editor).getOrDie("no"))),xm(s.editor).each(function(n){function e(n){return!un(n.start,n.finish)||n.soffset!==n.foffset}function t(){var n=o.doc.dom.hasFocus()&&o.getSelection().exists(e);i.getByDom(r).each(!0===(n||zo(c).filter(function(n){return"input"===le(n)}).exists(function(n){return n.dom.selectionStart!==n.dom.selectionEnd}))?ii.on:ii.off)}var o,r,i,u,c,a;Sm(s.container,n.body),f.set((o=n,r=s.toolstrip,i=s.alloy,u=Cm(o),c=me(r),a=[Pl(o.body,"touchstart",function(n){o.onTouchContent(),u.fireTouchstart(n)}),u.onTouchmove(),u.onTouchend(),Pl(r,"touchstart",function(n){o.onTouchToolstrip()}),o.onToReading(function(){Po(o.body)}),o.onToEditing(Y),o.onScrollToCursor(function(n){n.preventDefault(),o.getCursorBox().each(function(n){var e=o.win,t=n.top>e.innerHeight||n.bottom>e.innerHeight?n.bottom-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(1==wg?[]:[Pl(fe.fromDom(o.win),"blur",function(){i.getByDom(r).each(ii.off)}),Pl(c,"select",t),Pl(o.doc,"selectionchange",t)]),{destroy:function(){M(a,function(n){n.unbind()})}}))})},exit:function(){i.restore(),r.show(),Le(s.container,ci("fullscreen-maximized")),Le(s.container,ci("android-maximized")),Om(),Le(s.body,ci("android-scroll-reload")),f.clear(),u.clear()}});return{setReadOnly:e.setReadOnly,refreshStructure:Y,enter:c.enter,exit:c.exit,destroy:Y}}function Nm(n){return"true"===Be(n,Rg)?0<n.dom.scrollLeft||function(n){n.dom.scrollLeft=1;var e=0!==n.dom.scrollLeft;return n.dom.scrollLeft=0,e}(n):0<n.dom.scrollTop||function(n){n.dom.scrollTop=1;var e=0!==n.dom.scrollTop;return n.dom.scrollTop=0,e}(n)}function Hm(){function e(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Oa('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:or([el("adhoc-scrollable-toolbar",!0===n.scrollable?[Jo(function(n,e){$r(n.element,"overflow-x","auto"),Ie(n.element,Rg,"true"),_l(n.element)})]:[])]),components:[td.sketch({components:[_g.parts.items({})]})],markers:{itemSelector:"."+ci("toolbar-group-item")},items:n.items}}function t(){Eg.setGroups(o,r.get()),ii.off(o)}var o=Td(Eg.sketch({dom:Oa('<div class="${prefix}-toolbar"></div>'),components:[Eg.parts.groups({})],toolbarBehaviours:or([ii.config({toggleClass:ci("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),jc.config({mode:"cyclic"})]),shell:!0})),n=Td(td.sketch({dom:{classes:[ci("toolstrip")]},components:[Cd(o)],containerBehaviours:or([ii.config({toggleClass:ci("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=No([]);return{wrapper:n,toolbar:o,createGroups:function(n){return Z(n,i(_g.sketch,e))},setGroups:function(n){r.set(n),t()},setContextToolbar:function(n){ii.on(o),Eg.setGroups(o,n)},restoreToolbar:function(){ii.isOn(o)&&t()},refresh:function(){},focus:function(){jc.focusIn(o)}}}function Pm(n){return Td(Qs.sketch({dom:Oa('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))}function zm(){return Td(td.sketch({dom:Oa('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:or([jd.config({})])}))}function jm(n,e,t,o){(!0===t?cr.toAlpha:cr.toOmega)(o),(t?function(n,e){jd.append(n,Cd(e))}:function(n,e){jd.remove(n,e)})(n,e)}function Lm(e,n){return n.getAnimationRoot.fold(function(){return e.element},function(n){return n(e)})}function $m(n){return n.dimension.property}function Gm(n,e){return n.dimension.getDimension(e)}function Um(n,e){hl(Lm(n,e),[e.shrinkingClass,e.growingClass])}function Wm(n,e){Le(n.element,e.openClass),je(n.element,e.closedClass),$r(n.element,$m(e),"0px"),qr(n.element)}function Xm(n,e){Le(n.element,e.closedClass),je(n.element,e.openClass),Xr(n.element,$m(e))}function qm(n,e,t,o){t.setCollapsed(),$r(n.element,$m(e),Gm(e,n.element)),qr(n.element),Um(n,e),Wm(n,e),e.onStartShrink(n),e.onShrunk(n)}function Ym(n,e,t){var o=Gm(e,n.element);("0px"===o?qm:function(n,e,t,o){var r=o.getOrThunk(function(){return Gm(e,n.element)});t.setCollapsed(),$r(n.element,$m(e),r),qr(n.element);var i=Lm(n,e);Le(i,e.growingClass),je(i,e.shrinkingClass),Wm(n,e),e.onStartShrink(n)})(n,e,t,mn.some(o))}function Km(n,e,t){var o=Lm(n,e),r=$e(o,e.shrinkingClass),i=Gm(e,n.element);Xm(n,e);var u=Gm(e,n.element);(r?function(){$r(n.element,$m(e),i),qr(n.element)}:function(){Wm(n,e)})(),Le(o,e.shrinkingClass),je(o,e.growingClass),Xm(n,e),$r(n.element,$m(e),u),t.setExpanded(),e.onStartGrow(n)}function Jm(n,e,t){return!0===$e(Lm(n,e),e.growingClass)}function Qm(n,e,t){return!0===$e(Lm(n,e),e.shrinkingClass)}function Zm(e,t){var o=Td(td.sketch({dom:{tag:"div",classes:[ci("dropup")]},components:[],containerBehaviours:or([jd.config({}),Vg.config({closedClass:ci("dropup-closed"),openClass:ci("dropup-open"),shrinkingClass:ci("dropup-shrinking"),growingClass:ci("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),jd.set(n,[])},onGrown:function(n){e(),t()}}),Nr(function(n,e){r(Y)})])})),r=function(n){window.requestAnimationFrame(function(){n(),Vg.shrink(o)})};return{appear:function(n,e,t){!0===Vg.hasShrunk(o)&&!1===Vg.isTransitioning(o)&&window.requestAnimationFrame(function(){e(t),jd.set(o,[n()]),Vg.grow(o)})},disappear:r,component:o,element:o.element}}function ng(){return Fn().browser.isFirefox()}function eg(e,n){var t,o,r,i,u=y({stopBackspace:!0},n),c=Tm(u),a=Z(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return Pl(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),s=cu(),f=Pl(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),s.set(setTimeout(function(){u.triggerEvent(Jn(),e)},0))}),l=Pl(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!u.stopBackspace||((e=n).raw.which!==ji[0]||T(["input","textarea"],le(e.target))||vi(e.target,'[contenteditable="true"]',void 0).isSome())||n.prevent()}),d=(t=e,o=function(n){u.triggerEvent("focusin",n)&&n.kill()},ng()?zl(t,"focus",o):Pl(t,"focusin",o)),m=cu(),g=(r=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),m.set(setTimeout(function(){u.triggerEvent(Kn(),n)},0))},ng()?zl(r,"blur",i):Pl(r,"focusout",i));return{unbind:function(){M(a,function(n){n.unbind()}),l.unbind(),d.unbind(),g.unbind(),f.unbind(),s.on(clearTimeout),m.on(clearTimeout)}}}function tg(n,e){return No(_e(n,"target").getOr(e))}function og(n,o,e,t,r,i){var u,c,a=n(o,t),s=(u=No(!1),c=No(!1),{stop:function(){u.set(!0)},cut:function(){c.set(!0)},isStopped:u.get,isCut:c.get,event:e,setSource:r.set,getSource:r.get});return a.fold(function(){return i.logEventNoHandlers(o,t),Bg.complete()},function(e){var t=e.descHandler;return dl(t)(s),s.isStopped()?(i.logEventStopped(o,e.element,t.purpose),Bg.stopped()):s.isCut()?(i.logEventCut(o,e.element,t.purpose),Bg.complete()):pe(e.element).fold(function(){return i.logNoParent(o,e.element,t.purpose),Bg.complete()},function(n){return i.logEventResponse(o,e.element,t.purpose),Bg.resume(n)})})}function rg(){var u={};return{registerId:function(r,i,n){Ee(n,function(n,e){var t,o=void 0!==u[e]?u[e]:{};o[i]={cHandler:J.apply(void 0,[(t=n).handler].concat(r)),purpose:t.purpose},u[e]=o})},unregisterId:function(t){Ee(u,function(n,e){dt(n,t)&&delete n[t]})},filterByType:function(n){return _e(u,n).map(function(n){return Me(n,function(n,e){return{id:e,descHandler:n}})}).getOr([])},find:function(r,n,c){return _e(u,n).bind(function(o){return e=r,t=(n=function(n){return e=o,ba(t=n).bind(function(n){return _e(e,n)}).map(function(n){return{element:t,descHandler:n}});var e,t})(i=c),u=Oo(e),t.orThunk(function(){return u(i)?mn.none():function(n){for(var e=i.dom,t=Oo(u);e.parentNode;){var e=e.parentNode,o=fe.fromDom(e),r=n(o);if(r.isSome())return r;if(t(o))break}return mn.none()}(n)});var i,n,e,t,u})}}}function ig(){function r(n){ba(n.element).each(function(n){delete u[n],i.unregisterId(n)})}var i=rg(),u={};return{find:function(n,e,t){return i.find(n,e,t)},filter:function(n){return i.filterByType(n)},register:function(n){var t,o=ba((t=n).element).getOrThunk(function(){return n=t.element,e=Gu(Us+"uid-"),Xs(n,e),e;var n,e});Re(u,o)&&function(n){var e=u[o];if(e!==n)throw new Error('The tagId "'+o+'" is already used by: '+$o(e.element)+"\nCannot use it for: "+$o(n.element)+"\nThe conflicting element is"+(rt(e.element)?" ":" not ")+"already in the DOM");r(n)}(n),i.registerId([n],o,n.events),u[o]=n},unregister:r,getById:function(n){return _e(u,n)}}}cm.ltr,cm.rtl;function ug(n,e,t,o,r){var i=tg(t,o);return Ag(n,e,t,o,i,r)}var cg,ag,sg,fg=function(n,e,t,o){return{start:n,soffset:e,finish:t,foffset:o}},lg=(cg=qe,{get:function(n){if(!cg(n))throw new Error("Can only get text value of a text node");return ag(n).getOr("")},getOption:ag=function(n){return cg(n)?mn.from(n.dom.nodeValue):mn.none()},set:function(n,e){if(!cg(n))throw new Error("Can only set raw text value of a text node");n.dom.nodeValue=e}}),dg=Jt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),mg={before:dg.before,on:dg.on,after:dg.after,cata:function(n,e,t,o){return n.fold(e,t,o)},getStart:function(n){return n.fold(K,K,K)}},gg=Jt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),pg={domRange:gg.domRange,relative:gg.relative,exact:gg.exact,exactFromRange:function(n){return gg.exact(n.start,n.soffset,n.finish,n.foffset)},getWin:function(n){var e=n.match({domRange:function(n){return fe.fromDom(n.startContainer)},relative:function(n,e){return mg.getStart(n)},exact:function(n,e,t,o){return n}});return fe.fromDom(ge(e).dom.defaultView)},range:fg},hg=(sg=hm,function(e){return e.getWin.getOrThunk(function(){var n=bm(e);return function(){return sg(n)}})()}),vg="data-ephox-mobile-fullscreen-style",bg="position:absolute!important;",yg="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",xg=Fn().os.isAndroid(),wg=6<=Fn().os.version.major,Sg="data-"+ci("last-outer-height"),Og=w({unbind:Y}),kg=lo([Gt("editor",[Lt("getFrame"),Ut("getBody"),Ut("getDoc"),Ut("getWin"),Ut("getSelection"),Ut("setSelection"),Ut("clearSelection"),Ut("cursorSaver"),Ut("onKeyup"),Ut("onNodeChanged"),Ut("getCursorBox"),Lt("onDomChanged"),Yt("onTouchContent",Y),Yt("onTapContent",Y),Yt("onTouchToolstrip",Y),Yt("onScrollToCursor",Og),Yt("onScrollToElement",Og),Yt("onToEditing",Og),Yt("onToReading",Og),Yt("onToolbarScrollStart",K)]),Lt("socket"),Lt("toolstrip"),Lt("dropup"),Lt("toolbar"),Lt("container"),Lt("alloy"),vo("win",function(n){return me(n.socket).dom.defaultView}),vo("body",function(n){return fe.fromDom(n.socket.dom.ownerDocument.body)}),Yt("translate",K),Yt("setReadOnly",Y),Yt("readOnlyOnInit",x)]),Tg=w([Lt("dom"),Yt("shell",!0),ju("toolbarBehaviours",[jd])]),Cg=w([Hs({name:"groups",overrides:function(){return{behaviours:or([jd.config({})])}}})]),Eg=Sa({name:"Toolbar",configFields:Tg(),partFields:Cg(),factory:function(o,n,e,t){var r=o.shell?{behaviours:[jd.config({})],components:[]}:{behaviours:[],components:n};return{uid:o.uid,dom:o.dom,components:r.components,behaviours:Lu(o.toolbarBehaviours,r.behaviours),apis:{setGroups:function(n,e){var t;t=n,(o.shell?mn.some(t):ma(t,o,"groups")).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){jd.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Dg=w([Lt("items"),Gt("markers",Z(["itemSelector"],Lt)),ju("tgroupBehaviours",[jc])]),Mg=w([Ps({name:"items",unit:"item"})]),_g=Sa({name:"ToolbarGroup",configFields:Dg(),partFields:Mg(),factory:function(n,e,t,o){return{uid:n.uid,dom:n.dom,components:e,behaviours:Lu(n.tgroupBehaviours,[jc.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Rg="data-"+ci("horizontal-scroll"),Fg=Object.freeze({__proto__:null,refresh:function(n,e,t){var o;t.isExpanded()&&(Xr(n.element,$m(e)),o=Gm(e,n.element),$r(n.element,$m(e),o))},grow:function(n,e,t){t.isExpanded()||Km(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&Ym(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&qm(n,e,t)},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:Jm,isShrinking:Qm,isTransitioning:function(n,e,t){return Jm(n,e)||Qm(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?Ym:Km)(n,e,t)},disableTransitions:Um}),Ig=Object.freeze({__proto__:null,exhibit:function(n,e,t){return Io(e.expanded?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:yo(e.dimension.property,"0px")})},events:function(t,o){return qo([Mo(Wn())(function(n,e){e.event.raw.propertyName===t.dimension.property&&(Um(n,t),o.isExpanded()&&Xr(n.element,t.dimension.property),(o.isExpanded()?t.onGrown:t.onShrunk)(n))})])}}),Vg=Ao({fields:[Lt("closedClass"),Lt("openClass"),Lt("shrinkingClass"),Lt("growingClass"),Ut("getAnimationRoot"),kr("onShrunk"),kr("onStartShrink"),kr("onGrown"),kr("onStartGrow"),Yt("expanded",!1),$t("dimension",jt("property",{width:[Dr("property","width"),Dr("getDimension",function(n){return Ba(n)+"px"})],height:[Dr("property","height"),Dr("getDimension",function(n){return Kr(n)+"px"})]}))],name:"sliding",active:Ig,apis:Fg,state:Object.freeze({__proto__:null,init:function(n){var e=No(n.expanded);return tr({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:J(e.set,!1),setExpanded:J(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),Bg=Jt([{stopped:[]},{resume:["element"]},{complete:[]}]),Ag=function(e,t,o,n,r,i){return og(e,t,o,n,r,i).fold(x,function(n){return Ag(e,t,o,n,r,i)},S)},Ng=function(t){function o(e){return pe(t.element).fold(x,function(n){return un(e,n)})}function s(n,e){return i.find(o,n,e)}function r(e){M(i.filter(Qn()),function(n){dl(n.descHandler)(e)})}var i=ig(),n=eg(t.element,{triggerEvent:function(e,t){return vr(e,t.target,function(n){return ug(s,e,t,t.target,n)})}}),u={debugInfo:w("real"),triggerEvent:function(e,t,o){vr(e,t,function(n){return ug(s,e,o,t,n)})},triggerFocus:function(c,a){ba(c).fold(function(){Ho(c)},function(n){vr(Yn(),c,function(n){var e,t,o=s,r=Yn(),i=n,u=tg(e={originator:a,kill:Y,prevent:Y,target:c},t=c);return og(o,r,e,t,u,i),!1})})},triggerEscape:function(n,e){u.triggerEvent("keydown",n.element,e.event)},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:Td,addToGui:function(n){a(n)},removeFromGui:function(n){f(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){c(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:x},e=function(n){n.connect(u),qe(n.element)||(i.register(n),M(n.components(),e),u.triggerEvent(oe(),n.element,{target:n.element}))},c=function(n){qe(n.element)||(M(n.components(),c),i.unregister(n)),n.disconnect()},a=function(n){at(t,n,Qe)},f=function(n){Ce(n)},l=function(n){r({universal:!0,data:n})},d=function(n,e){r({universal:!1,channels:n,data:e})},m=function(n,e){var t,o,r=i.filter(n);return o={stop:function(){t.set(!0)},cut:Y,isStopped:(t=No(!1)).get,isCut:S,event:e,setSource:h("Cannot set source of a broadcasted event"),getSource:h("Cannot get source of a broadcasted event")},M(r,function(n){dl(n.descHandler)(o)}),o.isStopped()},g=function(n){return i.getById(n).fold(function(){return ht.error(new Error('Could not find component with uid: "'+n+'" in system.'))},ht.value)},p=function(n){var e=ba(n).getOr("not found");return g(e)};return e(t),{root:t,element:t.element,destroy:function(){n.unbind(),Ze(t.element)},add:a,remove:f,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:c,broadcast:l,broadcastOn:d,broadcastEvent:m}},Hg=ci("readonly-mode"),Pg=ci("edit-mode");function zg(n){var e=Td(td.sketch({dom:{classes:[ci("outer-container")].concat(n.classes)},containerBehaviours:or([cr.config({alpha:Hg,omega:Pg})])}));return Ng(e)}function jg(n,e){var t=fe.fromTag("input");Gr(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Qe(n,t),Ho(t),e(t),Ze(t)}function Lg(n){var e,t,o=n.getSelection();0<o.rangeCount&&(e=o.getRangeAt(0),(t=n.document.createRange()).setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),o.removeAllRanges(),o.addRange(t))}function $g(n,e){zo().each(function(n){un(n,e)||Po(n)}),n.focus(),Ho(fe.fromDom(n.document.body)),Lg(n)}function Gg(n,e,t,o){function r(){$g(e,o)}var i=Pl(t,"keydown",function(n){T(["input","textarea"],le(n.target))||r()});return{toReading:function(){jg(n,Po)},toEditing:r,onToolbarTouch:Y,destroy:function(){i.unbind()}}}function Ug(n){setTimeout(function(){throw n},0)}function Wg(n){var o,r,e=jl(n).isPortrait(),t=(o=n.screen.width,r=n.screen.height,z([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e=o<=n.width&&r<=n.height,t=n.keyboard,e?mn.some(t):mn.none();var e,t}).getOr({portrait:r/5,landscape:o/4})),i=e?t.portrait:t.landscape;return(e?n.screen.height:n.screen.width)-n.innerHeight>i?0:i}function Xg(n,e){var t=me(n).dom.defaultView;return Kr(n)+Kr(e)-Wg(t)}function qg(n,e,t){var o=Xg(e,t);$r(n,"padding-bottom",Kr(e)+Kr(t)-o+"px")}function Yg(n){return Em(n,lp)}function Kg(n,e){var t=Be(n,dp);return fp.fixed(n,t,e)}function Jg(n,e){return fp.scroller(n,e)}function Qg(n){var e=Yg(n);return("true"===Be(n,mp)?Jg:Kg)(n,e)}function Zg(n,e,t){var o=me(n).dom.defaultView.innerHeight;return Ie(n,gp,o+"px"),o-e-t}function np(n){var e=Wr(n,"top").getOr("0");return parseInt(e,10)}function ep(n){return parseInt(n.dom.scrollTop,10)}function tp(r,i){return ap(function(n){var e=J(ep,r);Ie(r,hp,e());var t=Math.abs(i-e()),o=Math.ceil(t/10);pp.animate(e,i,o,function(n,e){Em(r,hp)!==r.dom.scrollTop?e(r.dom.scrollTop):(r.dom.scrollTop=n,Ie(r,hp,n))},function(){r.dom.scrollTop=i,Ie(r,hp,i),n(i)},10)})}function op(n,e){$r(n,"top",e+Yg(n)+"px")}var rp,ip=function(n){function o(n){r()?i(n):e.push(n)}var t=mn.none(),e=[],r=function(){return t.isSome()},i=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){r()||(t=mn.some(n),M(e,i),e=[])}),{get:o,map:function(t){return ip(function(e){o(function(n){e(t(n))})})},isReady:r}},up={nu:ip,pure:function(e){return ip(function(n){n(e)})}},cp=function(t){function n(n){t().then(n,Ug)}return{map:function(n){return cp(function(){return t().then(n)})},bind:function(e){return cp(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return cp(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return up.nu(n)},toCached:function(){var n=null;return cp(function(){return n=null===n?t():n})},toPromise:t,get:n}},ap=function(n){return cp(function(){return new Jl(n)})},sp=function(n){return cp(function(){return Jl.resolve(n)})},fp=Jt([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),lp="data-"+ci("position-y-fixed"),dp="data-"+ci("y-property"),mp="data-"+ci("scrolling"),gp="data-"+ci("last-window-height"),pp=(rp=null,{animate:function(r,i,u,c,e,n){function a(n){s=!0,e(n)}var s=!1;function f(n){um.clearInterval(rp),a(n)}um.clearInterval(rp),rp=um.setInterval(function(){var t=r(),n=t,e=i,o=u;(Math.abs(n-e)<=o?mn.none():n<e?mn.some(n+o):mn.some(n-o)).fold(function(){um.clearInterval(rp),a(i)},function(n){var e;c(n,f),s||((e=r())!==n||Math.abs(e-i)>Math.abs(t-i))&&(um.clearInterval(rp),a(i))})},n)}}),hp="data-"+ci("last-scroll-top");function vp(n,l){return n.fold(function(n,e,t){return $r(n,e,l+(o=t)+"px"),sp(o);var o},function(n,e){return r=l+(o=e),i=Wr(t=n,"top").getOr(o),u=r-parseInt(i,10),c=t.dom.scrollTop+u,a=t,s=c,f=r,ap(function(n){var e=J(ep,a);pp.animate(e,s,15,function(n){a.dom.scrollTop=n,$r(a,"top",np(a)+15+"px")},function(){a.dom.scrollTop=s,$r(a,"top",f+"px"),n(s)},10)});var t,o,r,i,u,c,a,s,f})}function bp(n,e){var u,t=Z(Jr(n,"["+lp+"]"),Qg),o=Z(t,function(n){return vp(n,e)});return u=o,ap(function(o){var r=[],i=0;0===u.length?o([]):M(u,function(n,e){var t;n.get((t=e,function(n){r[t]=n,++i>=u.length&&o(r)}))})})}function yp(n){var o,r,i,u,e,t,c,a,s,f,l,d,m,g,p,h,v,b,y,x=n.cWin,w=n.ceBody,S=n.socket,O=n.toolstrip,k=n.contentElement,T=n.keyboardType,C=n.outerWindow,E=n.dropup,D=n.outerBody,M=(r=w,i=O,u=E,m=me(o=S).dom.defaultView,d=Be(l=i,"style"),Gr(l,{position:"absolute",top:"0px"}),Ie(l,lp,"0px"),Ie(l,dp,"top"),g={restore:function(){Ie(l,"style",d||""),He(l,lp),He(l,dp)}},p=Kr(i),h=Kr(u),a=Zg(o,c=p,h),f=Be(s=o,"style"),_l(s),Gr(s,{position:"absolute",height:a+"px",width:"100%",top:c+"px"}),Ie(s,lp,c+"px"),Ie(s,mp,"true"),Ie(s,dp,"top"),v={restore:function(){Rl(s),Ie(s,"style",f||""),He(s,lp),He(s,mp),He(s,dp)}},t=Be(e=u,"style"),Gr(e,{position:"absolute",bottom:"0px"}),Ie(e,lp,"0px"),Ie(e,dp,"bottom"),b={restore:function(){Ie(e,"style",t||""),He(e,lp),He(e,dp)}},y=!0,qg(r,o,u),{setViewportOffset:function(n){Ie(o,lp,n+"px"),I()},isExpanding:F,isShrinking:Q(F),refresh:I,restore:function(){y=!1,g.restore(),v.restore(),b.restore()}}),_=T(D,x,ke(),k),R=Ll(C,{onChange:Y,onReady:M.refresh});function F(){var n=m.innerHeight;return Em(o,gp)<n}function I(){var n,e,t;y&&(n=Kr(i),e=Kr(u),t=Zg(o,n,e),Ie(o,lp,n+"px"),$r(o,"height",t+"px"),qg(r,o,u))}R.onAdjustment(function(){M.refresh()});function V(){q.clear()}var B,A,N,H,P,z,j,L,$,G,U,W=Pl(fe.fromDom(C),"resize",function(){M.isExpanding()&&M.refresh()}),X=(B=O,A=S,N=D,H=C,P=M,z=x,j=function(n){return t=A,o=n,r=me(e=B).dom.defaultView,ap(function(n){op(e,o),op(t,o),r.scrollTo(0,o),n(o)});var e,t,o,r},L=No(up.pure({})),$={start:function(e){var n=up.nu(function(n){return j(e).get(n)});L.set(n)},idle:function(n){L.get().get(function(){n()})}},G=Vm(function(){$.idle(function(){bp(N,H.pageYOffset).get(function(){var n=_m(z);mn.from(n[0]).bind(function(n){var e=n.top-A.dom.scrollTop;return e>H.innerHeight+5||e<-5?mn.some({top:e,bottom:e+n.height}):mn.none()}).each(function(n){A.dom.scrollTop=A.dom.scrollTop+n.top}),$.start(0),P.refresh()})})},1e3),U=Pl(fe.fromDom(H),"scroll",function(){H.pageYOffset<0||G.throttle()}),bp(N,H.pageYOffset).get(K),{unbind:U.unbind}),q=function(e,t){var n=e.document,o=fe.fromTag("div");function r(n){var e=fe.fromTag("span");return pl(e,[ci("layer-editor"),ci("unfocused-selection")]),Gr(e,{left:n.left+"px",top:n.top+"px",width:n.width+"px",height:n.height+"px"}),e}je(o,ci("unfocused-selections")),Qe(fe.fromDom(n.documentElement),o);var i=Pl(o,"touchstart",function(n){n.prevent(),$g(e,t),u()}),u=function(){we(o)};return{update:function(){u();var n=Z(_m(e),r);xe(o,n)},isActive:function(){return 0<Je(o).length},destroy:function(){i.unbind(),Ze(o)},clear:u}}(x,k);return{toEditing:function(){_.toEditing(),V()},toReading:function(){_.toReading()},onToolbarTouch:function(n){_.onToolbarTouch()},refreshSelection:function(){q.isActive()&&q.update()},clearSelection:V,highlightSelection:function(){q.update()},scrollIntoView:function(n,e){var t,o=x,r=n,i=e,u=Xg(t=S,E),c=J(Lg,o);u<r||u<i?tp(t,t.dom.scrollTop-u+i).get(c):r<0&&tp(t,t.dom.scrollTop+r).get(c)},updateToolbarPadding:Y,setViewportOffset:function(n){var i,u;M.setViewportOffset(n),i=S,u=n,ap(function(n){function e(n){$r(i,"top",n+"px")}var t=J(np,i),o=Math.abs(u-t()),r=Math.ceil(o/10);pp.animate(t,u,r,e,function(){e(u),n(u)},10)}).get(K)},syncHeight:function(){$r(k,"height",k.dom.contentWindow.document.body.scrollHeight+"px")},refreshStructure:M.refresh,destroy:function(){M.restore(),R.destroy(),X.unbind(),W.unbind(),_.destroy(),q.destroy(),jg(ke(),Po)}}}function xp(g,n){var p=wm(),h=cu(),v=cu(),b=uu(),y=uu();return{enter:function(){n.hide();var m=fe.fromDom(document);xm(g.editor).each(function(n){var e,t,o,r,i,u,c,a;function s(){o.run(function(n){n.refreshSelection()})}function f(n,e){var t=n-i.dom.scrollTop;o.run(function(n){n.scrollIntoView(t,t+e)})}function l(){o.run(function(n){n.clearSelection()})}function d(){t.getCursorBox().each(function(n){f(n.top,n.height)}),o.run(function(n){n.syncHeight()})}h.set({socketHeight:Wr(g.socket,"height"),iframeHeight:Wr(n.frame,"height"),outerScroll:document.body.scrollTop}),v.set({exclusives:(e="."+Zd,Pl(m,"touchmove",function(n){vi(n.target,e).filter(Nm).fold(function(){n.prevent()},Y)}))}),je(g.container,ci("fullscreen-maximized")),Sm(g.container,n.body),p.maximize(),$r(g.socket,"overflow","scroll"),$r(g.socket,"-webkit-overflow-scrolling","touch"),Ho(n.body),b.set(yp({cWin:n.win,ceBody:n.body,socket:g.socket,toolstrip:g.toolstrip,dropup:g.dropup.element,contentElement:n.frame,outerBody:g.body,outerWindow:g.win,keyboardType:Gg})),b.run(function(n){n.syncHeight()}),y.set((t=n,o=b,r=g.toolstrip,i=g.socket,g.dropup,u=Cm(t),c=Vm(d,300),a=[t.onKeyup(function(){l(),c.throttle()}),t.onNodeChanged(s),t.onDomChanged(c.throttle),t.onDomChanged(s),t.onScrollToCursor(function(n){n.preventDefault(),c.throttle()}),t.onScrollToElement(function(n){n.element,f(o,i)}),t.onToEditing(function(){o.run(function(n){n.toEditing()})}),t.onToReading(function(){o.run(function(n){n.toReading()})}),Pl(t.doc,"touchend",function(n){un(t.html,n.target)||un(t.body,n.target)}),Pl(r,"transitionend",function(n){var e;"height"===n.raw.propertyName&&(e=Kr(r),o.run(function(n){n.setViewportOffset(e)}),s(),d())}),zl(r,"touchstart",function(n){var e;o.run(function(n){n.highlightSelection()}),e=n,o.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),Pl(t.body,"touchstart",function(n){l(),t.onTouchContent(),u.fireTouchstart(n)}),u.onTouchmove(),u.onTouchend(),Pl(t.body,"click",function(n){n.kill()}),Pl(r,"touchmove",function(){t.onToolbarScrollStart()})],{destroy:function(){M(a,function(n){n.unbind()})}}))})},refreshStructure:function(){b.run(function(n){n.refreshStructure()})},exit:function(){p.restore(),y.clear(),b.clear(),n.show(),h.on(function(n){n.socketHeight.each(function(n){$r(g.socket,"height",n)}),n.iframeHeight.each(function(n){$r(g.editor.getFrame(),"height",n)}),document.body.scrollTop=n.scrollTop}),h.clear(),v.on(function(n){n.exclusives.unbind()}),v.clear(),Le(g.container,ci("fullscreen-maximized")),Om(),Rl(g.toolbar),Xr(g.socket,"overflow"),Xr(g.socket,"-webkit-overflow-scrolling"),Po(g.editor.getFrame()),xm(g.editor).each(function(n){n.clearSelection()})}}}function wp(n,e,t){n.system.broadcastOn([dr],{command:e,state:t})}function Sp(e){return function(){function n(){e._skinLoaded=!0,e.fire("SkinLoaded")}e.initialized?n():e.on("init",n)}}var Op=tinymce.util.Tools.resolve("tinymce.EditorManager"),kp="toReading",Tp="toEditing";sr.add("mobile",function(E){return{getNotificationManagerImpl:function(){return{open:w({progressBar:{value:Y},close:Y,text:Y,getEl:w(null),moveTo:Y,moveRel:Y,settings:{}}),close:Y,reposition:Y,getArgs:w({})}},renderUI:function(){var n,e,t=E.getElement(),o={content:(n=mn.from(E.getParam("skin_url")).getOrThunk(function(){return Op.baseURL+"/skins/ui/oxide"}))+"/content.mobile.min.css",ui:n+"/skin.mobile.min.css"};function r(){E.fire("ScrollIntoView")}!1===E.getParam("skin")==0?(e=ar.DOM.styleSheetLoader,E.contentCSS.push(o.content),e.load(o.ui,Sp(E)),E.on("remove",function(){return e.unload(o.ui)})):Sp(E)();var i,u,c,a,s,f,l,d,m,g,p,h,v,b,y,x,w=Fn().os.isAndroid()?(i=r,u=zg({classes:[ci("android-container")]}),c=Hm(),a=uu(),s=Pm(a),f=zm(),l=Zm(Y,i),u.add(c.wrapper),u.add(f),u.add(l.component),{system:u,element:u.element,init:function(n){a.set(Am(n))},exit:function(){a.run(function(n){n.exit(),jd.remove(f,s)})},setToolbarGroups:function(n){var e=c.createGroups(n);c.setGroups(e)},setContextToolbar:function(n){var e=c.createGroups(n);c.setContextToolbar(e)},focusToolbar:function(){c.focus()},restoreToolbar:function(){c.restoreToolbar()},updateMode:function(n){jm(f,s,n,u.root)},socket:f,dropup:l}):(m=r,g=zg({classes:[ci("ios-container")]}),p=Hm(),h=uu(),v=Pm(h),b=zm(),y=Zm(function(){h.run(function(n){n.refreshStructure()})},m),g.add(p.wrapper),g.add(b),g.add(y.component),{system:g,element:g.element,init:function(r){h.set(function(){var n=zt("Getting IosWebapp schema",kg,r);$r(n.toolstrip,"width","100%"),$r(n.container,"position","relative");var e=Td(Bm(function(){n.setReadOnly(n.readOnlyOnInit()),o.enter()},n.translate));n.alloy.add(e);var t={show:function(){n.alloy.add(e)},hide:function(){n.alloy.remove(e)}},o=xp(n,t);return{setReadOnly:n.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:Y}}())},exit:function(){h.run(function(n){jd.remove(b,v),n.exit()})},setToolbarGroups:function(n){var e=p.createGroups(n);p.setGroups(e)},setContextToolbar:function(n){var e=p.createGroups(n);p.setContextToolbar(e)},focusToolbar:function(){p.focus()},restoreToolbar:function(){p.restoreToolbar()},updateMode:function(n){jm(b,v,n,g.root)},socket:b,dropup:y}),S=fe.fromDom(t);function O(n,e,t,o){!1===o&&E.selection.collapse();var r,i,u,c=(r=e,i=t,{readOnly:(u=n.get()).backToMask.concat(r.get()),main:u.backToMask.concat(i.get())});w.setToolbarGroups(!0===o?c.readOnly:c.main),E.setMode(!0===o?"readonly":"design"),E.fire(!0===o?kp:Tp),w.updateMode(o)}function k(n,e){return E.on(n,e),{unbind:function(){E.off(n)}}}d=w.system,be(S,(x=d).element),M(Je(x.element),function(n){x.getByDom(n).each(ct)});var T=t.ownerDocument.defaultView,C=Ll(T,{onChange:function(){var n,e,t;w.system.broadcastOn([mr],{width:(n=T,e=Fn().os.isiOS(),t=jl(n).isPortrait(),e&&!t?n.screen.height:n.screen.width)})},onReady:Y});return E.on("init",function(){w.init({editor:{getFrame:function(){return fe.fromDom(E.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:Y}},onToReading:function(n){return k(kp,n)},onToEditing:function(n){return k(Tp,n)},onScrollToCursor:function(e){return E.on("ScrollIntoView",function(n){e(n)}),{unbind:function(){E.off("ScrollIntoView"),C.destroy()}}},onTouchToolstrip:function(){i()},onTouchContent:function(){jo(fe.fromDom(E.editorContainer.querySelector("."+ci("toolbar")))).bind(function(n){return w.system.getByDom(n).toOptional()}).each(q),w.restoreToolbar(),i()},onTapContent:function(n){var e=n.target;"img"===le(e)?(E.selection.select(e.dom),n.kill()):"a"===le(e)&&w.system.getByDom(fe.fromDom(E.editorContainer)).each(function(n){cr.isAlpha(n)&&function(n){var e=document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)}(e.dom)})}},container:fe.fromDom(E.editorContainer),socket:fe.fromDom(E.contentAreaContainer),toolstrip:fe.fromDom(E.editorContainer.querySelector("."+ci("toolstrip"))),toolbar:fe.fromDom(E.editorContainer.querySelector("."+ci("toolbar"))),dropup:w.dropup,alloy:w.system,translate:Y,setReadOnly:function(n){O(d,l,f,n)},readOnlyOnInit:function(){return!1}});var t,n,o,r,e,i=function(){w.dropup.disappear(function(){w.system.broadcastOn([gr],{})})},u={label:"The first group",scrollable:!1,items:[nf("back",function(){E.selection.collapse(),w.exit()},{},E)]},c={label:"Back to read only",scrollable:!1,items:[nf("readonly-back",function(){O(d,l,f,!0)},{},E)]},a=Al(w,E),s={label:"The extra group",scrollable:!1,items:[]},f=No([{label:"the action group",scrollable:!0,items:(t=a,e=E.getParam("toolbar",lr,"array"),n=(D(e)?om:Bl)(e),o={},B(n,function(n){var e=!Re(o,n)&&Re(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return o[n]=!0,e}))},s]),l=No([{label:"The read only mode group",scrollable:!0,items:[]},s]),d=No({backToMask:[u],backToReadOnly:[c]}),m=w;M(st((r=E).formatter.get()),function(e){r.formatter.formatChanged(e,function(n){wp(m,e,n)})}),M(["ul","ol"],function(t){r.selection.selectorChanged(t,function(n,e){wp(m,t,n)})})}),E.on("remove",function(){w.exit()}),E.on("detach",function(){var e=w.system;M(Je(e.element),function(n){e.getByDom(n).each(ut)}),Ze(e.element),w.system.destroy()}),{iframeContainer:w.socket.element.dom,editorContainer:w.element.dom}}}})}();
/trunk/vendor/tinymce/tinymce/themes/silver/theme.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
435,7 → 435,7
};
 
var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var hasOwnProperty$1 = Object.hasOwnProperty;
var each = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
502,7 → 502,7
return has$2(obj, key) ? Optional.from(obj[key]) : Optional.none();
};
var has$2 = function (obj, key) {
return hasOwnProperty.call(obj, key);
return hasOwnProperty$1.call(obj, key);
};
var hasNonNullableKey = function (obj, key) {
return has$2(obj, key) && obj[key] !== undefined && obj[key] !== null;
2889,11 → 2889,11
return get$7(container);
};
 
var clone$1 = function (original, isDeep) {
var clone$2 = function (original, isDeep) {
return SugarElement.fromDom(original.dom.cloneNode(isDeep));
};
var shallow = function (original) {
return clone$1(original, false);
return clone$2(original, false);
};
 
var getHtml = function (element) {
3562,7 → 3562,7
});
return Result.value(build$2(completeSpec));
};
var text = function (textContent) {
var text$1 = function (textContent) {
var element = SugarElement.fromText(textContent);
return external$2({ element: element });
};
4179,7 → 4179,7
f(component, bConfig, bState);
});
};
var create$8 = function (schema, name, active, apis, extra, state) {
var create$9 = function (schema, name, active, apis, extra, state) {
var configSchema = objOfOnly(schema);
var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]);
return doCreate(configSchema, schemaSchema, name, active, apis, extra, state);
4274,9 → 4274,9
defaulted('state', NoState),
defaulted('extra', {})
]);
var create$7 = function (data) {
var create$8 = function (data) {
var value = asRawOrDie$1('Creating behaviour: ' + data.name, simpleSchema, data);
return create$8(value.fields, value.name, value.active, value.apis, value.extra, value.state);
return create$9(value.fields, value.name, value.active, value.apis, value.extra, value.state);
};
var modeSchema = objOfOnly([
required$1('branchKey'),
4293,7 → 4293,7
};
var revoke = constant$1(undefined);
 
var Receiving = create$7({
var Receiving = create$8({
fields: ReceivingSchema,
name: 'receiving',
active: ActiveReceiving
5198,7 → 5198,7
var zeroWidth = '\uFEFF';
var nbsp = '\xA0';
 
var create$6 = function (start, soffset, finish, foffset) {
var create$7 = function (start, soffset, finish, foffset) {
return {
start: start,
soffset: soffset,
5206,7 → 5206,7
foffset: foffset
};
};
var SimRange = { create: create$6 };
var SimRange = { create: create$7 };
 
var adt$6 = Adt.generate([
{ before: ['element'] },
5816,7 → 5816,7
init: init$g
});
 
var Positioning = create$7({
var Positioning = create$8({
fields: PositionSchema,
name: 'positioning',
active: ActivePosition,
6050,7 → 6050,7
init: init$f
});
 
var Sandboxing = create$7({
var Sandboxing = create$8({
fields: SandboxSchema,
name: 'sandboxing',
active: ActiveSandbox,
6327,7 → 6327,7
defaulted('resetOnDom', false)
];
 
var Representing = create$7({
var Representing = create$8({
fields: RepresentSchema,
name: 'representing',
active: ActiveRepresenting,
6797,7 → 6797,7
 
var ComposeSchema = [required$1('find')];
 
var Composing = create$7({
var Composing = create$8({
fields: ComposeSchema,
name: 'composing',
apis: ComposeApis
6893,7 → 6893,7
onHandler('onEnabled')
];
 
var Disabling = create$7({
var Disabling = create$8({
fields: DisableSchema,
name: 'disabling',
active: ActiveDisable,
7030,7 → 7030,7
onHandler('onDehighlight')
];
 
var Highlighting = create$7({
var Highlighting = create$8({
fields: HighlightSchema,
name: 'highlighting',
apis: HighlightApis
7220,7 → 7220,7
return me;
};
 
var create$5 = function (cyclicField) {
var create$6 = function (cyclicField) {
var schema = [
option('onEscape'),
option('onEnter'),
7310,9 → 7310,9
});
};
 
var AcyclicType = create$5(customField('cyclic', never));
var AcyclicType = create$6(customField('cyclic', never));
 
var CyclicType = create$5(customField('cyclic', always));
var CyclicType = create$6(customField('cyclic', always));
 
var doDefaultExecute = function (component, _simulatedEvent, focused) {
dispatch(component, focused, execute$5());
7964,7 → 7964,7
contents: contents
});
 
var Replacing = create$7({
var Replacing = create$8({
fields: [],
name: 'replacing',
apis: ReplaceApis
7972,7 → 7972,7
 
var events$d = function (name, eventHandlers) {
var events = derive$2(eventHandlers);
return create$7({
return create$8({
fields: [required$1('enabled')],
name: name,
active: { events: constant$1(events) }
8039,7 → 8039,7
defaulted('ignore', false)
];
 
var Focusing = create$7({
var Focusing = create$8({
fields: FocusSchema,
name: 'focusing',
active: ActiveFocus,
8168,7 → 8168,7
}))
];
 
var Toggling = create$7({
var Toggling = create$8({
fields: ToggleSchema,
name: 'toggling',
active: ActiveToggle,
9629,10 → 9629,10
});
}
};
var updateText = function (comp, text$1) {
var updateText = function (comp, text) {
if (comp.getSystem().isConnected()) {
var banner = memBannerText.get(comp);
Replacing.set(banner, [text(text$1)]);
Replacing.set(banner, [text$1(text)]);
}
};
var apis = {
9933,7 → 9933,7
};
 
var autocompleteSelector = '[data-mce-autocompleter]';
var create$4 = function (editor, range) {
var create$5 = function (editor, range) {
return detect(SugarElement.fromDom(editor.selection.getNode())).getOrThunk(function () {
var wrapper = SugarElement.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>', editor.getDoc());
append$2(wrapper, SugarElement.fromDom(range.extractContents()));
10922,7 → 10922,7
init: init$b
});
 
var Tooltipping = create$7({
var Tooltipping = create$8({
fields: TooltippingSchema,
name: 'tooltipping',
active: ActiveTooltipping,
11297,13 → 11297,13
classes: classes
}, icons);
};
var renderText = function (text$1) {
var renderText = function (text) {
return {
dom: {
tag: 'div',
classes: [textClass]
},
components: [text(global$e.translate(text$1))]
components: [text$1(global$e.translate(text))]
};
};
var renderHtml = function (html, classes) {
11315,7 → 11315,7
}
};
};
var renderStyledText = function (style, text$1) {
var renderStyledText = function (style, text) {
return {
dom: {
tag: 'div',
11326,7 → 11326,7
tag: style.tag,
styles: style.styles
},
components: [text(global$e.translate(text$1))]
components: [text$1(global$e.translate(text))]
}]
};
};
12451,7 → 12451,7
});
};
var makeLabelText = function (row, col) {
return text(col + 'x' + row);
return text$1(col + 'x' + row);
};
var renderInsertTableMenuItem = function (spec) {
var numRows = 10;
12861,7 → 12861,7
};
var commenceIfNecessary = function (context) {
if (!isActive()) {
var wrapper = create$4(editor, context.range);
var wrapper = create$5(editor, context.range);
activeAutocompleter.set({
triggerChar: context.triggerChar,
element: wrapper,
13688,7 → 13688,7
 
var TabstopSchema = [defaulted('tabAttr', 'data-alloy-tabstop')];
 
var Tabstopping = create$7({
var Tabstopping = create$8({
fields: TabstopSchema,
name: 'tabstopping',
active: ActiveTabstopping
14371,7 → 14371,7
])
];
 
var Invalidating = create$7({
var Invalidating = create$8({
fields: InvalidateSchema,
name: 'invalidating',
active: ActiveInvalidate,
14425,7 → 14425,7
init: init$a
});
 
var Coupling = create$7({
var Coupling = create$8({
fields: CouplingSchema,
name: 'coupling',
apis: CouplingApis,
14833,7 → 14833,7
exhibit: exhibit$1
});
 
var Unselecting = create$7({
var Unselecting = create$8({
fields: [],
name: 'unselecting',
active: ActiveUnselecting
16943,11 → 16943,11
return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []);
};
 
var create$3 = function (width, height) {
var create$4 = function (width, height) {
return resize$3(document.createElement('canvas'), width, height);
};
var clone = function (canvas) {
var tCanvas = create$3(canvas.width, canvas.height);
var clone$1 = function (canvas) {
var tCanvas = create$4(canvas.width, canvas.height);
var ctx = get2dContext(tCanvas);
ctx.drawImage(canvas, 0, 0);
return tCanvas;
17046,7 → 17046,7
var blobToCanvas = function (blob) {
return blobToImage(blob).then(function (image) {
revokeImageUrl(image);
var canvas = create$3(getWidth$1(image), getHeight$1(image));
var canvas = create$4(getWidth$1(image), getHeight$1(image));
var context = get2dContext(canvas);
context.drawImage(image, 0, 0);
return canvas;
17065,7 → 17065,7
URL.revokeObjectURL(image.src);
};
 
var create$2 = function (getCanvas, blob, uri) {
var create$3 = function (getCanvas, blob, uri) {
var initialType = blob.type;
var getType = constant$1(initialType);
var toBlob = function () {
17091,7 → 17091,7
});
};
var toCanvas = function () {
return getCanvas.then(clone);
return getCanvas.then(clone$1);
};
return {
getType: getType,
17106,12 → 17106,12
};
var fromBlob = function (blob) {
return blobToDataUri(blob).then(function (uri) {
return create$2(blobToCanvas(blob), blob, uri);
return create$3(blobToCanvas(blob), blob, uri);
});
};
var fromCanvas = function (canvas, type) {
return canvasToBlob(canvas, type).then(function (blob) {
return create$2(Promise$1.resolve(canvas), blob, canvas.toDataURL());
return create$3(Promise$1.resolve(canvas), blob, canvas.toDataURL());
});
};
 
17575,7 → 17575,7
var sH = getHeight$1(image);
var dW = Math.floor(sW * wRatio);
var dH = Math.floor(sH * hRatio);
var canvas = create$3(dW, dH);
var canvas = create$4(dW, dH);
var context = get2dContext(canvas);
context.drawImage(image, 0, 0, sW, sH, 0, 0, dW, dH);
resolve(canvas);
17604,7 → 17604,7
var cos = Math.cos(rad);
var newWidth = ceilWithPrecision(Math.abs(width * cos) + Math.abs(height * sin));
var newHeight = ceilWithPrecision(Math.abs(width * sin) + Math.abs(height * cos));
var canvas = create$3(newWidth, newHeight);
var canvas = create$4(newWidth, newHeight);
var context = get2dContext(canvas);
context.translate(newWidth / 2, newHeight / 2);
context.rotate(rad);
17617,7 → 17617,7
});
};
var applyFlip = function (image, type, axis) {
var canvas = create$3(image.width, image.height);
var canvas = create$4(image.width, image.height);
var context = get2dContext(canvas);
if (axis === 'v') {
context.scale(1, -1);
17634,7 → 17634,7
});
};
var applyCrop = function (image, type, x, y, w, h) {
var canvas = create$3(w, h);
var canvas = create$4(w, h);
var context = get2dContext(canvas);
context.drawImage(image, -x, -y);
return fromCanvas(canvas, type);
17795,7 → 17795,7
optMemDisplayText.bind(function (mem) {
return mem.getOpt(comp);
}).each(function (displayText) {
Replacing.set(displayText, [text(sharedBackstage.providers.translate(se.event.text))]);
Replacing.set(displayText, [text$1(sharedBackstage.providers.translate(se.event.text))]);
});
}),
run$1(updateMenuIcon, function (comp, se) {
18505,7 → 18505,7
var redo = constant$1(generate$6('redo'));
var zoom = constant$1(generate$6('zoom'));
var back = constant$1(generate$6('back'));
var apply = constant$1(generate$6('apply'));
var apply$1 = constant$1(generate$6('apply'));
var swap = constant$1(generate$6('swap'));
var transform$1 = constant$1(generate$6('transform'));
var tempTransform = constant$1(generate$6('temp-transform'));
18515,7 → 18515,7
redo: redo,
zoom: zoom,
back: back,
apply: apply,
apply: apply$1,
swap: swap,
transform: transform$1,
tempTransform: tempTransform,
19040,7 → 19040,7
}
 
var count = 0;
var create$1 = function (currentRect, viewPortRect, clampRect, containerElm, action) {
var create$2 = function (currentRect, viewPortRect, clampRect, containerElm, action) {
var dragHelpers;
var events = [];
var prefix = 'tox-';
19332,7 → 19332,7
});
return instance;
};
var CropRect = { create: create$1 };
var CropRect = { create: create$2 };
 
var loadImage = function (image) {
return new global$c(function (resolve) {
20428,7 → 20428,7
onStrictHandler('onStream')
];
 
var Streaming = create$7({
var Streaming = create$8({
fields: StreamingSchema,
name: 'streaming',
active: ActiveStreaming,
21903,7 → 21903,7
};
var isContentEditableTrue = hasContentEditableState('true');
var isContentEditableFalse = hasContentEditableState('false');
var create = function (type, title, url, level, attach) {
var create$1 = function (type, title, url, level, attach) {
return {
type: type,
title: title,
21955,12 → 21955,12
var attach = function () {
elm.id = headerId;
};
return create('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
return create$1('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
};
var anchorTarget = function (elm) {
var anchorId = elm.id || elm.name;
var anchorText = getElementText(elm);
return create('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
return create$1('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
};
var getHeaderTargets = function (elms) {
return map$2(filter$2(elms, isValidHeader), headerTarget);
22713,7 → 22713,7
init: init$6
});
 
var Docking = create$7({
var Docking = create$8({
fields: DockingSchema,
name: 'docking',
active: ActiveDocking,
23312,7 → 23312,7
init: init$5
});
 
var Sliding = create$7({
var Sliding = create$8({
fields: SlidingSchema,
name: 'sliding',
active: ActiveSliding,
23708,7 → 23708,7
init: init$4
});
 
var Blocking = create$7({
var Blocking = create$8({
fields: BlockingSchema,
name: 'blocking',
apis: BlockingApis,
25781,7 → 25781,7
init: init$3
});
 
var Reflecting = create$7({
var Reflecting = create$8({
fields: ReflectingSchema,
name: 'reflecting',
active: ActiveReflecting,
29642,7 → 29642,7
var renderWordCount = function (editor, providersBackstage) {
var _a;
var replaceCountText = function (comp, count, mode) {
return Replacing.set(comp, [text(providersBackstage.translate([
return Replacing.set(comp, [text$1(providersBackstage.translate([
'{0} ' + mode,
count[mode]
]))]);
31311,6 → 31311,1569
return ModalDialog.parts.body(bodySpec);
};
 
function _typeof(obj) {
'@babel/helpers - typeof';
return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
}, _typeof(obj);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === 'undefined' || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === 'function')
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {
}));
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class)
_setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr))
return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null || iter['@@iterator'] != null)
return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o)
return;
if (typeof o === 'string')
return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === 'Object' && o.constructor)
n = o.constructor.name;
if (n === 'Map' || n === 'Set')
return Array.from(o);
if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++)
arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
var hasOwnProperty = Object.hasOwnProperty, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var freeze = Object.freeze, seal = Object.seal, create = Object.create;
var _ref = typeof Reflect !== 'undefined' && Reflect, apply = _ref.apply, construct = _ref.construct;
if (!apply) {
apply = function apply(fun, thisValue, args) {
return fun.apply(thisValue, args);
};
}
if (!freeze) {
freeze = function freeze(x) {
return x;
};
}
if (!seal) {
seal = function seal(x) {
return x;
};
}
if (!construct) {
construct = function construct(Func, args) {
return _construct(Func, _toConsumableArray(args));
};
}
var arrayForEach = unapply(Array.prototype.forEach);
var arrayPop = unapply(Array.prototype.pop);
var arrayPush = unapply(Array.prototype.push);
var stringToLowerCase = unapply(String.prototype.toLowerCase);
var stringMatch = unapply(String.prototype.match);
var stringReplace = unapply(String.prototype.replace);
var stringIndexOf = unapply(String.prototype.indexOf);
var stringTrim = unapply(String.prototype.trim);
var regExpTest = unapply(RegExp.prototype.test);
var typeErrorCreate = unconstruct(TypeError);
function unapply(func) {
return function (thisArg) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return apply(func, thisArg, args);
};
}
function unconstruct(func) {
return function () {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return construct(func, args);
};
}
function addToSet(set, array) {
if (setPrototypeOf) {
setPrototypeOf(set, null);
}
var l = array.length;
while (l--) {
var element = array[l];
if (typeof element === 'string') {
var lcElement = stringToLowerCase(element);
if (lcElement !== element) {
if (!isFrozen(array)) {
array[l] = lcElement;
}
element = lcElement;
}
}
set[element] = true;
}
return set;
}
function clone(object) {
var newObject = create(null);
var property;
for (property in object) {
if (apply(hasOwnProperty, object, [property])) {
newObject[property] = object[property];
}
}
return newObject;
}
function lookupGetter(object, prop) {
while (object !== null) {
var desc = getOwnPropertyDescriptor(object, prop);
if (desc) {
if (desc.get) {
return unapply(desc.get);
}
if (typeof desc.value === 'function') {
return unapply(desc.value);
}
}
object = getPrototypeOf(object);
}
function fallbackValue(element) {
console.warn('fallback value for', element);
return null;
}
return fallbackValue;
}
var html$1 = freeze([
'a',
'abbr',
'acronym',
'address',
'area',
'article',
'aside',
'audio',
'b',
'bdi',
'bdo',
'big',
'blink',
'blockquote',
'body',
'br',
'button',
'canvas',
'caption',
'center',
'cite',
'code',
'col',
'colgroup',
'content',
'data',
'datalist',
'dd',
'decorator',
'del',
'details',
'dfn',
'dialog',
'dir',
'div',
'dl',
'dt',
'element',
'em',
'fieldset',
'figcaption',
'figure',
'font',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'head',
'header',
'hgroup',
'hr',
'html',
'i',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'map',
'mark',
'marquee',
'menu',
'menuitem',
'meter',
'nav',
'nobr',
'ol',
'optgroup',
'option',
'output',
'p',
'picture',
'pre',
'progress',
'q',
'rp',
'rt',
'ruby',
's',
'samp',
'section',
'select',
'shadow',
'small',
'source',
'spacer',
'span',
'strike',
'strong',
'style',
'sub',
'summary',
'sup',
'table',
'tbody',
'td',
'template',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'track',
'tt',
'u',
'ul',
'var',
'video',
'wbr'
]);
var svg$1 = freeze([
'svg',
'a',
'altglyph',
'altglyphdef',
'altglyphitem',
'animatecolor',
'animatemotion',
'animatetransform',
'circle',
'clippath',
'defs',
'desc',
'ellipse',
'filter',
'font',
'g',
'glyph',
'glyphref',
'hkern',
'image',
'line',
'lineargradient',
'marker',
'mask',
'metadata',
'mpath',
'path',
'pattern',
'polygon',
'polyline',
'radialgradient',
'rect',
'stop',
'style',
'switch',
'symbol',
'text',
'textpath',
'title',
'tref',
'tspan',
'view',
'vkern'
]);
var svgFilters = freeze([
'feBlend',
'feColorMatrix',
'feComponentTransfer',
'feComposite',
'feConvolveMatrix',
'feDiffuseLighting',
'feDisplacementMap',
'feDistantLight',
'feFlood',
'feFuncA',
'feFuncB',
'feFuncG',
'feFuncR',
'feGaussianBlur',
'feImage',
'feMerge',
'feMergeNode',
'feMorphology',
'feOffset',
'fePointLight',
'feSpecularLighting',
'feSpotLight',
'feTile',
'feTurbulence'
]);
var svgDisallowed = freeze([
'animate',
'color-profile',
'cursor',
'discard',
'fedropshadow',
'font-face',
'font-face-format',
'font-face-name',
'font-face-src',
'font-face-uri',
'foreignobject',
'hatch',
'hatchpath',
'mesh',
'meshgradient',
'meshpatch',
'meshrow',
'missing-glyph',
'script',
'set',
'solidcolor',
'unknown',
'use'
]);
var mathMl$1 = freeze([
'math',
'menclose',
'merror',
'mfenced',
'mfrac',
'mglyph',
'mi',
'mlabeledtr',
'mmultiscripts',
'mn',
'mo',
'mover',
'mpadded',
'mphantom',
'mroot',
'mrow',
'ms',
'mspace',
'msqrt',
'mstyle',
'msub',
'msup',
'msubsup',
'mtable',
'mtd',
'mtext',
'mtr',
'munder',
'munderover'
]);
var mathMlDisallowed = freeze([
'maction',
'maligngroup',
'malignmark',
'mlongdiv',
'mscarries',
'mscarry',
'msgroup',
'mstack',
'msline',
'msrow',
'semantics',
'annotation',
'annotation-xml',
'mprescripts',
'none'
]);
var text = freeze(['#text']);
var html = freeze([
'accept',
'action',
'align',
'alt',
'autocapitalize',
'autocomplete',
'autopictureinpicture',
'autoplay',
'background',
'bgcolor',
'border',
'capture',
'cellpadding',
'cellspacing',
'checked',
'cite',
'class',
'clear',
'color',
'cols',
'colspan',
'controls',
'controlslist',
'coords',
'crossorigin',
'datetime',
'decoding',
'default',
'dir',
'disabled',
'disablepictureinpicture',
'disableremoteplayback',
'download',
'draggable',
'enctype',
'enterkeyhint',
'face',
'for',
'headers',
'height',
'hidden',
'high',
'href',
'hreflang',
'id',
'inputmode',
'integrity',
'ismap',
'kind',
'label',
'lang',
'list',
'loading',
'loop',
'low',
'max',
'maxlength',
'media',
'method',
'min',
'minlength',
'multiple',
'muted',
'name',
'nonce',
'noshade',
'novalidate',
'nowrap',
'open',
'optimum',
'pattern',
'placeholder',
'playsinline',
'poster',
'preload',
'pubdate',
'radiogroup',
'readonly',
'rel',
'required',
'rev',
'reversed',
'role',
'rows',
'rowspan',
'spellcheck',
'scope',
'selected',
'shape',
'size',
'sizes',
'span',
'srclang',
'start',
'src',
'srcset',
'step',
'style',
'summary',
'tabindex',
'title',
'translate',
'type',
'usemap',
'valign',
'value',
'width',
'xmlns',
'slot'
]);
var svg = freeze([
'accent-height',
'accumulate',
'additive',
'alignment-baseline',
'ascent',
'attributename',
'attributetype',
'azimuth',
'basefrequency',
'baseline-shift',
'begin',
'bias',
'by',
'class',
'clip',
'clippathunits',
'clip-path',
'clip-rule',
'color',
'color-interpolation',
'color-interpolation-filters',
'color-profile',
'color-rendering',
'cx',
'cy',
'd',
'dx',
'dy',
'diffuseconstant',
'direction',
'display',
'divisor',
'dur',
'edgemode',
'elevation',
'end',
'fill',
'fill-opacity',
'fill-rule',
'filter',
'filterunits',
'flood-color',
'flood-opacity',
'font-family',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-weight',
'fx',
'fy',
'g1',
'g2',
'glyph-name',
'glyphref',
'gradientunits',
'gradienttransform',
'height',
'href',
'id',
'image-rendering',
'in',
'in2',
'k',
'k1',
'k2',
'k3',
'k4',
'kerning',
'keypoints',
'keysplines',
'keytimes',
'lang',
'lengthadjust',
'letter-spacing',
'kernelmatrix',
'kernelunitlength',
'lighting-color',
'local',
'marker-end',
'marker-mid',
'marker-start',
'markerheight',
'markerunits',
'markerwidth',
'maskcontentunits',
'maskunits',
'max',
'mask',
'media',
'method',
'mode',
'min',
'name',
'numoctaves',
'offset',
'operator',
'opacity',
'order',
'orient',
'orientation',
'origin',
'overflow',
'paint-order',
'path',
'pathlength',
'patterncontentunits',
'patterntransform',
'patternunits',
'points',
'preservealpha',
'preserveaspectratio',
'primitiveunits',
'r',
'rx',
'ry',
'radius',
'refx',
'refy',
'repeatcount',
'repeatdur',
'restart',
'result',
'rotate',
'scale',
'seed',
'shape-rendering',
'specularconstant',
'specularexponent',
'spreadmethod',
'startoffset',
'stddeviation',
'stitchtiles',
'stop-color',
'stop-opacity',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke',
'stroke-width',
'style',
'surfacescale',
'systemlanguage',
'tabindex',
'targetx',
'targety',
'transform',
'transform-origin',
'text-anchor',
'text-decoration',
'text-rendering',
'textlength',
'type',
'u1',
'u2',
'unicode',
'values',
'viewbox',
'visibility',
'version',
'vert-adv-y',
'vert-origin-x',
'vert-origin-y',
'width',
'word-spacing',
'wrap',
'writing-mode',
'xchannelselector',
'ychannelselector',
'x',
'x1',
'x2',
'xmlns',
'y',
'y1',
'y2',
'z',
'zoomandpan'
]);
var mathMl = freeze([
'accent',
'accentunder',
'align',
'bevelled',
'close',
'columnsalign',
'columnlines',
'columnspan',
'denomalign',
'depth',
'dir',
'display',
'displaystyle',
'encoding',
'fence',
'frame',
'height',
'href',
'id',
'largeop',
'length',
'linethickness',
'lspace',
'lquote',
'mathbackground',
'mathcolor',
'mathsize',
'mathvariant',
'maxsize',
'minsize',
'movablelimits',
'notation',
'numalign',
'open',
'rowalign',
'rowlines',
'rowspacing',
'rowspan',
'rspace',
'rquote',
'scriptlevel',
'scriptminsize',
'scriptsizemultiplier',
'selection',
'separator',
'separators',
'stretchy',
'subscriptshift',
'supscriptshift',
'symmetric',
'voffset',
'width',
'xmlns'
]);
var xml = freeze([
'xlink:href',
'xml:id',
'xlink:title',
'xml:space',
'xmlns:xlink'
]);
var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
var DOCTYPE_NAME = seal(/^html$/i);
var getGlobal = function getGlobal() {
return typeof window === 'undefined' ? null : window;
};
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
if (_typeof(trustedTypes) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
return null;
}
var suffix = null;
var ATTR_NAME = 'data-tt-policy-suffix';
if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
suffix = document.currentScript.getAttribute(ATTR_NAME);
}
var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
try {
return trustedTypes.createPolicy(policyName, {
createHTML: function createHTML(html) {
return html;
}
});
} catch (_) {
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
return null;
}
};
function createDOMPurify() {
var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
var DOMPurify = function DOMPurify(root) {
return createDOMPurify(root);
};
DOMPurify.version = '2.3.8';
DOMPurify.removed = [];
if (!window || !window.document || window.document.nodeType !== 9) {
DOMPurify.isSupported = false;
return DOMPurify;
}
var originalDocument = window.document;
var document = window.document;
var DocumentFragment = window.DocumentFragment, HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter, _window$NamedNodeMap = window.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window.HTMLFormElement, DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;
var ElementPrototype = Element.prototype;
var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
if (typeof HTMLTemplateElement === 'function') {
var template = document.createElement('template');
if (template.content && template.content.ownerDocument) {
document = template.content.ownerDocument;
}
}
var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';
var _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
var importNode = originalDocument.importNode;
var documentMode = {};
try {
documentMode = clone(document).documentMode ? document.documentMode : {};
} catch (_) {
}
var hooks = {};
DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE;
var IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
var ALLOWED_TAGS = null;
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text)));
var ALLOWED_ATTR = null;
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(mathMl), _toConsumableArray(xml)));
var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
tagNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
attributeNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
allowCustomizedBuiltInElements: {
writable: true,
configurable: false,
enumerable: true,
value: false
}
}));
var FORBID_TAGS = null;
var FORBID_ATTR = null;
var ALLOW_ARIA_ATTR = true;
var ALLOW_DATA_ATTR = true;
var ALLOW_UNKNOWN_PROTOCOLS = false;
var SAFE_FOR_TEMPLATES = false;
var WHOLE_DOCUMENT = false;
var SET_CONFIG = false;
var FORCE_BODY = false;
var RETURN_DOM = false;
var RETURN_DOM_FRAGMENT = false;
var RETURN_TRUSTED_TYPE = false;
var SANITIZE_DOM = true;
var KEEP_CONTENT = true;
var IN_PLACE = false;
var USE_PROFILES = {};
var FORBID_CONTENTS = null;
var DEFAULT_FORBID_CONTENTS = addToSet({}, [
'annotation-xml',
'audio',
'colgroup',
'desc',
'foreignobject',
'head',
'iframe',
'math',
'mi',
'mn',
'mo',
'ms',
'mtext',
'noembed',
'noframes',
'noscript',
'plaintext',
'script',
'style',
'svg',
'template',
'thead',
'title',
'video',
'xmp'
]);
var DATA_URI_TAGS = null;
var DEFAULT_DATA_URI_TAGS = addToSet({}, [
'audio',
'video',
'img',
'source',
'image',
'track'
]);
var URI_SAFE_ATTRIBUTES = null;
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
'alt',
'class',
'for',
'id',
'label',
'name',
'pattern',
'placeholder',
'role',
'summary',
'title',
'value',
'style',
'xmlns'
]);
var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
var NAMESPACE = HTML_NAMESPACE;
var IS_EMPTY_INPUT = false;
var PARSER_MEDIA_TYPE;
var SUPPORTED_PARSER_MEDIA_TYPES = [
'application/xhtml+xml',
'text/html'
];
var DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
var transformCaseFunc;
var CONFIG = null;
var formElement = document.createElement('form');
var isRegexOrFunction = function isRegexOrFunction(testValue) {
return testValue instanceof RegExp || testValue instanceof Function;
};
var _parseConfig = function _parseConfig(cfg) {
if (CONFIG && CONFIG === cfg) {
return;
}
if (!cfg || _typeof(cfg) !== 'object') {
cfg = {};
}
cfg = clone(cfg);
ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS;
FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
RETURN_DOM = cfg.RETURN_DOM || false;
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
FORCE_BODY = cfg.FORCE_BODY || false;
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
IN_PLACE = cfg.IN_PLACE || false;
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1;
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
}
PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE;
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? function (x) {
return x;
} : stringToLowerCase;
if (SAFE_FOR_TEMPLATES) {
ALLOW_DATA_ATTR = false;
}
if (RETURN_DOM_FRAGMENT) {
RETURN_DOM = true;
}
if (USE_PROFILES) {
ALLOWED_TAGS = addToSet({}, _toConsumableArray(text));
ALLOWED_ATTR = [];
if (USE_PROFILES.html === true) {
addToSet(ALLOWED_TAGS, html$1);
addToSet(ALLOWED_ATTR, html);
}
if (USE_PROFILES.svg === true) {
addToSet(ALLOWED_TAGS, svg$1);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.svgFilters === true) {
addToSet(ALLOWED_TAGS, svgFilters);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.mathMl === true) {
addToSet(ALLOWED_TAGS, mathMl$1);
addToSet(ALLOWED_ATTR, mathMl);
addToSet(ALLOWED_ATTR, xml);
}
}
if (cfg.ADD_TAGS) {
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
ALLOWED_TAGS = clone(ALLOWED_TAGS);
}
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
}
if (cfg.ADD_ATTR) {
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
ALLOWED_ATTR = clone(ALLOWED_ATTR);
}
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
}
if (cfg.ADD_URI_SAFE_ATTR) {
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
}
if (cfg.FORBID_CONTENTS) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS);
}
if (KEEP_CONTENT) {
ALLOWED_TAGS['#text'] = true;
}
if (WHOLE_DOCUMENT) {
addToSet(ALLOWED_TAGS, [
'html',
'head',
'body'
]);
}
if (ALLOWED_TAGS.table) {
addToSet(ALLOWED_TAGS, ['tbody']);
delete FORBID_TAGS.tbody;
}
if (freeze) {
freeze(cfg);
}
CONFIG = cfg;
};
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [
'mi',
'mo',
'mn',
'ms',
'mtext'
]);
var HTML_INTEGRATION_POINTS = addToSet({}, [
'foreignobject',
'desc',
'title',
'annotation-xml'
]);
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
'title',
'style',
'font',
'a',
'script'
]);
var ALL_SVG_TAGS = addToSet({}, svg$1);
addToSet(ALL_SVG_TAGS, svgFilters);
addToSet(ALL_SVG_TAGS, svgDisallowed);
var ALL_MATHML_TAGS = addToSet({}, mathMl$1);
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
var _checkValidNamespace = function _checkValidNamespace(element) {
var parent = getParentNode(element);
if (!parent || !parent.tagName) {
parent = {
namespaceURI: HTML_NAMESPACE,
tagName: 'template'
};
}
var tagName = stringToLowerCase(element.tagName);
var parentTagName = stringToLowerCase(parent.tagName);
if (element.namespaceURI === SVG_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === 'svg';
}
if (parent.namespaceURI === MATHML_NAMESPACE) {
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
}
return Boolean(ALL_SVG_TAGS[tagName]);
}
if (element.namespaceURI === MATHML_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === 'math';
}
if (parent.namespaceURI === SVG_NAMESPACE) {
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
}
return Boolean(ALL_MATHML_TAGS[tagName]);
}
if (element.namespaceURI === HTML_NAMESPACE) {
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
return false;
}
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
return false;
}
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
}
return false;
};
var _forceRemove = function _forceRemove(node) {
arrayPush(DOMPurify.removed, { element: node });
try {
node.parentNode.removeChild(node);
} catch (_) {
try {
node.outerHTML = emptyHTML;
} catch (_) {
node.remove();
}
}
};
var _removeAttribute = function _removeAttribute(name, node) {
try {
arrayPush(DOMPurify.removed, {
attribute: node.getAttributeNode(name),
from: node
});
} catch (_) {
arrayPush(DOMPurify.removed, {
attribute: null,
from: node
});
}
node.removeAttribute(name);
if (name === 'is' && !ALLOWED_ATTR[name]) {
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
try {
_forceRemove(node);
} catch (_) {
}
} else {
try {
node.setAttribute(name, '');
} catch (_) {
}
}
}
};
var _initDocument = function _initDocument(dirty) {
var doc;
var leadingWhitespace;
if (FORCE_BODY) {
dirty = '<remove></remove>' + dirty;
} else {
var matches = stringMatch(dirty, /^[\r\n\t ]+/);
leadingWhitespace = matches && matches[0];
}
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml') {
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
}
var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
if (NAMESPACE === HTML_NAMESPACE) {
try {
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
} catch (_) {
}
}
if (!doc || !doc.documentElement) {
doc = implementation.createDocument(NAMESPACE, 'template', null);
try {
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
} catch (_) {
}
}
var body = doc.body || doc.documentElement;
if (dirty && leadingWhitespace) {
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
}
if (NAMESPACE === HTML_NAMESPACE) {
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
}
return WHOLE_DOCUMENT ? doc.documentElement : body;
};
var _createIterator = function _createIterator(root) {
return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
};
var _isClobbered = function _isClobbered(elm) {
return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function');
};
var _isNode = function _isNode(object) {
return _typeof(Node) === 'object' ? object instanceof Node : object && _typeof(object) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
};
var _executeHook = function _executeHook(entryPoint, currentNode, data) {
if (!hooks[entryPoint]) {
return;
}
arrayForEach(hooks[entryPoint], function (hook) {
hook.call(DOMPurify, currentNode, data, CONFIG);
});
};
var _sanitizeElements = function _sanitizeElements(currentNode) {
var content;
_executeHook('beforeSanitizeElements', currentNode, null);
if (_isClobbered(currentNode)) {
_forceRemove(currentNode);
return true;
}
if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
_forceRemove(currentNode);
return true;
}
var tagName = transformCaseFunc(currentNode.nodeName);
_executeHook('uponSanitizeElement', currentNode, {
tagName: tagName,
allowedTags: ALLOWED_TAGS
});
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
_forceRemove(currentNode);
return true;
}
if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {
_forceRemove(currentNode);
return true;
}
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName))
return false;
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))
return false;
}
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
var parentNode = getParentNode(currentNode) || currentNode.parentNode;
var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
if (childNodes && parentNode) {
var childCount = childNodes.length;
for (var i = childCount - 1; i >= 0; --i) {
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
}
}
}
_forceRemove(currentNode);
return true;
}
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
_forceRemove(currentNode);
return true;
}
if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
_forceRemove(currentNode);
return true;
}
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
content = currentNode.textContent;
content = stringReplace(content, MUSTACHE_EXPR$1, ' ');
content = stringReplace(content, ERB_EXPR$1, ' ');
if (currentNode.textContent !== content) {
arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
currentNode.textContent = content;
}
}
_executeHook('afterSanitizeElements', currentNode, null);
return false;
};
var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
return false;
}
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName));
else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName));
else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
if (_basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));
else {
return false;
}
} else if (URI_SAFE_ATTRIBUTES[lcName]);
else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, '')));
else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]);
else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, '')));
else if (!value);
else {
return false;
}
return true;
};
var _basicCustomElementTest = function _basicCustomElementTest(tagName) {
return tagName.indexOf('-') > 0;
};
var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
var attr;
var value;
var lcName;
var l;
_executeHook('beforeSanitizeAttributes', currentNode, null);
var attributes = currentNode.attributes;
if (!attributes) {
return;
}
var hookEvent = {
attrName: '',
attrValue: '',
keepAttr: true,
allowedAttributes: ALLOWED_ATTR
};
l = attributes.length;
while (l--) {
attr = attributes[l];
var _attr = attr, name = _attr.name, namespaceURI = _attr.namespaceURI;
value = name === 'value' ? attr.value : stringTrim(attr.value);
lcName = transformCaseFunc(name);
hookEvent.attrName = lcName;
hookEvent.attrValue = value;
hookEvent.keepAttr = true;
hookEvent.forceKeepAttr = undefined;
_executeHook('uponSanitizeAttribute', currentNode, hookEvent);
value = hookEvent.attrValue;
if (hookEvent.forceKeepAttr) {
continue;
}
_removeAttribute(name, currentNode);
if (!hookEvent.keepAttr) {
continue;
}
if (regExpTest(/\/>/i, value)) {
_removeAttribute(name, currentNode);
continue;
}
if (SAFE_FOR_TEMPLATES) {
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
value = stringReplace(value, ERB_EXPR$1, ' ');
}
var lcTag = transformCaseFunc(currentNode.nodeName);
if (!_isValidAttribute(lcTag, lcName, value)) {
continue;
}
try {
if (namespaceURI) {
currentNode.setAttributeNS(namespaceURI, name, value);
} else {
currentNode.setAttribute(name, value);
}
arrayPop(DOMPurify.removed);
} catch (_) {
}
}
_executeHook('afterSanitizeAttributes', currentNode, null);
};
var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
var shadowNode;
var shadowIterator = _createIterator(fragment);
_executeHook('beforeSanitizeShadowDOM', fragment, null);
while (shadowNode = shadowIterator.nextNode()) {
_executeHook('uponSanitizeShadowNode', shadowNode, null);
if (_sanitizeElements(shadowNode)) {
continue;
}
if (shadowNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM(shadowNode.content);
}
_sanitizeAttributes(shadowNode);
}
_executeHook('afterSanitizeShadowDOM', fragment, null);
};
DOMPurify.sanitize = function (dirty, cfg) {
var body;
var importedNode;
var currentNode;
var oldNode;
var returnNode;
IS_EMPTY_INPUT = !dirty;
if (IS_EMPTY_INPUT) {
dirty = '<!-->';
}
if (typeof dirty !== 'string' && !_isNode(dirty)) {
if (typeof dirty.toString !== 'function') {
throw typeErrorCreate('toString is not a function');
} else {
dirty = dirty.toString();
if (typeof dirty !== 'string') {
throw typeErrorCreate('dirty is not a string, aborting');
}
}
}
if (!DOMPurify.isSupported) {
if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
if (typeof dirty === 'string') {
return window.toStaticHTML(dirty);
}
if (_isNode(dirty)) {
return window.toStaticHTML(dirty.outerHTML);
}
}
return dirty;
}
if (!SET_CONFIG) {
_parseConfig(cfg);
}
DOMPurify.removed = [];
if (typeof dirty === 'string') {
IN_PLACE = false;
}
if (IN_PLACE) {
if (dirty.nodeName) {
var tagName = transformCaseFunc(dirty.nodeName);
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
}
}
} else if (dirty instanceof Node) {
body = _initDocument('<!---->');
importedNode = body.ownerDocument.importNode(dirty, true);
if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
body = importedNode;
} else if (importedNode.nodeName === 'HTML') {
body = importedNode;
} else {
body.appendChild(importedNode);
}
} else {
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf('<') === -1) {
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
}
body = _initDocument(dirty);
if (!body) {
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
}
}
if (body && FORCE_BODY) {
_forceRemove(body.firstChild);
}
var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
while (currentNode = nodeIterator.nextNode()) {
if (currentNode.nodeType === 3 && currentNode === oldNode) {
continue;
}
if (_sanitizeElements(currentNode)) {
continue;
}
if (currentNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM(currentNode.content);
}
_sanitizeAttributes(currentNode);
oldNode = currentNode;
}
oldNode = null;
if (IN_PLACE) {
return dirty;
}
if (RETURN_DOM) {
if (RETURN_DOM_FRAGMENT) {
returnNode = createDocumentFragment.call(body.ownerDocument);
while (body.firstChild) {
returnNode.appendChild(body.firstChild);
}
} else {
returnNode = body;
}
if (ALLOWED_ATTR.shadowroot) {
returnNode = importNode.call(originalDocument, returnNode, true);
}
return returnNode;
}
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
}
if (SAFE_FOR_TEMPLATES) {
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$1, ' ');
serializedHTML = stringReplace(serializedHTML, ERB_EXPR$1, ' ');
}
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
};
DOMPurify.setConfig = function (cfg) {
_parseConfig(cfg);
SET_CONFIG = true;
};
DOMPurify.clearConfig = function () {
CONFIG = null;
SET_CONFIG = false;
};
DOMPurify.isValidAttribute = function (tag, attr, value) {
if (!CONFIG) {
_parseConfig({});
}
var lcTag = transformCaseFunc(tag);
var lcName = transformCaseFunc(attr);
return _isValidAttribute(lcTag, lcName, value);
};
DOMPurify.addHook = function (entryPoint, hookFunction) {
if (typeof hookFunction !== 'function') {
return;
}
hooks[entryPoint] = hooks[entryPoint] || [];
arrayPush(hooks[entryPoint], hookFunction);
};
DOMPurify.removeHook = function (entryPoint) {
if (hooks[entryPoint]) {
return arrayPop(hooks[entryPoint]);
}
};
DOMPurify.removeHooks = function (entryPoint) {
if (hooks[entryPoint]) {
hooks[entryPoint] = [];
}
};
DOMPurify.removeAllHooks = function () {
hooks = {};
};
return DOMPurify;
}
var purify = createDOMPurify();
 
var sanitizeHtmlString = function (html) {
return purify().sanitize(html);
};
 
var isTouch = global$9.deviceType.isTouch();
var hiddenHeader = function (title, close) {
return {
31364,7 → 32927,7
tag: 'div',
classes: ['tox-dialog__body-content']
},
components: [{ dom: fromHtml('<p>' + providersBackstage.translate(message) + '</p>') }]
components: [{ dom: fromHtml('<p>' + sanitizeHtmlString(providersBackstage.translate(message)) + '</p>') }]
}]
});
};
31486,7 → 33049,7
};
var renderTitle = function (spec, id, providersBackstage) {
var renderComponents = function (data) {
return [text(providersBackstage.translate(data.title))];
return [text$1(providersBackstage.translate(data.title))];
};
return {
dom: {
/trunk/vendor/tinymce/tinymce/themes/silver/theme.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function t(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}}function n(n){return function(t){return typeof t===n}}function e(n){return function(t){return n===t}}function g(t){return null==t}function f(t,n){if(c(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return;return 1}}function st(){}function r(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}}function rt(t){return function(){return t}}function h(t){return t}function v(t,n){return t===n}var y=t("string"),x=t("object"),c=t("array"),b=e(null),w=n("boolean"),E=e(void 0),k=function(t){return!g(t)},S=n("function"),u=n("number");function C(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}function O(n){return function(t){return!n(t)}}function _(t){return function(){throw new Error(t)}}var T=rt(!1),D=rt(!0),o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),lt=function(){return(lt=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function B(t,n){var e={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]]);return e}function H(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||((o=o||Array.prototype.slice.call(n,0,r))[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))}function i(){return a}var a={fold:function(t,n){return t()},isSome:T,isNone:D,getOr:h,getOrThunk:s,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:rt(null),getOrUndefined:rt(void 0),or:h,orThunk:s,map:i,each:st,bind:i,exists:T,forall:D,filter:function(){return a},toArray:function(){return[]},toString:rt("none()")};function s(t){return t()}function l(t,n){return yt.call(t,n)}function d(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return!0;return!1}function m(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e}function p(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=bt.call(t,o,o+n);e.push(r)}return e}function M(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o}function A(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}}function F(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e}function I(t,o,r){return function(t){for(var n,e=t.length-1;0<=e;e--)n=t[e],r=o(r,n,e)}(t),r}function R(t,e,o){return St(t,function(t,n){o=e(o,t,n)}),o}function V(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return vt.some(i);if(e(i,o))break}return vt.none()}(t,n,T)}function P(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return vt.some(e);return vt.none()}function ft(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!c(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);xt.apply(n,t[e])}return n}function z(t,n){return ft(M(t,n))}function N(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e))return!1;return!0}function L(t){var n=bt.call(t,0);return n.reverse(),n}function W(t,n){return F(t,function(t){return!wt(n,t)})}function U(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e}function j(t){return[t]}function G(t,n){var e=bt.call(t,0);return e.sort(n),e}function X(t,n){return 0<=n&&n<t.length?vt.some(t[n]):vt.none()}function Y(t){return X(t,0)}function q(t){return X(t,t.length-1)}function K(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return vt.none()}function J(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}}function dt(t,e){return _t(t,function(t,n){return{k:n,v:e(t,n)}})}function $(t,e){var o=[];return J(t,function(t,n){o.push(e(t,n))}),o}function Q(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return vt.some(u)}return vt.none()}function Z(t){return $(t,h)}function tt(t,n){return Tt(t,n)?vt.from(t[n]):vt.none()}function nt(t,n){return Tt(t,n)&&void 0!==t[n]&&null!==t[n]}function mt(t,n,e){return void 0===e&&(e=v),t.exists(function(t){return e(t,n)})}function et(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n}function ot(t,n){return t?vt.some(n):vt.none()}function it(t,n,e){return""===n||t.length>=n.length&&t.substr(e,e+n.length)===n}function ut(t,n){return-1!==t.indexOf(n)}function at(t){return 0<t.length}function ct(t){return void 0!==t.style&&S(t.style.getPropertyValue)}function gt(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var pt,ht=function(e){function t(){return r}function n(t){return t(e)}var o=rt(e),r={fold:function(t,n){return n(e)},isSome:D,isNone:T,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return ht(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?r:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},vt={some:ht,none:i,from:function(t){return null==t?a:ht(t)}},bt=Array.prototype.slice,yt=Array.prototype.indexOf,xt=Array.prototype.push,wt=function(t,n){return-1<l(t,n)},St=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e)},kt=S(Array.from)?Array.from:function(t){return bt.call(t)},Ct=Object.keys,Ot=Object.hasOwnProperty,_t=function(t,o){var r={};return J(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},Tt=function(t,n){return Ot.call(t,n)},Et=function(t,n,e){return t.isSome()&&n.isSome()?vt.some(e(t.getOrDie(),n.getOrDie())):vt.none()},Dt=function(t,n){return it(t,n,0)},Bt=function(t,n){return it(t,n,t.length-n.length)},Mt=(pt=/^\s+|\s+$/g,function(t){return t.replace(pt,"")}),At={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return gt(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return gt(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return gt(e)},fromDom:gt,fromPoint:function(t,n,e){return vt.from(t.dom.elementFromPoint(n,e)).map(gt)}};function Ft(t){return t.dom.nodeName.toLowerCase()}function It(n){return function(t){return t.dom.nodeType===n}}function Rt(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}}function Vt(t,n){var e=String(n).toLowerCase();return V(t,function(t){return t.search(e)})}function Pt(n){return function(t){return ut(t,n)}}function Ht(t){return window.matchMedia(t).matches}function zt(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(void 0!==o.matches)return o.matches(n);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(n);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(n);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function Nt(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount}function Lt(t,n){return t.dom===n.dom}function Wt(t,n){return le().browser.isIE()?(e=t.dom,o=n.dom,r=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(e.compareDocumentPosition(o)&r)):(i=t.dom)!==(u=n.dom)&&i.contains(u);var e,o,r,i,u}function Ut(t){return At.fromDom(t.dom.ownerDocument)}function jt(t){return qn(t)?t:Ut(t)}function Gt(t){return At.fromDom(jt(t).dom.documentElement)}function Xt(t){return At.fromDom(jt(t).dom.defaultView)}function Yt(t){return vt.from(t.dom.parentNode).map(At.fromDom)}function qt(t){return vt.from(t.dom.offsetParent).map(At.fromDom)}function Kt(t){return M(t.dom.childNodes,At.fromDom)}function Jt(t,n){var e=t.dom.childNodes;return vt.from(e[n]).map(At.fromDom)}function $t(t,n){return{element:t,offset:n}}function Qt(t,n){var e=Kt(t);return 0<e.length&&n<e.length?$t(e[n],0):$t(t,n)}function Zt(t){return Kn(t)&&k(t.dom.host)}function tn(t){return Zt(t)?t:At.fromDom(jt(t).dom.body)}function nn(t){return At.fromDom(t.dom.host)}function en(t,n,e){if(!(y(e)||w(e)||u(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")}function on(t,n,e){en(t.dom,n,e)}function rn(t,n){var e=t.dom;J(n,function(t,n){en(e,n,t)})}function un(t,n){var e=t.dom.getAttribute(n);return null===e?void 0:e}function an(t,n){return vt.from(un(t,n))}function cn(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)}function sn(t,n){t.dom.removeAttribute(n)}function ln(t,n,e){if(!y(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);ct(t)&&t.style.setProperty(n,e)}function fn(t,n){ct(t)&&t.style.removeProperty(n)}function dn(t,n,e){ln(t.dom,n,e)}function mn(t,n){var e=t.dom;J(n,function(t,n){ln(e,n,t)})}function gn(t,n){var e=t.dom;J(n,function(t,n){t.fold(function(){fn(e,n)},function(t){ln(e,n,t)})})}function pn(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||ve(t)?o:xe(e,n)}function hn(t,n){var e=t.dom,o=xe(e,n);return vt.from(o).filter(function(t){return 0<t.length})}function vn(t,n,e){var o=At.fromTag(t);return dn(o,n,e),hn(o,n).isSome()}function bn(t,n){fn(t.dom,n),mt(an(t,"style").map(Mt),"")&&sn(t,"style")}function yn(t){return t.dom.offsetWidth}function xn(o,r){function t(t){var n=r(t);if(n<=0||null===n){var e=pn(t,o);return parseFloat(e)||0}return n}function i(r,t){return R(t,function(t,n){var e=pn(r,n),o=void 0===e?0:parseInt(e,10);return isNaN(o)?t:t+o},0)}return{set:function(t,n){if(!u(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom;ct(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}function wn(t){return we.get(t)}function Sn(t){return we.getOuter(t)}function kn(t,n){return void 0!==t?t:void 0!==n?n:0}function Cn(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return ke(e.offsetLeft,e.offsetTop);var i=kn(null==o?void 0:o.pageYOffset,r.scrollTop),u=kn(null==o?void 0:o.pageXOffset,r.scrollLeft),a=kn(r.clientTop,e.clientTop),c=kn(r.clientLeft,e.clientLeft);return Ce(t).translate(u-c,i-a)}function On(t){return Oe.get(t)}function _n(t){return Oe.getOuter(t)}function Tn(t){function n(){return t.stopPropagation()}function e(){return t.preventDefault()}var o=r(e,n);return{target:At.fromDom(function(t){if(me()&&k(t.target)){var n=At.fromDom(t.target);if(Xn(n)&&he(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return Y(e)}}return vt.from(t.target)}(t).getOr(t.target)),x:t.clientX,y:t.clientY,stop:n,prevent:e,kill:o,raw:t}}function En(t,n,e,o,r){var i,u,a=(i=e,u=o,function(t){i(t)&&u(Tn(t))});return t.dom.addEventListener(n,a,r),{unbind:C(_e,t,n,a,r)}}function Dn(n,e){Yt(n).each(function(t){t.dom.insertBefore(e.dom,n.dom)})}function Bn(t,n){vt.from(t.dom.nextSibling).map(At.fromDom).fold(function(){Yt(t).each(function(t){Te(t,n)})},function(t){Dn(t,n)})}function Mn(n,e){Jt(n,0).fold(function(){Te(n,e)},function(t){n.dom.insertBefore(e.dom,t.dom)})}function An(n,t){St(t,function(t){Te(n,t)})}function Fn(t){t.dom.textContent="",St(Kt(t),function(t){Ee(t)})}function In(t){var n,e=Kt(t);0<e.length&&(n=t,St(e,function(t){Dn(n,t)})),Ee(t)}function Rn(t){var n=void 0!==t?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return ke(e,o)}function Vn(t,n,e){var o=(void 0!==e?e.dom:document).defaultView;o&&o.scrollTo(t,n)}function Pn(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}}function Hn(t){var o=void 0===t?window:t,n=o.document,r=Rn(At.fromDom(n)),e=void 0===o?window:o;return(le().browser.isFirefox()?vt.none():vt.from(e.visualViewport)).fold(function(){var t=o.document.documentElement,n=t.clientWidth,e=t.clientHeight;return Pn(r.left,r.top,n,e)},function(t){return Pn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})}function zn(o){var t,r=Rn(At.fromDom(document)),n=(t=Be).owner(o),e=De(t,n);return vt.some(e).fold(C(Cn,o),function(t){var n=Ce(o),e=I(t,function(t,n){var e=Ce(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return ke(e.left+n.left+r.left,e.top+n.top+r.top)})}function Nn(t){var n=zn(t),e=_n(t),o=Sn(t);return Me(n.left,n.top,e,o)}"undefined"!=typeof window||Function("return this;")();function Ln(){return Jn(0,0)}function Wn(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(te),isSafari:n("Safari")}}function Un(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isWindows:n(oe),isiOS:n("iOS"),isAndroid:n(re),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(ie),isFreeBSD:n(ue),isChromeOS:n(ae)}}var jn,Gn,Xn=It(1),Yn=It(3),qn=It(9),Kn=It(11),Jn=function(t,n){return{major:t,minor:n}},$n={nu:Jn,detect:function(t,n){var e,o,r=String(n).toLowerCase();return 0===t.length?Ln():(o=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}}(t,e=r))?Jn(i(1),i(2)):{major:0,minor:0};function i(t){return Number(e.replace(o,"$"+t))}},unknown:Ln},Qn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Zn={browsers:rt([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ut(t,"edge/")&&ut(t,"chrome")&&ut(t,"safari")&&ut(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qn],search:function(t){return ut(t,"chrome")&&!ut(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ut(t,"msie")||ut(t,"trident")}},{name:"Opera",versionRegexes:[Qn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Pt("firefox")},{name:"Safari",versionRegexes:[Qn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ut(t,"safari")||ut(t,"mobile/"))&&ut(t,"applewebkit")}}]),oses:rt([{name:"Windows",search:Pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ut(t,"iphone")||ut(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Pt("linux"),versionRegexes:[]},{name:"Solaris",search:Pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},te="Firefox",ne=function(){return Wn({current:void 0,version:$n.unknown()})},ee=Wn,oe=(rt("Edge"),rt("Chrome"),rt("IE"),rt("Opera"),rt(te),rt("Safari"),"Windows"),re="Android",ie="Solaris",ue="FreeBSD",ae="ChromeOS",ce=function(){return Un({current:void 0,version:$n.unknown()})},se=Un,le=(rt(oe),rt("iOS"),rt(re),rt("Linux"),rt("OSX"),rt(ie),rt(ue),rt(ae),Rt(function(){return t=navigator.userAgent,n=vt.from(navigator.userAgentData),e=Ht,p=Zn.browsers(),h=Zn.oses(),v=n.bind(function(t){return o=p,K(t.brands,function(n){var e=n.brand.toLowerCase();return V(o,function(t){var n;return e===(null===(n=t.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(t){return{current:t.name,version:$n.nu(parseInt(n.version,10),0)}})});var o}).orThunk(function(){return Vt(p,e=t).map(function(t){var n=$n.detect(t.versionRegexes,e);return{current:t.name,version:n}});var e}).fold(ne,ee),b=Vt(h,o=t).map(function(t){var n=$n.detect(t.versionRegexes,o);return{current:t.name,version:n}}).fold(ce,se),{browser:v,os:b,deviceType:(i=v,u=t,a=e,c=(r=b).isiOS()&&!0===/ipad/i.test(u),s=r.isiOS()&&!c,f=(l=r.isiOS()||r.isAndroid())||a("(pointer:coarse)"),d=c||!s&&l&&a("(min-device-width:768px)"),m=s||l&&!d,g=i.isSafari()&&r.isiOS()&&!1===/safari/i.test(u),{isiPad:rt(c),isiPhone:rt(s),isTablet:rt(d),isPhone:rt(m),isTouch:rt(f),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:rt(g),isDesktop:rt(!m&&!d&&!g)})};var t,n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b})),fe=Yt,de=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),me=rt(de),ge=de?function(t){return At.fromDom(t.dom.getRootNode())}:jt,pe=function(t){var n=ge(t);return Zt(n)?vt.some(n):vt.none()},he=function(t){return k(t.dom.shadowRoot)},ve=function(t){var n=Yn(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return pe(At.fromDom(n)).fold(function(){return r.body.contains(n)},(e=ve,o=nn,function(t){return e(o(t))}))},be=function(){return ye(At.fromDom(document))},ye=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return At.fromDom(n)},xe=function(t,n){return ct(t)?t.style.getPropertyValue(n):""},we=xn("height",function(t){var n=t.dom;return ve(t)?n.getBoundingClientRect().height:n.offsetHeight}),Se=function(e,o){return{left:e,top:o,translate:function(t,n){return Se(e+t,o+n)}}},ke=Se,Ce=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?ke(o.offsetLeft,o.offsetTop):ve(t)?(n=e.getBoundingClientRect(),ke(n.left,n.top)):ke(0,0)},Oe=xn("width",function(t){return t.dom.offsetWidth}),_e=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Te=function(t,n){t.dom.appendChild(n.dom)},Ee=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},De=function(o,t){return o.view(t).fold(rt([]),function(t){var n=o.owner(t),e=De(o,n);return[t].concat(e)})},Be=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?vt.none():vt.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(At.fromDom)},owner:Ut}),Me=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},Ae=function(t){var n=Cn(t),e=_n(t),o=Sn(t);return Me(n.left,n.top,e,o)},Fe=function(){return Hn(window)},Ie=function(e){return{isValue:D,isError:T,getOr:rt(e),getOrThunk:rt(e),getOrDie:rt(e),or:function(t){return Ie(e)},orThunk:function(t){return Ie(e)},fold:function(t,n){return n(e)},map:function(t){return Ie(t(e))},mapError:function(t){return Ie(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return vt.some(e)}}},Re=function(e){return{isValue:T,isError:D,getOr:h,getOrThunk:function(t){return t()},getOrDie:function(){return _(String(e))()},or:h,orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Re(e)},mapError:function(t){return Re(t(e))},each:st,bind:function(t){return Re(e)},exists:T,forall:D,toOptional:vt.none}},Ve={value:Ie,error:Re,fromOption:function(t,n){return t.fold(function(){return Re(n)},Ie)}};function Pe(t,n,e){return t.stype===jn.Error?n(t.serror):e(t.svalue)}function He(t){return{stype:jn.Value,svalue:t}}function ze(t){return{stype:jn.Error,serror:t}}function Ne(t,n,e,o){return{tag:"field",key:t,newKey:n,presence:e,prop:o}}function Le(t,n,e){switch(t.tag){case"field":return n(t.key,t.newKey,t.presence,t.prop);case"custom":return e(t.newKey,t.instantiator)}}function We(u){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)Tt(i,r)&&(e[r]=u(e[r],i[r]))}return e}}function Ue(){return{tag:"required",process:{}}}function je(t){return{tag:"defaultedThunk",process:t}}function Ge(t){return je(rt(t))}function Xe(){return{tag:"option",process:{}}}function Ye(t){return{tag:"mergeWithThunk",process:t}}function qe(t){return x(t)&&100<Ct(t).length?" removed due to size":JSON.stringify(t,null,2)}function Ke(t,n){return Lo([{path:t,getErrorInfo:n}])}function Je(e){return{extract:function(n,t){return Uo(e(t),function(t){return Ke(n,rt(t))})},toString:rt("val")}}function $e(t,n,e,o){return o(tt(t,n).getOrThunk(function(){return e(t)}))}function Qe(n,e,o,r,i){function u(t){return i.extract(e.concat([r]),t)}function t(t){return t.fold(function(){return No(vt.none())},function(t){var n=i.extract(e.concat([r]),t);return jo(n,vt.some)})}var a,c,s,l,f,d;switch(n.tag){case"required":return s=e,d=u,tt(l=o,f=r).fold(function(){return t=f,n=l,Ke(s,function(){return'Could not find valid *required* value for "'+t+'" in '+qe(n)});var t,n},d);case"defaultedThunk":return $e(o,r,n.process,u);case"option":return t(tt(o,r));case"defaultedOptionThunk":return c=n.process,t(tt(a=o,r).map(function(t){return!0===t?c(a):t}));case"mergeWithThunk":return $e(o,r,rt({}),function(t){return u(Yo(n.process(o),t))})}}function Ze(e){return{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}}}function to(t){var s=$o(t),l=I(t,function(e,t){return Le(t,function(t){var n;return Yo(e,((n={})[t]=!0,n))},rt(e))},{});return{extract:function(t,n){var e,o,r,i,u,a,c=F(w(n)?[]:Ct((r=k,i=o={},u=function(t,n){i[n]=t},a=st,J(n,function(t,n){(r(t,n)?u:a)(t,n)}),o)),function(t){return!nt(l,t)});return 0===c.length?s.extract(t,n):(e=c,Ke(t,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},toString:s.toString}}function no(o){return{extract:function(e,t){var n=M(t,function(t,n){return o.extract(e.concat(["["+n+"]"]),t)});return Ko(n)},toString:function(){return"array("+o.toString()+")"}}}function eo(u){return{extract:function(t,n){for(var e=[],o=0,r=u;o<r.length;o++){var i=r[o].extract(t,n);if(i.stype===jn.Value)return i;e.push(i)}return Ko(e)},toString:function(){return"oneOf("+M(u,function(t){return t.toString()}).join(", ")+")"}}}function oo(e,o){return Je(function(t){var n=typeof t;return e(t)?No(t):Lo("Expected type: "+o+" but got: "+n)})}function ro(n,a){return{extract:function(i,u){return tt(u,n).fold(function(){return t=n,Ke(i,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return e=i,n=u,tt(o=a,r=t).fold(function(){return t=o,n=r,Ke(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qe(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+r]),n)});var e,n,o,r})},toString:function(){return"chooseOn("+n+"). Possible values: "+Ct(a)}}}function io(n){return Je(function(t){return n(t).fold(Lo,No)})}function uo(n,t){return r=function(t){return n(t).fold(ze,He)},i=t,{extract:function(e,o){var t=Ct(o),n=no(Je(r)).extract(e,t);return Wo(n,function(t){var n=M(t,function(t){return Ne(t,t,Ue(),i)});return $o(n).extract(e,o)})},toString:function(){return"setOf("+i.toString()+")"}};var r,i}function ao(t,n,e){return zo((r=n.extract([t],o=e),Go(r,function(t){return{input:o,errors:t}})));var o,r}function co(t){return t.fold(function(t){throw new Error(ur(t))},h)}function so(t,n,e){return co(ao(t,n,e))}function lo(t,n){return ro(t,dt(n,$o))}function fo(n){return io(function(t){return wt(n,t)?Ve.value(t):Ve.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})}function mo(t){return ar(t,t,Ue(),Zo())}function go(t,n){return ar(t,t,Ue(),n)}function po(t){return go(t,nr)}function ho(t,n){return ar(t,t,Ue(),fo(n))}function vo(t){return go(t,or)}function bo(t,n){return ar(t,t,Ue(),$o(n))}function yo(t,n){return ar(t,t,Ue(),Qo(n))}function xo(t,n){return ar(t,t,Ue(),no(n))}function wo(t){return ar(t,t,Xe(),Zo())}function So(t,n){return ar(t,t,Xe(),n)}function ko(t){return So(t,tr)}function Co(t){return So(t,nr)}function Oo(t){return So(t,or)}function _o(t,n){return So(t,no(n))}function To(t,n){return So(t,$o(n))}function Eo(t,n){return ar(t,t,Ge(n),Zo())}function Do(t,n,e){return ar(t,t,Ge(n),e)}function Bo(t,n){return Do(t,n,tr)}function Mo(t,n){return Do(t,n,nr)}function Ao(t,n,e){return Do(t,n,fo(e))}function Fo(t,n){return Do(t,n,er)}function Io(t,n){return Do(t,n,or)}function Ro(t,n,e){return Do(t,n,no(e))}function Vo(t,n,e){return Do(t,n,$o(e))}function Po(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}(Gn=jn={})[Gn.Error=0]="Error",Gn[Gn.Value=1]="Value";function Ho(u){if(!c(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return St(u,function(t,o){var n=Ct(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(void 0!==e[r])throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!c(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);return{fold:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+t.length);return t[o].apply(null,e)},match:function(t){var n=Ct(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!N(a,function(t){return wt(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e}var zo=function(t){return Pe(t,Ve.error,Ve.value)},No=He,Lo=ze,Wo=function(t,n){return t.stype===jn.Value?n(t.svalue):t},Uo=function(t,n){return t.stype===jn.Error?n(t.serror):t},jo=function(t,n){return t.stype===jn.Value?{stype:jn.Value,svalue:n(t.svalue)}:t},Go=function(t,n){return t.stype===jn.Error?{stype:jn.Error,serror:n(t.serror)}:t},Xo=Pe,Yo=We(function(t,n){return x(t)&&x(n)?Yo(t,n):n}),qo=We(function(t,n){return n}),Ko=function(t){var n,e,o=(n=[],e=[],St(t,function(t){Pe(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e});return 0<o.errors.length?r(Lo,ft)(o.errors):No(o.values)},Jo=Je(No),$o=function(e){return{extract:function(i,u){for(var a={},c=[],t=0,n=e;t<n.length;t++)Le(n[t],function(t,n,e,o){var r=Qe(e,i,u,t,o);Xo(r,function(t){c.push.apply(c,t)},function(t){a[n]=t})},function(t,n){a[t]=n(u)});return 0<c.length?Lo(c):No(a)},toString:function(){return"obj{\n"+M(e,function(t){return Le(t,function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},Qo=r(no,$o),Zo=rt(Jo),tr=oo(u,"number"),nr=oo(y,"string"),er=oo(w,"boolean"),or=oo(S,"function"),rr=function(n){if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return rr(n[t])});default:return!1}},ir=Je(function(t){return rr(t)?No(t):Lo("Expected value to be acceptable for sending via postMessage")}),ur=function(t){return"Errors: \n"+M(10<(n=t.errors).length?n.slice(0,10).concat([{path:[],getErrorInfo:rt("... (only showing first ten failures)")}]):n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n")+"\n\nInput object: "+qe(t.input);var n},ar=Ne,cr=function(t,n){return{tag:"custom",newKey:t,instantiator:n}};function sr(t,n){return(e={})[t]=n,e;var e}function lr(t){return n={},St(t,function(t){n[t.key]=t.value}),n;var n}function fr(t){return S(t)?t:T}function dr(t,n,e){for(var o=t.dom,r=fr(e);o.parentNode;){var o=o.parentNode,i=At.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return vt.none()}function mr(t,n,e){var o=n(t),r=fr(e);return o.orThunk(function(){return r(t)?vt.none():dr(t,n,r)})}function gr(t,n){return Lt(t.element,n.event.target)}function pr(t){if(!nt(t,"can")&&!nt(t,"abort")&&!nt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return lt(lt({},ai),t)}function hr(t){return rt("alloy."+t)}function vr(t,n){nu(t,t.element,n,{})}function br(t,n,e){nu(t,t.element,n,e)}function yr(t){vr(t,Ii())}function xr(t,n,e){nu(t,n,e,{})}function wr(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)}function Sr(t,n){return{key:t,value:pr({abort:n})}}function kr(t){return{key:t,value:pr({run:function(t,n){n.event.prevent()}})}}function Cr(t,n){return{key:t,value:pr({run:n})}}function Or(t,e,o){return{key:t,value:pr({run:function(t,n){e.apply(void 0,[t,n].concat(o))}})}}function _r(t){return function(e){return{key:t,value:pr({run:function(t,n){gr(t,n)&&e(t,n)}})}}}function Tr(t,n,e){var o,r=n.partUids[e];return Cr(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){wr(t,t.element,o,n)})})}function Er(t,r){return Cr(t,function(n,t){var e=t.event,o=n.getSystem().getByDom(e.target).getOrThunk(function(){return mr(e.target,function(t){return n.getSystem().getByDom(t).toOptional()},T).getOr(n)});r(n,o,t)})}function Dr(t){return Cr(t,function(t,n){n.cut()})}function Br(t,n){return _r(t)(n)}function Mr(t){return t.dom.innerHTML}function Ar(t,n){var e,o,r=Ut(t).dom,i=At.fromDom(r.createDocumentFragment());An(i,(e=n,(o=(r||document).createElement("div")).innerHTML=e,Kt(At.fromDom(o)))),Fn(t),Te(t,i)}function Fr(t){if(Zt(t))return"#shadow-root";var n=At.fromDom(t.dom.cloneNode(!1)),e=At.fromTag("div"),o=At.fromDom(n.dom.cloneNode(!0));return Te(e,o),Mr(e)}function Ir(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++su+String(n)}function Rr(t){var n=Xn(t)?t.dom[mu]:null;return vt.from(n)}function Vr(n){function e(t){return"The component must be in a context to execute: "+t+(n?"\n"+Fr(n().element)+" is not in context.":"")}function t(t){return function(){throw new Error(e(t))}}function o(t){return function(){console.warn(e(t))}}return{debugInfo:rt("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),isConnected:T}}function Pr(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:bu(i)}},t}function Hr(t){return sr(yu,t)}function zr(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(void 0,H([t.getApis(),t],n,!1))},e=(n=o.toString()).indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:bu(i.slice(1))}},t;var t,n,e,r,i}function Nr(t,r){var i={};return J(t,function(t,o){J(t,function(t,n){var e=tt(i,n).getOr([]);i[n]=e.concat([r(o,t)])})}),i}function Lr(t){return{classes:E(t.classes)?[]:t.classes,attributes:E(t.attributes)?{}:t.attributes,styles:E(t.styles)?{}:t.styles}}function Wr(t){return t.cHandler}function Ur(t,n){return{name:t,handler:n}}function jr(t,n,e){var o=n[e];return o?function(u,t,a){try{var n=G(t,function(t,n){var e=t.name,o=n.name,r=a.indexOf(e),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r<i?-1:i<r?1:0});return Ve.value(n)}catch(t){return Ve.error([t])}}("Event: "+e,t,o).map(function(t){var e,n,o,r,i=M(t,function(t){return t.handler});return{can:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(n,function(t,n){return t&&n.can.apply(void 0,e)},!0)},abort:(o=n=e=i,r=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(o,function(t,n){return t||r(n).apply(void 0,e)},!1)}),run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];St(e,function(t){t.run.apply(void 0,n)})}}}):Ve.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(M(t,function(t){return t.name}),null,2)])}function Gr(t,n){var e=un(t,n);return void 0===e||""===e?[]:e.split(" ")}function Xr(t){return void 0!==t.dom.classList}function Yr(t,n){var e,o,r;Xr(t)?t.dom.classList.add(n):(o=n,r=Gr(e=t,"class").concat([o]),on(e,"class",r.join(" ")))}function qr(t,n){var e,o,r,i;Xr(t)?t.dom.classList.remove(n):(r=n,0<(i=F(Gr(o=t,"class"),function(t){return t!==r})).length?on(o,"class",i.join(" ")):sn(o,"class")),0===(Xr(e=t)?e.dom.classList:Gr(e,"class")).length&&sn(e,"class")}function Kr(t,n){return Xr(t)&&t.dom.classList.contains(n)}function Jr(n,t){St(t,function(t){Yr(n,t)})}function $r(n,t){St(t,function(t){qr(n,t)})}function Qr(t){return t.dom.value}function Zr(t,n){if(void 0===n)throw new Error("Value.set was undefined");t.dom.value=n}function ti(t){var e,n,o,r,i=(e=tt(t,"behaviours").getOr({}),z(Ct(e),function(t){var n=e[t];return k(n)?[n.me]:[]}));return n=t,r=M(o=i,function(t){return To(t.name(),[mo("config"),Eo("state",xu)])}),{list:o,data:dt(ao("component.behaviours",$o(r),n.behaviours).fold(function(t){throw new Error(ur(t)+"\nComplete spec:\n"+JSON.stringify(n,null,2))},h),function(t){return rt(t.map(function(t){return{config:t.config,state:t.state.init(t.config)}}))})}}function ni(t,n,e){var o,r,i=lt(lt({},(o=t).dom),{uid:o.uid,domChildren:M(o.components,function(t){return t.element})}),u=t.domModification.fold(function(){return Lr({})},Lr),a=0<n.length?function(n,t,e,o){var r=lt({},t);function i(t){return I(t,function(t,n){return lt(lt({},n.modification),t)},{})}St(e,function(t){r[t.name()]=t.exhibit(n,o)});var u=Nr(r,function(t,n){return{name:t,modification:n}});return Lr({classes:I(u.classes,function(t,n){return n.modification.concat(t)},[]),attributes:i(u.attributes),styles:i(u.styles)})}(e,{"alloy.base.modification":u},n,i):u;return lt(lt({},r=i),{attributes:lt(lt({},r.attributes),a.attributes),styles:lt(lt({},r.styles),a.styles),classes:r.classes.concat(a.classes)})}function ei(t,n,e){var o,r,i,u,a,c={"alloy.base.behaviour":t.events},s=t.eventOrder;return r=e,i=n,o=Nr(lt(lt({},c),(u=r,a={},St(i,function(t){a[t.name()]=t.handlers(u)}),a)),Ur),Su(o,s).getOrDie()}function oi(t){var e,n,o,r,i,u,a,c,s,l,f=hu(t),d=f.events,m=B(f,["events"]),g=M(tt(m,"components").getOr([]),Tu),p=lt(lt({},m),{events:lt(lt({},cu),d),components:g});return Ve.value((n=Po(vu),o=co(ao("custom.definition",Cu,e=p)),r=ti(e),i=r.list,u=r.data,a=function(t){var n=At.fromTag(t.tag);rn(n,t.attributes),Jr(n,t.classes),mn(n,t.styles),t.innerHtml.each(function(t){return Ar(n,t)});var e=t.domChildren;return An(n,e),t.value.each(function(t){Zr(n,t)}),t.uid,gu(n,t.uid),n}(ni(o,i,u)),c=ei(o,i,u),s=Po(o.components),l={uid:e.uid,getSystem:n.get,config:function(t){var n=u;return(S(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(t){return S(u[t.name()])},spec:e,readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Vr(h))},element:a,syncComponents:function(){var t=z(Kt(a),function(t){return n.get().getByDom(t).fold(function(){return[]},j)});s.set(t)},components:s.get,events:c}));function h(){return l}}function ri(t){var n=At.fromText(t);return Ou({element:n})}Ho([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var ii,ui,ai={can:D,abort:T,run:st},ci=rt,si=ci("touchstart"),li=ci("touchmove"),fi=ci("touchend"),di=ci("touchcancel"),mi=ci("mousedown"),gi=ci("mousemove"),pi=ci("mouseout"),hi=ci("mouseup"),vi=ci("mouseover"),bi=ci("focusin"),yi=ci("focusout"),xi=ci("keydown"),wi=ci("keyup"),Si=ci("input"),ki=ci("change"),Ci=ci("click"),Oi=ci("transitioncancel"),_i=ci("transitionend"),Ti=ci("transitionstart"),Ei=ci("selectstart"),Di={tap:hr("tap")},Bi=hr("focus"),Mi=hr("blur.post"),Ai=hr("paste.post"),Fi=hr("receive"),Ii=hr("execute"),Ri=hr("focus.item"),Vi=Di.tap,Pi=hr("longpress"),Hi=hr("sandbox.close"),zi=hr("typeahead.cancel"),Ni=hr("system.init"),Li=hr("system.touchmove"),Wi=hr("system.touchend"),Ui=hr("system.scroll"),ji=hr("system.resize"),Gi=hr("system.attached"),Xi=hr("system.detached"),Yi=hr("system.dismissRequested"),qi=hr("system.repositionRequested"),Ki=hr("focusmanager.shifted"),Ji=hr("slotcontainer.visibility"),$i=hr("change.tab"),Qi=hr("dismiss.tab"),Zi=hr("highlight"),tu=hr("dehighlight"),nu=function(t,n,e,o){var r=lt({target:n},o);t.getSystem().triggerEvent(e,n,r)},eu=lr,ou=_r(Gi()),ru=_r(Xi()),iu=_r(Ni()),uu=(ii=Ii(),function(t){return Cr(ii,t)}),au=eu([{key:Bi(),value:pr({can:function(t,n){var e,o=n.event,r=o.originator,i=o.target;return!(Lt(e=r,t.element)&&!Lt(e,i)&&(console.warn(Bi()+" did not get interpreted by the desired target. \nOriginator: "+Fr(r)+"\nTarget: "+Fr(i)+"\nCheck the "+Bi()+" event handlers"),1))}})}]),cu=Object.freeze({__proto__:null,events:au}),su=0,lu=rt("alloy-id-"),fu=rt("data-alloy-id"),du=lu(),mu=fu(),gu=function(t,n){Object.defineProperty(t.dom,mu,{value:n,writable:!0})},pu=Ir,hu=h,vu=Vr(),bu=function(t){return M(t,function(t){return Bt(t,"/*")?t.substring(0,t.length-"/*".length):t})},yu=Ir("alloy-premade"),xu={init:function(){return wu({readState:rt("No State required")})}},wu=function(t){return t},Su=function(t,a){var n,e,o,r,i,u,c=$(t,function(r,u){return(1===r.length?Ve.value(r[0].handler):jr(r,a,u)).map(function(t){var n,i,e=(i=S(n=t)?{can:D,abort:T,run:n}:n,function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(void 0,r)?n.stop():i.can.apply(void 0,r)&&i.run.apply(void 0,r)}),o=1<r.length?F(a[u],function(n){return d(r,function(t){return t.name===n})}).join(" > "):r[0].name;return sr(u,{handler:e,purpose:o})})});return n={},e=[],o=[],St(c,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),0<(u={errors:e,values:o}).errors.length?Ve.error(ft(u.errors)):(i=n,0===(r=u.values).length?Ve.value(i):Ve.value(Yo(i,qo.apply(void 0,r))))},ku="alloy.base.behaviour",Cu=$o([ar("dom","dom",Ue(),$o([mo("tag"),Eo("styles",{}),Eo("classes",[]),Eo("attributes",{}),wo("value"),wo("innerHtml")])),mo("components"),mo("uid"),Eo("events",{}),Eo("apis",{}),ar("eventOrder","eventOrder",((ui={})[Ii()]=["disabling",ku,"toggling","typeaheadevents"],ui[Bi()]=[ku,"focusing","keying"],ui[Ni()]=[ku,"disabling","toggling","representing"],ui[Si()]=[ku,"representing","streaming","invalidating"],ui[Xi()]=[ku,"representing","item-events","tooltipping"],ui[mi()]=["focusing",ku,"item-type-events"],ui[si()]=["focusing",ku,"item-type-events"],ui[vi()]=["item-type-events","tooltipping"],ui[Fi()]=["receiving","reflecting","tooltipping"],Ye(rt(ui))),Zo()),wo("domModification")]),Ou=function(t){var n=so("external.component",to([mo("element"),wo("uid")]),t),e=Po(Vr()),o=n.uid.getOrThunk(function(){return pu("external")});gu(n.element,o);var r={uid:o,getSystem:e.get,config:vt.none,hasConfigured:T,connect:function(t){e.set(t)},disconnect:function(){e.set(Vr(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:rt("No state"),syncComponents:st,components:rt([]),events:{}};return Hr(r)},_u=pu,Tu=function(t){return tt(t,yu).getOrThunk(function(){return oi(Tt(t,"uid")?t:lt({uid:_u("")},t)).getOrDie()})},Eu=Hr;function Du(t,n,e,o,r){return t(e,o)?vt.some(e):S(r)&&r(e)?vt.none():n(e,o,r)}function Bu(t,n,e){for(var o=t.dom,r=S(e)?e:T;o.parentNode;){var o=o.parentNode,i=At.fromDom(o);if(n(i))return vt.some(i);if(r(i))break}return vt.none()}function Mu(t,n,e){return Du(function(t,n){return n(t)},Bu,t,n,e)}function Au(t,n,e){return Mu(t,n,e).isSome()}function Fu(t,n,e){return Bu(t,function(t){return zt(t,n)},e)}function Iu(t,n){return e=n,Nt(o=void 0===t?document:t.dom)?vt.none():vt.from(o.querySelector(e)).map(At.fromDom);var e,o}function Ru(t,n,e){return Du(zt,Fu,t,n,e)}function Vu(){var n=Ir("aria-owns");return{id:n,link:function(t){on(t,"aria-owns",n)},unlink:function(t){sn(t,"aria-owns")}}}var Pu,Hu,zu=function(n,t){return Au(t,function(t){return Lt(t,n.element)},T)||(e=n,Mu(t,function(t){if(!Xn(t))return!1;var n=un(t,"id");return void 0!==n&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=un(t,"id");return Iu(ge(t),'[aria-owns="'+n+'"]')}).exists(function(t){return zu(e,t)}));var e},Nu="unknown";function Lu(n,t,e){var o,r,i,u;switch(tt(Wu.get(),n).orThunk(function(){return K(Ct(Wu.get()),function(t){return-1<n.indexOf(t)?vt.some(Wu.get()[t]):vt.none()})}).getOr(Pu.NORMAL)){case Pu.NORMAL:return e(ju());case Pu.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();wt(["mousemove","mouseover","mouseout",Ni()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:M(i,function(t){return wt(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Fr(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Pu.STOP:return!0}}(Hu=Pu=Pu||{})[Hu.STOP=0]="STOP",Hu[Hu.NORMAL=1]="NORMAL",Hu[Hu.LOGGING=2]="LOGGING";var Wu=Po({}),Uu=["alloy/data/Fields","alloy/debugging/Debugging"],ju=rt({logEventCut:st,logEventStopped:st,logNoParent:st,logEventNoHandlers:st,logEventResponse:st,write:st}),Gu=rt([mo("menu"),mo("selectedMenu")]),Xu=rt([mo("item"),mo("selectedItem")]);function Yu(){return bo("markers",[mo("backgroundMenu")].concat(Gu()).concat(Xu()))}function qu(t){return bo("markers",M(t,mo))}function Ku(t,n,e){return void 0!==(o=new Error).stack&&V(o.stack.split("\n"),function(n){return 0<n.indexOf("alloy")&&!d(Uu,function(t){return-1<n.indexOf(t)})}).getOr(Nu),ar(n,n,e,io(function(e){return Ve.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)})}));var o}function Ju(t){return Ku(0,t,Ge(st))}function $u(t){return Ku(0,t,Ge(vt.none))}function Qu(t){return Ku(0,t,Ue())}function Zu(t){return Ku(0,t,Ue())}function ta(t,n){return cr(t,rt(n))}function na(t){return cr(t,h)}function ea(t,n,e,o,r,i,u,a){return{x:t,y:n,bubble:e,direction:o,placement:r,restriction:i,label:u+"-"+r,alwaysFit:a=void 0!==a&&a}}function oa(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r}function ra(e,n){return U(["left","right","top","bottom"],function(t){return tt(n,t).map(function(n){return function(t){switch(n){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(e)})})}function ia(t,n){return t.x+t.width/2-n.width/2}function ua(t,n){return t.x+t.width-n.width}function aa(t,n){return t.y-n.height}function ca(t){return t.y+t.height}function sa(t,n){return t.y+t.height/2-n.height/2}function la(t,n,e){return ea(t.x+t.width,sa(t,n),e.east(),Wa(),"east",ra(t,{left:0}),Ga)}function fa(t,n,e){return ea(t.x-n.width,sa(t,n),e.west(),Ua(),"west",ra(t,{right:1}),Ga)}function da(){return[Xa,Ya,qa,Ka,$a,Ja,la,fa]}function ma(){return[Ya,Xa,Ka,qa,$a,Ja,la,fa]}function ga(){return[qa,Ka,Xa,Ya,Ja,$a]}function pa(){return[Ka,qa,Ya,Xa,Ja,$a]}function ha(){return[Xa,Ya,qa,Ka,$a,Ja]}function va(){return[Ya,Xa,Ka,qa,$a,Ja]}function ba(e,o,r){return iu(function(t,n){r(t,e,o)})}function ya(t){return{key:t,value:void 0}}function xa(t){var n,e,o,r,i,u,a,c,s=so("Creating behaviour: "+t.name,ec,t);return n=s.fields,e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=to(n),c=To(e,[So("config",to(n))]),tc(a,c,e,o,r,i,u)}function wa(t){var n,e=so("Creating behaviour: "+t.name,oc,t),o=lo(e.branchKey,e.branches),r=e.name,i=e.active,u=e.apis,a=e.extra,c=e.state,s=To(r,[So("config",n=o)]);return tc(n,s,r,i,u,a,c)}function Sa(){return At.fromDom(document)}function ka(t){return t.dom.focus()}function Ca(t){var n=ge(t).dom;return t.dom===n.activeElement}function Oa(t){return void 0===t&&(t=Sa()),vt.from(t.dom.activeElement).map(At.fromDom)}function _a(n){return Oa(ge(n)).filter(function(t){return n.dom.contains(t.dom)})}function Ta(t,e){var o=ge(e),n=Oa(o).bind(function(n){function t(t){return Lt(n,t)}var r,i;return t(e)?vt.some(e):(r=t,(i=function(t){for(var n=0;n<t.childNodes.length;n++){var e=At.fromDom(t.childNodes[n]);if(r(e))return vt.some(e);var o=i(t.childNodes[n]);if(o.isSome())return o}return vt.none()})(e.dom))}),r=t(e);return n.each(function(n){Oa(o).filter(function(t){return Lt(t,n)}).fold(function(){ka(n)},st)}),r}function Ea(t,n,e,o,r){function i(t){return t+"px"}return{position:t,left:n.map(i),top:e.map(i),right:o.map(i),bottom:r.map(i)}}function Da(t,n){var e;gn(t,lt(lt({},e=n),{position:vt.some(e.position)}))}function Ba(t,n,e,o,r,i){var u=n.rect,a=u.x-e,c=u.y-o,s=r-(a+u.width),l=i-(c+u.height),f=vt.some(a),d=vt.some(c),m=vt.some(s),g=vt.some(l),p=vt.none();return n.direction.fold(function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,p,p,m,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)})}function Ma(t,r){return t.fold(function(){var t=r.rect;return Ea("absolute",vt.some(t.x),vt.some(t.y),vt.none(),vt.none())},function(t,n,e,o){return Ba("absolute",r,t,n,e,o)},function(t,n,e,o){return Ba("fixed",r,t,n,e,o)})}function Aa(t,n){var e=C(zn,n),o=t.fold(e,e,function(){var t=Rn();return zn(n).translate(-t.left,-t.top)}),r=_n(n),i=Sn(n);return Me(o.left,o.top,r,i)}rt($o(Xu().concat(Gu())));var Fa=rt($o(Xu())),Ia=rt(bo("initSize",[mo("numColumns"),mo("numRows")])),Ra=Ho([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Va=Ra.southeast,Pa=Ra.southwest,Ha=Ra.northeast,za=Ra.northwest,Na=Ra.south,La=Ra.north,Wa=Ra.east,Ua=Ra.west,ja=function(t,n,e){return Math.min(Math.max(t,n),e)},Ga="layout",Xa=function(t,n,e){return ea(t.x,ca(t),e.southeast(),Va(),"southeast",ra(t,{left:1,top:3}),Ga)},Ya=function(t,n,e){return ea(ua(t,n),ca(t),e.southwest(),Pa(),"southwest",ra(t,{right:0,top:3}),Ga)},qa=function(t,n,e){return ea(t.x,aa(t,n),e.northeast(),Ha(),"northeast",ra(t,{left:1,bottom:2}),Ga)},Ka=function(t,n,e){return ea(ua(t,n),aa(t,n),e.northwest(),za(),"northwest",ra(t,{right:0,bottom:2}),Ga)},Ja=function(t,n,e){return ea(ia(t,n),aa(t,n),e.north(),La(),"north",ra(t,{bottom:2}),Ga)},$a=function(t,n,e){return ea(ia(t,n),ca(t),e.south(),Na(),"south",ra(t,{top:3}),Ga)},Qa=Object.freeze({__proto__:null,events:function(a){return eu([Cr(Fi(),function(r,t){var n,i=a.channels,e=Ct(i),u=t,o=(n=u).universal?e:F(e,function(t){return wt(n.channels,t)});St(o,function(t){var n=i[t],e=n.schema,o=so("channel["+t+"] data\nReceiver: "+Fr(r.element),e,u.data);n.onReceive(r,o)})})])}}),Za=[go("channels",uo(Ve.value,to([Qu("onReceive"),Eo("schema",Zo())])))],tc=function(e,t,f,n,o,r,i){function u(t){return nt(t,f)?t[f]():vt.none()}var a=dt(o,function(t,n){return r=f,e=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:rt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(void 0,[e,t.config,t.state].concat(n))})},o=u=n,a=(i=t).toString(),c=a.indexOf(")")+1,s=a.indexOf("("),l=a.substring(s+1,c-1).split(/,\s*/),e.toFunctionAnnotation=function(){return{name:o,parameters:bu(l.slice(0,1).concat(l.slice(3)))}},e;var r,i,u,e,o,a,c,s,l}),c=dt(r,Pr),s=lt(lt(lt({},c),a),{revoke:C(ya,f),config:function(t){var n=so(f+"-config",e,t);return{key:f,value:{config:n,me:s,configAsRaw:Rt(function(){return so(f+"-config",e,t)}),initialConfig:t,state:i}}},schema:rt(t),exhibit:function(t,e){return Et(u(t),tt(n,"exhibit"),function(t,n){return n(e,t.config,t.state)}).getOrThunk(function(){return Lr({})})},name:rt(f),handlers:function(t){return u(t).map(function(t){return tt(n,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},nc=lr,ec=to([mo("fields"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),oc=to([mo("branchKey"),mo("branches"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),rc=rt(void 0),ic=xa({fields:Za,name:"receiving",active:Qa}),uc=Object.freeze({__proto__:null,exhibit:function(t,n){return Lr({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),ac=Ho([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),cc=function(t,n,e){var o=ke(n,e);return t.fold(rt(o),rt(o),function(){var t=Rn();return o.translate(-t.left,-t.top)})};function sc(t){return an(t,Dc)}function lc(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T,E,D,B,M,A,F,I,R,V,P,H,z,N,L,W,U=t.bubble,j=U.offset,G=(V=o,P=t.restriction,H=j,z=ot("left",V.x),N=ot("top",V.y),L=ot("right",V.right),W=ot("bottom",V.bottom),Me(z,N,L-z,W-N)),X=t.x+j.left,Y=t.y+j.top,q=Me(X,Y,n,e),K=(r=G.x,i=G.y,u=G.right,a=G.bottom,c=q.x,s=q.y,l=q.right,f=q.bottom,d=q.width,m=q.height,{originInBounds:r<=c&&c<=u&&i<=s&&s<=a,sizeInBounds:l<=u&&r<=l&&f<=a&&i<=f,visibleW:Math.min(d,r<=c?u-c:l-r),visibleH:Math.min(m,i<=s?a-s:f-i)}),J=K.visibleW,$=K.visibleH,Q=K.originInBounds&&K.sizeInBounds,Z=Q?q:(g=G.x,p=G.y,h=G.right,v=G.bottom,b=q.x,y=q.y,x=q.width,w=q.height,S=Math.max(g,h-x),k=Math.max(p,v-w),C=ja(b,g,S),O=ja(y,p,k),_=Math.min(C+x,h)-C,T=Math.min(O+w,v)-O,Me(C,O,_,T)),tt=0<Z.width&&0<Z.height,nt=(E=t.direction,M=rt((D=Z).bottom-(B=o).y),A=rt(B.bottom-D.y),F=E.fold(A,A,M,M,A,M,A,A),I=rt(D.right-B.x),R=rt(B.right-D.x),{maxWidth:E.fold(R,I,R,I,R,R,R,I),maxHeight:F}),et={rect:Z,maxHeight:nt.maxHeight,maxWidth:nt.maxWidth,direction:t.direction,placement:t.placement,classes:{on:U.classesOn,off:U.classesOff},layout:t.label,testY:Y};function ot(r,i){return P[r].map(function(t){var n="top"===r||"bottom"===r,e=n?H.top:H.left,o=("left"===r||"top"===r?Math.max:Math.min)(t,i)+e;return n?ja(o,V.y,V.bottom):ja(o,V.x,V.right)}).getOr(i)}return Q||t.alwaysFit?Bc.fit(et):Bc.nofit(et,J,$,tt)}function fc(t){function n(){return e.get().each(t)}var e=Po(vt.none());return{clear:function(){n(),e.set(vt.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(vt.some(t))}}}function dc(){return fc(function(t){return t.destroy()})}function mc(){return fc(function(t){return t.unbind()})}function gc(){var n=fc(st);return lt(lt({},n),{on:function(t){return n.get().each(t)}})}function pc(t,n,e){return En(t,n,Mc,e,!1)}function hc(t,n,e){return En(t,n,Mc,e,!0)}function vc(o,e){function r(t){var n,e=null!==(n=t.raw.pseudoElement)&&void 0!==n?n:"";return Lt(t.target,o)&&!at(e)&&wt(Fc,t.raw.propertyName)}function t(t){var n;(g(t)||r(t))&&(a.clear(),c.clear(),!g(n=null==t?void 0:t.raw.type)&&n!==_i()||(clearTimeout(i),sn(o,Ic),$r(o,e.classes)))}function n(){a.set(pc(o,_i(),t)),c.set(pc(o,Oi(),t))}var i,u,a=mc(),c=mc();"ontransitionstart"in o.dom?u=pc(o,Ti(),function(t){r(t)&&(u.unbind(),n())}):n();var s,l,f=(s=o,l=d("transition-delay"),R(d("transition-duration"),function(t,n,e){var o=m(l[e])+m(n);return Math.max(t,o)},0));function d(t){var n=pn(s,t);return F(y(n)?n.split(/\s*,\s*/):[],at)}function m(t){if(y(t)&&/^[\d.]+/.test(t)){var n=parseFloat(t);return Bt(t,"ms")?n:1e3*n}return 0}requestAnimationFrame(function(){i=setTimeout(t,f+17),on(o,Ic,i)})}function bc(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(u=o,a=r,i.exists(function(t){var n=u.mode;return"all"===n||t[n]!==a[n]}));function h(t){return parseFloat(t).toFixed(3)}p||(g=t,N(o.classes,function(t){return Kr(g,t)}))?(dn(t,"position",e.position),c=Aa(n,t),s=Ma(n,lt(lt({},r),{rect:c})),l=U(Fc,function(t){return s[t]}),m=e,Q(l,function(t,n){var e,o,r,i=m[n].map(h),u=t.map(h);return!Et(e=i,o=u,r=void 0===r?v:r).getOr(e.isNone()&&o.isNone())}).isSome()&&(gn(t,l),p&&(Jr(f=t,(d=o).classes),an(f,Ic).each(function(t){clearTimeout(parseInt(t,10)),sn(f,Ic)}),vc(f,d)),yn(t))):$r(t,o.classes)}function yc(t,n,e,o){bn(n,"max-height"),bn(n,"max-width");var r,s,i,l,f,d,m,g,p,u={width:_n(r=n),height:Sn(r)};return s=n,i=o.preference,l=t,f=u,d=e,m=o.bounds,g=f.width,p=f.height,R(i,function(t,n){var e=C(a,n);return t.fold(rt(t),e)},Bc.nofit({rect:l,maxHeight:f.height,maxWidth:f.width,direction:Va(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:l.y},-1,-1,!1)).fold(h,h);function a(t,r,i,u,a){var c=lc(t(l,f,d,s,m),g,p,m);return c.fold(rt(c),function(t,n,e,o){return(a===o?u<e||i<n:!a&&o)?c:Bc.nofit(r,i,u,a)})}}function xc(t,n){var e=t,o=Math.floor(n);dn(e,"max-height",we.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"])+"px")}function wc(t,n,e){return void 0===t[n]?e:t[n]}function Sc(t,n,e,o){function r(t){return tt(e,t).getOr([])}function i(t,n,e){var o=W(Hc,e);return{offset:ke(t,n),classesOn:z(e,r),classesOff:z(o,r)}}var u=t*(o=void 0===o?1:o),a=n*o;return{southeast:function(){return i(-t,n,["top","alignLeft"])},southwest:function(){return i(t,n,["top","alignRight"])},south:function(){return i(-t/2,n,["top","alignCentre"])},northeast:function(){return i(-t,-n,["bottom","alignLeft"])},northwest:function(){return i(t,-n,["bottom","alignRight"])},north:function(){return i(-t/2,-n,["bottom","alignCentre"])},east:function(){return i(t,-n/2,["valignCentre","left"])},west:function(){return i(-t,-n/2,["valignCentre","right"])},insetNortheast:function(){return i(u,a,["top","alignLeft","inset"])},insetNorthwest:function(){return i(-u,a,["top","alignRight","inset"])},insetNorth:function(){return i(-u/2,a,["top","alignCentre","inset"])},insetSoutheast:function(){return i(u,-a,["bottom","alignLeft","inset"])},insetSouthwest:function(){return i(-u,-a,["bottom","alignRight","inset"])},insetSouth:function(){return i(-u/2,-a,["bottom","alignCentre","inset"])},insetEast:function(){return i(-u,-a/2,["valignCentre","right","inset"])},insetWest:function(){return i(u,-a/2,["valignCentre","left","inset"])}}}function kc(){return Sc(0,0,{})}function Cc(n,e){return function(t){return"rtl"===Nc(t)?e:n}}ac.none;var Oc,_c,Tc=ac.relative,Ec=ac.fixed,Dc="data-alloy-placement",Bc=Ho([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Mc=D,Ac=Tn,Fc=["top","bottom","right","left"],Ic="data-alloy-transition-timer",Rc=rt(function(t,n){xc(t,n),mn(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Vc=rt(function(t,n){xc(t,n)}),Pc=function(t,n,e,o){var r,i,u,a,c=yc(t,n,e,o),s=n,l=c,f=Ma((r=o).origin,l);return r.transition.each(function(t){bc(s,r.origin,f,t,l,r.lastPlacement)}),Da(s,f),a=c.placement,on(n,Dc,a),$r(i=n,(u=c.classes).off),Jr(i,u.on),(0,o.maxHeightFunction)(n,c.maxHeight),(0,o.maxWidthFunction)(n,c.maxWidth),{layout:c.layout,placement:c.placement}},Hc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],zc=h,Nc=function(t){return"rtl"===pn(t,"direction")?"rtl":"ltr"};function Lc(t){return Au(t,function(t){return Xn(t)&&un(t,"data-alloy-vertical-dir")===Oc.BottomToTop})}function Wc(){return To("layouts",[mo("onLtr"),mo("onRtl"),wo("onBottomLtr"),wo("onBottomRtl")])}function Uc(n,t,e,o,r,i,u){var a=u.map(Lc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)});return Cc(a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o))(n)}function jc(t){return t.fold(h,function(t,n,e){return t.translate(-n,-e)})}function Gc(t){return t.fold(h,h)}function Xc(t){return R(t,function(t,n){return t.translate(n.left,n.top)},ke(0,0))}function Yc(t){return Xc(M(t,Gc))}function qc(t,n,e){var o,r,i=Rn(Ut(t.element)),u=(o=t,r=Xt(e.root).dom,vt.from(r.frameElement).map(At.fromDom).filter(function(t){return Lt(Ut(t),Ut(o.element))}).map(Cn).getOr(i));return as(u,i.left,i.top)}function Kc(t,n,e,o){var r=us(ke(t,n));return vt.some({point:r,width:e,height:o})}function Jc(t,a,c,s,l){return t.map(function(t){var n=[a,t.point],e=s.fold(function(){return Yc(n)},function(){return Yc(n)},function(){return Xc(M(n,jc))}),o={x:e.left,y:e.top,width:t.width,height:t.height},r=(c.showAbove?ga:ha)(),i=(c.showAbove?pa:va)(),u=Uc(l,c,r,i,r,i,vt.none());return zc({anchorBox:o,bubble:c.bubble.getOr(kc()),overrides:c.overrides,layouts:u,placer:vt.none()})})}function $c(t,n,e){var o,r=t.document.createRange(),i=r;return n.fold(function(t){i.setStartBefore(t.dom)},function(t,n){i.setStart(t.dom,n)},function(t){i.setStartAfter(t.dom)}),o=r,e.fold(function(t){o.setEndBefore(t.dom)},function(t,n){o.setEnd(t.dom,n)},function(t){o.setEndAfter(t.dom)}),r}function Qc(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i}function Zc(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}function ts(t,n,e){return n(At.fromDom(e.startContainer),e.startOffset,At.fromDom(e.endContainer),e.endOffset)}function ns(i,t){return r=i,o=t.match({domRange:function(t){return{ltr:rt(t),rtl:vt.none}},relative:function(t,n){return{ltr:Rt(function(){return $c(r,t,n)}),rtl:Rt(function(){return vt.some($c(r,n,t))})}},exact:function(t,n,e,o){return{ltr:Rt(function(){return Qc(r,t,n,e,o)}),rtl:Rt(function(){return vt.some(Qc(r,e,o,t,n))})}}}),((e=(n=o).ltr()).collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return gs.rtl(At.fromDom(t.endContainer),t.endOffset,At.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return ts(0,gs.ltr,e)}):ts(0,gs.ltr,e)).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom,o),r.setEnd(t.dom,n),r}});var r,n,e,o}(Oc=Oc||{}).TopToBottom="toptobottom",Oc.BottomToTop="bottomtotop";var es="data-alloy-vertical-dir",os=[mo("hotspot"),wo("bubble"),Eo("overrides",{}),Wc(),ta("placement",function(t,n,e){var o=Aa(e,n.hotspot.element),r=Uc(t.element,n,ha(),va(),ga(),pa(),vt.some(n.hotspot.element));return vt.some(zc({anchorBox:o,bubble:n.bubble.getOr(kc()),overrides:n.overrides,layouts:r,placer:vt.none()}))})],rs=[mo("x"),mo("y"),Eo("height",0),Eo("width",0),Eo("bubble",kc()),Eo("overrides",{}),Wc(),ta("placement",function(t,n,e){var o=cc(e,n.x,n.y),r=Me(o.left,o.top,n.width,n.height),i=Uc(t.element,n,da(),ma(),da(),ma(),vt.none());return vt.some(zc({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i,placer:vt.none()}))})],is=Ho([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),us=is.screen,as=is.absolute,cs=[mo("node"),mo("root"),wo("bubble"),Wc(),Eo("overrides",{}),Eo("showAbove",!1),ta("placement",function(r,i,u){var a=qc(r,0,i);return i.node.filter(ve).bind(function(t){var n=t.dom.getBoundingClientRect(),e=Kc(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element);return Jc(e,a,i,u,o)})})],ss=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},ls=Ho([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),fs=(ls.before,ls.on,ls.after,function(t){return t.fold(h,h,h)}),ds=Ho([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ms={domRange:ds.domRange,relative:ds.relative,exact:ds.exact,exactFromRange:function(t){return ds.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){return Xt(t.match({domRange:function(t){return At.fromDom(t.startContainer)},relative:function(t,n){return fs(t)},exact:function(t,n,e,o){return t}}))},range:ss},gs=Ho([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function ps(t){return nf.getOption(t)}function hs(t){return ps(t).filter(function(t){return 0!==t.trim().length||-1<t.indexOf("\xa0")}).isSome()||wt(ef,Ft(t))}function vs(t,n){return Nt(e=void 0===t?document:t.dom)?[]:M(e.querySelectorAll(n),At.fromDom);var e}function bs(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return vt.some(ss(At.fromDom(n.startContainer),n.startOffset,At.fromDom(e.endContainer),e.endOffset))}return vt.none()}function ys(t){if(null===t.anchorNode||null===t.focusNode)return bs(t);var n,e,o,r,i,u,a,c,s,l,f,d=At.fromDom(t.anchorNode),m=At.fromDom(t.focusNode);return n=d,e=t.anchorOffset,o=m,r=t.focusOffset,u=e,a=o,c=r,(s=Ut(i=n).dom.createRange()).setStart(i.dom,u),s.setEnd(a.dom,c),l=s,f=Lt(n,o)&&e===r,l.collapsed&&!f?vt.some(ss(d,t.anchorOffset,m,t.focusOffset)):bs(t)}function xs(t,n){var e,o,r=(e=ns(t,n)).getClientRects();return 0<(o=0<r.length?r[0]:e.getBoundingClientRect()).width||0<o.height?vt.some(o).map(Zc):vt.none()}function ws(t,n){return{element:t,offset:n}}function Ss(t,n){return(Yn(t)?ws:function(t,n){var e=Kt(t);if(0===e.length)return ws(t,n);if(n<e.length)return ws(e[n],0);var o=e[e.length-1];return ws(o,(Yn(o)?nf.get(o):Kt(o)).length)})(t,n)}function ks(t,n){return n.getSelection.getOrThunk(function(){return function(){return vt.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(ys)}})().map(function(t){var n=Ss(t.start,t.soffset),e=Ss(t.finish,t.foffset);return ms.range(n.element,n.offset,e.element,e.offset)})}function Cs(t){return t.x+t.width}function Os(t,n){return t.x-n.width}function _s(t,n){return t.y-n.height+t.height}function Ts(t,n,e){return ea(Cs(t),t.y,e.southeast(),Va(),"southeast",ra(t,{left:0,top:2}),rf)}function Es(t,n,e){return ea(Os(t,n),t.y,e.southwest(),Pa(),"southwest",ra(t,{right:1,top:2}),rf)}function Ds(t,n,e){return ea(Cs(t),_s(t,n),e.northeast(),Ha(),"northeast",ra(t,{left:0,bottom:3}),rf)}function Bs(t,n,e){return ea(Os(t,n),_s(t,n),e.northwest(),za(),"northwest",ra(t,{right:1,bottom:3}),rf)}function Ms(){return[Ts,Es,Ds,Bs]}function As(){return[Es,Ts,Bs,Ds]}function Fs(t,n,e,o,r,i,u){var a,c,s,l,f,d,m,g,p,h,v,b,y,x,w={anchorBox:e.anchorBox,origin:n};return a=w,c=r.element,s=e.bubble,l=e.layouts,f=i,d=o,m=e.overrides,g=u,h=wc(m,"maxHeightFunction",Rc()),v=wc(m,"maxWidthFunction",st),b=a.anchorBox,y=a.origin,x={bounds:(p=y,d.fold(function(){return p.fold(Fe,Fe,Me)},function(e){return p.fold(e,e,function(){var t=e(),n=cc(p,t.x,t.y);return Me(n.left,n.top,t.width,t.height)})})),origin:y,preference:l,maxHeightFunction:h,maxWidthFunction:v,lastPlacement:f,transition:g},Pc(b,c,s,x)}function Is(t,n){Te(t.element,n.element)}function Rs(n,t){var e,o=n.components();St((e=n).components(),function(t){return Ee(t.element)}),Fn(e.element),e.syncComponents();var r=W(o,t);St(r,function(t){df(t),n.getSystem().removeFromWorld(t)}),St(t,function(t){t.getSystem().isConnected()?Is(n,t):(n.getSystem().addToWorld(t),Is(n,t),ve(n.element)&&mf(t)),n.syncComponents()})}function Vs(t,n){gf(t,n,Te)}function Ps(t){df(t),Ee(t.element),t.getSystem().removeFromWorld(t)}function Hs(n){var t=Yt(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()});Ps(n),t.each(function(t){t.syncComponents()})}function zs(t){var n=t.components();St(n,Ps),Fn(t.element),t.syncComponents()}function Ns(t,n){pf(t,n,Te)}function Ls(n){var t=Kt(n.element);St(t,function(t){n.getByDom(t).each(df)}),Ee(n.element)}function Ws(n,t,e,o){e.get().each(function(t){zs(n)}),Vs(t.getAttachPoint(n),n);var r=n.getSystem().build(o);return Vs(n,r),e.set(r),r}function Us(t,n,e,o){var r=Ws(t,n,e,o);return n.onOpen(t,r),r}function js(n,e,o){o.get().each(function(t){zs(n),Hs(n),e.onClose(n,t),o.clear()})}function Gs(t,n,e){return e.isOpen()}function Xs(t){var e=so("Dismissal",Sf,t),n={};return n[yf()]={schema:to([mo("target")]),onReceive:function(n,t){bf.isOpen(n)&&(bf.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return bf.close(n)},function(t){return vr(n,t.event)}))}},n}function Ys(t){var e=so("Reposition",kf,t),n={};return n[xf()]={onReceive:function(n){bf.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return vr(n,t.event)})}},n}function qs(t,n,e){n.store.manager.onLoad(t,n,e)}function Ks(t,n,e){n.store.manager.onUnload(t,n,e)}function Js(){var t=Po(null);return wu({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})}function $s(){var i=Po({}),u=Po({});return wu({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return tt(i.get(),t).orThunk(function(){return tt(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};St(t,function(n){tt(o[n.value]=n,"meta").each(function(t){tt(t,"text").each(function(t){r[t]=n})})}),i.set(lt(lt({},n),o)),u.set(lt(lt({},e),r))},clear:function(){i.set({}),u.set({})}})}function Qs(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)}function Zs(o,t){return Vo(o,{},M(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,ar(n,n,Xe(),Je(function(t){return Lo("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([cr("dump",h)]))}function tl(t){return t.dump}function nl(t,n){return lt(lt({},nc(n)),t.dump)}function el(t){return Tt(t,"uiType")}function ol(t){return t.fold(vt.some,vt.none,vt.some,vt.some)}function rl(t){function n(t){return t.name}return t.fold(n,n,n,n)}function il(e,o){return function(t){var n=so("Converting part type",o,t);return e(n)}}function ul(t,n,e,o){return Yo(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))}function al(r,t){var n={};return St(t,function(t){ol(t).each(function(e){var o=ed(r,e.pname);n[e.name]=function(t){var n=so("Part: "+e.name+" in "+r,$o(e.schema),t);return lt(lt({},o),{config:t,validated:n})}})}),n}function cl(t,n,e){return{uiType:Pf(),owner:t,name:n,config:e,validated:{}}}function sl(t){return z(t,function(t){return t.fold(vt.none,vt.some,vt.none,vt.none).map(function(t){return bo(t.name,t.schema.concat([na(td())]))}).toArray()})}function ll(t){return M(t,rl)}function fl(t,n,e){return o=n,r={},i={},St(e,function(t){t.fold(function(o){r[o.pname]=Rf(!0,function(t,n,e){return o.factory.sketch(ul(t,o,n,e))})},function(t){var n=o.parts[t.name];i[t.name]=rt(t.factory.sketch(ul(o,t,n[td()]),n))},function(o){r[o.pname]=Rf(!1,function(t,n,e){return o.factory.sketch(ul(t,o,n,e))})},function(o){r[o.pname]=Vf(!0,function(n,t,e){return M(n[o.name],function(t){return o.factory.sketch(Yo(o.defaults(n,t,e),t,o.overrides(n,t)))})})})}),{internals:rt(r),externals:rt(i)};var o,r,i}function dl(t,n,e){return o=vt.some(t),i=(r=n).components,s=dt(e,function(t,n){return o=t,r=!1,{name:rt(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),u=o,a=r,c=s,l=z(i,function(t){return If(u,a,t,c)}),J(s,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),l;var o,r,i,u,a,c,s,l}function ml(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()}function gl(t,n,e){return ml(t,n,e).getOrDie("Could not find part: "+e)}function pl(t,n,e){var o={},r=n.partUids,i=t.getSystem();return St(e,function(t){o[t]=rt(i.getByUid(r[t]))}),o}function hl(t,n){var e=t.getSystem();return dt(n.partUids,function(t,n){return rt(e.getByUid(t))})}function vl(t){return Ct(t.partUids)}function bl(t,n,e){var o={},r=n.partUids,i=t.getSystem();return St(e,function(t){o[t]=rt(i.getByUid(r[t]).getOrDie())}),o}function yl(n,t){return lr(M(ll(t),function(t){return{key:t,value:n+"-"+t}}))}function xl(n){return ar("partUids","partUids",Ye(function(t){return yl(t.uid,n)}),Zo())}function wl(t,n,e,o,r){var i;return so(t+" [SpecSchema]",to((i=r,(0<o.length?[bo("parts",o)]:[]).concat([mo("uid"),Eo("dom",{}),Eo("components",[]),na("originalSpec"),Eo("debug.sketcher",{})]).concat(i)).concat(n)),e)}function Sl(t,n,e,o,r){var i=rd(r),u=wl(t,n,i,sl(e),[xl(e)]),a=fl(0,u,e);return o(u,dl(t,u,a.internals()),i,a.externals())}function kl(t){var r=so("Sketcher for "+t.name,id,t),n=dt(r.apis,zr),e=dt(r.extraApis,Pr);return lt(lt({name:r.name,configFields:r.configFields,sketch:function(t){return n=r.name,e=r.configFields,(0,r.factory)(wl(n,e,o=rd(t),[],[]),o);var n,e,o}},n),e)}function Cl(t){var n=so("Sketcher for "+t.name,ud,t),e=al(n.name,n.partFields),o=dt(n.apis,zr),r=dt(n.extraApis,Pr);return lt(lt({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Sl(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)}function Ol(t){return"input"===Ft(t)&&"radio"!==un(t,"type")||"textarea"===Ft(t)}function _l(t,n,e){(n.disabled()?ld:fd)(t,n)}function Tl(t,n){return!0===n.useNative&&wt(sd,Ft(t.element))}function El(t,n){return Tl(t,n)?cn(t.element,"disabled"):"true"===un(t.element,"aria-disabled")}function Dl(e,o,t,r){var n=vs(e.element,"."+o.highlightClass);St(n,function(n){d(r,function(t){return t.element===n})||(qr(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),vr(t,tu())}))})}function Bl(t,n,e,o){Dl(t,n,0,[o]),Yl(0,n,0,o)||(Yr(o.element,n.highlightClass),n.onHighlight(t,o),vr(o,Zi()))}function Ml(e,n,t,o){var r=vs(e.element,"."+n.itemClass);return P(r,function(t){return Kr(t,n.highlightClass)}).bind(function(t){var n=oa(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOptional()})}function Al(t,n,e){var o=L(t.slice(0,n)),r=L(t.slice(n+1));return V(o.concat(r),e)}function Fl(t,n,e){return V(L(t.slice(0,n)),e)}function Il(t,n,e){var o=t.slice(0,n);return V(t.slice(n+1).concat(o),e)}function Rl(t,n,e){return V(t.slice(n+1),e)}function Vl(e){return function(t){var n=t.raw;return wt(e,n.which)}}function Pl(t){return function(n){return N(t,function(t){return t(n)})}}function Hl(t){return!0===t.raw.shiftKey}function zl(t){return!0===t.raw.ctrlKey}function Nl(t,n){return{matches:t,classification:n}}function Ll(t,n,e){n.exists(function(n){return e.exists(function(t){return Lt(t,n)})})||br(t,Ki(),{prevFocus:n,newFocus:e})}function Wl(){function o(t){return _a(t.element)}return{get:o,set:function(t,n){var e=o(t);t.getSystem().triggerFocus(n,t.element),Ll(t,e,o(t))}}}function Ul(){function r(t){return hd.getHighlighted(t).map(function(t){return t.element})}return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold(st,function(t){hd.highlight(n,t)});var o=r(n);Ll(n,e,o)}}}gs.ltr,gs.rtl;function jl(t,n,e,o,r,i){var u=i.map(Ae);return lf(t,n,e,o,r,u)}function Gl(t,n,e){var o,r,i,u=n.getAttachPoint(t);dn(t.element,"position",ff.getMode(u)),i=n.cloakVisibilityAttr,hn((o=t).element,r="visibility").fold(function(){sn(o.element,i)},function(t){on(o.element,i,t)}),dn(o.element,r,"hidden")}function Xl(t,n,e){var o,r,i,u=t.element;d(["top","left","right","bottom"],function(t){return hn(u,t).isSome()})||bn(t.element,"position"),r="visibility",i=n.cloakVisibilityAttr,an((o=t).element,i).fold(function(){return bn(o.element,r)},function(t){return dn(o.element,r,t)})}function Yl(t,n,e,o){return Kr(o.element,n.highlightClass)}function ql(n,t,e){return Iu(n.element,"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}function Kl(n,t,e){var o=vs(n.element,"."+t.itemClass);return(0<o.length?vt.some(o[o.length-1]):vt.none()).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}function Jl(n,t,e){return et(M(vs(n.element,"."+t.itemClass),function(t){return n.getSystem().getByDom(t).toOptional()}))}var $l,Ql,Zl,tf,nf=($l=Yn,{get:function(t){if(!$l(t))throw new Error("Can only get text value of a text node");return Ql(t).getOr("")},getOption:Ql=function(t){return $l(t)?vt.from(t.dom.nodeValue):vt.none()},set:function(t,n){if(!$l(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=n}}),ef=["img","br"],of=[wo("getSelection"),mo("root"),wo("bubble"),Wc(),Eo("overrides",{}),Eo("showAbove",!1),ta("placement",function(t,n,e){var r=Xt(n.root).dom,o=qc(t,0,n);return Jc(ks(r,n).bind(function(e){return t=r,n=ms.exactFromRange(e),(0<(o=ns(t,n).getBoundingClientRect()).width||0<o.height?vt.some(o).map(Zc):vt.none()).orThunk(function(){var t=At.fromText("\ufeff");Dn(e.start,t);var n=xs(r,ms.exact(t,0,t,1));return Ee(t),n}).bind(function(t){return Kc(t.left,t.top,t.width,t.height)});var t,n,o}),o,n,e,ks(r,n).bind(function(t){return Xn(t.start)?vt.some(t.start):fe(t.start)}).getOr(t.element))})],rf="link-layout",uf=lo("type",{selection:of,node:cs,hotspot:os,submenu:[mo("item"),Wc(),Eo("overrides",{}),ta("placement",function(t,n,e){var o=Aa(e,n.item.element),r=Uc(t.element,n,Ms(),As(),Ms(),As(),vt.none());return vt.some(zc({anchorBox:o,bubble:kc(),overrides:n.overrides,layouts:r,placer:vt.none()}))})],makeshift:rs}),af=[xo("classes",nr),Ao("mode","all",["all","layout","placement"])],cf=[Eo("useFixed",T),wo("getBounds")],sf=[go("anchor",uf),To("transition",af)],lf=function(c,s,l,f,t,d){var m=so("placement.info",$o(sf),t),g=m.anchor,p=f.element,h=l.get(f.uid);Ta(function(){dn(p,"position","fixed");var t=hn(p,"visibility");dn(p,"visibility","hidden");var n,e,o,r,i=s.useFixed()?(r=document.documentElement,Ec(0,0,r.clientWidth,r.clientHeight)):(e=Cn((n=c).element),o=n.element.dom.getBoundingClientRect(),Tc(e.left,e.top,o.width,o.height)),u=g.placement,a=d.map(rt).or(s.getBounds);u(c,g,i).each(function(t){var n=t.placer.getOr(Fs)(c,i,t,a,f,h,m.transition);l.set(f.uid,n)}),t.fold(function(){bn(p,"visibility")},function(t){dn(p,"visibility",t)}),hn(p,"left").isNone()&&hn(p,"top").isNone()&&hn(p,"right").isNone()&&hn(p,"bottom").isNone()&&mt(hn(p,"position"),"fixed")&&bn(p,"position")},p)},ff=xa({fields:cf,name:"positioning",active:uc,apis:Object.freeze({__proto__:null,position:function(t,n,e,o,r){jl(t,n,e,o,r,vt.none())},positionWithin:jl,positionWithinBounds:lf,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"},reset:function(t,n,e,o){var r=o.element;St(["position","left","right","top","bottom"],function(t){return bn(r,t)}),sn(r,Dc),e.clear(o.uid)}}),state:Object.freeze({__proto__:null,init:function(){var e={};return wu({readState:function(){return e},clear:function(t){k(t)?delete e[t]:e={}},set:function(t,n){e[t]=n},get:function(t){return tt(e,t)}})}})}),df=function(t){vr(t,Xi());var n=t.components();St(n,df)},mf=function(t){var n=t.components();St(n,mf),vr(t,Gi())},gf=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),ve(t.element)&&mf(n),t.syncComponents()},pf=function(t,n,e){e(t,n.element);var o=Kt(n.element);St(o,function(t){n.getByDom(t).each(mf)})},hf=Object.freeze({__proto__:null,cloak:Gl,decloak:Xl,open:Us,openWhileCloaked:function(t,n,e,o,r){Gl(t,n),Us(t,n,e,o),r(),Xl(t,n)},close:js,isOpen:Gs,isPartOf:function(n,e,t,o){return Gs(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return Ws(t,n,e,o)})}}),vf=Object.freeze({__proto__:null,events:function(e,o){return eu([Cr(Hi(),function(t,n){js(t,e,o)})])}}),bf=xa({fields:[Ju("onOpen"),Ju("onClose"),mo("isPartOf"),mo("getAttachPoint"),Eo("cloakVisibilityAttr","data-precloak-visibility")],name:"sandboxing",active:vf,apis:hf,state:Object.freeze({__proto__:null,init:function(){var t=gc(),n=rt("not-implemented");return wu({readState:n,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),yf=rt("dismiss.popups"),xf=rt("reposition.popups"),wf=rt("mouse.released"),Sf=to([Eo("isExtraPart",T),To("fireEventInstead",[Eo("event",Yi())])]),kf=to([To("fireEventInstead",[Eo("event",qi())]),vo("doReposition")]),Cf=Object.freeze({__proto__:null,onLoad:qs,onUnload:Ks,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Of=Object.freeze({__proto__:null,events:function(e,o){var t=e.resetOnDom?[ou(function(t,n){qs(t,e,o)}),ru(function(t,n){Ks(t,e,o)})]:[ba(e,o,qs)];return eu(t)}}),_f=Object.freeze({__proto__:null,memory:Js,dataset:$s,manual:function(){return wu({readState:st})},init:function(t){return t.store.manager.state(t)}}),Tf=[wo("initialValue"),mo("getFallbackEntry"),mo("getDataKey"),mo("setValue"),ta("manager",{setValue:Qs,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Qs(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:$s})],Ef=[mo("getValue"),Eo("setValue",st),wo("initialValue"),ta("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:st,state:xu.init})],Df=xa({fields:[Do("store",{mode:"memory"},lo("mode",{memory:[wo("initialValue"),ta("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Js})],manual:Ef,dataset:Tf})),Ju("onSetValue"),Eo("resetOnDom",!1)],name:"representing",active:Of,apis:Cf,extra:{setValueFrom:function(t,n){var e=Df.getValue(n);Df.setValue(t,e)}},state:_f}),Bf=Zs,Mf=nl,Af="placeholder",Ff=Ho([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),If=function(r,i,u,a){return t=r,e=a,(el(n=u)&&n.uiType===Af?(c=n,s=e,(o=t).exists(function(t){return t!==c.owner})?Ff.single(!0,rt(c)):tt(s,c.name).fold(function(){throw new Error("Unknown placeholder component: "+c.name+"\nKnown: ["+Ct(s)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+JSON.stringify(c,null,2))},function(t){return t.replace()})):Ff.single(!1,rt(n))).fold(function(t,n){var e=el(u)?n(i,u.config,u.validated):n(i),o=z(tt(e,"components").getOr([]),function(t){return If(r,i,t,a)});return[lt(lt({},e),{components:o})]},function(t,n){if(el(u)){var e=n(i,u.config,u.validated);return u.validated.preprocess.getOr(h)(e)}return n(i)});var t,n,e,o,c,s},Rf=Ff.single,Vf=Ff.multiple,Pf=rt(Af),Hf=Ho([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),zf=Eo("factory",{sketch:h}),Nf=Eo("schema",[]),Lf=mo("name"),Wf=ar("pname","pname",je(function(t){return"<alloy."+Ir(t.name)+">"}),Zo()),Uf=cr("schema",function(){return[wo("preprocess")]}),jf=Eo("defaults",rt({})),Gf=Eo("overrides",rt({})),Xf=$o([zf,Nf,Lf,Wf,jf,Gf]),Yf=$o([zf,Nf,Lf,jf,Gf]),qf=$o([zf,Nf,Lf,Wf,jf,Gf]),Kf=$o([zf,Uf,Lf,mo("unit"),Wf,jf,Gf]),Jf=il(Hf.required,Xf),$f=il(Hf.external,Yf),Qf=il(Hf.optional,qf),Zf=il(Hf.group,Kf),td=rt("entirety"),nd=Object.freeze({__proto__:null,required:Jf,external:$f,optional:Qf,group:Zf,asNamedPart:ol,name:rl,asCommon:function(t){return t.fold(h,h,h,h)},original:td}),ed=function(t,n){return{uiType:Pf(),owner:t,name:n}},od=Object.freeze({__proto__:null,generate:al,generateOne:cl,schemas:sl,names:ll,substitutes:fl,components:dl,defaultUids:yl,defaultUidsSchema:xl,getAllParts:hl,getAllPartNames:vl,getPart:ml,getPartOrDie:gl,getParts:pl,getPartsOrDie:bl}),rd=function(t){return Tt(t,"uid")?t:lt(lt({},t),{uid:pu("uid")})},id=to([mo("name"),mo("factory"),mo("configFields"),Eo("apis",{}),Eo("extraApis",{})]),ud=to([mo("name"),mo("factory"),mo("configFields"),mo("partFields"),Eo("apis",{}),Eo("extraApis",{})]),ad=Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),cd=xa({fields:[mo("find")],name:"composing",apis:ad}),sd=["input","button","textarea","select"],ld=function(n,t,e){t.disableClass.each(function(t){Yr(n.element,t)}),(Tl(n,t)?function(t){on(t.element,"disabled","disabled")}:function(t){on(t.element,"aria-disabled","true")})(n),t.onDisabled(n)},fd=function(n,t,e){t.disableClass.each(function(t){qr(n.element,t)}),(Tl(n,t)?function(t){sn(t.element,"disabled")}:function(t){on(t.element,"aria-disabled","false")})(n),t.onEnabled(n)},dd=Object.freeze({__proto__:null,enable:fd,disable:ld,isDisabled:El,onLoad:_l,set:function(t,n,e,o){(o?ld:fd)(t,n)}}),md=Object.freeze({__proto__:null,exhibit:function(t,n){return Lr({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return eu([Sr(Ii(),function(t,n){return El(t,e)}),ba(e,t,_l)])}}),gd=xa({fields:[Io("disabled",T),Eo("useNative",!0),wo("disableClass"),Ju("onDisabled"),Ju("onEnabled")],name:"disabling",active:md,apis:dd}),pd=Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return Dl(t,n,0,[])},dehighlight:function(t,n,e,o){Yl(0,n,0,o)&&(qr(o.element,n.highlightClass),n.onDehighlight(t,o),vr(o,tu()))},highlight:Bl,highlightFirst:function(n,e,t){ql(n,e).each(function(t){Bl(n,e,0,t)})},highlightLast:function(n,e,t){Kl(n,e).each(function(t){Bl(n,e,0,t)})},highlightAt:function(n,e,t,o){var r,i,u;i=o,u=vs((r=n).element,"."+e.itemClass),vt.from(u[i]).fold(function(){return Ve.error(new Error("No element found with index "+i))},r.getSystem().getByDom).fold(function(t){throw t},function(t){Bl(n,e,0,t)})},highlightBy:function(n,e,t,o){V(Jl(n,e),o).each(function(t){Bl(n,e,0,t)})},isHighlighted:Yl,getHighlighted:function(n,t,e){return Iu(n.element,"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},getFirst:ql,getLast:Kl,getPrevious:function(t,n,e){return Ml(t,n,0,-1)},getNext:function(t,n,e){return Ml(t,n,0,1)},getCandidates:Jl}),hd=xa({fields:[mo("highlightClass"),mo("itemClass"),Ju("onHighlight"),Ju("onDehighlight")],name:"highlighting",apis:pd}),vd=[8],bd=[9],yd=[13],xd=[27],wd=[32],Sd=[37],kd=[38],Cd=[39],Od=[40],_d=O(Hl);function Td(t,n,e,o,a){function c(n,e,t,o,r){var i=t(n,e,o,r),u=e.event;return V(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(n,e,o,r)})}var r={schema:function(){return t.concat([Eo("focusManager",Wl()),Do("focusInside","onFocus",io(function(t){return wt(["onFocus","onEnterOrSpace","onApi"],t)?Ve.value(t):Ve.error("Invalid value for focusInside")})),ta("handler",r),ta("state",n),ta("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Zl.OnFocusMode?vt.none():a(i).map(function(e){return Cr(Bi(),function(t,n){e(t,i,u),n.stop()})}),n=[Cr(xi(),function(o,r){c(o,r,e,i,u).fold(function(){var n=o,e=r,t=Vl(wd.concat(yd))(e.event);i.focusInside===Zl.OnEnterOrSpaceMode&&t&&gr(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),Cr(wi(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})];return eu(t.toArray().concat(n))}};return r}function Ed(t){function a(t,n){return 0<wn(t.visibilitySelector.bind(function(t){return Ru(n,t)}).getOr(n))}function n(n,e,t){var o=e,r=F(vs(n.element,o.selector),function(t){return a(o,t)});vt.from(r[o.firstTabstop]).each(function(t){e.focusManager.set(n,t)})}function o(e,t,r,i){var n,u=vs(e.element,r.selector);return(n=r).focusManager.get(e).bind(function(t){return Ru(t,n.selector)}).bind(function(t){return P(u,C(Lt,t)).bind(function(t){return n=e,o=r,i(u,t,function(t){return a(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?vt.some(!0):vt.none()},function(t){return o.focusManager.set(n,t),vt.some(!0)});var n,o})})}var e=[wo("onEscape"),wo("onEnter"),Eo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Eo("firstTabstop",0),Eo("useTabstopAt",D),wo("visibilitySelector")].concat([t]),r=rt([Nl(Pl([Hl,Vl(bd)]),function(t,n,e){return o(t,0,e,e.cyclic?Al:Fl)}),Nl(Vl(bd),function(t,n,e){return o(t,0,e,e.cyclic?Il:Rl)}),Nl(Vl(xd),function(n,e,t){return t.onEscape.bind(function(t){return t(n,e)})}),Nl(Pl([_d,Vl(yd)]),function(n,e,t){return t.onEnter.bind(function(t){return t(n,e)})})]),i=rt([]);return Td(e,xu.init,r,i,function(){return vt.some(n)})}function Dd(t,n,e){return Ol(e)&&Vl(wd)(n.event)?vt.none():(xr(t,e,Ii()),vt.some(!0))}function Bd(t,n){return vt.some(!0)}function Md(t,n,e){return e.execute(t,n,t.element)}function Ad(){var e=gc();return wu({readState:function(){return e.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set({numRows:t,numColumns:n})},getNumRows:function(){return e.get().map(function(t){return t.numRows})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns})}})}function Fd(i){return function(t,n,e,o){var r=i(t.element);return tg(r,t,n,e,o)}}function Id(t,n){return Fd(Cc(t,n))}function Rd(t,n){return Fd(Cc(n,t))}function Vd(r){return function(t,n,e,o){return tg(r,t,n,e,o)}}function Pd(t){return!((n=t.dom).offsetWidth<=0&&n.offsetHeight<=0);var n}function Hd(t,n,e){var o,r=F(vs(t,e),Pd);return P(o=r,function(t){return Lt(t,n)}).map(function(t){return{index:t,candidates:o}})}function zd(t,n){return P(t,function(t){return Lt(n,t)})}function Nd(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row*o+t.column;return 0<=n&&n<e.length?vt.some(e[n]):vt.none()})}function Ld(r,t,i,u,a){return Nd(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=oa(n,a,0,e-1);return vt.some({row:t,column:o})})}function Wd(i,t,u,a,c){return Nd(i,t,a,function(t,n){var e=oa(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=ja(n,0,o-1);return vt.some({row:e,column:r})})}function Ud(n,e,t){Iu(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})}function jd(r){return function(t,n,e,o){return Hd(t,n,e.selector).bind(function(t){return r(t.candidates,t.index,o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}}function Gd(t,n,e){return e.captureTab?vt.some(!0):vt.none()}function Xd(t,n,e,i){var u=function(t,n,e){var o,r=oa(n,i,0,e.length-1);return r===t?vt.none():"button"===Ft(o=e[r])&&"disabled"===un(o,"disabled")?u(t,r,e):vt.from(e[r])};return Hd(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return u(n,n,e)})}function Yd(n,e,o){return(r=o).focusManager.get(n).bind(function(t){return Ru(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var r}function qd(n,e,t){e.getInitial(n).orThunk(function(){return Iu(n.element,e.selector)}).each(function(t){e.focusManager.set(n,t)})}function Kd(t,n,e){return Xd(t,e.selector,n,-1)}function Jd(t,n,e){return Xd(t,e.selector,n,1)}function $d(r){return function(t,n,e,o){return r(t,n,e,o).bind(function(){return e.executeOnMove?Yd(t,n,e):vt.some(!0)})}}function Qd(t,n,e){return e.onEscape(t,n)}function Zd(t,n,e){return vt.from(t[n]).bind(function(t){return vt.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})}function tm(t,n,e,o){return Zd(t,n,oa(e,o,0,t[n].length-1))}function nm(t,n,e,o){var r=oa(e,o,0,t.length-1),i=t[r].length;return Zd(t,r,ja(n,0,i-1))}function em(t,n,e,o){var r=t[n].length;return Zd(t,n,ja(e+o,0,r-1))}function om(t,n,e,o){var r=ja(e+o,0,t.length-1),i=t[r].length;return Zd(t,r,ja(n,0,i-1))}function rm(n,e,t){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Iu(n.element,t.cell)}).each(function(t){e.focusManager.set(n,t)})}function im(t,o){return function(n,e,i){var u=i.cycles?t:o;return Ru(e,i.selectors.row).bind(function(t){return zd(vs(t,i.selectors.cell),e).bind(function(o){var r=vs(n,i.selectors.row);return zd(r,t).bind(function(t){var n,e=(n=i,M(r,function(t){return vs(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell})})})})}}function um(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})}function am(n,e,t){Iu(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})}function cm(t,n,e){return Xd(t,e.selector,n,-1)}function sm(t,n,e){return Xd(t,e.selector,n,1)}function lm(t,n,e,o){var r=t.getSystem().build(o);gf(t,r,e)}function fm(t,n,e,o){V(Ig(t),function(t){return Lt(o.element,t.element)}).each(Hs)}function dm(n,t,e,r,o){var i=Ig(n);return vt.from(i[r]).map(function(t){return fm(n,0,0,t),o.each(function(t){lm(n,0,function(t,n){var e,o=n;Jt(e=t,r).fold(function(){Te(e,o)},function(t){Dn(t,o)})},t)}),t})}function mm(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=eu(n),xa({fields:[mo("enabled")],name:e,active:{events:rt(o)}})),configAsRaw:rt({}),initialConfig:{},state:xu}}}function gm(t,n){n.ignore||(ka(t.element),n.onFocus(t))}function pm(t,n,e){var o=n.aria;o.update(t,o,e.get())}function hm(n,t,e){t.toggleClass.each(function(t){(e.get()?Yr:qr)(n.element,t)})}function vm(t,n,e){Ym(t,n,e,!e.get())}function bm(t,n,e){e.set(!0),hm(t,n,e),pm(t,n,e)}function ym(t,n,e){e.set(!1),hm(t,n,e),pm(t,n,e)}function xm(t,n,e){Ym(t,n,e,n.selected)}function wm(){function t(t,n){n.stop(),yr(t)}return[Cr(Ci(),t),Cr(Vi(),t),Dr(si()),Dr(mi())]}function Sm(t){return eu(ft([t.map(function(e){return uu(function(t,n){e(t),n.stop()})}).toArray(),wm()]))}function km(t){(_a(t.element).isNone()||Hg.isFocused(t))&&(Hg.isFocused(t)||Hg.focus(t),br(t,Wg,{item:t}))}function Cm(t){br(t,Ug,{item:t})}function Om(t,n){return t.x+t.width/2-n.width/2}function _m(t,n){return t.x+t.width-n.width}function Tm(t,n){return t.y+t.height-n.height}function Em(t,n){return t.y+t.height/2-n.height/2}function Dm(t,n,e){return ea(_m(t,n),Tm(t,n),e.insetSouthwest(),za(),"southwest",ra(t,{right:0,bottom:3}),ap)}function Bm(t,n,e){return ea(t.x,Tm(t,n),e.insetSoutheast(),Ha(),"southeast",ra(t,{left:1,bottom:3}),ap)}function Mm(t,n,e){return ea(_m(t,n),t.y,e.insetNorthwest(),Pa(),"northwest",ra(t,{right:0,top:2}),ap)}function Am(t,n,e){return ea(t.x,t.y,e.insetNortheast(),Va(),"northeast",ra(t,{left:1,top:2}),ap)}function Fm(t,n,e){return ea(_m(t,n),Em(t,n),e.insetEast(),Ua(),"east",ra(t,{right:0}),ap)}function Im(t,n,e){return ea(t.x,Em(t,n),e.insetWest(),Wa(),"west",ra(t,{left:1}),ap)}function Rm(t){switch(t){case"north":return cp;case"northeast":return Am;case"northwest":return Mm;case"south":return sp;case"southeast":return Bm;case"southwest":return Dm;case"east":return Fm;case"west":return Im}}function Vm(t,n,e,o,r){return sc(o).map(Rm).getOr(cp)(t,n,e,o,r)}function Pm(t){switch(t){case"north":return sp;case"northeast":return Bm;case"northwest":return Dm;case"south":return cp;case"southeast":return Am;case"southwest":return Mm;case"east":return Im;case"west":return Fm}}function Hm(t,n,e,o,r){return sc(o).map(Pm).getOr(cp)(t,n,e,o,r)}function zm(t){var n=void 0!==t.uid&&nt(t,"uid")?t.uid:pu("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return lt(lt({},t),{uid:n})}}}function Nm(t){return function(){return tt(t,gp).getOr("!not found!")}}function Lm(t,n){var e,o=t.toLowerCase();if(dp.isRtl()){var r=Bt(e=o,"-rtl")?e:e+"-rtl";return Tt(n,r)?r:o}return o}function Wm(t,n){return tt(n,Lm(t,n))}function Um(t,n){var e=n();return Wm(t,e).getOrThunk(Nm(e))}function jm(){return mm("add-focusable",[ou(function(t){var n,e,o;n=t.element,e="svg",o=function(t){return zt(t,e)},V(n.dom.childNodes,function(t){return o(At.fromDom(t))}).map(At.fromDom).each(function(t){return on(t,"focusable","false")})})])}function Gm(t,n,e,o){var r,i,u,a=(u=n,dp.isRtl()&&Tt(mp,u)?["tox-icon--flip"]:[]),c=tt(e,Lm(n,e)).or(o).getOrThunk(Nm(e));return{dom:{tag:t.tag,attributes:null!==(r=t.attributes)&&void 0!==r?r:{},classes:t.classes.concat(a),innerHtml:c},behaviours:nc(H(H([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[jm()],!1))}}function Xm(t,n,e,o){return void 0===o&&(o=vt.none()),Gm(n,t,e(),o)}(tf=Zl=Zl||{}).OnFocusMode="onFocus",tf.OnEnterOrSpaceMode="onEnterOrSpace",tf.OnApiMode="onApi";function Ym(t,n,e,o){(o?bm:ym)(t,n,e)}function qm(t,n,e){on(t.element,"aria-expanded",e)}function Km(t){return"prepared"===t.type?vt.some(t.menu):vt.none()}var Jm=Ed(cr("cyclic",T)),$m=Ed(cr("cyclic",D)),Qm=Td([Eo("execute",Dd),Eo("useSpace",!1),Eo("useEnter",!0),Eo("useControlEnter",!1),Eo("useDown",!1)],xu.init,function(t,n,e,o){var r=e.useSpace&&!Ol(t.element)?wd:[],i=e.useEnter?yd:[],u=e.useDown?Od:[];return[Nl(Vl(r.concat(i).concat(u)),Md)].concat(e.useControlEnter?[Nl(Pl([zl,Vl(yd)]),Md)]:[])},function(t,n,e,o){return e.useSpace&&!Ol(t.element)?[Nl(Vl(wd),Bd)]:[]},function(){return vt.none()}),Zm=Object.freeze({__proto__:null,flatgrid:Ad,init:function(t){return t.state(t)}}),tg=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element,t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},ng=Vd,eg=Vd,og=Vd,rg=jd(function(t,n,e,o){return Ld(t,n,e,o,-1)}),ig=jd(function(t,n,e,o){return Ld(t,n,e,o,1)}),ug=jd(function(t,n,e,o){return Wd(t,n,e,o,-1)}),ag=jd(function(t,n,e,o){return Wd(t,n,e,o,1)}),cg=Td([mo("selector"),Eo("execute",Dd),$u("onEscape"),Eo("captureTab",!1),Ia()],Ad,rt([Nl(Vl(Sd),Id(rg,ig)),Nl(Vl(Cd),Rd(rg,ig)),Nl(Vl(kd),ng(ug)),Nl(Vl(Od),eg(ag)),Nl(Pl([Hl,Vl(bd)]),Gd),Nl(Pl([_d,Vl(bd)]),Gd),Nl(Vl(xd),function(t,n,e){return e.onEscape(t,n)}),Nl(Vl(wd.concat(yd)),function(n,e,o,t){return(r=o).focusManager.get(n).bind(function(t){return Ru(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var r})]),rt([Nl(Vl(wd),Bd)]),function(){return vt.some(Ud)}),sg=[mo("selector"),Eo("getInitial",vt.none),Eo("execute",Dd),$u("onEscape"),Eo("executeOnMove",!1),Eo("allowVertical",!0)],lg=rt([Nl(Vl(wd),Bd)]),fg=Td(sg,xu.init,function(t,n,e,o){var r=Sd.concat(e.allowVertical?kd:[]),i=Cd.concat(e.allowVertical?Od:[]);return[Nl(Vl(r),$d(Id(Kd,Jd))),Nl(Vl(i),$d(Rd(Kd,Jd))),Nl(Vl(yd),Yd),Nl(Vl(wd),Yd),Nl(Vl(xd),Qd)]},lg,function(){return vt.some(qd)}),dg=[bo("selectors",[mo("row"),mo("cell")]),Eo("cycles",!0),Eo("previousSelector",vt.none),Eo("execute",Dd)],mg=im(function(t,n,e){return tm(t,n,e,-1)},function(t,n,e){return em(t,n,e,-1)}),gg=im(function(t,n,e){return tm(t,n,e,1)},function(t,n,e){return em(t,n,e,1)}),pg=im(function(t,n,e){return nm(t,e,n,-1)},function(t,n,e){return om(t,e,n,-1)}),hg=im(function(t,n,e){return nm(t,e,n,1)},function(t,n,e){return om(t,e,n,1)}),vg=rt([Nl(Vl(Sd),Id(mg,gg)),Nl(Vl(Cd),Rd(mg,gg)),Nl(Vl(kd),ng(pg)),Nl(Vl(Od),eg(hg)),Nl(Vl(wd.concat(yd)),function(n,e,o){return _a(n.element).bind(function(t){return o.execute(n,e,t)})})]),bg=rt([Nl(Vl(wd),Bd)]),yg=Td(dg,xu.init,vg,bg,function(){return vt.some(rm)}),xg=[mo("selector"),Eo("execute",Dd),Eo("moveOnTab",!1)],wg=rt([Nl(Vl(kd),og(cm)),Nl(Vl(Od),og(sm)),Nl(Pl([Hl,Vl(bd)]),function(t,n,e,o){return e.moveOnTab?og(cm)(t,n,e,o):vt.none()}),Nl(Pl([_d,Vl(bd)]),function(t,n,e,o){return e.moveOnTab?og(sm)(t,n,e,o):vt.none()}),Nl(Vl(yd),um),Nl(Vl(wd),um)]),Sg=rt([Nl(Vl(wd),Bd)]),kg=Td(xg,xu.init,wg,Sg,function(){return vt.some(am)}),Cg=Td([$u("onSpace"),$u("onEnter"),$u("onShiftEnter"),$u("onLeft"),$u("onRight"),$u("onTab"),$u("onShiftTab"),$u("onUp"),$u("onDown"),$u("onEscape"),Eo("stopSpaceKeyup",!1),wo("focusIn")],xu.init,function(t,n,e){return[Nl(Vl(wd),e.onSpace),Nl(Pl([_d,Vl(yd)]),e.onEnter),Nl(Pl([Hl,Vl(yd)]),e.onShiftEnter),Nl(Pl([Hl,Vl(bd)]),e.onShiftTab),Nl(Pl([_d,Vl(bd)]),e.onTab),Nl(Vl(kd),e.onUp),Nl(Vl(Od),e.onDown),Nl(Vl(Sd),e.onLeft),Nl(Vl(Cd),e.onRight),Nl(Vl(wd),e.onSpace),Nl(Vl(xd),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Nl(Vl(wd),Bd)]:[]},function(t){return t.focusIn}),Og=Jm.schema(),_g=$m.schema(),Tg=fg.schema(),Eg=cg.schema(),Dg=yg.schema(),Bg=Qm.schema(),Mg=kg.schema(),Ag=Cg.schema(),Fg=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Og,cyclic:_g,flow:Tg,flatgrid:Eg,matrix:Dg,execution:Bg,menu:Mg,special:Ag}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element,n.element)},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){nt(e,"setGridSize")?e.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Zm}),Ig=function(t,n){return t.components()},Rg=xa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,n,e,o){lm(t,0,Te,o)},prepend:function(t,n,e,o){lm(t,0,Mn,o)},remove:fm,replaceAt:dm,replaceBy:function(n,t,e,o,r){return P(Ig(n),o).bind(function(t){return dm(n,0,0,t,r)})},set:function(n,t,e,o){Ta(function(){var t=M(o,n.getSystem().build);Rs(n,t)},n.element)},contents:Ig})}),Vg=Object.freeze({__proto__:null,focus:gm,blur:function(t,n){n.ignore||t.element.dom.blur()},isFocused:function(t){return Ca(t.element)}}),Pg=Object.freeze({__proto__:null,exhibit:function(t,n){return Lr(n.ignore?{}:{attributes:{tabindex:"-1"}})},events:function(e){return eu([Cr(Bi(),function(t,n){gm(t,e),n.stop()})].concat(e.stopMousedown?[Cr(mi(),function(t,n){n.event.prevent()})]:[]))}}),Hg=xa({fields:[Ju("onFocus"),Eo("stopMousedown",!1),Eo("ignore",!1)],name:"focusing",active:Pg,apis:Vg}),zg=Object.freeze({__proto__:null,onLoad:xm,toggle:vm,isOn:function(t,n,e){return e.get()},on:bm,off:ym,set:Ym}),Ng=Object.freeze({__proto__:null,exhibit:function(){return Lr({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=vm,uu(function(t){r(t,e,o)})),u=ba(t,n,xm);return eu(ft([t.toggleOnExecute?[i]:[],[u]]))}}),Lg=xa({fields:[Eo("selected",!1),wo("toggleClass"),Eo("toggleOnExecute",!0),Do("aria",{mode:"none"},lo("mode",{pressed:[Eo("syncWithExpanded",!1),ta("update",function(t,n,e){on(t.element,"aria-pressed",e),n.syncWithExpanded&&qm(t,0,e)})],checked:[ta("update",function(t,n,e){on(t.element,"aria-checked",e)})],expanded:[ta("update",qm)],selected:[ta("update",function(t,n,e){on(t.element,"aria-selected",e)})],none:[ta("update",st)]}))],name:"toggling",active:Ng,apis:zg,state:{init:function(){var n=Po(!1);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(!1)},readState:function(){return n.get()}}}}}),Wg="alloy.item-hover",Ug="alloy.item-focus",jg=rt(Wg),Gg=rt(Ug),Xg=[mo("data"),mo("components"),mo("dom"),Eo("hasSubmenu",!1),wo("toggling"),Bf("itemBehaviours",[Lg,Hg,Fg,Df]),Eo("ignoreFocus",!1),Eo("domModification",{}),ta("builder",function(t){return{dom:t.dom,domModification:lt(lt({},t.domModification),{attributes:lt(lt(lt({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Mf(t.itemBehaviours,[t.toggling.fold(Lg.revoke,function(t){return Lg.config(lt({aria:{mode:"checked"}},t))}),Hg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Cm(t)}}),Fg.config({mode:"execution"}),Df.config({store:{mode:"memory",initialValue:t.data}}),mm("item-type-events",H(H([],wm(),!0),[Cr(vi(),km),Cr(Ri(),Hg.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}}),Eo("eventOrder",{})],Yg=[mo("dom"),mo("components"),ta("builder",function(t){return{dom:t.dom,components:t.components,events:eu([Cr(Ri(),function(t,n){n.stop()})])}})],qg=rt("item-widget"),Kg=rt([Jf({name:"widget",overrides:function(n){return{behaviours:nc([Df.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:st}})])}}})]),Jg=lo("type",{widget:[mo("uid"),mo("data"),mo("components"),mo("dom"),Eo("autofocus",!1),Eo("ignoreFocus",!1),Bf("widgetBehaviours",[Df,Hg,Fg]),Eo("domModification",{}),xl(Kg()),ta("builder",function(e){function o(t){return ml(t,e,"widget").map(function(t){return Fg.focusIn(t),t})}function t(t,n){return Ol(n.event.target)||e.autofocus&&n.setSource(t.element),vt.none()}var n=fl(qg(),e,Kg()),r=dl(qg(),e,n.internals());return{dom:e.dom,components:r,domModification:e.domModification,events:eu([uu(function(t,n){o(t).each(function(t){n.stop()})}),Cr(vi(),km),Cr(Ri(),function(t,n){e.autofocus?o(t):Hg.focus(t)})]),behaviours:Mf(e.widgetBehaviours,[Df.config({store:{mode:"memory",initialValue:e.data}}),Hg.config({ignore:e.ignoreFocus,onFocus:function(t){Cm(t)}}),Fg.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:rc(),onLeft:t,onRight:t,onEscape:function(t,n){return Hg.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element),vt.none()):(Hg.focus(t),vt.some(!0))}})])}})],item:Xg,separator:Yg}),$g=rt([Zf({factory:{sketch:function(t){var n=so("menu.spec item",Jg,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return Tt(n,"uid")?n:lt(lt({},n),{uid:pu("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Qg=rt([mo("value"),mo("items"),mo("dom"),mo("components"),Eo("eventOrder",{}),Zs("menuBehaviours",[hd,Df,cd,Fg]),Do("movement",{mode:"menu",moveOnTab:!0},lo("mode",{grid:[Ia(),ta("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[ta("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),mo("rowSelector")],menu:[Eo("moveOnTab",!0),ta("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),go("markers",Fa()),Eo("fakeFocus",!1),Eo("focusManager",Wl()),Ju("onHighlight")]),Zg=rt("alloy.menu-focus"),tp=Cl({name:"Menu",configFields:Qg(),partFields:$g(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:nl(t.menuBehaviours,[hd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Df.config({store:{mode:"memory",initialValue:t.value}}),cd.config({find:vt.some}),Fg.config(t.movement.config(t,t.movement))]),events:eu([Cr(Gg(),function(n,e){var t=e.event;n.getSystem().getByDom(t.target).each(function(t){hd.highlight(n,t),e.stop(),br(n,Zg(),{menu:n,item:t})})}),Cr(jg(),function(t,n){var e=n.event.item;hd.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),np=function(e,o,r,t){return tt(r,t).bind(function(t){return tt(e,t).bind(function(t){var n=np(e,o,r,t);return vt.some([t].concat(n))})}).getOr([])},ep=function(){function a(t){return n(t).bind(Km)}function e(t){return tt(c.get(),t)}var c=Po({}),i=Po({}),s=Po({}),l=gc(),u=Po({}),n=function(t){return tt(i.get(),t)};return{setMenuBuilt:function(t,n){var e;i.set(lt(lt({},i.get()),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){l.set(t),c.set(e),i.set(n),u.set(o);var r=function(t,n){var e={};J(t,function(t,n){St(t,function(t){e[t]=n})});var o=n,r=_t(n,function(t,n){return{k:t,v:n}}),i=dt(r,function(t,n){return[n].concat(np(e,o,r,n))});return dt(e,function(t){return tt(i,t).getOr([t])})}(o,e);s.set(r)},expand:function(e){return tt(c.get(),e).map(function(t){var n=tt(s.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return tt(s.get(),t)},collapse:function(t){return tt(s.get(),t).bind(function(t){return 1<t.length?vt.some(t.slice(1)):vt.none()})},lookupMenu:n,lookupItem:e,otherMenus:function(t){var n=u.get();return W(Ct(n),t)},getPrimary:function(){return l.get().bind(a)},getMenus:function(){return i.get()},clear:function(){c.set({}),i.set({}),s.set({}),l.clear()},isClear:function(){return l.get().isNone()},getTriggeringPath:function(t,u){var n=F(e(t).toArray(),function(t){return a(t).isSome()});return tt(s.get(),t).bind(function(t){var e=L(n.concat(t));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return vt.none();n.push(o.getOrDie())}return vt.some(n)}(z(e,function(t,n){return o=t,r=u,i=e.slice(0,n+1),a(o).bind(function(n){return e=o,Q(c.get(),function(t,n){return t===e}).bind(function(t){return r(t).map(function(t){return{triggeredMenu:n,triggeringItem:t,triggeringPath:i}})});var e}).fold(function(){return mt(l.get(),t)?[]:[vt.none()]},function(t){return[vt.some(t)]});var o,r,i}))})}}},op=Km,rp=rt("collapse-item"),ip=kl({name:"TieredMenu",configFields:[Zu("onExecute"),Zu("onEscape"),Qu("onOpenMenu"),Qu("onOpenSubmenu"),Ju("onRepositionMenu"),Ju("onCollapseMenu"),Eo("highlightImmediately",!0),bo("data",[mo("primary"),mo("menus"),mo("expansions")]),Eo("fakeFocus",!1),Ju("onHighlight"),Ju("onHover"),Yu(),mo("dom"),Eo("navigateOnHover",!0),Eo("stayInDom",!1),Zs("tmenuBehaviours",[Fg,hd,cd,Rg]),Eo("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)},repositionMenus:function(t,n){t.repositionMenus(n)}},factory:function(a,t){function e(t){var o,r,n=(o=t,r=a.data.primary,dt(a.data.menus,function(t,n){function e(){return tp.sketch(lt(lt({},t),{value:n,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:(a.fakeFocus?Ul:Wl)()}))}return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),e=dt(a.data.menus,function(t,n){return z(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})});return g.setContents(a.data.primary,n,a.data.expansions,e),g.getPrimary()}function c(t){return Df.getValue(t).value}function u(n,t){hd.highlight(n,t),hd.getHighlighted(t).orThunk(function(){return hd.getFirst(t)}).each(function(t){xr(n,t.element,Ri())})}function s(n,t){return et(M(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?vt.some(t.menu):vt.none()})}))}function l(n,t,e){var o=s(t,t.otherMenus(e));St(o,function(t){$r(t.element,[a.markers.backgroundMenu]),a.stayInDom||Rg.remove(n,t)})}function f(t,o){var n;J((n=t,r.get().getOrThunk(function(){var e={},t=F(vs(n.element,"."+a.markers.item),function(t){return"true"===un(t,"aria-haspopup")});return St(t,function(t){n.getSystem().getByDom(t).each(function(t){var n=c(t);e[n]=t})}),r.set(e),e})),function(t,n){var e=wt(o,n);on(t.element,"aria-expanded",e)})}function d(o,r,i){return vt.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return vt.none();var n=t.menu,e=s(r,i.slice(1));return St(e,function(t){Yr(t.element,a.markers.backgroundMenu)}),ve(n.element)||Rg.append(o,Eu(n)),$r(n.element,[a.markers.backgroundMenu]),u(o,n),l(o,r,i),vt.some(n)})})}var m,n,r=gc(),g=ep();function i(r,i,u){if(void 0===u&&(u=m.HighlightSubmenu),i.hasConfigured(gd)&&gd.isDisabled(i))return vt.some(i);var t=c(i);return g.expand(t).bind(function(o){return f(r,o),vt.from(o[0]).bind(function(e){return g.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return g.setMenuBuilt(n,o),o}(r,e,t);return ve(n.element)||Rg.append(r,Eu(n)),a.onOpenSubmenu(r,i,n,L(o)),u===m.HighlightSubmenu?(hd.highlightFirst(n),d(r,g,o)):(hd.dehighlightAll(n),vt.some(i))})})})}function o(n,e){var t=c(e);return g.collapse(t).bind(function(t){return f(n,t),d(n,g,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})}function p(e){return function(n,t){return Ru(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOptional().bind(function(t){return e(n,t).map(D)})})}}function h(t){return hd.getHighlighted(t).bind(hd.getHighlighted)}(n=m={})[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var v=eu([Cr(Zg(),function(e,o){var t=o.event.item;g.lookupItem(c(t)).each(function(){var t=o.event.menu;hd.highlight(e,t);var n=c(o.event.item);g.refresh(n).each(function(t){return l(e,g,t)})})}),uu(function(n,t){var e=t.event.target;n.getSystem().getByDom(e).each(function(t){0===c(t).indexOf("collapse-item")&&o(n,t),i(n,t,m.HighlightSubmenu).fold(function(){a.onExecute(n,t)},st)})}),ou(function(n,t){e(n).each(function(t){Rg.append(n,Eu(t)),a.onOpenMenu(n,t),a.highlightImmediately&&u(n,t)})})].concat(a.navigateOnHover?[Cr(jg(),function(t,n){var e=n.event.item,o=t,r=c(e);g.refresh(r).bind(function(t){return f(o,t),d(o,g,t)}),i(t,e,m.HighlightParent),a.onHover(t,e)})]:[])),b={collapseMenu:function(n){h(n).each(function(t){o(n,t)})},highlightPrimary:function(n){g.getPrimary().each(function(t){u(n,t)})},repositionMenus:function(o){g.getPrimary().bind(function(n){return h(o).bind(function(t){var n=c(t),e=et(M(Z(g.getMenus()),op));return g.getTriggeringPath(n,function(t){return n=t,K(e,function(t){return t.getSystem().isConnected()?V(hd.getCandidates(t),function(t){return c(t)===n}):vt.none()});var n})}).map(function(t){return{primary:n,triggeringPath:t}})}).fold(function(){vt.from(o.components()[0]).filter(function(t){return"menu"===un(t.element,"role")}).each(function(t){a.onRepositionMenu(o,t,[])})},function(t){var n=t.primary,e=t.triggeringPath;a.onRepositionMenu(o,n,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:nl(a.tmenuBehaviours,[Fg.config({mode:"special",onRight:p(function(t,n){return Ol(n.element)?vt.none():i(t,n,m.HighlightSubmenu)}),onLeft:p(function(t,n){return Ol(n.element)?vt.none():o(t,n)}),onEscape:p(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){g.getPrimary().each(function(t){xr(n,t.element,Ri())})}}),hd.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),cd.config({find:function(t){return hd.getHighlighted(t)}}),Rg.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:sr(t,n),expansions:{}}},collapseItem:function(t){return{value:Ir(rp()),meta:{text:t}}}}}),up=kl({name:"InlineView",configFields:[mo("lazySink"),Ju("onShow"),Ju("onHide"),Oo("onEscape"),Zs("inlineBehaviours",[bf,Df,ic]),To("fireDismissalEventInstead",[Eo("event",Yi())]),To("fireRepositionEventInstead",[Eo("event",qi())]),Eo("getRelated",vt.none),Eo("isExtraPart",T),Eo("eventOrder",vt.none)],factory:function(d,t){function n(e){bf.isOpen(e)&&Df.getValue(e).each(function(t){switch(t.mode){case"menu":bf.getState(e).each(ip.repositionMenus);break;case"position":var n=d.lazySink(e).getOrDie();ff.positionWithinBounds(n,e,t.config,t.getBounds())}})}function o(t,n,e,o){i(t,n,e,function(){return o.map(function(t){return Ae(t)})})}function r(t,n,e,o){var r,i,u,a,c,s=(r=d,i=t,u=n,a=o,c="horizontal"===e.type?{layouts:{onLtr:ha,onRtl:va}}:{},ip.sketch({dom:{tag:"div"},data:e.data,markers:e.menu.markers,highlightImmediately:e.menu.highlightImmediately,onEscape:function(){return bf.close(i),r.onEscape.map(function(t){return t(i)}),vt.some(!0)},onExecute:function(){return vt.some(!0)},onOpenMenu:function(t,n){ff.positionWithinBounds(l().getOrDie(),n,u,a())},onOpenSubmenu:function(t,n,e,o){var r=l().getOrDie();ff.position(r,e,{anchor:lt({type:"submenu",item:n},f(o))})},onRepositionMenu:function(t,n,e){var o=l().getOrDie();ff.positionWithinBounds(o,n,u,a()),St(e,function(t){var n=f(t.triggeringPath);ff.position(o,t.triggeredMenu,{anchor:lt({type:"submenu",item:t.triggeringItem},n)})})}}));function l(){return r.lazySink(i)}function f(t){return 2===t.length?c:{}}bf.open(t,s),Df.setValue(t,vt.some({mode:"menu",menu:s}))}var i=function(t,n,e,o){var r=d.lazySink(t).getOrDie();bf.openWhileCloaked(t,n,function(){return ff.positionWithinBounds(r,t,e,o())}),Df.setValue(t,vt.some({mode:"position",config:e,getBounds:o}))},e={setContent:function(t,n){bf.setContent(t,n)},showAt:function(t,n,e){o(t,n,e,vt.none())},showWithin:o,showWithinBounds:i,showMenuAt:function(t,n,e){r(t,n,e,vt.none)},showMenuWithinBounds:r,hide:function(t){bf.isOpen(t)&&(Df.setValue(t,vt.none()),bf.close(t))},getContent:function(t){return bf.getState(t)},reposition:n,isOpen:bf.isOpen};return{uid:d.uid,dom:d.dom,behaviours:nl(d.inlineBehaviours,[bf.config({isPartOf:function(t,n,e){return zu(n,e)||(o=e,d.getRelated(t).exists(function(t){return zu(t,o)}));var o},getAttachPoint:function(t){return d.lazySink(t).getOrDie()},onOpen:function(t){d.onShow(t)},onClose:function(t){d.onHide(t)}}),Df.config({store:{mode:"memory",initialValue:vt.none()}}),ic.config({channels:lt(lt({},Xs(lt({isExtraPart:t.isExtraPart},d.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ys(lt(lt({},d.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:n})))})]),eventOrder:d.eventOrder,apis:e}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showWithinBounds:function(t,n,e,o,r){t.showWithinBounds(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},showMenuWithinBounds:function(t,n,e,o,r){t.showMenuWithinBounds(n,e,o,r)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)},reposition:function(t,n){t.reposition(n)}}}),ap="layout-inset",cp=function(t,n,e){return ea(Om(t,n),t.y,e.insetNorth(),Na(),"north",ra(t,{top:2}),ap)},sp=function(t,n,e){return ea(Om(t,n),Tm(t,n),e.insetSouth(),La(),"south",ra(t,{bottom:3}),ap)},lp=tinymce.util.Tools.resolve("tinymce.util.Delay"),fp=kl({name:"Button",factory:function(t){function e(n){return tt(t.dom,"attributes").bind(function(t){return tt(t,n)})}var n=Sm(t.action),o=t.dom.tag;return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Mf(t.buttonBehaviours,[Hg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==o)return{role:e("role").getOr("button")};var t=e("type").getOr("button"),n=e("role").map(function(t){return{role:t}}).getOr({});return lt({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[Eo("uid",void 0),mo("dom"),Eo("components",[]),Bf("buttonBehaviours",[Hg,Fg]),wo("action"),wo("role"),Eo("eventOrder",{})]}),dp=tinymce.util.Tools.resolve("tinymce.util.I18n"),mp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},gp="temporary-placeholder",pp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},hp=kl({name:"Notification",factory:function(n){function e(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}}function o(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}}var t,r,i,u,a=zm({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:nc([Rg.config({})])}),c=zm({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(0)]},o(0)],behaviours:nc([Rg.config({})])}),s={updateProgress:function(t,n){t.getSystem().isConnected()&&c.getOpt(t).each(function(t){Rg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(n)]},o(n)])})},updateText:function(t,n){var e;t.getSystem().isConnected()&&(e=a.get(t),Rg.set(e,[ri(n)]))}},l=ft([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return vt.from(pp[t])}).toArray()]),f=zm(fp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Xm("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":n.translationProvider("Close")}},n.iconProvider)],action:function(t){n.onAction(t)}})),d=[(t=l,r={tag:"div",classes:["tox-notification__icon"]},i=n.iconProvider,u=i(),Gm(r,V(t,function(t){return Tt(u,Lm(t,u))}).getOr(gp),u,vt.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:nc([Rg.config({})])}];return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:nc([Hg.config({}),mm("notification-events",[Cr(bi(),function(t){f.getOpt(t).each(Hg.focus)})])]),components:d.concat(n.progress?[c.asSpec()]:[]).concat(n.closeButton?[f.asSpec()]:[]),apis:s}},configFields:[wo("level"),mo("progress"),mo("icon"),mo("onAction"),mo("text"),mo("iconProvider"),mo("translationProvider"),Fo("closeButton",!0)],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});function vp(e,o){function r(){b(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r(),i=setTimeout(function(){i=null,e.apply(null,t)},o)}}}function bp(o,t,n,e,r){var i=Bp(o,function(t){return(n=o).isBlock(e=t)||wt(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===n.getContentEditable(e);var n,e});return vt.from(i.backwards(t,n,e,r))}function yp(e,n){return Mp(At.fromDom(e.selection.getNode())).getOrThunk(function(){var i,u,t=At.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());return Te(t,At.fromDom(n.extractContents())),n.insertNode(t.dom),Yt(t).each(function(t){return t.dom.normalize()}),i=hs,(u=function(t){for(var n=Kt(t),e=n.length-1;0<=e;e--){var o=n[e];if(i(o))return vt.some(o);var r=u(o);if(r.isSome())return r}return vt.none()})(t).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===Ft(n=t)?1:ps(n).fold(function(){return Kt(n).length},function(t){return t.length}))}),t})}function xp(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function wp(t){return""!==t&&-1!==" \xa0\f\n\r\t\v".indexOf(t)}function Sp(t,n){return t.substring(n.length)}function kp(o,t,r,n){return void 0===n&&(n=0),Mp(At.fromDom(t.startContainer)).fold(function(){return function(t,o,i,r){if(void 0===r&&(r=0),!o.collapsed||3!==o.startContainer.nodeType)return vt.none();var n=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return bp(t,o.startContainer,o.startOffset,function(t,r,n){return function(t,n){for(var e=r-1;0<=e;e--){var o=t.charAt(e);if(wp(o))return vt.none();if(o===n)break}return vt.some(e)}(n,i).getOr(r)},n).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return vt.none();var e=xp(n);return 0!==e.lastIndexOf(i)||Sp(e,i).length<r?vt.none():vt.some({text:Sp(e,i),range:n,triggerChar:i})})}(o,t,r,n)},function(t){var n=o.createRng();n.selectNode(t.dom);var e=xp(n);return vt.some({range:n,text:Sp(e,r),triggerChar:r})})}function Cp(t,n){return{container:t,offset:n}}function Op(t){return ao("toolbarbutton",zp,t)}function _p(t){return ao("ToggleButton",Lp,t)}function Tp(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng().startContainer.nodeValue,u=F(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return e=n.dom,function(t){var n=Ip(t.startContainer,t.startOffset);return!bp(e,n.container,n.offset,function(t,n){return 0===n?-1:n},e.getRoot()).filter(function(t){return!wp(t.container.data.charAt(t.offset-1))}).isSome()};var e})(e.range,i,e.text)});if(0===u.length)return vt.none();var a=Ap.all(M(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction,highlightOn:n.highlightOn}})}));return vt.some({lookupData:a,context:e})}var Ep,Dp,Bp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Mp=function(t){return Ru(t,"[data-mce-autocompleter]")},Ap=tinymce.util.Tools.resolve("tinymce.util.Promise"),Fp=function(t){if(3===t.nodeType)return Cp(t,t.data.length);var n=t.childNodes;return 0<n.length?Fp(n[n.length-1]):Cp(t,n.length)},Ip=function(t,n){var e=t.childNodes;return 0<e.length&&n<e.length?Ip(e[n],0):0<e.length&&1===t.nodeType&&e.length===n?Fp(e[e.length-1]):Cp(t,n)},Rp=$o([po("type"),Co("text")]),Vp=$o([Eo("type","autocompleteitem"),Eo("active",!1),Eo("disabled",!1),Eo("meta",{}),po("value"),Co("text"),Co("icon")]),Pp=$o([po("type"),po("ch"),Bo("minChars",1),Eo("columns",1),Bo("maxResults",10),Oo("matches"),vo("fetch"),vo("onAction"),Ro("highlightOn",[],nr)]),Hp=[Fo("disabled",!1),Co("tooltip"),Co("icon"),Co("text"),Io("onSetup",function(){return st})],zp=$o([po("type"),vo("onAction")].concat(Hp)),Np=[Fo("active",!1)].concat(Hp),Lp=$o(Np.concat([po("type"),vo("onAction")])),Wp=[Io("predicate",T),Ao("scope","node",["node","editor"]),Ao("position","selection",["node","selection","line"])],Up=Hp.concat([Eo("type","contextformbutton"),Eo("primary",!1),vo("onAction"),cr("original",h)]),jp=Np.concat([Eo("type","contextformbutton"),Eo("primary",!1),vo("onAction"),cr("original",h)]),Gp=Hp.concat([Eo("type","contextformbutton")]),Xp=Np.concat([Eo("type","contextformtogglebutton")]),Yp=lo("type",{contextformbutton:Up,contextformtogglebutton:jp}),qp=$o([Eo("type","contextform"),Io("initValue",rt("")),Co("label"),xo("commands",Yp),So("launch",lo("type",{contextformbutton:Gp,contextformtogglebutton:Xp}))].concat(Wp)),Kp=$o([Eo("type","contexttoolbar"),po("items")].concat(Wp));function Jp(t){return tt(_h,t).getOr(kh)}function $p(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}}function Qp(t){var n=$p(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:Jp(t)}}function Zp(t,n,e){return{dom:{tag:"div",classes:ft([[$p(e).tieredMenu]])},markers:Qp(e)}}function th(n,e){return function(t){return M(p(t,e),function(t){return{dom:n,components:t}})}}function nh(t,e){var o=[],r=[];return St(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),M(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})}function eh(n,e){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[tp.parts.items({preprocess:function(t){return"auto"!==n&&1<n?th({tag:"div",classes:["tox-collection__group"]},n)(t):nh(t,function(t,n){return"separator"===e[n].type})}})]}}function oh(t){return d(t,function(t){return"icon"in t&&void 0!==t.icon})}function rh(t){return console.error(ur(t)),console.log(t),vt.none()}function ih(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[tp.parts.items({preprocess:function(t){return nh(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}}function uh(t,n,e,o,r){var i,u;return"color"===r?{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[tp.parts.items({preprocess:"auto"!==o?th({tag:"div",classes:["tox-swatches__row"]},o):h})]}]}).dom,components:i.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(i=eh(o,e)).dom,components:i.components,items:e}:"normal"===r&&1===o?{value:t,dom:(i=eh(1,e)).dom,components:i.components,items:e}:"normal"===r?{value:t,dom:(i=eh(o,e)).dom,components:i.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:{tag:"div",classes:ft([[(u=$p(r)).menu,"tox-menu-"+o+"-column"],n?[u.hasIcons]:[]])},components:Ih,items:e}:{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[tp.parts.items({preprocess:th({tag:"div",classes:["tox-collection__group"]},o)})]}).dom,components:i.components,items:e}}function ah(t,o,n){var r=vs(t.element,"."+n);if(0<r.length){var e=P(r,function(t){var n=t.dom.getBoundingClientRect().top,e=r[0].dom.getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return vt.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return vt.none()}function ch(t,n,e){t.getSystem().broadcastOn([Jh],{})}function sh(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))}function lh(t){return t.getParam("width",ev.DOM.getStyle(t.getElement(),"width"))}function fh(t){return vt.from(t.getParam("min_width")).filter(u)}function dh(t){return vt.from(t.getParam("min_height")).filter(u)}function mh(t){return vt.from(t.getParam("max_width")).filter(u)}function gh(t){return vt.from(t.getParam("max_height")).filter(u)}function ph(t){return!1!==t.getParam("menubar",!0,"boolean")}function hh(t){var n=t.getParam("toolbar",!0),e=!0===n,o=y(n),r=c(n)&&0<n.length;return!rv(t)&&(r||o||e)}function vh(n){var t=F(m(9,function(t){return n.getParam("toolbar"+(t+1),!1,"string")}),function(t){return"string"==typeof t});return 0<t.length?vt.some(t):vt.none()}(Dp=Ep={})[Dp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Dp[Dp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var bh,yh,xh,wh,Sh=Ep,kh="tox-menu-nav__js",Ch="tox-collection__item",Oh="tox-swatch",_h={normal:kh,color:Oh},Th="tox-collection__item--enabled",Eh="tox-collection__item-icon",Dh="tox-collection__item-label",Bh="tox-collection__item-caret",Mh="tox-collection__item--active",Ah="tox-collection__item-container",Fh="tox-collection__item-container--row",Ih=[tp.parts.items({})],Rh=[po("type"),po("src"),Co("alt"),Ro("classes",[],nr)],Vh=$o(Rh),Ph=[po("type"),po("text"),Co("name"),Ro("classes",["tox-collection__item-label"],nr)],Hh=$o(Ph),zh=Ze(function(){return ro("type",{cardimage:Vh,cardtext:Hh,cardcontainer:Nh})}),Nh=$o([po("type"),Mo("direction","horizontal"),Mo("align","left"),Mo("valign","middle"),xo("items",zh)]),Lh=[Fo("disabled",!1),Co("text"),Co("shortcut"),ar("value","value",je(function(){return Ir("menuitem-value")}),Zo()),Eo("meta",{})],Wh=$o([po("type"),Co("label"),xo("items",zh),Io("onSetup",function(){return st}),Io("onAction",st)].concat(Lh)),Uh=$o([po("type"),Fo("active",!1),Co("icon")].concat(Lh)),jh=[po("type"),po("fancytype"),Io("onAction",st)],Gh=lo("fancytype",{inserttable:[Eo("initData",{})].concat(jh),colorswatch:[Vo("initData",{},[Fo("allowCustomColors",!0),_o("colors",Zo())])].concat(jh)}),Xh=$o([po("type"),Io("onSetup",function(){return st}),Io("onAction",st),Co("icon")].concat(Lh)),Yh=$o([po("type"),vo("getSubmenuItems"),Io("onSetup",function(){return st}),Co("icon")].concat(Lh)),qh=$o([po("type"),Co("icon"),Fo("active",!1),Io("onSetup",function(){return st}),vo("onAction")].concat(Lh)),Kh=function(t){return n=Ir("unnamed-events"),nc([mm(n,t)]);var n},Jh=Ir("tooltip.exclusive"),$h=Ir("tooltip.show"),Qh=Ir("tooltip.hide"),Zh=Object.freeze({__proto__:null,hideAllExclusive:ch,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Rg.set(t,o)})}}),tv=Object.freeze({__proto__:null,events:function(r,i){function e(n){i.getTooltip().each(function(t){Hs(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()}return eu(ft([[Cr($h,function(o){i.resetTimer(function(){var t,n,e=o;i.isShowing()||(ch(e),t=r.lazySink(e).getOrDie(),n=e.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:eu("normal"===r.mode?[Cr(vi(),function(t){vr(e,$h)}),Cr(pi(),function(t){vr(e,Qh)})]:[]),behaviours:nc([Rg.config({})])}),i.setTooltip(n),Vs(t,n),r.onShow(e,n),ff.position(t,n,{anchor:r.anchor(e)}))},r.delay)}),Cr(Qh,function(t){i.resetTimer(function(){e(t)},r.delay)}),Cr(Fi(),function(t,n){n.universal||wt(n.channels,Jh)&&e(t)}),ru(function(t){e(t)})],"normal"===r.mode?[Cr(bi(),function(t){vr(t,$h)}),Cr(Mi(),function(t){vr(t,Qh)}),Cr(vi(),function(t){vr(t,$h)}),Cr(pi(),function(t){vr(t,Qh)})]:[Cr(Zi(),function(t,n){vr(t,$h)}),Cr(tu(),function(t){vr(t,Qh)})]]))}}),nv=xa({fields:[mo("lazySink"),mo("tooltipDom"),Eo("exclusive",!0),Eo("tooltipComponents",[]),Eo("delay",300),Ao("mode","normal",["normal","follow-highlight"]),Eo("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:rt([$a,Ja,Xa,qa,Ya,Ka]),onRtl:rt([$a,Ja,Xa,qa,Ya,Ka])}}}),Ju("onHide"),Ju("onShow")],name:"tooltipping",active:tv,state:Object.freeze({__proto__:null,init:function(){function e(){o.on(clearTimeout)}var o=gc(),t=gc(),n=rt("not-implemented");return wu({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:e,resetTimer:function(t,n){e(),o.set(setTimeout(t,n))},readState:n})}}),apis:Zh}),ev=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ov=tinymce.util.Tools.resolve("tinymce.EditorManager"),rv=function(t){return vh(t).fold(function(){return 0<t.getParam("toolbar",[],"string[]").length},D)};function iv(t){return t.getParam("toolbar_mode","","string")}function uv(t){return t.getParam("toolbar_location",xh.auto,"string")}function av(t){return uv(t)===xh.bottom}function cv(t){if(!t.inline)return vt.none();var n=t.getParam("fixed_toolbar_container","","string");if(0<n.length)return Iu(be(),n);var e=t.getParam("fixed_toolbar_container_target");return k(e)?vt.some(At.fromDom(e)):vt.none()}function sv(t){return t.inline&&cv(t).isSome()}function lv(t){return cv(t).getOrThunk(function(){return tn(ge(At.fromDom(t.getElement())))})}function fv(t){return t.inline&&!ph(t)&&!hh(t)&&!rv(t)}function dv(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!sv(t)&&!fv(t)}function mv(t,n){var e=t.outerContainer.element;n&&(t.mothership.broadcastOn([yf()],{target:e}),t.uiMothership.broadcastOn([yf()],{target:e})),t.mothership.broadcastOn([Kv],{readonly:n}),t.uiMothership.broadcastOn([Kv],{readonly:n})}function gv(t,n){t.on("init",function(){t.mode.isReadOnly()&&mv(n,!0)}),t.on("SwitchMode",function(){return mv(n,t.mode.isReadOnly())}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")}function pv(){var t;return ic.config({channels:((t={})[Kv]={schema:Jv,onReceive:function(t,n){gd.set(t,n.readonly)}},t)})}function hv(t,n){var e=t.getApi(n);return function(t){t(e)}}function vv(e,o){return ou(function(t){hv(e,t)(function(t){var n=e.onSetup(t);S(n)&&o.set(n)})})}function bv(n,e){return ru(function(t){return hv(n,t)(e.get())})}function yv(t,n,e,o){var r,i,u=Po(st);return{type:"item",dom:n.dom,components:tb(n.optComponents),data:t.data,eventOrder:Zv,hasSubmenu:t.triggersSubmenu,itemBehaviours:nc([mm("item-events",[(r=t,i=e,uu(function(t,n){hv(r,t)(r.onAction),r.triggersSubmenu||i!==Sh.CLOSE_ON_EXECUTE||(vr(t,Hi()),n.stop())})),vv(t,u),bv(t,u)]),gd.config({disabled:function(){return t.disabled||o.isDisabled()},disableClass:"tox-collection__item--state-disabled"}),pv(),Rg.config({})].concat(t.itemBehaviours))}}function xv(t){return{value:t.value,meta:lt({text:t.text.getOr("")},t.meta)}}function wv(t,n,e){return Xm(t,{tag:"div",classes:e=void 0===e?[Eh]:e},n)}function Sv(t){return{dom:{tag:"div",classes:[Dh]},components:[ri(dp.translate(t))]}}function kv(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}}function Cv(t,n){return{dom:{tag:"div",classes:[Dh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[ri(dp.translate(n))]}]}}function Ov(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(e=nb.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=M(t.split("+"),function(t){var n=t.toLowerCase().trim();return Tt(e,n)?e[n]:t}),nb.mac?n.join(""):n.join("+"))}};var e,n}function _v(t){return wv("checkmark",t,["tox-collection__item-checkmark"])}function Tv(t){var n=t.map(function(t){return{attributes:{title:dp.translate(t)}}}).getOr({});return lt({tag:"div",classes:[kh,Ch]},n)}function Ev(t,n,e,o){return void 0===o&&(o=vt.none()),"color"===t.presets?(r=n,i=o,c=t.ariaLabel,s=t.value,{dom:(u=t.iconContent.map(function(t){return n=r.icons,e=i,Wm(t,o=n()).or(e).getOrThunk(Nm(o));var n,e,o}).getOr(""),a={tag:"div",attributes:c.map(function(t){return{title:r.translate(t)}}).getOr({}),classes:["tox-swatch"]},lt(lt({},a),"custom"===s?{tag:"button",classes:H(H([],a.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:u}:"remove"===s?{classes:H(H([],a.classes,!0),["tox-swatch--remove"],!1),innerHtml:u}:{attributes:lt(lt({},a.attributes),{"data-mce-color":s}),styles:{"background-color":s}})),optComponents:[]}):(l=t,f=n,d=o,m={tag:"div",classes:[Eh]},g=e?l.iconContent.map(function(t){return Xm(t,m,f.icons,d)}).orThunk(function(){return vt.some({dom:m})}):vt.none(),p=l.checkMark,h=vt.from(l.meta).fold(function(){return Sv},function(t){return Tt(t,"style")?C(Cv,t.style):Sv}),v=l.htmlContent.fold(function(){return l.textContent.map(h)},function(t){return vt.some(kv(t,[Dh]))}),{dom:Tv(l.ariaLabel),optComponents:[g,v,l.shortcutContent.map(Ov),p,l.caret]});var r,i,u,a,c,s,l,f,d,m,g,p,h,v}function Dv(t,n){return tt(t,"tooltipWorker").map(function(e){return[nv.config({lazySink:n.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Vc}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){nv.setComponents(n,[Ou({element:At.fromDom(t)})])})}})]}).getOr([])}function Bv(t,n){var e=dp.translate(t),o=ev.DOM.encode(e);if(0<n.length){var r=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return o.replace(r,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return o}function Mv(t){return{value:t}}function Av(t){return rb.test(t)||ib.test(t)}function Fv(t){var n=t.toString(16);return(1===n.length?"0"+n:n).toUpperCase()}function Iv(t){return Mv(Fv(t.red)+Fv(t.green)+Fv(t.blue))}function Rv(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}}function Vv(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255}function Pv(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=ab(0,ub(i,1)),u=ab(0,ub(u,1));if(0===i)return Rv(n=e=o=cb(255*u),e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return Rv(n=cb(255*(n+l)),e=cb(255*(e+l)),o=cb(255*(o+l)),1)}function Hv(t){var n,e,o=(n={value:t.value.replace(rb,function(t,n,e,o){return n+n+e+e+o+o})},null===(e=ib.exec(n.value))?["FFFFFF","FF","FF","FF"]:e);return Rv(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16),1)}function zv(t,n,e,o){return Rv(parseInt(t,10),parseInt(n,10),parseInt(e,10),parseFloat(o))}function Nv(t){if("transparent"===t)return vt.some(Rv(0,0,0,0));var n=sb.exec(t);if(null!==n)return vt.some(zv(n[1],n[2],n[3],"1"));var e=lb.exec(t);return null!==e?vt.some(zv(e[1],e[2],e[3],e[4])):vt.none()}function Lv(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"}function Wv(t,n){return t.fire("ResizeContent",n)}function Uv(t,n,e){return{hue:t,saturation:n,value:e}}function jv(t){var n,e,o=0,r=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?Uv(0,0,100*(o=a)):(e=60*((r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),n=(c-a)/c,o=c,Uv(Math.round(e),Math.round(100*n),Math.round(100*o)))}function Gv(t){return Iv(Pv(t))}function Xv(o){return(Av(n=o)?vt.some({value:(Dt(t=n,"#")?t.substring("#".length):t).toUpperCase()}):vt.none()).orThunk(function(){return Nv(o).map(Iv)}).getOrThunk(function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=o,n.fillRect(0,0,1,1);var e=n.getImageData(0,0,1,1).data;return Iv(Rv(e[0],e[1],e[2],e[3]))});var t,n}(yh=bh=bh||{}).default="wrap",yh.floating="floating",yh.sliding="sliding",yh.scrolling="scrolling",(wh=xh=xh||{}).auto="auto",wh.top="top",wh.bottom="bottom";function Yv(t){return gd.config({disabled:t,disableClass:"tox-tbtn--disabled"})}var qv,Kv="silver.readonly",Jv=$o([go("readonly",er)]),$v=function(t){return gd.config({disabled:t})},Qv=function(t){return gd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Zv=((qv={})[Ii()]=["disabling","alloy.base.behaviour","toggling","item-events"],qv),tb=et,nb=tinymce.util.Tools.resolve("tinymce.Env"),eb=function(t,a){return M(t,function(t){switch(t.type){case"cardcontainer":return r=eb((o=t).items,a),i="vertical"===o.direction?"tox-collection__item-container--column":Fh,u="left"===o.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[Ah,i,u,function(){switch(o.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:r};case"cardimage":return e=t.src,{dom:{tag:"img",classes:t.classes,attributes:{src:e,alt:t.alt.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return wt(a.cardText.highlightOn,t)})?vt.from(a.cardText.matchText).getOr(""):"";return kv(Bv(t.text,n),t.classes)}var e,o,r,i,u})},ob=al(qg(),Kg()),rb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ib=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ub=Math.min,ab=Math.max,cb=Math.round,sb=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,lb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,fb=Rv(255,0,0,1),db=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),mb="tinymce-custom-colors";function gb(t){return!1!==t.getParam("custom_colors")}function pb(t){var n=t.getParam("color_map");return void 0!==n?function(t){for(var n=[],e=0;e<t.length;e+=2)n.push({text:t[e+1],value:"#"+Xv(t[e]).value,type:"choiceitem"});return n}(n):Mb}function hb(t){Ab.add(t)}function vb(t){var n,e=(n=pb(t).length,Math.max(5,Math.ceil(Math.sqrt(n))));return t.getParam("color_cols",e,"number")}function bb(t){var n="choiceitem",e={type:n,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:n,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}function yb(n,e,t,o){"custom"===t?Ib(n)(function(t){t.each(function(t){hb(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},Fb):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))}function xb(t,n){return t.concat(M(Ab.state(),function(t){return{type:Bb,text:t,value:t}}).concat(bb(n)))}function wb(n,e){return function(t){t(xb(n,e))}}function Sb(t,n,e){t.setIconFill("forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",e)}function kb(i,e,u,t,o){i.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var o,r=u;return i.dom.getParents(i.selection.getStart(),function(t){var n;(n=t.style["forecolor"===r?"color":"background-color"])&&(o=o||n)}),vt.from(o).bind(function(t){return Nv(t).map(function(t){var n=Iv(t).value;return ut(e.toLowerCase(),n)})}).getOr(!1)},columns:vb(i),fetch:wb(pb(i),gb(i)),onAction:function(t){yb(i,u,o.get(),st)},onItemAction:function(t,n){yb(i,u,n,function(t){o.set(t),i.fire("TextColorChange",{name:e,color:t})})},onSetup:function(n){function t(t){t.name===e&&Sb(n,t.name,t.color)}return Sb(n,e,o.get()),i.on("TextColorChange",t),function(){i.off("TextColorChange",t)}}})}function Cb(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){yb(n,e,t.value,st)}}]}})}function Ob(t,n,e,o,r,i,u,a){return uh(t,oh(n),Rb(n,e,o,"color"!==r?"normal":"color",i,u,a),o,r)}function _b(t,n){var e=Qp(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}}function Tb(t,n){return ri(n+"x"+t)}var Eb,Db,Bb="choiceitem",Mb=[{type:Bb,text:"Light Green",value:"#BFEDD2"},{type:Bb,text:"Light Yellow",value:"#FBEEB8"},{type:Bb,text:"Light Red",value:"#F8CAC6"},{type:Bb,text:"Light Purple",value:"#ECCAFA"},{type:Bb,text:"Light Blue",value:"#C2E0F4"},{type:Bb,text:"Green",value:"#2DC26B"},{type:Bb,text:"Yellow",value:"#F1C40F"},{type:Bb,text:"Red",value:"#E03E2D"},{type:Bb,text:"Purple",value:"#B96AD9"},{type:Bb,text:"Blue",value:"#3598DB"},{type:Bb,text:"Dark Turquoise",value:"#169179"},{type:Bb,text:"Orange",value:"#E67E23"},{type:Bb,text:"Dark Red",value:"#BA372A"},{type:Bb,text:"Dark Purple",value:"#843FA1"},{type:Bb,text:"Dark Blue",value:"#236FA1"},{type:Bb,text:"Light Gray",value:"#ECF0F1"},{type:Bb,text:"Medium Gray",value:"#CED4D9"},{type:Bb,text:"Gray",value:"#95A5A6"},{type:Bb,text:"Dark Gray",value:"#7E8C8D"},{type:Bb,text:"Navy Blue",value:"#34495E"},{type:Bb,text:"Black",value:"#000000"},{type:Bb,text:"White",value:"#ffffff"}],Ab=function(e){void 0===e&&(e=10);function o(t){i.splice(t,1)}var t,n=db.getItem(mb),r=y(n)?JSON.parse(n):[],i=e-(t=r).length<0?t.slice(0,e):t;return{add:function(t){var n;(-1===(n=l(i,t))?vt.none():vt.some(n)).each(o),i.unshift(t),i.length>e&&i.pop(),db.setItem(mb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Fb="#000000",Ib=function(r){return function(e,t){var o=!1;r.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{colorpicker:t},onAction:function(t,n){"hex-valid"===n.name&&(o=n.value)},onSubmit:function(t){var n=t.getData().colorpicker;o?(e(vt.from(n)),t.close()):r.windowManager.alert(r.translate(["Invalid hex color code: {0}",n]))},onClose:st,onCancel:function(){e(vt.none())}})}},Rb=function(e,o,r,i,u,a,c){return et(M(e,function(n){return"choiceitem"===n.type?ao("choicemenuitem",Uh,n).fold(rh,function(t){return vt.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=Ev({presets:e,textContent:t?n.text:vt.none(),htmlContent:vt.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:vt.none(),checkMark:t?vt.some(_v(u.icons)):vt.none(),caret:vt.none(),value:n.value},u,a);return Yo(yv({data:xv(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Lg.set(n,t)},isActive:function(){return Lg.isOn(n)},isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),st},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:n.active}})}(t,1===r,i,o,a(n.value),u,c,oh(e)))}):vt.none()}))},Vb=Ir("cell-over"),Pb=Ir("cell-execute"),Hb={inserttable:function(u){var t=Ir("size-label"),a=function(t){for(var n=[],e=0;e<10;e++){for(var o=[],r=0;r<10;r++)o.push(function(n,e,t){function o(t){return br(t,Pb,{row:n,col:e})}function r(t,n){n.stop(),o(t)}var i;return Tu({dom:{tag:"div",attributes:((i={role:"button"})["aria-labelledby"]=t,i)},behaviours:nc([mm("insert-table-picker-cell",[Cr(vi(),Hg.focus),Cr(Ii(),o),Cr(Ci(),r),Cr(Vi(),r)]),Lg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Hg.config({onFocus:function(t){return br(t,Vb,{row:n,col:e})}})])})}(e,r,t));n.push(o)}return n}(t),n=Tb(0,0),c=zm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[n],behaviours:nc([Rg.config({})])});return{type:"widget",data:{value:Ir("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ob.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:z(a,function(t){return M(t,Eu)}).concat(c.asSpec()),behaviours:nc([mm("insert-table-picker",[ou(function(t){Rg.set(c.get(t),[n])}),Er(Vb,function(t,n,e){var o=e.event,r=o.row,i=o.col;!function(t,n,e){for(var o=0;o<10;o++)for(var r=0;r<10;r++)Lg.set(t[o][r],o<=n&&r<=e)}(a,r,i),Rg.set(c.get(t),[Tb(r+1,i+1)])}),Er(Pb,function(t,n,e){var o=e.event,r=o.row,i=o.col;u.onAction({numRows:r+1,numColumns:i+1}),vr(t,Hi())})]),Fg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e,o,r,i=(o=t,r=(e=n).initData.allowCustomColors&&o.colorinput.hasCustomColors(),e.initData.colors.fold(function(){return xb(o.colorinput.getColors(),r)},function(t){return t.concat(bb(r))})),u=t.colorinput.getColorCols(),a=Ob(Ir("menu-value"),i,function(t){n.onAction({value:t})},u,"color",Sh.CLOSE_ON_EXECUTE,T,t.shared.providers),c=lt(lt({},a),{markers:Qp("color"),movement:_b(u,"color")});return{type:"widget",data:{value:Ir("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ob.widget(tp.sketch(c))]}}},zb=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:lt({tag:"div",classes:[Ch,"tox-collection__group-heading"]},n),components:[]}},Nb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ev({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,caret:vt.none(),checkMark:vt.none(),shortcutContent:t.shortcut},e,o);return yv({data:xv(t),getApi:function(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},Lb=function(t,n,e,o,r){void 0===o&&(o=!0);var i=(r=void 0!==r&&r)?wv("chevron-down",e.icons,[Bh]):wv("chevron-right",e.icons,[Bh]),u=Ev({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,caret:vt.some(i),checkMark:vt.none(),shortcutContent:t.shortcut},e,o);return yv({data:xv(t),getApi:function(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}},disabled:t.disabled,onAction:st,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n,e)},Wb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ev({iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,checkMark:vt.some(_v(e.icons)),caret:vt.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return Yo(yv({data:xv(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Lg.set(n,t)},isActive:function(){return Lg.isOn(n)},isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:t.active}})},Ub=function(n,e){return tt(Hb,n.fancytype).map(function(t){return t(n,e)})};function jb(t,u,a,n,c,s,l){var e=1===n,o=!e||oh(t);return et(M(t,function(t){switch(t.type){case"separator":return ao("Autocompleter.Separator",Rp,t).fold(rh,function(t){return vt.some(zb(t))});case"cardmenuitem":return ao("cardmenuitem",Wh,t).fold(rh,function(n){return vt.some((t=lt(lt({},n),{onAction:function(t){n.onAction(t),a(n.value,n.meta)}}),e=c,o=s,r={itemBehaviours:Dv(n.meta,s),cardText:{matchText:u,highlightOn:l}},i={dom:Tv(t.label),optComponents:[vt.some({dom:{tag:"div",classes:[Ah,Fh]},components:eb(t.items,r)})]},yv({data:xv(lt({text:vt.none()},t)),disabled:t.disabled,getApi:function(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(n){gd.set(e,n),St(vs(e.element,"*"),function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(gd)&&gd.set(t,n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:vt.from(r.itemBehaviours).getOr([])},i,e,o.providers)));var t,e,o,r,i});default:return ao("Autocompleter.Item",Vp,t).fold(rh,function(t){return vt.some(function(n,e,t,o,r,i,u,a){void 0===a&&(a=!0);var c=Ev({presets:o,textContent:vt.none(),htmlContent:t?n.text.map(function(t){return Bv(t,e)}):vt.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:vt.none(),checkMark:vt.none(),caret:vt.none(),value:n.value},u.providers,a,n.icon);return yv({data:xv(n),disabled:n.disabled,getApi:rt({}),onAction:function(t){return r(n.value,n.meta)},onSetup:rt(st),triggersSubmenu:!1,itemBehaviours:Dv(n.meta,u)},c,i,u.providers)}(t,u,e,"normal",a,c,s,o))})}}))}function Gb(t,n,e,o,r){var i=oh(n),u=et(M(n,function(t){function n(t){return function(t,n,e,o,r){function i(t){return r?lt(lt({},t),{shortcut:vt.none(),icon:t.text.isSome()?vt.none():t.icon}):t}var u=e.shared.providers;switch(t.type){case"menuitem":return ao("menuitem",Xh,t).fold(rh,function(t){return vt.some(Nb(i(t),n,u,o))});case"nestedmenuitem":return ao("nestedmenuitem",Yh,t).fold(rh,function(t){return vt.some(Lb(i(t),n,u,o,r))});case"togglemenuitem":return ao("togglemenuitem",qh,t).fold(rh,function(t){return vt.some(Wb(i(t),n,u,o))});case"separator":return ao("separatormenuitem",Rp,t).fold(rh,function(t){return vt.some(zb(t))});case"fancymenuitem":return ao("fancymenuitem",Gh,t).fold(rh,function(t){return Ub(i(t),e)});default:return console.error("Unknown item in general menu",t),vt.none()}}(t,e,o,r?!Tt(t,"text"):i,r)}return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(lt(lt({},t),{disabled:!0})):n(t)}));return(r?ih:uh)(t,i,u,1,"normal")}function Xb(t){return ip.singleData(t.value,t)}function Yb(t,n,e){return Ru(t,n,e).isSome()}function qb(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=setTimeout(function(){e.apply(null,t),r=null},o)}}}function Kb(t){var n=t.raw;return void 0===n.touches||1!==n.touches.length?vt.none():vt.some(n.touches[0])}function Jb(){return le().browser.isFirefox()}function $b(n,t){var e,o,r,i,u,a,c,s,l,f=lt({stopBackspace:!0},t),d=(u=f,a=gc(),c=Po(!1),s=qb(function(t){u.triggerEvent(Pi(),t),c.set(!0)},400),l=lr([{key:si(),value:function(e){return Kb(e).each(function(t){s.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};s.schedule(e),c.set(!1),a.set(n)}),vt.none()}},{key:li(),value:function(t){return s.cancel(),Kb(t).each(function(i){a.on(function(t){var n=i,e=t,o=Math.abs(n.clientX-e.x),r=Math.abs(n.clientY-e.y);(5<o||5<r)&&a.clear()})}),vt.none()}},{key:fi(),value:function(n){return s.cancel(),a.get().filter(function(t){return Lt(t.target,n.target)}).map(function(t){return c.get()?(n.prevent(),!1):u.triggerEvent(Vi(),n)})}}]),{fireIfReady:function(n,t){return tt(l,t).bind(function(t){return t(n)})}}),m=M(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return pc(n,t,function(n){d.fireIfReady(n,t).each(function(t){t&&n.kill()}),f.triggerEvent(t,n)&&n.kill()})}),g=gc(),p=pc(n,"paste",function(n){d.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),f.triggerEvent("paste",n)&&n.kill(),g.set(setTimeout(function(){f.triggerEvent(Ai(),n)},0))}),h=pc(n,"keydown",function(t){var n;f.triggerEvent("keydown",t)?t.kill():!f.stopBackspace||(n=t).raw.which!==vd[0]||wt(["input","textarea"],Ft(n.target))||Yb(n.target,'[contenteditable="true"]')||t.prevent()}),v=(e=n,o=function(t){f.triggerEvent("focusin",t)&&t.kill()},Jb()?hc(e,"focus",o):pc(e,"focusin",o)),b=gc(),y=(r=n,i=function(t){f.triggerEvent("focusout",t)&&t.kill(),b.set(setTimeout(function(){f.triggerEvent(Mi(),t)},0))},Jb()?hc(r,"blur",i):pc(r,"focusout",i));return{unbind:function(){St(m,function(t){t.unbind()}),h.unbind(),v.unbind(),y.unbind(),p.unbind(),g.on(clearTimeout),b.on(clearTimeout)}}}function Qb(t,n){return Po(tt(t,"target").getOr(n))}function Zb(t,o,n,e,r,i){var u,a,c=t(o,e),s=(u=Po(!1),a=Po(!1),{stop:function(){u.set(!0)},cut:function(){a.set(!0)},isStopped:u.get,isCut:a.get,event:n,setSource:r.set,getSource:r.get});return c.fold(function(){return i.logEventNoHandlers(o,e),ay.complete()},function(n){var e=n.descHandler;return Wr(e)(s),s.isStopped()?(i.logEventStopped(o,n.element,e.purpose),ay.stopped()):s.isCut()?(i.logEventCut(o,n.element,e.purpose),ay.complete()):Yt(n.element).fold(function(){return i.logNoParent(o,n.element,e.purpose),ay.complete()},function(t){return i.logEventResponse(o,n.element,e.purpose),ay.resume(t)})})}function ty(){function r(t){Rr(t.element).each(function(t){delete a[t],i.unregisterId(t)})}var u,i=(u={},{registerId:function(r,i,t){J(t,function(t,n){var e,o=void 0!==u[n]?u[n]:{};o[i]={cHandler:C.apply(void 0,[(e=t).handler].concat(r)),purpose:e.purpose},u[n]=o})},unregisterId:function(e){J(u,function(t,n){Tt(t,e)&&delete t[e]})},filterByType:function(t){return tt(u,t).map(function(t){return $(t,function(t,n){return{id:n,descHandler:t}})}).getOr([])},find:function(t,n,e){return tt(u,n).bind(function(o){return mr(e,function(t){return n=o,Rr(e=t).bind(function(t){return tt(n,t)}).map(function(t){return{element:e,descHandler:t}});var n,e},t)})}}),a={};return{find:function(t,n,e){return i.find(t,n,e)},filter:function(t){return i.filterByType(t)},register:function(t){var e,o=Rr((e=t).element).getOrThunk(function(){return t=e.element,n=Ir(du+"uid-"),gu(t,n),n;var t,n});nt(a,o)&&function(t){var n=a[o];if(n!==t)throw new Error('The tagId "'+o+'" is already used by: '+Fr(n.element)+"\nCannot use it for: "+Fr(t.element)+"\nThe conflicting element is"+(ve(n.element)?" ":" not ")+"already in the DOM");r(t)}(t),i.registerId([t],o,t.events),a[o]=t},unregister:r,getById:function(t){return tt(a,t)}}}function ny(e){function o(n){return Yt(e.element).fold(D,function(t){return Lt(n,t)})}function s(t,n){return i.find(o,t,n)}function r(n){var t=i.filter(Fi());St(t,function(t){Wr(t.descHandler)(n)})}var i=ty(),t=$b(e.element,{triggerEvent:function(n,e){return Lu(n,e.target,function(t){return sy(s,n,e,e.target,t)})}}),u={debugInfo:rt("real"),triggerEvent:function(n,e,o){Lu(n,e,function(t){return sy(s,n,o,e,t)})},triggerFocus:function(a,c){Rr(a).fold(function(){ka(a)},function(t){Lu(Bi(),a,function(t){var n,e,o=s,r=Bi(),i=t,u=Qb(n={originator:c,kill:st,prevent:st,target:a},e=a);return Zb(o,r,n,e,u,i),!1})})},triggerEscape:function(t,n){u.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Tu,addToGui:function(t){c(t)},removeFromGui:function(t){l(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:D},n=function(t){t.connect(u),Yn(t.element)||(i.register(t),St(t.components(),n),u.triggerEvent(Ni(),t.element,{target:t.element}))},a=function(t){Yn(t.element)||(St(t.components(),a),i.unregister(t)),t.disconnect()},c=function(t){Vs(e,t)},l=function(t){Hs(t)},f=function(t){r({universal:!0,data:t})},d=function(t,n){r({universal:!1,channels:t,data:n})},m=function(t,n){var e,o,r=i.filter(t);return o={stop:function(){e.set(!0)},cut:st,isStopped:(e=Po(!1)).get,isCut:T,event:n,setSource:_("Cannot set source of a broadcasted event"),getSource:_("Cannot get source of a broadcasted event")},St(r,function(t){Wr(t.descHandler)(o)}),o.isStopped()},g=function(t){return i.getById(t).fold(function(){return Ve.error(new Error('Could not find component with uid: "'+t+'" in system.'))},Ve.value)},p=function(t){var n=Rr(t).getOr("not found");return g(n)};return n(e),{root:e,element:e.element,destroy:function(){t.unbind(),Ee(e.element)},add:c,remove:l,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}}function ey(t,n,e,o){var r=vy(t,n,e,o);return my.sketch(r)}function oy(t,n){return my.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})}function ry(t){return nc([Hg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=Qr(n);n.dom.setSelectionRange(0,e.length)}:st})])}function iy(t){return{tag:t.tag,attributes:lt({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}}(Db=Eb={})[Db.ContentFocus=0]="ContentFocus",Db[Db.UiFocus=1]="UiFocus";function uy(f,c){function e(){return r.get().isSome()}function s(){e()&&up.hide(d)}var o,t,r=gc(),l=Po(!1),d=Tu(up.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:nc([mm("dismissAutocompleter",[Cr(Yi(),function(){return m()})])]),lazySink:c.getSink})),m=function(){var t;e()&&(t=r.get().map(function(t){return t.element}),Mp(t.getOr(At.fromDom(f.selection.getNode()))).each(In),s(),r.clear(),l.set(!1))},u=Rt(function(){return e=dt(f.ui.registry.getAll().popups,function(t){return ao("Autocompleter",Pp,t).fold(function(t){throw new Error(ur(t))},h)}),t=$(e,function(t){return t.ch}),n={},St(t,function(t){n[t]={}}),o=Ct(n),r=Z(e),{dataset:e,triggerChars:o,lookupByChar:function(n){return F(r,function(t){return t.ch===n})}};var t,n,e,o,r}),g=function(t){var n=t;r.get().map(function(t){return kp(f.dom,f.selection.getRng(),t.triggerChar).bind(function(t){return Tp(f,u,t,n)})}).getOrThunk(function(){return n=f,t=(e=u)(),o=n.selection.getRng(),r=n.dom,i=o,K(t.triggerChars,function(t){return kp(r,i,t)}).bind(function(t){return Tp(n,e,t)});var n,e,t,o,r,i}).fold(m,function(a){var t,n=a.context;e()||(t=yp(f,n.range),r.set({triggerChar:n.triggerChar,element:t,matchLength:n.text.length}),l.set(!1)),a.lookupData.then(function(u){r.get().map(function(t){var n,e,o,r,i=a.context;t.triggerChar===i.triggerChar&&(e=i.triggerChar,r=K(o=u,function(t){return vt.from(t.columns)}).getOr(1),0<(n=z(o,function(i){return jb(i.items,i.matchText,function(o,r){var t=f.selection.getRng();kp(f.dom,t,e).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var n=t.range,e={hide:function(){m()},reload:function(t){s(),g(t)}};l.set(!0),i.onAction(e,n,o,r),l.set(!1)})},r,Sh.BUBBLE_TO_SANDBOX,c,i.highlightOn)})).length?function(t,n,e,o){t.matchLength=n.text.length;var r,i,u,a,c,s,l=K(e,function(t){return vt.from(t.columns)}).getOr(1);up.showAt(d,tp.sketch((r=uh("autocompleter-value",!0,o,l,"normal"),i=l,a=((u=Eb.ContentFocus)===Eb.ContentFocus?Ul:Wl)(),c=_b(i,"normal"),s=Qp("normal"),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:s.selectedItem,item:s.item},movement:c,fakeFocus:u===Eb.ContentFocus,focusManager:a,menuBehaviours:Kh("auto"!==i?[]:[ou(function(o,t){ah(o,4,s.item).each(function(t){var n=t.numColumns,e=t.numRows;Fg.setGridSize(o,e,n)})})])})),{anchor:{type:"node",root:At.fromDom(f.getBody()),node:vt.from(t.element)}}),up.getContent(d).each(hd.highlightFirst)}(t,i,u,n):(10<=i.text.length-t.matchLength?m:s)())})})})},n={onKeypress:vp(function(t){27!==t.which&&g()},50),cancelIfNecessary:m,isMenuOpen:function(){return up.isOpen(d)},isActive:e,isProcessingAction:l.get,getView:function(){return up.getContent(d)}};function i(t,n){br(t,xi(),{raw:n})}!1===f.hasPlugin("rtc")&&(o=n,(t=f).on("keypress compositionend",o.onKeypress.throttle),t.on("remove",o.onKeypress.cancel),t.on("keydown",function(n){function t(){return o.getView().bind(hd.getHighlighted)}8===n.which&&o.onKeypress.throttle(n),o.isActive()&&(27===n.which&&o.cancelIfNecessary(),o.isMenuOpen()?13===n.which?(t().each(yr),n.preventDefault()):40===n.which?(t().fold(function(){o.getView().each(hd.highlightFirst)},function(t){i(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){i(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==n.which&&38!==n.which&&40!==n.which||o.cancelIfNecessary())}),t.on("NodeChange",function(t){o.isActive()&&!o.isProcessingAction()&&Mp(At.fromDom(t.element)).isNone()&&o.cancelIfNecessary()}))}var ay=Ho([{stopped:[]},{resume:["element"]},{complete:[]}]),cy=function(n,e,o,t,r,i){return Zb(n,e,o,t,r,i).fold(D,function(t){return cy(n,e,o,t,r,i)},T)},sy=function(t,n,e,o,r){var i=Qb(e,o);return cy(t,n,e,o,i,r)},ly=kl({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=B(n,["attributes"]);return{uid:t.uid,dom:lt({tag:"div",attributes:lt({role:"presentation"},e)},o),components:t.components,behaviours:tl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Eo("components",[]),Zs("containerBehaviours",[]),Eo("events",{}),Eo("domModification",{}),Eo("eventOrder",{})]}),fy=rt([Eo("prefix","form-field"),Zs("fieldBehaviours",[cd,Df])]),dy=rt([Qf({schema:[mo("dom")],name:"label"}),Qf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[mo("text")],name:"aria-descriptor"}),Jf({factory:{sketch:function(t){var e,o,n=(e=["factory"],o={},J(t,function(t,n){wt(e,n)||(o[n]=t)}),o);return t.factory.sketch(n)}},schema:[mo("factory")],name:"field"})]),my=Cl({name:"FormField",configFields:fy(),partFields:dy(),factory:function(r,t,n,e){var o=nl(r.fieldBehaviours,[cd.config({find:function(t){return ml(t,r,"field")}}),Df.config({store:{mode:"manual",getValue:function(t){return cd.getCurrent(t).bind(Df.getValue)},setValue:function(t,n){cd.getCurrent(t).each(function(t){Df.setValue(t,n)})}}})]),i=eu([ou(function(t,n){var o=pl(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=Ir(r.prefix);o.label().each(function(t){on(t.element,"for",n),on(e.element,"id",n)}),o["aria-descriptor"]().each(function(t){var n=Ir(r.prefix);on(t.element,"id",n),on(e.element,"aria-describedby",n)})})})]);return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:{getField:function(t){return ml(t,r,"field")},getLabel:function(t){return ml(t,r,"label")}}}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),gy=Object.freeze({__proto__:null,exhibit:function(t,n){return Lr({attributes:lr([{key:n.tabAttr,value:"true"}])})}}),py=xa({fields:[Eo("tabAttr","data-alloy-tabstop")],name:"tabstopping",active:gy}),hy=tinymce.util.Tools.resolve("tinymce.html.Entities"),vy=function(t,n,e,o){return{dom:by(e),components:t.toArray().concat([n]),fieldBehaviours:nc(o)}},by=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},yy=Ir("form-component-change"),xy=Ir("form-close"),wy=Ir("form-cancel"),Sy=Ir("form-action"),ky=Ir("form-submit"),Cy=Ir("form-block"),Oy=Ir("form-unblock"),_y=Ir("form-tabchange"),Ty=Ir("form-resize"),Ey=rt([wo("data"),Eo("inputAttributes",{}),Eo("inputStyles",{}),Eo("tag","input"),Eo("inputClasses",[]),Ju("onSetValue"),Eo("styles",{}),Eo("eventOrder",{}),Zs("inputBehaviours",[Df,Hg]),Eo("selectOnFocus",!0)]),Dy=kl({name:"Input",configFields:Ey(),factory:function(t,n){return{uid:t.uid,dom:iy(t),components:[],behaviours:lt(lt({},ry(e=t)),nl(e.inputBehaviours,[Df.config({store:lt(lt({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Qr(t.element)},setValue:function(t,n){Qr(t.element)!==n&&Zr(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),By={},My={exports:By};function Ay(t){setTimeout(function(){throw t},0)}function Fy(t){var n=Ft(t);return wt(Xy,n)}function Iy(t,n){qr(n.getRoot(t).getOr(t.element),n.invalidClass),n.notify.each(function(n){Fy(t.element)&&on(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){Ar(t,n.validHtml)}),n.onValid(t)})}function Ry(n,t,e,o){Yr(t.getRoot(n).getOr(n.element),t.invalidClass),t.notify.each(function(t){Fy(n.element)&&on(n.element,"aria-invalid",!0),t.getContainer(n).each(function(t){Ar(t,o)}),t.onInvalid(n,o)})}function Vy(n,t,e){return t.validator.fold(function(){return Gy(Ve.value(!0))},function(t){return t.validate(n)})}function Py(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),Vy(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return Ry(n,e,0,t),Ve.error(t)},function(t){return Iy(n,e),Ve.value(t)}):Ve.error("No longer in system")})}!function(){var t=this,n=function(){var t,n,e,o={exports:{}};function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(e,o){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn(function(){var t,n=1===e._state?o.onFulfilled:o.onRejected;if(null!==n){try{t=n(e._value)}catch(t){return void c(o.promise,t)}a(o.promise,t)}else(1===e._state?a:c)(o.promise,e._value)})):e._deferreds.push(o)}function a(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void s(n);if("function"==typeof e)return void f((o=e,r=t,function(){o.apply(r,arguments)}),n)}n._state=1,n._value=t,s(n)}catch(t){c(n,t)}var o,r}function c(t,n){t._state=2,t._value=n,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var n=0,e=t._deferreds.length;n<e;n++)u(t,t._deferreds[n]);t._deferreds=null}function l(t,n,e){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.promise=e}function f(t,n){var e=!1;try{t(function(t){e||(e=!0,a(n,t))},function(t){e||(e=!0,c(n,t))})}catch(t){if(e)return;e=!0,c(n,t)}}t=o,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=setTimeout,i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,n){var e=new this.constructor(r);return u(this,new l(t,n,e)),e},i.all=function(t){var a=Array.prototype.slice.call(t);return new i(function(r,i){if(0===a.length)return r([]);for(var u=a.length,t=0;t<a.length;t++)!function n(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if("function"==typeof o)return o.call(t,function(t){n(e,t)},i),0}a[e]=t,0==--u&&r(a)}catch(t){i(t)}}(t,a[t])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(t){t(n)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(r){return new i(function(t,n){for(var e=0,o=r.length;e<o;e++)r[e].then(t,n)})},i._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){e(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},t.exports?t.exports=i:n.Promise||(n.Promise=i);var d=o.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof By&&void 0!==My?My.exports=n():(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=n()}();var Hy,zy,Ny=My.exports.boltExport,Ly=function(t){function o(t){r()?i(t):n.push(t)}var e=vt.none(),n=[],r=function(){return e.isSome()},i=function(n){e.each(function(t){setTimeout(function(){n(t)},0)})};return t(function(t){r()||(e=vt.some(t),St(n,i),n=[])}),{get:o,map:function(e){return Ly(function(n){o(function(t){n(e(t))})})},isReady:r}},Wy={nu:Ly,pure:function(n){return Ly(function(t){t(n)})}},Uy=function(e){function t(t){e().then(t,Ay)}return{map:function(t){return Uy(function(){return e().then(t)})},bind:function(n){return Uy(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(t){return Uy(function(){return e().then(function(){return t.toPromise()})})},toLazy:function(){return Wy.nu(t)},toCached:function(){var t=null;return Uy(function(){return t=null===t?e():t})},toPromise:e,get:t}},jy=function(t){return Uy(function(){return new Ny(t)})},Gy=function(t){return Uy(function(){return Ny.resolve(t)})},Xy=["input","textarea"],Yy=Object.freeze({__proto__:null,markValid:Iy,markInvalid:Ry,query:Vy,run:Py,isInvalid:function(t,n){return Kr(n.getRoot(t).getOr(t.element),n.invalidClass)}}),qy=Object.freeze({__proto__:null,events:function(n,t){return n.validator.map(function(t){return eu([Cr(t.onEvent,function(t){Py(t,n).get(h)})].concat(t.validateOnLoad?[ou(function(t){Py(t,n).get(st)})]:[]))}).getOr({})}}),Ky=xa({fields:[mo("invalidClass"),Eo("getRoot",vt.none),To("notify",[Eo("aria","alert"),Eo("getContainer",vt.none),Eo("validHtml",""),Ju("onValid"),Ju("onInvalid"),Ju("onValidate")]),To("validator",[mo("validate"),Eo("onEvent","input"),Eo("validateOnLoad",!0)])],name:"invalidating",active:qy,apis:Yy,extra:{validation:function(e){return function(t){var n=Df.getValue(t);return Gy(e(n))}}}}),Jy=Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),$y=xa({fields:[go("others",uo(Ve.value,Zo()))],name:"coupling",apis:Jy,state:Object.freeze({__proto__:null,init:function(){var i={},t=rt({});return wu({readState:t,getOrCreate:function(e,o,r){var t=Ct(o.others);if(t)return tt(i,r).getOrThunk(function(){var t=tt(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(t,null,2))}})}})}),Qy=rt("sink"),Zy=rt(Qf({name:Qy(),overrides:rt({dom:{tag:"div"},behaviours:nc([ff.config({useFixed:D})]),events:eu([Dr(xi()),Dr(mi()),Dr(Ci())])})}));function tx(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:"hotspot",hotspot:e,overrides:o}},function(t){return{type:"hotspot",hotspot:e,overrides:o,layouts:t}})}function nx(t,n,e,o,r,i,u){var a,c=tx(t,e),s=e,l=o,f=r,d=u,m=n,g=(0,(a=t).fetch)(s).map(m),p=mw(s,a);return g.map(function(t){return t.bind(function(t){return vt.from(ip.sketch(lt(lt({},f.menu()),{uid:pu(""),data:t,highlightImmediately:d===Hy.HighlightFirst,onOpenMenu:function(t,n){var e=p().getOrDie();ff.position(e,n,{anchor:c}),bf.decloak(l)},onOpenSubmenu:function(t,n,e){var o=p().getOrDie();ff.position(o,e,{anchor:{type:"submenu",item:n}}),bf.decloak(l)},onRepositionMenu:function(t,n,e){var o=p().getOrDie();ff.position(o,n,{anchor:c}),St(e,function(t){ff.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return Hg.focus(s),bf.close(l),vt.some(!0)}})))})}).map(function(t){return t.fold(function(){bf.isOpen(o)&&bf.close(o)},function(t){bf.cloak(o),bf.open(o,t),i(o)}),o})}function ex(t,n,e,o,r,i){var u=$y.getCoupled(e,"sandbox");return(bf.isOpen(u)?function(t,n,e,o,r,i,u){return bf.close(o),Gy(o)}:nx)(t,n,e,u,o,r,i)}function ox(t){bf.getState(t).each(function(t){ip.repositionMenus(t)})}function rx(s,l,f){var d=Vu(),t=mw(l,s);return{dom:{tag:"div",classes:s.sandboxClasses,attributes:{id:d.id,role:"listbox"}},behaviours:Mf(s.sandboxBehaviours,[Df.config({store:{mode:"memory",initialValue:l}}),bf.config({onOpen:function(t,n){var e,o,r,i,u,a,c=tx(s,l);d.link(l.element),s.matchWidth&&(e=c.hotspot,o=n,r=s.useMinWidth,u=cd.getCurrent(o).getOr(o),a=On(e.element),r?dn(u.element,"min-width",a+"px"):(i=u.element,Oe.set(i,a))),s.onOpen(c,t,n),void 0!==f&&void 0!==f.onOpen&&f.onOpen(t,n)},onClose:function(t,n){d.unlink(l.element),void 0!==f&&void 0!==f.onClose&&f.onClose(t,n)},isPartOf:function(t,n,e){return zu(n,e)||zu(l,e)},getAttachPoint:function(){return t().getOrDie()}}),cd.config({find:function(t){return bf.getState(t).bind(function(t){return cd.getCurrent(t)})}}),ic.config({channels:lt(lt({},Xs({isExtraPart:T})),Ys({doReposition:ox}))})])}}function ix(t){ox($y.getCoupled(t,"sandbox"))}function ux(){return[Eo("sandboxClasses",[]),Bf("sandboxBehaviours",[cd,ic,bf,Df])]}function ax(n){return Qf({name:n+"-edge",overrides:function(t){return t.model.manager.edgeActions[n].fold(function(){return{}},function(o){return{events:eu([Or(si(),function(t,n,e){return o(t,e)},[t]),Or(mi(),function(t,n,e){return o(t,e)},[t]),Or(gi(),function(t,n,e){e.mouseIsDown.get()&&o(t,e)},[t])])}})}})}function cx(t){var n=t.event.raw;return-1===n.type.indexOf("touch")?void 0!==n.clientX?vt.some(n).map(function(t){return ke(t.clientX,t.clientY)}):vt.none():void 0!==n.touches&&1===n.touches.length?vt.some(n.touches[0]).map(function(t){return ke(t.clientX,t.clientY)}):vt.none()}function sx(t){return t.model.minX}function lx(t){return t.model.minY}function fx(t){return t.model.minX-1}function dx(t){return t.model.minY-1}function mx(t){return t.model.maxX}function gx(t){return t.model.maxY}function px(t){return t.model.maxX+1}function hx(t){return t.model.maxY+1}function vx(t,n,e){return n(t)-e(t)}function bx(t){return vx(t,mx,sx)}function yx(t){return vx(t,gx,lx)}function xx(t){return bx(t)/2}function wx(t){return yx(t)/2}function Sx(t){return t.stepSize}function kx(t){return t.snapToGrid}function Cx(t){return t.snapStart}function Ox(t){return t.rounded}function _x(t,n){return void 0!==t[n+"-edge"]}function Tx(t){return _x(t,"left")}function Ex(t){return _x(t,"right")}function Dx(t){return _x(t,"top")}function Bx(t){return _x(t,"bottom")}function Mx(t){return t.model.value.get()}function Ax(t,n){return{x:t,y:n}}function Fx(t,n){br(t,Bw(),{value:n})}function Ix(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)}function Rx(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)}function Vx(t,n,e){return Math.max(n,Math.min(e,t))}function Px(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=l?e+1:e;if(r<f)return g;if(d<r)return p;var h,v,b,y,x,w=Vx((x=f,Math.min(d,Math.max(r,x))-x)/m*o+n,g,p);return u&&n<=w&&w<=e?(h=w,v=n,b=e,y=i,a.fold(function(){var t=Math.round((h-v)/y)*y;return Vx(v+t,v-1,b+1)},function(t){var n=Math.round((h-t)%y/y),e=Math.floor((h-t)/y),o=Math.floor((b-t)/y),r=Math.min(o,e+n);return Math.max(t,t+r*y)})):c?Math.round(w):w}function Hx(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:l:(r-n)/o*c}function zx(t){return t.element.dom.getBoundingClientRect()}function Nx(t){return zx(t)[Mw]}function Lx(t){return zx(t).right}function Wx(t){return zx(t).top}function Ux(t){return zx(t).bottom}function jx(t){return zx(t).width}function Gx(t){return zx(t).height}function Xx(t,n){var e=zx(t),o=zx(n);return(e[Mw]+e.right)/2-o[Mw]}function Yx(t,n){var e=zx(t),o=zx(n);return(e.top+e.bottom)/2-o.top}function qx(t,n){br(t,Bw(),{value:n})}function Kx(t,n,e){return Px({min:sx(n),max:mx(n),range:bx(n),value:e,step:Sx(n),snap:kx(n),snapStart:Cx(n),rounded:Ox(n),hasMinEdge:Tx(n),hasMaxEdge:Ex(n),minBound:Nx(t),maxBound:Lx(t),screenRange:jx(t)})}function Jx(r){return function(t,n){return qx(t,{x:o=(0<r?Rx:Ix)(Mx(e=n).x,sx(e),mx(e),Sx(e))}),vt.some(o).map(D);var e,o}}function $x(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=e,s=o,l=r,f=jx(u=n),d=s.bind(function(t){return vt.some(Xx(t,u))}).getOr(0),m=l.bind(function(t){return vt.some(Xx(t,u))}).getOr(f),Hx({min:sx(a),max:mx(a),range:bx(a),value:c,hasMinEdge:Tx(a),hasMaxEdge:Ex(a),minBound:Nx(u),minOffset:0,maxBound:Lx(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return Nx(n)-Nx(t)+g}function Qx(t,n){br(t,Bw(),{value:n})}function Zx(t,n,e){return Px({min:lx(n),max:gx(n),range:yx(n),value:e,step:Sx(n),snap:kx(n),snapStart:Cx(n),rounded:Ox(n),hasMinEdge:Dx(n),hasMaxEdge:Bx(n),minBound:Wx(t),maxBound:Ux(t),screenRange:Gx(t)})}function t0(r){return function(t,n){return Qx(t,{y:o=(0<r?Rx:Ix)(Mx(e=n).y,lx(e),gx(e),Sx(e))}),vt.some(o).map(D);var e,o}}function n0(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=e,s=o,l=r,f=Gx(u=n),d=s.bind(function(t){return vt.some(Yx(t,u))}).getOr(0),m=l.bind(function(t){return vt.some(Yx(t,u))}).getOr(f),Hx({min:lx(a),max:gx(a),range:yx(a),value:c,hasMinEdge:Dx(a),hasMaxEdge:Bx(a),minBound:Wx(u),minOffset:0,maxBound:Ux(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return Wx(n)-Wx(t)+g}function e0(t,n){br(t,Bw(),{value:n})}function o0(t,n){return{x:t,y:n}}function r0(u,a){return function(t,n){return o=n,r=0<u?Rx:Ix,e0(t,o0(i=(e=a)?Mx(o).x:r(Mx(o).x,sx(o),mx(o),Sx(o)),e?r(Mx(o).y,lx(o),gx(o),Sx(o)):Mx(o).y)),vt.some(i).map(D);var e,o,r,i}}function i0(t){return"<alloy.field."+t+">"}function u0(f,d,m,g){function p(t,n,e,o,r){var i,u,a=f(uS+"range"),c=[my.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),my.parts.field({data:r,factory:Dy,inputAttributes:lt({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[d("textfield")],inputBehaviours:nc([(i=n,u=t,Ky.config({invalidClass:d("invalid"),notify:{onValidate:function(t){br(t,iS,{type:i})},onValid:function(t){br(t,oS,{type:i,value:Df.getValue(t)})},onInvalid:function(t){br(t,rS,{type:i,value:Df.getValue(t)})}},validator:{validate:function(t){var n=Df.getValue(t),e=u(n)?Ve.value(!0):Ve.error(f("aria.input.invalid"));return Gy(e)},validateOnLoad:!1}})),py.config({})]),onSetValue:function(t){Ky.isInvalid(t)&&Ky.run(t).get(st)}})],s="hex"!==n?[my.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}}function h(t,n){var e=n.red,o=n.green,r=n.blue;Df.setValue(t,{red:e,green:o,blue:r})}function v(t,n){b.getOpt(t).each(function(t){dn(t.element,"background-color","#"+n.value)})}var b=zm({dom:{tag:"div",classes:[d("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return kl({factory:function(){function a(t){return o[t].get()}function c(t,n){o[t].set(n)}function n(t,n){var e=n.event;"hex"!==e.type?c(e.type,vt.none()):g(t)}function e(t,n){var r,e,o,i,u=n.event;"hex"===u.type?function(t,n){m(t);var e=Mv(n);c("hex",vt.some(n));var o=Hv(e);h(t,o),s(o),br(t,Qw,{hex:e}),v(t,e)}(t,u.value):(r=t,e=u.type,o=u.value,i=parseInt(o,10),c(e,vt.some(i)),a("red").bind(function(e){return a("green").bind(function(n){return a("blue").map(function(t){return Rv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=Iv(t),eS.getField(n,"hex").each(function(t){Hg.isFocused(t)||Df.setValue(n,{hex:e.value})}),e);br(r,Qw,{hex:o}),v(r,o)}))}function t(t){return{label:f(uS+t+".label"),description:f(uS+t+".description")}}function s(t){var n=t.red,e=t.green,o=t.blue;c("red",vt.some(n)),c("green",vt.some(e)),c("blue",vt.some(o))}var o={red:Po(vt.some(255)),green:Po(vt.some(255)),blue:Po(vt.some(255)),hex:Po(vt.some("ffffff"))},r=t("red"),i=t("green"),u=t("blue"),l=t("hex");return Yo(eS.sketch(function(t){return{dom:{tag:"form",classes:[d("rgb-form")],attributes:{"aria-label":f("aria.color.picker")}},components:[t.field("red",my.sketch(p(Vv,"red",r.label,r.description,255))),t.field("green",my.sketch(p(Vv,"green",i.label,i.description,255))),t.field("blue",my.sketch(p(Vv,"blue",u.label,u.description,255))),t.field("hex",my.sketch(p(Av,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:nc([Ky.config({invalidClass:d("form-invalid")}),mm("rgb-form-events",[Cr(oS,e),Cr(rS,n),Cr(iS,n)])])}}),{apis:{updateHex:function(t,n){var e;Df.setValue(t,{hex:n.value}),h(t,e=Hv(n)),s(e),v(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})}function a0(x,w){return kl({name:"ColourPicker",configFields:[mo("dom"),Eo("onValidHex",st),Eo("onInvalidHex",st)],factory:function(t){function n(t,n,e){v.getOpt(t).each(function(t){g.setHue(t,e)})}function e(t,n){b.getOpt(t).each(function(t){m.updateHex(t,n)})}function r(n,e,o,t){var r=o,i=Hv(e);p.paletteRgba.set(i),p.paletteHue.set(r),St(t,function(t){t(n,e,o)})}var o,i,u,a,c,s,l,f,d,m=u0(x,w,t.onValidHex,t.onInvalidHex),g=(l=w,f=$w.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[l("sv-palette-spectrum")]}}),d=$w.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette-thumb")],innerHtml:"<div class="+l("sv-palette-inner-thumb")+' role="presentation"></div>'}}),kl({factory:function(t){var n=rt({x:0,y:0}),e=nc([cd.config({find:vt.some}),Hg.config({})]);return $w.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[f,d],onChange:function(t,n,e){br(t,tS,{value:e})},onInit:function(t,n,e,o){y(e.element.dom,Lv(fb))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,n,e){var o=e;y(n.components()[0].element.dom,Lv(Pv(Uv(o,100,100))))},setThumb:function(t,n,e){var o=n,r=jv(Hv(e));$w.setValue(o,{x:r.saturation,y:100-r.value})}},extraApis:{}})),p={paletteRgba:Po(fb),paletteHue:Po(0)},h=zm((i=$w.parts.spectrum({dom:{tag:"div",classes:[(o=w)("hue-slider-spectrum")],attributes:{role:"presentation"}}}),u=$w.parts.thumb({dom:{tag:"div",classes:[o("hue-slider-thumb")],attributes:{role:"presentation"}}}),$w.sketch({dom:{tag:"div",classes:[o("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:rt({y:0})},components:[i,u],sliderBehaviours:nc([Hg.config({})]),onChange:function(t,n,e){br(t,Zw,{value:e})}}))),v=zm(g.sketch({})),b=zm(m.sketch({}));function y(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))}return{uid:t.uid,dom:t.dom,components:[v.asSpec(),h.asSpec(),b.asSpec()],behaviours:nc([mm("colour-picker-events",[Cr(Qw,(s=[n,function(t,n,e){h.getOpt(t).each(function(t){$w.setValue(t,{y:100-e/360*100})})},function(t,n){v.getOpt(t).each(function(t){g.setThumb(t,n)})}],function(t,n){var e=n.event.hex;r(t,e,jv(Hv(e)).hue,s)})),Cr(tS,(c=[e],function(t,n){var e=n.event.value,o=p.paletteHue.get();r(t,Gv(Uv(o,e.x,100-e.y)),o,c)})),Cr(Zw,(a=[n,e],function(t,n){var e=(100-n.event.value.y)/100*360,o=jv(p.paletteRgba.get());r(t,Gv(Uv(e,o.saturation,o.value)),e,a)}))]),cd.config({find:function(t){return b.getOpt(t)}}),Fg.config({mode:"acyclic"})])}}})}function c0(t){return sS[t]}function s0(t,n,e){return Df.config(Yo({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))}function l0(r,i){function n(t,n){n.stop()}function e(t){return function(n,e){St(t,function(t){t(n,e)})}}function o(t,n){var e;gd.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))}function u(t,n){var e=n.event.raw.target;a(t,e.files)}function a(t,n){var e,o;Df.setValue(t,(e=n,o=fS.explode(i.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),F(kt(e),function(n){return d(o,function(t){return Bt(n.name.toLowerCase(),"."+t.toLowerCase())})}))),br(t,yy,{name:r.name})}var c=zm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:nc([mm("input-file-events",[Dr(Ci()),Dr(Vi())])])});return ey(r.label.map(function(t){return oy(t,i)}),my.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:nc([pS([]),aw(),gd.config({}),Lg.config({toggleClass:"dragenter",toggleOnExecute:!1}),mm("dropzone-events",[Cr("dragenter",e([n,Lg.toggle])),Cr("dragleave",e([n,Lg.toggle])),Cr("dragover",n),Cr("drop",e([n,o])),Cr(ki(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:i.translate("Drop an image here")}},fp.sketch({dom:{tag:"button",innerHtml:i.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:nc([py.config({}),$v(i.isDisabled),pv()])})]}]}}}}),["tox-form__group--stretched"],[])}function f0(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:nc([Hg.config({ignore:!0}),py.config({})])}}function d0(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[f0([hS]),t,f0([vS])],behaviours:nc([cS(1)])}}function m0(t,n){br(t,xi(),{raw:{which:9,shiftKey:n}})}function g0(t,n){var e=n.element;Kr(e,hS)?m0(t,!0):Kr(e,vS)&&m0(t,!1)}function p0(t){return Yb(t,["."+hS,"."+vS].join(","),T)}function h0(t,n){return xS(document.createElement("canvas"),t,n)}function v0(t){var n=h0(t.width,t.height);return yS(n).drawImage(t,0,0),n}function b0(t){return t.naturalWidth||t.width}function y0(t){return t.naturalHeight||t.height}function x0(t,o,r){return o=o||"image/png",S(HTMLCanvasElement.prototype.toBlob)?new Ny(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):(g=t.toDataURL(o,r),new Ny(function(t,n){!function(){var t=g.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return vt.none();for(var e=n[1],o=t[1],r=atob(o),i=r.length,u=Math.ceil(i/1024),a=new Array(u),c=0;c<u;++c){for(var s=1024*c,l=Math.min(1024+s,i),f=new Array(l-s),d=s,m=0;d<l;++m,++d)f[m]=r[d].charCodeAt(0);a[c]=new Uint8Array(f)}return vt.some(new Blob(a,{type:e}))}().fold(function(){n("uri is not base64: "+g)},t)}));var g}function w0(t,n,e){function o(n,e){return t.then(function(t){return t.toDataURL(n||"image/png",e)})}return{getType:rt(n.type),toBlob:function(){return Ny.resolve(n)},toDataURL:rt(e),toBase64:function(){return e.split(",")[1]},toAdjustedBlob:function(n,e){return t.then(function(t){return x0(t,n,e)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,n){return o(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(v0)}}}function S0(n,t){return x0(n,t).then(function(t){return w0(Ny.resolve(n),t,n.toDataURL())})}function k0(n){return e=n,new Ny(function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}).then(function(t){return w0((a=n,new Ny(function(t,n){function e(){r.removeEventListener("load",i),r.removeEventListener("error",u)}var o=URL.createObjectURL(a),r=new Image,i=function(){e(),t(r)},u=function(){e(),n("Unable to load data of type "+a.type+": "+o)};r.addEventListener("load",i),r.addEventListener("error",u),r.src=o,r.complete&&setTimeout(i,0)}).then(function(t){wS(t);var n=h0(b0(t),y0(t));return yS(n).drawImage(t,0,0),n})),n,t);var a});var e}function C0(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}function O0(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}function _0(t,n){for(var e=[],o=new Array(25),r=0;r<5;r++){for(var i=0;i<5;i++)e[i]=n[i+5*r];for(i=0;i<5;i++){for(var u=0,a=0;a<5;a++)u+=t[i+5*a]*e[a];o[i+5*r]=u}}return o}function T0(n,e){return n.toCanvas().then(function(t){return kS(t,n.getType(),e)})}function E0(e){return function(t,n){return T0(t,e(O0(),n))}}function D0(t,n){void 0===n&&(n=2);var e=Math.pow(10,n),o=Math.round(t*e);return Math.ceil(o/e)}function B0(t){return CS(t)}function M0(t){return TS(t)}function A0(t,n){return ES(t,n)}function F0(t,n){return OS(t,n)}function I0(t,n){return _S(t,n)}function R0(t,n){return o=n,(e=t).toCanvas().then(function(t){return AS(t,e.getType(),o)});var e,o}function V0(t,n){return o=n,(e=t).toCanvas().then(function(t){return MS(t,e.getType(),o)});var e,o}function P0(t,n,e){return Xm(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:e},n)}function H0(t,n){return P0(t,n,[])}function z0(t,n){return P0(t,n,[Rg.config({})])}function N0(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:nc([Rg.config({})])}}function L0(n,e,o){function t(t,n){var e=Df.getValue(t);return Hg.focus(e),br(e,"keydown",{raw:n.event.raw}),hw.close(e),vt.some(!0)}var r=Po(st),i=n.text.map(function(t){return zm(N0(t,e,o.providers))}),u=n.icon.map(function(t){return zm(z0(t,o.providers.icons))}),a=n.role.fold(function(){return{}},function(t){return{role:t}}),c=n.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}}),s=Xm("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},o.providers.icons);return zm(hw.sketch(lt(lt(lt({},n.uid?{uid:n.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(M(n.classes,function(t){return e+"--"+t})),attributes:lt({},c)},components:tb([u.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),vt.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:nc(H(H([],n.dropdownBehaviours,!0),[$v(function(){return n.disabled||o.providers.isDisabled()}),pv(),vw.config({}),Rg.config({}),mm("dropdown-events",[vv(n,r),bv(n,r)]),mm("menubutton-update-display-text",[Cr(VS,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){Rg.set(t,[ri(o.providers.translate(e.event.text))])})}),Cr(PS,function(n,e){u.bind(function(t){return t.getOpt(n)}).each(function(t){Rg.set(t,[z0(e.event.icon,o.providers.icons)])})})])],!1)),eventOrder:Yo(RS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:nc([Fg.config({mode:"special",onLeft:t,onRight:t})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:Zp(0,n.columns,n.presets)},fetch:function(t){return jy(C(n.fetch,t))}}))).asSpec()}function W0(t){return"separator"===t.type}function U0(t,e,o,n){var r=Ir("primary-menu"),i=zS(t,o.shared.providers.menuItems());if(0===i.items.length)return vt.none();var u=Gb(r,i.items,e,o,n),a=dt(i.menus,function(t,n){return Gb(n,t,e,o,!1)}),c=Yo(a,sr(r,u));return vt.from(ip.tieredData(r,c,i.expansions))}function j0(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)},setActive:function(t){var n=e.element;t?(Yr(n,"tox-tbtn--enabled"),on(n,"aria-pressed",!0)):(qr(n,"tox-tbtn--enabled"),sn(n,"aria-pressed"))},isActive:function(){return Kr(e.element,"tox-tbtn--enabled")}}}function G0(e,t,o,n){return L0({text:e.text,icon:e.icon,tooltip:e.tooltip,role:n,fetch:function(t,n){e.fetch(function(t){n(U0(t,Sh.CLOSE_ON_EXECUTE,o,!1))})},onSetup:e.onSetup,getApi:j0,columns:1,presets:"normal",classes:[],dropdownBehaviours:[py.config({})]},t,o.shared)}function X0(t,n,e,o,r,i){void 0===e&&(e=[]);var u=n.fold(function(){return{}},function(t){return{action:t}}),a=lt({buttonBehaviours:nc([$v(function(){return t.disabled||i.isDisabled()}),pv(),py.config({}),mm("button press",[kr("click"),kr("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Yo(a,{dom:o});return Yo(c,{components:r})}function Y0(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return H0(t,e.icons)});return X0(t,n,o,r,tb([i]),e)}function q0(t,n,e,o){void 0===o&&(o=[]);var r=Y0(t,vt.some(n),e,o);return fp.sketch(r)}function K0(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(t.text),u=t.icon?t.icon.map(function(t){return H0(t,e.icons)}):vt.none(),a=u.isSome()?tb([u]):[],c=u.isSome()?{}:{innerHtml:i},s=H(H(H(H([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),r,!0);return X0(t,n,o,lt(lt({tag:"button",classes:s},c),{attributes:{title:i}}),a,e)}function J0(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=K0(t,vt.some(n),e,o,r);return fp.sketch(i)}function $0(n,e){return function(t){"custom"===e?br(t,Sy,{name:n,value:{}}):"submit"===e?vr(t,ky):"cancel"===e?vr(t,wy):console.error("Unknown button type: ",e)}}function Q0(n,t,e){if("menu"===t){var o=n,r=zm(G0(lt(lt({},n),{onSetup:function(t){return t.setDisabled(n.disabled),st},fetch:(i=o.items,u=function(){return r},a=e,function(t){t(M(i,function(t){var n,e,o=t.text.fold(function(){return{}},function(t){return{text:t}});return lt(lt({type:t.type,active:!1},o),{onAction:function(t){var n=!t.isActive();t.setActive(n),e.storage.set(n),a.shared.getSink().each(function(t){u().getOpt(t).each(function(t){ka(t.element),br(t,Sy,{name:e.name,value:e.storage.get()})})})},onSetup:(n=e=t,function(t){t.setActive(n.storage.get())})})}))})}),"tox-tbtn",e,vt.none()));return r.asSpec()}var i,u,a;if("custom"===t||"cancel"===t||"submit"===t){var c=$0(n.name,t);return J0(lt(lt({},n),{borderless:!1}),c,e.shared.providers,[])}console.error("Unknown footer button type: ",t)}function Z0(t,n){return Jf({factory:my,name:t,overrides:function(o){return{fieldBehaviours:nc([mm("coupled-input-behaviour",[Cr(Si(),function(e){ml(e,o,n).bind(cd.getCurrent).each(function(n){ml(e,o,"lock").each(function(t){Lg.isOn(t)&&o.onLockedChange(e,n,t)})})})])])}}})}function tw(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return Ve.error(t);var e=parseFloat(n[1]),o=n[2];return Ve.value({value:e,unit:o})}function nw(t,n){function e(t){return Tt(o,t)}var o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1};return t.unit===n?vt.some(t.value):e(t.unit)&&e(n)?o[t.unit]===o[n]?vt.some(t.value):vt.some(t.value/o[t.unit]*o[n]):vt.none()}function ew(t){return vt.none()}function ow(o,n){function t(t){return Xm(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},n.icons)}function e(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}}function r(e){return my.parts.field({factory:Dy,inputClasses:["tox-textfield"],inputBehaviours:nc([gd.config({disabled:function(){return o.disabled||n.isDisabled()}}),pv(),py.config({}),mm("size-input-events",[Cr(bi(),function(t,n){br(t,u,{isField1:e})}),Cr(ki(),function(t,n){br(t,yy,{name:o.name})})])]),selectOnFocus:!1})}function i(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}}var l=ew,u=Ir("ratio-event"),a=WS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[t("lock"),t("unlock")],buttonBehaviours:nc([gd.config({disabled:function(){return o.disabled||n.isDisabled()}}),pv(),py.config({})])}),c=WS.parts.field1(e([my.parts.label(i("Width")),r(!0)])),s=WS.parts.field2(e([my.parts.label(i("Height")),r(!1)]));return WS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([i("&nbsp;"),a])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){tw(Df.getValue(t)).each(function(t){l(t).each(function(t){var n,e,o,r;Df.setValue(i,(r=-1!==(r=(n=t).value.toFixed((e=n.unit)in(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4})?o[e]:1)).indexOf(".")?r.replace(/\.?0*$/,""):r)+n.unit)})})},coupledFieldBehaviours:nc([gd.config({disabled:function(){return o.disabled||n.isDisabled()},onDisabled:function(t){WS.getField1(t).bind(my.getField).each(gd.disable),WS.getField2(t).bind(my.getField).each(gd.disable),WS.getLock(t).each(gd.disable)},onEnabled:function(t){WS.getField1(t).bind(my.getField).each(gd.enable),WS.getField2(t).bind(my.getField).each(gd.enable),WS.getLock(t).each(gd.enable)}}),pv(),mm("size-input-events2",[Cr(u,function(t,n){var e,o,r,i=n.event.isField1,u=i?WS.getField1(t):WS.getField2(t),a=i?WS.getField2(t):WS.getField1(t),c=u.map(Df.getValue).getOr(""),s=a.map(Df.getValue).getOr("");e=s,o=tw(c).toOptional(),r=tw(e).toOptional(),l=Et(o,r,function(t,o){return nw(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return nw(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(ew)}).getOr(ew)})])])})}function rw(f,c){function t(t,n,e,o){return zm(J0({name:t,text:t,disabled:e,primary:o,icon:vt.none(),borderless:!1},n,c))}function n(t,n,e,o){return zm(q0({name:t,icon:vt.some(t),tooltip:vt.some(n),disabled:o,primary:!1,borderless:!1},e,c))}function d(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gd)&&gd.disable(n)})}function m(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gd)&&gd.enable(n)})}function r(t,n,e){br(t,n,e)}function i(t){return vr(t,YS.disable()),0}function u(t){return vr(t,YS.enable()),0}function g(t,n){i(t),r(t,US.transform(),{transform:n}),u(t)}function e(t){return function(){q.getOpt(t).each(function(t){Rg.set(t,[Y])})}}function s(t,n){i(t),r(t,US.transformApply(),{transform:n,swap:e(t)}),u(t)}function p(){return t("Back",function(t){return r(t,US.back(),{swap:e(t)})},!1,!1)}function o(){return zm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:nc([gd.config({})])})}function h(){return t("Apply",function(t){return r(t,US.apply(),{swap:e(t)})},!0,!0)}function v(n,e){return function(t){return n(t,e)}}function a(t,n){var e,o=n;i(e=t),r(e,US.tempTransform(),{transform:o}),u(e)}function b(t,n,e,o,r){var i=$w.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=$w.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=$w.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return zm($w.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:rt({x:o})},components:[i,u,a],sliderBehaviours:nc([Hg.config({})]),onChoose:n}))}function l(t,n,e,o,r){var i,u,a,c,s,l,f=(i=t,u=n,a=e,c=o,s=r,[p(),(l=u,b(i,function(t,n,e){g(t,v(l,e.x/100))},a,c,s)),h()]);return ly.sketch({dom:w,components:f.map(function(t){return t.asSpec()}),containerBehaviours:nc([mm("image-tools-filter-panel-buttons-events",[Cr(YS.disable(),function(t,n){d(f,t)}),Cr(YS.enable(),function(t,n){m(f,t)})])])})}function y(t){return b(t,function(l,t,n){var e=z.getOpt(l),o=L.getOpt(l),r=N.getOpt(l);e.each(function(s){o.each(function(c){r.each(function(t){var o,r,i,n=Df.getValue(s).x/100,e=Df.getValue(t).x/100,u=Df.getValue(c).x/100,a=(o=n,r=e,i=u,function(t){return T0(t,(n=r,e=i,_0(O0(),[C0(o,0,2),0,0,0,0,0,C0(n,0,2),0,0,0,0,0,C0(e,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var n,e});g(l,a)})})})},0,100,200)}function x(n,e,o){return function(t){r(t,US.swap(),{transform:e,swap:function(){q.getOpt(t).each(function(t){Rg.set(t,[n]),o(t)})}})}}var w={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},S=st,k=[p(),o(),t("Apply",function(t){s(t,function(t){var n,e,o,r,i,u,a,c,s,l=f.getRect();return n=l.x,e=l.y,o=l.w,r=l.h,u=n,a=e,c=o,s=r,(i=t).toCanvas().then(function(t){return FS(t,i.getType(),u,a,c,s)})}),f.hideCrop()},!1,!0)],C=ly.sketch({dom:w,components:k.map(function(t){return t.asSpec()}),containerBehaviours:nc([mm("image-tools-crop-buttons-events",[Cr(YS.disable(),function(t,n){d(k,t)}),Cr(YS.enable(),function(t,n){m(k,t)})])])}),O=zm(ow({name:"size",label:vt.none(),constrain:!0,disabled:!1},c)),_=[p(),o(),O,o(),t("Apply",function(a){O.getOpt(a).each(function(t){var r,i,n=Df.getValue(t),e=parseInt(n.width,10),o=parseInt(n.height,10),u=(r=e,i=o,function(t){return e=r,o=i,(n=t).toCanvas().then(function(t){return DS(t,e,o).then(function(t){return S0(t,n.getType())})});var n,e,o});s(a,u)})},!1,!0)],T=ly.sketch({dom:w,components:_.map(function(t){return t.asSpec()}),containerBehaviours:nc([mm("image-tools-resize-buttons-events",[Cr(YS.disable(),function(t,n){d(_,t)}),Cr(YS.enable(),function(t,n){m(_,t)})])])}),E=v(R0,"h"),D=v(R0,"v"),B=v(V0,-90),M=v(V0,90),A=[p(),o(),n("flip-horizontally","Flip horizontally",function(t){a(t,E)},!1),n("flip-vertically","Flip vertically",function(t){a(t,D)},!1),n("rotate-left","Rotate counterclockwise",function(t){a(t,B)},!1),n("rotate-right","Rotate clockwise",function(t){a(t,M)},!1),o(),h()],F=ly.sketch({dom:w,components:A.map(function(t){return t.asSpec()}),containerBehaviours:nc([mm("image-tools-fliprotate-buttons-events",[Cr(YS.disable(),function(t,n){d(A,t)}),Cr(YS.enable(),function(t,n){m(A,t)})])])}),I=[p(),o(),h()],R=ly.sketch({dom:w,components:I.map(function(t){return t.asSpec()})}),V=l("Brightness",F0,-100,0,100),P=l("Contrast",I0,-100,0,100),H=l("Gamma",A0,-100,0,100),z=y("R"),N=y("G"),L=y("B"),W=[p(),z,N,L,h()],U=ly.sketch({dom:w,components:W.map(function(t){return t.asSpec()})}),j=vt.some(M0),G=vt.some(B0),X=[n("crop","Crop",x(C,vt.none(),function(t){f.showCrop()}),!1),n("resize","Resize",x(T,vt.none(),function(t){O.getOpt(t).each(function(t){var n=f.getMeasurements(),e=n.width,o=n.height;Df.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",x(F,vt.none(),S),!1),n("brightness","Brightness",x(V,vt.none(),S),!1),n("sharpen","Sharpen",x(R,j,S),!1),n("contrast","Contrast",x(P,vt.none(),S),!1),n("color-levels","Color levels",x(U,vt.none(),S),!1),n("gamma","Gamma",x(H,vt.none(),S),!1),n("invert","Invert",x(R,G,S),!1)],Y=ly.sketch({dom:w,components:X.map(function(t){return t.asSpec()})}),q=zm(ly.sketch({dom:{tag:"div"},components:[Y],containerBehaviours:nc([Rg.config({})])}));return{memContainer:q,getApplyButton:function(t){return q.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}}function iw(t){if(k(t.changedTouches))for(var n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}(zy=Hy=Hy||{})[zy.HighlightFirst=0]="HighlightFirst",zy[zy.HighlightNone=1]="HighlightNone";function uw(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:nl(o.formBehaviours,[Df.config({store:{mode:"manual",getValue:function(t){return dt(hl(t,o),function(t,o){return t().bind(function(t){var n=cd.getCurrent(t),e=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Fr(t.element));return n.fold(function(){return Ve.error(e)},Ve.value)}).map(Df.getValue)})},setValue:function(e,t){J(t,function(n,t){ml(e,o,t).each(function(t){cd.getCurrent(t).each(function(t){Df.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return ml(t,o,n).bind(cd.getCurrent)}}}}function aw(){return cd.config({find:vt.some})}function cw(t){return n=Mr,e=Ar,s0(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)});var n,e}var sw,lw,fw,dw,mw=function(n,t){return n.getSystem().getByUid(t.uid+"-"+Qy()).map(function(t){return function(){return Ve.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return Ve.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},gw=rt([mo("dom"),mo("fetch"),Ju("onOpen"),$u("onExecute"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Wc(),Zs("dropdownBehaviours",[Lg,$y,Fg,Hg]),mo("toggleClass"),Eo("eventOrder",{}),wo("lazySink"),Eo("matchWidth",!1),Eo("useMinWidth",!1),wo("role")].concat(ux())),pw=rt([$f({schema:[Yu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Zy()]),hw=Cl({name:"Dropdown",configFields:gw(),partFields:pw(),factory:function(n,t,e,o){function r(t){bf.getState(t).each(function(t){ip.highlightPrimary(t)})}function i(t,n){return yr(t),vt.some(!0)}var u,a={expand:function(t){Lg.isOn(t)||ex(n,h,t,o,st,Hy.HighlightNone).get(st)},open:function(t){Lg.isOn(t)||ex(n,h,t,o,st,Hy.HighlightFirst).get(st)},isOpen:Lg.isOn,close:function(t){Lg.isOn(t)&&ex(n,h,t,o,st,Hy.HighlightFirst).get(st)},repositionMenus:function(t){Lg.isOn(t)&&ix(t)}};return{uid:n.uid,dom:n.dom,components:t,behaviours:nl(n.dropdownBehaviours,[Lg.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(t){return rx(n,t,{onOpen:function(){return Lg.on(t)},onClose:function(){return Lg.off(t)}})}}}),Fg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(t,n){return hw.isOpen(t)?r($y.getCoupled(t,"sandbox")):hw.open(t),vt.some(!0)},onEscape:function(t,n){return hw.isOpen(t)?(hw.close(t),vt.some(!0)):vt.none()}}),Hg.config({})]),events:Sm(vt.some(function(t){ex(n,h,t,o,r,Hy.HighlightFirst).get(st)})),eventOrder:lt(lt({},n.eventOrder),((u={})[Ii()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:a,domModification:{attributes:lt(lt({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}})),"button"===n.dom.tag?{type:tt(n.dom,"attributes").bind(function(t){return tt(t,"type")}).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),vw=xa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return eu([Sr(Ei(),D)])},exhibit:function(){return Lr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),bw=Ir("color-input-change"),yw=Ir("color-swatch-change"),xw=Ir("color-picker-cancel"),ww=Qf({schema:[mo("dom")],name:"label"}),Sw=ax("top-left"),kw=ax("top"),Cw=ax("top-right"),Ow=ax("right"),_w=ax("bottom-right"),Tw=ax("bottom"),Ew=ax("bottom-left"),Dw=[ww,ax("left"),Ow,kw,Tw,Sw,Cw,Ew,_w,Jf({name:"thumb",defaults:rt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:eu([Tr(si(),t,"spectrum"),Tr(li(),t,"spectrum"),Tr(fi(),t,"spectrum"),Tr(mi(),t,"spectrum"),Tr(gi(),t,"spectrum"),Tr(hi(),t,"spectrum")])}}}),Jf({schema:[cr("mouseIsDown",function(){return Po(!1)})],name:"spectrum",overrides:function(e){function o(n,t){return r.getValueFromEvent(t).map(function(t){return r.setValueFrom(n,e,t)})}var r=e.model.manager;return{behaviours:nc([Fg.config({mode:"special",onLeft:function(t){return r.onLeft(t,e)},onRight:function(t){return r.onRight(t,e)},onUp:function(t){return r.onUp(t,e)},onDown:function(t){return r.onDown(t,e)}}),Hg.config({})]),events:eu([Cr(si(),o),Cr(li(),o),Cr(mi(),o),Cr(gi(),function(t,n){e.mouseIsDown.get()&&o(t,n)})])}}})],Bw=rt("slider.change.value"),Mw="left",Aw=Jx(-1),Fw=Jx(1),Iw=vt.none,Rw=vt.none,Vw={"top-left":vt.none(),top:vt.none(),"top-right":vt.none(),right:vt.some(function(t,n){Fx(t,{x:px(n)})}),"bottom-right":vt.none(),bottom:vt.none(),"bottom-left":vt.none(),left:vt.some(function(t,n){Fx(t,{x:fx(n)})})},Pw=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=Kx(t,n,e);return qx(t,{x:o}),o},setToMin:function(t,n){qx(t,{x:sx(n)})},setToMax:function(t,n){qx(t,{x:mx(n)})},findValueOfOffset:Kx,getValueFromEvent:function(t){return cx(t).map(function(t){return t.left})},findPositionOfValue:$x,setPositionFromValue:function(t,n,e,o){var r=Mx(e),i=$x(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=On(n.element)/2;dn(n.element,"left",i-u+"px")},onLeft:Aw,onRight:Fw,onUp:Iw,onDown:Rw,edgeActions:Vw}),Hw=vt.none,zw=vt.none,Nw=t0(-1),Lw=t0(1),Ww={"top-left":vt.none(),top:vt.some(function(t,n){Fx(t,{y:dx(n)})}),"top-right":vt.none(),right:vt.none(),"bottom-right":vt.none(),bottom:vt.some(function(t,n){Fx(t,{y:hx(n)})}),"bottom-left":vt.none(),left:vt.none()},Uw=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=Zx(t,n,e);return Qx(t,{y:o}),o},setToMin:function(t,n){Qx(t,{y:lx(n)})},setToMax:function(t,n){Qx(t,{y:gx(n)})},findValueOfOffset:Zx,getValueFromEvent:function(t){return cx(t).map(function(t){return t.top})},findPositionOfValue:n0,setPositionFromValue:function(t,n,e,o){var r=Mx(e),i=n0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),u=wn(n.element)/2;dn(n.element,"top",i-u+"px")},onLeft:Hw,onRight:zw,onUp:Nw,onDown:Lw,edgeActions:Ww}),jw=cx,Gw=r0(-1,!1),Xw=r0(1,!1),Yw=r0(-1,!0),qw=r0(1,!0),Kw={"top-left":vt.some(function(t,n){Fx(t,Ax(fx(n),dx(n)))}),top:vt.some(function(t,n){Fx(t,Ax(xx(n),dx(n)))}),"top-right":vt.some(function(t,n){Fx(t,Ax(px(n),dx(n)))}),right:vt.some(function(t,n){Fx(t,Ax(px(n),wx(n)))}),"bottom-right":vt.some(function(t,n){Fx(t,Ax(px(n),hx(n)))}),bottom:vt.some(function(t,n){Fx(t,Ax(xx(n),hx(n)))}),"bottom-left":vt.some(function(t,n){Fx(t,Ax(fx(n),hx(n)))}),left:vt.some(function(t,n){Fx(t,Ax(fx(n),wx(n)))})},Jw=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=o0(Kx(t,n,e.left),Zx(t,n,e.top));return e0(t,o),o},setToMin:function(t,n){e0(t,o0(sx(n),lx(n)))},setToMax:function(t,n){e0(t,o0(mx(n),gx(n)))},getValueFromEvent:jw,setPositionFromValue:function(t,n,e,o){var r=Mx(e),i=$x(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=n0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=On(n.element)/2,c=wn(n.element)/2;dn(n.element,"left",i-a+"px"),dn(n.element,"top",u-c+"px")},onLeft:Gw,onRight:Xw,onUp:Yw,onDown:qw,edgeActions:Kw}),$w=Cl({name:"Slider",configFields:[Eo("stepSize",1),Eo("onChange",st),Eo("onChoose",st),Eo("onInit",st),Eo("onDragStart",st),Eo("onDragEnd",st),Eo("snapToGrid",!1),Eo("rounded",!0),wo("snapStart"),go("model",lo("mode",{x:[Eo("minX",0),Eo("maxX",100),cr("value",function(t){return Po(t.mode.minX)}),mo("getInitialValue"),ta("manager",Pw)],y:[Eo("minY",0),Eo("maxY",100),cr("value",function(t){return Po(t.mode.minY)}),mo("getInitialValue"),ta("manager",Uw)],xy:[Eo("minX",0),Eo("maxX",100),Eo("minY",0),Eo("maxY",100),cr("value",function(t){return Po({x:t.mode.minX,y:t.mode.minY})}),mo("getInitialValue"),ta("manager",Jw)]})),Zs("sliderBehaviours",[Fg,Df]),cr("mouseIsDown",function(){return Po(!1)})],partFields:Dw,factory:function(i,t,n,e){function u(t){return gl(t,i,"thumb")}function a(t){return gl(t,i,"spectrum")}function o(t){return ml(t,i,"left-edge")}function r(t){return ml(t,i,"right-edge")}function c(t){return ml(t,i,"top-edge")}function s(t){return ml(t,i,"bottom-edge")}function l(t,n){v.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function f(t,n){h.value.set(n),l(t,u(t))}function d(e){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&ml(e,i,"thumb").each(function(t){var n=h.value.get();i.onChoose(e,t,n)})}function m(t,n){n.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))}function g(t,n){n.stop(),i.onDragEnd(t,u(t)),d(t)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:t,behaviours:nl(i.sliderBehaviours,[Fg.config({mode:"special",focusIn:function(t){return ml(t,i,"spectrum").map(Fg.focusIn).map(D)}}),Df.config({store:{mode:"manual",getValue:function(t){return h.value.get()}}}),ic.config({channels:((p={})[wf()]={onReceive:d},p)})]),events:eu([Cr(Bw(),function(t,n){!function(t,n){f(t,n);var e=u(t);i.onChange(t,e,n),vt.some(!0)}(t,n.event.value)}),ou(function(t,n){var e=h.getInitialValue();h.value.set(e);var o=u(t);l(t,o);var r=a(t);i.onInit(t,o,r,h.value.get())}),Cr(si(),m),Cr(fi(),g),Cr(mi(),m),Cr(hi(),g)]),apis:{resetToMin:function(t){v.setToMin(t,i)},resetToMax:function(t){v.setToMax(t,i)},setValue:f,refresh:l},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,n,e){t.setValue(n,e)},resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),Qw=Ir("rgb-hex-update"),Zw=Ir("slider-update"),tS=Ir("palette-update"),nS=[Zs("formBehaviours",[Df])],eS={getField:zr(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n={field:function(t,n){return e.push(t),cl("form",i0(t),n)},record:rt(e=[])},o=t(n),r=M(n.record(),function(t){return Jf({name:t,pname:i0(t)})});return Sl("form",nS,r,uw,o)}},oS=Ir("valid-input"),rS=Ir("invalid-input"),iS=Ir("validating-input"),uS="colorcustom.rgb.",aS=function(t){return cd.config({find:t.getOpt})},cS=function(t){return cd.config({find:function(n){return Jt(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},sS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},lS=tinymce.util.Tools.resolve("tinymce.Resource"),fS=tinymce.util.Tools.resolve("tinymce.util.Tools"),dS=$o([Eo("preprocess",h),Eo("postprocess",h)]),mS=function(r,t){var i=so("RepresentingConfigs.memento processors",dS,t);return Df.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Df.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Df.setValue(o,e)}}})},gS=s0,pS=function(t){return Df.config({store:{mode:"memory",initialValue:t}})},hS=Ir("alloy-fake-before-tabstop"),vS=Ir("alloy-fake-after-tabstop"),bS=!(le().browser.isIE()||le().browser.isEdge()),yS=function(t){return t.getContext("2d")},xS=function(t,n,e){return t.width=n,t.height=e,t},wS=function(t){URL.revokeObjectURL(t.src)},SS=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],kS=function(t,n,T){var e=yS(t),o=function(t){for(var n,e,o,r,i=t.data,u=T[0],a=T[1],c=T[2],s=T[3],l=T[4],f=T[5],d=T[6],m=T[7],g=T[8],p=T[9],h=T[10],v=T[11],b=T[12],y=T[13],x=T[14],w=T[15],S=T[16],k=T[17],C=T[18],O=T[19],_=0;_<i.length;_+=4)n=i[_],e=i[_+1],o=i[_+2],r=i[_+3],i[_]=n*u+e*a+o*c+r*s+l,i[_+1]=n*f+e*d+o*m+r*g+p,i[_+2]=n*h+e*v+o*b+r*y+x,i[_+3]=n*w+e*S+o*k+r*C+O;return t}(e.getImageData(0,0,t.width,t.height));return e.putImageData(o,0,0),S0(t,n)},CS=(sw=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return T0(t,sw)}),OS=E0(function(t,n){return _0(t,[1,0,0,0,n=C0(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),_S=E0(function(t,n){var e;return n=C0(n,-1,1),_0(t,[(e=(n*=100)<0?127+n/100*127:127*(0==(e=n%1)?SS[n]:SS[Math.floor(n)]*(1-e)+SS[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),TS=(lw=[0,-1,0,-1,5,-1,0,-1,0],function(t){return a=lw,(u=t).toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=yS(n),i=function(t,n,e){for(var o=function(t,n,e){return e<t?t=e:t<n&&(t=n),t},r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(f+h-i,0,c-1),b=4*(o(l+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(l*c+f);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return n}(r.getImageData(0,0,n.width,n.height),r.getImageData(0,0,n.width,n.height),o),r.putImageData(i,0,0),S0(n,e);var n,e,o,r,i});var u,a}),ES=(fw=function(t,n){return 255*Math.pow(t/255,1-n)},function(n,e){return n.toCanvas().then(function(t){return function(t,n,e){for(var o=yS(t),r=new Array(256),i=0;i<r.length;i++)r[i]=fw(i,e);var u=function(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),S0(t,n)}(t,n.getType(),e)})}),DS=function(t,n,e){var o=b0(t),r=y0(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=BS(t,i,u);return a?c.then(function(t){return DS(t,n,e)}):c},BS=function(u,a,c){return new Ny(function(t){var n=b0(u),e=y0(u),o=Math.floor(n*a),r=Math.floor(e*c),i=h0(o,r);yS(i).drawImage(u,0,0,n,e,0,0,o,r),t(i)})},MS=function(t,n,e){var o=(e<0?360+e:e)*Math.PI/180,r=t.width,i=t.height,u=Math.sin(o),a=Math.cos(o),c=D0(Math.abs(r*a)+Math.abs(i*u)),s=D0(Math.abs(r*u)+Math.abs(i*a)),l=h0(c,s),f=yS(l);return f.translate(c/2,s/2),f.rotate(o),f.drawImage(t,-r/2,-i/2),S0(l,n)},AS=function(t,n,e){var o=h0(t.width,t.height),r=yS(o);return"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),S0(o,n)},FS=function(t,n,e,o,r,i){var u=h0(r,i);return yS(u).drawImage(t,-e,-o),S0(u,n)},IS=Ir("toolbar.button.execute"),RS=((dw={})[Ii()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],dw),VS=Ir("update-menu-text"),PS=Ir("update-menu-icon"),HS={type:"separator"},zS=function(t,l){var n,e,o;return I((n=y(t)?t.split(" "):t,e=l,0<(o=R(n,function(t,n){return y(n)?""===n?t:"|"===n?0<t.length&&!W0(t[t.length-1])?t.concat([HS]):t:Tt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[])).length&&W0(o[o.length-1])&&o.pop(),o),function(t,n){var e,o,r,i,u,a,c=function(t){if(W0(t))return t;var n=tt(t,"value").getOrThunk(function(){return Ir("generated-menu-item")});return Yo({value:n},t)}(n),s=(o=l,Tt(e=c,"getSubmenuItems")?(i=o,u=(r=e).getSubmenuItems(),a=zS(u,i),{item:r,menus:Yo(a.menus,sr(r.value,a.items)),expansions:Yo(a.expansions,sr(r.value,r.value))}):{item:e,menus:{},expansions:{}});return{menus:Yo(t.menus,s.menus),items:[s.item].concat(t.items),expansions:Yo(t.expansions,s.expansions)}},{menus:{},expansions:{},items:[]})},NS=rt([Eo("field1Name","field1"),Eo("field2Name","field2"),Qu("onLockedChange"),qu(["lockClass"]),Eo("locked",!1),Bf("coupledFieldBehaviours",[cd,Df])]),LS=rt([Z0("field1","field2"),Z0("field2","field1"),Jf({factory:fp,schema:[mo("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:nc([Lg.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),WS=Cl({name:"FormCoupledInputs",configFields:NS(),partFields:LS(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Mf(o.coupledFieldBehaviours,[cd.config({find:vt.some}),Df.config({store:{mode:"manual",getValue:function(t){var n=bl(t,o,["field1","field2"]),e={};return e[o.field1Name]=Df.getValue(n.field1()),e[o.field2Name]=Df.getValue(n.field2()),e},setValue:function(t,n){var e=bl(t,o,["field1","field2"]);nt(n,o.field1Name)&&Df.setValue(e.field1(),n[o.field1Name]),nt(n,o.field2Name)&&Df.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return ml(t,o,"field1")},getField2:function(t){return ml(t,o,"field2")},getLock:function(t){return ml(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),US={undo:rt(Ir("undo")),redo:rt(Ir("redo")),zoom:rt(Ir("zoom")),back:rt(Ir("back")),apply:rt(Ir("apply")),swap:rt(Ir("swap")),transform:rt(Ir("transform")),tempTransform:rt(Ir("temp-transform")),transformApply:rt(Ir("transform-apply"))},jS=rt("save-state"),GS=rt("disable"),XS=rt("enable"),YS={formActionEvent:Sy,saveState:jS,disable:GS,enable:XS},qS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),KS=tinymce.util.Tools.resolve("tinymce.util.Observable"),JS=tinymce.util.Tools.resolve("tinymce.util.VK");function $S(t,d){function n(t){var n,e,o,r,i,u,a,c,s=t.raw,l=(n=Math.max,e=y.documentElement,o=y.body,r=n(e.scrollWidth,o.scrollWidth),i=n(e.clientWidth,o.clientWidth),u=n(e.offsetWidth,o.offsetWidth),a=n(e.scrollHeight,o.scrollHeight),c=n(e.clientHeight,o.clientHeight),{width:r<u?i:r,height:a<n(e.offsetHeight,o.offsetHeight)?c:a});iw(s),t.prevent(),p=s.button,h=s.screenX,v=s.screenY;var f=pn(w,"cursor");mn(g=At.fromTag("div",y),{position:"absolute",top:"0",left:"0",width:l.width+"px",height:l.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:f}),Te(ye(x),g),b.push(pc(x,"mousemove",m),pc(x,"touchmove",m),pc(x,"mouseup",S),pc(x,"touchend",S)),d.start(s)}function m(t){var n=t.raw;if(iw(n),n.button!==p)return S(t);n.deltaX=n.screenX-h,n.deltaY=n.screenY-v,t.prevent(),d.drag(n)}var e,o,r,g,p,h,v,i=[],b=[],y=null!==(e=d.document)&&void 0!==e?e:document,u=null!==(o=d.root)&&void 0!==o?o:y,x=At.fromDom(y),w=At.fromDom(u.getElementById(null!==(r=d.handle)&&void 0!==r?r:t)),S=function(t){iw(t.raw),St(b,function(t){return t.unbind()}),b=[],Ee(g),d.stop&&d.stop(t.raw)};return i.push(pc(w,"mousedown",n),pc(w,"touchstart",n)),{destroy:function(){St(b.concat(i),function(t){return t.unbind()}),b=[],i=[],k(g)&&Ee(g)}}}function QS(t,n,e,o,r){return q0({name:t,icon:vt.some(n),disabled:e,tooltip:vt.some(t),primary:!1,borderless:!1},o,r)}function ZS(t,n){n?gd.enable(t):gd.disable(t)}var tk=0,nk=function(s,n,l,t,e){function f(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function u(t,n,e,o){var r=n.x+e*t.deltaX,i=n.y+o*t.deltaY,u=Math.max(20,n.w+e*t.deltaW),a=Math.max(20,n.h+o*t.deltaH),c=(s=qS.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),f(l,s));b.fire("updateRect",{rect:c}),h(c)}function o(t){r(s=t)}function r(e){function t(t,n){Iu(m,"#"+d+"-"+t).each(function(t){mn(t,{left:n.x+"px",top:n.y+"px",width:Math.max(0,n.w)+"px",height:Math.max(0,n.h)+"px"})})}St(g,function(n){Iu(m,"#"+d+"-"+n.name).each(function(t){mn(t,{left:e.w*n.xMul+e.x+"px",top:e.h*n.yMul+e.y+"px"})})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}var i,a,c=[],d="tox-crid-"+tk++,m=At.fromDom(t),g=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],p=["top","right","bottom","left"],h=function(t){var n;o((n=l,{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}))};function v(t){on(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")}rn(a=At.fromTag("div"),{id:d,class:"tox-croprect-container",role:"grid","aria-dropeffect":"execute"}),Te(m,a),St(p,function(e){Iu(m,"#"+d).each(function(t){var n=At.fromTag("div");rn(n,{id:d+"-"+e,class:"tox-croprect-block","data-mce-bogus":"all"}),dn(n,"display","none"),Te(t,n)})}),St(g,function(e){Iu(m,"#"+d).each(function(t){var n=At.fromTag("div");rn(n,{id:d+"-"+e.name,"aria-label":e.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:e.label}),Jr(n,["tox-croprect-handle","tox-croprect-handle-"+e.name]),dn(n,"display","none"),Te(t,n)})}),i=M(g,function(n){var e;return $S(d,{document:t.ownerDocument,root:ge(m).dom,handle:d+"-"+n.name,start:function(){e=s},drag:function(t){u(n,e,t.deltaX,t.deltaY)}})}),r(s),c.push(pc(m,"focusin",v),pc(m,"focusout",v),pc(m,"keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),u(i,e,o,r)}switch(St(g,function(t){if(un(n.target,"id")===d+"-"+t.name)return i=t,!1}),n.raw.keyCode){case JS.LEFT:t(n,0,s,-10,0);break;case JS.RIGHT:t(n,0,s,10,0);break;case JS.UP:t(n,0,s,0,-10);break;case JS.DOWN:t(n,0,s,0,10);break;case JS.ENTER:case JS.SPACEBAR:n.prevent(),e()}}));var b=lt(lt({},KS),{toggleVisibility:function(t){var n=H(H([],M(g,function(t){return"#"+d+"-"+t.name}),!0),M(p,function(t){return"#"+d+"-"+t}),!0).join(","),e=vs(m,n);St(e,t?function(t){return bn(t,"display")}:function(t){return dn(t,"display","none")})},setClampRect:function(t){l=t,r(s)},setRect:o,getInnerRect:function(){return f(l,s)},setInnerRect:h,setViewPortRect:function(t){n=t,r(s)},destroy:function(){St(i,function(t){return t.destroy()}),i=[],St(c,function(t){return t.unbind()}),c=[]}});return b};function ek(t){var e,o,n,r,i=Po(t),u=gc(),a=(o=-1,{data:e=[],add:function(t){var n=e.splice(++o);return e.push(t),{state:t,removed:n}},undo:function(){if(n())return e[--o]},redo:function(){if(r())return e[++o]},canUndo:n=function(){return 0<o},canRedo:r=function(){return-1!==o&&o<e.length-1}});function c(t){i.set(t)}function s(t){URL.revokeObjectURL(t.url)}function l(t){var n=f(t);c(n);var e=a.add(n).removed;return fS.each(e,s),n.url}a.add(t);function f(t){return{blob:t,url:URL.createObjectURL(t)}}function d(){u.on(s),u.clear()}return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:l,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var n=f(t);return d(),u.set(n),n.url},addTempState:function(t){var n=f(t);return u.set(n),n.url},applyTempState:function(n){return u.get().fold(st,function(t){l(t.blob),n()})},destroyTempState:d,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}}function ok(t,n){function i(t){var n=y.getHistoryStates();k.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),br(t,YS.formActionEvent,{name:YS.saveState(),value:n.undoEnabled})}function u(t){return t.toBlob()}function a(t){br(t,YS.formActionEvent,{name:YS.disable(),value:{}})}function c(n,t,e,o,r){a(n),k0(t).then(e).then(u).then(o).then(function(t){return w(n,t)}).then(function(){i(n),r(),x(n)}).catch(function(t){console.log(t),n.getSystem().isConnected()&&x(n)})}function r(t,n,e){c(t,y.getBlobState().blob,n,function(t){return y.updateTempState(t)},e)}function s(t){var n=y.getBlobState().url;return y.destroyTempState(),i(t),n}var e,o,l,f,d,m,g,p,h,v,b,y=ek(t.currentState),x=function(t){C.getApplyButton(t).each(function(t){gd.enable(t)}),br(t,YS.formActionEvent,{name:YS.enable(),value:{}})},w=function(t,n){return a(t),S.updateSrc(t,n)},S=(f=t.currentState.url,m=zm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),g=Po(1),d=dc(),p=lt(lt({},d),{run:function(t){return d.get().each(t)}}),h=Po({x:0,y:0,w:1,h:1}),v=Po({x:0,y:0,w:1,h:1}),{memContainer:b=zm(ly.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[m.asSpec(),{dom:{tag:"img",attributes:{src:f}}},{dom:{tag:"div"},behaviours:nc([mm("image-panel-crop-events",[ou(function(t){b.getOpt(t).each(function(t){var n=t.element.dom,e=nk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,st);e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=g.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};h.set(o)}),p.set(e)})}),ru(function(){p.clear()})])])}],containerBehaviours:nc([Rg.config({}),mm("image-panel-events",[ou(function(t){_(t,f)})])])})),updateSrc:_,zoom:function(t,n){var e=g.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);g.set(o),b.getOpt(t).each(function(t){var n=t.components()[1].element;O(t,n)})},showCrop:function(){p.run(function(t){t.toggleVisibility(!0)})},hideCrop:function(){p.run(function(t){t.toggleVisibility(!1)})},getRect:function(){return h.get()},getMeasurements:function(){var t=v.get();return{width:t.w,height:t.h}}}),k=(o=zm(QS("Undo","undo",!0,function(t){br(t,US.undo(),{direction:1})},e=n)),l=zm(QS("Redo","redo",!0,function(t){br(t,US.redo(),{direction:1})},e)),{container:ly.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),l.asSpec(),QS("Zoom in","zoom-in",!1,function(t){br(t,US.zoom(),{direction:1})},e),QS("Zoom out","zoom-out",!1,function(t){br(t,US.zoom(),{direction:-1})},e)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){ZS(t,n)}),l.getOpt(t).each(function(t){ZS(t,e)})}}),C=rw(S,n);function O(t,s){b.getOpt(t).each(function(t){var e=g.get(),o=On(t.element),r=wn(t.element),i=s.dom.naturalWidth*e,u=s.dom.naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};mn(s,n),m.getOpt(t).each(function(t){mn(t.element,n)}),p.run(function(t){var n=h.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})}function _(t,n){var e,i=At.fromTag("img");return on(i,"src",n),e=i.dom,new Ap(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}).then(function(){t.getSystem().isConnected()&&b.getOpt(t).map(function(t){var n=Ou({element:i});Rg.replaceAt(t,1,vt.some(n));var e=v.get(),o={x:0,y:0,w:i.dom.naturalWidth,h:i.dom.naturalHeight};v.set(o);var u,r=qS.inflate(o,-20,-20);h.set(r),e.w===o.w&&e.h===o.h||(u=i,b.getOpt(t).each(function(t){var n=On(t.element),e=wn(t.element),o=u.dom.naturalWidth,r=u.dom.naturalHeight,i=Math.min(n/o,e/r);1<=i?g.set(1):g.set(i)})),O(t,i)})})}return{dom:{tag:"div",attributes:{role:"presentation"}},components:[C.memContainer.asSpec(),S.memContainer.asSpec(),k.container],behaviours:nc([Df.config({store:{mode:"manual",getValue:function(){return y.getBlobState()}}}),mm("image-tools-events",[Cr(US.undo(),function(n,t){var e=y.undo();w(n,e).then(function(t){x(n),i(n)})}),Cr(US.redo(),function(n,t){var e=y.redo();w(n,e).then(function(t){x(n),i(n)})}),Cr(US.zoom(),function(t,n){var e=n.event.direction;S.zoom(t,e)}),Cr(US.back(),function(t,n){var e,o=s(e=t);w(e,o).then(function(t){x(e)}),(0,n.event.swap)(),S.hideCrop()}),Cr(US.apply(),function(t,n){y.applyTempState(function(){s(t),(0,n.event.swap)()})}),Cr(US.transform(),function(t,n){return r(t,n.event.transform,st)}),Cr(US.tempTransform(),function(t,n){var e=n.event.transform;c(t,y.getTempState().blob,e,function(t){return y.addTempState(t)},st)}),Cr(US.transformApply(),function(t,n){var e=t,o=n.event.transform,r=n.event.swap,i=y.getBlobState().blob;c(e,i,o,function(t){var n=y.addBlobState(t);return s(e),n},r)}),Cr(US.swap(),function(n,t){k.updateButtonUndoStates(n,!1,!1);var e=t.event.transform,o=t.event.swap;e.fold(function(){o()},function(t){r(n,t,o)})})]),aw()])}}function rk(t){return!Tt(t,"items")}function ik(t,n){function e(t){return{dom:{tag:"td",innerHtml:n.translate(t)}}}return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:M(t.header,function(t){return{dom:{tag:"th",innerHtml:n.translate(t)}}})}]},{dom:{tag:"tbody"},components:M(t.cells,function(t){return{dom:{tag:"tr"},components:M(t,e)}})}],behaviours:nc([py.config({}),Hg.config({})])}}function uk(e,n){var t=e.label.map(function(t){return oy(t,n)}),o=[gd.config({disabled:function(){return e.disabled||n.isDisabled()}}),pv(),Fg.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return vr(t,ky),vt.some(!0)}}),mm("textfield-change",[Cr(Si(),function(t,n){br(t,yy,{name:e.name})}),Cr(Ai(),function(t,n){br(t,yy,{name:e.name})})]),py.config({})],r=e.validation.map(function(o){return Ky.config({getRoot:function(t){return Yt(t.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Df.getValue(t),e=o.validator(n);return Gy(!0===e?Ve.value(n):Ve.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(rt({}),function(t){return{placeholder:n.translate(t)}}),u=e.inputMode.fold(rt({}),function(t){return{inputmode:t}}),a=lt(lt({},i),u);return ey(t,my.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:nc(ft([o,r])),selectOnFocus:!1,factory:Dy}),(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),[gd.config({disabled:function(){return e.disabled||n.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])}function ak(t){var n=Po(null);return wu({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})}function ck(t,n,e){var o=Df.getValue(e);Df.setValue(n,o),s1(n)}function sk(t,n){var e=t.element,o=Qr(e),r=e.dom;"number"!==un(e,"type")&&n(r,o)}function lk(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:st}}function fk(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:void 0},onAction:st}}function dk(t,n){return e=t,M(F(n,function(t){return t.type===e}),lk);var e}function mk(t,n){var e=t.toLowerCase();return F(n,function(t){return ut((void 0!==t.meta&&void 0!==t.meta.text?t.meta:t).text.toLowerCase(),e)||ut(t.value.toLowerCase(),e)})}function gk(u,a,c){function r(t){var n=Df.getValue(t);c.addToHistory(n.value,u.filetype)}var t,n,e,o,i=a.shared.providers,s=my.parts.field({factory:m1,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":v1,type:"url"},minChars:0,responseTime:0,fetch:function(t){var e,o,n,r,i=U0((e=u.filetype,o=c,n=Df.getValue(t),r=void 0!==n.meta.text?n.meta.text:n.value,o.getLinkInformation().fold(function(){return[]},function(t){var n=mk(r,M(o.getHistory(e),function(t){return fk(t,t)}));return"file"===e?R([n,mk(r,dk("header",t.targets)),mk(r,ft([vt.from(t.anchorTop).map(function(t){return fk("<top>",t)}).toArray(),dk("anchor",t.targets),vt.from(t.anchorBottom).map(function(t){return fk("<bottom>",t)}).toArray()]))],function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(h1,n)},[]):n})),Sh.BUBBLE_TO_SANDBOX,a,!1);return Gy(i)},getHotspot:function(t){return p.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(Ky)&&Ky.run(t).get(st)},typeaheadBehaviours:nc(ft([c.getValidationHandler().map(function(e){return Ky.config({getRoot:function(t){return Yt(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){f.getOpt(t).each(function(t){on(t.element,"title",i.translate(n))})}},validator:{validate:function(t){var n=Df.getValue(t);return p1(function(o){e({type:u.filetype,url:n.value},function(t){var n,e;"invalid"===t.status?(n=Ve.error(t.message),o(n)):(e=Ve.value(t.message),o(e))})})},validateOnLoad:!1}})}).toArray(),[gd.config({disabled:function(){return u.disabled||i.isDisabled()}}),py.config({}),mm("urlinput-events",ft(["file"===u.filetype?[Cr(Si(),function(t){br(t,yy,{name:u.name})})]:[],[Cr(ki(),function(t){br(t,yy,{name:u.name}),r(t)}),Cr(Ai(),function(t){br(t,yy,{name:u.name}),r(t)})]]))]])),eventOrder:((t={})[Si()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:a.shared.getSink,parts:{menu:Zp(0,0,"normal")},onExecute:function(t,n,e){br(n,ky,{})},onItemExecute:function(t,n,e,o){r(t),br(t,yy,{name:u.name})}}),l=u.label.map(function(t){return oy(t,i)}),f=zm((n="invalid",e=vt.some(v1),Xm("warning",{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],attributes:lt({title:i.translate(o=void 0===o?n:o),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))},i.icons))),d=zm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[f.asSpec()]}),m=c.getUrlPicker(u.filetype),g=Ir("browser.url.event"),p=zm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[s,d.asSpec()],behaviours:nc([gd.config({disabled:function(){return u.disabled||i.isDisabled()}})])}),h=zm(J0({name:u.name,icon:vt.some("browse"),text:u.label.getOr(""),disabled:u.disabled,primary:!1,borderless:!0},function(t){return vr(t,g)},i,[],["tox-browse-url"]));return my.sketch({dom:by([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ft([[p.asSpec()],m.map(function(){return h.asSpec()}).toArray()])}]),fieldBehaviours:nc([gd.config({disabled:function(){return u.disabled||i.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable),h.getOpt(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable),h.getOpt(t).each(gd.enable)}}),pv(),mm("url-input-events",[Cr(g,function(o){cd.getCurrent(o).each(function(n){var t=Df.getValue(n),e=lt({fieldname:u.name},t);m.each(function(t){t(e).get(function(t){Df.setValue(n,t),br(o,yy,{name:u.name})})})})})])])})}function pk(r){return function(n,e,o){return tt(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}}function hk(n,t,e){var o=Yo(e,{shared:{interpreter:function(t){return x1(n,t,o)}}});return x1(n,t,o)}function vk(t,n,e){function o(){return At.fromDom(t.getContentAreaContainer())}function r(){return p||!e()}var i,u,a,c,s,l,f,d,m,g,p=sv(t);return{inlineDialog:(f=o,d=n,m=r,g={maxHeightFunction:Vc()},function(){return m()?{type:"node",root:tn(f()),node:vt.from(f()),bubble:Sc(12,12,w1),layouts:{onRtl:function(){return[Am]},onLtr:function(){return[Mm]}},overrides:g}:{type:"hotspot",hotspot:d(),bubble:Sc(-12,12,w1),layouts:{onRtl:function(){return[Xa]},onLtr:function(){return[Ya]}},overrides:g}}),banner:(c=o,s=n,l=r,function(){return l()?{type:"node",root:tn(c()),node:vt.from(c()),layouts:{onRtl:function(){return[cp]},onLtr:function(){return[cp]}}}:{type:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[$a]}}}}),cursor:(u=t,function(){return{type:"selection",root:a(),getSelection:function(){var t=u.selection.getRng();return vt.some(ms.range(At.fromDom(t.startContainer),t.startOffset,At.fromDom(t.endContainer),t.endOffset))}}}),node:(i=a=function(){return At.fromDom(t.getBody())},function(t){return{type:"node",root:i(),node:t}})}}function bk(i){return vt.from(i.getParam("style_formats")).filter(c).map(function(t){var n,e,o=(n=i,e=k1(t),n.formatter?r(e.customFormats):n.on("init",function(){r(e.customFormats)}),e.formats);function r(t){St(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})}return i.getParam("style_formats_merge",!1,"boolean")?S1.concat(o):o}).getOr(S1)}function yk(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return Yo(t,o)}function xk(c,t,s,l){var f=function(t){return M(t,function(t){var n,e,o,r,i,u=Ct(t);if(nt(t,"items")){var a=f(t.items);return Yo(Yo(t,{type:"submenu"}),{getStyleItems:rt(a)})}return nt(t,"format")?yk(t,s,l):1===u.length&&wt(u,"title")?Yo(t,{type:"separator"}):(r={type:"formatter",format:o="custom-"+(e=y((n=t).name)?n.name:Ir(n.title)),isSelected:s(o),getStylePreview:l(o)},i=Yo(n,r),c.formatter.register(e,i),i)})};return f(t)}function wk(e){return function(t){if(k(n=t)&&1===n.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}var n;return!1}}function Sk(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}}function kk(t){return t.innerText||t.textContent}function Ck(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)&&JC(t)}function Ok(t){return t&&/^(H[1-6])$/.test(t.nodeName)}function _k(t){return Ok(t)&&JC(t)}function Tk(t){var n,e=t.id||Ir("h");return Sk("header",kk(t),"#"+e,Ok(n=t)?parseInt(n.nodeName.substr(1),10):0,function(){t.id=e})}function Ek(t){var n=t.id||t.name;return Sk("anchor",kk(t)||"#"+n,"#"+n,0,st)}function Dk(t){return 0<C1(t.title).length}function Bk(t){return y(t)&&/^https?/.test(t)}function Mk(t){return x(t)&&Q(t,function(t){return!(c(n=t)&&n.length<=5&&N(n,Bk));var n}).isNone()}function Ak(){var t,n=db.getItem(E1);if(null===n)return{};try{t=JSON.parse(n)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+E1+" was not valid JSON",t),{};throw t}return Mk(t)?t:(console.log("Local storage "+E1+" was not valid format",t),{})}function Fk(t){return tt(Ak(),t).getOr([])}function Ik(n,t){var e,o;Bk(n)&&(o=F(tt(e=Ak(),t).getOr([]),function(t){return t!==n}),e[t]=[n].concat(o).slice(0,5),function(t){if(!Mk(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));db.setItem(E1,JSON.stringify(t))}(e))}function Rk(t){return!!t}function Vk(t){return dt(fS.makeMap(t,/[, ]/),Rk)}function Pk(t){return vt.from(t.getParam("file_picker_callback")).filter(S)}function Hk(t){return vt.from(t).filter(y).getOrUndefined()}function zk(l){return{getHistory:Fk,addToHistory:Ik,getLinkInformation:function(){return!1===(t=l).getParam("typeahead_urls")?vt.none():vt.some({targets:T1(t.getBody()),anchorTop:Hk(t.getParam("anchor_top","#top")),anchorBottom:Hk(t.getParam("anchor_bottom","#bottom"))});var t},getValidationHandler:function(){return vt.from(void 0===(n=(t=l).getParam("file_picker_validator_handler",void 0,"function"))?t.getParam("filepicker_validator_handler",void 0,"function"):n);var t,n},getUrlPicker:function(t){return n=c=l,e=s=t,r=vt.some((o=n).getParam("file_picker_types")).filter(Rk),i=vt.some(o.getParam("file_browser_callback_types")).filter(Rk),u=r.or(i).map(Vk),a=Pk(o).fold(T,function(t){return u.fold(D,function(t){return 0<Ct(t).length&&t})}),(w(a)?a?Pk(n):vt.none():a[e]?Pk(n):vt.none()).map(function(o){return function(n){return jy(function(e){var t=lt({filetype:s,fieldname:n.fieldname},vt.from(n.meta).getOr({}));o.call(c,function(t,n){if(!y(t))throw new Error("Expected value to be string");if(void 0!==n&&!x(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var n,e,o,r,i,u,a,c,s}}}function Nk(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h=Po(!1),v={isPositionedAtTop:function(){return"top"===o.get()},getDockingMode:(o=Po(av(n)?"bottom":"top")).get,setDockingMode:o.set},b={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:dp.translate,isDisabled:function(){return n.mode.isReadOnly()||n.ui.isDisabled()},getSetting:n.getParam.bind(n)},interpreter:function(t){return x1(y1,t,b)},anchors:vk(n,e,v.isPositionedAtTop),header:v,getSink:function(){return Ve.value(t)}},urlinput:zk(n),styleselect:(f=Po([]),d=Po([]),m=Po([]),g=Po([]),p=Po(!(l=function(t){var n=t.items;return void 0!==n&&0<n.length?z(n,l):[t.format]})),(s=n).on("PreInit",function(t){var n=bk(s),e=xk(s,n,y,x);f.set(e),d.set(z(e,l))}),s.on("addStyleModifications",function(t){var n=xk(s,t.items,y,x);m.set(n),p.set(t.replace),g.set(z(n,l))}),{getData:function(){var t=p.get()?[]:f.get(),n=m.get();return t.concat(n)},getFlattenedKeys:function(){var t=p.get()?[]:d.get(),n=g.get();return t.concat(n)}}),colorinput:{colorPicker:function(t,n){Ib(c)(t,n)},hasCustomColors:function(){return gb(a)},getColors:function(){return pb(u)},getColorCols:(i=u=a=c=n,function(){return vb(i)})},dialog:{isDraggableModal:(r=n,function(){return r.getParam("draggable_modal",!1,"boolean")})},isContextMenuOpen:function(){return h.get()},setContextMenuState:function(t){return h.set(t)}};function y(t){return function(){return s.formatter.match(t)}}function x(n){return function(){var t=s.formatter.get(n);return void 0!==t?vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:s.dom.parseStyle(s.formatter.getCssText(n))}):vt.none()}}return b}function Lk(t){return(mt(hn(t,"position"),"fixed")?vt.none():qt(t)).orThunk(function(){var e=At.fromTag("span");return Yt(t).bind(function(t){Te(t,e);var n=qt(e);return Ee(e),n})})}function Wk(t){return Lk(t).map(Cn).getOrThunk(function(){return ke(0,0)})}function Uk(t,n){var e=t.element;Yr(e,n.transitionClass),qr(e,n.fadeOutClass),Yr(e,n.fadeInClass),n.onShow(t)}function jk(t,n){var e=t.element;Yr(e,n.transitionClass),qr(e,n.fadeInClass),Yr(e,n.fadeOutClass),n.onHide(t)}function Gk(t,n,e){return N(t,function(t){switch(t){case"bottom":return n.bottom<=e.bottom;case"top":return n.y>=e.y}})}function Xk(n,t){return t.getInitialPos().map(function(t){return Me(t.bounds.x,t.bounds.y,On(n),wn(n))})}function Yk(e,o,r){return r.getInitialPos().bind(function(t){switch(r.clearInitialPos(),t.position){case"static":return vt.some(z1.static());case"absolute":var n=Lk(e).map(Ae).getOrThunk(function(){return Ae(be())});return vt.some(z1.absolute(Ea("absolute",tt(t.style,"left").map(function(t){return o.x-n.x}),tt(t.style,"top").map(function(t){return o.y-n.y}),tt(t.style,"right").map(function(t){return n.right-o.right}),tt(t.style,"bottom").map(function(t){return n.bottom-o.bottom}))));default:return vt.none()}})}function qk(t,n,e){var o,r,i,u=t.element;return mt(hn(u,"position"),"fixed")?(r=n,Xk(o=u,i=e).filter(function(t){return Gk(i.getModes(),t,r)}).bind(function(t){return Yk(o,t,i)})):function(t,n,e){var r,o,i=Ae(t);if(Gk(e.getModes(),i,n))return vt.none();r=t,o=i,e.setInitialPos({style:function(){var t={},n=r.dom;if(ct(n))for(var e=0;e<n.style.length;e++){var o=n.style.item(e);t[o]=n.style[o]}return t}(),position:pn(r,"position")||"static",bounds:o});var u=Fe(),a=i.x-u.x,c=n.y-u.y,s=u.bottom-n.bottom,l=i.y<=n.y;return vt.some(z1.fixed(Ea("fixed",vt.some(a),l?vt.some(c):vt.none(),vt.none(),l?vt.none():vt.some(s))))}(u,n,e)}function Kk(n,t,e){e.setDocked(!1),St(["left","right","top","bottom","position"],function(t){return bn(n.element,t)}),t.onUndocked(n)}function Jk(t,n,e,o){var r="fixed"===o.position;e.setDocked(r),Da(t.element,o),(r?n.onDocked:n.onUndocked)(t)}function $k(o,t,r,i,u){void 0===u&&(u=!1),t.contextual.each(function(e){e.lazyContext(o).each(function(t){var n=t.y<i.bottom&&t.bottom>i.y;n!==r.isVisible()&&(r.setVisible(n),u&&!n?(Jr(o.element,[e.fadeOutClass]),e.onHide(o)):(n?Uk:jk)(o,e))})})}function Qk(t,n,e){var o,r,i,u,a,c;e.isDocked()&&(r=n,i=e,c=(o=t).element,i.setDocked(!1),Xk(a=o.element,u=i).bind(function(t){return Yk(a,t,u)}).each(function(t){t.fold(function(){return Kk(o,r,i)},function(t){return Jk(o,r,i,t)},st)}),i.setVisible(!0),r.contextual.each(function(t){$r(c,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(o)}),N1(o,r,i))}function Zk(t,n){return wt(U1.getModes(t),n)}function tC(r){var i=r.element;Yt(i).each(function(t){var n,e,o="padding-"+U1.getModes(r)[0];U1.isDocked(r)?(n=On(t),dn(i,"width",n+"px"),dn(t,o,Sn(e=i)+(parseInt(pn(e,"margin-top"),10)||0)+(parseInt(pn(e,"margin-bottom"),10)||0)+"px")):(bn(i,"width"),bn(t,o))})}function nC(t,n){n?(qr(t,G1.fadeOutClass),Jr(t,[G1.transitionClass,G1.fadeInClass])):(qr(t,G1.fadeInClass),Jr(t,[G1.fadeOutClass,G1.transitionClass]))}function eC(t,n){var e=At.fromDom(t.getContainer());n?(Yr(e,X1),qr(e,Y1)):(Yr(e,Y1),qr(e,X1))}function oC(u,t){function o(n){r().each(function(t){return n(t.element)})}function n(t){u.inline||tC(t),eC(u,U1.isDocked(t)),t.getSystem().broadcastOn([xf()],{}),r().each(function(t){return t.getSystem().broadcastOn([xf()],{})})}var e,i=gc(),r=t.getSink,a=u.inline?[]:[ic.config({channels:((e={})[j1()]={onReceive:tC},e)})];return H([Hg.config({}),U1.config({contextual:lt({lazyContext:function(t){var n=Sn(t.element),e=u.inline?u.getContentAreaContainer():u.getContainer(),o=Ae(At.fromDom(e)),r=o.height-n,i=o.y+(Zk(t,"top")?0:n);return vt.some(Me(o.x,i,o.width,r))},onShow:function(){o(function(t){return nC(t,!0)})},onShown:function(r){o(function(t){return $r(t,[G1.transitionClass,G1.fadeInClass])}),i.get().each(function(t){var n,e=r.element,o=Ut(n=t);Oa(o).filter(function(t){return!Lt(n,t)}).filter(function(t){return Lt(t,At.fromDom(o.dom.body))||Wt(e,t)}).each(function(){return ka(n)}),i.clear()})},onHide:function(t){var n=t.element,e=r;_a(n).orThunk(function(){return e().toOptional().bind(function(t){return _a(t.element)})}).fold(i.clear,i.set),o(function(t){return nC(t,!1)})},onHidden:function(){o(function(t){return $r(t,[G1.transitionClass])})}},G1),lazyViewport:function(t){var n=Fe(),e=u.getParam("toolbar_sticky_offset",0,"number"),o=n.y+(Zk(t,"top")?e:0),r=n.height-(Zk(t,"bottom")?e:0);return Me(n.x,o,n.width,r)},modes:[t.header.getDockingMode()],onDocked:n,onUndocked:n})],a,!0)}function rC(t){return ao("menubutton",$1,t)}function iC(n,t){return t.getAnimationRoot.fold(function(){return n.element},function(t){return t(n)})}function uC(t){return t.dimension.property}function aC(t,n){return t.dimension.getDimension(n)}function cC(t,n){$r(iC(t,n),[n.shrinkingClass,n.growingClass])}function sC(t,n){qr(t.element,n.openClass),Yr(t.element,n.closedClass),dn(t.element,uC(n),"0px"),yn(t.element)}function lC(t,n){qr(t.element,n.closedClass),Yr(t.element,n.openClass),bn(t.element,uC(n))}function fC(t,n,e,o){e.setCollapsed(),dn(t.element,uC(n),aC(n,t.element)),yn(t.element),cC(t,n),sC(t,n),n.onStartShrink(t),n.onShrunk(t)}function dC(t,n,e){var o=aC(n,t.element);("0px"===o?fC:function(t,n,e,o){var r=o.getOrThunk(function(){return aC(n,t.element)});e.setCollapsed(),dn(t.element,uC(n),r),yn(t.element);var i=iC(t,n);qr(i,n.growingClass),Yr(i,n.shrinkingClass),sC(t,n),n.onStartShrink(t)})(t,n,e,vt.some(o))}function mC(t,n,e){var o=iC(t,n),r=Kr(o,n.shrinkingClass),i=aC(n,t.element);lC(t,n);var u=aC(n,t.element);(r?function(){dn(t.element,uC(n),i),yn(t.element)}:function(){sC(t,n)})(),qr(o,n.shrinkingClass),Yr(o,n.growingClass),lC(t,n),dn(t.element,uC(n),u),e.setExpanded(),n.onStartGrow(t)}function gC(t,n,e){return!0===Kr(iC(t,n),n.growingClass)}function pC(t,n,e){return!0===Kr(iC(t,n),n.shrinkingClass)}function hC(t){return"<alloy.field."+t+">"}function vC(t){return{element:function(){return t.element.dom}}}function bC(t,e){cd.getCurrent(t).each(function(t){return Rg.set(t,[(n=e,uO.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(e=t,r=M(Ct(o=n),function(t){var n=o[t],e=co(ao("sidebar",aO,n));return{name:t,getApi:vC,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}}),M(r,function(t){var n=Po(st);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Kh([vv(t,n),bv(t,n),Cr(Ji(),function(n,t){var e=t.event;V(r,function(t){return t.name===e.name}).each(function(t){(e.visible?t.onShow:t.onHide)(t.getApi(n))})})])})})),slotBehaviours:Kh([ou(function(t){return uO.hideAllSlots(t)})])};var e,o,r}))]);var n})}function yC(t){return cd.getCurrent(t).bind(function(t){return eO.isGrowing(t)||eO.hasGrown(t)?cd.getCurrent(t).bind(function(n){return V(uO.getSlotNames(n),function(t){return uO.isShowing(n,t)})}):vt.none()})}function xC(t){var n=At.fromHtml(t),e=Kt(n),o=R(void 0!==n.dom.attributes?n.dom.attributes:[],function(t,n){var e;return"class"===n.name?t:lt(lt({},t),((e={})[n.name]=n.value,e))},{}),r=Array.prototype.slice.call(n.dom.classList,0),i=0===e.length?{}:{innerHtml:Mr(n)};return lt({tag:Ft(n),classes:r,attributes:o},i)}function wC(t){return cd.getCurrent(t).each(function(t){return ka(t.element)})}function SC(f,d,m){function n(t){var n;!g.get()||"focusin"===(n=t).type&&(n.composed?Y(n.composedPath()):vt.from(n.target)).map(At.fromDom).filter(Xn).exists(function(t){return Kr(t,"mce-pastebin")})||(t.preventDefault(),wC(d()),f.editorManager.setActive(f))}var g=Po(!1),e=gc();function o(t){var n,e,o,r,i,u,a,c,s,l;t!==g.get()&&(g.set(t),n=f,e=d(),o=t,r=m.providers,c=e.element,s=o,l="data-mce-"+(i="tabindex"),vt.from(n.iframeElement).map(At.fromDom).each(function(n){s?(an(n,i).each(function(t){return on(n,l,t)}),on(n,i,-1)):(sn(n,i),an(n,l).each(function(t){on(n,i,t),sn(n,l)}))}),o?(fO.block(e,(a=r,function(t,n){return{dom:{tag:"div",attributes:{"aria-label":a.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:xC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})),bn(c,"display"),sn(c,"aria-hidden"),n.hasFocus()&&wC(e)):(u=cd.getCurrent(e).exists(function(t){return Ca(t.element)}),fO.unblock(e),dn(c,"display","none"),on(c,"aria-hidden","true"),u&&n.focus()),f.fire("AfterProgressState",{state:t}))}f.inline||f.on("PreInit",function(){f.dom.bind(f.getWin(),"focusin",n),f.on("BeforeExecCommand",function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&n(t)})}),f.on("ProgressState",function(t){var n;e.on(lp.clearTimeout),u(t.time)?(n=lp.setEditorTimeout(f,function(){return o(t.state)},t.time),e.set(n)):(o(t.state),e.clear())})}function kC(t,n,e){return{within:t,extra:n,withinWidth:e}}function CC(t,n,o){var e,r=(e=function(t,n){var e=o(t);return vt.some({element:t,start:n,finish:n+e,width:e})},R(t,function(n,t){return e(t,n.len).fold(rt(n),function(t){return{len:t.finish,list:n.list.concat([t])}})},{len:0,list:[]}).list),i=F(r,function(t){return t.finish<=n}),u=I(i,function(t,n){return t+n.width},0);return{within:i,extra:r.slice(i.length),withinWidth:u}}function OC(t){return M(t,function(t){return t.element})}function _C(t,n){var e=M(n,function(t){return Eu(t)});V1.setGroups(t,e)}function TC(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k=n.builtGroups.get();0!==k.length&&(o=gl(t,n,"primary"),r=$y.getCoupled(t,"overflowGroup"),dn(o.element,"visibility","hidden"),u=K(i=k.concat([r]),function(n){return _a(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}),e([]),_C(o,i),a=On(o.element),0===(s=a,l=n.builtGroups.get(),d=r,y=(0===(m=CC(l,s,f=function(t){return On(t.element)})).extra.length?vt.some(m):vt.none()).getOrThunk(function(){return CC(l,s-f(d),f)}),x=y.within,w=y.extra,S=y.withinWidth,(c=1===w.length&&w[0].width<=f(d)?(b=S,kC(OC(x.concat(w)),[],b)):1<=w.length?(p=w,h=d,v=S,kC(OC(x).concat([h]),OC(p),v)):(g=S,kC(OC(x),[],g))).extra.length)?(Rg.remove(o,r),e([])):(_C(o,c.within),e(c.extra)),bn(o.element,"visibility"),yn(o.element),u.each(Hg.focus))}function EC(t,n){var e=$y.getCoupled(t,"toolbarSandbox");bf.isOpen(e)?bf.close(e):bf.open(e,n.toolbar())}function DC(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();ff.positionWithinBounds(i,n,{anchor:{type:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:pO()}}},r)}function BC(t,n,e,o,r){V1.setGroups(n,r),DC(t,n,e,o),Lg.on(t)}function MC(t){return M(t,function(t){return Eu(t)})}function AC(t,e,o){TC(t,o,function(n){o.overflowGroups.set(n),e.getOpt(t).each(function(t){bO.setGroups(t,MC(n))})})}function FC(n,e){ml(n,e,"overflow-button").bind(function(){return ml(n,e,"overflow")}).each(function(t){QC(n,e),eO.toggleGrow(t)})}function IC(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:lt({tag:"div",classes:["tox-toolbar__group"]},n),components:[wO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:nc([py.config({}),Hg.config({})])}}function RC(t){return wO.sketch(IC(t))}function VC(e,t){var n=ou(function(t){var n=M(e.initGroups,RC);V1.setGroups(t,n)});return nc([Qv(e.providers.isDisabled),pv(),Fg.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),mm("toolbar-events",[n])])}function PC(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":IC({title:vt.none(),items:[]}),"overflow-button":Y0({name:"more",icon:vt.some("more-drawer"),disabled:!1,tooltip:vt.some("More..."),primary:!1,borderless:!1},vt.none(),t.providers)},splitToolbarBehaviours:VC(t,n)}}function HC(t){var n=t.cyclicKeying?"cyclic":"acyclic";return V1.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===bh.scrolling?["tox-toolbar--scrolling"]:[])},components:[V1.parts.groups({})],toolbarBehaviours:VC(t,n)})}function zC(t){return"string"==typeof t?t.split(" "):t}function NC(i,u){var a=lt(lt({},IO),u.menus),e=0<Ct(u.menus).length,t=F(void 0===u.menubar||!0===u.menubar?zC("file edit view insert format tools table help"):zC(!1===u.menubar?"":u.menubar),function(t){var n=Tt(IO,t);return e?n||tt(u.menus,t).exists(function(t){return Tt(t,"items")}):n});return F(M(t,function(t){var n=a[t],e={title:n.title,items:zC(n.items)},o=u,r=i.getParam("removed_menuitems","").split(/[ ,]/);return{text:e.title,getItems:function(){return z(e.items,function(t){var n=t.toLowerCase();return 0===n.trim().length||d(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:o.menuItems[n]?[o.menuItems[n]]:[]})}}}),function(t){return 0<t.getItems().length&&d(t.getItems(),function(t){return"separator"!==t.type})})}function LC(t){function n(){t._skinLoaded=!0,t.fire("SkinLoaded")}return function(){t.initialized?n():t.on("init",n)}}function WC(e,o,r){return new Ap(function(t,n){r.load(o,t,n),e.on("remove",function(){return r.unload(o)})})}function UC(t,n){var e,o,r,i,u,a,c,s,l,f=(r=(e=n).getParam("skin"),i=e.getParam("skin_url"),!1!==r&&(o=r||"oxide",i=i?e.documentBaseURI.toAbsolute(i):ov.baseURL+"/skins/ui/"+o),i);f&&n.contentCSS.push(f+(t?"/content.inline":"/content")+".min.css"),!1===n.getParam("skin")==0&&y(f)?Ap.all([WC(n,f+"/skin.min.css",n.ui.styleSheetLoader),(c=n,s=f,l=At.fromDom(c.getElement()),pe(l).isSome()?WC(c,s+"/skin.shadowdom.min.css",ev.DOM.styleSheetLoader):Ap.resolve())]).then(LC(n),(u=n,a="Skin could not be loaded",function(){return u.fire("SkinLoadError",{message:a})})):LC(n)()}function jC(o,r){return function(n){function t(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive);e.set(t)}var e=mc();return o.initialized?t():o.once("init",t),function(){o.off("init",t),e.clear()}}}function GC(o,r,i){return function(t){function n(){return i(t)}function e(){i(t),o.on(r,n)}return o.initialized?e():o.once("init",e),function(){o.off("init",e),o.off(r,n)}}}function XC(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}}function YC(t,n){return function(){return t.execCommand(n)}}function qC(t,n,e){var u,a,c,o=e.dataset,r="basic"===o.type?function(){return M(o.data,function(t){return yk(t,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:(u=n,a=e,c=function(t,n,e){var o="formatter"===t.type&&a.isInvalid(t);return 0===n?o?[]:i(t,n,!1,e).toArray():i(t,n,o,e).toArray()},{validateItems:s,getFetch:function(e,o){return function(t,n){n(U0(s(o()),Sh.CLOSE_ON_EXECUTE,e,!1))}}}),getStyleItems:r};function i(t,n,e,o){var r=u.shared.providers.translate(t.title);if("separator"===t.type)return vt.some({type:"separator",text:r});if("submenu"!==t.type)return vt.some(lt({type:"togglemenuitem",text:r,icon:t.icon,active:t.isSelected(o),disabled:e,onAction:a.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var i=z(t.getStyleItems(),function(t){return c(t,n,o)});return 0===n&&i.length<=0?vt.none():vt.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return z(t.getStyleItems(),function(t){return c(t,n,o)})}})}function s(t){var n=a.getCurrentValue(),e=a.shouldHide?0:1;return z(t,function(t){return c(t,e,n)})}}function KC(t,n,e){var o=qC(0,n,e),r=o.items,i=o.getStyleItems,u=GC(t,"NodeChange",function(t){var n=t.getComponent();e.updateText(n)});return L0({text:e.icon.isSome()?vt.none():e.text,icon:e.icon,tooltip:vt.from(e.tooltip),role:vt.none(),fetch:r.getFetch(n,i),onSetup:u,getApi:function(t){return{getComponent:rt(t)}},columns:1,presets:"normal",classes:e.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)}function JC(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return O1(t)}return!1}(t)&&!_1(t)}function $C(r,t){function n(t){return vl(r)}function e(e,o){return function(t,n){return ml(t,r,n).map(function(t){return e(t,n)}).getOr(o)}}function o(t,n){return"true"!==un(t.element,"aria-hidden")}var i,u=e(o,!1),a=e(function(t,n){var e;o(t)&&(dn(e=t.element,"display","none"),on(e,"aria-hidden","true"),br(t,Ji(),{name:n,visible:!1}))}),c=(i=a,function(n,t){St(t,function(t){return i(n,t)})}),s=e(function(t,n){var e;o(t)||(bn(e=t.element,"display"),sn(e,"aria-hidden"),br(t,Ji(),{name:n,visible:!0}))});return{uid:r.uid,dom:r.dom,components:t,behaviours:tl(r.slotBehaviours),apis:{getSlotNames:n,getSlot:function(t,n){return ml(t,r,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,n())},showSlot:s}}}function QC(t,n){ml(t,n,"overflow").each(function(e){TC(t,n,function(t){var n=M(t,function(t){return Eu(t)});V1.setGroups(e,n)}),ml(t,n,"overflow-button").each(function(t){eO.hasGrown(e)&&Lg.on(t)}),eO.refresh(e)})}var ZC,t1,n1,e1="data-value",o1=function(n,e,t,o){return M(t,function(t){return rk(t)?{type:"togglemenuitem",text:t.text,value:t.value,active:t.value===o,onAction:function(){Df.setValue(n,t.value),br(n,yy,{name:e}),Hg.focus(n)}}:{type:"nestedmenuitem",text:t.text,getSubmenuItems:function(){return o1(n,e,t.items,o)}}})},r1=function(t,n){return K(t,function(t){return rk(t)?ot(t.value===n,t):r1(t.items,n)})},i1=kl({name:"HtmlSelect",configFields:[mo("options"),Zs("selectBehaviours",[Hg,Df]),Eo("selectClasses",[]),Eo("selectAttributes",{}),wo("data")],factory:function(e,t){var n=M(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return sr("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:nl(e.selectBehaviours,[Hg.config({}),Df.config({store:lt({mode:"manual",getValue:function(t){return Qr(t.element)},setValue:function(t,n){V(e.options,function(t){return t.value===n}).isSome()&&Zr(t.element,n)}},o)})])}}}),u1=Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return eu([Cr(t.event,e),ru(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[Cr(t,function(){return n.cancel()})]}).getOr([])))}}),a1=Object.freeze({__proto__:null,throttle:ak,init:function(t){return t.stream.streams.state(t)}}),c1=xa({fields:[go("stream",lo("mode",{throttle:[mo("delay"),Eo("stopEvent",!0),ta("streams",{setup:function(t,n){var e=t.stream,o=vp(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:ak})]})),Eo("event","input"),wo("cancelEvent"),Qu("onStream")],name:"streaming",active:u1,state:a1}),s1=function(t){sk(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},l1=rt("alloy.typeahead.itemexecute"),f1=rt([wo("lazySink"),mo("fetch"),Eo("minChars",5),Eo("responseTime",1e3),Ju("onOpen"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Eo("layouts",vt.none()),Eo("eventOrder",{}),Vo("model",{},[Eo("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),Eo("selectsOver",!0),Eo("populateFromBrowse",!0)]),Ju("onSetValue"),$u("onExecute"),Ju("onItemExecute"),Eo("inputClasses",[]),Eo("inputAttributes",{}),Eo("inputStyles",{}),Eo("matchWidth",!0),Eo("useMinWidth",!1),Eo("dismissOnBlur",!0),qu(["openClass"]),wo("initialData"),Zs("typeaheadBehaviours",[Hg,Df,c1,Fg,Lg,$y]),cr("previewing",function(){return Po(!0)})].concat(Ey()).concat(ux())),d1=rt([$f({schema:[Yu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){!function(t,n,o){if(t.selectsOver){var e=Df.getValue(n),r=t.getDisplayText(e),i=Df.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?vt.some(function(){var e;ck(0,n,o),e=r.length,sk(n,function(t,n){return t.setSelectionRange(e,n.length)})}):vt.none()}return vt.none()}(o.model,t,e).fold(function(){return hd.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&ck(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOptional().map(function(t){return br(t,l1(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&ck(o.model,t,n)})}}}})]),m1=Cl({name:"Typeahead",configFields:f1(),partFields:d1(),factory:function(r,t,n,i){function e(t,n,e){r.previewing.set(!1);var o=$y.getCoupled(t,"sandbox");bf.isOpen(o)?cd.getCurrent(o).each(function(t){hd.getHighlighted(t).fold(function(){e(t)},function(){wr(o,t.element,"keydown",n)})}):nx(r,u(t),t,o,i,function(t){cd.getCurrent(t).each(e)},Hy.HighlightFirst).get(st)}function u(e){return function(t){return t.map(function(t){var n=z(Z(t.menus),function(t){return F(t.items,function(t){return"item"===t.type})});return Df.getState(e).update(M(n,function(t){return t.data})),t})}}var o=ry(r),a=[Hg.config({}),Df.config({onSetValue:r.onSetValue,store:lt({mode:"dataset",getDataKey:function(t){return Qr(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){Zr(t.element,r.model.getDisplayText(n))}},r.initialData.map(function(t){return sr("initialValue",t)}).getOr({}))}),c1.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e,o=$y.getCoupled(t,"sandbox");Hg.isFocused(t)&&Qr(t.element).length>=r.minChars&&(e=cd.getCurrent(o).bind(function(t){return hd.getHighlighted(t).map(Df.getValue)}),r.previewing.set(!0),nx(r,u(t),t,o,i,function(t){cd.getCurrent(o).each(function(t){e.fold(function(){r.model.selectsOver&&hd.highlightFirst(t)},function(n){hd.highlightBy(t,function(t){return Df.getValue(t).value===n.value}),hd.getHighlighted(t).orThunk(function(){return hd.highlightFirst(t),vt.none()})})})},Hy.HighlightFirst).get(st))},cancelEvent:zi()}),Fg.config({mode:"special",onDown:function(t,n){return e(t,n,hd.highlightFirst),vt.some(!0)},onEscape:function(t){var n=$y.getCoupled(t,"sandbox");return bf.isOpen(n)?(bf.close(n),vt.some(!0)):vt.none()},onUp:function(t,n){return e(t,n,hd.highlightLast),vt.some(!0)},onEnter:function(n){var t=$y.getCoupled(n,"sandbox"),e=bf.isOpen(t);if(e&&!r.previewing.get())return cd.getCurrent(t).bind(function(t){return hd.getHighlighted(t)}).map(function(t){return br(n,l1(),{item:t}),!0});var o=Df.getValue(n);return vr(n,zi()),r.onExecute(t,n,o),e&&bf.close(t),vt.some(!0)}}),Lg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(t){return rx(r,t,{onOpen:function(){return Lg.on(t)},onClose:function(){return Lg.off(t)}})}}}),mm("typeaheadevents",[uu(function(t){ex(r,u(t),t,i,st,Hy.HighlightFirst).get(st)}),Cr(l1(),function(t,n){var e=$y.getCoupled(t,"sandbox");ck(r.model,t,n.event.item),vr(t,zi()),r.onItemExecute(t,e,n.event.item,Df.getValue(t)),bf.close(e),s1(t)})].concat(r.dismissOnBlur?[Cr(Mi(),function(t){var n=$y.getCoupled(t,"sandbox");_a(n.element).isNone()&&bf.close(n)})]:[]))];return{uid:r.uid,dom:iy(Yo(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:lt(lt({},o),nl(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),g1=function(i){return lt(lt({},i),{toCached:function(){return g1(i.toCached())},bindFuture:function(n){return g1(i.bind(function(t){return t.fold(function(t){return Gy(Ve.error(t))},function(t){return n(t)})}))},bindResult:function(n){return g1(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return g1(i.map(function(t){return t.map(n)}))},mapError:function(n){return g1(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return g1(jy(function(n){var e=!1,o=setTimeout(function(){e=!0,n(Ve.error(r()))},t);i.get(function(t){e||(clearTimeout(o),n(t))})}))}})},p1=function(t){return g1(jy(t))},h1={type:"separator"},v1=Ir("aria-invalid"),b1={bar:pk(function(t,n){return e=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:M(t.items,e.interpreter)};var e}),collection:pk(function(t,n){return u=t,a=n.shared.providers,c=u.label.map(function(t){return oy(t,a)}),s=e(function(t,n,e,o){n.stop(),a.isDisabled()||br(t,Sy,{name:u.name,value:o})}),l=[Cr(vi(),e(function(t,n,e){ka(e)})),Cr(Ci(),s),Cr(Vi(),s),Cr(bi(),e(function(t,n,e){Iu(t.element,"."+Mh).each(function(t){qr(t,Mh)}),Yr(e,Mh)})),Cr(yi(),e(function(t){Iu(t.element,"."+Mh).each(function(t){qr(t,Mh)})})),uu(e(function(t,n,e,o){br(t,Sy,{name:u.name,value:o})}))],ey(c,my.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:h},behaviours:nc([gd.config({disabled:a.isDisabled,onDisabled:function(t){o(t,function(t){Yr(t,"tox-collection__item--state-disabled"),on(t,"aria-disabled",!0)})},onEnabled:function(t){o(t,function(t){qr(t,"tox-collection__item--state-disabled"),sn(t,"aria-disabled")})}}),pv(),Rg.config({}),Df.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n=o,e=M(t,function(t){var n=dp.translate(t.text),e=1===u.columns?'<div class="tox-collection__item-label">'+n+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=n.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item'+(a.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+hy.encodeAllRaw(t.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r=M("auto"!==u.columns&&1<u.columns?p(e,u.columns):[e],function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"});Ar(n.element,r.join("")),"auto"===u.columns&&ah(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;Fg.setGridSize(o,n,e)}),vr(o,Ty)}}),py.config({}),Fg.config(1===(i=u.columns)?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===i?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+Ch}}),mm("collection-events",l)]),eventOrder:((r={})[Ii()]=["disabling","alloy.base.behaviour","collection-events"],r)}),["tox-form__group--collection"],[]);function e(o){return function(n,e){Ru(e.event.target,"[data-collection-item-value]").each(function(t){o(n,e,t,un(t,"data-collection-item-value"))})}}function o(t,n){return M(vs(t.element,".tox-collection__item"),n)}var u,a,r,i,c,s,l}),alertbanner:pk(function(t,n){return o=n.shared.providers,ly.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+(e=t).level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Um(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){br(t,Sy,{name:"alert-banner",value:e.url})},buttonBehaviours:nc([jm()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:pk(function(t,n){return o=n.shared.providers,uk({name:(e=t).name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:vt.none(),maximized:e.maximized},o);var e,o}),textarea:pk(function(t,n){return o=n.shared.providers,uk({name:(e=t).name,multiline:!0,label:e.label,inputMode:vt.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:vt.none(),maximized:e.maximized},o);var e,o}),label:pk(function(t,n){return r={dom:{tag:"label",innerHtml:(o=n.shared).providers.translate((e=t).label),classes:["tox-label"]}},i=M(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:nc([aw(),Rg.config({}),cw(vt.none()),Fg.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(ZC=function(t,n){return e=t,o=n.shared.providers,u=bS&&e.sandboxed,a=lt(lt({},e.label.map(function(t){return{title:t}}).getOr({})),u?{sandbox:"allow-scripts allow-same-origin"}:{}),r=u,i=Po(""),c={getValue:function(t){return i.get()},setValue:function(t,n){var e;r?on(t.element,"srcdoc",n):(on(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),i.set(n)}},ey(e.label.map(function(t){return oy(t,o)}),my.parts.field({factory:{sketch:function(t){return d0({uid:t.uid,dom:{tag:"iframe",attributes:a},behaviours:nc([py.config({}),Hg.config({}),gS(vt.none(),c.getValue,c.setValue)])})}}}),["tox-form__group--stretched"],[]);var e,o,r,i,u,a,c},function(t,n,e){var o=Yo(n,{source:"dynamic"});return pk(ZC)(t,o,e)}),button:pk(function(t,n){return e=t,o=n.shared.providers,r=$0(e.name,"custom"),ey(vt.none(),my.parts.field(lt({factory:fp},K0(e,vt.some(r),o,[pS(""),aw()]))),[],[]);var e,o,r}),checkbox:pk(function(t,n){return r=t,i=n.shared.providers,u=Df.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,n){t.element.dom.checked=n}}}),a=my.parts.field({factory:{sketch:h},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:nc([aw(),gd.config({disabled:function(){return r.disabled||i.isDisabled()}}),py.config({}),Hg.config({}),u,Fg.config({mode:"special",onEnter:e,onSpace:e,stopSpaceKeyup:!0}),mm("checkbox-events",[Cr(ki(),function(t,n){br(t,yy,{name:r.name})})])])}),c=my.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:i.translate(r.label)},behaviours:nc([vw.config({})])}),s=zm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[o("checked"),o("unchecked")]}),my.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[a,s.asSpec(),c],fieldBehaviours:nc([gd.config({disabled:function(){return r.disabled||i.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])});function e(t){return t.element.dom.click(),vt.some(!0)}function o(t){return Xm("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},i.icons)}var r,i,u,a,c,s}),colorinput:pk(function(t,n){return e=t,r=n.shared,i=n.colorinput,c=my.parts.field({factory:Dy,inputClasses:["tox-textfield"],onSetValue:function(t){return Ky.run(t).get(st)},inputBehaviours:nc([gd.config({disabled:r.providers.isDisabled}),pv(),py.config({}),Ky.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Yt(t.element)},notify:{onValid:function(t){var n=Df.getValue(t);br(t,bw,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Df.getValue(t);if(0===n.length)return Gy(Ve.value(!0));var e=At.fromTag("span");dn(e,"background-color",n);var o=hn(e,"background-color").fold(function(){return Ve.error("blah")},function(t){return Ve.value(n)});return Gy(o)}}})]),selectOnFocus:!1}),s=e.label.map(function(t){return oy(t,r.providers)}),l=zm((u={dom:{tag:"span",attributes:{"aria-label":r.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ya,Xa,$a]},onLtr:function(){return[Xa,Ya,$a]}},components:[],fetch:wb(i.getColors(),i.hasCustomColors()),columns:i.getColorCols(),presets:"color",onItemAction:function(t,e){l.getOpt(t).each(function(n){"custom"===e?i.colorPicker(function(t){t.fold(function(){return vr(n,xw)},function(t){o(n,t),hb(t)})},"#ffffff"):o(n,"remove"===e?"":e)})}},hw.sketch({dom:u.dom,components:u.components,toggleClass:"mce-active",dropdownBehaviours:nc([$v((a=r).providers.isDisabled),pv(),vw.config({}),py.config({})]),layouts:u.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:a.getSink,fetch:function(n){return jy(function(t){return u.fetch(t)}).map(function(t){return vt.from(Xb(Yo(Ob(Ir("menu-value"),t,function(t){u.onItemAction(n,t)},u.columns,u.presets,Sh.CLOSE_ON_EXECUTE,T,a.providers),{movement:_b(u.columns,u.presets)})))})},parts:{menu:Zp(0,0,u.presets)}}))),my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[c,l.asSpec()]}]),fieldBehaviours:nc([mm("form-field-events",[Cr(bw,function(t,n){l.getOpt(t).each(function(t){dn(t.element,"background-color",n.event.color)}),br(t,yy,{name:e.name})}),Cr(yw,function(n,e){my.getField(n).each(function(t){Df.setValue(t,e.event.value),cd.getCurrent(n).each(Hg.focus)})}),Cr(xw,function(n,t){my.getField(n).each(function(t){cd.getCurrent(n).each(Hg.focus)})})])])});function o(t,n){br(t,yw,{value:n})}var e,r,i,u,a,c,s,l}),colorpicker:pk(function(t){var r=zm(a0(c0,function(t){return"tox-"+t}).sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){br(t,Sy,{name:"hex-valid",value:!0})},onInvalidHex:function(t){br(t,Sy,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:nc([Df.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return cd.getCurrent(n).bind(function(t){return Df.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);cd.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Df.setValue(t,{hex:vt.from(e[1]).getOr("")}),eS.getField(t,"hex").each(function(t){vr(t,Si())})})}}}),aw()])}}),dropzone:pk(function(t,n){return l0(t,n.shared.providers)}),grid:pk(function(t,n){return e=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:M(t.items,e.interpreter)};var e}),listbox:pk(function(t,n){return e=t,r=(o=n).shared.providers,i=Y(e.items).filter(rk),u=e.label.map(function(t){return oy(t,r)}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[my.parts.field({dom:{},factory:{sketch:function(t){return L0({uid:t.uid,text:i.map(function(t){return t.text}),icon:vt.none(),tooltip:e.label,role:vt.none(),fetch:function(t,n){n(U0(o1(t,e.name,e.items,Df.getValue(t)),Sh.CLOSE_ON_EXECUTE,o,!1))},onSetup:rt(st),getApi:rt({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[py.config({}),Df.config({store:{mode:"manual",initialValue:i.map(function(t){return t.value}).getOr(""),getValue:function(t){return un(t.element,e1)},setValue:function(n,t){r1(e.items,t).each(function(t){on(n.element,e1,t.value),br(n,VS,{text:t.text})})}}})]},"tox-listbox",o.shared)}}})]},my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([u.toArray(),[a]]),fieldBehaviours:nc([gd.config({disabled:rt(e.disabled),onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}})])});var e,o,r,i,u,a}),selectbox:pk(function(t,n){return e=t,o=n.shared.providers,r=M(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return oy(t,o)}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:ft([[my.parts.field({dom:{},selectAttributes:{size:e.size},options:r,factory:i1,selectBehaviours:nc([gd.config({disabled:function(){return e.disabled||o.isDisabled()}}),py.config({}),mm("selectbox-change",[Cr(ki(),function(t,n){br(t,yy,{name:e.name})})])])})],(1<e.size?vt.none():vt.some(Xm("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},o.icons))).toArray()])},my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([i.toArray(),[u]]),fieldBehaviours:nc([gd.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])});var e,o,r,i,u}),sizeinput:pk(function(t,n){return ow(t,n.shared.providers)}),urlinput:pk(function(t,n){return gk(t,n,n.urlinput)}),customeditor:pk(function(e){var o=gc(),n=zm({dom:{tag:e.tag}}),r=gc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:nc([mm("custom-editor-events",[ou(function(t){n.getOpt(t).each(function(n){(Tt(e,"init")?e.init(n.element.dom):lS.load(e.scriptId,e.scriptUrl).then(function(t){return t(n.element.dom,e.settings)})).then(function(n){r.on(function(t){n.setValue(t)}),r.clear(),o.set(n)})})})]),Df.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){o.get().fold(function(){r.set(n)},function(t){return t.setValue(n)})}}}),aw()]),components:[n.asSpec()]}}),htmlpanel:pk(function(t){return"presentation"===t.presets?ly.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):ly.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:nc([py.config({}),Hg.config({})])})}),imagetools:pk(function(t,n){return ok(t,n.shared.providers)}),table:pk(function(t,n){return ik(t,n.shared.providers)}),panel:pk(function(t,n){return{dom:{tag:"div",classes:t.classes},components:M(t.items,n.shared.interpreter)}})},y1={field:function(t,n){return n}},x1=function(n,e,o){return tt(b1,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},w1={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},S1=[{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",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],k1=function(t){return R(t,function(t,n){if(Tt(n,"items")){var e=k1(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(Tt(n,"inline")||Tt(n,"block")||Tt(n,"selector")){var o="custom-"+(y(n.name)?n.name:n.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return lt(lt({},t),{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},C1=fS.trim,O1=wk("true"),_1=wk("false"),T1=function(t){var n=M(vs(At.fromDom(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),function(t){return t.dom});return F(M(F(n,_k),Tk).concat(M(F(n,Ck),Ek)),Dk)},E1="tinymce-url-history",D1=od,B1=nd,M1=rt([Eo("shell",!1),mo("makeItem"),Eo("setupItem",st),Bf("listBehaviours",[Rg])]),A1=rt([Qf({name:"items",overrides:function(){return{behaviours:nc([Rg.config({})])}}})]),F1=Cl({name:rt("CustomList")(),configFields:M1(),partFields:A1(),factory:function(s,t,n,e){var o=s.shell?{behaviours:[Rg.config({})],components:[]}:{behaviours:[],components:t};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:nl(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){var t;t=a,(s.shell?vt.some(t):ml(t,s,"items")).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(n){var t=Rg.contents(n),e=c.length,o=e-t.length,r=0<o?m(o,function(){return s.makeItem()}):[],i=t.slice(e);St(i,function(t){return Rg.remove(n,t)}),St(r,function(t){return Rg.append(n,t)});var u=Rg.contents(n);St(u,function(t,n){s.setupItem(a,t,c[n],n)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),I1=rt([mo("dom"),Eo("shell",!0),Zs("toolbarBehaviours",[Rg])]),R1=rt([Qf({name:"groups",overrides:function(){return{behaviours:nc([Rg.config({})])}}})]),V1=Cl({name:"Toolbar",configFields:I1(),partFields:R1(),factory:function(o,t,n,e){var r=o.shell?{behaviours:[Rg.config({})],components:[]}:{behaviours:[],components:t};return{uid:o.uid,dom:o.dom,components:r.components,behaviours:nl(o.toolbarBehaviours,r.behaviours),apis:{setGroups:function(t,n){var e;e=t,(o.shell?vt.some(e):ml(e,o,"groups")).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Rg.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),P1=rt([]),H1=Object.freeze({__proto__:null,setup:st,isDocked:T,getBehaviours:P1}),z1=Ho([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),N1=function(t,n,e){var o,r,i,u;t.getSystem().isConnected()&&(i=e,u=(r=n).lazyViewport(o=t),i.isDocked()&&$k(o,r,i,u),qk(o,u,i).each(function(t){t.fold(function(){return Kk(o,r,i)},function(t){return Jk(o,r,i,t)},function(t){$k(o,r,i,u,!0),Jk(o,r,i,t)})}))},L1=Object.freeze({__proto__:null,refresh:N1,reset:Qk,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),W1=Object.freeze({__proto__:null,events:function(o,r){return eu([Br(_i(),function(n,e){o.contextual.each(function(t){Kr(n.element,t.transitionClass)&&($r(n.element,[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n)),e.stop()})}),Cr(Ui(),function(t,n){N1(t,o,r)}),Cr(ji(),function(t,n){Qk(t,o,r)})])}}),U1=xa({fields:[To("contextual",[po("fadeInClass"),po("fadeOutClass"),po("transitionClass"),vo("lazyContext"),Ju("onShow"),Ju("onShown"),Ju("onHide"),Ju("onHidden")]),Io("lazyViewport",Fe),Ro("modes",["top","bottom"],nr),Ju("onDocked"),Ju("onUndocked")],name:"docking",active:W1,apis:L1,state:Object.freeze({__proto__:null,init:function(t){var n=Po(!1),e=Po(!0),o=gc(),r=Po(t.modes);return wu({isDocked:n.get,setDocked:n.set,getInitialPos:o.get,setInitialPos:o.set,clearInitialPos:o.clear,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),j1=rt(Ir("toolbar-height-change")),G1={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},X1="tox-tinymce--toolbar-sticky-on",Y1="tox-tinymce--toolbar-sticky-off",q1=Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each(U1.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(tC)}),t.on("SkinLoaded",function(){e().each(function(t){U1.isDocked(t)?U1.reset(t):U1.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each(U1.reset)})),t.on("AfterScrollIntoView",function(b){e().each(function(t){U1.refresh(t);var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=t.element;Pd(v)&&(n=b,r=(o=Ut(e=v)).dom.defaultView.innerHeight,i=Rn(o),a=Nn(u=At.fromDom(n.elm)),c=wn(u),l=(s=a.y)+c,f=Cn(e),d=wn(e),g=(m=f.top)+d,p=Math.abs(m-i.top)<2,h=Math.abs(g-(i.top+r))<2,p&&s<g?Vn(i.left,s-d,o):h&&m<l&&Vn(i.left,s-r+c+d,o))})}),t.on("PostRender",function(){eC(t,!1)})},isDocked:function(t){return t().map(U1.isDocked).getOr(!1)},getBehaviours:oC}),K1=$o([po("type"),go("items",eo([Qo([po("name"),xo("items",nr)]),nr]))].concat(Hp)),J1=[Co("text"),Co("tooltip"),Co("icon"),vo("fetch"),Io("onSetup",function(){return st})],$1=$o(H([po("type")],J1,!0)),Q1=$o([po("type"),Co("tooltip"),Co("icon"),Co("text"),Oo("select"),vo("fetch"),Io("onSetup",function(){return st}),Ao("presets","normal",["normal","color","listpreview"]),Eo("columns",1),vo("onAction"),vo("onItemAction")]),Z1=kl({factory:function(n,o){var t={focus:Fg.focusIn,setMenus:function(t,n){var e=M(n,function(n){return G0(rC({type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}}).mapError(function(t){return ur(t)}).getOrDie(),"tox-mbtn",o.backstage,vt.some("menuitem"))});Rg.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:nc([Rg.config({}),mm("menubar-events",[ou(function(t){n.onSetup(t)}),Cr(vi(),function(e,t){Iu(e.element,".tox-mbtn--active").each(function(n){Ru(t.event.target,".tox-mbtn").each(function(t){Lt(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){hw.expand(t),hw.close(n),Hg.focus(t)})})})})}),Cr(Ki(),function(e,t){t.event.prevFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(n){t.event.newFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(t){hw.isOpen(n)&&(hw.expand(t),hw.close(n))})})})]),Fg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),vt.some(!0)}}),py.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[mo("dom"),mo("uid"),mo("onEscape"),mo("backstage"),Eo("onSetup",st)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),tO=Object.freeze({__proto__:null,refresh:function(t,n,e){var o;e.isExpanded()&&(bn(t.element,uC(n)),o=aC(n,t.element),dn(t.element,uC(n),o))},grow:function(t,n,e){e.isExpanded()||mC(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&dC(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&fC(t,n,e)},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:gC,isShrinking:pC,isTransitioning:function(t,n,e){return gC(t,n)||pC(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?dC:mC)(t,n,e)},disableTransitions:cC}),nO=Object.freeze({__proto__:null,exhibit:function(t,n,e){return Lr(n.expanded?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:sr(n.dimension.property,"0px")})},events:function(e,o){return eu([Br(_i(),function(t,n){n.event.raw.propertyName===e.dimension.property&&(cC(t,e),o.isExpanded()&&bn(t.element,e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),eO=xa({fields:[mo("closedClass"),mo("openClass"),mo("shrinkingClass"),mo("growingClass"),wo("getAnimationRoot"),Ju("onShrunk"),Ju("onStartShrink"),Ju("onGrown"),Ju("onStartGrow"),Eo("expanded",!1),go("dimension",lo("property",{width:[ta("property","width"),ta("getDimension",function(t){return On(t)+"px"})],height:[ta("property","height"),ta("getDimension",function(t){return wn(t)+"px"})]}))],name:"sliding",active:nO,apis:tO,state:Object.freeze({__proto__:null,init:function(t){var n=Po(t.expanded);return wu({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:C(n.set,!1),setExpanded:C(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),oO="container",rO=[Zs("slotBehaviours",[])],iO=dt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},zr),uO=lt(lt({},iO),{sketch:function(t){var e,n={slot:function(t,n){return e.push(t),cl(oO,hC(t),n)},record:rt(e=[])},o=t(n),r=M(n.record(),function(t){return Jf({name:t,pname:hC(t)})});return Sl(oO,rO,r,$C,o)}}),aO=$o([Co("icon"),Co("tooltip"),Io("onShow",st),Io("onHide",st),Io("onSetup",function(){return st})]),cO=Ir("FixSizeEvent"),sO=Ir("AutoSizeEvent"),lO=Object.freeze({__proto__:null,block:function(t,n,e,o){on(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=nc([Fg.config({mode:"special",onTab:function(){return vt.some(!0)},onShiftTab:function(){return vt.some(!0)}}),Hg.config({})]),u=o(r,i),a=r.getSystem().build(u);Rg.append(r,Eu(a)),a.hasConfigured(Fg)&&n.focus&&Fg.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return Rg.remove(r,a)})},unblock:function(t,n,e){sn(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()}}),fO=xa({fields:[Io("getRoot",vt.none),Fo("focus",!0),Ju("onBlock"),Ju("onUnblock")],name:"blocking",apis:lO,state:Object.freeze({__proto__:null,init:function(){var n=dc();return wu({readState:n.isSet,blockWith:function(t){n.set({destroy:t})},clear:n.clear,isBlocked:n.isSet})}})}),dO=rt([Zs("splitToolbarBehaviours",[$y]),cr("builtGroups",function(){return Po([])})]),mO=rt([qu(["overflowToggledClass"]),Oo("getOverflowBounds"),mo("lazySink"),cr("overflowGroups",function(){return Po([])})].concat(dO())),gO=rt([Jf({factory:V1,schema:I1(),name:"primary"}),$f({schema:I1(),name:"overflow"}),$f({name:"overflow-button"}),$f({name:"overflow-group"})]),pO=rt(function(t,n){var e=t,o=Math.floor(n);dn(e,"max-width",Oe.max(e,o,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"])+"px")}),hO=rt([qu(["toggledClass"]),mo("lazySink"),vo("fetch"),Oo("getBounds"),To("fireDismissalEventInstead",[Eo("event",Yi())]),Wc()]),vO=rt([$f({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:nc([Lg.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),$f({factory:V1,schema:I1(),name:"toolbar",overrides:function(n){return{toolbarBehaviours:nc([Fg.config({mode:"cyclic",onEscape:function(t){return ml(t,n,"button").each(Hg.focus),vt.none()}})])}}})]),bO=Cl({name:"FloatingToolbarButton",factory:function(u,t,a,n){return lt(lt({},fp.sketch(lt(lt({},n.button()),{action:function(t){EC(t,n)},buttonBehaviours:Mf({dump:n.button().buttonBehaviours},[$y.config({others:{toolbarSandbox:function(t){return o=t,e=a,r=u,{dom:{tag:"div",attributes:{id:(i=Vu()).id}},behaviours:nc([Fg.config({mode:"special",onEscape:function(t){return bf.close(t),vt.some(!0)}}),bf.config({onOpen:function(t,n){r.fetch().get(function(t){BC(o,n,r,e.layouts,t),i.link(o.element),Fg.focusIn(n)})},onClose:function(){Lg.off(o),Hg.focus(o),i.unlink(o.element)},isPartOf:function(t,n,e){return zu(n,e)||zu(o,e)},getAttachPoint:function(){return r.lazySink(o).getOrDie()}}),ic.config({channels:lt(lt({},Xs(lt({isExtraPart:T},r.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ys({doReposition:function(){bf.getState($y.getCoupled(o,"toolbarSandbox")).each(function(t){DC(o,t,r,e.layouts)})}}))})])};var o,e,r,i}}})])}))),{apis:{setGroups:function(n,e){bf.getState($y.getCoupled(n,"toolbarSandbox")).each(function(t){BC(n,t,u,a.layouts,e)})},reposition:function(n){bf.getState($y.getCoupled(n,"toolbarSandbox")).each(function(t){DC(n,t,u,a.layouts)})},toggle:function(t){EC(t,n)},getToolbar:function(t){return bf.getState($y.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bf.isOpen($y.getCoupled(t,"toolbarSandbox"))}}})},configFields:hO(),partFields:vO(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),yO=rt([mo("items"),qu(["itemSelector"]),Zs("tgroupBehaviours",[Fg])]),xO=rt([Zf({name:"items",unit:"item"})]),wO=Cl({name:"ToolbarGroup",configFields:yO(),partFields:xO(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:nl(t.tgroupBehaviours,[Fg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),SO=Cl({name:"SplitFloatingToolbar",configFields:mO(),partFields:gO(),factory:function(e,t,n,o){var r=zm(bO.sketch({fetch:function(){return jy(function(t){t(MC(e.overflowGroups.get()))})},layouts:{onLtr:function(){return[Ya,Xa]},onRtl:function(){return[Xa,Ya]},onBottomLtr:function(){return[Ka,qa]},onBottomRtl:function(){return[qa,Ka]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:nl(e.splitToolbarBehaviours,[$y.config({others:{overflowGroup:function(){return wO.sketch(lt(lt({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set(M(n,t.getSystem().build)),AC(t,r,e)},refresh:function(t){return AC(t,r,e)},toggle:function(t){r.getOpt(t).each(function(t){bO.toggle(t)})},isOpen:function(t){return r.getOpt(t).map(bO.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){bO.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(bO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),kO=rt([qu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ju("onOpened"),Ju("onClosed")].concat(dO())),CO=rt([Jf({factory:V1,schema:I1(),name:"primary"}),Jf({factory:V1,schema:I1(),name:"overflow",overrides:function(n){return{toolbarBehaviours:nc([eO.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){ml(t,n,"overflow-button").each(function(t){Lg.off(t),Hg.focus(t)}),n.onClosed(t)},onGrown:function(t){Fg.focusIn(t),n.onOpened(t)},onStartGrow:function(t){ml(t,n,"overflow-button").each(Lg.on)}}),Fg.config({mode:"acyclic",onEscape:function(t){return ml(t,n,"overflow-button").each(Hg.focus),vt.some(!0)}})])}}}),$f({name:"overflow-button",overrides:function(t){return{buttonBehaviours:nc([Lg.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),$f({name:"overflow-group"})]),OO=Cl({name:"SplitSlidingToolbar",configFields:kO(),partFields:CO(),factory:function(o,t,n,e){var r="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:nl(o.splitToolbarBehaviours,[$y.config({others:{overflowGroup:function(n){return wO.sketch(lt(lt({},e["overflow-group"]()),{items:[fp.sketch(lt(lt({},e["overflow-button"]()),{action:function(t){vr(n,r)}}))]}))}}}),mm("toolbar-toggle-events",[Cr(r,function(t){FC(t,o)})])]),apis:{setGroups:function(t,n){var e=M(n,t.getSystem().build);o.builtGroups.set(e),QC(t,o)},refresh:function(t){return QC(t,o)},toggle:function(t){return FC(t,o)},isOpen:function(t){return ml(t,o,"overflow").map(eO.hasGrown).getOr(!1)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)}}}),_O=B1.optional({factory:Z1,name:"menubar",schema:[mo("backstage")]}),TO=B1.optional({factory:{sketch:function(t){return F1.sketch({uid:t.uid,dom:t.dom,listBehaviours:nc([Fg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return HC({type:t.type,uid:Ir("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),vt.some(!0)}})},setupItem:function(t,n,e,o){V1.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[mo("dom"),mo("onEscape")]}),EO=B1.optional({factory:{sketch:function(t){return(t.type===bh.sliding?function(t){var n=OO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=OO.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=PC(t);return OO.sketch(lt(lt({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([j1()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([j1()],{type:"closed"})}}))}:t.type===bh.floating?function(i){var t=PC(i),n=SO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return SO.sketch(lt(lt({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element,n=Nn(t),e=Gt(t),o=Nn(e),r=Math.max(e.dom.scrollHeight,o.height);return Me(n.x+4,o.y,n.width-8,r)},parts:lt(lt({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}:HC)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),vt.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[mo("dom"),mo("onEscape"),mo("getSink")]}),DO=B1.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?oC:P1;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:nc(e(n,t.sharedBackstage))}}},name:"header",schema:[mo("dom")]}),BO=B1.optional({name:"socket",schema:[mo("dom")]}),MO=B1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:nc([py.config({}),Hg.config({}),eO.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){cd.getCurrent(t).each(uO.hideAllSlots),vr(t,sO)},onGrown:function(t){vr(t,sO)},onStartGrow:function(t){br(t,cO,{width:hn(t.element,"width").getOr("")})},onStartShrink:function(t){br(t,cO,{width:On(t.element)+"px"})}}),Rg.config({}),cd.config({find:function(t){return Y(Rg.contents(t))}})])}],behaviours:nc([cS(0),mm("sidebar-sliding-events",[Cr(cO,function(t,n){dn(t.element,"width",n.event.width)}),Cr(sO,function(t,n){bn(t.element,"width")})])])}}},name:"sidebar",schema:[mo("dom")]}),AO=B1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:nc([Rg.config({}),fO.config({focus:!1}),cd.config({find:function(t){return Y(t.components())}})]),components:[]}}},name:"throbber",schema:[mo("dom")]}),FO=Cl({name:"OuterContainer",factory:function(e,t,n){return{uid:e.uid,dom:e.dom,components:t,apis:{getSocket:function(t){return D1.getPart(t,e,"socket")},setSidebar:function(t,n){D1.getPart(t,e,"sidebar").each(function(t){return bC(t,n)})},toggleSidebar:function(t,n){D1.getPart(t,e,"sidebar").each(function(t){var e=n;cd.getCurrent(t).each(function(n){cd.getCurrent(n).each(function(t){eO.hasGrown(n)?uO.isShowing(t,e)?eO.shrink(n):(uO.hideAllSlots(t),uO.showSlot(t,e)):(uO.hideAllSlots(t),uO.showSlot(t,e),eO.grow(n))})})})},whichSidebar:function(t){return D1.getPart(t,e,"sidebar").bind(yC).getOrNull()},getHeader:function(t){return D1.getPart(t,e,"header")},getToolbar:function(t){return D1.getPart(t,e,"toolbar")},setToolbar:function(t,n){D1.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){D1.getPart(t,e,"multiple-toolbar").each(function(t){F1.setItems(t,n)})},refreshToolbar:function(t){D1.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(t){D1.getPart(t,e,"toolbar").each(function(n){var t=n.getApis().toggle;null!=t?vt.some(function(t){return t(n)}(t)):vt.none()})},isToolbarDrawerToggled:function(t){return D1.getPart(t,e,"toolbar").bind(function(n){return vt.from(n.getApis().isOpen).map(function(t){return t(n)})}).getOr(!1)},getThrobber:function(t){return D1.getPart(t,e,"throbber")},focusToolbar:function(t){D1.getPart(t,e,"toolbar").orThunk(function(){return D1.getPart(t,e,"multiple-toolbar")}).each(function(t){Fg.focusIn(t)})},setMenubar:function(t,n){D1.getPart(t,e,"menubar").each(function(t){Z1.setMenus(t,n)})},focusMenubar:function(t){D1.getPart(t,e,"menubar").each(function(t){Z1.focus(t)})}},behaviours:e.behaviours}},configFields:[mo("dom"),mo("behaviours")],partFields:[DO,_O,EO,TO,BO,MO,AO],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=M(e,RC);t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=M(e,function(t){return M(t,RC)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},isToolbarDrawerToggled:function(t,n){return t.isToolbarDrawerToggled(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),IO={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},RO=C(UC,!1),VO=C(UC,!0);function PO(t,n,e,o){var r;return{type:"basic",data:(r=t.getParam(n,e,"string"),M(o===t1.SemiColon?r.replace(/;$/,"").split(";"):r.split(" "),function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}}function HO(e){var t={type:"basic",data:v_};return{tooltip:"Align",text:vt.none(),icon:vt.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(t){return vt.none},onAction:function(n){return function(){return V(v_,function(t){return t.format===n.format}).each(function(t){return e.execCommand(t.command)})}},updateText:function(t){var n=V(v_,function(t){return e.formatter.match(t.format)}).fold(rt("left"),function(t){return t.title.toLowerCase()});br(t,PS,{icon:"align-"+n})},dataset:t,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}}function zO(t){return M(t.split(/\s*,\s*/),function(t){return t.replace(/^['"]+|['"]+$/g,"")})}function NO(r){function i(){function e(t){return t?zO(t)[0]:""}var t=r.queryCommandValue("FontName"),n=a.data,o=t?t.toLowerCase():"";return{matchOpt:V(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return ot(0===(t=o).indexOf("-apple-system")&&(n=zO(t.toLowerCase()),N(b_,function(t){return-1<n.indexOf(t.toLowerCase())})),{title:u,format:o});var t,n}),font:t}}var u="System Font",a=PO(r,"font_formats","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",t1.SemiColon);return{tooltip:"Fonts",text:vt.some(u),icon:vt.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(t){return function(){return vt.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},updateText:function(t){var n=i(),e=n.matchOpt,o=n.font,r=e.fold(rt(o),function(t){return t.title});br(t,VS,{text:r})},dataset:a,shouldHide:!1,isInvalid:T}}function LO(e){function i(){var a=vt.none(),c=o.data,s=e.queryCommandValue("FontSize");if(s)for(var t=function(t){var n,e,o,r,i=(e=t,/[0-9.]+px$/.test(n=s)?(o=72*parseInt(n,10)/96,r=Math.pow(10,e||0),Math.round(o*r)/r+"pt"):tt(x_,n).getOr(n)),u=tt(y_,i).getOr("");a=V(c,function(t){return t.format===s||t.format===i||t.format===u})},n=3;a.isNone()&&0<=n;n--)t(n);return{matchOpt:a,size:s}}var t=rt(vt.none),o=PO(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",t1.Space);return{tooltip:"Font sizes",text:vt.some("12pt"),icon:vt.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getPreviewFor:t,getCurrentValue:function(){return i().matchOpt},onAction:function(t){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,t.format)})}},updateText:function(t){var n=i(),e=n.matchOpt,o=n.size,r=e.fold(rt(o),function(t){return t.title});br(t,VS,{text:r})},dataset:o,shouldHide:!1,isInvalid:T}}function WO(t,n){var e=n(),o=M(e,function(t){return t.format});return vt.from(t.formatter.closest(o)).bind(function(n){return V(e,function(t){return t.format===n})}).orThunk(function(){return ot(t.formatter.match("p"),{title:"Paragraph",format:"p"})})}function UO(e){var o=PO(e,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",t1.SemiColon);return{tooltip:"Blocks",text:vt.some("Paragraph"),icon:vt.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(n){return function(){var t=e.formatter.get(n);return vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(n))})}},onAction:XC(e),updateText:function(t){var n=WO(e,function(){return o.data}).fold(rt("Paragraph"),function(t){return t.title});br(t,VS,{text:n})},dataset:o,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}}function jO(r,t){return{tooltip:"Formats",text:vt.some("Paragraph"),icon:vt.none(),isSelectedFor:function(t){return function(){return r.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(n){return function(){var t=r.formatter.get(n);return void 0!==t?vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(n))}):vt.none()}},onAction:XC(r),updateText:function(t){var e=function(t){var n=t.items;return void 0!==n&&0<n.length?z(n,e):[{title:t.title,format:t.format}]},n=z(bk(r),e),o=WO(r,rt(n)).fold(rt("Paragraph"),function(t){return t.title});br(t,VS,{text:o})},shouldHide:r.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!r.formatter.canApply(t.format)},dataset:t}}function GO(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}}function XO(n){return{setActive:function(t){Lg.set(n,t)},isActive:function(){return Lg.isOn(n)},isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)}}}function YO(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})}function qO(n,e,t,o,r,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:YO(t,i)},components:tb([n.map(function(t){return H0(t,i.icons)}),e.map(function(t){return N0(t,"tox-tbtn",i)})]),eventOrder:((u={})[mi()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:nc([Qv(i.isDisabled),pv(),mm("common-button-display-events",[Cr(mi(),function(t,n){n.event.prevent(),vr(t,T_)})])].concat(o.map(function(t){return k_.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return tb([t.icon.map(function(t){return H0(t,i.icons)}),t.text.map(function(t){return N0(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}}function KO(t,n,e){var o,r=Po(st),i=qO(t.icon,t.text,t.tooltip,vt.none(),vt.none(),e);return fp.sketch({dom:i.dom,components:i.components,eventOrder:RS,buttonBehaviours:nc([mm("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},uu(function(n,t){hv(o,n)(function(t){br(n,IS,{buttonApi:t}),o.onAction(t)})})),vv(n,r),bv(n,r)]),Qv(function(){return t.disabled||e.isDisabled()}),pv()].concat(n.toolbarButtonBehaviours))})}function JO(r,i){return function(t,n,e){var o=r(t).mapError(function(t){return ur(t)}).getOrDie();return i(o,n,e)}}function $O(e,t,o,r){var n,i=t.outerContainer,u=o.toolbar,a=o.buttons;f(u,y)?(n=u.map(function(t){var n={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return F_(e,n,{backstage:r},vt.none())}),FO.setToolbars(i,n)):FO.setToolbar(i,F_(e,o,{backstage:r},vt.none()))}function QO(t){return/^[0-9\.]+(|px)$/i.test(""+t)?vt.some(parseInt(""+t,10)):vt.none()}function ZO(t){return u(t)?t+"px":t}function t_(n,t,e){var o=t.filter(function(t){return n<t}),r=e.filter(function(t){return t<n});return o.or(r).getOr(n)}function n_(t){var n=lh(t),e=fh(t),o=mh(t);return QO(n).map(function(t){return t_(t,e,o)})}function e_(u,a,t,n,c){function s(){return x.get()&&!u.removed}function l(t){return y?t.fold(rt(0),function(t){return 1<t.components().length?wn(t.components()[1].element):0}):0}function f(){r.broadcastOn([xf()],{})}function o(t){var n,e,o,r,i;void 0===t&&(t=!1),s()&&(m||(n=p.getOrThunk(function(){var t=QO(pn(be(),"margin-left")).getOr(0);return On(be())-Cn(a).left+t}),dn(c.get().element,"max-width",n+"px")),y&&FO.refreshToolbar(d),m||(e=l(FO.getToolbar(d)),o=Ae(a),r=v()?Math.max(o.y-wn(c.get().element)+e,0):o.bottom,mn(d.element,{position:"absolute",top:Math.round(r)+"px",left:Math.round(o.x)+"px"})),g&&(i=c.get(),t?U1.reset(i):U1.refresh(i)),f())}function e(t){var n,e;void 0===t&&(t=!0),!m&&g&&s()&&(n=h.getDockingMode(),(e=function(t){switch(uv(u)){case xh.auto:var n=l(FO.getToolbar(d)),e=wn(t.element)-n,o=Ae(a);if(o.y>e)return"top";var r=Gt(a),i=Math.max(r.dom.scrollHeight,wn(r));return o.bottom<i-e||Fe().bottom<o.bottom-e?"bottom":"top";case xh.bottom:return"bottom";default:return xh.top,"top"}}(c.get()))!==n&&(function(t){var n=c.get();U1.setModes(n,[t]),h.setDockingMode(t);var e=v()?Oc.TopToBottom:Oc.BottomToTop;on(n.element,es,e)}(e),t&&o(!0)))}var r=t.uiMothership,d=t.outerContainer,i=ev.DOM,m=sv(u),g=dv(u),p=mh(u).or(n_(u)),h=n.shared.header,v=h.isPositionedAtTop,b=iv(u),y=b===bh.sliding||b===bh.floating,x=Po(!1);return{isVisible:s,isPositionedAtTop:v,show:function(){x.set(!0),dn(d.element,"display","flex"),i.addClass(u.getBody(),"mce-edit-focus"),bn(r.element,"display"),e(!1),o()},hide:function(){x.set(!1),t.outerContainer&&(dn(d.element,"display","none"),i.removeClass(u.getBody(),"mce-edit-focus")),dn(r.element,"display","none")},update:o,updateMode:e,repositionPopups:f}}function o_(t,n){var e=Ae(t);return{pos:n?e.y:e.bottom,bounds:e}}function r_(i,u){return Cr(IS,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return vr(e,Hi())},getValue:function(){return Df.getValue(e)}});u.onAction(r,n.event.buttonApi)})}function i_(t,n,e){return n.bottom-t.y>=(e=void 0===e?.01:e)&&t.bottom-n.y>=e}function u_(t){var n=function(t){var n=t.getBoundingClientRect();if(n.height<=0&&n.width<=0){var e=Qt(At.fromDom(t.startContainer),t.startOffset).element;return(Yn(e)?Yt(e):vt.some(e)).filter(Xn).map(function(t){return t.dom.getBoundingClientRect()}).getOr(n)}return n}(t.selection.getRng());if(t.inline){var e=Rn();return Me(e.left+n.left,e.top+n.top,n.width,n.height)}var o=Nn(At.fromDom(t.getBody()));return Me(o.x+n.left,o.y+n.top,n.width,n.height)}function a_(t,n,e,o){void 0===o&&(o=0);var r,i,u,a,c=Hn(window),s=Ae(At.fromDom(t.getContentAreaContainer())),l=ph(t)||hh(t)||rv(t),f=(r=s,i=c,u=o,{x:a=Math.max(r.x+u,i.x),width:Math.min(r.right-u,i.right)-a}),d=f.x,m=f.width;if(t.inline&&!l)return Me(d,c.y,m,c.height);var g=function(t,n,e,o,r,i){var u=At.fromDom(t.getContainer()),a=Iu(u,".tox-editor-header").getOr(u),c=Ae(a),s=c.y>=n.bottom,l=o&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,e.y),bottom:e.bottom};if(t.inline&&!l)return{y:e.y,bottom:Math.min(c.y-i,e.bottom)};var f="line"===r?Ae(u):n;return l?{y:Math.max(c.bottom+i,e.y),bottom:Math.min(f.bottom-i,e.bottom)}:{y:Math.max(f.y+i,e.y),bottom:Math.min(c.y-i,e.bottom)}}(t,s,c,n.header.isPositionedAtTop(),e,o),p=g.y,h=g.bottom;return Me(d,p,m,h-p)}function c_(t){return"node"===t}function s_(t,r,n,i,e){var u=u_(t),o=i.lastElement().exists(function(t){return Lt(n,t)}),a=n,c=t.selection.getRng(),s=Qt(At.fromDom(c.startContainer),c.startOffset);return c.startContainer===c.endContainer&&c.startOffset===c.endOffset-1&&Lt(s.element,a)?o?Vm:cp:o?function(n,t){var e=hn(n,"position");dn(n,"position",t);var o=i_(u,Ae(r))&&!i.isReposition()?Hm:Vm;return e.each(function(t){return dn(n,"position",t)}),o}(r,i.getMode()):("fixed"===i.getMode()?e.y+Rn().top:e.y)+(wn(r)+12)<=u.y?cp:sp}function l_(n,t){var e=A(F(t,function(t){return t.predicate(n.dom)}),function(t){return"contexttoolbar"===t.type});return{contextToolbars:e.pass,contextForms:e.fail}}function f_(e,t){function o(t){return Lt(t,r)}var n,r=At.fromDom(t.getBody()),i=At.fromDom(t.selection.getNode());return o(n=i)||Wt(r,n)?function(t,n,e){var o=l_(t,n);if(0<o.contextForms.length)return vt.some({elem:t,toolbars:[o.contextForms[0]]});var r=l_(t,e);if(0<r.contextForms.length)return vt.some({elem:t,toolbars:[r.contextForms[0]]});if(0<o.contextToolbars.length||0<r.contextToolbars.length){var i=function(t){if(t.length<=1)return t;function n(n){return d(t,function(t){return t.position===n})}function e(n){return F(t,function(t){return t.position===n})}var o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=M(e("selection"),function(t){return lt(lt({},t),{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return vt.some({elem:t,toolbars:i})}return vt.none()}(i,e.inNodeScope,e.inEditorScope).orThunk(function(){return a=e,(t=o)(n=i)?vt.none():dr(n,function(t){if(Xn(t)){var n=l_(t,a.inNodeScope),e=n.contextToolbars,o=n.contextForms,r=0<o.length?o:(u=e).length<=1?u:i("selection").orThunk(function(){return i("node")}).orThunk(function(){return i("line")}).map(function(t){return t.position}).fold(function(){return[]},function(n){return F(u,function(t){return t.position===n})});return 0<r.length?vt.some({elem:t,toolbars:r}):vt.none()}function i(n){return V(u,function(t){return t.position===n})}var u;return vt.none()},t);var t,n,a}):vt.none()}function d_(a,c){var s={},l=[],f=[],d={},m={},t=Ct(a);return St(t,function(t){var n,e,o,r,i,u=a[t];"contextform"===u.type?(o=t,i=co(ao("ContextForm",qp,r=u)),(s[o]=i).launch.map(function(t){d["form:"+o]=lt(lt({},r.launch),{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){c(i)}})}),("editor"===i.scope?f:l).push(i),m[o]=i):"contexttoolbar"===u.type&&(n=t,ao("ContextToolbar",Kp,e=u).each(function(t){("editor"===e.scope?f:l).push(t),m[n]=t}))}),{forms:s,inNodeScope:l,inEditorScope:f,lookupTable:m,formNavigators:d}}function m_(d,t,m,u){function a(){var t=y.get().getOr("node"),n=c_(t)?1:0;return a_(d,p,t,n)}function c(){return!(d.removed||h()&&g.isContextMenuOpen())}function s(){if(c()){var t=a(),n=mt(y.get(),"node")?(e=d,v.get().filter(ve).map(Nn).getOrThunk(function(){return u_(e)})):u_(d);return t.height<=0||!i_(n,t)}return 1;var e}function n(){v.clear(),b.clear(),y.clear(),up.hide(x)}function e(){var t;up.isOpen(x)&&(bn(t=x.element,"display"),s()?dn(t,"display","none"):(b.set(0),up.reposition(x)))}function l(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:nc([Fg.config({mode:"acyclic"}),mm("pop-dialog-wrap-events",[ou(function(t){d.shortcuts.add("ctrl+F9","focus statusbar",function(){return Fg.focusIn(t)})}),ru(function(t){d.shortcuts.remove("ctrl+F9")})])])}}function f(t,n){var e,o,r,i,c,s,u,a="node"===t?p.anchors.node(n):p.anchors.cursor(),l=(e=d,o=t,r=h(),i={lastElement:v.get,isReposition:function(){return mt(b.get(),0)},getMode:function(){return ff.getMode(m)}},"line"===o?{bubble:Sc(12,0,N_),layouts:{onLtr:function(){return[la]},onRtl:function(){return[fa]}},overrides:L_}:{bubble:Sc(0,12,N_,1/12),layouts:(c=e,s=i,u=o,r?{onLtr:function(t){return[$a,Xa,Ya,qa,Ka,Ja].concat(f(t))},onRtl:function(t){return[$a,Ya,Xa,Ka,qa,Ja].concat(f(t))}}:{onLtr:function(t){return[Ja,$a,qa,Xa,Ka,Ya].concat(f(t))},onRtl:function(t){return[Ja,$a,Ka,Ya,qa,Xa].concat(f(t))}}),overrides:L_});function f(t){return c_(u)?[(a=t,function(t,n,e,o,r){var i=s_(c,o,a,s,r),u=lt(lt({},t),{y:r.y,height:r.height});return lt(lt({},i(u,n,e,o,r)),{alwaysFit:!0})})]:[];var a}return Yo(a,l)}function o(t,n){var e,o,r,i;k.cancel(),c()&&(e=S(t),r=f(o=t[0].position,n),y.set(o),b.set(1),bn(i=x.element,"display"),mt(Et(n,v.get(),Lt),!0)||(qr(i,X_),ff.reset(m,x)),up.showWithinBounds(x,l(e),{anchor:r,transition:{classes:[X_],mode:"placement"}},function(){return vt.some(a())}),n.fold(v.clear,v.set),s()&&dn(i,"display","none"))}var r,i,g=u.backstage,p=g.shared,h=le().deviceType.isTouch,v=gc(),b=gc(),y=gc(),x=Tu((r={sink:m,onEscape:function(){return d.focus(),vt.some(!0)}},i=Po([]),up.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),up.getContent(t).each(function(t){bn(t.element,"visibility")}),qr(t.element,G_),bn(t.element,"width")},inlineBehaviours:nc([mm("context-toolbar-events",[Br(_i(),function(t,n){"width"===n.event.raw.propertyName&&(qr(t.element,G_),bn(t.element,"width"))}),Cr(j_,function(t,n){var e=t.element;bn(e,"width");var o=On(e);up.setContent(t,n.event.contents),Yr(e,G_);var r=On(e);dn(e,"width",o+"px"),up.getContent(t).each(function(t){n.event.focus.bind(function(t){return ka(t),_a(e)}).orThunk(function(){return Fg.focusIn(t),Oa(ge(e))})}),lp.setTimeout(function(){dn(t.element,"width",r+"px")},0)}),Cr(W_,function(n,t){up.getContent(n).each(function(t){i.set(i.get().concat([{bar:t,focus:Oa(ge(n.element))}]))}),br(n,j_,{contents:t.event.forwardContents,focus:vt.none()})}),Cr(U_,function(n,t){q(i.get()).each(function(t){i.set(i.get().slice(0,i.get().length-1)),br(n,j_,{contents:Eu(t.bar),focus:t.focus})})})]),Fg.config({mode:"special",onEscape:function(n){return q(i.get()).fold(function(){return r.onEscape()},function(t){return vr(n,U_),vt.some(!0)})}})]),lazySink:function(){return Ve.value(r.sink)}}))),w=Rt(function(){return d_(t,function(t){var n=S([t]);br(x,W_,{forwardContents:l(n)})})}),S=function(t){var n=d.ui.registry.getAll().buttons,e=w(),o=lt(lt({},n),e.formNavigators),r=iv(d)===bh.scrolling?bh.scrolling:bh.default,i=ft(M(t,function(t){return"contexttoolbar"===t.type?F_(d,{buttons:o,toolbar:t.items,allowToolbarGroups:!1},u,vt.some(["form:"])):(n=p.providers,z_(t,n));var n}));return HC({type:r,uid:Ir("context-toolbar"),initGroups:i,onEscape:vt.none,cyclicKeying:!0,providers:p.providers})},k=vp(function(){d.hasFocus()&&!d.removed&&(Kr(x.element,X_)?k.throttle():f_(w(),d).fold(n,function(t){o(t.toolbars,vt.some(t.elem))}))},17);d.on("init",function(){d.on("remove",n),d.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",e),d.on("click keyup focus SetContent",k.throttle),d.on(H_,n),d.on("contexttoolbar-show",function(n){tt(w().lookupTable,n.toolbarKey).each(function(t){o([t],ot(n.target!==d,n.target)),up.getContent(x).each(Fg.focusIn)})}),d.on("focusout",function(t){lp.setEditorTimeout(d,function(){_a(m.element).isNone()&&_a(x.element).isNone()&&n()},0)}),d.on("SwitchMode",function(){d.mode.isReadOnly()&&n()}),d.on("AfterProgressState",function(t){t.state?n():d.hasFocus()&&k.throttle()}),d.on("NodeChange",function(t){_a(x.element).fold(k.throttle,st)})})}(n1=t1=t1||{})[n1.SemiColon=0]="SemiColon",n1[n1.Space=1]="Space";var g_,p_,h_,v_=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],b_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],y_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},x_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},w_=Object.freeze({__proto__:null,events:function(r,i){function u(e,o){r.updateState.each(function(t){var n=t(e,o);i.set(n)}),r.renderComponents.each(function(t){var n=M(t(o,i.get()),e.getSystem().build);Rs(e,n)})}return eu([Cr(Fi(),function(t,n){var e,o=n;o.universal||(e=r.channel,wt(o.channels,e)&&u(t,o.data))}),ou(function(n,t){r.initialData.each(function(t){u(n,t)})})])}}),S_=Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),k_=xa({fields:[mo("channel"),wo("renderComponents"),wo("updateState"),wo("initialData")],name:"reflecting",active:w_,apis:S_,state:Object.freeze({__proto__:null,init:function(){var t=Po(vt.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(vt.none())}}}})}),C_=rt([mo("toggleClass"),mo("fetch"),Qu("onExecute"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Wc(),Qu("onItemExecute"),wo("lazySink"),mo("dom"),Ju("onOpen"),Zs("splitDropdownBehaviours",[$y,Fg,Hg]),Eo("matchWidth",!1),Eo("useMinWidth",!1),Eo("eventOrder",{}),wo("role")].concat(ux())),O_=rt([Jf({factory:fp,schema:[mo("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:nc([Hg.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(yr)},buttonBehaviours:nc([Lg.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),Jf({factory:fp,schema:[mo("dom")],name:"button",defaults:function(){return{buttonBehaviours:nc([Hg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),Qf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[mo("text")],name:"aria-descriptor"}),$f({schema:[Yu()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Zy()]),__=Cl({name:"SplitDropdown",configFields:C_(),partFields:O_(),factory:function(o,t,n,e){function r(t){cd.getCurrent(t).each(function(t){hd.highlightFirst(t),Fg.focusIn(t)})}function i(t){ex(o,h,t,e,r,Hy.HighlightFirst).get(st)}function u(t){return yr(gl(t,o,"button")),vt.some(!0)}var a,c=lt(lt({},eu([ou(function(e,t){ml(e,o,"aria-descriptor").each(function(t){var n=Ir("aria");on(t.element,"id",n),on(e.element,"aria-describedby",n)})})])),Sm(vt.some(i))),s={repositionMenus:function(t){Lg.isOn(t)&&ix(t)}};return{uid:o.uid,dom:o.dom,components:t,apis:s,eventOrder:lt(lt({},o.eventOrder),((a={})[Ii()]=["disabling","toggling","alloy.base.behaviour"],a)),events:c,behaviours:nl(o.splitDropdownBehaviours,[$y.config({others:{sandbox:function(t){var n=gl(t,o,"arrow");return rx(o,t,{onOpen:function(){Lg.on(n),Lg.on(t)},onClose:function(){Lg.off(n),Lg.off(t)}})}}}),Fg.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),vt.some(!0)}}),Hg.config({}),Lg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),T_=Ir("focus-button"),E_=function(t,n,e){return KO(t,{toolbarButtonBehaviours:[].concat(0<e.length?[mm("toolbarButtonWith",e)]:[]),getApi:GO,onSetup:t.onSetup},n)},D_=function(t,n,e){return Yo(KO(t,{toolbarButtonBehaviours:[Rg.config({}),Lg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[mm("toolbarToggleButtonWith",e)]:[]),getApi:XO,onSetup:t.onSetup},n))},B_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],M_={button:JO(Op,function(t,n){return e=n.backstage.shared.providers,E_(t,e,[]);var e}),togglebutton:JO(_p,function(t,n){return e=n.backstage.shared.providers,D_(t,e,[]);var e}),menubutton:JO(rC,function(t,n){return G0(t,"tox-tbtn",n.backstage,vt.none())}),splitbutton:JO(function(t){return ao("SplitButton",Q1,t)},function(t,n){return o=t,r=n.backstage.shared,s=Ir("channel-update-split-dropdown-display"),l=Po(st),f={getApi:e,onSetup:o.onSetup},__.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:lt({"aria-pressed":!1},YO(o.tooltip,r.providers))},onExecute:function(t){o.onAction(e(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:nc([Yv(r.providers.isDisabled),pv(),mm("split-dropdown-events",[Cr(T_,Hg.focus),vv(f,l),bv(f,l)]),vw.config({})]),eventOrder:((i={})[Gi()]=["alloy.base.behaviour","split-dropdown-events"],i),toggleClass:"tox-tbtn--enabled",lazySink:r.getSink,fetch:(u=e,a=o,c=r.providers,function(n){return jy(function(t){return a.fetch(t)}).map(function(t){return vt.from(Xb(Yo(Ob(Ir("menu-value"),t,function(t){a.onItemAction(u(n),t)},a.columns,a.presets,Sh.CLOSE_ON_EXECUTE,a.select.getOr(T),c),{movement:_b(a.columns,a.presets),menuBehaviours:Kh("auto"!==a.columns?[]:[ou(function(o,t){ah(o,4,Jp(a.presets)).each(function(t){var n=t.numRows,e=t.numColumns;Fg.setGridSize(o,n,e)})})])})))})}),parts:{menu:Zp(0,o.columns,o.presets)},components:[__.parts.button(qO(o.icon,o.text,vt.none(),vt.some(s),vt.some([Lg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),r.providers)),__.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Um("chevron-down",r.providers.icons)},buttonBehaviours:nc([Yv(r.providers.isDisabled),pv(),jm()])}),__.parts["aria-descriptor"]({text:r.providers.translate("To open the popup, press Shift+Enter")})]});function e(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)},setIconFill:function(t,n){Iu(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){on(t,"fill",n)})},setIconStroke:function(t,n){Iu(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){on(t,"stroke",n)})},setActive:function(n){on(e.element,"aria-pressed",n),Iu(e.element,"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Lg.set(t,n)})})},isActive:function(){return Iu(e.element,"span").exists(function(t){return e.getSystem().getByDom(t).exists(Lg.isOn)})}}}var o,r,i,u,a,c,s,l,f}),grouptoolbarbutton:JO(function(t){return ao("GroupToolbarButton",K1,t)},function(t,n,e){var o,r,i,u,a,c,s=e.ui.registry.getAll().buttons,l=((o={})[es]=n.backstage.shared.header.isPositionedAtTop()?Oc.TopToBottom:Oc.BottomToTop,o);if(iv(e)!==bh.floating)throw new Error("Toolbar groups are only supported when using floating toolbar mode");return i=n.backstage,u=function(t){return F_(e,{buttons:s,toolbar:t,allowToolbarGroups:!1},n,vt.none())},a=l,c=i.shared,bO.sketch({lazySink:c.getSink,fetch:function(){return jy(function(t){t(M(u(r.items),RC))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:qO((r=t).icon,r.text,r.tooltip,vt.none(),vt.none(),c.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:a}}}})}),styleSelectButton:function(t,n){return KC(t,e=n.backstage,jO(t,lt({type:"advanced"},e.styleselect)));var e},fontsizeSelectButton:function(t,n){return KC(t,n.backstage,LO(t))},fontSelectButton:function(t,n){return KC(t,n.backstage,NO(t))},formatButton:function(t,n){return KC(t,n.backstage,UO(t))},alignMenuButton:function(t,n){return KC(t,n.backstage,HO(t))}},A_={styleselect:M_.styleSelectButton,fontsizeselect:M_.fontsizeSelectButton,fontselect:M_.fontSelectButton,formatselect:M_.formatButton,align:M_.alignMenuButton},F_=function(o,c,s,l){var e,t,n,r,i=(n=c.toolbar,r=c.buttons,!1===n?[]:void 0===n||!0===n?(e=r,t=M(B_,function(t){var n=F(t.items,function(t){return Tt(e,t)||Tt(A_,t)});return{name:t.name,items:n}}),F(t,function(t){return 0<t.items.length})):y(n)?M(n.split("|"),function(t){return{items:t.trim().split(" ")}}):f(n,function(t){return Tt(t,"name")&&Tt(t,"items")})?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[]));return F(M(i,function(t){var n=z(t.items,function(t){return 0===t.trim().length?[]:(r=o,n=c.buttons,i=t,u=c.allowToolbarGroups,a=s,e=l,tt(n,i.toLowerCase()).orThunk(function(){return e.bind(function(t){return K(t,function(t){return tt(n,t+i.toLowerCase())})})}).fold(function(){return tt(A_,i.toLowerCase()).map(function(t){return t(r,a)}).orThunk(function(){return vt.none()})},function(t){return"grouptoolbarbutton"!==t.type||u?(e=a,o=r,tt(M_,(n=t).type).fold(function(){return console.error("skipping button defined by",n),vt.none()},function(t){return vt.some(t(n,e,o))})):(console.warn("Ignoring the '"+i+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),vt.none());var n,e,o}).toArray());var r,n,i,u,a,e});return{title:vt.from(o.translate(t.name)),items:n}}),function(t){return 0<t.items.length})},I_=le(),R_=I_.os.isiOS()&&I_.os.version.major<=12,V_=Object.freeze({__proto__:null,render:function(e,n,t,o,r){var i=Po(0),u=n.outerContainer;RO(e);var a=At.fromDom(r.targetNode),c=tn(ge(a)),s=n.mothership;pf(a,s,Bn),Ns(c,n.uiMothership),e.on("PostRender",function(){$O(e,n,t,o),i.set(e.getWin().innerWidth),FO.setMenubar(u,NC(e,t)),FO.setSidebar(u,t.sidebar),function(e,t){function n(){var t=c.get();t.left===u.innerWidth&&t.top===u.innerHeight||(c.set(ke(u.innerWidth,u.innerHeight)),Wv(e))}function o(){var t=e.getDoc().documentElement,n=s.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(s.set(ke(t.offsetWidth,t.offsetHeight)),Wv(e))}function r(t){return e.fire("ScrollContent",t)}var i=e.dom,u=e.getWin(),a=e.getDoc().documentElement,c=Po(ke(u.innerWidth,u.innerHeight)),s=Po(ke(a.offsetWidth,a.offsetHeight));i.bind(u,"resize",n),i.bind(u,"scroll",r);var l=hc(At.fromDom(e.getBody()),"load",o),f=t.uiMothership.element;e.on("hide",function(){dn(f,"display","none")}),e.on("show",function(){bn(f,"display")}),e.on("NodeChange",o),e.on("remove",function(){l.unbind(),i.unbind(u,"resize",n),i.unbind(u,"scroll",r),u=null})}(e,n)});var l,f,d,m,g=FO.getSocket(u).getOrDie("Could not find expected socket element");R_&&(mn(g.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),f=function(){e.fire("ScrollContent")},d=null,m=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];b(d)&&(d=setTimeout(function(){d=null,f.apply(null,t)},20))},l=pc(g.element,"scroll",m),e.on("remove",l.unbind)),gv(e,n),e.addCommand("ToggleSidebar",function(t,n){FO.toggleSidebar(u,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return FO.whichSidebar(u)});var p=iv(e);p!==bh.sliding&&p!==bh.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){var t=e.getWin().innerWidth;t!==i.get()&&(FO.refreshToolbar(n.outerContainer),i.set(t))});var h={enable:function(){mv(n,!1)},disable:function(){mv(n,!0)},isDisabled:function(){return gd.isDisabled(u)}};return{iframeContainer:g.element.dom,editorContainer:u.element.dom,api:h}}}),P_=Object.freeze({__proto__:null,render:function(n,e,o,r,t){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Po(null),s=At.fromDom(t.targetNode),l=e_(n,s,e,r,c),f=n.getParam("toolbar_persist",!1,"boolean");function d(){var t;c.get()?l.show():(c.set(FO.getHeader(a).getOrDie()),Ns(t=lv(n),i),Ns(t,u),$O(n,e,o,r),FO.setMenubar(a,NC(n,o)),l.show(),function(c,s,l,t){function n(t){var n=o_(s,l.isPositionedAtTop()),e=n.pos,o=n.bounds,r=f.get(),i=r.pos,u=r.bounds,a=o.height!==u.height||o.width!==u.width;f.set({pos:e,bounds:o}),a&&Wv(c,t),l.isVisible()&&(i!==e?l.update(!0):a&&(l.updateMode(),l.repositionPopups()))}var f=Po(o_(s,l.isPositionedAtTop()));t||(c.on("activate",l.show),c.on("deactivate",l.hide)),c.on("SkinLoaded ResizeWindow",function(){return l.update(!0)}),c.on("NodeChange keydown",function(t){lp.requestAnimationFrame(function(){return n(t)})}),c.on("ScrollWindow",function(){return l.updateMode()});var e=mc();e.set(hc(At.fromDom(c.getBody()),"load",n)),c.on("remove",function(){e.clear()})}(n,s,l,f),n.nodeChanged())}VO(n),n.on("show",d),n.on("hide",l.hide),f||(n.on("focus",d),n.on("blur",l.hide)),n.on("init",function(){(n.hasFocus()||f)&&d()}),gv(n,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){mv(e,!1)},disable:function(){mv(e,!0)},isDisabled:function(){return gd.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),H_="contexttoolbar-hide",z_=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=zm(Dy.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:nc([Fg.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return yr(t),!0})},onLeft:function(t,n){return n.cut(),vt.none()},onRight:function(t,n){return n.cut(),vt.none()}})])})),c=(e=a,o=t.commands,r=n,i=M(o,function(t){return zm(("contextformtogglebutton"===t.type?function(t,n,e){var o=n.original;o.primary;var r=B(o,["primary"]),i=co(_p(lt(lt({},r),{type:"togglebutton",onAction:st})));return D_(i,e.backstage.shared.providers,[r_(t,n)])}:function(t,n,e){var o=n.original;o.primary;var r=B(o,["primary"]),i=co(Op(lt(lt({},r),{type:"button",onAction:st})));return E_(i,e.backstage.shared.providers,[r_(t,n)])})(e,t,{backstage:{shared:{providers:r}}}))}),{asSpecs:function(){return M(i,function(t){return t.asSpec()})},findPrimary:function(e){return K(o,function(t,n){return t.primary?vt.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(O(gd.isDisabled)):vt.none()})}});return[{title:vt.none(),items:[a.asSpec()]},{title:vt.none(),items:c.asSpecs()}]},N_={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},L_={maxHeightFunction:Vc(),maxWidthFunction:pO()},W_=Ir("forward-slide"),U_=Ir("backward-slide"),j_=Ir("change-slide-event"),G_="tox-pop--resizing",X_="tox-pop--transition",Y_={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},q_=(h_=["Infinity",(g_="[0-9]+")+"\\."+K_(g_)+K_(p_="[eE][+-]?[0-9]+"),"\\."+g_+K_(p_),g_+K_(p_)].join("|"),new RegExp("^([+-]?(?:"+h_+"))(.*)$"));function K_(t){return"(?:"+t+")?"}function J_(u,a){function n(){var t=a.getOptions(u),r=a.getCurrent(u).map(a.hash),i=gc();return M(t,function(o){return{type:"togglemenuitem",text:a.display(o),onSetup:function(n){function t(t){t&&(i.on(function(t){return t.setActive(!1)}),i.set(n)),n.setActive(t)}t(mt(r,a.hash(o)));var e=a.watcher(u,o,t);return function(){i.clear(),e()}},onAction:function(){return a.setCurrent(u,o)}}})}u.ui.registry.addMenuButton(a.name,{tooltip:a.text,icon:a.icon,fetch:function(t){return t(n())},onSetup:a.onToolbarSetup}),u.ui.registry.addNestedMenuItem(a.name,{type:"nestedmenuitem",text:a.text,getSubmenuItems:n,onSetup:a.onMenuSetup})}function $_(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}}function Q_(t){var n,e;!function(e){fS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:jC(e,t.name),onAction:$_(e,t.name)})});for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:jC(e,n),onAction:$_(e,n)})}}(t),n=t,fS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(n,t.action)})}),e=t,fS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(e,t.action),onSetup:jC(e,t.name)})})}function Z_(n,e){return GC(n,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(t){t.setDisabled(n.mode.isReadOnly()||!n.undoManager[e]())})}function tT(t){var n;t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:YC(t,"mceToggleVisualAid")}),t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:GC(n=t,"VisualAid",function(t){t.setActive(n.hasVisual)}),onAction:YC(t,"mceToggleVisualAid")})}function nT(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=t;St([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){T.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(T,t.cmd),onSetup:jC(T,t.name)})}),T.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:YC(T,"JustifyNone")}),Q_(O=t),_=O,fS.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){_.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:YC(_,t.action)})}),_.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:$_(_,"code")}),C=qC(0,d=l=n,HO(f=s=t)),f.ui.registry.addNestedMenuItem("align",{text:d.shared.providers.translate("Align"),getSubmenuItems:function(){return C.items.validateItems(C.getStyleItems())}}),p=qC(0,g=l,NO(m=s)),m.ui.registry.addNestedMenuItem("fontformats",{text:g.shared.providers.translate("Fonts"),getSubmenuItems:function(){return p.items.validateItems(p.getStyleItems())}}),h=s,b=lt({type:"advanced"},(v=l).styleselect),y=qC(0,v,jO(h,b)),h.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return y.items.validateItems(y.getStyleItems())}}),w=qC(0,l,UO(x=s)),x.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}}),k=qC(0,l,LO(S=s)),S.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return k.items.validateItems(k.getStyleItems())}}),(a=u=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:Z_(a,"hasUndo"),onAction:YC(a,"undo")}),a.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:Z_(a,"hasRedo"),onAction:YC(a,"redo")}),(c=u).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:Z_(c,"hasUndo"),onAction:YC(c,"undo")}),c.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:Z_(c,"hasRedo"),onAction:YC(c,"redo")}),function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,n){var e,o=t,r=n;(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e=t;(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})});var n=Po(Fb),e=Po(Fb);kb(t,"forecolor","forecolor","Text color",n),kb(t,"backcolor","hilitecolor","Background color",e),Cb(t,"forecolor","forecolor","Text color"),Cb(t,"backcolor","hilitecolor","Background color")}(t),tT(t),(r=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:GC(i=r,"NodeChange",function(t){t.setDisabled(!i.queryCommandState("outdent"))}),onAction:YC(r,"outdent")}),r.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:YC(r,"indent")}),J_(e=t,NT),o=e,vt.from(o.getParam("content_langs",void 0,"array")).map(function(t){return{name:"language",text:"Language",icon:"language",getOptions:rt(t),hash:function(t){return E(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,n,e){return t.formatter.formatChanged("lang",e,!1,{value:n.code,customValue:n.customCode}).unbind},getCurrent:function(t){return mr(At.fromDom(t.selection.getNode()),function(t){return vt.some(t).filter(Xn).bind(function(n){return an(n,"lang").map(function(t){return{code:t,customCode:an(n,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,n){return t.execCommand("Lang",!1,n)},onToolbarSetup:function(t){var n=mc();return t.setActive(o.formatter.match("lang",{},void 0,!0)),n.set(o.formatter.formatChanged("lang",t.setActive,!0)),n.clear}}}).each(function(t){return J_(e,t)})}function eT(t,n){return{type:"makeshift",x:t,y:n}}function oT(t){return"longpress"===t.type||0===t.type.indexOf("touch")}function rT(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(oT(t)){var n=t.touches[0];return eT(n.pageX,n.pageY)}return eT(t.pageX,t.pageY)}(n):(e=t.getContentAreaContainer(),o=function(t){if(oT(t)){var n=t.touches[0];return eT(n.clientX,n.clientY)}return eT(t.clientX,t.clientY)}(n),r=ev.DOM.getPos(e),i=r.x,u=r.y,eT(o.x+i,o.y+u)):LT(t);var e,o,r,i,u}function iT(t,n,e){switch(e){case"node":return{type:"node",node:vt.some(At.fromDom((o=t).selection.getNode())),root:At.fromDom(o.getBody())};case"point":return rT(t,n);case"selection":return LT(t)}var o}function uT(f,d,m,g,p,h){function t(){var n,e,t,o,r,i,u,a,c,s,l=m();t=l,o=g,r=p,u=!(y||v||b&&x),c=iT(n=f,e=d,a=i=h),s=lt({bubble:Sc(0,"point"===a?12:0,UT),layouts:WT,overrides:{maxWidthFunction:pO(),maxHeightFunction:Vc()}},c),U0(t,Sh.CLOSE_ON_EXECUTE,o,!0).map(function(t){e.preventDefault(),up.showMenuWithinBounds(r,{anchor:s},{menu:{markers:Qp("normal"),highlightImmediately:u},data:t,type:"horizontal"},function(){return vt.some(a_(n,o.shared,"node"===i?"node":"selection"))}),n.fire(H_)})}var n,e=le(),v=e.os.isiOS(),b=e.os.isOSX(),y=e.os.isAndroid(),x=e.deviceType.isTouch();(b||v)&&"node"!==h?(n=function(){(function(t){function n(){lp.setEditorTimeout(t,function(){t.selection.setRng(e)},10),i()}var e=t.selection.getRng();function o(t){t.preventDefault(),t.stopImmediatePropagation()}function r(){return i()}t.once("touchend",n),t.on("mousedown",o,!0),t.once("longpresscancel",r);var i=function(){t.off("touchend",n),t.off("longpresscancel",r),t.off("mousedown",o)}})(f),t()},function(t,n){var e=t.selection;if(!(e.isCollapsed()||n.touches.length<1)){var o=n.touches[0],r=e.getRng();return xs(t.getWin(),ms.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}}(f,d)?n():(f.once("selectionchange",n),f.once("touchend",function(){return f.off("selectionchange",n)}))):t()}function aT(t){return"string"==typeof t?t.split(/[ ,]/):t}function cT(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")}function sT(t){return y(t)?"|"===t:"separator"===t.type}function lT(t,n){if(0===n.length)return t;var e=q(t).filter(function(t){return!sT(t)}).fold(function(){return[]},function(t){return[jT]});return t.concat(e).concat(n).concat([jT])}function fT(t,n){return"longpress"!==n.type&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)}function dT(t,n){return fT(t,n)?t.selection.getStart(!0):n.target}function mT(s,t,n){function e(t){return up.hide(i)}function o(c){var t;cT(s)&&c.preventDefault(),c.ctrlKey&&!cT(s)||!1===s.getParam("contextmenu")||(t=function(t,n){var e=t.getParam("contextmenu_avoid_overlap","","string"),o=fT(t,n)?"selection":"point";if(at(e)){var r=dT(t,n);return Yb(At.fromDom(r),e)?"node":o}return o}(s,c),(r()?uT:function(t,n,e,o,r,i){var u=e(),a=iT(t,n,i);U0(u,Sh.CLOSE_ON_EXECUTE,o,!1).map(function(t){n.preventDefault(),up.showMenuAt(r,{anchor:a},{menu:{markers:Qp("normal")},data:t})})})(s,c,function(){var t,n,e,o=dT(s,c),r=s.ui.registry.getAll(),i=(e=(n=s).ui.registry.getAll().contextMenus,vt.from(n.getParam("contextmenu")).map(aT).getOrThunk(function(){return F(aT("link linkchecker image imagetools table spellchecker configurepermanentpen"),function(t){return Tt(e,t)})})),u=r.contextMenus,a=o;return 0<(t=R(i,function(o,t){return tt(u,t.toLowerCase()).map(function(t){var n=t.update(a);if(y(n))return lT(o,n.split(" "));if(0<n.length){var e=M(n,GT);return lT(o,e)}return o}).getOrThunk(function(){return o.concat([t])})},[])).length&&sT(t[t.length-1])&&t.pop(),t},n,i,t))}var r=le().deviceType.isTouch,i=Tu(up.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return s.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:nc([mm("dismissContextMenu",[Cr(Yi(),function(t,n){bf.close(t),s.focus()})])])}));s.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");s.on(t,e),s.on("longpress contextmenu",o)})}function gT(n){return function(t){return t.translate(-n.left,-n.top)}}function pT(n){return function(t){return t.translate(n.left,n.top)}}function hT(e){return function(t,n){return R(e,function(t,n){return n(t)},ke(t,n))}}function vT(t,n,e){return t.fold(hT([pT(e),gT(n)]),hT([gT(n)]),hT([]))}function bT(t,n,e){return t.fold(hT([pT(e)]),hT([]),hT([pT(n)]))}function yT(t,n,e){return t.fold(hT([]),hT([gT(e)]),hT([pT(n),gT(e)]))}function xT(t,n,e){var o=t.fold(function(t,n){return{position:vt.some("absolute"),left:vt.some(t+"px"),top:vt.some(n+"px")}},function(t,n){return{position:vt.some("absolute"),left:vt.some(t-e.left+"px"),top:vt.some(n-e.top+"px")}},function(t,n){return{position:vt.some("fixed"),left:vt.some(t+"px"),top:vt.some(n+"px")}});return lt({right:vt.none(),bottom:vt.none()},o)}function wT(t,i,u,a){function n(o,r){return function(t,n){var e=o(i,u,a);return r(t.getOr(e.left),n.getOr(e.top))}}return t.fold(n(yT,YT),n(bT,qT),n(vT,KT))}function ST(t,n){var e=un(t,n);return E(e)?NaN:parseInt(e,10)}function kT(t,n,e,o,r,i){var u,a,c,s,l,f,d=(u=e,a=o,l=ST(s=t.element,(c=n).leftAttr),f=ST(s,c.topAttr),(isNaN(l)||isNaN(f)?vt.none():vt.some(ke(l,f))).fold(function(){return u},function(t){return KT(t.left+a.left,t.top+a.top)})),m=(n.mustSnap?JT:$T)(t,n,d,r,i),g=vT(d,r,i),p=n,h=g,v=t.element;return on(v,p.leftAttr,h.left+"px"),on(v,p.topAttr,h.top+"px"),m.fold(function(){return{coord:KT(g.left,g.top),extra:vt.none()}},function(t){return{coord:t.output,extra:t.extra}})}function CT(t,c,s,l){return K(t,function(t){var n,e,o=t.sensor,r=t.range.left,i=t.range.top,u=bT(c,n=s,e=l),a=bT(o,n,e);return Math.abs(u.left-a.left)<=r&&Math.abs(u.top-a.top)<=i?vt.some({output:wT(t.output,c,s,l),extra:t.extra}):vt.none()})}function OT(t,n){var e;t.getSystem().addToGui(n),Yt((e=n).element).filter(Xn).each(function(n){hn(n,"z-index").each(function(t){on(n,ZT,t)}),dn(n,"z-index",pn(e.element,"z-index"))})}function _T(t){Yt(t.element).filter(Xn).each(function(n){an(n,ZT).fold(function(){return bn(n,"z-index")},function(t){return dn(n,"z-index",t)}),sn(n,ZT)}),t.getSystem().removeFromGui(t)}function TT(t,n,e){return t.getSystem().build(ly.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))}function ET(t,n){return{bounds:t.getBounds(),height:Sn(n.element),width:_n(n.element)}}function DT(B,M,t,n,e){var o=t.update(n,e),A=t.getStartData().getOrThunk(function(){return ET(M,B)});o.each(function(t){var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_=B,T=A,E=t,D=(n=M).getTarget(_.element);n.repositionTarget&&(e=Rn(Ut(_.element)),o=Wk(D),S=hn(w=D,"left"),k=hn(w,"top"),C=hn(w,"position"),O=function(t,n,e){return("fixed"===e?KT:YT)(parseInt(t,10),parseInt(n,10))},r=(S.isSome()&&k.isSome()&&C.isSome()?vt.some(O(S.getOrDie(),k.getOrDie(),C.getOrDie())):vt.none()).getOrThunk(function(){var t=Cn(w);return qT(t.left,t.top)}),i=_,u=n.snaps,a=r,c=e,s=o,l=E,f=T,m=u.fold(function(){var e,o,t=vT((e=l.left,o=l.top,a.fold(function(t,n){return YT(t+e,n+o)},function(t,n){return qT(t+e,n+o)},function(t,n){return KT(t+e,n+o)})),c,s);return KT(t.left,t.top)},function(n){var t=kT(i,n,a,l,c,s);return t.extra.each(function(t){n.onSensor(i,t)}),t.coord}),g=c,p=s,h=(d=f).bounds,v=bT(m,g,p),b=ja(v.left,h.x,h.x+h.width-d.width),y=ja(v.top,h.y,h.y+h.height-d.height),x=qT(b,y),gn(D,xT(m.fold(function(){var t=yT(x,g,p);return YT(t.left,t.top)},rt(x),function(){var t=vT(x,g,p);return KT(t.left,t.top)}),0,o))),n.onDrag(_,D,E)})}function BT(o,t,n,e){t.each(_T),n.snaps.each(function(t){var n,e;n=t,sn(e=o.element,n.leftAttr),sn(e,n.topAttr)});var r=n.getTarget(o.element);e.reset(),n.onDrop(o,r)}function MT(t){return function(n,e){function o(t){e.setStartData(ET(n,t))}return eu(H([Cr(Ui(),function(t){e.getStartData().each(function(){return o(t)})})],t(n,e,o),!0))}}function AT(a,c,s){return[Cr(mi(),function(n,t){var e,o,r,i,u;0===t.event.raw.button&&(t.stop(),r={drop:e=function(){return BT(n,vt.some(i),a,c)},delayDrop:(o=qb(e,200)).schedule,forceDrop:e,move:function(t){o.cancel(),DT(n,a,c,eE,t)}},i=TT(n,a.blockerClass,(u=r,eu([Cr(mi(),u.forceDrop),Cr(hi(),u.drop),Cr(gi(),function(t,n){u.move(n.event)}),Cr(pi(),u.delayDrop)]))),s(n),OT(n,i))})]}function FT(a,c,s){function l(t){BT(t,f.get(),a,c),f.clear()}var f=gc();return[Cr(si(),function(n,t){function e(){return l(n)}t.stop();var o,r,i,u=TT(n,a.blockerClass,(r=o=e,i=function(t){DT(n,a,c,rE,t)},eu([Cr(si(),r),Cr(fi(),o),Cr(di(),o),Cr(li(),function(t,n){i(n.event)})])));f.set(u),s(n),OT(n,u)}),Cr(li(),function(t,n){n.stop(),DT(t,a,c,rE,n.event)}),Cr(fi(),function(t,n){n.stop(),l(t)}),Cr(di(),l)]}function IT(t,r,i,u,n,e){return t.fold(function(){return aE.snap({sensor:qT(i-20,u-20),range:ke(n,e),output:qT(vt.some(i),vt.some(u)),extra:{td:r}})},function(t){var n=i-20,e=u-20,o=t.element.dom.getBoundingClientRect();return aE.snap({sensor:qT(n,e),range:ke(40,40),output:qT(vt.some(i-o.width/2),vt.some(u-o.height/2)),extra:{td:r}})})}function RT(t,i,u){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){var e=n.td,o=i.get(),r=e;o.exists(function(t){return Lt(t,r)})||(i.set(e),u(e))},mustSnap:!0}}function VT(t){return zm(fp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:nc([aE.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),vw.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))}function PT(a,e){function n(t){var n=Nn(t);return IT(g.getOpt(e),t,n.x,n.y,n.width,n.height)}function o(t){var n=Nn(t);return IT(p.getOpt(e),t,n.right,n.bottom,n.width,n.height)}function r(t,i,n,u){var e=n(i);aE.snapTo(t,e),function(t){var n=i.dom.getBoundingClientRect();bn(t.element,"display");var e=Xt(At.fromDom(a.getBody())).dom.innerHeight,o=n[u]<0,r=n[u]>e;(o||r)&&dn(t.element,"display","none")}(t)}function i(t){return r(h,t,n,"top")}function u(t){return r(v,t,o,"bottom")}var c=Po([]),s=Po([]),t=Po(!1),l=gc(),f=gc(),d=RT(function(){return M(c.get(),n)},l,function(n){f.get().each(function(t){a.fire("TableSelectorChange",{start:n,finish:t})})}),m=RT(function(){return M(s.get(),o)},f,function(n){l.get().each(function(t){a.fire("TableSelectorChange",{start:t,finish:n})})}),g=VT(d),p=VT(m),h=Tu(g.asSpec()),v=Tu(p.asSpec());le().deviceType.isTouch()&&(a.on("TableSelectionChange",function(n){t.get()||(Vs(e,h),Vs(e,v),t.set(!0)),l.set(n.start),f.set(n.finish),n.otherCells.each(function(t){c.set(t.upOrLeftCells),s.set(t.downOrRightCells),i(n.start),u(n.finish)})}),a.on("ResizeEditor ResizeWindow ScrollContent",function(){l.get().each(i),f.get().each(u)}),a.on("TableSelectionClear",function(){t.get()&&(Hs(h),Hs(v),t.set(!1)),l.clear(),f.clear()}))}var HT,zT,NT={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return r=["fixed","relative","empty"],vt.from(q_.exec(t)).bind(function(t){var n=Number(t[1]),e=t[2],o=e;return d(r,function(t){return d(Y_[t],function(t){return o===t})})?vt.some({value:n,unit:e}):vt.none()}).map(function(t){return t.value+t.unit}).getOr(t);var r},display:h,watcher:function(t,n,e){return t.formatter.formatChanged("lineheight",e,!1,{value:n}).unbind},getCurrent:function(t){return vt.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,n){return t.execCommand("LineHeight",!1,n)}},LT=function(t){return{type:"selection",root:At.fromDom(t.selection.getNode())}},WT={onLtr:function(){return[$a,Xa,Ya,qa,Ka,Ja,cp,sp,Am,Bm,Mm,Dm]},onRtl:function(){return[$a,Ya,Xa,Ka,qa,Ja,cp,sp,Mm,Dm,Am,Bm]}},UT={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},jT={type:"separator"},GT=function(n){function t(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}}var e;if(y(n))return n;switch(n.type){case"separator":return jT;case"submenu":return lt(lt({type:"nestedmenuitem"},t(n)),{getSubmenuItems:function(){var t=n.getSubmenuItems();return y(t)?t:M(t,GT)}});default:return lt(lt({type:"menuitem"},t(n)),{onAction:(e=n.onAction,function(){return e()})})}},XT=Ho([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),YT=XT.offset,qT=XT.absolute,KT=XT.fixed,JT=function(t,n,l,f,d){var e=n.getSnapPoints(t);return CT(e,l,f,d).orThunk(function(){return R(e,function(n,e){var t,o,r,i,u,a,c,s=(t=e.sensor,e.range.left,e.range.top,i=bT(l,o=f,r=d),u=bT(t,o,r),a=Math.abs(i.left-u.left),c=Math.abs(i.top-u.top),ke(a,c));return n.deltas.fold(function(){return{deltas:vt.some(s),snap:vt.some(e)}},function(t){return(s.left+s.top)/2<=(t.left+t.top)/2?{deltas:vt.some(s),snap:vt.some(e)}:n})},{deltas:vt.none(),snap:vt.none()}).snap.map(function(t){return{output:wT(t.output,l,f,d),extra:t.extra}})})},$T=function(t,n,e,o,r){return CT(n.getSnapPoints(t),e,o,r)},QT=Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r,i,u,a=n.getTarget(t.element);n.repositionTarget&&(r=Rn(Ut(t.element)),i=Wk(a),gn(a,xT({coord:wT((u=o).output,u.output,r,i),extra:u.extra}.coord,0,i)))}}),ZT="data-initial-z-index",tE=To("snaps",[mo("getSnapPoints"),Ju("onSensor"),mo("leftAttr"),mo("topAttr"),Eo("lazyViewport",Fe),Eo("mustSnap",!1)]),nE=[Eo("useFixed",T),mo("blockerClass"),Eo("getTarget",h),Eo("onDrag",st),Eo("repositionTarget",!0),Eo("onDrop",st),Io("getBounds",Fe),tE],eE=Object.freeze({__proto__:null,getData:function(t){return vt.from(ke(t.x,t.y))},getDelta:function(t,n){return ke(n.left-t.left,n.top-t.top)}}),oE=H(H([],nE,!0),[ta("dragger",{handlers:MT(AT)})],!1),rE=Object.freeze({__proto__:null,getData:function(t){var n,e=t.raw.touches;return 1===e.length?(n=e[0],vt.some(ke(n.clientX,n.clientY))):vt.none()},getDelta:function(t,n){return ke(n.left-t.left,n.top-t.top)}}),iE=H(H([],nE,!0),[ta("dragger",{handlers:MT(FT)})],!1),uE=H(H([],nE,!0),[ta("dragger",{handlers:MT(function(t,n,e){return H(H([],AT(t,n,e),!0),FT(t,n,e),!0)})})],!1),aE=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:oE,touch:iE,mouseOrTouch:uE}),name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:vt.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var i=vt.none(),n=vt.none(),t=rt({});return wu({readState:t,reset:function(){i=vt.none(),n=vt.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=vt.some(e),o;var n,e,o})},getStartData:function(){return n},setStartData:function(t){n=vt.some(t)}})}}),apis:QT});function cE(t,n,e){var o,r,i,u,a,c,s=At.fromDom(t.getContainer());J((o=t,r=n,i=e,u=wn(s),a=On(s),(c={}).height=t_(u+r.top,dh(o),gh(o)),i===HT.Both&&(c.width=t_(a+r.left,fh(o),mh(o))),c),function(t,n){return dn(s,n,ZO(t)),0}),t.fire("ResizeEditor")}function sE(t,n,e,o){return cE(t,ke(20*e,20*o),n),vt.some(!0)}function lE(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(v=[],t.getParam("elementpath",!0,"boolean")&&v.push((g=t,h=n,(p={}).delimiter||(p.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:nc([Fg.config({mode:"flow",selector:"div[role=button]"}),gd.config({disabled:h.isDisabled}),pv(),py.config({}),Rg.config({}),mm("elementPathEvents",[ou(function(r,t){g.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Fg.focusIn(r)}),g.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return 1;if("bookmark"===t.getAttribute("data-mce-type"))return 1}}(o)){var r=g.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length?Rg.set(r,(n=M(e||[],function(n,t){return fp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){g.focus(),g.selection.select(n.element),g.nodeChanged()},buttonBehaviours:nc([$v(h.isDisabled),pv()])})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+p.delimiter+" "}},R(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]]))):Rg.set(r,[])})})])]),components:[]})),t.hasPlugin("wordcount")&&v.push((f=t,d=n,fp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:nc([$v(d.isDisabled),pv(),py.config({}),Rg.config({}),Df.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),mm("wordcount-events",[uu(function(t){var n=Df.getValue(t),e="words"===n.mode?"characters":"words";Df.setValue(t,{mode:e,count:n.count}),b(t,n.count,e)}),ou(function(e){f.on("wordCountUpdate",function(t){var n=Df.getValue(e).mode;Df.setValue(e,{mode:n,count:t.wordCount}),b(e,t.wordCount,n)})})])]),eventOrder:((m={})[Ii()]=["disabling","alloy.base.behaviour","wordcount-events"],m)}))),t.getParam("branding",!0,"boolean")&&v.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(l=dp.translate(["Powered by {0}","Tiny"]))+'">'+l+"</a>"}}),e=0<v.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:v}]:[],i=n,a=!(u=r=t).hasPlugin("autoresize"),o=(s=!1===(c=u.getParam("resize",a))?HT.None:"both"===c?HT.Both:HT.Vertical)===HT.None?vt.none():vt.some(Xm("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:i.translate("Resize")},behaviours:[aE.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){return cE(r,e,s)},blockerClass:"tox-blocker"}),Fg.config({mode:"special",onLeft:function(){return sE(r,s,-1,0)},onRight:function(){return sE(r,s,1,0)},onUp:function(){return sE(r,s,0,-1)},onDown:function(){return sE(r,s,0,1)}}),py.config({}),Hg.config({})]},i.icons)),e.concat(o.toArray()))};function b(t,n,e){return Rg.set(t,[ri(d.translate(["{0} "+e,n[e]]))])}}function fE(d){function m(){return i.bind(FO.getHeader)}function g(){return Ve.value(y)}function p(){return i.bind(function(t){return FO.getThrobber(t)}).getOrDie("Could not find throbber element")}var t,n,e,o,r=d.inline,h=r?P_:V_,v=dv(d)?q1:H1,i=vt.none(),u=le(),a=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],s=av(d),l=lv(d),f=dp.isRtl()?{attributes:{dir:"rtl"}}:{},b={attributes:((t={})[es]=s?Oc.BottomToTop:Oc.TopToBottom,t)},y=Tu((n=Lt(be(),l)&&"grid"===pn(l,"display"),e={dom:lt({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(a).concat(c)},f),behaviours:nc([ff.config({useFixed:function(){return v.isDocked(m)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:eu([Cr(ji(),function(){dn(J.element,"width",document.body.clientWidth+"px")})])},Yo(e,n?o:{}))),x=zm({dom:{tag:"div",classes:["tox-anchorbar"]}}),w=Nk(y,d,function(){return i.bind(function(t){return x.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),S=FO.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:w,onEscape:function(){d.focus()}}),k=iv(d),C=FO.parts.toolbar(lt({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g,providers:w.shared.providers,onEscape:function(){d.focus()},type:k,lazyToolbar:function(){return i.bind(function(t){return FO.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return m().getOrDie("Could not find header element")}},b)),O=FO.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:w.shared.providers,onEscape:function(){d.focus()},type:k}),_=FO.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),T=FO.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),E=FO.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:w}),D=d.getParam("statusbar",!0,"boolean")&&!r?vt.some(lE(d,w.shared.providers)):vt.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[_,T]},M=rv(d),A=hh(d),F=ph(d),I=FO.parts.header({dom:lt({tag:"div",classes:["tox-editor-header"]},b),components:ft([F?[S]:[],M?[O]:A?[C]:[],sv(d)?[]:[x.asSpec()]]),sticky:dv(d),editor:d,sharedBackstage:w.shared}),R=ft([s?[]:[I],r?[]:[B],s?[I]:[]]),V=ft([[{dom:{tag:"div",classes:["tox-editor-container"]},components:R}],r?[]:D.toArray(),[E]]),P=fv(d),H=lt(lt({role:"application"},dp.isRtl()?{dir:"rtl"}:{}),P?{"aria-hidden":"true"}:{}),z=Tu(FO.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(s?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(a),styles:lt({visibility:"hidden"},P?{opacity:"0",border:"0"}:{}),attributes:H},components:V,behaviours:nc([pv(),gd.config({disableClass:"tox-tinymce--disabled"}),Fg.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),i=vt.some(z);d.shortcuts.add("alt+F9","focus menubar",function(){FO.focusMenubar(z)}),d.shortcuts.add("alt+F10","focus toolbar",function(){FO.focusToolbar(z)}),d.addCommand("ToggleToolbarDrawer",function(){FO.toggleToolbarDrawer(z)}),d.addQueryStateHandler("ToggleToolbarDrawer",function(){return FO.isToolbarDrawerToggled(z)});var N,L,W,U,j,G,X,Y,q,K=ny(z),J=ny(y);function $(){var t,n,e,o,r,i,u=ZO((o=sh(e=n=d),r=dh(e),i=gh(e),QO(o).map(function(t){return t_(t,r,i)}).getOr(sh(n)))),a=ZO(n_(t=d).getOr(lh(t)));return d.inline||(vn("div","width",a)&&dn(z.element,"width",a),vn("div","height",u)?dn(z.element,"height",u):dn(z.element,"height","200px")),u}return N=d,L=K,W=J,U=Sa(),j=pc(U,"touchstart",tt),G=pc(U,"touchmove",function(t){return Q(Li(),t)}),X=pc(U,"touchend",function(t){return Q(Wi(),t)}),Y=pc(U,"mousedown",tt),q=pc(U,"mouseup",function(t){0===t.raw.button&&Z(wf(),{target:t.target})}),N.on("PostRender",function(){N.on("click",nt),N.on("tap",nt),N.on("mouseup",et),N.on("mousedown",ot),N.on("ScrollWindow",rt),N.on("ResizeWindow",it),N.on("ResizeEditor",ut),N.on("AfterProgressState",at),N.on("DismissPopups",ct)}),N.on("remove",function(){N.off("click",nt),N.off("tap",nt),N.off("mouseup",et),N.off("mousedown",ot),N.off("ScrollWindow",rt),N.off("ResizeWindow",it),N.off("ResizeEditor",ut),N.off("AfterProgressState",at),N.off("DismissPopups",ct),Y.unbind(),j.unbind(),G.unbind(),X.unbind(),q.unbind()}),N.on("detach",function(){Ls(L),Ls(W),L.destroy(),W.destroy()}),{mothership:K,uiMothership:J,backstage:w,renderUI:function(){var o,r;v.setup(d,w.shared,m),nT(d,w),mT(d,g,w),r=(o=d).ui.registry.getAll().sidebars,St(Ct(r),function(n){function e(){return mt(vt.from(o.queryCommandValue("ToggleSidebar")),n)}var t=r[n];o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){function n(){return t.setActive(e())}return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),SC(d,p,w.shared),dt(d.getParam("toolbar_groups",{},"object"),function(t,n){d.ui.registry.addGroupToolbarButton(n,t)});var t,n=d.ui.registry.getAll(),e=n.buttons,i=n.menuItems,u=n.contextToolbars,a=n.sidebars,c=vh(d),s={menuItems:i,menus:(t=d.getParam("menu"))?dt(t,function(t){return lt(lt({},t),{items:t.items})}):{},menubar:d.getParam("menubar"),toolbar:c.getOrThunk(function(){return d.getParam("toolbar",!0)}),allowToolbarGroups:k===bh.floating,buttons:e,sidebar:a};m_(d,u,y,{backstage:w}),PT(d,y);var l=d.getElement(),f=$();return h.render(d,{mothership:K,uiMothership:J,outerContainer:z},s,w,{targetNode:l,height:f})},getUi:function(){return{channels:{broadcastAll:J.broadcast,broadcastOn:J.broadcastOn,register:st}}}};function Q(n,e){St([L,W],function(t){t.broadcastEvent(n,e)})}function Z(n,e){St([L,W],function(t){t.broadcastOn([n],e)})}function tt(t){return Z(yf(),{target:t.target})}function nt(t){return Z(yf(),{target:At.fromDom(t.target)})}function et(t){0===t.button&&Z(wf(),{target:At.fromDom(t.target)})}function ot(){St(N.editorManager.get(),function(t){N!==t&&t.fire("DismissPopups",{relatedTarget:N})})}function rt(t){return Q(Ui(),Ac(t))}function it(t){Z(xf(),{}),Q(ji(),Ac(t))}function ut(){return Z(xf(),{})}function at(t){t.state&&Z(yf(),{target:At.fromDom(N.getContainer())})}function ct(t){Z(yf(),{target:At.fromDom(t.relatedTarget.getContainer())})}}function dE(n){return ar("items","items",Ue(),no(io(function(t){return ao("Checking item of "+n,nB,t).fold(function(t){return Ve.error(ur(t))},function(t){return Ve.value(t)})})))}function mE(t){return y(t.type)&&y(t.name)}function gE(t){return{internalDialog:co(ao("dialog",sB,t)),dataValidator:(n=z(F(dB(t),mE),function(n){return vt.from(mB[n.type]).fold(function(){return[]},function(t){return[go(n.name,t)]})}),$o(n)),initialData:t.initialData};var n}function pE(t){var e=[],o={};return J(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?Ve.error(e):Ve.value(o)}function hE(t,n){dn(t,"height",n+"px"),le().browser.isIE()?bn(t,"flex-basis"):dn(t,"flex-basis",n+"px")}function vE(t,d,n){Fu(t,'[role="dialog"]').each(function(f){Iu(f,'[role="tablist"]').each(function(l){n.get().map(function(t){return dn(d,"height","0"),dn(d,"flex-basis","0"),Math.min(t,(e=d,o=l,r=Gt(n=f).dom,i="fixed"===pn(Fu(n,".tox-dialog-wrap").getOr(n),"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight),u=wn(e),a=e.dom.offsetLeft>=o.dom.offsetLeft+On(o)?Math.max(wn(o),u):u,c=parseInt(pn(n,"margin-top"),10)||0,s=parseInt(pn(n,"margin-bottom"),10)||0,i-(wn(n)+c+s-a)));var n,e,o,r,i,u,a,c,s}).each(function(t){hE(d,t)})})})}function bE(t){return Iu(t,'[role="tabpanel"]')}function yE(t,e){function o(t){var n=pE(Df.getValue(t)).getOr({}),e=i.get(),o=Yo(e,n);i.set(o)}function r(t){var n=i.get();Df.setValue(t,n)}var u,a,i=Po({}),c=Po(null),n=M(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[eS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:M(t.items,function(t){return hk(n,t,e)}),formBehaviours:nc([Fg.config({mode:"acyclic",useTabstopAt:O(p0)}),mm("TabView.form.events",[ou(r),ru(o)]),ic.config({channels:lr([{key:kB,value:{onReceive:o}},{key:CB,value:{onReceive:r}}])})])}})]}}}),s=(u=n,a=gc(),{extraEvents:[ou(function(t){var o=t.element;bE(o).each(function(n){var e;dn(n,"visibility","hidden"),t.getSystem().getByDom(n).toOptional().each(function(t){var o,r,i;Y(G((r=n,i=t,M(o=u,function(t,n){Rg.set(i,o[n].view());var e=r.dom.getBoundingClientRect();return Rg.set(i,[]),e.height})),function(t,n){return n<t?-1:t<n?1:0})).fold(a.clear,a.set)}),vE(o,n,a),bn(n,"visibility"),e=t,Y(u).each(function(t){return SB.showTab(e,t.value)}),lp.requestAnimationFrame(function(){vE(o,n,a)})})}),Cr(ji(),function(t){var n=t.element;bE(n).each(function(t){vE(n,t,a)})}),Cr(Ty,function(t,n){var r=t.element;bE(r).each(function(n){var t=Oa(ge(n));dn(n,"visibility","hidden");var e=hn(n,"height").map(function(t){return parseInt(t,10)});bn(n,"height"),bn(n,"flex-basis");var o=n.dom.getBoundingClientRect().height;e.forall(function(t){return t<o})?(a.set(o),vE(r,n,a)):e.each(function(t){hE(n,t)}),bn(n,"visibility"),t.each(ka)})})],selectFirst:!1});return SB.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Df.getValue(n);br(t,_y,{name:o,oldName:c.get()}),c.set(o)},tabs:n,components:[SB.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[bB.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:nc([py.config({})])}),SB.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:nc([mm("tabpanel",s.extraEvents),Fg.config({mode:"acyclic"}),cd.config({find:function(t){return Y(SB.getViewItems(t))}}),Df.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([kB],{}),i.get()},setValue:function(t,n){i.set(n),t.getSystem().broadcastOn([CB],{})}}})])})}function xE(t,n,r,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:lt(lt({},n.map(function(t){return{id:t}}).getOr({})),e?{"aria-live":"polite"}:{})},components:[],behaviours:nc([cS(0),k_.config({channel:TB,updateState:function(t,n){return vt.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){return"tabpanel"!==t.body.type?[(e=t.body,o=r,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(n=zm(eS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:M(e.items,function(t){return hk(n,t,o)})}}))).asSpec()]}],behaviours:nc([Fg.config({mode:"acyclic",useTabstopAt:O(p0)}),aS(n),mS(n,{postprocess:function(t){return pE(t).fold(function(t){return console.error(t),{}},h)}})])})]:[yE(t.body,r)];var e,o,n},initialData:t})])}}function wE(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}}function SE(t,n){return JE.parts.close(fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:nc([py.config({})])}))}function kE(){return JE.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function CE(t,n){return JE.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:xC("<p>"+n.translate(t)+"</p>")}]}]})}function OE(t){return JE.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})}function _E(t,n){return[ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]}function TE(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return JE.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),vt.some(!0)},useTabstopAt:function(t){return!p0(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:lt({position:"relative"},n.extraStyles)},components:H([n.header,n.body],n.footer.toArray(),!0),parts:{blocker:{dom:xC('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:BB?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:nc(H([Hg.config({}),mm("dialog-events",n.dialogEvents.concat([Br(bi(),function(t,n){Fg.focusIn(t)})])),mm("scroll-lock",[ou(function(){Yr(be(),i)}),ru(function(){qr(be(),i)})])],n.extraBehaviours,!0)),eventOrder:lt(((t={})[Ii()]=["dialog-events"],t[Gi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Xi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})}function EE(t){return fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Xm("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){vr(t,wy)}})}function DE(t,n,e){function o(t){return[ri(e.translate(t.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:lt({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:nc([k_.config({channel:_B,renderComponents:o})])}}function BE(){return{dom:xC('<div class="tox-dialog__draghandle"></div>')}}function ME(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=JE.parts.title(DE(e,vt.none(),o)),i=JE.parts.draghandle(BE()),u=JE.parts.close(EE(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),ly.sketch({dom:xC('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a}function AE(t,n,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:xC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}function FE(t,o,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){JE.setBusy(t(),function(t,n){return AE(e.message,n,o)})},onUnblock:function(){JE.setIdle(t())}}}function IE(t,n,e,o){var r;return Tu(TE(lt(lt({},t),{lazySink:o.shared.getSink,extraBehaviours:H([k_.config({channel:OB,updateState:function(t,n){return vt.some(n)},initialData:n}),pS({})],t.extraBehaviours,!0),onEscape:function(t){vr(t,wy)},dialogEvents:e,eventOrder:((r={})[Fi()]=[k_.name(),ic.name()],r[Gi()]=["scroll-lock",k_.name(),"messages","dialog-events","alloy.base.behaviour"],r[Xi()]=["alloy.base.behaviour","dialog-events","messages",k_.name(),"scroll-lock"],r)})))}function RE(t){return M(t,function(t){return"menu"===t.type?(e=M((n=t).items,function(t){var n=Po(!1);return lt(lt({},t),{storage:n})}),lt(lt({},n),{items:e})):t;var n,e})}function VE(t){return R(t,function(t,n){return"menu"!==n.type?t:R(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})}function PE(t,e){return[Er(bi(),g0),t(xy,function(t,n){e.onClose(),n.onClose()}),t(wy,function(t,n,e,o){n.onCancel(t),vr(o,xy)}),Cr(Oy,function(t,n){return e.onUnblock()}),Cr(Cy,function(t,n){return e.onBlock(n.event)})]}function HE(t,n){function e(t,n){return ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:M(n,function(t){return t.memento.asSpec()})})}var o=A(n.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align});return[e("start",o.pass),e("end",o.fail)]}function zE(t,e){return{dom:xC('<div class="tox-dialog__footer"></div>'),components:[],behaviours:nc([k_.config({channel:EB,initialData:t,updateState:function(t,n){var r=M(n.buttons,function(t){var n=zm(Q0(t,t.type,e));return{name:t.name,align:t.align,memento:n}});return vt.some({lookupByName:function(t,n){return e=t,o=n,V(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:HE})])}}function NE(t,n){return JE.parts.footer(zE(t,n))}function LE(n,e){if(n.getRoot().getSystem().isConnected()){var o=cd.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return eS.getField(o,e).fold(function(){var t=n.getFooter();return k_.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return vt.some(t)})}return vt.none()}function WE(c,o,s){function t(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)}var l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=Df.getValue(n),o=dt(s,function(t){return t.get()});return lt(lt({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=lt(lt({},o),a),i=(n=r,e=c.getRoot(),k_.getState(e).get().map(function(t){return co(ao("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Df.setValue(u,i),J(s,function(t,n){Tt(r,n)&&t.set(r[n])})})},disable:function(t){LE(c,t).each(gd.disable)},enable:function(t){LE(c,t).each(gd.enable)},focus:function(t){LE(c,t).each(Hg.focus)},block:function(n){if(!y(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){br(t,Cy,{message:n})})},unblock:function(){t(function(t){vr(t,Oy)})},showTab:function(e){t(function(t){var n=c.getBody();k_.getState(n).get().exists(function(t){return t.isTabPanel()})&&cd.getCurrent(n).each(function(t){SB.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([OB],n),t.getSystem().broadcastOn([_B],n.internalDialog),t.getSystem().broadcastOn([TB],n.internalDialog),t.getSystem().broadcastOn([EB],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){vr(t,xy)})}};return l}function UE(t){return x(t)&&-1!==RB.indexOf(t.mceAction)}function jE(o,t,r,n){var e,i,u,a=ME(o.title,n),c=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[d0({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:nc([py.config({}),Hg.config({})])})]}],behaviours:nc([Fg.config({mode:"acyclic",useTabstopAt:O(p0)})])},JE.parts.body(i)),s=o.buttons.bind(function(t){return 0===t.length?vt.none():vt.some(NE({buttons:t},n))}),l=MB(function(){return v},FE(function(){return h},n.shared.providers,t)),f=lt(lt({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),d=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],m=new IB(o.url,{base_uri:new IB(window.location.href)}),g=m.protocol+"://"+m.host+(m.port?":"+m.port:""),p=mc(),h=IE({header:a,body:c,footer:s,extraClasses:d,extraBehaviours:[mm("messages",[ou(function(){var t=pc(At.fromDom(window),"message",function(t){var n,e;m.isSameOrigin(new IB(t.raw.origin))&&(UE(n=t.raw.data)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!w(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,v,n):!UE(e=n)&&x(e)&&Tt(e,"mceAction")&&o.onMessage(v,n))});p.set(t)}),ru(p.clear)]),ic.config({channels:((e={})[DB]={onReceive:function(t,n){Iu(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(n,g)})}},e)})],extraStyles:f},o,l,n),v={block:function(n){if(!y(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");b(function(t){br(t,Cy,{message:n})})},unblock:function(){b(function(t){vr(t,Oy)})},close:function(){b(function(t){vr(t,xy)})},sendMessage:function(n){b(function(t){t.getSystem().broadcastOn([DB],n)})}};function b(t){u.getSystem().isConnected()&&t(u)}return{dialog:u=h,instanceApi:v}}function GE(t){function o(t,y){return gB.open(function(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=n,b=(r={redial:gB.redial,closeWindow:function(){JE.hide(b.dialog),y(b.instanceApi)}},i=R,c=ME((o={dataValidator:e,initialData:v,internalDialog:t}).internalDialog.title,i),u=i,a=xE({body:o.internalDialog.body},vt.none(),u,!1),s=JE.parts.body(a),l=RE(o.internalDialog.buttons),f=VE(l),d=NE({buttons:l},i),m=AB(function(){return h},FE(function(){return p},i.shared.providers,r),i.shared.getSink),g=function(){switch(o.internalDialog.size){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(),p=IE({header:c,body:s,footer:vt.some(d),extraClasses:g,extraBehaviours:[],extraStyles:{}},o,m,i),h=WE({getRoot:rt(p),getBody:function(){return JE.getBody(p)},getFooter:function(){return JE.getFooter(p)},getFormWrapper:function(){var t=JE.getBody(p);return cd.getCurrent(t).getOr(t)}},r.redial,f),{dialog:p,instanceApi:h});return JE.show(b.dialog),b.instanceApi.setData(v),b.instanceApi},t)}function r(t,A,F,I){return gB.open(function(t,n,e){function o(){return E.on(function(t){up.reposition(t),U1.refresh(t)})}var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=co(ao("data",e,n)),E=gc(),D=R.shared.header.isPositionedAtTop(),B=(i={dataValidator:e,initialData:T,internalDialog:t},u={redial:gB.redial,closeWindow:function(){E.on(up.hide),V.off("ResizeEditor",o),E.clear(),F(B.instanceApi)}},a=R,c=I,v=Ir("dialog-label"),b=Ir("dialog-content"),y=zm((f={title:i.internalDialog.title,draggable:!0},d=v,m=a.shared.providers,ly.sketch({dom:xC('<div class="tox-dialog__header"></div>'),components:[DE(f,vt.some(d),m),BE(),EE(m)],containerBehaviours:nc([aE.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ru(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),x=zm((g={body:i.internalDialog.body},p=a,h=c,xE(g,vt.some(b),p,h))),w=RE(i.internalDialog.buttons),S=VE(w),k=zm(FB({buttons:w},a)),C=AB(function(){return _},{onBlock:function(e){fO.block(O,function(t,n){return AE(e.message,n,a.shared.providers)})},onUnblock:function(){fO.unblock(O)},onClose:function(){return u.closeWindow()}},a.shared.getSink),O=Tu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((s={role:"dialog"})["aria-labelledby"]=v,s["aria-describedby"]=b,s)},eventOrder:((l={})[Fi()]=[k_.name(),ic.name()],l[Ii()]=["execute-on-form"],l[Gi()]=["reflecting","execute-on-form"],l),behaviours:nc([Fg.config({mode:"cyclic",onEscape:function(t){return vr(t,xy),vt.some(!0)},useTabstopAt:function(t){return!p0(t)&&("button"!==Ft(t)||"disabled"!==un(t,"disabled"))}}),k_.config({channel:OB,updateState:function(t,n){return vt.some(n)},initialData:i}),Hg.config({}),mm("execute-on-form",C.concat([Br(bi(),function(t,n){Fg.focusIn(t)})])),fO.config({getRoot:function(){return vt.some(O)}}),Rg.config({}),pS({})]),components:[y.asSpec(),x.asSpec(),k.asSpec()]}),_=WE({getRoot:rt(O),getFooter:function(){return k.get(O)},getBody:function(){return x.get(O)},getFormWrapper:function(){var t=x.get(O);return cd.getCurrent(t).getOr(t)}},u.redial,S),{dialog:O,instanceApi:_}),M=Tu(up.sketch(lt(lt({lazySink:R.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},D?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:nc(H([mm("window-manager-inline-events",[Cr(Yi(),function(t,n){vr(B.dialog,wy)})])],(r=V,P&&D?[]:[U1.config({contextual:{lazyContext:function(){return vt.some(Ae(At.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]),!0)),isExtraPart:function(t,n){return Yb(e=n,".tox-alert-dialog")||Yb(e,".tox-confirm-dialog");var e}})));return E.set(M),up.showWithin(M,Eu(B.dialog),{anchor:A},vt.some(be())),P&&D||(U1.refresh(M),V.on("ResizeEditor",o)),B.instanceApi.setData(T),Fg.focusIn(B.dialog),B.instanceApi},t)}var c,s,l,f,R=t.backstage,V=t.editor,P=dv(V),e=(s=(c=t).backstage.shared,{open:function(t,n){function e(){JE.hide(u),n()}var o=zm(Q0({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:vt.none()},"cancel",c.backstage)),r=kE(),i=SE(e,s.providers),u=Tu(TE({lazySink:function(){return s.getSink()},header:wE(r,i),body:CE(t,s.providers),footer:vt.some(OE(_E([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Cr(wy,e)],eventOrder:{}}));JE.show(u);var a=o.get(u);Hg.focus(a)}}),i=(f=(l=t).backstage.shared,{open:function(t,n){function e(t){JE.hide(a),n(t)}var o=zm(Q0({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:vt.none()},"submit",l.backstage)),r=Q0({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:vt.none()},"cancel",l.backstage),i=kE(),u=SE(function(){return e(!1)},f.providers),a=Tu(TE({lazySink:function(){return f.getSink()},header:wE(i,u),body:CE(t,f.providers),footer:vt.some(OE(_E([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Cr(wy,function(){return e(!1)}),Cr(ky,function(){return e(!0)})],eventOrder:{}}));JE.show(a);var c=o.get(a);Hg.focus(c)}});return{open:function(t,n,e){return void 0!==n&&"toolbar"===n.inline?r(t,R.shared.anchors.inlineDialog(),e,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?r(t,R.shared.anchors.cursor(),e,n.ariaAttrs):o(t,e)},openUrl:function(t,n){return e=n,gB.openUrl(function(t){var n=jE(t,{closeWindow:function(){JE.hide(n.dialog),e(n.instanceApi)}},V,R);return JE.show(n.dialog),n.instanceApi},t);var e},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){i.open(t,function(t){n(t)})}}}(zT=HT=HT||{})[zT.None=0]="None",zT[zT.Both=1]="Both",zT[zT.Vertical=2]="Vertical";var XE,YE=rt([mo("lazySink"),wo("dragBlockClass"),Io("getBounds",Fe),Eo("useTabstopAt",D),Eo("eventOrder",{}),Zs("modalBehaviours",[Fg]),$u("onExecute"),Zu("onEscape")]),qE={sketch:h},KE=rt([Qf({name:"draghandle",overrides:function(t,n){return{behaviours:nc([aE.config({mode:"mouse",getTarget:function(t){return Fu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(n,null,2)).message),getBounds:t.getDragBounds})])}}}),Jf({schema:[mo("dom")],name:"title"}),Jf({factory:qE,schema:[mo("dom")],name:"close"}),Jf({factory:qE,schema:[mo("dom")],name:"body"}),Qf({factory:qE,schema:[mo("dom")],name:"footer"}),$f({factory:{sketch:function(t,n){return lt(lt({},t),{dom:n.dom,components:n.components})}},schema:[Eo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Eo("components",[])],name:"blocker"})]),JE=Cl({name:"ModalDialog",configFields:YE(),partFields:KE(),factory:function(a,t,n,r){var e,i=gc(),o=Ir("modal-events"),u=lt(lt({},a.eventOrder),((e={})[Gi()]=[o].concat(a.eventOrder["alloy.system.attached"]||[]),e));return{uid:a.uid,dom:a.dom,components:t,apis:{show:function(t){i.set(t);var n=a.lazySink(t).getOrDie(),e=r.blocker(),o=n.getSystem().build(lt(lt({},e),{components:e.components.concat([Eu(t)]),behaviours:nc([Hg.config({}),mm("dialog-blocker-events",[Br(bi(),function(){Fg.focusIn(t)})])])}));Vs(n,o),Fg.focusIn(t)},hide:function(n){i.clear(),Yt(n.element).each(function(t){n.getSystem().getByDom(t).each(function(t){Hs(t)})})},getBody:function(t){return gl(t,a,"body")},getFooter:function(t){return gl(t,a,"footer")},setIdle:function(t){fO.unblock(t)},setBusy:function(t,n){fO.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:nl(a.modalBehaviours,[Rg.config({}),Fg.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt}),fO.config({getRoot:i.get}),mm(o,[ou(function(t){var n,e,o,r=t.element,i=gl(t,a,"title").element,u=an(r,"id").fold(function(){var t=Ir("dialog-label");return on(i,"id",t),t},h);on(r,"aria-labelledby",u),n=t.element,e=gl(t,a,"body").element,o=vt.from(un(n,"id")).fold(function(){var t=Ir("dialog-describe");return on(e,"id",t),t},h),on(n,"aria-describedby",o)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),$E=$o([po("type"),po("name")].concat(Lh)),QE=er,ZE=[ar("name","name",je(function(){return Ir("button-name")}),nr),Co("icon"),Ao("align","end",["start","end"]),Fo("primary",!1),Fo("disabled",!1)],tD=H(H([],ZE,!0),[po("text")],!1),nD=H([ho("type",["submit","cancel","custom"])],tD,!0),eD=lo("type",{submit:nD,cancel:nD,custom:nD,menu:H([ho("type",["menu"]),Co("text"),Co("tooltip"),Co("icon"),xo("items",$E)],ZE,!0)}),oD=[po("type"),po("text"),ho("level",["info","warn","error","success"]),po("icon"),Eo("url","")],rD=$o(oD),iD=[po("type"),po("text"),Fo("disabled",!1),Fo("primary",!1),ar("name","name",je(function(){return Ir("button-name")}),nr),Co("icon"),Fo("borderless",!1)],uD=$o(iD),aD=[po("type"),po("name"),po("label"),Fo("disabled",!1)],cD=$o(aD),sD=er,lD=[po("type"),po("name")],fD=lD.concat([Co("label")]),dD=fD.concat([Eo("columns","auto")]),mD=$o(dD),gD=Qo([po("value"),po("text"),po("icon")]),pD=$o(fD),hD=nr,vD=$o(fD),bD=nr,yD=lD.concat([Mo("tag","textarea"),po("scriptId"),po("scriptUrl"),Do("settings",void 0,ir)]),xD=lD.concat([Mo("tag","textarea"),vo("init")]),wD=io(function(t){return ao("customeditor.old",to(xD),t).orThunk(function(){return ao("customeditor.new",to(yD),t)})}),SD=nr,kD=$o(fD),CD=no(Jo),OD=[po("type"),po("html"),Ao("presets","presentation",["presentation","document"])],_D=$o(OD),TD=fD.concat([Fo("sandboxed",!0)]),ED=$o(TD),DD=nr,BD=fD.concat([go("currentState",$o([mo("blob"),po("url")]))]),MD=$o(BD),AD=fD.concat([Co("inputMode"),Co("placeholder"),Fo("maximized",!1),Fo("disabled",!1)]),FD=$o(AD),ID=nr,RD=[po("text"),po("value")],VD=[po("text"),xo("items",(XE=Rt(function(){return PD}),{extract:function(t,n){return XE().extract(t,n)},toString:function(){return XE().toString()}}))],PD=eo([$o(RD),$o(VD)]),HD=fD.concat([xo("items",PD),Fo("disabled",!1)]),zD=$o(HD),ND=nr,LD=fD.concat([yo("items",[po("text"),po("value")]),Bo("size",1),Fo("disabled",!1)]),WD=$o(LD),UD=nr,jD=fD.concat([Fo("constrain",!0),Fo("disabled",!1)]),GD=$o(jD),XD=$o([po("width"),po("height")]),YD=[po("type"),xo("header",nr),xo("cells",no(nr))],qD=$o(YD),KD=fD.concat([Co("placeholder"),Fo("maximized",!1),Fo("disabled",!1)]),JD=$o(KD),$D=nr,QD=fD.concat([Ao("filetype","file",["image","media","file"]),Eo("disabled",!1)]),ZD=$o(QD),tB=$o([po("value"),Eo("meta",{})]),nB=Ze(function(){return ro("type",{alertbanner:rD,bar:$o((e=dE("bar"),[po("type"),e])),button:uD,checkbox:cD,colorinput:pD,colorpicker:vD,dropzone:kD,grid:$o((t=dE("grid"),[po("type"),go("columns",tr),t])),iframe:ED,input:FD,listbox:zD,selectbox:WD,sizeinput:GD,textarea:JD,urlinput:ZD,customeditor:wD,htmlpanel:_D,imagetools:MD,collection:mD,label:$o((n=dE("label"),[po("type"),po("label"),n])),table:qD,panel:oB});var t,n,e}),eB=[po("type"),Eo("classes",[]),xo("items",nB)],oB=$o(eB),rB=[ar("name","name",je(function(){return Ir("tab-name")}),nr),po("title"),xo("items",nB)],iB=[po("type"),yo("tabs",rB)],uB=$o(iB),aB=tD,cB=eD,sB=$o([po("title"),go("body",ro("type",{panel:oB,tabpanel:uB})),Mo("size","normal"),xo("buttons",cB),Eo("initialData",{}),Io("onAction",st),Io("onChange",st),Io("onSubmit",st),Io("onClose",st),Io("onCancel",st),Eo("onTabChange",st)]),lB=$o(H([ho("type",["cancel","custom"])],aB,!0)),fB=$o([po("title"),po("url"),ko("height"),ko("width"),_o("buttons",lB),Io("onAction",st),Io("onCancel",st),Io("onClose",st),Io("onMessage",st)]),dB=function(t){return x(t)?[t].concat(z(Z(t),dB)):c(t)?z(t,dB):[]},mB={checkbox:sD,colorinput:hD,colorpicker:bD,dropzone:CD,input:ID,iframe:DD,sizeinput:XD,selectbox:UD,listbox:ND,size:XD,textarea:$D,urlinput:tB,customeditor:SD,collection:gD,togglemenuitem:QE},gB={open:function(t,n){var e=gE(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(co(ao("dialog",fB,n)))},redial:gE},pB=kl({name:"TabButton",configFields:[Eo("uid",void 0),mo("value"),ar("dom","dom",Ye(function(){return{attributes:{role:"tab",id:Ir("aria"),"aria-selected":"false"}}}),Zo()),wo("action"),Eo("domModification",{}),Zs("tabButtonBehaviours",[Hg,Fg,Df]),mo("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Sm(t.action),behaviours:nl(t.tabButtonBehaviours,[Hg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0}),Df.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),hB=rt([mo("tabs"),mo("dom"),Eo("clickToDismiss",!1),Zs("tabbarBehaviours",[hd,Fg]),qu(["tabClass","selectedClass"])]),vB=rt([Zf({factory:pB,name:"tabs",unit:"tab",overrides:function(o){return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=hd.isHighlighted(n,t);(e&&o.clickToDismiss?function(t,n){hd.dehighlight(t,n),br(t,Qi(),{tabbar:t,button:n})}:e?st:function(t,n){hd.highlight(t,n),br(t,$i(),{tabbar:t,button:n})})(n,t)},domModification:{classes:[o.markers.tabClass]}}}})]),bB=Cl({name:"Tabbar",configFields:hB(),partFields:vB(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:nl(t.tabbarBehaviours,[hd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){on(n.element,"aria-selected","true")},onDehighlight:function(t,n){on(n.element,"aria-selected","false")}}),Fg.config({mode:"flow",getInitial:function(t){return hd.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),yB=kl({name:"Tabview",configFields:[Zs("tabviewBehaviours",[Rg])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:nl(t.tabviewBehaviours,[Rg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),xB=rt([Eo("selectFirst",!0),Ju("onChangeTab"),Ju("onDismissTab"),Eo("tabs",[]),Zs("tabSectionBehaviours",[])]),wB=rt([Jf({factory:bB,schema:[mo("dom"),bo("markers",[mo("tabClass"),mo("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Jf({factory:yB,name:"tabview"})]),SB=Cl({name:"TabSection",configFields:xB(),partFields:wB(),factory:function(i,t,n,e){function o(t,n){ml(t,i,"tabbar").each(function(t){n(t).each(yr)})}return{uid:i.uid,dom:i.dom,components:t,behaviours:tl(i.tabSectionBehaviours),events:eu(ft([i.selectFirst?[ou(function(t,n){o(t,hd.getFirst)})]:[],[Cr($i(),function(t,n){var o=n.event.button,r=Df.getValue(o);ml(o,i,"tabview").each(function(e){V(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();an(o.element,"id").each(function(t){on(e.element,"aria-labelledby",t)}),Rg.set(e,n),i.onChangeTab(e,o,n)})})}),Cr(Qi(),function(t,n){var e=n.event.button;i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return ml(t,i,"tabview").map(function(t){return Rg.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){return V(hd.getCandidates(n),function(t){return Df.getValue(t)===e}).filter(function(t){return!hd.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),kB="send-data-to-section",CB="send-data-to-view",OB=Ir("update-dialog"),_B=Ir("update-title"),TB=Ir("update-body"),EB=Ir("update-footer"),DB=Ir("body-send-message"),BB=nb.deviceType.isTouch(),MB=function(u,t){function n(t,i){return Cr(t,function(e,o){var n,r;n=e,r=function(t,n){i(u(),t,o.event,e)},k_.getState(n).get().each(function(t){r(t,n)})})}return H(H([],PE(n,t),!0),[n(Sy,function(t,n,e){n.onAction(t,{name:e.name})})],!1)},AB=function(u,t,c){function n(t,i){return Cr(t,function(e,o){var n,r;n=e,r=function(t,n){i(u(),t,o.event,e)},k_.getState(n).get().each(function(t){r(t.internalDialog,n)})})}return H(H([],PE(n,t),!0),[n(ky,function(t,n){return n.onSubmit(t)}),n(yy,function(t,n,e){n.onChange(t,{name:e.name})}),n(Sy,function(t,n,e,o){function r(){return Fg.focusIn(o)}function i(t){return cn(t,"disabled")||an(t,"aria-disabled").exists(function(t){return"true"===t})}var u=ge(o.element),a=Oa(u);n.onAction(t,{name:e.name,value:e.value}),Oa(u).fold(r,function(n){i(n)||a.exists(function(t){return Wt(n,t)&&i(t)})?r():c().toOptional().filter(function(t){return!Wt(t.element,n)}).each(r)})}),n(_y,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),ru(function(t){var n=u();Df.setValue(t,n.getData())})],!1)},FB=zE,IB=tinymce.util.Tools.resolve("tinymce.util.URI"),RB=["insertContent","setContent","execCommand","close","block","unblock"];o.add("silver",function(t){var n=fE(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;return uy(t,o.shared),{renderUI:r,getWindowManagerImpl:rt(GE({editor:t,backstage:o})),getNotificationManagerImpl:function(){return u=t,r=e,l={backstage:o}.backstage.shared,{open:function(t,n){function e(){n(),up.hide(c)}var o=!t.closeButton&&t.timeout&&(0<t.timeout||t.timeout<0),a=Tu(hp.sketch({text:t.text,level:wt(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:vt.from(t.icon),closeButton:!o,onAction:e,iconProvider:l.providers.icons,translationProvider:l.providers.translate})),c=Tu(up.sketch(lt({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:l.getSink,fireDismissalEventInstead:{}},l.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));function s(){var t=Ae(At.fromDom(u.getContentAreaContainer())),n=Fe(),e=ja(n.x,t.x,t.right),o=ja(n.y,t.y,t.bottom),r=Math.max(t.right,n.right),i=Math.max(t.bottom,n.bottom);return vt.some(Me(e,o,r-e,i-o))}return r.add(c),0<t.timeout&&lp.setTimeout(function(){e()},t.timeout),{close:e,moveTo:function(t,n){up.showAt(c,Eu(a),{anchor:{type:"makeshift",x:t,y:n}})},moveRel:function(t,n){var e,o,r,i=Eu(a),u={maxHeightFunction:Vc()};"banner"!==n&&k(t)?(e=function(){switch(n){case"bc-bc":return sp;case"tc-tc":return cp;case"tc-bc":return Ja;default:return $a}}(),o={type:"node",root:be(),node:vt.some(At.fromDom(t)),overrides:u,layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}},up.showWithinBounds(c,i,{anchor:o},s)):(r=lt(lt({},l.anchors.banner()),{overrides:u}),up.showWithinBounds(c,i,{anchor:r},s))},text:function(t){hp.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){hp.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(e){0<e.length&&St(e,function(t,n){0===n?t.moveRel(null,"banner"):t.moveRel(e[n-1].getEl(),"bc-tc")})},getArgs:function(t){return t.settings}};var u,r,l},ui:i()}})}();
!function(){"use strict";function t(o){return function(t){return n=typeof(e=t),(null===e?"null":"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n)===o;var e,n}}function e(e){return function(t){return typeof t===e}}function n(e){return function(t){return e===t}}function g(t){return null==t}function f(t,e){if(c(t)){for(var n=0,o=t.length;n<o;++n)if(!e(t[n]))return;return 1}}function st(){}function r(n,o){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(o.apply(null,t))}}function rt(t){return function(){return t}}function h(t){return t}function v(t,e){return t===e}var y=t("string"),x=t("object"),c=t("array"),b=n(null),w=e("boolean"),E=n(void 0),k=function(t){return!g(t)},S=e("function"),u=e("number");function C(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=r.concat(t);return o.apply(null,n)}}function O(e){return function(t){return!e(t)}}function _(t){return function(){throw new Error(t)}}var T=rt(!1),D=rt(!0),o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),lt=function(){return(lt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function A(t,e){var n={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function V(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||((o=o||Array.prototype.slice.call(e,0,r))[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function i(){return a}var a={fold:function(t,e){return t()},isSome:T,isNone:D,getOr:h,getOrThunk:s,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:rt(null),getOrUndefined:rt(void 0),or:h,orThunk:s,map:i,each:st,bind:i,exists:T,forall:D,filter:function(){return a},toArray:function(){return[]},toString:rt("none()")};function s(t){return t()}function l(t,e){return yt.call(t,e)}function d(t,e){for(var n=0,o=t.length;n<o;n++)if(e(t[n],n))return!0;return!1}function m(t,e){for(var n=[],o=0;o<t;o++)n.push(e(o));return n}function p(t,e){for(var n=[],o=0;o<t.length;o+=e){var r=bt.call(t,o,o+e);n.push(r)}return n}function B(t,e){for(var n=t.length,o=new Array(n),r=0;r<n;r++){var i=t[r];o[r]=e(i,r)}return o}function M(t,e){for(var n=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(e(u,r)?n:o).push(u)}return{pass:n,fail:o}}function F(t,e){for(var n=[],o=0,r=t.length;o<r;o++){var i=t[o];e(i,o)&&n.push(i)}return n}function I(t,o,r){return function(t){for(var e,n=t.length-1;0<=n;n--)e=t[n],r=o(r,e,n)}(t),r}function R(t,n,o){return St(t,function(t,e){o=n(o,t,e)}),o}function N(t,e){return function(t,e,n){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(e(i,o))return vt.some(i);if(n(i,o))break}return vt.none()}(t,e,T)}function P(t,e){for(var n=0,o=t.length;n<o;n++)if(e(t[n],n))return vt.some(n);return vt.none()}function ft(t){for(var e=[],n=0,o=t.length;n<o;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);xt.apply(e,t[n])}return e}function H(t,e){return ft(B(t,e))}function L(t,e){for(var n=0,o=t.length;n<o;++n)if(!0!==e(t[n],n))return!1;return!0}function z(t){var e=bt.call(t,0);return e.reverse(),e}function U(t,e){return F(t,function(t){return!wt(e,t)})}function j(t,e){for(var n={},o=0,r=t.length;o<r;o++){var i=t[o];n[String(i)]=e(i,o)}return n}function W(t){return[t]}function G(t,e){var n=bt.call(t,0);return n.sort(e),n}function X(t,e){return 0<=e&&e<t.length?vt.some(t[e]):vt.none()}function Y(t){return X(t,0)}function q(t){return X(t,t.length-1)}function K(t,e){for(var n=0;n<t.length;n++){var o=e(t[n],n);if(o.isSome())return o}return vt.none()}function J(t,e){for(var n=Ct(t),o=0,r=n.length;o<r;o++){var i=n[o];e(t[i],i)}}function dt(t,n){return _t(t,function(t,e){return{k:e,v:n(t,e)}})}function $(t,n){var o=[];return J(t,function(t,e){o.push(n(t,e))}),o}function Q(t,e){for(var n=Ct(t),o=0,r=n.length;o<r;o++){var i=n[o],u=t[i];if(e(u,i,t))return vt.some(u)}return vt.none()}function Z(t){return $(t,h)}function tt(t,e){return Tt(t,e)?vt.from(t[e]):vt.none()}function et(t,e){return Tt(t,e)&&void 0!==t[e]&&null!==t[e]}function mt(t,e,n){return void 0===n&&(n=v),t.exists(function(t){return n(t,e)})}function nt(t){for(var e=[],n=function(t){e.push(t)},o=0;o<t.length;o++)t[o].each(n);return e}function ot(t,e){return t?vt.some(e):vt.none()}function it(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}function ut(t,e){return-1!==t.indexOf(e)}function at(t){return 0<t.length}function ct(t){return void 0!==t.style&&S(t.style.getPropertyValue)}function gt(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var pt,ht=function(n){function t(){return r}function e(t){return t(n)}var o=rt(n),r={fold:function(t,e){return e(n)},isSome:D,isNone:T,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return ht(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?r:a},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},vt={some:ht,none:i,from:function(t){return null==t?a:ht(t)}},bt=Array.prototype.slice,yt=Array.prototype.indexOf,xt=Array.prototype.push,wt=function(t,e){return-1<l(t,e)},St=function(t,e){for(var n=0,o=t.length;n<o;n++)e(t[n],n)},kt=S(Array.from)?Array.from:function(t){return bt.call(t)},Ct=Object.keys,Ot=Object.hasOwnProperty,_t=function(t,o){var r={};return J(t,function(t,e){var n=o(t,e);r[n.k]=n.v}),r},Tt=function(t,e){return Ot.call(t,e)},Et=function(t,e,n){return t.isSome()&&e.isSome()?vt.some(n(t.getOrDie(),e.getOrDie())):vt.none()},Dt=function(t,e){return it(t,e,0)},At=function(t,e){return it(t,e,t.length-e.length)},Bt=(pt=/^\s+|\s+$/g,function(t){return t.replace(pt,"")}),Mt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return gt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return gt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return gt(n)},fromDom:gt,fromPoint:function(t,e,n){return vt.from(t.dom.elementFromPoint(e,n)).map(gt)}};function Ft(t){return t.dom.nodeName.toLowerCase()}function It(e){return function(t){return t.dom.nodeType===e}}function Rt(n){var o,r=!1;return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r||(r=!0,o=n.apply(null,t)),o}}function Nt(t,e){var n=String(e).toLowerCase();return N(t,function(t){return t.search(n)})}function Pt(e){return function(t){return ut(t,e)}}function Vt(t){return window.matchMedia(t).matches}function Ht(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var o=n;if(void 0!==o.matches)return o.matches(e);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(e);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(e);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}function Lt(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount}function zt(t,e){return t.dom===e.dom}function Ut(t,e){return ln().browser.isIE()?(n=t.dom,o=e.dom,r=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(o)&r)):(i=t.dom)!==(u=e.dom)&&i.contains(u);var n,o,r,i,u}function jt(t){return Mt.fromDom(t.dom.ownerDocument)}function Wt(t){return Ye(t)?t:jt(t)}function Gt(t){return Mt.fromDom(Wt(t).dom.documentElement)}function Xt(t){return Mt.fromDom(Wt(t).dom.defaultView)}function Yt(t){return vt.from(t.dom.parentNode).map(Mt.fromDom)}function qt(t){return vt.from(t.dom.offsetParent).map(Mt.fromDom)}function Kt(t){return B(t.dom.childNodes,Mt.fromDom)}function Jt(t,e){var n=t.dom.childNodes;return vt.from(n[e]).map(Mt.fromDom)}function $t(t,e){return{element:t,offset:e}}function Qt(t,e){var n=Kt(t);return 0<n.length&&e<n.length?$t(n[e],0):$t(t,e)}function Zt(t){return qe(t)&&k(t.dom.host)}function te(t){return Zt(t)?t:Mt.fromDom(Wt(t).dom.body)}function ee(t){return Mt.fromDom(t.dom.host)}function ne(t,e,n){if(!(y(n)||w(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}function oe(t,e,n){ne(t.dom,e,n)}function re(t,e){var n=t.dom;J(e,function(t,e){ne(n,e,t)})}function ie(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n}function ue(t,e){return vt.from(ie(t,e))}function ae(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}function ce(t,e){t.dom.removeAttribute(e)}function se(t,e,n){if(!y(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);ct(t)&&t.style.setProperty(e,n)}function le(t,e){ct(t)&&t.style.removeProperty(e)}function fe(t,e,n){se(t.dom,e,n)}function de(t,e){var n=t.dom;J(e,function(t,e){se(n,e,t)})}function me(t,e){var n=t.dom;J(e,function(t,e){t.fold(function(){le(n,e)},function(t){se(n,e,t)})})}function ge(t,e){var n=t.dom,o=window.getComputedStyle(n).getPropertyValue(e);return""!==o||vn(t)?o:xn(n,e)}function pe(t,e){var n=t.dom,o=xn(n,e);return vt.from(o).filter(function(t){return 0<t.length})}function he(t,e,n){var o=Mt.fromTag(t);return fe(o,e,n),pe(o,e).isSome()}function ve(t,e){le(t.dom,e),mt(ue(t,"style").map(Bt),"")&&ce(t,"style")}function be(t){return t.dom.offsetWidth}function ye(o,r){function t(t){var e=r(t);if(e<=0||null===e){var n=ge(t,o);return parseFloat(n)||0}return e}function i(r,t){return R(t,function(t,e){var n=ge(r,e),o=void 0===n?0:parseInt(n,10);return isNaN(o)?t:t+o},0)}return{set:function(t,e){if(!u(e)&&!e.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+e);var n=t.dom;ct(n)&&(n.style[o]=e+"px")},get:t,getOuter:t,aggregate:i,max:function(t,e,n){var o=i(t,n);return o<e?e-o:0}}}function xe(t){return wn.get(t)}function we(t){return wn.getOuter(t)}function Se(t,e){return void 0!==t?t:void 0!==e?e:0}function ke(t){var e=t.dom.ownerDocument,n=e.body,o=e.defaultView,r=e.documentElement;if(n===t.dom)return kn(n.offsetLeft,n.offsetTop);var i=Se(null==o?void 0:o.pageYOffset,r.scrollTop),u=Se(null==o?void 0:o.pageXOffset,r.scrollLeft),a=Se(r.clientTop,n.clientTop),c=Se(r.clientLeft,n.clientLeft);return Cn(t).translate(u-c,i-a)}function Ce(t){return On.get(t)}function Oe(t){return On.getOuter(t)}function _e(t){function e(){return t.stopPropagation()}function n(){return t.preventDefault()}var o=r(n,e);return{target:Mt.fromDom(function(t){if(mn()&&k(t.target)){var e=Mt.fromDom(t.target);if(Ge(e)&&hn(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return Y(n)}}return vt.from(t.target)}(t).getOr(t.target)),x:t.clientX,y:t.clientY,stop:e,prevent:n,kill:o,raw:t}}function Te(t,e,n,o,r){var i,u,a=(i=n,u=o,function(t){i(t)&&u(_e(t))});return t.dom.addEventListener(e,a,r),{unbind:C(_n,t,e,a,r)}}function Ee(e,n){Yt(e).each(function(t){t.dom.insertBefore(n.dom,e.dom)})}function De(t,e){vt.from(t.dom.nextSibling).map(Mt.fromDom).fold(function(){Yt(t).each(function(t){Tn(t,e)})},function(t){Ee(t,e)})}function Ae(e,n){Jt(e,0).fold(function(){Tn(e,n)},function(t){e.dom.insertBefore(n.dom,t.dom)})}function Be(e,t){St(t,function(t){Tn(e,t)})}function Me(t){t.dom.textContent="",St(Kt(t),function(t){En(t)})}function Fe(t){var e,n=Kt(t);0<n.length&&(e=t,St(n,function(t){Ee(e,t)})),En(t)}function Ie(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return kn(n,o)}function Re(t,e,n){var o=(void 0!==n?n.dom:document).defaultView;o&&o.scrollTo(t,e)}function Ne(t,e,n,o){return{x:t,y:e,width:n,height:o,right:t+n,bottom:e+o}}function Pe(t){var o=void 0===t?window:t,e=o.document,r=Ie(Mt.fromDom(e)),n=void 0===o?window:o;return(ln().browser.isFirefox()?vt.none():vt.from(n.visualViewport)).fold(function(){var t=o.document.documentElement,e=t.clientWidth,n=t.clientHeight;return Ne(r.left,r.top,e,n)},function(t){return Ne(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})}function Ve(o){var t,r=Ie(Mt.fromDom(document)),e=(t=An).owner(o),n=Dn(t,e);return vt.some(n).fold(C(ke,o),function(t){var e=Cn(o),n=I(t,function(t,e){var n=Cn(e);return{left:t.left+n.left,top:t.top+n.top}},{left:0,top:0});return kn(n.left+e.left+r.left,n.top+e.top+r.top)})}function He(t){var e=Ve(t),n=Oe(t),o=we(t);return Bn(e.left,e.top,n,o)}"undefined"!=typeof window||Function("return this;")();function Le(){return Ke(0,0)}function ze(t){function e(t){return function(){return n===t}}var n=t.current,o=t.version;return{current:n,version:o,isEdge:e("Edge"),isChrome:e("Chrome"),isIE:e("IE"),isOpera:e("Opera"),isFirefox:e(Ze),isSafari:e("Safari")}}function Ue(t){function e(t){return function(){return n===t}}var n=t.current,o=t.version;return{current:n,version:o,isWindows:e(nn),isiOS:e("iOS"),isAndroid:e(on),isOSX:e("OSX"),isLinux:e("Linux"),isSolaris:e(rn),isFreeBSD:e(un),isChromeOS:e(an)}}var je,We,Ge=It(1),Xe=It(3),Ye=It(9),qe=It(11),Ke=function(t,e){return{major:t,minor:e}},Je={nu:Ke,detect:function(t,e){var n,o,r=String(e).toLowerCase();return 0===t.length?Le():(o=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(o.test(e))return o}}(t,n=r))?Ke(i(1),i(2)):{major:0,minor:0};function i(t){return Number(n.replace(o,"$"+t))}},unknown:Le},$e=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Qe={browsers:rt([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ut(t,"edge/")&&ut(t,"chrome")&&ut(t,"safari")&&ut(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$e],search:function(t){return ut(t,"chrome")&&!ut(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ut(t,"msie")||ut(t,"trident")}},{name:"Opera",versionRegexes:[$e,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Pt("firefox")},{name:"Safari",versionRegexes:[$e,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ut(t,"safari")||ut(t,"mobile/"))&&ut(t,"applewebkit")}}]),oses:rt([{name:"Windows",search:Pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ut(t,"iphone")||ut(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Pt("linux"),versionRegexes:[]},{name:"Solaris",search:Pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},Ze="Firefox",tn=function(){return ze({current:void 0,version:Je.unknown()})},en=ze,nn=(rt("Edge"),rt("Chrome"),rt("IE"),rt("Opera"),rt(Ze),rt("Safari"),"Windows"),on="Android",rn="Solaris",un="FreeBSD",an="ChromeOS",cn=function(){return Ue({current:void 0,version:Je.unknown()})},sn=Ue,ln=(rt(nn),rt("iOS"),rt(on),rt("Linux"),rt("OSX"),rt(rn),rt(un),rt(an),Rt(function(){return t=navigator.userAgent,e=vt.from(navigator.userAgentData),n=Vt,p=Qe.browsers(),h=Qe.oses(),v=e.bind(function(t){return o=p,K(t.brands,function(e){var n=e.brand.toLowerCase();return N(o,function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(t){return{current:t.name,version:Je.nu(parseInt(e.version,10),0)}})});var o}).orThunk(function(){return Nt(p,n=t).map(function(t){var e=Je.detect(t.versionRegexes,n);return{current:t.name,version:e}});var n}).fold(tn,en),b=Nt(h,o=t).map(function(t){var e=Je.detect(t.versionRegexes,o);return{current:t.name,version:e}}).fold(cn,sn),{browser:v,os:b,deviceType:(i=v,u=t,a=n,c=(r=b).isiOS()&&!0===/ipad/i.test(u),s=r.isiOS()&&!c,f=(l=r.isiOS()||r.isAndroid())||a("(pointer:coarse)"),d=c||!s&&l&&a("(min-device-width:768px)"),m=s||l&&!d,g=i.isSafari()&&r.isiOS()&&!1===/safari/i.test(u),{isiPad:rt(c),isiPhone:rt(s),isTablet:rt(d),isPhone:rt(m),isTouch:rt(f),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:rt(g),isDesktop:rt(!m&&!d&&!g)})};var t,e,n,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b})),fn=Yt,dn=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),mn=rt(dn),gn=dn?function(t){return Mt.fromDom(t.dom.getRootNode())}:Wt,pn=function(t){var e=gn(t);return Zt(e)?vt.some(e):vt.none()},hn=function(t){return k(t.dom.shadowRoot)},vn=function(t){var e=Xe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,o,r=e.ownerDocument;return pn(Mt.fromDom(e)).fold(function(){return r.body.contains(e)},(n=vn,o=ee,function(t){return n(o(t))}))},bn=function(){return yn(Mt.fromDom(document))},yn=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Mt.fromDom(e)},xn=function(t,e){return ct(t)?t.style.getPropertyValue(e):""},wn=ye("height",function(t){var e=t.dom;return vn(t)?e.getBoundingClientRect().height:e.offsetHeight}),Sn=function(n,o){return{left:n,top:o,translate:function(t,e){return Sn(n+t,o+e)}}},kn=Sn,Cn=function(t){var e,n=t.dom,o=n.ownerDocument.body;return o===n?kn(o.offsetLeft,o.offsetTop):vn(t)?(e=n.getBoundingClientRect(),kn(e.left,e.top)):kn(0,0)},On=ye("width",function(t){return t.dom.offsetWidth}),_n=function(t,e,n,o){t.dom.removeEventListener(e,n,o)},Tn=function(t,e){t.dom.appendChild(e.dom)},En=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Dn=function(o,t){return o.view(t).fold(rt([]),function(t){var e=o.owner(t),n=Dn(o,e);return[t].concat(n)})},An=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?vt.none():vt.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Mt.fromDom)},owner:jt}),Bn=function(t,e,n,o){return{x:t,y:e,width:n,height:o,right:t+n,bottom:e+o}},Mn=function(t){var e=ke(t),n=Oe(t),o=we(t);return Bn(e.left,e.top,n,o)},Fn=function(){return Pe(window)},In=function(n){return{isValue:D,isError:T,getOr:rt(n),getOrThunk:rt(n),getOrDie:rt(n),or:function(t){return In(n)},orThunk:function(t){return In(n)},fold:function(t,e){return e(n)},map:function(t){return In(t(n))},mapError:function(t){return In(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOptional:function(){return vt.some(n)}}},Rn=function(n){return{isValue:T,isError:D,getOr:h,getOrThunk:function(t){return t()},getOrDie:function(){return _(String(n))()},or:h,orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return Rn(n)},mapError:function(t){return Rn(t(n))},each:st,bind:function(t){return Rn(n)},exists:T,forall:D,toOptional:vt.none}},Nn={value:In,error:Rn,fromOption:function(t,e){return t.fold(function(){return Rn(e)},In)}};function Pn(t,e,n){return t.stype===je.Error?e(t.serror):n(t.svalue)}function Vn(t){return{stype:je.Value,svalue:t}}function Hn(t){return{stype:je.Error,serror:t}}function Ln(t,e,n,o){return{tag:"field",key:t,newKey:e,presence:n,prop:o}}function zn(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}}function Un(u){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)Tt(i,r)&&(n[r]=u(n[r],i[r]))}return n}}function jn(){return{tag:"required",process:{}}}function Wn(t){return{tag:"defaultedThunk",process:t}}function Gn(t){return Wn(rt(t))}function Xn(){return{tag:"option",process:{}}}function Yn(t){return{tag:"mergeWithThunk",process:t}}function qn(t){return x(t)&&100<Ct(t).length?" removed due to size":JSON.stringify(t,null,2)}function Kn(t,e){return zo([{path:t,getErrorInfo:e}])}function Jn(n){return{extract:function(e,t){return jo(n(t),function(t){return Kn(e,rt(t))})},toString:rt("val")}}function $n(t,e,n,o){return o(tt(t,e).getOrThunk(function(){return n(t)}))}function Qn(e,n,o,r,i){function u(t){return i.extract(n.concat([r]),t)}function t(t){return t.fold(function(){return Lo(vt.none())},function(t){var e=i.extract(n.concat([r]),t);return Wo(e,vt.some)})}var a,c,s,l,f,d;switch(e.tag){case"required":return s=n,d=u,tt(l=o,f=r).fold(function(){return t=f,e=l,Kn(s,function(){return'Could not find valid *required* value for "'+t+'" in '+qn(e)});var t,e},d);case"defaultedThunk":return $n(o,r,e.process,u);case"option":return t(tt(o,r));case"defaultedOptionThunk":return c=e.process,t(tt(a=o,r).map(function(t){return!0===t?c(a):t}));case"mergeWithThunk":return $n(o,r,rt({}),function(t){return u(Yo(e.process(o),t))})}}function Zn(n){return{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}}}function to(t){var s=$o(t),l=I(t,function(n,t){return zn(t,function(t){var e;return Yo(n,((e={})[t]=!0,e))},rt(n))},{});return{extract:function(t,e){var n,o,r,i,u,a,c=F(w(e)?[]:Ct((r=k,i=o={},u=function(t,e){i[e]=t},a=st,J(e,function(t,e){(r(t,e)?u:a)(t,e)}),o)),function(t){return!et(l,t)});return 0===c.length?s.extract(t,e):(n=c,Kn(t,function(){return"There are unsupported fields: ["+n.join(", ")+"] specified"}))},toString:s.toString}}function eo(o){return{extract:function(n,t){var e=B(t,function(t,e){return o.extract(n.concat(["["+e+"]"]),t)});return Ko(e)},toString:function(){return"array("+o.toString()+")"}}}function no(u){return{extract:function(t,e){for(var n=[],o=0,r=u;o<r.length;o++){var i=r[o].extract(t,e);if(i.stype===je.Value)return i;n.push(i)}return Ko(n)},toString:function(){return"oneOf("+B(u,function(t){return t.toString()}).join(", ")+")"}}}function oo(n,o){return Jn(function(t){var e=typeof t;return n(t)?Lo(t):zo("Expected type: "+o+" but got: "+e)})}function ro(e,a){return{extract:function(i,u){return tt(u,e).fold(function(){return t=e,Kn(i,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return n=i,e=u,tt(o=a,r=t).fold(function(){return t=o,e=r,Kn(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+qn(t)});var t,e},function(t){return t.extract(n.concat(["branch: "+r]),e)});var n,e,o,r})},toString:function(){return"chooseOn("+e+"). Possible values: "+Ct(a)}}}function io(e){return Jn(function(t){return e(t).fold(zo,Lo)})}function uo(e,t){return r=function(t){return e(t).fold(Hn,Vn)},i=t,{extract:function(n,o){var t=Ct(o),e=eo(Jn(r)).extract(n,t);return Uo(e,function(t){var e=B(t,function(t){return Ln(t,t,jn(),i)});return $o(e).extract(n,o)})},toString:function(){return"setOf("+i.toString()+")"}};var r,i}function ao(t,e,n){return Ho((r=e.extract([t],o=n),Go(r,function(t){return{input:o,errors:t}})));var o,r}function co(t){return t.fold(function(t){throw new Error(ur(t))},h)}function so(t,e,n){return co(ao(t,e,n))}function lo(t,e){return ro(t,dt(e,$o))}function fo(e){return io(function(t){return wt(e,t)?Nn.value(t):Nn.error('Unsupported value: "'+t+'", choose one of "'+e.join(", ")+'".')})}function mo(t){return ar(t,t,jn(),Zo())}function go(t,e){return ar(t,t,jn(),e)}function po(t){return go(t,er)}function ho(t,e){return ar(t,t,jn(),fo(e))}function vo(t){return go(t,or)}function bo(t,e){return ar(t,t,jn(),$o(e))}function yo(t,e){return ar(t,t,jn(),Qo(e))}function xo(t,e){return ar(t,t,jn(),eo(e))}function wo(t){return ar(t,t,Xn(),Zo())}function So(t,e){return ar(t,t,Xn(),e)}function ko(t){return So(t,tr)}function Co(t){return So(t,er)}function Oo(t){return So(t,or)}function _o(t,e){return So(t,eo(e))}function To(t,e){return So(t,$o(e))}function Eo(t,e){return ar(t,t,Gn(e),Zo())}function Do(t,e,n){return ar(t,t,Gn(e),n)}function Ao(t,e){return Do(t,e,tr)}function Bo(t,e){return Do(t,e,er)}function Mo(t,e,n){return Do(t,e,fo(n))}function Fo(t,e){return Do(t,e,nr)}function Io(t,e){return Do(t,e,or)}function Ro(t,e,n){return Do(t,e,eo(n))}function No(t,e,n){return Do(t,e,$o(n))}function Po(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(We=je={})[We.Error=0]="Error",We[We.Value=1]="Value";function Vo(u){if(!c(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return St(u,function(t,o){var e=Ct(t);if(1!==e.length)throw new Error("one and only one name per case");var r=e[0],i=t[r];if(void 0!==n[r])throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!c(i))throw new Error("case arguments must be an array");a.push(r),n[r]=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+e);return{fold:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+t.length);return t[o].apply(null,n)},match:function(t){var e=Ct(t);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!L(a,function(t){return wt(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,n)},log:function(t){console.log(t,{constructors:a,constructor:r,params:n})}}}}),n}var Ho=function(t){return Pn(t,Nn.error,Nn.value)},Lo=Vn,zo=Hn,Uo=function(t,e){return t.stype===je.Value?e(t.svalue):t},jo=function(t,e){return t.stype===je.Error?e(t.serror):t},Wo=function(t,e){return t.stype===je.Value?{stype:je.Value,svalue:e(t.svalue)}:t},Go=function(t,e){return t.stype===je.Error?{stype:je.Error,serror:e(t.serror)}:t},Xo=Pn,Yo=Un(function(t,e){return x(t)&&x(e)?Yo(t,e):e}),qo=Un(function(t,e){return e}),Ko=function(t){var e,n,o=(e=[],n=[],St(t,function(t){Pn(t,function(t){return n.push(t)},function(t){return e.push(t)})}),{values:e,errors:n});return 0<o.errors.length?r(zo,ft)(o.errors):Lo(o.values)},Jo=Jn(Lo),$o=function(n){return{extract:function(i,u){for(var a={},c=[],t=0,e=n;t<e.length;t++)zn(e[t],function(t,e,n,o){var r=Qn(n,i,u,t,o);Xo(r,function(t){c.push.apply(c,t)},function(t){a[e]=t})},function(t,e){a[t]=e(u)});return 0<c.length?zo(c):Lo(a)},toString:function(){return"obj{\n"+B(n,function(t){return zn(t,function(t,e,n,o){return t+" -> "+o.toString()},function(t,e){return"state("+t+")"})}).join("\n")+"}"}}},Qo=r(eo,$o),Zo=rt(Jo),tr=oo(u,"number"),er=oo(y,"string"),nr=oo(w,"boolean"),or=oo(S,"function"),rr=function(e){if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every(function(t){return rr(e[t])});default:return!1}},ir=Jn(function(t){return rr(t)?Lo(t):zo("Expected value to be acceptable for sending via postMessage")}),ur=function(t){return"Errors: \n"+B(10<(e=t.errors).length?e.slice(0,10).concat([{path:[],getErrorInfo:rt("... (only showing first ten failures)")}]):e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n")+"\n\nInput object: "+qn(t.input);var e},ar=Ln,cr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}};function sr(t,e){return(n={})[t]=e,n;var n}function lr(t){return e={},St(t,function(t){e[t.key]=t.value}),e;var e}function fr(t){return S(t)?t:T}function dr(t,e,n){for(var o=t.dom,r=fr(n);o.parentNode;){var o=o.parentNode,i=Mt.fromDom(o),u=e(i);if(u.isSome())return u;if(r(i))break}return vt.none()}function mr(t,e,n){var o=e(t),r=fr(n);return o.orThunk(function(){return r(t)?vt.none():dr(t,e,r)})}function gr(t,e){return zt(t.element,e.event.target)}function pr(t){if(!et(t,"can")&&!et(t,"abort")&&!et(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return lt(lt({},ai),t)}function hr(t){return rt("alloy."+t)}function vr(t,e){eu(t,t.element,e,{})}function br(t,e,n){eu(t,t.element,e,n)}function yr(t){vr(t,Ii())}function xr(t,e,n){eu(t,e,n,{})}function wr(t,e,n,o){t.getSystem().triggerEvent(n,e,o.event)}function Sr(t,e){return{key:t,value:pr({abort:e})}}function kr(t){return{key:t,value:pr({run:function(t,e){e.event.prevent()}})}}function Cr(t,e){return{key:t,value:pr({run:e})}}function Or(t,n,o){return{key:t,value:pr({run:function(t,e){n.apply(void 0,[t,e].concat(o))}})}}function _r(t){return function(n){return{key:t,value:pr({run:function(t,e){gr(t,e)&&n(t,e)}})}}}function Tr(t,e,n){var o,r=e.partUids[n];return Cr(o=t,function(t,e){t.getSystem().getByUid(r).each(function(t){wr(t,t.element,o,e)})})}function Er(t,r){return Cr(t,function(e,t){var n=t.event,o=e.getSystem().getByDom(n.target).getOrThunk(function(){return mr(n.target,function(t){return e.getSystem().getByDom(t).toOptional()},T).getOr(e)});r(e,o,t)})}function Dr(t){return Cr(t,function(t,e){e.cut()})}function Ar(t,e){return _r(t)(e)}function Br(t){return t.dom.innerHTML}function Mr(t,e){var n,o,r=jt(t).dom,i=Mt.fromDom(r.createDocumentFragment());Be(i,(n=e,(o=(r||document).createElement("div")).innerHTML=n,Kt(Mt.fromDom(o)))),Me(t),Tn(t,i)}function Fr(t){if(Zt(t))return"#shadow-root";var e=Mt.fromDom(t.dom.cloneNode(!1)),n=Mt.fromTag("div"),o=Mt.fromDom(e.dom.cloneNode(!0));return Tn(n,o),Br(n)}function Ir(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++su+String(e)}function Rr(t){var e=Ge(t)?t.dom[mu]:null;return vt.from(e)}function Nr(e){function n(t){return"The component must be in a context to execute: "+t+(e?"\n"+Fr(e().element)+" is not in context.":"")}function t(t){return function(){throw new Error(n(t))}}function o(t){return function(){console.warn(n(t))}}return{debugInfo:rt("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),isConnected:T}}function Pr(t,e){var n=t.toString(),o=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:bu(i)}},t}function Vr(t){return sr(yu,t)}function Hr(o){return t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o.apply(void 0,V([t.getApis(),t],e,!1))},n=(e=o.toString()).indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,n-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:bu(i.slice(1))}},t;var t,e,n,r,i}function Lr(t,r){var i={};return J(t,function(t,o){J(t,function(t,e){var n=tt(i,e).getOr([]);i[e]=n.concat([r(o,t)])})}),i}function zr(t){return{classes:E(t.classes)?[]:t.classes,attributes:E(t.attributes)?{}:t.attributes,styles:E(t.styles)?{}:t.styles}}function Ur(t){return t.cHandler}function jr(t,e){return{name:t,handler:e}}function Wr(t,e,n){var o=e[n];return o?function(u,t,a){try{var e=G(t,function(t,e){var n=t.name,o=e.name,r=a.indexOf(n),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+n+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r<i?-1:i<r?1:0});return Nn.value(e)}catch(t){return Nn.error([t])}}("Event: "+n,t,o).map(function(t){var n,e,o,r,i=B(t,function(t){return t.handler});return{can:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return R(e,function(t,e){return t&&e.can.apply(void 0,n)},!0)},abort:(o=e=n=i,r=function(t){return t.abort},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return R(o,function(t,e){return t||r(e).apply(void 0,n)},!1)}),run:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];St(n,function(t){t.run.apply(void 0,e)})}}}):Nn.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(B(t,function(t){return t.name}),null,2)])}function Gr(t,e){var n=ie(t,e);return void 0===n||""===n?[]:n.split(" ")}function Xr(t){return void 0!==t.dom.classList}function Yr(t,e){var n,o,r;Xr(t)?t.dom.classList.add(e):(o=e,r=Gr(n=t,"class").concat([o]),oe(n,"class",r.join(" ")))}function qr(t,e){var n,o,r,i;Xr(t)?t.dom.classList.remove(e):(r=e,0<(i=F(Gr(o=t,"class"),function(t){return t!==r})).length?oe(o,"class",i.join(" ")):ce(o,"class")),0===(Xr(n=t)?n.dom.classList:Gr(n,"class")).length&&ce(n,"class")}function Kr(t,e){return Xr(t)&&t.dom.classList.contains(e)}function Jr(e,t){St(t,function(t){Yr(e,t)})}function $r(e,t){St(t,function(t){qr(e,t)})}function Qr(t){return t.dom.value}function Zr(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e}function ti(t){var n,e,o,r,i=(n=tt(t,"behaviours").getOr({}),H(Ct(n),function(t){var e=n[t];return k(e)?[e.me]:[]}));return e=t,r=B(o=i,function(t){return To(t.name(),[mo("config"),Eo("state",xu)])}),{list:o,data:dt(ao("component.behaviours",$o(r),e.behaviours).fold(function(t){throw new Error(ur(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},h),function(t){return rt(t.map(function(t){return{config:t.config,state:t.state.init(t.config)}}))})}}function ei(t,e,n){var o,r,i=lt(lt({},(o=t).dom),{uid:o.uid,domChildren:B(o.components,function(t){return t.element})}),u=t.domModification.fold(function(){return zr({})},zr),a=0<e.length?function(e,t,n,o){var r=lt({},t);function i(t){return I(t,function(t,e){return lt(lt({},e.modification),t)},{})}St(n,function(t){r[t.name()]=t.exhibit(e,o)});var u=Lr(r,function(t,e){return{name:t,modification:e}});return zr({classes:I(u.classes,function(t,e){return e.modification.concat(t)},[]),attributes:i(u.attributes),styles:i(u.styles)})}(n,{"alloy.base.modification":u},e,i):u;return lt(lt({},r=i),{attributes:lt(lt({},r.attributes),a.attributes),styles:lt(lt({},r.styles),a.styles),classes:r.classes.concat(a.classes)})}function ni(t,e,n){var o,r,i,u,a,c={"alloy.base.behaviour":t.events},s=t.eventOrder;return r=n,i=e,o=Lr(lt(lt({},c),(u=r,a={},St(i,function(t){a[t.name()]=t.handlers(u)}),a)),jr),Su(o,s).getOrDie()}function oi(t){var n,e,o,r,i,u,a,c,s,l,f=hu(t),d=f.events,m=A(f,["events"]),g=B(tt(m,"components").getOr([]),Tu),p=lt(lt({},m),{events:lt(lt({},cu),d),components:g});return Nn.value((e=Po(vu),o=co(ao("custom.definition",Cu,n=p)),r=ti(n),i=r.list,u=r.data,a=function(t){var e=Mt.fromTag(t.tag);re(e,t.attributes),Jr(e,t.classes),de(e,t.styles),t.innerHtml.each(function(t){return Mr(e,t)});var n=t.domChildren;return Be(e,n),t.value.each(function(t){Zr(e,t)}),t.uid,gu(e,t.uid),e}(ei(o,i,u)),c=ni(o,i,u),s=Po(o.components),l={uid:n.uid,getSystem:e.get,config:function(t){var e=u;return(S(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(n,null,2))})()},hasConfigured:function(t){return S(u[t.name()])},spec:n,readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){e.set(t)},disconnect:function(){e.set(Nr(h))},element:a,syncComponents:function(){var t=H(Kt(a),function(t){return e.get().getByDom(t).fold(function(){return[]},W)});s.set(t)},components:s.get,events:c}));function h(){return l}}function ri(t){var e=Mt.fromText(t);return Ou({element:e})}Vo([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var ii,ui,ai={can:D,abort:T,run:st},ci=rt,si=ci("touchstart"),li=ci("touchmove"),fi=ci("touchend"),di=ci("touchcancel"),mi=ci("mousedown"),gi=ci("mousemove"),pi=ci("mouseout"),hi=ci("mouseup"),vi=ci("mouseover"),bi=ci("focusin"),yi=ci("focusout"),xi=ci("keydown"),wi=ci("keyup"),Si=ci("input"),ki=ci("change"),Ci=ci("click"),Oi=ci("transitioncancel"),_i=ci("transitionend"),Ti=ci("transitionstart"),Ei=ci("selectstart"),Di={tap:hr("tap")},Ai=hr("focus"),Bi=hr("blur.post"),Mi=hr("paste.post"),Fi=hr("receive"),Ii=hr("execute"),Ri=hr("focus.item"),Ni=Di.tap,Pi=hr("longpress"),Vi=hr("sandbox.close"),Hi=hr("typeahead.cancel"),Li=hr("system.init"),zi=hr("system.touchmove"),Ui=hr("system.touchend"),ji=hr("system.scroll"),Wi=hr("system.resize"),Gi=hr("system.attached"),Xi=hr("system.detached"),Yi=hr("system.dismissRequested"),qi=hr("system.repositionRequested"),Ki=hr("focusmanager.shifted"),Ji=hr("slotcontainer.visibility"),$i=hr("change.tab"),Qi=hr("dismiss.tab"),Zi=hr("highlight"),tu=hr("dehighlight"),eu=function(t,e,n,o){var r=lt({target:e},o);t.getSystem().triggerEvent(n,e,r)},nu=lr,ou=_r(Gi()),ru=_r(Xi()),iu=_r(Li()),uu=(ii=Ii(),function(t){return Cr(ii,t)}),au=nu([{key:Ai(),value:pr({can:function(t,e){var n,o=e.event,r=o.originator,i=o.target;return!(zt(n=r,t.element)&&!zt(n,i)&&(console.warn(Ai()+" did not get interpreted by the desired target. \nOriginator: "+Fr(r)+"\nTarget: "+Fr(i)+"\nCheck the "+Ai()+" event handlers"),1))}})}]),cu=Object.freeze({__proto__:null,events:au}),su=0,lu=rt("alloy-id-"),fu=rt("data-alloy-id"),du=lu(),mu=fu(),gu=function(t,e){Object.defineProperty(t.dom,mu,{value:e,writable:!0})},pu=Ir,hu=h,vu=Nr(),bu=function(t){return B(t,function(t){return At(t,"/*")?t.substring(0,t.length-"/*".length):t})},yu=Ir("alloy-premade"),xu={init:function(){return wu({readState:rt("No State required")})}},wu=function(t){return t},Su=function(t,a){var e,n,o,r,i,u,c=$(t,function(r,u){return(1===r.length?Nn.value(r[0].handler):Wr(r,a,u)).map(function(t){var e,i,n=(i=S(e=t)?{can:D,abort:T,run:e}:e,function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=[t,e].concat(n);i.abort.apply(void 0,r)?e.stop():i.can.apply(void 0,r)&&i.run.apply(void 0,r)}),o=1<r.length?F(a[u],function(e){return d(r,function(t){return t.name===e})}).join(" > "):r[0].name;return sr(u,{handler:n,purpose:o})})});return e={},n=[],o=[],St(c,function(t){t.fold(function(t){n.push(t)},function(t){o.push(t)})}),0<(u={errors:n,values:o}).errors.length?Nn.error(ft(u.errors)):(i=e,0===(r=u.values).length?Nn.value(i):Nn.value(Yo(i,qo.apply(void 0,r))))},ku="alloy.base.behaviour",Cu=$o([ar("dom","dom",jn(),$o([mo("tag"),Eo("styles",{}),Eo("classes",[]),Eo("attributes",{}),wo("value"),wo("innerHtml")])),mo("components"),mo("uid"),Eo("events",{}),Eo("apis",{}),ar("eventOrder","eventOrder",((ui={})[Ii()]=["disabling",ku,"toggling","typeaheadevents"],ui[Ai()]=[ku,"focusing","keying"],ui[Li()]=[ku,"disabling","toggling","representing"],ui[Si()]=[ku,"representing","streaming","invalidating"],ui[Xi()]=[ku,"representing","item-events","tooltipping"],ui[mi()]=["focusing",ku,"item-type-events"],ui[si()]=["focusing",ku,"item-type-events"],ui[vi()]=["item-type-events","tooltipping"],ui[Fi()]=["receiving","reflecting","tooltipping"],Yn(rt(ui))),Zo()),wo("domModification")]),Ou=function(t){var e=so("external.component",to([mo("element"),wo("uid")]),t),n=Po(Nr()),o=e.uid.getOrThunk(function(){return pu("external")});gu(e.element,o);var r={uid:o,getSystem:n.get,config:vt.none,hasConfigured:T,connect:function(t){n.set(t)},disconnect:function(){n.set(Nr(function(){return r}))},getApis:function(){return{}},element:e.element,spec:t,readState:rt("No state"),syncComponents:st,components:rt([]),events:{}};return Vr(r)},_u=pu,Tu=function(t){return tt(t,yu).getOrThunk(function(){return oi(Tt(t,"uid")?t:lt({uid:_u("")},t)).getOrDie()})},Eu=Vr;function Du(t,e,n,o,r){return t(n,o)?vt.some(n):S(r)&&r(n)?vt.none():e(n,o,r)}function Au(t,e,n){for(var o=t.dom,r=S(n)?n:T;o.parentNode;){var o=o.parentNode,i=Mt.fromDom(o);if(e(i))return vt.some(i);if(r(i))break}return vt.none()}function Bu(t,e,n){return Du(function(t,e){return e(t)},Au,t,e,n)}function Mu(t,e,n){return Bu(t,e,n).isSome()}function Fu(t,e,n){return Au(t,function(t){return Ht(t,e)},n)}function Iu(t,e){return n=e,Lt(o=void 0===t?document:t.dom)?vt.none():vt.from(o.querySelector(n)).map(Mt.fromDom);var n,o}function Ru(t,e,n){return Du(Ht,Fu,t,e,n)}function Nu(){var e=Ir("aria-owns");return{id:e,link:function(t){oe(t,"aria-owns",e)},unlink:function(t){ce(t,"aria-owns")}}}var Pu,Vu,Hu=function(e,t){return Mu(t,function(t){return zt(t,e.element)},T)||(n=e,Bu(t,function(t){if(!Ge(t))return!1;var e=ie(t,"id");return void 0!==e&&-1<e.indexOf("aria-owns")}).bind(function(t){var e=ie(t,"id");return Iu(gn(t),'[aria-owns="'+e+'"]')}).exists(function(t){return Hu(n,t)}));var n},Lu="unknown";function zu(e,t,n){var o,r,i,u;switch(tt(Uu.get(),e).orThunk(function(){return K(Ct(Uu.get()),function(t){return-1<e.indexOf(t)?vt.some(Uu.get()[t]):vt.none()})}).getOr(Pu.NORMAL)){case Pu.NORMAL:return n(Wu());case Pu.LOGGING:var a=(o=e,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,e,n){i.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){i.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){i.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){i.push({outcome:"response",purpose:n,target:e})},write:function(){var t=(new Date).getTime();wt(["mousemove","mouseover","mouseout",Li()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:B(i,function(t){return wt(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Fr(t.target)+")":t.outcome})})}}),c=n(a);return a.write(),c;case Pu.STOP:return!0}}(Vu=Pu=Pu||{})[Vu.STOP=0]="STOP",Vu[Vu.NORMAL=1]="NORMAL",Vu[Vu.LOGGING=2]="LOGGING";var Uu=Po({}),ju=["alloy/data/Fields","alloy/debugging/Debugging"],Wu=rt({logEventCut:st,logEventStopped:st,logNoParent:st,logEventNoHandlers:st,logEventResponse:st,write:st}),Gu=rt([mo("menu"),mo("selectedMenu")]),Xu=rt([mo("item"),mo("selectedItem")]);function Yu(){return bo("markers",[mo("backgroundMenu")].concat(Gu()).concat(Xu()))}function qu(t){return bo("markers",B(t,mo))}function Ku(t,e,n){return void 0!==(o=new Error).stack&&N(o.stack.split("\n"),function(e){return 0<e.indexOf("alloy")&&!d(ju,function(t){return-1<e.indexOf(t)})}).getOr(Lu),ar(e,e,n,io(function(n){return Nn.value(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(void 0,t)})}));var o}function Ju(t){return Ku(0,t,Gn(st))}function $u(t){return Ku(0,t,Gn(vt.none))}function Qu(t){return Ku(0,t,jn())}function Zu(t){return Ku(0,t,jn())}function ta(t,e){return cr(t,rt(e))}function ea(t){return cr(t,h)}function na(t,e,n,o,r,i,u,a){return{x:t,y:e,bubble:n,direction:o,placement:r,restriction:i,label:u+"-"+r,alwaysFit:a=void 0!==a&&a}}function oa(t,e,n,o){var r=t+e;return o<r?n:r<n?o:r}function ra(n,e){return j(["left","right","top","bottom"],function(t){return tt(e,t).map(function(e){return function(t){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(n)})})}function ia(t,e){return t.x+t.width/2-e.width/2}function ua(t,e){return t.x+t.width-e.width}function aa(t,e){return t.y-e.height}function ca(t){return t.y+t.height}function sa(t,e){return t.y+t.height/2-e.height/2}function la(t,e,n){return na(t.x+t.width,sa(t,e),n.east(),Ua(),"east",ra(t,{left:0}),Ga)}function fa(t,e,n){return na(t.x-e.width,sa(t,e),n.west(),ja(),"west",ra(t,{right:1}),Ga)}function da(){return[Xa,Ya,qa,Ka,$a,Ja,la,fa]}function ma(){return[Ya,Xa,Ka,qa,$a,Ja,la,fa]}function ga(){return[qa,Ka,Xa,Ya,Ja,$a]}function pa(){return[Ka,qa,Ya,Xa,Ja,$a]}function ha(){return[Xa,Ya,qa,Ka,$a,Ja]}function va(){return[Ya,Xa,Ka,qa,$a,Ja]}function ba(n,o,r){return iu(function(t,e){r(t,n,o)})}function ya(t){return{key:t,value:void 0}}function xa(t){var e,n,o,r,i,u,a,c,s=so("Creating behaviour: "+t.name,nc,t);return e=s.fields,n=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=to(e),c=To(n,[So("config",to(e))]),tc(a,c,n,o,r,i,u)}function wa(t){var e,n=so("Creating behaviour: "+t.name,oc,t),o=lo(n.branchKey,n.branches),r=n.name,i=n.active,u=n.apis,a=n.extra,c=n.state,s=To(r,[So("config",e=o)]);return tc(e,s,r,i,u,a,c)}function Sa(){return Mt.fromDom(document)}function ka(t){return t.dom.focus()}function Ca(t){var e=gn(t).dom;return t.dom===e.activeElement}function Oa(t){return void 0===t&&(t=Sa()),vt.from(t.dom.activeElement).map(Mt.fromDom)}function _a(e){return Oa(gn(e)).filter(function(t){return e.dom.contains(t.dom)})}function Ta(t,n){var o=gn(n),e=Oa(o).bind(function(e){function t(t){return zt(e,t)}var r,i;return t(n)?vt.some(n):(r=t,(i=function(t){for(var e=0;e<t.childNodes.length;e++){var n=Mt.fromDom(t.childNodes[e]);if(r(n))return vt.some(n);var o=i(t.childNodes[e]);if(o.isSome())return o}return vt.none()})(n.dom))}),r=t(n);return e.each(function(e){Oa(o).filter(function(t){return zt(t,e)}).fold(function(){ka(e)},st)}),r}function Ea(t,e,n,o,r){function i(t){return t+"px"}return{position:t,left:e.map(i),top:n.map(i),right:o.map(i),bottom:r.map(i)}}function Da(t,e){var n;me(t,lt(lt({},n=e),{position:vt.some(n.position)}))}function Aa(t,e,n,o,r,i){var u=e.rect,a=u.x-n,c=u.y-o,s=r-(a+u.width),l=i-(c+u.height),f=vt.some(a),d=vt.some(c),m=vt.some(s),g=vt.some(l),p=vt.none();return e.direction.fold(function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,p,p,m,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)})}function Ba(t,r){return t.fold(function(){var t=r.rect;return Ea("absolute",vt.some(t.x),vt.some(t.y),vt.none(),vt.none())},function(t,e,n,o){return Aa("absolute",r,t,e,n,o)},function(t,e,n,o){return Aa("fixed",r,t,e,n,o)})}function Ma(t,e){var n=C(Ve,e),o=t.fold(n,n,function(){var t=Ie();return Ve(e).translate(-t.left,-t.top)}),r=Oe(e),i=we(e);return Bn(o.left,o.top,r,i)}rt($o(Xu().concat(Gu())));var Fa=rt($o(Xu())),Ia=rt(bo("initSize",[mo("numColumns"),mo("numRows")])),Ra=Vo([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Na=Ra.southeast,Pa=Ra.southwest,Va=Ra.northeast,Ha=Ra.northwest,La=Ra.south,za=Ra.north,Ua=Ra.east,ja=Ra.west,Wa=function(t,e,n){return Math.min(Math.max(t,e),n)},Ga="layout",Xa=function(t,e,n){return na(t.x,ca(t),n.southeast(),Na(),"southeast",ra(t,{left:1,top:3}),Ga)},Ya=function(t,e,n){return na(ua(t,e),ca(t),n.southwest(),Pa(),"southwest",ra(t,{right:0,top:3}),Ga)},qa=function(t,e,n){return na(t.x,aa(t,e),n.northeast(),Va(),"northeast",ra(t,{left:1,bottom:2}),Ga)},Ka=function(t,e,n){return na(ua(t,e),aa(t,e),n.northwest(),Ha(),"northwest",ra(t,{right:0,bottom:2}),Ga)},Ja=function(t,e,n){return na(ia(t,e),aa(t,e),n.north(),za(),"north",ra(t,{bottom:2}),Ga)},$a=function(t,e,n){return na(ia(t,e),ca(t),n.south(),La(),"south",ra(t,{top:3}),Ga)},Qa=Object.freeze({__proto__:null,events:function(a){return nu([Cr(Fi(),function(r,t){var e,i=a.channels,n=Ct(i),u=t,o=(e=u).universal?n:F(n,function(t){return wt(e.channels,t)});St(o,function(t){var e=i[t],n=e.schema,o=so("channel["+t+"] data\nReceiver: "+Fr(r.element),n,u.data);e.onReceive(r,o)})})])}}),Za=[go("channels",uo(Nn.value,to([Qu("onReceive"),Eo("schema",Zo())])))],tc=function(n,t,f,e,o,r,i){function u(t){return et(t,f)?t[f]():vt.none()}var a=dt(o,function(t,e){return r=f,n=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];var o=[n].concat(t);return n.config({name:rt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var e=Array.prototype.slice.call(o,1);return i.apply(void 0,[n,t.config,t.state].concat(e))})},o=u=e,a=(i=t).toString(),c=a.indexOf(")")+1,s=a.indexOf("("),l=a.substring(s+1,c-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:o,parameters:bu(l.slice(0,1).concat(l.slice(3)))}},n;var r,i,u,n,o,a,c,s,l}),c=dt(r,Pr),s=lt(lt(lt({},c),a),{revoke:C(ya,f),config:function(t){var e=so(f+"-config",n,t);return{key:f,value:{config:e,me:s,configAsRaw:Rt(function(){return so(f+"-config",n,t)}),initialConfig:t,state:i}}},schema:rt(t),exhibit:function(t,n){return Et(u(t),tt(e,"exhibit"),function(t,e){return e(n,t.config,t.state)}).getOrThunk(function(){return zr({})})},name:rt(f),handlers:function(t){return u(t).map(function(t){return tt(e,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},ec=lr,nc=to([mo("fields"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),oc=to([mo("branchKey"),mo("branches"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),rc=rt(void 0),ic=xa({fields:Za,name:"receiving",active:Qa}),uc=Object.freeze({__proto__:null,exhibit:function(t,e){return zr({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),ac=Vo([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),cc=function(t,e,n){var o=kn(e,n);return t.fold(rt(o),rt(o),function(){var t=Ie();return o.translate(-t.left,-t.top)})};function sc(t){return ue(t,Dc)}function lc(t,e,n,o){var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T,E,D,A,B,M,F,I,R,N,P,V,H,L,z,U,j=t.bubble,W=j.offset,G=(N=o,P=t.restriction,V=W,H=ot("left",N.x),L=ot("top",N.y),z=ot("right",N.right),U=ot("bottom",N.bottom),Bn(H,L,z-H,U-L)),X=t.x+W.left,Y=t.y+W.top,q=Bn(X,Y,e,n),K=(r=G.x,i=G.y,u=G.right,a=G.bottom,c=q.x,s=q.y,l=q.right,f=q.bottom,d=q.width,m=q.height,{originInBounds:r<=c&&c<=u&&i<=s&&s<=a,sizeInBounds:l<=u&&r<=l&&f<=a&&i<=f,visibleW:Math.min(d,r<=c?u-c:l-r),visibleH:Math.min(m,i<=s?a-s:f-i)}),J=K.visibleW,$=K.visibleH,Q=K.originInBounds&&K.sizeInBounds,Z=Q?q:(g=G.x,p=G.y,h=G.right,v=G.bottom,b=q.x,y=q.y,x=q.width,w=q.height,S=Math.max(g,h-x),k=Math.max(p,v-w),C=Wa(b,g,S),O=Wa(y,p,k),_=Math.min(C+x,h)-C,T=Math.min(O+w,v)-O,Bn(C,O,_,T)),tt=0<Z.width&&0<Z.height,et=(E=t.direction,B=rt((D=Z).bottom-(A=o).y),M=rt(A.bottom-D.y),F=E.fold(M,M,B,B,M,B,M,M),I=rt(D.right-A.x),R=rt(A.right-D.x),{maxWidth:E.fold(R,I,R,I,R,R,R,I),maxHeight:F}),nt={rect:Z,maxHeight:et.maxHeight,maxWidth:et.maxWidth,direction:t.direction,placement:t.placement,classes:{on:j.classesOn,off:j.classesOff},layout:t.label,testY:Y};function ot(r,i){return P[r].map(function(t){var e="top"===r||"bottom"===r,n=e?V.top:V.left,o=("left"===r||"top"===r?Math.max:Math.min)(t,i)+n;return e?Wa(o,N.y,N.bottom):Wa(o,N.x,N.right)}).getOr(i)}return Q||t.alwaysFit?Ac.fit(nt):Ac.nofit(nt,J,$,tt)}function fc(t){function e(){return n.get().each(t)}var n=Po(vt.none());return{clear:function(){e(),n.set(vt.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){e(),n.set(vt.some(t))}}}function dc(){return fc(function(t){return t.destroy()})}function mc(){return fc(function(t){return t.unbind()})}function gc(){var e=fc(st);return lt(lt({},e),{on:function(t){return e.get().each(t)}})}function pc(t,e,n){return Te(t,e,Bc,n,!1)}function hc(t,e,n){return Te(t,e,Bc,n,!0)}function vc(o,n){function r(t){var e,n=null!==(e=t.raw.pseudoElement)&&void 0!==e?e:"";return zt(t.target,o)&&!at(n)&&wt(Fc,t.raw.propertyName)}function t(t){var e;(g(t)||r(t))&&(a.clear(),c.clear(),!g(e=null==t?void 0:t.raw.type)&&e!==_i()||(clearTimeout(i),ce(o,Ic),$r(o,n.classes)))}function e(){a.set(pc(o,_i(),t)),c.set(pc(o,Oi(),t))}var i,u,a=mc(),c=mc();"ontransitionstart"in o.dom?u=pc(o,Ti(),function(t){r(t)&&(u.unbind(),e())}):e();var s,l,f=(s=o,l=d("transition-delay"),R(d("transition-duration"),function(t,e,n){var o=m(l[n])+m(e);return Math.max(t,o)},0));function d(t){var e=ge(s,t);return F(y(e)?e.split(/\s*,\s*/):[],at)}function m(t){if(y(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return At(t,"ms")?e:1e3*e}return 0}requestAnimationFrame(function(){i=setTimeout(t,f+17),oe(o,Ic,i)})}function bc(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,g,p=(u=o,a=r,i.exists(function(t){var e=u.mode;return"all"===e||t[e]!==a[e]}));function h(t){return parseFloat(t).toFixed(3)}p||(g=t,L(o.classes,function(t){return Kr(g,t)}))?(fe(t,"position",n.position),c=Ma(e,t),s=Ba(e,lt(lt({},r),{rect:c})),l=j(Fc,function(t){return s[t]}),m=n,Q(l,function(t,e){var n,o,r,i=m[e].map(h),u=t.map(h);return!Et(n=i,o=u,r=void 0===r?v:r).getOr(n.isNone()&&o.isNone())}).isSome()&&(me(t,l),p&&(Jr(f=t,(d=o).classes),ue(f,Ic).each(function(t){clearTimeout(parseInt(t,10)),ce(f,Ic)}),vc(f,d)),be(t))):$r(t,o.classes)}function yc(t,e,n,o){ve(e,"max-height"),ve(e,"max-width");var r,s,i,l,f,d,m,g,p,u={width:Oe(r=e),height:we(r)};return s=e,i=o.preference,l=t,f=u,d=n,m=o.bounds,g=f.width,p=f.height,R(i,function(t,e){var n=C(a,e);return t.fold(rt(t),n)},Ac.nofit({rect:l,maxHeight:f.height,maxWidth:f.width,direction:Na(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:l.y},-1,-1,!1)).fold(h,h);function a(t,r,i,u,a){var c=lc(t(l,f,d,s,m),g,p,m);return c.fold(rt(c),function(t,e,n,o){return(a===o?u<n||i<e:!a&&o)?c:Ac.nofit(r,i,u,a)})}}function xc(t,e){var n=t,o=Math.floor(e);fe(n,"max-height",wn.max(n,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"])+"px")}function wc(t,e,n){return void 0===t[e]?n:t[e]}function Sc(t,e,n,o){function r(t){return tt(n,t).getOr([])}function i(t,e,n){var o=U(Vc,n);return{offset:kn(t,e),classesOn:H(n,r),classesOff:H(o,r)}}var u=t*(o=void 0===o?1:o),a=e*o;return{southeast:function(){return i(-t,e,["top","alignLeft"])},southwest:function(){return i(t,e,["top","alignRight"])},south:function(){return i(-t/2,e,["top","alignCentre"])},northeast:function(){return i(-t,-e,["bottom","alignLeft"])},northwest:function(){return i(t,-e,["bottom","alignRight"])},north:function(){return i(-t/2,-e,["bottom","alignCentre"])},east:function(){return i(t,-e/2,["valignCentre","left"])},west:function(){return i(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return i(u,a,["top","alignLeft","inset"])},insetNorthwest:function(){return i(-u,a,["top","alignRight","inset"])},insetNorth:function(){return i(-u/2,a,["top","alignCentre","inset"])},insetSoutheast:function(){return i(u,-a,["bottom","alignLeft","inset"])},insetSouthwest:function(){return i(-u,-a,["bottom","alignRight","inset"])},insetSouth:function(){return i(-u/2,-a,["bottom","alignCentre","inset"])},insetEast:function(){return i(-u,-a/2,["valignCentre","right","inset"])},insetWest:function(){return i(u,-a/2,["valignCentre","left","inset"])}}}function kc(){return Sc(0,0,{})}function Cc(e,n){return function(t){return"rtl"===Lc(t)?n:e}}ac.none;var Oc,_c,Tc=ac.relative,Ec=ac.fixed,Dc="data-alloy-placement",Ac=Vo([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Bc=D,Mc=_e,Fc=["top","bottom","right","left"],Ic="data-alloy-transition-timer",Rc=rt(function(t,e){xc(t,e),de(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Nc=rt(function(t,e){xc(t,e)}),Pc=function(t,e,n,o){var r,i,u,a,c=yc(t,e,n,o),s=e,l=c,f=Ba((r=o).origin,l);return r.transition.each(function(t){bc(s,r.origin,f,t,l,r.lastPlacement)}),Da(s,f),a=c.placement,oe(e,Dc,a),$r(i=e,(u=c.classes).off),Jr(i,u.on),(0,o.maxHeightFunction)(e,c.maxHeight),(0,o.maxWidthFunction)(e,c.maxWidth),{layout:c.layout,placement:c.placement}},Vc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Hc=h,Lc=function(t){return"rtl"===ge(t,"direction")?"rtl":"ltr"};function zc(t){return Mu(t,function(t){return Ge(t)&&ie(t,"data-alloy-vertical-dir")===Oc.BottomToTop})}function Uc(){return To("layouts",[mo("onLtr"),mo("onRtl"),wo("onBottomLtr"),wo("onBottomRtl")])}function jc(e,t,n,o,r,i,u){var a=u.map(zc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(e)}),s=t.layouts.map(function(t){return t.onRtl(e)});return Cc(a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(e)})}).or(c).getOr(r):c.getOr(n),a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(e)})}).or(s).getOr(i):s.getOr(o))(e)}function Wc(t){return t.fold(h,function(t,e,n){return t.translate(-e,-n)})}function Gc(t){return t.fold(h,h)}function Xc(t){return R(t,function(t,e){return t.translate(e.left,e.top)},kn(0,0))}function Yc(t){return Xc(B(t,Gc))}function qc(t,e,n){var o,r,i=Ie(jt(t.element)),u=(o=t,r=Xt(n.root).dom,vt.from(r.frameElement).map(Mt.fromDom).filter(function(t){return zt(jt(t),jt(o.element))}).map(ke).getOr(i));return as(u,i.left,i.top)}function Kc(t,e,n,o){var r=us(kn(t,e));return vt.some({point:r,width:n,height:o})}function Jc(t,a,c,s,l){return t.map(function(t){var e=[a,t.point],n=s.fold(function(){return Yc(e)},function(){return Yc(e)},function(){return Xc(B(e,Wc))}),o={x:n.left,y:n.top,width:t.width,height:t.height},r=(c.showAbove?ga:ha)(),i=(c.showAbove?pa:va)(),u=jc(l,c,r,i,r,i,vt.none());return Hc({anchorBox:o,bubble:c.bubble.getOr(kc()),overrides:c.overrides,layouts:u,placer:vt.none()})})}function $c(t,e,n){var o,r=t.document.createRange(),i=r;return e.fold(function(t){i.setStartBefore(t.dom)},function(t,e){i.setStart(t.dom,e)},function(t){i.setStartAfter(t.dom)}),o=r,n.fold(function(t){o.setEndBefore(t.dom)},function(t,e){o.setEnd(t.dom,e)},function(t){o.setEndAfter(t.dom)}),r}function Qc(t,e,n,o,r){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(o.dom,r),i}function Zc(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}function ts(t,e,n){return e(Mt.fromDom(n.startContainer),n.startOffset,Mt.fromDom(n.endContainer),n.endOffset)}function es(i,t){return r=i,o=t.match({domRange:function(t){return{ltr:rt(t),rtl:vt.none}},relative:function(t,e){return{ltr:Rt(function(){return $c(r,t,e)}),rtl:Rt(function(){return vt.some($c(r,e,t))})}},exact:function(t,e,n,o){return{ltr:Rt(function(){return Qc(r,t,e,n,o)}),rtl:Rt(function(){return vt.some(Qc(r,n,o,t,e))})}}}),((n=(e=o).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return gs.rtl(Mt.fromDom(t.endContainer),t.endOffset,Mt.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return ts(0,gs.ltr,n)}):ts(0,gs.ltr,n)).match({ltr:function(t,e,n,o){var r=i.document.createRange();return r.setStart(t.dom,e),r.setEnd(n.dom,o),r},rtl:function(t,e,n,o){var r=i.document.createRange();return r.setStart(n.dom,o),r.setEnd(t.dom,e),r}});var r,e,n,o}(Oc=Oc||{}).TopToBottom="toptobottom",Oc.BottomToTop="bottomtotop";var ns="data-alloy-vertical-dir",os=[mo("hotspot"),wo("bubble"),Eo("overrides",{}),Uc(),ta("placement",function(t,e,n){var o=Ma(n,e.hotspot.element),r=jc(t.element,e,ha(),va(),ga(),pa(),vt.some(e.hotspot.element));return vt.some(Hc({anchorBox:o,bubble:e.bubble.getOr(kc()),overrides:e.overrides,layouts:r,placer:vt.none()}))})],rs=[mo("x"),mo("y"),Eo("height",0),Eo("width",0),Eo("bubble",kc()),Eo("overrides",{}),Uc(),ta("placement",function(t,e,n){var o=cc(n,e.x,e.y),r=Bn(o.left,o.top,e.width,e.height),i=jc(t.element,e,da(),ma(),da(),ma(),vt.none());return vt.some(Hc({anchorBox:r,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:vt.none()}))})],is=Vo([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),us=is.screen,as=is.absolute,cs=[mo("node"),mo("root"),wo("bubble"),Uc(),Eo("overrides",{}),Eo("showAbove",!1),ta("placement",function(r,i,u){var a=qc(r,0,i);return i.node.filter(vn).bind(function(t){var e=t.dom.getBoundingClientRect(),n=Kc(e.left,e.top,e.width,e.height),o=i.node.getOr(r.element);return Jc(n,a,i,u,o)})})],ss=function(t,e,n,o){return{start:t,soffset:e,finish:n,foffset:o}},ls=Vo([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),fs=(ls.before,ls.on,ls.after,function(t){return t.fold(h,h,h)}),ds=Vo([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ms={domRange:ds.domRange,relative:ds.relative,exact:ds.exact,exactFromRange:function(t){return ds.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){return Xt(t.match({domRange:function(t){return Mt.fromDom(t.startContainer)},relative:function(t,e){return fs(t)},exact:function(t,e,n,o){return t}}))},range:ss},gs=Vo([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function ps(t){return ef.getOption(t)}function hs(t){return ps(t).filter(function(t){return 0!==t.trim().length||-1<t.indexOf("\xa0")}).isSome()||wt(nf,Ft(t))}function vs(t,e){return Lt(n=void 0===t?document:t.dom)?[]:B(n.querySelectorAll(e),Mt.fromDom);var n}function bs(t){if(0<t.rangeCount){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return vt.some(ss(Mt.fromDom(e.startContainer),e.startOffset,Mt.fromDom(n.endContainer),n.endOffset))}return vt.none()}function ys(t){if(null===t.anchorNode||null===t.focusNode)return bs(t);var e,n,o,r,i,u,a,c,s,l,f,d=Mt.fromDom(t.anchorNode),m=Mt.fromDom(t.focusNode);return e=d,n=t.anchorOffset,o=m,r=t.focusOffset,u=n,a=o,c=r,(s=jt(i=e).dom.createRange()).setStart(i.dom,u),s.setEnd(a.dom,c),l=s,f=zt(e,o)&&n===r,l.collapsed&&!f?vt.some(ss(d,t.anchorOffset,m,t.focusOffset)):bs(t)}function xs(t,e){var n,o,r=(n=es(t,e)).getClientRects();return 0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?vt.some(o).map(Zc):vt.none()}function ws(t,e){return{element:t,offset:e}}function Ss(t,e){return(Xe(t)?ws:function(t,e){var n=Kt(t);if(0===n.length)return ws(t,e);if(e<n.length)return ws(n[e],0);var o=n[n.length-1];return ws(o,(Xe(o)?ef.get(o):Kt(o)).length)})(t,e)}function ks(t,e){return e.getSelection.getOrThunk(function(){return function(){return vt.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(ys)}})().map(function(t){var e=Ss(t.start,t.soffset),n=Ss(t.finish,t.foffset);return ms.range(e.element,e.offset,n.element,n.offset)})}function Cs(t){return t.x+t.width}function Os(t,e){return t.x-e.width}function _s(t,e){return t.y-e.height+t.height}function Ts(t,e,n){return na(Cs(t),t.y,n.southeast(),Na(),"southeast",ra(t,{left:0,top:2}),rf)}function Es(t,e,n){return na(Os(t,e),t.y,n.southwest(),Pa(),"southwest",ra(t,{right:1,top:2}),rf)}function Ds(t,e,n){return na(Cs(t),_s(t,e),n.northeast(),Va(),"northeast",ra(t,{left:0,bottom:3}),rf)}function As(t,e,n){return na(Os(t,e),_s(t,e),n.northwest(),Ha(),"northwest",ra(t,{right:1,bottom:3}),rf)}function Bs(){return[Ts,Es,Ds,As]}function Ms(){return[Es,Ts,As,Ds]}function Fs(t,e,n,o,r,i,u){var a,c,s,l,f,d,m,g,p,h,v,b,y,x,w={anchorBox:n.anchorBox,origin:e};return a=w,c=r.element,s=n.bubble,l=n.layouts,f=i,d=o,m=n.overrides,g=u,h=wc(m,"maxHeightFunction",Rc()),v=wc(m,"maxWidthFunction",st),b=a.anchorBox,y=a.origin,x={bounds:(p=y,d.fold(function(){return p.fold(Fn,Fn,Bn)},function(n){return p.fold(n,n,function(){var t=n(),e=cc(p,t.x,t.y);return Bn(e.left,e.top,t.width,t.height)})})),origin:y,preference:l,maxHeightFunction:h,maxWidthFunction:v,lastPlacement:f,transition:g},Pc(b,c,s,x)}function Is(t,e){Tn(t.element,e.element)}function Rs(e,t){var n,o=e.components();St((n=e).components(),function(t){return En(t.element)}),Me(n.element),n.syncComponents();var r=U(o,t);St(r,function(t){df(t),e.getSystem().removeFromWorld(t)}),St(t,function(t){t.getSystem().isConnected()?Is(e,t):(e.getSystem().addToWorld(t),Is(e,t),vn(e.element)&&mf(t)),e.syncComponents()})}function Ns(t,e){gf(t,e,Tn)}function Ps(t){df(t),En(t.element),t.getSystem().removeFromWorld(t)}function Vs(e){var t=Yt(e.element).bind(function(t){return e.getSystem().getByDom(t).toOptional()});Ps(e),t.each(function(t){t.syncComponents()})}function Hs(t){var e=t.components();St(e,Ps),Me(t.element),t.syncComponents()}function Ls(t,e){pf(t,e,Tn)}function zs(e){var t=Kt(e.element);St(t,function(t){e.getByDom(t).each(df)}),En(e.element)}function Us(e,t,n,o){n.get().each(function(t){Hs(e)}),Ns(t.getAttachPoint(e),e);var r=e.getSystem().build(o);return Ns(e,r),n.set(r),r}function js(t,e,n,o){var r=Us(t,e,n,o);return e.onOpen(t,r),r}function Ws(e,n,o){o.get().each(function(t){Hs(e),Vs(e),n.onClose(e,t),o.clear()})}function Gs(t,e,n){return n.isOpen()}function Xs(t){var n=so("Dismissal",Sf,t),e={};return e[yf()]={schema:to([mo("target")]),onReceive:function(e,t){bf.isOpen(e)&&(bf.isPartOf(e,t.target)||n.isExtraPart(e,t.target)||n.fireEventInstead.fold(function(){return bf.close(e)},function(t){return vr(e,t.event)}))}},e}function Ys(t){var n=so("Reposition",kf,t),e={};return e[xf()]={onReceive:function(e){bf.isOpen(e)&&n.fireEventInstead.fold(function(){return n.doReposition(e)},function(t){return vr(e,t.event)})}},e}function qs(t,e,n){e.store.manager.onLoad(t,e,n)}function Ks(t,e,n){e.store.manager.onUnload(t,e,n)}function Js(){var t=Po(null);return wu({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})}function $s(){var i=Po({}),u=Po({});return wu({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return tt(i.get(),t).orThunk(function(){return tt(u.get(),t)})},update:function(t){var e=i.get(),n=u.get(),o={},r={};St(t,function(e){tt(o[e.value]=e,"meta").each(function(t){tt(t,"text").each(function(t){r[t]=e})})}),i.set(lt(lt({},e),o)),u.set(lt(lt({},n),r))},clear:function(){i.set({}),u.set({})}})}function Qs(t,e,n,o){var r=e.store;n.update([o]),r.setValue(t,o),e.onSetValue(t,o)}function Zs(o,t){return No(o,{},B(t,function(t){return e=t.name(),n="Cannot configure "+t.name()+" for "+o,ar(e,e,Xn(),Jn(function(t){return zo("The field: "+e+" is forbidden. "+n)}));var e,n}).concat([cr("dump",h)]))}function tl(t){return t.dump}function el(t,e){return lt(lt({},ec(e)),t.dump)}function nl(t){return Tt(t,"uiType")}function ol(t){return t.fold(vt.some,vt.none,vt.some,vt.some)}function rl(t){function e(t){return t.name}return t.fold(e,e,e,e)}function il(n,o){return function(t){var e=so("Converting part type",o,t);return n(e)}}function ul(t,e,n,o){return Yo(e.defaults(t,n,o),n,{uid:t.partUids[e.name]},e.overrides(t,n,o))}function al(r,t){var e={};return St(t,function(t){ol(t).each(function(n){var o=nd(r,n.pname);e[n.name]=function(t){var e=so("Part: "+n.name+" in "+r,$o(n.schema),t);return lt(lt({},o),{config:t,validated:e})}})}),e}function cl(t,e,n){return{uiType:Pf(),owner:t,name:e,config:n,validated:{}}}function sl(t){return H(t,function(t){return t.fold(vt.none,vt.some,vt.none,vt.none).map(function(t){return bo(t.name,t.schema.concat([ea(td())]))}).toArray()})}function ll(t){return B(t,rl)}function fl(t,e,n){return o=e,r={},i={},St(n,function(t){t.fold(function(o){r[o.pname]=Rf(!0,function(t,e,n){return o.factory.sketch(ul(t,o,e,n))})},function(t){var e=o.parts[t.name];i[t.name]=rt(t.factory.sketch(ul(o,t,e[td()]),e))},function(o){r[o.pname]=Rf(!1,function(t,e,n){return o.factory.sketch(ul(t,o,e,n))})},function(o){r[o.pname]=Nf(!0,function(e,t,n){return B(e[o.name],function(t){return o.factory.sketch(Yo(o.defaults(e,t,n),t,o.overrides(e,t)))})})})}),{internals:rt(r),externals:rt(i)};var o,r,i}function dl(t,e,n){return o=vt.some(t),i=(r=e).components,s=dt(n,function(t,e){return o=t,r=!1,{name:rt(n=e),required:function(){return o.fold(function(t,e){return t},function(t,e){return t})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+n);return r=!0,o}};var n,o,r}),u=o,a=r,c=s,l=H(i,function(t){return If(u,a,t,c)}),J(s,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),l;var o,r,i,u,a,c,s,l}function ml(t,e,n){var o=e.partUids[n];return t.getSystem().getByUid(o).toOptional()}function gl(t,e,n){return ml(t,e,n).getOrDie("Could not find part: "+n)}function pl(t,e,n){var o={},r=e.partUids,i=t.getSystem();return St(n,function(t){o[t]=rt(i.getByUid(r[t]))}),o}function hl(t,e){var n=t.getSystem();return dt(e.partUids,function(t,e){return rt(n.getByUid(t))})}function vl(t){return Ct(t.partUids)}function bl(t,e,n){var o={},r=e.partUids,i=t.getSystem();return St(n,function(t){o[t]=rt(i.getByUid(r[t]).getOrDie())}),o}function yl(e,t){return lr(B(ll(t),function(t){return{key:t,value:e+"-"+t}}))}function xl(e){return ar("partUids","partUids",Yn(function(t){return yl(t.uid,e)}),Zo())}function wl(t,e,n,o,r){var i;return so(t+" [SpecSchema]",to((i=r,(0<o.length?[bo("parts",o)]:[]).concat([mo("uid"),Eo("dom",{}),Eo("components",[]),ea("originalSpec"),Eo("debug.sketcher",{})]).concat(i)).concat(e)),n)}function Sl(t,e,n,o,r){var i=rd(r),u=wl(t,e,i,sl(n),[xl(n)]),a=fl(0,u,n);return o(u,dl(t,u,a.internals()),i,a.externals())}function kl(t){var r=so("Sketcher for "+t.name,id,t),e=dt(r.apis,Hr),n=dt(r.extraApis,Pr);return lt(lt({name:r.name,configFields:r.configFields,sketch:function(t){return e=r.name,n=r.configFields,(0,r.factory)(wl(e,n,o=rd(t),[],[]),o);var e,n,o}},e),n)}function Cl(t){var e=so("Sketcher for "+t.name,ud,t),n=al(e.name,e.partFields),o=dt(e.apis,Hr),r=dt(e.extraApis,Pr);return lt(lt({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Sl(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},o),r)}function Ol(t){return"input"===Ft(t)&&"radio"!==ie(t,"type")||"textarea"===Ft(t)}function _l(t,e,n){(e.disabled()?ld:fd)(t,e)}function Tl(t,e){return!0===e.useNative&&wt(sd,Ft(t.element))}function El(t,e){return Tl(t,e)?ae(t.element,"disabled"):"true"===ie(t.element,"aria-disabled")}function Dl(n,o,t,r){var e=vs(n.element,"."+o.highlightClass);St(e,function(e){d(r,function(t){return t.element===e})||(qr(e,o.highlightClass),n.getSystem().getByDom(e).each(function(t){o.onDehighlight(n,t),vr(t,tu())}))})}function Al(t,e,n,o){Dl(t,e,0,[o]),Yl(0,e,0,o)||(Yr(o.element,e.highlightClass),e.onHighlight(t,o),vr(o,Zi()))}function Bl(n,e,t,o){var r=vs(n.element,"."+e.itemClass);return P(r,function(t){return Kr(t,e.highlightClass)}).bind(function(t){var e=oa(t,o,0,r.length-1);return n.getSystem().getByDom(r[e]).toOptional()})}function Ml(t,e,n){var o=z(t.slice(0,e)),r=z(t.slice(e+1));return N(o.concat(r),n)}function Fl(t,e,n){return N(z(t.slice(0,e)),n)}function Il(t,e,n){var o=t.slice(0,e);return N(t.slice(e+1).concat(o),n)}function Rl(t,e,n){return N(t.slice(e+1),n)}function Nl(n){return function(t){var e=t.raw;return wt(n,e.which)}}function Pl(t){return function(e){return L(t,function(t){return t(e)})}}function Vl(t){return!0===t.raw.shiftKey}function Hl(t){return!0===t.raw.ctrlKey}function Ll(t,e){return{matches:t,classification:e}}function zl(t,e,n){e.exists(function(e){return n.exists(function(t){return zt(t,e)})})||br(t,Ki(),{prevFocus:e,newFocus:n})}function Ul(){function o(t){return _a(t.element)}return{get:o,set:function(t,e){var n=o(t);t.getSystem().triggerFocus(e,t.element),zl(t,n,o(t))}}}function jl(){function r(t){return hd.getHighlighted(t).map(function(t){return t.element})}return{get:r,set:function(e,t){var n=r(e);e.getSystem().getByDom(t).fold(st,function(t){hd.highlight(e,t)});var o=r(e);zl(e,n,o)}}}gs.ltr,gs.rtl;function Wl(t,e,n,o,r,i){var u=i.map(Mn);return lf(t,e,n,o,r,u)}function Gl(t,e,n){var o,r,i,u=e.getAttachPoint(t);fe(t.element,"position",ff.getMode(u)),i=e.cloakVisibilityAttr,pe((o=t).element,r="visibility").fold(function(){ce(o.element,i)},function(t){oe(o.element,i,t)}),fe(o.element,r,"hidden")}function Xl(t,e,n){var o,r,i,u=t.element;d(["top","left","right","bottom"],function(t){return pe(u,t).isSome()})||ve(t.element,"position"),r="visibility",i=e.cloakVisibilityAttr,ue((o=t).element,i).fold(function(){return ve(o.element,r)},function(t){return fe(o.element,r,t)})}function Yl(t,e,n,o){return Kr(o.element,e.highlightClass)}function ql(e,t,n){return Iu(e.element,"."+t.itemClass).bind(function(t){return e.getSystem().getByDom(t).toOptional()})}function Kl(e,t,n){var o=vs(e.element,"."+t.itemClass);return(0<o.length?vt.some(o[o.length-1]):vt.none()).bind(function(t){return e.getSystem().getByDom(t).toOptional()})}function Jl(e,t,n){return nt(B(vs(e.element,"."+t.itemClass),function(t){return e.getSystem().getByDom(t).toOptional()}))}var $l,Ql,Zl,tf,ef=($l=Xe,{get:function(t){if(!$l(t))throw new Error("Can only get text value of a text node");return Ql(t).getOr("")},getOption:Ql=function(t){return $l(t)?vt.from(t.dom.nodeValue):vt.none()},set:function(t,e){if(!$l(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),nf=["img","br"],of=[wo("getSelection"),mo("root"),wo("bubble"),Uc(),Eo("overrides",{}),Eo("showAbove",!1),ta("placement",function(t,e,n){var r=Xt(e.root).dom,o=qc(t,0,e);return Jc(ks(r,e).bind(function(n){return t=r,e=ms.exactFromRange(n),(0<(o=es(t,e).getBoundingClientRect()).width||0<o.height?vt.some(o).map(Zc):vt.none()).orThunk(function(){var t=Mt.fromText("\ufeff");Ee(n.start,t);var e=xs(r,ms.exact(t,0,t,1));return En(t),e}).bind(function(t){return Kc(t.left,t.top,t.width,t.height)});var t,e,o}),o,e,n,ks(r,e).bind(function(t){return Ge(t.start)?vt.some(t.start):fn(t.start)}).getOr(t.element))})],rf="link-layout",uf=lo("type",{selection:of,node:cs,hotspot:os,submenu:[mo("item"),Uc(),Eo("overrides",{}),ta("placement",function(t,e,n){var o=Ma(n,e.item.element),r=jc(t.element,e,Bs(),Ms(),Bs(),Ms(),vt.none());return vt.some(Hc({anchorBox:o,bubble:kc(),overrides:e.overrides,layouts:r,placer:vt.none()}))})],makeshift:rs}),af=[xo("classes",er),Mo("mode","all",["all","layout","placement"])],cf=[Eo("useFixed",T),wo("getBounds")],sf=[go("anchor",uf),To("transition",af)],lf=function(c,s,l,f,t,d){var m=so("placement.info",$o(sf),t),g=m.anchor,p=f.element,h=l.get(f.uid);Ta(function(){fe(p,"position","fixed");var t=pe(p,"visibility");fe(p,"visibility","hidden");var e,n,o,r,i=s.useFixed()?(r=document.documentElement,Ec(0,0,r.clientWidth,r.clientHeight)):(n=ke((e=c).element),o=e.element.dom.getBoundingClientRect(),Tc(n.left,n.top,o.width,o.height)),u=g.placement,a=d.map(rt).or(s.getBounds);u(c,g,i).each(function(t){var e=t.placer.getOr(Fs)(c,i,t,a,f,h,m.transition);l.set(f.uid,e)}),t.fold(function(){ve(p,"visibility")},function(t){fe(p,"visibility",t)}),pe(p,"left").isNone()&&pe(p,"top").isNone()&&pe(p,"right").isNone()&&pe(p,"bottom").isNone()&&mt(pe(p,"position"),"fixed")&&ve(p,"position")},p)},ff=xa({fields:cf,name:"positioning",active:uc,apis:Object.freeze({__proto__:null,position:function(t,e,n,o,r){Wl(t,e,n,o,r,vt.none())},positionWithin:Wl,positionWithinBounds:lf,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,o){var r=o.element;St(["position","left","right","top","bottom"],function(t){return ve(r,t)}),ce(r,Dc),n.clear(o.uid)}}),state:Object.freeze({__proto__:null,init:function(){var n={};return wu({readState:function(){return n},clear:function(t){k(t)?delete n[t]:n={}},set:function(t,e){n[t]=e},get:function(t){return tt(n,t)}})}})}),df=function(t){vr(t,Xi());var e=t.components();St(e,df)},mf=function(t){var e=t.components();St(e,mf),vr(t,Gi())},gf=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),vn(t.element)&&mf(e),t.syncComponents()},pf=function(t,e,n){n(t,e.element);var o=Kt(e.element);St(o,function(t){e.getByDom(t).each(mf)})},hf=Object.freeze({__proto__:null,cloak:Gl,decloak:Xl,open:js,openWhileCloaked:function(t,e,n,o,r){Gl(t,e),js(t,e,n,o),r(),Xl(t,e)},close:Ws,isOpen:Gs,isPartOf:function(e,n,t,o){return Gs(0,0,t)&&t.get().exists(function(t){return n.isPartOf(e,t,o)})},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,o){return n.get().map(function(){return Us(t,e,n,o)})}}),vf=Object.freeze({__proto__:null,events:function(n,o){return nu([Cr(Vi(),function(t,e){Ws(t,n,o)})])}}),bf=xa({fields:[Ju("onOpen"),Ju("onClose"),mo("isPartOf"),mo("getAttachPoint"),Eo("cloakVisibilityAttr","data-precloak-visibility")],name:"sandboxing",active:vf,apis:hf,state:Object.freeze({__proto__:null,init:function(){var t=gc(),e=rt("not-implemented");return wu({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),yf=rt("dismiss.popups"),xf=rt("reposition.popups"),wf=rt("mouse.released"),Sf=to([Eo("isExtraPart",T),To("fireEventInstead",[Eo("event",Yi())])]),kf=to([To("fireEventInstead",[Eo("event",qi())]),vo("doReposition")]),Cf=Object.freeze({__proto__:null,onLoad:qs,onUnload:Ks,setValue:function(t,e,n,o){e.store.manager.setValue(t,e,n,o)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),Of=Object.freeze({__proto__:null,events:function(n,o){var t=n.resetOnDom?[ou(function(t,e){qs(t,n,o)}),ru(function(t,e){Ks(t,n,o)})]:[ba(n,o,qs)];return nu(t)}}),_f=Object.freeze({__proto__:null,memory:Js,dataset:$s,manual:function(){return wu({readState:st})},init:function(t){return t.store.manager.state(t)}}),Tf=[wo("initialValue"),mo("getFallbackEntry"),mo("getDataKey"),mo("setValue"),ta("manager",{setValue:Qs,getValue:function(t,e,n){var o=e.store,r=o.getDataKey(t);return n.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(e,n,o){n.store.initialValue.each(function(t){Qs(e,n,o,t)})},onUnload:function(t,e,n){n.clear()},state:$s})],Ef=[mo("getValue"),Eo("setValue",st),wo("initialValue"),ta("manager",{setValue:function(t,e,n,o){e.store.setValue(t,o),e.onSetValue(t,o)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(e,n,t){n.store.initialValue.each(function(t){n.store.setValue(e,t)})},onUnload:st,state:xu.init})],Df=xa({fields:[Do("store",{mode:"memory"},lo("mode",{memory:[wo("initialValue"),ta("manager",{setValue:function(t,e,n,o){n.set(o),e.onSetValue(t,o)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each(function(t){n.isNotSet()&&n.set(t)})},onUnload:function(t,e,n){n.clear()},state:Js})],manual:Ef,dataset:Tf})),Ju("onSetValue"),Eo("resetOnDom",!1)],name:"representing",active:Of,apis:Cf,extra:{setValueFrom:function(t,e){var n=Df.getValue(e);Df.setValue(t,n)}},state:_f}),Af=Zs,Bf=el,Mf="placeholder",Ff=Vo([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),If=function(r,i,u,a){return t=r,n=a,(nl(e=u)&&e.uiType===Mf?(c=e,s=n,(o=t).exists(function(t){return t!==c.owner})?Ff.single(!0,rt(c)):tt(s,c.name).fold(function(){throw new Error("Unknown placeholder component: "+c.name+"\nKnown: ["+Ct(s)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+JSON.stringify(c,null,2))},function(t){return t.replace()})):Ff.single(!1,rt(e))).fold(function(t,e){var n=nl(u)?e(i,u.config,u.validated):e(i),o=H(tt(n,"components").getOr([]),function(t){return If(r,i,t,a)});return[lt(lt({},n),{components:o})]},function(t,e){if(nl(u)){var n=e(i,u.config,u.validated);return u.validated.preprocess.getOr(h)(n)}return e(i)});var t,e,n,o,c,s},Rf=Ff.single,Nf=Ff.multiple,Pf=rt(Mf),Vf=Vo([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Hf=Eo("factory",{sketch:h}),Lf=Eo("schema",[]),zf=mo("name"),Uf=ar("pname","pname",Wn(function(t){return"<alloy."+Ir(t.name)+">"}),Zo()),jf=cr("schema",function(){return[wo("preprocess")]}),Wf=Eo("defaults",rt({})),Gf=Eo("overrides",rt({})),Xf=$o([Hf,Lf,zf,Uf,Wf,Gf]),Yf=$o([Hf,Lf,zf,Wf,Gf]),qf=$o([Hf,Lf,zf,Uf,Wf,Gf]),Kf=$o([Hf,jf,zf,mo("unit"),Uf,Wf,Gf]),Jf=il(Vf.required,Xf),$f=il(Vf.external,Yf),Qf=il(Vf.optional,qf),Zf=il(Vf.group,Kf),td=rt("entirety"),ed=Object.freeze({__proto__:null,required:Jf,external:$f,optional:Qf,group:Zf,asNamedPart:ol,name:rl,asCommon:function(t){return t.fold(h,h,h,h)},original:td}),nd=function(t,e){return{uiType:Pf(),owner:t,name:e}},od=Object.freeze({__proto__:null,generate:al,generateOne:cl,schemas:sl,names:ll,substitutes:fl,components:dl,defaultUids:yl,defaultUidsSchema:xl,getAllParts:hl,getAllPartNames:vl,getPart:ml,getPartOrDie:gl,getParts:pl,getPartsOrDie:bl}),rd=function(t){return Tt(t,"uid")?t:lt(lt({},t),{uid:pu("uid")})},id=to([mo("name"),mo("factory"),mo("configFields"),Eo("apis",{}),Eo("extraApis",{})]),ud=to([mo("name"),mo("factory"),mo("configFields"),mo("partFields"),Eo("apis",{}),Eo("extraApis",{})]),ad=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),cd=xa({fields:[mo("find")],name:"composing",apis:ad}),sd=["input","button","textarea","select"],ld=function(e,t,n){t.disableClass.each(function(t){Yr(e.element,t)}),(Tl(e,t)?function(t){oe(t.element,"disabled","disabled")}:function(t){oe(t.element,"aria-disabled","true")})(e),t.onDisabled(e)},fd=function(e,t,n){t.disableClass.each(function(t){qr(e.element,t)}),(Tl(e,t)?function(t){ce(t.element,"disabled")}:function(t){oe(t.element,"aria-disabled","false")})(e),t.onEnabled(e)},dd=Object.freeze({__proto__:null,enable:fd,disable:ld,isDisabled:El,onLoad:_l,set:function(t,e,n,o){(o?ld:fd)(t,e)}}),md=Object.freeze({__proto__:null,exhibit:function(t,e){return zr({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(n,t){return nu([Sr(Ii(),function(t,e){return El(t,n)}),ba(n,t,_l)])}}),gd=xa({fields:[Io("disabled",T),Eo("useNative",!0),wo("disableClass"),Ju("onDisabled"),Ju("onEnabled")],name:"disabling",active:md,apis:dd}),pd=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Dl(t,e,0,[])},dehighlight:function(t,e,n,o){Yl(0,e,0,o)&&(qr(o.element,e.highlightClass),e.onDehighlight(t,o),vr(o,tu()))},highlight:Al,highlightFirst:function(e,n,t){ql(e,n).each(function(t){Al(e,n,0,t)})},highlightLast:function(e,n,t){Kl(e,n).each(function(t){Al(e,n,0,t)})},highlightAt:function(e,n,t,o){var r,i,u;i=o,u=vs((r=e).element,"."+n.itemClass),vt.from(u[i]).fold(function(){return Nn.error(new Error("No element found with index "+i))},r.getSystem().getByDom).fold(function(t){throw t},function(t){Al(e,n,0,t)})},highlightBy:function(e,n,t,o){N(Jl(e,n),o).each(function(t){Al(e,n,0,t)})},isHighlighted:Yl,getHighlighted:function(e,t,n){return Iu(e.element,"."+t.highlightClass).bind(function(t){return e.getSystem().getByDom(t).toOptional()})},getFirst:ql,getLast:Kl,getPrevious:function(t,e,n){return Bl(t,e,0,-1)},getNext:function(t,e,n){return Bl(t,e,0,1)},getCandidates:Jl}),hd=xa({fields:[mo("highlightClass"),mo("itemClass"),Ju("onHighlight"),Ju("onDehighlight")],name:"highlighting",apis:pd}),vd=[8],bd=[9],yd=[13],xd=[27],wd=[32],Sd=[37],kd=[38],Cd=[39],Od=[40],_d=O(Vl);function Td(t,e,n,o,a){function c(e,n,t,o,r){var i=t(e,n,o,r),u=n.event;return N(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(e,n,o,r)})}var r={schema:function(){return t.concat([Eo("focusManager",Ul()),Do("focusInside","onFocus",io(function(t){return wt(["onFocus","onEnterOrSpace","onApi"],t)?Nn.value(t):Nn.error("Invalid value for focusInside")})),ta("handler",r),ta("state",e),ta("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Zl.OnFocusMode?vt.none():a(i).map(function(n){return Cr(Ai(),function(t,e){n(t,i,u),e.stop()})}),e=[Cr(xi(),function(o,r){c(o,r,n,i,u).fold(function(){var e=o,n=r,t=Nl(wd.concat(yd))(n.event);i.focusInside===Zl.OnEnterOrSpaceMode&&t&&gr(e,n)&&a(i).each(function(t){t(e,i,u),n.stop()})},function(t){r.stop()})}),Cr(wi(),function(t,e){c(t,e,o,i,u).each(function(t){e.stop()})})];return nu(t.toArray().concat(e))}};return r}function Ed(t){function a(t,e){return 0<xe(t.visibilitySelector.bind(function(t){return Ru(e,t)}).getOr(e))}function e(e,n,t){var o=n,r=F(vs(e.element,o.selector),function(t){return a(o,t)});vt.from(r[o.firstTabstop]).each(function(t){n.focusManager.set(e,t)})}function o(n,t,r,i){var e,u=vs(n.element,r.selector);return(e=r).focusManager.get(n).bind(function(t){return Ru(t,e.selector)}).bind(function(t){return P(u,C(zt,t)).bind(function(t){return e=n,o=r,i(u,t,function(t){return a(e=o,n=t)&&e.useTabstopAt(n);var e,n}).fold(function(){return o.cyclic?vt.some(!0):vt.none()},function(t){return o.focusManager.set(e,t),vt.some(!0)});var e,o})})}var n=[wo("onEscape"),wo("onEnter"),Eo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Eo("firstTabstop",0),Eo("useTabstopAt",D),wo("visibilitySelector")].concat([t]),r=rt([Ll(Pl([Vl,Nl(bd)]),function(t,e,n){return o(t,0,n,n.cyclic?Ml:Fl)}),Ll(Nl(bd),function(t,e,n){return o(t,0,n,n.cyclic?Il:Rl)}),Ll(Nl(xd),function(e,n,t){return t.onEscape.bind(function(t){return t(e,n)})}),Ll(Pl([_d,Nl(yd)]),function(e,n,t){return t.onEnter.bind(function(t){return t(e,n)})})]),i=rt([]);return Td(n,xu.init,r,i,function(){return vt.some(e)})}function Dd(t,e,n){return Ol(n)&&Nl(wd)(e.event)?vt.none():(xr(t,n,Ii()),vt.some(!0))}function Ad(t,e){return vt.some(!0)}function Bd(t,e,n){return n.execute(t,e,t.element)}function Md(){var n=gc();return wu({readState:function(){return n.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,e){n.set({numRows:t,numColumns:e})},getNumRows:function(){return n.get().map(function(t){return t.numRows})},getNumColumns:function(){return n.get().map(function(t){return t.numColumns})}})}function Fd(i){return function(t,e,n,o){var r=i(t.element);return tg(r,t,e,n,o)}}function Id(t,e){return Fd(Cc(t,e))}function Rd(t,e){return Fd(Cc(e,t))}function Nd(r){return function(t,e,n,o){return tg(r,t,e,n,o)}}function Pd(t){return!((e=t.dom).offsetWidth<=0&&e.offsetHeight<=0);var e}function Vd(t,e,n){var o,r=F(vs(t,n),Pd);return P(o=r,function(t){return zt(t,e)}).map(function(t){return{index:t,candidates:o}})}function Hd(t,e){return P(t,function(t){return zt(e,t)})}function Ld(n,t,o,e){return e(Math.floor(t/o),t%o).bind(function(t){var e=t.row*o+t.column;return 0<=e&&e<n.length?vt.some(n[e]):vt.none()})}function zd(r,t,i,u,a){return Ld(r,t,u,function(t,e){var n=t===i-1?r.length-t*u:u,o=oa(e,a,0,n-1);return vt.some({row:t,column:o})})}function Ud(i,t,u,a,c){return Ld(i,t,a,function(t,e){var n=oa(t,c,0,u-1),o=n===u-1?i.length-n*a:a,r=Wa(e,0,o-1);return vt.some({row:n,column:r})})}function jd(e,n,t){Iu(e.element,n.selector).each(function(t){n.focusManager.set(e,t)})}function Wd(r){return function(t,e,n,o){return Vd(t,e,n.selector).bind(function(t){return r(t.candidates,t.index,o.getNumRows().getOr(n.initSize.numRows),o.getNumColumns().getOr(n.initSize.numColumns))})}}function Gd(t,e,n){return n.captureTab?vt.some(!0):vt.none()}function Xd(t,e,n,i){var u=function(t,e,n){var o,r=oa(e,i,0,n.length-1);return r===t?vt.none():"button"===Ft(o=n[r])&&"disabled"===ie(o,"disabled")?u(t,r,n):vt.from(n[r])};return Vd(t,n,e).bind(function(t){var e=t.index,n=t.candidates;return u(e,e,n)})}function Yd(e,n,o){return(r=o).focusManager.get(e).bind(function(t){return Ru(t,r.selector)}).bind(function(t){return o.execute(e,n,t)});var r}function qd(e,n,t){n.getInitial(e).orThunk(function(){return Iu(e.element,n.selector)}).each(function(t){n.focusManager.set(e,t)})}function Kd(t,e,n){return Xd(t,n.selector,e,-1)}function Jd(t,e,n){return Xd(t,n.selector,e,1)}function $d(r){return function(t,e,n,o){return r(t,e,n,o).bind(function(){return n.executeOnMove?Yd(t,e,n):vt.some(!0)})}}function Qd(t,e,n){return n.onEscape(t,e)}function Zd(t,e,n){return vt.from(t[e]).bind(function(t){return vt.from(t[n]).map(function(t){return{rowIndex:e,columnIndex:n,cell:t}})})}function tm(t,e,n,o){return Zd(t,e,oa(n,o,0,t[e].length-1))}function em(t,e,n,o){var r=oa(n,o,0,t.length-1),i=t[r].length;return Zd(t,r,Wa(e,0,i-1))}function nm(t,e,n,o){var r=t[e].length;return Zd(t,e,Wa(n+o,0,r-1))}function om(t,e,n,o){var r=Wa(n+o,0,t.length-1),i=t[r].length;return Zd(t,r,Wa(e,0,i-1))}function rm(e,n,t){n.previousSelector(e).orThunk(function(){var t=n.selectors;return Iu(e.element,t.cell)}).each(function(t){n.focusManager.set(e,t)})}function im(t,o){return function(e,n,i){var u=i.cycles?t:o;return Ru(n,i.selectors.row).bind(function(t){return Hd(vs(t,i.selectors.cell),n).bind(function(o){var r=vs(e,i.selectors.row);return Hd(r,t).bind(function(t){var e,n=(e=i,B(r,function(t){return vs(t,e.selectors.cell)}));return u(n,t,o).map(function(t){return t.cell})})})})}}function um(e,n,o){return o.focusManager.get(e).bind(function(t){return o.execute(e,n,t)})}function am(e,n,t){Iu(e.element,n.selector).each(function(t){n.focusManager.set(e,t)})}function cm(t,e,n){return Xd(t,n.selector,e,-1)}function sm(t,e,n){return Xd(t,n.selector,e,1)}function lm(t,e,n,o){var r=t.getSystem().build(o);gf(t,r,n)}function fm(t,e,n,o){N(Ig(t),function(t){return zt(o.element,t.element)}).each(Vs)}function dm(e,t,n,r,o){var i=Ig(e);return vt.from(i[r]).map(function(t){return fm(e,0,0,t),o.each(function(t){lm(e,0,function(t,e){var n,o=e;Jt(n=t,r).fold(function(){Tn(n,o)},function(t){Ee(t,o)})},t)}),t})}function mm(t,e){var n,o;return{key:t,value:{config:{},me:(n=t,o=nu(e),xa({fields:[mo("enabled")],name:n,active:{events:rt(o)}})),configAsRaw:rt({}),initialConfig:{},state:xu}}}function gm(t,e){e.ignore||(ka(t.element),e.onFocus(t))}function pm(t,e,n){var o=e.aria;o.update(t,o,n.get())}function hm(e,t,n){t.toggleClass.each(function(t){(n.get()?Yr:qr)(e.element,t)})}function vm(t,e,n){Ym(t,e,n,!n.get())}function bm(t,e,n){n.set(!0),hm(t,e,n),pm(t,e,n)}function ym(t,e,n){n.set(!1),hm(t,e,n),pm(t,e,n)}function xm(t,e,n){Ym(t,e,n,e.selected)}function wm(){function t(t,e){e.stop(),yr(t)}return[Cr(Ci(),t),Cr(Ni(),t),Dr(si()),Dr(mi())]}function Sm(t){return nu(ft([t.map(function(n){return uu(function(t,e){n(t),e.stop()})}).toArray(),wm()]))}function km(t){(_a(t.element).isNone()||Vg.isFocused(t))&&(Vg.isFocused(t)||Vg.focus(t),br(t,Ug,{item:t}))}function Cm(t){br(t,jg,{item:t})}function Om(t,e){return t.x+t.width/2-e.width/2}function _m(t,e){return t.x+t.width-e.width}function Tm(t,e){return t.y+t.height-e.height}function Em(t,e){return t.y+t.height/2-e.height/2}function Dm(t,e,n){return na(_m(t,e),Tm(t,e),n.insetSouthwest(),Ha(),"southwest",ra(t,{right:0,bottom:3}),ap)}function Am(t,e,n){return na(t.x,Tm(t,e),n.insetSoutheast(),Va(),"southeast",ra(t,{left:1,bottom:3}),ap)}function Bm(t,e,n){return na(_m(t,e),t.y,n.insetNorthwest(),Pa(),"northwest",ra(t,{right:0,top:2}),ap)}function Mm(t,e,n){return na(t.x,t.y,n.insetNortheast(),Na(),"northeast",ra(t,{left:1,top:2}),ap)}function Fm(t,e,n){return na(_m(t,e),Em(t,e),n.insetEast(),ja(),"east",ra(t,{right:0}),ap)}function Im(t,e,n){return na(t.x,Em(t,e),n.insetWest(),Ua(),"west",ra(t,{left:1}),ap)}function Rm(t){switch(t){case"north":return cp;case"northeast":return Mm;case"northwest":return Bm;case"south":return sp;case"southeast":return Am;case"southwest":return Dm;case"east":return Fm;case"west":return Im}}function Nm(t,e,n,o,r){return sc(o).map(Rm).getOr(cp)(t,e,n,o,r)}function Pm(t){switch(t){case"north":return sp;case"northeast":return Am;case"northwest":return Dm;case"south":return cp;case"southeast":return Mm;case"southwest":return Bm;case"east":return Im;case"west":return Fm}}function Vm(t,e,n,o,r){return sc(o).map(Pm).getOr(cp)(t,e,n,o,r)}function Hm(t){var e=void 0!==t.uid&&et(t,"uid")?t.uid:pu("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return lt(lt({},t),{uid:e})}}}function Lm(t){return function(){return tt(t,gp).getOr("!not found!")}}function zm(t,e){var n,o=t.toLowerCase();if(dp.isRtl()){var r=At(n=o,"-rtl")?n:n+"-rtl";return Tt(e,r)?r:o}return o}function Um(t,e){return tt(e,zm(t,e))}function jm(t,e){var n=e();return Um(t,n).getOrThunk(Lm(n))}function Wm(){return mm("add-focusable",[ou(function(t){var e,n,o;e=t.element,n="svg",o=function(t){return Ht(t,n)},N(e.dom.childNodes,function(t){return o(Mt.fromDom(t))}).map(Mt.fromDom).each(function(t){return oe(t,"focusable","false")})})])}function Gm(t,e,n,o){var r,i,u,a=(u=e,dp.isRtl()&&Tt(mp,u)?["tox-icon--flip"]:[]),c=tt(n,zm(e,n)).or(o).getOrThunk(Lm(n));return{dom:{tag:t.tag,attributes:null!==(r=t.attributes)&&void 0!==r?r:{},classes:t.classes.concat(a),innerHtml:c},behaviours:ec(V(V([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[Wm()],!1))}}function Xm(t,e,n,o){return void 0===o&&(o=vt.none()),Gm(e,t,n(),o)}(tf=Zl=Zl||{}).OnFocusMode="onFocus",tf.OnEnterOrSpaceMode="onEnterOrSpace",tf.OnApiMode="onApi";function Ym(t,e,n,o){(o?bm:ym)(t,e,n)}function qm(t,e,n){oe(t.element,"aria-expanded",n)}function Km(t){return"prepared"===t.type?vt.some(t.menu):vt.none()}var Jm=Ed(cr("cyclic",T)),$m=Ed(cr("cyclic",D)),Qm=Td([Eo("execute",Dd),Eo("useSpace",!1),Eo("useEnter",!0),Eo("useControlEnter",!1),Eo("useDown",!1)],xu.init,function(t,e,n,o){var r=n.useSpace&&!Ol(t.element)?wd:[],i=n.useEnter?yd:[],u=n.useDown?Od:[];return[Ll(Nl(r.concat(i).concat(u)),Bd)].concat(n.useControlEnter?[Ll(Pl([Hl,Nl(yd)]),Bd)]:[])},function(t,e,n,o){return n.useSpace&&!Ol(t.element)?[Ll(Nl(wd),Ad)]:[]},function(){return vt.none()}),Zm=Object.freeze({__proto__:null,flatgrid:Md,init:function(t){return t.state(t)}}),tg=function(e,n,t,o,r){return o.focusManager.get(n).bind(function(t){return e(n.element,t,o,r)}).map(function(t){return o.focusManager.set(n,t),!0})},eg=Nd,ng=Nd,og=Nd,rg=Wd(function(t,e,n,o){return zd(t,e,n,o,-1)}),ig=Wd(function(t,e,n,o){return zd(t,e,n,o,1)}),ug=Wd(function(t,e,n,o){return Ud(t,e,n,o,-1)}),ag=Wd(function(t,e,n,o){return Ud(t,e,n,o,1)}),cg=Td([mo("selector"),Eo("execute",Dd),$u("onEscape"),Eo("captureTab",!1),Ia()],Md,rt([Ll(Nl(Sd),Id(rg,ig)),Ll(Nl(Cd),Rd(rg,ig)),Ll(Nl(kd),eg(ug)),Ll(Nl(Od),ng(ag)),Ll(Pl([Vl,Nl(bd)]),Gd),Ll(Pl([_d,Nl(bd)]),Gd),Ll(Nl(xd),function(t,e,n){return n.onEscape(t,e)}),Ll(Nl(wd.concat(yd)),function(e,n,o,t){return(r=o).focusManager.get(e).bind(function(t){return Ru(t,r.selector)}).bind(function(t){return o.execute(e,n,t)});var r})]),rt([Ll(Nl(wd),Ad)]),function(){return vt.some(jd)}),sg=[mo("selector"),Eo("getInitial",vt.none),Eo("execute",Dd),$u("onEscape"),Eo("executeOnMove",!1),Eo("allowVertical",!0)],lg=rt([Ll(Nl(wd),Ad)]),fg=Td(sg,xu.init,function(t,e,n,o){var r=Sd.concat(n.allowVertical?kd:[]),i=Cd.concat(n.allowVertical?Od:[]);return[Ll(Nl(r),$d(Id(Kd,Jd))),Ll(Nl(i),$d(Rd(Kd,Jd))),Ll(Nl(yd),Yd),Ll(Nl(wd),Yd),Ll(Nl(xd),Qd)]},lg,function(){return vt.some(qd)}),dg=[bo("selectors",[mo("row"),mo("cell")]),Eo("cycles",!0),Eo("previousSelector",vt.none),Eo("execute",Dd)],mg=im(function(t,e,n){return tm(t,e,n,-1)},function(t,e,n){return nm(t,e,n,-1)}),gg=im(function(t,e,n){return tm(t,e,n,1)},function(t,e,n){return nm(t,e,n,1)}),pg=im(function(t,e,n){return em(t,n,e,-1)},function(t,e,n){return om(t,n,e,-1)}),hg=im(function(t,e,n){return em(t,n,e,1)},function(t,e,n){return om(t,n,e,1)}),vg=rt([Ll(Nl(Sd),Id(mg,gg)),Ll(Nl(Cd),Rd(mg,gg)),Ll(Nl(kd),eg(pg)),Ll(Nl(Od),ng(hg)),Ll(Nl(wd.concat(yd)),function(e,n,o){return _a(e.element).bind(function(t){return o.execute(e,n,t)})})]),bg=rt([Ll(Nl(wd),Ad)]),yg=Td(dg,xu.init,vg,bg,function(){return vt.some(rm)}),xg=[mo("selector"),Eo("execute",Dd),Eo("moveOnTab",!1)],wg=rt([Ll(Nl(kd),og(cm)),Ll(Nl(Od),og(sm)),Ll(Pl([Vl,Nl(bd)]),function(t,e,n,o){return n.moveOnTab?og(cm)(t,e,n,o):vt.none()}),Ll(Pl([_d,Nl(bd)]),function(t,e,n,o){return n.moveOnTab?og(sm)(t,e,n,o):vt.none()}),Ll(Nl(yd),um),Ll(Nl(wd),um)]),Sg=rt([Ll(Nl(wd),Ad)]),kg=Td(xg,xu.init,wg,Sg,function(){return vt.some(am)}),Cg=Td([$u("onSpace"),$u("onEnter"),$u("onShiftEnter"),$u("onLeft"),$u("onRight"),$u("onTab"),$u("onShiftTab"),$u("onUp"),$u("onDown"),$u("onEscape"),Eo("stopSpaceKeyup",!1),wo("focusIn")],xu.init,function(t,e,n){return[Ll(Nl(wd),n.onSpace),Ll(Pl([_d,Nl(yd)]),n.onEnter),Ll(Pl([Vl,Nl(yd)]),n.onShiftEnter),Ll(Pl([Vl,Nl(bd)]),n.onShiftTab),Ll(Pl([_d,Nl(bd)]),n.onTab),Ll(Nl(kd),n.onUp),Ll(Nl(Od),n.onDown),Ll(Nl(Sd),n.onLeft),Ll(Nl(Cd),n.onRight),Ll(Nl(wd),n.onSpace),Ll(Nl(xd),n.onEscape)]},function(t,e,n){return n.stopSpaceKeyup?[Ll(Nl(wd),Ad)]:[]},function(t){return t.focusIn}),Og=Jm.schema(),_g=$m.schema(),Tg=fg.schema(),Eg=cg.schema(),Dg=yg.schema(),Ag=Qm.schema(),Bg=kg.schema(),Mg=Cg.schema(),Fg=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Og,cyclic:_g,flow:Tg,flatgrid:Eg,matrix:Dg,execution:Ag,menu:Bg,special:Mg}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(e,n,o){n.sendFocusIn(n).fold(function(){e.getSystem().triggerFocus(e.element,e.element)},function(t){t(e,n,o)})},setGridSize:function(t,e,n,o,r){et(n,"setGridSize")?n.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Zm}),Ig=function(t,e){return t.components()},Rg=xa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,o){lm(t,0,Tn,o)},prepend:function(t,e,n,o){lm(t,0,Ae,o)},remove:fm,replaceAt:dm,replaceBy:function(e,t,n,o,r){return P(Ig(e),o).bind(function(t){return dm(e,0,0,t,r)})},set:function(e,t,n,o){Ta(function(){var t=B(o,e.getSystem().build);Rs(e,t)},e.element)},contents:Ig})}),Ng=Object.freeze({__proto__:null,focus:gm,blur:function(t,e){e.ignore||t.element.dom.blur()},isFocused:function(t){return Ca(t.element)}}),Pg=Object.freeze({__proto__:null,exhibit:function(t,e){return zr(e.ignore?{}:{attributes:{tabindex:"-1"}})},events:function(n){return nu([Cr(Ai(),function(t,e){gm(t,n),e.stop()})].concat(n.stopMousedown?[Cr(mi(),function(t,e){e.event.prevent()})]:[]))}}),Vg=xa({fields:[Ju("onFocus"),Eo("stopMousedown",!1),Eo("ignore",!1)],name:"focusing",active:Pg,apis:Ng}),Hg=Object.freeze({__proto__:null,onLoad:xm,toggle:vm,isOn:function(t,e,n){return n.get()},on:bm,off:ym,set:Ym}),Lg=Object.freeze({__proto__:null,exhibit:function(){return zr({})},events:function(t,e){var n,o,r,i=(n=t,o=e,r=vm,uu(function(t){r(t,n,o)})),u=ba(t,e,xm);return nu(ft([t.toggleOnExecute?[i]:[],[u]]))}}),zg=xa({fields:[Eo("selected",!1),wo("toggleClass"),Eo("toggleOnExecute",!0),Do("aria",{mode:"none"},lo("mode",{pressed:[Eo("syncWithExpanded",!1),ta("update",function(t,e,n){oe(t.element,"aria-pressed",n),e.syncWithExpanded&&qm(t,0,n)})],checked:[ta("update",function(t,e,n){oe(t.element,"aria-checked",n)})],expanded:[ta("update",qm)],selected:[ta("update",function(t,e,n){oe(t.element,"aria-selected",n)})],none:[ta("update",st)]}))],name:"toggling",active:Lg,apis:Hg,state:{init:function(){var e=Po(!1);return{get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(!1)},readState:function(){return e.get()}}}}}),Ug="alloy.item-hover",jg="alloy.item-focus",Wg=rt(Ug),Gg=rt(jg),Xg=[mo("data"),mo("components"),mo("dom"),Eo("hasSubmenu",!1),wo("toggling"),Af("itemBehaviours",[zg,Vg,Fg,Df]),Eo("ignoreFocus",!1),Eo("domModification",{}),ta("builder",function(t){return{dom:t.dom,domModification:lt(lt({},t.domModification),{attributes:lt(lt(lt({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Bf(t.itemBehaviours,[t.toggling.fold(zg.revoke,function(t){return zg.config(lt({aria:{mode:"checked"}},t))}),Vg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Cm(t)}}),Fg.config({mode:"execution"}),Df.config({store:{mode:"memory",initialValue:t.data}}),mm("item-type-events",V(V([],wm(),!0),[Cr(vi(),km),Cr(Ri(),Vg.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}}),Eo("eventOrder",{})],Yg=[mo("dom"),mo("components"),ta("builder",function(t){return{dom:t.dom,components:t.components,events:nu([Cr(Ri(),function(t,e){e.stop()})])}})],qg=rt("item-widget"),Kg=rt([Jf({name:"widget",overrides:function(e){return{behaviours:ec([Df.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:st}})])}}})]),Jg=lo("type",{widget:[mo("uid"),mo("data"),mo("components"),mo("dom"),Eo("autofocus",!1),Eo("ignoreFocus",!1),Af("widgetBehaviours",[Df,Vg,Fg]),Eo("domModification",{}),xl(Kg()),ta("builder",function(n){function o(t){return ml(t,n,"widget").map(function(t){return Fg.focusIn(t),t})}function t(t,e){return Ol(e.event.target)||n.autofocus&&e.setSource(t.element),vt.none()}var e=fl(qg(),n,Kg()),r=dl(qg(),n,e.internals());return{dom:n.dom,components:r,domModification:n.domModification,events:nu([uu(function(t,e){o(t).each(function(t){e.stop()})}),Cr(vi(),km),Cr(Ri(),function(t,e){n.autofocus?o(t):Vg.focus(t)})]),behaviours:Bf(n.widgetBehaviours,[Df.config({store:{mode:"memory",initialValue:n.data}}),Vg.config({ignore:n.ignoreFocus,onFocus:function(t){Cm(t)}}),Fg.config({mode:"special",focusIn:n.autofocus?function(t){o(t)}:rc(),onLeft:t,onRight:t,onEscape:function(t,e){return Vg.isFocused(t)||n.autofocus?(n.autofocus&&e.setSource(t.element),vt.none()):(Vg.focus(t),vt.some(!0))}})])}})],item:Xg,separator:Yg}),$g=rt([Zf({factory:{sketch:function(t){var e=so("menu.spec item",Jg,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return Tt(e,"uid")?e:lt(lt({},e),{uid:pu("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Qg=rt([mo("value"),mo("items"),mo("dom"),mo("components"),Eo("eventOrder",{}),Zs("menuBehaviours",[hd,Df,cd,Fg]),Do("movement",{mode:"menu",moveOnTab:!0},lo("mode",{grid:[Ia(),ta("config",function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}})],matrix:[ta("config",function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),mo("rowSelector")],menu:[Eo("moveOnTab",!0),ta("config",function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}})]})),go("markers",Fa()),Eo("fakeFocus",!1),Eo("focusManager",Ul()),Ju("onHighlight")]),Zg=rt("alloy.menu-focus"),tp=Cl({name:"Menu",configFields:Qg(),partFields:$g(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:el(t.menuBehaviours,[hd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Df.config({store:{mode:"memory",initialValue:t.value}}),cd.config({find:vt.some}),Fg.config(t.movement.config(t,t.movement))]),events:nu([Cr(Gg(),function(e,n){var t=n.event;e.getSystem().getByDom(t.target).each(function(t){hd.highlight(e,t),n.stop(),br(e,Zg(),{menu:e,item:t})})}),Cr(Wg(),function(t,e){var n=e.event.item;hd.highlight(t,n)})]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),ep=function(n,o,r,t){return tt(r,t).bind(function(t){return tt(n,t).bind(function(t){var e=ep(n,o,r,t);return vt.some([t].concat(e))})}).getOr([])},np=function(){function a(t){return e(t).bind(Km)}function n(t){return tt(c.get(),t)}var c=Po({}),i=Po({}),s=Po({}),l=gc(),u=Po({}),e=function(t){return tt(i.get(),t)};return{setMenuBuilt:function(t,e){var n;i.set(lt(lt({},i.get()),((n={})[t]={type:"prepared",menu:e},n)))},setContents:function(t,e,n,o){l.set(t),c.set(n),i.set(e),u.set(o);var r=function(t,e){var n={};J(t,function(t,e){St(t,function(t){n[t]=e})});var o=e,r=_t(e,function(t,e){return{k:t,v:e}}),i=dt(r,function(t,e){return[e].concat(ep(n,o,r,e))});return dt(n,function(t){return tt(i,t).getOr([t])})}(o,n);s.set(r)},expand:function(n){return tt(c.get(),n).map(function(t){var e=tt(s.get(),n).getOr([]);return[t].concat(e)})},refresh:function(t){return tt(s.get(),t)},collapse:function(t){return tt(s.get(),t).bind(function(t){return 1<t.length?vt.some(t.slice(1)):vt.none()})},lookupMenu:e,lookupItem:n,otherMenus:function(t){var e=u.get();return U(Ct(e),t)},getPrimary:function(){return l.get().bind(a)},getMenus:function(){return i.get()},clear:function(){c.set({}),i.set({}),s.set({}),l.clear()},isClear:function(){return l.get().isNone()},getTriggeringPath:function(t,u){var e=F(n(t).toArray(),function(t){return a(t).isSome()});return tt(s.get(),t).bind(function(t){var n=z(e.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var o=t[n];if(!o.isSome())return vt.none();e.push(o.getOrDie())}return vt.some(e)}(H(n,function(t,e){return o=t,r=u,i=n.slice(0,e+1),a(o).bind(function(e){return n=o,Q(c.get(),function(t,e){return t===n}).bind(function(t){return r(t).map(function(t){return{triggeredMenu:e,triggeringItem:t,triggeringPath:i}})});var n}).fold(function(){return mt(l.get(),t)?[]:[vt.none()]},function(t){return[vt.some(t)]});var o,r,i}))})}}},op=Km,rp=rt("collapse-item"),ip=kl({name:"TieredMenu",configFields:[Zu("onExecute"),Zu("onEscape"),Qu("onOpenMenu"),Qu("onOpenSubmenu"),Ju("onRepositionMenu"),Ju("onCollapseMenu"),Eo("highlightImmediately",!0),bo("data",[mo("primary"),mo("menus"),mo("expansions")]),Eo("fakeFocus",!1),Ju("onHighlight"),Ju("onHover"),Yu(),mo("dom"),Eo("navigateOnHover",!0),Eo("stayInDom",!1),Zs("tmenuBehaviours",[Fg,hd,cd,Rg]),Eo("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(a,t){function n(t){var o,r,e=(o=t,r=a.data.primary,dt(a.data.menus,function(t,e){function n(){return tp.sketch(lt(lt({},t),{value:e,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:(a.fakeFocus?jl:Ul)()}))}return e===r?{type:"prepared",menu:o.getSystem().build(n())}:{type:"notbuilt",nbMenu:n}})),n=dt(a.data.menus,function(t,e){return H(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})});return g.setContents(a.data.primary,e,a.data.expansions,n),g.getPrimary()}function c(t){return Df.getValue(t).value}function u(e,t){hd.highlight(e,t),hd.getHighlighted(t).orThunk(function(){return hd.getFirst(t)}).each(function(t){xr(e,t.element,Ri())})}function s(e,t){return nt(B(t,function(t){return e.lookupMenu(t).bind(function(t){return"prepared"===t.type?vt.some(t.menu):vt.none()})}))}function l(e,t,n){var o=s(t,t.otherMenus(n));St(o,function(t){$r(t.element,[a.markers.backgroundMenu]),a.stayInDom||Rg.remove(e,t)})}function f(t,o){var e;J((e=t,r.get().getOrThunk(function(){var n={},t=F(vs(e.element,"."+a.markers.item),function(t){return"true"===ie(t,"aria-haspopup")});return St(t,function(t){e.getSystem().getByDom(t).each(function(t){var e=c(t);n[e]=t})}),r.set(n),n})),function(t,e){var n=wt(o,e);oe(t.element,"aria-expanded",n)})}function d(o,r,i){return vt.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return vt.none();var e=t.menu,n=s(r,i.slice(1));return St(n,function(t){Yr(t.element,a.markers.backgroundMenu)}),vn(e.element)||Rg.append(o,Eu(e)),$r(e.element,[a.markers.backgroundMenu]),u(o,e),l(o,r,i),vt.some(e)})})}var m,e,r=gc(),g=np();function i(r,i,u){if(void 0===u&&(u=m.HighlightSubmenu),i.hasConfigured(gd)&&gd.isDisabled(i))return vt.some(i);var t=c(i);return g.expand(t).bind(function(o){return f(r,o),vt.from(o[0]).bind(function(n){return g.lookupMenu(n).bind(function(t){var e=function(t,e,n){if("notbuilt"!==n.type)return n.menu;var o=t.getSystem().build(n.nbMenu());return g.setMenuBuilt(e,o),o}(r,n,t);return vn(e.element)||Rg.append(r,Eu(e)),a.onOpenSubmenu(r,i,e,z(o)),u===m.HighlightSubmenu?(hd.highlightFirst(e),d(r,g,o)):(hd.dehighlightAll(e),vt.some(i))})})})}function o(e,n){var t=c(n);return g.collapse(t).bind(function(t){return f(e,t),d(e,g,t).map(function(t){return a.onCollapseMenu(e,n,t),t})})}function p(n){return function(e,t){return Ru(t.getSource(),"."+a.markers.item).bind(function(t){return e.getSystem().getByDom(t).toOptional().bind(function(t){return n(e,t).map(D)})})}}function h(t){return hd.getHighlighted(t).bind(hd.getHighlighted)}(e=m={})[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var v=nu([Cr(Zg(),function(n,o){var t=o.event.item;g.lookupItem(c(t)).each(function(){var t=o.event.menu;hd.highlight(n,t);var e=c(o.event.item);g.refresh(e).each(function(t){return l(n,g,t)})})}),uu(function(e,t){var n=t.event.target;e.getSystem().getByDom(n).each(function(t){0===c(t).indexOf("collapse-item")&&o(e,t),i(e,t,m.HighlightSubmenu).fold(function(){a.onExecute(e,t)},st)})}),ou(function(e,t){n(e).each(function(t){Rg.append(e,Eu(t)),a.onOpenMenu(e,t),a.highlightImmediately&&u(e,t)})})].concat(a.navigateOnHover?[Cr(Wg(),function(t,e){var n=e.event.item,o=t,r=c(n);g.refresh(r).bind(function(t){return f(o,t),d(o,g,t)}),i(t,n,m.HighlightParent),a.onHover(t,n)})]:[])),b={collapseMenu:function(e){h(e).each(function(t){o(e,t)})},highlightPrimary:function(e){g.getPrimary().each(function(t){u(e,t)})},repositionMenus:function(o){g.getPrimary().bind(function(e){return h(o).bind(function(t){var e=c(t),n=nt(B(Z(g.getMenus()),op));return g.getTriggeringPath(e,function(t){return e=t,K(n,function(t){return t.getSystem().isConnected()?N(hd.getCandidates(t),function(t){return c(t)===e}):vt.none()});var e})}).map(function(t){return{primary:e,triggeringPath:t}})}).fold(function(){vt.from(o.components()[0]).filter(function(t){return"menu"===ie(t.element,"role")}).each(function(t){a.onRepositionMenu(o,t,[])})},function(t){var e=t.primary,n=t.triggeringPath;a.onRepositionMenu(o,e,n)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:el(a.tmenuBehaviours,[Fg.config({mode:"special",onRight:p(function(t,e){return Ol(e.element)?vt.none():i(t,e,m.HighlightSubmenu)}),onLeft:p(function(t,e){return Ol(e.element)?vt.none():o(t,e)}),onEscape:p(function(t,e){return o(t,e).orThunk(function(){return a.onEscape(t,e).map(function(){return t})})}),focusIn:function(e,t){g.getPrimary().each(function(t){xr(e,t.element,Ri())})}}),hd.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),cd.config({find:function(t){return hd.getHighlighted(t)}}),Rg.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:sr(t,e),expansions:{}}},collapseItem:function(t){return{value:Ir(rp()),meta:{text:t}}}}}),up=kl({name:"InlineView",configFields:[mo("lazySink"),Ju("onShow"),Ju("onHide"),Oo("onEscape"),Zs("inlineBehaviours",[bf,Df,ic]),To("fireDismissalEventInstead",[Eo("event",Yi())]),To("fireRepositionEventInstead",[Eo("event",qi())]),Eo("getRelated",vt.none),Eo("isExtraPart",T),Eo("eventOrder",vt.none)],factory:function(d,t){function e(n){bf.isOpen(n)&&Df.getValue(n).each(function(t){switch(t.mode){case"menu":bf.getState(n).each(ip.repositionMenus);break;case"position":var e=d.lazySink(n).getOrDie();ff.positionWithinBounds(e,n,t.config,t.getBounds())}})}function o(t,e,n,o){i(t,e,n,function(){return o.map(function(t){return Mn(t)})})}function r(t,e,n,o){var r,i,u,a,c,s=(r=d,i=t,u=e,a=o,c="horizontal"===n.type?{layouts:{onLtr:ha,onRtl:va}}:{},ip.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightImmediately:n.menu.highlightImmediately,onEscape:function(){return bf.close(i),r.onEscape.map(function(t){return t(i)}),vt.some(!0)},onExecute:function(){return vt.some(!0)},onOpenMenu:function(t,e){ff.positionWithinBounds(l().getOrDie(),e,u,a())},onOpenSubmenu:function(t,e,n,o){var r=l().getOrDie();ff.position(r,n,{anchor:lt({type:"submenu",item:e},f(o))})},onRepositionMenu:function(t,e,n){var o=l().getOrDie();ff.positionWithinBounds(o,e,u,a()),St(n,function(t){var e=f(t.triggeringPath);ff.position(o,t.triggeredMenu,{anchor:lt({type:"submenu",item:t.triggeringItem},e)})})}}));function l(){return r.lazySink(i)}function f(t){return 2===t.length?c:{}}bf.open(t,s),Df.setValue(t,vt.some({mode:"menu",menu:s}))}var i=function(t,e,n,o){var r=d.lazySink(t).getOrDie();bf.openWhileCloaked(t,e,function(){return ff.positionWithinBounds(r,t,n,o())}),Df.setValue(t,vt.some({mode:"position",config:n,getBounds:o}))},n={setContent:function(t,e){bf.setContent(t,e)},showAt:function(t,e,n){o(t,e,n,vt.none())},showWithin:o,showWithinBounds:i,showMenuAt:function(t,e,n){r(t,e,n,vt.none)},showMenuWithinBounds:r,hide:function(t){bf.isOpen(t)&&(Df.setValue(t,vt.none()),bf.close(t))},getContent:function(t){return bf.getState(t)},reposition:e,isOpen:bf.isOpen};return{uid:d.uid,dom:d.dom,behaviours:el(d.inlineBehaviours,[bf.config({isPartOf:function(t,e,n){return Hu(e,n)||(o=n,d.getRelated(t).exists(function(t){return Hu(t,o)}));var o},getAttachPoint:function(t){return d.lazySink(t).getOrDie()},onOpen:function(t){d.onShow(t)},onClose:function(t){d.onHide(t)}}),Df.config({store:{mode:"memory",initialValue:vt.none()}}),ic.config({channels:lt(lt({},Xs(lt({isExtraPart:t.isExtraPart},d.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ys(lt(lt({},d.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:e})))})]),eventOrder:d.eventOrder,apis:n}},apis:{showAt:function(t,e,n,o){t.showAt(e,n,o)},showWithin:function(t,e,n,o,r){t.showWithin(e,n,o,r)},showWithinBounds:function(t,e,n,o,r){t.showWithinBounds(e,n,o,r)},showMenuAt:function(t,e,n,o){t.showMenuAt(e,n,o)},showMenuWithinBounds:function(t,e,n,o,r){t.showMenuWithinBounds(e,n,o,r)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),ap="layout-inset",cp=function(t,e,n){return na(Om(t,e),t.y,n.insetNorth(),La(),"north",ra(t,{top:2}),ap)},sp=function(t,e,n){return na(Om(t,e),Tm(t,e),n.insetSouth(),za(),"south",ra(t,{bottom:3}),ap)},lp=tinymce.util.Tools.resolve("tinymce.util.Delay"),fp=kl({name:"Button",factory:function(t){function n(e){return tt(t.dom,"attributes").bind(function(t){return tt(t,e)})}var e=Sm(t.action),o=t.dom.tag;return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Bf(t.buttonBehaviours,[Vg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==o)return{role:n("role").getOr("button")};var t=n("type").getOr("button"),e=n("role").map(function(t){return{role:t}}).getOr({});return lt({type:t},e)}()},eventOrder:t.eventOrder}},configFields:[Eo("uid",void 0),mo("dom"),Eo("components",[]),Af("buttonBehaviours",[Vg,Fg]),wo("action"),wo("role"),Eo("eventOrder",{})]}),dp=tinymce.util.Tools.resolve("tinymce.util.I18n"),mp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},gp="temporary-placeholder",pp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},hp=kl({name:"Notification",factory:function(e){function n(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}}function o(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}}var t,r,i,u,a=Hm({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:ec([Rg.config({})])}),c=Hm({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},o(0)],behaviours:ec([Rg.config({})])}),s={updateProgress:function(t,e){t.getSystem().isConnected()&&c.getOpt(t).each(function(t){Rg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},o(e)])})},updateText:function(t,e){var n;t.getSystem().isConnected()&&(n=a.get(t),Rg.set(n,[ri(e)]))}},l=ft([e.icon.toArray(),e.level.toArray(),e.level.bind(function(t){return vt.from(pp[t])}).toArray()]),f=Hm(fp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Xm("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":e.translationProvider("Close")}},e.iconProvider)],action:function(t){e.onAction(t)}})),d=[(t=l,r={tag:"div",classes:["tox-notification__icon"]},i=e.iconProvider,u=i(),Gm(r,N(t,function(t){return Tt(u,zm(t,u))}).getOr(gp),u,vt.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:ec([Rg.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:ec([Vg.config({}),mm("notification-events",[Cr(bi(),function(t){f.getOpt(t).each(Vg.focus)})])]),components:d.concat(e.progress?[c.asSpec()]:[]).concat(e.closeButton?[f.asSpec()]:[]),apis:s}},configFields:[wo("level"),mo("progress"),mo("icon"),mo("onAction"),mo("text"),mo("iconProvider"),mo("translationProvider"),Fo("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function vp(n,o){function r(){b(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r(),i=setTimeout(function(){i=null,n.apply(null,t)},o)}}}function bp(o,t,e,n,r){var i=Ap(o,function(t){return(e=o).isBlock(n=t)||wt(["BR","IMG","HR","INPUT"],n.nodeName)||"false"===e.getContentEditable(n);var e,n});return vt.from(i.backwards(t,e,n,r))}function yp(n,e){return Bp(Mt.fromDom(n.selection.getNode())).getOrThunk(function(){var i,u,t=Mt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',n.getDoc());return Tn(t,Mt.fromDom(e.extractContents())),e.insertNode(t.dom),Yt(t).each(function(t){return t.dom.normalize()}),i=hs,(u=function(t){for(var e=Kt(t),n=e.length-1;0<=n;n--){var o=e[n];if(i(o))return vt.some(o);var r=u(o);if(r.isSome())return r}return vt.none()})(t).map(function(t){var e;n.selection.setCursorLocation(t.dom,"img"===Ft(e=t)?1:ps(e).fold(function(){return Kt(e).length},function(t){return t.length}))}),t})}function xp(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function wp(t){return""!==t&&-1!==" \xa0\f\n\r\t\v".indexOf(t)}function Sp(t,e){return t.substring(e.length)}function kp(o,t,r,e){return void 0===e&&(e=0),Bp(Mt.fromDom(t.startContainer)).fold(function(){return function(t,o,i,r){if(void 0===r&&(r=0),!o.collapsed||3!==o.startContainer.nodeType)return vt.none();var e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return bp(t,o.startContainer,o.startOffset,function(t,r,e){return function(t,e){for(var n=r-1;0<=n;n--){var o=t.charAt(n);if(wp(o))return vt.none();if(o===e)break}return vt.some(n)}(e,i).getOr(r)},e).bind(function(t){var e=o.cloneRange();if(e.setStart(t.container,t.offset),e.setEnd(o.endContainer,o.endOffset),e.collapsed)return vt.none();var n=xp(e);return 0!==n.lastIndexOf(i)||Sp(n,i).length<r?vt.none():vt.some({text:Sp(n,i),range:e,triggerChar:i})})}(o,t,r,e)},function(t){var e=o.createRng();e.selectNode(t.dom);var n=xp(e);return vt.some({range:e,text:Sp(n,r),triggerChar:r})})}function Cp(t,e){return{container:t,offset:e}}function Op(t){return ao("toolbarbutton",Hp,t)}function _p(t){return ao("ToggleButton",zp,t)}function Tp(e,t,n,o){void 0===o&&(o={});var r=t(),i=e.selection.getRng().startContainer.nodeValue,u=F(r.lookupByChar(n.triggerChar),function(t){return n.text.length>=t.minChars&&t.matches.getOrThunk(function(){return n=e.dom,function(t){var e=Ip(t.startContainer,t.startOffset);return!bp(n,e.container,e.offset,function(t,e){return 0===e?-1:e},n.getRoot()).filter(function(t){return!wp(t.container.data.charAt(t.offset-1))}).isSome()};var n})(n.range,i,n.text)});if(0===u.length)return vt.none();var a=Mp.all(B(u,function(e){return e.fetch(n.text,e.maxResults,o).then(function(t){return{matchText:n.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}})}));return vt.some({lookupData:a,context:n})}var Ep,Dp,Ap=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Bp=function(t){return Ru(t,"[data-mce-autocompleter]")},Mp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Fp=function(t){if(3===t.nodeType)return Cp(t,t.data.length);var e=t.childNodes;return 0<e.length?Fp(e[e.length-1]):Cp(t,e.length)},Ip=function(t,e){var n=t.childNodes;return 0<n.length&&e<n.length?Ip(n[e],0):0<n.length&&1===t.nodeType&&n.length===e?Fp(n[n.length-1]):Cp(t,e)},Rp=$o([po("type"),Co("text")]),Np=$o([Eo("type","autocompleteitem"),Eo("active",!1),Eo("disabled",!1),Eo("meta",{}),po("value"),Co("text"),Co("icon")]),Pp=$o([po("type"),po("ch"),Ao("minChars",1),Eo("columns",1),Ao("maxResults",10),Oo("matches"),vo("fetch"),vo("onAction"),Ro("highlightOn",[],er)]),Vp=[Fo("disabled",!1),Co("tooltip"),Co("icon"),Co("text"),Io("onSetup",function(){return st})],Hp=$o([po("type"),vo("onAction")].concat(Vp)),Lp=[Fo("active",!1)].concat(Vp),zp=$o(Lp.concat([po("type"),vo("onAction")])),Up=[Io("predicate",T),Mo("scope","node",["node","editor"]),Mo("position","selection",["node","selection","line"])],jp=Vp.concat([Eo("type","contextformbutton"),Eo("primary",!1),vo("onAction"),cr("original",h)]),Wp=Lp.concat([Eo("type","contextformbutton"),Eo("primary",!1),vo("onAction"),cr("original",h)]),Gp=Vp.concat([Eo("type","contextformbutton")]),Xp=Lp.concat([Eo("type","contextformtogglebutton")]),Yp=lo("type",{contextformbutton:jp,contextformtogglebutton:Wp}),qp=$o([Eo("type","contextform"),Io("initValue",rt("")),Co("label"),xo("commands",Yp),So("launch",lo("type",{contextformbutton:Gp,contextformtogglebutton:Xp}))].concat(Up)),Kp=$o([Eo("type","contexttoolbar"),po("items")].concat(Up));function Jp(t){return tt(_h,t).getOr(kh)}function $p(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}}function Qp(t){var e=$p(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Jp(t)}}function Zp(t,e,n){return{dom:{tag:"div",classes:ft([[$p(n).tieredMenu]])},markers:Qp(n)}}function th(e,n){return function(t){return B(p(t,n),function(t){return{dom:e,components:t}})}}function eh(t,n){var o=[],r=[];return St(t,function(t,e){n(t,e)?(0<r.length&&o.push(r),r=[],Tt(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),B(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})}function nh(e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[tp.parts.items({preprocess:function(t){return"auto"!==e&&1<e?th({tag:"div",classes:["tox-collection__group"]},e)(t):eh(t,function(t,e){return"separator"===n[e].type})}})]}}function oh(t){return d(t,function(t){return"icon"in t&&void 0!==t.icon})}function rh(t){return console.error(ur(t)),console.log(t),vt.none()}function ih(t,e,n,o,r){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[tp.parts.items({preprocess:function(t){return eh(t,function(t,e){return"separator"===i[e].type})}})]});return{value:t,dom:u.dom,components:u.components,items:n}}function uh(t,e,n,o,r){var i,u;return"color"===r?{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[tp.parts.items({preprocess:"auto"!==o?th({tag:"div",classes:["tox-swatches__row"]},o):h})]}]}).dom,components:i.components,items:n}:"normal"===r&&"auto"===o?{value:t,dom:(i=nh(o,n)).dom,components:i.components,items:n}:"normal"===r&&1===o?{value:t,dom:(i=nh(1,n)).dom,components:i.components,items:n}:"normal"===r?{value:t,dom:(i=nh(o,n)).dom,components:i.components,items:n}:"listpreview"!==r||"auto"===o?{value:t,dom:{tag:"div",classes:ft([[(u=$p(r)).menu,"tox-menu-"+o+"-column"],e?[u.hasIcons]:[]])},components:Ih,items:n}:{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[tp.parts.items({preprocess:th({tag:"div",classes:["tox-collection__group"]},o)})]}).dom,components:i.components,items:n}}function ah(t,o,e){var r=vs(t.element,"."+e);if(0<r.length){var n=P(r,function(t){var e=t.dom.getBoundingClientRect().top,n=r[0].dom.getBoundingClientRect().top;return Math.abs(e-n)>o}).getOr(r.length);return vt.some({numColumns:n,numRows:Math.ceil(r.length/n)})}return vt.none()}function ch(t,e,n){t.getSystem().broadcastOn([Jh],{})}function sh(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))}function lh(t){return t.getParam("width",nv.DOM.getStyle(t.getElement(),"width"))}function fh(t){return vt.from(t.getParam("min_width")).filter(u)}function dh(t){return vt.from(t.getParam("min_height")).filter(u)}function mh(t){return vt.from(t.getParam("max_width")).filter(u)}function gh(t){return vt.from(t.getParam("max_height")).filter(u)}function ph(t){return!1!==t.getParam("menubar",!0,"boolean")}function hh(t){var e=t.getParam("toolbar",!0),n=!0===e,o=y(e),r=c(e)&&0<e.length;return!rv(t)&&(r||o||n)}function vh(e){var t=F(m(9,function(t){return e.getParam("toolbar"+(t+1),!1,"string")}),function(t){return"string"==typeof t});return 0<t.length?vt.some(t):vt.none()}(Dp=Ep={})[Dp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Dp[Dp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var bh,yh,xh,wh,Sh=Ep,kh="tox-menu-nav__js",Ch="tox-collection__item",Oh="tox-swatch",_h={normal:kh,color:Oh},Th="tox-collection__item--enabled",Eh="tox-collection__item-icon",Dh="tox-collection__item-label",Ah="tox-collection__item-caret",Bh="tox-collection__item--active",Mh="tox-collection__item-container",Fh="tox-collection__item-container--row",Ih=[tp.parts.items({})],Rh=[po("type"),po("src"),Co("alt"),Ro("classes",[],er)],Nh=$o(Rh),Ph=[po("type"),po("text"),Co("name"),Ro("classes",["tox-collection__item-label"],er)],Vh=$o(Ph),Hh=Zn(function(){return ro("type",{cardimage:Nh,cardtext:Vh,cardcontainer:Lh})}),Lh=$o([po("type"),Bo("direction","horizontal"),Bo("align","left"),Bo("valign","middle"),xo("items",Hh)]),zh=[Fo("disabled",!1),Co("text"),Co("shortcut"),ar("value","value",Wn(function(){return Ir("menuitem-value")}),Zo()),Eo("meta",{})],Uh=$o([po("type"),Co("label"),xo("items",Hh),Io("onSetup",function(){return st}),Io("onAction",st)].concat(zh)),jh=$o([po("type"),Fo("active",!1),Co("icon")].concat(zh)),Wh=[po("type"),po("fancytype"),Io("onAction",st)],Gh=lo("fancytype",{inserttable:[Eo("initData",{})].concat(Wh),colorswatch:[No("initData",{},[Fo("allowCustomColors",!0),_o("colors",Zo())])].concat(Wh)}),Xh=$o([po("type"),Io("onSetup",function(){return st}),Io("onAction",st),Co("icon")].concat(zh)),Yh=$o([po("type"),vo("getSubmenuItems"),Io("onSetup",function(){return st}),Co("icon")].concat(zh)),qh=$o([po("type"),Co("icon"),Fo("active",!1),Io("onSetup",function(){return st}),vo("onAction")].concat(zh)),Kh=function(t){return e=Ir("unnamed-events"),ec([mm(e,t)]);var e},Jh=Ir("tooltip.exclusive"),$h=Ir("tooltip.show"),Qh=Ir("tooltip.hide"),Zh=Object.freeze({__proto__:null,hideAllExclusive:ch,setComponents:function(t,e,n,o){n.getTooltip().each(function(t){t.getSystem().isConnected()&&Rg.set(t,o)})}}),tv=Object.freeze({__proto__:null,events:function(r,i){function n(e){i.getTooltip().each(function(t){Vs(t),r.onHide(e,t),i.clearTooltip()}),i.clearTimer()}return nu(ft([[Cr($h,function(o){i.resetTimer(function(){var t,e,n=o;i.isShowing()||(ch(n),t=r.lazySink(n).getOrDie(),e=n.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:nu("normal"===r.mode?[Cr(vi(),function(t){vr(n,$h)}),Cr(pi(),function(t){vr(n,Qh)})]:[]),behaviours:ec([Rg.config({})])}),i.setTooltip(e),Ns(t,e),r.onShow(n,e),ff.position(t,e,{anchor:r.anchor(n)}))},r.delay)}),Cr(Qh,function(t){i.resetTimer(function(){n(t)},r.delay)}),Cr(Fi(),function(t,e){e.universal||wt(e.channels,Jh)&&n(t)}),ru(function(t){n(t)})],"normal"===r.mode?[Cr(bi(),function(t){vr(t,$h)}),Cr(Bi(),function(t){vr(t,Qh)}),Cr(vi(),function(t){vr(t,$h)}),Cr(pi(),function(t){vr(t,Qh)})]:[Cr(Zi(),function(t,e){vr(t,$h)}),Cr(tu(),function(t){vr(t,Qh)})]]))}}),ev=xa({fields:[mo("lazySink"),mo("tooltipDom"),Eo("exclusive",!0),Eo("tooltipComponents",[]),Eo("delay",300),Mo("mode","normal",["normal","follow-highlight"]),Eo("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:rt([$a,Ja,Xa,qa,Ya,Ka]),onRtl:rt([$a,Ja,Xa,qa,Ya,Ka])}}}),Ju("onHide"),Ju("onShow")],name:"tooltipping",active:tv,state:Object.freeze({__proto__:null,init:function(){function n(){o.on(clearTimeout)}var o=gc(),t=gc(),e=rt("not-implemented");return wu({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:n,resetTimer:function(t,e){n(),o.set(setTimeout(t,e))},readState:e})}}),apis:Zh}),nv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ov=tinymce.util.Tools.resolve("tinymce.EditorManager"),rv=function(t){return vh(t).fold(function(){return 0<t.getParam("toolbar",[],"string[]").length},D)};function iv(t){return t.getParam("toolbar_mode","","string")}function uv(t){return t.getParam("toolbar_location",xh.auto,"string")}function av(t){return uv(t)===xh.bottom}function cv(t){if(!t.inline)return vt.none();var e=t.getParam("fixed_toolbar_container","","string");if(0<e.length)return Iu(bn(),e);var n=t.getParam("fixed_toolbar_container_target");return k(n)?vt.some(Mt.fromDom(n)):vt.none()}function sv(t){return t.inline&&cv(t).isSome()}function lv(t){return cv(t).getOrThunk(function(){return te(gn(Mt.fromDom(t.getElement())))})}function fv(t){return t.inline&&!ph(t)&&!hh(t)&&!rv(t)}function dv(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!sv(t)&&!fv(t)}function mv(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([yf()],{target:n}),t.uiMothership.broadcastOn([yf()],{target:n})),t.mothership.broadcastOn([Kv],{readonly:e}),t.uiMothership.broadcastOn([Kv],{readonly:e})}function gv(t,e){t.on("init",function(){t.mode.isReadOnly()&&mv(e,!0)}),t.on("SwitchMode",function(){return mv(e,t.mode.isReadOnly())}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")}function pv(){var t;return ic.config({channels:((t={})[Kv]={schema:Jv,onReceive:function(t,e){gd.set(t,e.readonly)}},t)})}function hv(t,e){var n=t.getApi(e);return function(t){t(n)}}function vv(n,o){return ou(function(t){hv(n,t)(function(t){var e=n.onSetup(t);S(e)&&o.set(e)})})}function bv(e,n){return ru(function(t){return hv(e,t)(n.get())})}function yv(t,e,n,o){var r,i,u=Po(st);return{type:"item",dom:e.dom,components:tb(e.optComponents),data:t.data,eventOrder:Zv,hasSubmenu:t.triggersSubmenu,itemBehaviours:ec([mm("item-events",[(r=t,i=n,uu(function(t,e){hv(r,t)(r.onAction),r.triggersSubmenu||i!==Sh.CLOSE_ON_EXECUTE||(vr(t,Vi()),e.stop())})),vv(t,u),bv(t,u)]),gd.config({disabled:function(){return t.disabled||o.isDisabled()},disableClass:"tox-collection__item--state-disabled"}),pv(),Rg.config({})].concat(t.itemBehaviours))}}function xv(t){return{value:t.value,meta:lt({text:t.text.getOr("")},t.meta)}}function wv(t,e,n){return Xm(t,{tag:"div",classes:n=void 0===n?[Eh]:n},e)}function Sv(t){return{dom:{tag:"div",classes:[Dh]},components:[ri(dp.translate(t))]}}function kv(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}}function Cv(t,e){return{dom:{tag:"div",classes:[Dh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[ri(dp.translate(e))]}]}}function Ov(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=eb.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},e=B(t.split("+"),function(t){var e=t.toLowerCase().trim();return Tt(n,e)?n[e]:t}),eb.mac?e.join(""):e.join("+"))}};var n,e}function _v(t){return wv("checkmark",t,["tox-collection__item-checkmark"])}function Tv(t){var e=t.map(function(t){return{attributes:{title:dp.translate(t)}}}).getOr({});return lt({tag:"div",classes:[kh,Ch]},e)}function Ev(t,e,n,o){return void 0===o&&(o=vt.none()),"color"===t.presets?(r=e,i=o,c=t.ariaLabel,s=t.value,{dom:(u=t.iconContent.map(function(t){return e=r.icons,n=i,Um(t,o=e()).or(n).getOrThunk(Lm(o));var e,n,o}).getOr(""),a={tag:"div",attributes:c.map(function(t){return{title:r.translate(t)}}).getOr({}),classes:["tox-swatch"]},lt(lt({},a),"custom"===s?{tag:"button",classes:V(V([],a.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:u}:"remove"===s?{classes:V(V([],a.classes,!0),["tox-swatch--remove"],!1),innerHtml:u}:{attributes:lt(lt({},a.attributes),{"data-mce-color":s}),styles:{"background-color":s}})),optComponents:[]}):(l=t,f=e,d=o,m={tag:"div",classes:[Eh]},g=n?l.iconContent.map(function(t){return Xm(t,m,f.icons,d)}).orThunk(function(){return vt.some({dom:m})}):vt.none(),p=l.checkMark,h=vt.from(l.meta).fold(function(){return Sv},function(t){return Tt(t,"style")?C(Cv,t.style):Sv}),v=l.htmlContent.fold(function(){return l.textContent.map(h)},function(t){return vt.some(kv(t,[Dh]))}),{dom:Tv(l.ariaLabel),optComponents:[g,v,l.shortcutContent.map(Ov),p,l.caret]});var r,i,u,a,c,s,l,f,d,m,g,p,h,v}function Dv(t,e){return tt(t,"tooltipWorker").map(function(n){return[ev.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Nc}}},mode:"follow-highlight",onShow:function(e,t){n(function(t){ev.setComponents(e,[Ou({element:Mt.fromDom(t)})])})}})]}).getOr([])}function Av(t,e){var n=dp.translate(t),o=nv.DOM.encode(n);if(0<e.length){var r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return o.replace(r,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return o}function Bv(t){return{value:t}}function Mv(t){return rb.test(t)||ib.test(t)}function Fv(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()}function Iv(t){return Bv(Fv(t.red)+Fv(t.green)+Fv(t.blue))}function Rv(t,e,n,o){return{red:t,green:e,blue:n,alpha:o}}function Nv(t){var e=parseInt(t,10);return e.toString()===t&&0<=e&&e<=255}function Pv(t){var e,n,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=ab(0,ub(i,1)),u=ab(0,ub(u,1));if(0===i)return Rv(e=n=o=cb(255*u),n,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,o=0;break;case 1:e=s,n=c,o=0;break;case 2:e=0,n=c,o=s;break;case 3:e=0,n=s,o=c;break;case 4:e=s,n=0,o=c;break;case 5:e=c,n=0,o=s;break;default:e=n=o=0}return Rv(e=cb(255*(e+l)),n=cb(255*(n+l)),o=cb(255*(o+l)),1)}function Vv(t){var e,n,o=(e={value:t.value.replace(rb,function(t,e,n,o){return e+e+n+n+o+o})},null===(n=ib.exec(e.value))?["FFFFFF","FF","FF","FF"]:n);return Rv(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16),1)}function Hv(t,e,n,o){return Rv(parseInt(t,10),parseInt(e,10),parseInt(n,10),parseFloat(o))}function Lv(t){if("transparent"===t)return vt.some(Rv(0,0,0,0));var e=sb.exec(t);if(null!==e)return vt.some(Hv(e[1],e[2],e[3],"1"));var n=lb.exec(t);return null!==n?vt.some(Hv(n[1],n[2],n[3],n[4])):vt.none()}function zv(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"}function Uv(t,e){return t.fire("ResizeContent",e)}function jv(t,e,n){return{hue:t,saturation:e,value:n}}function Wv(t){var e,n,o=0,r=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?jv(0,0,100*(o=a)):(n=60*((r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),e=(c-a)/c,o=c,jv(Math.round(n),Math.round(100*e),Math.round(100*o)))}function Gv(t){return Iv(Pv(t))}function Xv(o){return(Mv(e=o)?vt.some({value:(Dt(t=e,"#")?t.substring("#".length):t).toUpperCase()}):vt.none()).orThunk(function(){return Lv(o).map(Iv)}).getOrThunk(function(){var t=document.createElement("canvas");t.height=1,t.width=1;var e=t.getContext("2d");e.clearRect(0,0,t.width,t.height),e.fillStyle="#FFFFFF",e.fillStyle=o,e.fillRect(0,0,1,1);var n=e.getImageData(0,0,1,1).data;return Iv(Rv(n[0],n[1],n[2],n[3]))});var t,e}(yh=bh=bh||{}).default="wrap",yh.floating="floating",yh.sliding="sliding",yh.scrolling="scrolling",(wh=xh=xh||{}).auto="auto",wh.top="top",wh.bottom="bottom";function Yv(t){return gd.config({disabled:t,disableClass:"tox-tbtn--disabled"})}var qv,Kv="silver.readonly",Jv=$o([go("readonly",nr)]),$v=function(t){return gd.config({disabled:t})},Qv=function(t){return gd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Zv=((qv={})[Ii()]=["disabling","alloy.base.behaviour","toggling","item-events"],qv),tb=nt,eb=tinymce.util.Tools.resolve("tinymce.Env"),nb=function(t,a){return B(t,function(t){switch(t.type){case"cardcontainer":return r=nb((o=t).items,a),i="vertical"===o.direction?"tox-collection__item-container--column":Fh,u="left"===o.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[Mh,i,u,function(){switch(o.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:r};case"cardimage":return n=t.src,{dom:{tag:"img",classes:t.classes,attributes:{src:n,alt:t.alt.getOr("")}}};case"cardtext":var e=t.name.exists(function(t){return wt(a.cardText.highlightOn,t)})?vt.from(a.cardText.matchText).getOr(""):"";return kv(Av(t.text,e),t.classes)}var n,o,r,i,u})},ob=al(qg(),Kg()),rb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ib=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ub=Math.min,ab=Math.max,cb=Math.round,sb=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,lb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,fb=Rv(255,0,0,1),db=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),mb="tinymce-custom-colors";function gb(t){return!1!==t.getParam("custom_colors")}function pb(t){var e=t.getParam("color_map");return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+Xv(t[n]).value,type:"choiceitem"});return e}(e):Bb}function hb(t){Mb.add(t)}function vb(t){var e,n=(e=pb(t).length,Math.max(5,Math.ceil(Math.sqrt(e))));return t.getParam("color_cols",n,"number")}function bb(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}function yb(e,n,t,o){"custom"===t?Ib(e)(function(t){t.each(function(t){hb(t),e.execCommand("mceApplyTextcolor",n,t),o(t)})},Fb):"remove"===t?(o(""),e.execCommand("mceRemoveTextcolor",n)):(o(t),e.execCommand("mceApplyTextcolor",n,t))}function xb(t,e){return t.concat(B(Mb.state(),function(t){return{type:Ab,text:t,value:t}}).concat(bb(e)))}function wb(e,n){return function(t){t(xb(e,n))}}function Sb(t,e,n){t.setIconFill("forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",n)}function kb(i,n,u,t,o){i.ui.registry.addSplitButton(n,{tooltip:t,presets:"color",icon:"forecolor"===n?"text-color":"highlight-bg-color",select:function(n){var o,r=u;return i.dom.getParents(i.selection.getStart(),function(t){var e;(e=t.style["forecolor"===r?"color":"background-color"])&&(o=o||e)}),vt.from(o).bind(function(t){return Lv(t).map(function(t){var e=Iv(t).value;return ut(n.toLowerCase(),e)})}).getOr(!1)},columns:vb(i),fetch:wb(pb(i),gb(i)),onAction:function(t){yb(i,u,o.get(),st)},onItemAction:function(t,e){yb(i,u,e,function(t){o.set(t),i.fire("TextColorChange",{name:n,color:t})})},onSetup:function(e){function t(t){t.name===n&&Sb(e,t.name,t.color)}return Sb(e,n,o.get()),i.on("TextColorChange",t),function(){i.off("TextColorChange",t)}}})}function Cb(e,t,n,o){e.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){yb(e,n,t.value,st)}}]}})}function Ob(t,e,n,o,r,i,u,a){return uh(t,oh(e),Rb(e,n,o,"color"!==r?"normal":"color",i,u,a),o,r)}function _b(t,e){var n=Qp(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}}function Tb(t,e){return ri(e+"x"+t)}var Eb,Db,Ab="choiceitem",Bb=[{type:Ab,text:"Light Green",value:"#BFEDD2"},{type:Ab,text:"Light Yellow",value:"#FBEEB8"},{type:Ab,text:"Light Red",value:"#F8CAC6"},{type:Ab,text:"Light Purple",value:"#ECCAFA"},{type:Ab,text:"Light Blue",value:"#C2E0F4"},{type:Ab,text:"Green",value:"#2DC26B"},{type:Ab,text:"Yellow",value:"#F1C40F"},{type:Ab,text:"Red",value:"#E03E2D"},{type:Ab,text:"Purple",value:"#B96AD9"},{type:Ab,text:"Blue",value:"#3598DB"},{type:Ab,text:"Dark Turquoise",value:"#169179"},{type:Ab,text:"Orange",value:"#E67E23"},{type:Ab,text:"Dark Red",value:"#BA372A"},{type:Ab,text:"Dark Purple",value:"#843FA1"},{type:Ab,text:"Dark Blue",value:"#236FA1"},{type:Ab,text:"Light Gray",value:"#ECF0F1"},{type:Ab,text:"Medium Gray",value:"#CED4D9"},{type:Ab,text:"Gray",value:"#95A5A6"},{type:Ab,text:"Dark Gray",value:"#7E8C8D"},{type:Ab,text:"Navy Blue",value:"#34495E"},{type:Ab,text:"Black",value:"#000000"},{type:Ab,text:"White",value:"#ffffff"}],Mb=function(n){void 0===n&&(n=10);function o(t){i.splice(t,1)}var t,e=db.getItem(mb),r=y(e)?JSON.parse(e):[],i=n-(t=r).length<0?t.slice(0,n):t;return{add:function(t){var e;(-1===(e=l(i,t))?vt.none():vt.some(e)).each(o),i.unshift(t),i.length>n&&i.pop(),db.setItem(mb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Fb="#000000",Ib=function(r){return function(n,t){var o=!1;r.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{colorpicker:t},onAction:function(t,e){"hex-valid"===e.name&&(o=e.value)},onSubmit:function(t){var e=t.getData().colorpicker;o?(n(vt.from(e)),t.close()):r.windowManager.alert(r.translate(["Invalid hex color code: {0}",e]))},onClose:st,onCancel:function(){n(vt.none())}})}},Rb=function(n,o,r,i,u,a,c){return nt(B(n,function(e){return"choiceitem"===e.type?ao("choicemenuitem",jh,e).fold(rh,function(t){return vt.some(function(e,t,n,o,r,i,u,a){void 0===a&&(a=!0);var c=Ev({presets:n,textContent:t?e.text:vt.none(),htmlContent:vt.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:vt.none(),checkMark:t?vt.some(_v(u.icons)):vt.none(),caret:vt.none(),value:e.value},u,a);return Yo(yv({data:xv(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){zg.set(e,t)},isActive:function(){return zg.isOn(e)},isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}},onAction:function(t){return o(e.value)},onSetup:function(t){return t.setActive(r),st},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:e.active}})}(t,1===r,i,o,a(e.value),u,c,oh(n)))}):vt.none()}))},Nb=Ir("cell-over"),Pb=Ir("cell-execute"),Vb={inserttable:function(u){var t=Ir("size-label"),a=function(t){for(var e=[],n=0;n<10;n++){for(var o=[],r=0;r<10;r++)o.push(function(e,n,t){function o(t){return br(t,Pb,{row:e,col:n})}function r(t,e){e.stop(),o(t)}var i;return Tu({dom:{tag:"div",attributes:((i={role:"button"})["aria-labelledby"]=t,i)},behaviours:ec([mm("insert-table-picker-cell",[Cr(vi(),Vg.focus),Cr(Ii(),o),Cr(Ci(),r),Cr(Ni(),r)]),zg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Vg.config({onFocus:function(t){return br(t,Nb,{row:e,col:n})}})])})}(n,r,t));e.push(o)}return e}(t),e=Tb(0,0),c=Hm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[e],behaviours:ec([Rg.config({})])});return{type:"widget",data:{value:Ir("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ob.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:H(a,function(t){return B(t,Eu)}).concat(c.asSpec()),behaviours:ec([mm("insert-table-picker",[ou(function(t){Rg.set(c.get(t),[e])}),Er(Nb,function(t,e,n){var o=n.event,r=o.row,i=o.col;!function(t,e,n){for(var o=0;o<10;o++)for(var r=0;r<10;r++)zg.set(t[o][r],o<=e&&r<=n)}(a,r,i),Rg.set(c.get(t),[Tb(r+1,i+1)])}),Er(Pb,function(t,e,n){var o=n.event,r=o.row,i=o.col;u.onAction({numRows:r+1,numColumns:i+1}),vr(t,Vi())})]),Fg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(e,t){var n,o,r,i=(o=t,r=(n=e).initData.allowCustomColors&&o.colorinput.hasCustomColors(),n.initData.colors.fold(function(){return xb(o.colorinput.getColors(),r)},function(t){return t.concat(bb(r))})),u=t.colorinput.getColorCols(),a=Ob(Ir("menu-value"),i,function(t){e.onAction({value:t})},u,"color",Sh.CLOSE_ON_EXECUTE,T,t.shared.providers),c=lt(lt({},a),{markers:Qp("color"),movement:_b(u,"color")});return{type:"widget",data:{value:Ir("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[ob.widget(tp.sketch(c))]}}},Hb=function(t){var e=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:lt({tag:"div",classes:[Ch,"tox-collection__group-heading"]},e),components:[]}},Lb=function(t,e,n,o){void 0===o&&(o=!0);var r=Ev({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,caret:vt.none(),checkMark:vt.none(),shortcutContent:t.shortcut},n,o);return yv({data:xv(t),getApi:function(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,e,n)},zb=function(t,e,n,o,r){void 0===o&&(o=!0);var i=(r=void 0!==r&&r)?wv("chevron-down",n.icons,[Ah]):wv("chevron-right",n.icons,[Ah]),u=Ev({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,caret:vt.some(i),checkMark:vt.none(),shortcutContent:t.shortcut},n,o);return yv({data:xv(t),getApi:function(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}},disabled:t.disabled,onAction:st,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,e,n)},Ub=function(t,e,n,o){void 0===o&&(o=!0);var r=Ev({iconContent:t.icon,textContent:t.text,htmlContent:vt.none(),ariaLabel:t.text,checkMark:vt.some(_v(n.icons)),caret:vt.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,o);return Yo(yv({data:xv(t),disabled:t.disabled,getApi:function(e){return{setActive:function(t){zg.set(e,t)},isActive:function(){return zg.isOn(e)},isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,e,n),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:t.active}})},jb=function(e,n){return tt(Vb,e.fancytype).map(function(t){return t(e,n)})};function Wb(t,u,a,e,c,s,l){var n=1===e,o=!n||oh(t);return nt(B(t,function(t){switch(t.type){case"separator":return ao("Autocompleter.Separator",Rp,t).fold(rh,function(t){return vt.some(Hb(t))});case"cardmenuitem":return ao("cardmenuitem",Uh,t).fold(rh,function(e){return vt.some((t=lt(lt({},e),{onAction:function(t){e.onAction(t),a(e.value,e.meta)}}),n=c,o=s,r={itemBehaviours:Dv(e.meta,s),cardText:{matchText:u,highlightOn:l}},i={dom:Tv(t.label),optComponents:[vt.some({dom:{tag:"div",classes:[Mh,Fh]},components:nb(t.items,r)})]},yv({data:xv(lt({text:vt.none()},t)),disabled:t.disabled,getApi:function(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(e){gd.set(n,e),St(vs(n.element,"*"),function(t){n.getSystem().getByDom(t).each(function(t){t.hasConfigured(gd)&&gd.set(t,e)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:vt.from(r.itemBehaviours).getOr([])},i,n,o.providers)));var t,n,o,r,i});default:return ao("Autocompleter.Item",Np,t).fold(rh,function(t){return vt.some(function(e,n,t,o,r,i,u,a){void 0===a&&(a=!0);var c=Ev({presets:o,textContent:vt.none(),htmlContent:t?e.text.map(function(t){return Av(t,n)}):vt.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:vt.none(),checkMark:vt.none(),caret:vt.none(),value:e.value},u.providers,a,e.icon);return yv({data:xv(e),disabled:e.disabled,getApi:rt({}),onAction:function(t){return r(e.value,e.meta)},onSetup:rt(st),triggersSubmenu:!1,itemBehaviours:Dv(e.meta,u)},c,i,u.providers)}(t,u,n,"normal",a,c,s,o))})}}))}function Gb(t,e,n,o,r){var i=oh(e),u=nt(B(e,function(t){function e(t){return function(t,e,n,o,r){function i(t){return r?lt(lt({},t),{shortcut:vt.none(),icon:t.text.isSome()?vt.none():t.icon}):t}var u=n.shared.providers;switch(t.type){case"menuitem":return ao("menuitem",Xh,t).fold(rh,function(t){return vt.some(Lb(i(t),e,u,o))});case"nestedmenuitem":return ao("nestedmenuitem",Yh,t).fold(rh,function(t){return vt.some(zb(i(t),e,u,o,r))});case"togglemenuitem":return ao("togglemenuitem",qh,t).fold(rh,function(t){return vt.some(Ub(i(t),e,u,o))});case"separator":return ao("separatormenuitem",Rp,t).fold(rh,function(t){return vt.some(Hb(t))});case"fancymenuitem":return ao("fancymenuitem",Gh,t).fold(rh,function(t){return jb(i(t),n)});default:return console.error("Unknown item in general menu",t),vt.none()}}(t,n,o,r?!Tt(t,"text"):i,r)}return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(lt(lt({},t),{disabled:!0})):e(t)}));return(r?ih:uh)(t,i,u,1,"normal")}function Xb(t){return ip.singleData(t.value,t)}function Yb(t,e,n){return Ru(t,e,n).isSome()}function qb(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r=setTimeout(function(){n.apply(null,t),r=null},o)}}}function Kb(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?vt.none():vt.some(e.touches[0])}function Jb(){return ln().browser.isFirefox()}function $b(e,t){var n,o,r,i,u,a,c,s,l,f=lt({stopBackspace:!0},t),d=(u=f,a=gc(),c=Po(!1),s=qb(function(t){u.triggerEvent(Pi(),t),c.set(!0)},400),l=lr([{key:si(),value:function(n){return Kb(n).each(function(t){s.cancel();var e={x:t.clientX,y:t.clientY,target:n.target};s.schedule(n),c.set(!1),a.set(e)}),vt.none()}},{key:li(),value:function(t){return s.cancel(),Kb(t).each(function(i){a.on(function(t){var e=i,n=t,o=Math.abs(e.clientX-n.x),r=Math.abs(e.clientY-n.y);(5<o||5<r)&&a.clear()})}),vt.none()}},{key:fi(),value:function(e){return s.cancel(),a.get().filter(function(t){return zt(t.target,e.target)}).map(function(t){return c.get()?(e.prevent(),!1):u.triggerEvent(Ni(),e)})}}]),{fireIfReady:function(e,t){return tt(l,t).bind(function(t){return t(e)})}}),m=B(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return pc(e,t,function(e){d.fireIfReady(e,t).each(function(t){t&&e.kill()}),f.triggerEvent(t,e)&&e.kill()})}),g=gc(),p=pc(e,"paste",function(e){d.fireIfReady(e,"paste").each(function(t){t&&e.kill()}),f.triggerEvent("paste",e)&&e.kill(),g.set(setTimeout(function(){f.triggerEvent(Mi(),e)},0))}),h=pc(e,"keydown",function(t){var e;f.triggerEvent("keydown",t)?t.kill():!f.stopBackspace||(e=t).raw.which!==vd[0]||wt(["input","textarea"],Ft(e.target))||Yb(e.target,'[contenteditable="true"]')||t.prevent()}),v=(n=e,o=function(t){f.triggerEvent("focusin",t)&&t.kill()},Jb()?hc(n,"focus",o):pc(n,"focusin",o)),b=gc(),y=(r=e,i=function(t){f.triggerEvent("focusout",t)&&t.kill(),b.set(setTimeout(function(){f.triggerEvent(Bi(),t)},0))},Jb()?hc(r,"blur",i):pc(r,"focusout",i));return{unbind:function(){St(m,function(t){t.unbind()}),h.unbind(),v.unbind(),y.unbind(),p.unbind(),g.on(clearTimeout),b.on(clearTimeout)}}}function Qb(t,e){return Po(tt(t,"target").getOr(e))}function Zb(t,o,e,n,r,i){var u,a,c=t(o,n),s=(u=Po(!1),a=Po(!1),{stop:function(){u.set(!0)},cut:function(){a.set(!0)},isStopped:u.get,isCut:a.get,event:e,setSource:r.set,getSource:r.get});return c.fold(function(){return i.logEventNoHandlers(o,n),ay.complete()},function(e){var n=e.descHandler;return Ur(n)(s),s.isStopped()?(i.logEventStopped(o,e.element,n.purpose),ay.stopped()):s.isCut()?(i.logEventCut(o,e.element,n.purpose),ay.complete()):Yt(e.element).fold(function(){return i.logNoParent(o,e.element,n.purpose),ay.complete()},function(t){return i.logEventResponse(o,e.element,n.purpose),ay.resume(t)})})}function ty(){function r(t){Rr(t.element).each(function(t){delete a[t],i.unregisterId(t)})}var u,i=(u={},{registerId:function(r,i,t){J(t,function(t,e){var n,o=void 0!==u[e]?u[e]:{};o[i]={cHandler:C.apply(void 0,[(n=t).handler].concat(r)),purpose:n.purpose},u[e]=o})},unregisterId:function(n){J(u,function(t,e){Tt(t,n)&&delete t[n]})},filterByType:function(t){return tt(u,t).map(function(t){return $(t,function(t,e){return{id:e,descHandler:t}})}).getOr([])},find:function(t,e,n){return tt(u,e).bind(function(o){return mr(n,function(t){return e=o,Rr(n=t).bind(function(t){return tt(e,t)}).map(function(t){return{element:n,descHandler:t}});var e,n},t)})}}),a={};return{find:function(t,e,n){return i.find(t,e,n)},filter:function(t){return i.filterByType(t)},register:function(t){var n,o=Rr((n=t).element).getOrThunk(function(){return t=n.element,e=Ir(du+"uid-"),gu(t,e),e;var t,e});et(a,o)&&function(t){var e=a[o];if(e!==t)throw new Error('The tagId "'+o+'" is already used by: '+Fr(e.element)+"\nCannot use it for: "+Fr(t.element)+"\nThe conflicting element is"+(vn(e.element)?" ":" not ")+"already in the DOM");r(t)}(t),i.registerId([t],o,t.events),a[o]=t},unregister:r,getById:function(t){return tt(a,t)}}}function ey(n){function o(e){return Yt(n.element).fold(D,function(t){return zt(e,t)})}function s(t,e){return i.find(o,t,e)}function r(e){var t=i.filter(Fi());St(t,function(t){Ur(t.descHandler)(e)})}var i=ty(),t=$b(n.element,{triggerEvent:function(e,n){return zu(e,n.target,function(t){return sy(s,e,n,n.target,t)})}}),u={debugInfo:rt("real"),triggerEvent:function(e,n,o){zu(e,n,function(t){return sy(s,e,o,n,t)})},triggerFocus:function(a,c){Rr(a).fold(function(){ka(a)},function(t){zu(Ai(),a,function(t){var e,n,o=s,r=Ai(),i=t,u=Qb(e={originator:c,kill:st,prevent:st,target:a},n=a);return Zb(o,r,e,n,u,i),!1})})},triggerEscape:function(t,e){u.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Tu,addToGui:function(t){c(t)},removeFromGui:function(t){l(t)},addToWorld:function(t){e(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:D},e=function(t){t.connect(u),Xe(t.element)||(i.register(t),St(t.components(),e),u.triggerEvent(Li(),t.element,{target:t.element}))},a=function(t){Xe(t.element)||(St(t.components(),a),i.unregister(t)),t.disconnect()},c=function(t){Ns(n,t)},l=function(t){Vs(t)},f=function(t){r({universal:!0,data:t})},d=function(t,e){r({universal:!1,channels:t,data:e})},m=function(t,e){var n,o,r=i.filter(t);return o={stop:function(){n.set(!0)},cut:st,isStopped:(n=Po(!1)).get,isCut:T,event:e,setSource:_("Cannot set source of a broadcasted event"),getSource:_("Cannot get source of a broadcasted event")},St(r,function(t){Ur(t.descHandler)(o)}),o.isStopped()},g=function(t){return i.getById(t).fold(function(){return Nn.error(new Error('Could not find component with uid: "'+t+'" in system.'))},Nn.value)},p=function(t){var e=Rr(t).getOr("not found");return g(e)};return e(n),{root:n,element:n.element,destroy:function(){t.unbind(),En(n.element)},add:c,remove:l,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}}function ny(t,e,n,o){var r=vy(t,e,n,o);return my.sketch(r)}function oy(t,e){return my.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})}function ry(t){return ec([Vg.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Qr(e);e.dom.setSelectionRange(0,n.length)}:st})])}function iy(t){return{tag:t.tag,attributes:lt({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}}(Db=Eb={})[Db.ContentFocus=0]="ContentFocus",Db[Db.UiFocus=1]="UiFocus";function uy(f,c){function n(){return r.get().isSome()}function s(){n()&&up.hide(d)}var o,t,r=gc(),l=Po(!1),d=Tu(up.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ec([mm("dismissAutocompleter",[Cr(Yi(),function(){return m()})])]),lazySink:c.getSink})),m=function(){var t;n()&&(t=r.get().map(function(t){return t.element}),Bp(t.getOr(Mt.fromDom(f.selection.getNode()))).each(Fe),s(),r.clear(),l.set(!1))},u=Rt(function(){return n=dt(f.ui.registry.getAll().popups,function(t){return ao("Autocompleter",Pp,t).fold(function(t){throw new Error(ur(t))},h)}),t=$(n,function(t){return t.ch}),e={},St(t,function(t){e[t]={}}),o=Ct(e),r=Z(n),{dataset:n,triggerChars:o,lookupByChar:function(e){return F(r,function(t){return t.ch===e})}};var t,e,n,o,r}),g=function(t){var e=t;r.get().map(function(t){return kp(f.dom,f.selection.getRng(),t.triggerChar).bind(function(t){return Tp(f,u,t,e)})}).getOrThunk(function(){return e=f,t=(n=u)(),o=e.selection.getRng(),r=e.dom,i=o,K(t.triggerChars,function(t){return kp(r,i,t)}).bind(function(t){return Tp(e,n,t)});var e,n,t,o,r,i}).fold(m,function(a){var t,e=a.context;n()||(t=yp(f,e.range),r.set({triggerChar:e.triggerChar,element:t,matchLength:e.text.length}),l.set(!1)),a.lookupData.then(function(u){r.get().map(function(t){var e,n,o,r,i=a.context;t.triggerChar===i.triggerChar&&(n=i.triggerChar,r=K(o=u,function(t){return vt.from(t.columns)}).getOr(1),0<(e=H(o,function(i){return Wb(i.items,i.matchText,function(o,r){var t=f.selection.getRng();kp(f.dom,t,n).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var e=t.range,n={hide:function(){m()},reload:function(t){s(),g(t)}};l.set(!0),i.onAction(n,e,o,r),l.set(!1)})},r,Sh.BUBBLE_TO_SANDBOX,c,i.highlightOn)})).length?function(t,e,n,o){t.matchLength=e.text.length;var r,i,u,a,c,s,l=K(n,function(t){return vt.from(t.columns)}).getOr(1);up.showAt(d,tp.sketch((r=uh("autocompleter-value",!0,o,l,"normal"),i=l,a=((u=Eb.ContentFocus)===Eb.ContentFocus?jl:Ul)(),c=_b(i,"normal"),s=Qp("normal"),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:s.selectedItem,item:s.item},movement:c,fakeFocus:u===Eb.ContentFocus,focusManager:a,menuBehaviours:Kh("auto"!==i?[]:[ou(function(o,t){ah(o,4,s.item).each(function(t){var e=t.numColumns,n=t.numRows;Fg.setGridSize(o,n,e)})})])})),{anchor:{type:"node",root:Mt.fromDom(f.getBody()),node:vt.from(t.element)}}),up.getContent(d).each(hd.highlightFirst)}(t,i,u,e):(10<=i.text.length-t.matchLength?m:s)())})})})},e={onKeypress:vp(function(t){27!==t.which&&g()},50),cancelIfNecessary:m,isMenuOpen:function(){return up.isOpen(d)},isActive:n,isProcessingAction:l.get,getView:function(){return up.getContent(d)}};function i(t,e){br(t,xi(),{raw:e})}!1===f.hasPlugin("rtc")&&(o=e,(t=f).on("keypress compositionend",o.onKeypress.throttle),t.on("remove",o.onKeypress.cancel),t.on("keydown",function(e){function t(){return o.getView().bind(hd.getHighlighted)}8===e.which&&o.onKeypress.throttle(e),o.isActive()&&(27===e.which&&o.cancelIfNecessary(),o.isMenuOpen()?13===e.which?(t().each(yr),e.preventDefault()):40===e.which?(t().fold(function(){o.getView().each(hd.highlightFirst)},function(t){i(t,e)}),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||t().each(function(t){i(t,e),e.preventDefault(),e.stopImmediatePropagation()}):13!==e.which&&38!==e.which&&40!==e.which||o.cancelIfNecessary())}),t.on("NodeChange",function(t){o.isActive()&&!o.isProcessingAction()&&Bp(Mt.fromDom(t.element)).isNone()&&o.cancelIfNecessary()}))}var ay=Vo([{stopped:[]},{resume:["element"]},{complete:[]}]),cy=function(e,n,o,t,r,i){return Zb(e,n,o,t,r,i).fold(D,function(t){return cy(e,n,o,t,r,i)},T)},sy=function(t,e,n,o,r){var i=Qb(n,o);return cy(t,e,n,o,i,r)},ly=kl({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,o=A(e,["attributes"]);return{uid:t.uid,dom:lt({tag:"div",attributes:lt({role:"presentation"},n)},o),components:t.components,behaviours:tl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Eo("components",[]),Zs("containerBehaviours",[]),Eo("events",{}),Eo("domModification",{}),Eo("eventOrder",{})]}),fy=rt([Eo("prefix","form-field"),Zs("fieldBehaviours",[cd,Df])]),dy=rt([Qf({schema:[mo("dom")],name:"label"}),Qf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[mo("text")],name:"aria-descriptor"}),Jf({factory:{sketch:function(t){var n,o,e=(n=["factory"],o={},J(t,function(t,e){wt(n,e)||(o[e]=t)}),o);return t.factory.sketch(e)}},schema:[mo("factory")],name:"field"})]),my=Cl({name:"FormField",configFields:fy(),partFields:dy(),factory:function(r,t,e,n){var o=el(r.fieldBehaviours,[cd.config({find:function(t){return ml(t,r,"field")}}),Df.config({store:{mode:"manual",getValue:function(t){return cd.getCurrent(t).bind(Df.getValue)},setValue:function(t,e){cd.getCurrent(t).each(function(t){Df.setValue(t,e)})}}})]),i=nu([ou(function(t,e){var o=pl(t,r,["label","field","aria-descriptor"]);o.field().each(function(n){var e=Ir(r.prefix);o.label().each(function(t){oe(t.element,"for",e),oe(n.element,"id",e)}),o["aria-descriptor"]().each(function(t){var e=Ir(r.prefix);oe(t.element,"id",e),oe(n.element,"aria-describedby",e)})})})]);return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:{getField:function(t){return ml(t,r,"field")},getLabel:function(t){return ml(t,r,"label")}}}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),gy=Object.freeze({__proto__:null,exhibit:function(t,e){return zr({attributes:lr([{key:e.tabAttr,value:"true"}])})}}),py=xa({fields:[Eo("tabAttr","data-alloy-tabstop")],name:"tabstopping",active:gy}),hy=tinymce.util.Tools.resolve("tinymce.html.Entities"),vy=function(t,e,n,o){return{dom:by(n),components:t.toArray().concat([e]),fieldBehaviours:ec(o)}},by=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},yy=Ir("form-component-change"),xy=Ir("form-close"),wy=Ir("form-cancel"),Sy=Ir("form-action"),ky=Ir("form-submit"),Cy=Ir("form-block"),Oy=Ir("form-unblock"),_y=Ir("form-tabchange"),Ty=Ir("form-resize"),Ey=rt([wo("data"),Eo("inputAttributes",{}),Eo("inputStyles",{}),Eo("tag","input"),Eo("inputClasses",[]),Ju("onSetValue"),Eo("styles",{}),Eo("eventOrder",{}),Zs("inputBehaviours",[Df,Vg]),Eo("selectOnFocus",!0)]),Dy=kl({name:"Input",configFields:Ey(),factory:function(t,e){return{uid:t.uid,dom:iy(t),components:[],behaviours:lt(lt({},ry(n=t)),el(n.inputBehaviours,[Df.config({store:lt(lt({mode:"manual"},n.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Qr(t.element)},setValue:function(t,e){Qr(t.element)!==e&&Zr(t.element,e)}}),onSetValue:n.onSetValue})])),eventOrder:t.eventOrder};var n}}),Ay={},By={exports:Ay};function My(t){setTimeout(function(){throw t},0)}function Fy(t){var e=Ft(t);return wt(Xy,e)}function Iy(t,e){qr(e.getRoot(t).getOr(t.element),e.invalidClass),e.notify.each(function(e){Fy(t.element)&&oe(t.element,"aria-invalid",!1),e.getContainer(t).each(function(t){Mr(t,e.validHtml)}),e.onValid(t)})}function Ry(e,t,n,o){Yr(t.getRoot(e).getOr(e.element),t.invalidClass),t.notify.each(function(t){Fy(e.element)&&oe(e.element,"aria-invalid",!0),t.getContainer(e).each(function(t){Mr(t,o)}),t.onInvalid(e,o)})}function Ny(e,t,n){return t.validator.fold(function(){return Gy(Nn.value(!0))},function(t){return t.validate(e)})}function Py(e,n,t){return n.notify.each(function(t){t.onValidate(e)}),Ny(e,n).map(function(t){return e.getSystem().isConnected()?t.fold(function(t){return Ry(e,n,0,t),Nn.error(t)},function(t){return Iy(e,n),Nn.value(t)}):Nn.error("No longer in system")})}!function(){var t=this,e=function(){var t,e,n,o={exports:{}};function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(n,o){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var t,e=1===n._state?o.onFulfilled:o.onRejected;if(null!==e){try{t=e(n._value)}catch(t){return void c(o.promise,t)}a(o.promise,t)}else(1===n._state?a:c)(o.promise,n._value)})):n._deferreds.push(o)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void f((o=n,r=t,function(){o.apply(r,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}var o,r}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,c(e,t))})}catch(t){if(n)return;n=!0,c(e,t)}}t=o,e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return u(this,new l(t,e,n)),n},i.all=function(t){var a=Array.prototype.slice.call(t);return new i(function(r,i){if(0===a.length)return r([]);for(var u=a.length,t=0;t<a.length;t++)!function e(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if("function"==typeof o)return o.call(t,function(t){e(n,t)},i),0}a[n]=t,0==--u&&r(a)}catch(t){i(t)}}(t,a[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(r){return new i(function(t,e){for(var n=0,o=r.length;n<o;n++)r[n].then(t,e)})},i._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},t.exports?t.exports=i:e.Promise||(e.Promise=i);var d=o.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof Ay&&void 0!==By?By.exports=e():(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=e()}();var Vy,Hy,Ly=By.exports.boltExport,zy=function(t){function o(t){r()?i(t):e.push(t)}var n=vt.none(),e=[],r=function(){return n.isSome()},i=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){r()||(n=vt.some(t),St(e,i),e=[])}),{get:o,map:function(n){return zy(function(e){o(function(t){e(n(t))})})},isReady:r}},Uy={nu:zy,pure:function(e){return zy(function(t){t(e)})}},jy=function(n){function t(t){n().then(t,My)}return{map:function(t){return jy(function(){return n().then(t)})},bind:function(e){return jy(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return jy(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return Uy.nu(t)},toCached:function(){var t=null;return jy(function(){return t=null===t?n():t})},toPromise:n,get:t}},Wy=function(t){return jy(function(){return new Ly(t)})},Gy=function(t){return jy(function(){return Ly.resolve(t)})},Xy=["input","textarea"],Yy=Object.freeze({__proto__:null,markValid:Iy,markInvalid:Ry,query:Ny,run:Py,isInvalid:function(t,e){return Kr(e.getRoot(t).getOr(t.element),e.invalidClass)}}),qy=Object.freeze({__proto__:null,events:function(e,t){return e.validator.map(function(t){return nu([Cr(t.onEvent,function(t){Py(t,e).get(h)})].concat(t.validateOnLoad?[ou(function(t){Py(t,e).get(st)})]:[]))}).getOr({})}}),Ky=xa({fields:[mo("invalidClass"),Eo("getRoot",vt.none),To("notify",[Eo("aria","alert"),Eo("getContainer",vt.none),Eo("validHtml",""),Ju("onValid"),Ju("onInvalid"),Ju("onValidate")]),To("validator",[mo("validate"),Eo("onEvent","input"),Eo("validateOnLoad",!0)])],name:"invalidating",active:qy,apis:Yy,extra:{validation:function(n){return function(t){var e=Df.getValue(t);return Gy(n(e))}}}}),Jy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,o){return n.getOrCreate(t,e,o)}}),$y=xa({fields:[go("others",uo(Nn.value,Zo()))],name:"coupling",apis:Jy,state:Object.freeze({__proto__:null,init:function(){var i={},t=rt({});return wu({readState:t,getOrCreate:function(n,o,r){var t=Ct(o.others);if(t)return tt(i,r).getOrThunk(function(){var t=tt(o.others,r).getOrDie("No information found for coupled component: "+r)(n),e=n.getSystem().build(t);return i[r]=e});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(t,null,2))}})}})}),Qy=rt("sink"),Zy=rt(Qf({name:Qy(),overrides:rt({dom:{tag:"div"},behaviours:ec([ff.config({useFixed:D})]),events:nu([Dr(xi()),Dr(mi()),Dr(Ci())])})}));function tx(t,e){var n=t.getHotspot(e).getOr(e),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:"hotspot",hotspot:n,overrides:o}},function(t){return{type:"hotspot",hotspot:n,overrides:o,layouts:t}})}function ex(t,e,n,o,r,i,u){var a,c=tx(t,n),s=n,l=o,f=r,d=u,m=e,g=(0,(a=t).fetch)(s).map(m),p=mw(s,a);return g.map(function(t){return t.bind(function(t){return vt.from(ip.sketch(lt(lt({},f.menu()),{uid:pu(""),data:t,highlightImmediately:d===Vy.HighlightFirst,onOpenMenu:function(t,e){var n=p().getOrDie();ff.position(n,e,{anchor:c}),bf.decloak(l)},onOpenSubmenu:function(t,e,n){var o=p().getOrDie();ff.position(o,n,{anchor:{type:"submenu",item:e}}),bf.decloak(l)},onRepositionMenu:function(t,e,n){var o=p().getOrDie();ff.position(o,e,{anchor:c}),St(n,function(t){ff.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return Vg.focus(s),bf.close(l),vt.some(!0)}})))})}).map(function(t){return t.fold(function(){bf.isOpen(o)&&bf.close(o)},function(t){bf.cloak(o),bf.open(o,t),i(o)}),o})}function nx(t,e,n,o,r,i){var u=$y.getCoupled(n,"sandbox");return(bf.isOpen(u)?function(t,e,n,o,r,i,u){return bf.close(o),Gy(o)}:ex)(t,e,n,u,o,r,i)}function ox(t){bf.getState(t).each(function(t){ip.repositionMenus(t)})}function rx(s,l,f){var d=Nu(),t=mw(l,s);return{dom:{tag:"div",classes:s.sandboxClasses,attributes:{id:d.id,role:"listbox"}},behaviours:Bf(s.sandboxBehaviours,[Df.config({store:{mode:"memory",initialValue:l}}),bf.config({onOpen:function(t,e){var n,o,r,i,u,a,c=tx(s,l);d.link(l.element),s.matchWidth&&(n=c.hotspot,o=e,r=s.useMinWidth,u=cd.getCurrent(o).getOr(o),a=Ce(n.element),r?fe(u.element,"min-width",a+"px"):(i=u.element,On.set(i,a))),s.onOpen(c,t,e),void 0!==f&&void 0!==f.onOpen&&f.onOpen(t,e)},onClose:function(t,e){d.unlink(l.element),void 0!==f&&void 0!==f.onClose&&f.onClose(t,e)},isPartOf:function(t,e,n){return Hu(e,n)||Hu(l,n)},getAttachPoint:function(){return t().getOrDie()}}),cd.config({find:function(t){return bf.getState(t).bind(function(t){return cd.getCurrent(t)})}}),ic.config({channels:lt(lt({},Xs({isExtraPart:T})),Ys({doReposition:ox}))})])}}function ix(t){ox($y.getCoupled(t,"sandbox"))}function ux(){return[Eo("sandboxClasses",[]),Af("sandboxBehaviours",[cd,ic,bf,Df])]}function ax(e){return Qf({name:e+"-edge",overrides:function(t){return t.model.manager.edgeActions[e].fold(function(){return{}},function(o){return{events:nu([Or(si(),function(t,e,n){return o(t,n)},[t]),Or(mi(),function(t,e,n){return o(t,n)},[t]),Or(gi(),function(t,e,n){n.mouseIsDown.get()&&o(t,n)},[t])])}})}})}function cx(t){var e=t.event.raw;return-1===e.type.indexOf("touch")?void 0!==e.clientX?vt.some(e).map(function(t){return kn(t.clientX,t.clientY)}):vt.none():void 0!==e.touches&&1===e.touches.length?vt.some(e.touches[0]).map(function(t){return kn(t.clientX,t.clientY)}):vt.none()}function sx(t){return t.model.minX}function lx(t){return t.model.minY}function fx(t){return t.model.minX-1}function dx(t){return t.model.minY-1}function mx(t){return t.model.maxX}function gx(t){return t.model.maxY}function px(t){return t.model.maxX+1}function hx(t){return t.model.maxY+1}function vx(t,e,n){return e(t)-n(t)}function bx(t){return vx(t,mx,sx)}function yx(t){return vx(t,gx,lx)}function xx(t){return bx(t)/2}function wx(t){return yx(t)/2}function Sx(t){return t.stepSize}function kx(t){return t.snapToGrid}function Cx(t){return t.snapStart}function Ox(t){return t.rounded}function _x(t,e){return void 0!==t[e+"-edge"]}function Tx(t){return _x(t,"left")}function Ex(t){return _x(t,"right")}function Dx(t){return _x(t,"top")}function Ax(t){return _x(t,"bottom")}function Bx(t){return t.model.value.get()}function Mx(t,e){return{x:t,y:e}}function Fx(t,e){br(t,Aw(),{value:e})}function Ix(t,e,n,o){return t<e?t:n<t?n:t===e?e-1:Math.max(e,t-o)}function Rx(t,e,n,o){return n<t?t:t<e?e:t===n?n+1:Math.min(n,t+o)}function Nx(t,e,n){return Math.max(e,Math.min(n,t))}function Px(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,p=l?n+1:n;if(r<f)return g;if(d<r)return p;var h,v,b,y,x,w=Nx((x=f,Math.min(d,Math.max(r,x))-x)/m*o+e,g,p);return u&&e<=w&&w<=n?(h=w,v=e,b=n,y=i,a.fold(function(){var t=Math.round((h-v)/y)*y;return Nx(v+t,v-1,b+1)},function(t){var e=Math.round((h-t)%y/y),n=Math.floor((h-t)/y),o=Math.floor((b-t)/y),r=Math.min(o,n+e);return Math.max(t,t+r*y)})):c?Math.round(w):w}function Vx(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<e?i?0:s:n<r?u?a:l:(r-e)/o*c}function Hx(t){return t.element.dom.getBoundingClientRect()}function Lx(t){return Hx(t)[Bw]}function zx(t){return Hx(t).right}function Ux(t){return Hx(t).top}function jx(t){return Hx(t).bottom}function Wx(t){return Hx(t).width}function Gx(t){return Hx(t).height}function Xx(t,e){var n=Hx(t),o=Hx(e);return(n[Bw]+n.right)/2-o[Bw]}function Yx(t,e){var n=Hx(t),o=Hx(e);return(n.top+n.bottom)/2-o.top}function qx(t,e){br(t,Aw(),{value:e})}function Kx(t,e,n){return Px({min:sx(e),max:mx(e),range:bx(e),value:n,step:Sx(e),snap:kx(e),snapStart:Cx(e),rounded:Ox(e),hasMinEdge:Tx(e),hasMaxEdge:Ex(e),minBound:Lx(t),maxBound:zx(t),screenRange:Wx(t)})}function Jx(r){return function(t,e){return qx(t,{x:o=(0<r?Rx:Ix)(Bx(n=e).x,sx(n),mx(n),Sx(n))}),vt.some(o).map(D);var n,o}}function $x(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=n,s=o,l=r,f=Wx(u=e),d=s.bind(function(t){return vt.some(Xx(t,u))}).getOr(0),m=l.bind(function(t){return vt.some(Xx(t,u))}).getOr(f),Vx({min:sx(a),max:mx(a),range:bx(a),value:c,hasMinEdge:Tx(a),hasMaxEdge:Ex(a),minBound:Lx(u),minOffset:0,maxBound:zx(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return Lx(e)-Lx(t)+g}function Qx(t,e){br(t,Aw(),{value:e})}function Zx(t,e,n){return Px({min:lx(e),max:gx(e),range:yx(e),value:n,step:Sx(e),snap:kx(e),snapStart:Cx(e),rounded:Ox(e),hasMinEdge:Dx(e),hasMaxEdge:Ax(e),minBound:Ux(t),maxBound:jx(t),screenRange:Gx(t)})}function t0(r){return function(t,e){return Qx(t,{y:o=(0<r?Rx:Ix)(Bx(n=e).y,lx(n),gx(n),Sx(n))}),vt.some(o).map(D);var n,o}}function e0(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=n,s=o,l=r,f=Gx(u=e),d=s.bind(function(t){return vt.some(Yx(t,u))}).getOr(0),m=l.bind(function(t){return vt.some(Yx(t,u))}).getOr(f),Vx({min:lx(a),max:gx(a),range:yx(a),value:c,hasMinEdge:Dx(a),hasMaxEdge:Ax(a),minBound:Ux(u),minOffset:0,maxBound:jx(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return Ux(e)-Ux(t)+g}function n0(t,e){br(t,Aw(),{value:e})}function o0(t,e){return{x:t,y:e}}function r0(u,a){return function(t,e){return o=e,r=0<u?Rx:Ix,n0(t,o0(i=(n=a)?Bx(o).x:r(Bx(o).x,sx(o),mx(o),Sx(o)),n?r(Bx(o).y,lx(o),gx(o),Sx(o)):Bx(o).y)),vt.some(i).map(D);var n,o,r,i}}function i0(t){return"<alloy.field."+t+">"}function u0(f,d,m,g){function p(t,e,n,o,r){var i,u,a=f(uS+"range"),c=[my.parts.label({dom:{tag:"label",innerHtml:n,attributes:{"aria-label":o}}}),my.parts.field({data:r,factory:Dy,inputAttributes:lt({type:"text"},"hex"===e?{"aria-live":"polite"}:{}),inputClasses:[d("textfield")],inputBehaviours:ec([(i=e,u=t,Ky.config({invalidClass:d("invalid"),notify:{onValidate:function(t){br(t,iS,{type:i})},onValid:function(t){br(t,oS,{type:i,value:Df.getValue(t)})},onInvalid:function(t){br(t,rS,{type:i,value:Df.getValue(t)})}},validator:{validate:function(t){var e=Df.getValue(t),n=u(e)?Nn.value(!0):Nn.error(f("aria.input.invalid"));return Gy(n)},validateOnLoad:!1}})),py.config({})]),onSetValue:function(t){Ky.isInvalid(t)&&Ky.run(t).get(st)}})],s="hex"!==e?[my.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}}function h(t,e){var n=e.red,o=e.green,r=e.blue;Df.setValue(t,{red:n,green:o,blue:r})}function v(t,e){b.getOpt(t).each(function(t){fe(t.element,"background-color","#"+e.value)})}var b=Hm({dom:{tag:"div",classes:[d("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return kl({factory:function(){function a(t){return o[t].get()}function c(t,e){o[t].set(e)}function e(t,e){var n=e.event;"hex"!==n.type?c(n.type,vt.none()):g(t)}function n(t,e){var r,n,o,i,u=e.event;"hex"===u.type?function(t,e){m(t);var n=Bv(e);c("hex",vt.some(e));var o=Vv(n);h(t,o),s(o),br(t,Qw,{hex:n}),v(t,n)}(t,u.value):(r=t,n=u.type,o=u.value,i=parseInt(o,10),c(n,vt.some(i)),a("red").bind(function(n){return a("green").bind(function(e){return a("blue").map(function(t){return Rv(n,e,t,1)})})}).each(function(t){var e,n,o=(e=r,n=Iv(t),nS.getField(e,"hex").each(function(t){Vg.isFocused(t)||Df.setValue(e,{hex:n.value})}),n);br(r,Qw,{hex:o}),v(r,o)}))}function t(t){return{label:f(uS+t+".label"),description:f(uS+t+".description")}}function s(t){var e=t.red,n=t.green,o=t.blue;c("red",vt.some(e)),c("green",vt.some(n)),c("blue",vt.some(o))}var o={red:Po(vt.some(255)),green:Po(vt.some(255)),blue:Po(vt.some(255)),hex:Po(vt.some("ffffff"))},r=t("red"),i=t("green"),u=t("blue"),l=t("hex");return Yo(nS.sketch(function(t){return{dom:{tag:"form",classes:[d("rgb-form")],attributes:{"aria-label":f("aria.color.picker")}},components:[t.field("red",my.sketch(p(Nv,"red",r.label,r.description,255))),t.field("green",my.sketch(p(Nv,"green",i.label,i.description,255))),t.field("blue",my.sketch(p(Nv,"blue",u.label,u.description,255))),t.field("hex",my.sketch(p(Mv,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:ec([Ky.config({invalidClass:d("form-invalid")}),mm("rgb-form-events",[Cr(oS,n),Cr(rS,e),Cr(iS,e)])])}}),{apis:{updateHex:function(t,e){var n;Df.setValue(t,{hex:e.value}),h(t,n=Vv(e)),s(n),v(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})}function a0(x,w){return kl({name:"ColourPicker",configFields:[mo("dom"),Eo("onValidHex",st),Eo("onInvalidHex",st)],factory:function(t){function e(t,e,n){v.getOpt(t).each(function(t){g.setHue(t,n)})}function n(t,e){b.getOpt(t).each(function(t){m.updateHex(t,e)})}function r(e,n,o,t){var r=o,i=Vv(n);p.paletteRgba.set(i),p.paletteHue.set(r),St(t,function(t){t(e,n,o)})}var o,i,u,a,c,s,l,f,d,m=u0(x,w,t.onValidHex,t.onInvalidHex),g=(l=w,f=$w.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[l("sv-palette-spectrum")]}}),d=$w.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette-thumb")],innerHtml:"<div class="+l("sv-palette-inner-thumb")+' role="presentation"></div>'}}),kl({factory:function(t){var e=rt({x:0,y:0}),n=ec([cd.config({find:vt.some}),Vg.config({})]);return $w.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette")]},model:{mode:"xy",getInitialValue:e},rounded:!1,components:[f,d],onChange:function(t,e,n){br(t,tS,{value:n})},onInit:function(t,e,n,o){y(n.element.dom,zv(fb))},sliderBehaviours:n})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){var o=n;y(e.components()[0].element.dom,zv(Pv(jv(o,100,100))))},setThumb:function(t,e,n){var o=e,r=Wv(Vv(n));$w.setValue(o,{x:r.saturation,y:100-r.value})}},extraApis:{}})),p={paletteRgba:Po(fb),paletteHue:Po(0)},h=Hm((i=$w.parts.spectrum({dom:{tag:"div",classes:[(o=w)("hue-slider-spectrum")],attributes:{role:"presentation"}}}),u=$w.parts.thumb({dom:{tag:"div",classes:[o("hue-slider-thumb")],attributes:{role:"presentation"}}}),$w.sketch({dom:{tag:"div",classes:[o("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:rt({y:0})},components:[i,u],sliderBehaviours:ec([Vg.config({})]),onChange:function(t,e,n){br(t,Zw,{value:n})}}))),v=Hm(g.sketch({})),b=Hm(m.sketch({}));function y(t,e){var n,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=e,u.fillRect(0,0,r,i),(n=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),n.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=n,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))}return{uid:t.uid,dom:t.dom,components:[v.asSpec(),h.asSpec(),b.asSpec()],behaviours:ec([mm("colour-picker-events",[Cr(Qw,(s=[e,function(t,e,n){h.getOpt(t).each(function(t){$w.setValue(t,{y:100-n/360*100})})},function(t,e){v.getOpt(t).each(function(t){g.setThumb(t,e)})}],function(t,e){var n=e.event.hex;r(t,n,Wv(Vv(n)).hue,s)})),Cr(tS,(c=[n],function(t,e){var n=e.event.value,o=p.paletteHue.get();r(t,Gv(jv(o,n.x,100-n.y)),o,c)})),Cr(Zw,(a=[e,n],function(t,e){var n=(100-e.event.value.y)/100*360,o=Wv(p.paletteRgba.get());r(t,Gv(jv(n,o.saturation,o.value)),n,a)}))]),cd.config({find:function(t){return b.getOpt(t)}}),Fg.config({mode:"acyclic"})])}}})}function c0(t){return sS[t]}function s0(t,e,n){return Df.config(Yo({store:{mode:"manual",getValue:e,setValue:n}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))}function l0(r,i){function e(t,e){e.stop()}function n(t){return function(e,n){St(t,function(t){t(e,n)})}}function o(t,e){var n;gd.isDisabled(t)||(n=e.event.raw,a(t,n.dataTransfer.files))}function u(t,e){var n=e.event.raw.target;a(t,n.files)}function a(t,e){var n,o;Df.setValue(t,(n=e,o=fS.explode(i.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),F(kt(n),function(e){return d(o,function(t){return At(e.name.toLowerCase(),"."+t.toLowerCase())})}))),br(t,yy,{name:r.name})}var c=Hm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ec([mm("input-file-events",[Dr(Ci()),Dr(Ni())])])});return ny(r.label.map(function(t){return oy(t,i)}),my.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ec([pS([]),aw(),gd.config({}),zg.config({toggleClass:"dragenter",toggleOnExecute:!1}),mm("dropzone-events",[Cr("dragenter",n([e,zg.toggle])),Cr("dragleave",n([e,zg.toggle])),Cr("dragover",e),Cr("drop",n([e,o])),Cr(ki(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:i.translate("Drop an image here")}},fp.sketch({dom:{tag:"button",innerHtml:i.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:ec([py.config({}),$v(i.isDisabled),pv()])})]}]}}}}),["tox-form__group--stretched"],[])}function f0(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ec([Vg.config({ignore:!0}),py.config({})])}}function d0(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[f0([hS]),t,f0([vS])],behaviours:ec([cS(1)])}}function m0(t,e){br(t,xi(),{raw:{which:9,shiftKey:e}})}function g0(t,e){var n=e.element;Kr(n,hS)?m0(t,!0):Kr(n,vS)&&m0(t,!1)}function p0(t){return Yb(t,["."+hS,"."+vS].join(","),T)}function h0(t,e){return xS(document.createElement("canvas"),t,e)}function v0(t){var e=h0(t.width,t.height);return yS(e).drawImage(t,0,0),e}function b0(t){return t.naturalWidth||t.width}function y0(t){return t.naturalHeight||t.height}function x0(t,o,r){return o=o||"image/png",S(HTMLCanvasElement.prototype.toBlob)?new Ly(function(e,n){t.toBlob(function(t){t?e(t):n()},o,r)}):(g=t.toDataURL(o,r),new Ly(function(t,e){!function(){var t=g.split(","),e=/data:([^;]+)/.exec(t[0]);if(!e)return vt.none();for(var n=e[1],o=t[1],r=atob(o),i=r.length,u=Math.ceil(i/1024),a=new Array(u),c=0;c<u;++c){for(var s=1024*c,l=Math.min(1024+s,i),f=new Array(l-s),d=s,m=0;d<l;++m,++d)f[m]=r[d].charCodeAt(0);a[c]=new Uint8Array(f)}return vt.some(new Blob(a,{type:n}))}().fold(function(){e("uri is not base64: "+g)},t)}));var g}function w0(t,e,n){function o(e,n){return t.then(function(t){return t.toDataURL(e||"image/png",n)})}return{getType:rt(e.type),toBlob:function(){return Ly.resolve(e)},toDataURL:rt(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return x0(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(v0)}}}function S0(e,t){return x0(e,t).then(function(t){return w0(Ly.resolve(e),t,e.toDataURL())})}function k0(e){return n=e,new Ly(function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)}).then(function(t){return w0((a=e,new Ly(function(t,e){function n(){r.removeEventListener("load",i),r.removeEventListener("error",u)}var o=URL.createObjectURL(a),r=new Image,i=function(){n(),t(r)},u=function(){n(),e("Unable to load data of type "+a.type+": "+o)};r.addEventListener("load",i),r.addEventListener("error",u),r.src=o,r.complete&&setTimeout(i,0)}).then(function(t){wS(t);var e=h0(b0(t),y0(t));return yS(e).drawImage(t,0,0),e})),e,t);var a});var n}function C0(t,e,n){var o="string"==typeof t?parseFloat(t):t;return n<o?o=n:o<e&&(o=e),o}function O0(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}function _0(t,e){for(var n=[],o=new Array(25),r=0;r<5;r++){for(var i=0;i<5;i++)n[i]=e[i+5*r];for(i=0;i<5;i++){for(var u=0,a=0;a<5;a++)u+=t[i+5*a]*n[a];o[i+5*r]=u}}return o}function T0(e,n){return e.toCanvas().then(function(t){return kS(t,e.getType(),n)})}function E0(n){return function(t,e){return T0(t,n(O0(),e))}}function D0(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),o=Math.round(t*n);return Math.ceil(o/n)}function A0(t){return CS(t)}function B0(t){return TS(t)}function M0(t,e){return ES(t,e)}function F0(t,e){return OS(t,e)}function I0(t,e){return _S(t,e)}function R0(t,e){return o=e,(n=t).toCanvas().then(function(t){return MS(t,n.getType(),o)});var n,o}function N0(t,e){return o=e,(n=t).toCanvas().then(function(t){return BS(t,n.getType(),o)});var n,o}function P0(t,e,n){return Xm(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)}function V0(t,e){return P0(t,e,[])}function H0(t,e){return P0(t,e,[Rg.config({})])}function L0(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:ec([Rg.config({})])}}function z0(e,n,o){function t(t,e){var n=Df.getValue(t);return Vg.focus(n),br(n,"keydown",{raw:e.event.raw}),hw.close(n),vt.some(!0)}var r=Po(st),i=e.text.map(function(t){return Hm(L0(t,n,o.providers))}),u=e.icon.map(function(t){return Hm(H0(t,o.providers.icons))}),a=e.role.fold(function(){return{}},function(t){return{role:t}}),c=e.tooltip.fold(function(){return{}},function(t){var e=o.providers.translate(t);return{title:e,"aria-label":e}}),s=Xm("chevron-down",{tag:"div",classes:[n+"__select-chevron"]},o.providers.icons);return Hm(hw.sketch(lt(lt(lt({},e.uid?{uid:e.uid}:{}),a),{dom:{tag:"button",classes:[n,n+"--select"].concat(B(e.classes,function(t){return n+"--"+t})),attributes:lt({},c)},components:tb([u.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),vt.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ec(V(V([],e.dropdownBehaviours,!0),[$v(function(){return e.disabled||o.providers.isDisabled()}),pv(),vw.config({}),Rg.config({}),mm("dropdown-events",[vv(e,r),bv(e,r)]),mm("menubutton-update-display-text",[Cr(NS,function(e,n){i.bind(function(t){return t.getOpt(e)}).each(function(t){Rg.set(t,[ri(o.providers.translate(n.event.text))])})}),Cr(PS,function(e,n){u.bind(function(t){return t.getOpt(e)}).each(function(t){Rg.set(t,[H0(n.event.icon,o.providers.icons)])})})])],!1)),eventOrder:Yo(RS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ec([Fg.config({mode:"special",onLeft:t,onRight:t})]),lazySink:o.getSink,toggleClass:n+"--active",parts:{menu:Zp(0,e.columns,e.presets)},fetch:function(t){return Wy(C(e.fetch,t))}}))).asSpec()}function U0(t){return"separator"===t.type}function j0(t,n,o,e){var r=Ir("primary-menu"),i=HS(t,o.shared.providers.menuItems());if(0===i.items.length)return vt.none();var u=Gb(r,i.items,n,o,e),a=dt(i.menus,function(t,e){return Gb(e,t,n,o,!1)}),c=Yo(a,sr(r,u));return vt.from(ip.tieredData(r,c,i.expansions))}function W0(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)},setActive:function(t){var e=n.element;t?(Yr(e,"tox-tbtn--enabled"),oe(e,"aria-pressed",!0)):(qr(e,"tox-tbtn--enabled"),ce(e,"aria-pressed"))},isActive:function(){return Kr(n.element,"tox-tbtn--enabled")}}}function G0(n,t,o,e){return z0({text:n.text,icon:n.icon,tooltip:n.tooltip,role:e,fetch:function(t,e){n.fetch(function(t){e(j0(t,Sh.CLOSE_ON_EXECUTE,o,!1))})},onSetup:n.onSetup,getApi:W0,columns:1,presets:"normal",classes:[],dropdownBehaviours:[py.config({})]},t,o.shared)}function X0(t,e,n,o,r,i){void 0===n&&(n=[]);var u=e.fold(function(){return{}},function(t){return{action:t}}),a=lt({buttonBehaviours:ec([$v(function(){return t.disabled||i.isDisabled()}),pv(),py.config({}),mm("button press",[kr("click"),kr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Yo(a,{dom:o});return Yo(c,{components:r})}function Y0(t,e,n,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},i=t.icon.map(function(t){return V0(t,n.icons)});return X0(t,e,o,r,tb([i]),n)}function q0(t,e,n,o){void 0===o&&(o=[]);var r=Y0(t,vt.some(e),n,o);return fp.sketch(r)}function K0(t,e,n,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=n.translate(t.text),u=t.icon?t.icon.map(function(t){return V0(t,n.icons)}):vt.none(),a=u.isSome()?tb([u]):[],c=u.isSome()?{}:{innerHtml:i},s=V(V(V(V([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),r,!0);return X0(t,e,o,lt(lt({tag:"button",classes:s},c),{attributes:{title:i}}),a,n)}function J0(t,e,n,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=K0(t,vt.some(e),n,o,r);return fp.sketch(i)}function $0(e,n){return function(t){"custom"===n?br(t,Sy,{name:e,value:{}}):"submit"===n?vr(t,ky):"cancel"===n?vr(t,wy):console.error("Unknown button type: ",n)}}function Q0(e,t,n){if("menu"===t){var o=e,r=Hm(G0(lt(lt({},e),{onSetup:function(t){return t.setDisabled(e.disabled),st},fetch:(i=o.items,u=function(){return r},a=n,function(t){t(B(i,function(t){var e,n,o=t.text.fold(function(){return{}},function(t){return{text:t}});return lt(lt({type:t.type,active:!1},o),{onAction:function(t){var e=!t.isActive();t.setActive(e),n.storage.set(e),a.shared.getSink().each(function(t){u().getOpt(t).each(function(t){ka(t.element),br(t,Sy,{name:n.name,value:n.storage.get()})})})},onSetup:(e=n=t,function(t){t.setActive(e.storage.get())})})}))})}),"tox-tbtn",n,vt.none()));return r.asSpec()}var i,u,a;if("custom"===t||"cancel"===t||"submit"===t){var c=$0(e.name,t);return J0(lt(lt({},e),{borderless:!1}),c,n.shared.providers,[])}console.error("Unknown footer button type: ",t)}function Z0(t,e){return Jf({factory:my,name:t,overrides:function(o){return{fieldBehaviours:ec([mm("coupled-input-behaviour",[Cr(Si(),function(n){ml(n,o,e).bind(cd.getCurrent).each(function(e){ml(n,o,"lock").each(function(t){zg.isOn(t)&&o.onLockedChange(n,e,t)})})})])])}}})}function tw(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===e)return Nn.error(t);var n=parseFloat(e[1]),o=e[2];return Nn.value({value:n,unit:o})}function ew(t,e){function n(t){return Tt(o,t)}var o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1};return t.unit===e?vt.some(t.value):n(t.unit)&&n(e)?o[t.unit]===o[e]?vt.some(t.value):vt.some(t.value/o[t.unit]*o[e]):vt.none()}function nw(t){return vt.none()}function ow(o,e){function t(t){return Xm(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)}function n(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}}function r(n){return my.parts.field({factory:Dy,inputClasses:["tox-textfield"],inputBehaviours:ec([gd.config({disabled:function(){return o.disabled||e.isDisabled()}}),pv(),py.config({}),mm("size-input-events",[Cr(bi(),function(t,e){br(t,u,{isField1:n})}),Cr(ki(),function(t,e){br(t,yy,{name:o.name})})])]),selectOnFocus:!1})}function i(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}}var l=nw,u=Ir("ratio-event"),a=US.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(o.label.getOr("Constrain proportions"))}},components:[t("lock"),t("unlock")],buttonBehaviours:ec([gd.config({disabled:function(){return o.disabled||e.isDisabled()}}),pv(),py.config({})])}),c=US.parts.field1(n([my.parts.label(i("Width")),r(!0)])),s=US.parts.field2(n([my.parts.label(i("Height")),r(!1)]));return US.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,n([i("&nbsp;"),a])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,e){tw(Df.getValue(t)).each(function(t){l(t).each(function(t){var e,n,o,r;Df.setValue(i,(r=-1!==(r=(e=t).value.toFixed((n=e.unit)in(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4})?o[n]:1)).indexOf(".")?r.replace(/\.?0*$/,""):r)+e.unit)})})},coupledFieldBehaviours:ec([gd.config({disabled:function(){return o.disabled||e.isDisabled()},onDisabled:function(t){US.getField1(t).bind(my.getField).each(gd.disable),US.getField2(t).bind(my.getField).each(gd.disable),US.getLock(t).each(gd.disable)},onEnabled:function(t){US.getField1(t).bind(my.getField).each(gd.enable),US.getField2(t).bind(my.getField).each(gd.enable),US.getLock(t).each(gd.enable)}}),pv(),mm("size-input-events2",[Cr(u,function(t,e){var n,o,r,i=e.event.isField1,u=i?US.getField1(t):US.getField2(t),a=i?US.getField2(t):US.getField1(t),c=u.map(Df.getValue).getOr(""),s=a.map(Df.getValue).getOr("");n=s,o=tw(c).toOptional(),r=tw(n).toOptional(),l=Et(o,r,function(t,o){return ew(t,o.unit).map(function(t){return o.value/t}).map(function(t){return e=t,n=o.unit,function(t){return ew(t,n).map(function(t){return{value:t*e,unit:n}})};var e,n}).getOr(nw)}).getOr(nw)})])])})}function rw(f,c){function t(t,e,n,o){return Hm(J0({name:t,text:t,disabled:n,primary:o,icon:vt.none(),borderless:!1},e,c))}function e(t,e,n,o){return Hm(q0({name:t,icon:vt.some(t),tooltip:vt.some(e),disabled:o,primary:!1,borderless:!1},n,c))}function d(t,n){t.map(function(t){var e=t.get(n);e.hasConfigured(gd)&&gd.disable(e)})}function m(t,n){t.map(function(t){var e=t.get(n);e.hasConfigured(gd)&&gd.enable(e)})}function r(t,e,n){br(t,e,n)}function i(t){return vr(t,YS.disable()),0}function u(t){return vr(t,YS.enable()),0}function g(t,e){i(t),r(t,jS.transform(),{transform:e}),u(t)}function n(t){return function(){q.getOpt(t).each(function(t){Rg.set(t,[Y])})}}function s(t,e){i(t),r(t,jS.transformApply(),{transform:e,swap:n(t)}),u(t)}function p(){return t("Back",function(t){return r(t,jS.back(),{swap:n(t)})},!1,!1)}function o(){return Hm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ec([gd.config({})])})}function h(){return t("Apply",function(t){return r(t,jS.apply(),{swap:n(t)})},!0,!0)}function v(e,n){return function(t){return e(t,n)}}function a(t,e){var n,o=e;i(n=t),r(n,jS.tempTransform(),{transform:o}),u(n)}function b(t,e,n,o,r){var i=$w.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=$w.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=$w.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Hm($w.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:n,maxX:r,getInitialValue:rt({x:o})},components:[i,u,a],sliderBehaviours:ec([Vg.config({})]),onChoose:e}))}function l(t,e,n,o,r){var i,u,a,c,s,l,f=(i=t,u=e,a=n,c=o,s=r,[p(),(l=u,b(i,function(t,e,n){g(t,v(l,n.x/100))},a,c,s)),h()]);return ly.sketch({dom:w,components:f.map(function(t){return t.asSpec()}),containerBehaviours:ec([mm("image-tools-filter-panel-buttons-events",[Cr(YS.disable(),function(t,e){d(f,t)}),Cr(YS.enable(),function(t,e){m(f,t)})])])})}function y(t){return b(t,function(l,t,e){var n=H.getOpt(l),o=z.getOpt(l),r=L.getOpt(l);n.each(function(s){o.each(function(c){r.each(function(t){var o,r,i,e=Df.getValue(s).x/100,n=Df.getValue(t).x/100,u=Df.getValue(c).x/100,a=(o=e,r=n,i=u,function(t){return T0(t,(e=r,n=i,_0(O0(),[C0(o,0,2),0,0,0,0,0,C0(e,0,2),0,0,0,0,0,C0(n,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var e,n});g(l,a)})})})},0,100,200)}function x(e,n,o){return function(t){r(t,jS.swap(),{transform:n,swap:function(){q.getOpt(t).each(function(t){Rg.set(t,[e]),o(t)})}})}}var w={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},S=st,k=[p(),o(),t("Apply",function(t){s(t,function(t){var e,n,o,r,i,u,a,c,s,l=f.getRect();return e=l.x,n=l.y,o=l.w,r=l.h,u=e,a=n,c=o,s=r,(i=t).toCanvas().then(function(t){return FS(t,i.getType(),u,a,c,s)})}),f.hideCrop()},!1,!0)],C=ly.sketch({dom:w,components:k.map(function(t){return t.asSpec()}),containerBehaviours:ec([mm("image-tools-crop-buttons-events",[Cr(YS.disable(),function(t,e){d(k,t)}),Cr(YS.enable(),function(t,e){m(k,t)})])])}),O=Hm(ow({name:"size",label:vt.none(),constrain:!0,disabled:!1},c)),_=[p(),o(),O,o(),t("Apply",function(a){O.getOpt(a).each(function(t){var r,i,e=Df.getValue(t),n=parseInt(e.width,10),o=parseInt(e.height,10),u=(r=n,i=o,function(t){return n=r,o=i,(e=t).toCanvas().then(function(t){return DS(t,n,o).then(function(t){return S0(t,e.getType())})});var e,n,o});s(a,u)})},!1,!0)],T=ly.sketch({dom:w,components:_.map(function(t){return t.asSpec()}),containerBehaviours:ec([mm("image-tools-resize-buttons-events",[Cr(YS.disable(),function(t,e){d(_,t)}),Cr(YS.enable(),function(t,e){m(_,t)})])])}),E=v(R0,"h"),D=v(R0,"v"),A=v(N0,-90),B=v(N0,90),M=[p(),o(),e("flip-horizontally","Flip horizontally",function(t){a(t,E)},!1),e("flip-vertically","Flip vertically",function(t){a(t,D)},!1),e("rotate-left","Rotate counterclockwise",function(t){a(t,A)},!1),e("rotate-right","Rotate clockwise",function(t){a(t,B)},!1),o(),h()],F=ly.sketch({dom:w,components:M.map(function(t){return t.asSpec()}),containerBehaviours:ec([mm("image-tools-fliprotate-buttons-events",[Cr(YS.disable(),function(t,e){d(M,t)}),Cr(YS.enable(),function(t,e){m(M,t)})])])}),I=[p(),o(),h()],R=ly.sketch({dom:w,components:I.map(function(t){return t.asSpec()})}),N=l("Brightness",F0,-100,0,100),P=l("Contrast",I0,-100,0,100),V=l("Gamma",M0,-100,0,100),H=y("R"),L=y("G"),z=y("B"),U=[p(),H,L,z,h()],j=ly.sketch({dom:w,components:U.map(function(t){return t.asSpec()})}),W=vt.some(B0),G=vt.some(A0),X=[e("crop","Crop",x(C,vt.none(),function(t){f.showCrop()}),!1),e("resize","Resize",x(T,vt.none(),function(t){O.getOpt(t).each(function(t){var e=f.getMeasurements(),n=e.width,o=e.height;Df.setValue(t,{width:n,height:o})})}),!1),e("orientation","Orientation",x(F,vt.none(),S),!1),e("brightness","Brightness",x(N,vt.none(),S),!1),e("sharpen","Sharpen",x(R,W,S),!1),e("contrast","Contrast",x(P,vt.none(),S),!1),e("color-levels","Color levels",x(j,vt.none(),S),!1),e("gamma","Gamma",x(V,vt.none(),S),!1),e("invert","Invert",x(R,G,S),!1)],Y=ly.sketch({dom:w,components:X.map(function(t){return t.asSpec()})}),q=Hm(ly.sketch({dom:{tag:"div"},components:[Y],containerBehaviours:ec([Rg.config({})])}));return{memContainer:q,getApplyButton:function(t){return q.getOpt(t).map(function(t){var e=t.components()[0];return e.components()[e.components().length-1]})}}}function iw(t){if(k(t.changedTouches))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}(Hy=Vy=Vy||{})[Hy.HighlightFirst=0]="HighlightFirst",Hy[Hy.HighlightNone=1]="HighlightNone";function uw(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:el(o.formBehaviours,[Df.config({store:{mode:"manual",getValue:function(t){return dt(hl(t,o),function(t,o){return t().bind(function(t){var e=cd.getCurrent(t),n=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Fr(t.element));return e.fold(function(){return Nn.error(n)},Nn.value)}).map(Df.getValue)})},setValue:function(n,t){J(t,function(e,t){ml(n,o,t).each(function(t){cd.getCurrent(t).each(function(t){Df.setValue(t,e)})})})}}})]),apis:{getField:function(t,e){return ml(t,o,e).bind(cd.getCurrent)}}}}function aw(){return cd.config({find:vt.some})}function cw(t){return e=Br,n=Mr,s0(t,function(t){return e(t.element)},function(t,e){return n(t.element,e)});var e,n}var sw,lw,fw,dw,mw=function(e,t){return e.getSystem().getByUid(t.uid+"-"+Qy()).map(function(t){return function(){return Nn.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return Nn.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(e)}})})},gw=rt([mo("dom"),mo("fetch"),Ju("onOpen"),$u("onExecute"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Uc(),Zs("dropdownBehaviours",[zg,$y,Fg,Vg]),mo("toggleClass"),Eo("eventOrder",{}),wo("lazySink"),Eo("matchWidth",!1),Eo("useMinWidth",!1),wo("role")].concat(ux())),pw=rt([$f({schema:[Yu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Zy()]),hw=Cl({name:"Dropdown",configFields:gw(),partFields:pw(),factory:function(e,t,n,o){function r(t){bf.getState(t).each(function(t){ip.highlightPrimary(t)})}function i(t,e){return yr(t),vt.some(!0)}var u,a={expand:function(t){zg.isOn(t)||nx(e,h,t,o,st,Vy.HighlightNone).get(st)},open:function(t){zg.isOn(t)||nx(e,h,t,o,st,Vy.HighlightFirst).get(st)},isOpen:zg.isOn,close:function(t){zg.isOn(t)&&nx(e,h,t,o,st,Vy.HighlightFirst).get(st)},repositionMenus:function(t){zg.isOn(t)&&ix(t)}};return{uid:e.uid,dom:e.dom,components:t,behaviours:el(e.dropdownBehaviours,[zg.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(t){return rx(e,t,{onOpen:function(){return zg.on(t)},onClose:function(){return zg.off(t)}})}}}),Fg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(t,e){return hw.isOpen(t)?r($y.getCoupled(t,"sandbox")):hw.open(t),vt.some(!0)},onEscape:function(t,e){return hw.isOpen(t)?(hw.close(t),vt.some(!0)):vt.none()}}),Vg.config({})]),events:Sm(vt.some(function(t){nx(e,h,t,o,r,Vy.HighlightFirst).get(st)})),eventOrder:lt(lt({},e.eventOrder),((u={})[Ii()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:a,domModification:{attributes:lt(lt({"aria-haspopup":"true"},e.role.fold(function(){return{}},function(t){return{role:t}})),"button"===e.dom.tag?{type:tt(e.dom,"attributes").bind(function(t){return tt(t,"type")}).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),vw=xa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return nu([Sr(Ei(),D)])},exhibit:function(){return zr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),bw=Ir("color-input-change"),yw=Ir("color-swatch-change"),xw=Ir("color-picker-cancel"),ww=Qf({schema:[mo("dom")],name:"label"}),Sw=ax("top-left"),kw=ax("top"),Cw=ax("top-right"),Ow=ax("right"),_w=ax("bottom-right"),Tw=ax("bottom"),Ew=ax("bottom-left"),Dw=[ww,ax("left"),Ow,kw,Tw,Sw,Cw,Ew,_w,Jf({name:"thumb",defaults:rt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:nu([Tr(si(),t,"spectrum"),Tr(li(),t,"spectrum"),Tr(fi(),t,"spectrum"),Tr(mi(),t,"spectrum"),Tr(gi(),t,"spectrum"),Tr(hi(),t,"spectrum")])}}}),Jf({schema:[cr("mouseIsDown",function(){return Po(!1)})],name:"spectrum",overrides:function(n){function o(e,t){return r.getValueFromEvent(t).map(function(t){return r.setValueFrom(e,n,t)})}var r=n.model.manager;return{behaviours:ec([Fg.config({mode:"special",onLeft:function(t){return r.onLeft(t,n)},onRight:function(t){return r.onRight(t,n)},onUp:function(t){return r.onUp(t,n)},onDown:function(t){return r.onDown(t,n)}}),Vg.config({})]),events:nu([Cr(si(),o),Cr(li(),o),Cr(mi(),o),Cr(gi(),function(t,e){n.mouseIsDown.get()&&o(t,e)})])}}})],Aw=rt("slider.change.value"),Bw="left",Mw=Jx(-1),Fw=Jx(1),Iw=vt.none,Rw=vt.none,Nw={"top-left":vt.none(),top:vt.none(),"top-right":vt.none(),right:vt.some(function(t,e){Fx(t,{x:px(e)})}),"bottom-right":vt.none(),bottom:vt.none(),"bottom-left":vt.none(),left:vt.some(function(t,e){Fx(t,{x:fx(e)})})},Pw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var o=Kx(t,e,n);return qx(t,{x:o}),o},setToMin:function(t,e){qx(t,{x:sx(e)})},setToMax:function(t,e){qx(t,{x:mx(e)})},findValueOfOffset:Kx,getValueFromEvent:function(t){return cx(t).map(function(t){return t.left})},findPositionOfValue:$x,setPositionFromValue:function(t,e,n,o){var r=Bx(n),i=$x(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),n),u=Ce(e.element)/2;fe(e.element,"left",i-u+"px")},onLeft:Mw,onRight:Fw,onUp:Iw,onDown:Rw,edgeActions:Nw}),Vw=vt.none,Hw=vt.none,Lw=t0(-1),zw=t0(1),Uw={"top-left":vt.none(),top:vt.some(function(t,e){Fx(t,{y:dx(e)})}),"top-right":vt.none(),right:vt.none(),"bottom-right":vt.none(),bottom:vt.some(function(t,e){Fx(t,{y:hx(e)})}),"bottom-left":vt.none(),left:vt.none()},jw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var o=Zx(t,e,n);return Qx(t,{y:o}),o},setToMin:function(t,e){Qx(t,{y:lx(e)})},setToMax:function(t,e){Qx(t,{y:gx(e)})},findValueOfOffset:Zx,getValueFromEvent:function(t){return cx(t).map(function(t){return t.top})},findPositionOfValue:e0,setPositionFromValue:function(t,e,n,o){var r=Bx(n),i=e0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),n),u=xe(e.element)/2;fe(e.element,"top",i-u+"px")},onLeft:Vw,onRight:Hw,onUp:Lw,onDown:zw,edgeActions:Uw}),Ww=cx,Gw=r0(-1,!1),Xw=r0(1,!1),Yw=r0(-1,!0),qw=r0(1,!0),Kw={"top-left":vt.some(function(t,e){Fx(t,Mx(fx(e),dx(e)))}),top:vt.some(function(t,e){Fx(t,Mx(xx(e),dx(e)))}),"top-right":vt.some(function(t,e){Fx(t,Mx(px(e),dx(e)))}),right:vt.some(function(t,e){Fx(t,Mx(px(e),wx(e)))}),"bottom-right":vt.some(function(t,e){Fx(t,Mx(px(e),hx(e)))}),bottom:vt.some(function(t,e){Fx(t,Mx(xx(e),hx(e)))}),"bottom-left":vt.some(function(t,e){Fx(t,Mx(fx(e),hx(e)))}),left:vt.some(function(t,e){Fx(t,Mx(fx(e),wx(e)))})},Jw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var o=o0(Kx(t,e,n.left),Zx(t,e,n.top));return n0(t,o),o},setToMin:function(t,e){n0(t,o0(sx(e),lx(e)))},setToMax:function(t,e){n0(t,o0(mx(e),gx(e)))},getValueFromEvent:Ww,setPositionFromValue:function(t,e,n,o){var r=Bx(n),i=$x(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),n),u=e0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),n),a=Ce(e.element)/2,c=xe(e.element)/2;fe(e.element,"left",i-a+"px"),fe(e.element,"top",u-c+"px")},onLeft:Gw,onRight:Xw,onUp:Yw,onDown:qw,edgeActions:Kw}),$w=Cl({name:"Slider",configFields:[Eo("stepSize",1),Eo("onChange",st),Eo("onChoose",st),Eo("onInit",st),Eo("onDragStart",st),Eo("onDragEnd",st),Eo("snapToGrid",!1),Eo("rounded",!0),wo("snapStart"),go("model",lo("mode",{x:[Eo("minX",0),Eo("maxX",100),cr("value",function(t){return Po(t.mode.minX)}),mo("getInitialValue"),ta("manager",Pw)],y:[Eo("minY",0),Eo("maxY",100),cr("value",function(t){return Po(t.mode.minY)}),mo("getInitialValue"),ta("manager",jw)],xy:[Eo("minX",0),Eo("maxX",100),Eo("minY",0),Eo("maxY",100),cr("value",function(t){return Po({x:t.mode.minX,y:t.mode.minY})}),mo("getInitialValue"),ta("manager",Jw)]})),Zs("sliderBehaviours",[Fg,Df]),cr("mouseIsDown",function(){return Po(!1)})],partFields:Dw,factory:function(i,t,e,n){function u(t){return gl(t,i,"thumb")}function a(t){return gl(t,i,"spectrum")}function o(t){return ml(t,i,"left-edge")}function r(t){return ml(t,i,"right-edge")}function c(t){return ml(t,i,"top-edge")}function s(t){return ml(t,i,"bottom-edge")}function l(t,e){v.setPositionFromValue(t,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function f(t,e){h.value.set(e),l(t,u(t))}function d(n){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&ml(n,i,"thumb").each(function(t){var e=h.value.get();i.onChoose(n,t,e)})}function m(t,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))}function g(t,e){e.stop(),i.onDragEnd(t,u(t)),d(t)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:t,behaviours:el(i.sliderBehaviours,[Fg.config({mode:"special",focusIn:function(t){return ml(t,i,"spectrum").map(Fg.focusIn).map(D)}}),Df.config({store:{mode:"manual",getValue:function(t){return h.value.get()}}}),ic.config({channels:((p={})[wf()]={onReceive:d},p)})]),events:nu([Cr(Aw(),function(t,e){!function(t,e){f(t,e);var n=u(t);i.onChange(t,n,e),vt.some(!0)}(t,e.event.value)}),ou(function(t,e){var n=h.getInitialValue();h.value.set(n);var o=u(t);l(t,o);var r=a(t);i.onInit(t,o,r,h.value.get())}),Cr(si(),m),Cr(fi(),g),Cr(mi(),m),Cr(hi(),g)]),apis:{resetToMin:function(t){v.setToMin(t,i)},resetToMax:function(t){v.setToMax(t,i)},setValue:f,refresh:l},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),Qw=Ir("rgb-hex-update"),Zw=Ir("slider-update"),tS=Ir("palette-update"),eS=[Zs("formBehaviours",[Df])],nS={getField:Hr(function(t,e,n){return t.getField(e,n)}),sketch:function(t){var n,e={field:function(t,e){return n.push(t),cl("form",i0(t),e)},record:rt(n=[])},o=t(e),r=B(e.record(),function(t){return Jf({name:t,pname:i0(t)})});return Sl("form",eS,r,uw,o)}},oS=Ir("valid-input"),rS=Ir("invalid-input"),iS=Ir("validating-input"),uS="colorcustom.rgb.",aS=function(t){return cd.config({find:t.getOpt})},cS=function(t){return cd.config({find:function(e){return Jt(e.element,t).bind(function(t){return e.getSystem().getByDom(t).toOptional()})}})},sS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},lS=tinymce.util.Tools.resolve("tinymce.Resource"),fS=tinymce.util.Tools.resolve("tinymce.util.Tools"),dS=$o([Eo("preprocess",h),Eo("postprocess",h)]),mS=function(r,t){var i=so("RepresentingConfigs.memento processors",dS,t);return Df.config({store:{mode:"manual",getValue:function(t){var e=r.get(t),n=Df.getValue(e);return i.postprocess(n)},setValue:function(t,e){var n=i.preprocess(e),o=r.get(t);Df.setValue(o,n)}}})},gS=s0,pS=function(t){return Df.config({store:{mode:"memory",initialValue:t}})},hS=Ir("alloy-fake-before-tabstop"),vS=Ir("alloy-fake-after-tabstop"),bS=!(ln().browser.isIE()||ln().browser.isEdge()),yS=function(t){return t.getContext("2d")},xS=function(t,e,n){return t.width=e,t.height=n,t},wS=function(t){URL.revokeObjectURL(t.src)},SS=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],kS=function(t,e,T){var n=yS(t),o=function(t){for(var e,n,o,r,i=t.data,u=T[0],a=T[1],c=T[2],s=T[3],l=T[4],f=T[5],d=T[6],m=T[7],g=T[8],p=T[9],h=T[10],v=T[11],b=T[12],y=T[13],x=T[14],w=T[15],S=T[16],k=T[17],C=T[18],O=T[19],_=0;_<i.length;_+=4)e=i[_],n=i[_+1],o=i[_+2],r=i[_+3],i[_]=e*u+n*a+o*c+r*s+l,i[_+1]=e*f+n*d+o*m+r*g+p,i[_+2]=e*h+n*v+o*b+r*y+x,i[_+3]=e*w+n*S+o*k+r*C+O;return t}(n.getImageData(0,0,t.width,t.height));return n.putImageData(o,0,0),S0(t,e)},CS=(sw=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return T0(t,sw)}),OS=E0(function(t,e){return _0(t,[1,0,0,0,e=C0(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])}),_S=E0(function(t,e){var n;return e=C0(e,-1,1),_0(t,[(n=(e*=100)<0?127+e/100*127:127*(0==(n=e%1)?SS[e]:SS[Math.floor(e)]*(1-n)+SS[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])}),TS=(lw=[0,-1,0,-1,5,-1,0,-1,0],function(t){return a=lw,(u=t).toCanvas().then(function(t){return e=t,n=u.getType(),o=a,r=yS(e),i=function(t,e,n){for(var o=function(t,e,n){return n<t?t=n:t<e&&(t=e),t},r=Math.round(Math.sqrt(n.length)),i=Math.floor(r/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(f+h-i,0,c-1),b=4*(o(l+p-i,0,s-1)*c+v),y=n[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(l*c+f);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return e}(r.getImageData(0,0,e.width,e.height),r.getImageData(0,0,e.width,e.height),o),r.putImageData(i,0,0),S0(e,n);var e,n,o,r,i});var u,a}),ES=(fw=function(t,e){return 255*Math.pow(t/255,1-e)},function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){for(var o=yS(t),r=new Array(256),i=0;i<r.length;i++)r[i]=fw(i,n);var u=function(t,e){for(var n=t.data,o=0;o<n.length;o+=4)n[o]=e[n[o]],n[o+1]=e[n[o+1]],n[o+2]=e[n[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),S0(t,e)}(t,e.getType(),n)})}),DS=function(t,e,n){var o=b0(t),r=y0(t),i=e/o,u=n/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=AS(t,i,u);return a?c.then(function(t){return DS(t,e,n)}):c},AS=function(u,a,c){return new Ly(function(t){var e=b0(u),n=y0(u),o=Math.floor(e*a),r=Math.floor(n*c),i=h0(o,r);yS(i).drawImage(u,0,0,e,n,0,0,o,r),t(i)})},BS=function(t,e,n){var o=(n<0?360+n:n)*Math.PI/180,r=t.width,i=t.height,u=Math.sin(o),a=Math.cos(o),c=D0(Math.abs(r*a)+Math.abs(i*u)),s=D0(Math.abs(r*u)+Math.abs(i*a)),l=h0(c,s),f=yS(l);return f.translate(c/2,s/2),f.rotate(o),f.drawImage(t,-r/2,-i/2),S0(l,e)},MS=function(t,e,n){var o=h0(t.width,t.height),r=yS(o);return"v"===n?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),S0(o,e)},FS=function(t,e,n,o,r,i){var u=h0(r,i);return yS(u).drawImage(t,-n,-o),S0(u,e)},IS=Ir("toolbar.button.execute"),RS=((dw={})[Ii()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],dw),NS=Ir("update-menu-text"),PS=Ir("update-menu-icon"),VS={type:"separator"},HS=function(t,l){var e,n,o;return I((e=y(t)?t.split(" "):t,n=l,0<(o=R(e,function(t,e){return y(e)?""===e?t:"|"===e?0<t.length&&!U0(t[t.length-1])?t.concat([VS]):t:Tt(n,e.toLowerCase())?t.concat([n[e.toLowerCase()]]):t:t.concat([e])},[])).length&&U0(o[o.length-1])&&o.pop(),o),function(t,e){var n,o,r,i,u,a,c=function(t){if(U0(t))return t;var e=tt(t,"value").getOrThunk(function(){return Ir("generated-menu-item")});return Yo({value:e},t)}(e),s=(o=l,Tt(n=c,"getSubmenuItems")?(i=o,u=(r=n).getSubmenuItems(),a=HS(u,i),{item:r,menus:Yo(a.menus,sr(r.value,a.items)),expansions:Yo(a.expansions,sr(r.value,r.value))}):{item:n,menus:{},expansions:{}});return{menus:Yo(t.menus,s.menus),items:[s.item].concat(t.items),expansions:Yo(t.expansions,s.expansions)}},{menus:{},expansions:{},items:[]})},LS=rt([Eo("field1Name","field1"),Eo("field2Name","field2"),Qu("onLockedChange"),qu(["lockClass"]),Eo("locked",!1),Af("coupledFieldBehaviours",[cd,Df])]),zS=rt([Z0("field1","field2"),Z0("field2","field1"),Jf({factory:fp,schema:[mo("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ec([zg.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),US=Cl({name:"FormCoupledInputs",configFields:LS(),partFields:zS(),factory:function(o,t,e,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Bf(o.coupledFieldBehaviours,[cd.config({find:vt.some}),Df.config({store:{mode:"manual",getValue:function(t){var e=bl(t,o,["field1","field2"]),n={};return n[o.field1Name]=Df.getValue(e.field1()),n[o.field2Name]=Df.getValue(e.field2()),n},setValue:function(t,e){var n=bl(t,o,["field1","field2"]);et(e,o.field1Name)&&Df.setValue(n.field1(),e[o.field1Name]),et(e,o.field2Name)&&Df.setValue(n.field2(),e[o.field2Name])}}})]),apis:{getField1:function(t){return ml(t,o,"field1")},getField2:function(t){return ml(t,o,"field2")},getLock:function(t){return ml(t,o,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),jS={undo:rt(Ir("undo")),redo:rt(Ir("redo")),zoom:rt(Ir("zoom")),back:rt(Ir("back")),apply:rt(Ir("apply")),swap:rt(Ir("swap")),transform:rt(Ir("transform")),tempTransform:rt(Ir("temp-transform")),transformApply:rt(Ir("transform-apply"))},WS=rt("save-state"),GS=rt("disable"),XS=rt("enable"),YS={formActionEvent:Sy,saveState:WS,disable:GS,enable:XS},qS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),KS=tinymce.util.Tools.resolve("tinymce.util.Observable"),JS=tinymce.util.Tools.resolve("tinymce.util.VK");function $S(t,d){function e(t){var e,n,o,r,i,u,a,c,s=t.raw,l=(e=Math.max,n=y.documentElement,o=y.body,r=e(n.scrollWidth,o.scrollWidth),i=e(n.clientWidth,o.clientWidth),u=e(n.offsetWidth,o.offsetWidth),a=e(n.scrollHeight,o.scrollHeight),c=e(n.clientHeight,o.clientHeight),{width:r<u?i:r,height:a<e(n.offsetHeight,o.offsetHeight)?c:a});iw(s),t.prevent(),p=s.button,h=s.screenX,v=s.screenY;var f=ge(w,"cursor");de(g=Mt.fromTag("div",y),{position:"absolute",top:"0",left:"0",width:l.width+"px",height:l.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:f}),Tn(yn(x),g),b.push(pc(x,"mousemove",m),pc(x,"touchmove",m),pc(x,"mouseup",S),pc(x,"touchend",S)),d.start(s)}function m(t){var e=t.raw;if(iw(e),e.button!==p)return S(t);e.deltaX=e.screenX-h,e.deltaY=e.screenY-v,t.prevent(),d.drag(e)}var n,o,r,g,p,h,v,i=[],b=[],y=null!==(n=d.document)&&void 0!==n?n:document,u=null!==(o=d.root)&&void 0!==o?o:y,x=Mt.fromDom(y),w=Mt.fromDom(u.getElementById(null!==(r=d.handle)&&void 0!==r?r:t)),S=function(t){iw(t.raw),St(b,function(t){return t.unbind()}),b=[],En(g),d.stop&&d.stop(t.raw)};return i.push(pc(w,"mousedown",e),pc(w,"touchstart",e)),{destroy:function(){St(b.concat(i),function(t){return t.unbind()}),b=[],i=[],k(g)&&En(g)}}}function QS(t,e,n,o,r){return q0({name:t,icon:vt.some(e),disabled:n,tooltip:vt.some(t),primary:!1,borderless:!1},o,r)}function ZS(t,e){e?gd.enable(t):gd.disable(t)}var tk=0,ek=function(s,e,l,t,n){function f(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function u(t,e,n,o){var r=e.x+n*t.deltaX,i=e.y+o*t.deltaY,u=Math.max(20,e.w+n*t.deltaW),a=Math.max(20,e.h+o*t.deltaH),c=(s=qS.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),f(l,s));b.fire("updateRect",{rect:c}),h(c)}function o(t){r(s=t)}function r(n){function t(t,e){Iu(m,"#"+d+"-"+t).each(function(t){de(t,{left:e.x+"px",top:e.y+"px",width:Math.max(0,e.w)+"px",height:Math.max(0,e.h)+"px"})})}St(g,function(e){Iu(m,"#"+d+"-"+e.name).each(function(t){de(t,{left:n.w*e.xMul+n.x+"px",top:n.h*e.yMul+n.y+"px"})})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}var i,a,c=[],d="tox-crid-"+tk++,m=Mt.fromDom(t),g=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],p=["top","right","bottom","left"],h=function(t){var e;o((e=l,{x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}))};function v(t){oe(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")}re(a=Mt.fromTag("div"),{id:d,class:"tox-croprect-container",role:"grid","aria-dropeffect":"execute"}),Tn(m,a),St(p,function(n){Iu(m,"#"+d).each(function(t){var e=Mt.fromTag("div");re(e,{id:d+"-"+n,class:"tox-croprect-block","data-mce-bogus":"all"}),fe(e,"display","none"),Tn(t,e)})}),St(g,function(n){Iu(m,"#"+d).each(function(t){var e=Mt.fromTag("div");re(e,{id:d+"-"+n.name,"aria-label":n.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:n.label}),Jr(e,["tox-croprect-handle","tox-croprect-handle-"+n.name]),fe(e,"display","none"),Tn(t,e)})}),i=B(g,function(e){var n;return $S(d,{document:t.ownerDocument,root:gn(m).dom,handle:d+"-"+e.name,start:function(){n=s},drag:function(t){u(e,n,t.deltaX,t.deltaY)}})}),r(s),c.push(pc(m,"focusin",v),pc(m,"focusout",v),pc(m,"keydown",function(e){var i;function t(t,e,n,o,r){t.stopPropagation(),t.preventDefault(),u(i,n,o,r)}switch(St(g,function(t){if(ie(e.target,"id")===d+"-"+t.name)return i=t,!1}),e.raw.keyCode){case JS.LEFT:t(e,0,s,-10,0);break;case JS.RIGHT:t(e,0,s,10,0);break;case JS.UP:t(e,0,s,0,-10);break;case JS.DOWN:t(e,0,s,0,10);break;case JS.ENTER:case JS.SPACEBAR:e.prevent(),n()}}));var b=lt(lt({},KS),{toggleVisibility:function(t){var e=V(V([],B(g,function(t){return"#"+d+"-"+t.name}),!0),B(p,function(t){return"#"+d+"-"+t}),!0).join(","),n=vs(m,e);St(n,t?function(t){return ve(t,"display")}:function(t){return fe(t,"display","none")})},setClampRect:function(t){l=t,r(s)},setRect:o,getInnerRect:function(){return f(l,s)},setInnerRect:h,setViewPortRect:function(t){e=t,r(s)},destroy:function(){St(i,function(t){return t.destroy()}),i=[],St(c,function(t){return t.unbind()}),c=[]}});return b};function nk(t){var n,o,e,r,i=Po(t),u=gc(),a=(o=-1,{data:n=[],add:function(t){var e=n.splice(++o);return n.push(t),{state:t,removed:e}},undo:function(){if(e())return n[--o]},redo:function(){if(r())return n[++o]},canUndo:e=function(){return 0<o},canRedo:r=function(){return-1!==o&&o<n.length-1}});function c(t){i.set(t)}function s(t){URL.revokeObjectURL(t.url)}function l(t){var e=f(t);c(e);var n=a.add(e).removed;return fS.each(n,s),e.url}a.add(t);function f(t){return{blob:t,url:URL.createObjectURL(t)}}function d(){u.on(s),u.clear()}return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:l,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var e=f(t);return d(),u.set(e),e.url},addTempState:function(t){var e=f(t);return u.set(e),e.url},applyTempState:function(e){return u.get().fold(st,function(t){l(t.blob),e()})},destroyTempState:d,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}}function ok(t,e){function i(t){var e=y.getHistoryStates();k.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),br(t,YS.formActionEvent,{name:YS.saveState(),value:e.undoEnabled})}function u(t){return t.toBlob()}function a(t){br(t,YS.formActionEvent,{name:YS.disable(),value:{}})}function c(e,t,n,o,r){a(e),k0(t).then(n).then(u).then(o).then(function(t){return w(e,t)}).then(function(){i(e),r(),x(e)}).catch(function(t){console.log(t),e.getSystem().isConnected()&&x(e)})}function r(t,e,n){c(t,y.getBlobState().blob,e,function(t){return y.updateTempState(t)},n)}function s(t){var e=y.getBlobState().url;return y.destroyTempState(),i(t),e}var n,o,l,f,d,m,g,p,h,v,b,y=nk(t.currentState),x=function(t){C.getApplyButton(t).each(function(t){gd.enable(t)}),br(t,YS.formActionEvent,{name:YS.enable(),value:{}})},w=function(t,e){return a(t),S.updateSrc(t,e)},S=(f=t.currentState.url,m=Hm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),g=Po(1),d=dc(),p=lt(lt({},d),{run:function(t){return d.get().each(t)}}),h=Po({x:0,y:0,w:1,h:1}),v=Po({x:0,y:0,w:1,h:1}),{memContainer:b=Hm(ly.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[m.asSpec(),{dom:{tag:"img",attributes:{src:f}}},{dom:{tag:"div"},behaviours:ec([mm("image-panel-crop-events",[ou(function(t){b.getOpt(t).each(function(t){var e=t.element.dom,n=ek({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,st);n.toggleVisibility(!1),n.on("updateRect",function(t){var e=t.rect,n=g.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};h.set(o)}),p.set(n)})}),ru(function(){p.clear()})])])}],containerBehaviours:ec([Rg.config({}),mm("image-panel-events",[ou(function(t){_(t,f)})])])})),updateSrc:_,zoom:function(t,e){var n=g.get(),o=0<e?Math.min(2,n+.1):Math.max(.1,n-.1);g.set(o),b.getOpt(t).each(function(t){var e=t.components()[1].element;O(t,e)})},showCrop:function(){p.run(function(t){t.toggleVisibility(!0)})},hideCrop:function(){p.run(function(t){t.toggleVisibility(!1)})},getRect:function(){return h.get()},getMeasurements:function(){var t=v.get();return{width:t.w,height:t.h}}}),k=(o=Hm(QS("Undo","undo",!0,function(t){br(t,jS.undo(),{direction:1})},n=e)),l=Hm(QS("Redo","redo",!0,function(t){br(t,jS.redo(),{direction:1})},n)),{container:ly.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),l.asSpec(),QS("Zoom in","zoom-in",!1,function(t){br(t,jS.zoom(),{direction:1})},n),QS("Zoom out","zoom-out",!1,function(t){br(t,jS.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(t,e,n){o.getOpt(t).each(function(t){ZS(t,e)}),l.getOpt(t).each(function(t){ZS(t,n)})}}),C=rw(S,e);function O(t,s){b.getOpt(t).each(function(t){var n=g.get(),o=Ce(t.element),r=xe(t.element),i=s.dom.naturalWidth*n,u=s.dom.naturalHeight*n,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),e={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};de(s,e),m.getOpt(t).each(function(t){de(t.element,e)}),p.run(function(t){var e=h.get();t.setRect({x:e.x*n+a,y:e.y*n+c,w:e.w*n,h:e.h*n}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})}function _(t,e){var n,i=Mt.fromTag("img");return oe(i,"src",e),n=i.dom,new Mp(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)}).then(function(){t.getSystem().isConnected()&&b.getOpt(t).map(function(t){var e=Ou({element:i});Rg.replaceAt(t,1,vt.some(e));var n=v.get(),o={x:0,y:0,w:i.dom.naturalWidth,h:i.dom.naturalHeight};v.set(o);var u,r=qS.inflate(o,-20,-20);h.set(r),n.w===o.w&&n.h===o.h||(u=i,b.getOpt(t).each(function(t){var e=Ce(t.element),n=xe(t.element),o=u.dom.naturalWidth,r=u.dom.naturalHeight,i=Math.min(e/o,n/r);1<=i?g.set(1):g.set(i)})),O(t,i)})})}return{dom:{tag:"div",attributes:{role:"presentation"}},components:[C.memContainer.asSpec(),S.memContainer.asSpec(),k.container],behaviours:ec([Df.config({store:{mode:"manual",getValue:function(){return y.getBlobState()}}}),mm("image-tools-events",[Cr(jS.undo(),function(e,t){var n=y.undo();w(e,n).then(function(t){x(e),i(e)})}),Cr(jS.redo(),function(e,t){var n=y.redo();w(e,n).then(function(t){x(e),i(e)})}),Cr(jS.zoom(),function(t,e){var n=e.event.direction;S.zoom(t,n)}),Cr(jS.back(),function(t,e){var n,o=s(n=t);w(n,o).then(function(t){x(n)}),(0,e.event.swap)(),S.hideCrop()}),Cr(jS.apply(),function(t,e){y.applyTempState(function(){s(t),(0,e.event.swap)()})}),Cr(jS.transform(),function(t,e){return r(t,e.event.transform,st)}),Cr(jS.tempTransform(),function(t,e){var n=e.event.transform;c(t,y.getTempState().blob,n,function(t){return y.addTempState(t)},st)}),Cr(jS.transformApply(),function(t,e){var n=t,o=e.event.transform,r=e.event.swap,i=y.getBlobState().blob;c(n,i,o,function(t){var e=y.addBlobState(t);return s(n),e},r)}),Cr(jS.swap(),function(e,t){k.updateButtonUndoStates(e,!1,!1);var n=t.event.transform,o=t.event.swap;n.fold(function(){o()},function(t){r(e,t,o)})})]),aw()])}}function rk(t){return!Tt(t,"items")}function ik(t,e){function n(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}}return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:B(t.header,function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}})}]},{dom:{tag:"tbody"},components:B(t.cells,function(t){return{dom:{tag:"tr"},components:B(t,n)}})}],behaviours:ec([py.config({}),Vg.config({})])}}function uk(n,e){var t=n.label.map(function(t){return oy(t,e)}),o=[gd.config({disabled:function(){return n.disabled||e.isDisabled()}}),pv(),Fg.config({mode:"execution",useEnter:!0!==n.multiline,useControlEnter:!0===n.multiline,execute:function(t){return vr(t,ky),vt.some(!0)}}),mm("textfield-change",[Cr(Si(),function(t,e){br(t,yy,{name:n.name})}),Cr(Mi(),function(t,e){br(t,yy,{name:n.name})})]),py.config({})],r=n.validation.map(function(o){return Ky.config({getRoot:function(t){return Yt(t.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var e=Df.getValue(t),n=o.validator(e);return Gy(!0===n?Nn.value(e):Nn.error(n))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=n.placeholder.fold(rt({}),function(t){return{placeholder:e.translate(t)}}),u=n.inputMode.fold(rt({}),function(t){return{inputmode:t}}),a=lt(lt({},i),u);return ny(t,my.parts.field({tag:!0===n.multiline?"textarea":"input",inputAttributes:a,inputClasses:[n.classname],inputBehaviours:ec(ft([o,r])),selectOnFocus:!1,factory:Dy}),(n.flex?["tox-form__group--stretched"]:[]).concat(n.maximized?["tox-form-group--maximize"]:[]),[gd.config({disabled:function(){return n.disabled||e.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])}function ak(t){var e=Po(null);return wu({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})}function ck(t,e,n){var o=Df.getValue(n);Df.setValue(e,o),s1(e)}function sk(t,e){var n=t.element,o=Qr(n),r=n.dom;"number"!==ie(n,"type")&&e(r,o)}function lk(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:st}}function fk(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:st}}function dk(t,e){return n=t,B(F(e,function(t){return t.type===n}),lk);var n}function mk(t,e){var n=t.toLowerCase();return F(e,function(t){return ut((void 0!==t.meta&&void 0!==t.meta.text?t.meta:t).text.toLowerCase(),n)||ut(t.value.toLowerCase(),n)})}function gk(u,a,c){function r(t){var e=Df.getValue(t);c.addToHistory(e.value,u.filetype)}var t,e,n,o,i=a.shared.providers,s=my.parts.field({factory:m1,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":v1,type:"url"},minChars:0,responseTime:0,fetch:function(t){var n,o,e,r,i=j0((n=u.filetype,o=c,e=Df.getValue(t),r=void 0!==e.meta.text?e.meta.text:e.value,o.getLinkInformation().fold(function(){return[]},function(t){var e=mk(r,B(o.getHistory(n),function(t){return fk(t,t)}));return"file"===n?R([e,mk(r,dk("header",t.targets)),mk(r,ft([vt.from(t.anchorTop).map(function(t){return fk("<top>",t)}).toArray(),dk("anchor",t.targets),vt.from(t.anchorBottom).map(function(t){return fk("<bottom>",t)}).toArray()]))],function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(h1,e)},[]):e})),Sh.BUBBLE_TO_SANDBOX,a,!1);return Gy(i)},getHotspot:function(t){return p.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Ky)&&Ky.run(t).get(st)},typeaheadBehaviours:ec(ft([c.getValidationHandler().map(function(n){return Ky.config({getRoot:function(t){return Yt(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){f.getOpt(t).each(function(t){oe(t.element,"title",i.translate(e))})}},validator:{validate:function(t){var e=Df.getValue(t);return p1(function(o){n({type:u.filetype,url:e.value},function(t){var e,n;"invalid"===t.status?(e=Nn.error(t.message),o(e)):(n=Nn.value(t.message),o(n))})})},validateOnLoad:!1}})}).toArray(),[gd.config({disabled:function(){return u.disabled||i.isDisabled()}}),py.config({}),mm("urlinput-events",ft(["file"===u.filetype?[Cr(Si(),function(t){br(t,yy,{name:u.name})})]:[],[Cr(ki(),function(t){br(t,yy,{name:u.name}),r(t)}),Cr(Mi(),function(t){br(t,yy,{name:u.name}),r(t)})]]))]])),eventOrder:((t={})[Si()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:a.shared.getSink,parts:{menu:Zp(0,0,"normal")},onExecute:function(t,e,n){br(e,ky,{})},onItemExecute:function(t,e,n,o){r(t),br(t,yy,{name:u.name})}}),l=u.label.map(function(t){return oy(t,i)}),f=Hm((e="invalid",n=vt.some(v1),Xm("warning",{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:lt({title:i.translate(o=void 0===o?e:o),"aria-live":"polite"},n.fold(function(){return{}},function(t){return{id:t}}))},i.icons))),d=Hm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[f.asSpec()]}),m=c.getUrlPicker(u.filetype),g=Ir("browser.url.event"),p=Hm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[s,d.asSpec()],behaviours:ec([gd.config({disabled:function(){return u.disabled||i.isDisabled()}})])}),h=Hm(J0({name:u.name,icon:vt.some("browse"),text:u.label.getOr(""),disabled:u.disabled,primary:!1,borderless:!0},function(t){return vr(t,g)},i,[],["tox-browse-url"]));return my.sketch({dom:by([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ft([[p.asSpec()],m.map(function(){return h.asSpec()}).toArray()])}]),fieldBehaviours:ec([gd.config({disabled:function(){return u.disabled||i.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable),h.getOpt(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable),h.getOpt(t).each(gd.enable)}}),pv(),mm("url-input-events",[Cr(g,function(o){cd.getCurrent(o).each(function(e){var t=Df.getValue(e),n=lt({fieldname:u.name},t);m.each(function(t){t(n).get(function(t){Df.setValue(e,t),br(o,yy,{name:u.name})})})})})])])})}function pk(r){return function(e,n,o){return tt(n,"name").fold(function(){return r(n,o)},function(t){return e.field(t,r(n,o))})}}function hk(e,t,n){var o=Yo(n,{shared:{interpreter:function(t){return x1(e,t,o)}}});return x1(e,t,o)}function vk(t,e,n){function o(){return Mt.fromDom(t.getContentAreaContainer())}function r(){return p||!n()}var i,u,a,c,s,l,f,d,m,g,p=sv(t);return{inlineDialog:(f=o,d=e,m=r,g={maxHeightFunction:Nc()},function(){return m()?{type:"node",root:te(f()),node:vt.from(f()),bubble:Sc(12,12,w1),layouts:{onRtl:function(){return[Mm]},onLtr:function(){return[Bm]}},overrides:g}:{type:"hotspot",hotspot:d(),bubble:Sc(-12,12,w1),layouts:{onRtl:function(){return[Xa]},onLtr:function(){return[Ya]}},overrides:g}}),banner:(c=o,s=e,l=r,function(){return l()?{type:"node",root:te(c()),node:vt.from(c()),layouts:{onRtl:function(){return[cp]},onLtr:function(){return[cp]}}}:{type:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[$a]}}}}),cursor:(u=t,function(){return{type:"selection",root:a(),getSelection:function(){var t=u.selection.getRng();return vt.some(ms.range(Mt.fromDom(t.startContainer),t.startOffset,Mt.fromDom(t.endContainer),t.endOffset))}}}),node:(i=a=function(){return Mt.fromDom(t.getBody())},function(t){return{type:"node",root:i(),node:t}})}}function bk(i){return vt.from(i.getParam("style_formats")).filter(c).map(function(t){var e,n,o=(e=i,n=k1(t),e.formatter?r(n.customFormats):e.on("init",function(){r(n.customFormats)}),n.formats);function r(t){St(t,function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)})}return i.getParam("style_formats_merge",!1,"boolean")?S1.concat(o):o}).getOr(S1)}function yk(t,e,n){var o={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Yo(t,o)}function xk(c,t,s,l){var f=function(t){return B(t,function(t){var e,n,o,r,i,u=Ct(t);if(et(t,"items")){var a=f(t.items);return Yo(Yo(t,{type:"submenu"}),{getStyleItems:rt(a)})}return et(t,"format")?yk(t,s,l):1===u.length&&wt(u,"title")?Yo(t,{type:"separator"}):(r={type:"formatter",format:o="custom-"+(n=y((e=t).name)?e.name:Ir(e.title)),isSelected:s(o),getStylePreview:l(o)},i=Yo(e,r),c.formatter.register(n,i),i)})};return f(t)}function wk(n){return function(t){if(k(e=t)&&1===e.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}var e;return!1}}function Sk(t,e,n,o,r){return{type:t,title:e,url:n,level:o,attach:r}}function kk(t){return t.innerText||t.textContent}function Ck(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)&&JC(t)}function Ok(t){return t&&/^(H[1-6])$/.test(t.nodeName)}function _k(t){return Ok(t)&&JC(t)}function Tk(t){var e,n=t.id||Ir("h");return Sk("header",kk(t),"#"+n,Ok(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=n})}function Ek(t){var e=t.id||t.name;return Sk("anchor",kk(t)||"#"+e,"#"+e,0,st)}function Dk(t){return 0<C1(t.title).length}function Ak(t){return y(t)&&/^https?/.test(t)}function Bk(t){return x(t)&&Q(t,function(t){return!(c(e=t)&&e.length<=5&&L(e,Ak));var e}).isNone()}function Mk(){var t,e=db.getItem(E1);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+E1+" was not valid JSON",t),{};throw t}return Bk(t)?t:(console.log("Local storage "+E1+" was not valid format",t),{})}function Fk(t){return tt(Mk(),t).getOr([])}function Ik(e,t){var n,o;Ak(e)&&(o=F(tt(n=Mk(),t).getOr([]),function(t){return t!==e}),n[t]=[e].concat(o).slice(0,5),function(t){if(!Bk(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));db.setItem(E1,JSON.stringify(t))}(n))}function Rk(t){return!!t}function Nk(t){return dt(fS.makeMap(t,/[, ]/),Rk)}function Pk(t){return vt.from(t.getParam("file_picker_callback")).filter(S)}function Vk(t){return vt.from(t).filter(y).getOrUndefined()}function Hk(l){return{getHistory:Fk,addToHistory:Ik,getLinkInformation:function(){return!1===(t=l).getParam("typeahead_urls")?vt.none():vt.some({targets:T1(t.getBody()),anchorTop:Vk(t.getParam("anchor_top","#top")),anchorBottom:Vk(t.getParam("anchor_bottom","#bottom"))});var t},getValidationHandler:function(){return vt.from(void 0===(e=(t=l).getParam("file_picker_validator_handler",void 0,"function"))?t.getParam("filepicker_validator_handler",void 0,"function"):e);var t,e},getUrlPicker:function(t){return e=c=l,n=s=t,r=vt.some((o=e).getParam("file_picker_types")).filter(Rk),i=vt.some(o.getParam("file_browser_callback_types")).filter(Rk),u=r.or(i).map(Nk),a=Pk(o).fold(T,function(t){return u.fold(D,function(t){return 0<Ct(t).length&&t})}),(w(a)?a?Pk(e):vt.none():a[n]?Pk(e):vt.none()).map(function(o){return function(e){return Wy(function(n){var t=lt({filetype:s,fieldname:e.fieldname},vt.from(e.meta).getOr({}));o.call(c,function(t,e){if(!y(t))throw new Error("Expected value to be string");if(void 0!==e&&!x(e))throw new Error("Expected meta to be a object");n({value:t,meta:e})},e.value,t)})}});var e,n,o,r,i,u,a,c,s}}}function Lk(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,g,p,h=Po(!1),v={isPositionedAtTop:function(){return"top"===o.get()},getDockingMode:(o=Po(av(e)?"bottom":"top")).get,setDockingMode:o.set},b={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:dp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return x1(y1,t,b)},anchors:vk(e,n,v.isPositionedAtTop),header:v,getSink:function(){return Nn.value(t)}},urlinput:Hk(e),styleselect:(f=Po([]),d=Po([]),m=Po([]),g=Po([]),p=Po(!(l=function(t){var e=t.items;return void 0!==e&&0<e.length?H(e,l):[t.format]})),(s=e).on("PreInit",function(t){var e=bk(s),n=xk(s,e,y,x);f.set(n),d.set(H(n,l))}),s.on("addStyleModifications",function(t){var e=xk(s,t.items,y,x);m.set(e),p.set(t.replace),g.set(H(e,l))}),{getData:function(){var t=p.get()?[]:f.get(),e=m.get();return t.concat(e)},getFlattenedKeys:function(){var t=p.get()?[]:d.get(),e=g.get();return t.concat(e)}}),colorinput:{colorPicker:function(t,e){Ib(c)(t,e)},hasCustomColors:function(){return gb(a)},getColors:function(){return pb(u)},getColorCols:(i=u=a=c=e,function(){return vb(i)})},dialog:{isDraggableModal:(r=e,function(){return r.getParam("draggable_modal",!1,"boolean")})},isContextMenuOpen:function(){return h.get()},setContextMenuState:function(t){return h.set(t)}};function y(t){return function(){return s.formatter.match(t)}}function x(e){return function(){var t=s.formatter.get(e);return void 0!==t?vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:s.dom.parseStyle(s.formatter.getCssText(e))}):vt.none()}}return b}function zk(t){return(mt(pe(t,"position"),"fixed")?vt.none():qt(t)).orThunk(function(){var n=Mt.fromTag("span");return Yt(t).bind(function(t){Tn(t,n);var e=qt(n);return En(n),e})})}function Uk(t){return zk(t).map(ke).getOrThunk(function(){return kn(0,0)})}function jk(t,e){var n=t.element;Yr(n,e.transitionClass),qr(n,e.fadeOutClass),Yr(n,e.fadeInClass),e.onShow(t)}function Wk(t,e){var n=t.element;Yr(n,e.transitionClass),qr(n,e.fadeInClass),Yr(n,e.fadeOutClass),e.onHide(t)}function Gk(t,e,n){return L(t,function(t){switch(t){case"bottom":return e.bottom<=n.bottom;case"top":return e.y>=n.y}})}function Xk(e,t){return t.getInitialPos().map(function(t){return Bn(t.bounds.x,t.bounds.y,Ce(e),xe(e))})}function Yk(n,o,r){return r.getInitialPos().bind(function(t){switch(r.clearInitialPos(),t.position){case"static":return vt.some(H1.static());case"absolute":var e=zk(n).map(Mn).getOrThunk(function(){return Mn(bn())});return vt.some(H1.absolute(Ea("absolute",tt(t.style,"left").map(function(t){return o.x-e.x}),tt(t.style,"top").map(function(t){return o.y-e.y}),tt(t.style,"right").map(function(t){return e.right-o.right}),tt(t.style,"bottom").map(function(t){return e.bottom-o.bottom}))));default:return vt.none()}})}function qk(t,e,n){var o,r,i,u=t.element;return mt(pe(u,"position"),"fixed")?(r=e,Xk(o=u,i=n).filter(function(t){return Gk(i.getModes(),t,r)}).bind(function(t){return Yk(o,t,i)})):function(t,e,n){var r,o,i=Mn(t);if(Gk(n.getModes(),i,e))return vt.none();r=t,o=i,n.setInitialPos({style:function(){var t={},e=r.dom;if(ct(e))for(var n=0;n<e.style.length;n++){var o=e.style.item(n);t[o]=e.style[o]}return t}(),position:ge(r,"position")||"static",bounds:o});var u=Fn(),a=i.x-u.x,c=e.y-u.y,s=u.bottom-e.bottom,l=i.y<=e.y;return vt.some(H1.fixed(Ea("fixed",vt.some(a),l?vt.some(c):vt.none(),vt.none(),l?vt.none():vt.some(s))))}(u,e,n)}function Kk(e,t,n){n.setDocked(!1),St(["left","right","top","bottom","position"],function(t){return ve(e.element,t)}),t.onUndocked(e)}function Jk(t,e,n,o){var r="fixed"===o.position;n.setDocked(r),Da(t.element,o),(r?e.onDocked:e.onUndocked)(t)}function $k(o,t,r,i,u){void 0===u&&(u=!1),t.contextual.each(function(n){n.lazyContext(o).each(function(t){var e=t.y<i.bottom&&t.bottom>i.y;e!==r.isVisible()&&(r.setVisible(e),u&&!e?(Jr(o.element,[n.fadeOutClass]),n.onHide(o)):(e?jk:Wk)(o,n))})})}function Qk(t,e,n){var o,r,i,u,a,c;n.isDocked()&&(r=e,i=n,c=(o=t).element,i.setDocked(!1),Xk(a=o.element,u=i).bind(function(t){return Yk(a,t,u)}).each(function(t){t.fold(function(){return Kk(o,r,i)},function(t){return Jk(o,r,i,t)},st)}),i.setVisible(!0),r.contextual.each(function(t){$r(c,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(o)}),L1(o,r,i))}function Zk(t,e){return wt(j1.getModes(t),e)}function tC(r){var i=r.element;Yt(i).each(function(t){var e,n,o="padding-"+j1.getModes(r)[0];j1.isDocked(r)?(e=Ce(t),fe(i,"width",e+"px"),fe(t,o,we(n=i)+(parseInt(ge(n,"margin-top"),10)||0)+(parseInt(ge(n,"margin-bottom"),10)||0)+"px")):(ve(i,"width"),ve(t,o))})}function eC(t,e){e?(qr(t,G1.fadeOutClass),Jr(t,[G1.transitionClass,G1.fadeInClass])):(qr(t,G1.fadeInClass),Jr(t,[G1.fadeOutClass,G1.transitionClass]))}function nC(t,e){var n=Mt.fromDom(t.getContainer());e?(Yr(n,X1),qr(n,Y1)):(Yr(n,Y1),qr(n,X1))}function oC(u,t){function o(e){r().each(function(t){return e(t.element)})}function e(t){u.inline||tC(t),nC(u,j1.isDocked(t)),t.getSystem().broadcastOn([xf()],{}),r().each(function(t){return t.getSystem().broadcastOn([xf()],{})})}var n,i=gc(),r=t.getSink,a=u.inline?[]:[ic.config({channels:((n={})[W1()]={onReceive:tC},n)})];return V([Vg.config({}),j1.config({contextual:lt({lazyContext:function(t){var e=we(t.element),n=u.inline?u.getContentAreaContainer():u.getContainer(),o=Mn(Mt.fromDom(n)),r=o.height-e,i=o.y+(Zk(t,"top")?0:e);return vt.some(Bn(o.x,i,o.width,r))},onShow:function(){o(function(t){return eC(t,!0)})},onShown:function(r){o(function(t){return $r(t,[G1.transitionClass,G1.fadeInClass])}),i.get().each(function(t){var e,n=r.element,o=jt(e=t);Oa(o).filter(function(t){return!zt(e,t)}).filter(function(t){return zt(t,Mt.fromDom(o.dom.body))||Ut(n,t)}).each(function(){return ka(e)}),i.clear()})},onHide:function(t){var e=t.element,n=r;_a(e).orThunk(function(){return n().toOptional().bind(function(t){return _a(t.element)})}).fold(i.clear,i.set),o(function(t){return eC(t,!1)})},onHidden:function(){o(function(t){return $r(t,[G1.transitionClass])})}},G1),lazyViewport:function(t){var e=Fn(),n=u.getParam("toolbar_sticky_offset",0,"number"),o=e.y+(Zk(t,"top")?n:0),r=e.height-(Zk(t,"bottom")?n:0);return Bn(e.x,o,e.width,r)},modes:[t.header.getDockingMode()],onDocked:e,onUndocked:e})],a,!0)}function rC(t){return ao("menubutton",$1,t)}function iC(e,t){return t.getAnimationRoot.fold(function(){return e.element},function(t){return t(e)})}function uC(t){return t.dimension.property}function aC(t,e){return t.dimension.getDimension(e)}function cC(t,e){$r(iC(t,e),[e.shrinkingClass,e.growingClass])}function sC(t,e){qr(t.element,e.openClass),Yr(t.element,e.closedClass),fe(t.element,uC(e),"0px"),be(t.element)}function lC(t,e){qr(t.element,e.closedClass),Yr(t.element,e.openClass),ve(t.element,uC(e))}function fC(t,e,n,o){n.setCollapsed(),fe(t.element,uC(e),aC(e,t.element)),be(t.element),cC(t,e),sC(t,e),e.onStartShrink(t),e.onShrunk(t)}function dC(t,e,n){var o=aC(e,t.element);("0px"===o?fC:function(t,e,n,o){var r=o.getOrThunk(function(){return aC(e,t.element)});n.setCollapsed(),fe(t.element,uC(e),r),be(t.element);var i=iC(t,e);qr(i,e.growingClass),Yr(i,e.shrinkingClass),sC(t,e),e.onStartShrink(t)})(t,e,n,vt.some(o))}function mC(t,e,n){var o=iC(t,e),r=Kr(o,e.shrinkingClass),i=aC(e,t.element);lC(t,e);var u=aC(e,t.element);(r?function(){fe(t.element,uC(e),i),be(t.element)}:function(){sC(t,e)})(),qr(o,e.shrinkingClass),Yr(o,e.growingClass),lC(t,e),fe(t.element,uC(e),u),n.setExpanded(),e.onStartGrow(t)}function gC(t,e,n){return!0===Kr(iC(t,e),e.growingClass)}function pC(t,e,n){return!0===Kr(iC(t,e),e.shrinkingClass)}function hC(t){return"<alloy.field."+t+">"}function vC(t){return{element:function(){return t.element.dom}}}function bC(t,n){cd.getCurrent(t).each(function(t){return Rg.set(t,[(e=n,uO.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(n=t,r=B(Ct(o=e),function(t){var e=o[t],n=co(ao("sidebar",aO,e));return{name:t,getApi:vC,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}),B(r,function(t){var e=Po(st);return n.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Kh([vv(t,e),bv(t,e),Cr(Ji(),function(e,t){var n=t.event;N(r,function(t){return t.name===n.name}).each(function(t){(n.visible?t.onShow:t.onHide)(t.getApi(e))})})])})})),slotBehaviours:Kh([ou(function(t){return uO.hideAllSlots(t)})])};var n,o,r}))]);var e})}function yC(t){return cd.getCurrent(t).bind(function(t){return nO.isGrowing(t)||nO.hasGrown(t)?cd.getCurrent(t).bind(function(e){return N(uO.getSlotNames(e),function(t){return uO.isShowing(e,t)})}):vt.none()})}function xC(t){var e=Mt.fromHtml(t),n=Kt(e),o=R(void 0!==e.dom.attributes?e.dom.attributes:[],function(t,e){var n;return"class"===e.name?t:lt(lt({},t),((n={})[e.name]=e.value,n))},{}),r=Array.prototype.slice.call(e.dom.classList,0),i=0===n.length?{}:{innerHtml:Br(e)};return lt({tag:Ft(e),classes:r,attributes:o},i)}function wC(t){return cd.getCurrent(t).each(function(t){return ka(t.element)})}function SC(f,d,m){function e(t){var e;!g.get()||"focusin"===(e=t).type&&(e.composed?Y(e.composedPath()):vt.from(e.target)).map(Mt.fromDom).filter(Ge).exists(function(t){return Kr(t,"mce-pastebin")})||(t.preventDefault(),wC(d()),f.editorManager.setActive(f))}var g=Po(!1),n=gc();function o(t){var e,n,o,r,i,u,a,c,s,l;t!==g.get()&&(g.set(t),e=f,n=d(),o=t,r=m.providers,c=n.element,s=o,l="data-mce-"+(i="tabindex"),vt.from(e.iframeElement).map(Mt.fromDom).each(function(e){s?(ue(e,i).each(function(t){return oe(e,l,t)}),oe(e,i,-1)):(ce(e,i),ue(e,l).each(function(t){oe(e,i,t),ce(e,l)}))}),o?(fO.block(n,(a=r,function(t,e){return{dom:{tag:"div",attributes:{"aria-label":a.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:xC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})),ve(c,"display"),ce(c,"aria-hidden"),e.hasFocus()&&wC(n)):(u=cd.getCurrent(n).exists(function(t){return Ca(t.element)}),fO.unblock(n),fe(c,"display","none"),oe(c,"aria-hidden","true"),u&&e.focus()),f.fire("AfterProgressState",{state:t}))}f.inline||f.on("PreInit",function(){f.dom.bind(f.getWin(),"focusin",e),f.on("BeforeExecCommand",function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&e(t)})}),f.on("ProgressState",function(t){var e;n.on(lp.clearTimeout),u(t.time)?(e=lp.setEditorTimeout(f,function(){return o(t.state)},t.time),n.set(e)):(o(t.state),n.clear())})}function kC(t,e,n){return{within:t,extra:e,withinWidth:n}}function CC(t,e,o){var n,r=(n=function(t,e){var n=o(t);return vt.some({element:t,start:e,finish:e+n,width:n})},R(t,function(e,t){return n(t,e.len).fold(rt(e),function(t){return{len:t.finish,list:e.list.concat([t])}})},{len:0,list:[]}).list),i=F(r,function(t){return t.finish<=e}),u=I(i,function(t,e){return t+e.width},0);return{within:i,extra:r.slice(i.length),withinWidth:u}}function OC(t){return B(t,function(t){return t.element})}function _C(t,e){var n=B(e,function(t){return Eu(t)});N1.setGroups(t,n)}function TC(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k=e.builtGroups.get();0!==k.length&&(o=gl(t,e,"primary"),r=$y.getCoupled(t,"overflowGroup"),fe(o.element,"visibility","hidden"),u=K(i=k.concat([r]),function(e){return _a(e.element).bind(function(t){return e.getSystem().getByDom(t).toOptional()})}),n([]),_C(o,i),a=Ce(o.element),0===(s=a,l=e.builtGroups.get(),d=r,y=(0===(m=CC(l,s,f=function(t){return Ce(t.element)})).extra.length?vt.some(m):vt.none()).getOrThunk(function(){return CC(l,s-f(d),f)}),x=y.within,w=y.extra,S=y.withinWidth,(c=1===w.length&&w[0].width<=f(d)?(b=S,kC(OC(x.concat(w)),[],b)):1<=w.length?(p=w,h=d,v=S,kC(OC(x).concat([h]),OC(p),v)):(g=S,kC(OC(x),[],g))).extra.length)?(Rg.remove(o,r),n([])):(_C(o,c.within),n(c.extra)),ve(o.element,"visibility"),be(o.element),u.each(Vg.focus))}function EC(t,e){var n=$y.getCoupled(t,"toolbarSandbox");bf.isOpen(n)?bf.close(n):bf.open(n,e.toolbar())}function DC(t,e,n,o){var r=n.getBounds.map(function(t){return t()}),i=n.lazySink(t).getOrDie();ff.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:pO()}}},r)}function AC(t,e,n,o,r){N1.setGroups(e,r),DC(t,e,n,o),zg.on(t)}function BC(t){return B(t,function(t){return Eu(t)})}function MC(t,n,o){TC(t,o,function(e){o.overflowGroups.set(e),n.getOpt(t).each(function(t){bO.setGroups(t,BC(e))})})}function FC(e,n){ml(e,n,"overflow-button").bind(function(){return ml(e,n,"overflow")}).each(function(t){QC(e,n),nO.toggleGrow(t)})}function IC(t){var e=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:lt({tag:"div",classes:["tox-toolbar__group"]},e),components:[wO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ec([py.config({}),Vg.config({})])}}function RC(t){return wO.sketch(IC(t))}function NC(n,t){var e=ou(function(t){var e=B(n.initGroups,RC);N1.setGroups(t,e)});return ec([Qv(n.providers.isDisabled),pv(),Fg.config({mode:t,onEscape:n.onEscape,selector:".tox-toolbar__group"}),mm("toolbar-events",[e])])}function PC(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":IC({title:vt.none(),items:[]}),"overflow-button":Y0({name:"more",icon:vt.some("more-drawer"),disabled:!1,tooltip:vt.some("More..."),primary:!1,borderless:!1},vt.none(),t.providers)},splitToolbarBehaviours:NC(t,e)}}function VC(t){var e=t.cyclicKeying?"cyclic":"acyclic";return N1.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===bh.scrolling?["tox-toolbar--scrolling"]:[])},components:[N1.parts.groups({})],toolbarBehaviours:NC(t,e)})}function HC(t){return"string"==typeof t?t.split(" "):t}function LC(i,u){var a=lt(lt({},IO),u.menus),n=0<Ct(u.menus).length,t=F(void 0===u.menubar||!0===u.menubar?HC("file edit view insert format tools table help"):HC(!1===u.menubar?"":u.menubar),function(t){var e=Tt(IO,t);return n?e||tt(u.menus,t).exists(function(t){return Tt(t,"items")}):e});return F(B(t,function(t){var e=a[t],n={title:e.title,items:HC(e.items)},o=u,r=i.getParam("removed_menuitems","").split(/[ ,]/);return{text:n.title,getItems:function(){return H(n.items,function(t){var e=t.toLowerCase();return 0===e.trim().length||d(r,function(t){return t===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:o.menuItems[e]?[o.menuItems[e]]:[]})}}}),function(t){return 0<t.getItems().length&&d(t.getItems(),function(t){return"separator"!==t.type})})}function zC(t){function e(){t._skinLoaded=!0,t.fire("SkinLoaded")}return function(){t.initialized?e():t.on("init",e)}}function UC(n,o,r){return new Mp(function(t,e){r.load(o,t,e),n.on("remove",function(){return r.unload(o)})})}function jC(t,e){var n,o,r,i,u,a,c,s,l,f=(r=(n=e).getParam("skin"),i=n.getParam("skin_url"),!1!==r&&(o=r||"oxide",i=i?n.documentBaseURI.toAbsolute(i):ov.baseURL+"/skins/ui/"+o),i);f&&e.contentCSS.push(f+(t?"/content.inline":"/content")+".min.css"),!1===e.getParam("skin")==0&&y(f)?Mp.all([UC(e,f+"/skin.min.css",e.ui.styleSheetLoader),(c=e,s=f,l=Mt.fromDom(c.getElement()),pn(l).isSome()?UC(c,s+"/skin.shadowdom.min.css",nv.DOM.styleSheetLoader):Mp.resolve())]).then(zC(e),(u=e,a="Skin could not be loaded",function(){return u.fire("SkinLoadError",{message:a})})):zC(e)()}function WC(o,r){return function(e){function t(){e.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,e.setActive);n.set(t)}var n=mc();return o.initialized?t():o.once("init",t),function(){o.off("init",t),n.clear()}}}function GC(o,r,i){return function(t){function e(){return i(t)}function n(){i(t),o.on(r,e)}return o.initialized?n():o.once("init",n),function(){o.off("init",n),o.off(r,e)}}}function XC(e){return function(t){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("mceToggleFormat",!1,t.format)})}}}function YC(t,e){return function(){return t.execCommand(e)}}function qC(t,e,n){var u,a,c,o=n.dataset,r="basic"===o.type?function(){return B(o.data,function(t){return yk(t,n.isSelectedFor,n.getPreviewFor)})}:o.getData;return{items:(u=e,a=n,c=function(t,e,n){var o="formatter"===t.type&&a.isInvalid(t);return 0===e?o?[]:i(t,e,!1,n).toArray():i(t,e,o,n).toArray()},{validateItems:s,getFetch:function(n,o){return function(t,e){e(j0(s(o()),Sh.CLOSE_ON_EXECUTE,n,!1))}}}),getStyleItems:r};function i(t,e,n,o){var r=u.shared.providers.translate(t.title);if("separator"===t.type)return vt.some({type:"separator",text:r});if("submenu"!==t.type)return vt.some(lt({type:"togglemenuitem",text:r,icon:t.icon,active:t.isSelected(o),disabled:n,onAction:a.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var i=H(t.getStyleItems(),function(t){return c(t,e,o)});return 0===e&&i.length<=0?vt.none():vt.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return H(t.getStyleItems(),function(t){return c(t,e,o)})}})}function s(t){var e=a.getCurrentValue(),n=a.shouldHide?0:1;return H(t,function(t){return c(t,n,e)})}}function KC(t,e,n){var o=qC(0,e,n),r=o.items,i=o.getStyleItems,u=GC(t,"NodeChange",function(t){var e=t.getComponent();n.updateText(e)});return z0({text:n.icon.isSome()?vt.none():n.text,icon:n.icon,tooltip:vt.from(n.tooltip),role:vt.none(),fetch:r.getFetch(e,i),onSetup:u,getApi:function(t){return{getComponent:rt(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)}function JC(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return O1(t)}return!1}(t)&&!_1(t)}function $C(r,t){function e(t){return vl(r)}function n(n,o){return function(t,e){return ml(t,r,e).map(function(t){return n(t,e)}).getOr(o)}}function o(t,e){return"true"!==ie(t.element,"aria-hidden")}var i,u=n(o,!1),a=n(function(t,e){var n;o(t)&&(fe(n=t.element,"display","none"),oe(n,"aria-hidden","true"),br(t,Ji(),{name:e,visible:!1}))}),c=(i=a,function(e,t){St(t,function(t){return i(e,t)})}),s=n(function(t,e){var n;o(t)||(ve(n=t.element,"display"),ce(n,"aria-hidden"),br(t,Ji(),{name:e,visible:!0}))});return{uid:r.uid,dom:r.dom,components:t,behaviours:tl(r.slotBehaviours),apis:{getSlotNames:e,getSlot:function(t,e){return ml(t,r,e)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,e())},showSlot:s}}}function QC(t,e){ml(t,e,"overflow").each(function(n){TC(t,e,function(t){var e=B(t,function(t){return Eu(t)});N1.setGroups(n,e)}),ml(t,e,"overflow-button").each(function(t){nO.hasGrown(n)&&zg.on(t)}),nO.refresh(n)})}var ZC,t1,e1,n1="data-value",o1=function(e,n,t,o){return B(t,function(t){return rk(t)?{type:"togglemenuitem",text:t.text,value:t.value,active:t.value===o,onAction:function(){Df.setValue(e,t.value),br(e,yy,{name:n}),Vg.focus(e)}}:{type:"nestedmenuitem",text:t.text,getSubmenuItems:function(){return o1(e,n,t.items,o)}}})},r1=function(t,e){return K(t,function(t){return rk(t)?ot(t.value===e,t):r1(t.items,e)})},i1=kl({name:"HtmlSelect",configFields:[mo("options"),Zs("selectBehaviours",[Vg,Df]),Eo("selectClasses",[]),Eo("selectAttributes",{}),wo("data")],factory:function(n,t){var e=B(n.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=n.data.map(function(t){return sr("initialValue",t)}).getOr({});return{uid:n.uid,dom:{tag:"select",classes:n.selectClasses,attributes:n.selectAttributes},components:e,behaviours:el(n.selectBehaviours,[Vg.config({}),Df.config({store:lt({mode:"manual",getValue:function(t){return Qr(t.element)},setValue:function(t,e){N(n.options,function(t){return t.value===e}).isSome()&&Zr(t.element,e)}},o)})])}}}),u1=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return nu([Cr(t.event,n),ru(function(){return e.cancel()})].concat(t.cancelEvent.map(function(t){return[Cr(t,function(){return e.cancel()})]}).getOr([])))}}),a1=Object.freeze({__proto__:null,throttle:ak,init:function(t){return t.stream.streams.state(t)}}),c1=xa({fields:[go("stream",lo("mode",{throttle:[mo("delay"),Eo("stopEvent",!0),ta("streams",{setup:function(t,e){var n=t.stream,o=vp(t.onStream,n.delay);return e.setTimer(o),function(t,e){o.throttle(t,e),n.stopEvent&&e.stop()}},state:ak})]})),Eo("event","input"),wo("cancelEvent"),Qu("onStream")],name:"streaming",active:u1,state:a1}),s1=function(t){sk(t,function(t,e){return t.setSelectionRange(e.length,e.length)})},l1=rt("alloy.typeahead.itemexecute"),f1=rt([wo("lazySink"),mo("fetch"),Eo("minChars",5),Eo("responseTime",1e3),Ju("onOpen"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Eo("layouts",vt.none()),Eo("eventOrder",{}),No("model",{},[Eo("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),Eo("selectsOver",!0),Eo("populateFromBrowse",!0)]),Ju("onSetValue"),$u("onExecute"),Ju("onItemExecute"),Eo("inputClasses",[]),Eo("inputAttributes",{}),Eo("inputStyles",{}),Eo("matchWidth",!0),Eo("useMinWidth",!1),Eo("dismissOnBlur",!0),qu(["openClass"]),wo("initialData"),Zs("typeaheadBehaviours",[Vg,Df,c1,Fg,zg,$y]),cr("previewing",function(){return Po(!0)})].concat(Ey()).concat(ux())),d1=rt([$f({schema:[Yu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(e,n){o.previewing.get()?e.getSystem().getByUid(o.uid).each(function(t){!function(t,e,o){if(t.selectsOver){var n=Df.getValue(e),r=t.getDisplayText(n),i=Df.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?vt.some(function(){var n;ck(0,e,o),n=r.length,sk(e,function(t,e){return t.setSelectionRange(n,e.length)})}):vt.none()}return vt.none()}(o.model,t,n).fold(function(){return hd.dehighlight(e,n)},function(t){return t()})}):e.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&ck(o.model,t,n)}),o.previewing.set(!1)},onExecute:function(t,e){return t.getSystem().getByUid(o.uid).toOptional().map(function(t){return br(t,l1(),{item:e}),!0})},onHover:function(t,e){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&ck(o.model,t,e)})}}}})]),m1=Cl({name:"Typeahead",configFields:f1(),partFields:d1(),factory:function(r,t,e,i){function n(t,e,n){r.previewing.set(!1);var o=$y.getCoupled(t,"sandbox");bf.isOpen(o)?cd.getCurrent(o).each(function(t){hd.getHighlighted(t).fold(function(){n(t)},function(){wr(o,t.element,"keydown",e)})}):ex(r,u(t),t,o,i,function(t){cd.getCurrent(t).each(n)},Vy.HighlightFirst).get(st)}function u(n){return function(t){return t.map(function(t){var e=H(Z(t.menus),function(t){return F(t.items,function(t){return"item"===t.type})});return Df.getState(n).update(B(e,function(t){return t.data})),t})}}var o=ry(r),a=[Vg.config({}),Df.config({onSetValue:r.onSetValue,store:lt({mode:"dataset",getDataKey:function(t){return Qr(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,e){Zr(t.element,r.model.getDisplayText(e))}},r.initialData.map(function(t){return sr("initialValue",t)}).getOr({}))}),c1.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,e){var n,o=$y.getCoupled(t,"sandbox");Vg.isFocused(t)&&Qr(t.element).length>=r.minChars&&(n=cd.getCurrent(o).bind(function(t){return hd.getHighlighted(t).map(Df.getValue)}),r.previewing.set(!0),ex(r,u(t),t,o,i,function(t){cd.getCurrent(o).each(function(t){n.fold(function(){r.model.selectsOver&&hd.highlightFirst(t)},function(e){hd.highlightBy(t,function(t){return Df.getValue(t).value===e.value}),hd.getHighlighted(t).orThunk(function(){return hd.highlightFirst(t),vt.none()})})})},Vy.HighlightFirst).get(st))},cancelEvent:Hi()}),Fg.config({mode:"special",onDown:function(t,e){return n(t,e,hd.highlightFirst),vt.some(!0)},onEscape:function(t){var e=$y.getCoupled(t,"sandbox");return bf.isOpen(e)?(bf.close(e),vt.some(!0)):vt.none()},onUp:function(t,e){return n(t,e,hd.highlightLast),vt.some(!0)},onEnter:function(e){var t=$y.getCoupled(e,"sandbox"),n=bf.isOpen(t);if(n&&!r.previewing.get())return cd.getCurrent(t).bind(function(t){return hd.getHighlighted(t)}).map(function(t){return br(e,l1(),{item:t}),!0});var o=Df.getValue(e);return vr(e,Hi()),r.onExecute(t,e,o),n&&bf.close(t),vt.some(!0)}}),zg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(t){return rx(r,t,{onOpen:function(){return zg.on(t)},onClose:function(){return zg.off(t)}})}}}),mm("typeaheadevents",[uu(function(t){nx(r,u(t),t,i,st,Vy.HighlightFirst).get(st)}),Cr(l1(),function(t,e){var n=$y.getCoupled(t,"sandbox");ck(r.model,t,e.event.item),vr(t,Hi()),r.onItemExecute(t,n,e.event.item,Df.getValue(t)),bf.close(n),s1(t)})].concat(r.dismissOnBlur?[Cr(Bi(),function(t){var e=$y.getCoupled(t,"sandbox");_a(e.element).isNone()&&bf.close(e)})]:[]))];return{uid:r.uid,dom:iy(Yo(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:lt(lt({},o),el(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),g1=function(i){return lt(lt({},i),{toCached:function(){return g1(i.toCached())},bindFuture:function(e){return g1(i.bind(function(t){return t.fold(function(t){return Gy(Nn.error(t))},function(t){return e(t)})}))},bindResult:function(e){return g1(i.map(function(t){return t.bind(e)}))},mapResult:function(e){return g1(i.map(function(t){return t.map(e)}))},mapError:function(e){return g1(i.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return i.map(function(t){return t.fold(e,n)})},withTimeout:function(t,r){return g1(Wy(function(e){var n=!1,o=setTimeout(function(){n=!0,e(Nn.error(r()))},t);i.get(function(t){n||(clearTimeout(o),e(t))})}))}})},p1=function(t){return g1(Wy(t))},h1={type:"separator"},v1=Ir("aria-invalid"),b1={bar:pk(function(t,e){return n=e.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:B(t.items,n.interpreter)};var n}),collection:pk(function(t,e){return u=t,a=e.shared.providers,c=u.label.map(function(t){return oy(t,a)}),s=n(function(t,e,n,o){e.stop(),a.isDisabled()||br(t,Sy,{name:u.name,value:o})}),l=[Cr(vi(),n(function(t,e,n){ka(n)})),Cr(Ci(),s),Cr(Ni(),s),Cr(bi(),n(function(t,e,n){Iu(t.element,"."+Bh).each(function(t){qr(t,Bh)}),Yr(n,Bh)})),Cr(yi(),n(function(t){Iu(t.element,"."+Bh).each(function(t){qr(t,Bh)})})),uu(n(function(t,e,n,o){br(t,Sy,{name:u.name,value:o})}))],ny(c,my.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:h},behaviours:ec([gd.config({disabled:a.isDisabled,onDisabled:function(t){o(t,function(t){Yr(t,"tox-collection__item--state-disabled"),oe(t,"aria-disabled",!0)})},onEnabled:function(t){o(t,function(t){qr(t,"tox-collection__item--state-disabled"),ce(t,"aria-disabled")})}}),pv(),Rg.config({}),Df.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var e=o,n=B(t,function(t){var e=dp.translate(t.text),n=1===u.columns?'<div class="tox-collection__item-label">'+e+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=e.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item'+(a.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+hy.encodeAllRaw(t.value)+'" title="'+i+'" aria-label="'+i+'">'+o+n+"</div>"}),r=B("auto"!==u.columns&&1<u.columns?p(n,u.columns):[n],function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"});Mr(e.element,r.join("")),"auto"===u.columns&&ah(o,5,"tox-collection__item").each(function(t){var e=t.numRows,n=t.numColumns;Fg.setGridSize(o,e,n)}),vr(o,Ty)}}),py.config({}),Fg.config(1===(i=u.columns)?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===i?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+Ch}}),mm("collection-events",l)]),eventOrder:((r={})[Ii()]=["disabling","alloy.base.behaviour","collection-events"],r)}),["tox-form__group--collection"],[]);function n(o){return function(e,n){Ru(n.event.target,"[data-collection-item-value]").each(function(t){o(e,n,t,ie(t,"data-collection-item-value"))})}}function o(t,e){return B(vs(t.element,".tox-collection__item"),e)}var u,a,r,i,c,s,l}),alertbanner:pk(function(t,e){return o=e.shared.providers,ly.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+(n=t).level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:jm(n.icon,o.icons),attributes:{title:o.translate(n.iconTooltip)}},action:function(t){br(t,Sy,{name:"alert-banner",value:n.url})},buttonBehaviours:ec([Wm()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(n.text)}}]});var n,o}),input:pk(function(t,e){return o=e.shared.providers,uk({name:(n=t).name,multiline:!1,label:n.label,inputMode:n.inputMode,placeholder:n.placeholder,flex:!1,disabled:n.disabled,classname:"tox-textfield",validation:vt.none(),maximized:n.maximized},o);var n,o}),textarea:pk(function(t,e){return o=e.shared.providers,uk({name:(n=t).name,multiline:!0,label:n.label,inputMode:vt.none(),placeholder:n.placeholder,flex:!0,disabled:n.disabled,classname:"tox-textarea",validation:vt.none(),maximized:n.maximized},o);var n,o}),label:pk(function(t,e){return r={dom:{tag:"label",innerHtml:(o=e.shared).providers.translate((n=t).label),classes:["tox-label"]}},i=B(n.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:ec([aw(),Rg.config({}),cw(vt.none()),Fg.config({mode:"acyclic"})])};var n,o,r,i}),iframe:(ZC=function(t,e){return n=t,o=e.shared.providers,u=bS&&n.sandboxed,a=lt(lt({},n.label.map(function(t){return{title:t}}).getOr({})),u?{sandbox:"allow-scripts allow-same-origin"}:{}),r=u,i=Po(""),c={getValue:function(t){return i.get()},setValue:function(t,e){var n;r?oe(t.element,"srcdoc",e):(oe(t.element,"src","javascript:''"),(n=t.element.dom.contentWindow.document).open(),n.write(e),n.close()),i.set(e)}},ny(n.label.map(function(t){return oy(t,o)}),my.parts.field({factory:{sketch:function(t){return d0({uid:t.uid,dom:{tag:"iframe",attributes:a},behaviours:ec([py.config({}),Vg.config({}),gS(vt.none(),c.getValue,c.setValue)])})}}}),["tox-form__group--stretched"],[]);var n,o,r,i,u,a,c},function(t,e,n){var o=Yo(e,{source:"dynamic"});return pk(ZC)(t,o,n)}),button:pk(function(t,e){return n=t,o=e.shared.providers,r=$0(n.name,"custom"),ny(vt.none(),my.parts.field(lt({factory:fp},K0(n,vt.some(r),o,[pS(""),aw()]))),[],[]);var n,o,r}),checkbox:pk(function(t,e){return r=t,i=e.shared.providers,u=Df.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),a=my.parts.field({factory:{sketch:h},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ec([aw(),gd.config({disabled:function(){return r.disabled||i.isDisabled()}}),py.config({}),Vg.config({}),u,Fg.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),mm("checkbox-events",[Cr(ki(),function(t,e){br(t,yy,{name:r.name})})])])}),c=my.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:i.translate(r.label)},behaviours:ec([vw.config({})])}),s=Hm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[o("checked"),o("unchecked")]}),my.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[a,s.asSpec(),c],fieldBehaviours:ec([gd.config({disabled:function(){return r.disabled||i.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])});function n(t){return t.element.dom.click(),vt.some(!0)}function o(t){return Xm("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},i.icons)}var r,i,u,a,c,s}),colorinput:pk(function(t,e){return n=t,r=e.shared,i=e.colorinput,c=my.parts.field({factory:Dy,inputClasses:["tox-textfield"],onSetValue:function(t){return Ky.run(t).get(st)},inputBehaviours:ec([gd.config({disabled:r.providers.isDisabled}),pv(),py.config({}),Ky.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Yt(t.element)},notify:{onValid:function(t){var e=Df.getValue(t);br(t,bw,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Df.getValue(t);if(0===e.length)return Gy(Nn.value(!0));var n=Mt.fromTag("span");fe(n,"background-color",e);var o=pe(n,"background-color").fold(function(){return Nn.error("blah")},function(t){return Nn.value(e)});return Gy(o)}}})]),selectOnFocus:!1}),s=n.label.map(function(t){return oy(t,r.providers)}),l=Hm((u={dom:{tag:"span",attributes:{"aria-label":r.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ya,Xa,$a]},onLtr:function(){return[Xa,Ya,$a]}},components:[],fetch:wb(i.getColors(),i.hasCustomColors()),columns:i.getColorCols(),presets:"color",onItemAction:function(t,n){l.getOpt(t).each(function(e){"custom"===n?i.colorPicker(function(t){t.fold(function(){return vr(e,xw)},function(t){o(e,t),hb(t)})},"#ffffff"):o(e,"remove"===n?"":n)})}},hw.sketch({dom:u.dom,components:u.components,toggleClass:"mce-active",dropdownBehaviours:ec([$v((a=r).providers.isDisabled),pv(),vw.config({}),py.config({})]),layouts:u.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:a.getSink,fetch:function(e){return Wy(function(t){return u.fetch(t)}).map(function(t){return vt.from(Xb(Yo(Ob(Ir("menu-value"),t,function(t){u.onItemAction(e,t)},u.columns,u.presets,Sh.CLOSE_ON_EXECUTE,T,a.providers),{movement:_b(u.columns,u.presets)})))})},parts:{menu:Zp(0,0,u.presets)}}))),my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[c,l.asSpec()]}]),fieldBehaviours:ec([mm("form-field-events",[Cr(bw,function(t,e){l.getOpt(t).each(function(t){fe(t.element,"background-color",e.event.color)}),br(t,yy,{name:n.name})}),Cr(yw,function(e,n){my.getField(e).each(function(t){Df.setValue(t,n.event.value),cd.getCurrent(e).each(Vg.focus)})}),Cr(xw,function(e,t){my.getField(e).each(function(t){cd.getCurrent(e).each(Vg.focus)})})])])});function o(t,e){br(t,yw,{value:e})}var n,r,i,u,a,c,s,l}),colorpicker:pk(function(t){var r=Hm(a0(c0,function(t){return"tox-"+t}).sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){br(t,Sy,{name:"hex-valid",value:!0})},onInvalidHex:function(t){br(t,Sy,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ec([Df.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return cd.getCurrent(e).bind(function(t){return Df.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);cd.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Df.setValue(t,{hex:vt.from(n[1]).getOr("")}),nS.getField(t,"hex").each(function(t){vr(t,Si())})})}}}),aw()])}}),dropzone:pk(function(t,e){return l0(t,e.shared.providers)}),grid:pk(function(t,e){return n=e.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:B(t.items,n.interpreter)};var n}),listbox:pk(function(t,e){return n=t,r=(o=e).shared.providers,i=Y(n.items).filter(rk),u=n.label.map(function(t){return oy(t,r)}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[my.parts.field({dom:{},factory:{sketch:function(t){return z0({uid:t.uid,text:i.map(function(t){return t.text}),icon:vt.none(),tooltip:n.label,role:vt.none(),fetch:function(t,e){e(j0(o1(t,n.name,n.items,Df.getValue(t)),Sh.CLOSE_ON_EXECUTE,o,!1))},onSetup:rt(st),getApi:rt({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[py.config({}),Df.config({store:{mode:"manual",initialValue:i.map(function(t){return t.value}).getOr(""),getValue:function(t){return ie(t.element,n1)},setValue:function(e,t){r1(n.items,t).each(function(t){oe(e.element,n1,t.value),br(e,NS,{text:t.text})})}}})]},"tox-listbox",o.shared)}}})]},my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([u.toArray(),[a]]),fieldBehaviours:ec([gd.config({disabled:rt(n.disabled),onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}})])});var n,o,r,i,u,a}),selectbox:pk(function(t,e){return n=t,o=e.shared.providers,r=B(n.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=n.label.map(function(t){return oy(t,o)}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:ft([[my.parts.field({dom:{},selectAttributes:{size:n.size},options:r,factory:i1,selectBehaviours:ec([gd.config({disabled:function(){return n.disabled||o.isDisabled()}}),py.config({}),mm("selectbox-change",[Cr(ki(),function(t,e){br(t,yy,{name:n.name})})])])})],(1<n.size?vt.none():vt.some(Xm("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},o.icons))).toArray()])},my.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([i.toArray(),[u]]),fieldBehaviours:ec([gd.config({disabled:function(){return n.disabled||o.isDisabled()},onDisabled:function(t){my.getField(t).each(gd.disable)},onEnabled:function(t){my.getField(t).each(gd.enable)}}),pv()])});var n,o,r,i,u}),sizeinput:pk(function(t,e){return ow(t,e.shared.providers)}),urlinput:pk(function(t,e){return gk(t,e,e.urlinput)}),customeditor:pk(function(n){var o=gc(),e=Hm({dom:{tag:n.tag}}),r=gc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ec([mm("custom-editor-events",[ou(function(t){e.getOpt(t).each(function(e){(Tt(n,"init")?n.init(e.element.dom):lS.load(n.scriptId,n.scriptUrl).then(function(t){return t(e.element.dom,n.settings)})).then(function(e){r.on(function(t){e.setValue(t)}),r.clear(),o.set(e)})})})]),Df.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,e){o.get().fold(function(){r.set(e)},function(t){return t.setValue(e)})}}}),aw()]),components:[e.asSpec()]}}),htmlpanel:pk(function(t){return"presentation"===t.presets?ly.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):ly.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ec([py.config({}),Vg.config({})])})}),imagetools:pk(function(t,e){return ok(t,e.shared.providers)}),table:pk(function(t,e){return ik(t,e.shared.providers)}),panel:pk(function(t,e){return{dom:{tag:"div",classes:t.classes},components:B(t.items,e.shared.interpreter)}})},y1={field:function(t,e){return e}},x1=function(e,n,o){return tt(b1,n.type).fold(function(){return console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n},function(t){return t(e,n,o)})},w1={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},S1=[{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",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],k1=function(t){return R(t,function(t,e){if(Tt(e,"items")){var n=k1(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(Tt(e,"inline")||Tt(e,"block")||Tt(e,"selector")){var o="custom-"+(y(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return lt(lt({},t),{formats:t.formats.concat(e)})},{customFormats:[],formats:[]})},C1=fS.trim,O1=wk("true"),_1=wk("false"),T1=function(t){var e=B(vs(Mt.fromDom(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),function(t){return t.dom});return F(B(F(e,_k),Tk).concat(B(F(e,Ck),Ek)),Dk)},E1="tinymce-url-history",D1=od,A1=ed,B1=rt([Eo("shell",!1),mo("makeItem"),Eo("setupItem",st),Af("listBehaviours",[Rg])]),M1=rt([Qf({name:"items",overrides:function(){return{behaviours:ec([Rg.config({})])}}})]),F1=Cl({name:rt("CustomList")(),configFields:B1(),partFields:M1(),factory:function(s,t,e,n){var o=s.shell?{behaviours:[Rg.config({})],components:[]}:{behaviours:[],components:t};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:el(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){var t;t=a,(s.shell?vt.some(t):ml(t,s,"items")).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(e){var t=Rg.contents(e),n=c.length,o=n-t.length,r=0<o?m(o,function(){return s.makeItem()}):[],i=t.slice(n);St(i,function(t){return Rg.remove(e,t)}),St(r,function(t){return Rg.append(e,t)});var u=Rg.contents(e);St(u,function(t,e){s.setupItem(a,t,c[e],e)})})}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),I1=rt([mo("dom"),Eo("shell",!0),Zs("toolbarBehaviours",[Rg])]),R1=rt([Qf({name:"groups",overrides:function(){return{behaviours:ec([Rg.config({})])}}})]),N1=Cl({name:"Toolbar",configFields:I1(),partFields:R1(),factory:function(o,t,e,n){var r=o.shell?{behaviours:[Rg.config({})],components:[]}:{behaviours:[],components:t};return{uid:o.uid,dom:o.dom,components:r.components,behaviours:el(o.toolbarBehaviours,r.behaviours),apis:{setGroups:function(t,e){var n;n=t,(o.shell?vt.some(n):ml(n,o,"groups")).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Rg.set(t,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),P1=rt([]),V1=Object.freeze({__proto__:null,setup:st,isDocked:T,getBehaviours:P1}),H1=Vo([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),L1=function(t,e,n){var o,r,i,u;t.getSystem().isConnected()&&(i=n,u=(r=e).lazyViewport(o=t),i.isDocked()&&$k(o,r,i,u),qk(o,u,i).each(function(t){t.fold(function(){return Kk(o,r,i)},function(t){return Jk(o,r,i,t)},function(t){$k(o,r,i,u,!0),Jk(o,r,i,t)})}))},z1=Object.freeze({__proto__:null,refresh:L1,reset:Qk,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,o){return n.setModes(o)}}),U1=Object.freeze({__proto__:null,events:function(o,r){return nu([Ar(_i(),function(e,n){o.contextual.each(function(t){Kr(e.element,t.transitionClass)&&($r(e.element,[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(e)),n.stop()})}),Cr(ji(),function(t,e){L1(t,o,r)}),Cr(Wi(),function(t,e){Qk(t,o,r)})])}}),j1=xa({fields:[To("contextual",[po("fadeInClass"),po("fadeOutClass"),po("transitionClass"),vo("lazyContext"),Ju("onShow"),Ju("onShown"),Ju("onHide"),Ju("onHidden")]),Io("lazyViewport",Fn),Ro("modes",["top","bottom"],er),Ju("onDocked"),Ju("onUndocked")],name:"docking",active:U1,apis:z1,state:Object.freeze({__proto__:null,init:function(t){var e=Po(!1),n=Po(!0),o=gc(),r=Po(t.modes);return wu({isDocked:e.get,setDocked:e.set,getInitialPos:o.get,setInitialPos:o.set,clearInitialPos:o.clear,isVisible:n.get,setVisible:n.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+r.get().join(",")}})}})}),W1=rt(Ir("toolbar-height-change")),G1={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},X1="tox-tinymce--toolbar-sticky-on",Y1="tox-tinymce--toolbar-sticky-off",q1=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",function(){n().each(j1.reset)}),t.on("ResizeWindow ResizeEditor",function(){n().each(tC)}),t.on("SkinLoaded",function(){n().each(function(t){j1.isDocked(t)?j1.reset(t):j1.refresh(t)})}),t.on("FullscreenStateChanged",function(){n().each(j1.reset)})),t.on("AfterScrollIntoView",function(b){n().each(function(t){j1.refresh(t);var e,n,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=t.element;Pd(v)&&(e=b,r=(o=jt(n=v)).dom.defaultView.innerHeight,i=Ie(o),a=He(u=Mt.fromDom(e.elm)),c=xe(u),l=(s=a.y)+c,f=ke(n),d=xe(n),g=(m=f.top)+d,p=Math.abs(m-i.top)<2,h=Math.abs(g-(i.top+r))<2,p&&s<g?Re(i.left,s-d,o):h&&m<l&&Re(i.left,s-r+c+d,o))})}),t.on("PostRender",function(){nC(t,!1)})},isDocked:function(t){return t().map(j1.isDocked).getOr(!1)},getBehaviours:oC}),K1=$o([po("type"),go("items",no([Qo([po("name"),xo("items",er)]),er]))].concat(Vp)),J1=[Co("text"),Co("tooltip"),Co("icon"),vo("fetch"),Io("onSetup",function(){return st})],$1=$o(V([po("type")],J1,!0)),Q1=$o([po("type"),Co("tooltip"),Co("icon"),Co("text"),Oo("select"),vo("fetch"),Io("onSetup",function(){return st}),Mo("presets","normal",["normal","color","listpreview"]),Eo("columns",1),vo("onAction"),vo("onItemAction")]),Z1=kl({factory:function(e,o){var t={focus:Fg.focusIn,setMenus:function(t,e){var n=B(e,function(e){return G0(rC({type:"menubutton",text:e.text,fetch:function(t){t(e.getItems())}}).mapError(function(t){return ur(t)}).getOrDie(),"tox-mbtn",o.backstage,vt.some("menuitem"))});Rg.set(t,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:ec([Rg.config({}),mm("menubar-events",[ou(function(t){e.onSetup(t)}),Cr(vi(),function(n,t){Iu(n.element,".tox-mbtn--active").each(function(e){Ru(t.event.target,".tox-mbtn").each(function(t){zt(e,t)||n.getSystem().getByDom(e).each(function(e){n.getSystem().getByDom(t).each(function(t){hw.expand(t),hw.close(e),Vg.focus(t)})})})})}),Cr(Ki(),function(n,t){t.event.prevFocus.bind(function(t){return n.getSystem().getByDom(t).toOptional()}).each(function(e){t.event.newFocus.bind(function(t){return n.getSystem().getByDom(t).toOptional()}).each(function(t){hw.isOpen(e)&&(hw.expand(t),hw.close(e))})})})]),Fg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return e.onEscape(t),vt.some(!0)}}),py.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[mo("dom"),mo("uid"),mo("onEscape"),mo("backstage"),Eo("onSetup",st)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),tO=Object.freeze({__proto__:null,refresh:function(t,e,n){var o;n.isExpanded()&&(ve(t.element,uC(e)),o=aC(e,t.element),fe(t.element,uC(e),o))},grow:function(t,e,n){n.isExpanded()||mC(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&dC(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&fC(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:gC,isShrinking:pC,isTransitioning:function(t,e,n){return gC(t,e)||pC(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?dC:mC)(t,e,n)},disableTransitions:cC}),eO=Object.freeze({__proto__:null,exhibit:function(t,e,n){return zr(e.expanded?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:sr(e.dimension.property,"0px")})},events:function(n,o){return nu([Ar(_i(),function(t,e){e.event.raw.propertyName===n.dimension.property&&(cC(t,n),o.isExpanded()&&ve(t.element,n.dimension.property),(o.isExpanded()?n.onGrown:n.onShrunk)(t))})])}}),nO=xa({fields:[mo("closedClass"),mo("openClass"),mo("shrinkingClass"),mo("growingClass"),wo("getAnimationRoot"),Ju("onShrunk"),Ju("onStartShrink"),Ju("onGrown"),Ju("onStartGrow"),Eo("expanded",!1),go("dimension",lo("property",{width:[ta("property","width"),ta("getDimension",function(t){return Ce(t)+"px"})],height:[ta("property","height"),ta("getDimension",function(t){return xe(t)+"px"})]}))],name:"sliding",active:eO,apis:tO,state:Object.freeze({__proto__:null,init:function(t){var e=Po(t.expanded);return wu({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:C(e.set,!1),setExpanded:C(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),oO="container",rO=[Zs("slotBehaviours",[])],iO=dt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},Hr),uO=lt(lt({},iO),{sketch:function(t){var n,e={slot:function(t,e){return n.push(t),cl(oO,hC(t),e)},record:rt(n=[])},o=t(e),r=B(e.record(),function(t){return Jf({name:t,pname:hC(t)})});return Sl(oO,rO,r,$C,o)}}),aO=$o([Co("icon"),Co("tooltip"),Io("onShow",st),Io("onHide",st),Io("onSetup",function(){return st})]),cO=Ir("FixSizeEvent"),sO=Ir("AutoSizeEvent"),lO=Object.freeze({__proto__:null,block:function(t,e,n,o){oe(t.element,"aria-busy",!0);var r=e.getRoot(t).getOr(t),i=ec([Fg.config({mode:"special",onTab:function(){return vt.some(!0)},onShiftTab:function(){return vt.some(!0)}}),Vg.config({})]),u=o(r,i),a=r.getSystem().build(u);Rg.append(r,Eu(a)),a.hasConfigured(Fg)&&e.focus&&Fg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith(function(){return Rg.remove(r,a)})},unblock:function(t,e,n){ce(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),fO=xa({fields:[Io("getRoot",vt.none),Fo("focus",!0),Ju("onBlock"),Ju("onUnblock")],name:"blocking",apis:lO,state:Object.freeze({__proto__:null,init:function(){var e=dc();return wu({readState:e.isSet,blockWith:function(t){e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})}),dO=rt([Zs("splitToolbarBehaviours",[$y]),cr("builtGroups",function(){return Po([])})]),mO=rt([qu(["overflowToggledClass"]),Oo("getOverflowBounds"),mo("lazySink"),cr("overflowGroups",function(){return Po([])})].concat(dO())),gO=rt([Jf({factory:N1,schema:I1(),name:"primary"}),$f({schema:I1(),name:"overflow"}),$f({name:"overflow-button"}),$f({name:"overflow-group"})]),pO=rt(function(t,e){var n=t,o=Math.floor(e);fe(n,"max-width",On.max(n,o,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"])+"px")}),hO=rt([qu(["toggledClass"]),mo("lazySink"),vo("fetch"),Oo("getBounds"),To("fireDismissalEventInstead",[Eo("event",Yi())]),Uc()]),vO=rt([$f({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ec([zg.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),$f({factory:N1,schema:I1(),name:"toolbar",overrides:function(e){return{toolbarBehaviours:ec([Fg.config({mode:"cyclic",onEscape:function(t){return ml(t,e,"button").each(Vg.focus),vt.none()}})])}}})]),bO=Cl({name:"FloatingToolbarButton",factory:function(u,t,a,e){return lt(lt({},fp.sketch(lt(lt({},e.button()),{action:function(t){EC(t,e)},buttonBehaviours:Bf({dump:e.button().buttonBehaviours},[$y.config({others:{toolbarSandbox:function(t){return o=t,n=a,r=u,{dom:{tag:"div",attributes:{id:(i=Nu()).id}},behaviours:ec([Fg.config({mode:"special",onEscape:function(t){return bf.close(t),vt.some(!0)}}),bf.config({onOpen:function(t,e){r.fetch().get(function(t){AC(o,e,r,n.layouts,t),i.link(o.element),Fg.focusIn(e)})},onClose:function(){zg.off(o),Vg.focus(o),i.unlink(o.element)},isPartOf:function(t,e,n){return Hu(e,n)||Hu(o,n)},getAttachPoint:function(){return r.lazySink(o).getOrDie()}}),ic.config({channels:lt(lt({},Xs(lt({isExtraPart:T},r.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ys({doReposition:function(){bf.getState($y.getCoupled(o,"toolbarSandbox")).each(function(t){DC(o,t,r,n.layouts)})}}))})])};var o,n,r,i}}})])}))),{apis:{setGroups:function(e,n){bf.getState($y.getCoupled(e,"toolbarSandbox")).each(function(t){AC(e,t,u,a.layouts,n)})},reposition:function(e){bf.getState($y.getCoupled(e,"toolbarSandbox")).each(function(t){DC(e,t,u,a.layouts)})},toggle:function(t){EC(t,e)},getToolbar:function(t){return bf.getState($y.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bf.isOpen($y.getCoupled(t,"toolbarSandbox"))}}})},configFields:hO(),partFields:vO(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),yO=rt([mo("items"),qu(["itemSelector"]),Zs("tgroupBehaviours",[Fg])]),xO=rt([Zf({name:"items",unit:"item"})]),wO=Cl({name:"ToolbarGroup",configFields:yO(),partFields:xO(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,behaviours:el(t.tgroupBehaviours,[Fg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),SO=Cl({name:"SplitFloatingToolbar",configFields:mO(),partFields:gO(),factory:function(n,t,e,o){var r=Hm(bO.sketch({fetch:function(){return Wy(function(t){t(BC(n.overflowGroups.get()))})},layouts:{onLtr:function(){return[Ya,Xa]},onRtl:function(){return[Xa,Ya]},onBottomLtr:function(){return[Ka,qa]},onBottomRtl:function(){return[qa,Ka]}},getBounds:e.getOverflowBounds,lazySink:n.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:n.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:n.uid,dom:n.dom,components:t,behaviours:el(n.splitToolbarBehaviours,[$y.config({others:{overflowGroup:function(){return wO.sketch(lt(lt({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,e){n.builtGroups.set(B(e,t.getSystem().build)),MC(t,r,n)},refresh:function(t){return MC(t,r,n)},toggle:function(t){r.getOpt(t).each(function(t){bO.toggle(t)})},isOpen:function(t){return r.getOpt(t).map(bO.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){bO.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(bO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),kO=rt([qu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ju("onOpened"),Ju("onClosed")].concat(dO())),CO=rt([Jf({factory:N1,schema:I1(),name:"primary"}),Jf({factory:N1,schema:I1(),name:"overflow",overrides:function(e){return{toolbarBehaviours:ec([nO.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:function(t){ml(t,e,"overflow-button").each(function(t){zg.off(t),Vg.focus(t)}),e.onClosed(t)},onGrown:function(t){Fg.focusIn(t),e.onOpened(t)},onStartGrow:function(t){ml(t,e,"overflow-button").each(zg.on)}}),Fg.config({mode:"acyclic",onEscape:function(t){return ml(t,e,"overflow-button").each(Vg.focus),vt.some(!0)}})])}}}),$f({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ec([zg.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),$f({name:"overflow-group"})]),OO=Cl({name:"SplitSlidingToolbar",configFields:kO(),partFields:CO(),factory:function(o,t,e,n){var r="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:el(o.splitToolbarBehaviours,[$y.config({others:{overflowGroup:function(e){return wO.sketch(lt(lt({},n["overflow-group"]()),{items:[fp.sketch(lt(lt({},n["overflow-button"]()),{action:function(t){vr(e,r)}}))]}))}}}),mm("toolbar-toggle-events",[Cr(r,function(t){FC(t,o)})])]),apis:{setGroups:function(t,e){var n=B(e,t.getSystem().build);o.builtGroups.set(n),QC(t,o)},refresh:function(t){return QC(t,o)},toggle:function(t){return FC(t,o)},isOpen:function(t){return ml(t,o,"overflow").map(nO.hasGrown).getOr(!1)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),_O=A1.optional({factory:Z1,name:"menubar",schema:[mo("backstage")]}),TO=A1.optional({factory:{sketch:function(t){return F1.sketch({uid:t.uid,dom:t.dom,listBehaviours:ec([Fg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return VC({type:t.type,uid:Ir("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),vt.some(!0)}})},setupItem:function(t,e,n,o){N1.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[mo("dom"),mo("onEscape")]}),EO=A1.optional({factory:{sketch:function(t){return(t.type===bh.sliding?function(t){var e=OO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=OO.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=PC(t);return OO.sketch(lt(lt({},o),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([W1()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([W1()],{type:"closed"})}}))}:t.type===bh.floating?function(i){var t=PC(i),e=SO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return SO.sketch(lt(lt({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element,e=He(t),n=Gt(t),o=He(n),r=Math.max(n.dom.scrollHeight,o.height);return Bn(e.x+4,o.y,e.width-8,r)},parts:lt(lt({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[e],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}:VC)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),vt.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[mo("dom"),mo("onEscape"),mo("getSink")]}),DO=A1.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?oC:P1;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ec(n(e,t.sharedBackstage))}}},name:"header",schema:[mo("dom")]}),AO=A1.optional({name:"socket",schema:[mo("dom")]}),BO=A1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ec([py.config({}),Vg.config({}),nO.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){cd.getCurrent(t).each(uO.hideAllSlots),vr(t,sO)},onGrown:function(t){vr(t,sO)},onStartGrow:function(t){br(t,cO,{width:pe(t.element,"width").getOr("")})},onStartShrink:function(t){br(t,cO,{width:Ce(t.element)+"px"})}}),Rg.config({}),cd.config({find:function(t){return Y(Rg.contents(t))}})])}],behaviours:ec([cS(0),mm("sidebar-sliding-events",[Cr(cO,function(t,e){fe(t.element,"width",e.event.width)}),Cr(sO,function(t,e){ve(t.element,"width")})])])}}},name:"sidebar",schema:[mo("dom")]}),MO=A1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ec([Rg.config({}),fO.config({focus:!1}),cd.config({find:function(t){return Y(t.components())}})]),components:[]}}},name:"throbber",schema:[mo("dom")]}),FO=Cl({name:"OuterContainer",factory:function(n,t,e){return{uid:n.uid,dom:n.dom,components:t,apis:{getSocket:function(t){return D1.getPart(t,n,"socket")},setSidebar:function(t,e){D1.getPart(t,n,"sidebar").each(function(t){return bC(t,e)})},toggleSidebar:function(t,e){D1.getPart(t,n,"sidebar").each(function(t){var n=e;cd.getCurrent(t).each(function(e){cd.getCurrent(e).each(function(t){nO.hasGrown(e)?uO.isShowing(t,n)?nO.shrink(e):(uO.hideAllSlots(t),uO.showSlot(t,n)):(uO.hideAllSlots(t),uO.showSlot(t,n),nO.grow(e))})})})},whichSidebar:function(t){return D1.getPart(t,n,"sidebar").bind(yC).getOrNull()},getHeader:function(t){return D1.getPart(t,n,"header")},getToolbar:function(t){return D1.getPart(t,n,"toolbar")},setToolbar:function(t,e){D1.getPart(t,n,"toolbar").each(function(t){t.getApis().setGroups(t,e)})},setToolbars:function(t,e){D1.getPart(t,n,"multiple-toolbar").each(function(t){F1.setItems(t,e)})},refreshToolbar:function(t){D1.getPart(t,n,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(t){D1.getPart(t,n,"toolbar").each(function(e){var t=e.getApis().toggle;null!=t?vt.some(function(t){return t(e)}(t)):vt.none()})},isToolbarDrawerToggled:function(t){return D1.getPart(t,n,"toolbar").bind(function(e){return vt.from(e.getApis().isOpen).map(function(t){return t(e)})}).getOr(!1)},getThrobber:function(t){return D1.getPart(t,n,"throbber")},focusToolbar:function(t){D1.getPart(t,n,"toolbar").orThunk(function(){return D1.getPart(t,n,"multiple-toolbar")}).each(function(t){Fg.focusIn(t)})},setMenubar:function(t,e){D1.getPart(t,n,"menubar").each(function(t){Z1.setMenus(t,e)})},focusMenubar:function(t){D1.getPart(t,n,"menubar").each(function(t){Z1.focus(t)})}},behaviours:n.behaviours}},configFields:[mo("dom"),mo("behaviours")],partFields:[DO,_O,EO,TO,AO,BO,MO],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var o=B(n,RC);t.setToolbar(e,o)},setToolbars:function(t,e,n){var o=B(n,function(t){return B(t,RC)});t.setToolbars(e,o)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),IO={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},RO=C(jC,!1),NO=C(jC,!0);function PO(t,e,n,o){var r;return{type:"basic",data:(r=t.getParam(e,n,"string"),B(o===t1.SemiColon?r.replace(/;$/,"").split(";"):r.split(" "),function(t){var e=t,n=t,o=t.split("=");return 1<o.length&&(e=o[0],n=o[1]),{title:e,format:n}}))}}function VO(n){var t={type:"basic",data:v_};return{tooltip:"Align",text:vt.none(),icon:vt.some("align-left"),isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(t){return vt.none},onAction:function(e){return function(){return N(v_,function(t){return t.format===e.format}).each(function(t){return n.execCommand(t.command)})}},updateText:function(t){var e=N(v_,function(t){return n.formatter.match(t.format)}).fold(rt("left"),function(t){return t.title.toLowerCase()});br(t,PS,{icon:"align-"+e})},dataset:t,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}}}function HO(t){return B(t.split(/\s*,\s*/),function(t){return t.replace(/^['"]+|['"]+$/g,"")})}function LO(r){function i(){function n(t){return t?HO(t)[0]:""}var t=r.queryCommandValue("FontName"),e=a.data,o=t?t.toLowerCase():"";return{matchOpt:N(e,function(t){var e=t.format;return e.toLowerCase()===o||n(e).toLowerCase()===n(o).toLowerCase()}).orThunk(function(){return ot(0===(t=o).indexOf("-apple-system")&&(e=HO(t.toLowerCase()),L(b_,function(t){return-1<e.indexOf(t.toLowerCase())})),{title:u,format:o});var t,e}),font:t}}var u="System Font",a=PO(r,"font_formats","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",t1.SemiColon);return{tooltip:"Fonts",text:vt.some(u),icon:vt.none(),isSelectedFor:function(e){return function(t){return t.exists(function(t){return t.format===e})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(t){return function(){return vt.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},updateText:function(t){var e=i(),n=e.matchOpt,o=e.font,r=n.fold(rt(o),function(t){return t.title});br(t,NS,{text:r})},dataset:a,shouldHide:!1,isInvalid:T}}function zO(n){function i(){var a=vt.none(),c=o.data,s=n.queryCommandValue("FontSize");if(s)for(var t=function(t){var e,n,o,r,i=(n=t,/[0-9.]+px$/.test(e=s)?(o=72*parseInt(e,10)/96,r=Math.pow(10,n||0),Math.round(o*r)/r+"pt"):tt(x_,e).getOr(e)),u=tt(y_,i).getOr("");a=N(c,function(t){return t.format===s||t.format===i||t.format===u})},e=3;a.isNone()&&0<=e;e--)t(e);return{matchOpt:a,size:s}}var t=rt(vt.none),o=PO(n,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",t1.Space);return{tooltip:"Font sizes",text:vt.some("12pt"),icon:vt.none(),isSelectedFor:function(e){return function(t){return t.exists(function(t){return t.format===e})}},getPreviewFor:t,getCurrentValue:function(){return i().matchOpt},onAction:function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("FontSize",!1,t.format)})}},updateText:function(t){var e=i(),n=e.matchOpt,o=e.size,r=n.fold(rt(o),function(t){return t.title});br(t,NS,{text:r})},dataset:o,shouldHide:!1,isInvalid:T}}function UO(t,e){var n=e(),o=B(n,function(t){return t.format});return vt.from(t.formatter.closest(o)).bind(function(e){return N(n,function(t){return t.format===e})}).orThunk(function(){return ot(t.formatter.match("p"),{title:"Paragraph",format:"p"})})}function jO(n){var o=PO(n,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",t1.SemiColon);return{tooltip:"Blocks",text:vt.some("Paragraph"),icon:vt.none(),isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(e){return function(){var t=n.formatter.get(e);return vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:n.dom.parseStyle(n.formatter.getCssText(e))})}},onAction:XC(n),updateText:function(t){var e=UO(n,function(){return o.data}).fold(rt("Paragraph"),function(t){return t.title});br(t,NS,{text:e})},dataset:o,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}}}function WO(r,t){return{tooltip:"Formats",text:vt.some("Paragraph"),icon:vt.none(),isSelectedFor:function(t){return function(){return r.formatter.match(t)}},getCurrentValue:vt.none,getPreviewFor:function(e){return function(){var t=r.formatter.get(e);return void 0!==t?vt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(e))}):vt.none()}},onAction:XC(r),updateText:function(t){var n=function(t){var e=t.items;return void 0!==e&&0<e.length?H(e,n):[{title:t.title,format:t.format}]},e=H(bk(r),n),o=UO(r,rt(e)).fold(rt("Paragraph"),function(t){return t.title});br(t,NS,{text:o})},shouldHide:r.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!r.formatter.canApply(t.format)},dataset:t}}function GO(e){return{isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}}function XO(e){return{setActive:function(t){zg.set(e,t)},isActive:function(){return zg.isOn(e)},isDisabled:function(){return gd.isDisabled(e)},setDisabled:function(t){return gd.set(e,t)}}}function YO(t,e){return t.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})}function qO(e,n,t,o,r,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:YO(t,i)},components:tb([e.map(function(t){return V0(t,i.icons)}),n.map(function(t){return L0(t,"tox-tbtn",i)})]),eventOrder:((u={})[mi()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ec([Qv(i.isDisabled),pv(),mm("common-button-display-events",[Cr(mi(),function(t,e){e.event.prevent(),vr(t,T_)})])].concat(o.map(function(t){return k_.config({channel:t,initialData:{icon:e,text:n},renderComponents:function(t,e){return tb([t.icon.map(function(t){return V0(t,i.icons)}),t.text.map(function(t){return L0(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}}function KO(t,e,n){var o,r=Po(st),i=qO(t.icon,t.text,t.tooltip,vt.none(),vt.none(),n);return fp.sketch({dom:i.dom,components:i.components,eventOrder:RS,buttonBehaviours:ec([mm("toolbar-button-events",[(o={onAction:t.onAction,getApi:e.getApi},uu(function(e,t){hv(o,e)(function(t){br(e,IS,{buttonApi:t}),o.onAction(t)})})),vv(e,r),bv(e,r)]),Qv(function(){return t.disabled||n.isDisabled()}),pv()].concat(e.toolbarButtonBehaviours))})}function JO(r,i){return function(t,e,n){var o=r(t).mapError(function(t){return ur(t)}).getOrDie();return i(o,e,n)}}function $O(n,t,o,r){var e,i=t.outerContainer,u=o.toolbar,a=o.buttons;f(u,y)?(e=u.map(function(t){var e={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return F_(n,e,{backstage:r},vt.none())}),FO.setToolbars(i,e)):FO.setToolbar(i,F_(n,o,{backstage:r},vt.none()))}function QO(t){return/^[0-9\.]+(|px)$/i.test(""+t)?vt.some(parseInt(""+t,10)):vt.none()}function ZO(t){return u(t)?t+"px":t}function t_(e,t,n){var o=t.filter(function(t){return e<t}),r=n.filter(function(t){return t<e});return o.or(r).getOr(e)}function e_(t){var e=lh(t),n=fh(t),o=mh(t);return QO(e).map(function(t){return t_(t,n,o)})}function n_(u,a,t,e,c){function s(){return x.get()&&!u.removed}function l(t){return y?t.fold(rt(0),function(t){return 1<t.components().length?xe(t.components()[1].element):0}):0}function f(){r.broadcastOn([xf()],{})}function o(t){var e,n,o,r,i;void 0===t&&(t=!1),s()&&(m||(e=p.getOrThunk(function(){var t=QO(ge(bn(),"margin-left")).getOr(0);return Ce(bn())-ke(a).left+t}),fe(c.get().element,"max-width",e+"px")),y&&FO.refreshToolbar(d),m||(n=l(FO.getToolbar(d)),o=Mn(a),r=v()?Math.max(o.y-xe(c.get().element)+n,0):o.bottom,de(d.element,{position:"absolute",top:Math.round(r)+"px",left:Math.round(o.x)+"px"})),g&&(i=c.get(),t?j1.reset(i):j1.refresh(i)),f())}function n(t){var e,n;void 0===t&&(t=!0),!m&&g&&s()&&(e=h.getDockingMode(),(n=function(t){switch(uv(u)){case xh.auto:var e=l(FO.getToolbar(d)),n=xe(t.element)-e,o=Mn(a);if(o.y>n)return"top";var r=Gt(a),i=Math.max(r.dom.scrollHeight,xe(r));return o.bottom<i-n||Fn().bottom<o.bottom-n?"bottom":"top";case xh.bottom:return"bottom";default:return xh.top,"top"}}(c.get()))!==e&&(function(t){var e=c.get();j1.setModes(e,[t]),h.setDockingMode(t);var n=v()?Oc.TopToBottom:Oc.BottomToTop;oe(e.element,ns,n)}(n),t&&o(!0)))}var r=t.uiMothership,d=t.outerContainer,i=nv.DOM,m=sv(u),g=dv(u),p=mh(u).or(e_(u)),h=e.shared.header,v=h.isPositionedAtTop,b=iv(u),y=b===bh.sliding||b===bh.floating,x=Po(!1);return{isVisible:s,isPositionedAtTop:v,show:function(){x.set(!0),fe(d.element,"display","flex"),i.addClass(u.getBody(),"mce-edit-focus"),ve(r.element,"display"),n(!1),o()},hide:function(){x.set(!1),t.outerContainer&&(fe(d.element,"display","none"),i.removeClass(u.getBody(),"mce-edit-focus")),fe(r.element,"display","none")},update:o,updateMode:n,repositionPopups:f}}function o_(t,e){var n=Mn(t);return{pos:e?n.y:n.bottom,bounds:n}}function r_(i,u){return Cr(IS,function(t,e){var n,o=i.get(t),r=(n=o,{hide:function(){return vr(n,Vi())},getValue:function(){return Df.getValue(n)}});u.onAction(r,e.event.buttonApi)})}function i_(t,e,n){return e.bottom-t.y>=(n=void 0===n?.01:n)&&t.bottom-e.y>=n}function u_(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Qt(Mt.fromDom(t.startContainer),t.startOffset).element;return(Xe(n)?Yt(n):vt.some(n)).filter(Ge).map(function(t){return t.dom.getBoundingClientRect()}).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=Ie();return Bn(n.left+e.left,n.top+e.top,e.width,e.height)}var o=He(Mt.fromDom(t.getBody()));return Bn(o.x+e.left,o.y+e.top,e.width,e.height)}function a_(t,e,n,o){void 0===o&&(o=0);var r,i,u,a,c=Pe(window),s=Mn(Mt.fromDom(t.getContentAreaContainer())),l=ph(t)||hh(t)||rv(t),f=(r=s,i=c,u=o,{x:a=Math.max(r.x+u,i.x),width:Math.min(r.right-u,i.right)-a}),d=f.x,m=f.width;if(t.inline&&!l)return Bn(d,c.y,m,c.height);var g=function(t,e,n,o,r,i){var u=Mt.fromDom(t.getContainer()),a=Iu(u,".tox-editor-header").getOr(u),c=Mn(a),s=c.y>=e.bottom,l=o&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===r?Mn(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,s,c,e.header.isPositionedAtTop(),n,o),p=g.y,h=g.bottom;return Bn(d,p,m,h-p)}function c_(t){return"node"===t}function s_(t,r,e,i,n){var u=u_(t),o=i.lastElement().exists(function(t){return zt(e,t)}),a=e,c=t.selection.getRng(),s=Qt(Mt.fromDom(c.startContainer),c.startOffset);return c.startContainer===c.endContainer&&c.startOffset===c.endOffset-1&&zt(s.element,a)?o?Nm:cp:o?function(e,t){var n=pe(e,"position");fe(e,"position",t);var o=i_(u,Mn(r))&&!i.isReposition()?Vm:Nm;return n.each(function(t){return fe(e,"position",t)}),o}(r,i.getMode()):("fixed"===i.getMode()?n.y+Ie().top:n.y)+(xe(r)+12)<=u.y?cp:sp}function l_(e,t){var n=M(F(t,function(t){return t.predicate(e.dom)}),function(t){return"contexttoolbar"===t.type});return{contextToolbars:n.pass,contextForms:n.fail}}function f_(n,t){function o(t){return zt(t,r)}var e,r=Mt.fromDom(t.getBody()),i=Mt.fromDom(t.selection.getNode());return o(e=i)||Ut(r,e)?function(t,e,n){var o=l_(t,e);if(0<o.contextForms.length)return vt.some({elem:t,toolbars:[o.contextForms[0]]});var r=l_(t,n);if(0<r.contextForms.length)return vt.some({elem:t,toolbars:[r.contextForms[0]]});if(0<o.contextToolbars.length||0<r.contextToolbars.length){var i=function(t){if(t.length<=1)return t;function e(e){return d(t,function(t){return t.position===e})}function n(e){return F(t,function(t){return t.position===e})}var o=e("selection"),r=e("node");if(o||r){if(r&&o){var i=n("node"),u=B(n("selection"),function(t){return lt(lt({},t),{position:"node"})});return i.concat(u)}return n(o?"selection":"node")}return n("line")}(o.contextToolbars.concat(r.contextToolbars));return vt.some({elem:t,toolbars:i})}return vt.none()}(i,n.inNodeScope,n.inEditorScope).orThunk(function(){return a=n,(t=o)(e=i)?vt.none():dr(e,function(t){if(Ge(t)){var e=l_(t,a.inNodeScope),n=e.contextToolbars,o=e.contextForms,r=0<o.length?o:(u=n).length<=1?u:i("selection").orThunk(function(){return i("node")}).orThunk(function(){return i("line")}).map(function(t){return t.position}).fold(function(){return[]},function(e){return F(u,function(t){return t.position===e})});return 0<r.length?vt.some({elem:t,toolbars:r}):vt.none()}function i(e){return N(u,function(t){return t.position===e})}var u;return vt.none()},t);var t,e,a}):vt.none()}function d_(a,c){var s={},l=[],f=[],d={},m={},t=Ct(a);return St(t,function(t){var e,n,o,r,i,u=a[t];"contextform"===u.type?(o=t,i=co(ao("ContextForm",qp,r=u)),(s[o]=i).launch.map(function(t){d["form:"+o]=lt(lt({},r.launch),{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){c(i)}})}),("editor"===i.scope?f:l).push(i),m[o]=i):"contexttoolbar"===u.type&&(e=t,ao("ContextToolbar",Kp,n=u).each(function(t){("editor"===n.scope?f:l).push(t),m[e]=t}))}),{forms:s,inNodeScope:l,inEditorScope:f,lookupTable:m,formNavigators:d}}function m_(d,t,m,u){function a(){var t=y.get().getOr("node"),e=c_(t)?1:0;return a_(d,p,t,e)}function c(){return!(d.removed||h()&&g.isContextMenuOpen())}function s(){if(c()){var t=a(),e=mt(y.get(),"node")?(n=d,v.get().filter(vn).map(He).getOrThunk(function(){return u_(n)})):u_(d);return t.height<=0||!i_(e,t)}return 1;var n}function e(){v.clear(),b.clear(),y.clear(),up.hide(x)}function n(){var t;up.isOpen(x)&&(ve(t=x.element,"display"),s()?fe(t,"display","none"):(b.set(0),up.reposition(x)))}function l(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ec([Fg.config({mode:"acyclic"}),mm("pop-dialog-wrap-events",[ou(function(t){d.shortcuts.add("ctrl+F9","focus statusbar",function(){return Fg.focusIn(t)})}),ru(function(t){d.shortcuts.remove("ctrl+F9")})])])}}function f(t,e){var n,o,r,i,c,s,u,a="node"===t?p.anchors.node(e):p.anchors.cursor(),l=(n=d,o=t,r=h(),i={lastElement:v.get,isReposition:function(){return mt(b.get(),0)},getMode:function(){return ff.getMode(m)}},"line"===o?{bubble:Sc(12,0,L_),layouts:{onLtr:function(){return[la]},onRtl:function(){return[fa]}},overrides:z_}:{bubble:Sc(0,12,L_,1/12),layouts:(c=n,s=i,u=o,r?{onLtr:function(t){return[$a,Xa,Ya,qa,Ka,Ja].concat(f(t))},onRtl:function(t){return[$a,Ya,Xa,Ka,qa,Ja].concat(f(t))}}:{onLtr:function(t){return[Ja,$a,qa,Xa,Ka,Ya].concat(f(t))},onRtl:function(t){return[Ja,$a,Ka,Ya,qa,Xa].concat(f(t))}}),overrides:z_});function f(t){return c_(u)?[(a=t,function(t,e,n,o,r){var i=s_(c,o,a,s,r),u=lt(lt({},t),{y:r.y,height:r.height});return lt(lt({},i(u,e,n,o,r)),{alwaysFit:!0})})]:[];var a}return Yo(a,l)}function o(t,e){var n,o,r,i;k.cancel(),c()&&(n=S(t),r=f(o=t[0].position,e),y.set(o),b.set(1),ve(i=x.element,"display"),mt(Et(e,v.get(),zt),!0)||(qr(i,X_),ff.reset(m,x)),up.showWithinBounds(x,l(n),{anchor:r,transition:{classes:[X_],mode:"placement"}},function(){return vt.some(a())}),e.fold(v.clear,v.set),s()&&fe(i,"display","none"))}var r,i,g=u.backstage,p=g.shared,h=ln().deviceType.isTouch,v=gc(),b=gc(),y=gc(),x=Tu((r={sink:m,onEscape:function(){return d.focus(),vt.some(!0)}},i=Po([]),up.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),up.getContent(t).each(function(t){ve(t.element,"visibility")}),qr(t.element,G_),ve(t.element,"width")},inlineBehaviours:ec([mm("context-toolbar-events",[Ar(_i(),function(t,e){"width"===e.event.raw.propertyName&&(qr(t.element,G_),ve(t.element,"width"))}),Cr(W_,function(t,e){var n=t.element;ve(n,"width");var o=Ce(n);up.setContent(t,e.event.contents),Yr(n,G_);var r=Ce(n);fe(n,"width",o+"px"),up.getContent(t).each(function(t){e.event.focus.bind(function(t){return ka(t),_a(n)}).orThunk(function(){return Fg.focusIn(t),Oa(gn(n))})}),lp.setTimeout(function(){fe(t.element,"width",r+"px")},0)}),Cr(U_,function(e,t){up.getContent(e).each(function(t){i.set(i.get().concat([{bar:t,focus:Oa(gn(e.element))}]))}),br(e,W_,{contents:t.event.forwardContents,focus:vt.none()})}),Cr(j_,function(e,t){q(i.get()).each(function(t){i.set(i.get().slice(0,i.get().length-1)),br(e,W_,{contents:Eu(t.bar),focus:t.focus})})})]),Fg.config({mode:"special",onEscape:function(e){return q(i.get()).fold(function(){return r.onEscape()},function(t){return vr(e,j_),vt.some(!0)})}})]),lazySink:function(){return Nn.value(r.sink)}}))),w=Rt(function(){return d_(t,function(t){var e=S([t]);br(x,U_,{forwardContents:l(e)})})}),S=function(t){var e=d.ui.registry.getAll().buttons,n=w(),o=lt(lt({},e),n.formNavigators),r=iv(d)===bh.scrolling?bh.scrolling:bh.default,i=ft(B(t,function(t){return"contexttoolbar"===t.type?F_(d,{buttons:o,toolbar:t.items,allowToolbarGroups:!1},u,vt.some(["form:"])):(e=p.providers,H_(t,e));var e}));return VC({type:r,uid:Ir("context-toolbar"),initGroups:i,onEscape:vt.none,cyclicKeying:!0,providers:p.providers})},k=vp(function(){d.hasFocus()&&!d.removed&&(Kr(x.element,X_)?k.throttle():f_(w(),d).fold(e,function(t){o(t.toolbars,vt.some(t.elem))}))},17);d.on("init",function(){d.on("remove",e),d.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",n),d.on("click keyup focus SetContent",k.throttle),d.on(V_,e),d.on("contexttoolbar-show",function(e){tt(w().lookupTable,e.toolbarKey).each(function(t){o([t],ot(e.target!==d,e.target)),up.getContent(x).each(Fg.focusIn)})}),d.on("focusout",function(t){lp.setEditorTimeout(d,function(){_a(m.element).isNone()&&_a(x.element).isNone()&&e()},0)}),d.on("SwitchMode",function(){d.mode.isReadOnly()&&e()}),d.on("AfterProgressState",function(t){t.state?e():d.hasFocus()&&k.throttle()}),d.on("NodeChange",function(t){_a(x.element).fold(k.throttle,st)})})}(e1=t1=t1||{})[e1.SemiColon=0]="SemiColon",e1[e1.Space=1]="Space";var g_,p_,h_,v_=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],b_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],y_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},x_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},w_=Object.freeze({__proto__:null,events:function(r,i){function u(n,o){r.updateState.each(function(t){var e=t(n,o);i.set(e)}),r.renderComponents.each(function(t){var e=B(t(o,i.get()),n.getSystem().build);Rs(n,e)})}return nu([Cr(Fi(),function(t,e){var n,o=e;o.universal||(n=r.channel,wt(o.channels,n)&&u(t,o.data))}),ou(function(e,t){r.initialData.each(function(t){u(e,t)})})])}}),S_=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),k_=xa({fields:[mo("channel"),wo("renderComponents"),wo("updateState"),wo("initialData")],name:"reflecting",active:w_,apis:S_,state:Object.freeze({__proto__:null,init:function(){var t=Po(vt.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(vt.none())}}}})}),C_=rt([mo("toggleClass"),mo("fetch"),Qu("onExecute"),Eo("getHotspot",vt.some),Eo("getAnchorOverrides",rt({})),Uc(),Qu("onItemExecute"),wo("lazySink"),mo("dom"),Ju("onOpen"),Zs("splitDropdownBehaviours",[$y,Fg,Vg]),Eo("matchWidth",!1),Eo("useMinWidth",!1),Eo("eventOrder",{}),wo("role")].concat(ux())),O_=rt([Jf({factory:fp,schema:[mo("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ec([Vg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(yr)},buttonBehaviours:ec([zg.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),Jf({factory:fp,schema:[mo("dom")],name:"button",defaults:function(){return{buttonBehaviours:ec([Vg.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(n.uid).each(function(t){n.onExecute(t,e)})}}}}),Qf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[mo("text")],name:"aria-descriptor"}),$f({schema:[Yu()],name:"menu",defaults:function(o){return{onExecute:function(e,n){e.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,e,n)})}}}}),Zy()]),__=Cl({name:"SplitDropdown",configFields:C_(),partFields:O_(),factory:function(o,t,e,n){function r(t){cd.getCurrent(t).each(function(t){hd.highlightFirst(t),Fg.focusIn(t)})}function i(t){nx(o,h,t,n,r,Vy.HighlightFirst).get(st)}function u(t){return yr(gl(t,o,"button")),vt.some(!0)}var a,c=lt(lt({},nu([ou(function(n,t){ml(n,o,"aria-descriptor").each(function(t){var e=Ir("aria");oe(t.element,"id",e),oe(n.element,"aria-describedby",e)})})])),Sm(vt.some(i))),s={repositionMenus:function(t){zg.isOn(t)&&ix(t)}};return{uid:o.uid,dom:o.dom,components:t,apis:s,eventOrder:lt(lt({},o.eventOrder),((a={})[Ii()]=["disabling","toggling","alloy.base.behaviour"],a)),events:c,behaviours:el(o.splitDropdownBehaviours,[$y.config({others:{sandbox:function(t){var e=gl(t,o,"arrow");return rx(o,t,{onOpen:function(){zg.on(e),zg.on(t)},onClose:function(){zg.off(e),zg.off(t)}})}}}),Fg.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),vt.some(!0)}}),Vg.config({}),zg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),T_=Ir("focus-button"),E_=function(t,e,n){return KO(t,{toolbarButtonBehaviours:[].concat(0<n.length?[mm("toolbarButtonWith",n)]:[]),getApi:GO,onSetup:t.onSetup},e)},D_=function(t,e,n){return Yo(KO(t,{toolbarButtonBehaviours:[Rg.config({}),zg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<n.length?[mm("toolbarToggleButtonWith",n)]:[]),getApi:XO,onSetup:t.onSetup},e))},A_=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],B_={button:JO(Op,function(t,e){return n=e.backstage.shared.providers,E_(t,n,[]);var n}),togglebutton:JO(_p,function(t,e){return n=e.backstage.shared.providers,D_(t,n,[]);var n}),menubutton:JO(rC,function(t,e){return G0(t,"tox-tbtn",e.backstage,vt.none())}),splitbutton:JO(function(t){return ao("SplitButton",Q1,t)},function(t,e){return o=t,r=e.backstage.shared,s=Ir("channel-update-split-dropdown-display"),l=Po(st),f={getApi:n,onSetup:o.onSetup},__.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:lt({"aria-pressed":!1},YO(o.tooltip,r.providers))},onExecute:function(t){o.onAction(n(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:ec([Yv(r.providers.isDisabled),pv(),mm("split-dropdown-events",[Cr(T_,Vg.focus),vv(f,l),bv(f,l)]),vw.config({})]),eventOrder:((i={})[Gi()]=["alloy.base.behaviour","split-dropdown-events"],i),toggleClass:"tox-tbtn--enabled",lazySink:r.getSink,fetch:(u=n,a=o,c=r.providers,function(e){return Wy(function(t){return a.fetch(t)}).map(function(t){return vt.from(Xb(Yo(Ob(Ir("menu-value"),t,function(t){a.onItemAction(u(e),t)},a.columns,a.presets,Sh.CLOSE_ON_EXECUTE,a.select.getOr(T),c),{movement:_b(a.columns,a.presets),menuBehaviours:Kh("auto"!==a.columns?[]:[ou(function(o,t){ah(o,4,Jp(a.presets)).each(function(t){var e=t.numRows,n=t.numColumns;Fg.setGridSize(o,e,n)})})])})))})}),parts:{menu:Zp(0,o.columns,o.presets)},components:[__.parts.button(qO(o.icon,o.text,vt.none(),vt.some(s),vt.some([zg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),r.providers)),__.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:jm("chevron-down",r.providers.icons)},buttonBehaviours:ec([Yv(r.providers.isDisabled),pv(),Wm()])}),__.parts["aria-descriptor"]({text:r.providers.translate("To open the popup, press Shift+Enter")})]});function n(n){return{isDisabled:function(){return gd.isDisabled(n)},setDisabled:function(t){return gd.set(n,t)},setIconFill:function(t,e){Iu(n.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){oe(t,"fill",e)})},setIconStroke:function(t,e){Iu(n.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){oe(t,"stroke",e)})},setActive:function(e){oe(n.element,"aria-pressed",e),Iu(n.element,"span").each(function(t){n.getSystem().getByDom(t).each(function(t){return zg.set(t,e)})})},isActive:function(){return Iu(n.element,"span").exists(function(t){return n.getSystem().getByDom(t).exists(zg.isOn)})}}}var o,r,i,u,a,c,s,l,f}),grouptoolbarbutton:JO(function(t){return ao("GroupToolbarButton",K1,t)},function(t,e,n){var o,r,i,u,a,c,s=n.ui.registry.getAll().buttons,l=((o={})[ns]=e.backstage.shared.header.isPositionedAtTop()?Oc.TopToBottom:Oc.BottomToTop,o);if(iv(n)!==bh.floating)throw new Error("Toolbar groups are only supported when using floating toolbar mode");return i=e.backstage,u=function(t){return F_(n,{buttons:s,toolbar:t,allowToolbarGroups:!1},e,vt.none())},a=l,c=i.shared,bO.sketch({lazySink:c.getSink,fetch:function(){return Wy(function(t){t(B(u(r.items),RC))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:qO((r=t).icon,r.text,r.tooltip,vt.none(),vt.none(),c.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:a}}}})}),styleSelectButton:function(t,e){return KC(t,n=e.backstage,WO(t,lt({type:"advanced"},n.styleselect)));var n},fontsizeSelectButton:function(t,e){return KC(t,e.backstage,zO(t))},fontSelectButton:function(t,e){return KC(t,e.backstage,LO(t))},formatButton:function(t,e){return KC(t,e.backstage,jO(t))},alignMenuButton:function(t,e){return KC(t,e.backstage,VO(t))}},M_={styleselect:B_.styleSelectButton,fontsizeselect:B_.fontsizeSelectButton,fontselect:B_.fontSelectButton,formatselect:B_.formatButton,align:B_.alignMenuButton},F_=function(o,c,s,l){var n,t,e,r,i=(e=c.toolbar,r=c.buttons,!1===e?[]:void 0===e||!0===e?(n=r,t=B(A_,function(t){var e=F(t.items,function(t){return Tt(n,t)||Tt(M_,t)});return{name:t.name,items:e}}),F(t,function(t){return 0<t.items.length})):y(e)?B(e.split("|"),function(t){return{items:t.trim().split(" ")}}):f(e,function(t){return Tt(t,"name")&&Tt(t,"items")})?e:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[]));return F(B(i,function(t){var e=H(t.items,function(t){return 0===t.trim().length?[]:(r=o,e=c.buttons,i=t,u=c.allowToolbarGroups,a=s,n=l,tt(e,i.toLowerCase()).orThunk(function(){return n.bind(function(t){return K(t,function(t){return tt(e,t+i.toLowerCase())})})}).fold(function(){return tt(M_,i.toLowerCase()).map(function(t){return t(r,a)}).orThunk(function(){return vt.none()})},function(t){return"grouptoolbarbutton"!==t.type||u?(n=a,o=r,tt(B_,(e=t).type).fold(function(){return console.error("skipping button defined by",e),vt.none()},function(t){return vt.some(t(e,n,o))})):(console.warn("Ignoring the '"+i+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),vt.none());var e,n,o}).toArray());var r,e,i,u,a,n});return{title:vt.from(o.translate(t.name)),items:e}}),function(t){return 0<t.items.length})},I_=ln(),R_=I_.os.isiOS()&&I_.os.version.major<=12,N_=Object.freeze({__proto__:null,render:function(n,e,t,o,r){var i=Po(0),u=e.outerContainer;RO(n);var a=Mt.fromDom(r.targetNode),c=te(gn(a)),s=e.mothership;pf(a,s,De),Ls(c,e.uiMothership),n.on("PostRender",function(){$O(n,e,t,o),i.set(n.getWin().innerWidth),FO.setMenubar(u,LC(n,t)),FO.setSidebar(u,t.sidebar),function(n,t){function e(){var t=c.get();t.left===u.innerWidth&&t.top===u.innerHeight||(c.set(kn(u.innerWidth,u.innerHeight)),Uv(n))}function o(){var t=n.getDoc().documentElement,e=s.get();e.left===t.offsetWidth&&e.top===t.offsetHeight||(s.set(kn(t.offsetWidth,t.offsetHeight)),Uv(n))}function r(t){return n.fire("ScrollContent",t)}var i=n.dom,u=n.getWin(),a=n.getDoc().documentElement,c=Po(kn(u.innerWidth,u.innerHeight)),s=Po(kn(a.offsetWidth,a.offsetHeight));i.bind(u,"resize",e),i.bind(u,"scroll",r);var l=hc(Mt.fromDom(n.getBody()),"load",o),f=t.uiMothership.element;n.on("hide",function(){fe(f,"display","none")}),n.on("show",function(){ve(f,"display")}),n.on("NodeChange",o),n.on("remove",function(){l.unbind(),i.unbind(u,"resize",e),i.unbind(u,"scroll",r),u=null})}(n,e)});var l,f,d,m,g=FO.getSocket(u).getOrDie("Could not find expected socket element");R_&&(de(g.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),f=function(){n.fire("ScrollContent")},d=null,m=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];b(d)&&(d=setTimeout(function(){d=null,f.apply(null,t)},20))},l=pc(g.element,"scroll",m),n.on("remove",l.unbind)),gv(n,e),n.addCommand("ToggleSidebar",function(t,e){FO.toggleSidebar(u,e),n.fire("ToggleSidebar")}),n.addQueryValueHandler("ToggleSidebar",function(){return FO.whichSidebar(u)});var p=iv(n);p!==bh.sliding&&p!==bh.floating||n.on("ResizeWindow ResizeEditor ResizeContent",function(){var t=n.getWin().innerWidth;t!==i.get()&&(FO.refreshToolbar(e.outerContainer),i.set(t))});var h={enable:function(){mv(e,!1)},disable:function(){mv(e,!0)},isDisabled:function(){return gd.isDisabled(u)}};return{iframeContainer:g.element.dom,editorContainer:u.element.dom,api:h}}}),P_=Object.freeze({__proto__:null,render:function(e,n,o,r,t){var i=n.mothership,u=n.uiMothership,a=n.outerContainer,c=Po(null),s=Mt.fromDom(t.targetNode),l=n_(e,s,n,r,c),f=e.getParam("toolbar_persist",!1,"boolean");function d(){var t;c.get()?l.show():(c.set(FO.getHeader(a).getOrDie()),Ls(t=lv(e),i),Ls(t,u),$O(e,n,o,r),FO.setMenubar(a,LC(e,o)),l.show(),function(c,s,l,t){function e(t){var e=o_(s,l.isPositionedAtTop()),n=e.pos,o=e.bounds,r=f.get(),i=r.pos,u=r.bounds,a=o.height!==u.height||o.width!==u.width;f.set({pos:n,bounds:o}),a&&Uv(c,t),l.isVisible()&&(i!==n?l.update(!0):a&&(l.updateMode(),l.repositionPopups()))}var f=Po(o_(s,l.isPositionedAtTop()));t||(c.on("activate",l.show),c.on("deactivate",l.hide)),c.on("SkinLoaded ResizeWindow",function(){return l.update(!0)}),c.on("NodeChange keydown",function(t){lp.requestAnimationFrame(function(){return e(t)})}),c.on("ScrollWindow",function(){return l.updateMode()});var n=mc();n.set(hc(Mt.fromDom(c.getBody()),"load",e)),c.on("remove",function(){n.clear()})}(e,s,l,f),e.nodeChanged())}NO(e),e.on("show",d),e.on("hide",l.hide),f||(e.on("focus",d),e.on("blur",l.hide)),e.on("init",function(){(e.hasFocus()||f)&&d()}),gv(e,n);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){mv(n,!1)},disable:function(){mv(n,!0)},isDisabled:function(){return gd.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),V_="contexttoolbar-hide",H_=function(t,e){var n,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=Hm(Dy.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:ec([Fg.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return yr(t),!0})},onLeft:function(t,e){return e.cut(),vt.none()},onRight:function(t,e){return e.cut(),vt.none()}})])})),c=(n=a,o=t.commands,r=e,i=B(o,function(t){return Hm(("contextformtogglebutton"===t.type?function(t,e,n){var o=e.original;o.primary;var r=A(o,["primary"]),i=co(_p(lt(lt({},r),{type:"togglebutton",onAction:st})));return D_(i,n.backstage.shared.providers,[r_(t,e)])}:function(t,e,n){var o=e.original;o.primary;var r=A(o,["primary"]),i=co(Op(lt(lt({},r),{type:"button",onAction:st})));return E_(i,n.backstage.shared.providers,[r_(t,e)])})(n,t,{backstage:{shared:{providers:r}}}))}),{asSpecs:function(){return B(i,function(t){return t.asSpec()})},findPrimary:function(n){return K(o,function(t,e){return t.primary?vt.from(i[e]).bind(function(t){return t.getOpt(n)}).filter(O(gd.isDisabled)):vt.none()})}});return[{title:vt.none(),items:[a.asSpec()]},{title:vt.none(),items:c.asSpecs()}]},L_={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},z_={maxHeightFunction:Nc(),maxWidthFunction:pO()},U_=Ir("forward-slide"),j_=Ir("backward-slide"),W_=Ir("change-slide-event"),G_="tox-pop--resizing",X_="tox-pop--transition",Y_={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},q_=(h_=["Infinity",(g_="[0-9]+")+"\\."+K_(g_)+K_(p_="[eE][+-]?[0-9]+"),"\\."+g_+K_(p_),g_+K_(p_)].join("|"),new RegExp("^([+-]?(?:"+h_+"))(.*)$"));function K_(t){return"(?:"+t+")?"}function J_(u,a){function e(){var t=a.getOptions(u),r=a.getCurrent(u).map(a.hash),i=gc();return B(t,function(o){return{type:"togglemenuitem",text:a.display(o),onSetup:function(e){function t(t){t&&(i.on(function(t){return t.setActive(!1)}),i.set(e)),e.setActive(t)}t(mt(r,a.hash(o)));var n=a.watcher(u,o,t);return function(){i.clear(),n()}},onAction:function(){return a.setCurrent(u,o)}}})}u.ui.registry.addMenuButton(a.name,{tooltip:a.text,icon:a.icon,fetch:function(t){return t(e())},onSetup:a.onToolbarSetup}),u.ui.registry.addNestedMenuItem(a.name,{type:"nestedmenuitem",text:a.text,getSubmenuItems:e,onSetup:a.onMenuSetup})}function $_(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}}function Q_(t){var e,n;!function(n){fS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,e){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:WC(n,t.name),onAction:$_(n,t.name)})});for(var t=1;t<=6;t++){var e="h"+t;n.ui.registry.addToggleButton(e,{text:e.toUpperCase(),tooltip:"Heading "+t,onSetup:WC(n,e),onAction:$_(n,e)})}}(t),e=t,fS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(e,t.action)})}),n=t,fS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(n,t.action),onSetup:WC(n,t.name)})})}function Z_(e,n){return GC(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(t){t.setDisabled(e.mode.isReadOnly()||!e.undoManager[n]())})}function tT(t){var e;t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:YC(t,"mceToggleVisualAid")}),t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:GC(e=t,"VisualAid",function(t){t.setActive(e.hasVisual)}),onAction:YC(t,"mceToggleVisualAid")})}function eT(t,e){var n,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=t;St([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){T.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:YC(T,t.cmd),onSetup:WC(T,t.name)})}),T.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:YC(T,"JustifyNone")}),Q_(O=t),_=O,fS.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){_.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:YC(_,t.action)})}),_.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:$_(_,"code")}),C=qC(0,d=l=e,VO(f=s=t)),f.ui.registry.addNestedMenuItem("align",{text:d.shared.providers.translate("Align"),getSubmenuItems:function(){return C.items.validateItems(C.getStyleItems())}}),p=qC(0,g=l,LO(m=s)),m.ui.registry.addNestedMenuItem("fontformats",{text:g.shared.providers.translate("Fonts"),getSubmenuItems:function(){return p.items.validateItems(p.getStyleItems())}}),h=s,b=lt({type:"advanced"},(v=l).styleselect),y=qC(0,v,WO(h,b)),h.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return y.items.validateItems(y.getStyleItems())}}),w=qC(0,l,jO(x=s)),x.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}}),k=qC(0,l,zO(S=s)),S.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return k.items.validateItems(k.getStyleItems())}}),(a=u=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:Z_(a,"hasUndo"),onAction:YC(a,"undo")}),a.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:Z_(a,"hasRedo"),onAction:YC(a,"redo")}),(c=u).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:Z_(c,"hasUndo"),onAction:YC(c,"undo")}),c.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:Z_(c,"hasRedo"),onAction:YC(c,"redo")}),function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,e){var n,o=t,r=e;(n=i).undoManager.transact(function(){n.focus(),n.formatter.apply(o,{value:r}),n.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var e,n=t;(e=i).undoManager.transact(function(){e.focus(),e.formatter.remove(n,{value:null},null,!0),e.nodeChanged()})});var e=Po(Fb),n=Po(Fb);kb(t,"forecolor","forecolor","Text color",e),kb(t,"backcolor","hilitecolor","Background color",n),Cb(t,"forecolor","forecolor","Text color"),Cb(t,"backcolor","hilitecolor","Background color")}(t),tT(t),(r=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:GC(i=r,"NodeChange",function(t){t.setDisabled(!i.queryCommandState("outdent"))}),onAction:YC(r,"outdent")}),r.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:YC(r,"indent")}),J_(n=t,LT),o=n,vt.from(o.getParam("content_langs",void 0,"array")).map(function(t){return{name:"language",text:"Language",icon:"language",getOptions:rt(t),hash:function(t){return E(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){return mr(Mt.fromDom(t.selection.getNode()),function(t){return vt.some(t).filter(Ge).bind(function(e){return ue(e,"lang").map(function(t){return{code:t,customCode:ue(e,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(t){var e=mc();return t.setActive(o.formatter.match("lang",{},void 0,!0)),e.set(o.formatter.formatChanged("lang",t.setActive,!0)),e.clear}}}).each(function(t){return J_(n,t)})}function nT(t,e){return{type:"makeshift",x:t,y:e}}function oT(t){return"longpress"===t.type||0===t.type.indexOf("touch")}function rT(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(oT(t)){var e=t.touches[0];return nT(e.pageX,e.pageY)}return nT(t.pageX,t.pageY)}(e):(n=t.getContentAreaContainer(),o=function(t){if(oT(t)){var e=t.touches[0];return nT(e.clientX,e.clientY)}return nT(t.clientX,t.clientY)}(e),r=nv.DOM.getPos(n),i=r.x,u=r.y,nT(o.x+i,o.y+u)):zT(t);var n,o,r,i,u}function iT(t,e,n){switch(n){case"node":return{type:"node",node:vt.some(Mt.fromDom((o=t).selection.getNode())),root:Mt.fromDom(o.getBody())};case"point":return rT(t,e);case"selection":return zT(t)}var o}function uT(f,d,m,g,p,h){function t(){var e,n,t,o,r,i,u,a,c,s,l=m();t=l,o=g,r=p,u=!(y||v||b&&x),c=iT(e=f,n=d,a=i=h),s=lt({bubble:Sc(0,"point"===a?12:0,jT),layouts:UT,overrides:{maxWidthFunction:pO(),maxHeightFunction:Nc()}},c),j0(t,Sh.CLOSE_ON_EXECUTE,o,!0).map(function(t){n.preventDefault(),up.showMenuWithinBounds(r,{anchor:s},{menu:{markers:Qp("normal"),highlightImmediately:u},data:t,type:"horizontal"},function(){return vt.some(a_(e,o.shared,"node"===i?"node":"selection"))}),e.fire(V_)})}var e,n=ln(),v=n.os.isiOS(),b=n.os.isOSX(),y=n.os.isAndroid(),x=n.deviceType.isTouch();(b||v)&&"node"!==h?(e=function(){(function(t){function e(){lp.setEditorTimeout(t,function(){t.selection.setRng(n)},10),i()}var n=t.selection.getRng();function o(t){t.preventDefault(),t.stopImmediatePropagation()}function r(){return i()}t.once("touchend",e),t.on("mousedown",o,!0),t.once("longpresscancel",r);var i=function(){t.off("touchend",e),t.off("longpresscancel",r),t.off("mousedown",o)}})(f),t()},function(t,e){var n=t.selection;if(!(n.isCollapsed()||e.touches.length<1)){var o=e.touches[0],r=n.getRng();return xs(t.getWin(),ms.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}}(f,d)?e():(f.once("selectionchange",e),f.once("touchend",function(){return f.off("selectionchange",e)}))):t()}function aT(t){return"string"==typeof t?t.split(/[ ,]/):t}function cT(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")}function sT(t){return y(t)?"|"===t:"separator"===t.type}function lT(t,e){if(0===e.length)return t;var n=q(t).filter(function(t){return!sT(t)}).fold(function(){return[]},function(t){return[WT]});return t.concat(n).concat(e).concat([WT])}function fT(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)}function dT(t,e){return fT(t,e)?t.selection.getStart(!0):e.target}function mT(s,t,e){function n(t){return up.hide(i)}function o(c){var t;cT(s)&&c.preventDefault(),c.ctrlKey&&!cT(s)||!1===s.getParam("contextmenu")||(t=function(t,e){var n=t.getParam("contextmenu_avoid_overlap","","string"),o=fT(t,e)?"selection":"point";if(at(n)){var r=dT(t,e);return Yb(Mt.fromDom(r),n)?"node":o}return o}(s,c),(r()?uT:function(t,e,n,o,r,i){var u=n(),a=iT(t,e,i);j0(u,Sh.CLOSE_ON_EXECUTE,o,!1).map(function(t){e.preventDefault(),up.showMenuAt(r,{anchor:a},{menu:{markers:Qp("normal")},data:t})})})(s,c,function(){var t,e,n,o=dT(s,c),r=s.ui.registry.getAll(),i=(n=(e=s).ui.registry.getAll().contextMenus,vt.from(e.getParam("contextmenu")).map(aT).getOrThunk(function(){return F(aT("link linkchecker image imagetools table spellchecker configurepermanentpen"),function(t){return Tt(n,t)})})),u=r.contextMenus,a=o;return 0<(t=R(i,function(o,t){return tt(u,t.toLowerCase()).map(function(t){var e=t.update(a);if(y(e))return lT(o,e.split(" "));if(0<e.length){var n=B(e,GT);return lT(o,n)}return o}).getOrThunk(function(){return o.concat([t])})},[])).length&&sT(t[t.length-1])&&t.pop(),t},e,i,t))}var r=ln().deviceType.isTouch,i=Tu(up.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return s.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ec([mm("dismissContextMenu",[Cr(Yi(),function(t,e){bf.close(t),s.focus()})])])}));s.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");s.on(t,n),s.on("longpress contextmenu",o)})}function gT(e){return function(t){return t.translate(-e.left,-e.top)}}function pT(e){return function(t){return t.translate(e.left,e.top)}}function hT(n){return function(t,e){return R(n,function(t,e){return e(t)},kn(t,e))}}function vT(t,e,n){return t.fold(hT([pT(n),gT(e)]),hT([gT(e)]),hT([]))}function bT(t,e,n){return t.fold(hT([pT(n)]),hT([]),hT([pT(e)]))}function yT(t,e,n){return t.fold(hT([]),hT([gT(n)]),hT([pT(e),gT(n)]))}function xT(t,e,n){var o=t.fold(function(t,e){return{position:vt.some("absolute"),left:vt.some(t+"px"),top:vt.some(e+"px")}},function(t,e){return{position:vt.some("absolute"),left:vt.some(t-n.left+"px"),top:vt.some(e-n.top+"px")}},function(t,e){return{position:vt.some("fixed"),left:vt.some(t+"px"),top:vt.some(e+"px")}});return lt({right:vt.none(),bottom:vt.none()},o)}function wT(t,i,u,a){function e(o,r){return function(t,e){var n=o(i,u,a);return r(t.getOr(n.left),e.getOr(n.top))}}return t.fold(e(yT,YT),e(bT,qT),e(vT,KT))}function ST(t,e){var n=ie(t,e);return E(n)?NaN:parseInt(n,10)}function kT(t,e,n,o,r,i){var u,a,c,s,l,f,d=(u=n,a=o,l=ST(s=t.element,(c=e).leftAttr),f=ST(s,c.topAttr),(isNaN(l)||isNaN(f)?vt.none():vt.some(kn(l,f))).fold(function(){return u},function(t){return KT(t.left+a.left,t.top+a.top)})),m=(e.mustSnap?JT:$T)(t,e,d,r,i),g=vT(d,r,i),p=e,h=g,v=t.element;return oe(v,p.leftAttr,h.left+"px"),oe(v,p.topAttr,h.top+"px"),m.fold(function(){return{coord:KT(g.left,g.top),extra:vt.none()}},function(t){return{coord:t.output,extra:t.extra}})}function CT(t,c,s,l){return K(t,function(t){var e,n,o=t.sensor,r=t.range.left,i=t.range.top,u=bT(c,e=s,n=l),a=bT(o,e,n);return Math.abs(u.left-a.left)<=r&&Math.abs(u.top-a.top)<=i?vt.some({output:wT(t.output,c,s,l),extra:t.extra}):vt.none()})}function OT(t,e){var n;t.getSystem().addToGui(e),Yt((n=e).element).filter(Ge).each(function(e){pe(e,"z-index").each(function(t){oe(e,ZT,t)}),fe(e,"z-index",ge(n.element,"z-index"))})}function _T(t){Yt(t.element).filter(Ge).each(function(e){ue(e,ZT).fold(function(){return ve(e,"z-index")},function(t){return fe(e,"z-index",t)}),ce(e,ZT)}),t.getSystem().removeFromGui(t)}function TT(t,e,n){return t.getSystem().build(ly.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))}function ET(t,e){return{bounds:t.getBounds(),height:we(e.element),width:Oe(e.element)}}function DT(A,B,t,e,n){var o=t.update(e,n),M=t.getStartData().getOrThunk(function(){return ET(B,A)});o.each(function(t){var e,n,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_=A,T=M,E=t,D=(e=B).getTarget(_.element);e.repositionTarget&&(n=Ie(jt(_.element)),o=Uk(D),S=pe(w=D,"left"),k=pe(w,"top"),C=pe(w,"position"),O=function(t,e,n){return("fixed"===n?KT:YT)(parseInt(t,10),parseInt(e,10))},r=(S.isSome()&&k.isSome()&&C.isSome()?vt.some(O(S.getOrDie(),k.getOrDie(),C.getOrDie())):vt.none()).getOrThunk(function(){var t=ke(w);return qT(t.left,t.top)}),i=_,u=e.snaps,a=r,c=n,s=o,l=E,f=T,m=u.fold(function(){var n,o,t=vT((n=l.left,o=l.top,a.fold(function(t,e){return YT(t+n,e+o)},function(t,e){return qT(t+n,e+o)},function(t,e){return KT(t+n,e+o)})),c,s);return KT(t.left,t.top)},function(e){var t=kT(i,e,a,l,c,s);return t.extra.each(function(t){e.onSensor(i,t)}),t.coord}),g=c,p=s,h=(d=f).bounds,v=bT(m,g,p),b=Wa(v.left,h.x,h.x+h.width-d.width),y=Wa(v.top,h.y,h.y+h.height-d.height),x=qT(b,y),me(D,xT(m.fold(function(){var t=yT(x,g,p);return YT(t.left,t.top)},rt(x),function(){var t=vT(x,g,p);return KT(t.left,t.top)}),0,o))),e.onDrag(_,D,E)})}function AT(o,t,e,n){t.each(_T),e.snaps.each(function(t){var e,n;e=t,ce(n=o.element,e.leftAttr),ce(n,e.topAttr)});var r=e.getTarget(o.element);n.reset(),e.onDrop(o,r)}function BT(t){return function(e,n){function o(t){n.setStartData(ET(e,t))}return nu(V([Cr(ji(),function(t){n.getStartData().each(function(){return o(t)})})],t(e,n,o),!0))}}function MT(a,c,s){return[Cr(mi(),function(e,t){var n,o,r,i,u;0===t.event.raw.button&&(t.stop(),r={drop:n=function(){return AT(e,vt.some(i),a,c)},delayDrop:(o=qb(n,200)).schedule,forceDrop:n,move:function(t){o.cancel(),DT(e,a,c,nE,t)}},i=TT(e,a.blockerClass,(u=r,nu([Cr(mi(),u.forceDrop),Cr(hi(),u.drop),Cr(gi(),function(t,e){u.move(e.event)}),Cr(pi(),u.delayDrop)]))),s(e),OT(e,i))})]}function FT(a,c,s){function l(t){AT(t,f.get(),a,c),f.clear()}var f=gc();return[Cr(si(),function(e,t){function n(){return l(e)}t.stop();var o,r,i,u=TT(e,a.blockerClass,(r=o=n,i=function(t){DT(e,a,c,rE,t)},nu([Cr(si(),r),Cr(fi(),o),Cr(di(),o),Cr(li(),function(t,e){i(e.event)})])));f.set(u),s(e),OT(e,u)}),Cr(li(),function(t,e){e.stop(),DT(t,a,c,rE,e.event)}),Cr(fi(),function(t,e){e.stop(),l(t)}),Cr(di(),l)]}function IT(t,r,i,u,e,n){return t.fold(function(){return aE.snap({sensor:qT(i-20,u-20),range:kn(e,n),output:qT(vt.some(i),vt.some(u)),extra:{td:r}})},function(t){var e=i-20,n=u-20,o=t.element.dom.getBoundingClientRect();return aE.snap({sensor:qT(e,n),range:kn(40,40),output:qT(vt.some(i-o.width/2),vt.some(u-o.height/2)),extra:{td:r}})})}function RT(t,i,u){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,e){var n=e.td,o=i.get(),r=n;o.exists(function(t){return zt(t,r)})||(i.set(n),u(n))},mustSnap:!0}}function NT(t){return Hm(fp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ec([aE.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),vw.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))}function PT(a,n){function e(t){var e=He(t);return IT(g.getOpt(n),t,e.x,e.y,e.width,e.height)}function o(t){var e=He(t);return IT(p.getOpt(n),t,e.right,e.bottom,e.width,e.height)}function r(t,i,e,u){var n=e(i);aE.snapTo(t,n),function(t){var e=i.dom.getBoundingClientRect();ve(t.element,"display");var n=Xt(Mt.fromDom(a.getBody())).dom.innerHeight,o=e[u]<0,r=e[u]>n;(o||r)&&fe(t.element,"display","none")}(t)}function i(t){return r(h,t,e,"top")}function u(t){return r(v,t,o,"bottom")}var c=Po([]),s=Po([]),t=Po(!1),l=gc(),f=gc(),d=RT(function(){return B(c.get(),e)},l,function(e){f.get().each(function(t){a.fire("TableSelectorChange",{start:e,finish:t})})}),m=RT(function(){return B(s.get(),o)},f,function(e){l.get().each(function(t){a.fire("TableSelectorChange",{start:t,finish:e})})}),g=NT(d),p=NT(m),h=Tu(g.asSpec()),v=Tu(p.asSpec());ln().deviceType.isTouch()&&(a.on("TableSelectionChange",function(e){t.get()||(Ns(n,h),Ns(n,v),t.set(!0)),l.set(e.start),f.set(e.finish),e.otherCells.each(function(t){c.set(t.upOrLeftCells),s.set(t.downOrRightCells),i(e.start),u(e.finish)})}),a.on("ResizeEditor ResizeWindow ScrollContent",function(){l.get().each(i),f.get().each(u)}),a.on("TableSelectionClear",function(){t.get()&&(Vs(h),Vs(v),t.set(!1)),l.clear(),f.clear()}))}var VT,HT,LT={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return r=["fixed","relative","empty"],vt.from(q_.exec(t)).bind(function(t){var e=Number(t[1]),n=t[2],o=n;return d(r,function(t){return d(Y_[t],function(t){return o===t})})?vt.some({value:e,unit:n}):vt.none()}).map(function(t){return t.value+t.unit}).getOr(t);var r},display:h,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return vt.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},zT=function(t){return{type:"selection",root:Mt.fromDom(t.selection.getNode())}},UT={onLtr:function(){return[$a,Xa,Ya,qa,Ka,Ja,cp,sp,Mm,Am,Bm,Dm]},onRtl:function(){return[$a,Ya,Xa,Ka,qa,Ja,cp,sp,Bm,Dm,Mm,Am]}},jT={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},WT={type:"separator"},GT=function(e){function t(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}}var n;if(y(e))return e;switch(e.type){case"separator":return WT;case"submenu":return lt(lt({type:"nestedmenuitem"},t(e)),{getSubmenuItems:function(){var t=e.getSubmenuItems();return y(t)?t:B(t,GT)}});default:return lt(lt({type:"menuitem"},t(e)),{onAction:(n=e.onAction,function(){return n()})})}},XT=Vo([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),YT=XT.offset,qT=XT.absolute,KT=XT.fixed,JT=function(t,e,l,f,d){var n=e.getSnapPoints(t);return CT(n,l,f,d).orThunk(function(){return R(n,function(e,n){var t,o,r,i,u,a,c,s=(t=n.sensor,n.range.left,n.range.top,i=bT(l,o=f,r=d),u=bT(t,o,r),a=Math.abs(i.left-u.left),c=Math.abs(i.top-u.top),kn(a,c));return e.deltas.fold(function(){return{deltas:vt.some(s),snap:vt.some(n)}},function(t){return(s.left+s.top)/2<=(t.left+t.top)/2?{deltas:vt.some(s),snap:vt.some(n)}:e})},{deltas:vt.none(),snap:vt.none()}).snap.map(function(t){return{output:wT(t.output,l,f,d),extra:t.extra}})})},$T=function(t,e,n,o,r){return CT(e.getSnapPoints(t),n,o,r)},QT=Object.freeze({__proto__:null,snapTo:function(t,e,n,o){var r,i,u,a=e.getTarget(t.element);e.repositionTarget&&(r=Ie(jt(t.element)),i=Uk(a),me(a,xT({coord:wT((u=o).output,u.output,r,i),extra:u.extra}.coord,0,i)))}}),ZT="data-initial-z-index",tE=To("snaps",[mo("getSnapPoints"),Ju("onSensor"),mo("leftAttr"),mo("topAttr"),Eo("lazyViewport",Fn),Eo("mustSnap",!1)]),eE=[Eo("useFixed",T),mo("blockerClass"),Eo("getTarget",h),Eo("onDrag",st),Eo("repositionTarget",!0),Eo("onDrop",st),Io("getBounds",Fn),tE],nE=Object.freeze({__proto__:null,getData:function(t){return vt.from(kn(t.x,t.y))},getDelta:function(t,e){return kn(e.left-t.left,e.top-t.top)}}),oE=V(V([],eE,!0),[ta("dragger",{handlers:BT(MT)})],!1),rE=Object.freeze({__proto__:null,getData:function(t){var e,n=t.raw.touches;return 1===n.length?(e=n[0],vt.some(kn(e.clientX,e.clientY))):vt.none()},getDelta:function(t,e){return kn(e.left-t.left,e.top-t.top)}}),iE=V(V([],eE,!0),[ta("dragger",{handlers:BT(FT)})],!1),uE=V(V([],eE,!0),[ta("dragger",{handlers:BT(function(t,e,n){return V(V([],MT(t,e,n),!0),FT(t,e,n),!0)})})],!1),aE=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:oE,touch:iE,mouseOrTouch:uE}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:vt.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var i=vt.none(),e=vt.none(),t=rt({});return wu({readState:t,reset:function(){i=vt.none(),e=vt.none()},update:function(r,t){return r.getData(t).bind(function(t){return e=r,n=t,o=i.map(function(t){return e.getDelta(t,n)}),i=vt.some(n),o;var e,n,o})},getStartData:function(){return e},setStartData:function(t){e=vt.some(t)}})}}),apis:QT});function cE(t,e,n){var o,r,i,u,a,c,s=Mt.fromDom(t.getContainer());J((o=t,r=e,i=n,u=xe(s),a=Ce(s),(c={}).height=t_(u+r.top,dh(o),gh(o)),i===VT.Both&&(c.width=t_(a+r.left,fh(o),mh(o))),c),function(t,e){return fe(s,e,ZO(t)),0}),t.fire("ResizeEditor")}function sE(t,e,n,o){return cE(t,kn(20*n,20*o),e),vt.some(!0)}function lE(t,e){var n,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(v=[],t.getParam("elementpath",!0,"boolean")&&v.push((g=t,h=e,(p={}).delimiter||(p.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ec([Fg.config({mode:"flow",selector:"div[role=button]"}),gd.config({disabled:h.isDisabled}),pv(),py.config({}),Rg.config({}),mm("elementPathEvents",[ou(function(r,t){g.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Fg.focusIn(r)}),g.on("NodeChange",function(t){var e,o,n=function(t){for(var e=[],n=t.length;0<n--;){var o=t[n];if(1===o.nodeType&&!function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return 1;if("bookmark"===t.getAttribute("data-mce-type"))return 1}}(o)){var r=g.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||e.push({name:r.name,element:o}),r.isPropagationStopped())break}}return e}(t.parents);0<n.length?Rg.set(r,(e=B(n||[],function(e,t){return fp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:e.name},action:function(t){g.focus(),g.selection.select(e.element),g.nodeChanged()},buttonBehaviours:ec([$v(h.isDisabled),pv()])})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+p.delimiter+" "}},R(e.slice(1),function(t,e){var n=t;return n.push(o),n.push(e),n},[e[0]]))):Rg.set(r,[])})})])]),components:[]})),t.hasPlugin("wordcount")&&v.push((f=t,d=e,fp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ec([$v(d.isDisabled),pv(),py.config({}),Rg.config({}),Df.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),mm("wordcount-events",[uu(function(t){var e=Df.getValue(t),n="words"===e.mode?"characters":"words";Df.setValue(t,{mode:n,count:e.count}),b(t,e.count,n)}),ou(function(n){f.on("wordCountUpdate",function(t){var e=Df.getValue(n).mode;Df.setValue(n,{mode:e,count:t.wordCount}),b(n,t.wordCount,e)})})])]),eventOrder:((m={})[Ii()]=["disabling","alloy.base.behaviour","wordcount-events"],m)}))),t.getParam("branding",!0,"boolean")&&v.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(l=dp.translate(["Powered by {0}","Tiny"]))+'">'+l+"</a>"}}),n=0<v.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:v}]:[],i=e,a=!(u=r=t).hasPlugin("autoresize"),o=(s=!1===(c=u.getParam("resize",a))?VT.None:"both"===c?VT.Both:VT.Vertical)===VT.None?vt.none():vt.some(Xm("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:i.translate("Resize")},behaviours:[aE.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,e,n){return cE(r,n,s)},blockerClass:"tox-blocker"}),Fg.config({mode:"special",onLeft:function(){return sE(r,s,-1,0)},onRight:function(){return sE(r,s,1,0)},onUp:function(){return sE(r,s,0,-1)},onDown:function(){return sE(r,s,0,1)}}),py.config({}),Vg.config({})]},i.icons)),n.concat(o.toArray()))};function b(t,e,n){return Rg.set(t,[ri(d.translate(["{0} "+n,e[n]]))])}}function fE(d){function m(){return i.bind(FO.getHeader)}function g(){return Nn.value(y)}function p(){return i.bind(function(t){return FO.getThrobber(t)}).getOrDie("Could not find throbber element")}var t,e,n,o,r=d.inline,h=r?P_:N_,v=dv(d)?q1:V1,i=vt.none(),u=ln(),a=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],s=av(d),l=lv(d),f=dp.isRtl()?{attributes:{dir:"rtl"}}:{},b={attributes:((t={})[ns]=s?Oc.BottomToTop:Oc.TopToBottom,t)},y=Tu((e=zt(bn(),l)&&"grid"===ge(l,"display"),n={dom:lt({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(a).concat(c)},f),behaviours:ec([ff.config({useFixed:function(){return v.isDocked(m)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:nu([Cr(Wi(),function(){fe(J.element,"width",document.body.clientWidth+"px")})])},Yo(n,e?o:{}))),x=Hm({dom:{tag:"div",classes:["tox-anchorbar"]}}),w=Lk(y,d,function(){return i.bind(function(t){return x.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),S=FO.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:w,onEscape:function(){d.focus()}}),k=iv(d),C=FO.parts.toolbar(lt({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g,providers:w.shared.providers,onEscape:function(){d.focus()},type:k,lazyToolbar:function(){return i.bind(function(t){return FO.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return m().getOrDie("Could not find header element")}},b)),O=FO.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:w.shared.providers,onEscape:function(){d.focus()},type:k}),_=FO.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),T=FO.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),E=FO.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:w}),D=d.getParam("statusbar",!0,"boolean")&&!r?vt.some(lE(d,w.shared.providers)):vt.none(),A={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[_,T]},B=rv(d),M=hh(d),F=ph(d),I=FO.parts.header({dom:lt({tag:"div",classes:["tox-editor-header"]},b),components:ft([F?[S]:[],B?[O]:M?[C]:[],sv(d)?[]:[x.asSpec()]]),sticky:dv(d),editor:d,sharedBackstage:w.shared}),R=ft([s?[]:[I],r?[]:[A],s?[I]:[]]),N=ft([[{dom:{tag:"div",classes:["tox-editor-container"]},components:R}],r?[]:D.toArray(),[E]]),P=fv(d),V=lt(lt({role:"application"},dp.isRtl()?{dir:"rtl"}:{}),P?{"aria-hidden":"true"}:{}),H=Tu(FO.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(s?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(a),styles:lt({visibility:"hidden"},P?{opacity:"0",border:"0"}:{}),attributes:V},components:N,behaviours:ec([pv(),gd.config({disableClass:"tox-tinymce--disabled"}),Fg.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),i=vt.some(H);d.shortcuts.add("alt+F9","focus menubar",function(){FO.focusMenubar(H)}),d.shortcuts.add("alt+F10","focus toolbar",function(){FO.focusToolbar(H)}),d.addCommand("ToggleToolbarDrawer",function(){FO.toggleToolbarDrawer(H)}),d.addQueryStateHandler("ToggleToolbarDrawer",function(){return FO.isToolbarDrawerToggled(H)});var L,z,U,j,W,G,X,Y,q,K=ey(H),J=ey(y);function $(){var t,e,n,o,r,i,u=ZO((o=sh(n=e=d),r=dh(n),i=gh(n),QO(o).map(function(t){return t_(t,r,i)}).getOr(sh(e)))),a=ZO(e_(t=d).getOr(lh(t)));return d.inline||(he("div","width",a)&&fe(H.element,"width",a),he("div","height",u)?fe(H.element,"height",u):fe(H.element,"height","200px")),u}return L=d,z=K,U=J,j=Sa(),W=pc(j,"touchstart",tt),G=pc(j,"touchmove",function(t){return Q(zi(),t)}),X=pc(j,"touchend",function(t){return Q(Ui(),t)}),Y=pc(j,"mousedown",tt),q=pc(j,"mouseup",function(t){0===t.raw.button&&Z(wf(),{target:t.target})}),L.on("PostRender",function(){L.on("click",et),L.on("tap",et),L.on("mouseup",nt),L.on("mousedown",ot),L.on("ScrollWindow",rt),L.on("ResizeWindow",it),L.on("ResizeEditor",ut),L.on("AfterProgressState",at),L.on("DismissPopups",ct)}),L.on("remove",function(){L.off("click",et),L.off("tap",et),L.off("mouseup",nt),L.off("mousedown",ot),L.off("ScrollWindow",rt),L.off("ResizeWindow",it),L.off("ResizeEditor",ut),L.off("AfterProgressState",at),L.off("DismissPopups",ct),Y.unbind(),W.unbind(),G.unbind(),X.unbind(),q.unbind()}),L.on("detach",function(){zs(z),zs(U),z.destroy(),U.destroy()}),{mothership:K,uiMothership:J,backstage:w,renderUI:function(){var o,r;v.setup(d,w.shared,m),eT(d,w),mT(d,g,w),r=(o=d).ui.registry.getAll().sidebars,St(Ct(r),function(e){function n(){return mt(vt.from(o.queryCommandValue("ToggleSidebar")),e)}var t=r[e];o.ui.registry.addToggleButton(e,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,e),t.setActive(n())},onSetup:function(t){function e(){return t.setActive(n())}return o.on("ToggleSidebar",e),function(){o.off("ToggleSidebar",e)}}})}),SC(d,p,w.shared),dt(d.getParam("toolbar_groups",{},"object"),function(t,e){d.ui.registry.addGroupToolbarButton(e,t)});var t,e=d.ui.registry.getAll(),n=e.buttons,i=e.menuItems,u=e.contextToolbars,a=e.sidebars,c=vh(d),s={menuItems:i,menus:(t=d.getParam("menu"))?dt(t,function(t){return lt(lt({},t),{items:t.items})}):{},menubar:d.getParam("menubar"),toolbar:c.getOrThunk(function(){return d.getParam("toolbar",!0)}),allowToolbarGroups:k===bh.floating,buttons:n,sidebar:a};m_(d,u,y,{backstage:w}),PT(d,y);var l=d.getElement(),f=$();return h.render(d,{mothership:K,uiMothership:J,outerContainer:H},s,w,{targetNode:l,height:f})},getUi:function(){return{channels:{broadcastAll:J.broadcast,broadcastOn:J.broadcastOn,register:st}}}};function Q(e,n){St([z,U],function(t){t.broadcastEvent(e,n)})}function Z(e,n){St([z,U],function(t){t.broadcastOn([e],n)})}function tt(t){return Z(yf(),{target:t.target})}function et(t){return Z(yf(),{target:Mt.fromDom(t.target)})}function nt(t){0===t.button&&Z(wf(),{target:Mt.fromDom(t.target)})}function ot(){St(L.editorManager.get(),function(t){L!==t&&t.fire("DismissPopups",{relatedTarget:L})})}function rt(t){return Q(ji(),Mc(t))}function it(t){Z(xf(),{}),Q(Wi(),Mc(t))}function ut(){return Z(xf(),{})}function at(t){t.state&&Z(yf(),{target:Mt.fromDom(L.getContainer())})}function ct(t){Z(yf(),{target:Mt.fromDom(t.relatedTarget.getContainer())})}}function dE(e){return ar("items","items",jn(),eo(io(function(t){return ao("Checking item of "+e,AD,t).fold(function(t){return Nn.error(ur(t))},function(t){return Nn.value(t)})})))}function mE(t){return y(t.type)&&y(t.name)}function gE(t){return{internalDialog:co(ao("dialog",VD,t)),dataValidator:(e=H(F(zD(t),mE),function(e){return vt.from(UD[e.type]).fold(function(){return[]},function(t){return[go(e.name,t)]})}),$o(e)),initialData:t.initialData};var e}function pE(t){var n=[],o={};return J(t,function(t,e){t.fold(function(){n.push(e)},function(t){o[e]=t})}),0<n.length?Nn.error(n):Nn.value(o)}function hE(t,e){fe(t,"height",e+"px"),ln().browser.isIE()?ve(t,"flex-basis"):fe(t,"flex-basis",e+"px")}function vE(t,d,e){Fu(t,'[role="dialog"]').each(function(f){Iu(f,'[role="tablist"]').each(function(l){e.get().map(function(t){return fe(d,"height","0"),fe(d,"flex-basis","0"),Math.min(t,(n=d,o=l,r=Gt(e=f).dom,i="fixed"===ge(Fu(e,".tox-dialog-wrap").getOr(e),"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight),u=xe(n),a=n.dom.offsetLeft>=o.dom.offsetLeft+Ce(o)?Math.max(xe(o),u):u,c=parseInt(ge(e,"margin-top"),10)||0,s=parseInt(ge(e,"margin-bottom"),10)||0,i-(xe(e)+c+s-a)));var e,n,o,r,i,u,a,c,s}).each(function(t){hE(d,t)})})})}function bE(t){return Iu(t,'[role="tabpanel"]')}function yE(t,n){function o(t){var e=pE(Df.getValue(t)).getOr({}),n=i.get(),o=Yo(n,e);i.set(o)}function r(t){var e=i.get();Df.setValue(t,e)}var u,a,i=Po({}),c=Po(null),e=B(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:n.shared.providers.translate(t.title)},view:function(){return[nS.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"]},components:B(t.items,function(t){return hk(e,t,n)}),formBehaviours:ec([Fg.config({mode:"acyclic",useTabstopAt:O(p0)}),mm("TabView.form.events",[ou(r),ru(o)]),ic.config({channels:lr([{key:QD,value:{onReceive:o}},{key:ZD,value:{onReceive:r}}])})])}})]}}}),s=(u=e,a=gc(),{extraEvents:[ou(function(t){var o=t.element;bE(o).each(function(e){var n;fe(e,"visibility","hidden"),t.getSystem().getByDom(e).toOptional().each(function(t){var o,r,i;Y(G((r=e,i=t,B(o=u,function(t,e){Rg.set(i,o[e].view());var n=r.dom.getBoundingClientRect();return Rg.set(i,[]),n.height})),function(t,e){return e<t?-1:t<e?1:0})).fold(a.clear,a.set)}),vE(o,e,a),ve(e,"visibility"),n=t,Y(u).each(function(t){return $D.showTab(n,t.value)}),lp.requestAnimationFrame(function(){vE(o,e,a)})})}),Cr(Wi(),function(t){var e=t.element;bE(e).each(function(t){vE(e,t,a)})}),Cr(Ty,function(t,e){var r=t.element;bE(r).each(function(e){var t=Oa(gn(e));fe(e,"visibility","hidden");var n=pe(e,"height").map(function(t){return parseInt(t,10)});ve(e,"height"),ve(e,"flex-basis");var o=e.dom.getBoundingClientRect().height;n.forall(function(t){return t<o})?(a.set(o),vE(r,e,a)):n.each(function(t){hE(e,t)}),ve(e,"visibility"),t.each(ka)})})],selectFirst:!1});return $D.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var o=Df.getValue(e);br(t,_y,{name:o,oldName:c.get()}),c.set(o)},tabs:e,components:[$D.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[YD.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ec([py.config({})])}),$D.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:ec([mm("tabpanel",s.extraEvents),Fg.config({mode:"acyclic"}),cd.config({find:function(t){return Y($D.getViewItems(t))}}),Df.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([QD],{}),i.get()},setValue:function(t,e){i.set(e),t.getSystem().broadcastOn([ZD],{})}}})])})}function xE(t,e,r,n){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:lt(lt({},e.map(function(t){return{id:t}}).getOr({})),n?{"aria-live":"polite"}:{})},components:[],behaviours:ec([cS(0),k_.config({channel:nA,updateState:function(t,e){return vt.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){return"tabpanel"!==t.body.type?[(n=t.body,o=r,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(e=Hm(nS.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"].concat(n.classes)},components:B(n.items,function(t){return hk(e,t,o)})}}))).asSpec()]}],behaviours:ec([Fg.config({mode:"acyclic",useTabstopAt:O(p0)}),aS(e),mS(e,{postprocess:function(t){return pE(t).fold(function(t){return console.error(t),{}},h)}})])})]:[yE(t.body,r)];var n,o,e},initialData:t})])}}(HT=VT=VT||{})[HT.None=0]="None",HT[HT.Both=1]="Both",HT[HT.Vertical=2]="Vertical";var wE,SE=rt([mo("lazySink"),wo("dragBlockClass"),Io("getBounds",Fn),Eo("useTabstopAt",D),Eo("eventOrder",{}),Zs("modalBehaviours",[Fg]),$u("onExecute"),Zu("onEscape")]),kE={sketch:h},CE=rt([Qf({name:"draghandle",overrides:function(t,e){return{behaviours:ec([aE.config({mode:"mouse",getTarget:function(t){return Fu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Jf({schema:[mo("dom")],name:"title"}),Jf({factory:kE,schema:[mo("dom")],name:"close"}),Jf({factory:kE,schema:[mo("dom")],name:"body"}),Qf({factory:kE,schema:[mo("dom")],name:"footer"}),$f({factory:{sketch:function(t,e){return lt(lt({},t),{dom:e.dom,components:e.components})}},schema:[Eo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Eo("components",[])],name:"blocker"})]),OE=Cl({name:"ModalDialog",configFields:SE(),partFields:CE(),factory:function(a,t,e,r){var n,i=gc(),o=Ir("modal-events"),u=lt(lt({},a.eventOrder),((n={})[Gi()]=[o].concat(a.eventOrder["alloy.system.attached"]||[]),n));return{uid:a.uid,dom:a.dom,components:t,apis:{show:function(t){i.set(t);var e=a.lazySink(t).getOrDie(),n=r.blocker(),o=e.getSystem().build(lt(lt({},n),{components:n.components.concat([Eu(t)]),behaviours:ec([Vg.config({}),mm("dialog-blocker-events",[Ar(bi(),function(){Fg.focusIn(t)})])])}));Ns(e,o),Fg.focusIn(t)},hide:function(e){i.clear(),Yt(e.element).each(function(t){e.getSystem().getByDom(t).each(function(t){Vs(t)})})},getBody:function(t){return gl(t,a,"body")},getFooter:function(t){return gl(t,a,"footer")},setIdle:function(t){fO.unblock(t)},setBusy:function(t,e){fO.block(t,e)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:el(a.modalBehaviours,[Rg.config({}),Fg.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt}),fO.config({getRoot:i.get}),mm(o,[ou(function(t){var e,n,o,r=t.element,i=gl(t,a,"title").element,u=ue(r,"id").fold(function(){var t=Ir("dialog-label");return oe(i,"id",t),t},h);oe(r,"aria-labelledby",u),e=t.element,n=gl(t,a,"body").element,o=vt.from(ie(e,"id")).fold(function(){var t=Ir("dialog-describe");return oe(n,"id",t),t},h),oe(e,"aria-describedby",o)})])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),_E=$o([po("type"),po("name")].concat(zh)),TE=nr,EE=[ar("name","name",Wn(function(){return Ir("button-name")}),er),Co("icon"),Mo("align","end",["start","end"]),Fo("primary",!1),Fo("disabled",!1)],DE=V(V([],EE,!0),[po("text")],!1),AE=V([ho("type",["submit","cancel","custom"])],DE,!0),BE=lo("type",{submit:AE,cancel:AE,custom:AE,menu:V([ho("type",["menu"]),Co("text"),Co("tooltip"),Co("icon"),xo("items",_E)],EE,!0)}),ME=[po("type"),po("text"),ho("level",["info","warn","error","success"]),po("icon"),Eo("url","")],FE=$o(ME),IE=[po("type"),po("text"),Fo("disabled",!1),Fo("primary",!1),ar("name","name",Wn(function(){return Ir("button-name")}),er),Co("icon"),Fo("borderless",!1)],RE=$o(IE),NE=[po("type"),po("name"),po("label"),Fo("disabled",!1)],PE=$o(NE),VE=nr,HE=[po("type"),po("name")],LE=HE.concat([Co("label")]),zE=LE.concat([Eo("columns","auto")]),UE=$o(zE),jE=Qo([po("value"),po("text"),po("icon")]),WE=$o(LE),GE=er,XE=$o(LE),YE=er,qE=HE.concat([Bo("tag","textarea"),po("scriptId"),po("scriptUrl"),Do("settings",void 0,ir)]),KE=HE.concat([Bo("tag","textarea"),vo("init")]),JE=io(function(t){return ao("customeditor.old",to(KE),t).orThunk(function(){return ao("customeditor.new",to(qE),t)})}),$E=er,QE=$o(LE),ZE=eo(Jo),tD=[po("type"),po("html"),Mo("presets","presentation",["presentation","document"])],eD=$o(tD),nD=LE.concat([Fo("sandboxed",!0)]),oD=$o(nD),rD=er,iD=LE.concat([go("currentState",$o([mo("blob"),po("url")]))]),uD=$o(iD),aD=LE.concat([Co("inputMode"),Co("placeholder"),Fo("maximized",!1),Fo("disabled",!1)]),cD=$o(aD),sD=er,lD=[po("text"),po("value")],fD=[po("text"),xo("items",(wE=Rt(function(){return dD}),{extract:function(t,e){return wE().extract(t,e)},toString:function(){return wE().toString()}}))],dD=no([$o(lD),$o(fD)]),mD=LE.concat([xo("items",dD),Fo("disabled",!1)]),gD=$o(mD),pD=er,hD=LE.concat([yo("items",[po("text"),po("value")]),Ao("size",1),Fo("disabled",!1)]),vD=$o(hD),bD=er,yD=LE.concat([Fo("constrain",!0),Fo("disabled",!1)]),xD=$o(yD),wD=$o([po("width"),po("height")]),SD=[po("type"),xo("header",er),xo("cells",eo(er))],kD=$o(SD),CD=LE.concat([Co("placeholder"),Fo("maximized",!1),Fo("disabled",!1)]),OD=$o(CD),_D=er,TD=LE.concat([Mo("filetype","file",["image","media","file"]),Eo("disabled",!1)]),ED=$o(TD),DD=$o([po("value"),Eo("meta",{})]),AD=Zn(function(){return ro("type",{alertbanner:FE,bar:$o((n=dE("bar"),[po("type"),n])),button:RE,checkbox:PE,colorinput:WE,colorpicker:XE,dropzone:QE,grid:$o((t=dE("grid"),[po("type"),go("columns",tr),t])),iframe:oD,input:cD,listbox:gD,selectbox:vD,sizeinput:xD,textarea:OD,urlinput:ED,customeditor:JE,htmlpanel:eD,imagetools:uD,collection:UE,label:$o((e=dE("label"),[po("type"),po("label"),e])),table:kD,panel:MD});var t,e,n}),BD=[po("type"),Eo("classes",[]),xo("items",AD)],MD=$o(BD),FD=[ar("name","name",Wn(function(){return Ir("tab-name")}),er),po("title"),xo("items",AD)],ID=[po("type"),yo("tabs",FD)],RD=$o(ID),ND=DE,PD=BE,VD=$o([po("title"),go("body",ro("type",{panel:MD,tabpanel:RD})),Bo("size","normal"),xo("buttons",PD),Eo("initialData",{}),Io("onAction",st),Io("onChange",st),Io("onSubmit",st),Io("onClose",st),Io("onCancel",st),Eo("onTabChange",st)]),HD=$o(V([ho("type",["cancel","custom"])],ND,!0)),LD=$o([po("title"),po("url"),ko("height"),ko("width"),_o("buttons",HD),Io("onAction",st),Io("onCancel",st),Io("onClose",st),Io("onMessage",st)]),zD=function(t){return x(t)?[t].concat(H(Z(t),zD)):c(t)?H(t,zD):[]},UD={checkbox:VE,colorinput:GE,colorpicker:YE,dropzone:ZE,input:sD,iframe:rD,sizeinput:wD,selectbox:bD,listbox:pD,size:wD,textarea:_D,urlinput:DD,customeditor:$E,collection:jE,togglemenuitem:TE},jD={open:function(t,e){var n=gE(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(co(ao("dialog",LD,e)))},redial:gE},WD=kl({name:"TabButton",configFields:[Eo("uid",void 0),mo("value"),ar("dom","dom",Yn(function(){return{attributes:{role:"tab",id:Ir("aria"),"aria-selected":"false"}}}),Zo()),wo("action"),Eo("domModification",{}),Zs("tabButtonBehaviours",[Vg,Fg,Df]),mo("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Sm(t.action),behaviours:el(t.tabButtonBehaviours,[Vg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0}),Df.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),GD=rt([mo("tabs"),mo("dom"),Eo("clickToDismiss",!1),Zs("tabbarBehaviours",[hd,Fg]),qu(["tabClass","selectedClass"])]),XD=rt([Zf({factory:WD,name:"tabs",unit:"tab",overrides:function(o){return{action:function(t){var e=t.getSystem().getByUid(o.uid).getOrDie(),n=hd.isHighlighted(e,t);(n&&o.clickToDismiss?function(t,e){hd.dehighlight(t,e),br(t,Qi(),{tabbar:t,button:e})}:n?st:function(t,e){hd.highlight(t,e),br(t,$i(),{tabbar:t,button:e})})(e,t)},domModification:{classes:[o.markers.tabClass]}}}})]),YD=Cl({name:"Tabbar",configFields:GD(),partFields:XD(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:el(t.tabbarBehaviours,[hd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){oe(e.element,"aria-selected","true")},onDehighlight:function(t,e){oe(e.element,"aria-selected","false")}}),Fg.config({mode:"flow",getInitial:function(t){return hd.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),qD=kl({name:"Tabview",configFields:[Zs("tabviewBehaviours",[Rg])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:el(t.tabviewBehaviours,[Rg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),KD=rt([Eo("selectFirst",!0),Ju("onChangeTab"),Ju("onDismissTab"),Eo("tabs",[]),Zs("tabSectionBehaviours",[])]),JD=rt([Jf({factory:YD,schema:[mo("dom"),bo("markers",[mo("tabClass"),mo("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Jf({factory:qD,name:"tabview"})]),$D=Cl({name:"TabSection",configFields:KD(),partFields:JD(),factory:function(i,t,e,n){function o(t,e){ml(t,i,"tabbar").each(function(t){e(t).each(yr)})}return{uid:i.uid,dom:i.dom,components:t,behaviours:tl(i.tabSectionBehaviours),events:nu(ft([i.selectFirst?[ou(function(t,e){o(t,hd.getFirst)})]:[],[Cr($i(),function(t,e){var o=e.event.button,r=Df.getValue(o);ml(o,i,"tabview").each(function(n){N(i.tabs,function(t){return t.value===r}).each(function(t){var e=t.view();ue(o.element,"id").each(function(t){oe(n.element,"aria-labelledby",t)}),Rg.set(n,e),i.onChangeTab(n,o,e)})})}),Cr(Qi(),function(t,e){var n=e.event.button;i.onDismissTab(t,n)})]])),apis:{getViewItems:function(t){return ml(t,i,"tabview").map(function(t){return Rg.contents(t)}).getOr([])},showTab:function(t,n){o(t,function(e){return N(hd.getCandidates(e),function(t){return Df.getValue(t)===n}).filter(function(t){return!hd.isHighlighted(e,t)})})}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),QD="send-data-to-section",ZD="send-data-to-view",tA=Ir("update-dialog"),eA=Ir("update-title"),nA=Ir("update-body"),oA=Ir("update-footer"),rA=Ir("body-send-message");function iA(t){return(iA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uA(t,e){return(uA=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function aA(t,e,n){return(aA=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),1}catch(t){return}}}()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&uA(r,n.prototype),r}).apply(null,arguments)}function cA(t){return function(t){if(Array.isArray(t))return sA(t)}(t)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||function(t){if(t){if("string"==typeof t)return sA(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?sA(t,void 0):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var lA,fA=Object.hasOwnProperty,dA=Object.setPrototypeOf,mA=Object.isFrozen,gA=Object.getPrototypeOf,pA=Object.getOwnPropertyDescriptor,hA=Object.freeze,vA=Object.seal,bA=Object.create,yA="undefined"!=typeof Reflect&&Reflect,xA=yA.apply||function(t,e,n){return t.apply(e,n)},hA=hA||function(t){return t},vA=vA||function(t){return t},wA=yA.construct||function(t,e){return aA(t,cA(e))},SA=MA(Array.prototype.forEach),kA=MA(Array.prototype.pop),CA=MA(Array.prototype.push),OA=MA(String.prototype.toLowerCase),_A=MA(String.prototype.match),TA=MA(String.prototype.replace),EA=MA(String.prototype.indexOf),DA=MA(String.prototype.trim),AA=MA(RegExp.prototype.test),BA=(lA=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return wA(lA,e)});function MA(r){return function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return xA(r,t,n)}}function FA(t,e){dA&&dA(t,null);for(var n=e.length;n--;){var o,r=e[n];"string"!=typeof r||(o=OA(r))!==r&&(mA(e)||(e[n]=o),r=o),t[r]=!0}return t}function IA(t){var e,n=bA(null);for(e in t)xA(fA,t,[e])&&(n[e]=t[e]);return n}function RA(t,e){for(;null!==t;){var n=pA(t,e);if(n){if(n.get)return MA(n.get);if("function"==typeof n.value)return MA(n.value)}t=gA(t)}return function(t){return console.warn("fallback value for",t),null}}var NA=hA(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),PA=hA(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),VA=hA(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),HA=hA(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),LA=hA(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),zA=hA(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),UA=hA(["#text"]),jA=hA(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),WA=hA(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),GA=hA(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),XA=hA(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),YA=vA(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qA=vA(/<%[\w\W]*|[\w\W]*%>/gm),KA=vA(/^data-[\-\w.\u00B7-\uFFFF]/),JA=vA(/^aria-[\-\w]+$/),$A=vA(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QA=vA(/^(?:\w+script|data):/i),ZA=vA(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tB=vA(/^html$/i);function eB(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}}function nB(t,e){return OE.parts.close(fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:ec([py.config({})])}))}function oB(){return OE.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function rB(t,e){return OE.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:xC("<p>"+(n=e.translate(t),_B().sanitize(n))+"</p>")}]}]});var n}function iB(t){return OE.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})}function uB(t,e){return[ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]}function aB(e){var t,n="tox-dialog",o=n+"-wrap",r=o+"__backdrop",i=n+"__disable-scroll";return OE.sketch({lazySink:e.lazySink,onEscape:function(t){return e.onEscape(t),vt.some(!0)},useTabstopAt:function(t){return!p0(t)},dom:{tag:"div",classes:[n].concat(e.extraClasses),styles:lt({position:"relative"},e.extraStyles)},components:V([e.header,e.body],e.footer.toArray(),!0),parts:{blocker:{dom:xC('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:TB?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ec(V([Vg.config({}),mm("dialog-events",e.dialogEvents.concat([Ar(bi(),function(t,e){Fg.focusIn(t)})])),mm("scroll-lock",[ou(function(){Yr(bn(),i)}),ru(function(){qr(bn(),i)})])],e.extraBehaviours,!0)),eventOrder:lt(((t={})[Ii()]=["dialog-events"],t[Gi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Xi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),e.eventOrder)})}function cB(t){return fp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Xm("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){vr(t,wy)}})}function sB(t,e,n){function o(t){return[ri(n.translate(t.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:lt({},e.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:ec([k_.config({channel:eA,renderComponents:o})])}}function lB(){return{dom:xC('<div class="tox-dialog__draghandle"></div>')}}function fB(t,e){return n={title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},o=e.shared.providers,r=OE.parts.title(sB(n,vt.none(),o)),i=OE.parts.draghandle(lB()),u=OE.parts.close(cB(o)),a=[r].concat(n.draggable?[i]:[]).concat([u]),ly.sketch({dom:xC('<div class="tox-dialog__header"></div>'),components:a});var n,o,r,i,u,a}function dB(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:xC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}function mB(t,o,e){return{onClose:function(){return e.closeWindow()},onBlock:function(n){OE.setBusy(t(),function(t,e){return dB(n.message,e,o)})},onUnblock:function(){OE.setIdle(t())}}}function gB(t,e,n,o){var r;return Tu(aB(lt(lt({},t),{lazySink:o.shared.getSink,extraBehaviours:V([k_.config({channel:tA,updateState:function(t,e){return vt.some(e)},initialData:e}),pS({})],t.extraBehaviours,!0),onEscape:function(t){vr(t,wy)},dialogEvents:n,eventOrder:((r={})[Fi()]=[k_.name(),ic.name()],r[Gi()]=["scroll-lock",k_.name(),"messages","dialog-events","alloy.base.behaviour"],r[Xi()]=["alloy.base.behaviour","dialog-events","messages",k_.name(),"scroll-lock"],r)})))}function pB(t){return B(t,function(t){return"menu"===t.type?(n=B((e=t).items,function(t){var e=Po(!1);return lt(lt({},t),{storage:e})}),lt(lt({},e),{items:n})):t;var e,n})}function hB(t){return R(t,function(t,e){return"menu"!==e.type?t:R(e.items,function(t,e){return t[e.name]=e.storage,t},t)},{})}function vB(t,n){return[Er(bi(),g0),t(xy,function(t,e){n.onClose(),e.onClose()}),t(wy,function(t,e,n,o){e.onCancel(t),vr(o,xy)}),Cr(Oy,function(t,e){return n.onUnblock()}),Cr(Cy,function(t,e){return n.onBlock(e.event)})]}function bB(t,e){function n(t,e){return ly.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:B(e,function(t){return t.memento.asSpec()})})}var o=M(e.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align});return[n("start",o.pass),n("end",o.fail)]}function yB(t,n){return{dom:xC('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ec([k_.config({channel:oA,initialData:t,updateState:function(t,e){var r=B(e.buttons,function(t){var e=Hm(Q0(t,t.type,n));return{name:t.name,align:t.align,memento:e}});return vt.some({lookupByName:function(t,e){return n=t,o=e,N(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(n)});var n,o},footerButtons:r})},renderComponents:bB})])}}function xB(t,e){return OE.parts.footer(yB(t,e))}function wB(e,n){if(e.getRoot().getSystem().isConnected()){var o=cd.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return nS.getField(o,n).fold(function(){var t=e.getFooter();return k_.getState(t).get().bind(function(t){return t.lookupByName(o,n)})},function(t){return vt.some(t)})}return vt.none()}function SB(c,o,s){function t(t){var e=c.getRoot();e.getSystem().isConnected()&&t(e)}var l={getData:function(){var t=c.getRoot(),e=t.getSystem().isConnected()?c.getFormWrapper():t,n=Df.getValue(e),o=dt(s,function(t){return t.get()});return lt(lt({},n),o)},setData:function(a){t(function(t){var e,n,o=l.getData(),r=lt(lt({},o),a),i=(e=r,n=c.getRoot(),k_.getState(n).get().map(function(t){return co(ao("data",t.dataValidator,e))}).getOr(e)),u=c.getFormWrapper();Df.setValue(u,i),J(s,function(t,e){Tt(r,e)&&t.set(r[e])})})},disable:function(t){wB(c,t).each(gd.disable)},enable:function(t){wB(c,t).each(gd.enable)},focus:function(t){wB(c,t).each(Vg.focus)},block:function(e){if(!y(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){br(t,Cy,{message:e})})},unblock:function(){t(function(t){vr(t,Oy)})},showTab:function(n){t(function(t){var e=c.getBody();k_.getState(e).get().exists(function(t){return t.isTabPanel()})&&cd.getCurrent(e).each(function(t){$D.showTab(t,n)})})},redial:function(n){t(function(t){var e=o(n);t.getSystem().broadcastOn([tA],e),t.getSystem().broadcastOn([eA],e.internalDialog),t.getSystem().broadcastOn([nA],e.internalDialog),t.getSystem().broadcastOn([oA],e.internalDialog),l.setData(e.initialData)})},close:function(){t(function(t){vr(t,xy)})}};return l}function kB(t){return x(t)&&-1!==MB.indexOf(t.mceAction)}function CB(o,t,r,e){var n,i,u,a=fB(o.title,e),c=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[d0({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:ec([py.config({}),Vg.config({})])})]}],behaviours:ec([Fg.config({mode:"acyclic",useTabstopAt:O(p0)})])},OE.parts.body(i)),s=o.buttons.bind(function(t){return 0===t.length?vt.none():vt.some(xB({buttons:t},e))}),l=EB(function(){return v},mB(function(){return h},e.shared.providers,t)),f=lt(lt({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),d=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],m=new BB(o.url,{base_uri:new BB(window.location.href)}),g=m.protocol+"://"+m.host+(m.port?":"+m.port:""),p=mc(),h=gB({header:a,body:c,footer:s,extraClasses:d,extraBehaviours:[mm("messages",[ou(function(){var t=pc(Mt.fromDom(window),"message",function(t){var e,n;m.isSameOrigin(new BB(t.raw.origin))&&(kB(e=t.raw.data)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var o=!!w(n.ui)&&n.ui;t.execCommand(n.cmd,o,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(r,v,e):!kB(n=e)&&x(n)&&Tt(n,"mceAction")&&o.onMessage(v,e))});p.set(t)}),ru(p.clear)]),ic.config({channels:((n={})[rA]={onReceive:function(t,e){Iu(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(e,g)})}},n)})],extraStyles:f},o,l,e),v={block:function(e){if(!y(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");b(function(t){br(t,Cy,{message:e})})},unblock:function(){b(function(t){vr(t,Oy)})},close:function(){b(function(t){vr(t,xy)})},sendMessage:function(e){b(function(t){t.getSystem().broadcastOn([rA],e)})}};function b(t){u.getSystem().isConnected()&&t(u)}return{dialog:u=h,instanceApi:v}}function OB(t){function o(t,y){return jD.open(function(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=e,b=(r={redial:jD.redial,closeWindow:function(){OE.hide(b.dialog),y(b.instanceApi)}},i=R,c=fB((o={dataValidator:n,initialData:v,internalDialog:t}).internalDialog.title,i),u=i,a=xE({body:o.internalDialog.body},vt.none(),u,!1),s=OE.parts.body(a),l=pB(o.internalDialog.buttons),f=hB(l),d=xB({buttons:l},i),m=DB(function(){return h},mB(function(){return p},i.shared.providers,r),i.shared.getSink),g=function(){switch(o.internalDialog.size){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(),p=gB({header:c,body:s,footer:vt.some(d),extraClasses:g,extraBehaviours:[],extraStyles:{}},o,m,i),h=SB({getRoot:rt(p),getBody:function(){return OE.getBody(p)},getFooter:function(){return OE.getFooter(p)},getFormWrapper:function(){var t=OE.getBody(p);return cd.getCurrent(t).getOr(t)}},r.redial,f),{dialog:p,instanceApi:h});return OE.show(b.dialog),b.instanceApi.setData(v),b.instanceApi},t)}function r(t,M,F,I){return jD.open(function(t,e,n){function o(){return E.on(function(t){up.reposition(t),j1.refresh(t)})}var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=co(ao("data",n,e)),E=gc(),D=R.shared.header.isPositionedAtTop(),A=(i={dataValidator:n,initialData:T,internalDialog:t},u={redial:jD.redial,closeWindow:function(){E.on(up.hide),N.off("ResizeEditor",o),E.clear(),F(A.instanceApi)}},a=R,c=I,v=Ir("dialog-label"),b=Ir("dialog-content"),y=Hm((f={title:i.internalDialog.title,draggable:!0},d=v,m=a.shared.providers,ly.sketch({dom:xC('<div class="tox-dialog__header"></div>'),components:[sB(f,vt.some(d),m),lB(),cB(m)],containerBehaviours:ec([aE.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ru(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),x=Hm((g={body:i.internalDialog.body},p=a,h=c,xE(g,vt.some(b),p,h))),w=pB(i.internalDialog.buttons),S=hB(w),k=Hm(AB({buttons:w},a)),C=DB(function(){return _},{onBlock:function(n){fO.block(O,function(t,e){return dB(n.message,e,a.shared.providers)})},onUnblock:function(){fO.unblock(O)},onClose:function(){return u.closeWindow()}},a.shared.getSink),O=Tu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((s={role:"dialog"})["aria-labelledby"]=v,s["aria-describedby"]=b,s)},eventOrder:((l={})[Fi()]=[k_.name(),ic.name()],l[Ii()]=["execute-on-form"],l[Gi()]=["reflecting","execute-on-form"],l),behaviours:ec([Fg.config({mode:"cyclic",onEscape:function(t){return vr(t,xy),vt.some(!0)},useTabstopAt:function(t){return!p0(t)&&("button"!==Ft(t)||"disabled"!==ie(t,"disabled"))}}),k_.config({channel:tA,updateState:function(t,e){return vt.some(e)},initialData:i}),Vg.config({}),mm("execute-on-form",C.concat([Ar(bi(),function(t,e){Fg.focusIn(t)})])),fO.config({getRoot:function(){return vt.some(O)}}),Rg.config({}),pS({})]),components:[y.asSpec(),x.asSpec(),k.asSpec()]}),_=SB({getRoot:rt(O),getFooter:function(){return k.get(O)},getBody:function(){return x.get(O)},getFormWrapper:function(){var t=x.get(O);return cd.getCurrent(t).getOr(t)}},u.redial,S),{dialog:O,instanceApi:_}),B=Tu(up.sketch(lt(lt({lazySink:R.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},D?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ec(V([mm("window-manager-inline-events",[Cr(Yi(),function(t,e){vr(A.dialog,wy)})])],(r=N,P&&D?[]:[j1.config({contextual:{lazyContext:function(){return vt.some(Mn(Mt.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]),!0)),isExtraPart:function(t,e){return Yb(n=e,".tox-alert-dialog")||Yb(n,".tox-confirm-dialog");var n}})));return E.set(B),up.showWithin(B,Eu(A.dialog),{anchor:M},vt.some(bn())),P&&D||(j1.refresh(B),N.on("ResizeEditor",o)),A.instanceApi.setData(T),Fg.focusIn(A.dialog),A.instanceApi},t)}var c,s,l,f,R=t.backstage,N=t.editor,P=dv(N),n=(s=(c=t).backstage.shared,{open:function(t,e){function n(){OE.hide(u),e()}var o=Hm(Q0({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:vt.none()},"cancel",c.backstage)),r=oB(),i=nB(n,s.providers),u=Tu(aB({lazySink:function(){return s.getSink()},header:eB(r,i),body:rB(t,s.providers),footer:vt.some(iB(uB([],[o.asSpec()]))),onEscape:n,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Cr(wy,n)],eventOrder:{}}));OE.show(u);var a=o.get(u);Vg.focus(a)}}),i=(f=(l=t).backstage.shared,{open:function(t,e){function n(t){OE.hide(a),e(t)}var o=Hm(Q0({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:vt.none()},"submit",l.backstage)),r=Q0({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:vt.none()},"cancel",l.backstage),i=oB(),u=nB(function(){return n(!1)},f.providers),a=Tu(aB({lazySink:function(){return f.getSink()},header:eB(i,u),body:rB(t,f.providers),footer:vt.some(iB(uB([],[r,o.asSpec()]))),onEscape:function(){return n(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Cr(wy,function(){return n(!1)}),Cr(ky,function(){return n(!0)})],eventOrder:{}}));OE.show(a);var c=o.get(a);Vg.focus(c)}});return{open:function(t,e,n){return void 0!==e&&"toolbar"===e.inline?r(t,R.shared.anchors.inlineDialog(),n,e.ariaAttrs):void 0!==e&&"cursor"===e.inline?r(t,R.shared.anchors.cursor(),n,e.ariaAttrs):o(t,n)},openUrl:function(t,e){return n=e,jD.openUrl(function(t){var e=CB(t,{closeWindow:function(){OE.hide(e.dialog),n(e.instanceApi)}},N,R);return OE.show(e.dialog),e.instanceApi},t);var n},alert:function(t,e){n.open(t,function(){e()})},close:function(t){t.close()},confirm:function(t,e){i.open(t,function(t){e(t)})}}}var _B=function e(t){function l(t){return e(t)}var f=0<arguments.length&&void 0!==t?t:"undefined"==typeof window?null:window;if(l.version="2.3.8",l.removed=[],!f||!f.document||9!==f.document.nodeType)return l.isSupported=!1,l;var n,d=f.document,u=f.document,m=f.DocumentFragment,o=f.HTMLTemplateElement,g=f.Node,a=f.Element,r=f.NodeFilter,i=f.NamedNodeMap,c=void 0===i?f.NamedNodeMap||f.MozNamedAttrMap:i,s=f.HTMLFormElement,p=f.DOMParser,h=f.trustedTypes,v=a.prototype,b=RA(v,"cloneNode"),y=RA(v,"nextSibling"),x=RA(v,"childNodes"),w=RA(v,"parentNode");"function"!=typeof o||(n=u.createElement("template")).content&&n.content.ownerDocument&&(u=n.content.ownerDocument);var S=function(t,e){if("object"!==iA(t)||"function"!=typeof t.createPolicy)return null;var n=null,o="data-tt-policy-suffix",r="dompurify"+((n=e.currentScript&&e.currentScript.hasAttribute(o)?e.currentScript.getAttribute(o):n)?"#"+n:"");try{return t.createPolicy(r,{createHTML:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,d),k=S?S.createHTML(""):"",C=u,O=C.implementation,_=C.createNodeIterator,T=C.createDocumentFragment,E=C.getElementsByTagName,D=d.importNode,A={};try{A=IA(u).documentMode?u.documentMode:{}}catch(t){}var B={};function M(t){return t instanceof RegExp||t instanceof Function}function F(t){St&&St===t||(t=IA(t=t&&"object"===iA(t)?t:{}),G="ALLOWED_TAGS"in t?FA({},t.ALLOWED_TAGS):X,Y="ALLOWED_ATTR"in t?FA({},t.ALLOWED_ATTR):q,pt="ADD_URI_SAFE_ATTR"in t?FA(IA(ht),t.ADD_URI_SAFE_ATTR):ht,mt="ADD_DATA_URI_TAGS"in t?FA(IA(gt),t.ADD_DATA_URI_TAGS):gt,ft="FORBID_CONTENTS"in t?FA({},t.FORBID_CONTENTS):dt,J="FORBID_TAGS"in t?FA({},t.FORBID_TAGS):{},$="FORBID_ATTR"in t?FA({},t.FORBID_ATTR):{},I="USE_PROFILES"in t&&t.USE_PROFILES,Q=!1!==t.ALLOW_ARIA_ATTR,Z=!1!==t.ALLOW_DATA_ATTR,tt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,et=t.SAFE_FOR_TEMPLATES||!1,nt=t.WHOLE_DOCUMENT||!1,it=t.RETURN_DOM||!1,ut=t.RETURN_DOM_FRAGMENT||!1,at=t.RETURN_TRUSTED_TYPE||!1,rt=t.FORCE_BODY||!1,ct=!1!==t.SANITIZE_DOM,st=!1!==t.KEEP_CONTENT,lt=t.IN_PLACE||!1,W=t.ALLOWED_URI_REGEXP||W,xt=t.NAMESPACE||yt,t.CUSTOM_ELEMENT_HANDLING&&M(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&M(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(K.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),R=-1===wt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,N="application/xhtml+xml"===R?function(t){return t}:OA,et&&(Z=!1),ut&&(it=!0),I&&(G=FA({},cA(UA)),Y=[],!0===I.html&&(FA(G,NA),FA(Y,jA)),!0===I.svg&&(FA(G,PA),FA(Y,WA),FA(Y,XA)),!0===I.svgFilters&&(FA(G,VA),FA(Y,WA),FA(Y,XA)),!0===I.mathMl&&(FA(G,LA),FA(Y,GA),FA(Y,XA))),t.ADD_TAGS&&FA(G=G===X?IA(G):G,t.ADD_TAGS),t.ADD_ATTR&&FA(Y=Y===q?IA(Y):Y,t.ADD_ATTR),t.ADD_URI_SAFE_ATTR&&FA(pt,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&FA(ft=ft===dt?IA(ft):ft,t.FORBID_CONTENTS),st&&(G["#text"]=!0),nt&&FA(G,["html","head","body"]),G.table&&(FA(G,["tbody"]),delete J.tbody),hA&&hA(t),St=t)}l.isSupported="function"==typeof w&&O&&void 0!==O.createHTMLDocument&&9!==A;var I,R,N,P,V=YA,H=qA,L=KA,z=JA,U=QA,j=ZA,W=$A,G=null,X=FA({},[].concat(cA(NA),cA(PA),cA(VA),cA(LA),cA(UA))),Y=null,q=FA({},[].concat(cA(jA),cA(WA),cA(GA),cA(XA))),K=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,$=null,Q=!0,Z=!0,tt=!1,et=!1,nt=!1,ot=!1,rt=!1,it=!1,ut=!1,at=!1,ct=!0,st=!0,lt=!1,ft=null,dt=FA({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),mt=null,gt=FA({},["audio","video","img","source","image","track"]),pt=null,ht=FA({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",bt="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml",xt=yt,wt=["application/xhtml+xml","text/html"],St=null,kt=u.createElement("form"),Ct=FA({},["mi","mo","mn","ms","mtext"]),Ot=FA({},["foreignobject","desc","title","annotation-xml"]),_t=FA({},["title","style","font","a","script"]),Tt=FA({},PA);FA(Tt,VA),FA(Tt,HA);var Et=FA({},LA);function Dt(e){CA(l.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=k}catch(t){e.remove()}}}function At(t,e){try{CA(l.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){CA(l.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!Y[t])if(it||ut)try{Dt(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}}function Bt(t){var e,n,o;rt?t="<remove></remove>"+t:o=(n=_A(t,/^[\r\n\t ]+/))&&n[0],"application/xhtml+xml"===R&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var r=S?S.createHTML(t):t;if(xt===yt)try{e=(new p).parseFromString(r,R)}catch(t){}if(!e||!e.documentElement){e=O.createDocument(xt,"template",null);try{e.documentElement.innerHTML=P?"":r}catch(t){}}var i=e.body||e.documentElement;return t&&o&&i.insertBefore(u.createTextNode(o),i.childNodes[0]||null),xt===yt?E.call(e,nt?"html":"body")[0]:nt?e.documentElement:i}function Mt(t){return _.call(t.ownerDocument||t,t,r.SHOW_ELEMENT|r.SHOW_COMMENT|r.SHOW_TEXT,null,!1)}function Ft(t){return"object"===iA(g)?t instanceof g:t&&"object"===iA(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName}function It(t,e,n){B[t]&&SA(B[t],function(t){t.call(l,e,n,St)})}function Rt(t){var e;if(It("beforeSanitizeElements",t,null),t instanceof s&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof c)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore))return Dt(t),1;if(AA(/[\u0080-\uFFFF]/,t.nodeName))return Dt(t),1;var n=N(t.nodeName);if(It("uponSanitizeElement",t,{tagName:n,allowedTags:G}),t.hasChildNodes()&&!Ft(t.firstElementChild)&&(!Ft(t.content)||!Ft(t.content.firstElementChild))&&AA(/<[/\w]/g,t.innerHTML)&&AA(/<[/\w]/g,t.textContent))return Dt(t),1;if("select"===n&&AA(/<template/i,t.innerHTML))return Dt(t),1;if(G[n]&&!J[n])return t instanceof a&&!function(t){var e=w(t);e&&e.tagName||(e={namespaceURI:yt,tagName:"template"});var n=OA(t.tagName),o=OA(e.tagName);return t.namespaceURI===bt?e.namespaceURI===yt?"svg"===n:e.namespaceURI===vt?"svg"===n&&("annotation-xml"===o||Ct[o]):Boolean(Tt[n]):t.namespaceURI===vt?e.namespaceURI===yt?"math"===n:e.namespaceURI===bt?"math"===n&&Ot[o]:Boolean(Et[n]):t.namespaceURI===yt&&(e.namespaceURI!==bt||Ot[o])&&(e.namespaceURI!==vt||Ct[o])&&!Et[n]&&(_t[n]||!Tt[n])}(t)||("noscript"===n||"noembed"===n)&&AA(/<\/no(script|embed)/i,t.innerHTML)?(Dt(t),1):(et&&3===t.nodeType&&(e=t.textContent,e=TA(e,V," "),e=TA(e,H," "),t.textContent!==e&&(CA(l.removed,{element:t.cloneNode()}),t.textContent=e)),It("afterSanitizeElements",t,null),0);if(!J[n]&&Vt(n)){if(K.tagNameCheck instanceof RegExp&&AA(K.tagNameCheck,n))return;if(K.tagNameCheck instanceof Function&&K.tagNameCheck(n))return}if(st&&!ft[n]){var o=w(t)||t.parentNode,r=x(t)||t.childNodes;if(r&&o)for(var i=r.length-1;0<=i;--i)o.insertBefore(b(r[i],!0),y(t))}return Dt(t),1}function Nt(t,e,n){if(ct&&("id"===e||"name"===e)&&(n in u||n in kt))return!1;if((!Z||$[e]||!AA(L,e))&&(!Q||!AA(z,e)))if(!Y[e]||$[e]){if(!(Vt(t)&&(K.tagNameCheck instanceof RegExp&&AA(K.tagNameCheck,t)||K.tagNameCheck instanceof Function&&K.tagNameCheck(t))&&(K.attributeNameCheck instanceof RegExp&&AA(K.attributeNameCheck,e)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(e))||"is"===e&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&AA(K.tagNameCheck,n)||K.tagNameCheck instanceof Function&&K.tagNameCheck(n))))return!1}else if(!pt[e]&&!AA(W,TA(n,j,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==EA(n,"data:")||!mt[t])&&(!tt||AA(U,TA(n,j,"")))&&n)return!1;return!0}function Pt(t){It("beforeSanitizeAttributes",t,null);var e=t.attributes;if(e){for(var n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y},o=e.length;o--;){var r,i=(r=e[o]).name,u=r.namespaceURI,a="value"===i?r.value:DA(r.value),c=N(i);if(n.attrName=c,n.attrValue=a,n.keepAttr=!0,n.forceKeepAttr=void 0,It("uponSanitizeAttribute",t,n),a=n.attrValue,!n.forceKeepAttr&&(At(i,t),n.keepAttr))if(AA(/\/>/i,a))At(i,t);else if(et&&(a=TA(a,V," "),a=TA(a,H," ")),Nt(N(t.nodeName),c,a))try{u?t.setAttributeNS(u,i,a):t.setAttribute(i,a),kA(l.removed)}catch(t){}}It("afterSanitizeAttributes",t,null)}}FA(Et,zA);var Vt=function(t){return 0<t.indexOf("-")};return l.sanitize=function(t,e){var n,o,r,i,u;if("string"!=typeof(t=(P=!t)?"\x3c!--\x3e":t)&&!Ft(t)){if("function"!=typeof t.toString)throw BA("toString is not a function");if("string"!=typeof(t=t.toString()))throw BA("dirty is not a string, aborting")}if(!l.isSupported){if("object"===iA(f.toStaticHTML)||"function"==typeof f.toStaticHTML){if("string"==typeof t)return f.toStaticHTML(t);if(Ft(t))return f.toStaticHTML(t.outerHTML)}return t}if(ot||F(e),l.removed=[],lt="string"!=typeof t&&lt){if(t.nodeName){var a=N(t.nodeName);if(!G[a]||J[a])throw BA("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof g)1===(o=(n=Bt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!it&&!et&&!nt&&-1===t.indexOf("<"))return S&&at?S.createHTML(t):t;if(!(n=Bt(t)))return it?null:at?k:""}n&&rt&&Dt(n.firstChild);for(var c=Mt(lt?t:n);r=c.nextNode();)3===r.nodeType&&r===i||Rt(r)||(r.content instanceof m&&function t(e){var n,o=Mt(e);for(It("beforeSanitizeShadowDOM",e,null);n=o.nextNode();)It("uponSanitizeShadowNode",n,null),Rt(n)||(n.content instanceof m&&t(n.content),Pt(n));It("afterSanitizeShadowDOM",e,null)}(r.content),Pt(r),i=r);if(i=null,lt)return t;if(it){if(ut)for(u=T.call(n.ownerDocument);n.firstChild;)u.appendChild(n.firstChild);else u=n;return Y.shadowroot?D.call(d,u,!0):u}var s=nt?n.outerHTML:n.innerHTML;return nt&&G["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&AA(tB,n.ownerDocument.doctype.name)&&(s="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+s),et&&(s=TA(s,V," "),s=TA(s,H," ")),S&&at?S.createHTML(s):s},l.setConfig=function(t){F(t),ot=!0},l.clearConfig=function(){St=null,ot=!1},l.isValidAttribute=function(t,e,n){return St||F({}),Nt(N(t),N(e),n)},l.addHook=function(t,e){"function"==typeof e&&(B[t]=B[t]||[],CA(B[t],e))},l.removeHook=function(t){if(B[t])return kA(B[t])},l.removeHooks=function(t){B[t]&&(B[t]=[])},l.removeAllHooks=function(){B={}},l}(),TB=eb.deviceType.isTouch(),EB=function(u,t){function e(t,i){return Cr(t,function(n,o){var e,r;e=n,r=function(t,e){i(u(),t,o.event,n)},k_.getState(e).get().each(function(t){r(t,e)})})}return V(V([],vB(e,t),!0),[e(Sy,function(t,e,n){e.onAction(t,{name:n.name})})],!1)},DB=function(u,t,c){function e(t,i){return Cr(t,function(n,o){var e,r;e=n,r=function(t,e){i(u(),t,o.event,n)},k_.getState(e).get().each(function(t){r(t.internalDialog,e)})})}return V(V([],vB(e,t),!0),[e(ky,function(t,e){return e.onSubmit(t)}),e(yy,function(t,e,n){e.onChange(t,{name:n.name})}),e(Sy,function(t,e,n,o){function r(){return Fg.focusIn(o)}function i(t){return ae(t,"disabled")||ue(t,"aria-disabled").exists(function(t){return"true"===t})}var u=gn(o.element),a=Oa(u);e.onAction(t,{name:n.name,value:n.value}),Oa(u).fold(r,function(e){i(e)||a.exists(function(t){return Ut(e,t)&&i(t)})?r():c().toOptional().filter(function(t){return!Ut(t.element,e)}).each(r)})}),e(_y,function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})}),ru(function(t){var e=u();Df.setValue(t,e.getData())})],!1)},AB=yB,BB=tinymce.util.Tools.resolve("tinymce.util.URI"),MB=["insertContent","setContent","execCommand","close","block","unblock"];o.add("silver",function(t){var e=fE(t),n=e.uiMothership,o=e.backstage,r=e.renderUI,i=e.getUi;return uy(t,o.shared),{renderUI:r,getWindowManagerImpl:rt(OB({editor:t,backstage:o})),getNotificationManagerImpl:function(){return u=t,r=n,l={backstage:o}.backstage.shared,{open:function(t,e){function n(){e(),up.hide(c)}var o=!t.closeButton&&t.timeout&&(0<t.timeout||t.timeout<0),a=Tu(hp.sketch({text:t.text,level:wt(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:vt.from(t.icon),closeButton:!o,onAction:n,iconProvider:l.providers.icons,translationProvider:l.providers.translate})),c=Tu(up.sketch(lt({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:l.getSink,fireDismissalEventInstead:{}},l.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));function s(){var t=Mn(Mt.fromDom(u.getContentAreaContainer())),e=Fn(),n=Wa(e.x,t.x,t.right),o=Wa(e.y,t.y,t.bottom),r=Math.max(t.right,e.right),i=Math.max(t.bottom,e.bottom);return vt.some(Bn(n,o,r-n,i-o))}return r.add(c),0<t.timeout&&lp.setTimeout(function(){n()},t.timeout),{close:n,moveTo:function(t,e){up.showAt(c,Eu(a),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n,o,r,i=Eu(a),u={maxHeightFunction:Nc()};"banner"!==e&&k(t)?(n=function(){switch(e){case"bc-bc":return sp;case"tc-tc":return cp;case"tc-bc":return Ja;default:return $a}}(),o={type:"node",root:bn(),node:vt.some(Mt.fromDom(t)),overrides:u,layouts:{onRtl:function(){return[n]},onLtr:function(){return[n]}}},up.showWithinBounds(c,i,{anchor:o},s)):(r=lt(lt({},l.anchors.banner()),{overrides:u}),up.showWithinBounds(c,i,{anchor:r},s))},text:function(t){hp.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){hp.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(n){0<n.length&&St(n,function(t,e){0===e?t.moveRel(null,"banner"):t.moveRel(n[e-1].getEl(),"bc-tc")})},getArgs:function(t){return t.settings}};var u,r,l},ui:i()}})}();
/trunk/vendor/tinymce/tinymce/tinymce.js
4,7 → 4,7
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
(function () {
'use strict';
29028,8 → 29028,8
suffix: null,
$: DomQuery,
majorVersion: '5',
minorVersion: '10.6',
releaseDate: '2022-10-19',
minorVersion: '10.7',
releaseDate: '2022-12-06',
editors: legacyEditors,
i18n: I18n,
activeEditor: null,
/trunk/vendor/tinymce/tinymce/tinymce.min.js
4,6 → 4,6
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.10.6 (2022-10-19)
* Version: 5.10.7 (2022-12-06)
*/
!function(){"use strict";function r(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}function f(o){return m(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r<n;r++)if(!o.eq(e[r],t[r]))return!1;return!0})}function d(l){return m(function(e,t){var n,r,o,i=Object.keys(e),a=Object.keys(t);if(r=f(g),o=function(e){return t=n,Array.prototype.slice.call(e).sort(t);var t},!m(function(e,t){return r.eq(o(e),o(t))}).eq(i,a))return!1;for(var u=i.length,s=0;s<u;s++){var c=i[s];if(!l.eq(e[c],t[c]))return!1}return!0})}function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function n(t){return function(e){return t===e}}function K(e){return null==e}function V(e){return!K(e)}function te(){}function i(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}}function a(t,n){return function(e){return t(n(e))}}function J(e){return function(){return e}}function u(e){return e}function o(e,t){return e===t}var m=function(e){return{eq:e}},g=m(function(e,t){return e===t}),p=m(function(e,t){if(e===t)return!0;var n=r(e);return n===r(t)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(n)?e===t:"array"===n?f(p).eq(e,t):"object"===n&&d(p).eq(e,t))}),X=e("string"),h=e("object"),S=e("array"),l=n(null),v=t("boolean"),b=n(void 0),y=t("function"),E=t("number");function R(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}function s(t){return function(e){return!t(e)}}function C(e){return e()}function x(e){e()}function c(){return k}var D=J(!1),w=J(!0),k={fold:function(e,t){return e()},isSome:D,isNone:w,getOr:u,getOrThunk:N,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:J(null),getOrUndefined:J(void 0),or:u,orThunk:N,map:c,each:te,bind:c,exists:D,forall:w,filter:function(){return k},toArray:function(){return[]},toString:J("none()")};function N(e){return e()}function _(e,t){return ye.call(e,t)}function T(e,t){return-1<_(e,t)}function F(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1}function A(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}function Y(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function O(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}function B(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}}function U(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}function P(e,n,r){return O(e,function(e,t){r=n(r,e,t)}),r}function L(e,n,r){return Y(e,function(e,t){r=n(r,e,t)}),r}function I(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return ve.some(i);if(n(i,r))break}return ve.none()}function M(e,t){return I(e,t,D)}function z(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return ve.some(n);return ve.none()}function H(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!S(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Ce.apply(t,e[n])}return t}(A(e,t))}function j(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0}function q(e){var t=be.call(e,0);return t.reverse(),t}function $(e,t){return U(e,function(e){return!T(t,e)})}function W(e,t){var n=be.call(e,0);return n.sort(t),n}function G(e,t){return 0<=t&&t<e.length?ve.some(e[t]):ve.none()}function Q(e){return G(e,0)}function Z(e){return G(e,e.length-1)}function ee(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return ve.none()}function ne(e,t){for(var n=we(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}function re(e,n){return Ee(e,function(e,t){return{k:t,v:n(e,t)}})}function oe(n){return function(e,t){n[t]=e}}function ie(e,n,r,o){return ne(e,function(e,t){(n(e,t)?r:o)(e,t)}),1}function ae(e,t){var n={};return ie(e,t,oe(n),te),n}function ue(e,t){return ke(e,t)?ve.from(e[t]):ve.none()}function se(e,t){return ke(e,t)&&void 0!==e[t]&&null!==e[t]}function ce(e,t,n){var r,o;if(!e)return!1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return!1}else for(r in e)if(ke(e,r)&&!1===t.call(n,e[r],r,e))return!1;return!0}function le(n,r){var o=[];return ce(n,function(e,t){o.push(r(e,t,n))}),o}function fe(n,r){var o=[];return ce(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o}function de(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function me(e,t,n,r){for(var o=b(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o}function ge(e,t,n){for(var r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1}function pe(e){return e[e.length-1]}var he=function(n){function e(){return o}function t(e){return e(n)}var r=J(n),o={fold:function(e,t){return t(n)},isSome:w,isNone:D,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return he(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:k},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},ve={some:he,none:c,from:function(e){return null==e?k:he(e)}},be=Array.prototype.slice,ye=Array.prototype.indexOf,Ce=Array.prototype.push,xe=y(Array.from)?Array.from:function(e){return be.call(e)},we=Object.keys,Se=Object.hasOwnProperty,Ee=function(e,r){var o={};return ne(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},ke=function(e,t){return Se.call(e,t)},Ne=Array.isArray,_e=function(){return(_e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ae(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Re(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}}function De(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})}function Te(e,t){return-1!==e.indexOf(t)}function Oe(t){return function(e){return e.replace(t,"")}}function Be(e){return 0<e.length}function Pe(e){return!Be(e)}function Le(t){return function(e){return Te(e,t)}}function Ie(e){return window.matchMedia(e).matches}function Me(e){return null==e?"":(""+e).replace(wt,"")}function Fe(e,t){return t?!("array"!==t||!Ne(e))||typeof e===t:void 0!==e}function Ue(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n}function ze(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function He(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount}function je(e,t){return e.dom===t.dom}function Ve(e,t){return dt().browser.isIE()?(n=e.dom,r=t.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o)):(i=e.dom)!==(a=t.dom)&&i.contains(a);var n,r,o,i,a}function qe(){return Xe(0,0)}function $e(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isEdge:t("Edge"),isChrome:t("Chrome"),isIE:t("IE"),isOpera:t("Opera"),isFirefox:t(nt),isSafari:t("Safari")}}function We(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isWindows:t(it),isiOS:t("iOS"),isAndroid:t(at),isOSX:t("OSX"),isLinux:t("Linux"),isSolaris:t(ut),isFreeBSD:t(st),isChromeOS:t(ct)}}function Ke(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var Xe=function(e,t){return{major:e,minor:t}},Ye={nu:Xe,detect:function(e,t){var n,r,o=String(t).toLowerCase();return 0===e.length?qe():(r=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,n=o))?Xe(i(1),i(2)):{major:0,minor:0};function i(e){return Number(n.replace(r,"$"+e))}},unknown:qe},Ge=function(e,t){return""===(n=t)||e.length>=n.length&&e.substr(0,0+n.length)===n;var n},Je=Oe(/^\s+|\s+$/g),Qe=Oe(/^\s+/g),Ze=Oe(/\s+$/g),et=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,tt={browsers:J([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Te(e,"edge/")&&Te(e,"chrome")&&Te(e,"safari")&&Te(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,et],search:function(e){return Te(e,"chrome")&&!Te(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Te(e,"msie")||Te(e,"trident")}},{name:"Opera",versionRegexes:[et,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Le("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Le("firefox")},{name:"Safari",versionRegexes:[et,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Te(e,"safari")||Te(e,"mobile/"))&&Te(e,"applewebkit")}}]),oses:J([{name:"Windows",search:Le("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Te(e,"iphone")||Te(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Le("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Le("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Le("linux"),versionRegexes:[]},{name:"Solaris",search:Le("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Le("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Le("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},nt="Firefox",rt=function(){return $e({current:void 0,version:Ye.unknown()})},ot=$e,it=(J("Edge"),J("Chrome"),J("IE"),J("Opera"),J(nt),J("Safari"),"Windows"),at="Android",ut="Solaris",st="FreeBSD",ct="ChromeOS",lt=function(){return We({current:void 0,version:Ye.unknown()})},ft=We,dt=(J(it),J("iOS"),J(at),J("Linux"),J("OSX"),J(ut),J(st),J(ct),Re(function(){return e=navigator.userAgent,t=ve.from(navigator.userAgentData),n=Ie,p=tt.browsers(),h=tt.oses(),v=t.bind(function(e){return r=p,ee(e.brands,function(t){var n=t.brand.toLowerCase();return M(r,function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(function(e){return{current:e.name,version:Ye.nu(parseInt(t.version,10),0)}})});var r}).orThunk(function(){return De(p,n=e).map(function(e){var t=Ye.detect(e.versionRegexes,n);return{current:e.name,version:t}});var n}).fold(rt,ot),b=De(h,r=e).map(function(e){var t=Ye.detect(e.versionRegexes,r);return{current:e.name,version:t}}).fold(lt,ft),{browser:v,os:b,deviceType:(i=v,a=e,u=n,s=(o=b).isiOS()&&!0===/ipad/i.test(a),c=o.isiOS()&&!s,f=(l=o.isiOS()||o.isAndroid())||u("(pointer:coarse)"),d=s||!c&&l&&u("(min-device-width:768px)"),m=c||l&&!d,g=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(a),{isiPad:J(s),isiPhone:J(c),isTablet:J(d),isPhone:J(m),isTouch:J(f),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:J(g),isDesktop:J(!m&&!d&&!g)})};var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b})),mt=navigator.userAgent,gt=dt(),pt=gt.browser,ht=gt.os,vt=gt.deviceType,bt=/WebKit/.test(mt)&&!pt.isEdge(),yt="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ct=-1!==mt.indexOf("Windows Phone"),xt={opera:pt.isOpera(),webkit:bt,ie:!(!pt.isIE()&&!pt.isEdge())&&pt.version.major,gecko:pt.isFirefox(),mac:ht.isOSX()||ht.isiOS(),iOS:vt.isiPad()||vt.isiPhone(),android:ht.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:pt.isIE()?document.documentMode||7:10,fileApi:yt,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!pt.isIE(),desktop:vt.isDesktop(),windowsPhone:Ct,browser:{current:pt.current,version:pt.version,isChrome:pt.isChrome,isEdge:pt.isEdge,isFirefox:pt.isFirefox,isIE:pt.isIE,isOpera:pt.isOpera,isSafari:pt.isSafari},os:{current:ht.current,version:ht.version,isAndroid:ht.isAndroid,isChromeOS:ht.isChromeOS,isFreeBSD:ht.isFreeBSD,isiOS:ht.isiOS,isLinux:ht.isLinux,isOSX:ht.isOSX,isSolaris:ht.isSolaris,isWindows:ht.isWindows},deviceType:{isDesktop:vt.isDesktop,isiPad:vt.isiPad,isiPhone:vt.isiPhone,isPhone:vt.isPhone,isTablet:vt.isTablet,isTouch:vt.isTouch,isWebView:vt.isWebView}},wt=/^\s*|\s*$/g,St=function(e,n,r,o){o=o||this,e&&ce(e=r?e[r]:e,function(e,t){return!1!==n.call(o,e,t,r)&&void St(e,n,r,o)})},Et={trim:Me,isArray:Ne,is:Fe,toArray:function(e){if(Ne(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},makeMap:function(e,t,n){var r;for(t=t||",",n=n||{},r=(e="string"==typeof(e=e||[])?e.split(t):e).length;r--;)n[e[r]]={};return n},each:ce,map:le,grep:fe,inArray:de,hasOwn:ke,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o,i,a=t[r];for(o in a)!ke(a,o)||void 0!==(i=a[o])&&(e[o]=i)}return e},create:function(e,t,n){var r,o,i,a=this,u=0,s=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],c=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!c[s]){if("static"===e[2])return c[s]=t,void(this.onCreate&&this.onCreate(e[2],e[3],c[s]));t[s]||(t[s]=function(){},u=1),c[s]=t[s],a.extend(c[s].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=c[s],c[s]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[s].prototype[s]=c[s],a.each(r,function(e,t){c[s].prototype[t]=r[t]}),a.each(t,function(e,t){r[t]?c[s].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==s&&(c[s].prototype[t]=e)})),a.each(t.static,function(e,t){c[s][t]=e})}},walk:St,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Fe(e,"array")?e:le(e.split(t||","),Me)},_addCacheSuffix:function(e){var t=xt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},kt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ke(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Ke(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Ke(n)},fromDom:Ke,fromPoint:function(e,t,n){return ve.from(e.dom.elementFromPoint(t,n)).map(Ke)}};function Nt(e){return e.dom.nodeName.toLowerCase()}function _t(e){return e.dom.nodeType}function At(t){return function(e){return _t(e)===t}}function Rt(e){return kt.fromDom(e.dom.ownerDocument)}function Dt(e){return An(e)?e:Rt(e)}function Tt(e){return kt.fromDom(Dt(e).dom.defaultView)}function Ot(e){return ve.from(e.dom.parentNode).map(kt.fromDom)}function Bt(e){return ve.from(e.dom.previousSibling).map(kt.fromDom)}function Pt(e){return ve.from(e.dom.nextSibling).map(kt.fromDom)}function Lt(e){return q(Ue(e,Bt))}function It(e){return Ue(e,Pt)}function Mt(e,t){var n=e.dom.childNodes;return ve.from(n[t]).map(kt.fromDom)}function Ft(e){return Mt(e,0)}function Ut(e){return Mt(e,e.dom.childNodes.length-1)}function zt(e){return e.dom.childNodes.length}function Ht(e){return Rn(e)&&V(e.dom.host)}function jt(t){return Ht(t)?t:function(){var e=Dt(t).dom.head;if(null==e)throw new Error("Head is not available yet");return kt.fromDom(e)}()}function Vt(e){return kt.fromDom(e.dom.host)}function qt(t,n){Ot(t).each(function(e){e.dom.insertBefore(n.dom,t.dom)})}function $t(e,t){Pt(e).fold(function(){Ot(e).each(function(e){Pn(e,t)})},function(e){qt(e,t)})}function Wt(t,n){Ft(t).fold(function(){Pn(t,n)},function(e){t.dom.insertBefore(n.dom,e.dom)})}function Kt(t,e){Y(e,function(e){Pn(t,e)})}function Xt(e){e.dom.textContent="",Y(Dn(e),function(e){Ln(e)})}function Yt(e){var t,n=Dn(e);0<n.length&&(t=e,Y(n,function(e){qt(t,e)})),Ln(e)}function Gt(e,t){return void 0!==e?e:void 0!==t?t:0}function Jt(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Fn(n,r)}function Qt(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t)}function Zt(e,t){dt().browser.isSafari()&&y(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)}function en(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}}function tn(e){var r=void 0===e?window:e,t=r.document,o=Jt(kt.fromDom(t)),n=void 0===r?window:r;return(dt().browser.isFirefox()?ve.none():ve.from(n.visualViewport)).fold(function(){var e=r.document.documentElement,t=e.clientWidth,n=e.clientHeight;return en(o.left,o.top,t,n)},function(e){return en(Math.max(e.pageLeft,o.left),Math.max(e.pageTop,o.top),e.width,e.height)})}function nn(t){return function(e){return!!e&&e.nodeType===t}}function rn(e){return e&&!Object.getPrototypeOf(e)}function on(e){var n=e.map(function(e){return e.toLowerCase()});return function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();return T(n,t)}return!1}}function an(r,e){var o=e.toLowerCase().split(" ");return function(e){if(zn(e))for(var t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}}function un(t){return function(e){return zn(e)&&e.hasAttribute(t)}}function sn(e){return zn(e)&&e.hasAttribute("data-mce-bogus")}function cn(e){return zn(e)&&"TABLE"===e.tagName}function ln(t){return function(e){if(zn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}}function fn(e,t,n){return void 0===n&&(n=o),e.exists(function(e){return n(e,t)})}function dn(e,t,n){return e.isSome()&&t.isSome()?ve.some(n(e.getOrDie(),t.getOrDie())):ve.none()}function mn(e){return void 0!==e.style&&y(e.style.getPropertyValue)}function gn(e,t,n){if(!(X(n)||v(n)||E(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}function pn(e,t,n){gn(e.dom,t,n)}function hn(e,t){var n=e.dom;ne(t,function(e,t){gn(n,t,e)})}function vn(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n}function bn(e,t){return ve.from(vn(e,t))}function yn(e,t){e.dom.removeAttribute(t)}function Cn(e,t){var n=e.dom;ne(t,function(e,t){!function(e,t,n){if(!X(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);mn(e)&&e.style.setProperty(t,n)}(n,t,e)})}function xn(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||In(e)?r:Qn(n,t)}function wn(e,t){var n=e.dom,r=Qn(n,t);return ve.from(r).filter(function(e){return 0<e.length})}function Sn(e){var t={},n=e.dom;if(mn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t}function En(e){return M(e,Nn)}function kn(e,t){return e.children&&T(e.children,t)}"undefined"!=typeof window||Function("return this;")();var Nn=At(1),_n=At(3),An=At(9),Rn=At(11),Dn=function(e){return A(e.dom.childNodes,kt.fromDom)},Tn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),On=J(Tn),Bn=Tn?function(e){return kt.fromDom(e.dom.getRootNode())}:Dt,Pn=function(e,t){e.dom.appendChild(t.dom)},Ln=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},In=function(e){var t=_n(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n=t.ownerDocument,r=kt.fromDom(t),o=Bn(r);return(Ht(o)?ve.some(o):ve.none()).fold(function(){return n.body.contains(t)},a(In,Vt))},Mn=function(n,r){return{left:n,top:r,translate:function(e,t){return Mn(n+e,r+t)}}},Fn=Mn,Un=function(e){var t,n=e.dom,r=n.ownerDocument.body;return r===n?Fn(r.offsetLeft,r.offsetTop):In(e)?(t=n.getBoundingClientRect(),Fn(t.left,t.top)):Fn(0,0)},zn=nn(1),Hn=on(["textarea","input"]),jn=nn(3),Vn=nn(8),qn=nn(9),$n=nn(11),Wn=on(["br"]),Kn=on(["img"]),Xn=ln("true"),Yn=ln("false"),Gn=on(["td","th"]),Jn=on(["video","audio","object","embed"]),Qn=function(e,t){return mn(e)?e.style.getPropertyValue(t):""},Zn=dt().browser,er={},tr={exports:er};function nr(e){setTimeout(function(){throw e},0)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void s(r.promise,e)}u(r.promise,e)}else(1===n._state?u:s)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new l(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof er&&void 0!==tr?tr.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();function rr(e){return sr(function(){return new ir(e)})}function or(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return Y(a,function(e,r){var t=we(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(void 0!==n[o])throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var t=we(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!j(u,function(e){return T(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n}var ir=tr.exports.boltExport,ar=function(e){function r(e){o()?i(e):t.push(e)}var n=ve.none(),t=[],o=function(){return n.isSome()},i=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){o()||(n=ve.some(e),Y(t,i),t=[])}),{get:r,map:function(n){return ar(function(t){r(function(e){t(n(e))})})},isReady:o}},ur={nu:ar,pure:function(t){return ar(function(e){e(t)})}},sr=function(n){function e(e){n().then(e,nr)}return{map:function(e){return sr(function(){return n().then(e)})},bind:function(t){return sr(function(){return n().then(function(e){return t(e).toPromise()})})},anonBind:function(e){return sr(function(){return n().then(function(){return e.toPromise()})})},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return sr(function(){return e=null===e?n():e})},toPromise:n,get:e}},cr=function(n){return{isValue:w,isError:D,getOr:J(n),getOrThunk:J(n),getOrDie:J(n),or:function(e){return cr(n)},orThunk:function(e){return cr(n)},fold:function(e,t){return t(n)},map:function(e){return cr(e(n))},mapError:function(e){return cr(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOptional:function(){return ve.some(n)}}},lr=function(n){return{isValue:D,isError:w,getOr:u,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:u,orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return lr(n)},mapError:function(e){return lr(e(n))},each:te,bind:function(e){return lr(n)},exists:D,forall:w,toOptional:ve.none}},fr={value:cr,error:lr,fromOption:function(e,t){return e.fold(function(){return lr(t)},cr)}};function dr(e){return e.fold(u,u)}function mr(e,t,n,r,o){return e(n,r)?ve.some(n):y(o)&&o(n)?ve.none():t(n,r,o)}function gr(e,t,n){for(var r=e.dom,o=y(n)?n:D;r.parentNode;){var r=r.parentNode,i=kt.fromDom(r);if(t(i))return ve.some(i);if(o(i))break}return ve.none()}function pr(e,t,n){return mr(function(e,t){return t(e)},gr,e,t,n)}function hr(e,t,n){return gr(e,function(e){return ze(e,t)},n)}function vr(e,t){return n=t,He(r=void 0===e?document:e.dom)?ve.none():ve.from(r.querySelector(n)).map(kt.fromDom);var n,r}function br(e,t,n){return mr(ze,hr,e,t,n)}function yr(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function Cr(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function xr(n,r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];clearTimeout(o),o=yr(function(){n.apply(this,e)},r)}var o;return e.stop=function(){clearTimeout(o)},e}function wr(m,g){function n(e,t,n){var r,o=Et._addCacheSuffix(e),i=ue(h,o).getOrThunk(function(){return{id:"mce-u"+p++,passed:[],failed:[],count:0}});function a(e,t){for(var n=e.length;n--;)e[n]();i.status=t,i.passed=[],i.failed=[],r&&(r.onload=null,r.onerror=null,r=null)}function u(){return a(i.passed,2),0}function s(){return a(i.failed,3)}(h[o]=i).count++;var c,l,f,d=function(){var e=d;!function(){for(var e=m.styleSheets,t=e.length;t--;){var n=e[t].ownerNode;if(n&&n.id===r.id)return u(),1}}()&&(Date.now()-l<y?_r.setTimeout(e):s())};t&&i.passed.push(t),n&&i.failed.push(n),1!==i.status&&(2!==i.status?3!==i.status?(i.status=1,hn(c=kt.fromTag("link",b.dom),{rel:"stylesheet",type:"text/css",id:i.id}),l=Date.now(),g.contentCssCors&&pn(c,"crossOrigin","anonymous"),g.referrerPolicy&&pn(c,"referrerpolicy",g.referrerPolicy),(r=c.dom).onload=d,r.onerror=s,f=c,Pn(jt(v),f),pn(c,"href",o)):s():u())}function o(t){return rr(function(e){n(t,i(e,J(fr.value(t))),i(e,J(fr.error(t))))})}function t(e){var n=Et._addCacheSuffix(e);ue(h,n).each(function(e){var t;0==--e.count&&(delete h[n],t=e.id,vr(jt(v),"#"+t).each(Ln))})}void 0===g&&(g={});var p=0,h={},v=kt.fromDom(m),b=Dt(v),y=g.maxLoadTime||5e3;return{load:n,loadAll:function(e,n,r){var a,t=A(e,o);a=t,rr(function(r){var o=[],i=0;0===a.length?r([]):Y(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})}).get(function(e){var t=B(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(dr)):n(t.pass.map(dr))})},unload:t,unloadAll:function(e){Y(e,function(e){t(e)})},_setReferrerPolicy:function(e){g.referrerPolicy=e}}}or([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Sr,Er,kr=function(e,t){return M(e.dom.childNodes,function(e){return t(kt.fromDom(e))}).map(kt.fromDom)},Nr=window.Promise||ir,_r={requestAnimationFrame:function(e,t){Sr?Sr.then(e):Sr=new Nr(function(e){(function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];(n=n||function(e){window.setTimeout(e,0)})(e,t)})(e,t=t||document.body)}).then(e)},setTimeout:yr,setInterval:Cr,setEditorTimeout:function(e,t,n){return yr(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r=Cr(function(){e.removed?clearInterval(r):t()},n);return r},debounce:xr,throttle:xr,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ar=(Er=new WeakMap,{forElement:function(e,t){var n=Bn(e).dom;return ve.from(Er.get(n)).getOrThunk(function(){var e=wr(n,t);return Er.set(n,e),e})}}),Rr=(Dr.prototype.current=function(){return this.node},Dr.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},Dr.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},Dr.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},Dr.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},Dr.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e&&(o=e[n],!this.rootNode||o!==this.rootNode)){if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}return(i=e.parentNode)&&i!==this.rootNode?i:void 0}},Dr);function Dr(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}function Tr(t){var n;return function(e){return n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,w),ke(n,Nt(e))}}function Or(e){return Nn(e)&&!mo(e)}function Br(e){return Nn(e)&&"br"===Nt(e)}function Pr(e){return No(e)&&(e=e.parentNode),ko(e)&&e.hasAttribute("data-mce-caret")}function Lr(e){return No(e)&&So(e.data)}function Ir(e){return Pr(e)||Lr(e)}function Mr(e){return e.firstChild!==e.lastChild||!Wn(e.firstChild)}function Fr(e){var t=e.container();return!!jn(t)&&(t.data.charAt(e.offset())===wo||e.isAtStart()&&Lr(t.previousSibling))}function Ur(e){var t=e.container();return!!jn(t)&&(t.data.charAt(e.offset()-1)===wo||e.isAtEnd()&&Lr(t.nextSibling))}function zr(e){return e&&e.hasAttribute("data-mce-caret")?(sn(n=(t=e.getElementsByTagName("br"))[t.length-1])&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n}function Hr(e){return Pr(e.startContainer)}function jr(e){return!Io(e)&&(Oo(e)?!Bo(e.parentNode):Po(e)||To(e)||Lo(e)||Mo(e))}function Vr(e,t){return jr(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Mo(e))return!1;if(Ro(e))return!0}return!0}(e,t)}function qr(e){return Fo.test(e)}function $r(e,t){return jr(e)&&!1===(a=t,jn(i=e)&&qr(i.data)&&!1===(n=i,r=kt.fromDom(a),hr(kt.fromDom(n),"pre,code",R(je,r)).isSome()))||zn(o=e)&&"A"===o.nodeName&&!o.hasAttribute("href")&&(o.hasAttribute("name")||o.hasAttribute("id"))||Uo(e);var n,r,o,i,a}function Wr(e,t){return function(e,t){var n=0;if($r(e,e))return!1;var r=e.firstChild;if(!r)return!0;var o=new Rr(r,e);do{if(t){if(Ho(r)){r=o.next(!0);continue}if(zo(r)){r=o.next();continue}}if(Wn(r))n++,r=o.next();else{if($r(r,e))return!1;r=o.next()}}while(r);return n<=1}(e.dom,t=void 0===t||t)}function Kr(e,t){return V(e)&&($r(e,t)||Or(kt.fromDom(e)))}function Xr(e){return"span"===e.nodeName.toLowerCase()&&"bookmark"===e.getAttribute("data-mce-type")}function Yr(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),Yo[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}}function Gr(e,t){return e.replace(t?qo:$o,function(e){return Yo[e]||e})}function Jr(e,t){return e.replace(t?qo:$o,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Yo[e]||"&#"+e.charCodeAt(0)+";"})}function Qr(e,t,n){return n=n||Jo,e.replace(t?qo:$o,function(e){return Yo[e]||n[e]||e})}function Zr(e,t){return(e=Et.trim(e))?e.split(t||" "):[]}function eo(e,t){var n=ti(e," ",ti(e.toUpperCase()," "));return ri(n,t)}function to(e){return eo("td th li dt dd figcaption caption details summary",e.getTextBlockElements())}function no(e,n){var r;return e&&(r={},ni(e="string"==typeof e?{"*":e}:e,function(e,t){r[t]=r[t.toUpperCase()]=("map"===n?ti:oi)(e,/[, ]/)})),r}function ro(i){function e(e,t,n){var r=i[e];return r?r=ti(r,/[, ]/,ti(r.toUpperCase(),/[, ]/)):(r=Zo[e])||(r=eo(t,n),Zo[e]=r),r}var t,s,n,r,o,a,u,c,S={},l={},E=[],f={},d={},m=(t=(i=i||{}).schema,c={},Zo[t]||(s="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="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"!==t&&(s+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(s+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),ni(Zr(u),function(e){g(e,"",r)}),n=[n,a="center dir isindex noframes"].join(" "),o=[n,r].join(" "),ni(Zr(a),function(e){g(e,"",o)})),o=o||[n,r].join(" "),g("html","manifest","head body"),g("head","","base command link meta noscript script style title"),g("title hr noscript br"),g("base","href target"),g("link","href rel media hreflang type sizes hreflang"),g("meta","name http-equiv content charset"),g("style","media type scoped"),g("script","src async defer type charset"),g("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),g("address dt dd div caption","",o),g("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","",r),g("blockquote","cite",o),g("ol","reversed start type","li"),g("ul","","li"),g("li","value",o),g("dl","","dt dd"),g("a","href target rel media hreflang type",r),g("q","cite",r),g("ins del","cite datetime",o),g("img","src sizes srcset alt usemap ismap width height"),g("iframe","src name width height",o),g("embed","src type width height"),g("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),g("param","name value"),g("map","name",[o,"area"].join(" ")),g("area","alt coords shape href target rel media hreflang type"),g("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),g("colgroup","span","col"),g("col","span"),g("tbody thead tfoot","","tr"),g("tr","","td th"),g("td","colspan rowspan headers",o),g("th","colspan rowspan headers scope abbr",o),g("form","accept-charset action autocomplete enctype method name novalidate target",o),g("fieldset","disabled form name",[o,"legend"].join(" ")),g("label","form for",r),g("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"),g("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),g("select","disabled form multiple name required size","option optgroup"),g("optgroup","disabled label","option"),g("option","disabled label selected value"),g("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),g("menu","type label",[o,"li"].join(" ")),g("noscript","",o),"html4"!==t&&(g("wbr"),g("ruby","",[r,"rt rp"].join(" ")),g("figcaption","",o),g("mark rt rp summary bdi","",r),g("canvas","width height",o),g("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),g("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),g("picture","","img source"),g("source","src srcset type media sizes"),g("track","kind src srclang label default"),g("datalist","",[r,"option"].join(" ")),g("article section nav aside main header footer","",o),g("hgroup","","h1 h2 h3 h4 h5 h6"),g("figure","",[o,"figcaption"].join(" ")),g("time","datetime",r),g("dialog","open",o),g("command","type label icon disabled checked radiogroup command"),g("output","for form name",r),g("progress","value max",r),g("meter","value min max low high optimum",r),g("details","open",[o,"summary"].join(" ")),g("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(p("script","language xml:space"),p("style","xml:space"),p("object","declare classid code codebase codetype archive standby align border hspace vspace"),p("embed","align name hspace vspace"),p("param","valuetype type"),p("a","charset name rev shape coords"),p("br","clear"),p("applet","codebase archive code object alt name width height align hspace vspace"),p("img","name longdesc align border hspace vspace"),p("iframe","longdesc frameborder marginwidth marginheight scrolling align"),p("font basefont","size color face"),p("input","usemap align"),p("select"),p("textarea"),p("h1 h2 h3 h4 h5 h6 div p legend caption","align"),p("ul","type compact"),p("li","type"),p("ol dl menu dir","compact"),p("pre","width xml:space"),p("hr","align noshade size width"),p("isindex","prompt"),p("table","summary width frame rules cellspacing cellpadding align bgcolor"),p("col","width align char charoff valign"),p("colgroup","width align char charoff valign"),p("thead","align char charoff valign"),p("tr","align char charoff valign bgcolor"),p("th","axis align char charoff valign nowrap bgcolor width height"),p("form","accept"),p("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),p("tfoot","align char charoff valign"),p("tbody","align char charoff valign"),p("area","nohref"),p("body","background bgcolor text link vlink alink")),"html4"!==t&&(p("input button select textarea","autofocus"),p("input textarea","placeholder"),p("a","download"),p("link script img","crossorigin"),p("img","loading"),p("iframe","sandbox seamless allowfullscreen loading")),ni(Zr("a form meter progress dfn"),function(e){c[e]&&delete c[e].children[e]}),delete c.caption.children.table,delete c.script,Zo[t]=c));function g(e,t,n){function r(e,t){for(var n={},r=0,o=e.length;r<o;r++)n[e[r]]=t||{};return n}var o,i;t=t||"","string"==typeof(n=n||[])&&(n=Zr(n));for(var a=Zr(e),u=a.length;u--;)i={attributes:r(o=Zr([s,t].join(" "))),attributesOrder:o,children:r(n,ei)},c[a[u]]=i}function p(e,t){for(var n,r,o,i=Zr(e),a=i.length,u=Zr(t);a--;)for(n=c[i[a]],r=0,o=u.length;r<o;r++)n.attributes[u[r]]={},n.attributesOrder.push(u[r])}!1===i.verify_html&&(i.valid_elements="*[*]");var h=no(i.valid_styles),v=no(i.invalid_styles,"map"),b=no(i.valid_classes,"map"),y=e("whitespace_elements","pre script noscript style textarea video audio iframe object code"),C=e("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),x=e("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),w=e("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),k="td th iframe video audio object script code",N=e("non_empty_elements",k+" pre",x),_=e("move_caret_before_on_enter_elements",k+" table",x),A=e("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),R=e("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 details summary",A),D=e("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");function T(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function O(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,x=/[*?+]/;if(e){var w=Zr(e,",");for(S["@"]&&(h=S["@"].attributes,v=S["@"].attributesOrder),t=0,n=w.length;t<n;t++)if(i=y.exec(w[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h&&(ne(h,function(e,t){d[t]=e}),m.push.apply(m,v)),s)for(r=0,o=(s=Zr(s,"|")).length;r<o;r++)(i=C.exec(s[r]))&&(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"!==f?(g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===g&&(u.validValues=ti(b,"?"))),x.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=T(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)):(delete d[l],m.splice(ii(m,l),1)));h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,S[p]=a),x.test(c)?(a.pattern=T(c),E.push(a)):S[c]=a}}}function B(e){S={},E=[],O(e),ni(m,function(e,t){l[t]=e.children})}function P(e){var a=/^(~)?(.+)$/;e&&(Zo.text_block_elements=Zo.block_elements=null,ni(Zr(e,","),function(e){var t,n=a.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];l[i]=l[o],f[i]=o,r||(R[i.toUpperCase()]={},R[i]={}),S[i]||(t=S[o],delete(t=ri({},t)).removeEmptyAttrs,delete t.removeEmpty,S[i]=t),ni(l,function(e,t){e[o]&&(l[t]=e=ri({},l[t]),e[i]=e[o])})}))}function L(e){var o=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;Zo[i.schema]=null,e&&ni(Zr(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?l[r[2]]:l[r[2]]={"#comment":{}},t=l[r[2]],ni(Zr(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})}function I(e){var t,n=S[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n}ni((i.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(e){d[e]=new RegExp("</"+e+"[^>]*>","gi")}),i.valid_elements?B(i.valid_elements):(ni(m,function(e,t){S[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},l[t]=e.children}),"html5"!==i.schema&&ni(Zr("strong/b em/i"),function(e){var t=Zr(e,"/");S[t[1]].outputName=t[0]}),ni(D,function(e,t){S[t]&&(i.padd_empty_block_inline_children&&(S[t].paddInEmptyBlock=!0),S[t].removeEmpty=!0)}),ni(Zr("ol ul blockquote a table tbody"),function(e){S[e]&&(S[e].removeEmpty=!0)}),ni(Zr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){S[e].paddEmpty=!0}),ni(Zr("span"),function(e){S[e].removeEmptyAttrs=!0})),P(i.custom_elements),L(i.valid_children),O(i.extended_valid_elements),L("+ol[ul|ol],+ul[ul|ol]"),ni({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){S[t]&&(S[t].parentsRequired=Zr(e))}),i.invalid_elements&&ni(oi(i.invalid_elements),function(e){S[e]&&delete S[e]}),I("span")||O("span[!data-mce-type|*]");var M=J(h),F=J(v),U=J(b),z=J(w),H=J(R),j=J(A),V=J(D),q=J(x),$=J(C),W=J(N),K=J(_),X=J(y),Y=J(d),G=J(f);return{children:l,elements:S,getValidStyles:M,getValidClasses:U,getBlockElements:H,getInvalidStyles:F,getShortEndedElements:q,getTextBlockElements:j,getTextInlineElements:V,getBoolAttrs:z,getElementRule:I,getSelfClosingElements:$,getNonEmptyElements:W,getMoveCaretBeforeOnEnterElements:K,getWhiteSpaceElements:X,getSpecialElements:Y,isValidChild:function(e,t){var n=l[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=I(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:G,addValidElements:O,setValidElements:B,addCustomElements:P,addValidChildren:L}}function oo(e,t,n,r){function o(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+o(t)+o(n)+o(r)}function io(b,e){var u,o,y=this,C=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,x=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,w=/\s*([^:]+):\s*([^;]+);?/g,S=/\s+$/,E={},k=Co;b=b||{},e&&(u=e.getValidStyles(),o=e.getInvalidStyles());for(var t=("\\\" \\' \\; \\: ; : "+k).split(" "),N=0;N<t.length;N++)E[t[N]]=k+N,E[k+N]=t[N];return{toHex:function(e){return e.replace(C,oo)},parse:function(e){function t(e,t,n){var r=p[e+"-top"+t];if(r){var o=p[e+"-right"+t];if(o){var i=p[e+"-bottom"+t];if(i){var a=p[e+"-left"+t];if(a){var u=[r,o,i,a];for(N=u.length-1;N--&&u[N]===u[N+1];);-1<N&&n||(p[e+t]=-1===N?u[0]:u.join(" "),delete p[e+"-top"+t],delete p[e+"-right"+t],delete p[e+"-bottom"+t],delete p[e+"-left"+t])}}}}}function n(e){var t,n=p[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return;return p[e]=n[0],1}}function r(e){return f=!0,E[e]}function u(e,t){return f&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return E[e]})),t?e:e.replace(/\\([\'\";:])/g,"$1")}function o(e){return String.fromCharCode(parseInt(e.slice(1),16))}function i(e){return e.replace(/\\[0-9a-f]+/gi,o)}function a(e,t,n,r,o,i){if(o=o||i)return"'"+(o=u(o)).replace(/\'/g,"\\'")+"'";if(t=u(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return"url('"+(t=h?h.call(v,t,"style"):t).replace(/\'/g,"\\'")+"')"}var s,c,l,f,d,m,g,p={},h=b.url_converter,v=b.url_converter_scope||y;if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,r).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,r)});s=w.exec(e);)w.lastIndex=s.index+s[0].length,c=s[1].replace(S,"").toLowerCase(),l=s[2].replace(S,""),c&&l&&(c=i(c),l=i(l),-1===c.indexOf(k)&&-1===c.indexOf('"')&&(b.allow_script_urls||"behavior"!==c&&!/expression\s*\(|\/\*|\*\//.test(l))&&("font-weight"===c&&"700"===l?l="bold":"color"!==c&&"background-color"!==c||(l=l.toLowerCase()),l=(l=l.replace(C,oo)).replace(x,a),p[c]=f?u(l,!0):l));t("border","",!0),t("border","-width"),t("border","-color"),t("border","-style"),t("padding",""),t("margin",""),m="border-style",g="border-color",n(d="border-width")&&n(m)&&n(g)&&(p.border=p[d]+" "+p[m]+" "+p[g],delete p[d],delete p[m],delete p[g]),"medium none"===p.border&&delete p.border,"none"===p["border-image"]&&delete p["border-image"]}return p},serialize:function(i,r){function e(e){var t,n=u[e];if(n)for(var r=0,o=n.length;r<o;r++)e=n[r],(t=i[e])&&(a+=(0<a.length?" ":"")+e+": "+t+";")}var a="";return r&&u?(e("*"),e(r)):ne(i,function(e,t){var n;!e||o&&((n=o["*"])&&n[t]||(n=o[r])&&n[t])||(a+=(0<a.length?" ":"")+t+": "+e+";")}),a}}}function ao(e){return e instanceof Event||y(e.initEvent)}function uo(e,t,n,r){var o,i,a=function(e){var t,n=null!=r?r:{};for(t in e)ke(ai,t)||(n[t]=e[t]);return V(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t);return a.type=e,K(a.target)&&(a.target=null!==(o=a.srcElement)&&void 0!==o?o:n),(K((i=t).preventDefault)||ao(i))&&(a.preventDefault=function(){a.defaultPrevented=!0,a.isDefaultPrevented=w,y(t.preventDefault)?t.preventDefault():ao(t)&&(t.returnValue=!1)},a.stopPropagation=function(){a.cancelBubble=!0,a.isPropagationStopped=w,y(t.stopPropagation)?t.stopPropagation():ao(t)&&(t.cancelBubble=!0)},a.stopImmediatePropagation=function(){a.isImmediatePropagationStopped=w,a.stopPropagation()},a.isDefaultPrevented!==w&&a.isDefaultPrevented!==D&&(a.isDefaultPrevented=!0===a.defaultPrevented?w:D,a.isPropagationStopped=!0===a.cancelBubble?w:D,a.isImmediatePropagationStopped=D)),a}function so(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function co(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function lo(e,t){var n,r,o,i,a=uo(e.type,e,document,t);return V(i=e)&&ui.test(i.type)&&b(e.pageX)&&!b(e.clientX)&&(r=(n=a.target.ownerDocument||document).documentElement,o=n.body,a.pageX=e.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),a.pageY=e.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),b(a.metaKey)&&(a.metaKey=!1),a}var fo=Tr(["h1","h2","h3","h4","h5","h6"]),mo=Tr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),go=Tr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),po=Tr(["ul","ol","dl"]),ho=Tr(["li","dd","dt"]),vo=Tr(["thead","tbody","tfoot"]),bo=Tr(["td","th"]),yo=Tr(["pre","script","textarea","style"]),Co="\ufeff",xo="\xa0",wo=Co,So=function(e){return e===Co},Eo=function(e){return e.replace(/\uFEFF/g,"")},ko=zn,No=jn,_o=function(e){return No(e)&&e.data[0]===wo},Ao=function(e){return No(e)&&e.data[e.data.length-1]===wo},Ro=Xn,Do=Yn,To=Wn,Oo=jn,Bo=on(["script","style","textarea"]),Po=on(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Lo=on(["table"]),Io=Ir,Mo=function(e){return!1===(zn(t=e)&&"true"===t.getAttribute("unselectable"))&&Do(e);var t},Fo=/^[ \t\r\n]*$/,Uo=un("data-mce-bookmark"),zo=un("data-mce-bogus"),Ho=function(e){return zn(e)&&"all"===e.getAttribute("data-mce-bogus")},jo=function(e,t,n){var r=n||t;if(zn(t)&&Xr(t))return t;for(var o,i,a,u,s,c,l,f,d,m,g,p=t.childNodes,h=p.length-1;0<=h;h--)jo(e,p[h],r);return!zn(t)||1===(o=t.childNodes).length&&Xr(o[0])&&t.parentNode.insertBefore(o[0],t),$n(a=t)||qn(a)||$r(t,r)||zn(i=t)&&0<i.childNodes.length||(s=r,jn(u=t)&&0<u.data.length&&(f=new Rr(c=u,l=s).prev(!1),d=new Rr(c,l).next(!1),m=b(f)||Kr(f,l),g=b(d)||Kr(d,l),m&&g))||e.remove(t),t},Vo=Et.makeMap,qo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$o=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\"\']/g,Ko=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Xo={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"},Yo={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Go={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Jo=Yr("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),Qo={encodeRaw:Gr,encodeAllRaw:function(e){return(""+e).replace(Wo,function(e){return Yo[e]||e})},encodeNumeric:Jr,encodeNamed:Qr,getEncodeFunc:function(e,t){var n=Yr(t)||Jo,r=Vo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?qo:$o,function(e){return void 0!==Yo[e]?Yo[e]:void 0!==n[e]?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Qr(e,t,n)}:Qr:r.numeric?Jr:Gr},decode:function(e){return e.replace(Ko,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Xo[t]||String.fromCharCode(t):Go[e]||Jo[e]||(n=e,(r=kt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Zo={},ei={},ti=Et.makeMap,ni=Et.each,ri=Et.extend,oi=Et.explode,ii=Et.inArray,ai={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ui=/^(?:mouse|contextmenu)|click/,si=(ci.prototype.bind=function(e,t,n,r){function o(e){f.executeHandlers(lo(e||d.event),i)}var i,a,u,s,c,l,f=this,d=window;if(e&&3!==e.nodeType&&8!==e.nodeType){e[f.expando]?i=e[f.expando]:(i=f.count++,e[f.expando]=i,f.events[i]={}),r=r||e;for(var m=t.split(" "),g=m.length;g--;)c=o,s=l=!1,"DOMContentLoaded"===(u=m[g])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,lo({type:u})):(f.hasMouseEnterLeave||(s=f.mouseEnterLeave[u])&&(c=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=lo(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,f.executeHandlers(e,i))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=lo(e||d.event)).type="focus"===e.type?"focusin":"focusout",f.executeHandlers(e,i)}),(a=f.events[i][u])?"ready"===u&&f.domLoaded?n(lo({type:u})):a.push({func:n,scope:r}):(f.events[i][u]=a=[{func:n,scope:r}],a.fakeName=s,a.capture=l,a.nativeHandler=c,"ready"===u?function(e,t,n){var r,o=e.document,i={type:"ready"};n.domLoaded?t(i):(r=function(){co(e,"DOMContentLoaded",r),co(e,"load",r),n.domLoaded||(n.domLoaded=!0,t(i)),e=null},"complete"===o.readyState||"interactive"===o.readyState&&o.body?r():so(e,"DOMContentLoaded",r),n.domLoaded||so(e,"load",r))}(e,c,f):so(e,s||u,c,l)));return e=a=null,n}},ci.prototype.unbind=function(n,e,t){var r,o,i;if(!n||3===n.nodeType||8===n.nodeType)return this;var a=n[this.expando];if(a){if(i=this.events[a],e){for(var u,s,c,l,f=e.split(" "),d=f.length;d--;)if(l=i[o=f[d]]){if(t)for(r=l.length;r--;)l[r].func===t&&(u=l.nativeHandler,s=l.fakeName,c=l.capture,(l=l.slice(0,r).concat(l.slice(r+1))).nativeHandler=u,l.fakeName=s,l.capture=c,i[o]=l);t&&0!==l.length||(delete i[o],co(n,l.fakeName||o,l.nativeHandler,l.capture))}}else ne(i,function(e,t){co(n,e.fakeName||t,e.nativeHandler,e.capture)}),i={};for(o in i)if(ke(i,o))return this;delete this.events[a];try{delete n[this.expando]}catch(e){n[this.expando]=null}}return this},ci.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;for(var o=lo({type:t,target:e},n);(r=e[this.expando])&&this.executeHandlers(o,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!o.isPropagationStopped(););return this},ci.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),(e=e.getElementsByTagName?e:e.document)&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},ci.prototype.destroy=function(){this.events={}},ci.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},ci.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},ci.Event=new ci,ci);function ci(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}function li(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)}var fi,di,mi,gi,pi,hi,vi,bi,yi,Ci,xi,wi,Si,Ei,ki,Ni,_i,Ai="sizzle"+-new Date,Ri=window.document,Di=0,Ti=0,Oi=ca(),Bi=ca(),Pi=ca(),Li=function(e,t){return e===t&&(Ci=!0),0},Ii="undefined",Mi={}.hasOwnProperty,Fi=[],Ui=Fi.pop,zi=Fi.push,Hi=Fi.push,ji=Fi.slice,Vi=Fi.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},qi="[\\x20\\t\\r\\n\\f]",$i="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Wi="\\["+qi+"*("+$i+")(?:"+qi+"*([*^$|!~]?=)"+qi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+$i+"))|)"+qi+"*\\]",Ki=":("+$i+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Wi+")*)|.*)\\)|)",Xi=new RegExp("^"+qi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+qi+"+$","g"),Yi=new RegExp("^"+qi+"*,"+qi+"*"),Gi=new RegExp("^"+qi+"*([>+~]|"+qi+")"+qi+"*"),Ji=new RegExp("="+qi+"*([^\\]'\"]*?)"+qi+"*\\]","g"),Qi=new RegExp(Ki),Zi=new RegExp("^"+$i+"$"),ea={ID:new RegExp("^#("+$i+")"),CLASS:new RegExp("^\\.("+$i+")"),TAG:new RegExp("^("+$i+"|[*])"),ATTR:new RegExp("^"+Wi),PSEUDO:new RegExp("^"+Ki),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+qi+"*(even|odd|(([+-]|)(\\d*)n|)"+qi+"*(?:([+-]|)"+qi+"*(\\d+)|))"+qi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+qi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+qi+"*((?:-\\d)?\\d*)"+qi+"*\\)|)(?=[^-]|$)","i")},ta=/^(?:input|select|textarea|button)$/i,na=/^h\d$/i,ra=/^[^{]+\{\s*\[native \w/,oa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ia=/[+~]/,aa=/'|\\/g,ua=new RegExp("\\\\([\\da-f]{1,6}"+qi+"?|("+qi+")|.)","ig");try{Hi.apply(Fi=ji.call(Ri.childNodes),Ri.childNodes),Fi[Ri.childNodes.length].nodeType}catch(e){Hi={apply:Fi.length?function(e,t){zi.apply(e,ji.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var sa=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:Ri)!==wi&&xi(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||wi).nodeType)&&9!==u)return[];if(Ei&&!r){if(o=oa.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_i(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return Hi.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&fi.getElementsByClassName)return Hi.apply(n,t.getElementsByClassName(a)),n}if(fi.qsa&&(!ki||!ki.test(e))){if(f=l=Ai,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=pi(e),(l=t.getAttribute("id"))?f=l.replace(aa,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+pa(c[s]);d=ia.test(e)&&ma(t.parentNode)||t,m=c.join(",")}if(m)try{return Hi.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{l||t.removeAttribute("id")}}}return vi(e.replace(Xi,"$1"),t,n,r)};function ca(){var n=[];function r(e,t){return n.push(e+" ")>di.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function la(e){return e[Ai]=!0,e}function fa(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function da(a){return la(function(i){return i=+i,la(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function ma(e){return e&&typeof e.getElementsByTagName!=Ii&&e}function ga(){}function pa(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ha(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Ti++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Di,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[Ai]||(e[Ai]={}))[u])&&r[0]===Di&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function va(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function ba(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function ya(e){return void 0!==e}function Ca(e){return"string"==typeof e}function xa(e,t){var n,r=(t=t||Aa).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o}function wa(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function Sa(e,t,n){var r,o;return t=Xa(t)[0],e.each(function(){n&&r===this.parentNode||(r=this.parentNode,o=t.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)}),e}function Ea(e,t){return new Xa.fn.init(e,t)}function ka(e){return null==e?"":(""+e).replace(Ha,"")}function Na(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e}function _a(e,n){var r=[];return Na(e,function(e,t){n(t,e)&&r.push(t)}),r}fi=sa.support={},gi=sa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},xi=sa.setDocument=function(e){var t,s=e?e.ownerDocument||e:Ri,n=s.defaultView;return s!==wi&&9===s.nodeType&&s.documentElement?(Si=(wi=s).documentElement,Ei=!gi(s),n&&n!==function(e){try{return e.top}catch(e){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){xi()},!1):n.attachEvent&&n.attachEvent("onunload",function(){xi()})),fi.attributes=!0,fi.getElementsByTagName=!0,fi.getElementsByClassName=ra.test(s.getElementsByClassName),fi.getById=!0,di.find.ID=function(e,t){if(typeof t.getElementById!=Ii&&Ei){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},di.filter.ID=function(e){var t=e.replace(ua,li);return function(e){return e.getAttribute("id")===t}},di.find.TAG=fi.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!=Ii)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},di.find.CLASS=fi.getElementsByClassName&&function(e,t){if(Ei)return t.getElementsByClassName(e)},Ni=[],ki=[],fi.disconnectedMatch=!0,ki=ki.length&&new RegExp(ki.join("|")),Ni=Ni.length&&new RegExp(Ni.join("|")),t=ra.test(Si.compareDocumentPosition),_i=t||ra.test(Si.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},Li=t?function(e,t){return e===t?(Ci=!0,0):(n=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!fi.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===Ri&&_i(Ri,e)?-1:t===s||t.ownerDocument===Ri&&_i(Ri,t)?1:yi?Vi.call(yi,e)-Vi.call(yi,t):0:4&n?-1:1);var n}:function(e,t){if(e===t)return Ci=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:yi?Vi.call(yi,e)-Vi.call(yi,t):0;if(o===i)return fa(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?fa(a[r],u[r]):a[r]===Ri?-1:u[r]===Ri?1:0},s):wi},sa.matches=function(e,t){return sa(e,null,null,t)},sa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==wi&&xi(e),t=t.replace(Ji,"='$1']"),fi.matchesSelector&&Ei&&(!Ni||!Ni.test(t))&&(!ki||!ki.test(t)))try{var n=(void 0).call(e,t);if(n||fi.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<sa(t,wi,null,[e]).length},sa.contains=function(e,t){return(e.ownerDocument||e)!==wi&&xi(e),_i(e,t)},sa.attr=function(e,t){(e.ownerDocument||e)!==wi&&xi(e);var n=di.attrHandle[t.toLowerCase()],r=n&&Mi.call(di.attrHandle,t.toLowerCase())?n(e,t,!Ei):void 0;return void 0!==r?r:fi.attributes||!Ei?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},sa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},sa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ci=!fi.detectDuplicates,yi=!fi.sortStable&&e.slice(0),e.sort(Li),Ci){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return yi=null,e},mi=sa.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=mi(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=mi(t);return n},(di=sa.selectors={cacheLength:50,createPseudo:la,match:ea,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(ua,li),e[3]=(e[3]||e[4]||e[5]||"").replace(ua,li),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||sa.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&sa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ea.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Qi.test(n)&&(t=pi(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(ua,li).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Oi[e+" "];return t||(t=new RegExp("(^|"+qi+")"+e+"("+qi+"|$)"))&&Oi(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!=Ii&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=sa.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!=v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[Ai]||(l[Ai]={}))[m]||[])[0]===Di&&r[1],a=r[0]===Di&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Di,u,a];break}}else if(d&&(r=(e[Ai]||(e[Ai]={}))[m])&&r[0]===Di)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[Ai]||(i[Ai]={}))[m]=[Di,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=di.pseudos[e]||di.setFilters[e.toLowerCase()]||sa.error("unsupported pseudo: "+e);return a[Ai]?a(i):1<a.length?(t=[e,e,"",i],di.setFilters.hasOwnProperty(e.toLowerCase())?la(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=Vi.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:la(function(e){var r=[],o=[],u=hi(e.replace(Xi,"$1"));return u[Ai]?la(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),r[0]=null,!o.pop()}}),has:la(function(t){return function(e){return 0<sa(t,e).length}}),contains:la(function(t){return t=t.replace(ua,li),function(e){return-1<(e.textContent||e.innerText||mi(e)).indexOf(t)}}),lang:la(function(n){return Zi.test(n||"")||sa.error("unsupported lang: "+n),n=n.replace(ua,li).toLowerCase(),function(e){var t;do{if(t=Ei?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}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===Si},focus:function(e){return e===wi.activeElement&&(!wi.hasFocus||wi.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!di.pseudos.empty(e)},header:function(e){return na.test(e.nodeName)},input:function(e){return ta.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:da(function(){return[0]}),last:da(function(e,t){return[t-1]}),eq:da(function(e,t,n){return[n<0?n+t:n]}),even:da(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:da(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:da(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:da(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=di.pseudos.eq,Y(["radio","checkbox","file","password","image"],function(e){var t;di.pseudos[e]=(t=e,function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t})}),Y(["submit","reset"],function(e){var n;di.pseudos[e]=(n=e,function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n})}),ga.prototype=di.filters=di.pseudos,di.setFilters=new ga,pi=sa.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Bi[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=di.preFilter;a;){for(i in n&&!(r=Yi.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=Gi.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Xi," ")}),a=a.slice(n.length)),di.filter)di.filter.hasOwnProperty(i)&&(!(r=ea[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?sa.error(e):Bi(e,u).slice(0)},hi=sa.compile=function(e,t){var n,h,v,b,y,r=[],o=[],i=Pi[e+" "];if(!i){for(n=(t=t||pi(e)).length;n--;)((i=function e(t){for(var o,n,r,i=t.length,a=di.relative[t[0].type],u=a||di.relative[" "],s=a?1:0,c=ha(function(e){return e===o},u,!0),l=ha(function(e){return-1<Vi.call(o,e)},u,!0),f=[function(e,t,n){var r=!a&&(n||t!==bi)||((o=t).nodeType?c:l)(e,t,n);return o=null,r}];s<i;s++)if(n=di.relative[t[s].type])f=[ha(va(f),n)];else{if((n=di.filter[t[s].type].apply(null,t[s].matches))[Ai]){for(r=++s;r<i&&!di.relative[t[r].type];r++);return function e(m,g,p,h,v,t){return h&&!h[Ai]&&(h=e(h)),v&&!v[Ai]&&(v=e(v,t)),la(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)sa(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:ba(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=ba(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?Vi.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=ba(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):Hi.apply(t,d)})}(1<s&&va(f),1<s&&pa(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(Xi,"$1"),n,s<r&&e(t.slice(s,r)),r<i&&e(t=t.slice(r)),r<i&&pa(t))}f.push(n)}return va(f)}(t[n]))[Ai]?r:o).push(i);(i=Pi(e,(h=o,b=0<(v=r).length,y=0<h.length,b?la(a):a))).selector=e}function a(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=bi,m=e||y&&di.find.TAG("*",o),g=Di+=null==d?1:Math.random()||.1,p=m.length;for(o&&(bi=t!==wi&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Di=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=Ui.call(r));f=ba(f)}Hi.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&sa.uniqueSort(r)}return o&&(Di=g,bi=d),l}return i},vi=sa.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&pi(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&fi.getById&&9===t.nodeType&&Ei&&di.relative[i[1].type]){if(!(t=(di.find.ID(a.matches[0].replace(ua,li),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ea.needsContext.test(e)?0:i.length;o--&&(a=i[o],!di.relative[u=a.type]);)if((s=di.find[u])&&(r=s(a.matches[0].replace(ua,li),ia.test(i[0].type)&&ma(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&pa(i)))return Hi.apply(n,r),n;break}}return(c||hi(e,l))(r,t,!Ei,n,ia.test(e)&&ma(t.parentNode)||t),n},fi.sortStable=Ai.split("").sort(Li).join("")===Ai,fi.detectDuplicates=!!Ci,xi(),fi.sortDetached=!0;var Aa=document,Ra=Array.prototype.push,Da=Array.prototype.slice,Ta=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Oa=si.Event,Ba=Et.makeMap("children,contents,next,prev"),Pa=function(e,t,n,r){var o;if(Ca(t))t=xa(t,ja(e[0]));else if(t.length&&!t.nodeType){if(t=Xa.makeArray(t),r)for(o=t.length-1;0<=o;o--)Pa(e,t[o],n,r);else for(o=0;o<t.length;o++)Pa(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},La=Et.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Ia=Et.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ma={for:"htmlFor",class:"className",readonly:"readOnly"},Fa={float:"cssFloat"},Ua={},za={},Ha=/^\s*|\s*$/g,ja=function(e){return e?9===e.nodeType?e:e.ownerDocument:Aa};function Va(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Xa&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Xa(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r}function qa(e,t,n,r){var o=[];for(r instanceof Xa&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&Xa(e).is(r))break}o.push(e)}return o}function $a(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null}function Wa(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName)||null;t.attr("data-mce-style",r)}function Ka(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o}Ea.fn=Ea.prototype={constructor:Ea,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return Xa(e).attr(t);o.context=t=document}if(Ca(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ta.exec(e)))return Xa(t).find(e);if(n[1])for(r=xa(e,ja(t)).firstChild;r;)Ra.call(o,r),r=r.nextSibling;else{if(!(r=ja(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Et.toArray(this)},add:function(e,t){var n,r;if(Ca(e))return this.add(Xa(e));if(!1!==t)for(n=Xa.unique(this.toArray().concat(Xa.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Ra.apply(this,Xa.makeArray(e));return this},attr:function(t,n){var e,r=this;if("object"==typeof t)Na(t,function(e,t){r.attr(e,t)});else{if(!ya(n)){if(r[0]&&1===r[0].nodeType){if((e=Ua[t])&&e.get)return e.get(r[0],t);if(Ia[t])return r.prop(t)?t:void 0;null===(n=r[0].getAttribute(t,2))&&(n=void 0)}return n}this.each(function(){var e;1===this.nodeType&&((e=Ua[t])&&e.set?e.set(this,n):null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2))})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ma[e]||e))Na(e,function(e,t){n.prop(e,t)});else{if(!ya(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(t,n){function e(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var o,i,a=this;if("object"==typeof t)Na(t,function(e,t){a.css(e,t)});else if(ya(n))t=e(t),"number"!=typeof n||La[t]||(n=n.toString()+"px"),a.each(function(){var e=this.style;if((i=za[t])&&i.set)i.set(this,n);else{try{this.style[Fa[t]||t]=n}catch(e){}null!==n&&""!==n||(e.removeProperty?e.removeProperty(r(t)):e.removeAttribute(t))}});else{if(o=a[0],(i=za[t])&&i.get)return i.get(o);if(!o.ownerDocument.defaultView)return o.currentStyle?o.currentStyle[e(t)]:"";try{return o.ownerDocument.defaultView.getComputedStyle(o,null).getPropertyValue(r(t))}catch(e){return}}return a},remove:function(){for(var e,t=this.length;t--;)e=this[t],Oa.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(t){var n;if(ya(t)){n=this.length;try{for(;n--;)this[n].innerHTML=t}catch(e){Xa(this[n]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(e){var t;if(ya(e)){for(t=this.length;t--;)"innerText"in this[t]?this[t].innerText=e:this[0].textContent=e;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Pa(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return Pa(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?Pa(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?Pa(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return Xa(e).append(this),this},prependTo:function(e){return Xa(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Sa(this,e)},wrapAll:function(e){return Sa(this,e,!0)},wrapInner:function(e){return this.each(function(){Xa(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){Xa(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),Xa(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?Na(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r=wa(t,o);r!==i&&(n=t.className,r?t.className=ka((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return wa(this[0],e)},each:function(e){return Na(this,e)},on:function(e,t){return this.each(function(){Oa.bind(this,e,t)})},off:function(e,t){return this.each(function(){Oa.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Oa.fire(this,e.type,e):Oa.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Xa(Da.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){for(var t=[],n=0,r=this.length;n<r;n++)Xa.find(e,this[n],t);return Xa(t)},filter:function(n){return Xa("function"==typeof n?_a(this.toArray(),function(e,t){return n(t,e)}):Xa.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof Xa&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&Xa(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),Xa(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ra,sort:Array.prototype.sort,splice:Array.prototype.splice},Et.extend(Ea,{extend:Et.extend,makeArray:function(e){return e&&e===e.window||e.nodeType?[e]:Et.toArray(e)},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Et.isArray,each:Na,trim:ka,grep:_a,find:sa,expr:sa.selectors,unique:sa.uniqueSort,text:sa.getText,contains:sa.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 1===t.length?Xa.find.matchesSelector(t[0],e)?[t[0]]:[]:Xa.find.matches(e,t)}}),Na({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Va(e,"parentNode")},next:function(e){return $a(e,"nextSibling",1)},prev:function(e){return $a(e,"previousSibling",1)},children:function(e){return qa(e.firstChild,"nextSibling",1)},contents:function(e){return Et.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(r,o){Ea.fn[r]=function(t){var n=[];this.each(function(){var e=o.call(n,this,t,n);e&&(Xa.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(Ba[r]||(n=Xa.unique(n)),0===r.indexOf("parents")&&(n=n.reverse()));var e=Xa(n);return t?e.filter(t):e}}),Na({parentsUntil:function(e,t){return Va(e,"parentNode",t)},nextUntil:function(e,t){return qa(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return qa(e,"previousSibling",1,t).slice(1)}},function(o,i){Ea.fn[o]=function(t,e){var n=[];this.each(function(){var e=i.call(n,this,t,n);e&&(Xa.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=Xa.unique(n),0!==o.indexOf("parents")&&"prevUntil"!==o||(n=n.reverse()));var r=Xa(n);return e?r.filter(e):r}}),Ea.fn.is=function(e){return!!e&&0<this.filter(e).length},Ea.fn.init.prototype=Ea.fn,Ea.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t=t||r.context,new o.fn.init(e,t)};return Xa.extend(o,this),o},Ea.attrHooks=Ua,Ea.cssHooks=za;var Xa=Ea,Ya=Et.each,Ga=Et.grep,Ja=xt.ie,Qa=/^([a-z0-9],?)+$/i,Za=function(a,u){function s(e){return e&&a&&X(e)?a.getElementById(e):e}function c(e){return H("string"==typeof e?s(e):e)}function r(e,t,n){var r,o,i=c(e);return void 0===(o=i.length?(r=W[t])&&r.get?r.get(i,t):i.attr(t):o)?n||"":o}function o(e){var t=s(e);return t?t.attributes:[]}function i(e,t,n){""===n&&(n=null);var r,o=c(e),i=o.attr(t);o.length&&((r=W[t])&&r.set?r.set(o,n,t):o.attr(t,n),i!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:o,attrName:t,attrValue:n}))}function l(){return u.root_element||a.body}function f(e,t){return function(e,t,n){var r,o=0,i=0,a=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===xn(kt.fromDom(e),"position")){var u=t.getBoundingClientRect();return{x:o=u.left+(a.documentElement.scrollLeft||e.scrollLeft)-a.documentElement.clientLeft,y:i=u.top+(a.documentElement.scrollTop||e.scrollTop)-a.documentElement.clientTop}}for(var s=t;s&&s!==n&&s.nodeType&&!kn(s,n);){var c=s;o+=c.offsetLeft||0,i+=c.offsetTop||0,s=c.offsetParent}for(s=t.parentNode;s&&s!==n&&s.nodeType&&!kn(s,n);)o-=s.scrollLeft||0,i-=s.scrollTop||0,s=s.parentNode;i+=(r=kt.fromDom(t),Zn.isFirefox()&&"table"===Nt(r)?En(Dn(r)).filter(function(e){return"caption"===Nt(e)}).bind(function(o){return En(It(o)).map(function(e){var t=e.dom.offsetTop,n=o.dom.offsetTop,r=o.dom.offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:o,y:i}}(a.body,s(e),t)}function d(e,t,n){var r=c(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=xt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)}function m(e){var t=d(e=s(e),"width"),n=d(e,"height");return-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}}function g(e,t){if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(Qa.test(t)){for(var n=t.toLowerCase().split(/,/),r=e.nodeName.toLowerCase(),o=n.length-1;0<=o;o--)if(n[o]===r)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<sa(t,i[0].ownerDocument||i[0],null,i).length}function p(e,t,n,r){var o,i=[],a=s(e);for(r=void 0===r,n=n||("BODY"!==l().nodeName?l().parentNode:null),Et.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return g(e,o)});a&&!(a===n||K(a.nodeType)||qn(a)||$n(a));){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null}function n(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return g(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null}function h(e,n,r){var o,t="string"==typeof e?s(e):e;return!!t&&(Et.isArray(t)&&(t.length||0===t.length)?(o=[],Ya(t,function(e,t){e&&o.push(n.call(r,"string"==typeof e?s(e):e,t))}),o):n.call(r||this,t))}function v(e,t){c(e).each(function(e,n){Ya(t,function(e,t){i(n,t,e)})})}function b(e,n){var t=c(e);Ja?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+n,t.removeChild(t.firstChild)}catch(e){Xa("<div></div>").html("<br>"+n).contents().slice(1).appendTo(t)}return n}}):t.html(n)}function y(e,n,r,o,i){return h(e,function(e){var t="string"==typeof n?a.createElement(n):n;return v(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&b(t,o)),i?t:e.appendChild(t)})}function C(e,t,n){return y(a.createElement(e),e,t,n,!0)}function x(e,t){var n=c(e);return(t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}):n).remove(),1<n.length?n.toArray():n[0]}function w(e,t,n){c(e).toggleClass(t,n).each(function(){""===this.className&&Xa(this).attr("class",null)})}function S(t,e,n){return h(e,function(e){return Et.is(e,"array")&&(t=t.cloneNode(!0)),n&&Ya(Ga(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})}function E(e){if(zn(e)){var t="a"===e.nodeName.toLowerCase()&&!r(e,"href")&&r(e,"id");return r(e,"name")||r(e,"data-mce-bookmark")||t?1:void 0}}function k(){return a.createRange()}function N(e){if(e&&zn(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null}void 0===u&&(u={});var _,A,R,D,e,t,T={},O=window,B={},P=0,L=Ar.forElement(kt.fromDom(a),{contentCssCors:u.contentCssCors,referrerPolicy:u.referrerPolicy}),I=[],M=u.schema||ro({}),F=io({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),U=u.ownEvents?new si:si.Event,z=M.getBlockElements(),H=Xa.overrideDefaults(function(){return{context:a,element:$.getRoot()}}),j=Qo.encodeAllRaw,V=function(e,t,n,r){if(Et.isArray(e)){for(var o=e.length,i=[];o--;)i[o]=V(e[o],t,n,r);return i}return!u.collect||e!==a&&e!==O||I.push([e,t,n,r]),U.bind(e,t,n,r||$)},q=function(e,t,n){if(Et.isArray(e)){for(var r=e.length,o=[];r--;)o[r]=q(e[r],t,n);return o}if(0<I.length&&(e===a||e===O))for(r=I.length;r--;){var i=I[r];e!==i[0]||t&&t!==i[1]||n&&n!==i[2]||U.unbind(i[0],i[1],i[2])}return U.unbind(e,t,n)},$={doc:a,settings:u,win:O,files:B,stdMode:!0,boxModel:!0,styleSheetLoader:L,boundEvents:I,styles:F,schema:M,events:U,isBlock:function(e){if("string"==typeof e)return!!z[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!z[e.nodeName])}return!1},$:H,$$:c,root:null,clone:function(t,e){if(!Ja||1!==t.nodeType||e)return t.cloneNode(e);var n=a.createElement(t.nodeName);return Ya(o(t),function(e){i(n,e.nodeName,r(t,e.nodeName))}),n},getRoot:l,getViewPort:function(e){var t=tn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){var t=f(e=s(e)),n=m(e);return{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:m,getParent:function(e,t,n){var r=p(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:p,get:s,getNext:function(e,t){return n(e,t,"nextSibling")},getPrev:function(e,t){return n(e,t,"previousSibling")},select:function(e,t){return sa(e,s(t)||u.root_element||a,[])},is:g,add:y,create:C,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)se(t,r)&&(o+=" "+r+'="'+j(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(r.appendChild(n),e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r.removeChild(n),r},remove:x,setStyle:function(e,t,n){var r=X(t)?c(e).css(t,n):c(e).css(t);u.update_styles&&Wa(F,r)},getStyle:d,setStyles:function(e,t){var n=c(e).css(t);u.update_styles&&Wa(F,n)},removeAllAttribs:function(e){return h(e,function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--)e.removeAttributeNode(t.item(n))})},setAttrib:i,setAttribs:v,getAttrib:r,getPos:f,parseStyle:function(e){return F.parse(e)},serializeStyle:function(e,t){return F.serialize(e,t)},addStyle:function(e){var t,n;if($!==Za.DOM&&a===document){if(T[e])return;T[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){Y((e=e||"").split(","),function(e){B[e]=!0,L.load(e,te)})},addClass:function(e,t){c(e).addClass(t)},removeClass:function(e,t){w(e,t,!1)},hasClass:function(e,t){return c(e).hasClass(t)},toggleClass:w,show:function(e){c(e).show()},hide:function(e){c(e).hide()},isHidden:function(e){return"none"===c(e).css("display")},uniqueId:function(e){return(e||"mce_")+P++},setHTML:b,getOuterHTML:function(e){var t="string"==typeof e?s(e):e;return zn(t)?t.outerHTML:Xa("<div></div>").append(Xa(t).clone()).html()},setOuterHTML:function(e,t){c(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}x(Xa(this).html(t),!0)})},decode:Qo.decode,encode:j,insertAfter:function(e,t){var r=s(t);return h(e,function(e){var t=r.parentNode,n=r.nextSibling;return n?t.insertBefore(e,n):t.appendChild(e),e})},replace:S,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=C(e),Ya(o(t),function(e){i(n,e.nodeName,r(t,e.nodeName))}),S(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return F.toHex(Et.trim(e))},run:h,getAttribs:o,isEmpty:function(e,t){var n,r,o=0;if(E(e))return!1;if(e=e.firstChild){var i=new Rr(e,e.parentNode),a=M?M.getWhiteSpaceElements():{};t=t||(M?M.getNonEmptyElements():null);do{if(n=e.nodeType,zn(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"!==r)return!1;o++,e=i.next();continue}if(E(e))return!1}if(8===n)return!1;if(3===n&&!qr(e.nodeValue))return!1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&qr(e.nodeValue))return!1;e=i.next()}while(e)}return o<=1},createRng:k,nodeIndex:Ka,split:function(e,t,n){var r,o,i,a=k();if(e&&t)return a.setStart(e.parentNode,Ka(e)),a.setEnd(t.parentNode,Ka(t)),r=a.extractContents(),(a=k()).setStart(t.parentNode,Ka(t)+1),a.setEnd(e.parentNode,Ka(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(jo($,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(jo($,o),e),x(e),n||t},bind:V,unbind:q,fire:function(e,t,n){return U.fire(e,t,n)},getContentEditable:N,getContentEditableParent:function(e){for(var t=l(),n=null;e&&e!==t&&null===(n=N(e));e=e.parentNode);return n},destroy:function(){if(0<I.length)for(var e=I.length;e--;){var t=I[e];U.unbind(t[0],t[1],t[2])}ne(B,function(e,t){L.unload(t),delete B[t]}),sa.setDocument&&sa.setDocument()},isChildOf:function(e,t){if(Ja){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}return e===t||t.contains(e)},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},W=(_=F,R=J($),e={set:function(e,t,n){A.url_converter&&null!==t&&(t=A.url_converter.call(A.url_converter_scope||R(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},t={style:{set:function(e,t){null===t||"object"!=typeof t?(D&&e.attr("data-mce-style",t),null!==t&&"string"==typeof t?(e.removeAttr("style"),e.css(_.parse(t))):e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return _.serialize(_.parse(t),e[0].nodeName)}}},(D=(A=u).keep_values)&&(t.href=t.src=e),t);return $};Za.DOM=Za(document),Za.nodeIndex=Ka;var eu=Za.DOM,tu=Et.each,nu=Et.grep,ru=(ou.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e},ou.prototype.loadScript=function(e,t,n){function r(){o.remove(i),a&&(a.onerror=a.onload=a=null)}var o=eu,i=o.uniqueId(),a=document.createElement("script");a.id=i,a.type="text/javascript",a.src=Et._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(a,"referrerpolicy",this.settings.referrerPolicy),a.onload=function(){r(),t()},a.onerror=function(){r(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a)},ou.prototype.isDone=function(e){return 2===this.states[e]},ou.prototype.markDone=function(e){this.states[e]=2},ou.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}))},ou.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},ou.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]},ou.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n)},ou.prototype.loadScripts=function(n,e,t,r){function o(t,e){tu(i.scriptLoadedCallbacks[e],function(e){y(e[t])&&e[t].call(e.scope)}),i.scriptLoadedCallbacks[e]=void 0}var i=this,a=[];i.queueLoadedCallbacks.push({success:e,failure:r,scope:t||this});var u=function(){var e,t=nu(n);n.length=0,tu(t,function(e){2!==i.states[e]?3!==i.states[e]?1!==i.states[e]&&(i.states[e]=1,i.loading++,i.loadScript(e,function(){i.states[e]=2,i.loading--,o("success",e),u()},function(){i.states[e]=3,i.loading--,a.push(e),o("failure",e),u()})):o("failure",e):o("success",e)}),i.loading||(e=i.queueLoadedCallbacks.slice(0),i.queueLoadedCallbacks.length=0,tu(e,function(e){0===a.length?y(e.success)&&e.success.call(e.scope):y(e.failure)&&e.failure.call(e.scope,a)}))};u()},ou.ScriptLoader=new ou,ou);function ou(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e}function iu(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function au(){return ue(uu,su.get())}var uu={},su=iu("en"),cu={getData:function(){return re(uu,function(e){return _e({},e)})},setCode:function(e){e&&su.set(e)},getCode:function(){return su.get()},add:function(e,t){var n=uu[e];n||(uu[e]=n={}),ne(t,function(e,t){n[t.toLowerCase()]=e})},translate:function(e){function n(e){return y(e)?Object.prototype.toString.call(e):u(e)?"":""+e}function t(e){var t=n(e);return ue(a,t.toLowerCase()).map(n).getOr(t)}function r(e){return e.replace(/{context:\w+}$/,"")}var o,i,a=au().getOr({}),u=function(e){return""===e||null==e};if(u(e))return"";if(h(o=e)&&ke(o,"raw"))return n(e.raw);if(S(i=e)&&1<i.length){var s=e.slice(1);return r(t(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return ke(s,t)?n(s[t]):e}))}return r(t(e))},isRtl:function(){return au().bind(function(e){return ue(e,"_dir")}).exists(function(e){return"rtl"===e})},hasCode:function(e){return ke(uu,e)}},lu=function(){function u(t,n){Y(U(r,function(e){return e.name===t&&e.state===n}),function(e){return e.callback()})}function s(e){var t;return(f[e]?f[e].dependencies:t)||[]}function c(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}}function e(e,t,n){void 0===n&&(n="added"),ke(f,e)&&"added"===n||ke(l,e)&&"loaded"===n?t():r.push({name:e,state:n,callback:t})}var o=[],l={},f={},r=[],d=function(r,o,i,a,e){var t,n;l[r]||(0!==(t="string"==typeof o?o:o.prefix+o.resource+o.suffix).indexOf("/")&&-1===t.indexOf("://")&&(t=lu.baseURL+"/"+t),l[r]=t.substring(0,t.lastIndexOf("/")),n=function(){var n,e,t;u(r,"loaded"),n=o,e=i,t=a,Y(s(r),function(e){var t=c(n,e);d(t.resource,t,void 0,void 0)}),e&&(t?e.call(t):e.call(ru))},f[r]?n():ru.ScriptLoader.add(t,n,a,e))};return{items:o,urls:l,lookup:f,_listeners:r,get:function(e){if(f[e])return f[e].instance},dependencies:s,requireLangPack:function(t,n){!1!==lu.languageLoad&&e(t,function(){var e=cu.getCode();!e||n&&-1===(","+(n||"")+",").indexOf(","+e+",")||ru.ScriptLoader.add(l[t]+"/langs/"+e+".js")},"loaded")},add:function(e,t,n){var r=t;return o.push(r),f[e]={instance:r,dependencies:n},u(e,"added"),r},remove:function(e){delete l[e],delete f[e]},createUrl:c,addComponents:function(e,t){var n=l[e];Y(t,function(e){ru.ScriptLoader.add(n+"/"+e)})},load:d,waitFor:e}};function fu(){var e,t,n=(e=te,t=iu(ve.none()),{clear:function(){r(),t.set(ve.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){r(),t.set(ve.some(e))}});function r(){return t.get().each(e)}return _e(_e({},n),{on:function(e){return n.get().each(e)}})}function du(n,r){var o=null;return{cancel:function(){l(o)||(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];l(o)&&(o=setTimeout(function(){o=null,n.apply(null,e)},r))}}}function mu(n,r){function o(){l(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:o,throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o(),i=setTimeout(function(){i=null,n.apply(null,e)},r)}}}function gu(e,t){var n=vn(e,t);return void 0===n||""===n?[]:n.split(" ")}function pu(e){return void 0!==e.dom.classList}function hu(e,t){var n,r,o;pu(e)?e.dom.classList.add(t):(r=t,o=gu(n=e,"class").concat([r]),pn(n,"class",o.join(" ")))}function vu(e,t){return pu(e)&&e.dom.classList.contains(t)}function bu(e,t){return He(n=void 0===e?document:e.dom)?[]:A(n.querySelectorAll(t),kt.fromDom);var n}function yu(r,e){function t(e,t){return(n=e.dom)&&n.hasAttribute&&n.hasAttribute(t)?ve.some(vn(e,t)):ve.none();var n}var n=r.selection.getRng(),o=kt.fromDom(n.startContainer),i=kt.fromDom(r.getBody()),a=e.fold(function(){return"."+qu()},function(e){return"["+$u()+'="'+e+'"]'});return br(Mt(o,n.startOffset).getOr(o),a,function(e){return je(e,i)}).bind(function(e){return t(e,""+Wu()).bind(function(n){return t(e,""+$u()).map(function(e){var t=Ku(r,n);return{uid:n,name:e,elements:t}})})})}function Cu(t){function o(){return{listeners:[],previous:fu()}}function c(e,t){n(e,function(e){return t(e),e})}function n(e,t){var n=i.get(),r=t(ue(n,e).getOrThunk(o));n[e]=r,i.set(n)}var i=iu({}),e=mu(function(){var e=i.get();Y(W(we(e)),function(e){n(e,function(u){var s=u.previous.get();return yu(t,ve.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){Y(e.listeners,function(e){return e(!1,t)})}),u.previous.clear())},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;fn(s,o)||(n=o,r=a,c(t=i,function(e){Y(e.listeners,function(e){return e(!0,t,{uid:n,nodes:A(r,function(e){return e.dom})})})}),u.previous.set(o))}),{previous:u.previous,listeners:u.listeners}})})},30);return t.on("remove",function(){e.cancel()}),t.on("NodeChange",function(){e.throttle()}),{addListener:function(e,t){n(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}}function xu(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Xu+String(t)}function wu(e,t){var n,r,o=Rt(e).dom,i=kt.fromDom(o.createDocumentFragment());Kt(i,(n=t,(r=(o||document).createElement("div")).innerHTML=n,Dn(kt.fromDom(r)))),Xt(e),Pn(e,i)}function Su(e,t){return kt.fromDom(e.dom.cloneNode(t))}function Eu(e){return Su(e,!1)}function ku(e){return Su(e,!0)}function Nu(e,t,n){function r(e){for(var t;(t=o[e]())&&!jn(t)&&!n(t););return ve.from(t).filter(jn)}void 0===n&&(n=D);var o=new Rr(e,t);return{current:function(){return ve.from(o.current()).filter(jn)},next:function(){return r("next")},prev:function(){return r("prev")},prev2:function(){return r("prev2")}}}function _u(t,e){var i=e||function(e){return t.isBlock(e)||Wn(e)||Yn(e)},a=function(e,t,n,r){if(jn(e)){var o=r(e,t,e.data);if(-1!==o)return ve.some({container:e,offset:o})}return n().bind(function(e){return a(e.container,e.offset,n,r)})};return{backwards:function(e,t,n,r){var o=Nu(e,r,i);return a(e,t,function(){return o.prev().map(function(e){return{container:e,offset:e.length}})},n).getOrNull()},forwards:function(e,t,n,r){var o=Nu(e,r,i);return a(e,t,function(){return o.next().map(function(e){return{container:e,offset:0}})},n).getOrNull()}}}function Au(e){return e?{left:Yu(e.left),top:Yu(e.top),bottom:Yu(e.bottom),right:Yu(e.right),width:Yu(e.width),height:Yu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function Ru(e,t){return e=Au(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e}function Du(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2}function Tu(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Du(t.top-e.bottom,e,t)}function Ou(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Du(t.bottom-e.top,e,t)}function Bu(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}function Pu(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null}function Lu(e,t){if(zn(e)&&e.hasChildNodes()){var n=e.childNodes;return n[r=n.length-1,Math.min(Math.max(t,0),r)]}return e;var r}function Iu(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Gu.test(e)}function Mu(e){return"createRange"in e?e.createRange():Za.DOM.createRng()}function Fu(e){return e&&/[\r\n\t ]/.test(e)}function Uu(e){return e.setStart&&e.setEnd}function zu(e){var t=e.startContainer,n=e.startOffset;if(Fu(e.toString())&&ns(t.parentNode)&&jn(t)){var r=t.data;return Fu(r[n-1])||Fu(r[n+1])?1:void 0}}function Hu(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom}function ju(e,t){var n=Ru(e,t);return n.width=1,n.right=n.left+1,n}lu.languageLoad=!0,lu.baseURL="",lu.PluginManager=lu(),lu.ThemeManager=lu();var Vu=function(e,t){var n=[];return Y(Dn(e),function(e){n=(n=t(e)?n.concat([e]):n).concat(Vu(e,t))}),n},qu=J("mce-annotation"),$u=J("data-mce-annotation"),Wu=J("data-mce-annotation-uid"),Ku=function(e,t){return bu(kt.fromDom(e.getBody()),"["+Wu()+'="'+t+'"]')},Xu=0,Yu=Math.round,Gu=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]"),Ju=zn,Qu=jr,Zu=an("display","block table"),es=an("float","left right"),ts=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}}(Ju,Qu,s(es)),ns=s(an("white-space","pre pre-line pre-wrap")),rs=jn,os=Wn,is=Za.nodeIndex,as=function(e,t){if(!(t<0&&zn(e)&&e.hasChildNodes()))return Lu(e,t)},us=function(e){var t=e.getClientRects(),n=0<t.length?Au(t[0]):Au(e.getBoundingClientRect());return!Uu(e)&&os(e)&&Hu(n)?function(e){var t=e.ownerDocument,n=Mu(t),r=t.createTextNode(xo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=Au(n.getBoundingClientRect());return o.removeChild(r),i}(e):Hu(n)&&Uu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&jn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),us(i)}return null}(e):n},ss=function(t,n,e){function r(){return e=e||function(e){function r(e){var t;0!==e.height&&(0<o.length&&(t=o[o.length-1],e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right)||o.push(e))}function t(e,t){var n=Mu(e.ownerDocument);if(t<e.data.length){if(Iu(e.data[t]))return o;if(Iu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!zu(n)))return r(ju(us(n),!1)),o}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),zu(n)||r(ju(us(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),zu(n)||r(ju(us(n),!0)))}var o=[],n=e.container(),i=e.offset();if(rs(n))return t(n,i),o;if(Ju(n))if(e.isAtEnd()){var a=as(n,i);rs(a)&&t(a,a.data.length),ts(a)&&!os(a)&&r(ju(us(a),!1))}else{if(a=as(n,i),rs(a)&&t(a,0),ts(a)&&e.isAtEnd())return r(ju(us(a),!1)),o;var u=as(e.container(),e.offset()-1);ts(u)&&!os(u)&&(!Zu(u)&&!Zu(a)&&ts(a)||r(ju(us(u),!1))),ts(a)&&r(ju(us(a),!0))}return o}(ss(t,n))}return{container:J(t),offset:J(n),toRange:function(){var e=Mu(t.ownerDocument);return e.setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return rs(t),0===n},isAtEnd:function(){return rs(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return as(t,e?n-1:n)}}};function cs(e,t){jn(t)&&0===t.data.length&&e.remove(t)}function ls(e,t,n){var r,o,i,a,u,s,c;$n(n)?(i=e,a=t,s=ve.from((u=n).firstChild),c=ve.from(u.lastChild),a.insertNode(u),s.each(function(e){return cs(i,e.previousSibling)}),c.each(function(e){return cs(i,e.nextSibling)})):(r=e,t.insertNode(o=n),cs(r,o.previousSibling),cs(r,o.nextSibling))}function fs(t){return function(e){return t===e}}function ds(e){var t,r,n,o;return(cc(e)?"text()":e.nodeName.toLowerCase())+"["+(r=mc(dc(t=e)),n=ge(r,fs(t),t),o=me(r=r.slice(0,n+1),function(e,t,n){return cc(t)&&cc(r[n-1])&&e++,e},0),ge(r=fe(r,on([t.nodeName])),fs(t),t)-o)+"]"}function ms(e,t){var n,r,o,i=[],a=t.container(),u=t.offset();return cc(a)?n=function(e,t){for(;(e=e.previousSibling)&&cc(e);)t+=e.data.length;return t}(a,u):(u>=(r=a.childNodes).length?(n="after",u=r.length-1):n="before",a=r[u]),i.push(ds(a)),o=fe(function(e,t){var n=[];for(t=t.parentNode;t!==e;t=t.parentNode)n.push(t);return n}(e,a),s(sn)),(i=i.concat(le(o,ds))).reverse().join("/")+","+n}function gs(e,t){if(!t)return null;var n=t.split(","),r=n[0].split("/"),o=1<n.length?n[1]:"before",i=me(r,function(e,t){var n,r,o,i,a=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return a?("text()"===a[1]&&(a[1]="#text"),n=e,r=a[1],o=parseInt(a[2],10),i=fe(i=mc(n),function(e,t){return!cc(e)||!cc(i[t-1])}),(i=fe(i,on([r])))[o]):null},e);return i?cc(i)?function(e,t){for(var n,r=e,o=0;cc(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!cc(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return cc(e)&&t>e.data.length&&(t=e.data.length),ss(e,t)}(i,parseInt(o,10)):(o="after"===o?fc(i)+1:fc(i),ss(i.parentNode,o)):null}function ps(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(jn(a)?s.push(n?function(e,t,n){for(var r=e(t.data.slice(0,n)).length,o=t.previousSibling;o&&jn(o);o=o.previousSibling)r+=e(o.data).length;return r}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s}function hs(e,t,n){var r=0;return Et.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r}function vs(e,t){var n,r=t?"start":"end",o=e[r+"Container"],i=e[r+"Offset"];zn(o)&&"TR"===o.nodeName&&(o=(n=o.childNodes)[Math.min(t?i:i-1,n.length-1)])&&(i=t?0:o.childNodes.length,e["set"+(t?"Start":"End")](o,i))}function bs(e){return vs(e,!0),vs(e,!1),e}function ys(e,t){var n;return zn(e)&&(e=Lu(e,t),gc(e))?e:Ir(e)?(n=(e=jn(e)&&Pr(e)?e.parentNode:e).previousSibling,gc(n)?n:(n=e.nextSibling,gc(n)?n:void 0)):void 0}function Cs(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(gc(r)||"IMG"===o)return{name:o,index:hs(n.dom,o,r)};var a,u,s,c,l,f,d,m=ys((a=i).startContainer,a.startOffset)||ys(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:hs(n.dom,o,m)}:(f=(s=n).dom,(d={}).start=ps(f,u=e,c=t,l=i,!0),s.isCollapsed()||(d.end=ps(f,u,c,l,!1)),Hr(l)&&(d.isFakeCaret=!0),d)}function xs(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)}function ws(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:hs(n,u,a)};var s=bs(r.cloneRange());return i||(s.collapse(!1),ls(n,s,xs(n,o+"_end",t))),(r=bs(r)).collapse(!0),ls(n,r,xs(n,o+"_start",t)),e.moveToBookmark({id:o,keep:!0}),{id:o}}function Ss(e,t,n){var r=e.getParam(t,n);return-1===r.indexOf("=")?r:ue(e.getParam(t,"","hash"),e.id).getOr(n)}function Es(e){return e.getParam("content_security_policy","")}function ks(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t}function Ns(e){return e.getParam("forced_root_block_attrs",{})}function _s(e){return e.getParam("automatic_uploads",!0,"boolean")}function As(e){return e.getParam("icons","","string")}function Rs(e){return e.getParam("referrer_policy","","string")}function Ds(e){return e.getParam("language","en","string")}function Ts(e){return e.getParam("indent_use_margin",!1)}function Os(e){var t=e.getParam("font_css",[]);return S(t)?t:A(t.split(","),Je)}function Bs(e){var t=e.getParam("object_resizing");return!1!==t&&!xt.iOS&&(X(t)?t:"table,img,figure.image,div,video,iframe")}function Ps(e){return e.getParam("event_root")}function Ls(e){return e.getParam("theme")}function Is(e){return!1!==e.getParam("inline_boundaries")}function Ms(e){return e.getParam("plugins","","string")}function Fs(e){var t=e.parentNode;t&&t.removeChild(e)}function Us(e){var t=Eo(e);return{count:e.length-t.length,text:t}}function zs(e){for(var t;-1!==(t=e.data.lastIndexOf(wo));)e.deleteData(t,1)}function Hs(e,t){return yc(e),t}function js(e,t){var n,r=t.container(),o=(-1===(n=_(xe(r.childNodes),e))?ve.none():ve.some(n)).map(function(e){return e<t.offset()?ss(r,t.offset()-1):t}).getOr(t);return yc(e),o}function Vs(e,t){return ss.isTextPosition(t)?(r=t,bc(n=e)&&r.container()===n?(a=Us((o=n).data.substr(0,(i=r).offset())),u=Us(o.data.substr(i.offset())),0<(a.text+u.text).length?(zs(o),ss(o,i.offset()-a.count)):i):Hs(n,r)):(s=e,((c=t).container()===s.parentNode?js:Hs)(s,c));var n,r,o,i,a,u,s,c}function qs(e,t,n){var r,o,i,a=Ru(t.getBoundingClientRect(),n),u="BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,e.scrollTop||r.scrollTop):(i=e.getBoundingClientRect(),o=e.scrollLeft-i.left,e.scrollTop-i.top);a.left+=o,a.right+=o,a.top+=u,a.bottom+=u,a.width=1;var s=t.offsetWidth-t.clientWidth;return 0<s&&(n&&(s*=-1),a.left+=s,a.right+=s),a}function $s(e,i,a,u){function s(){!function(){for(var e=bu(kt.fromDom(i),"*[contentEditable=false],video,audio,embed,object"),t=0;t<e.length;t++){var n,r=e[t].dom,o=r.previousSibling;Ao(o)&&(1===(n=o.data).length?o.parentNode.removeChild(o):o.deleteData(n.length-1,1)),o=r.nextSibling,_o(o)&&(1===(n=o.data).length?o.parentNode.removeChild(o):o.deleteData(0,1))}}(),l&&(yc(l),l=null),f.on(function(e){Xa(e.caret).remove(),f.clear()}),c&&(_r.clearInterval(c),c=void 0)}var c,l,f=fu(),t=ks(e),d=0<t.length?t:"p";return{show:function(e,t){var n;if(s(),Sc(t))return null;if(!a(t))return l=function(e,t){var n=e.ownerDocument.createTextNode(wo),r=e.parentNode;if(t){if(o=e.previousSibling,No(o)){if(Ir(o))return o;if(Ao(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e)}else{var o=e.nextSibling;if(No(o)){if(Ir(o))return o;if(_o(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n)}return n}(t,e),n=t.ownerDocument.createRange(),Ec(l.nextSibling)?(n.setStart(l,0),n.setEnd(l,0)):(n.setStart(l,1),n.setEnd(l,1)),n;l=function(e,t,n){var r,o=t.ownerDocument.createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o}(d,t,e);var r=qs(i,t,e);Xa(l).css("top",r.top);var o=Xa('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(_e({},r)).appendTo(i)[0];return f.set({caret:o,element:t,before:e}),e&&Xa(o).addClass("mce-visual-caret-before"),c=_r.setInterval(function(){u()?Xa("div.mce-visual-caret",i).toggleClass("mce-visual-caret-hidden"):Xa("div.mce-visual-caret",i).addClass("mce-visual-caret-hidden")},500),(n=t.ownerDocument.createRange()).setStart(l,0),n.setEnd(l,0),n},hide:s,getCss:function(){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;}"},reposition:function(){f.on(function(e){var t=qs(i,e.element,e.before);Xa(e.caret).css(_e({},t))})},destroy:function(){return _r.clearInterval(c)}}}function Ws(){return Cc.isIE()||Cc.isEdge()||Cc.isFirefox()}function Ks(e){return Ec(e)||cn(e)&&Ws()}function Xs(e,t){for(var n;n=e(t);)if(!Rc(n))return n;return null}function Ys(e,t,n,r,o){var i=new Rr(e,r),a=kc(e)||Rc(e);if(t<0){if(a&&n(e=Xs(i.prev.bind(i),!0)))return e;for(;e=Xs(i.prev.bind(i),o);)if(n(e))return e}if(0<t){if(a&&n(e=Xs(i.next.bind(i),!0)))return e;for(;e=Xs(i.next.bind(i),o);)if(n(e))return e}return null}function Gs(e,t){for(;e&&e!==t;){if(_c(e))return e;e=e.parentNode}return null}function Js(e,t,n){return Gs(e.container(),n)===Gs(t.container(),n)}function Qs(e,t){if(!t)return null;var n=t.container(),r=t.offset();return Dc(n)?n.childNodes[r+e]:null}function Zs(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function ec(e,t,n){for(var r,o,i=e?"previousSibling":"nextSibling";n&&n!==t;){var a=n[i];if(Ac(a)&&(a=a[i]),kc(a)||Nc(a)){if(o=n,Gs(a,r=t)===Gs(o,r))return a;break}if(Tc(a))break;n=n.parentNode}return null}function tc(e,t,n){var r,o=R(ec,!0,t),i=R(ec,!1,t),a=n.startContainer,u=n.startOffset;if(Pr(a)){var s=(a=Dc(a)?a:a.parentNode).getAttribute("data-mce-caret");if("before"===s&&Ks(r=a.nextSibling))return Oc(r);if("after"===s&&Ks(r=a.previousSibling))return Bc(r)}if(!n.collapsed)return n;if(jn(a)){if(Ac(a)){if(1===e){if(r=i(a))return Oc(r);if(r=o(a))return Bc(r)}if(-1===e){if(r=o(a))return Bc(r);if(r=i(a))return Oc(r)}return n}if(Ao(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?Oc(r):n;if(_o(a)&&u<=1)return-1===e&&(r=o(a))?Bc(r):n;if(u===a.data.length)return(r=i(a))?Oc(r):n;if(0===u)return(r=o(a))?Bc(r):n}return n}function nc(e,t){return ve.from(Qs(e?0:-1,t)).filter(kc)}function rc(e,t,n){var r=tc(e,t,n);return-1===e?ss.fromRangeStart(r):ss.fromRangeEnd(r)}function oc(e){return ve.from(e.getNode()).map(kt.fromDom)}function ic(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function ac(e,t){var n=Js(e,t);return!(n||!Wn(e.getNode()))||n}ss.fromRangeStart=function(e){return ss(e.startContainer,e.startOffset)},ss.fromRangeEnd=function(e){return ss(e.endContainer,e.endOffset)},ss.after=function(e){return ss(e.parentNode,is(e)+1)},ss.before=function(e){return ss(e.parentNode,is(e))},ss.isAbove=function(e,t){return dn(Q(t.getClientRects()),Z(e.getClientRects()),Tu).getOr(!1)},ss.isBelow=function(e,t){return dn(Z(t.getClientRects()),Q(e.getClientRects()),Ou).getOr(!1)},ss.isAtStart=function(e){return!!e&&e.isAtStart()},ss.isAtEnd=function(e){return!!e&&e.isAtEnd()},ss.isTextPosition=function(e){return!!e&&jn(e.container())},ss.isElementPosition=function(e){return!1===ss.isTextPosition(e)};var uc,sc,cc=jn,lc=sn,fc=Za.nodeIndex,dc=function(e){var t=e.parentNode;return lc(t)?dc(t):t},mc=function(e){return e?me(e.childNodes,function(e,t){return lc(t)&&"BR"!==t.nodeName?e=e.concat(mc(t)):e.push(t),e},[]):[]},gc=Yn,pc=R(Cs,u,!0),hc=Za.DOM,vc=zn,bc=jn,yc=function(e){vc(e)&&Ir(e)&&(Mr(e)?e.removeAttribute("data-mce-caret"):Fs(e)),bc(e)&&(zs(e),0===e.data.length&&Fs(e))},Cc=dt().browser,xc=Yn,wc=Jn,Sc=Gn,Ec=function(e){return xc(e)||wc(e)},kc=Yn,Nc=Jn,_c=an("display","block table table-cell table-caption list-item"),Ac=Ir,Rc=Pr,Dc=zn,Tc=jr,Oc=R(Zs,!0),Bc=R(Zs,!1);function Pc(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function Lc(e,t){if(0<e){if(Yl(t.previousSibling)&&!Wl(t.previousSibling))return ss.before(t);if(Wl(t))return ss(t,0)}if(e<0){if(Yl(t.nextSibling)&&!Wl(t.nextSibling))return ss.after(t);if(Wl(t))return ss(t,t.data.length)}return e<0&&!Xl(t)?ss.after(t):ss.before(t)}function Ic(t){return{next:function(e){return Jl(uc.Forwards,e,t)},prev:function(e){return Jl(uc.Backwards,e,t)}}}function Mc(e){return ss.isTextPosition(e)?0===e.offset():jr(e.getNode())}function Fc(e){if(ss.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return jr(e.getNode(!0))}function Uc(e,t){return!ss.isTextPosition(e)&&!ss.isTextPosition(t)&&e.getNode()===t.getNode(!0)}function zc(o,i,a){return Ql(o,i,a).bind(function(e){return Js(a,e,i)&&(t=a,n=e,o?!Uc(t,n)&&(ss.isTextPosition(r=t)||!Wn(r.getNode()))&&Fc(t)&&Mc(n):!Uc(n,t)&&Mc(t)&&Fc(n))?Ql(o,i,e):ve.some(e);var t,n,r})}function Hc(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return jn(u)?ve.some(ss(u,e?0:u.data.length)):u?jr(u)?ve.some(e?ss.before(u):Wn(a=u)?ss.before(a):ss.after(a)):(r=t,o=u,i=(n=e)?ss.before(o):ss.after(o),Ql(n,r,i)):ve.none()}function jc(e){return zn(e)&&e.id===of}function Vc(e,t){for(;t&&t!==e;){if(t.id===of)return t;t=t.parentNode}return null}function qc(e){return Et.isArray(e.start)}function $c(e,t){return zn(t)&&e.isBlock(t)&&!t.innerHTML&&!xt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t}function Wc(e,t,n){return!1===t.hasChildNodes()&&Vc(e,t)&&(o=n,i=(r=t).ownerDocument.createTextNode(wo),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),1);var r,o,i}function Kc(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,Wc(c,i,r))return 1;if(s[o]>u.length-1)return Wc(c,i,r)||function(t){return rf(i).fold(D,function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})}(r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return 1}function Xc(e){return jn(e)&&0<e.data.length}function Yc(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,o="start"===t?l?c.hasChildNodes()?(r=c.firstChild,1):Xc(c.nextSibling)?(r=c.nextSibling,0):Xc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)+1):e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,1):Xc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)):e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Et.each(Et.grep(c.childNodes),function(e){jn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&jn(a)&&!xt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return ve.some(ss(u,s))}return ve.none()}function Gc(t,e){!function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g=e.dom;if(t){if(qc(t))return d=t,m=(f=g).createRng(),Kc(f,!0,d,m)&&Kc(f,!1,d,m)?ve.some(m):ve.none();if(X(t.start))return ve.some((s=t,c=(u=g).createRng(),l=gs(u.getRoot(),s.start),c.setStart(l.container(),l.offset()),l=gs(u.getRoot(),s.end),c.setEnd(l.container(),l.offset()),c));if(ke(t,"id"))return dn(a=Yc(o=g,"start",i=t),Yc(o,"end",i).or(a),function(e,t){var n=o.createRng();return n.setStart($c(o,e.container()),e.offset()),n.setEnd($c(o,t.container()),t.offset()),n});if(ke(t,"name"))return n=g,ve.from(n.select((r=t).name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(ke(t,"rng"))return ve.some(t.rng)}return ve.none()}(t,e).each(function(e){t.setRng(e)})}function Jc(e){return zn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")}function Qc(e){return""!==e&&-1!==" \f\n\r\t\v".indexOf(e)}function Zc(e){return!Qc(e)&&!uf(e)}function el(e){return e.nodeType}function tl(e,t,n){var r,o=n.startOffset,i=n.startContainer;if((i!==n.endContainer||!(r=i.childNodes[o])||!/^(IMG)$/.test(r.nodeName))&&zn(i)){var a=i.childNodes,u=void 0;o<a.length?(i=a[o],u=new Rr(i,e.getParent(i,e.isBlock))):(i=a[a.length-1],(u=new Rr(i,e.getParent(i,e.isBlock))).next(!0));for(var s=u.current();s;s=u.next())if(jn(s)&&!sf(s))return n.setStart(s,0),t.setRng(n),0}}function nl(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(zn(e)||!sf(e))return e}}function rl(e,t){return el(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]}function ol(e,t,n){return e.schema.isValidChild(t,n)}function il(e,n){return y(e)?e=e(n):V(n)&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e}function al(e,t){return e=""+((e=e||"").nodeName||e),t=""+((t=t||"").nodeName||t),e.toLowerCase()===t.toLowerCase()}function ul(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),""+("fontFamily"===n?t.replace(/[\'\"]/g,"").replace(/,\s+/g,","):t)}function sl(e,t,n){return ul(e,e.getStyle(t,n),n)}function cl(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n}function ll(e,t,n){return e.getParents(t,n,e.getRoot())}function fl(e,t){return F(e.formatter.get(t),function(t){function o(e){return 1<e.length&&"%"===e.charAt(0)}return F(["styles","attributes"],function(e){return ue(t,e).exists(function(e){var n,r;return F(S(e)?e:(n=u,r=[],ne(e,function(e,t){r.push(n(e,t))}),r),o)})})})}function dl(e){return se(e,"block")}function ml(e){return se(e,"selector")}function gl(e){return se(e,"inline")}function pl(e){return ml(e)&&!1!==e.expand&&!gl(e)}function hl(e,t){for(var n=t;n;){if(zn(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t}function vl(e,t,n,r){for(var o=t.data,i=n;e?0<=i:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return-1}function bl(e,t,n){return vl(e,t,n,function(e){return uf(e)||Qc(e)})}function yl(e,t,n){return vl(e,t,n,Zc)}function Cl(i,e,t,n,a,r){function o(e,t,n){var r=_u(i),o=a?r.backwards:r.forwards;return ve.from(o(e,t,function(e,t){return cf(e.parentNode)?-1:n(a,u=e,t)},s))}var u,s=i.getParent(t,i.isBlock)||e;return o(t,n,bl).bind(function(e){return r?o(e.container,e.offset+(a?-1:0),yl):ve.some(e)}).orThunk(function(){return u?ve.some({container:u,offset:a?0:u.length}):ve.none()})}function xl(e,t,n,r,o){jn(r)&&Pe(r.data)&&r[o]&&(r=r[o]);for(var i=lf(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var s=t[u];if((!V(s.collapsed)||s.collapsed===n.collapsed)&&ml(s)&&e.is(i[a],s.selector))return i[a]}return r}function wl(t,e,n,r){var o,i=n,a=t.dom,u=a.getRoot(),s=e[0];if((i=dl(s)?s.wrapper?null:a.getParent(n,s.block,u):i)||(o=a.getParent(n,"LI,TD,TH"),i=a.getParent(jn(n)?n.parentNode:n,function(e){return e!==u&&df(t,e)},o)),!(i=i&&dl(s)&&s.wrapper&&lf(a,i,"ul,ol").reverse()[0]||i))for(i=n;i[r]&&!a.isBlock(i[r])&&!al(i=i[r],"br"););return i||n}function Sl(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",s=e.getRoot();if(jn(n)&&!ff(n)&&(o?0<r:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var c=a[u];c;c=c[u]){var l=jn(c)&&!mf(e,s,c,u);if(!cf(c)&&(!Wn(i=c)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!ff(c,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n}function El(e){return cf(e.parentNode)||cf(e)}function kl(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,s=e.dom,c=n[0];return zn(o)&&o.hasChildNodes()&&(o=Lu(o,i),jn(o)&&(i=0)),zn(a)&&a.hasChildNodes()&&(a=Lu(a,t.collapsed?u:u-1),jn(a)&&(u=a.nodeValue.length)),o=hl(s,o),a=hl(s,a),El(o)&&(o=cf(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,jn(o)&&(i=t.collapsed?o.length:0)),El(a)&&(a=cf(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,jn(a)&&(u=t.collapsed?0:a.length)),t.collapsed&&(Cl(s,e.getBody(),o,i,!0,r).each(function(e){var t=e.container,n=e.offset;o=t,i=n}),Cl(s,e.getBody(),a,u,!1,r).each(function(e){var t=e.container,n=e.offset;a=t,u=n})),(gl(c)||c.block_expand)&&(gl(c)&&jn(o)&&0!==i||(o=Sl(s,n,o,i,!0)),gl(c)&&jn(a)&&u!==a.nodeValue.length||(a=Sl(s,n,a,u,!1))),pl(c)&&(o=xl(s,n,t,o,"previousSibling"),a=xl(s,n,t,a,"nextSibling")),(dl(c)||ml(c))&&(o=wl(e,n,o,"previousSibling"),a=wl(e,n,a,"nextSibling"),dl(c)&&(s.isBlock(o)||(o=Sl(s,n,o,i,!0)),s.isBlock(a)||(a=Sl(s,n,a,u,!1)))),zn(o)&&(i=s.nodeIndex(o),o=o.parentNode),zn(a)&&(u=s.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}}function Nl(n,e,u){function s(e){var t=e[0];jn(t)&&t===i&&o>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===a&&0<e.length&&n===l&&jn(n)&&e.splice(e.length-1,1),e}function c(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r}function t(e,t){return n.getParent(e,function(e){return e.parentNode===t},t)}function r(e,t,n){var r=n?"nextSibling":"previousSibling",o=e;for(o.parentNode;o&&o!==t;o=i){var i=o.parentNode,a=c(o===e?o:o[r],r);a.length&&(n||a.reverse(),u(s(a)))}}var o=e.startOffset,i=Lu(e.startContainer,o),a=e.endOffset,l=Lu(e.endContainer,a-1);if(i===l)return u(s([i]));var f=n.findCommonAncestor(i,l);if(n.isChildOf(i,l))return r(i,f,!0);if(n.isChildOf(l,i))return r(l,f);var d=t(i,f)||i,m=t(l,f)||l;r(i,d,!0);var g=c(d===i?d:d.nextSibling,"nextSibling",m===l?m.nextSibling:m);g.length&&u(s(g)),r(l,m)}function _l(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t}function Al(e,t){var n=bu(t,"td[data-mce-selected],th[data-mce-selected]");return 0<n.length?n:U(H(e,function(e){var t=Pu(e);return t?[kt.fromDom(t)]:[]}),bo)}function Rl(e){return Al(_l(e.selection.getSel()),kt.fromDom(e.getBody()))}function Dl(e,t){return hr(e,"table",t)}function Tl(o,e){return dn((r=e.startContainer,i=e.startOffset,jn(r)?0===i?ve.some(kt.fromDom(r)):ve.none():ve.from(r.childNodes[i]).map(kt.fromDom)),(t=e.endContainer,n=e.endOffset,jn(t)?n===t.data.length?ve.some(kt.fromDom(t)):ve.none():ve.from(t.childNodes[n-1]).map(kt.fromDom)),function(e,t){var n=M(gf(o),R(je,e)),r=M(pf(o),R(je,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i}function Ol(e,t,n,r){var o=n,i=new Rr(n,o),a=ae(e.schema.getMoveCaretBeforeOnEnterElements(),function(e,t){return!T(["td","th","table"],t.toLowerCase())});do{if(jn(n)&&0!==Et.trim(n.nodeValue).length)return r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length),0;if(a[n.nodeName])return r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n),0}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))}function Bl(e){var t=e.selection.getSel();return t&&0<t.rangeCount}function Pl(r,o){var e=Rl(r);0<e.length?Y(e,function(e){var t=e.dom,n=r.dom.createRng();n.setStartBefore(t),n.setEndAfter(t),o(n,!0)}):o(r.selection.getRng(),!1)}function Ll(e,t,n){var r=ws(e,t);n(r),e.moveToBookmark(r)}function Il(e){return hf.get(e)}function Ml(e,t,n,r){var o=t.uid,i=void 0===o?xu("mce-annotation"):o,a=function(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}(t,["uid"]),u=kt.fromTag("span",e);hu(u,qu()),pn(u,""+Wu(),i),pn(u,""+$u(),n);var s,c=r(i,a),l=c.attributes,f=c.classes,d=void 0===f?[]:f;return hn(u,void 0===l?{}:l),s=u,Y(d,function(e){hu(s,e)}),u}function Fl(u,e,t,n,r){function s(){d.clear()}function c(e){Y(e,o)}var l=[],f=Ml(u.getDoc(),r,t,n),d=fu(),o=function(e){var t,n,r,o,i,a;switch(r=u,i="span",a=Nt(o=e),Ot(o).fold(function(){return"skipping"},function(e){return"br"===a||_n(n=o)&&Il(n)===wo?"valid":Nn(t=o)&&vu(t,qu())?"existing":jc(o.dom)?"caret":ol(r,i,a)&&ol(r,Nt(e),i)?"valid":"invalid-child";var t,n})){case"invalid-child":s(),c(Dn(e)),s();break;case"valid":qt(t=e,n=d.get().getOrThunk(function(){var e=Eu(f);return l.push(e),d.set(e),e})),Pn(n,t)}};return Nl(u.dom,e,function(e){s(),c(A(e,kt.fromDom))}),l}function Ul(o){var n,e,r,i=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return ue(n,e).map(function(e){return e.settings})}});r=i,(e=o).on("init",function(){e.serializer.addNodeFilter("span",function(e){Y(e,function(t){ve.from(t.attr($u())).bind(r.lookup).each(function(e){!1===e.persistent&&t.unwrap()})})})});var a=Cu(o);return{register:function(e,t){i.register(e,t)},annotate:function(t,n){i.lookup(t).each(function(e){var u,s,c,l;s=t,c=e,l=n,(u=o).undoManager.transact(function(){var e,t,n,r,o=u.selection,i=o.getRng(),a=0<Rl(u).length;i.collapsed&&!a&&(n=kl(e=u,t=i,[{inline:"span"}]),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)),o.getRng().collapsed&&!a?(wu(r=Ml(u.getDoc(),l,s,c.decorate),xo),o.getRng().insertNode(r.dom),o.select(r.dom)):Ll(o,!1,function(){Pl(u,function(e){Fl(u,e,s,c.decorate,l)})})})})},annotationChanged:function(e,t){a.addListener(e,t)},remove:function(e){yu(o,ve.some(e)).each(function(e){Y(e.elements,Yt)})},getAll:function(e){var t,n,r;return re((t=e,n=bu(kt.fromDom(o.getBody()),"["+$u()+'="'+t+'"]'),r={},Y(n,function(e){var t=vn(e,Wu()),n=ue(r,t).getOr([]);r[t]=n.concat([e])}),r),function(e){return A(e,function(e){return e.dom})})}}}function zl(e){return{getBookmark:R(af,e),moveToBookmark:R(Gc,e)}}(sc=uc=uc||{})[sc.Backwards=-1]="Backwards",sc[sc.Forwards=1]="Forwards";function Hl(e){return Po(e)||!!Mo(t=e)&&!0!==L(xe(t.getElementsByTagName("*")),function(e,t){return e||Ro(t)},!1);var t}var jl,Vl,ql,$l=Yn,Wl=jn,Kl=zn,Xl=Wn,Yl=jr,Gl=Vr,Jl=function(e,t,n){var r,o,i;if(!Kl(n)||!t)return null;if(t.isEqual(ss.after(n))&&n.lastChild){if(i=ss.after(n.lastChild),e<0&&Yl(n.lastChild)&&Kl(n.lastChild))return Xl(n.lastChild)?ss.before(n.lastChild):i}else i=t;var a,u,s,c=i.container(),l=i.offset();if(Wl(c)){if(e<0&&0<l)return ss(c,--l);if(0<e&&l<c.length)return ss(c,++l);r=c}else{if(e<0&&0<l&&(f=Pc(c,l-1),Yl(f)))return!Hl(f)&&(o=Ys(f,e,Gl,f))?Wl(o)?ss(o,o.data.length):ss.after(o):Wl(f)?ss(f,f.data.length):ss.before(f);if(0<e&&l<c.childNodes.length&&(f=Pc(c,l),Yl(f)))return Xl(f)?(a=n,(s=(u=f).nextSibling)&&Yl(s)?Wl(s)?ss(s,0):ss.before(s):Jl(uc.Forwards,ss.after(u),a)):!Hl(f)&&(o=Ys(f,e,Gl,f))?Wl(o)?ss(o,0):ss.before(o):Wl(f)?ss(f,0):ss.after(f);r=f||i.getNode()}if((0<e&&i.isAtEnd()||e<0&&i.isAtStart())&&(r=Ys(r,e,w,n,!0),Gl(r,n)))return Lc(e,r);var f=Ys(r,e,Gl,n),d=pe(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(c,n),$l));return!d||f&&d.contains(f)?f?Lc(e,f):null:0<e?ss.after(d):ss.before(d)},Ql=function(e,t,n){var r=Ic(t);return ve.from(e?r.next(n):r.prev(n))},Zl=function(t,n,e,r){return zc(t,n,e).bind(function(e){return r(e)?Zl(t,n,e,r):ve.some(e)})},ef=R(Ql,!0),tf=R(Ql,!1),nf=R(Hc,!0),rf=R(Hc,!1),of="_mce_caret",af=function(e,t,n){return 2===t?Cs(Eo,n,e):3===t?(o=(r=e).getRng(),{start:ms(r.dom.getRoot(),ss.fromRangeStart(o)),end:ms(r.dom.getRoot(),ss.fromRangeEnd(o))}):t?{rng:e.getRng()}:ws(e,!1);var r,o},uf=(jl=xo,function(e){return jl===e}),sf=function(e,t){return void 0===t&&(t=!1),!(!V(e)||!jn(e))&&qr(t?e.data.replace(/ /g,"\xa0"):e.data)},cf=Jc,lf=ll,ff=sf,df=rl,mf=function(e,t,n,r){var o=n.parentNode;return!V(n[r])&&(!(o!==t&&!K(o)&&!e.isBlock(o))||mf(e,t,o,r))},gf=function(t){return Ft(t).fold(J([t]),function(e){return[t].concat(gf(e))})},pf=function(t){return Ut(t).fold(J([t]),function(e){return"br"===Nt(e)?Bt(e).map(function(e){return[t].concat(pf(e))}).getOr([]):[t].concat(pf(e))})},hf=(Vl=_n,{get:function(e){if(!Vl(e))throw new Error("Can only get text value of a text node");return ql(e).getOr("")},getOption:ql=function(e){return Vl(e)?ve.from(e.dom.nodeValue):ve.none()},set:function(e,t){if(!Vl(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=t}});function vf(e,t){for(;t&&t!==e;){if(Xn(t)||Yn(t))return t;t=t.parentNode}return null}function bf(t,n,e){if(!e.collapsed){if(xt.browser.isIE()&&e.startOffset===e.endOffset-1&&e.startContainer===e.endContainer){var r=e.startContainer.childNodes[e.startOffset];if(zn(r))return F(r.getClientRects(),function(e){return Bu(e,t,n)})}return F(e.getClientRects(),function(e){return Bu(e,t,n)})}}function yf(e,t,n){return e.fire(t,n)}function Cf(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})}function xf(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})}function wf(r,l){function c(e){return e&&("IMG"===e.nodeName||l.dom.is(e,"figure.image"))}function f(e){return Jn(e)||T.hasClass(e,"mce-preview-object")}function n(e){var t=e.target;!function(e,t){if("longpress"!==e.type&&0!==e.type.indexOf("touch"))return c(e.target)&&!bf(e.clientX,e.clientY,t);var n=e.touches[0];return c(e.target)&&!bf(n.clientX,n.clientY,t)}(e,l.selection.getRng())||e.isDefaultPrevented()||l.selection.select(t)}function d(e){return T.is(e,"figure.image")?[e.querySelector("img")]:T.hasClass(e,"mce-preview-object")&&V(e.firstElementChild)?[e,e.firstElementChild]:[e]}function i(e){var t=Bs(l);return!!t&&"false"!==e.getAttribute("data-mce-resize")&&e!==l.getBody()&&(T.hasClass(e,"mce-preview-object")?ze(kt.fromDom(e.firstElementChild),t):ze(kt.fromDom(e),t))}function a(e,t,n){V(n)&&Y(d(e),function(e){e.style[t]||!l.schema.isValid(e.nodeName.toLowerCase(),t)?T.setStyle(e,t,n):T.setAttrib(e,t,""+n)})}function m(e,t,n){a(e,"width",t),a(e,"height",n)}function g(e){var t,n,r,o,i,a,u=e.screenX-C,s=e.screenY-x;N=u*b[2]+w,_=s*b[3]+S,N=N<5?5:N,_=_<5?5:_,((c(p)||f(p))&&!1!==l.getParam("resize_img_proportional",!0,"boolean")?!Lf.modifierPressed(e):Lf.modifierPressed(e))&&(L(u)>L(s)?(_=I(N*E),N=I(_/E)):(N=I(_/E),_=I(N*E))),m(h,N,_),t=b.startPos.x+u,n=b.startPos.y+s,T.setStyles(v,{left:t=0<t?t:0,top:n=0<n?n:0,display:"block"}),v.innerHTML=N+" &times; "+_,b[2]<0&&h.clientWidth<=N&&T.setStyle(h,"left",void 0+(w-N)),b[3]<0&&h.clientHeight<=_&&T.setStyle(h,"top",void 0+(S-_)),(u=M.scrollWidth-A)+(s=M.scrollHeight-R)!=0&&T.setStyles(v,{left:t-u,top:n-s}),k||(r=p,o=w,i=S,a="corner-"+b.name,l.fire("ObjectResizeStart",{target:r,width:o,height:i,origin:a}),k=!0)}function o(e){function t(e,t){if(e)do{if(e===t)return 1}while(e=e.parentNode)}var n;k||l.removed||(O(T.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute(D)}),n="mousedown"===e.type?e.target:r.getNode(),t(n=T.$(n).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],M)&&(s(),t(r.getStart(!0),n)&&t(r.getEnd(!0),n))?z(n):H())}function u(e){return If(vf(l.getBody(),e))}function s(){try{l.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}}var p,h,v,b,y,C,x,w,S,E,k,N,_,A,R,D="data-mce-selected",T=l.dom,O=Et.each,B=l.getDoc(),P=document,L=Math.abs,I=Math.round,M=l.getBody(),F={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},U=function(){var e,t,n,r,o=k;k=!1,o&&(a(p,"width",N),a(p,"height",_)),T.unbind(B,"mousemove",g),T.unbind(B,"mouseup",U),P!==B&&(T.unbind(P,"mousemove",g),T.unbind(P,"mouseup",U)),T.remove(h),T.remove(v),T.remove(y),z(p),o&&(e=p,t=N,n=_,r="corner-"+b.name,l.fire("ObjectResized",{target:e,width:t,height:n,origin:r}),T.setAttrib(p,"style",T.getAttrib(p,"style"))),l.nodeChanged()},z=function(e){j();var t=T.getPos(e,M),a=t.x,u=t.y,n=e.getBoundingClientRect(),s=n.width||n.right-n.left,c=n.height||n.bottom-n.top;p!==e&&(H(),p=e,N=_=0);var r=l.fire("ObjectSelected",{target:e}),o=T.getAttrib(p,D,"1");i(e)&&!r.isDefaultPrevented()?O(F,function(o,i){var e=T.get("mceResizeHandle"+i);e&&T.remove(e),e=T.add(M,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),11===xt.ie&&(e.contentEditable=!1),T.bind(e,"mousedown",function(e){var t,n,r;e.stopImmediatePropagation(),e.preventDefault(),t=e,r=d(p)[0],C=t.screenX,x=t.screenY,w=r.clientWidth,S=r.clientHeight,E=S/w,(b=o).name=i,b.startPos={x:s*o[0]+a,y:c*o[1]+u},A=M.scrollWidth,R=M.scrollHeight,y=T.add(M,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),T.setStyles(y,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),h=f(n=p)?T.create("img",{src:xt.transparentSrc}):n.cloneNode(!0),T.addClass(h,"mce-clonedresizable"),T.setAttrib(h,"data-mce-bogus","all"),h.contentEditable="false",T.setStyles(h,{left:a,top:u,margin:0}),m(h,s,c),h.removeAttribute(D),M.appendChild(h),T.bind(B,"mousemove",g),T.bind(B,"mouseup",U),P!==B&&(T.bind(P,"mousemove",g),T.bind(P,"mouseup",U)),v=T.add(M,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},w+" &times; "+S)}),o.elm=e,T.setStyles(e,{left:s*o[0]+a-e.offsetWidth/2,top:c*o[1]+u-e.offsetHeight/2})}):H(),T.getAttrib(p,D)||p.setAttribute(D,o)},H=function(){j(),p&&p.removeAttribute(D),ne(F,function(e,t){var n=T.get("mceResizeHandle"+t);n&&(T.unbind(n),T.remove(n))})},j=function(){ne(F,function(e){e.elm&&(T.unbind(e.elm),delete e.elm)})};return l.on("init",function(){var e;s(),(xt.browser.isIE()||xt.browser.isEdge())&&(l.on("mousedown click",function(e){var t=e.target,n=t.nodeName;k||!/^(TABLE|IMG|HR)$/.test(n)||u(t)||(2!==e.button&&l.selection.select(t,"TABLE"===n),"mousedown"===e.type&&l.nodeChanged())}),T.bind(M,"mscontrolselect",e=function(e){function t(e){_r.setEditorTimeout(l,function(){return l.selection.select(e)})}if(u(e.target)||Jn(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}),l.on("remove",function(){return T.unbind(M,"mscontrolselect",e)}));var t=_r.throttle(function(e){l.composing||o(e)});l.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",t),l.on("keyup compositionend",function(e){p&&"TABLE"===p.nodeName&&t(e)}),l.on("hide blur",H),l.on("contextmenu longpress",n,!0)}),l.on("remove",j),{isResizable:i,showResizeRect:z,hideResizeRect:H,updateResizeRect:o,destroy:function(){p=h=y=null}}}function Sf(e){return Xn(e)||Yn(e)}function Ef(t,n,r){var o,e,i,a,u,s=r;if(s.caretPositionFromPoint)(e=s.caretPositionFromPoint(t,n))&&((o=r.createRange()).setStart(e.offsetNode,e.offset),o.collapse(!0));else if(s.caretRangeFromPoint)o=s.caretRangeFromPoint(t,n);else if(s.body.createTextRange){o=s.body.createTextRange();try{o.moveToPoint(t,n),o.collapse(!0)}catch(e){o=function(e,n,t){var r,o=t.elementFromPoint(e,n),i=t.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=t.body),i.moveToElementText(o),0<(r=(r=Et.toArray(i.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-Math.abs(Math.max(t.top-n,t.bottom-n))})).length){n=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,n),i.collapse(!0),i}catch(e){}}return null}(t,n,r)}return i=o,a=r.body,u=i&&i.parentElement?i.parentElement():null,Yn(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Sf))?null:i}return o}function kf(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function Nf(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)}function _f(e){return e&&"TABLE"===e.nodeName}function Af(e,t,n){for(var r=new Rr(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Wn(t))return 1}function Rf(e,t,n,r,o){var i,a,u=e.getRoot(),s=e.schema.getNonEmptyElements(),c=e.getParent(o.parentNode,e.isBlock)||u;if(r&&Wn(o)&&t&&e.isEmpty(c))return ve.some(ss(o.parentNode,e.nodeIndex(o)));for(var l,f,d=new Rr(o,c);a=d[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||(f=u,Ir(l=a)&&!1===Nf(l,f,jc)))return ve.none();if(jn(a)&&0<a.nodeValue.length)return!1===Nf(a,u,function(e){return"A"===e.nodeName})?ve.some(ss(a,r?a.nodeValue.length:0)):ve.none();if(e.isBlock(a)||s[a.nodeName.toLowerCase()])return ve.none();i=a}return n&&i?ve.some(ss(i,0)):ve.none()}function Df(e,t,n,r){var o,i=e.getRoot(),a=!1,u=r[(n?"start":"end")+"Container"],s=r[(n?"start":"end")+"Offset"],c=zn(u)&&s===u.childNodes.length,l=e.schema.getNonEmptyElements(),f=n;if(Ir(u))return ve.none();if(zn(u)&&s>u.childNodes.length-1&&(f=!1),qn(u)&&(u=i,s=0),u===i){if(f&&(d=u.childNodes[0<s?s-1:0])){if(Ir(d))return ve.none();if(l[d.nodeName]||_f(d))return ve.none()}if(u.hasChildNodes()){if(s=Math.min(!f&&0<s?s-1:s,u.childNodes.length-1),u=u.childNodes[s],s=jn(u)&&c?u.data.length:0,!t&&u===i.lastChild&&_f(u))return ve.none();if(function(e,t){for(;t&&t!==e;){if(Yn(t))return 1;t=t.parentNode}}(i,u)||Ir(u))return ve.none();if(u.hasChildNodes()&&!1===_f(u)){var d=u,m=new Rr(u,i);do{if(Yn(d)||Ir(d)){a=!1;break}if(jn(d)&&0<d.nodeValue.length){s=f?0:d.nodeValue.length,u=d,a=!0;break}if(l[d.nodeName.toLowerCase()]&&(!(o=d)||!/^(TD|TH|CAPTION)$/.test(o.nodeName))){s=e.nodeIndex(d),u=d.parentNode,f||s++,a=!0;break}}while(d=f?m.next():m.prev())}}}return t&&(jn(u)&&0===s&&Rf(e,c,t,!0,u).each(function(e){u=e.container(),s=e.offset(),a=!0}),zn(u)&&(!(d=(d=u.childNodes[s])||u.childNodes[s-1])||!Wn(d)||d.previousSibling&&"A"===d.previousSibling.nodeName||Af(e,d,!1)||Af(e,d,!0)||Rf(e,c,t,!0,d).each(function(e){u=e.container(),s=e.offset(),a=!0}))),f&&!t&&jn(u)&&s===u.nodeValue.length&&Rf(e,c,t,!1,u).each(function(e){u=e.container(),s=e.offset(),a=!0}),a?ve.some(ss(u,s)):ve.none()}function Tf(e,t){var n=t.collapsed,r=t.cloneRange(),o=ss.fromRangeStart(t);return Df(e,n,!0,r).each(function(e){n&&ss.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Df(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),kf(t,r)?ve.none():ve.some(r)}function Of(e,t){return e.splitText(t)}function Bf(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&jn(t)?0<n&&n<t.nodeValue.length&&(t=(r=Of(t,n)).previousSibling,n<o?(t=r=Of(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(jn(t)&&0<n&&n<t.nodeValue.length&&(t=Of(t,n),n=0),jn(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Of(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}}function Pf(n){return{walk:function(e,t){return Nl(n,e,t)},split:Bf,normalize:function(t){return Tf(n,t).fold(D,function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}zl.isBookmarkNode=Jc;var Lf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||Lf.metaKeyPressed(e)},metaKeyPressed:function(e){return xt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},If=Yn;Pf.compareRanges=kf,Pf.getCaretRangeFromPoint=Ef,Pf.getSelectedNode=Pu,Pf.getNode=Lu;var Mf,Ff,Uf=(Mf="height",Ff=function(e){var t=e.dom;return In(e)?t.getBoundingClientRect().height:t.offsetHeight},{set:function(e,t){if(!E(t)&&!t.match(/^[0-9]+$/))throw new Error(Mf+".set accepts only positive integer values. Value was "+t);var n=e.dom;mn(n)&&(n.style[Mf]=t+"px")},get:zf,getOuter:zf,aggregate:Hf,max:function(e,t,n){var r=Hf(e,n);return r<t?t-r:0}});function zf(e){var t=Ff(e);if(t<=0||null===t){var n=xn(e,Mf);return parseFloat(n)||0}return t}function Hf(o,e){return L(e,function(e,t){var n=xn(o,t),r=void 0===n?0:parseInt(n,10);return isNaN(r)?e:e+r},0)}function jf(e){return"textarea"===Nt(e)}function Vf(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return Fn(n.offsetLeft,n.offsetTop);var i=Gt(null==r?void 0:r.pageYOffset,o.scrollTop),a=Gt(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Gt(o.clientTop,n.clientTop),s=Gt(o.clientLeft,n.clientLeft);return Un(e).translate(a-s,i-u)}(e),r=Uf.get(e);return{element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}}function qf(n,r,o,i){Td(n,function(e,t){return Dd(n,r,o,i)},o)}function $f(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Jt(t).top,r,o),e.fire("AfterScrollIntoView",i))}function Wf(e,t,n,r){var o=kt.fromDom(e.getDoc());$f(e,o,n,Vf(kt.fromDom(t),te),r)}function Kf(e,t,n,r){var o,i=e.pos;n?Qt(i.left,i.top,r):(o=i.top-t+e.height,Qt(i.left,o,r))}function Xf(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,s=n<=u-a;a<t?Kf(r,n,!1!==o,e):i<a?Kf(r,n,s?!1!==o:!0===o,e):i<u&&!s&&Kf(r,n,!0===o,e)}function Yf(e,t,n,r){Xf(e,t,e.dom.defaultView.innerHeight,n,r)}function Gf(e,t,n,r){Xf(e,t,e.dom.defaultView.innerHeight,n,r);var o,i,a,u,s,c,l,f=(o=n.element,u=Jt(kt.fromDom(document)),a=(i=Rd).owner(o),s=Ad(i,a),c=Un(o),l=P(s,function(e,t){var n=Un(t);return{left:e.left+n.left,top:e.top+n.top}},{left:0,top:0}),Fn(l.left+c.left+u.left,l.top+c.top+u.top)),d=tn(window);f.top<d.y?Zt(n.element,!1!==r):f.top>d.bottom&&Zt(n.element,!0===r)}function Jf(e,t,n){return qf(e,Yf,t,n)}function Qf(e,t,n){return Wf(e,t,Yf,n)}function Zf(e,t,n){return qf(e,Gf,t,n)}function ed(e,t,n){return Wf(e,t,Gf,n)}function td(e,t,n){(e.inline?Jf:Zf)(e,t,n)}function nd(e){var t=Bn(e).dom;return e.dom===t.activeElement}function rd(e){return void 0===e&&(e=kt.fromDom(document)),ve.from(e.dom.activeElement).map(kt.fromDom)}function od(e,t){var n=_n(t)?Il(t).length:Dn(t).length+1;return n<e?n:e<0?0:e}function id(e){return Ld.range(e.start,od(e.soffset,e.start),e.finish,od(e.foffset,e.finish))}function ad(e,t){return!rn(t.dom)&&(Ve(e,t)||je(e,t))}function ud(t){return function(e){return ad(t,e.start)&&ad(t,e.finish)}}function sd(e){return!0===e.inline||Id.isIE()}function cd(e){return Ld.range(kt.fromDom(e.startContainer),e.startOffset,kt.fromDom(e.endContainer),e.endOffset)}function ld(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),ve.some(t)}catch(e){return ve.none()}}function fd(e){var t,n,r=sd(e)?(t=kt.fromDom(e.getBody()),((n=Tt(t).dom.getSelection())&&0!==n.rangeCount?ve.from(n.getRangeAt(0)):ve.none()).map(cd).filter(ud(t))):ve.none();e.bookmark=r.isSome()?r:e.bookmark}function dd(n){return(n.bookmark||ve.none()).bind(function(e){return t=kt.fromDom(n.getBody()),ve.from(e).filter(ud(t)).map(id);var t}).bind(ld)}function md(u){var s=du(function(){fd(u)},0);u.on("init",function(){function e(){n.throttle()}var t,n,r,o,i,a;u.inline&&(t=u,n=s,Za.DOM.bind(document,"mouseup",e),t.on("remove",function(){Za.DOM.unbind(document,"mouseup",e)})),r=u,o=s,dt().browser.isIE()?(a=r).on("focusout",function(){fd(a)}):(i=o,r.on("mouseup touchend",function(e){i.throttle()})),r.on("keyup NodeChange",function(e){"nodechange"===e.type&&e.selectionChange||fd(r)})}),u.on("remove",function(){s.cancel()})}function gd(t,e){var n=t.getParam("custom_ui_selector","","string");return null!==Fd.getParent(e,function(e){return Md.isEditorUIElement(e)||!!n&&t.dom.is(e,n)})}function pd(n,e){var t=e.editor;md(t),t.on("focusin",function(){var e=n.focusedEditor;e!==t&&(e&&e.fire("blur",{focusedEditor:t}),n.setActive(t),(n.focusedEditor=t).fire("focus",{blurredEditor:e}),t.focus(!0))}),t.on("focusout",function(){_r.setEditorTimeout(t,function(){var e=n.focusedEditor;gd(t,function(e){try{return rd(Bn(kt.fromDom(e.getElement()))).fold(function(){return document.body},function(e){return e.dom})}catch(e){return document.body}}(t))||e!==t||(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null)})}),_d||(_d=function(e){var t=n.activeEditor;t&&!function(e){if(On()&&V(e.target)){var t=kt.fromDom(e.target);if(Nn(t)&&V(t.dom.shadowRoot)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return Q(n)}}return ve.from(e.target)}(e).each(function(e){e.ownerDocument===document&&(e===document.body||gd(t,e)||n.focusedEditor!==t||(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null))})},Fd.bind(document,"focusin",_d))}function hd(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Fd.unbind(document,"focusin",_d),_d=null)}function vd(t,e){var n,r;n=kt.fromDom(t.getBody()),((r=e).collapsed?ve.from(Lu(r.startContainer,r.startOffset)).map(kt.fromDom):ve.none()).bind(function(e){return vo(e)?ve.some(e):!1===Ve(n,e)?ve.some(n):ve.none()}).bind(function(e){return nf(e.dom)}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})}function bd(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()}function yd(e){return e.inline?(r=e.getBody())&&(nd(t=kt.fromDom(r))||rd(Bn(n=t)).filter(function(e){return n.dom.contains(e.dom)}).isSome()):e.iframeElement&&nd(kt.fromDom(e.iframeElement));var t,n,r}function Cd(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return ve.from(i).map(kt.fromDom).map(function(e){return r&&t.collapsed?e:Mt(e,o(e,a)).getOr(e)}).bind(function(e){return Nn(e)?ve.some(e):Ot(e).filter(Nn)}).map(function(e){return e.dom}).getOr(e)}function xd(e,t,n){return Cd(e,t,!0,n,function(e,t){return Math.min(zt(e),t)})}function wd(e,t,n){return Cd(e,t,!1,n,function(e,t){return 0<t?t-1:t})}function Sd(e,t){for(var n=e;e&&jn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}function Ed(n,e){return A(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})}function kd(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}}function Nd(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t}var _d,Ad=function(r,e){return r.view(e).fold(J([]),function(e){var t=r.owner(e),n=Ad(r,t);return[e].concat(n)})},Rd=Object.freeze({__proto__:null,view:function(e){var t;return(e.dom===document?ve.none():ve.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(kt.fromDom)},owner:Dt}),Dd=function(e,t,n,r){var o=kt.fromDom(e.getBody()),i=kt.fromDom(e.getDoc());o.dom.offsetWidth;var a,u,s,c,l=(a=kt.fromDom(n.startContainer),u=n.startOffset,s=function(e,t){var n=Dn(e);if(0===n.length||jf(e))return{element:e,offset:t};if(t<n.length&&!jf(n[t]))return{element:n[t],offset:0};var r=n[n.length-1];return jf(r)?{element:e,offset:t}:"img"===Nt(r)?{element:r,offset:1}:_n(r)?{element:r,offset:Il(r).length}:{element:r,offset:Dn(r).length}}(a,u),c=kt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>'),qt(s.element,c),Vf(c,function(){return Ln(c)}));$f(e,i,t,l,r),l.cleanup()},Td=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(kt.fromDom(r),kt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Od=or([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bd=(Od.before,Od.on,Od.after,function(e){return e.fold(u,u,u)}),Pd=or([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ld={domRange:Pd.domRange,relative:Pd.relative,exact:Pd.exact,exactFromRange:function(e){return Pd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){return Tt(e.match({domRange:function(e){return kt.fromDom(e.startContainer)},relative:function(e,t){return Bd(e)},exact:function(e,t,n,r){return e}}))},range:function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}}},Id=dt().browser,Md={isEditorUIElement:function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Fd=Za.DOM,Ud=function(e){return e.editorManager.setActive(e)},zd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Hd=(jd.create=function(e,t){var n=new jd(e,zd[e]||1);return t&&ne(t,function(e,t){n.attr(t,e)}),n},jd.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},jd.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&ne(e,function(e,t){r.attr(t,e)}),r;if(n=r.attributes){if(void 0===t)return n.map[e];if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}},jd.prototype.clone=function(){var e,t=new jd(this.name,this.type);if(e=this.attributes){var n=[];n.map={};for(var r=0,o=e.length;r<o;r++){var i=e[r];"id"!==i.name&&(n[n.length]={name:i.name,value:i.value},n.map[i.name]=i.value)}t.attributes=n}return t.value=this.value,t.shortEnded=this.shortEnded,t},jd.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},jd.prototype.unwrap=function(){for(var e=this.firstChild;e;){var t=e.next;this.insert(e,this,!0),e=t}this.remove()},jd.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},jd.prototype.append=function(e){e.parent&&e.remove();var t=this.lastChild;return t?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},jd.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},jd.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=kd(n,this))n.name===e&&t.push(n);return t},jd.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},jd.prototype.empty=function(){if(this.firstChild){for(var e=[],t=this.firstChild;t;t=kd(t,this))e.push(t);for(var n=e.length;n--;)(t=e[n]).parent=t.firstChild=t.lastChild=t.next=t.prev=null}return this.firstChild=this.lastChild=null,this},jd.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this.firstChild;if(Nd(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(e[r.name])return!1;if(Nd(r))return!1}if(8===r.type)return!1;if(3===r.type&&!function(e){if(qr(e.value)){var t=e.parent;return!t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)}}(r))return!1;if(3===r.type&&r.parent&&t[r.parent.name]&&qr(r.value))return!1;if(n&&n(r))return!1}while(r=kd(r,this));return!0},jd.prototype.walk=function(e){return kd(this,null,e)},jd);function jd(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}function Vd(e,t){return e.replace(t.re,function(e){return ue(t.uris,e).getOr(e)})}var qd=Et.each,$d=Et.trim,Wd="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Kd={ftp:21,http:80,https:443,mailto:25},Xd=["img","video"],Yd=(Gd.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}},Gd.isDomSafe=function(e,t,n){if((n=void 0===n?{}:n).allow_script_urls)return!0;var r,o,i,a,u=Qo.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{u=decodeURIComponent(u)}catch(e){u=unescape(u)}return!(/((java|vb)script|mhtml):/i.test(u)||(o=u,i=t,!(r=n).allow_html_data_urls&&(/^data:image\//i.test(o)?(V(a=r.allow_svg_data_urls)?!a:!V(i)||!T(Xd,i))&&/^data:image\/svg\+xml/i.test(o):/^data:/i.test(o))))},Gd.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},Gd.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},Gd.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new Gd(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},Gd.prototype.toAbsolute=function(e,t){var n=new Gd(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},Gd.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Kd[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},Gd.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},Gd.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),s=t.split("/");for(qd(u,function(e){e&&i.push(e)}),u=i,n=s.length-1,i=[];0<=n;n--)0!==s[n].length&&"."!==s[n]&&(".."!==s[n]?0<o?o--:i.push(s[n]):o++);return 0!==(r=(n=u.length-o)<=0?q(i).join("/"):u.slice(0,n).join("/")+"/"+q(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},Gd.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},Gd);function Gd(e,t){e=$d(e),this.settings=t||{};var n,r,o,i,a=this.settings.base_uri,u=this;/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?u.source=e:(n=0===e.indexOf("//"),0!==e.indexOf("/")||n||(e=(a&&a.protocol||"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(r=this.settings.base_uri?this.settings.base_uri.path:new Gd(document.location.href).directory,e=this.settings.base_uri&&""==this.settings.base_uri.protocol?"//mce_host"+u.toAbsPath(r,e):(o=/([^#?]*)([#?]?.*)/.exec(e),(a&&a.protocol||"http")+"://mce_host"+u.toAbsPath(r,o[1])+o[2])),e=e.replace(/@@/g,"(mce_at)"),i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),qd(Wd,function(e,t){var n=(n=i[t])&&n.replace(/\(mce_at\)/g,"@@");u[e]=n}),a&&(u.protocol||(u.protocol=a.protocol),u.userInfo||(u.userInfo=a.userInfo),u.port||"mce_host"!==u.host||(u.port=a.port),u.host&&"mce_host"!==u.host||(u.host=a.host),u.source=""),n&&(u.protocol=""))}function Jd(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var s=r.exec(t);if(null===s)return u;if("!"===s[1]){u=Ge(s[2],"--")?tm(t,!1,s.index+"!--".length):tm(t,!0,s.index+1);break}o.lastIndex=r.lastIndex;var c=o.exec(t);if(!l(c)&&c.index===r.lastIndex){"/"===s[1]?--a:ke(i,s[2])||(a+=1),u=r.lastIndex+c[0].length;break}}return u}function Qd(q,$){void 0===$&&($=ro()),q=q||{};var W=em(),K=W.createElement("form");function n(s,e){void 0===e&&(e="html");for(var t,i,n,c,r,o,a,l,u,f,d,m,g,p,h,v,b,y,C,x=s.html,w=0,S=[],E=0,k=Qo.decode,N=Et.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),_="html"===e?0:1,A=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},R=function(e,t){return G(Vd(e,s),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),q.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(Vd(e,s)))},T=function(e,t){var n=e||"",r=!Ge(n,"--"),o=tm(x,r,t);return e=x.substr(t,o-t),D(r?n+e:e),o+1},O=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),B=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,P=$.getShortEndedElements(),L=q.self_closing_elements||$.getSelfClosingElements(),I=$.getBoolAttrs(),M=q.validate,F=q.remove_internals,U=q.fix_self_closing,z=$.getSpecialElements(),H=x+">";t=O.exec(H);){var j=t[0];if(w<t.index&&R(k(x.substr(w,t.index-w))),i=t[7])A(i=":"===(i=i.toLowerCase()).charAt(0)?i.substr(1):i);else if(i=t[8]){if(t.index+j.length>x.length){R(k(x.substr(t.index))),w=t.index+j.length;continue}u=(i=":"===(i=i.toLowerCase()).charAt(0)?i.substr(1):i)in P,U&&L[i]&&0<S.length&&S[S.length-1].name===i&&A(i);var V=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null}(B,t[9]);if(null!==V){if("all"===V){w=Jd($,x,O.lastIndex),O.lastIndex=w;continue}d=!1}if(!M||(f=$.getElementRule(i))){if(d=!0,M&&(p=f.attributes,h=f.attributePatterns),(g=t[9])?((l=-1!==g.indexOf("data-mce-type"))&&F&&(d=!1),(c=[]).map={},g.replace(B,function(e,t,n,r,o){return function(e,t,n,r,o){var i;if(n=Vd((t=t.toLowerCase())in I?t:k(n||r||o||""),s),M&&!l&&0==(0===(i=t).indexOf("data-")||0===i.indexOf("aria-"))){var a=p[t];if(!a&&h){for(var u=h.length;u--&&!(a=h[u]).pattern.test(t););-1===u&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}("name"===t||"id"===t)&&e in Zd&&(n in W||n in K)||N[t]&&!Yd.isDomSafe(n,e,q)||l&&(t in N||0===t.indexOf("on"))||(c.map[t]=n,c.push({name:t,value:n}))}(i,t,n,r,o),""})):(c=[]).map={},M&&!l){if(v=f.attributesRequired,b=f.attributesDefault,y=f.attributesForced,f.removeEmptyAttrs&&!c.length&&(d=!1),y)for(r=y.length;r--;)a=(m=y[r]).name,"{$uid}"===(C=m.value)&&(C="mce_"+E++),c.map[a]=C,c.push({name:a,value:C});if(b)for(r=b.length;r--;)(a=(m=b[r]).name)in c.map||("{$uid}"===(C=m.value)&&(C="mce_"+E++),c.map[a]=C,c.push({name:a,value:C}));if(v){for(r=v.length;r--&&!(v[r]in c.map););-1===r&&(d=!1)}if(m=c.map["data-mce-bogus"]){if("all"===m){w=Jd($,x,O.lastIndex),O.lastIndex=w;continue}d=!1}}d&&J(i,c,u)}else d=!1;if(n=z[i]){n.lastIndex=w=t.index+j.length,w=(t=n.exec(x))?(d&&(o=x.substr(w,t.index-w)),t.index+t[0].length):(o=x.substr(w),x.length),d&&(0<o.length&&R(o,!0),Q(i)),O.lastIndex=w;continue}u||(g&&g.indexOf("/")===g.length-1?d&&Q(i):S.push({name:i,valid:d}))}else if(i=t[1])D(i);else if(i=t[2]){if(!(1==_||q.preserve_cdata||0<S.length&&$.isValidChild(S[S.length-1].name,"#cdata"))){w=T("",t.index+2),O.lastIndex=w;continue}Y(i)}else if(i=t[3])ee(i);else{if((i=t[4])||"<!"===j){w=T(i,t.index+j.length),O.lastIndex=w;continue}if(i=t[5]){if(1!=_){w=T("?",t.index+2),O.lastIndex=w;continue}Z(i,t[6])}}w=t.index+j.length}for(w<x.length&&R(k(x.substr(w))),r=S.length-1;0<=r;r--)(i=S[r]).valid&&Q(i.name)}!1!==q.fix_self_closing&&(q.fix_self_closing=!0);var X=q.comment||te,Y=q.cdata||te,G=q.text||te,J=q.start||te,Q=q.end||te,Z=q.pi||te,ee=q.doctype||te;return{parse:function(e,t){void 0===t&&(t="html"),n(function(e){for(var t,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=xu("img"),a=0,u=0;t=n.exec(e);){var s=t[0],c=i+"_"+u++;o[c]=s,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(c),a=t.index+s.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:l}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(e),t)}}}var Zd=Et.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),em=Re(function(){return document.implementation.createHTMLDocument("parser")}),tm=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length};function nm(e,t){for(var n,r,o,i,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,u=e.schema,s=(n=e.getTempAttrs(),r=t,o=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi"),r.replace(o,"")),c=u.getShortEndedElements();i=a.exec(s);){var l=a.lastIndex,f=i[0].length,d=c[i[1]]?l:Qd.findEndTag(u,s,l),s=s.substring(0,l-f)+s.substring(d);a.lastIndex=l-f}return Eo(s)}function rm(o){return{compare:function(e,t){return e.nodeName===t.nodeName&&!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||Jc(e)||Jc(t));function n(n){var r={};return um(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r}function r(e,t){var n,r;for(r in e)if(ke(e,r)){if(void 0===(n=t[r]))return;if(e[r]!==n)return;delete t[r]}for(r in t)if(ke(t,r))return;return 1}}}}function om(e){var u=[],s=(e=e||{}).indent,c=sm(e.indent_before||""),l=sm(e.indent_after||""),f=Qo.getEncodeFunc(e.entity_encoding||"raw",e.entities),d="html"===e.element_format;return{start:function(e,t,n){var r,o,i,a;if(s&&c[e]&&0<u.length&&0<(a=u[u.length-1]).length&&"\n"!==a&&u.push("\n"),u.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],u.push(" ",i.name,'="',f(i.value,!0),'"');u[u.length]=!n||d?">":" />",n&&s&&l[e]&&0<u.length&&0<(a=u[u.length-1]).length&&"\n"!==a&&u.push("\n")},end:function(e){var t;u.push("</",e,">"),s&&l[e]&&0<u.length&&0<(t=u[u.length-1]).length&&"\n"!==t&&u.push("\n")},text:function(e,t){0<e.length&&(u[u.length]=t?e:f(e))},cdata:function(e){u.push("<![CDATA[",e,"]]>")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push("<?",e," ",f(t),"?>"):u.push("<?",e,"?>"),s&&u.push("\n")},doctype:function(e){u.push("<!DOCTYPE",e,">",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}}function im(t,g){void 0===g&&(g=ro());var p=om(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f=t.validate,d={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};p.reset();var m=function(e){var t=d[e.type];if(t)t(e);else{var n=e.name,r=e.shortEnded,o=e.attributes;if(f&&o&&1<o.length){var i=[];i.map={};var a=g.getElementRule(e.name);if(a){for(var u=0,s=a.attributesOrder.length;u<s;u++)(c=a.attributesOrder[u])in o.map&&(l=o.map[c],i.map[c]=l,i.push({name:c,value:l}));for(var c,l,u=0,s=o.length;u<s;u++)(c=o[u].name)in i.map||(l=o.map[c],i.map[c]=l,i.push({name:c,value:l}));o=i}}if(p.start(e.name,o,r),!r){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(n)}}};return 1!==e.type||t.inner?d[11](e):m(e),p.getContent()}}}Qd.findEndTag=Jd;var am=nm,um=Et.each,sm=Et.makeMap,cm=new Set;function lm(e,t){return we(e.parseStyle(e.getAttrib(t,"style")))}function fm(n,r,o){return ve.from(o.container()).filter(jn).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})}function dm(e){var t=e.container();return jn(t)&&(0===t.data.length||So(t.data)&&zl.isBookmarkNode(t.parentNode))}function mm(t,n){return function(e){return ve.from(Qs(t?0:-1,e)).filter(n).isSome()}}function gm(e){return Kn(e)&&"block"===xn(kt.fromDom(e),"display")}function pm(e){return Yn(e)&&!(zn(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t}function hm(e){Xt(e),Pn(e,kt.fromHtml('<br data-mce-bogus="1">'))}function vm(n){Ut(n).each(function(t){Bt(t).each(function(e){mo(n)&&Br(t)&&mo(e)&&Ln(t)})})}function bm(e,t){return o=D,Ve(r=t,n=e)?function(e,t){for(var n=y(t)?t:D,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=kt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(n,function(e){return o(e)||je(e,r)}).slice(0,-1):[];var n,r,o}function ym(e,t){return[e].concat(bm(e,t))}function Cm(e,t,n){return Zl(e,t,n,dm)}function xm(e,t){return M(ym(kt.fromDom(t.container()),e),mo)}function wm(e,n,r){return Cm(e,n.dom,r).forall(function(t){return xm(n,r).fold(function(){return!1===Js(t,r,n.dom)},function(e){return!1===Js(t,r,n.dom)&&Ve(e,kt.fromDom(t.container()))})})}function Sm(t,n,r){return xm(n,r).fold(function(){return Cm(t,n.dom,r).forall(function(e){return!1===Js(e,r,n.dom)})},function(e){return Cm(t,e.dom,r).isNone()})}function Em(e){return oc(e).exists(Br)}function km(e,t,n){var r=Q(U(ym(kt.fromDom(n.container()),t),mo)).getOr(t);return Ql(e,r.dom,n).filter(Em)}function Nm(e,t){return oc(t).exists(Br)||km(!0,e,t).isSome()}function _m(e,t){return ve.from(t.getNode(!0)).map(kt.fromDom).exists(Br)||km(!1,e,t).isSome()}function Am(e){return ss.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()}function Rm(e,t){return Q(U(ym(kt.fromDom(t.container()),e),mo)).getOr(e)}function Dm(e,t){return Am(t)?Gg(t):Gg(t)||tf(Rm(e,t).dom,t).exists(Gg)}function Tm(e,t){return Am(t)?Yg(t):Yg(t)||ef(Rm(e,t).dom,t).exists(Yg)}function Om(e){return oc(e).bind(function(e){return pr(e,Nn)}).exists(function(e){return T(["pre","pre-wrap"],xn(e,"white-space"))})}function Bm(e,t){return!Om(t)&&(ip(e,t)||up(e,t)||_m(e,t)||Dm(e,t))}function Pm(e,t){return!Om(t)&&(ap(e,t)||sp(e,t)||Nm(e,t)||Tm(e,t))}function Lm(e,t){return Bm(e,t)||Pm(e,(r=(n=t).container(),o=n.offset(),jn(r)&&o<r.data.length?ss(r,o+1):n));var n,r,o}function Im(e,t){return uf(e.charAt(t))}function Mm(e){var t=e.container();return jn(t)&&Te(t.data,xo)}function Fm(g,e){return ve.some(e).filter(Mm).bind(function(e){var t,n,r,o,i,a,u,s,c,l=e.container(),f=g,d=(i=l).data,m=ss(i,0);return(!Im(d,0)||Lm(f,m)?(s=(a=l).data,(c=A(u=s.split(""),function(e,t){return uf(e)&&0<t&&t<u.length-1&&Zc(u[t-1])&&Zc(u[t+1])?" ":e}).join(""))!==s&&(a.data=c,1)):(i.data=" "+d.slice(1),1))||(t=g,r=(n=l).data,o=ss(n,r.length-1),Im(r,r.length-1)&&!Lm(t,o)&&(n.data=r.slice(0,-1)+" ",1))?ve.some(e):ve.none()})}function Um(t){var e=kt.fromDom(t.getBody());t.selection.isCollapsed()&&Fm(e,ss.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})}function zm(e,t,n){var r,o,i,a,u,s,c,l;0!==n&&(o=gr(r=kt.fromDom(e),mo).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&Pm(o,ss(e,e.data.length)),u=0===t&&Bm(o,ss(e,0)),e.replaceData(t,n,(c=u,l=a,L(s=i,function(e,t){return Qc(t)||uf(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+xo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))}function Hm(e,t){var n=e.data.slice(t);zm(e,t,n.length-Qe(n).length)}function jm(e,t){var n=e.data.slice(0,t),r=n.length-Ze(n).length;zm(e,t-r,r)}function Vm(e,t,n,r){void 0===r&&(r=!0);var o=Ze(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),Ln(kt.fromDom(a)),n&&Hm(i,o),i}function qm(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===ss.isTextPosition(n)&&o===r.parentNode&&i>ss.before(r).offset()?ss(t.container(),t.offset()-1):t;var n,r,o,i}function $m(e){return jr(e.previousSibling)?ve.some((t=e.previousSibling,jn(t)?ss(t,t.data.length):ss.after(t))):e.previousSibling?rf(e.previousSibling):ve.none();var t}function Wm(e){return jr(e.nextSibling)?ve.some((t=e.nextSibling,jn(t)?ss(t,0):ss.before(t))):e.nextSibling?nf(e.nextSibling):ve.none();var t}function Km(r,o){return $m(o).orThunk(function(){return Wm(o)}).orThunk(function(){return e=r,n=ss.before((t=o).previousSibling||t.parentNode),tf(e,n).fold(function(){return ef(e,ss.after(t))},ve.some);var e,t,n})}function Xm(n,r){return Wm(r).orThunk(function(){return $m(r)}).orThunk(function(){return ef(e=n,ss.after(t=r)).fold(function(){return tf(e,ss.before(t))},ve.some);var e,t})}function Ym(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})}function Gm(e,t){return t&&ke(e.schema.getBlockElements(),Nt(t))}function Jm(e){if(Wr(e)){var t=kt.fromHtml('<br data-mce-bogus="1">');return Xt(e),Pn(e,t),ve.some(ss.before(t.dom))}return ve.none()}function Qm(t,n,e,r){void 0===r&&(r=!0);var o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(p=n,h=t.getBody(),v=e.dom,(p?Xm:Km)(h,v).map(R(qm,v))),y=gr(e,R(Gm,t),(o=t.getBody(),function(e){return e.dom===o})),C=(u=b,i=a=e,s=ke(t.schema.getTextInlineElements(),Nt(i)),m=Bt(a).filter(_n),g=Pt(a).filter(_n),Ln(a),l=g,f=u,d=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Vm(r,o,s),n.container()===o?ss(r,i):n},((c=m).isSome()&&l.isSome()&&f.isSome()?ve.some(d(c.getOrDie(),l.getOrDie(),f.getOrDie())):ve.none()).orThunk(function(){return s&&(m.each(function(e){return jm(e.dom,e.dom.length)}),g.each(function(e){return Hm(e.dom,0)})),u}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):y.bind(Jm).fold(function(){r&&Ym(t,n,C)},function(e){r&&Ym(t,n,ve.some(e))})}function Zm(e){return bu(e,"td,th")}function eg(e,t){return{start:e,end:t}}function tg(e,t){return br(kt.fromDom(e),"td,th",t)}function ng(e){return!je(e.start,e.end)}function rg(e,n){return Dl(e.start,n).bind(function(t){return Dl(e.end,n).bind(function(e){return je(t,e)?ve.some(t):ve.none()})})}function og(e){return function(t){return rg(t,e).map(function(e){return{rng:t,table:e,cells:Zm(e)}})}}function ig(e,t,n,r){if(n.collapsed||!e.forall(ng))return ve.none();if(t.isSameTable){var o=e.bind(og(r));return ve.some({start:o,end:o})}var i,a,u=tg(n.startContainer,r),s=tg(n.endContainer,r),c=u.bind((a=r,function(t){return Dl(t,a).bind(function(e){return Z(Zm(e)).map(function(e){return eg(t,e)})})})).bind(og(r)),l=s.bind((i=r,function(t){return Dl(t,i).bind(function(e){return Q(Zm(e)).map(function(e){return eg(e,t)})})})).bind(og(r));return ve.some({start:c,end:l})}function ag(e,t){return z(e,function(e){return je(e,t)})}function ug(n){return dn(ag(n.cells,n.rng.start),ag(n.cells,n.rng.end),function(e,t){return n.cells.slice(e,t+1)})}function sg(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each(function(e){return o.setStartAfter(e.dom)}),r.each(function(e){return o.setEndBefore(e.dom)}),o}function cg(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(n=e,function(e){return je(n,e)}),y=dn(tg((r=t).startContainer,o=b),tg(r.endContainer,o),eg),C=(l=b,f=x((c=t).startContainer),d=x(c.endContainer),m=f.isSome(),g=d.isSome(),p=dn(f,d,je).getOr(!1),{startTable:f,endTable:d,isStartInTable:m,isEndInTable:g,isSameTable:p,isMultiTable:!p&&m&&g});function x(e){return Dl(kt.fromDom(e),l)}return h=t,v=b,y.exists(function(e){return!ng(t=e)&&rg(t,v).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&Tl(e.start,h);var t})?y.map(function(e){return fp.singleCellTable(t,e.start)}):C.isMultiTable?ig(y,u=C,s=t,b).bind(function(e){var t=e.start,n=e.end,r=t.bind(ug).getOr([]),o=n.bind(ug).getOr([]);if(0<r.length&&0<o.length){var i=sg(s,u);return ve.some(fp.multiTable(r,o,i))}return ve.none()}):ig(y,i=C,a=t,b).bind(function(e){var t=e.start,n=e.end;return t.or(n)}).bind(function(e){var t=i.isSameTable,n=ug(e).getOr([]);if(t&&e.cells.length===n.length)return ve.some(fp.fullTable(e.table));if(0<n.length){if(t)return ve.some(fp.partialTable(n,ve.none()));var r=sg(a,i);return ve.some(fp.partialTable(n,ve.some(_e(_e({},i),{rng:r}))))}return ve.none()})}function lg(e){return Y(e,function(e){yn(e,"contenteditable"),hm(e)}),0}function fg(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),mp(e,o,t,!1)}function dg(e){var t=Rl(e),n=kt.fromDom(e.selection.getNode());Gn(n.dom)&&Wr(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),1<t.length&&F(t,function(e){return je(e,n)})&&pn(n,"data-mce-selected","1")}function mg(s,c,e){var l=s.selection.getRng();return lg(e.bind(function(e){var t,n,r,o=e.rng,i=e.isStartInTable,a=(t=i?o.endContainer:o.startContainer,ve.from(s.dom.getParent(t,s.dom.isBlock)).map(kt.fromDom));o.deleteContents(),n=s,r=i,a.filter(Wr).each(function(e){r?Ln(e):(hm(e),n.selection.setCursorLocation(e.dom,0))});var u=i?c[0]:c[c.length-1];return fg(s,u,l,i),Wr(u)?ve.none():ve.some(i?c.slice(1):c.slice(0,-1))}).getOr(c)),dg(s),!0}function gg(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];fg(e,i,o,!0),fg(e,a,o,!1);var u=Wr(i)?t:t.slice(1),s=Wr(a)?n:n.slice(0,-1);return lg(u.concat(s)),r.deleteContents(),dg(e),!0}function pg(e,t){return Qm(e,!1,t),!0}function hg(e,t){return M(ym(t,e),bo)}function vg(e,t){return(e?tp:np)(t)}function bg(f,d,s){var m=kt.fromDom(f.getBody());return gp(m,s).fold(function(){return o=f,i=d,a=m,e=s,u=ss.fromRangeStart(o.selection.getRng()),hg(a,e).bind(function(e){return Wr(e)?pp(o,e):(t=a,n=e,r=u,zc(i,o.getBody(),r).bind(function(e){return hg(t,kt.fromDom(e.getNode())).map(function(e){return!1===je(e,n)})}));var t,n,r}).getOr(!1)||(n=d,r=ss.fromRangeStart((t=f).selection.getRng()),vg(n,r)||Ql(n,t.getBody(),r).exists(function(e){return vg(n,e)}));var o,i,a,e,u,t,n,r},function(e){return n=d,r=m,o=e,i=ss.fromRangeStart((t=f).selection.getRng()),(Wr(o)?pp(t,o):(u=r,c=o,l=i,zc(s=n,(a=t).getBody(),l).bind(function(e){return r=s,o=l,i=e,nf((n=c).dom).bind(function(t){return rf(n.dom).map(function(e){return r?o.isEqual(t)&&i.isEqual(e):o.isEqual(e)&&i.isEqual(t)})}).getOr(!0)?pp(a,c):(t=c,gp(u,kt.fromDom(e.getNode())).map(function(e){return!1===je(e,t)}));var t,n,r,o,i}).or(ve.some(!0)))).getOr(!1);var a,u,s,c,l,t,n,r,o,i})}function yg(e,t){var n,r,o,i,a,u,s,c,l=kt.fromDom(e.selection.getStart(!0)),f=Rl(e);return e.selection.isCollapsed()&&0===f.length?bg(e,t,l):(r=l,o=f,i=kt.fromDom((n=e).getBody()),a=n.selection.getRng(),0!==o.length?mg(n,o,ve.none()):(u=n,c=a,gp(s=i,r).fold(function(){return t=u,cg(s,c).map(function(e){return e.fold(R(mp,t),R(pg,t),R(mg,t),R(gg,t))});var t},function(e){return pp(u,e)}).getOr(!1)))}function Cg(e){return e.collapsed?e:(a=e,u=ss.fromRangeStart(a),s=ss.fromRangeEnd(a),c=a.commonAncestorContainer,Ql(!1,c,s).map(function(e){return!Js(u,s,c)&&Js(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a));var a,u,s,c}function xg(e,t){var n,r,o,i,a,u=t.firstChild,s=t.lastChild;return u&&"meta"===u.name&&(u=u.next),r=s=s&&"mce_marker"===s.attr("id")?s.prev:s,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||(i=r,n.getBlockElements()[i.name]&&i.firstChild&&i.firstChild===i.lastChild&&("br"===(a=i.firstChild).name||a.value===xo)))&&(s=s.prev),u&&u===s&&("ul"===u.name||"ol"===u.name)}function wg(e){return 0<e.length&&(!(r=e[e.length-1]).firstChild||(t=r)&&t.firstChild&&t.firstChild===t.lastChild&&((n=t.firstChild).data===xo||Wn(n)))?e.slice(0,-1):e;var t,n,r}function Sg(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null}function Eg(e,t){var n=ss.after(e),r=Ic(t).prev(n);return r?r.toRange():null}function kg(e,o,i,t){function n(e){var t=ss.fromRangeStart(i),n=Ic(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Sg(o,r.getNode())!==R}var r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,S,E,k,N,_,A=(r=o,c=e.serialize(t),u=(a=r.createFragment(c)).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),R=Sg(o,i.startContainer),D=wg(U(A.firstChild.childNodes,function(e){return"LI"===e.nodeName})),T=o.getRoot();return n(1)?(S=T,_=(w=R).parentNode,Et.each(D,function(e){_.insertBefore(e,w)}),E=S,k=ss.before(w),(N=Ic(E).next(k))?N.toRange():null):n(2)?(l=R,d=T,o.insertAfter((f=D).reverse(),l),Eg(f[0],d)):(g=D,p=T,h=m=R,b=(v=i).cloneRange(),y=v.cloneRange(),b.setStartBefore(h),y.setEndAfter(h),C=[b.cloneContents(),y.cloneContents()],(x=m.parentNode).insertBefore(C[0],m),Et.each(g,function(e){x.insertBefore(e,m)}),x.insertBefore(C[1],m),x.removeChild(m),Eg(g[g.length-1],p))}function Ng(e,t,n){var r,o,i,a,u=e.selection,s=e.dom;/^ | $/.test(t)&&(r=s,o=u.getRng(),i=t,i=Bm(a=kt.fromDom(r.getRoot()),ss.fromRangeStart(o))?i.replace(/^ /,"&nbsp;"):i.replace(/^&nbsp;/," "),t=i=Pm(a,ss.fromRangeEnd(o))?i.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):i.replace(/&nbsp;(<br( \/)?>)?$/," "));var c=e.parser,l=n.merge,f=im({validate:e.getParam("validate")},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',m=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(m.isDefaultPrevented())e.fire("SetContent",{content:m.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=m.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var g,p,h=(g=u.getRng()).startContainer||(g.parentElement?g.parentElement():null),v=e.getBody();h===v&&u.isCollapsed()&&s.isBlock(v.firstChild)&&((p=v.firstChild)&&!e.schema.getShortEndedElements()[p.nodeName])&&s.isEmpty(v.firstChild)&&((g=s.createRng()).setStart(v.firstChild,0),g.setEnd(v.firstChild,0),u.setRng(g)),u.isCollapsed()||function(e){var t=e.dom,n=Cg(e.selection.getRng());e.selection.setRng(n);var r,o=t.getParent(n.startContainer,hp),i=n;null!==(r=o)&&r===t.getParent(i.endContainer,hp)&&Tl(kt.fromDom(r),i)?mp(e,n,kt.fromDom(o)):e.getDoc().execCommand("Delete",!1,null)}(e);var b,y,C,x,w,S,E,k,N,_,A,R,D,T,O={context:(I=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},B=c.parse(t,O);if(!0===n.paste&&xg(e.schema,B)&&Sg(s,I))return g=kg(f,s,u.getRng(),B),u.setRng(g),void e.fire("SetContent",m);if(function(){for(var e=B;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(),"mce_marker"===(L=B.lastChild).attr("id"))for(var P=L,L=L.prev;L;L=L.walk(!0))if(3===L.type||!s.isBlock(L.name)){e.schema.isValidChild(L.parent.name,"span")&&L.parent.insert(P,L,"br"===L.name);break}if(e._selectionOverrides.showBlockCaretContainer(I),O.invalid){e.selection.setContent(d);var I=u.getNode(),M=e.getBody();for(9===I.nodeType?I=L=M:L=I;L!==M;)L=(I=L).parentNode;t=I===M?M.innerHTML:s.getOuterHTML(I),t=f.serialize(c.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return f.serialize(B)}))),I===M?s.setHTML(M,t):s.setOuterHTML(I,t)}else b=e,y=t=f.serialize(B),"all"===(C=I).getAttribute("data-mce-bogus")?C.parentNode.insertBefore(b.dom.createFragment(y),C):(x=C.firstChild,w=C.lastChild,!x||x===w&&"BR"===x.nodeName?b.dom.setHTML(C,y):b.selection.setContent(y));E=l,_=(S=e).schema.getTextInlineElements(),A=S.dom,E&&(k=S.getBody(),N=rm(A),Et.each(A.select("*[data-mce-fragment]"),function(e){if(V(_[e.nodeName.toLowerCase()])&&j(lm(A,e),function(e){return!cm.has(e)}))for(var t=e.parentNode;V(t)&&t!==k&&!function(r,o,i){function a(e){var t=r.getStyle(o,e),n=r.getStyle(i,e);return Be(t)&&Be(n)&&t!==n}var e=lm(r,o),u=lm(r,i);return F(e,function(t){function e(e){return F(e,function(e){return e===t})}if(e(u)||!e(Xg))return a(t);var n=U(u,function(t){return F(Xg,function(e){return Ge(t,e)})});return F(n,a)})}(A,e,t);t=t.parentNode)if(N.compare(t,e)){A.remove(e,!0);break}})),function(n,e){var t,r=n.dom,o=n.selection;if(e){o.scrollIntoView(e);var i=vf(n.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),o.select(i);var a,u=r.createRng(),s=e.previousSibling;jn(s)?(u.setStart(s,s.nodeValue.length),xt.ie||(a=e.nextSibling,jn(a)&&(s.appendData(a.data),a.parentNode.removeChild(a)))):(u.setStartBefore(e),u.setEndBefore(e));var c=r.getParent(e,r.isBlock);r.remove(e),c&&r.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),hp(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=ss.fromRangeStart(e);if(t=Ic(n.getBody()).next(t))return t.toRange()}(u))?r.add(c,r.create("br",{"data-mce-bogus":"1"})):(u=t,r.remove(c))),o.setRng(u)}}(e,s.get("mce_marker")),R=e.getBody(),Et.each(R.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),D=s,T=u.getStart(),ve.from(D.getParent(T,"td,th")).map(kt.fromDom).each(vm),e.fire("SetContent",m),e.addVisual()}}function _g(e){return e instanceof Hd}function Ag(e,t,n){var r;e.dom.setHTML(e.getBody(),t),!0!==n&&yd(r=e)&&nf(r.getBody()).each(function(e){var t=e.getNode(),n=cn(t)?nf(t).getOr(e):e;r.selection.setRng(n.toRange())})}function Rg(u,s,e){var t,n=(t=s,_e(_e({format:"html"},e),{set:!0,content:_g(t)?"":t})),c=e.no_events?n:u.fire("BeforeSetContent",n);return _g(s)||(s=c.content),ve.from(u.getBody()).fold(J(s),function(e){return _g(s)?function(e,t,n,r){var o,i,u,a;o=e.parser.getNodeFilters(),i=e.parser.getAttributeFilters(),u=n,a=function(e,n){var t,r,o={},i={},a=[];for(t in u.firstChild&&vp(u.firstChild,function(t){Y(e,function(e){e.name===t.name&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})}),Y(n,function(e){"string"==typeof t.attr(e.name)&&(i[e.name]?i[e.name].nodes.push(t):i[e.name]={filter:e,nodes:[t]})})}),o)ke(o,t)&&a.push(o[t]);for(r in i)ke(i,r)&&a.push(i[r]);return a}(o,i),Y(a,function(t){Y(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})});var s=im({validate:e.validate},e.schema).serialize(n);return r.content=yo(kt.fromDom(t))?s:Et.trim(s),Ag(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(i='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+i+"</li>"),r=(a=ks(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),a.toLowerCase())?(r=i,t.dom.createHTML(a,Ns(t),r)):r||'<br data-mce-bogus="1">',Ag(t,r,o.no_selection),t.fire("SetContent",o)):("raw"!==o.format&&(r=im({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=yo(kt.fromDom(n))?r:Et.trim(r),Ag(t,o.content,o.no_selection),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})}function Dg(e){return y(e)?e:D}function Tg(i,e,t){var n=e(i),a=Dg(t);return n.orThunk(function(){return a(i)?ve.none():function(e){for(var t=i.dom,n=Dg(a);t.parentNode;){var t=t.parentNode,r=kt.fromDom(t),o=e(r);if(o.isSome())return o;if(n(r))break}return ve.none()}(e)})}function Og(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(ml(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return 1}}function Bg(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,function(e){return!!Og(t,e,n)||e.parentNode===i||!!yp(t,e,n,r,!0)}),!!yp(t,e,n,r,o))}function Pg(e,t,n){return!!bp(t,n.inline)||!!bp(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)}function Lg(e,t,n,r,o,i){var a=n[r];if(y(n.onmatch))return n.onmatch(t,n,r);if(a)if(b(a.length)){for(var u in a)if(ke(a,u)){var s="attributes"===r?e.getAttrib(t,u):sl(e,t,u),c=il(a[u],i),l=K(s)||Pe(s);if(!l||!K(c)){if(o&&l&&!n.exact)return;if((!o||n.exact)&&!bp(s,ul(e,c,u)))return}}}else for(var f=0;f<a.length;f++)if("attributes"===r?e.getAttrib(t,a[f]):sl(e,t,a[f]))return 1;return 1}function Ig(e,t,n,r,o){if(r)return Bg(e,r,t,n,o);if(r=e.selection.getNode(),Bg(e,r,t,n,o))return!0;var i=e.selection.getStart();return!(i===r||!Bg(e,i,t,n,o))}function Mg(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==Cp||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length}function Fg(e){if(e){var t=new Rr(e,e);for(e=t.current();e;e=t.next())if(jn(e))return e}return null}function Ug(e){var t=kt.fromTag("span");return hn(t,{id:xp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Pn(t,kt.fromText(Cp)),t}function zg(e,t,n){void 0===n&&(n=!0);var r,o,i,a,u,s,c,l,f=e.dom,d=e.selection;Mg(t)?Qm(e,!1,kt.fromDom(t),n):(r=d.getRng(),o=f.getParent(t,f.isBlock),i=r.startContainer,a=r.startOffset,u=r.endContainer,s=r.endOffset,(l=Fg(t))&&l.nodeValue.charAt(0)===Cp&&l.deleteData(0,1),c=l,f.remove(t,!0),i===c&&0<a&&r.setStart(c,a-1),u===c&&0<s&&r.setEnd(c,s-1),o&&f.isEmpty(o)&&hm(kt.fromDom(o)),d.setRng(r))}function Hg(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)zg(e,t,n);else if(!(t=Vc(e.getBody(),o.getStart())))for(;t=r.get(xp);)zg(e,t,!1)}function jg(e,t){return e.appendChild(t),t}function Vg(e,t){var n=P(e,function(e,t){return jg(e,t.cloneNode(!1))},t);return jg(n,n.ownerDocument.createTextNode(Cp))}function qg(o,e,t,i,n,r){var a,u,s=o.formatter,c=o.dom,l=U(we(s.get()),function(e){return e!==i&&!Te(e,"removeformat")});if(0<U((a=o,u=t,L(l,function(e,t){var n=fl(a,t);return a.formatter.matchNode(u,t,{},n)?e.concat([t]):e},[])),function(e){return n=i,r=["inline","block","selector","attributes","styles","classes"],!F((t=o).formatter.get(e),function(e){var i=a(e);return F(t.formatter.get(n),function(e){var t,n=a(e),r=i,o=n;return d(t=void 0===t?p:t).eq(r,o)})});function a(e){return ae(e,function(e,t){return F(r,function(e){return e===t})})}var t,n,r}).length){var f=t.cloneNode(!1);return c.add(e,f),s.remove(i,n,f,r),c.remove(f),ve.some(f)}return ve.none()}function $g(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom,C=e.selection,x=[],w=C.getRng(),S=w.startContainer,E=w.startOffset,k=S;for(3===S.nodeType&&(E!==S.nodeValue.length&&(o=!0),k=k.parentNode);k;){if(yp(e,k,t,n,r)){i=k;break}k.nextSibling&&(o=!0),x.push(k),k=k.parentNode}i&&(o?(a=C.getBookmark(),w.collapse(!0),u=Bf(kl(e,w,e.formatter.get(t),!0)),e.formatter.remove(t,n,u,r),C.moveToBookmark(a)):(s=Vc(e.getBody(),i),d=c=Ug(!1).dom,(p=(g=e.dom).getParent(m=null!==s?s:i,R(rl,e)))&&g.isEmpty(p)?m.parentNode.replaceChild(d,m):(h=kt.fromDom(m),v=bu(h,"br"),b=U(function(){for(var e=[],t=h.dom;t;)e.push(kt.fromDom(t)),t=t.lastChild;return e}().slice(-1),Br),v.length===b.length&&Y(b,Ln),g.isEmpty(m)?m.parentNode.replaceChild(d,m):g.insertAfter(d,m)),l=qg(e,c,i,t,n,r),f=Vg(x.concat(l.toArray()),c),zg(e,s,!1),C.setCursorLocation(f,1),y.isEmpty(i)&&y.remove(i)))}function Wg(e,t){var n=e.schema.getTextInlineElements();return ke(n,Nt(t))&&!jc(t.dom)&&!sn(t.dom)}Y(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],function(e){cm.add(e)});var Kg,Xg=["font","text-decoration","text-emphasis"],Yg=R(fm,!0,Qc),Gg=R(fm,!1,Qc),Jg=mm(!0,gm),Qg=mm(!1,gm),Zg=mm(!0,Jn),ep=mm(!1,Jn),tp=mm(!0,cn),np=mm(!1,cn),rp=mm(!0,pm),op=mm(!1,pm),ip=R(Sm,!1),ap=R(Sm,!0),up=R(wm,!1),sp=R(wm,!0),cp=R(km,!1),lp=R(km,!0),fp=or([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),dp=function(e){var t;return(8===_t(t=e)||"#comment"===Nt(t)?Bt:Ut)(e).bind(dp).orThunk(function(){return ve.some(e)})},mp=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=dp(n).getOr(n),a=kt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Wr(a)&&(hm(a),r&&e.selection.setCursorLocation(a.dom,0)),je(n,a)||Y((fn(Ot(a),n)?[]:Ot(o=a).map(Dn).map(function(e){return U(e,function(e){return!je(o,e)})}).getOr([])).concat(Dn(n)),function(e){je(e,a)||Ve(e,a)||!Wr(e)||Ln(e)}),!0},gp=function(e,t){return M(ym(t,e),function(e){return Nn(e)&&"caption"===Nt(e)})},pp=function(e,t){return hm(t),e.selection.setCursorLocation(t.dom,0),ve.some(!0)},hp=Gn,vp=function(e,t){t(e),e.firstChild&&vp(e.firstChild,t),e.next&&vp(e.next,t)},bp=al,yp=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var s=i[u];if(Pg(e.dom,t,s)&&Lg(a,t,s,"attributes",o,r)&&Lg(a,t,s,"styles",o,r)){var c=s.classes;if(c)for(var l=0;l<c.length;l++)if(!e.dom.hasClass(t,il(c[l],r)))return;return s}}},Cp=wo,xp="_mce_caret",wp={},Sp=fe,Ep=ce;function kp(e){return zn(e)&&!Jc(e)&&!jc(e)&&!sn(e)}function Np(e,t){for(var n=e;n;n=n[t]){if(jn(n)&&Be(n.data))return e;if(zn(n)&&!Jc(n))return n}return e}function _p(e,t,n){var r=rm(e);if(t&&n&&(t=Np(t,"previousSibling"),n=Np(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o,o=o.nextSibling;t.appendChild(i)}return e.remove(n),Et.each(Et.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n}function Ap(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=_p(e,nl(r),r),_p(e,o,nl(o,!0)))}function Rp(t,n){return function(e){return!(!e||!sl(t,e,n))}}function Dp(r,o,i){return function(e){var t,n;r.setStyle(e,o,i),""===e.getAttribute("style")&&e.removeAttribute("style"),t=r,"SPAN"===(n=e).nodeName&&0===t.getAttribs(n).length&&t.remove(n,!0)}}function Tp(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)}function Op(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return zn(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r<i?r:i]),jn(o)&&n&&i>=o.nodeValue.length&&(o=new Rr(o,e.getBody()).next()||o),jn(o)&&!n&&0===i&&new Rr(o,e.getBody()).prev()||o}function Bp(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e}function Pp(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o}function Lp(e,t,n,r,o){var i=kt.fromDom(t),a=kt.fromDom(e.create(r,o));return Kt(a,(n?It:Lt)(i)),n?(qt(i,a),Wt(a,i)):($t(i,a),Pn(a,i)),a.dom}function Ip(e,t,n,r){var o=nl(t,n,r);return K(o)||"BR"===o.nodeName||e.isBlock(o)}function Mp(e,r,o,t,i){var n,a,u=e.dom,s=u,c=t;if(!(gl(a=r)&&Rh(c,a.inline)||dl(a)&&Rh(c,a.block)||ml(a)&&(zn(c)&&s.is(c,a.selector))||r.links&&"A"===t.nodeName))return Nh.keep();var l,f,d,m,g,p,h,v,b=t;if(gl(r)&&"all"===r.remove&&S(r.preserve_attributes)){var y=U(u.getAttribs(b),function(e){return T(r.preserve_attributes,e.name.toLowerCase())});if(u.removeAllAttribs(b),Y(y,function(e){return u.setAttrib(b,e.name,e.value)}),0<y.length)return Nh.rename("span")}if("all"!==r.remove){Ah(r.styles,function(e,t){e=ul(u,il(e,o),t+""),E(t)&&(t=e,i=null),!r.remove_similar&&i&&!Rh(sl(u,i,t),e)||u.setStyle(b,t,""),n=!0}),n&&""===u.getAttrib(b,"style")&&(b.removeAttribute("style"),b.removeAttribute("data-mce-style")),Ah(r.attributes,function(e,t){var n;if(e=il(e,o),E(t)&&(t=e,i=null),r.remove_similar||!i||Rh(u.getAttrib(i,t),e))if("class"===t&&(e=u.getAttrib(b,t))&&(n="",Y(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))u.setAttrib(b,t,n);else{if(_h.test(t)&&b.removeAttribute("data-mce-"+t),"style"===t&&on(["li"])(b)&&"none"===u.getStyle(b,"list-style-type"))return b.removeAttribute(t),void u.setStyle(b,"list-style-type","none");"class"===t&&b.removeAttribute("className"),b.removeAttribute(t)}}),Ah(r.classes,function(e){e=il(e,o),i&&!u.hasClass(i,e)||u.removeClass(b,e)});for(var C=u.getAttribs(b),x=0;x<C.length;x++){var w=C[x].nodeName;if(0!==w.indexOf("_")&&0!==w.indexOf("data-"))return Nh.keep()}}return"none"!==r.remove?(l=e,d=r,p=(f=b).parentNode,h=l.dom,v=ks(l),dl(d)&&(v?p===h.getRoot()&&(d.list_block&&Rh(f,d.list_block)||Y(xe(f.childNodes),function(e){ol(l,v,e.nodeName.toLowerCase())?m?m.appendChild(e):(m=Pp(h,e,v),h.setAttribs(m,l.settings.forced_root_block_attrs)):m=null})):h.isBlock(f)&&!h.isBlock(p)&&(Ip(h,f,!1)||Ip(h,f.firstChild,!0,!0)||f.insertBefore(h.create("br"),f.firstChild),Ip(h,f,!0)||Ip(h,f.lastChild,!1,!0)||f.appendChild(h.create("br")))),ml(g=d)&&gl(g)&&fn(ue(g,"mixed"),!0)&&!Rh(d.inline,f)||h.remove(f,!0),Nh.removed()):Nh.keep()}function Fp(t,e,n,r,o){return Mp(t,e,n,r,o).fold(D,function(e){return t.dom.rename(r,e),!0},w)}function Up(u,s,c,e,l){function a(e){var n,r,o,i,a,t=(r=s,o=c,i=l,Y(ll((n=u).dom,e.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=yp(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l=e.dom;if(n){for(var f=n.parentNode,d=r.parentNode;d&&d!==f;d=d.parentNode){for(var m=l.clone(d,!1),g=0;g<t.length&&null!==(m=function(t,e,n){return Mp(t,e,u,n,n).fold(J(n),function(e){return t.dom.createFragment().appendChild(n),t.dom.rename(n,e)},J(null))}(e,t[g],m));g++);m&&(s&&m.appendChild(s),c=c||m,s=m)}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),c.appendChild(o),gl(a)&&Ap(l,a,0,s))}return r}(u,m,t,e,e,!0,g,c)}function f(t){return F(m,function(e){return Fp(u,e,c,t,t)})}function d(e){var t,n=h.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return Jc(t=r)&&zn(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),jn(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),h.remove(n,!0),r}function t(e){var t=kl(u,e,m,e.collapsed);if(g.split){if(t=Bf(t),(r=Op(u,t,!0))!==(o=Op(u,t))){if(r=Bp(r,!0),o=Bp(o,!1),Tp(h,r,o)){var n=ve.from(r.firstChild).getOr(r);return a(Lp(h,n,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(Tp(h,o,r))return n=ve.from(o.lastChild).getOr(o),a(Lp(h,n,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);var r=Pp(h,r,"span",{id:"_start","data-mce-type":"bookmark"}),o=Pp(h,o,"span",{id:"_end","data-mce-type":"bookmark"}),i=h.createRng();i.setStartAfter(r),i.setEndBefore(o),Nl(h,i,function(e){Y(e,function(e){Jc(e)||Jc(e.parentNode)||a(e)})}),a(r),a(o),r=d(!0),o=d()}else r=o=a(r);t.startContainer=r.parentNode||r,t.startOffset=h.nodeIndex(r),t.endContainer=o.parentNode||o,t.endOffset=h.nodeIndex(o)+1}Nl(h,t,function(e){Y(e,v)})}var n,m=u.formatter.get(s),g=m[0],p=!0,h=u.dom,r=u.selection,v=function(t){var e=!0,n=!1;zn(t)&&h.getContentEditable(t)&&(e=p,p="true"===h.getContentEditable(t),n=!0);var r,o,i=xe(t.childNodes);if(p&&!n&&(r=f(t)||F(m,function(e){return Pg(h,t,e)}),o=t.parentNode,!r&&V(o)&&pl(g)&&f(o)),g.deep&&i.length){for(var a=0;a<i.length;a++)v(i[a]);n&&(p=e)}Y(["underline","line-through","overline"],function(e){zn(t)&&u.dom.getStyle(t,"text-decoration")===e&&t.parentNode&&cl(h,t.parentNode)===e&&Fp(u,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:e}},null,t)})};if(e)return el(e)?((n=h.createRng()).setStartBefore(e),n.setEndAfter(e),t(n)):t(e),void xf(u,s,e,c);if("false"!==h.getContentEditable(r.getNode()))r.isCollapsed()&&gl(g)&&!Rl(u).length?$g(u,s,c,l):(Ll(r,!0,function(){Pl(u,t)}),gl(g)&&Ig(u,s,c,r.getStart())&&tl(h,r,r.getRng()),u.nodeChanged()),xf(u,s,e,c);else{e=r.getNode();for(var o=0;o<m.length&&(!m[o].ceFalseOverride||!Fp(u,m[o],c,e,e));o++);xf(u,s,e,c)}}function zp(e){return zn(e)&&!Jc(e)&&!jc(e)&&!sn(e)}function Hp(e){return ke(e,"vars")}function jp(n,e,r,o,i){return I(e,function(e){var t=n.formatter.matchNode(e,r,null!=i?i:{},o);return!b(t)},function(e){return Og(n,e,r)||!o&&V(n.formatter.matchNode(e,r,i,!0))})}function Vp(e,t){var n=null!=t?t:Bh(e);return U(ll(e.dom,n),function(e){return zn(e)&&!sn(e)})}function qp(e,o,i,a,t,n){var r,u,s,c,l,f,d,m,g;return null===o.get()&&(u=e,(r=o).set({}),u.on("NodeChange",function(e){Ph(u,e.element,r.get())}),u.on("FormatApply FormatRemove",function(e){var t=ve.from(e.node).map(function(e){return el(e)?e:e.startContainer}).bind(function(e){return zn(e)?ve.some(e):ve.from(e.parentElement)}).getOrThunk(function(){return Bh(u)});Ph(u,t,r.get())})),s=e,l=i,f=a,d=t,m=n,g=(c=o).get(),Y(l.split(","),function(t){function e(){var e=Vp(s);return jp(s,e,t,d,m).isSome()}var n,r=ue(g,t).getOrThunk(function(){var e={withSimilar:{state:iu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:iu(!1),similar:!1,callbacks:[]},withVars:[]};return g[t]=e});b(m)?((n=d?r.withSimilar:r.withoutSimilar).callbacks.push(f),1===n.callbacks.length&&n.state.set(e())):r.withVars.push({state:iu(e()),similar:d,vars:m,callback:f})}),c.set(g),{unbind:function(){var e,t=i,n=a,r=(e=o).get();Y(t.split(","),function(t){return ue(r,t).each(function(e){r[t]={withSimilar:_e(_e({},e.withSimilar),{callbacks:U(e.withSimilar.callbacks,function(e){return e!==n})}),withoutSimilar:_e(_e({},e.withoutSimilar),{callbacks:U(e.withoutSimilar.callbacks,function(e){return e!==n})}),withVars:U(e.withVars,function(e){return e.callback!==n})}})}),e.set(r)}}}function $p(e,t){var n=(t||document).createDocumentFragment();return Y(e,function(e){n.appendChild(e.dom)}),kt.fromDom(n)}function Wp(e,t,n){return{element:e,width:t,rows:n}}function Kp(e,t){return{element:e,cells:t}}function Xp(e,t){var n=parseInt(vn(e,t),10);return isNaN(n)?1:n}function Yp(e){return L(e,function(e,t){return t.cells.length>e?t.cells.length:e},0)}function Gp(e,t){for(var n=e.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(je(o[i],t))return ve.some({x:i,y:r});return ve.none()}function Jp(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var s=a[u].cells,c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Kp(a[u].element,c))}return i}function Qp(e){var o=Wp(Eu(e),0,[]);return Y(bu(e,"tr"),function(n,r){Y(bu(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Xp(o,"rowspan"),a=Xp(o,"colspan"),u=e.rows,s=n;s<n+i;s++){u[s]||(u[s]=Kp(ku(r),[]));for(var c=t;c<t+a;c++)u[s].cells[c]=s===n&&c===t?o:Eu(o)}}(o,function(e,t,n){for(;r=t,((o=e.rows)[n]?o[n].cells:[])[r];)t++;var r,o;return t}(o,t,r),r,n,e)})}),Wp(o.element,Yp(o.rows),o.rows)}function Zp(e,t){var n,r,o,i=kt.fromDom(t.commonAncestorContainer),a=ym(i,e),u=U(a,function(e){return Or(e)||fo(e)}),s=(o=t,M(r=a,function(e){return"li"===Nt(e)&&Tl(e,o)}).fold(J([]),function(e){return M(r,function(e){return"ul"===Nt(e)||"ol"===Nt(e)}).map(function(e){var t=kt.fromTag(Nt(e));return Cn(t,ae(Sn(e),function(e,t){return Ge(t,"list-style")})),[kt.fromTag("li"),t]}).getOr([])}));return A(u.concat(s.length?s:ho(n=i)?Ot(n).filter(po).fold(J([]),function(e){return[n,e]}):po(n)?[n]:[]),Eu)}function eh(){return $p([])}function th(e,i){return hr(i[0],"table",R(je,e)).bind(function(e){var s,t,n=i[0],r=i[i.length-1],o=Qp(e);return t=r,Gp(s=o,n).bind(function(u){return Gp(s,t).map(function(e){return t=s,n=u.x,r=u.y,o=e.x,a=r<(i=e.y)?Jp(t,n,r,o,i):Jp(t,n,i,o,r),Wp(t.element,Yp(a),a);var t,n,r,o,i,a})}).map(function(e){return $p([(n=A((t=e).rows,function(e){var t=A(e.cells,function(e){var t=ku(e);return yn(t,"colspan"),yn(t,"rowspan"),t}),n=Eu(e.element);return Kt(n,t),n}),r=Eu(t.element),Kt(o=kt.fromTag("tbody"),n),Pn(r,o),r)]);var t,n,r,o})}).getOrThunk(eh)}function nh(e,t){var n,r,o,i,a,u,s,c=Al(t,e);return 0<c.length?th(e,c):(n=e,0<(r=t).length&&r[0].collapsed?eh():(o=n,i=r[0],a=kt.fromDom(i.cloneContents()),s=L(u=Zp(o,i),function(e,t){return Pn(t,e),t},a),0<u.length?$p([s]):s))}function rh(e,t){return 0<=t&&t<e.length&&Qc(e.charAt(t))}function oh(e,t){var n=Eo(e.innerText);return t?n.replace(/^[ \f\n\r\t\v]+/,""):n}function ih(e){return zn(e)?e.outerHTML:jn(e)?Qo.encodeRaw(e.data,!1):Vn(e)?"\x3c!--"+e.data+"--\x3e":""}function ah(e,c){var l=0;Y(e,function(e){var t,n,r,o,i,a,u,s;0===e[0]?l++:1===e[0]?(o=c,i=e[1],a=l,s=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(i),o.hasChildNodes()&&a<o.childNodes.length?(u=o.childNodes[a]).parentNode.insertBefore(s,u):o.appendChild(s),l++):2===e[0]&&(n=l,(t=c).hasChildNodes()&&n<t.childNodes.length&&(r=t.childNodes[n]).parentNode.removeChild(r))})}function uh(n){var e,t=H((e=n.getBody(),U(A(xe(e.childNodes),ih),function(e){return 0<e.length})),function(e){var t=nm(n.serializer,e);return 0<t.length?[t]:[]}),r=t.join("");return-1!==r.indexOf("</iframe>")?{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:r,bookmark:null,beforeBookmark:null}}function sh(e,t,n){var r,o,i,g,p,a,h,v,c,l,u,s=n?t.beforeBookmark:t.bookmark;function b(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}}"fragmented"===t.type?(r=t.fragments,o=e.getBody(),i=A(xe(o.childNodes),ih),ah((p=r,a=(g=i).length+p.length+2,h=new Array(a),v=new Array(a),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0==o||0==i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:1+d)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},u=[],c(0,g.length,0,p.length,u),u),o)):e.setContent(t.content,{format:"raw",no_selection:!V(s)||!qc(s)||!s.isFakeCaret}),e.selection.moveToBookmark(s)}function ch(e){return"fragmented"===e.type?e.fragments.join(""):e.content}function lh(e){var t=kt.fromTag("body",Lh());return wu(t,ch(e)),Y(bu(t,"*[data-mce-bogus]"),Yt),t.dom.innerHTML}function fh(e,t){return!(!e||!t)&&(r=t,ch(e)===ch(r)||(n=t,lh(e)===lh(n)));var n,r}function dh(e){return 0===e.get()}function mh(e,t,n){dh(n)&&(e.typing=t)}function gh(e,t){e.typing&&(mh(e,!1,t),e.add())}function ph(c){return{undoManager:{beforeChange:function(e,t){var n=c,r=t;dh(e)&&r.set(pc(n.selection))},add:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=uh(e);if(i=Et.extend(i=i||{},u),!1===dh(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&fh(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam("custom_undo_redo_levels",0,"number");if(c&&t.data.length>c){for(var l=0;l<t.data.length-1;l++)t.data[l]=t.data[l+1];t.data.length--,n.set(t.data.length)}i.bookmark=pc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var f={level:i,lastLevel:s,originalEvent:a};return 0<n.get()?(e.setDirty(!0),e.fire("AddUndo",f),e.fire("change",f)):e.fire("AddUndo",f),i}(c,e,t,n,r,o,i)},undo:function(e,t,n){return r=c,i=t,a=n,(o=e).typing&&(o.add(),o.typing=!1,mh(o,!1,i)),0<a.get()&&(a.set(a.get()-1),sh(r,u=o.data[a.get()],!0),r.setDirty(!0),r.fire("Undo",{level:u})),u;var r,o,i,a,u},redo:function(e,t){return n=c,o=t,(r=e).get()<o.length-1&&(r.set(r.get()+1),sh(n,i=o[r.get()],!1),n.setDirty(!0),n.fire("Redo",{level:i})),i;var n,r,o,i},clear:function(e,t){var n,r=c,o=t;(n=e).data=[],o.set(0),n.typing=!1,r.fire("ClearUndos")},reset:function(e){var t;(t=e).clear(),t.add()},hasUndo:function(e,t){return n=c,r=e,0<t.get()||r.typing&&r.data[0]&&!fh(uh(n),r.data[0]);var n,r},hasRedo:function(e,t){return n=e,t.get()<n.data.length-1&&!n.typing;var n},transact:function(e,t,n){return o=n,gh(r=e,t),r.beforeChange(),r.ignore(o),r.add();var r,o},ignore:function(e,t){try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}},extra:function(e,t,n,r){var o,i,a=c,u=t,s=r;(o=e).transact(n)&&(i=o.data[u.get()].bookmark,sh(a,o.data[u.get()-1],!0),o.transact(s)&&(o.data[u.get()-1].beforeBookmark=i))}},formatter:{match:function(e,t,n,r){return Ig(c,e,t,n,r)},matchAll:function(e,t){return o=e,i=t,a=[],u={},n=(r=c).selection.getStart(),r.dom.getParent(n,function(e){for(var t=0;t<o.length;t++){var n=o[t];!u[n]&&yp(r,e,n,i)&&(u[n]=!0,a.push(n))}},r.dom.getRoot()),a;var r,o,i,a,u,n},matchNode:function(e,t,n,r){return yp(c,e,t,n,r)},canApply:function(u){return function(e){var t=e.formatter.get(u),n=e.dom;if(t)for(var r=ll(n,e.selection.getStart()),o=t.length-1;0<=o;o--){var i=t[o];if(!ml(i)||V(i.defaultBlock))return!0;for(var a=r.length-1;0<=a;a--)if(n.is(r[a],i.selector))return!0}return!1}(c)},closest:function(e){return r=c,o=e,ve.from(r.selection.getStart(!0)).bind(function(e){return Tg(kt.fromDom(e),function(n){return ee(o,function(e){return yp(r,n.dom,t=e)?ve.some(t):ve.none();var t})},t)}).getOrNull();function t(e){return je(e,kt.fromDom(r.getBody()))}var r,o},apply:function(e,t,n){return Oh(c,e,t,n)},remove:function(e,t,n,r){return Up(c,e,t,n,r)},toggle:function(e,t,n){var r,o=e,i=t,a=n,u=(r=c).formatter.get(o);(!Ig(r,o,i,a)||"toggle"in u[0]&&!u[0].toggle?Oh:Up)(r,o,i,a)},formatChanged:function(e,t,n,r,o){return qp(c,e,t,n,r,o)}},editor:{getContent:function(e,t){return d=c,m=e,g=t,ve.from(d.getBody()).fold(J("tree"===m.format?new Hd("body",11):""),function(e){return t=d,r=e,o=g,c=_e(_e({},n=m),{format:o,get:!0,getInner:!0}),l=n.no_events?c:t.fire("BeforeGetContent",c),f="raw"===l.format?Et.trim(am(t.serializer,r.innerHTML)):"text"===l.format?t.dom.isEmpty(r)?"":Eo(r.innerText||r.textContent):"tree"===l.format?t.serializer.serialize(r,l):(a=(i=t).serializer.serialize(r,l),u=ks(i),s=new RegExp("^(<"+u+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+u+">[\r\n]*|<br \\/>[\r\n]*)$"),a.replace(s,"")),T(["text","tree"],l.format)||yo(kt.fromDom(r))?l.content=f:l.content=Et.trim(f),(l.no_events?l:t.fire("GetContent",l)).content;var t,n,r,o,i,a,u,s,c,l,f});var d,m,g},setContent:function(e,t){return Rg(c,e,t)},insertContent:function(e,t){return Ng(c,e,t)},addVisual:function(e){var i,t=e,a=(i=c).dom,n=V(t)?t:i.getBody();b(i.hasVisual)&&(i.hasVisual=i.getParam("visual",!0,"boolean")),Y(a.select("table,a",n),function(e){switch(e.nodeName){case"TABLE":var t=i.getParam("visual_table_class","mce-item-table","string"),n=a.getAttrib(e,"border");n&&"0"!==n||!i.hasVisual?a.removeClass(e,t):a.addClass(e,t);break;case"A":var r,o;a.getAttrib(e,"href")||(r=a.getAttrib(e,"name")||e.id,o=i.getParam("visual_anchor_class","mce-item-anchor","string"),r&&i.hasVisual?a.addClass(e,o):a.removeClass(e,o))}}),i.fire("VisualAid",{element:t,hasVisual:i.hasVisual})}},selection:{getContent:function(e,t){return function(e,t,n){var r,o=(r=t,_e(_e({},n=void 0===n?{}:n),{format:r,get:!0,selection:!0})),i=e.fire("BeforeGetContent",o);if(i.isDefaultPrevented())return e.fire("GetContent",i),i.content;if("text"===i.format)return m=e,ve.from(m.selection.getRng()).map(function(e){var t=ve.from(m.dom.getParent(e.commonAncestorContainer,m.dom.isBlock)),n=m.getBody(),r=t.map(function(e){return e.nodeName}).getOr("div").toLowerCase(),o=xt.browser.isIE()&&"pre"!==r,i=m.dom.add(n,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=oh(i,o),u=Eo(i.textContent);if(m.dom.remove(i),rh(u,0)||rh(u,u.length-1)){var s=oh(t.getOr(n),o),c=s.indexOf(a);return-1===c?a:(rh(s,c-1)?" ":"")+a+(rh(s,c+a.length)?" ":"")}return a}).getOr("");i.getInner=!0;var a,u,s,c,l,f,d,m,g=(u=i,s=(a=e).selection.getRng(),c=a.dom.create("body"),l=a.selection.getSel(),f=Ed(a,_l(l)),(d=u.contextual?nh(kt.fromDom(a.getBody()),f).dom:s.cloneContents())&&c.appendChild(d),a.selection.serializer.serialize(c,u));return"tree"===i.format?g:(i.content=e.selection.isCollapsed()?"":g,e.fire("GetContent",i),i.content)}(c,e,t)}},raw:{getModel:function(){return ve.none()}}}}function hh(e){return ke(e.plugins,"rtc")}function vh(e){var u=e;return ue(e.plugins,"rtc").bind(function(e){return ve.from(e.setup)}).fold(function(){return u.rtcInstance=ph(e),ve.none()},function(e){var t,n;return u.rtcInstance=(t=J(null),n=J(""),{undoManager:{beforeChange:te,add:t,undo:t,redo:t,clear:te,reset:te,hasUndo:D,hasRedo:D,transact:t,ignore:te,extra:te},formatter:{match:D,matchAll:J([]),matchNode:J(void 0),canApply:D,closest:n,apply:te,remove:te,toggle:te,formatChanged:J({unbind:te})},editor:{getContent:n,setContent:n,insertContent:te,addVisual:te},selection:{getContent:n},raw:{getModel:J(ve.none())}}),ve.some(function(){return e().then(function(e){return u.rtcInstance=(i=e.undoManager,a=e.formatter,n=e.editor,r=e.selection,t=e.raw,{undoManager:{beforeChange:i.beforeChange,add:i.add,undo:i.undo,redo:i.redo,clear:i.clear,reset:i.reset,hasUndo:i.hasUndo,hasRedo:i.hasRedo,transact:function(e,t,n){return i.transact(n)},ignore:function(e,t){return i.ignore(t)},extra:function(e,t,n,r){return i.extra(n,r)}},formatter:{match:function(e,t,n,r){return a.match(e,o(t),r)},matchAll:a.matchAll,matchNode:a.matchNode,canApply:function(e){return a.canApply(e)},closest:function(e){return a.closest(e)},apply:function(e,t,n){return a.apply(e,o(t))},remove:function(e,t,n,r){return a.remove(e,o(t))},toggle:function(e,t,n){return a.toggle(e,o(t))},formatChanged:function(e,t,n,r,o){return a.formatChanged(t,n,r,o)}},editor:{getContent:function(e,t){return n.getContent(e)},setContent:function(e,t){return n.setContent(e,t)},insertContent:function(e,t){return n.insertContent(e)},addVisual:n.addVisual},selection:{getContent:function(e,t){return r.getContent(t)}},raw:{getModel:function(){return ve.some(t.getRawModel())}}}),e.rtc.isRemote;function o(e){return h(e)?e:{}}var i,a,n,r,t})})})}function bh(e){return e.rtcInstance||ph(e)}function yh(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")}function Ch(e){return 0===e.dom.length?(Ln(e),ve.none()):ve.some(e)}function xh(e,t,u,s){e.bind(function(a){return(s?jm:Hm)(a.dom,s?a.dom.length:0),t.filter(_n).map(function(e){var t=u,n=s,r=a.dom,o=e.dom,i=(n?r:o).length;n?(Vm(r,o,!1,!n),t.setStart(o,i)):(Vm(o,r,!1,!n),t.setEnd(o,i))})}).orThunk(function(){var e=s;return t.filter(function(e){return zl.isBookmarkNode(e.dom)}).bind(e?Pt:Bt).or(t).filter(_n).map(function(e){var n,r=s;Ot(n=e).each(function(e){var t=n.dom;r&&Bm(e,ss(t,0))?Hm(t,0):!r&&Pm(e,ss(t,t.length))&&jm(t,t.length)})})})}function wh(e,t,n){var r,o=(r=t,_e(_e({format:"html"},n=void 0===n?{}:n),{set:!0,selection:!0,content:r})),i=o;if(!o.no_events){var a=e.fire("BeforeSetContent",o);if(a.isDefaultPrevented())return void e.fire("SetContent",a);i=a}i.content=function(e,t){if("raw"===t.format)return t.content;var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,_e(_e({isRootContent:!0,forced_root_block:!1},o),t));return im({validate:e.validate},e.schema).serialize(i)}(e,i);var u=e.selection.getRng();!function(e,t){var n=ve.from(t.firstChild).map(kt.fromDom),r=ve.from(t.lastChild).map(kt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Bt).filter(_n).bind(Ch),i=r.bind(Pt).filter(_n).bind(Ch);xh(o,n,e,!0),xh(i,r,e,!1),e.collapse(!1)}(u,u.createContextualFragment(i.content)),e.selection.setRng(u),td(e,u),i.no_events||e.fire("SetContent",i)}function Sh(e,t,n){var r;e&&ke(e,t)&&(0===(r=U(e[t],function(e){return e!==n})).length?delete e[t]:e[t]=r)}Kg=function(e){var t,n=e.selection.getRng(),r=on(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Ep(Sp(Sp(t,r),function(e){return r(e.previousSibling)&&-1!==de(t,e.previousSibling)}),function(e){var t,n=e.previousSibling;Xa(t=e).remove(),Xa(n).append("<br><br>").append(t.childNodes)}))},wp["pre"]||(wp.pre=[]),wp.pre.push(Kg);var Eh=Et.each,kh=function(e,t,n){Eh(e.childNodes,function(e){kp(e)&&(t(e)&&n(e),e.hasChildNodes()&&kh(e,t,n))})},Nh=or([{keep:[]},{rename:["name"]},{removed:[]}]),_h=/^(src|href|style)$/,Ah=Et.each,Rh=al,Dh=Et.each,Th=Et.each,Oh=function(S,E,k,r){function N(n,e){var t;y((e=void 0===e?A:e).onformat)&&e.onformat(n,e,k,r),Th(e.styles,function(e,t){u.setStyle(n,t,il(e,k))}),!e.styles||(t=u.getAttrib(n,"style"))&&u.setAttrib(n,"data-mce-style",t),Th(e.attributes,function(e,t){u.setAttrib(n,t,il(e,k))}),Th(e.classes,function(e){e=il(e,k),u.hasClass(n,e)||u.addClass(n,e)})}function g(e,t){var n=!1;return Th(e,function(e){return!!ml(e)&&(V(e.collapsed)&&e.collapsed!==a||!u.is(t,e.selector)||jc(t)?void 0:(N(t,e),!(n=!0)))}),n}function o(x,e,l){var w=[],f=!0,d=A.inline||A.block,m=function(e){if(X(e)){var t=u.create(e);return N(t),t}return null}(d);Nl(x,e,function(e){var s,c=function(e){var t=!1,n=f,r=e.nodeName.toLowerCase(),o=e.parentNode,i=o.nodeName.toLowerCase();if(zn(e)&&x.getContentEditable(e)&&(n=f,f="true"===x.getContentEditable(e),t=!0),Wn(e)&&!function(e,t,n,r){if(e.getParam("format_empty_lines",!1,"boolean")&&gl(t)){var o=to(e.schema),i=(a=kt.fromDom(n),s=function(e){return jc(e.dom)},((c=(u=a).dom).parentNode?kr(kt.fromDom(c.parentNode),function(e){return!je(u,e)&&s(e)}):ve.none()).isSome());return se(o,r)&&Wr(kt.fromDom(n.parentNode),!1)&&!i}var a,u,s,c}(S,A,e,i))return s=null,void(dl(A)&&x.remove(e));if(dl(A)&&A.wrapper&&yp(S,e,E,k))s=null;else{if(f&&!t&&dl(A)&&!A.wrapper&&rl(S,r)&&ol(S,i,d)){var a=x.rename(e,d);return N(a),w.push(a),void(s=null)}if(ml(A)){var u=g(_,e);if(!u&&V(o)&&pl(A)&&(u=g(_,o)),!gl(A)||u)return void(s=null)}!f||t||!ol(S,d,r)||!ol(S,i,d)||!l&&jn(e)&&So(e.data)||jc(e)||gl(A)&&x.isBlock(e)?(s=null,Y(xe(e.childNodes),c),t&&(f=n),s=null):(s||(s=x.clone(m,!1),e.parentNode.insertBefore(s,e),w.push(s)),s.appendChild(e))}};Y(e,c)}),!0===A.links&&Y(w,function(e){var t=function(e){"A"===e.nodeName&&N(e,A),Y(xe(e.childNodes),t)};t(e)}),Y(w,function(e){var n,t,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=(n=0,Y(e.childNodes,function(e){var t;V(t=e)&&jn(t)&&0===t.length||Jc(e)||n++}),n);function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=cl(m,e.parentNode),m.getStyle(e,"color")&&t?m.setStyle(e,"text-decoration",t):m.getStyle(e,"text-decoration")===t&&m.setStyle(e,"text-decoration",null))}!(1<w.length)&&x.isBlock(e)||0!==y?(gl(A)||dl(A)&&A.wrapper)&&(A.exact||1!==y||(e=M((d=e).childNodes,zp).filter(function(e){return Pg(x,e,A)}).map(function(e){var t=x.clone(e,!1);return N(t),x.replace(t,d,!0),x.remove(e,!0),t}).getOr(d)),h=S,v=k,b=e,Dh(_,function(t){var r,e,n;gl(t)&&Dh(h.dom.select(t.inline,b),function(e){kp(e)&&Fp(h,t,v,e,t.exact?e:null)}),r=h.dom,(e=t).clear_child_styles&&(n=e.links?"*:not(a)":"*",Eh(r.select(n,b),function(n){kp(n)&&Eh(e.styles,function(e,t){r.setStyle(n,t,"")})}))}),s=A,yp(u=S,(f=e).parentNode,c=E,l=k)&&Fp(u,s,l,f)||s.merge_with_parents&&u.dom.getParent(f.parentNode,function(e){if(yp(u,e,c,l))return Fp(u,s,l,f),!0}),a=e,(i=A).styles&&i.styles.backgroundColor&&kh(a,Rp(x,"fontSize"),Dp(x,"backgroundColor",il(i.styles.backgroundColor,k))),m=x,p=e,(g=A).styles&&(g.styles.color||g.styles.textDecoration)&&(Et.walk(p,C,"childNodes"),C(p)),t=x,o=e,!gl(r=A)||"sub"!==r.inline&&"sup"!==r.inline||(kh(o,Rp(t,"fontSize"),Dp(t,"fontSize","")),t.remove(t.select("sup"===r.inline?"sub":"sup",o),!0)),Ap(x,A,0,e)):x.remove(e,!0)})}var e,t,n,i,_=S.formatter.get(E),A=_[0],a=!r&&S.selection.isCollapsed(),u=S.dom,s=S.selection;if("false"!==u.getContentEditable(s.getNode()))A&&(r?el(r)?g(_,r)||((e=u.createRng()).setStartBefore(r),e.setEndAfter(r),o(u,kl(S,e,_),!0)):o(u,r,!0):a&&gl(A)&&!Rl(S).length?function(e,t,n){var r,o=e.selection,i=o.getRng(),a=i.startOffset,u=i.startContainer.nodeValue,s=Vc(e.getBody(),o.getStart());s&&(r=Fg(s));var c,l,f,d,m=/[^\s\u00a0\u00ad\u200b\ufeff]/;u&&0<a&&a<u.length&&m.test(u.charAt(a))&&m.test(u.charAt(a-1))?(c=o.getBookmark(),i.collapse(!0),l=Bf(kl(e,i,e.formatter.get(t))),e.formatter.apply(t,n,l),o.moveToBookmark(c)):(s&&r.nodeValue===Cp||(f=e.getDoc(),d=Ug(!0).dom,r=(s=f.importNode(d,!0)).firstChild,i.insertNode(s),a=1),e.formatter.apply(t,n,s),o.setCursorLocation(r,a))}(S,E,k):(t=s.getNode(),n=_[0],S.settings.forced_root_block||!n.defaultBlock||u.getParent(t,u.isBlock)||Oh(S,n.defaultBlock),s.setRng(Cg(s.getRng())),Ll(s,!0,function(){Pl(S,function(e,t){var n=t?e:kl(S,e,_);o(u,n,!1)})}),tl(u,s,s.getRng()),S.nodeChanged()),i=S,Ep(wp[E],function(e){e(i)})),Cf(S,E,r,k);else{r=s.getNode();for(var c=0,l=_.length;c<l;c++){var f=_[c];if(f.ceFalseOverride&&ml(f)&&u.is(r,f.selector)){N(r,f);break}}Cf(S,E,r,k)}},Bh=function(e){return e.selection.getStart()},Ph=function(i,a,e){var u=Vp(i,a);ne(e,function(e,o){function t(e){var t,n=jp(i,u,o,e.similar,Hp(e)?e.vars:void 0),r=n.isSome();e.state.get()!==r&&(e.state.set(r),t=n.getOr(a),Hp(e)?e.callback(r,{node:t,format:o,parents:u}):Y(e.callbacks,function(e){return e(r,{node:t,format:o,parents:u})}))}Y([e.withSimilar,e.withoutSimilar],t),Y(e.withVars,t)})},Lh=Re(function(){return document.implementation.createHTMLDocument("undo")});function Ih(e){return e.select}function Mh(e){return e&&e.ownerDocument&&Ve(kt.fromDom(e.ownerDocument),kt.fromDom(e))}function Fh(a,u,e,s){function t(e,t){return wh(s,e,t)}function n(){var e=c(),t=null==e?void 0:e.anchorNode,n=null==e?void 0:e.focusNode;if(!e||!t||!n||rn(t)||rn(n))return!0;var r=a.createRng();r.setStart(t,e.anchorOffset),r.collapse(!0);var o=a.createRng();return o.setStart(n,e.focusOffset),o.collapse(!0),r.compareBoundaryPoints(r.START_TO_START,o)<=0}function r(e){var t=p();t.collapse(!!e),h(t)}function c(){return u.getSelection?u.getSelection():u.document.selection}var l,f,o,i,d,m,g=function(e,t){return d||(d={},m={},i.on("NodeChange",function(e){var n=e.element,r=x(n),o={};Et.each(d,function(e,n){C(n,r).each(function(t){m[n]||(Y(e,function(e){e(!0,{node:t,selector:n,parents:r})}),m[n]=e),o[n]=e})}),Et.each(m,function(e,t){o[t]||(delete m[t],Et.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),d[e]||(d[e]=[]),d[e].push(t),C(e,x(i.selection.getStart())).each(function(){m[e]=d[e]}),{unbind:function(){Sh(d,e,t),Sh(m,e,t)}}},p=function(){function e(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return-1}}var t,n,r,o=u.document;if(void 0!==s.bookmark&&!1===yd(s)){var i=dd(s);if(i.isSome())return i.map(function(e){return Ed(s,[e])[0]}).getOr(o.createRange())}try{(t=c())&&!rn(t.anchorNode)&&(n=0<t.rangeCount?t.getRangeAt(0):(t.createRange?t:o).createRange(),n=Ed(s,[n])[0])}catch(e){}return(n=n||(o.createRange?o.createRange():o.body.createTextRange())).setStart&&9===n.startContainer.nodeType&&n.collapsed&&(r=a.getRoot(),n.setStart(r,0),n.setEnd(r,0)),l&&f&&(0===e(n.START_TO_START,n,l)&&0===e(n.END_TO_END,n,l)?n=f:f=l=null),n},h=function(e,t){var n;if((r=e)&&(Ih(r)||Mh(r.startContainer)&&Mh(r.endContainer))){var r,o=Ih(e)?e:null;if(o){f=null;try{o.select()}catch(e){}}else{var i=c();if(e=s.fire("SetSelectionRange",{range:e,forward:t}).range,i){f=e;try{i.removeAllRanges(),i.addRange(e)}catch(e){}!1===t&&i.extend&&(i.collapse(e.endContainer,e.endOffset),i.extend(e.startContainer,e.startOffset)),l=0<i.rangeCount?i.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!i.setBaseAndExtent||xt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(i.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),i.anchorNode===e.startContainer&&i.focusNode===e.endContainer||i.setBaseAndExtent(n,0,n,1)),s.fire("AfterSetSelectionRange",{range:e,forward:t})}}},v={bookmarkManager:null,controlSelection:null,dom:o=a,win:u,serializer:e,editor:i=s,collapse:r,setCursorLocation:function(e,t){var n=a.createRng();V(e)&&V(t)?(n.setStart(e,t),n.setEnd(e,t),h(n),r(!1)):(Ol(a,n,s.getBody(),!0),h(n))},getContent:function(e){return n=(t=void 0===(t=e)?{}:t).format||"html",r=t,yh(s).selection.getContent(n,r);var t,n,r},setContent:t,getBookmark:function(e,t){return b.getBookmark(e,t)},moveToBookmark:function(e){return b.moveToBookmark(e)},select:function(e,t){var r=a,o=t;return ve.from(e).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Ol(r,n,e,!0),Ol(r,n,e,!1)),n}).each(h),e},isCollapsed:function(){var e=p(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:n,setNode:function(e){return t(a.getOuterHTML(e)),e},getNode:function(){return function(e,t){if(!t)return e;var n=t.startContainer,r=t.endContainer,o=t.startOffset,i=t.endOffset,a=t.commonAncestorContainer;return!t.collapsed&&(n===r&&i-o<2&&n.hasChildNodes()&&(a=n.childNodes[o]),3===n.nodeType&&3===r.nodeType&&(n=n.length===o?Sd(n.nextSibling,!0):n.parentNode,r=0===i?Sd(r.previousSibling,!1):r.parentNode,n&&n===r))?n:a&&3===a.nodeType?a.parentNode:a}(s.getBody(),p())},getSel:c,setRng:h,getRng:p,getStart:function(e){return xd(s.getBody(),p(),e)},getEnd:function(e){return wd(s.getBody(),p(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o=[],i=e.getRoot();if(n=e.getParent(n||xd(i,t,t.collapsed),e.isBlock),r=e.getParent(r||wd(i,t,t.collapsed),e.isBlock),n&&n!==i&&o.push(n),n&&r&&n!==r)for(var a,u=new Rr(n,i);(a=u.next())&&a!==r;)e.isBlock(a)&&o.push(a);return r&&n!==r&&r!==i&&o.push(r),o}(a,p(),e,t)},normalize:function(){var e=p();if(1<_l(c()).length||!Bl(s))return e;var t=Tf(a,e);return t.each(function(e){h(e,n())}),t.getOr(e)},selectorChanged:function(e,t){return g(e,t),v},selectorChangedWithUnbind:g,getScrollContainer:function(){for(var e,t=a.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){V(e)?(s.inline?Qf:ed)(s,e,t):td(s,p(),t)},placeCaretAt:function(e,t){return h(Ef(e,t,s.getDoc()))},getBoundingClientRect:function(){var e=p();return e.collapsed?ss.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){u=l=f=null,y.destroy()}},b=zl(v),y=wf(v,s);function C(t,e){return M(e,function(e){return o.is(e,t)})}function x(e){return o.getParents(e,null,o.getRoot())}return v.bookmarkManager=b,v.controlSelection=y,v}function Uh(e,t){var n,r,a,u,o=io();t.convert_fonts_to_spans&&(r=e,a=o,u=Et.explode(t.font_size_legacy_values),r.addNodeFilter("font",function(e){Y(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,Y(["color","face","size"],function(e){t.attr(e,null)})})})),n=o,e.addNodeFilter("strike",function(e){Y(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})}function zh(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}}function Hh(e,t){var n;try{n=atob(t)}catch(e){return ve.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return ve.some(new Blob([r],{type:e}))}function jh(e){return 0===e.indexOf("blob:")?(o=e,new Nr(function(e,t){function n(){t("Cannot convert "+o+" to Blob. Resource might not exist or is inaccessible.")}try{var r=new XMLHttpRequest;r.open("GET",o,!0),r.responseType="blob",r.onload=function(){200===r.status?e(r.response):n()},r.onerror=n,r.send()}catch(e){n()}})):0===e.indexOf("data:")?(n=e,new Nr(function(e){var t=zh(n);Hh(t.type,t.data).fold(function(){return e(new Blob([]))},e)})):null;var o,n}function Vh(e){return(e||"blobid")+mv++}function qh(r,d){var o={};return{findAll:function(e,n){n=n||w;var t=A(U(e?xe(e.getElementsByTagName("img")):[],function(e){var t=e.src;return xt.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&t&&t!==xt.transparentSrc&&(0===t.indexOf("blob:")?!r.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))}),function(f){if(void 0!==o[f.src])return new Nr(function(t){o[f.src].then(function(e){return"string"==typeof e?e:void t({image:f,blobInfo:e.blobInfo})})});var e=new Nr(function(e,t){var r,o,i,n,a,u,s,c,l;r=d,i=e,n=t,0!==(o=f).src.indexOf("blob:")?(u=(a=zh(o.src)).data,s=a.type,c=u,(l=r.getByData(c,s))?i({image:o,blobInfo:l}):jh(o.src).then(function(e){l=r.create(Vh(),e,c),r.add(l),i({image:o,blobInfo:l})},function(e){n(e)})):(l=r.getByUri(o.src))?i({image:o,blobInfo:l}):jh(o.src).then(function(t){var n=t;new Nr(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){c=zh(e).data,l=r.create(Vh(),t,c),r.add(l),i({image:o,blobInfo:l})})},function(e){n(e)})}).then(function(e){return delete o[e.image.src],e}).catch(function(e){return delete o[f.src],e});return o[f.src]=e});return Nr.all(t)}}}function $h(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Hd("br",1)).shortEnded=!0:r.empty().append(new Hd("#text",3)).value=xo}function Wh(n,e,t,r){return r.isEmpty(e,t,function(e){return(t=n.getElementRule(e.name))&&t.paddEmpty;var t})}function Kh(e,p){var t,o,i,h=e.schema;function n(t){var e,n,r=t.attr("src");(e=t).attr("src")===xt.transparentSrc||V(e.attr("data-mce-placeholder"))||V(t.attr("data-mce-bogus"))||((n=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(r))?ve.some({type:n[1],data:decodeURIComponent(n[2])}):ve.none()).filter(function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),ne(e.attributes.map,function(e,t){n.setAttribute(t,e)}),t.images_dataimg_filter(n)}return!0}(t,o)}).bind(function(e){var t=e.type,n=e.data;return ve.from(i.getByData(n,t)).orThunk(function(){return Hh(t,n).map(function(e){var t=i.create(Vh(),e,n);return i.add(t),t})})}).each(function(e){t.attr("src",e.blobUri())})}p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Et.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getWhiteSpaceElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){"br"===s&&(o=null);break}u=u.prev}o&&(o.remove(),Wh(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&$h(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new Hd("#text",3)).value=xo,o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r=e.length;if(!p.allow_unsafe_link_target)for(;r--;){var o=e[r];"a"===o.name&&"_blank"===o.attr("target")&&o.attr("rel",(n=void 0,n=(t=o.attr("rel"))?Et.trim(t):"",/\b(noopener)\b/g.test(n)?n:n.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r,o=e.length;o--;)"ul"!==(r=(n=e[o]).parent).name&&"ol"!==r.name||(n.prev&&"li"===n.prev.name?n.prev.append(n):((t=new Hd("li",1)).attr("style","list-style-type: none"),n.wrap(t)))}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t=h.getValidClasses(),n=e.length;n--;){for(var r=e[n],o=r.attr("class").split(" "),i="",a=0;a<o.length;a++){var u=o[a],s=!1,c=t["*"];c&&c[u]&&(s=!0),c=t[r.name],(s=!(s||!c||!c[u])||s)&&(i&&(i+=" "),i+=u)}i.length||(i=null),r.attr("class",i)}}),t=e,(i=(o=p).blob_cache)&&t.addAttributeFilter("src",function(e){return Y(e,n)})}function Xh(A,R){void 0===R&&(R=ro());var D={},T=[],O={},B={};(A=A||{}).validate=!("validate"in A)||A.validate,A.root_name=A.root_name||"body";function P(e){var t=e.name;t in D&&((r=O[t])?r.push(e):O[t]=[e]);for(var n=T.length;n--;){var r,o=T[n].name;o in e.attributes.map&&((r=B[o])?r.push(e):B[o]=[e])}return e}var e={schema:R,addAttributeFilter:function(e,n){hv(vv(e),function(e){for(var t=0;t<T.length;t++)if(T[t].name===e)return void T[t].callbacks.push(n);T.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(T)},addNodeFilter:function(e,n){hv(vv(e),function(e){var t=D[e];t||(D[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e,t=[];for(e in D)ke(D,e)&&t.push({name:e,callbacks:D[e]});return t},filterNode:P,parse:function(e,s){var t,n,r,o,i,c,a,l,f=[];function d(e){for(var t=R.getBlockElements(),n=e.prev;n&&3===n.type;){var r=n.value.replace(w,"");if(0<r.length)return n.value=r,0;var o=n.next;if(o){if(3===o.type&&o.value.length){n=n.prev;continue}if(!t[o.name]&&"script"!==o.name&&"style"!==o.name){n=n.prev;continue}}var i=n.prev;n.remove(),n=i}}s=s||{},O={},B={};function m(e,t){var n,r=new Hd(e,t);return e in D&&((n=O[e])?n.push(r):O[e]=[r]),r}var g=bv(pv("script,style,head,html,body,title,meta,param"),R.getBlockElements()),p=to(R),h=R.getNonEmptyElements(),v=R.children,b=A.validate,u=("forced_root_block"in s?s:A).forced_root_block,y=!1===u?"":!0===u?"p":u,C=R.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,w=/[ \t\r\n]+$/,S=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/,k=ke(C,s.context)||ke(C,A.root_name),N=Qd({validate:b,document:A.document,allow_html_data_urls:A.allow_html_data_urls,allow_svg_data_urls:A.allow_svg_data_urls,allow_script_urls:A.allow_script_urls,allow_conditional_comments:A.allow_conditional_comments,preserve_cdata:A.preserve_cdata,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(R.getSelfClosingElements()),cdata:function(e){l.append(m("#cdata",4)).value=e},text:function(e,t){var n,r;k||(e=e.replace(S," "),(r=l.lastChild)&&(ke(g,r.name)||"br"===r.name)&&(e=e.replace(x,""))),0!==e.length&&((n=m("#text",3)).raw=!!t,l.append(n).value=e)},comment:function(e){l.append(m("#comment",8)).value=e},pi:function(e,t){l.append(m(e,7)).value=t,d(l)},doctype:function(e){l.append(m("#doctype",10)).value=e,d(l)},start:function(e,t,n){var r=b?R.getElementRule(e):{};if(r){var o=m(r.outputName||e,1);o.attributes=t,o.shortEnded=n,l.append(o);var i=v[l.name];i&&v[o.name]&&!i[o.name]&&f.push(o);for(var a=T.length;a--;){var u=T[a].name;u in t.map&&((c=B[u])?c.push(o):B[u]=[o])}g[e]&&d(o),n||(l=o),!k&&C[e]&&(k=!0)}},end:function(e){var t,n,r,o,i=b?R.getElementRule(e):{};if(i){if(g[e]&&!k){if((t=l.firstChild)&&3===t.type)if(0<(n=t.value.replace(x,"")).length)t.value=n,t=t.next;else for(r=t.next,t.remove(),t=r;t&&3===t.type;)n=t.value,r=t.next,0!==n.length&&!E.test(n)||(t.remove(),t=r),t=r;if((t=l.lastChild)&&3===t.type)if(0<(n=t.value.replace(w,"")).length)t.value=n,t=t.prev;else for(r=t.prev,t.remove(),t=r;t&&3===t.type;)n=t.value,r=t.prev,0!==n.length&&!E.test(n)||(t.remove(),t=r),t=r}k&&C[e]&&(k=!1);var a=Wh(R,h,C,l),u=l.parent;i.paddInEmptyBlock&&a&&function(){for(var e=l;V(e);){if(e.name in p)return Wh(R,h,C,e);e=e.parent}}()?$h(A,s,g,l):i.removeEmpty&&a?g[l.name]?l.empty().remove():l.unwrap():i.paddEmpty&&(gv(o=l,"#text")&&o.firstChild.value===xo||a)&&$h(A,s,g,l),l=u}}},R),_=l=new Hd(s.context||A.root_name,11);if(N.parse(e,s.format),b&&f.length&&(s.context?s.invalid=!0:function(e){for(var t=pv("tr,td,th,tbody,thead,tfoot,table"),n=R.getNonEmptyElements(),r=R.getWhiteSpaceElements(),o=R.getTextBlockElements(),i=R.getSpecialElements(),a=function(e,t){if(void 0===t&&(t=e.parent),i[e.name])e.empty().remove();else{for(var n=0,r=e.children();n<r.length;n++){var o=r[n];R.isValidChild(t.name,o.name)||a(o,t)}e.unwrap()}},u=0;u<e.length;u++){var s,c=e[u],l=void 0,f=void 0;if(c.parent&&!c.fixed)if(o[c.name]&&"li"===c.parent.name){for(var d=c.next;d&&o[d.name];)d.name="li",d.fixed=!0,c.parent.insert(d,c.parent),d=d.next;c.unwrap()}else{for(var m=[c],l=c.parent;l&&!R.isValidChild(l.name,c.name)&&!t[l.name];l=l.parent)m.push(l);if(l&&1<m.length)if(R.isValidChild(l.name,c.name)){m.reverse();for(var g=s=P(m[0].clone()),p=0;p<m.length-1;p++){R.isValidChild(g.name,m[p].name)?(f=P(m[p].clone()),g.append(f)):f=g;for(var h=m[p].firstChild;h&&h!==m[p+1];){var v=h.next;f.append(h),h=v}g=f}Wh(R,n,r,s)?l.insert(c,m[0],!0):(l.insert(s,m[0],!0),l.insert(c,s)),l=m[0],(Wh(R,n,r,l)||gv(l,"br"))&&l.empty().remove()}else a(c);else c.parent&&("li"!==c.name?R.isValidChild(c.parent.name,"div")&&R.isValidChild("div",c.name)?c.wrap(P(new Hd("div",1))):a(c):!(d=c.prev)||"ul"!==d.name&&"ol"!==d.name?!(d=c.next)||"ul"!==d.name&&"ol"!==d.name?c.wrap(P(new Hd("ul",1))):d.insert(c,d.firstChild,!0):d.append(c))}}}(f)),y&&("body"===_.name||s.isRootContent)&&function(){function e(e){e&&((t=e.firstChild)&&3===t.type&&(t.value=t.value.replace(x,"")),(t=e.lastChild)&&3===t.type&&(t.value=t.value.replace(w,"")))}var t=_.firstChild,n=null;if(R.isValidChild(_.name,y.toLowerCase())){for(;t;){var r=t.next;3===t.type||1===t.type&&"p"!==t.name&&!g[t.name]&&!t.attr("data-mce-type")?(n||((n=m(y,1)).attr(A.forced_root_block_attrs),_.insert(n,t)),n.append(t)):(e(n),n=null),t=r}e(n)}}(),!s.invalid){for(a in O)if(ke(O,a)){for(c=D[a],o=(t=O[a]).length;o--;)t[o].parent||t.splice(o,1);for(n=0,r=c.length;n<r;n++)c[n](t,a,s)}for(n=0,r=T.length;n<r;n++)if((c=T[n]).name in B){for(o=(t=B[c.name]).length;o--;)t[o].parent||t.splice(o,1);for(o=0,i=c.callbacks.length;o<i;o++)c.callbacks[o](t,c.name,s)}}return _}};return Kh(e,A),A.inline_styles&&Uh(e,A),e}function Yh(e,t,n){-1===Et.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))}function Gh(L,I){var e=["data-mce-selected"],M=I&&I.dom?I.dom:Za.DOM,F=I&&I.schema?I.schema:ro(L);L.entity_encoding=L.entity_encoding||"named",L.remove_trailing_brs=!("remove_trailing_brs"in L)||L.remove_trailing_brs;var t,U=Xh(L,F),s=L,c=M;return(t=U).addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null)}}),t.addAttributeFilter("src,href,style",function(e,t){for(var n="data-mce-"+t,r=s.url_converter,o=s.url_converter_scope,i=e.length;i--;){var a=e[i],u=a.attr(n);void 0!==u?(a.attr(t,0<u.length?u:null),a.attr(n,null)):(u=a.attr(t),"style"===t?u=c.serializeStyle(c.parseStyle(u),a.name):r&&(u=r.call(o,u,t,a.name)),a.attr(t,0<u.length?u:null))}}),t.addAttributeFilter("class",function(e){for(var t=e.length;t--;){var n,r=e[t];r.attr("class")&&(n=r.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),r.attr("class",0<n.length?n:null))}}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length;r--;){var o=e[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(ve.from(o.firstChild).exists(function(e){return!So(e.value)})?o.unwrap():o.remove())}}),t.addNodeFilter("noscript",function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=Qo.decode(n.value))}}),t.addNodeFilter("script,style",function(e,t){for(var n=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},r=e.length;r--;){var o,i=e[r],a=i.firstChild?i.firstChild.value:"";"script"===t?((o=i.attr("type"))&&i.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<a.length&&(i.firstChild.value="// <![CDATA[\n"+n(a)+"\n// ]]>")):"xhtml"===s.element_format&&0<a.length&&(i.firstChild.value="\x3c!--\n"+n(a)+"\n--\x3e")}}),t.addNodeFilter("#comment",function(e){for(var t=e.length;t--;){var n=e[t];s.preserve_cdata&&0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=c.decode(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))}}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"))}}),t.addAttributeFilter("data-mce-type",function(e){Y(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:F,addNodeFilter:U.addNodeFilter,addAttributeFilter:U.addAttributeFilter,serialize:function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,S,E,k,N,_,A,R,D,T=_e({format:"html"},t=void 0===t?{}:t),O=(n=(m=e,E=g=T,(d=I)&&d.hasEventListeners("PreProcess")&&!E.no_events?(h=g,x=(p=d).dom,w=m.cloneNode(!0),(S=document.implementation).createHTMLDocument&&(b=S.createHTMLDocument(""),Et.each("BODY"===w.nodeName?w.childNodes:[w],function(e){b.body.appendChild(b.importNode(e,!0))}),w="BODY"!==w.nodeName?b.body.firstChild:b.body,v=x.doc,x.doc=b),y=p,C=_e(_e({},h),{node:w}),y.fire("PreProcess",C),v&&(x.doc=v),w):m),o=Eo((r=T).getInner?n.innerHTML:M.getOuterHTML(n)),r.selection||yo(kt.fromDom(n))?o:Et.trim(o)),B=(i=U,a=O,s=(u=T).selection?_e({forced_root_block:!1},u):u,c=i.parse(a,s),!P(f=c.lastChild)||P(l=f.prev)&&(f.remove(),l.remove()),c);function P(e){return e&&"br"===e.name}return"tree"===T.format?B:(k=I,N=T,_=B,D=im(L,F).serialize(_),N.no_events||!k?D:(A=k,R=_e(_e({},N),{content:D}),A.fire("PostProcess",R).content))},addRules:F.addValidElements,setRules:F.setValidElements,addTempAttr:R(Yh,U,e),getTempAttrs:J(e),getNodeFilters:U.getNodeFilters,getAttributeFilters:U.getAttributeFilters}}function Jh(e,t){var n=Gh(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}}function Qh(e,t,n){return r=n=void 0===n?{}:n,bh(e).editor.setContent(t,r);var r}function Zh(e){return ve.from(e).each(function(e){return e.destroy()})}function ev(e,t){var n,r,o,i,a,u,s,c=(n=e,r=U(xv,function(e){return ke(n,e)}),!1!==(o=n.forced_root_block)&&""!==o||r.push("forced_root_block (false only)"),W(r)),l=(s=Et.makeMap(t.plugins," "),W(Ae(Ae([],U(wv,g),!0),H(Sv,function(e){return g(e)?[e+" (moving to premium)"]:[]}),!0))),f=0<l.length,d=0<c.length,m="mobile"===t.theme;function g(e){return ke(s,e)}(f||d||m)&&(i=m?"\n\nThemes:\n- mobile":"",a=f?"\n\nPlugins:\n- "+l.join("\n- "):"",u=d?"\n\nSettings:\n- "+c.join("\n- "):"",console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+i+a+u))}function tv(e){var t=S(e)?e.join(" "):e;return U(A(X(t)?t.split(" "):[],Je),function(e){return 0<e.length})}function nv(e,t){return ke(e.sections(),t)}function rv(e,t){return ue(e,"toolbar_mode").orThunk(function(){return ue(e,"toolbar_drawer").map(function(e){return!1===e?"wrap":e})}).getOr(t)}function ov(e,t,n,r){var o,i,a,u,s,c,l,f,d=tv(n.forced_plugins),m=tv(r.plugins),g=nv(o=t,"mobile")?o.sections().mobile:{},p=g.plugins?tv(g.plugins):m,h=(i=(u=t,s=m,c=p,(a=e)&&(0,f=(l=u).sections(),nv(l,"mobile")&&"mobile"===f.mobile.theme)?U(c,R(T,Av)):a&&nv(u,"mobile")?c:s),[].concat(tv(d)).concat(tv(i)));if(xt.browser.isIE()&&T(h,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return Et.extend(r,{plugins:h.join(" ")})}function iv(e,t,n,r,o){var i,a,u,s,c,l,f,d,m=e?{mobile:(i=t,a={resize:!1,toolbar_mode:rv(o.mobile||{},"scrolling"),toolbar_sticky:!1},_e(_e(_e({},Rv),a),i?{menubar:!1}:{}))}:{},g=(c=["mobile"],ie(Cv(m,o),function(e,t){return T(c,t)},oe(l={}),oe(f={})),{sections:J((d={t:l,f:f}).t),settings:J(d.f)}),p=Et.extend(n,r,g.settings(),e&&nv(g,"mobile")?function(e){void 0===e&&(e={});var t=ue(g.sections(),"mobile").getOr({});return Et.extend({},e,t)}():{},{validate:!0,external_plugins:(u=r,s=g.settings().external_plugins||{},u&&u.external_plugins?Et.extend({},u.external_plugins,s):s)});return ov(e,g,r,p)}function av(e,t,n){return ve.from(t.settings[n]).filter(e)}function uv(e,t){return t.dom[e]}function sv(e,t){return parseInt(xn(t,e),10)}function cv(e,t,n){var r,o,i,a,u,s,c=kt.fromDom(e.getBody()),l=e.inline?c:kt.fromDom(Dt(c).dom.documentElement),f=(r=e.inline,i=t,a=n,u=(o=l).dom.getBoundingClientRect(),{x:i-(r?u.left+o.dom.clientLeft+Pv(o):0),y:a-(r?u.top+o.dom.clientTop+Bv(o):0)}),d=f.x,m=f.y,g=Tv(s=l),p=Ov(s);return 0<=d&&0<=m&&d<=g&&m<=p}function lv(o){function i(){var e=o.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():{open:t,close:t,reposition:t,getArgs:t};function t(){throw new Error("Theme did not provide a NotificationManager implementation.")}}function a(){return ve.from(c[0])}function u(){0<c.length&&i().reposition(c)}function s(t){z(c,function(e){return e===t}).each(function(e){c.splice(e,1)})}function t(n,e){if(void 0===e&&(e=!0),!o.removed&&(r=(t=o).inline?t.getBody():t.getContentAreaContainer(),ve.from(r).map(kt.fromDom).map(In).getOr(!1)))return e&&o.fire("BeforeOpenNotification",{notification:n}),M(c,function(e){return!((t=i().getArgs(e)).type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t}).getOrThunk(function(){o.editorManager.setActive(o);var e=i().open(n,function(){s(e),u(),a().fold(function(){return o.focus()},function(e){return kt.fromDom(e.getEl()).dom.focus()})});return c.push(e),u(),o.fire("OpenNotification",{notification:_e({},e)}),e});var t,r}var n,c=[],e=J(c);return(n=o).on("SkinLoaded",function(){var e=n.getParam("service_message");e&&t({text:e,type:"warning",timeout:0},!1),u()}),n.on("show ResizeEditor ResizeWindow NodeChange",function(){_r.requestAnimationFrame(u)}),n.on("remove",function(){Y(c.slice(),function(e){i().close(e)})}),{open:t,close:function(){a().each(function(e){i().close(e),s(e),u()})},getNotifications:e}}var fv,dv,mv=0,gv=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},pv=Et.makeMap,hv=Et.each,vv=Et.explode,bv=Et.extend,yv=Za.DOM,Cv=(fv=function(e,t){return h(e)&&h(t)?Cv(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o,i=e[r];for(o in i)ke(i,o)&&(n[o]=fv(n[o],i[o]))}return n}),xv="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),wv="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Sv="imagetools,toc".split(","),Ev=dt().deviceType,kv=Ev.isTouch(),Nv=Ev.isPhone(),_v=Ev.isTablet(),Av=["lists","autolink","autosave"],Rv={table_grid:!1,object_resizing:!1,resize:!1},Dv=(dv={},{add:function(e,t){dv[e]=t},get:function(e){return dv[e]||{icons:{}}},has:function(e){return ke(dv,e)}}),Tv=R(uv,"clientWidth"),Ov=R(uv,"clientHeight"),Bv=R(sv,"margin-top"),Pv=R(sv,"margin-left"),Lv=lu.PluginManager,Iv=lu.ThemeManager;function Mv(r){function o(){var e=r.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():{open:t,openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t};function t(){throw new Error("Theme did not provide a WindowManager implementation.")}}function i(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r?r.apply(n,e):void 0}}function n(t){r.fire("CloseWindow",{dialog:t}),0===(u=U(u,function(e){return e!==t})).length&&r.focus()}function a(e){r.editorManager.setActive(r),fd(r);var t,n=e();return t=n,u.push(t),r.fire("OpenWindow",{dialog:t}),n}var u=[];return r.on("remove",function(){Y(u,function(e){o().close(e)})}),{open:function(e,t){return a(function(){return o().open(e,t,n)})},openUrl:function(e){return a(function(){return o().openUrl(e,n)})},alert:function(e,t,n){var r=o();r.alert(e,i(n||r,t))},confirm:function(e,t,n){var r=o();r.confirm(e,i(n||r,t))},close:function(){ve.from(u[u.length-1]).each(function(e){o().close(e),n(e)})}}}function Fv(e,t){e.notificationManager.open({type:"error",text:t})}function Uv(e,t){e._skinLoaded?Fv(e,t):e.on("SkinLoaded",function(){Fv(e,t)})}function zv(e,t,n){yf(e,t,{message:n}),console.error(n)}function Hv(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t}function jv(e,t,n){zv(e,"PluginLoadError",Hv("plugin",t,n))}function Vv(e){var t,n;e.contentCSS=e.contentCSS.concat(dy(e,(n=(t=e).getParam("content_css"),X(n)?A(n.split(","),Je):S(n)?n:!1===n||t.inline?[]:["default"])),dy(e,Os(e)))}function qv(){function n(e,t){return{status:e,resultUri:t}}function t(e){return e in r}var r={};return{hasBlobUri:t,getResultUri:function(e){var t=r[e];return t?t.resultUri:null},isPending:function(e){return!!t(e)&&1===r[e].status},isUploaded:function(e){return!!t(e)&&2===r[e].status},markPending:function(e){r[e]=n(1,null)},markUploaded:function(e,t){r[e]=n(2,t)},removeFailed:function(e){delete r[e]},destroy:function(){r={}}}}function $v(e){return e+my+++("s"+(new Date).getTime().toString(36)+t()+t()+t());function t(){return Math.round(4294967295*Math.random()).toString(36)}}function Wv(){function e(e){return M(n,e).getOrUndefined()}function i(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t=e.id||$v("blobid"),n=e.name||t,r=e.blob;return{id:J(t),name:J(n),filename:J(e.filename||n+"."+({"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.type.toLowerCase()]||"dat")),blob:J(r),base64:J(e.base64),blobUri:J(e.blobUri||URL.createObjectURL(r)),uri:J(e.uri)}}function t(t){return e(function(e){return e.id()===t})}var n=[];return{create:function(e,t,n,r,o){if(X(e))return i({id:e,name:r,filename:o,blob:t,base64:n});if(h(e))return i(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t,getByUri:function(t){return e(function(e){return e.blobUri()===t})},getByData:function(t,n){return e(function(e){return e.base64()===t&&e.blob().type===n})},findFirst:e,removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||void URL.revokeObjectURL(e.blobUri())})},destroy:function(){Y(n,function(e){URL.revokeObjectURL(e.blobUri())}),n=[]}}}function Kv(u,s){function o(e,r,o,t){var i=new XMLHttpRequest;i.open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)};var n=new FormData;n.append("file",e.blob(),e.filename()),i.send(n)}function c(e,t){return{url:t,blobInfo:e,status:!0}}function l(e,t,n){return{url:"",blobInfo:e,status:!1,error:{message:t,options:n}}}function f(e,t){Et.each(d[e],function(e){e(t)}),delete d[e]}var d={};return!1===y(s.handler)&&(s.handler=o),{upload:function(e,t){return s.url||s.handler!==o?(n=e,r=t,n=Et.grep(e,function(e){return!u.isUploaded(e.blobUri())}),Nr.all(Et.map(n,function(e){return u.isPending(e.blobUri())?(n=e.blobUri(),new Nr(function(e){d[n]=d[n]||[],d[n].push(e)})):(i=e,t=s.handler,a=r,u.markPending(i.blobUri()),new Nr(function(r){var n;try{var o=function(){n&&n.close()};t(i,function(e){o(),u.markUploaded(i.blobUri(),e),f(i.blobUri(),c(i,e)),r(c(i,e))},function(e,t){var n=t||{};o(),u.removeFailed(i.blobUri()),f(i.blobUri(),l(i,e,n)),r(l(i,e,n))},function(t){t<0||100<t||ve.from(n).orThunk(function(){return ve.from(a).map(C)}).each(function(e){(n=e).progressBar.value(t)})})}catch(e){r(l(i,e.message,{}))}}));var i,t,a,n}))):new Nr(function(e){e([])});var n,r}}}function Xv(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}}function Yv(e,t){return Kv(t,{url:e.getParam("images_upload_url","","string"),basePath:e.getParam("images_upload_base_path","","string"),credentials:e.getParam("images_upload_credentials",!1,"boolean"),handler:e.getParam("images_upload_handler",null,"function")})}function Gv(l){function t(t){return function(e){return l.selection?t(e):[]}}function r(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e}function o(e,t,n){return e=r(e,'src="'+t+'"','src="'+n+'"'+(n===xt.transparentSrc?' data-mce-placeholder="1"':"")),r(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function f(t,n){Y(l.undoManager.data,function(e){"fragmented"===e.type?e.fragments=A(e.fragments,function(e){return o(e,t,n)}):e.content=o(e.content,t,n)})}function n(n){return u=u||Yv(l,g),v().then(t(function(c){var e=A(c,function(e){return e.blobInfo});return u.upload(e,Xv(l)).then(t(function(e){var s=[],t=A(e,function(e,t){var n,r,o,i,a=c[t].blobInfo,u=c[t].image;return e.status&&l.getParam("images_replace_blob_uris",!0,"boolean")?(m.removeByUri(u.src),hh(l)||(r=u,o=e.url,i=l.convertURL(o,"src"),f(r.src,o),l.$(r).attr({src:l.getParam("images_reuse_filename",!1,"boolean")?o+(-1===o.indexOf("?")?"?":"&")+(new Date).getTime():o,"data-mce-src":i}))):e.error&&(e.error.options.remove&&(f(u.getAttribute("src"),xt.transparentSrc),s.push(u)),n=e.error.message,Uv(l,cu.translate(["Failed to upload image: {0}",n]))),{element:u,status:e.status,uploadUri:e.url,blobInfo:a}});return 0<t.length&&h.fireIfChanged(),0<s.length&&(hh(l)?console.error("Removing images on failed uploads is currently unsupported for RTC"):l.undoManager.transact(function(){Y(s,function(e){l.dom.remove(e),m.removeByUri(e.src)})})),n&&n(t),t}))}))}function e(e){if(_s(l))return n(e)}function i(t){return!1!==j(p,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||l.getParam("images_dataimg_filter",w,"function")(t))}function a(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=g.getResultUri(n);if(t)return'src="'+t+'"';var r=(r=m.getByUri(n))||L(l.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null);return r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})}var u,s,c,d,m=Wv(),g=qv(),p=[],h=(d=iu(null),(c=l).on("change AddUndo",function(e){d.set(_e({},e.level))}),{fireIfChanged:function(){var t=c.undoManager.data;Z(t).filter(function(e){return!fh(d.get(),e)}).each(function(e){c.setDirty(!0),c.fire("change",{level:e,lastLevel:G(t,t.length-2).getOrNull()})})}}),v=function(){return(s=s||qh(g,m)).findAll(l.getBody(),i).then(t(function(e){return e=U(e,function(e){return"string"!=typeof e||void Uv(l,e)}),hh(l)||Y(e,function(e){f(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))};return l.on("SetContent",function(){(_s(l)?e:v)()}),l.on("RawSaveContent",function(e){e.content=a(e.content)}),l.on("GetContent",function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=a(e.content))}),l.on("PostRender",function(){l.parser.addNodeFilter("img",function(e){Y(e,function(e){var t,n=e.attr("src");m.getByUri(n)||(t=g.getResultUri(n))&&e.attr("src",t)})})}),{blobCache:m,addFilter:function(e){p.push(e)},uploadImages:n,uploadImagesAuto:e,scanForImages:v,destroy:function(){m.destroy(),g.destroy(),s=u=null}}}function Jv(e,t){function m(e){o="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t,n=py.create(o.name),r=n;return(t=o).classes.length&&py.addClass(r,t.classes.join(" ")),py.setAttribs(r,t.attrs),n}var n,o,r,g=t&&t.schema||ro({}),p=function(n,e,t){var r,o,i,a,u,s,c,l=0<e.length&&e[0],f=l&&l.name,d=(a=f,u="string"!=typeof(i=n)?i.nodeName.toLowerCase():i,!(!(c=(s=g.getElementRule(u))&&s.parentsRequired)||!c.length)&&(a&&-1!==Et.inArray(c,a)?a:c[0]));if(d)f===d?(o=e[0],e=e.slice(1)):o=d;else if(l)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=m(o)).appendChild(n),t&&(r||(r=py.create("div")).appendChild(n),Et.each(t,function(e){var t=m(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(n=m(o=e[0]),(r=py.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""}function Qv(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Et.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Et.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}var i;return"["!==r||(i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(a.attrs[i[1]]=i[2]),""})),a.name=t||"div",a}function Zv(n,e){var r,t,o="",i=(t=n.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),X(t)?t:"");if(""===i)return"";function a(e){return e.replace(/%(\w+)/g,"")}if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}if("preview"in e){var u=ue(e,"preview");if(fn(u,!1))return"";i=u.getOr(i)}var s,c=e.block||e.inline||"span",l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Et.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Et.map(e.split(/(?:~\+|~|\+)/),Qv),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=c),c=e.selector,Jv(l,n)):Jv([c],n),d=py.select(c,f)[0]||f.firstChild;return gy(e.styles,function(e,t){var n=a(e);n&&py.setStyle(d,t,n)}),gy(e.attributes,function(e,t){var n=a(e);n&&py.setAttrib(d,t,n)}),gy(e.classes,function(e){var t=a(e);py.hasClass(d,t)||py.addClass(d,t)}),n.fire("PreviewFormats"),py.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=py.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,gy(i.split(" "),function(e){var t=py.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=py.getStyle(n.getBody(),e,!0),"#ffffff"===py.toHex(t).toLowerCase())||"color"===e&&"#000000"===py.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),py.remove(f),o}function eb(c){var e,r,t,n,o,i,a=(n={},(o=function(e,t){e&&(X(e)?(Y(t=!S(t)?[t]:t,function(e){b(e.deep)&&(e.deep=!ml(e)),b(e.split)&&(e.split=!ml(e)||gl(e)),b(e.remove)&&ml(e)&&!gl(e)&&(e.remove="none"),ml(e)&&gl(e)&&(e.mixed=!0,e.block_expand=!0),X(e.classes)&&(e.classes=e.classes.split(/\s+/))}),n[e]=t):ne(e,function(e,t){o(t,e)}))})((r=(e=c).dom,t={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,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return zn(e)&&e.hasAttribute("href")},onformat:function(n,e,t){Et.each(t,function(e,t){r.setAttrib(n,t,e)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",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}]},Et.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t)),o(e.getParam("formats")),{get:function(e){return V(e)?n[e]:n},has:function(e){return ke(n,e)},register:o,unregister:function(e){return e&&n[e]&&delete n[e],n}}),l=iu(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(c),(i=c).on("mouseup keydown",function(e){var t=i,n=e.keyCode,r=t.selection,o=t.getBody();Hg(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==Cp||Hg(t,Vc(o,r.getStart())),37!==n&&39!==n||Hg(t,Vc(o,r.getStart()))}),{get:a.get,has:a.has,register:a.register,unregister:a.unregister,apply:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o=e,i=t,a=n,u=r;yh(c).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.toggle(r,o,i)},match:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.match(o,i,a,u);var o,i,a,u},closest:function(e){return t=e,yh(c).formatter.closest(t);var t},matchAll:function(e,t){return n=e,r=t,yh(c).formatter.matchAll(n,r);var n,r},matchNode:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.matchNode(o,i,a,u);var o,i,a,u},canApply:function(e){return t=e,yh(c).formatter.canApply(t);var t},formatChanged:function(e,t,n,r){return o=l,i=e,a=t,u=n,s=r,yh(c).formatter.formatChanged(o,i,a,u,s);var o,i,a,u,s},getCssText:R(Zv,c)}}function tb(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return 1;default:return}}function nb(s){var e,n,r,o,i,c=fu(),l=iu(0),f=iu(0),d={data:[],typing:!1,beforeChange:function(){var e=l,t=c;yh(s).undoManager.beforeChange(e,t)},add:function(e,t){return n=d,r=f,o=l,i=c,a=e,u=t,yh(s).undoManager.add(n,r,o,i,a,u);var n,r,o,i,a,u},undo:function(){return e=d,t=l,n=f,yh(s).undoManager.undo(e,t,n);var e,t,n},redo:function(){return e=f,t=d.data,yh(s).undoManager.redo(e,t);var e,t},clear:function(){var e=d,t=f;yh(s).undoManager.clear(e,t)},reset:function(){var e=d;yh(s).undoManager.reset(e)},hasUndo:function(){return e=d,t=f,yh(s).undoManager.hasUndo(e,t);var e,t},hasRedo:function(){return e=d,t=f,yh(s).undoManager.hasRedo(e,t);var e,t},transact:function(e){return t=d,n=l,r=e,yh(s).undoManager.transact(t,n,r);var t,n,r},ignore:function(e){var t=l,n=e;yh(s).undoManager.ignore(t,n)},extra:function(e,t){var n=d,r=f,o=e,i=t;yh(s).undoManager.extra(n,r,o,i)}};return hh(s)||(r=d,o=l,i=iu(!1),(n=s).on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){tb(e.command)||(gh(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){tb(e.command)||a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===fh(uh(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20<n)||224===n||91===n||r.typing||t||(r.beforeChange(),mh(r,!0,o),r.add({},e),i.set(!0))))}),n.on("mousedown",function(e){r.typing&&a(e)}),n.on("input",function(e){e.inputType&&("insertReplacementText"===e.inputType||"insertText"===e.inputType&&null===e.data||"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)&&a(e)}),n.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||n.nodeChanged()})),(e=s).addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),d;function a(e){mh(r,!1,o),r.add({},e)}}function rb(e){return"keydown"===e.type||"keyup"===e.type}function ob(e){var t=e.keyCode;return t===Lf.BACKSPACE||t===Lf.DELETE}function ib(e,t){return ze(kt.fromDom(t),e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string"))}function ab(e,t,n){var r,o,i=(r=e,o=t,U(Za.DOM.getParents(n.container(),"*",o),r));return ve.from(i[i.length-1])}function ub(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Lr(n)?jn(n.nextSibling)?ss(n.nextSibling,0):ss.after(n):Fr(t)?ss(n,r+1):t:Lr(n)?jn(n.previousSibling)?ss(n.previousSibling,n.previousSibling.data.length):ss.before(n):Ur(t)?ss(n,r-1):t}function sb(e){return go(e)||ho(e)}function cb(e,t){return Ve(e,t)?pr(t,sb,(n=e,function(e){return je(n,kt.fromDom(e.dom.parentNode))})):ve.none();var n}function lb(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),r=(n=(t=e).getBody()).firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))}function fb(e,t){return{from:e,to:t}}function db(e,t){return cb(kt.fromDom(e),kt.fromDom(t.container())).map(function(e){return{block:e,position:t}})}function mb(e){var t,n=z(t=Dn(e),mo).fold(J(t),function(e){return t.slice(0,e)});return Y(n,Ln),n}function gb(e,t){return M(ym(t,e).reverse(),function(e){return Wr(e)}).each(Ln)}function pb(e,t,n,r){if(Wr(n))return hm(n),nf(n.dom);0===U(Lt(r),function(e){return!Wr(e)}).length&&Wr(t)&&qt(r,kt.fromTag("br"));var o=tf(n.dom,ss.before(r.dom));return Y(mb(t),function(e){qt(r,e)}),gb(e,t),o}function hb(e,t,n){if(Wr(n))return Ln(n),Wr(t)&&hm(t),nf(t.dom);var r=rf(n.dom);return Y(mb(t),function(e){Pn(n,e)}),gb(e,t),r}function vb(e,t){Hc(e,t.dom).map(function(e){return e.getNode()}).map(kt.fromDom).filter(Br).each(Ln)}function bb(e,t,n){return vb(!0,t),vb(!1,n),(Ve(o=n,r=t)?(i=ym(r,o),ve.from(i[i.length-1])):ve.none()).fold(R(hb,e,t,n),R(pb,e,t,n));var r,o,i}function yb(e,t,n,r){return t?bb(e,r,n):bb(e,n,r)}function Cb(t,n){var e,r,o,i,a,u,s,c=kt.fromDom(t.getBody()),l=(e=c.dom,r=n,((o=t.selection.getRng()).collapsed?(a=r,u=db(i=e,ss.fromRangeStart(o)),s=u.bind(function(e){return Ql(a,i,e.position).bind(function(e){return db(i,e).map(function(e){return t=i,n=a,Wn((r=e).position.getNode())&&!1===Wr(r.block)?Hc(!1,r.block.dom).bind(function(e){return e.isEqual(r.position)?Ql(n,t,e).bind(function(e){return db(t,e)}):ve.some(r)}).getOr(r):r;var t,n,r})})}),dn(u,s,fb).filter(function(e){return!1===je(e.from.block,e.to.block)&&Ot((n=e).from.block).bind(function(t){return Ot(n.to.block).filter(function(e){return je(t,e)})}).isSome()&&!1===Yn((t=e).from.block.dom)&&!1===Yn(t.to.block.dom);var t,n})):ve.none()).bind(function(e){return yb(c,n,e.from.block,e.to.block)}));return l.each(function(e){t.selection.setRng(e.toRange())}),l.isSome()}function xb(e,t){var n=kt.fromDom(t),r=R(je,e);return gr(n,bo,r).isSome()}function wb(e){var n,r,o,t,i,a,u,s,c,l,f=kt.fromDom(e.getBody()),d=e.selection.getRng();return a=d,c=tf((i=f).dom,ss.fromRangeStart(a)).isNone(),l=ef(i.dom,ss.fromRangeEnd(a)).isNone(),!xb(u=i,(s=a).startContainer)&&!xb(u,s.endContainer)&&c&&l?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=f,r=e.selection,o=r.getRng(),dn(cb(n,kt.fromDom(o.startContainer)),cb(n,kt.fromDom(o.endContainer)),function(e,t){return!1===je(e,t)&&(o.deleteContents(),yb(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))}function Sb(e,t){return!e.selection.isCollapsed()&&wb(e)}function Eb(e,t,n,r,o){return ve.from(t._selectionOverrides.showCaret(e,n,r,o))}function kb(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?ve.none():ve.some(((r=(n=t).ownerDocument.createRange()).selectNode(n),r))}function Nb(e,t,n){var r=tc(1,e.getBody(),t),o=ss.fromRangeStart(r),i=o.getNode();if(Ec(i))return Eb(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Ec(a))return Eb(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return wy(e)||xy(e)});return Ec(u)?Eb(1,e,u,!1,n):ve.none()}function _b(e,t,n){return t.collapsed?Nb(e,t,n).getOr(t):t}function Ab(e){return rp(e)||Zg(e)}function Rb(e){return op(e)||ep(e)}function Db(n,r,e,t,o,i){var a,u;return Eb(t,n,i.getNode(!o),o,!0).each(function(e){var t;r.collapsed?(t=r.cloneRange(),o?t.setEnd(e.startContainer,e.startOffset):t.setStart(e.endContainer,e.endOffset),t.deleteContents()):r.deleteContents(),n.selection.setRng(e)}),a=n.dom,jn(u=e)&&0===u.data.length&&a.remove(u),!0}function Tb(e,t){var n=e.selection.getRng();if(!jn(n.commonAncestorContainer))return!1;var r=t?uc.Forwards:uc.Backwards,o=Ic(e.getBody()),i=R(ic,t?o.next:o.prev),a=t?Ab:Rb,u=rc(r,e.getBody(),n),s=ub(t,i(u));if(!s||!ac(u,s))return!1;if(a(s))return Db(e,n,u.getNode(),r,t,s);var c=i(s);return!!(c&&a(c)&&ac(s,c))&&Db(e,n,u.getNode(),r,t,c)}function Ob(l,f,d){return Ql(f,l,d).bind(function(e){return s=e.getNode(),bo(kt.fromDom(s))||ho(kt.fromDom(s))||(o=l,u=e,nc(!(i=f),a=d).fold(function(){return nc(i,u).fold(D,c)},c))?ve.none():f&&Yn(e.getNode())||!1===f&&Yn(e.getNode(!0))?(t=l,n=d,r=e.getNode(!1===f),cb(kt.fromDom(t),kt.fromDom(n.getNode())).map(function(e){return Wr(e)?Sy.remove(e.dom):Sy.moveToElement(r)}).orThunk(function(){return ve.some(Sy.moveToElement(r))})):f&&op(d)||!1===f&&rp(d)?ve.some(Sy.moveToPosition(e)):ve.none();var t,n,r,o,i,a,u,s;function c(e){return Or(kt.fromDom(e))&&!Js(a,u,o)}})}function Bb(e,t){return ve.from(vf(e.getBody(),t))}function Pb(m,g){var e=m.selection.getNode();return Bb(m,e).filter(Yn).fold(function(){return s=m.getBody(),l=tc((c=g)?1:-1,s,m.selection.getRng()),f=ss.fromRangeStart(l),d=kt.fromDom(s),(!1===c&&op(f)?ve.some(Sy.remove(f.getNode(!0))):c&&rp(f)?ve.some(Sy.remove(f.getNode())):!1===c&&rp(f)&&_m(d,f)?cp(d,f).map(function(e){return Sy.remove(e.getNode())}):c&&op(f)&&Nm(d,f)?lp(d,f).map(function(e){return Sy.remove(e.getNode())}):(r=s,e=c,a=(o=f).getNode(!1===(i=e)),u=i?"after":"before",zn(a)&&a.getAttribute("data-mce-caret")===u?(n=o.getNode(!1===(t=e)),(t&&Yn(n.nextSibling)?ve.some(Sy.moveToElement(n.nextSibling)):!1===t&&Yn(n.previousSibling)?ve.some(Sy.moveToElement(n.previousSibling)):ve.none()).fold(function(){return Ob(r,e,o)},ve.some)):Ob(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return ve.some(Sy.remove(e))},function(e){return ve.some(Sy.moveToElement(e))},function(e){return Js(n,e,t)?ve.none():ve.some(Sy.moveToPosition(e))});var t,n}))).exists(function(e){return e.fold(function(e){return o._selectionOverrides.hideFakeCaret(),Qm(o,i,kt.fromDom(e)),!0},(r=i=g,function(e){var t=r?ss.before(e):ss.after(e);return n.selection.setRng(t.toRange()),!0}),(t=n=o=m,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i});var r,e,o,t,n,i,a,u,s,c,l,f,d},w)}function Lb(e,t){var n=e.selection.getNode();return!(!Yn(n)||Gn(n))&&Bb(e,n.parentNode).filter(Yn).fold(function(){return Y(bu(kt.fromDom(e.getBody()),".mce-offscreen-selection"),Ln),Qm(e,t,kt.fromDom(e.selection.getNode())),lb(e),!0},w)}function Ib(e){var t,n=e.dom,r=e.selection,o=vf(e.getBody(),r.getNode());return Xn(o)&&n.isBlock(o)&&n.isEmpty(o)&&(t=n.create("br",{"data-mce-bogus":"1"}),n.setHTML(o,""),o.appendChild(t),r.setRng(ss.before(t).toRange())),!0}function Mb(e,t){return(e.selection.isCollapsed()?Pb:Lb)(e,t)}function Fb(e,t){return!!e.selection.isCollapsed()&&(n=e,r=t,o=ss.fromRangeStart(n.selection.getRng()),Ql(r,n.getBody(),o).filter(function(e){return(r?Jg:Qg)(e)}).bind(function(e){return ve.from(Qs(r?0:-1,e))}).exists(function(e){return n.selection.select(e),!0}));var n,r,o}function Ub(e){return Ey(e)&&e.data[0]===wo}function zb(e){return Ey(e)&&e.data[e.data.length-1]===wo}function Hb(e){return e.ownerDocument.createTextNode(wo)}function jb(e,t){return(e?function(e){if(Ey(e.previousSibling))return zb(e.previousSibling)||e.previousSibling.appendData(wo),e.previousSibling;if(Ey(e))return Ub(e)||e.insertData(0,wo),e;var t=Hb(e);return e.parentNode.insertBefore(t,e),t}:function(e){if(Ey(e.nextSibling))return Ub(e.nextSibling)||e.nextSibling.insertData(0,wo),e.nextSibling;if(Ey(e))return zb(e)||e.appendData(wo),e;var t=Hb(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t})(t)}function Vb(e,t){return jn(e.container())?jb(t,e.container()):jb(t,e.getNode())}function qb(e,t){var n=t.get();return n&&e.container()===n&&Lr(n)}function $b(n,e){return e.fold(function(e){yc(n.get());var t=ky(e);return n.set(t),ve.some(ss(t,t.length-1))},function(e){return nf(e).map(function(e){if(qb(e,n))return ss(n.get(),1);yc(n.get());var t=Vb(e,!0);return n.set(t),ss(t,1)})},function(e){return rf(e).map(function(e){if(qb(e,n))return ss(n.get(),n.get().length-1);yc(n.get());var t=Vb(e,!1);return n.set(t),ss(t,t.length-1)})},function(e){yc(n.get());var t=Ny(e);return n.set(t),ve.some(ss(t,1))})}function Wb(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return ve.none()}function Kb(e,t){return Gs(t,e)||e}function Xb(e,t,n){var r=yy(n),o=Kb(t,r.container());return ab(e,o,r).fold(function(){return ef(o,r).bind(R(ab,e,o)).map(function(e){return _y.before(e)})},ve.none)}function Yb(e,t){return null===Vc(e,t)}function Gb(e,t,n){return ab(e,t,n).filter(R(Yb,t))}function Jb(e,t,n){var r=Cy(n);return Gb(e,t,r).bind(function(e){return tf(e,r).isNone()?ve.some(_y.start(e)):ve.none()})}function Qb(e,t,n){var r=yy(n);return Gb(e,t,r).bind(function(e){return ef(e,r).isNone()?ve.some(_y.end(e)):ve.none()})}function Zb(e,t,n){var r=Cy(n),o=Kb(t,r.container());return ab(e,o,r).fold(function(){return tf(o,r).bind(R(ab,e,o)).map(function(e){return _y.after(e)})},ve.none)}function ey(e){return!1===(t=Ay(e),"rtl"===Za.DOM.getStyle(t,"direction",!0)||(n=t.textContent,by.test(n)));var t,n}function ty(e,t,n){return Wb([Xb,Jb,Qb,Zb],[e,t,n]).filter(ey)}function ny(e){return e.fold(J("before"),J("start"),J("end"),J("after"))}function ry(e){return e.fold(_y.before,_y.before,_y.after,_y.after)}function oy(e){return e.fold(_y.start,_y.start,_y.end,_y.end)}function iy(a,e,u,t,n,s){return dn(ab(e,u,t),ab(e,u,n),function(e,t){return e!==t&&(r=t,o=Gs(e,n=u),i=Gs(r,n),o&&o===i)?_y.after(a?e:t):s;var n,r,o,i}).getOr(s)}function ay(e,r){return e.fold(w,function(e){return n=r,!(ny(t=e)===ny(n)&&Ay(t)===Ay(n));var t,n})}function uy(e,t){return e?t.fold(i(ve.some,_y.start),ve.none,i(ve.some,_y.after),ve.none):t.fold(ve.none,i(ve.some,_y.before),ve.none,i(ve.some,_y.end))}function sy(e,a,u,s){var t=ub(e,s),c=ty(a,u,t);return ty(a,u,t).bind(R(uy,e)).orThunk(function(){return n=a,r=u,o=c,i=ub(t=e,s),Ql(t,r,i).map(R(ub,t)).fold(function(){return o.map(ry)},function(e){return ty(n,r,e).map(R(iy,t,n,r,i,e)).filter(R(ay,o))}).filter(ey);var t,n,r,o,i})}function cy(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error||r.log).apply(r,Ae([e],t,!1))}var ly,fy,dy=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return A(e,function(e){return/^[a-z0-9\-]+$/i.test(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)})},my=0,gy=Et.each,py=Za.DOM,hy=[9,27,Lf.HOME,Lf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Lf.DOWN,Lf.UP,Lf.LEFT,Lf.RIGHT].concat(xt.browser.isFirefox()?[224]:[]),vy="data-mce-placeholder",by=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,yy=R(ub,!0),Cy=R(ub,!1),xy=Xn,wy=Yn,Sy=or([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Ey=jn,ky=R(jb,!0),Ny=R(jb,!1),_y=or([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Ay=function(e){return e.fold(u,u,u,u)};function Ry(e,t,n){var r=e?1:-1;return t.setRng(ss(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0}function Dy(e,t){return e===uc.Backwards?q(t):t}function Ty(e,t,n,r){for(var o,i,a,u,s=Ic(n),c=r,l=[];c;){var f=(a=s,u=c,t===uc.Forwards?a.next(u):a.prev(u));if(!f)break;if(Wn(f.getNode(!1)))return t===uc.Forwards?{positions:Dy(t,l).concat([f]),breakType:ly.Br,breakAt:ve.some(f)}:{positions:Dy(t,l),breakType:ly.Br,breakAt:ve.some(f)};if(f.isVisible()){if(e(c,f)){var d=(o=c,Wn((i=f).getNode(t===uc.Forwards))?ly.Br:!1===Js(o,i)?ly.Block:ly.Wrap);return{positions:Dy(t,l),breakType:d,breakAt:ve.some(f)}}l.push(f),c=f}else c=f}return{positions:Dy(t,l),breakType:ly.Eol,breakAt:ve.none()}}function Oy(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===uc.Backwards?t.concat(e):[e].concat(t)}).getOr([])}function By(e,i){return L(e,function(e,o){return e.fold(function(){return ve.some(o)},function(r){return dn(Q(r.getClientRects()),Q(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},ve.none())}function Py(t,e){return Q(e.getClientRects()).bind(function(e){return By(t,e.left)})}function Ly(n){function e(e){return A(e,function(e){var t=Au(e);return t.node=n,t})}if(zn(n))return e(n.getClientRects());if(jn(n)){var t=n.ownerDocument.createRange();return t.setStart(n,0),t.setEnd(n,n.data.length),e(t.getClientRects())}}function Iy(e){return H(e,Ly)}R(sy,!1),R(sy,!0),(fy=ly={})[fy.Br=0]="Br",fy[fy.Block=1]="Block",fy[fy.Wrap=2]="Wrap",fy[fy.Eol=3]="Eol";var My,Fy,Uy=R(Ty,ss.isAbove,-1),zy=R(Ty,ss.isBelow,1),Hy=R(Oy,-1,Uy),jy=R(Oy,1,zy);function Vy(o,i,a,e,u,t){function n(e){var t=Iy([e]);-1===o&&(t=t.reverse());for(var n=0;n<t.length;n++){var r=t[n];if(!a(r,l)){if(0<c.length&&i(r,pe(c))&&s++,r.line=s,u(r))return!0;c.push(r)}}}var s=0,c=[],l=pe(t.getClientRects());if(!l)return c;var r=t.getNode();return n(r),function(e,t,n,r){for(;r=Ys(r,e,Vr,t);)if(n(r))return}(o,e,n,r),c}function qy(t){return function(e){return e.line>t}}function $y(t){return function(e){return e.line===t}}function Wy(e,t){return Math.abs(e.left-t)}function Ky(e,t){return Math.abs(e.right-t)}function Xy(e,t){return e>=t.left&&e<=t.right}function Yy(e,t){return e>=t.top&&e<=t.bottom}function Gy(e,o,i){return void 0===i&&(i=w),me(e,function(e,t){if(Xy(o,t))return i(t)?t:e;if(Xy(o,e))return i(e)?e:t;var n=Math.min(Wy(e,o),Ky(e,o)),r=Math.min(Wy(t,o),Ky(t,o));return r===n&&se(t,"node")&&zC(t.node)||r<n?t:e})}function Jy(e,t,n,r,o){var i=HC(r,e,Vr,t,!o);do{if(!i||n(i))return}while(i=HC(i,e,Vr,t))}function Qy(e,t,n){function r(e){return!cn(e.node)&&!Jn(e.node)}var o,i,a,u=Iy(U(xe(e.getElementsByTagName("*")),Ks)),s=U(u,R(Yy,n));if((a=Gy(s,t,r))&&((a=Gy(function(e,r,t){function n(t,e){var n=U(Iy([e]),function(e){return!t(e,r)});return o=o.concat(n),0===n.length}void 0===t&&(t=!0);var o=[];return o.push(r),Jy(My.Up,e,R(n,Tu),r.node,t),Jy(My.Down,e,R(n,Ou),r.node,t),o}(e,a,r(a)),t,r))&&Ks(a.node)))return{node:(o=a).node,before:Wy(o,i=t)<Ky(o,i)};return null}function Zy(e,t){e.selection.setRng(t),td(e,e.selection.getRng())}function e0(e,t,n){return ve.some(_b(e,t,n))}function t0(e,t,n,r,o,i){var a=t===uc.Forwards,u=Ic(e.getBody()),s=R(ic,a?u.next:u.prev),c=a?r:o;if(!n.collapsed){var l=Pu(n);if(i(l))return Eb(t,e,l,t===uc.Backwards,!1)}var f=rc(t,e.getBody(),n);if(c(f))return kb(e,f.getNode(!a));var d=ub(a,s(f)),m=Hr(n);if(!d)return m?ve.some(n):ve.none();if(c(d))return Eb(t,e,d.getNode(!a),a,!1);var g=s(d);return g&&c(g)&&ac(d,g)?Eb(t,e,g.getNode(!a),a,!1):m?e0(e,d.toRange(),!1):ve.none()}function n0(t,e,n,r,o,i){var a=rc(e,t.getBody(),n),u=pe(a.getClientRects()),s=e===My.Down;if(!u)return ve.none();var c,l=U((s?UC:FC)(t.getBody(),qy(1),a),$y(1)),f=u.left,d=Gy(l,f);if(d&&i(d.node)){var m=Math.abs(f-d.left),g=Math.abs(f-d.right);return Eb(e,t,d.node,m<g,!1)}if(c=r(a)?a.getNode():o(a)?a.getNode(!0):Pu(n)){var p=function(e,t,n,r){function o(e){return pe(e.getClientRects())}var i,a,u,s=Ic(t),c=[],l=0,f=1===e?(i=s.next,a=Ou,u=Tu,ss.after(r)):(i=s.prev,a=Tu,u=Ou,ss.before(r)),d=o(f);do{if(f.isVisible()){var m=o(f);if(!u(m,d)){0<c.length&&a(m,pe(c))&&l++;var g=Au(m);if(g.position=f,g.line=l,n(g))return c;c.push(g)}}}while(f=i(f));return c}(e,t.getBody(),qy(1),c),h=Gy(U(p,$y(1)),f);if(h)return e0(t,h.position.toRange(),!1);if(h=pe(U(p,$y(0))))return e0(t,h.position.toRange(),!1)}return 0===l.length?jC(t,s).filter(s?o:r).map(function(e){return _b(t,e.toRange(),!1)}):ve.none()}function r0(t,e,n){return jC(t,e).filter(n).exists(function(e){return t.selection.setRng(e.toRange()),!0})}function o0(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)}function i0(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")}function a0(t,e,n){return $b(e,n).map(function(e){return o0(t,e),n})}function u0(e,t,n){return!!Is(e)&&(o=t,i=n,a=(r=e).getBody(),u=ss.fromRangeStart(r.selection.getRng()),sy(i,R(ib,r),a,u).bind(function(e){return a0(r,o,e)}).isSome());var r,o,i,a,u}function s0(e,t,n){return!!Is(t)&&(r=e,i=(o=t).selection.getRng(),a=r?ss.fromRangeEnd(i):ss.fromRangeStart(i),!!y(o.selection.getSel().modify)&&(r&&Fr(a)?Ry(!0,o.selection,a):!(r||!Ur(a))&&Ry(!1,o.selection,a)));var r,o,i,a}function c0(g){var p=iu(null),h=R(ib,g);return g.on("NodeChange",function(e){var n,r,o,t,i,a,u,s,c,l,f,d,m;!Is(g)||xt.browser.isIE()&&e.initial||(i=h,a=g.dom,u=e.parents,Y($(s=U(A(bu(kt.fromDom(a.getRoot()),'*[data-mce-selected="inline-boundary"]'),function(e){return e.dom}),i),c=U(u,i)),R(i0,!1)),Y($(c,s),R(i0,!0)),f=p,(l=g).selection.isCollapsed()&&!0!==l.composing&&f.get()&&(d=ss.fromRangeStart(l.selection.getRng()),ss.isTextPosition(d)&&!1===(Fr(m=d)||Ur(m))&&(o0(l,Vs(f.get(),d)),f.set(null))),n=h,r=g,o=p,t=e.parents,r.selection.isCollapsed()&&Y(U(t,n),function(e){var t=ss.fromRangeStart(r.selection.getRng());ty(n,r.getBody(),t).bind(function(e){return a0(r,o,e)})}))}),p}function l0(n,t,r){if(Is(n)){var e=jC(n,t).getOrThunk(function(){var e=n.selection.getRng();return t?ss.fromRangeEnd(e):ss.fromRangeStart(e)});return ty(R(ib,n),n.getBody(),e).exists(function(e){var t=ry(e);return $b(r,t).exists(function(e){return o0(n,e),!0})})}return!1}function f0(t,n){return function(e){return $b(n,e).exists(function(e){return o0(t,e),!0})}}function d0(r,o,i,a){var u=r.getBody(),s=R(ib,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),ty(s,u,ss.fromRangeStart(r.selection.getRng())).map(oy).map(f0(r,o))}),r.nodeChanged()}function m0(e,t,n){if(e.selection.isCollapsed()&&Is(e)){var r=ss.fromRangeStart(e.selection.getRng());return o=t,a=n,u=r,s=(i=e).getBody(),c=Gs(u.container(),s)||s,l=R(ib,i),(f=ty(l,c,u)).bind(function(e){return a?e.fold(J(ve.some(oy(e))),ve.none,J(ve.some(ry(e))),ve.none):e.fold(ve.none,J(ve.some(ry(e))),ve.none,J(ve.some(oy(e))))}).map(f0(i,o)).getOrThunk(function(){var t=zc(a,c,u),e=t.bind(function(e){return ty(l,c,e)});return dn(f,e,function(){return ab(l,c,u).exists(function(e){return!!dn(nf(o=e),rf(o),function(e,t){var n=ub(!0,e),r=ub(!1,t);return ef(o,n).forall(function(e){return e.isEqual(r)})}).getOr(!0)&&(Qm(i,a,kt.fromDom(e)),!0);var o})}).orThunk(function(){return e.bind(function(e){return t.map(function(e){return a?d0(i,o,u,e):d0(i,o,e,u),!0})})}).getOr(!1)})}var i,o,a,u,s,c,l,f;return!1}function g0(e){return 1===zt(e)}function p0(g,p){var t,e=kt.fromDom(g.getBody()),n=kt.fromDom(g.selection.getStart()),h=U(z(t=ym(n,e),mo).fold(J(t),function(e){return t.slice(0,e)}),g0);return Z(h).exists(function(e){var t,n,r,o,i,a,u,s,c,l=ss.fromRangeStart(g.selection.getRng()),f=p,d=l,m=e.dom;return!(!dn(nf(m),rf(m),function(e,t){var n=ub(!0,e),r=ub(!1,t),o=ub(!1,d);return f?ef(m,o).exists(function(e){return e.isEqual(r)&&d.isEqual(n)}):tf(m,o).exists(function(e){return e.isEqual(n)&&d.isEqual(r)})}).getOr(!0)||jc((t=e).dom)&&Mg(t.dom)||(n=p,o=e,0===(c=A(U(h,R(Wg,r=g)),function(e){return e.dom})).length?Qm(r,n,o):(a=o.dom,s=Vg(c,(u=Ug(!1)).dom),qt(kt.fromDom(a),u),Ln(kt.fromDom(a)),i=ss(s,0),r.selection.setRng(i.toRange())),0))})}function h0(e,t){return!!e.selection.isCollapsed()&&p0(e,t)}function v0(e,t,n){return e._selectionOverrides.hideFakeCaret(),Qm(e,t,kt.fromDom(n)),!0}function b0(e,t){return e.selection.isCollapsed()?(i=e,u=(a=t)?Zg:ep,s=a?uc.Forwards:uc.Backwards,c=rc(s,i.getBody(),i.selection.getRng()),u(c)?v0(i,a,c.getNode(!a)):ve.from(ub(a,c)).filter(function(e){return u(e)&&ac(c,e)}).exists(function(e){return v0(i,a,e.getNode(!a))})):(r=t,o=(n=e).selection.getNode(),!!Jn(o)&&v0(n,r,o));var n,r,o,i,a,u,s,c}function y0(e){var t=parseInt(e,10);return isNaN(t)?0:t}function C0(e,t){return(e||"table"===Nt(t)?"margin":"padding")+("rtl"===xn(t,"direction")?"-right":"-left")}function x0(e){var n,t=$C(e);return!e.mode.isReadOnly()&&(1<t.length||(n=e,j(t,function(e){var t=wn(e,C0(Ts(n),e)).map(y0).getOr(0);return"false"!==n.dom.getContentEditable(e.dom)&&0<t})))}function w0(e){return po(e)||ho(e)}function S0(e,s){var c=e.dom,t=e.selection,n=e.formatter,r=e.getParam("indentation","40px","string"),l=/[a-z%]+$/i.exec(r)[0],f=parseInt(r,10),d=Ts(e),o=ks(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==o||c.getParent(t.getNode(),c.isBlock)||n.apply("div"),Y($C(e),function(e){var t,n=c,r=s,o=f,i=l,a=e.dom,u=C0(d,kt.fromDom(a));"outdent"===r?(t=Math.max(0,y0(a.style[u])-o),n.setStyle(a,u,t?t+i:"")):(t=y0(a.style[u])+o+i,n.setStyle(a,u,t))})}function E0(e,t){if(e.selection.isCollapsed()&&x0(e)){var n=e.dom,r=e.selection.getRng(),o=ss.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&ip(kt.fromDom(i),o))return S0(e,"outdent"),!0}return!1}function k0(e,t){e.getDoc().execCommand(t,!1,null)}function N0(e){return void 0===e.touches||1!==e.touches.length?ve.none():ve.some(e.touches[0])}function _0(e,t){return ke(e,t.nodeName)}function A0(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),s=i.getStart(),c=e.getBody(),l=ks(e);if(s&&zn(s)&&l){var f=c.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&(d=u,m=c,g=s,!F(bm(kt.fromDom(g),kt.fromDom(m)),function(e){return _0(d,e.dom)}))){for(var d,m,g,p,h,v=i.getRng(),b=v.startContainer,y=v.startOffset,C=v.endContainer,x=v.endOffset,w=yd(e),s=c.firstChild;s;)p=u,jn(h=s)||zn(h)&&!_0(p,h)&&!Jc(h)?function(e,t){if(jn(t)){if(0===t.nodeValue.length)return 1;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||_0(e,t.nextSibling)))return 1}}(u,s)?(s=(n=s).nextSibling,o.remove(n)):(t||(t=o.create(l,Ns(e)),s.parentNode.insertBefore(t,s),r=!0),s=(n=s).nextSibling,t.appendChild(n)):(t=null,s=s.nextSibling);r&&w&&(v.setStart(b,y),v.setEnd(C,x),i.setRng(v),e.nodeChanged())}}}function R0(e,t){t.hasAttribute("data-mce-caret")&&(zr(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))}function D0(e,t){var n=vr(kt.fromDom(e.getBody()),"*[data-mce-caret]").map(function(e){return e.dom}).getOrNull();if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void R0(e,n)):void(Mr(n)&&(R0(e,n),e.undoManager.add()))}function T0(e,t,n){var r,o,i,a=Ic(e.getBody()),u=R(ic,1===t?a.next:a.prev);!n.collapsed||""===ks(e)||(r=e.dom.getParent(n.startContainer,"PRE"))&&(u(ss.fromRangeStart(n))||(i=e.dom.create(ks(e)),(!xt.ie||11<=xt.ie)&&(i.innerHTML='<br data-mce-bogus="1">'),o=i,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse()))}function O0(t,e){return n=t,r=e?uc.Forwards:uc.Backwards,o=n.selection.getRng(),t0(n,r,o,rp,op,WC).orThunk(function(){return T0(n,r,o),ve.none()}).exists(function(e){return Zy(t,e),!0});var n,r,o}function B0(t,e){return r=e?1:-1,o=(n=t).selection.getRng(),n0(n,r,o,function(e){return rp(e)||tp(e)},function(e){return op(e)||np(e)},WC).orThunk(function(){return T0(n,r,o),ve.none()}).exists(function(e){return Zy(t,e),!0});var n,r,o}function P0(e,t){return r0(e,t,t?op:rp)}function L0(e){return T(["figcaption"],Nt(e))}function I0(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t}function M0(e,t,n){(n?Pn:Wt)(e,t)}function F0(h,v){var b=kt.fromDom(h.getBody()),y=ss.fromRangeStart(h.selection.getRng()),C=ks(h),x=Ns(h),e=y,t=R(je,b);return pr(kt.fromDom(e.container()),mo,t).filter(L0).exists(function(){if(d=b,m=y,v?(p=d.dom,zy(p,m).breakAt.isNone()):(g=d.dom,Uy(g,m).breakAt.isNone())){var e=(t=b,r=x,o=v,""===(n=C)?(l=o,M0(t,f=kt.fromTag("br"),l),I0(f)):(i=t,a=o,u=r,s=kt.fromTag(n),c=kt.fromTag("br"),hn(s,u),Pn(s,c),M0(i,s,a),I0(c)));return h.selection.setRng(e),!0}var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p;return!1})}function U0(e,t){return!!e.selection.isCollapsed()&&F0(e,t)}function z0(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}}function H0(e,t){return M((n=t,H(A(e,function(e){return _e({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:te},e)}),function(e){return n.keyCode===e.keyCode&&n.shiftKey===e.shiftKey&&n.altKey===e.altKey&&n.ctrlKey===e.ctrlKey&&n.metaKey===e.metaKey?[e]:[]})),function(e){return e.action()});var n}function j0(t,e){var n=e?uc.Forwards:uc.Backwards,r=t.selection.getRng();return t0(t,n,r,Zg,ep,Jn).exists(function(e){return Zy(t,e),!0})}function V0(t,e){var n=e?1:-1,r=t.selection.getRng();return n0(t,n,r,Zg,ep,Jn).exists(function(e){return Zy(t,e),!0})}function q0(e,t){return r0(e,t,t?ep:Zg)}function $0(e,t,n,r,o){var i,a=bu(kt.fromDom(n),"td,th,caption").map(function(e){return e.dom}),u=U((i=e,H(a,function(e){var t,n={left:(t=Au(e.getBoundingClientRect())).left- -1,top:t.top- -1,right:t.right+-2,bottom:t.bottom+-2,width:t.width+-1,height:t.height+-1};return[{x:n.left,y:i(n),cell:e},{x:n.right,y:i(n),cell:e}]})),function(e){return t(e,o)}),s=r,c=o;return L(u,function(e,r){return e.fold(function(){return ve.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-s)+Math.abs(e.y-c)),n=Math.sqrt(Math.abs(r.x-s)+Math.abs(r.y-c));return ve.some(n<t?r:e)})},ve.none()).map(function(e){return e.cell})}function W0(e,t,n){var r,o,i=e(t,n);return i.breakType===ly.Wrap&&0===i.positions.length||!Wn(n.getNode())&&i.breakType===ly.Br&&1===i.positions.length?(r=e,o=t,!i.breakAt.exists(function(e){return r(o,e).breakAt.isSome()})):i.breakAt.isNone()}function K0(t,e,n,r){var o,i,a,u=t.selection.getRng(),s=e?1:-1;return!(!Ws()||(o=e,i=n,a=ss.fromRangeStart(u),!Hc(!o,i).exists(function(e){return e.isEqual(a)}))||(Eb(s,t,n,!e,!1).each(function(e){Zy(t,e)}),0))}function X0(u,s,c){var e,t,n=(e=!!s,t=c.getNode(e),zn(t)&&"TABLE"===t.nodeName?ve.some(t):ve.none()),r=!1===s;n.fold(function(){return Zy(u,c.toRange())},function(a){return Hc(r,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Zy(u,c.toRange())},function(e){var n,r,o=s,i=a,t=c;(r=ks(n=u))?n.undoManager.transact(function(){var e=kt.fromTag(r);hn(e,Ns(n)),Pn(e,kt.fromTag("br")),(o?$t:qt)(kt.fromDom(i),e);var t=n.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),Zy(n,t)}):Zy(n,t.toRange())})})}function Y0(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.selection.getRng(),p=ss.fromRangeStart(g),h=e.getBody();if(t||!YC(r,p))return!(!t||!GC(r,p))&&(o=h,d=i=n,X0(e,t,v=Z((m=a=p).getClientRects()).bind(function(e){return XC(d,e.left,e.top)}).bind(function(e){return Py(nf(t=e).map(function(e){return[e].concat(zy(t,e).positions)}).getOr([]),m);var t}).orThunk(function(){return Q(a.getClientRects()).bind(function(e){return By(jy(o,ss.after(i)),e.left)})}).getOr(ss.after(i))),!0);var v=(u=h,l=s=n,Q((f=c=p).getClientRects()).bind(function(e){return KC(l,e.left,e.top)}).bind(function(e){return Py(rf(t=e).map(function(e){return Uy(t,e).positions.concat(e)}).getOr([]),f);var t}).orThunk(function(){return Q(c.getClientRects()).bind(function(e){return By(Hy(u,ss.before(s)),e.left)})}).getOr(ss.before(s)));return X0(e,t,v),!0}function G0(n,r,o){return ve.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return ve.from(n.dom.getParent(t,"table")).map(function(e){return o(n,r,e,t)})}).getOr(!1)}function J0(e,t){return G0(e,t,K0)}function Q0(e,t){return G0(e,t,Y0)}function Z0(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(xo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var s=new Rr(t,t);n=s.current();){if(jn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=s.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else Wn(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),td(e,u)}}function eC(e){return ve.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))}function tC(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t}function nC(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)}function rC(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e}function oC(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!zn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t}function iC(e){e.innerHTML='<br data-mce-bogus="1">'}function aC(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t}function uC(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)}function sC(e,t,n){return!1===jn(t)?n:e?1===n&&t.data.charAt(n-1)===wo?0:n:n===t.data.length-1&&t.data.charAt(n)===wo?t.data.length:n}function cC(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}function lC(e,t){var n=ks(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;ve.from(t.style).map(i.parseStyle).each(function(e){var t=Sn(kt.fromDom(o)),n=_e(_e({},t),e);i.setStyles(o,n)}),dn(ve.from(t.class).map(function(e){return e.split(/\s+/)}),ve.from(o.className).map(function(e){return U(e.split(/\s+/),function(e){return""!==e})}),function(t,e){var n=U(e,function(e){return!T(t,e)}),r=Ae(Ae([],t,!0),n,!0);i.setAttrib(o,"class",r.join(" "))});var n=["style","class"],r=ae(t,function(e,t){return!T(n,t)});i.setAttribs(o,r)}(e,t,Ns(e))}function fC(a,e){function t(e){var t,n=m,r=l.getTextInlineElements(),o=e||"TABLE"===C||"HR"===C?c.create(e||p):b.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))c.setAttrib(o,"style",null),c.setAttrib(o,"class",null);else for(;r[n.nodeName]&&(jc(n)||Jc(n)||(t=n.cloneNode(!1),c.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t))),(n=n.parentNode)&&n!==F;);return lC(a,o),iC(i),o}function n(e){var t,n,r=sC(e,m,g);if(!jn(m)||!(e?0<r:r<m.nodeValue.length)){if(m.parentNode===b&&s&&!e)return 1;if(e&&zn(m)&&m===b.firstChild)return 1;if(aC(m,"TABLE")||aC(m,"HR"))return s&&!e||!s&&e;var o=new Rr(m,b);for(jn(m)&&(e&&0===r?o.prev():e||r!==m.nodeValue.length||o.next());t=o.current();){if(zn(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),f[n]&&"br"!==n))return}else if(jn(t)&&!qr(t.nodeValue))return;e?o.prev():o.next()}return 1}}function r(){u=/^(H[1-6]|PRE|FIGURE)$/.test(C)&&"HGROUP"!==x?t(p):t(),a.getParam("end_container_on_empty_block",!1)&&uC(c,y)&&c.isEmpty(b)?u=c.split(y,b):c.insertAfter(u,b),Z0(a,u)}var o,u,i,s,c=a.dom,l=a.schema,f=l.getNonEmptyElements(),d=a.selection.getRng();Tf(c,d).each(function(e){d.setStart(e.startContainer,e.startOffset),d.setEnd(e.endContainer,e.endOffset)});var m=d.startContainer,g=d.startOffset,p=ks(a),h=!(!e||!e.shiftKey),v=!(!e||!e.ctrlKey);zn(m)&&m.hasChildNodes()&&(s=g>m.childNodes.length-1,m=m.childNodes[Math.min(g,m.childNodes.length-1)]||m,g=s&&jn(m)?m.nodeValue.length:0);var b,y,C,x,w,S,p,E,k,N,_,A,R,D,T,O,B,P,L,I,M,F=cC(c,m);F&&((p&&!h||!p&&h)&&(m=function(e,t,n,r){var o,i,a,u,s,c,l=p||"P",f=e.dom,d=cC(f,n),m=f.getParent(n,f.isBlock);if(!m||!uC(f,m)){if(s=((m=m||d)===e.getBody()||(c=m)&&/^(TD|TH|CAPTION)$/.test(c.nodeName)?m:m.parentNode).nodeName.toLowerCase(),!m.hasChildNodes())return lC(e,o=f.create(l)),m.appendChild(o),t.setStart(o,0),t.setEnd(o,0),o;for(a=n;a.parentNode!==m;)a=a.parentNode;for(;a&&!f.isBlock(a);)a=(i=a).previousSibling;if(i&&e.schema.isValidChild(s,l.toLowerCase())){for(lC(e,o=f.create(l)),i.parentNode.insertBefore(o,i),a=i;a&&!f.isBlock(a);)u=a.nextSibling,o.appendChild(a),a=u;t.setStart(n,r),t.setEnd(n,r)}}return n}(a,d,m,g)),y=(b=c.getParent(m,c.isBlock))?c.getParent(b.parentNode,c.isBlock):null,C=b?b.nodeName.toUpperCase():"","LI"!==(x=y?y.nodeName.toUpperCase():"")||v||(y=(b=y).parentNode,C=x),/^(LI|DT|DD)$/.test(C)&&c.isEmpty(b)?(k=t,N=y,_=b,A=p,I=(E=a).dom,M=E.selection.getRng(),N!==E.getBody()&&(D=(A=nC(R=N)&&nC(R.parentNode)?"LI":A)?k(A):I.create("BR"),oC(N,_,!0)&&oC(N,_,!1)?tC(N,"LI")?(T=rC(N),I.insertAfter(D,T),(null===(L=(P=N).parentNode)||void 0===L?void 0:L.firstChild)===P?I.remove(T):I.remove(N)):I.replace(D,N):(oC(N,_,!0)?tC(N,"LI")?(I.insertAfter(D,rC(N)),D.appendChild(I.doc.createTextNode(" ")),D.appendChild(N)):N.parentNode.insertBefore(D,N):oC(N,_,!1)?I.insertAfter(D,rC(N)):(N=rC(N),(O=M.cloneRange()).setStartAfter(_),O.setEndAfter(N),B=O.extractContents(),"LI"===A&&(B.firstChild&&"LI"===B.firstChild.nodeName)?(D=B.firstChild,I.insertAfter(B,N)):(I.insertAfter(B,N),I.insertAfter(D,N))),I.remove(_)),Z0(E,D))):p&&b===a.getBody()||(p=p||"P",Pr(b)?(u=zr(b),c.isEmpty(b)&&iC(b),lC(a,u),Z0(a,u)):n()?r():n(!0)?(u=b.parentNode.insertBefore(t(),b),Z0(a,aC(b,"HR")?u:b)):((S=(w=d).cloneRange()).setStart(w.startContainer,sC(!0,w.startContainer,w.startOffset)),S.setEnd(w.endContainer,sC(!1,w.endContainer,w.endOffset)),(o=S.cloneRange()).setEndAfter(b),i=o.extractContents(),Y(Vu(kt.fromDom(i),_n),function(e){var t=e.dom;t.nodeValue=Eo(t.nodeValue)}),function(e){for(;jn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(i),u=i.firstChild,c.insertAfter(i,b),function(e,t){var n,r,o=u,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;zn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(n=i.length;n--;)!(o=i[n]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(r=o)&&"A"===r.nodeName&&e.isEmpty(r)&&e.remove(o)}}(c,f),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(c,b),c.isEmpty(b)&&iC(b),u.normalize(),c.isEmpty(u)?(c.remove(u),r()):(lC(a,u),Z0(a,u))),c.setAttrib(u,"id",""),a.fire("NewBlock",{newBlock:u})))}function dC(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),td(e,r)}function mC(e,t){var n=kt.fromTag("br");qt(kt.fromDom(t),n),e.undoManager.add()}function gC(e,t){JC(e.getBody(),t)||$t(kt.fromDom(t),kt.fromTag("br"));var n=kt.fromTag("br");$t(kt.fromDom(t),n),dC(e,n.dom,!1),e.undoManager.add()}function pC(e){return e&&"A"===e.nodeName&&"href"in e}function hC(e){return e.fold(D,pC,pC,D)}function vC(e,t){t.fold(te,R(mC,e),R(gC,e),te)}function bC(e,t){var n,r,o,i=(r=R(ib,n=e),o=ss.fromRangeStart(n.selection.getRng()),ty(r,n.getBody(),o).filter(hC));i.isSome()?i.each(R(vC,e)):function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Tf(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e){for(var t,n=new Rr(c,l),r=e.getNonEmptyElements();t=n.next();)if(r[t.nodeName.toLowerCase()]||0<t.length)return 1}(e.schema)&&(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0),n=i.create("br"),ls(i,a,n),dC(e,n,r),e.undoManager.add()}(e,t)}function yC(e,t){return eC(e).filter(function(e){return 0<t.length&&ze(kt.fromDom(e),t)}).isSome()}function CC(e,t){return yC(e,e.getParam("no_newline_selector",""))}function xC(n){return function(e,t){return""===ks(e)===n}}function wC(n){return function(e,t){return eC(e).filter(function(e){return ho(kt.fromDom(e))}).isSome()===n}}function SC(n,r){return function(e,t){return eC(e).fold(J(""),function(e){return e.nodeName.toUpperCase()})===n.toUpperCase()===r}}function EC(e){return SC("pre",e)}function kC(n){return function(e,t){return e.getParam("br_in_pre",!0)===n}}function NC(e,t){return yC(e,e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption"))}function _C(e,t){return t}function AC(e){var t=ks(e),n=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")}function RC(e,t){return function(n,r){return L(e,function(e,t){return e&&t(n,r)},!0)?ve.some(t):ve.none()}}function DC(e,t){var n,r;n=e,r=t,Wb([RC([CC],QC.none()),RC([SC("summary",!0)],QC.br()),RC([EC(!0),kC(!1),_C],QC.br()),RC([EC(!0),kC(!1)],QC.block()),RC([EC(!0),kC(!0),_C],QC.block()),RC([EC(!0),kC(!0)],QC.br()),RC([wC(!0),_C],QC.br()),RC([wC(!0)],QC.block()),RC([xC(!0),_C,AC],QC.block()),RC([xC(!0)],QC.br()),RC([NC],QC.br()),RC([xC(!1),_C],QC.br()),RC([AC],QC.block())],[n,!(!r||!r.shiftKey)]).getOr(QC.none()).fold(function(){bC(e,t)},function(){fC(e,t)},te)}function TC(e){return e.stopImmediatePropagation()}function OC(e){return e.keyCode===Lf.PAGE_UP||e.keyCode===Lf.PAGE_DOWN}function BC(e,t,n){n&&!e.get()?t.on("NodeChange",TC,!0):!n&&e.get()&&t.off("NodeChange",TC),e.set(n)}function PC(n,r){var e=r.container(),t=r.offset();return jn(e)?(e.insertData(t,n),ve.some(ss(e,t+n.length))):oc(r).map(function(e){var t=kt.fromText(n);return(r.isAtEnd()?$t:qt)(e,t),ss(t.dom,n.length)})}function LC(i,a){return function(e){return r=i,(!Om(o=e)&&(n=o,tf((t=r).dom,n).isNone()||ef(t.dom,n).isNone()||ip(t,n)||ap(t,n)||_m(t,n)||Nm(t,n)||Dm(r,o)||Tm(r,o))?t1:n1)(a);var t,n,r,o}}function IC(e){var t,n,r=ss.fromRangeStart(e.selection.getRng()),o=kt.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=R(ib,e),a=ss.fromRangeStart(e.selection.getRng());return ty(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return tf(n.dom,ss.before(e))},function(e){return nf(e)},function(e){return rf(e)},function(e){return ef(n.dom,ss.after(e))})})).bind(LC(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1}function MC(e){var o,i,a,u,s,t,n,r,c,l,f,d,m,g,p=c0(e);return e.on("keyup compositionstart",R(D0,e)),g=p,(m=e).on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=m,n=g,r=e,o=dt().os,H0([{keyCode:Lf.RIGHT,action:z0(O0,t,!0)},{keyCode:Lf.LEFT,action:z0(O0,t,!1)},{keyCode:Lf.UP,action:z0(B0,t,!1)},{keyCode:Lf.DOWN,action:z0(B0,t,!0)},{keyCode:Lf.RIGHT,action:z0(J0,t,!0)},{keyCode:Lf.LEFT,action:z0(J0,t,!1)},{keyCode:Lf.UP,action:z0(Q0,t,!1)},{keyCode:Lf.DOWN,action:z0(Q0,t,!0)},{keyCode:Lf.RIGHT,action:z0(j0,t,!0)},{keyCode:Lf.LEFT,action:z0(j0,t,!1)},{keyCode:Lf.UP,action:z0(V0,t,!1)},{keyCode:Lf.DOWN,action:z0(V0,t,!0)},{keyCode:Lf.RIGHT,action:z0(u0,t,n,!0)},{keyCode:Lf.LEFT,action:z0(u0,t,n,!1)},{keyCode:Lf.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:z0(VC,t,n)},{keyCode:Lf.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:z0(qC,t,n)},{keyCode:Lf.UP,action:z0(U0,t,!1)},{keyCode:Lf.DOWN,action:z0(U0,t,!0)}],r).each(function(e){r.preventDefault()}))}),d=p,(f=e).on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=d,r=e,H0([{keyCode:Lf.BACKSPACE,action:z0(E0,t=f,!1)},{keyCode:Lf.BACKSPACE,action:z0(Mb,t,!1)},{keyCode:Lf.DELETE,action:z0(Mb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Tb,t,!1)},{keyCode:Lf.DELETE,action:z0(Tb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(m0,t,n,!1)},{keyCode:Lf.DELETE,action:z0(m0,t,n,!0)},{keyCode:Lf.BACKSPACE,action:z0(yg,t,!1)},{keyCode:Lf.DELETE,action:z0(yg,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Fb,t,!1)},{keyCode:Lf.DELETE,action:z0(Fb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(b0,t,!1)},{keyCode:Lf.DELETE,action:z0(b0,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Sb,t,!1)},{keyCode:Lf.DELETE,action:z0(Sb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Cb,t,!1)},{keyCode:Lf.DELETE,action:z0(Cb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(h0,t,!1)},{keyCode:Lf.DELETE,action:z0(h0,t,!0)}],r).each(function(e){r.preventDefault()}))}),f.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(n=e,H0([{keyCode:Lf.BACKSPACE,action:z0(Ib,t=f)},{keyCode:Lf.DELETE,action:z0(Ib,t)}],n))}),(l=e).on("keydown",function(e){var t,n,r;e.keyCode===Lf.ENTER&&(t=l,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),DC(t,n)})))}),(c=e).on("keydown",function(e){var t;!1===e.isDefaultPrevented()&&(t=e,H0([{keyCode:Lf.SPACEBAR,action:z0(IC,c)}],t).each(function(e){t.preventDefault()}))}),n=t=e,r=du(function(){n.composing||Um(n)},0),ZC.isIE()&&(n.on("keypress",function(e){r.throttle()}),n.on("remove",function(e){r.cancel()})),t.on("input",function(e){!1===e.isComposing&&Um(t)}),s=p,(u=e).on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=s,r=e,H0([{keyCode:Lf.END,action:z0(P0,t=u,!0)},{keyCode:Lf.HOME,action:z0(P0,t,!1)},{keyCode:Lf.END,action:z0(q0,t,!0)},{keyCode:Lf.HOME,action:z0(q0,t,!1)},{keyCode:Lf.END,action:z0(l0,t,!0,n)},{keyCode:Lf.HOME,action:z0(l0,t,!1,n)}],r).each(function(e){r.preventDefault()}))}),o=e,i=p,e1.os.isOSX()||(a=iu(!1),o.on("keydown",function(e){OC(e)&&BC(a,o,!0)}),o.on("keyup",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(r=e,H0([{keyCode:Lf.PAGE_UP,action:z0(l0,t=o,!1,n=i)},{keyCode:Lf.PAGE_DOWN,action:z0(l0,t,!0,n)}],r)),OC(e)&&a.get()&&(BC(a,o,!1),o.nodeChanged())})),p}(Fy=My=My||{})[Fy.Up=-1]="Up",Fy[Fy.Down=1]="Down";var FC=R(Vy,My.Up,Tu,Ou),UC=R(Vy,My.Down,Ou,Tu),zC=Yn,HC=Ys,jC=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=ss.fromRangeEnd(n),i=zy(r,o);return Z(i.positions)}return o=ss.fromRangeStart(n),Q((i=Uy(r,o)).positions)},VC=R(s0,!0),qC=R(s0,!1),$C=function(e){return U(A(e.selection.getSelectedBlocks(),kt.fromDom),function(e){return!w0(e)&&!Ot(e).exists(w0)&&pr(e,function(e){return Xn(e.dom)||Yn(e.dom)}).exists(function(e){return Xn(e.dom)})})},WC=Yn,KC=R($0,function(e){return e.bottom},function(e,t){return e.y<t}),XC=R($0,function(e){return e.top},function(e,t){return e.y>t}),YC=R(W0,Uy),GC=R(W0,zy),JC=function(e,t){return n=ss.after(t),!!Wn(n.getNode())||ef(e,ss.after(t)).map(function(e){return Wn(e.getNode())}).getOr(!1);var n},QC=or([{br:[]},{block:[]},{none:[]}]),ZC=dt().browser,e1=dt(),t1=R(PC,xo),n1=R(PC," "),r1=(o1.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,function(e){return e===r||void n.push(e)}),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e))},o1.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;0<=t&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},o1);function o1(r){var o;this.lastPath=[],this.editor=r;var t=this;"onselectionchange"in r.getDoc()||r.on("NodeChange click mouseup keyup focus",function(e){var t=r.selection.getRng(),n={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};"nodechange"!==e.type&&kf(n,o)||r.fire("SelectionChange"),o=n}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!e||!xt.range&&r.selection.isCollapsed()||Bl(r)&&!t.isSameElementPath(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("mouseup",function(e){!e.isDefaultPrevented()&&Bl(r)&&("IMG"===r.selection.getNode().nodeName?_r.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())})}function i1(e){return zn(e)&&go(kt.fromDom(e))}function a1(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}}function u1(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function s1(e,S){var E=_r.throttle(function(e,t){S._selectionOverrides.hideFakeCaret(),S.selection.placeCaretAt(e,t)},0);return S.on("remove",E.stop),function(w){return e.on(function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x=Math.max(Math.abs(w.screenX-e.screenX),Math.abs(w.screenY-e.screenY));if(!e.dragging&&10<x){if(S.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,S.focus()}e.dragging&&(d=e,t={pageX:(p=w,h=(g=S).inline?a1(g.getBody()):{left:0,top:0},C=(y=g).getBody(),v=y.inline?{left:C.scrollLeft,top:C.scrollTop}:{left:0,top:0},(m={pageX:(b=function(e,t){if(t.target.ownerDocument===e.getDoc())return{left:t.pageX,top:t.pageY};var n,r,o,i,a,u=a1(e.getContentAreaContainer()),s=(r=(n=e).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:t.pageX-u.left+s.left,top:t.pageY-u.top+s.top}}(g,p)).left-h.left+v.left,pageY:b.top-h.top+v.top}).pageX-d.relX),pageY:m.pageY+5},l=e.ghost,f=S.getBody(),l.parentNode!==f&&f.appendChild(l),n=e.ghost,o=e.width,i=e.height,a=e.maxX,u=e.maxY,c=s=0,n.style.left=(r=t).pageX+"px",n.style.top=r.pageY+"px",u<r.pageY+i&&(c=r.pageY+i-u),n.style.width=o-(s=a<r.pageX+o?r.pageX+o-a:s)+"px",n.style.height=i-c+"px",E(w.clientX,w.clientY))})}}function c1(e){function t(e){var t,n,r,o,i,a;0===e.button&&(t=M(c.dom.getParents(e.target),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}}(P1,L1)).getOr(null),i=c.getBody(),P1(a=t)&&a!==i&&(n=c.dom.getPos(t),r=c.getBody(),o=c.getDoc().documentElement,u.set({element:t,dragging:!1,screenX:e.screenX,screenY:e.screenY,maxX:(c.inline?r.scrollWidth:o.offsetWidth)-2,maxY:(c.inline?r.scrollHeight:o.offsetHeight)-2,relX:e.pageX-n.x,relY:e.pageY-n.y,width:t.offsetWidth,height:t.offsetHeight,ghost:function(e,t,n){var r=c.dom,o=e.cloneNode(!0);r.setStyles(o,{width:t,height:n}),r.setAttrib(o,"data-mce-selected",null);var i=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:t,height:n}),r.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,t.offsetWidth,t.offsetHeight)})))}function n(u){i.on(function(e){var t,n,r,o,i,a;e.dragging&&((o=3===(a=(r=s).selection.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a)===(i=e.element)||r.dom.isChildOf(o,i)||P1(o)||((n=e.element.cloneNode(!0)).removeAttribute("data-mce-selected"),t=n,s.fire("drop",{clientX:u.clientX,clientY:u.clientY}).isDefaultPrevented()||s.undoManager.transact(function(){u1(e.element),s.insertContent(s.dom.getOuterHTML(t)),s._selectionOverrides.hideFakeCaret()})),s.fire("dragend"))}),I1(i)}var r,o,i,s,u,c,a=fu(),l=Za.DOM,f=document,d=s1(u=a,c=e),m=(r=i=a,function(){r.on(function(e){e.dragging&&o.fire("dragend")}),I1(r)});(o=s=e).on("mousedown",t),e.on("mousemove",d),e.on("mouseup",n),l.bind(f,"mousemove",d),l.bind(f,"mouseup",m),e.on("remove",function(){l.unbind(f,"mousemove",d),l.unbind(f,"mouseup",m)}),e.on("keydown",function(e){e.keyCode===Lf.ESC&&m()})}function l1(e){var n,i;function a(e){var t;e.isDefaultPrevented()||(t=e.dataTransfer)&&(T(t.types,"Files")||0<t.files.length)&&(e.preventDefault(),"drop"===e.type&&Uv(i,"Dropped file type is not supported"))}function u(e){gd(i,e.target)&&a(e)}function t(){var t=Za.DOM,n=i.dom,r=document,o=i.inline?i.getBody():i.getDoc(),e=["drop","dragover"];Y(e,function(e){t.bind(r,e,u),n.bind(o,e,a)}),i.on("remove",function(){Y(e,function(e){t.unbind(r,e,u),n.unbind(o,e,a)})})}c1(e),(n=e).on("drop",function(e){var t=void 0!==e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;!P1(t)&&"false"!==n.dom.getContentEditableParent(t)||e.preventDefault()}),e.getParam("block_unsupported_drop",!0,"boolean")&&(i=e).on("init",function(){_r.setEditorTimeout(i,t,0)})}function f1(e,t){return vf(e.getBody(),t)}function d1(l){function f(e){return e!==x&&(F1(e)||Jn(e))&&y.isChildOf(e,x)}function c(e){return rp(e)||op(e)||Zg(e)||ep(e)}function d(e){e&&b.setRng(e)}function m(e,t,n,r){return void 0===r&&(r=!0),l.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&b.scrollIntoView(t,-1===e),i.show(n,t))}function t(e){return Ir(e)||_o(e)||Ao(e)}function g(e){return t(e.startContainer)||t(e.endContainer)}function p(e,t){if(!e)return null;if(e.collapsed){if(!g(e)){var n=t?1:-1,r=rc(n,x,e),o=r.getNode(!t);if(Ks(o))return m(n,o,!!t&&!r.isAtEnd(),!1);var i=r.getNode(t);if(Ks(i))return m(n,i,!t&&!r.isAtEnd(),!1)}return null}var a=e.startContainer,u=e.startOffset,s=e.endOffset;if(3===a.nodeType&&0===u&&F1(a.parentNode)&&(a=a.parentNode,u=y.nodeIndex(a),a=a.parentNode),1!==a.nodeType)return null;if(s===u+1&&a===e.endContainer){var c=a.childNodes[u];if(f(c))return function(e){var t=e.cloneNode(!0),n=l.fire("ObjectSelected",{target:e,targetClone:t});if(n.isDefaultPrevented())return null;var r=function(e,t,n){var r=l.$,o=vr(kt.fromDom(l.getBody()),"#"+w).fold(function(){return r([])},function(e){return r([e.dom])});0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",w)).appendTo(l.getBody());var i=y.createRng();t===n&&xt.ie?(o.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(t),i.setStartAfter(o[0].firstChild.firstChild),i.setEndAfter(t)):(o.empty().append(xo).append(t).append(xo),i.setStart(o[0].firstChild,1),i.setEnd(o[0].lastChild,0)),o.css({top:y.getPos(e,l.getBody()).y}),o[0].focus();var a=b.getSel();return a.removeAllRanges(),a.addRange(i),i}(e,n.targetClone,t),o=kt.fromDom(e);return Y(bu(kt.fromDom(l.getBody()),"*[data-mce-selected]"),function(e){je(o,e)||yn(e,S)}),y.getAttrib(e,S)||e.setAttribute(S,"1"),v=e,E(),r}(c)}return null}function h(){v&&v.removeAttribute(S),vr(kt.fromDom(l.getBody()),"#"+w).each(Ln),v=null}var v,n,e,o,b=l.selection,y=l.dom,C=y.isBlock,x=l.getBody(),i=$s(l,x,C,function(){return yd(l)}),w="sel-"+y.uniqueId(),S="data-mce-selected",r=b.getRng,E=function(){i.hide()};return xt.ceFalse&&!hh(l)&&(l.on("mouseup",function(e){var t=r();t.collapsed&&cv(l,e.clientX,e.clientY)&&Nb(l,t,!1).each(d)}),l.on("click",function(e){var t=f1(l,e.target);t&&(F1(t)&&(e.preventDefault(),l.focus()),M1(t)&&y.isChildOf(t,b.getNode())&&h())}),l.on("blur NewBlock",h),l.on("ResizeWindow FullscreenStateChanged",i.reposition),l.on("tap",function(e){var t=e.target,n=f1(l,t);F1(n)?(e.preventDefault(),kb(l,n).each(p)):f(t)&&kb(l,t).each(p)},!0),l.on("mousedown",function(e){var t,n,r,o,i,a,u,s=e.target;s!==x&&"HTML"!==s.nodeName&&!y.isChildOf(s,x)||!1===cv(l,e.clientX,e.clientY)||((t=f1(l,s))?F1(t)?(e.preventDefault(),kb(l,t).each(p)):(h(),M1(t)&&e.shiftKey||bf(e.clientX,e.clientY,b.getRng())||(E(),b.placeCaretAt(e.clientX,e.clientY))):f(s)?kb(l,s).each(p):!1===Ks(s)&&(h(),E(),(n=Qy(x,e.clientX,e.clientY))&&(r=s,o=n.node,a=y.getParent(r,C),u=y.getParent(o,C),!K(a)&&(r!==u&&y.isChildOf(a,u)&&!1===F1(f1(l,a))||!y.isChildOf(u,a)&&(i=u,y.getParent(a,C)!==y.getParent(i,C))&&function(e){var t=e.firstChild;if(!K(t)){var n=ss.before(t);if(Wn(n.getNode())&&1===e.childNodes.length)return!c(n);var r=Ic(e).next(n);return r&&!c(r)}}(a))||(e.preventDefault(),d(m(1,n.node,n.before,!1)),l.getBody().focus()))))}),l.on("keypress",function(e){Lf.modifierPressed(e)||F1(b.getNode())&&e.preventDefault()}),l.on("GetSelectionRange",function(e){var t=e.range;v&&(v.parentNode?((t=t.cloneRange()).selectNode(v),e.range=t):v=null)}),l.on("SetSelectionRange",function(e){var t,n,r,o,i,a,u;e.range=(t=e.range,n=l.schema.getShortEndedElements(),r=y.createRng(),o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,ke(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),ke(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r);var s=p(e.range,e.forward);s&&(e.range=s)}),l.on("AfterSetSelectionRange",function(e){var t=e.range,n=t.startContainer.parentNode;g(t)||"mcepastebin"===n.id||E(),y.hasClass(n,"mce-offscreen-selection")||h()}),l.on("copy",function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||xt.ie||(t=(n=y.get(w))&&n.getElementsByTagName("*")[0])&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))}),l1(l),e=du(function(){var e,t;n.removed||!n.getBody().contains(document.activeElement)||(e=n.selection.getRng()).collapsed&&(t=_b(n,e,!1),n.selection.setRng(t))},0),(n=l).on("focus",function(){e.throttle()}),n.on("blur",function(){e.cancel()}),(o=l).on("init",function(){o.on("focusin",function(e){var t,n,r=e.target;Jn(r)&&(t=vf(o.getBody(),r),n=Yn(t)?t:r,o.selection.getNode()!==n&&kb(o,n).each(function(e){return o.selection.setRng(e)}))})})),{showCaret:m,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(zr(e),d(r()),b.scrollIntoView(e))},hideFakeCaret:E,destroy:function(){i.destroy(),v=null}}}function m1(a){function e(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(e){}}function u(e){return e.isDefaultPrevented()}function t(){a.shortcuts.add("meta+a",null,"SelectAll")}function n(){a.inline||b.bind(a.getDoc(),"mousedown mouseup",function(e){var t;e.target===a.getDoc().documentElement&&(t=y.getRng(),a.getBody().focus(),"mousedown"===e.type?Ir(t.startContainer)||y.placeCaretAt(e.clientX,e.clientY):y.setRng(t))})}function r(){Range.prototype.getClientRects||a.on("mousedown",function(e){var t;u(e)||"HTML"!==e.target.nodeName||((t=a.getBody()).blur(),_r.setEditorTimeout(a,function(){t.focus()}))})}function o(){a.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==b.getContentEditableParent(t)&&(e.preventDefault(),a.selection.select(t),a.nodeChanged()),"A"===t.nodeName&&b.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),y.select(t))})}function i(){a.on("keydown",function(e){if(!u(e)&&e.keyCode===h&&y.isCollapsed()&&0===y.getRng().startOffset){var t=y.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function s(){a.getParam("readonly")||a.on("BeforeExecCommand mousedown",function(){e("StyleWithCSS",!1),e("enableInlineTableEditing",!1),Bs(a)||e("enableObjectResizing",!1)})}function c(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function l(){a.inline||a.on("keydown",function(){document.activeElement===document.body&&a.getWin().focus()})}function f(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){var t;"HTML"===e.target.nodeName&&(11<xt.ie?a.getBody().focus():(t=a.selection.getRng(),a.getBody().focus(),a.selection.setRng(t),a.selection.normalize(),a.nodeChanged()))}))}function d(){xt.mac&&a.on("keydown",function(e){!Lf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),a.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})}function m(){a.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function g(){a.on("init",function(){a.dom.bind(a.getBody(),"submit",function(e){e.preventDefault()})})}var p=Et.each,h=Lf.BACKSPACE,v=Lf.DELETE,b=a.dom,y=a.selection,C=a.parser,x=xt.gecko,w=xt.ie,S=xt.webkit,E="data:text/mce-internal,",k=w?"Text":"URL",N=te;return hh(a)?(S&&(n(),o(),g(),t(),xt.iOS&&(l(),f(),m())),x&&(r(),s(),c(),d())):(a.on("keydown",function(e){if(!u(e)&&e.keyCode===Lf.BACKSPACE){var t,n=(t=y.getRng()).startContainer,r=t.startOffset,o=b.getRoot(),i=n;if(t.collapsed&&0===r){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(a.formatter.toggle("blockquote",null,i),(t=b.createRng()).setStart(n,0),t.setEnd(n,0),y.setRng(t))}}}),a.on("keydown",function(e){var t,n,r,o,i=e.keyCode;u(e)||i!==v&&i!==h||(t=a.selection.isCollapsed(),n=a.getBody(),t&&!b.isEmpty(n)||!t&&(r=R(a.selection.getRng()),(o=b.createRng()).selectNode(a.getBody()),r!==R(o))||(e.preventDefault(),a.setContent(""),n.firstChild&&b.isBlock(n.firstChild)?a.selection.setCursorLocation(n.firstChild,0):a.selection.setCursorLocation(n,0),a.nodeChanged()))}),xt.windowsPhone||a.on("keyup focusin mouseup",function(e){Lf.modifierPressed(e)||y.normalize()},!0),S&&(n(),o(),ks(a)&&a.on("init",function(){e("DefaultParagraphSeparator",ks(a))}),g(),i(),C.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),xt.iOS?(l(),f(),m()):t()),11<=xt.ie&&(f(),i()),xt.ie&&(t(),e("AutoUrlDetect",!1),a.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(a.selection.isCollapsed()&&"IMG"===t.target.tagName&&y.select(t.target),0<(n=a.selection.getContent()).length&&(r=E+escape(a.id)+","+escape(n),t.dataTransfer.setData(k,r)))}),a.on("drop",function(e){var t,n,r,o;u(e)||(t=e.dataTransfer&&(o=e.dataTransfer.getData(k))&&0<=o.indexOf(E)?(o=o.substr(E.length).split(","),{id:unescape(o[0]),html:unescape(o[1])}):null)&&t.id!==a.id&&(e.preventDefault(),n=Ef(e.x,e.y,a.getDoc()),y.setRng(n),r=t.html,a.queryCommandSupported("mceInsertClipboardContent")?a.execCommand("mceInsertClipboardContent",!1,{content:r,internal:!0}):a.execCommand("mceInsertContent",!1,r))})),x&&(a.on("keydown",function(e){if(!u(e)&&e.keyCode===h&&a.getBody().getElementsByTagName("hr").length&&y.isCollapsed()&&0===y.getRng().startOffset){var t=y.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return b.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(b.remove(n),e.preventDefault())}}),r(),a.on("keypress",function(e){var t;if(!u(e)&&(8===e.keyCode||46===e.keyCode)&&A())return t=_(),a.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),b.bind(a.getDoc(),"cut",function(e){var t;!u(e)&&A()&&(t=_(),_r.setEditorTimeout(a,function(){t()}))}),s(),a.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||p(b.select("a"),function(e){var t=e.parentNode,n=b.getRoot();if(t.lastChild===e){for(;t&&!b.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}b.add(t,"br",{"data-mce-bogus":1})}})}),c(),d(),i())),{refreshContentEditable:N,isHidden:function(){if(!x||a.removed)return!1;var e=a.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}};function _(){var e=b.getAttribs(y.getStart().cloneNode(!1));return function(){var t=y.getStart();t!==a.getBody()&&(b.setAttrib(t,"style",null),p(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function A(){return!y.isCollapsed()&&b.getParent(y.getStart(),b.isBlock)!==b.getParent(y.getEnd(),b.isBlock)}function R(e){var t=b.create("body"),n=e.cloneContents();return t.appendChild(n),y.serializer.serialize(t,{format:"html"})}}function g1(e){return ae(e,function(e){return!1===b(e)})}function p1(e){var t=e.settings;return g1({block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements,padd_empty_block_inline_children:t.format_empty_lines})}function h1(e){var t=e.settings,n=e.editorUpload.blobCache;return g1({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:e.inline?e.getElement().nodeName.toLowerCase():void 0,validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})}function v1(e){var t,u,n;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("Init"),e.focus(!0),n=(u=e).dom.getRoot(),u.inline||Bl(u)&&u.selection.getStart(!0)!==n||nf(n).each(function(e){var t,n,r,o,i=e.getNode(),a=cn(i)?nf(i).getOr(e):e;xt.browser.isIE()?(t=u,n=a.toRange(),r=kt.fromDom(t.getBody()),o=(sd(t)?ve.from(n):ve.none()).map(cd).filter(ud(r)),t.bookmark=o.isSome()?o:t.bookmark):u.selection.setRng(a.toRange())}),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&_r.setEditorTimeout(t,function(){var e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus);e.destroyed||e.focus()},100)}function b1(e){return(e.inline?e.ui:e.dom).styleSheetLoader}function y1(e){function t(){o.unloadAll(a),e.inline||e.ui.styleSheetLoader.unloadAll(i)}function n(){e.removed?t():e.on("remove",t)}var r,o=b1(e),i=Os(e),a=e.contentCSS;0<e.contentStyles.length&&(r="",Et.each(e.contentStyles,function(e){r+=e+"\r\n"}),e.dom.addStyle(r));var u,s,c,l,f,d,m,g,p,h=Nr.all((u=e,s=a,c=i,l=[new Nr(function(e,t){return b1(u).loadAll(s,e,t)})],u.inline?l:l.concat([new Nr(function(e,t){return u.ui.styleSheetLoader.loadAll(c,e,t)})]))).then(n).catch(n);return e.settings.content_style&&(d=(f=e).settings.content_style,m=kt.fromDom(f.getBody()),g=jt(Bn(m)),pn(p=kt.fromTag("style"),"type","text/css"),Pn(p,kt.fromText(d)),Pn(g,p),f.on("remove",function(){Ln(p)})),h}function C1(e){var t;!0!==e.removed&&(hh(t=e)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),v1(e))}function x1(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(U1.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var u,i,a,s,c,l,f,d,m,g,p,h,v=t.getBody();v.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===U1.getStyle(v,"position",!0)&&(v.style.position="relative"),v.contentEditable=t.getParam("content_editable_state",!0)),v.disabled=!1,t.editorUpload=Gv(t),t.schema=ro(p1(t)),t.dom=Za(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:t.getParam("content_css_cors",!1,"boolean"),referrerPolicy:Rs(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((i=Xh(h1(u=t),u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o=e.length,i=u.dom,a="data-mce-"+t;o--;)(r=(n=e[o]).attr(t))&&!n.attr(a)&&0!==r.indexOf("data:")&&0!==r.indexOf("blob:")&&("style"===t?((r=i.serializeStyle(i.parseStyle(r),n.name)).length||(r=null),n.attr(a,r),n.attr(t,r)):"tabindex"===t?(n.attr(a,r),n.attr(t,null)):n.attr(a,u.convertURL(r,t,n.name)))}),i.addNodeFilter("script",function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}}),u.settings.preserve_cdata&&i.addNodeFilter("#cdata",function(e){for(var t=e.length;t--;){var n=e[t];n.type=8,n.name="#comment",n.value="[CDATA["+u.dom.encode(n.value)+"]]"}}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,n=u.schema.getNonEmptyElements();t--;){var r=e[t];r.isEmpty(n)&&0===r.getAll("br").length&&(r.append(new Hd("br",1)).shortEnded=!0)}}),i),t.serializer=Jh((s=(a=t).settings,_e(_e(_e({},h1(a)),p1(a)),g1({url_converter:s.url_converter,url_converter_scope:s.url_converter_scope,element_format:s.element_format,entities:s.entities,entity_encoding:s.entity_encoding,indent:s.indent,indent_after:s.indent_after,indent_before:s.indent_before}))),t),t.selection=Fh(t.dom,t.getWin(),t.serializer,t),t.annotator=Ul(t),t.formatter=eb(t),t.undoManager=nb(t),t._nodeChangeDispatcher=new r1(t),t._selectionOverrides=d1(t),m=t,g=fu(),p=iu(!1),h=mu(function(e){m.fire("longpress",_e(_e({},e),{type:"longpress"})),p.set(!0)},400),m.on("touchstart",function(n){N0(n).each(function(e){h.cancel();var t={x:e.clientX,y:e.clientY,target:n.target};h.throttle(n),p.set(!1),g.set(t)})},!0),m.on("touchmove",function(e){h.cancel(),N0(e).each(function(i){g.on(function(e){var t=i,n=e,r=Math.abs(t.clientX-n.x),o=Math.abs(t.clientY-n.y);(5<r||5<o)&&(g.clear(),p.set(!1),m.fire("longpresscancel"))})})},!0),m.on("touchend touchcancel",function(t){h.cancel(),"touchcancel"!==t.type&&g.get().filter(function(e){return e.target.isEqualNode(t.target)}).each(function(){p.get()?t.preventDefault():m.fire("tap",_e(_e({},t),{type:"tap"}))})},!0),(f=l=t).on("click",function(e){f.dom.getParent(e.target,"details")&&e.preventDefault()}),(d=l).parser.addNodeFilter("details",function(e){Y(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),d.serializer.addNodeFilter("details",function(e){Y(e,function(e){var t=e.attr("data-mce-open");e.attr("open",X(t)?t:null),e.attr("data-mce-open",null)})}),hh(t)||(c=t).on("click",function(e){var t,n,r,o,i;3<=e.detail&&(r=(t=c).selection.getRng(),o=ss.fromRangeStart(r),i=ss.fromRangeEnd(r),!ss.isElementPosition(o)||i1(n=o.container())&&nf(n).each(function(e){return r.setStart(e.container(),e.offset())}),!ss.isElementPosition(i)||i1(n=o.container())&&rf(n).each(function(e){return r.setEnd(e.container(),e.offset())}),t.selection.setRng(Cg(r)))});var b,y,C,x,w,S,E,k,N,_=hh(b=t)?iu(null):MC(b);N=_,(k=t).addCommand("delete",function(){var e,t=N;E0(e=k)||Mb(e,!1)||Tb(e,!1)||m0(e,t,!1)||Cb(e,!1)||yg(e)||Fb(e,!1)||b0(e,!1)||Sb(e)||h0(e,!1)||(k0(e,"Delete"),lb(e))}),k.addCommand("forwardDelete",function(){var e,t=N;Mb(e=k,!0)||Tb(e,!0)||m0(e,t,!0)||Cb(e,!0)||yg(e)||Fb(e,!0)||b0(e,!0)||Sb(e)||h0(e,!0)||k0(e,"ForwardDelete")}),ks(y=t)&&y.on("NodeChange",R(A0,y)),x=(C=t).dom,w=ks(C),S=C.getParam("placeholder",hc.getAttrib(C.getElement(),"placeholder"),"string"),E=function(e,t){var n,r,o;!function(e){if(rb(e)){var t=e.keyCode;return!ob(e)&&(Lf.metaKeyPressed(e)||e.altKey||112<=t&&t<=123||T(hy,t))}}(e)&&(n=C.getBody(),r=!(rb(o=e)&&!(ob(o)||"keyup"===o.type&&229===o.keyCode))&&function(e,t,n){if(Wr(kt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return!o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(x,n,w),""!==x.getAttrib(n,vy)===r&&!t||(x.setAttrib(n,vy,r?S:null),x.setAttrib(n,"aria-placeholder",r?S:null),C.fire("PlaceholderToggle",{state:r}),C.on(r?"keydown":"keyup",E),C.off(r?"keyup":"keydown",E)))},S&&C.on("init",function(e){E(e,!0),C.on("change SetContent ExecCommand",E),C.on("paste",function(e){return _r.setEditorTimeout(C,function(){return E(e)})})});var A=vh(t);(function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();t.fire("PreInit"),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,U1.setAttrib(r,"spellcheck","false")),t.quirks=m1(t),t.fire("PostRender");var o=t.getParam("directionality",cu.isRtl()?"rtl":void 0);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",function(t){Et.each(e.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type})})(t),A.fold(function(){y1(t).then(function(){return C1(t)})},function(e){t.setProgressState(!0),y1(t).then(function(){e().then(function(e){t.setProgressState(!1),C1(t)},function(e){t.notificationManager.open({type:"error",text:String(e)}),C1(t)})})})}function w1(e,t){var n,r,o,i,a=e.translate("Rich Text Area"),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),hn(i=kt.fromTag("iframe"),o),hn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),hu(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(document.domain!==window.location.hostname&&xt.browser.isIE()){var n=$v("mce");e[n]=function(){x1(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return z1.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=function(e){var t=e.getParam("doctype","<!DOCTYPE html>")+"<html><head>";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=Ss(e,"body_id","tinymce"),r=Ss(e,"body_class",""),o=e.translate(e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string"));return Es(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+Es(e)+'" />'),t+('</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id)+'" aria-label="'+o+'"><br></body></html>'}(e),z1.add(t.iframeContainer,u),s}function S1(e){return e.replace(/^\-/,"")}function E1(e){return{editorContainer:e,iframeContainer:e,api:{}}}function k1(e){var t,n,r,o,i,a,u,s=e.getElement();return e.orgDisplay=s.style.display,X(Ls(e))?e.theme.renderUI():y(Ls(e))?(n=(t=e).getElement(),(r=Ls(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight||n.offsetHeight,r):(u=(o=e).getElement(),o.inline?E1(null):(i=u,a=H1.create("div"),H1.insertAfter(a,i),E1(a)))}function N1(e){var n,t,r,o,i,a,u,s;e.fire("ScriptsLoaded"),n=e,t=Et.trim(As(n)),r=n.ui.registry.getAll().icons,ne(_e(_e({},Dv.get("default").icons),Dv.get(t).icons),function(e,t){ke(r,t)||n.ui.registry.addIcon(t,e)}),a=Ls(o=e),X(a)?(o.settings.theme=S1(a),i=Iv.get(a),o.theme=new i(o,Iv.urls[a]),o.theme.init&&o.theme.init(o,Iv.urls[a]||o.documentBaseUrl.replace(/\/$/,""),o.$)):o.theme={},s=[],Et.each(Ms(u=e).split(/[ ,]/),function(e){j1(u,s,S1(e))});var c=k1(e),l=e,f=ve.from(c.api).getOr({}),d={show:ve.from(f.show).getOr(te),hide:ve.from(f.hide).getOr(te),disable:ve.from(f.disable).getOr(te),isDisabled:ve.from(f.isDisabled).getOr(D),enable:function(){l.mode.isReadOnly()||ve.from(f.enable).map(x)}};l.ui=_e(_e({},l.ui),d);var m,g,p,h={editorContainer:c.editorContainer,iframeContainer:c.iframeContainer};return e.editorContainer=h.editorContainer||null,Vv(e),e.inline?x1(e):(p=w1(m=e,g=h),g.editorContainer&&(z1.get(g.editorContainer).style.display=m.orgDisplay,m.hidden=z1.isHidden(g.editorContainer)),m.getElement().style.display="none",z1.setAttrib(m.id,"aria-hidden","true"),void(p||x1(m)))}function _1(e){return"-"===e.charAt(0)}function A1(t,e,n){return ve.from(e).filter(function(e){return 0<e.length&&!Dv.has(e)}).map(function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:ve.some(e)}})}function R1(c,l){var e,t,f=ru.ScriptLoader,n=f,r=l,o=function(){var r,o,t,n,e,i,a,u,s;e=f,u=Ds(i=c),s=i.getParam("language_url","","string"),!1===cu.hasCode(u)&&"en"!==u&&(a=""!==s?s:i.editorManager.baseURL+"/langs/"+u+".js",e.add(a,te,void 0,function(){zv(i,"LanguageLoadError",Hv("language",a,u))})),t=f,Y(function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t}([A1(n=c,"default",l),ve.from(n.getParam("icons_url","","string")).filter(function(e){return 0<e.length}).map(function(e){return{url:e,name:ve.none()}}).orThunk(function(){return A1(n,As(n),"")})]),function(e){t.add(e.url,te,void 0,function(){zv(n,"IconsLoadError",Hv("icons",e.url,e.name.getOrUndefined()))})}),r=c,o=l,Et.each(r.getParam("external_plugins"),function(e,t){Lv.load(t,e,te,void 0,function(){jv(r,e,t)}),r.settings.plugins+=" "+t}),Et.each(Ms(r).split(/[ ,]/),function(e){var t,n;(e=Et.trim(e))&&!Lv.urls[e]&&(_1(e)?(e=e.substr(1,e.length),t=Lv.dependencies(e),Et.each(t,function(e){var t=Lv.createUrl({prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"},e);Lv.load(t.resource,t,te,void 0,function(){jv(r,t.prefix+t.resource+t.suffix,t.resource)})})):(n={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"},Lv.load(e,n,te,void 0,function(){jv(r,n.prefix+n.resource+n.suffix,e)})))}),f.loadQueue(function(){c.removed||N1(c)},c,function(){c.removed||N1(c)})},i=Ls(e=c);X(i)?(_1(i)||ke(Iv.urls,i)||((t=e.getParam("theme_url"))?Iv.load(i,e.documentBaseURI.toAbsolute(t)):Iv.load(i,"themes/"+i+"/theme"+r+".js")),n.loadQueue(function(){Iv.waitFor(i,o)})):o()}function D1(a){return function(i,e){return ve.from(e).map(kt.fromDom).filter(Nn).bind(function(e){return n=a,t=i,r=e.dom,Tg(kt.fromDom(r),function(e){return wn(t=e,n).orThunk(function(){return"font"===Nt(t)?ue(q1,n).bind(function(e){return bn(t,e)}):ve.none()});var t},function(e){return je(kt.fromDom(t),e)}).or((o=e.dom,ve.from(Za.DOM.getStyle(o,a,!0))));var n,t,r,o}).getOr("")}}function T1(e){return nf(e.getBody()).map(function(e){var t=e.container();return jn(t)?t.parentNode:t})}function O1(e,t){return n=e,r=a(ve.some,t),o=n,ve.from(o.selection.getRng()).bind(function(e){var t=o.getBody();return e.startContainer===t&&0===e.startOffset?ve.none():ve.from(o.selection.getStart(!0))}).orThunk(R(T1,n)).map(kt.fromDom).filter(Nn).bind(r);var n,r,o}function B1(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=Et.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),o=Et.explode(e.getParam("font_size_classes",""));return o?o[n-1]||t:r[n-1]||t}return t}return t}var P1=Yn,L1=Xn,I1=function(e){e.on(function(e){u1(e.ghost)}),e.clear()},M1=Xn,F1=Yn,U1=Za.DOM,z1=Za.DOM,H1=Za.DOM,j1=function(t,n,r){var o,i,a,u,e=Lv.get(r),s=Lv.urls[r]||t.documentBaseUrl.replace(/\/$/,"");if(r=Et.trim(r),e&&-1===Et.inArray(n,r)&&(Et.each(Lv.dependencies(r),function(e){j1(t,n,e)}),!t.plugins[r]))try{var c=new e(t,s,t.$);(t.plugins[r]=c).init&&(c.init(t,s),n.push(r))}catch(e){i=r,a=e,yf(o=t,"PluginLoadError",{message:u=cu.translate(["Failed to initialize plugin: {0}",i])}),cy(u,a),Uv(o,u)}},V1=Za.DOM,q1={"font-size":"size","font-family":"face"},$1=D1("font-size"),W1=i(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},D1("font-family")),K1=Et.each,X1=Et.map,Y1=Et.inArray,G1=(J1.prototype.execCommand=function(t,n,r,e){var o,i,a=!1,u=this;if(!u.editor.removed){if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?dd(i=u.editor).each(function(e){return i.selection.setRng(e)}):u.editor.focus()),(e=u.editor.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;var s=t.toLowerCase();if(o=u.commands.exec[s])return o(s,n,r),u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(K1(this.editor.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,n,r))return u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=u.editor.getDoc().execCommand(t,n,r)}catch(e){}return!!a&&(u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},J1.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return!1}},J1.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},J1.prototype.addCommands=function(e,n){void 0===n&&(n="exec");var r=this;K1(e,function(t,e){K1(e.toLowerCase().split(","),function(e){r.commands[n][e]=t})})},J1.prototype.addCommand=function(e,o,i){var a=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,t,n,r){return o.call(i||a.editor,t,n,r)}},J1.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return!0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return!1},J1.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)}},J1.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)}},J1.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},J1.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},J1.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},J1.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged()},J1.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e)},J1.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},J1.prototype.setupCommands=function(u){var o=this;function e(r){return function(){var e=u.selection,t=e.isCollapsed()?[u.dom.getParent(e.getNode(),u.dom.isBlock)]:e.getSelectedBlocks(),n=X1(t,function(e){return!!u.formatter.matchNode(e,r)});return-1!==Y1(n,!0)}}this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":te,"mceEndUndoLevel,mceAddUndoLevel":function(){u.undoManager.add()},mceFocus:function(e,t,n){var r,o;o=n,(r=u).removed||(o?Ud:function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===yd(t)&&dd(t).each(function(e){t.selection.setRng(e),r=e});var o,i,a=(o=t,i=e.getNode(),o.dom.getParent(i,function(e){return"true"===o.dom.getContentEditable(e)}));if(t.$.contains(n,a))return bd(a),vd(t,r),Ud(t);t.inline||(xt.opera||bd(n),t.getWin().focus()),(xt.gecko||t.inline)&&(bd(n),vd(t,r)),Ud(t)})(r)},"Cut,Copy,Paste":function(e){var t,n,r=u.getDoc();try{o.execNativeCommand(e)}catch(e){t=!0}!(t="paste"===e&&!r.queryCommandEnabled(e)||t)&&r.queryCommandSupported(e)||(n=u.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."),xt.mac&&(n=n.replace(/Ctrl\+/g,"\u2318+")),u.notificationManager.open({text:n,type:"error"}))},unlink:function(){var e;u.selection.isCollapsed()?(e=u.dom.getParent(u.selection.getStart(),"a"))&&u.dom.remove(e,!0):u.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),K1("left,center,right,justify".split(","),function(e){t!==e&&u.formatter.remove("align"+e)}),"none"!==t&&o.toggleFormat("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t;o.execNativeCommand(e);var n=u.dom.getParent(u.selection.getNode(),"ol,ul");n&&(t=n.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(t.nodeName)&&(o.storeSelection(),u.dom.split(t,n),o.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){o.toggleFormat(e)},"ForeColor,HiliteColor":function(e,t,n){o.toggleFormat(e,{value:n})},FontName:function(e,t,n){var r,o;o=B1(r=u,n),r.formatter.toggle("fontname",{value:A(o.split(/\s*,\s*/),function(e){return-1===e.indexOf(" ")||Ge(e,'"')||Ge(e,"'")?e:"'"+e+"'"}).join(",")}),r.nodeChanged()},FontSize:function(e,t,n){var r;(r=u).formatter.toggle("fontsize",{value:B1(r,n)}),r.nodeChanged()},LineHeight:function(e,t,n){var r;(r=u).formatter.toggle("lineheight",{value:String(n)}),r.nodeChanged()},Lang:function(e,t,n){o.toggleFormat(e,{value:n.code,customValue:n.customCode})},RemoveFormat:function(e){u.formatter.remove(e)},mceBlockQuote:function(){o.toggleFormat("blockquote")},FormatBlock:function(e,t,n){return o.toggleFormat(n||"p")},mceCleanup:function(){var e=u.selection.getBookmark();u.setContent(u.getContent()),u.selection.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||u.selection.getNode();r!==u.getBody()&&(o.storeSelection(),u.dom.remove(r,!0),o.restoreSelection())},mceSelectNodeDepth:function(e,t,n){var r=0;u.dom.getParent(u.selection.getNode(),function(e){if(1===e.nodeType&&r++===n)return u.selection.select(e),!1},u.getBody())},mceSelectNode:function(e,t,n){u.selection.select(n)},mceInsertContent:function(e,t,n){var r,o,i,a;r=u,o=function(e){if("string"==typeof e)return{content:e,details:{}};var t=Et.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}(n),i=o.content,a=o.details,bh(r).editor.insertContent(i,a)},mceInsertRawHTML:function(e,t,n){u.selection.setContent("tiny_mce_marker");var r=u.getContent();u.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceInsertNewLine:function(e,t,n){DC(u,n)},mceToggleFormat:function(e,t,n){o.toggleFormat(n)},mceSetContent:function(e,t,n){u.setContent(n)},"Indent,Outdent":function(e){S0(u,e)},mceRepaint:te,InsertHorizontalRule:function(){u.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){u.hasVisual=!u.hasVisual,u.addVisual()},mceReplaceContent:function(e,t,n){u.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,u.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){"string"==typeof n&&(n={href:n});var r=u.dom.getParent(u.selection.getNode(),"a");n.href=n.href.replace(/ /g,"%20"),r&&n.href||u.formatter.remove("link"),n.href&&u.formatter.apply("link",n,r)},selectAll:function(){var e,t=u.dom.getParent(u.selection.getStart(),Xn);t&&((e=u.dom.createRng()).selectNodeContents(t),u.selection.setRng(e))},mceNewDocument:function(){u.setContent("")},InsertLineBreak:function(e,t,n){return bC(u,n),!0}}),o.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return o.isFormatMatch(e)},mceBlockQuote:function(){return o.isFormatMatch("blockquote")},Outdent:function(){return x0(u)},"InsertUnorderedList,InsertOrderedList":function(e){var t=u.dom.getParent(u.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),o.addCommands({Undo:function(){u.undoManager.undo()},Redo:function(){u.undoManager.redo()}}),o.addQueryValueHandler("FontName",function(){return O1(t=u,function(e){return W1(t.getBody(),e.dom)}).getOr("");var t},this),o.addQueryValueHandler("FontSize",function(){return O1(t=u,function(e){return $1(t.getBody(),e.dom)}).getOr("");var t},this),o.addQueryValueHandler("LineHeight",function(){return O1(t=u,function(n){var e=kt.fromDom(t.getBody());return Tg(n,function(e){return wn(e,"line-height")},R(je,e)).getOrThunk(function(){var e=parseFloat(xn(n,"line-height")),t=parseFloat(xn(n,"font-size"));return String(e/t)})}).getOr("");var t},this)},J1);function J1(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}function Q1(e,t,n){var r,o,i,a,u,s;vu(e,t)&&!1===n?(o=t,pu(r=e)?r.dom.classList.remove(o):(u=o,0<(s=U(gu(a=r,"class"),function(e){return e!==u})).length?pn(a,"class",s.join(" ")):yn(a,"class")),0===(pu(i=r)?i.dom.classList:gu(i,"class")).length&&yn(i,"class")):n&&hu(e,t)}function Z1(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(e){}}function ex(e,t){e.dom.contentEditable=t?"true":"false"}function tx(e,t){var n,r,o=kt.fromDom(e.getBody());Q1(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),ve.from(e.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")}),ex(o,!(e.readonly=!0)),Y(bu(o,'*[contenteditable="true"]'),function(e){pn(e,ox,"true"),ex(e,!1)})):(ex(o,!(e.readonly=!1)),Y(bu(o,"*["+ox+'="true"]'),function(e){yn(e,ox),ex(e,!0)}),Z1(e,"StyleWithCSS",!1),Z1(e,"enableInlineTableEditing",!1),Z1(e,"enableObjectResizing",!1),(yd(n=e)||(r=n,rd(Bn(kt.fromDom(r.getElement()))).filter(function(e){return!(void 0!==(t=e.dom.classList)&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body")))&&gd(r,e.dom);var t}).isSome()))&&e.focus(),e.selection.setRng(e.selection.getRng()),e.nodeChanged())}function nx(e){return e.readonly}function rx(t){t.parser.addAttributeFilter("contenteditable",function(e){nx(t)&&Y(e,function(e){e.attr(ox,e.attr("contenteditable")),e.attr("contenteditable","false")})}),t.serializer.addAttributeFilter(ox,function(e){nx(t)&&Y(e,function(e){e.attr("contenteditable",e.attr(ox))})}),t.serializer.addTempAttr(ox)}var ox="data-mce-contenteditable",ix=Et.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),ax=(ux.isNative=function(e){return!!ix[e.toLowerCase()]},ux.prototype.fire=function(e,t){var n=e.toLowerCase(),r=uo(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},ux.prototype.on=function(e,t,n,r){if(t=!1===t?D:t){var o={func:t,removed:!1};r&&Et.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],s=this.bindings[u];s||(s=[],this.toggleEvent(u,!0)),s=n?Ae([o],s,!0):Ae(Ae([],s,!0),[o],!1),this.bindings[u]=s}}return this},ux.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i,a=r[o],u=this.bindings[a];if(!a)return ne(this.bindings,function(e,t){n.toggleEvent(t,!1),delete n.bindings[t]}),this;u&&(t?(u=(i=B(u,function(e){return e.func===t})).fail,this.bindings[a]=u,Y(i.pass,function(e){e.removed=!0})):u.length=0,u.length||(this.toggleEvent(e,!1),delete this.bindings[a]))}else ne(this.bindings,function(e,t){n.toggleEvent(t,!1)}),this.bindings={};return this},ux.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},ux.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},ux);function ux(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}function sx(n){return n._eventDispatcher||(n._eventDispatcher=new ax({scope:n,toggleEvent:function(e,t){ax.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher}function cx(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=Ps(e);return n?(e.eventRoot||(e.eventRoot=hx.select(n)[0]),e.eventRoot):e.getBody()}function lx(e,t,n){var r,o,i,a;e.hidden||nx(e)?nx(e)&&(r=e,"click"!==(o=n).type||Lf.metaKeyPressed(o)||(i=kt.fromDom(o.target),a=r,br(i,"a",function(e){return je(e,kt.fromDom(a.getBody()))}).bind(function(e){return bn(e,"href")}).each(function(e){var t,n;o.preventDefault(),/^#/.test(e)?(t=r.dom.select(e+',[name="'+(Ge(n=e,"#")?n.substring("#".length):n)+'"]')).length&&r.selection.scrollIntoView(t[0],!0):window.open(e,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))):e.fire(t,n)}function fx(i,a){var e,t;i.delegates||(i.delegates={}),i.delegates[a]||i.removed||(t=cx(i,a),Ps(i)?(gx||(gx={},i.editorManager.on("removeEditor",function(){i.editorManager.activeEditor||gx&&(ne(gx,function(e,t){i.dom.unbind(cx(i,t))}),gx=null)})),gx[a]||(gx[a]=e=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();o!==t&&!hx.isChildOf(t,o)||lx(n[r],a,e)}},hx.bind(t,a,e))):(hx.bind(t,a,e=function(e){lx(i,a,e)}),i.delegates[a]=e))}function dx(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate()}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&tx(e,i.editorReadOnly),t.set(r),e.fire("SwitchMode",{mode:r})}function mx(e){var t,n={};yx(Cx(e.toLowerCase(),"+"),function(e){e in wx?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=xx[e]||e.toUpperCase().charCodeAt(0))});var r=[n.keyCode];for(t in wx)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,xt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(xt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n}var gx,px={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;var r=sx(this).fire(e,t);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(e,r,!1),o=o.parent();return r},on:function(e,t,n){return sx(this).on(e,t,n)},off:function(e,t){return sx(this).off(e,t)},once:function(e,t){return sx(this).once(e,t)},hasEventListeners:function(e){return sx(this).has(e)}},hx=Za.DOM,vx=_e(_e({},px),{bindPendingEventDelegates:function(){var t=this;Et.each(t._pendingNativeEvents,function(e){fx(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?fx(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(cx(n,e),e,n.delegates[e]),delete n.delegates[e])))},unbindAllNativeEvents:function(){var n=this,e=n.getBody(),t=n.dom;n.delegates&&(ne(n.delegates,function(e,t){n.dom.unbind(cx(n,t),t,e)}),delete n.delegates),!n.inline&&e&&t&&(e.onload=null,t.unbind(n.getWin()),t.unbind(n.getDoc())),t&&(t.unbind(e),t.unbind(n.getContainer()))}}),bx=["design","readonly"],yx=Et.each,Cx=Et.explode,xx={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},wx=Et.makeMap("alt,ctrl,shift,meta,access"),Sx=(Ex.prototype.add=function(e,n,t,r){var o=this,i=o.normalizeCommandFunc(t);return yx(Cx(Et.trim(e)),function(e){var t=o.createShortcut(e,n,i,r);o.shortcuts[t.id]=t}),!0},Ex.prototype.remove=function(e){var t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},Ex.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return"string"==typeof n?function(){t.editor.execCommand(n,!1,null)}:Et.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2])}:n},Ex.prototype.createShortcut=function(e,t,n,r){var o=Et.map(Cx(e,">"),mx);return o[o.length-1]=Et.extend(o[o.length-1],{func:n,scope:r||this.editor}),Et.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},Ex.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},Ex.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},Ex.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},Ex.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},Ex);function Ex(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(yx(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var kx=Za.DOM,Nx=Et.extend,_x=Et.each,Ax=Et.resolve,Rx=xt.ie,Dx=(Tx.prototype.render=function(){!function(t){var e=t.id;cu.setCode(Ds(t));var n,r,o,i,a=function(){V1.unbind(window,"ready",a),t.render()};si.Event.domLoaded?t.getElement()&&xt.contentEditable&&(n=kt.fromDom(t.getElement()),r=L(n.dom.attributes,function(e,t){return e[t.name]=t.value,e},{}),t.on("remove",function(){O(n.dom.attributes,function(e){return yn(n,e.name),0}),hn(n,r)}),t.ui.styleSheetLoader=Ar.forElement(n,{contentCssCors:(o=t).getParam("content_css_cors"),referrerPolicy:Rs(o)}),t.getParam("inline")?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"),(i=t.getElement().form||V1.getParent(e,"form"))&&(t.formElement=i,t.getParam("hidden_input")&&!Hn(t.getElement())&&(V1.insertAfter(V1.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},V1.bind(i,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!t.getParam("submit_patch")||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Mv(t),t.notificationManager=lv(t),"xml"===t.getParam("encoding")&&t.on("GetContent",function(e){e.save&&(e.content=V1.encode(e.content))}),t.getParam("add_form_submit_trigger")&&t.on("submit",function(){t.initialized&&t.save()}),t.getParam("add_unload_trigger")&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),R1(t,t.suffix)):V1.bind(window,"ready",a)}(this)},Tx.prototype.focus=function(e){this.execCommand("mceFocus",!1,e)},Tx.prototype.hasFocus=function(){return yd(this)},Tx.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Ax(r):0,o=Ax(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,t)},Tx.prototype.translate=function(e){return cu.translate(e)},Tx.prototype.getParam=function(e,t,n){return i=t,a=n,l=(o=e)in(r=this).settings?r.settings[o]:i,"hash"===a?(c={},"string"==typeof(s=l)?Y(0<s.indexOf("=")?s.split(/[;,](?![^=;,]*(?:[;,]|$))/):s.split(","),function(e){var t=e.split("=");1<t.length?c[Et.trim(t[0])]=Et.trim(t[1]):c[Et.trim(t[0])]=Et.trim(t[0])}):c=s,c):"string"===a?av(X,r,o).getOr(i):"number"===a?av(E,r,o).getOr(i):"boolean"===a?av(v,r,o).getOr(i):"object"===a?av(h,r,o).getOr(i):"array"===a?av(S,r,o).getOr(i):"string[]"===a?av((u=X,function(e){return S(e)&&j(e,u)}),r,o).getOr(i):"function"===a?av(y,r,o).getOr(i):l;var r,o,i,a,u,s,c,l},Tx.prototype.hasPlugin=function(e,t){return!(!T(Ms(this).split(/[ ,]/),e)||t&&void 0===Lv.get(e))},Tx.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e)},Tx.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n)},Tx.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},Tx.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},Tx.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r)},Tx.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},Tx.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},Tx.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},Tx.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},Tx.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(kx.show(this.getContainer()),kx.hide(this.id)),this.load(),this.fire("show"))},Tx.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(Rx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(kx.hide(e.getContainer()),kx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},Tx.prototype.isHidden=function(){return!!this.hidden},Tx.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t})},Tx.prototype.load=function(e){var t=this.getElement();if(this.removed)return"";if(t){(e=e||{}).load=!0;var n=Hn(t)?t.value:t.innerHTML,r=this.setContent(n,e);return e.element=t,e.no_events||this.fire("LoadContent",e),e.element=t=null,r}},Tx.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,Hn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=kx.getParent(r.id,"form"))&&_x(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},Tx.prototype.setContent=function(e,t){return Qh(this,e,t)},Tx.prototype.getContent=function(e){return t=this,r=(n=void 0===(n=e)?{}:n).format||"html",o=n,bh(t).editor.getContent(o,r);var t,n,r,o},Tx.prototype.insertContent=function(e,t){t&&(e=Nx({content:e},t)),this.execCommand("mceInsertContent",!1,e)},Tx.prototype.resetContent=function(e){void 0===e?Qh(this,this.startContent,{format:"raw"}):Qh(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},Tx.prototype.isDirty=function(){return!this.isNotDirty},Tx.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},Tx.prototype.getContainer=function(){return this.container||(this.container=kx.get(this.editorContainer||this.id+"_parent")),this.container},Tx.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},Tx.prototype.getElement=function(){return this.targetElm||(this.targetElm=kx.get(this.id)),this.targetElm},Tx.prototype.getWin=function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},Tx.prototype.getDoc=function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},Tx.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},Tx.prototype.convertURL=function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):this.documentBaseURI.toAbsolute(e,r.remove_script_host)},Tx.prototype.addVisual=function(e){var t;t=e,yh(this).editor.addVisual(t)},Tx.prototype.remove=function(){var e,t,n,r,o;(e=this).removed||(t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement(),r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&yv.remove(o.nextSibling),e.fire("remove"),e.editorManager.remove(e),!e.inline&&r&&yv.setStyle(e.id,"display",e.orgDisplay),e.fire("detach"),yv.remove(e.getContainer()),Zh(t),Zh(n),e.destroy())},Tx.prototype.destroy=function(e){var t,n,r,o,i,a,u;n=e,a=(t=this).selection,u=t.dom,t.destroyed||(n||t.removed?(n||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Zh(a),Zh(u)),(o=(r=t).formElement)&&(o._mceOldSubmit&&(o.submit=o._mceOldSubmit,o._mceOldSubmit=null),yv.unbind(o,"submit reset",r.formEventDelegate)),(i=t).contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null,i.selection&&(i.selection=i.selection.win=i.selection.dom=i.selection.dom.doc=null),t.destroyed=!0):t.remove())},Tx.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},Tx.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},Tx.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},Tx.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},Tx.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},Tx.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},Tx);function Tx(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x=this;function w(n,r){return function(e,t){return n[e.toLowerCase()]=_e(_e({},t),{type:r})}}this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,Nx(this,vx),this.settings=(d=(f=this).documentBaseUrl,m=n.defaultSettings,p=d,h=kv,v=f,b={id:e,theme:"silver",toolbar_mode:rv(g=t,"floating"),plugins:"",document_base_url:p,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:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,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,summary,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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:v.convertURL,url_converter_scope:v},y=_e(_e({},b),h?Rv:{}),!1!==(C=iv(Nv||_v,Nv,y,m,g)).deprecation_warnings&&ev(g,C),C),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ru.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Za.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),lu.languageLoad=this.settings.language_load,lu.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new Yd(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new Sx(this),this.editorCommands=new G1(this),this.settings.cache_suffix&&(xt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:{addAutocompleter:(u={},(r={addButton:w(o={},"button"),addGroupToolbarButton:w(o,"grouptoolbarbutton"),addToggleButton:w(o,"togglebutton"),addMenuButton:w(o,"menubutton"),addSplitButton:w(o,"splitbutton"),addMenuItem:w(i={},"menuitem"),addNestedMenuItem:w(i,"nestedmenuitem"),addToggleMenuItem:w(i,"togglemenuitem"),addAutocompleter:w(a={},"autocompleter"),addContextMenu:w(s={},"contextmenu"),addContextToolbar:w(c={},"contexttoolbar"),addContextForm:w(c,"contextform"),addSidebar:w(l={},"sidebar"),addIcon:function(e,t){return u[e.toLowerCase()]=t},getAll:function(){return{buttons:o,menuItems:i,icons:u,popups:a,contextMenus:s,contextToolbars:c,sidebars:l}}}).addAutocompleter),addButton:r.addButton,addContextForm:r.addContextForm,addContextMenu:r.addContextMenu,addContextToolbar:r.addContextToolbar,addIcon:r.addIcon,addMenuButton:r.addMenuButton,addMenuItem:r.addMenuItem,addNestedMenuItem:r.addNestedMenuItem,addSidebar:r.addSidebar,addSplitButton:r.addSplitButton,addToggleButton:r.addToggleButton,addGroupToolbarButton:r.addGroupToolbarButton,addToggleMenuItem:r.addToggleMenuItem,getAll:r.getAll},styleSheetLoader:void 0,show:te,hide:te,enable:te,disable:te,isDisabled:D};var S,E,k,N,_,A=(N=iu("design"),_=iu({design:{activate:te,deactivate:te,editorReadOnly:!1},readonly:{activate:te,deactivate:te,editorReadOnly:!0}}),(E=S=this).serializer?rx(E):E.on("PreInit",function(){rx(E)}),(k=S).on("ShowCaret",function(e){nx(k)&&e.preventDefault()}),k.on("ObjectSelected",function(e){nx(k)&&e.preventDefault()}),{isReadOnly:function(){return nx(S)},set:function(e){return function(e,t,n,r){if(r!==n.get()){if(!ke(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?dx(e,n,t,r):e.on("init",function(){return dx(e,n,t,r)})}}(S,_.get(),N,e)},get:function(){return N.get()},register:function(e,t){_.set(function(e,t,n){var r;if(T(bx,t))throw new Error("Cannot override default mode "+t);return _e(_e({},e),((r={})[t]=_e(_e({},n),{deactivate:function(){try{n.deactivate()}catch(e){console.error("problem while deactivating editor mode "+t+":",e)}}}),r))}(_.get(),e,t))}});this.mode=A,this.setMode=A.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Xa.overrideDefaults(function(){return{context:x.inline?x.getBody():x.getDoc(),element:x.getBody()}})}function Ox(t){var n=t.type;Fx($x.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})}function Bx(e){e!==Hx&&(e?Xa(window).on("resize scroll",Ox):Xa(window).off("resize scroll",Ox),Hx=e)}function Px(t){var e=Vx;delete jx[t.id];for(var n=0;n<jx.length;n++)if(jx[n]===t){jx.splice(n,1);break}return Vx=U(Vx,function(e){return t!==e}),$x.activeEditor===t&&($x.activeEditor=0<Vx.length?Vx[0]:null),$x.focusedEditor===t&&($x.focusedEditor=null),e.length!==Vx.length}var Lx,Ix=Za.DOM,Mx=Et.explode,Fx=Et.each,Ux=Et.extend,zx=0,Hx=!1,jx=[],Vx=[],qx="CSS1Compat"!==document.compatMode,$x=_e(_e({},px),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Xa,majorVersion:"5",minorVersion:"10.6",releaseDate:"2022-10-19",editors:jx,i18n:cu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t="",n=Yd.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var r=window.tinymce||window.tinyMCEPreInit;if(r)e=r.base||r.baseURL,t=r.suffix;else{for(var o,i=document.getElementsByTagName("script"),a=0;a<i.length;a++)if(""!==(o=i[a].src||"")){var u=o.substring(o.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(o)){-1!==u.indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(o=document.currentScript.src).indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/")))}this.baseURL=new Yd(n).toAbsolute(e),this.documentBaseURL=n,this.baseURI=new Yd(this.baseURL),this.suffix=t,this.on("AddEditor",R(pd,this)),this.on("RemoveEditor",R(hd,this))},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;void 0!==r&&ne(r,function(e,t){lu.PluginManager.urls[t]=e})},init:function(r){function u(e){var t=e.id;return t||(t=ue(e,"name").filter(function(e){return!Ix.get(e)}).getOrThunk(Ix.uniqueId),e.setAttribute("id",t)),t}function s(e,t){return t.constructor===RegExp?t.test(e.className):Ix.hasClass(e,t)}var n,c=this,l=Et.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),f=function(e){n=e},t=function(){function n(e,t,n){var r=new Dx(e,t,c);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()}var o,e,i=0,a=[];Ix.unbind(window,"ready",t),(e=r.onpageload)&&e.apply(c,[]),o=Xa.unique(function(t){var n=[];if(xt.browser.isIE()&&xt.browser.version.major<11)return cy("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(qx)return cy("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return Fx(t.types,function(e){n=n.concat(Ix.select(e.selector))}),n;if(t.selector)return Ix.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var e=t.elements||"";0<e.length&&Fx(Mx(e),function(t){var e=Ix.get(t);e?n.push(e):Fx(document.forms,function(e){Fx(e.elements,function(e){e.name===t&&(t="mce_editor_"+zx++,Ix.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Fx(Ix.select("textarea"),function(e){t.editor_deselector&&s(e,t.editor_deselector)||t.editor_selector&&!s(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?Fx(r.types,function(t){Et.each(o,function(e){return!Ix.is(e,t.selector)||(n(u(e),Ux({},r,t),e),!1)})}):(Et.each(o,function(e){var t;(t=c.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(Px(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0)}),0===(o=Et.grep(o,function(e){return!c.get(e.id)})).length?f([]):Fx(o,function(e){var t=e;r.inline&&t.tagName.toLowerCase()in l?cy("Could not initialize inline editor on invalid inline target element",e):n(u(e),r,e)}))};return c.settings=r,Ix.bind(window,"ready",t),new Nr(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?Vx.slice(0):X(t)?M(Vx,function(e){return e.id===t}).getOr(null):E(t)&&Vx[t]||null},add:function(e){var n=this;return jx[e.id]===e||(null===n.get(e.id)&&("length"!==e.id&&(jx[e.id]=e),jx.push(e),Vx.push(e)),Bx(!0),n.activeEditor=e,n.fire("AddEditor",{editor:e}),Lx||(Lx=function(e){var t=n.fire("BeforeUnload");if(t.returnValue)return e.preventDefault(),e.returnValue=t.returnValue,t.returnValue},window.addEventListener("beforeunload",Lx))),e},createEditor:function(e,t){return this.add(new Dx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!X(e))return n=e,l(r.get(n.id))?null:(Px(n)&&r.fire("RemoveEditor",{editor:n}),0===Vx.length&&window.removeEventListener("beforeunload",Lx),n.remove(),Bx(0<Vx.length),n);Fx(Ix.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=Vx.length-1;0<=t;t--)r.remove(Vx[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Dx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",!1,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Fx(Vx,function(e){e.save()})},addI18n:function(e,t){cu.add(e,t)},translate:function(e){return cu.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},_setBaseUrl:function(e){this.baseURL=new Yd(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new Yd(this.baseURL)}});function Wx(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,c=(n||"").split("");return"b"===c[0]&&(o+=s),"r"===c[1]&&(r+=u),"c"===c[0]&&(o+=tw(s/2)),"c"===c[1]&&(r+=tw(u/2)),"b"===c[3]&&(o-=a),"r"===c[4]&&(r-=i),"c"===c[3]&&(o-=tw(a/2)),"c"===c[4]&&(r-=tw(i/2)),Xx(r,o,i,a)}function Kx(){}$x.setup();function Xx(e,t,n,r){return{x:e,y:t,w:n,h:r}}var Yx,Gx,Jx,Qx,Zx=Math.min,ew=Math.max,tw=Math.round,nw={inflate:function(e,t,n){return Xx(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Wx,findBestRelativePosition:function(e,t,n,r){for(var o,i=0;i<r.length;i++)if((o=Wx(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=ew(e.x,t.x),r=ew(e.y,t.y),o=Zx(e.x+e.w,t.x+t.w),i=Zx(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:Xx(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=ew(0,t.x-r),l=ew(0,t.y-o),f=ew(0,i-u),d=ew(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),Xx(r,o,(i-=f)-r,(a-=d)-o)},create:Xx,fromClientRect:function(e){return Xx(e.left,e.top,e.width,e.height)}},rw=(Yx={},Gx={},{load:function(r,o){var i='Script at URL "'+o+'" failed to load',a='Script at URL "'+o+"\" did not call `tinymce.Resource.add('"+r+"', data)` within 1 second";if(void 0!==Yx[r])return Yx[r];var e=new Nr(function(e,t){var n=function(e,t,n){function r(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o||(o=!0,null!==i&&(clearTimeout(i),i=null),n.apply(null,e))}}void 0===n&&(n=1e3);var o=!1,i=null,a=r(e),u=r(t);return{start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o||null!==i||(i=setTimeout(function(){return u.apply(null,e)},n))},resolve:a,reject:u}}(e,t);Gx[r]=n.resolve,ru.ScriptLoader.loadScript(o,function(){return n.start(a)},function(){return n.reject(i)})});return Yx[r]=e},add:function(e,t){void 0!==Gx[e]&&(Gx[e](t),delete Gx[e]),Yx[e]=Nr.resolve(t)}}),ow=Et.each,iw=Et.extend;Kx.extend=Jx=function(n){function r(){var e,t,n;if(!Qx&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)}function t(){return this}var o=this.prototype;Qx=!0;var i=new this;return Qx=!1,n.Mixins&&(ow(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&ow(n.Methods.split(","),function(e){n[e]=t}),n.Properties&&ow(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return void 0!==e?(this[t]=e,this):this[t]}}),n.Statics&&ow(n.Statics,function(e,t){r[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=iw({},o.Defaults,n.Defaults)),ne(n,function(e,t){var n,r;"function"==typeof e&&o[t]?i[t]=(n=t,r=e,function(){var e=this._super;this._super=o[n];var t=r.apply(this,arguments);return this._super=e,t}):i[t]=e}),r.prototype=i,(r.constructor=r).extend=Jx,r};var aw,uw,sw,cw=Math.min,lw=Math.max,fw=Math.round,dw={serialize:function(e){var t=JSON.stringify(e);return X(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},mw={callbacks:{},count:0,send:function(t){var n=this,r=Za.DOM,o=(void 0!==t.count?t:n).count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},gw=_e(_e({},px),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):_r.setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",gw.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Et.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=gw.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();_r.setTimeout(r,10)}}),pw=Et.extend,hw=(vw.sendRPC=function(e){return(new vw).send(e)},vw.prototype.send=function(e){var n=e.error,r=e.success,o=pw(this.settings,e);o.success=function(e,t){(e=void 0===(e=dw.parse(e))?{error:"JSON Parse error."}:e).error?n.call(o.error_scope||o.scope,e.error,t):r.call(o.success_scope||o.scope,e.result)},o.error=function(e,t){n&&n.call(o.error_scope||o.scope,e,t)},o.data=dw.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),o.content_type="application/json",gw.send(o)},vw);function vw(e){this.settings=pw({},e),this.count=0}try{var bw,yw="__storage_test__";(bw=window.localStorage).setItem(yw,yw),bw.removeItem(yw)}catch(e){aw={},uw=[],sw={getItem:function(e){return aw[e]||null},setItem:function(e,t){uw.push(e),aw[e]=String(t)},key:function(e){return uw[e]},removeItem:function(t){uw=uw.filter(function(e){return e===t}),delete aw[t]},clear:function(){uw=[],aw={}},length:0},Object.defineProperty(sw,"length",{get:function(){return uw.length},configurable:!1,enumerable:!1}),bw=sw}var Cw={geom:{Rect:nw},util:{Promise:Nr,Delay:_r,Tools:Et,VK:Lf,URI:Yd,Class:Kx,EventDispatcher:ax,Observable:px,I18n:cu,XHR:gw,JSON:dw,JSONRequest:hw,JSONP:mw,LocalStorage:bw,Color:function(e){function t(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=lw(0,cw(t,1)),n=lw(0,cw(n,1)),0!==t){var r=e/60,o=n*t,i=o*(1-Math.abs(r%2-1)),a=n-o;switch(Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=fw(255*(u+a)),s=fw(255*(s+a)),c=fw(255*(c+a))}else u=s=c=fw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n}var n={},u=0,s=0,c=0;return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=cw(e/=255,cw(t/=255,n/=255)))===(a=lw(e,lw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:fw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:fw(100*r),v:fw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){function e(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+e(u)+e(s)+e(c)},n.parse=t,n},ImageUploader:function(n){var e=qv(),r=Yv(n,e);return{upload:function(e,t){return r.upload(e,(t=void 0===t||t)?Xv(n):void 0)}}}},dom:{EventUtils:si,Sizzle:sa,DomQuery:Xa,TreeWalker:Rr,TextSeeker:_u,DOMUtils:Za,ScriptLoader:ru,RangeUtils:Pf,Serializer:Jh,StyleSheetLoader:wr,ControlSelection:wf,BookmarkManager:zl,Selection:Fh,Event:si.Event},html:{Styles:io,Entities:Qo,Node:Hd,Schema:ro,SaxParser:Qd,DomParser:Xh,Writer:om,Serializer:im},Env:xt,AddOnManager:lu,Annotator:Ul,Formatter:eb,UndoManager:nb,EditorCommands:G1,WindowManager:Mv,NotificationManager:lv,EditorObservable:vx,Shortcuts:Sx,Editor:Dx,FocusManager:Md,EditorManager:$x,DOM:Za.DOM,ScriptLoader:ru.ScriptLoader,PluginManager:Lv,ThemeManager:Iv,IconManager:Dv,Resource:rw,trim:Et.trim,isArray:Et.isArray,is:Et.is,toArray:Et.toArray,makeMap:Et.makeMap,each:Et.each,map:Et.map,grep:Et.grep,inArray:Et.inArray,extend:Et.extend,create:Et.create,walk:Et.walk,createNS:Et.createNS,resolve:Et.resolve,explode:Et.explode,_addCacheSuffix:Et._addCacheSuffix,isOpera:xt.opera,isWebKit:xt.webkit,isIE:xt.ie,isGecko:xt.gecko,isMac:xt.mac},xw=Et.extend($x,Cw),ww=xw;window.tinymce=ww,window.tinyMCE=ww,function(e){if("object"==typeof module)try{module.exports=e}catch(e){}}(xw)}();
!function(){"use strict";function r(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}function f(o){return m(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r<n;r++)if(!o.eq(e[r],t[r]))return!1;return!0})}function d(l){return m(function(e,t){var n,r,o,i=Object.keys(e),a=Object.keys(t);if(r=f(g),o=function(e){return t=n,Array.prototype.slice.call(e).sort(t);var t},!m(function(e,t){return r.eq(o(e),o(t))}).eq(i,a))return!1;for(var u=i.length,s=0;s<u;s++){var c=i[s];if(!l.eq(e[c],t[c]))return!1}return!0})}function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function n(t){return function(e){return t===e}}function K(e){return null==e}function V(e){return!K(e)}function te(){}function i(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}}function a(t,n){return function(e){return t(n(e))}}function J(e){return function(){return e}}function u(e){return e}function o(e,t){return e===t}var m=function(e){return{eq:e}},g=m(function(e,t){return e===t}),p=m(function(e,t){if(e===t)return!0;var n=r(e);return n===r(t)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(n)?e===t:"array"===n?f(p).eq(e,t):"object"===n&&d(p).eq(e,t))}),X=e("string"),h=e("object"),S=e("array"),l=n(null),v=t("boolean"),b=n(void 0),y=t("function"),E=t("number");function R(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}function s(t){return function(e){return!t(e)}}function C(e){return e()}function x(e){e()}function c(){return k}var D=J(!1),w=J(!0),k={fold:function(e,t){return e()},isSome:D,isNone:w,getOr:u,getOrThunk:N,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:J(null),getOrUndefined:J(void 0),or:u,orThunk:N,map:c,each:te,bind:c,exists:D,forall:w,filter:function(){return k},toArray:function(){return[]},toString:J("none()")};function N(e){return e()}function _(e,t){return ye.call(e,t)}function T(e,t){return-1<_(e,t)}function F(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1}function A(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}function Y(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function O(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}function B(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}}function U(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}function P(e,n,r){return O(e,function(e,t){r=n(r,e,t)}),r}function L(e,n,r){return Y(e,function(e,t){r=n(r,e,t)}),r}function I(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return ve.some(i);if(n(i,r))break}return ve.none()}function M(e,t){return I(e,t,D)}function z(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return ve.some(n);return ve.none()}function H(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!S(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Ce.apply(t,e[n])}return t}(A(e,t))}function j(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0}function q(e){var t=be.call(e,0);return t.reverse(),t}function $(e,t){return U(e,function(e){return!T(t,e)})}function W(e,t){var n=be.call(e,0);return n.sort(t),n}function G(e,t){return 0<=t&&t<e.length?ve.some(e[t]):ve.none()}function Q(e){return G(e,0)}function Z(e){return G(e,e.length-1)}function ee(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return ve.none()}function ne(e,t){for(var n=we(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}function re(e,n){return Ee(e,function(e,t){return{k:t,v:n(e,t)}})}function oe(n){return function(e,t){n[t]=e}}function ie(e,n,r,o){return ne(e,function(e,t){(n(e,t)?r:o)(e,t)}),1}function ae(e,t){var n={};return ie(e,t,oe(n),te),n}function ue(e,t){return ke(e,t)?ve.from(e[t]):ve.none()}function se(e,t){return ke(e,t)&&void 0!==e[t]&&null!==e[t]}function ce(e,t,n){var r,o;if(!e)return!1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return!1}else for(r in e)if(ke(e,r)&&!1===t.call(n,e[r],r,e))return!1;return!0}function le(n,r){var o=[];return ce(n,function(e,t){o.push(r(e,t,n))}),o}function fe(n,r){var o=[];return ce(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o}function de(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function me(e,t,n,r){for(var o=b(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o}function ge(e,t,n){for(var r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1}function pe(e){return e[e.length-1]}var he=function(n){function e(){return o}function t(e){return e(n)}var r=J(n),o={fold:function(e,t){return t(n)},isSome:w,isNone:D,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return he(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:k},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},ve={some:he,none:c,from:function(e){return null==e?k:he(e)}},be=Array.prototype.slice,ye=Array.prototype.indexOf,Ce=Array.prototype.push,xe=y(Array.from)?Array.from:function(e){return be.call(e)},we=Object.keys,Se=Object.hasOwnProperty,Ee=function(e,r){var o={};return ne(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},ke=function(e,t){return Se.call(e,t)},Ne=Array.isArray,_e=function(){return(_e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ae(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Re(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}}function De(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})}function Te(e,t){return-1!==e.indexOf(t)}function Oe(t){return function(e){return e.replace(t,"")}}function Be(e){return 0<e.length}function Pe(e){return!Be(e)}function Le(t){return function(e){return Te(e,t)}}function Ie(e){return window.matchMedia(e).matches}function Me(e){return null==e?"":(""+e).replace(wt,"")}function Fe(e,t){return t?!("array"!==t||!Ne(e))||typeof e===t:void 0!==e}function Ue(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n}function ze(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function He(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount}function je(e,t){return e.dom===t.dom}function Ve(e,t){return dt().browser.isIE()?(n=e.dom,r=t.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o)):(i=e.dom)!==(a=t.dom)&&i.contains(a);var n,r,o,i,a}function qe(){return Xe(0,0)}function $e(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isEdge:t("Edge"),isChrome:t("Chrome"),isIE:t("IE"),isOpera:t("Opera"),isFirefox:t(nt),isSafari:t("Safari")}}function We(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isWindows:t(it),isiOS:t("iOS"),isAndroid:t(at),isOSX:t("OSX"),isLinux:t("Linux"),isSolaris:t(ut),isFreeBSD:t(st),isChromeOS:t(ct)}}function Ke(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var Xe=function(e,t){return{major:e,minor:t}},Ye={nu:Xe,detect:function(e,t){var n,r,o=String(t).toLowerCase();return 0===e.length?qe():(r=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,n=o))?Xe(i(1),i(2)):{major:0,minor:0};function i(e){return Number(n.replace(r,"$"+e))}},unknown:qe},Ge=function(e,t){return""===(n=t)||e.length>=n.length&&e.substr(0,0+n.length)===n;var n},Je=Oe(/^\s+|\s+$/g),Qe=Oe(/^\s+/g),Ze=Oe(/\s+$/g),et=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,tt={browsers:J([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Te(e,"edge/")&&Te(e,"chrome")&&Te(e,"safari")&&Te(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,et],search:function(e){return Te(e,"chrome")&&!Te(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Te(e,"msie")||Te(e,"trident")}},{name:"Opera",versionRegexes:[et,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Le("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Le("firefox")},{name:"Safari",versionRegexes:[et,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Te(e,"safari")||Te(e,"mobile/"))&&Te(e,"applewebkit")}}]),oses:J([{name:"Windows",search:Le("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Te(e,"iphone")||Te(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Le("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Le("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Le("linux"),versionRegexes:[]},{name:"Solaris",search:Le("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Le("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Le("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},nt="Firefox",rt=function(){return $e({current:void 0,version:Ye.unknown()})},ot=$e,it=(J("Edge"),J("Chrome"),J("IE"),J("Opera"),J(nt),J("Safari"),"Windows"),at="Android",ut="Solaris",st="FreeBSD",ct="ChromeOS",lt=function(){return We({current:void 0,version:Ye.unknown()})},ft=We,dt=(J(it),J("iOS"),J(at),J("Linux"),J("OSX"),J(ut),J(st),J(ct),Re(function(){return e=navigator.userAgent,t=ve.from(navigator.userAgentData),n=Ie,p=tt.browsers(),h=tt.oses(),v=t.bind(function(e){return r=p,ee(e.brands,function(t){var n=t.brand.toLowerCase();return M(r,function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(function(e){return{current:e.name,version:Ye.nu(parseInt(t.version,10),0)}})});var r}).orThunk(function(){return De(p,n=e).map(function(e){var t=Ye.detect(e.versionRegexes,n);return{current:e.name,version:t}});var n}).fold(rt,ot),b=De(h,r=e).map(function(e){var t=Ye.detect(e.versionRegexes,r);return{current:e.name,version:t}}).fold(lt,ft),{browser:v,os:b,deviceType:(i=v,a=e,u=n,s=(o=b).isiOS()&&!0===/ipad/i.test(a),c=o.isiOS()&&!s,f=(l=o.isiOS()||o.isAndroid())||u("(pointer:coarse)"),d=s||!c&&l&&u("(min-device-width:768px)"),m=c||l&&!d,g=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(a),{isiPad:J(s),isiPhone:J(c),isTablet:J(d),isPhone:J(m),isTouch:J(f),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:J(g),isDesktop:J(!m&&!d&&!g)})};var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b})),mt=navigator.userAgent,gt=dt(),pt=gt.browser,ht=gt.os,vt=gt.deviceType,bt=/WebKit/.test(mt)&&!pt.isEdge(),yt="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ct=-1!==mt.indexOf("Windows Phone"),xt={opera:pt.isOpera(),webkit:bt,ie:!(!pt.isIE()&&!pt.isEdge())&&pt.version.major,gecko:pt.isFirefox(),mac:ht.isOSX()||ht.isiOS(),iOS:vt.isiPad()||vt.isiPhone(),android:ht.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:pt.isIE()?document.documentMode||7:10,fileApi:yt,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!pt.isIE(),desktop:vt.isDesktop(),windowsPhone:Ct,browser:{current:pt.current,version:pt.version,isChrome:pt.isChrome,isEdge:pt.isEdge,isFirefox:pt.isFirefox,isIE:pt.isIE,isOpera:pt.isOpera,isSafari:pt.isSafari},os:{current:ht.current,version:ht.version,isAndroid:ht.isAndroid,isChromeOS:ht.isChromeOS,isFreeBSD:ht.isFreeBSD,isiOS:ht.isiOS,isLinux:ht.isLinux,isOSX:ht.isOSX,isSolaris:ht.isSolaris,isWindows:ht.isWindows},deviceType:{isDesktop:vt.isDesktop,isiPad:vt.isiPad,isiPhone:vt.isiPhone,isPhone:vt.isPhone,isTablet:vt.isTablet,isTouch:vt.isTouch,isWebView:vt.isWebView}},wt=/^\s*|\s*$/g,St=function(e,n,r,o){o=o||this,e&&ce(e=r?e[r]:e,function(e,t){return!1!==n.call(o,e,t,r)&&void St(e,n,r,o)})},Et={trim:Me,isArray:Ne,is:Fe,toArray:function(e){if(Ne(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},makeMap:function(e,t,n){var r;for(t=t||",",n=n||{},r=(e="string"==typeof(e=e||[])?e.split(t):e).length;r--;)n[e[r]]={};return n},each:ce,map:le,grep:fe,inArray:de,hasOwn:ke,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o,i,a=t[r];for(o in a)!ke(a,o)||void 0!==(i=a[o])&&(e[o]=i)}return e},create:function(e,t,n){var r,o,i,a=this,u=0,s=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],c=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!c[s]){if("static"===e[2])return c[s]=t,void(this.onCreate&&this.onCreate(e[2],e[3],c[s]));t[s]||(t[s]=function(){},u=1),c[s]=t[s],a.extend(c[s].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=c[s],c[s]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[s].prototype[s]=c[s],a.each(r,function(e,t){c[s].prototype[t]=r[t]}),a.each(t,function(e,t){r[t]?c[s].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==s&&(c[s].prototype[t]=e)})),a.each(t.static,function(e,t){c[s][t]=e})}},walk:St,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Fe(e,"array")?e:le(e.split(t||","),Me)},_addCacheSuffix:function(e){var t=xt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},kt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ke(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Ke(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Ke(n)},fromDom:Ke,fromPoint:function(e,t,n){return ve.from(e.dom.elementFromPoint(t,n)).map(Ke)}};function Nt(e){return e.dom.nodeName.toLowerCase()}function _t(e){return e.dom.nodeType}function At(t){return function(e){return _t(e)===t}}function Rt(e){return kt.fromDom(e.dom.ownerDocument)}function Dt(e){return An(e)?e:Rt(e)}function Tt(e){return kt.fromDom(Dt(e).dom.defaultView)}function Ot(e){return ve.from(e.dom.parentNode).map(kt.fromDom)}function Bt(e){return ve.from(e.dom.previousSibling).map(kt.fromDom)}function Pt(e){return ve.from(e.dom.nextSibling).map(kt.fromDom)}function Lt(e){return q(Ue(e,Bt))}function It(e){return Ue(e,Pt)}function Mt(e,t){var n=e.dom.childNodes;return ve.from(n[t]).map(kt.fromDom)}function Ft(e){return Mt(e,0)}function Ut(e){return Mt(e,e.dom.childNodes.length-1)}function zt(e){return e.dom.childNodes.length}function Ht(e){return Rn(e)&&V(e.dom.host)}function jt(t){return Ht(t)?t:function(){var e=Dt(t).dom.head;if(null==e)throw new Error("Head is not available yet");return kt.fromDom(e)}()}function Vt(e){return kt.fromDom(e.dom.host)}function qt(t,n){Ot(t).each(function(e){e.dom.insertBefore(n.dom,t.dom)})}function $t(e,t){Pt(e).fold(function(){Ot(e).each(function(e){Pn(e,t)})},function(e){qt(e,t)})}function Wt(t,n){Ft(t).fold(function(){Pn(t,n)},function(e){t.dom.insertBefore(n.dom,e.dom)})}function Kt(t,e){Y(e,function(e){Pn(t,e)})}function Xt(e){e.dom.textContent="",Y(Dn(e),function(e){Ln(e)})}function Yt(e){var t,n=Dn(e);0<n.length&&(t=e,Y(n,function(e){qt(t,e)})),Ln(e)}function Gt(e,t){return void 0!==e?e:void 0!==t?t:0}function Jt(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Fn(n,r)}function Qt(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t)}function Zt(e,t){dt().browser.isSafari()&&y(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)}function en(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}}function tn(e){var r=void 0===e?window:e,t=r.document,o=Jt(kt.fromDom(t)),n=void 0===r?window:r;return(dt().browser.isFirefox()?ve.none():ve.from(n.visualViewport)).fold(function(){var e=r.document.documentElement,t=e.clientWidth,n=e.clientHeight;return en(o.left,o.top,t,n)},function(e){return en(Math.max(e.pageLeft,o.left),Math.max(e.pageTop,o.top),e.width,e.height)})}function nn(t){return function(e){return!!e&&e.nodeType===t}}function rn(e){return e&&!Object.getPrototypeOf(e)}function on(e){var n=e.map(function(e){return e.toLowerCase()});return function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();return T(n,t)}return!1}}function an(r,e){var o=e.toLowerCase().split(" ");return function(e){if(zn(e))for(var t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}}function un(t){return function(e){return zn(e)&&e.hasAttribute(t)}}function sn(e){return zn(e)&&e.hasAttribute("data-mce-bogus")}function cn(e){return zn(e)&&"TABLE"===e.tagName}function ln(t){return function(e){if(zn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}}function fn(e,t,n){return void 0===n&&(n=o),e.exists(function(e){return n(e,t)})}function dn(e,t,n){return e.isSome()&&t.isSome()?ve.some(n(e.getOrDie(),t.getOrDie())):ve.none()}function mn(e){return void 0!==e.style&&y(e.style.getPropertyValue)}function gn(e,t,n){if(!(X(n)||v(n)||E(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}function pn(e,t,n){gn(e.dom,t,n)}function hn(e,t){var n=e.dom;ne(t,function(e,t){gn(n,t,e)})}function vn(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n}function bn(e,t){return ve.from(vn(e,t))}function yn(e,t){e.dom.removeAttribute(t)}function Cn(e,t){var n=e.dom;ne(t,function(e,t){!function(e,t,n){if(!X(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);mn(e)&&e.style.setProperty(t,n)}(n,t,e)})}function xn(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||In(e)?r:Qn(n,t)}function wn(e,t){var n=e.dom,r=Qn(n,t);return ve.from(r).filter(function(e){return 0<e.length})}function Sn(e){var t={},n=e.dom;if(mn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t}function En(e){return M(e,Nn)}function kn(e,t){return e.children&&T(e.children,t)}"undefined"!=typeof window||Function("return this;")();var Nn=At(1),_n=At(3),An=At(9),Rn=At(11),Dn=function(e){return A(e.dom.childNodes,kt.fromDom)},Tn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),On=J(Tn),Bn=Tn?function(e){return kt.fromDom(e.dom.getRootNode())}:Dt,Pn=function(e,t){e.dom.appendChild(t.dom)},Ln=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},In=function(e){var t=_n(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n=t.ownerDocument,r=kt.fromDom(t),o=Bn(r);return(Ht(o)?ve.some(o):ve.none()).fold(function(){return n.body.contains(t)},a(In,Vt))},Mn=function(n,r){return{left:n,top:r,translate:function(e,t){return Mn(n+e,r+t)}}},Fn=Mn,Un=function(e){var t,n=e.dom,r=n.ownerDocument.body;return r===n?Fn(r.offsetLeft,r.offsetTop):In(e)?(t=n.getBoundingClientRect(),Fn(t.left,t.top)):Fn(0,0)},zn=nn(1),Hn=on(["textarea","input"]),jn=nn(3),Vn=nn(8),qn=nn(9),$n=nn(11),Wn=on(["br"]),Kn=on(["img"]),Xn=ln("true"),Yn=ln("false"),Gn=on(["td","th"]),Jn=on(["video","audio","object","embed"]),Qn=function(e,t){return mn(e)?e.style.getPropertyValue(t):""},Zn=dt().browser,er={},tr={exports:er};function nr(e){setTimeout(function(){throw e},0)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void s(r.promise,e)}u(r.promise,e)}else(1===n._state?u:s)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new l(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof er&&void 0!==tr?tr.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();function rr(e){return sr(function(){return new ir(e)})}function or(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return Y(a,function(e,r){var t=we(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(void 0!==n[o])throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var t=we(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!j(u,function(e){return T(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n}var ir=tr.exports.boltExport,ar=function(e){function r(e){o()?i(e):t.push(e)}var n=ve.none(),t=[],o=function(){return n.isSome()},i=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){o()||(n=ve.some(e),Y(t,i),t=[])}),{get:r,map:function(n){return ar(function(t){r(function(e){t(n(e))})})},isReady:o}},ur={nu:ar,pure:function(t){return ar(function(e){e(t)})}},sr=function(n){function e(e){n().then(e,nr)}return{map:function(e){return sr(function(){return n().then(e)})},bind:function(t){return sr(function(){return n().then(function(e){return t(e).toPromise()})})},anonBind:function(e){return sr(function(){return n().then(function(){return e.toPromise()})})},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return sr(function(){return e=null===e?n():e})},toPromise:n,get:e}},cr=function(n){return{isValue:w,isError:D,getOr:J(n),getOrThunk:J(n),getOrDie:J(n),or:function(e){return cr(n)},orThunk:function(e){return cr(n)},fold:function(e,t){return t(n)},map:function(e){return cr(e(n))},mapError:function(e){return cr(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOptional:function(){return ve.some(n)}}},lr=function(n){return{isValue:D,isError:w,getOr:u,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:u,orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return lr(n)},mapError:function(e){return lr(e(n))},each:te,bind:function(e){return lr(n)},exists:D,forall:w,toOptional:ve.none}},fr={value:cr,error:lr,fromOption:function(e,t){return e.fold(function(){return lr(t)},cr)}};function dr(e){return e.fold(u,u)}function mr(e,t,n,r,o){return e(n,r)?ve.some(n):y(o)&&o(n)?ve.none():t(n,r,o)}function gr(e,t,n){for(var r=e.dom,o=y(n)?n:D;r.parentNode;){var r=r.parentNode,i=kt.fromDom(r);if(t(i))return ve.some(i);if(o(i))break}return ve.none()}function pr(e,t,n){return mr(function(e,t){return t(e)},gr,e,t,n)}function hr(e,t,n){return gr(e,function(e){return ze(e,t)},n)}function vr(e,t){return n=t,He(r=void 0===e?document:e.dom)?ve.none():ve.from(r.querySelector(n)).map(kt.fromDom);var n,r}function br(e,t,n){return mr(ze,hr,e,t,n)}function yr(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function Cr(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function xr(n,r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];clearTimeout(o),o=yr(function(){n.apply(this,e)},r)}var o;return e.stop=function(){clearTimeout(o)},e}function wr(m,g){function n(e,t,n){var r,o=Et._addCacheSuffix(e),i=ue(h,o).getOrThunk(function(){return{id:"mce-u"+p++,passed:[],failed:[],count:0}});function a(e,t){for(var n=e.length;n--;)e[n]();i.status=t,i.passed=[],i.failed=[],r&&(r.onload=null,r.onerror=null,r=null)}function u(){return a(i.passed,2),0}function s(){return a(i.failed,3)}(h[o]=i).count++;var c,l,f,d=function(){var e=d;!function(){for(var e=m.styleSheets,t=e.length;t--;){var n=e[t].ownerNode;if(n&&n.id===r.id)return u(),1}}()&&(Date.now()-l<y?_r.setTimeout(e):s())};t&&i.passed.push(t),n&&i.failed.push(n),1!==i.status&&(2!==i.status?3!==i.status?(i.status=1,hn(c=kt.fromTag("link",b.dom),{rel:"stylesheet",type:"text/css",id:i.id}),l=Date.now(),g.contentCssCors&&pn(c,"crossOrigin","anonymous"),g.referrerPolicy&&pn(c,"referrerpolicy",g.referrerPolicy),(r=c.dom).onload=d,r.onerror=s,f=c,Pn(jt(v),f),pn(c,"href",o)):s():u())}function o(t){return rr(function(e){n(t,i(e,J(fr.value(t))),i(e,J(fr.error(t))))})}function t(e){var n=Et._addCacheSuffix(e);ue(h,n).each(function(e){var t;0==--e.count&&(delete h[n],t=e.id,vr(jt(v),"#"+t).each(Ln))})}void 0===g&&(g={});var p=0,h={},v=kt.fromDom(m),b=Dt(v),y=g.maxLoadTime||5e3;return{load:n,loadAll:function(e,n,r){var a,t=A(e,o);a=t,rr(function(r){var o=[],i=0;0===a.length?r([]):Y(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})}).get(function(e){var t=B(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(dr)):n(t.pass.map(dr))})},unload:t,unloadAll:function(e){Y(e,function(e){t(e)})},_setReferrerPolicy:function(e){g.referrerPolicy=e}}}or([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Sr,Er,kr=function(e,t){return M(e.dom.childNodes,function(e){return t(kt.fromDom(e))}).map(kt.fromDom)},Nr=window.Promise||ir,_r={requestAnimationFrame:function(e,t){Sr?Sr.then(e):Sr=new Nr(function(e){(function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];(n=n||function(e){window.setTimeout(e,0)})(e,t)})(e,t=t||document.body)}).then(e)},setTimeout:yr,setInterval:Cr,setEditorTimeout:function(e,t,n){return yr(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r=Cr(function(){e.removed?clearInterval(r):t()},n);return r},debounce:xr,throttle:xr,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ar=(Er=new WeakMap,{forElement:function(e,t){var n=Bn(e).dom;return ve.from(Er.get(n)).getOrThunk(function(){var e=wr(n,t);return Er.set(n,e),e})}}),Rr=(Dr.prototype.current=function(){return this.node},Dr.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},Dr.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},Dr.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},Dr.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},Dr.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e&&(o=e[n],!this.rootNode||o!==this.rootNode)){if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}return(i=e.parentNode)&&i!==this.rootNode?i:void 0}},Dr);function Dr(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}function Tr(t){var n;return function(e){return n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,w),ke(n,Nt(e))}}function Or(e){return Nn(e)&&!mo(e)}function Br(e){return Nn(e)&&"br"===Nt(e)}function Pr(e){return No(e)&&(e=e.parentNode),ko(e)&&e.hasAttribute("data-mce-caret")}function Lr(e){return No(e)&&So(e.data)}function Ir(e){return Pr(e)||Lr(e)}function Mr(e){return e.firstChild!==e.lastChild||!Wn(e.firstChild)}function Fr(e){var t=e.container();return!!jn(t)&&(t.data.charAt(e.offset())===wo||e.isAtStart()&&Lr(t.previousSibling))}function Ur(e){var t=e.container();return!!jn(t)&&(t.data.charAt(e.offset()-1)===wo||e.isAtEnd()&&Lr(t.nextSibling))}function zr(e){return e&&e.hasAttribute("data-mce-caret")?(sn(n=(t=e.getElementsByTagName("br"))[t.length-1])&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n}function Hr(e){return Pr(e.startContainer)}function jr(e){return!Io(e)&&(Oo(e)?!Bo(e.parentNode):Po(e)||To(e)||Lo(e)||Mo(e))}function Vr(e,t){return jr(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Mo(e))return!1;if(Ro(e))return!0}return!0}(e,t)}function qr(e){return Fo.test(e)}function $r(e,t){return jr(e)&&!1===(a=t,jn(i=e)&&qr(i.data)&&!1===(n=i,r=kt.fromDom(a),hr(kt.fromDom(n),"pre,code",R(je,r)).isSome()))||zn(o=e)&&"A"===o.nodeName&&!o.hasAttribute("href")&&(o.hasAttribute("name")||o.hasAttribute("id"))||Uo(e);var n,r,o,i,a}function Wr(e,t){return function(e,t){var n=0;if($r(e,e))return!1;var r=e.firstChild;if(!r)return!0;var o=new Rr(r,e);do{if(t){if(Ho(r)){r=o.next(!0);continue}if(zo(r)){r=o.next();continue}}if(Wn(r))n++,r=o.next();else{if($r(r,e))return!1;r=o.next()}}while(r);return n<=1}(e.dom,t=void 0===t||t)}function Kr(e,t){return V(e)&&($r(e,t)||Or(kt.fromDom(e)))}function Xr(e){return"span"===e.nodeName.toLowerCase()&&"bookmark"===e.getAttribute("data-mce-type")}function Yr(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),Yo[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}}function Gr(e,t){return e.replace(t?qo:$o,function(e){return Yo[e]||e})}function Jr(e,t){return e.replace(t?qo:$o,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Yo[e]||"&#"+e.charCodeAt(0)+";"})}function Qr(e,t,n){return n=n||Jo,e.replace(t?qo:$o,function(e){return Yo[e]||n[e]||e})}function Zr(e,t){return(e=Et.trim(e))?e.split(t||" "):[]}function eo(e,t){var n=ti(e," ",ti(e.toUpperCase()," "));return ri(n,t)}function to(e){return eo("td th li dt dd figcaption caption details summary",e.getTextBlockElements())}function no(e,n){var r;return e&&(r={},ni(e="string"==typeof e?{"*":e}:e,function(e,t){r[t]=r[t.toUpperCase()]=("map"===n?ti:oi)(e,/[, ]/)})),r}function ro(i){function e(e,t,n){var r=i[e];return r?r=ti(r,/[, ]/,ti(r.toUpperCase(),/[, ]/)):(r=Zo[e])||(r=eo(t,n),Zo[e]=r),r}var t,s,n,r,o,a,u,c,S={},l={},E=[],f={},d={},m=(t=(i=i||{}).schema,c={},Zo[t]||(s="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="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"!==t&&(s+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(s+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),ni(Zr(u),function(e){g(e,"",r)}),n=[n,a="center dir isindex noframes"].join(" "),o=[n,r].join(" "),ni(Zr(a),function(e){g(e,"",o)})),o=o||[n,r].join(" "),g("html","manifest","head body"),g("head","","base command link meta noscript script style title"),g("title hr noscript br"),g("base","href target"),g("link","href rel media hreflang type sizes hreflang"),g("meta","name http-equiv content charset"),g("style","media type scoped"),g("script","src async defer type charset"),g("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),g("address dt dd div caption","",o),g("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","",r),g("blockquote","cite",o),g("ol","reversed start type","li"),g("ul","","li"),g("li","value",o),g("dl","","dt dd"),g("a","href target rel media hreflang type",r),g("q","cite",r),g("ins del","cite datetime",o),g("img","src sizes srcset alt usemap ismap width height"),g("iframe","src name width height",o),g("embed","src type width height"),g("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),g("param","name value"),g("map","name",[o,"area"].join(" ")),g("area","alt coords shape href target rel media hreflang type"),g("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),g("colgroup","span","col"),g("col","span"),g("tbody thead tfoot","","tr"),g("tr","","td th"),g("td","colspan rowspan headers",o),g("th","colspan rowspan headers scope abbr",o),g("form","accept-charset action autocomplete enctype method name novalidate target",o),g("fieldset","disabled form name",[o,"legend"].join(" ")),g("label","form for",r),g("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"),g("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),g("select","disabled form multiple name required size","option optgroup"),g("optgroup","disabled label","option"),g("option","disabled label selected value"),g("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),g("menu","type label",[o,"li"].join(" ")),g("noscript","",o),"html4"!==t&&(g("wbr"),g("ruby","",[r,"rt rp"].join(" ")),g("figcaption","",o),g("mark rt rp summary bdi","",r),g("canvas","width height",o),g("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),g("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),g("picture","","img source"),g("source","src srcset type media sizes"),g("track","kind src srclang label default"),g("datalist","",[r,"option"].join(" ")),g("article section nav aside main header footer","",o),g("hgroup","","h1 h2 h3 h4 h5 h6"),g("figure","",[o,"figcaption"].join(" ")),g("time","datetime",r),g("dialog","open",o),g("command","type label icon disabled checked radiogroup command"),g("output","for form name",r),g("progress","value max",r),g("meter","value min max low high optimum",r),g("details","open",[o,"summary"].join(" ")),g("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(p("script","language xml:space"),p("style","xml:space"),p("object","declare classid code codebase codetype archive standby align border hspace vspace"),p("embed","align name hspace vspace"),p("param","valuetype type"),p("a","charset name rev shape coords"),p("br","clear"),p("applet","codebase archive code object alt name width height align hspace vspace"),p("img","name longdesc align border hspace vspace"),p("iframe","longdesc frameborder marginwidth marginheight scrolling align"),p("font basefont","size color face"),p("input","usemap align"),p("select"),p("textarea"),p("h1 h2 h3 h4 h5 h6 div p legend caption","align"),p("ul","type compact"),p("li","type"),p("ol dl menu dir","compact"),p("pre","width xml:space"),p("hr","align noshade size width"),p("isindex","prompt"),p("table","summary width frame rules cellspacing cellpadding align bgcolor"),p("col","width align char charoff valign"),p("colgroup","width align char charoff valign"),p("thead","align char charoff valign"),p("tr","align char charoff valign bgcolor"),p("th","axis align char charoff valign nowrap bgcolor width height"),p("form","accept"),p("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),p("tfoot","align char charoff valign"),p("tbody","align char charoff valign"),p("area","nohref"),p("body","background bgcolor text link vlink alink")),"html4"!==t&&(p("input button select textarea","autofocus"),p("input textarea","placeholder"),p("a","download"),p("link script img","crossorigin"),p("img","loading"),p("iframe","sandbox seamless allowfullscreen loading")),ni(Zr("a form meter progress dfn"),function(e){c[e]&&delete c[e].children[e]}),delete c.caption.children.table,delete c.script,Zo[t]=c));function g(e,t,n){function r(e,t){for(var n={},r=0,o=e.length;r<o;r++)n[e[r]]=t||{};return n}var o,i;t=t||"","string"==typeof(n=n||[])&&(n=Zr(n));for(var a=Zr(e),u=a.length;u--;)i={attributes:r(o=Zr([s,t].join(" "))),attributesOrder:o,children:r(n,ei)},c[a[u]]=i}function p(e,t){for(var n,r,o,i=Zr(e),a=i.length,u=Zr(t);a--;)for(n=c[i[a]],r=0,o=u.length;r<o;r++)n.attributes[u[r]]={},n.attributesOrder.push(u[r])}!1===i.verify_html&&(i.valid_elements="*[*]");var h=no(i.valid_styles),v=no(i.invalid_styles,"map"),b=no(i.valid_classes,"map"),y=e("whitespace_elements","pre script noscript style textarea video audio iframe object code"),C=e("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),x=e("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),w=e("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),k="td th iframe video audio object script code",N=e("non_empty_elements",k+" pre",x),_=e("move_caret_before_on_enter_elements",k+" table",x),A=e("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),R=e("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 details summary",A),D=e("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");function T(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function O(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,x=/[*?+]/;if(e){var w=Zr(e,",");for(S["@"]&&(h=S["@"].attributes,v=S["@"].attributesOrder),t=0,n=w.length;t<n;t++)if(i=y.exec(w[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h&&(ne(h,function(e,t){d[t]=e}),m.push.apply(m,v)),s)for(r=0,o=(s=Zr(s,"|")).length;r<o;r++)(i=C.exec(s[r]))&&(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"!==f?(g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===g&&(u.validValues=ti(b,"?"))),x.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=T(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)):(delete d[l],m.splice(ii(m,l),1)));h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,S[p]=a),x.test(c)?(a.pattern=T(c),E.push(a)):S[c]=a}}}function B(e){S={},E=[],O(e),ni(m,function(e,t){l[t]=e.children})}function P(e){var a=/^(~)?(.+)$/;e&&(Zo.text_block_elements=Zo.block_elements=null,ni(Zr(e,","),function(e){var t,n=a.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];l[i]=l[o],f[i]=o,r||(R[i.toUpperCase()]={},R[i]={}),S[i]||(t=S[o],delete(t=ri({},t)).removeEmptyAttrs,delete t.removeEmpty,S[i]=t),ni(l,function(e,t){e[o]&&(l[t]=e=ri({},l[t]),e[i]=e[o])})}))}function L(e){var o=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;Zo[i.schema]=null,e&&ni(Zr(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?l[r[2]]:l[r[2]]={"#comment":{}},t=l[r[2]],ni(Zr(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})}function I(e){var t,n=S[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n}ni((i.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(e){d[e]=new RegExp("</"+e+"[^>]*>","gi")}),i.valid_elements?B(i.valid_elements):(ni(m,function(e,t){S[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},l[t]=e.children}),"html5"!==i.schema&&ni(Zr("strong/b em/i"),function(e){var t=Zr(e,"/");S[t[1]].outputName=t[0]}),ni(D,function(e,t){S[t]&&(i.padd_empty_block_inline_children&&(S[t].paddInEmptyBlock=!0),S[t].removeEmpty=!0)}),ni(Zr("ol ul blockquote a table tbody"),function(e){S[e]&&(S[e].removeEmpty=!0)}),ni(Zr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){S[e].paddEmpty=!0}),ni(Zr("span"),function(e){S[e].removeEmptyAttrs=!0})),P(i.custom_elements),L(i.valid_children),O(i.extended_valid_elements),L("+ol[ul|ol],+ul[ul|ol]"),ni({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){S[t]&&(S[t].parentsRequired=Zr(e))}),i.invalid_elements&&ni(oi(i.invalid_elements),function(e){S[e]&&delete S[e]}),I("span")||O("span[!data-mce-type|*]");var M=J(h),F=J(v),U=J(b),z=J(w),H=J(R),j=J(A),V=J(D),q=J(x),$=J(C),W=J(N),K=J(_),X=J(y),Y=J(d),G=J(f);return{children:l,elements:S,getValidStyles:M,getValidClasses:U,getBlockElements:H,getInvalidStyles:F,getShortEndedElements:q,getTextBlockElements:j,getTextInlineElements:V,getBoolAttrs:z,getElementRule:I,getSelfClosingElements:$,getNonEmptyElements:W,getMoveCaretBeforeOnEnterElements:K,getWhiteSpaceElements:X,getSpecialElements:Y,isValidChild:function(e,t){var n=l[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=I(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:G,addValidElements:O,setValidElements:B,addCustomElements:P,addValidChildren:L}}function oo(e,t,n,r){function o(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+o(t)+o(n)+o(r)}function io(b,e){var u,o,y=this,C=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,x=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,w=/\s*([^:]+):\s*([^;]+);?/g,S=/\s+$/,E={},k=Co;b=b||{},e&&(u=e.getValidStyles(),o=e.getInvalidStyles());for(var t=("\\\" \\' \\; \\: ; : "+k).split(" "),N=0;N<t.length;N++)E[t[N]]=k+N,E[k+N]=t[N];return{toHex:function(e){return e.replace(C,oo)},parse:function(e){function t(e,t,n){var r=p[e+"-top"+t];if(r){var o=p[e+"-right"+t];if(o){var i=p[e+"-bottom"+t];if(i){var a=p[e+"-left"+t];if(a){var u=[r,o,i,a];for(N=u.length-1;N--&&u[N]===u[N+1];);-1<N&&n||(p[e+t]=-1===N?u[0]:u.join(" "),delete p[e+"-top"+t],delete p[e+"-right"+t],delete p[e+"-bottom"+t],delete p[e+"-left"+t])}}}}}function n(e){var t,n=p[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return;return p[e]=n[0],1}}function r(e){return f=!0,E[e]}function u(e,t){return f&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return E[e]})),t?e:e.replace(/\\([\'\";:])/g,"$1")}function o(e){return String.fromCharCode(parseInt(e.slice(1),16))}function i(e){return e.replace(/\\[0-9a-f]+/gi,o)}function a(e,t,n,r,o,i){if(o=o||i)return"'"+(o=u(o)).replace(/\'/g,"\\'")+"'";if(t=u(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return"url('"+(t=h?h.call(v,t,"style"):t).replace(/\'/g,"\\'")+"')"}var s,c,l,f,d,m,g,p={},h=b.url_converter,v=b.url_converter_scope||y;if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,r).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,r)});s=w.exec(e);)w.lastIndex=s.index+s[0].length,c=s[1].replace(S,"").toLowerCase(),l=s[2].replace(S,""),c&&l&&(c=i(c),l=i(l),-1===c.indexOf(k)&&-1===c.indexOf('"')&&(b.allow_script_urls||"behavior"!==c&&!/expression\s*\(|\/\*|\*\//.test(l))&&("font-weight"===c&&"700"===l?l="bold":"color"!==c&&"background-color"!==c||(l=l.toLowerCase()),l=(l=l.replace(C,oo)).replace(x,a),p[c]=f?u(l,!0):l));t("border","",!0),t("border","-width"),t("border","-color"),t("border","-style"),t("padding",""),t("margin",""),m="border-style",g="border-color",n(d="border-width")&&n(m)&&n(g)&&(p.border=p[d]+" "+p[m]+" "+p[g],delete p[d],delete p[m],delete p[g]),"medium none"===p.border&&delete p.border,"none"===p["border-image"]&&delete p["border-image"]}return p},serialize:function(i,r){function e(e){var t,n=u[e];if(n)for(var r=0,o=n.length;r<o;r++)e=n[r],(t=i[e])&&(a+=(0<a.length?" ":"")+e+": "+t+";")}var a="";return r&&u?(e("*"),e(r)):ne(i,function(e,t){var n;!e||o&&((n=o["*"])&&n[t]||(n=o[r])&&n[t])||(a+=(0<a.length?" ":"")+t+": "+e+";")}),a}}}function ao(e){return e instanceof Event||y(e.initEvent)}function uo(e,t,n,r){var o,i,a=function(e){var t,n=null!=r?r:{};for(t in e)ke(ai,t)||(n[t]=e[t]);return V(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t);return a.type=e,K(a.target)&&(a.target=null!==(o=a.srcElement)&&void 0!==o?o:n),(K((i=t).preventDefault)||ao(i))&&(a.preventDefault=function(){a.defaultPrevented=!0,a.isDefaultPrevented=w,y(t.preventDefault)?t.preventDefault():ao(t)&&(t.returnValue=!1)},a.stopPropagation=function(){a.cancelBubble=!0,a.isPropagationStopped=w,y(t.stopPropagation)?t.stopPropagation():ao(t)&&(t.cancelBubble=!0)},a.stopImmediatePropagation=function(){a.isImmediatePropagationStopped=w,a.stopPropagation()},a.isDefaultPrevented!==w&&a.isDefaultPrevented!==D&&(a.isDefaultPrevented=!0===a.defaultPrevented?w:D,a.isPropagationStopped=!0===a.cancelBubble?w:D,a.isImmediatePropagationStopped=D)),a}function so(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function co(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function lo(e,t){var n,r,o,i,a=uo(e.type,e,document,t);return V(i=e)&&ui.test(i.type)&&b(e.pageX)&&!b(e.clientX)&&(r=(n=a.target.ownerDocument||document).documentElement,o=n.body,a.pageX=e.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),a.pageY=e.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),b(a.metaKey)&&(a.metaKey=!1),a}var fo=Tr(["h1","h2","h3","h4","h5","h6"]),mo=Tr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),go=Tr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),po=Tr(["ul","ol","dl"]),ho=Tr(["li","dd","dt"]),vo=Tr(["thead","tbody","tfoot"]),bo=Tr(["td","th"]),yo=Tr(["pre","script","textarea","style"]),Co="\ufeff",xo="\xa0",wo=Co,So=function(e){return e===Co},Eo=function(e){return e.replace(/\uFEFF/g,"")},ko=zn,No=jn,_o=function(e){return No(e)&&e.data[0]===wo},Ao=function(e){return No(e)&&e.data[e.data.length-1]===wo},Ro=Xn,Do=Yn,To=Wn,Oo=jn,Bo=on(["script","style","textarea"]),Po=on(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Lo=on(["table"]),Io=Ir,Mo=function(e){return!1===(zn(t=e)&&"true"===t.getAttribute("unselectable"))&&Do(e);var t},Fo=/^[ \t\r\n]*$/,Uo=un("data-mce-bookmark"),zo=un("data-mce-bogus"),Ho=function(e){return zn(e)&&"all"===e.getAttribute("data-mce-bogus")},jo=function(e,t,n){var r=n||t;if(zn(t)&&Xr(t))return t;for(var o,i,a,u,s,c,l,f,d,m,g,p=t.childNodes,h=p.length-1;0<=h;h--)jo(e,p[h],r);return!zn(t)||1===(o=t.childNodes).length&&Xr(o[0])&&t.parentNode.insertBefore(o[0],t),$n(a=t)||qn(a)||$r(t,r)||zn(i=t)&&0<i.childNodes.length||(s=r,jn(u=t)&&0<u.data.length&&(f=new Rr(c=u,l=s).prev(!1),d=new Rr(c,l).next(!1),m=b(f)||Kr(f,l),g=b(d)||Kr(d,l),m&&g))||e.remove(t),t},Vo=Et.makeMap,qo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$o=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\"\']/g,Ko=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Xo={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"},Yo={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Go={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Jo=Yr("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),Qo={encodeRaw:Gr,encodeAllRaw:function(e){return(""+e).replace(Wo,function(e){return Yo[e]||e})},encodeNumeric:Jr,encodeNamed:Qr,getEncodeFunc:function(e,t){var n=Yr(t)||Jo,r=Vo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?qo:$o,function(e){return void 0!==Yo[e]?Yo[e]:void 0!==n[e]?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Qr(e,t,n)}:Qr:r.numeric?Jr:Gr},decode:function(e){return e.replace(Ko,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Xo[t]||String.fromCharCode(t):Go[e]||Jo[e]||(n=e,(r=kt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Zo={},ei={},ti=Et.makeMap,ni=Et.each,ri=Et.extend,oi=Et.explode,ii=Et.inArray,ai={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ui=/^(?:mouse|contextmenu)|click/,si=(ci.prototype.bind=function(e,t,n,r){function o(e){f.executeHandlers(lo(e||d.event),i)}var i,a,u,s,c,l,f=this,d=window;if(e&&3!==e.nodeType&&8!==e.nodeType){e[f.expando]?i=e[f.expando]:(i=f.count++,e[f.expando]=i,f.events[i]={}),r=r||e;for(var m=t.split(" "),g=m.length;g--;)c=o,s=l=!1,"DOMContentLoaded"===(u=m[g])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,lo({type:u})):(f.hasMouseEnterLeave||(s=f.mouseEnterLeave[u])&&(c=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=lo(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,f.executeHandlers(e,i))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=lo(e||d.event)).type="focus"===e.type?"focusin":"focusout",f.executeHandlers(e,i)}),(a=f.events[i][u])?"ready"===u&&f.domLoaded?n(lo({type:u})):a.push({func:n,scope:r}):(f.events[i][u]=a=[{func:n,scope:r}],a.fakeName=s,a.capture=l,a.nativeHandler=c,"ready"===u?function(e,t,n){var r,o=e.document,i={type:"ready"};n.domLoaded?t(i):(r=function(){co(e,"DOMContentLoaded",r),co(e,"load",r),n.domLoaded||(n.domLoaded=!0,t(i)),e=null},"complete"===o.readyState||"interactive"===o.readyState&&o.body?r():so(e,"DOMContentLoaded",r),n.domLoaded||so(e,"load",r))}(e,c,f):so(e,s||u,c,l)));return e=a=null,n}},ci.prototype.unbind=function(n,e,t){var r,o,i;if(!n||3===n.nodeType||8===n.nodeType)return this;var a=n[this.expando];if(a){if(i=this.events[a],e){for(var u,s,c,l,f=e.split(" "),d=f.length;d--;)if(l=i[o=f[d]]){if(t)for(r=l.length;r--;)l[r].func===t&&(u=l.nativeHandler,s=l.fakeName,c=l.capture,(l=l.slice(0,r).concat(l.slice(r+1))).nativeHandler=u,l.fakeName=s,l.capture=c,i[o]=l);t&&0!==l.length||(delete i[o],co(n,l.fakeName||o,l.nativeHandler,l.capture))}}else ne(i,function(e,t){co(n,e.fakeName||t,e.nativeHandler,e.capture)}),i={};for(o in i)if(ke(i,o))return this;delete this.events[a];try{delete n[this.expando]}catch(e){n[this.expando]=null}}return this},ci.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;for(var o=lo({type:t,target:e},n);(r=e[this.expando])&&this.executeHandlers(o,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!o.isPropagationStopped(););return this},ci.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),(e=e.getElementsByTagName?e:e.document)&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},ci.prototype.destroy=function(){this.events={}},ci.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},ci.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},ci.Event=new ci,ci);function ci(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}function li(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)}var fi,di,mi,gi,pi,hi,vi,bi,yi,Ci,xi,wi,Si,Ei,ki,Ni,_i,Ai="sizzle"+-new Date,Ri=window.document,Di=0,Ti=0,Oi=ca(),Bi=ca(),Pi=ca(),Li=function(e,t){return e===t&&(Ci=!0),0},Ii="undefined",Mi={}.hasOwnProperty,Fi=[],Ui=Fi.pop,zi=Fi.push,Hi=Fi.push,ji=Fi.slice,Vi=Fi.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},qi="[\\x20\\t\\r\\n\\f]",$i="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Wi="\\["+qi+"*("+$i+")(?:"+qi+"*([*^$|!~]?=)"+qi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+$i+"))|)"+qi+"*\\]",Ki=":("+$i+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Wi+")*)|.*)\\)|)",Xi=new RegExp("^"+qi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+qi+"+$","g"),Yi=new RegExp("^"+qi+"*,"+qi+"*"),Gi=new RegExp("^"+qi+"*([>+~]|"+qi+")"+qi+"*"),Ji=new RegExp("="+qi+"*([^\\]'\"]*?)"+qi+"*\\]","g"),Qi=new RegExp(Ki),Zi=new RegExp("^"+$i+"$"),ea={ID:new RegExp("^#("+$i+")"),CLASS:new RegExp("^\\.("+$i+")"),TAG:new RegExp("^("+$i+"|[*])"),ATTR:new RegExp("^"+Wi),PSEUDO:new RegExp("^"+Ki),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+qi+"*(even|odd|(([+-]|)(\\d*)n|)"+qi+"*(?:([+-]|)"+qi+"*(\\d+)|))"+qi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+qi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+qi+"*((?:-\\d)?\\d*)"+qi+"*\\)|)(?=[^-]|$)","i")},ta=/^(?:input|select|textarea|button)$/i,na=/^h\d$/i,ra=/^[^{]+\{\s*\[native \w/,oa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ia=/[+~]/,aa=/'|\\/g,ua=new RegExp("\\\\([\\da-f]{1,6}"+qi+"?|("+qi+")|.)","ig");try{Hi.apply(Fi=ji.call(Ri.childNodes),Ri.childNodes),Fi[Ri.childNodes.length].nodeType}catch(e){Hi={apply:Fi.length?function(e,t){zi.apply(e,ji.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var sa=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:Ri)!==wi&&xi(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||wi).nodeType)&&9!==u)return[];if(Ei&&!r){if(o=oa.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_i(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return Hi.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&fi.getElementsByClassName)return Hi.apply(n,t.getElementsByClassName(a)),n}if(fi.qsa&&(!ki||!ki.test(e))){if(f=l=Ai,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=pi(e),(l=t.getAttribute("id"))?f=l.replace(aa,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+pa(c[s]);d=ia.test(e)&&ma(t.parentNode)||t,m=c.join(",")}if(m)try{return Hi.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{l||t.removeAttribute("id")}}}return vi(e.replace(Xi,"$1"),t,n,r)};function ca(){var n=[];function r(e,t){return n.push(e+" ")>di.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function la(e){return e[Ai]=!0,e}function fa(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function da(a){return la(function(i){return i=+i,la(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function ma(e){return e&&typeof e.getElementsByTagName!=Ii&&e}function ga(){}function pa(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ha(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Ti++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Di,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[Ai]||(e[Ai]={}))[u])&&r[0]===Di&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function va(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function ba(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function ya(e){return void 0!==e}function Ca(e){return"string"==typeof e}function xa(e,t){var n,r=(t=t||Aa).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o}function wa(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function Sa(e,t,n){var r,o;return t=Xa(t)[0],e.each(function(){n&&r===this.parentNode||(r=this.parentNode,o=t.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)}),e}function Ea(e,t){return new Xa.fn.init(e,t)}function ka(e){return null==e?"":(""+e).replace(Ha,"")}function Na(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e}function _a(e,n){var r=[];return Na(e,function(e,t){n(t,e)&&r.push(t)}),r}fi=sa.support={},gi=sa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},xi=sa.setDocument=function(e){var t,s=e?e.ownerDocument||e:Ri,n=s.defaultView;return s!==wi&&9===s.nodeType&&s.documentElement?(Si=(wi=s).documentElement,Ei=!gi(s),n&&n!==function(e){try{return e.top}catch(e){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){xi()},!1):n.attachEvent&&n.attachEvent("onunload",function(){xi()})),fi.attributes=!0,fi.getElementsByTagName=!0,fi.getElementsByClassName=ra.test(s.getElementsByClassName),fi.getById=!0,di.find.ID=function(e,t){if(typeof t.getElementById!=Ii&&Ei){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},di.filter.ID=function(e){var t=e.replace(ua,li);return function(e){return e.getAttribute("id")===t}},di.find.TAG=fi.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!=Ii)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},di.find.CLASS=fi.getElementsByClassName&&function(e,t){if(Ei)return t.getElementsByClassName(e)},Ni=[],ki=[],fi.disconnectedMatch=!0,ki=ki.length&&new RegExp(ki.join("|")),Ni=Ni.length&&new RegExp(Ni.join("|")),t=ra.test(Si.compareDocumentPosition),_i=t||ra.test(Si.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},Li=t?function(e,t){return e===t?(Ci=!0,0):(n=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!fi.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===Ri&&_i(Ri,e)?-1:t===s||t.ownerDocument===Ri&&_i(Ri,t)?1:yi?Vi.call(yi,e)-Vi.call(yi,t):0:4&n?-1:1);var n}:function(e,t){if(e===t)return Ci=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:yi?Vi.call(yi,e)-Vi.call(yi,t):0;if(o===i)return fa(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?fa(a[r],u[r]):a[r]===Ri?-1:u[r]===Ri?1:0},s):wi},sa.matches=function(e,t){return sa(e,null,null,t)},sa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==wi&&xi(e),t=t.replace(Ji,"='$1']"),fi.matchesSelector&&Ei&&(!Ni||!Ni.test(t))&&(!ki||!ki.test(t)))try{var n=(void 0).call(e,t);if(n||fi.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<sa(t,wi,null,[e]).length},sa.contains=function(e,t){return(e.ownerDocument||e)!==wi&&xi(e),_i(e,t)},sa.attr=function(e,t){(e.ownerDocument||e)!==wi&&xi(e);var n=di.attrHandle[t.toLowerCase()],r=n&&Mi.call(di.attrHandle,t.toLowerCase())?n(e,t,!Ei):void 0;return void 0!==r?r:fi.attributes||!Ei?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},sa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},sa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ci=!fi.detectDuplicates,yi=!fi.sortStable&&e.slice(0),e.sort(Li),Ci){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return yi=null,e},mi=sa.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=mi(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=mi(t);return n},(di=sa.selectors={cacheLength:50,createPseudo:la,match:ea,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(ua,li),e[3]=(e[3]||e[4]||e[5]||"").replace(ua,li),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||sa.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&sa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ea.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Qi.test(n)&&(t=pi(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(ua,li).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Oi[e+" "];return t||(t=new RegExp("(^|"+qi+")"+e+"("+qi+"|$)"))&&Oi(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!=Ii&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=sa.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!=v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[Ai]||(l[Ai]={}))[m]||[])[0]===Di&&r[1],a=r[0]===Di&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Di,u,a];break}}else if(d&&(r=(e[Ai]||(e[Ai]={}))[m])&&r[0]===Di)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[Ai]||(i[Ai]={}))[m]=[Di,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=di.pseudos[e]||di.setFilters[e.toLowerCase()]||sa.error("unsupported pseudo: "+e);return a[Ai]?a(i):1<a.length?(t=[e,e,"",i],di.setFilters.hasOwnProperty(e.toLowerCase())?la(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=Vi.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:la(function(e){var r=[],o=[],u=hi(e.replace(Xi,"$1"));return u[Ai]?la(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),r[0]=null,!o.pop()}}),has:la(function(t){return function(e){return 0<sa(t,e).length}}),contains:la(function(t){return t=t.replace(ua,li),function(e){return-1<(e.textContent||e.innerText||mi(e)).indexOf(t)}}),lang:la(function(n){return Zi.test(n||"")||sa.error("unsupported lang: "+n),n=n.replace(ua,li).toLowerCase(),function(e){var t;do{if(t=Ei?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}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===Si},focus:function(e){return e===wi.activeElement&&(!wi.hasFocus||wi.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!di.pseudos.empty(e)},header:function(e){return na.test(e.nodeName)},input:function(e){return ta.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:da(function(){return[0]}),last:da(function(e,t){return[t-1]}),eq:da(function(e,t,n){return[n<0?n+t:n]}),even:da(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:da(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:da(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:da(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=di.pseudos.eq,Y(["radio","checkbox","file","password","image"],function(e){var t;di.pseudos[e]=(t=e,function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t})}),Y(["submit","reset"],function(e){var n;di.pseudos[e]=(n=e,function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n})}),ga.prototype=di.filters=di.pseudos,di.setFilters=new ga,pi=sa.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Bi[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=di.preFilter;a;){for(i in n&&!(r=Yi.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=Gi.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Xi," ")}),a=a.slice(n.length)),di.filter)di.filter.hasOwnProperty(i)&&(!(r=ea[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?sa.error(e):Bi(e,u).slice(0)},hi=sa.compile=function(e,t){var n,h,v,b,y,r=[],o=[],i=Pi[e+" "];if(!i){for(n=(t=t||pi(e)).length;n--;)((i=function e(t){for(var o,n,r,i=t.length,a=di.relative[t[0].type],u=a||di.relative[" "],s=a?1:0,c=ha(function(e){return e===o},u,!0),l=ha(function(e){return-1<Vi.call(o,e)},u,!0),f=[function(e,t,n){var r=!a&&(n||t!==bi)||((o=t).nodeType?c:l)(e,t,n);return o=null,r}];s<i;s++)if(n=di.relative[t[s].type])f=[ha(va(f),n)];else{if((n=di.filter[t[s].type].apply(null,t[s].matches))[Ai]){for(r=++s;r<i&&!di.relative[t[r].type];r++);return function e(m,g,p,h,v,t){return h&&!h[Ai]&&(h=e(h)),v&&!v[Ai]&&(v=e(v,t)),la(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)sa(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:ba(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=ba(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?Vi.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=ba(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):Hi.apply(t,d)})}(1<s&&va(f),1<s&&pa(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(Xi,"$1"),n,s<r&&e(t.slice(s,r)),r<i&&e(t=t.slice(r)),r<i&&pa(t))}f.push(n)}return va(f)}(t[n]))[Ai]?r:o).push(i);(i=Pi(e,(h=o,b=0<(v=r).length,y=0<h.length,b?la(a):a))).selector=e}function a(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=bi,m=e||y&&di.find.TAG("*",o),g=Di+=null==d?1:Math.random()||.1,p=m.length;for(o&&(bi=t!==wi&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Di=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=Ui.call(r));f=ba(f)}Hi.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&sa.uniqueSort(r)}return o&&(Di=g,bi=d),l}return i},vi=sa.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&pi(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&fi.getById&&9===t.nodeType&&Ei&&di.relative[i[1].type]){if(!(t=(di.find.ID(a.matches[0].replace(ua,li),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ea.needsContext.test(e)?0:i.length;o--&&(a=i[o],!di.relative[u=a.type]);)if((s=di.find[u])&&(r=s(a.matches[0].replace(ua,li),ia.test(i[0].type)&&ma(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&pa(i)))return Hi.apply(n,r),n;break}}return(c||hi(e,l))(r,t,!Ei,n,ia.test(e)&&ma(t.parentNode)||t),n},fi.sortStable=Ai.split("").sort(Li).join("")===Ai,fi.detectDuplicates=!!Ci,xi(),fi.sortDetached=!0;var Aa=document,Ra=Array.prototype.push,Da=Array.prototype.slice,Ta=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Oa=si.Event,Ba=Et.makeMap("children,contents,next,prev"),Pa=function(e,t,n,r){var o;if(Ca(t))t=xa(t,ja(e[0]));else if(t.length&&!t.nodeType){if(t=Xa.makeArray(t),r)for(o=t.length-1;0<=o;o--)Pa(e,t[o],n,r);else for(o=0;o<t.length;o++)Pa(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},La=Et.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Ia=Et.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ma={for:"htmlFor",class:"className",readonly:"readOnly"},Fa={float:"cssFloat"},Ua={},za={},Ha=/^\s*|\s*$/g,ja=function(e){return e?9===e.nodeType?e:e.ownerDocument:Aa};function Va(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Xa&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Xa(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r}function qa(e,t,n,r){var o=[];for(r instanceof Xa&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&Xa(e).is(r))break}o.push(e)}return o}function $a(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null}function Wa(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName)||null;t.attr("data-mce-style",r)}function Ka(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o}Ea.fn=Ea.prototype={constructor:Ea,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return Xa(e).attr(t);o.context=t=document}if(Ca(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ta.exec(e)))return Xa(t).find(e);if(n[1])for(r=xa(e,ja(t)).firstChild;r;)Ra.call(o,r),r=r.nextSibling;else{if(!(r=ja(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Et.toArray(this)},add:function(e,t){var n,r;if(Ca(e))return this.add(Xa(e));if(!1!==t)for(n=Xa.unique(this.toArray().concat(Xa.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Ra.apply(this,Xa.makeArray(e));return this},attr:function(t,n){var e,r=this;if("object"==typeof t)Na(t,function(e,t){r.attr(e,t)});else{if(!ya(n)){if(r[0]&&1===r[0].nodeType){if((e=Ua[t])&&e.get)return e.get(r[0],t);if(Ia[t])return r.prop(t)?t:void 0;null===(n=r[0].getAttribute(t,2))&&(n=void 0)}return n}this.each(function(){var e;1===this.nodeType&&((e=Ua[t])&&e.set?e.set(this,n):null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2))})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ma[e]||e))Na(e,function(e,t){n.prop(e,t)});else{if(!ya(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(t,n){function e(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var o,i,a=this;if("object"==typeof t)Na(t,function(e,t){a.css(e,t)});else if(ya(n))t=e(t),"number"!=typeof n||La[t]||(n=n.toString()+"px"),a.each(function(){var e=this.style;if((i=za[t])&&i.set)i.set(this,n);else{try{this.style[Fa[t]||t]=n}catch(e){}null!==n&&""!==n||(e.removeProperty?e.removeProperty(r(t)):e.removeAttribute(t))}});else{if(o=a[0],(i=za[t])&&i.get)return i.get(o);if(!o.ownerDocument.defaultView)return o.currentStyle?o.currentStyle[e(t)]:"";try{return o.ownerDocument.defaultView.getComputedStyle(o,null).getPropertyValue(r(t))}catch(e){return}}return a},remove:function(){for(var e,t=this.length;t--;)e=this[t],Oa.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(t){var n;if(ya(t)){n=this.length;try{for(;n--;)this[n].innerHTML=t}catch(e){Xa(this[n]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(e){var t;if(ya(e)){for(t=this.length;t--;)"innerText"in this[t]?this[t].innerText=e:this[0].textContent=e;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Pa(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return Pa(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?Pa(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?Pa(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return Xa(e).append(this),this},prependTo:function(e){return Xa(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Sa(this,e)},wrapAll:function(e){return Sa(this,e,!0)},wrapInner:function(e){return this.each(function(){Xa(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){Xa(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),Xa(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?Na(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r=wa(t,o);r!==i&&(n=t.className,r?t.className=ka((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return wa(this[0],e)},each:function(e){return Na(this,e)},on:function(e,t){return this.each(function(){Oa.bind(this,e,t)})},off:function(e,t){return this.each(function(){Oa.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Oa.fire(this,e.type,e):Oa.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Xa(Da.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){for(var t=[],n=0,r=this.length;n<r;n++)Xa.find(e,this[n],t);return Xa(t)},filter:function(n){return Xa("function"==typeof n?_a(this.toArray(),function(e,t){return n(t,e)}):Xa.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof Xa&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&Xa(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),Xa(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ra,sort:Array.prototype.sort,splice:Array.prototype.splice},Et.extend(Ea,{extend:Et.extend,makeArray:function(e){return e&&e===e.window||e.nodeType?[e]:Et.toArray(e)},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Et.isArray,each:Na,trim:ka,grep:_a,find:sa,expr:sa.selectors,unique:sa.uniqueSort,text:sa.getText,contains:sa.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 1===t.length?Xa.find.matchesSelector(t[0],e)?[t[0]]:[]:Xa.find.matches(e,t)}}),Na({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Va(e,"parentNode")},next:function(e){return $a(e,"nextSibling",1)},prev:function(e){return $a(e,"previousSibling",1)},children:function(e){return qa(e.firstChild,"nextSibling",1)},contents:function(e){return Et.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(r,o){Ea.fn[r]=function(t){var n=[];this.each(function(){var e=o.call(n,this,t,n);e&&(Xa.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(Ba[r]||(n=Xa.unique(n)),0===r.indexOf("parents")&&(n=n.reverse()));var e=Xa(n);return t?e.filter(t):e}}),Na({parentsUntil:function(e,t){return Va(e,"parentNode",t)},nextUntil:function(e,t){return qa(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return qa(e,"previousSibling",1,t).slice(1)}},function(o,i){Ea.fn[o]=function(t,e){var n=[];this.each(function(){var e=i.call(n,this,t,n);e&&(Xa.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=Xa.unique(n),0!==o.indexOf("parents")&&"prevUntil"!==o||(n=n.reverse()));var r=Xa(n);return e?r.filter(e):r}}),Ea.fn.is=function(e){return!!e&&0<this.filter(e).length},Ea.fn.init.prototype=Ea.fn,Ea.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t=t||r.context,new o.fn.init(e,t)};return Xa.extend(o,this),o},Ea.attrHooks=Ua,Ea.cssHooks=za;var Xa=Ea,Ya=Et.each,Ga=Et.grep,Ja=xt.ie,Qa=/^([a-z0-9],?)+$/i,Za=function(a,u){function s(e){return e&&a&&X(e)?a.getElementById(e):e}function c(e){return H("string"==typeof e?s(e):e)}function r(e,t,n){var r,o,i=c(e);return void 0===(o=i.length?(r=W[t])&&r.get?r.get(i,t):i.attr(t):o)?n||"":o}function o(e){var t=s(e);return t?t.attributes:[]}function i(e,t,n){""===n&&(n=null);var r,o=c(e),i=o.attr(t);o.length&&((r=W[t])&&r.set?r.set(o,n,t):o.attr(t,n),i!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:o,attrName:t,attrValue:n}))}function l(){return u.root_element||a.body}function f(e,t){return function(e,t,n){var r,o=0,i=0,a=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===xn(kt.fromDom(e),"position")){var u=t.getBoundingClientRect();return{x:o=u.left+(a.documentElement.scrollLeft||e.scrollLeft)-a.documentElement.clientLeft,y:i=u.top+(a.documentElement.scrollTop||e.scrollTop)-a.documentElement.clientTop}}for(var s=t;s&&s!==n&&s.nodeType&&!kn(s,n);){var c=s;o+=c.offsetLeft||0,i+=c.offsetTop||0,s=c.offsetParent}for(s=t.parentNode;s&&s!==n&&s.nodeType&&!kn(s,n);)o-=s.scrollLeft||0,i-=s.scrollTop||0,s=s.parentNode;i+=(r=kt.fromDom(t),Zn.isFirefox()&&"table"===Nt(r)?En(Dn(r)).filter(function(e){return"caption"===Nt(e)}).bind(function(o){return En(It(o)).map(function(e){var t=e.dom.offsetTop,n=o.dom.offsetTop,r=o.dom.offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:o,y:i}}(a.body,s(e),t)}function d(e,t,n){var r=c(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=xt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)}function m(e){var t=d(e=s(e),"width"),n=d(e,"height");return-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}}function g(e,t){if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(Qa.test(t)){for(var n=t.toLowerCase().split(/,/),r=e.nodeName.toLowerCase(),o=n.length-1;0<=o;o--)if(n[o]===r)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<sa(t,i[0].ownerDocument||i[0],null,i).length}function p(e,t,n,r){var o,i=[],a=s(e);for(r=void 0===r,n=n||("BODY"!==l().nodeName?l().parentNode:null),Et.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return g(e,o)});a&&!(a===n||K(a.nodeType)||qn(a)||$n(a));){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null}function n(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return g(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null}function h(e,n,r){var o,t="string"==typeof e?s(e):e;return!!t&&(Et.isArray(t)&&(t.length||0===t.length)?(o=[],Ya(t,function(e,t){e&&o.push(n.call(r,"string"==typeof e?s(e):e,t))}),o):n.call(r||this,t))}function v(e,t){c(e).each(function(e,n){Ya(t,function(e,t){i(n,t,e)})})}function b(e,n){var t=c(e);Ja?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+n,t.removeChild(t.firstChild)}catch(e){Xa("<div></div>").html("<br>"+n).contents().slice(1).appendTo(t)}return n}}):t.html(n)}function y(e,n,r,o,i){return h(e,function(e){var t="string"==typeof n?a.createElement(n):n;return v(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&b(t,o)),i?t:e.appendChild(t)})}function C(e,t,n){return y(a.createElement(e),e,t,n,!0)}function x(e,t){var n=c(e);return(t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}):n).remove(),1<n.length?n.toArray():n[0]}function w(e,t,n){c(e).toggleClass(t,n).each(function(){""===this.className&&Xa(this).attr("class",null)})}function S(t,e,n){return h(e,function(e){return Et.is(e,"array")&&(t=t.cloneNode(!0)),n&&Ya(Ga(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})}function E(e){if(zn(e)){var t="a"===e.nodeName.toLowerCase()&&!r(e,"href")&&r(e,"id");return r(e,"name")||r(e,"data-mce-bookmark")||t?1:void 0}}function k(){return a.createRange()}function N(e){if(e&&zn(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null}void 0===u&&(u={});var _,A,R,D,e,t,T={},O=window,B={},P=0,L=Ar.forElement(kt.fromDom(a),{contentCssCors:u.contentCssCors,referrerPolicy:u.referrerPolicy}),I=[],M=u.schema||ro({}),F=io({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),U=u.ownEvents?new si:si.Event,z=M.getBlockElements(),H=Xa.overrideDefaults(function(){return{context:a,element:$.getRoot()}}),j=Qo.encodeAllRaw,V=function(e,t,n,r){if(Et.isArray(e)){for(var o=e.length,i=[];o--;)i[o]=V(e[o],t,n,r);return i}return!u.collect||e!==a&&e!==O||I.push([e,t,n,r]),U.bind(e,t,n,r||$)},q=function(e,t,n){if(Et.isArray(e)){for(var r=e.length,o=[];r--;)o[r]=q(e[r],t,n);return o}if(0<I.length&&(e===a||e===O))for(r=I.length;r--;){var i=I[r];e!==i[0]||t&&t!==i[1]||n&&n!==i[2]||U.unbind(i[0],i[1],i[2])}return U.unbind(e,t,n)},$={doc:a,settings:u,win:O,files:B,stdMode:!0,boxModel:!0,styleSheetLoader:L,boundEvents:I,styles:F,schema:M,events:U,isBlock:function(e){if("string"==typeof e)return!!z[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!z[e.nodeName])}return!1},$:H,$$:c,root:null,clone:function(t,e){if(!Ja||1!==t.nodeType||e)return t.cloneNode(e);var n=a.createElement(t.nodeName);return Ya(o(t),function(e){i(n,e.nodeName,r(t,e.nodeName))}),n},getRoot:l,getViewPort:function(e){var t=tn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){var t=f(e=s(e)),n=m(e);return{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:m,getParent:function(e,t,n){var r=p(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:p,get:s,getNext:function(e,t){return n(e,t,"nextSibling")},getPrev:function(e,t){return n(e,t,"previousSibling")},select:function(e,t){return sa(e,s(t)||u.root_element||a,[])},is:g,add:y,create:C,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)se(t,r)&&(o+=" "+r+'="'+j(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(r.appendChild(n),e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r.removeChild(n),r},remove:x,setStyle:function(e,t,n){var r=X(t)?c(e).css(t,n):c(e).css(t);u.update_styles&&Wa(F,r)},getStyle:d,setStyles:function(e,t){var n=c(e).css(t);u.update_styles&&Wa(F,n)},removeAllAttribs:function(e){return h(e,function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--)e.removeAttributeNode(t.item(n))})},setAttrib:i,setAttribs:v,getAttrib:r,getPos:f,parseStyle:function(e){return F.parse(e)},serializeStyle:function(e,t){return F.serialize(e,t)},addStyle:function(e){var t,n;if($!==Za.DOM&&a===document){if(T[e])return;T[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){Y((e=e||"").split(","),function(e){B[e]=!0,L.load(e,te)})},addClass:function(e,t){c(e).addClass(t)},removeClass:function(e,t){w(e,t,!1)},hasClass:function(e,t){return c(e).hasClass(t)},toggleClass:w,show:function(e){c(e).show()},hide:function(e){c(e).hide()},isHidden:function(e){return"none"===c(e).css("display")},uniqueId:function(e){return(e||"mce_")+P++},setHTML:b,getOuterHTML:function(e){var t="string"==typeof e?s(e):e;return zn(t)?t.outerHTML:Xa("<div></div>").append(Xa(t).clone()).html()},setOuterHTML:function(e,t){c(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}x(Xa(this).html(t),!0)})},decode:Qo.decode,encode:j,insertAfter:function(e,t){var r=s(t);return h(e,function(e){var t=r.parentNode,n=r.nextSibling;return n?t.insertBefore(e,n):t.appendChild(e),e})},replace:S,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=C(e),Ya(o(t),function(e){i(n,e.nodeName,r(t,e.nodeName))}),S(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return F.toHex(Et.trim(e))},run:h,getAttribs:o,isEmpty:function(e,t){var n,r,o=0;if(E(e))return!1;if(e=e.firstChild){var i=new Rr(e,e.parentNode),a=M?M.getWhiteSpaceElements():{};t=t||(M?M.getNonEmptyElements():null);do{if(n=e.nodeType,zn(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"!==r)return!1;o++,e=i.next();continue}if(E(e))return!1}if(8===n)return!1;if(3===n&&!qr(e.nodeValue))return!1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&qr(e.nodeValue))return!1;e=i.next()}while(e)}return o<=1},createRng:k,nodeIndex:Ka,split:function(e,t,n){var r,o,i,a=k();if(e&&t)return a.setStart(e.parentNode,Ka(e)),a.setEnd(t.parentNode,Ka(t)),r=a.extractContents(),(a=k()).setStart(t.parentNode,Ka(t)+1),a.setEnd(e.parentNode,Ka(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(jo($,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(jo($,o),e),x(e),n||t},bind:V,unbind:q,fire:function(e,t,n){return U.fire(e,t,n)},getContentEditable:N,getContentEditableParent:function(e){for(var t=l(),n=null;e&&e!==t&&null===(n=N(e));e=e.parentNode);return n},destroy:function(){if(0<I.length)for(var e=I.length;e--;){var t=I[e];U.unbind(t[0],t[1],t[2])}ne(B,function(e,t){L.unload(t),delete B[t]}),sa.setDocument&&sa.setDocument()},isChildOf:function(e,t){if(Ja){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}return e===t||t.contains(e)},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},W=(_=F,R=J($),e={set:function(e,t,n){A.url_converter&&null!==t&&(t=A.url_converter.call(A.url_converter_scope||R(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},t={style:{set:function(e,t){null===t||"object"!=typeof t?(D&&e.attr("data-mce-style",t),null!==t&&"string"==typeof t?(e.removeAttr("style"),e.css(_.parse(t))):e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return _.serialize(_.parse(t),e[0].nodeName)}}},(D=(A=u).keep_values)&&(t.href=t.src=e),t);return $};Za.DOM=Za(document),Za.nodeIndex=Ka;var eu=Za.DOM,tu=Et.each,nu=Et.grep,ru=(ou.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e},ou.prototype.loadScript=function(e,t,n){function r(){o.remove(i),a&&(a.onerror=a.onload=a=null)}var o=eu,i=o.uniqueId(),a=document.createElement("script");a.id=i,a.type="text/javascript",a.src=Et._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(a,"referrerpolicy",this.settings.referrerPolicy),a.onload=function(){r(),t()},a.onerror=function(){r(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a)},ou.prototype.isDone=function(e){return 2===this.states[e]},ou.prototype.markDone=function(e){this.states[e]=2},ou.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}))},ou.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},ou.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]},ou.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n)},ou.prototype.loadScripts=function(n,e,t,r){function o(t,e){tu(i.scriptLoadedCallbacks[e],function(e){y(e[t])&&e[t].call(e.scope)}),i.scriptLoadedCallbacks[e]=void 0}var i=this,a=[];i.queueLoadedCallbacks.push({success:e,failure:r,scope:t||this});var u=function(){var e,t=nu(n);n.length=0,tu(t,function(e){2!==i.states[e]?3!==i.states[e]?1!==i.states[e]&&(i.states[e]=1,i.loading++,i.loadScript(e,function(){i.states[e]=2,i.loading--,o("success",e),u()},function(){i.states[e]=3,i.loading--,a.push(e),o("failure",e),u()})):o("failure",e):o("success",e)}),i.loading||(e=i.queueLoadedCallbacks.slice(0),i.queueLoadedCallbacks.length=0,tu(e,function(e){0===a.length?y(e.success)&&e.success.call(e.scope):y(e.failure)&&e.failure.call(e.scope,a)}))};u()},ou.ScriptLoader=new ou,ou);function ou(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e}function iu(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function au(){return ue(uu,su.get())}var uu={},su=iu("en"),cu={getData:function(){return re(uu,function(e){return _e({},e)})},setCode:function(e){e&&su.set(e)},getCode:function(){return su.get()},add:function(e,t){var n=uu[e];n||(uu[e]=n={}),ne(t,function(e,t){n[t.toLowerCase()]=e})},translate:function(e){function n(e){return y(e)?Object.prototype.toString.call(e):u(e)?"":""+e}function t(e){var t=n(e);return ue(a,t.toLowerCase()).map(n).getOr(t)}function r(e){return e.replace(/{context:\w+}$/,"")}var o,i,a=au().getOr({}),u=function(e){return""===e||null==e};if(u(e))return"";if(h(o=e)&&ke(o,"raw"))return n(e.raw);if(S(i=e)&&1<i.length){var s=e.slice(1);return r(t(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return ke(s,t)?n(s[t]):e}))}return r(t(e))},isRtl:function(){return au().bind(function(e){return ue(e,"_dir")}).exists(function(e){return"rtl"===e})},hasCode:function(e){return ke(uu,e)}},lu=function(){function u(t,n){Y(U(r,function(e){return e.name===t&&e.state===n}),function(e){return e.callback()})}function s(e){var t;return(f[e]?f[e].dependencies:t)||[]}function c(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}}function e(e,t,n){void 0===n&&(n="added"),ke(f,e)&&"added"===n||ke(l,e)&&"loaded"===n?t():r.push({name:e,state:n,callback:t})}var o=[],l={},f={},r=[],d=function(r,o,i,a,e){var t,n;l[r]||(0!==(t="string"==typeof o?o:o.prefix+o.resource+o.suffix).indexOf("/")&&-1===t.indexOf("://")&&(t=lu.baseURL+"/"+t),l[r]=t.substring(0,t.lastIndexOf("/")),n=function(){var n,e,t;u(r,"loaded"),n=o,e=i,t=a,Y(s(r),function(e){var t=c(n,e);d(t.resource,t,void 0,void 0)}),e&&(t?e.call(t):e.call(ru))},f[r]?n():ru.ScriptLoader.add(t,n,a,e))};return{items:o,urls:l,lookup:f,_listeners:r,get:function(e){if(f[e])return f[e].instance},dependencies:s,requireLangPack:function(t,n){!1!==lu.languageLoad&&e(t,function(){var e=cu.getCode();!e||n&&-1===(","+(n||"")+",").indexOf(","+e+",")||ru.ScriptLoader.add(l[t]+"/langs/"+e+".js")},"loaded")},add:function(e,t,n){var r=t;return o.push(r),f[e]={instance:r,dependencies:n},u(e,"added"),r},remove:function(e){delete l[e],delete f[e]},createUrl:c,addComponents:function(e,t){var n=l[e];Y(t,function(e){ru.ScriptLoader.add(n+"/"+e)})},load:d,waitFor:e}};function fu(){var e,t,n=(e=te,t=iu(ve.none()),{clear:function(){r(),t.set(ve.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){r(),t.set(ve.some(e))}});function r(){return t.get().each(e)}return _e(_e({},n),{on:function(e){return n.get().each(e)}})}function du(n,r){var o=null;return{cancel:function(){l(o)||(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];l(o)&&(o=setTimeout(function(){o=null,n.apply(null,e)},r))}}}function mu(n,r){function o(){l(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:o,throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o(),i=setTimeout(function(){i=null,n.apply(null,e)},r)}}}function gu(e,t){var n=vn(e,t);return void 0===n||""===n?[]:n.split(" ")}function pu(e){return void 0!==e.dom.classList}function hu(e,t){var n,r,o;pu(e)?e.dom.classList.add(t):(r=t,o=gu(n=e,"class").concat([r]),pn(n,"class",o.join(" ")))}function vu(e,t){return pu(e)&&e.dom.classList.contains(t)}function bu(e,t){return He(n=void 0===e?document:e.dom)?[]:A(n.querySelectorAll(t),kt.fromDom);var n}function yu(r,e){function t(e,t){return(n=e.dom)&&n.hasAttribute&&n.hasAttribute(t)?ve.some(vn(e,t)):ve.none();var n}var n=r.selection.getRng(),o=kt.fromDom(n.startContainer),i=kt.fromDom(r.getBody()),a=e.fold(function(){return"."+qu()},function(e){return"["+$u()+'="'+e+'"]'});return br(Mt(o,n.startOffset).getOr(o),a,function(e){return je(e,i)}).bind(function(e){return t(e,""+Wu()).bind(function(n){return t(e,""+$u()).map(function(e){var t=Ku(r,n);return{uid:n,name:e,elements:t}})})})}function Cu(t){function o(){return{listeners:[],previous:fu()}}function c(e,t){n(e,function(e){return t(e),e})}function n(e,t){var n=i.get(),r=t(ue(n,e).getOrThunk(o));n[e]=r,i.set(n)}var i=iu({}),e=mu(function(){var e=i.get();Y(W(we(e)),function(e){n(e,function(u){var s=u.previous.get();return yu(t,ve.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){Y(e.listeners,function(e){return e(!1,t)})}),u.previous.clear())},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;fn(s,o)||(n=o,r=a,c(t=i,function(e){Y(e.listeners,function(e){return e(!0,t,{uid:n,nodes:A(r,function(e){return e.dom})})})}),u.previous.set(o))}),{previous:u.previous,listeners:u.listeners}})})},30);return t.on("remove",function(){e.cancel()}),t.on("NodeChange",function(){e.throttle()}),{addListener:function(e,t){n(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}}function xu(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Xu+String(t)}function wu(e,t){var n,r,o=Rt(e).dom,i=kt.fromDom(o.createDocumentFragment());Kt(i,(n=t,(r=(o||document).createElement("div")).innerHTML=n,Dn(kt.fromDom(r)))),Xt(e),Pn(e,i)}function Su(e,t){return kt.fromDom(e.dom.cloneNode(t))}function Eu(e){return Su(e,!1)}function ku(e){return Su(e,!0)}function Nu(e,t,n){function r(e){for(var t;(t=o[e]())&&!jn(t)&&!n(t););return ve.from(t).filter(jn)}void 0===n&&(n=D);var o=new Rr(e,t);return{current:function(){return ve.from(o.current()).filter(jn)},next:function(){return r("next")},prev:function(){return r("prev")},prev2:function(){return r("prev2")}}}function _u(t,e){var i=e||function(e){return t.isBlock(e)||Wn(e)||Yn(e)},a=function(e,t,n,r){if(jn(e)){var o=r(e,t,e.data);if(-1!==o)return ve.some({container:e,offset:o})}return n().bind(function(e){return a(e.container,e.offset,n,r)})};return{backwards:function(e,t,n,r){var o=Nu(e,r,i);return a(e,t,function(){return o.prev().map(function(e){return{container:e,offset:e.length}})},n).getOrNull()},forwards:function(e,t,n,r){var o=Nu(e,r,i);return a(e,t,function(){return o.next().map(function(e){return{container:e,offset:0}})},n).getOrNull()}}}function Au(e){return e?{left:Yu(e.left),top:Yu(e.top),bottom:Yu(e.bottom),right:Yu(e.right),width:Yu(e.width),height:Yu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function Ru(e,t){return e=Au(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e}function Du(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2}function Tu(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Du(t.top-e.bottom,e,t)}function Ou(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Du(t.bottom-e.top,e,t)}function Bu(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}function Pu(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null}function Lu(e,t){if(zn(e)&&e.hasChildNodes()){var n=e.childNodes;return n[r=n.length-1,Math.min(Math.max(t,0),r)]}return e;var r}function Iu(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Gu.test(e)}function Mu(e){return"createRange"in e?e.createRange():Za.DOM.createRng()}function Fu(e){return e&&/[\r\n\t ]/.test(e)}function Uu(e){return e.setStart&&e.setEnd}function zu(e){var t=e.startContainer,n=e.startOffset;if(Fu(e.toString())&&ns(t.parentNode)&&jn(t)){var r=t.data;return Fu(r[n-1])||Fu(r[n+1])?1:void 0}}function Hu(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom}function ju(e,t){var n=Ru(e,t);return n.width=1,n.right=n.left+1,n}lu.languageLoad=!0,lu.baseURL="",lu.PluginManager=lu(),lu.ThemeManager=lu();var Vu=function(e,t){var n=[];return Y(Dn(e),function(e){n=(n=t(e)?n.concat([e]):n).concat(Vu(e,t))}),n},qu=J("mce-annotation"),$u=J("data-mce-annotation"),Wu=J("data-mce-annotation-uid"),Ku=function(e,t){return bu(kt.fromDom(e.getBody()),"["+Wu()+'="'+t+'"]')},Xu=0,Yu=Math.round,Gu=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]"),Ju=zn,Qu=jr,Zu=an("display","block table"),es=an("float","left right"),ts=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}}(Ju,Qu,s(es)),ns=s(an("white-space","pre pre-line pre-wrap")),rs=jn,os=Wn,is=Za.nodeIndex,as=function(e,t){if(!(t<0&&zn(e)&&e.hasChildNodes()))return Lu(e,t)},us=function(e){var t=e.getClientRects(),n=0<t.length?Au(t[0]):Au(e.getBoundingClientRect());return!Uu(e)&&os(e)&&Hu(n)?function(e){var t=e.ownerDocument,n=Mu(t),r=t.createTextNode(xo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=Au(n.getBoundingClientRect());return o.removeChild(r),i}(e):Hu(n)&&Uu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&jn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),us(i)}return null}(e):n},ss=function(t,n,e){function r(){return e=e||function(e){function r(e){var t;0!==e.height&&(0<o.length&&(t=o[o.length-1],e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right)||o.push(e))}function t(e,t){var n=Mu(e.ownerDocument);if(t<e.data.length){if(Iu(e.data[t]))return o;if(Iu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!zu(n)))return r(ju(us(n),!1)),o}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),zu(n)||r(ju(us(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),zu(n)||r(ju(us(n),!0)))}var o=[],n=e.container(),i=e.offset();if(rs(n))return t(n,i),o;if(Ju(n))if(e.isAtEnd()){var a=as(n,i);rs(a)&&t(a,a.data.length),ts(a)&&!os(a)&&r(ju(us(a),!1))}else{if(a=as(n,i),rs(a)&&t(a,0),ts(a)&&e.isAtEnd())return r(ju(us(a),!1)),o;var u=as(e.container(),e.offset()-1);ts(u)&&!os(u)&&(!Zu(u)&&!Zu(a)&&ts(a)||r(ju(us(u),!1))),ts(a)&&r(ju(us(a),!0))}return o}(ss(t,n))}return{container:J(t),offset:J(n),toRange:function(){var e=Mu(t.ownerDocument);return e.setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return rs(t),0===n},isAtEnd:function(){return rs(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return as(t,e?n-1:n)}}};function cs(e,t){jn(t)&&0===t.data.length&&e.remove(t)}function ls(e,t,n){var r,o,i,a,u,s,c;$n(n)?(i=e,a=t,s=ve.from((u=n).firstChild),c=ve.from(u.lastChild),a.insertNode(u),s.each(function(e){return cs(i,e.previousSibling)}),c.each(function(e){return cs(i,e.nextSibling)})):(r=e,t.insertNode(o=n),cs(r,o.previousSibling),cs(r,o.nextSibling))}function fs(t){return function(e){return t===e}}function ds(e){var t,r,n,o;return(cc(e)?"text()":e.nodeName.toLowerCase())+"["+(r=mc(dc(t=e)),n=ge(r,fs(t),t),o=me(r=r.slice(0,n+1),function(e,t,n){return cc(t)&&cc(r[n-1])&&e++,e},0),ge(r=fe(r,on([t.nodeName])),fs(t),t)-o)+"]"}function ms(e,t){var n,r,o,i=[],a=t.container(),u=t.offset();return cc(a)?n=function(e,t){for(;(e=e.previousSibling)&&cc(e);)t+=e.data.length;return t}(a,u):(u>=(r=a.childNodes).length?(n="after",u=r.length-1):n="before",a=r[u]),i.push(ds(a)),o=fe(function(e,t){var n=[];for(t=t.parentNode;t!==e;t=t.parentNode)n.push(t);return n}(e,a),s(sn)),(i=i.concat(le(o,ds))).reverse().join("/")+","+n}function gs(e,t){if(!t)return null;var n=t.split(","),r=n[0].split("/"),o=1<n.length?n[1]:"before",i=me(r,function(e,t){var n,r,o,i,a=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return a?("text()"===a[1]&&(a[1]="#text"),n=e,r=a[1],o=parseInt(a[2],10),i=fe(i=mc(n),function(e,t){return!cc(e)||!cc(i[t-1])}),(i=fe(i,on([r])))[o]):null},e);return i?cc(i)?function(e,t){for(var n,r=e,o=0;cc(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!cc(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return cc(e)&&t>e.data.length&&(t=e.data.length),ss(e,t)}(i,parseInt(o,10)):(o="after"===o?fc(i)+1:fc(i),ss(i.parentNode,o)):null}function ps(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(jn(a)?s.push(n?function(e,t,n){for(var r=e(t.data.slice(0,n)).length,o=t.previousSibling;o&&jn(o);o=o.previousSibling)r+=e(o.data).length;return r}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s}function hs(e,t,n){var r=0;return Et.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r}function vs(e,t){var n,r=t?"start":"end",o=e[r+"Container"],i=e[r+"Offset"];zn(o)&&"TR"===o.nodeName&&(o=(n=o.childNodes)[Math.min(t?i:i-1,n.length-1)])&&(i=t?0:o.childNodes.length,e["set"+(t?"Start":"End")](o,i))}function bs(e){return vs(e,!0),vs(e,!1),e}function ys(e,t){var n;return zn(e)&&(e=Lu(e,t),gc(e))?e:Ir(e)?(n=(e=jn(e)&&Pr(e)?e.parentNode:e).previousSibling,gc(n)?n:(n=e.nextSibling,gc(n)?n:void 0)):void 0}function Cs(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(gc(r)||"IMG"===o)return{name:o,index:hs(n.dom,o,r)};var a,u,s,c,l,f,d,m=ys((a=i).startContainer,a.startOffset)||ys(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:hs(n.dom,o,m)}:(f=(s=n).dom,(d={}).start=ps(f,u=e,c=t,l=i,!0),s.isCollapsed()||(d.end=ps(f,u,c,l,!1)),Hr(l)&&(d.isFakeCaret=!0),d)}function xs(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)}function ws(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:hs(n,u,a)};var s=bs(r.cloneRange());return i||(s.collapse(!1),ls(n,s,xs(n,o+"_end",t))),(r=bs(r)).collapse(!0),ls(n,r,xs(n,o+"_start",t)),e.moveToBookmark({id:o,keep:!0}),{id:o}}function Ss(e,t,n){var r=e.getParam(t,n);return-1===r.indexOf("=")?r:ue(e.getParam(t,"","hash"),e.id).getOr(n)}function Es(e){return e.getParam("content_security_policy","")}function ks(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t}function Ns(e){return e.getParam("forced_root_block_attrs",{})}function _s(e){return e.getParam("automatic_uploads",!0,"boolean")}function As(e){return e.getParam("icons","","string")}function Rs(e){return e.getParam("referrer_policy","","string")}function Ds(e){return e.getParam("language","en","string")}function Ts(e){return e.getParam("indent_use_margin",!1)}function Os(e){var t=e.getParam("font_css",[]);return S(t)?t:A(t.split(","),Je)}function Bs(e){var t=e.getParam("object_resizing");return!1!==t&&!xt.iOS&&(X(t)?t:"table,img,figure.image,div,video,iframe")}function Ps(e){return e.getParam("event_root")}function Ls(e){return e.getParam("theme")}function Is(e){return!1!==e.getParam("inline_boundaries")}function Ms(e){return e.getParam("plugins","","string")}function Fs(e){var t=e.parentNode;t&&t.removeChild(e)}function Us(e){var t=Eo(e);return{count:e.length-t.length,text:t}}function zs(e){for(var t;-1!==(t=e.data.lastIndexOf(wo));)e.deleteData(t,1)}function Hs(e,t){return yc(e),t}function js(e,t){var n,r=t.container(),o=(-1===(n=_(xe(r.childNodes),e))?ve.none():ve.some(n)).map(function(e){return e<t.offset()?ss(r,t.offset()-1):t}).getOr(t);return yc(e),o}function Vs(e,t){return ss.isTextPosition(t)?(r=t,bc(n=e)&&r.container()===n?(a=Us((o=n).data.substr(0,(i=r).offset())),u=Us(o.data.substr(i.offset())),0<(a.text+u.text).length?(zs(o),ss(o,i.offset()-a.count)):i):Hs(n,r)):(s=e,((c=t).container()===s.parentNode?js:Hs)(s,c));var n,r,o,i,a,u,s,c}function qs(e,t,n){var r,o,i,a=Ru(t.getBoundingClientRect(),n),u="BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,e.scrollTop||r.scrollTop):(i=e.getBoundingClientRect(),o=e.scrollLeft-i.left,e.scrollTop-i.top);a.left+=o,a.right+=o,a.top+=u,a.bottom+=u,a.width=1;var s=t.offsetWidth-t.clientWidth;return 0<s&&(n&&(s*=-1),a.left+=s,a.right+=s),a}function $s(e,i,a,u){function s(){!function(){for(var e=bu(kt.fromDom(i),"*[contentEditable=false],video,audio,embed,object"),t=0;t<e.length;t++){var n,r=e[t].dom,o=r.previousSibling;Ao(o)&&(1===(n=o.data).length?o.parentNode.removeChild(o):o.deleteData(n.length-1,1)),o=r.nextSibling,_o(o)&&(1===(n=o.data).length?o.parentNode.removeChild(o):o.deleteData(0,1))}}(),l&&(yc(l),l=null),f.on(function(e){Xa(e.caret).remove(),f.clear()}),c&&(_r.clearInterval(c),c=void 0)}var c,l,f=fu(),t=ks(e),d=0<t.length?t:"p";return{show:function(e,t){var n;if(s(),Sc(t))return null;if(!a(t))return l=function(e,t){var n=e.ownerDocument.createTextNode(wo),r=e.parentNode;if(t){if(o=e.previousSibling,No(o)){if(Ir(o))return o;if(Ao(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e)}else{var o=e.nextSibling;if(No(o)){if(Ir(o))return o;if(_o(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n)}return n}(t,e),n=t.ownerDocument.createRange(),Ec(l.nextSibling)?(n.setStart(l,0),n.setEnd(l,0)):(n.setStart(l,1),n.setEnd(l,1)),n;l=function(e,t,n){var r,o=t.ownerDocument.createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o}(d,t,e);var r=qs(i,t,e);Xa(l).css("top",r.top);var o=Xa('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(_e({},r)).appendTo(i)[0];return f.set({caret:o,element:t,before:e}),e&&Xa(o).addClass("mce-visual-caret-before"),c=_r.setInterval(function(){u()?Xa("div.mce-visual-caret",i).toggleClass("mce-visual-caret-hidden"):Xa("div.mce-visual-caret",i).addClass("mce-visual-caret-hidden")},500),(n=t.ownerDocument.createRange()).setStart(l,0),n.setEnd(l,0),n},hide:s,getCss:function(){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;}"},reposition:function(){f.on(function(e){var t=qs(i,e.element,e.before);Xa(e.caret).css(_e({},t))})},destroy:function(){return _r.clearInterval(c)}}}function Ws(){return Cc.isIE()||Cc.isEdge()||Cc.isFirefox()}function Ks(e){return Ec(e)||cn(e)&&Ws()}function Xs(e,t){for(var n;n=e(t);)if(!Rc(n))return n;return null}function Ys(e,t,n,r,o){var i=new Rr(e,r),a=kc(e)||Rc(e);if(t<0){if(a&&n(e=Xs(i.prev.bind(i),!0)))return e;for(;e=Xs(i.prev.bind(i),o);)if(n(e))return e}if(0<t){if(a&&n(e=Xs(i.next.bind(i),!0)))return e;for(;e=Xs(i.next.bind(i),o);)if(n(e))return e}return null}function Gs(e,t){for(;e&&e!==t;){if(_c(e))return e;e=e.parentNode}return null}function Js(e,t,n){return Gs(e.container(),n)===Gs(t.container(),n)}function Qs(e,t){if(!t)return null;var n=t.container(),r=t.offset();return Dc(n)?n.childNodes[r+e]:null}function Zs(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function ec(e,t,n){for(var r,o,i=e?"previousSibling":"nextSibling";n&&n!==t;){var a=n[i];if(Ac(a)&&(a=a[i]),kc(a)||Nc(a)){if(o=n,Gs(a,r=t)===Gs(o,r))return a;break}if(Tc(a))break;n=n.parentNode}return null}function tc(e,t,n){var r,o=R(ec,!0,t),i=R(ec,!1,t),a=n.startContainer,u=n.startOffset;if(Pr(a)){var s=(a=Dc(a)?a:a.parentNode).getAttribute("data-mce-caret");if("before"===s&&Ks(r=a.nextSibling))return Oc(r);if("after"===s&&Ks(r=a.previousSibling))return Bc(r)}if(!n.collapsed)return n;if(jn(a)){if(Ac(a)){if(1===e){if(r=i(a))return Oc(r);if(r=o(a))return Bc(r)}if(-1===e){if(r=o(a))return Bc(r);if(r=i(a))return Oc(r)}return n}if(Ao(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?Oc(r):n;if(_o(a)&&u<=1)return-1===e&&(r=o(a))?Bc(r):n;if(u===a.data.length)return(r=i(a))?Oc(r):n;if(0===u)return(r=o(a))?Bc(r):n}return n}function nc(e,t){return ve.from(Qs(e?0:-1,t)).filter(kc)}function rc(e,t,n){var r=tc(e,t,n);return-1===e?ss.fromRangeStart(r):ss.fromRangeEnd(r)}function oc(e){return ve.from(e.getNode()).map(kt.fromDom)}function ic(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function ac(e,t){var n=Js(e,t);return!(n||!Wn(e.getNode()))||n}ss.fromRangeStart=function(e){return ss(e.startContainer,e.startOffset)},ss.fromRangeEnd=function(e){return ss(e.endContainer,e.endOffset)},ss.after=function(e){return ss(e.parentNode,is(e)+1)},ss.before=function(e){return ss(e.parentNode,is(e))},ss.isAbove=function(e,t){return dn(Q(t.getClientRects()),Z(e.getClientRects()),Tu).getOr(!1)},ss.isBelow=function(e,t){return dn(Z(t.getClientRects()),Q(e.getClientRects()),Ou).getOr(!1)},ss.isAtStart=function(e){return!!e&&e.isAtStart()},ss.isAtEnd=function(e){return!!e&&e.isAtEnd()},ss.isTextPosition=function(e){return!!e&&jn(e.container())},ss.isElementPosition=function(e){return!1===ss.isTextPosition(e)};var uc,sc,cc=jn,lc=sn,fc=Za.nodeIndex,dc=function(e){var t=e.parentNode;return lc(t)?dc(t):t},mc=function(e){return e?me(e.childNodes,function(e,t){return lc(t)&&"BR"!==t.nodeName?e=e.concat(mc(t)):e.push(t),e},[]):[]},gc=Yn,pc=R(Cs,u,!0),hc=Za.DOM,vc=zn,bc=jn,yc=function(e){vc(e)&&Ir(e)&&(Mr(e)?e.removeAttribute("data-mce-caret"):Fs(e)),bc(e)&&(zs(e),0===e.data.length&&Fs(e))},Cc=dt().browser,xc=Yn,wc=Jn,Sc=Gn,Ec=function(e){return xc(e)||wc(e)},kc=Yn,Nc=Jn,_c=an("display","block table table-cell table-caption list-item"),Ac=Ir,Rc=Pr,Dc=zn,Tc=jr,Oc=R(Zs,!0),Bc=R(Zs,!1);function Pc(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function Lc(e,t){if(0<e){if(Yl(t.previousSibling)&&!Wl(t.previousSibling))return ss.before(t);if(Wl(t))return ss(t,0)}if(e<0){if(Yl(t.nextSibling)&&!Wl(t.nextSibling))return ss.after(t);if(Wl(t))return ss(t,t.data.length)}return e<0&&!Xl(t)?ss.after(t):ss.before(t)}function Ic(t){return{next:function(e){return Jl(uc.Forwards,e,t)},prev:function(e){return Jl(uc.Backwards,e,t)}}}function Mc(e){return ss.isTextPosition(e)?0===e.offset():jr(e.getNode())}function Fc(e){if(ss.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return jr(e.getNode(!0))}function Uc(e,t){return!ss.isTextPosition(e)&&!ss.isTextPosition(t)&&e.getNode()===t.getNode(!0)}function zc(o,i,a){return Ql(o,i,a).bind(function(e){return Js(a,e,i)&&(t=a,n=e,o?!Uc(t,n)&&(ss.isTextPosition(r=t)||!Wn(r.getNode()))&&Fc(t)&&Mc(n):!Uc(n,t)&&Mc(t)&&Fc(n))?Ql(o,i,e):ve.some(e);var t,n,r})}function Hc(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return jn(u)?ve.some(ss(u,e?0:u.data.length)):u?jr(u)?ve.some(e?ss.before(u):Wn(a=u)?ss.before(a):ss.after(a)):(r=t,o=u,i=(n=e)?ss.before(o):ss.after(o),Ql(n,r,i)):ve.none()}function jc(e){return zn(e)&&e.id===of}function Vc(e,t){for(;t&&t!==e;){if(t.id===of)return t;t=t.parentNode}return null}function qc(e){return Et.isArray(e.start)}function $c(e,t){return zn(t)&&e.isBlock(t)&&!t.innerHTML&&!xt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t}function Wc(e,t,n){return!1===t.hasChildNodes()&&Vc(e,t)&&(o=n,i=(r=t).ownerDocument.createTextNode(wo),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),1);var r,o,i}function Kc(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,Wc(c,i,r))return 1;if(s[o]>u.length-1)return Wc(c,i,r)||function(t){return rf(i).fold(D,function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})}(r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return 1}function Xc(e){return jn(e)&&0<e.data.length}function Yc(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,o="start"===t?l?c.hasChildNodes()?(r=c.firstChild,1):Xc(c.nextSibling)?(r=c.nextSibling,0):Xc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)+1):e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,1):Xc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)):e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Et.each(Et.grep(c.childNodes),function(e){jn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&jn(a)&&!xt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return ve.some(ss(u,s))}return ve.none()}function Gc(t,e){!function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g=e.dom;if(t){if(qc(t))return d=t,m=(f=g).createRng(),Kc(f,!0,d,m)&&Kc(f,!1,d,m)?ve.some(m):ve.none();if(X(t.start))return ve.some((s=t,c=(u=g).createRng(),l=gs(u.getRoot(),s.start),c.setStart(l.container(),l.offset()),l=gs(u.getRoot(),s.end),c.setEnd(l.container(),l.offset()),c));if(ke(t,"id"))return dn(a=Yc(o=g,"start",i=t),Yc(o,"end",i).or(a),function(e,t){var n=o.createRng();return n.setStart($c(o,e.container()),e.offset()),n.setEnd($c(o,t.container()),t.offset()),n});if(ke(t,"name"))return n=g,ve.from(n.select((r=t).name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(ke(t,"rng"))return ve.some(t.rng)}return ve.none()}(t,e).each(function(e){t.setRng(e)})}function Jc(e){return zn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")}function Qc(e){return""!==e&&-1!==" \f\n\r\t\v".indexOf(e)}function Zc(e){return!Qc(e)&&!uf(e)}function el(e){return e.nodeType}function tl(e,t,n){var r,o=n.startOffset,i=n.startContainer;if((i!==n.endContainer||!(r=i.childNodes[o])||!/^(IMG)$/.test(r.nodeName))&&zn(i)){var a=i.childNodes,u=void 0;o<a.length?(i=a[o],u=new Rr(i,e.getParent(i,e.isBlock))):(i=a[a.length-1],(u=new Rr(i,e.getParent(i,e.isBlock))).next(!0));for(var s=u.current();s;s=u.next())if(jn(s)&&!sf(s))return n.setStart(s,0),t.setRng(n),0}}function nl(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(zn(e)||!sf(e))return e}}function rl(e,t){return el(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]}function ol(e,t,n){return e.schema.isValidChild(t,n)}function il(e,n){return y(e)?e=e(n):V(n)&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e}function al(e,t){return e=""+((e=e||"").nodeName||e),t=""+((t=t||"").nodeName||t),e.toLowerCase()===t.toLowerCase()}function ul(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),""+("fontFamily"===n?t.replace(/[\'\"]/g,"").replace(/,\s+/g,","):t)}function sl(e,t,n){return ul(e,e.getStyle(t,n),n)}function cl(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n}function ll(e,t,n){return e.getParents(t,n,e.getRoot())}function fl(e,t){return F(e.formatter.get(t),function(t){function o(e){return 1<e.length&&"%"===e.charAt(0)}return F(["styles","attributes"],function(e){return ue(t,e).exists(function(e){var n,r;return F(S(e)?e:(n=u,r=[],ne(e,function(e,t){r.push(n(e,t))}),r),o)})})})}function dl(e){return se(e,"block")}function ml(e){return se(e,"selector")}function gl(e){return se(e,"inline")}function pl(e){return ml(e)&&!1!==e.expand&&!gl(e)}function hl(e,t){for(var n=t;n;){if(zn(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t}function vl(e,t,n,r){for(var o=t.data,i=n;e?0<=i:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return-1}function bl(e,t,n){return vl(e,t,n,function(e){return uf(e)||Qc(e)})}function yl(e,t,n){return vl(e,t,n,Zc)}function Cl(i,e,t,n,a,r){function o(e,t,n){var r=_u(i),o=a?r.backwards:r.forwards;return ve.from(o(e,t,function(e,t){return cf(e.parentNode)?-1:n(a,u=e,t)},s))}var u,s=i.getParent(t,i.isBlock)||e;return o(t,n,bl).bind(function(e){return r?o(e.container,e.offset+(a?-1:0),yl):ve.some(e)}).orThunk(function(){return u?ve.some({container:u,offset:a?0:u.length}):ve.none()})}function xl(e,t,n,r,o){jn(r)&&Pe(r.data)&&r[o]&&(r=r[o]);for(var i=lf(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var s=t[u];if((!V(s.collapsed)||s.collapsed===n.collapsed)&&ml(s)&&e.is(i[a],s.selector))return i[a]}return r}function wl(t,e,n,r){var o,i=n,a=t.dom,u=a.getRoot(),s=e[0];if((i=dl(s)?s.wrapper?null:a.getParent(n,s.block,u):i)||(o=a.getParent(n,"LI,TD,TH"),i=a.getParent(jn(n)?n.parentNode:n,function(e){return e!==u&&df(t,e)},o)),!(i=i&&dl(s)&&s.wrapper&&lf(a,i,"ul,ol").reverse()[0]||i))for(i=n;i[r]&&!a.isBlock(i[r])&&!al(i=i[r],"br"););return i||n}function Sl(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",s=e.getRoot();if(jn(n)&&!ff(n)&&(o?0<r:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var c=a[u];c;c=c[u]){var l=jn(c)&&!mf(e,s,c,u);if(!cf(c)&&(!Wn(i=c)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!ff(c,l))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n}function El(e){return cf(e.parentNode)||cf(e)}function kl(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,s=e.dom,c=n[0];return zn(o)&&o.hasChildNodes()&&(o=Lu(o,i),jn(o)&&(i=0)),zn(a)&&a.hasChildNodes()&&(a=Lu(a,t.collapsed?u:u-1),jn(a)&&(u=a.nodeValue.length)),o=hl(s,o),a=hl(s,a),El(o)&&(o=cf(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,jn(o)&&(i=t.collapsed?o.length:0)),El(a)&&(a=cf(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,jn(a)&&(u=t.collapsed?0:a.length)),t.collapsed&&(Cl(s,e.getBody(),o,i,!0,r).each(function(e){var t=e.container,n=e.offset;o=t,i=n}),Cl(s,e.getBody(),a,u,!1,r).each(function(e){var t=e.container,n=e.offset;a=t,u=n})),(gl(c)||c.block_expand)&&(gl(c)&&jn(o)&&0!==i||(o=Sl(s,n,o,i,!0)),gl(c)&&jn(a)&&u!==a.nodeValue.length||(a=Sl(s,n,a,u,!1))),pl(c)&&(o=xl(s,n,t,o,"previousSibling"),a=xl(s,n,t,a,"nextSibling")),(dl(c)||ml(c))&&(o=wl(e,n,o,"previousSibling"),a=wl(e,n,a,"nextSibling"),dl(c)&&(s.isBlock(o)||(o=Sl(s,n,o,i,!0)),s.isBlock(a)||(a=Sl(s,n,a,u,!1)))),zn(o)&&(i=s.nodeIndex(o),o=o.parentNode),zn(a)&&(u=s.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}}function Nl(n,e,u){function s(e){var t=e[0];jn(t)&&t===i&&o>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===a&&0<e.length&&n===l&&jn(n)&&e.splice(e.length-1,1),e}function c(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r}function t(e,t){return n.getParent(e,function(e){return e.parentNode===t},t)}function r(e,t,n){var r=n?"nextSibling":"previousSibling",o=e;for(o.parentNode;o&&o!==t;o=i){var i=o.parentNode,a=c(o===e?o:o[r],r);a.length&&(n||a.reverse(),u(s(a)))}}var o=e.startOffset,i=Lu(e.startContainer,o),a=e.endOffset,l=Lu(e.endContainer,a-1);if(i===l)return u(s([i]));var f=n.findCommonAncestor(i,l);if(n.isChildOf(i,l))return r(i,f,!0);if(n.isChildOf(l,i))return r(l,f);var d=t(i,f)||i,m=t(l,f)||l;r(i,d,!0);var g=c(d===i?d:d.nextSibling,"nextSibling",m===l?m.nextSibling:m);g.length&&u(s(g)),r(l,m)}function _l(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t}function Al(e,t){var n=bu(t,"td[data-mce-selected],th[data-mce-selected]");return 0<n.length?n:U(H(e,function(e){var t=Pu(e);return t?[kt.fromDom(t)]:[]}),bo)}function Rl(e){return Al(_l(e.selection.getSel()),kt.fromDom(e.getBody()))}function Dl(e,t){return hr(e,"table",t)}function Tl(o,e){return dn((r=e.startContainer,i=e.startOffset,jn(r)?0===i?ve.some(kt.fromDom(r)):ve.none():ve.from(r.childNodes[i]).map(kt.fromDom)),(t=e.endContainer,n=e.endOffset,jn(t)?n===t.data.length?ve.some(kt.fromDom(t)):ve.none():ve.from(t.childNodes[n-1]).map(kt.fromDom)),function(e,t){var n=M(gf(o),R(je,e)),r=M(pf(o),R(je,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i}function Ol(e,t,n,r){var o=n,i=new Rr(n,o),a=ae(e.schema.getMoveCaretBeforeOnEnterElements(),function(e,t){return!T(["td","th","table"],t.toLowerCase())});do{if(jn(n)&&0!==Et.trim(n.nodeValue).length)return r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length),0;if(a[n.nodeName])return r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n),0}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))}function Bl(e){var t=e.selection.getSel();return t&&0<t.rangeCount}function Pl(r,o){var e=Rl(r);0<e.length?Y(e,function(e){var t=e.dom,n=r.dom.createRng();n.setStartBefore(t),n.setEndAfter(t),o(n,!0)}):o(r.selection.getRng(),!1)}function Ll(e,t,n){var r=ws(e,t);n(r),e.moveToBookmark(r)}function Il(e){return hf.get(e)}function Ml(e,t,n,r){var o=t.uid,i=void 0===o?xu("mce-annotation"):o,a=function(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}(t,["uid"]),u=kt.fromTag("span",e);hu(u,qu()),pn(u,""+Wu(),i),pn(u,""+$u(),n);var s,c=r(i,a),l=c.attributes,f=c.classes,d=void 0===f?[]:f;return hn(u,void 0===l?{}:l),s=u,Y(d,function(e){hu(s,e)}),u}function Fl(u,e,t,n,r){function s(){d.clear()}function c(e){Y(e,o)}var l=[],f=Ml(u.getDoc(),r,t,n),d=fu(),o=function(e){var t,n,r,o,i,a;switch(r=u,i="span",a=Nt(o=e),Ot(o).fold(function(){return"skipping"},function(e){return"br"===a||_n(n=o)&&Il(n)===wo?"valid":Nn(t=o)&&vu(t,qu())?"existing":jc(o.dom)?"caret":ol(r,i,a)&&ol(r,Nt(e),i)?"valid":"invalid-child";var t,n})){case"invalid-child":s(),c(Dn(e)),s();break;case"valid":qt(t=e,n=d.get().getOrThunk(function(){var e=Eu(f);return l.push(e),d.set(e),e})),Pn(n,t)}};return Nl(u.dom,e,function(e){s(),c(A(e,kt.fromDom))}),l}function Ul(o){var n,e,r,i=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return ue(n,e).map(function(e){return e.settings})}});r=i,(e=o).on("init",function(){e.serializer.addNodeFilter("span",function(e){Y(e,function(t){ve.from(t.attr($u())).bind(r.lookup).each(function(e){!1===e.persistent&&t.unwrap()})})})});var a=Cu(o);return{register:function(e,t){i.register(e,t)},annotate:function(t,n){i.lookup(t).each(function(e){var u,s,c,l;s=t,c=e,l=n,(u=o).undoManager.transact(function(){var e,t,n,r,o=u.selection,i=o.getRng(),a=0<Rl(u).length;i.collapsed&&!a&&(n=kl(e=u,t=i,[{inline:"span"}]),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)),o.getRng().collapsed&&!a?(wu(r=Ml(u.getDoc(),l,s,c.decorate),xo),o.getRng().insertNode(r.dom),o.select(r.dom)):Ll(o,!1,function(){Pl(u,function(e){Fl(u,e,s,c.decorate,l)})})})})},annotationChanged:function(e,t){a.addListener(e,t)},remove:function(e){yu(o,ve.some(e)).each(function(e){Y(e.elements,Yt)})},getAll:function(e){var t,n,r;return re((t=e,n=bu(kt.fromDom(o.getBody()),"["+$u()+'="'+t+'"]'),r={},Y(n,function(e){var t=vn(e,Wu()),n=ue(r,t).getOr([]);r[t]=n.concat([e])}),r),function(e){return A(e,function(e){return e.dom})})}}}function zl(e){return{getBookmark:R(af,e),moveToBookmark:R(Gc,e)}}(sc=uc=uc||{})[sc.Backwards=-1]="Backwards",sc[sc.Forwards=1]="Forwards";function Hl(e){return Po(e)||!!Mo(t=e)&&!0!==L(xe(t.getElementsByTagName("*")),function(e,t){return e||Ro(t)},!1);var t}var jl,Vl,ql,$l=Yn,Wl=jn,Kl=zn,Xl=Wn,Yl=jr,Gl=Vr,Jl=function(e,t,n){var r,o,i;if(!Kl(n)||!t)return null;if(t.isEqual(ss.after(n))&&n.lastChild){if(i=ss.after(n.lastChild),e<0&&Yl(n.lastChild)&&Kl(n.lastChild))return Xl(n.lastChild)?ss.before(n.lastChild):i}else i=t;var a,u,s,c=i.container(),l=i.offset();if(Wl(c)){if(e<0&&0<l)return ss(c,--l);if(0<e&&l<c.length)return ss(c,++l);r=c}else{if(e<0&&0<l&&(f=Pc(c,l-1),Yl(f)))return!Hl(f)&&(o=Ys(f,e,Gl,f))?Wl(o)?ss(o,o.data.length):ss.after(o):Wl(f)?ss(f,f.data.length):ss.before(f);if(0<e&&l<c.childNodes.length&&(f=Pc(c,l),Yl(f)))return Xl(f)?(a=n,(s=(u=f).nextSibling)&&Yl(s)?Wl(s)?ss(s,0):ss.before(s):Jl(uc.Forwards,ss.after(u),a)):!Hl(f)&&(o=Ys(f,e,Gl,f))?Wl(o)?ss(o,0):ss.before(o):Wl(f)?ss(f,0):ss.after(f);r=f||i.getNode()}if((0<e&&i.isAtEnd()||e<0&&i.isAtStart())&&(r=Ys(r,e,w,n,!0),Gl(r,n)))return Lc(e,r);var f=Ys(r,e,Gl,n),d=pe(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(c,n),$l));return!d||f&&d.contains(f)?f?Lc(e,f):null:0<e?ss.after(d):ss.before(d)},Ql=function(e,t,n){var r=Ic(t);return ve.from(e?r.next(n):r.prev(n))},Zl=function(t,n,e,r){return zc(t,n,e).bind(function(e){return r(e)?Zl(t,n,e,r):ve.some(e)})},ef=R(Ql,!0),tf=R(Ql,!1),nf=R(Hc,!0),rf=R(Hc,!1),of="_mce_caret",af=function(e,t,n){return 2===t?Cs(Eo,n,e):3===t?(o=(r=e).getRng(),{start:ms(r.dom.getRoot(),ss.fromRangeStart(o)),end:ms(r.dom.getRoot(),ss.fromRangeEnd(o))}):t?{rng:e.getRng()}:ws(e,!1);var r,o},uf=(jl=xo,function(e){return jl===e}),sf=function(e,t){return void 0===t&&(t=!1),!(!V(e)||!jn(e))&&qr(t?e.data.replace(/ /g,"\xa0"):e.data)},cf=Jc,lf=ll,ff=sf,df=rl,mf=function(e,t,n,r){var o=n.parentNode;return!V(n[r])&&(!(o!==t&&!K(o)&&!e.isBlock(o))||mf(e,t,o,r))},gf=function(t){return Ft(t).fold(J([t]),function(e){return[t].concat(gf(e))})},pf=function(t){return Ut(t).fold(J([t]),function(e){return"br"===Nt(e)?Bt(e).map(function(e){return[t].concat(pf(e))}).getOr([]):[t].concat(pf(e))})},hf=(Vl=_n,{get:function(e){if(!Vl(e))throw new Error("Can only get text value of a text node");return ql(e).getOr("")},getOption:ql=function(e){return Vl(e)?ve.from(e.dom.nodeValue):ve.none()},set:function(e,t){if(!Vl(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=t}});function vf(e,t){for(;t&&t!==e;){if(Xn(t)||Yn(t))return t;t=t.parentNode}return null}function bf(t,n,e){if(!e.collapsed){if(xt.browser.isIE()&&e.startOffset===e.endOffset-1&&e.startContainer===e.endContainer){var r=e.startContainer.childNodes[e.startOffset];if(zn(r))return F(r.getClientRects(),function(e){return Bu(e,t,n)})}return F(e.getClientRects(),function(e){return Bu(e,t,n)})}}function yf(e,t,n){return e.fire(t,n)}function Cf(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})}function xf(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})}function wf(r,l){function c(e){return e&&("IMG"===e.nodeName||l.dom.is(e,"figure.image"))}function f(e){return Jn(e)||T.hasClass(e,"mce-preview-object")}function n(e){var t=e.target;!function(e,t){if("longpress"!==e.type&&0!==e.type.indexOf("touch"))return c(e.target)&&!bf(e.clientX,e.clientY,t);var n=e.touches[0];return c(e.target)&&!bf(n.clientX,n.clientY,t)}(e,l.selection.getRng())||e.isDefaultPrevented()||l.selection.select(t)}function d(e){return T.is(e,"figure.image")?[e.querySelector("img")]:T.hasClass(e,"mce-preview-object")&&V(e.firstElementChild)?[e,e.firstElementChild]:[e]}function i(e){var t=Bs(l);return!!t&&"false"!==e.getAttribute("data-mce-resize")&&e!==l.getBody()&&(T.hasClass(e,"mce-preview-object")?ze(kt.fromDom(e.firstElementChild),t):ze(kt.fromDom(e),t))}function a(e,t,n){V(n)&&Y(d(e),function(e){e.style[t]||!l.schema.isValid(e.nodeName.toLowerCase(),t)?T.setStyle(e,t,n):T.setAttrib(e,t,""+n)})}function m(e,t,n){a(e,"width",t),a(e,"height",n)}function g(e){var t,n,r,o,i,a,u=e.screenX-C,s=e.screenY-x;N=u*b[2]+w,_=s*b[3]+S,N=N<5?5:N,_=_<5?5:_,((c(p)||f(p))&&!1!==l.getParam("resize_img_proportional",!0,"boolean")?!Lf.modifierPressed(e):Lf.modifierPressed(e))&&(L(u)>L(s)?(_=I(N*E),N=I(_/E)):(N=I(_/E),_=I(N*E))),m(h,N,_),t=b.startPos.x+u,n=b.startPos.y+s,T.setStyles(v,{left:t=0<t?t:0,top:n=0<n?n:0,display:"block"}),v.innerHTML=N+" &times; "+_,b[2]<0&&h.clientWidth<=N&&T.setStyle(h,"left",void 0+(w-N)),b[3]<0&&h.clientHeight<=_&&T.setStyle(h,"top",void 0+(S-_)),(u=M.scrollWidth-A)+(s=M.scrollHeight-R)!=0&&T.setStyles(v,{left:t-u,top:n-s}),k||(r=p,o=w,i=S,a="corner-"+b.name,l.fire("ObjectResizeStart",{target:r,width:o,height:i,origin:a}),k=!0)}function o(e){function t(e,t){if(e)do{if(e===t)return 1}while(e=e.parentNode)}var n;k||l.removed||(O(T.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute(D)}),n="mousedown"===e.type?e.target:r.getNode(),t(n=T.$(n).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],M)&&(s(),t(r.getStart(!0),n)&&t(r.getEnd(!0),n))?z(n):H())}function u(e){return If(vf(l.getBody(),e))}function s(){try{l.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}}var p,h,v,b,y,C,x,w,S,E,k,N,_,A,R,D="data-mce-selected",T=l.dom,O=Et.each,B=l.getDoc(),P=document,L=Math.abs,I=Math.round,M=l.getBody(),F={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},U=function(){var e,t,n,r,o=k;k=!1,o&&(a(p,"width",N),a(p,"height",_)),T.unbind(B,"mousemove",g),T.unbind(B,"mouseup",U),P!==B&&(T.unbind(P,"mousemove",g),T.unbind(P,"mouseup",U)),T.remove(h),T.remove(v),T.remove(y),z(p),o&&(e=p,t=N,n=_,r="corner-"+b.name,l.fire("ObjectResized",{target:e,width:t,height:n,origin:r}),T.setAttrib(p,"style",T.getAttrib(p,"style"))),l.nodeChanged()},z=function(e){j();var t=T.getPos(e,M),a=t.x,u=t.y,n=e.getBoundingClientRect(),s=n.width||n.right-n.left,c=n.height||n.bottom-n.top;p!==e&&(H(),p=e,N=_=0);var r=l.fire("ObjectSelected",{target:e}),o=T.getAttrib(p,D,"1");i(e)&&!r.isDefaultPrevented()?O(F,function(o,i){var e=T.get("mceResizeHandle"+i);e&&T.remove(e),e=T.add(M,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),11===xt.ie&&(e.contentEditable=!1),T.bind(e,"mousedown",function(e){var t,n,r;e.stopImmediatePropagation(),e.preventDefault(),t=e,r=d(p)[0],C=t.screenX,x=t.screenY,w=r.clientWidth,S=r.clientHeight,E=S/w,(b=o).name=i,b.startPos={x:s*o[0]+a,y:c*o[1]+u},A=M.scrollWidth,R=M.scrollHeight,y=T.add(M,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),T.setStyles(y,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),h=f(n=p)?T.create("img",{src:xt.transparentSrc}):n.cloneNode(!0),T.addClass(h,"mce-clonedresizable"),T.setAttrib(h,"data-mce-bogus","all"),h.contentEditable="false",T.setStyles(h,{left:a,top:u,margin:0}),m(h,s,c),h.removeAttribute(D),M.appendChild(h),T.bind(B,"mousemove",g),T.bind(B,"mouseup",U),P!==B&&(T.bind(P,"mousemove",g),T.bind(P,"mouseup",U)),v=T.add(M,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},w+" &times; "+S)}),o.elm=e,T.setStyles(e,{left:s*o[0]+a-e.offsetWidth/2,top:c*o[1]+u-e.offsetHeight/2})}):H(),T.getAttrib(p,D)||p.setAttribute(D,o)},H=function(){j(),p&&p.removeAttribute(D),ne(F,function(e,t){var n=T.get("mceResizeHandle"+t);n&&(T.unbind(n),T.remove(n))})},j=function(){ne(F,function(e){e.elm&&(T.unbind(e.elm),delete e.elm)})};return l.on("init",function(){var e;s(),(xt.browser.isIE()||xt.browser.isEdge())&&(l.on("mousedown click",function(e){var t=e.target,n=t.nodeName;k||!/^(TABLE|IMG|HR)$/.test(n)||u(t)||(2!==e.button&&l.selection.select(t,"TABLE"===n),"mousedown"===e.type&&l.nodeChanged())}),T.bind(M,"mscontrolselect",e=function(e){function t(e){_r.setEditorTimeout(l,function(){return l.selection.select(e)})}if(u(e.target)||Jn(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}),l.on("remove",function(){return T.unbind(M,"mscontrolselect",e)}));var t=_r.throttle(function(e){l.composing||o(e)});l.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",t),l.on("keyup compositionend",function(e){p&&"TABLE"===p.nodeName&&t(e)}),l.on("hide blur",H),l.on("contextmenu longpress",n,!0)}),l.on("remove",j),{isResizable:i,showResizeRect:z,hideResizeRect:H,updateResizeRect:o,destroy:function(){p=h=y=null}}}function Sf(e){return Xn(e)||Yn(e)}function Ef(t,n,r){var o,e,i,a,u,s=r;if(s.caretPositionFromPoint)(e=s.caretPositionFromPoint(t,n))&&((o=r.createRange()).setStart(e.offsetNode,e.offset),o.collapse(!0));else if(s.caretRangeFromPoint)o=s.caretRangeFromPoint(t,n);else if(s.body.createTextRange){o=s.body.createTextRange();try{o.moveToPoint(t,n),o.collapse(!0)}catch(e){o=function(e,n,t){var r,o=t.elementFromPoint(e,n),i=t.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=t.body),i.moveToElementText(o),0<(r=(r=Et.toArray(i.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-Math.abs(Math.max(t.top-n,t.bottom-n))})).length){n=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,n),i.collapse(!0),i}catch(e){}}return null}(t,n,r)}return i=o,a=r.body,u=i&&i.parentElement?i.parentElement():null,Yn(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Sf))?null:i}return o}function kf(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function Nf(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)}function _f(e){return e&&"TABLE"===e.nodeName}function Af(e,t,n){for(var r=new Rr(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Wn(t))return 1}function Rf(e,t,n,r,o){var i,a,u=e.getRoot(),s=e.schema.getNonEmptyElements(),c=e.getParent(o.parentNode,e.isBlock)||u;if(r&&Wn(o)&&t&&e.isEmpty(c))return ve.some(ss(o.parentNode,e.nodeIndex(o)));for(var l,f,d=new Rr(o,c);a=d[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||(f=u,Ir(l=a)&&!1===Nf(l,f,jc)))return ve.none();if(jn(a)&&0<a.nodeValue.length)return!1===Nf(a,u,function(e){return"A"===e.nodeName})?ve.some(ss(a,r?a.nodeValue.length:0)):ve.none();if(e.isBlock(a)||s[a.nodeName.toLowerCase()])return ve.none();i=a}return n&&i?ve.some(ss(i,0)):ve.none()}function Df(e,t,n,r){var o,i=e.getRoot(),a=!1,u=r[(n?"start":"end")+"Container"],s=r[(n?"start":"end")+"Offset"],c=zn(u)&&s===u.childNodes.length,l=e.schema.getNonEmptyElements(),f=n;if(Ir(u))return ve.none();if(zn(u)&&s>u.childNodes.length-1&&(f=!1),qn(u)&&(u=i,s=0),u===i){if(f&&(d=u.childNodes[0<s?s-1:0])){if(Ir(d))return ve.none();if(l[d.nodeName]||_f(d))return ve.none()}if(u.hasChildNodes()){if(s=Math.min(!f&&0<s?s-1:s,u.childNodes.length-1),u=u.childNodes[s],s=jn(u)&&c?u.data.length:0,!t&&u===i.lastChild&&_f(u))return ve.none();if(function(e,t){for(;t&&t!==e;){if(Yn(t))return 1;t=t.parentNode}}(i,u)||Ir(u))return ve.none();if(u.hasChildNodes()&&!1===_f(u)){var d=u,m=new Rr(u,i);do{if(Yn(d)||Ir(d)){a=!1;break}if(jn(d)&&0<d.nodeValue.length){s=f?0:d.nodeValue.length,u=d,a=!0;break}if(l[d.nodeName.toLowerCase()]&&(!(o=d)||!/^(TD|TH|CAPTION)$/.test(o.nodeName))){s=e.nodeIndex(d),u=d.parentNode,f||s++,a=!0;break}}while(d=f?m.next():m.prev())}}}return t&&(jn(u)&&0===s&&Rf(e,c,t,!0,u).each(function(e){u=e.container(),s=e.offset(),a=!0}),zn(u)&&(!(d=(d=u.childNodes[s])||u.childNodes[s-1])||!Wn(d)||d.previousSibling&&"A"===d.previousSibling.nodeName||Af(e,d,!1)||Af(e,d,!0)||Rf(e,c,t,!0,d).each(function(e){u=e.container(),s=e.offset(),a=!0}))),f&&!t&&jn(u)&&s===u.nodeValue.length&&Rf(e,c,t,!1,u).each(function(e){u=e.container(),s=e.offset(),a=!0}),a?ve.some(ss(u,s)):ve.none()}function Tf(e,t){var n=t.collapsed,r=t.cloneRange(),o=ss.fromRangeStart(t);return Df(e,n,!0,r).each(function(e){n&&ss.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Df(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),kf(t,r)?ve.none():ve.some(r)}function Of(e,t){return e.splitText(t)}function Bf(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&jn(t)?0<n&&n<t.nodeValue.length&&(t=(r=Of(t,n)).previousSibling,n<o?(t=r=Of(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(jn(t)&&0<n&&n<t.nodeValue.length&&(t=Of(t,n),n=0),jn(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Of(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}}function Pf(n){return{walk:function(e,t){return Nl(n,e,t)},split:Bf,normalize:function(t){return Tf(n,t).fold(D,function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}zl.isBookmarkNode=Jc;var Lf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||Lf.metaKeyPressed(e)},metaKeyPressed:function(e){return xt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},If=Yn;Pf.compareRanges=kf,Pf.getCaretRangeFromPoint=Ef,Pf.getSelectedNode=Pu,Pf.getNode=Lu;var Mf,Ff,Uf=(Mf="height",Ff=function(e){var t=e.dom;return In(e)?t.getBoundingClientRect().height:t.offsetHeight},{set:function(e,t){if(!E(t)&&!t.match(/^[0-9]+$/))throw new Error(Mf+".set accepts only positive integer values. Value was "+t);var n=e.dom;mn(n)&&(n.style[Mf]=t+"px")},get:zf,getOuter:zf,aggregate:Hf,max:function(e,t,n){var r=Hf(e,n);return r<t?t-r:0}});function zf(e){var t=Ff(e);if(t<=0||null===t){var n=xn(e,Mf);return parseFloat(n)||0}return t}function Hf(o,e){return L(e,function(e,t){var n=xn(o,t),r=void 0===n?0:parseInt(n,10);return isNaN(r)?e:e+r},0)}function jf(e){return"textarea"===Nt(e)}function Vf(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return Fn(n.offsetLeft,n.offsetTop);var i=Gt(null==r?void 0:r.pageYOffset,o.scrollTop),a=Gt(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Gt(o.clientTop,n.clientTop),s=Gt(o.clientLeft,n.clientLeft);return Un(e).translate(a-s,i-u)}(e),r=Uf.get(e);return{element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}}function qf(n,r,o,i){Td(n,function(e,t){return Dd(n,r,o,i)},o)}function $f(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Jt(t).top,r,o),e.fire("AfterScrollIntoView",i))}function Wf(e,t,n,r){var o=kt.fromDom(e.getDoc());$f(e,o,n,Vf(kt.fromDom(t),te),r)}function Kf(e,t,n,r){var o,i=e.pos;n?Qt(i.left,i.top,r):(o=i.top-t+e.height,Qt(i.left,o,r))}function Xf(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,s=n<=u-a;a<t?Kf(r,n,!1!==o,e):i<a?Kf(r,n,s?!1!==o:!0===o,e):i<u&&!s&&Kf(r,n,!0===o,e)}function Yf(e,t,n,r){Xf(e,t,e.dom.defaultView.innerHeight,n,r)}function Gf(e,t,n,r){Xf(e,t,e.dom.defaultView.innerHeight,n,r);var o,i,a,u,s,c,l,f=(o=n.element,u=Jt(kt.fromDom(document)),a=(i=Rd).owner(o),s=Ad(i,a),c=Un(o),l=P(s,function(e,t){var n=Un(t);return{left:e.left+n.left,top:e.top+n.top}},{left:0,top:0}),Fn(l.left+c.left+u.left,l.top+c.top+u.top)),d=tn(window);f.top<d.y?Zt(n.element,!1!==r):f.top>d.bottom&&Zt(n.element,!0===r)}function Jf(e,t,n){return qf(e,Yf,t,n)}function Qf(e,t,n){return Wf(e,t,Yf,n)}function Zf(e,t,n){return qf(e,Gf,t,n)}function ed(e,t,n){return Wf(e,t,Gf,n)}function td(e,t,n){(e.inline?Jf:Zf)(e,t,n)}function nd(e){var t=Bn(e).dom;return e.dom===t.activeElement}function rd(e){return void 0===e&&(e=kt.fromDom(document)),ve.from(e.dom.activeElement).map(kt.fromDom)}function od(e,t){var n=_n(t)?Il(t).length:Dn(t).length+1;return n<e?n:e<0?0:e}function id(e){return Ld.range(e.start,od(e.soffset,e.start),e.finish,od(e.foffset,e.finish))}function ad(e,t){return!rn(t.dom)&&(Ve(e,t)||je(e,t))}function ud(t){return function(e){return ad(t,e.start)&&ad(t,e.finish)}}function sd(e){return!0===e.inline||Id.isIE()}function cd(e){return Ld.range(kt.fromDom(e.startContainer),e.startOffset,kt.fromDom(e.endContainer),e.endOffset)}function ld(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),ve.some(t)}catch(e){return ve.none()}}function fd(e){var t,n,r=sd(e)?(t=kt.fromDom(e.getBody()),((n=Tt(t).dom.getSelection())&&0!==n.rangeCount?ve.from(n.getRangeAt(0)):ve.none()).map(cd).filter(ud(t))):ve.none();e.bookmark=r.isSome()?r:e.bookmark}function dd(n){return(n.bookmark||ve.none()).bind(function(e){return t=kt.fromDom(n.getBody()),ve.from(e).filter(ud(t)).map(id);var t}).bind(ld)}function md(u){var s=du(function(){fd(u)},0);u.on("init",function(){function e(){n.throttle()}var t,n,r,o,i,a;u.inline&&(t=u,n=s,Za.DOM.bind(document,"mouseup",e),t.on("remove",function(){Za.DOM.unbind(document,"mouseup",e)})),r=u,o=s,dt().browser.isIE()?(a=r).on("focusout",function(){fd(a)}):(i=o,r.on("mouseup touchend",function(e){i.throttle()})),r.on("keyup NodeChange",function(e){"nodechange"===e.type&&e.selectionChange||fd(r)})}),u.on("remove",function(){s.cancel()})}function gd(t,e){var n=t.getParam("custom_ui_selector","","string");return null!==Fd.getParent(e,function(e){return Md.isEditorUIElement(e)||!!n&&t.dom.is(e,n)})}function pd(n,e){var t=e.editor;md(t),t.on("focusin",function(){var e=n.focusedEditor;e!==t&&(e&&e.fire("blur",{focusedEditor:t}),n.setActive(t),(n.focusedEditor=t).fire("focus",{blurredEditor:e}),t.focus(!0))}),t.on("focusout",function(){_r.setEditorTimeout(t,function(){var e=n.focusedEditor;gd(t,function(e){try{return rd(Bn(kt.fromDom(e.getElement()))).fold(function(){return document.body},function(e){return e.dom})}catch(e){return document.body}}(t))||e!==t||(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null)})}),_d||(_d=function(e){var t=n.activeEditor;t&&!function(e){if(On()&&V(e.target)){var t=kt.fromDom(e.target);if(Nn(t)&&V(t.dom.shadowRoot)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return Q(n)}}return ve.from(e.target)}(e).each(function(e){e.ownerDocument===document&&(e===document.body||gd(t,e)||n.focusedEditor!==t||(t.fire("blur",{focusedEditor:null}),n.focusedEditor=null))})},Fd.bind(document,"focusin",_d))}function hd(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Fd.unbind(document,"focusin",_d),_d=null)}function vd(t,e){var n,r;n=kt.fromDom(t.getBody()),((r=e).collapsed?ve.from(Lu(r.startContainer,r.startOffset)).map(kt.fromDom):ve.none()).bind(function(e){return vo(e)?ve.some(e):!1===Ve(n,e)?ve.some(n):ve.none()}).bind(function(e){return nf(e.dom)}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})}function bd(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()}function yd(e){return e.inline?(r=e.getBody())&&(nd(t=kt.fromDom(r))||rd(Bn(n=t)).filter(function(e){return n.dom.contains(e.dom)}).isSome()):e.iframeElement&&nd(kt.fromDom(e.iframeElement));var t,n,r}function Cd(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return ve.from(i).map(kt.fromDom).map(function(e){return r&&t.collapsed?e:Mt(e,o(e,a)).getOr(e)}).bind(function(e){return Nn(e)?ve.some(e):Ot(e).filter(Nn)}).map(function(e){return e.dom}).getOr(e)}function xd(e,t,n){return Cd(e,t,!0,n,function(e,t){return Math.min(zt(e),t)})}function wd(e,t,n){return Cd(e,t,!1,n,function(e,t){return 0<t?t-1:t})}function Sd(e,t){for(var n=e;e&&jn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}function Ed(n,e){return A(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})}function kd(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}}function Nd(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t}var _d,Ad=function(r,e){return r.view(e).fold(J([]),function(e){var t=r.owner(e),n=Ad(r,t);return[e].concat(n)})},Rd=Object.freeze({__proto__:null,view:function(e){var t;return(e.dom===document?ve.none():ve.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(kt.fromDom)},owner:Dt}),Dd=function(e,t,n,r){var o=kt.fromDom(e.getBody()),i=kt.fromDom(e.getDoc());o.dom.offsetWidth;var a,u,s,c,l=(a=kt.fromDom(n.startContainer),u=n.startOffset,s=function(e,t){var n=Dn(e);if(0===n.length||jf(e))return{element:e,offset:t};if(t<n.length&&!jf(n[t]))return{element:n[t],offset:0};var r=n[n.length-1];return jf(r)?{element:e,offset:t}:"img"===Nt(r)?{element:r,offset:1}:_n(r)?{element:r,offset:Il(r).length}:{element:r,offset:Dn(r).length}}(a,u),c=kt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>'),qt(s.element,c),Vf(c,function(){return Ln(c)}));$f(e,i,t,l,r),l.cleanup()},Td=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(kt.fromDom(r),kt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Od=or([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bd=(Od.before,Od.on,Od.after,function(e){return e.fold(u,u,u)}),Pd=or([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ld={domRange:Pd.domRange,relative:Pd.relative,exact:Pd.exact,exactFromRange:function(e){return Pd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){return Tt(e.match({domRange:function(e){return kt.fromDom(e.startContainer)},relative:function(e,t){return Bd(e)},exact:function(e,t,n,r){return e}}))},range:function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}}},Id=dt().browser,Md={isEditorUIElement:function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Fd=Za.DOM,Ud=function(e){return e.editorManager.setActive(e)},zd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Hd=(jd.create=function(e,t){var n=new jd(e,zd[e]||1);return t&&ne(t,function(e,t){n.attr(t,e)}),n},jd.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},jd.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&ne(e,function(e,t){r.attr(t,e)}),r;if(n=r.attributes){if(void 0===t)return n.map[e];if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}},jd.prototype.clone=function(){var e,t=new jd(this.name,this.type);if(e=this.attributes){var n=[];n.map={};for(var r=0,o=e.length;r<o;r++){var i=e[r];"id"!==i.name&&(n[n.length]={name:i.name,value:i.value},n.map[i.name]=i.value)}t.attributes=n}return t.value=this.value,t.shortEnded=this.shortEnded,t},jd.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},jd.prototype.unwrap=function(){for(var e=this.firstChild;e;){var t=e.next;this.insert(e,this,!0),e=t}this.remove()},jd.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},jd.prototype.append=function(e){e.parent&&e.remove();var t=this.lastChild;return t?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},jd.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},jd.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=kd(n,this))n.name===e&&t.push(n);return t},jd.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},jd.prototype.empty=function(){if(this.firstChild){for(var e=[],t=this.firstChild;t;t=kd(t,this))e.push(t);for(var n=e.length;n--;)(t=e[n]).parent=t.firstChild=t.lastChild=t.next=t.prev=null}return this.firstChild=this.lastChild=null,this},jd.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this.firstChild;if(Nd(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(e[r.name])return!1;if(Nd(r))return!1}if(8===r.type)return!1;if(3===r.type&&!function(e){if(qr(e.value)){var t=e.parent;return!t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)}}(r))return!1;if(3===r.type&&r.parent&&t[r.parent.name]&&qr(r.value))return!1;if(n&&n(r))return!1}while(r=kd(r,this));return!0},jd.prototype.walk=function(e){return kd(this,null,e)},jd);function jd(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}function Vd(e,t){return e.replace(t.re,function(e){return ue(t.uris,e).getOr(e)})}var qd=Et.each,$d=Et.trim,Wd="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Kd={ftp:21,http:80,https:443,mailto:25},Xd=["img","video"],Yd=(Gd.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}},Gd.isDomSafe=function(e,t,n){if((n=void 0===n?{}:n).allow_script_urls)return!0;var r,o,i,a,u=Qo.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{u=decodeURIComponent(u)}catch(e){u=unescape(u)}return!(/((java|vb)script|mhtml):/i.test(u)||(o=u,i=t,!(r=n).allow_html_data_urls&&(/^data:image\//i.test(o)?(V(a=r.allow_svg_data_urls)?!a:!V(i)||!T(Xd,i))&&/^data:image\/svg\+xml/i.test(o):/^data:/i.test(o))))},Gd.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},Gd.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},Gd.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new Gd(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},Gd.prototype.toAbsolute=function(e,t){var n=new Gd(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},Gd.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Kd[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},Gd.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},Gd.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),s=t.split("/");for(qd(u,function(e){e&&i.push(e)}),u=i,n=s.length-1,i=[];0<=n;n--)0!==s[n].length&&"."!==s[n]&&(".."!==s[n]?0<o?o--:i.push(s[n]):o++);return 0!==(r=(n=u.length-o)<=0?q(i).join("/"):u.slice(0,n).join("/")+"/"+q(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},Gd.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},Gd);function Gd(e,t){e=$d(e),this.settings=t||{};var n,r,o,i,a=this.settings.base_uri,u=this;/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?u.source=e:(n=0===e.indexOf("//"),0!==e.indexOf("/")||n||(e=(a&&a.protocol||"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(r=this.settings.base_uri?this.settings.base_uri.path:new Gd(document.location.href).directory,e=this.settings.base_uri&&""==this.settings.base_uri.protocol?"//mce_host"+u.toAbsPath(r,e):(o=/([^#?]*)([#?]?.*)/.exec(e),(a&&a.protocol||"http")+"://mce_host"+u.toAbsPath(r,o[1])+o[2])),e=e.replace(/@@/g,"(mce_at)"),i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),qd(Wd,function(e,t){var n=(n=i[t])&&n.replace(/\(mce_at\)/g,"@@");u[e]=n}),a&&(u.protocol||(u.protocol=a.protocol),u.userInfo||(u.userInfo=a.userInfo),u.port||"mce_host"!==u.host||(u.port=a.port),u.host&&"mce_host"!==u.host||(u.host=a.host),u.source=""),n&&(u.protocol=""))}function Jd(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var s=r.exec(t);if(null===s)return u;if("!"===s[1]){u=Ge(s[2],"--")?tm(t,!1,s.index+"!--".length):tm(t,!0,s.index+1);break}o.lastIndex=r.lastIndex;var c=o.exec(t);if(!l(c)&&c.index===r.lastIndex){"/"===s[1]?--a:ke(i,s[2])||(a+=1),u=r.lastIndex+c[0].length;break}}return u}function Qd(q,$){void 0===$&&($=ro()),q=q||{};var W=em(),K=W.createElement("form");function n(s,e){void 0===e&&(e="html");for(var t,i,n,c,r,o,a,l,u,f,d,m,g,p,h,v,b,y,C,x=s.html,w=0,S=[],E=0,k=Qo.decode,N=Et.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),_="html"===e?0:1,A=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},R=function(e,t){return G(Vd(e,s),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),q.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(Vd(e,s)))},T=function(e,t){var n=e||"",r=!Ge(n,"--"),o=tm(x,r,t);return e=x.substr(t,o-t),D(r?n+e:e),o+1},O=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),B=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,P=$.getShortEndedElements(),L=q.self_closing_elements||$.getSelfClosingElements(),I=$.getBoolAttrs(),M=q.validate,F=q.remove_internals,U=q.fix_self_closing,z=$.getSpecialElements(),H=x+">";t=O.exec(H);){var j=t[0];if(w<t.index&&R(k(x.substr(w,t.index-w))),i=t[7])A(i=":"===(i=i.toLowerCase()).charAt(0)?i.substr(1):i);else if(i=t[8]){if(t.index+j.length>x.length){R(k(x.substr(t.index))),w=t.index+j.length;continue}u=(i=":"===(i=i.toLowerCase()).charAt(0)?i.substr(1):i)in P,U&&L[i]&&0<S.length&&S[S.length-1].name===i&&A(i);var V=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null}(B,t[9]);if(null!==V){if("all"===V){w=Jd($,x,O.lastIndex),O.lastIndex=w;continue}d=!1}if(!M||(f=$.getElementRule(i))){if(d=!0,M&&(p=f.attributes,h=f.attributePatterns),(g=t[9])?((l=-1!==g.indexOf("data-mce-type"))&&F&&(d=!1),(c=[]).map={},g.replace(B,function(e,t,n,r,o){return function(e,t,n,r,o){var i;if(n=Vd((t=t.toLowerCase())in I?t:k(n||r||o||""),s),M&&!l&&0==(0===(i=t).indexOf("data-")||0===i.indexOf("aria-"))){var a=p[t];if(!a&&h){for(var u=h.length;u--&&!(a=h[u]).pattern.test(t););-1===u&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}("name"===t||"id"===t)&&e in Zd&&(n in W||n in K)||N[t]&&!Yd.isDomSafe(n,e,q)||l&&(t in N||0===t.indexOf("on"))||(c.map[t]=n,c.push({name:t,value:n}))}(i,t,n,r,o),""})):(c=[]).map={},M&&!l){if(v=f.attributesRequired,b=f.attributesDefault,y=f.attributesForced,f.removeEmptyAttrs&&!c.length&&(d=!1),y)for(r=y.length;r--;)a=(m=y[r]).name,"{$uid}"===(C=m.value)&&(C="mce_"+E++),c.map[a]=C,c.push({name:a,value:C});if(b)for(r=b.length;r--;)(a=(m=b[r]).name)in c.map||("{$uid}"===(C=m.value)&&(C="mce_"+E++),c.map[a]=C,c.push({name:a,value:C}));if(v){for(r=v.length;r--&&!(v[r]in c.map););-1===r&&(d=!1)}if(m=c.map["data-mce-bogus"]){if("all"===m){w=Jd($,x,O.lastIndex),O.lastIndex=w;continue}d=!1}}d&&J(i,c,u)}else d=!1;if(n=z[i]){n.lastIndex=w=t.index+j.length,w=(t=n.exec(x))?(d&&(o=x.substr(w,t.index-w)),t.index+t[0].length):(o=x.substr(w),x.length),d&&(0<o.length&&R(o,!0),Q(i)),O.lastIndex=w;continue}u||(g&&g.indexOf("/")===g.length-1?d&&Q(i):S.push({name:i,valid:d}))}else if(i=t[1])D(i);else if(i=t[2]){if(!(1==_||q.preserve_cdata||0<S.length&&$.isValidChild(S[S.length-1].name,"#cdata"))){w=T("",t.index+2),O.lastIndex=w;continue}Y(i)}else if(i=t[3])ee(i);else{if((i=t[4])||"<!"===j){w=T(i,t.index+j.length),O.lastIndex=w;continue}if(i=t[5]){if(1!=_){w=T("?",t.index+2),O.lastIndex=w;continue}Z(i,t[6])}}w=t.index+j.length}for(w<x.length&&R(k(x.substr(w))),r=S.length-1;0<=r;r--)(i=S[r]).valid&&Q(i.name)}!1!==q.fix_self_closing&&(q.fix_self_closing=!0);var X=q.comment||te,Y=q.cdata||te,G=q.text||te,J=q.start||te,Q=q.end||te,Z=q.pi||te,ee=q.doctype||te;return{parse:function(e,t){void 0===t&&(t="html"),n(function(e){for(var t,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=xu("img"),a=0,u=0;t=n.exec(e);){var s=t[0],c=i+"_"+u++;o[c]=s,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(c),a=t.index+s.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:l}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(e),t)}}}var Zd=Et.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),em=Re(function(){return document.implementation.createHTMLDocument("parser")}),tm=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length};function nm(e,t){for(var n,r,o,i,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,u=e.schema,s=(n=e.getTempAttrs(),r=t,o=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi"),r.replace(o,"")),c=u.getShortEndedElements();i=a.exec(s);){var l=a.lastIndex,f=i[0].length,d=c[i[1]]?l:Qd.findEndTag(u,s,l),s=s.substring(0,l-f)+s.substring(d);a.lastIndex=l-f}return Eo(s)}function rm(o){return{compare:function(e,t){return e.nodeName===t.nodeName&&!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||Jc(e)||Jc(t));function n(n){var r={};return um(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r}function r(e,t){var n,r;for(r in e)if(ke(e,r)){if(void 0===(n=t[r]))return;if(e[r]!==n)return;delete t[r]}for(r in t)if(ke(t,r))return;return 1}}}}function om(e){var u=[],s=(e=e||{}).indent,c=sm(e.indent_before||""),l=sm(e.indent_after||""),f=Qo.getEncodeFunc(e.entity_encoding||"raw",e.entities),d="html"===e.element_format;return{start:function(e,t,n){var r,o,i,a;if(s&&c[e]&&0<u.length&&0<(a=u[u.length-1]).length&&"\n"!==a&&u.push("\n"),u.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],u.push(" ",i.name,'="',f(i.value,!0),'"');u[u.length]=!n||d?">":" />",n&&s&&l[e]&&0<u.length&&0<(a=u[u.length-1]).length&&"\n"!==a&&u.push("\n")},end:function(e){var t;u.push("</",e,">"),s&&l[e]&&0<u.length&&0<(t=u[u.length-1]).length&&"\n"!==t&&u.push("\n")},text:function(e,t){0<e.length&&(u[u.length]=t?e:f(e))},cdata:function(e){u.push("<![CDATA[",e,"]]>")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push("<?",e," ",f(t),"?>"):u.push("<?",e,"?>"),s&&u.push("\n")},doctype:function(e){u.push("<!DOCTYPE",e,">",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}}function im(t,g){void 0===g&&(g=ro());var p=om(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f=t.validate,d={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};p.reset();var m=function(e){var t=d[e.type];if(t)t(e);else{var n=e.name,r=e.shortEnded,o=e.attributes;if(f&&o&&1<o.length){var i=[];i.map={};var a=g.getElementRule(e.name);if(a){for(var u=0,s=a.attributesOrder.length;u<s;u++)(c=a.attributesOrder[u])in o.map&&(l=o.map[c],i.map[c]=l,i.push({name:c,value:l}));for(var c,l,u=0,s=o.length;u<s;u++)(c=o[u].name)in i.map||(l=o.map[c],i.map[c]=l,i.push({name:c,value:l}));o=i}}if(p.start(e.name,o,r),!r){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(n)}}};return 1!==e.type||t.inner?d[11](e):m(e),p.getContent()}}}Qd.findEndTag=Jd;var am=nm,um=Et.each,sm=Et.makeMap,cm=new Set;function lm(e,t){return we(e.parseStyle(e.getAttrib(t,"style")))}function fm(n,r,o){return ve.from(o.container()).filter(jn).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})}function dm(e){var t=e.container();return jn(t)&&(0===t.data.length||So(t.data)&&zl.isBookmarkNode(t.parentNode))}function mm(t,n){return function(e){return ve.from(Qs(t?0:-1,e)).filter(n).isSome()}}function gm(e){return Kn(e)&&"block"===xn(kt.fromDom(e),"display")}function pm(e){return Yn(e)&&!(zn(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t}function hm(e){Xt(e),Pn(e,kt.fromHtml('<br data-mce-bogus="1">'))}function vm(n){Ut(n).each(function(t){Bt(t).each(function(e){mo(n)&&Br(t)&&mo(e)&&Ln(t)})})}function bm(e,t){return o=D,Ve(r=t,n=e)?function(e,t){for(var n=y(t)?t:D,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=kt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(n,function(e){return o(e)||je(e,r)}).slice(0,-1):[];var n,r,o}function ym(e,t){return[e].concat(bm(e,t))}function Cm(e,t,n){return Zl(e,t,n,dm)}function xm(e,t){return M(ym(kt.fromDom(t.container()),e),mo)}function wm(e,n,r){return Cm(e,n.dom,r).forall(function(t){return xm(n,r).fold(function(){return!1===Js(t,r,n.dom)},function(e){return!1===Js(t,r,n.dom)&&Ve(e,kt.fromDom(t.container()))})})}function Sm(t,n,r){return xm(n,r).fold(function(){return Cm(t,n.dom,r).forall(function(e){return!1===Js(e,r,n.dom)})},function(e){return Cm(t,e.dom,r).isNone()})}function Em(e){return oc(e).exists(Br)}function km(e,t,n){var r=Q(U(ym(kt.fromDom(n.container()),t),mo)).getOr(t);return Ql(e,r.dom,n).filter(Em)}function Nm(e,t){return oc(t).exists(Br)||km(!0,e,t).isSome()}function _m(e,t){return ve.from(t.getNode(!0)).map(kt.fromDom).exists(Br)||km(!1,e,t).isSome()}function Am(e){return ss.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()}function Rm(e,t){return Q(U(ym(kt.fromDom(t.container()),e),mo)).getOr(e)}function Dm(e,t){return Am(t)?Gg(t):Gg(t)||tf(Rm(e,t).dom,t).exists(Gg)}function Tm(e,t){return Am(t)?Yg(t):Yg(t)||ef(Rm(e,t).dom,t).exists(Yg)}function Om(e){return oc(e).bind(function(e){return pr(e,Nn)}).exists(function(e){return T(["pre","pre-wrap"],xn(e,"white-space"))})}function Bm(e,t){return!Om(t)&&(ip(e,t)||up(e,t)||_m(e,t)||Dm(e,t))}function Pm(e,t){return!Om(t)&&(ap(e,t)||sp(e,t)||Nm(e,t)||Tm(e,t))}function Lm(e,t){return Bm(e,t)||Pm(e,(r=(n=t).container(),o=n.offset(),jn(r)&&o<r.data.length?ss(r,o+1):n));var n,r,o}function Im(e,t){return uf(e.charAt(t))}function Mm(e){var t=e.container();return jn(t)&&Te(t.data,xo)}function Fm(g,e){return ve.some(e).filter(Mm).bind(function(e){var t,n,r,o,i,a,u,s,c,l=e.container(),f=g,d=(i=l).data,m=ss(i,0);return(!Im(d,0)||Lm(f,m)?(s=(a=l).data,(c=A(u=s.split(""),function(e,t){return uf(e)&&0<t&&t<u.length-1&&Zc(u[t-1])&&Zc(u[t+1])?" ":e}).join(""))!==s&&(a.data=c,1)):(i.data=" "+d.slice(1),1))||(t=g,r=(n=l).data,o=ss(n,r.length-1),Im(r,r.length-1)&&!Lm(t,o)&&(n.data=r.slice(0,-1)+" ",1))?ve.some(e):ve.none()})}function Um(t){var e=kt.fromDom(t.getBody());t.selection.isCollapsed()&&Fm(e,ss.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})}function zm(e,t,n){var r,o,i,a,u,s,c,l;0!==n&&(o=gr(r=kt.fromDom(e),mo).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&Pm(o,ss(e,e.data.length)),u=0===t&&Bm(o,ss(e,0)),e.replaceData(t,n,(c=u,l=a,L(s=i,function(e,t){return Qc(t)||uf(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+xo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))}function Hm(e,t){var n=e.data.slice(t);zm(e,t,n.length-Qe(n).length)}function jm(e,t){var n=e.data.slice(0,t),r=n.length-Ze(n).length;zm(e,t-r,r)}function Vm(e,t,n,r){void 0===r&&(r=!0);var o=Ze(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),Ln(kt.fromDom(a)),n&&Hm(i,o),i}function qm(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===ss.isTextPosition(n)&&o===r.parentNode&&i>ss.before(r).offset()?ss(t.container(),t.offset()-1):t;var n,r,o,i}function $m(e){return jr(e.previousSibling)?ve.some((t=e.previousSibling,jn(t)?ss(t,t.data.length):ss.after(t))):e.previousSibling?rf(e.previousSibling):ve.none();var t}function Wm(e){return jr(e.nextSibling)?ve.some((t=e.nextSibling,jn(t)?ss(t,0):ss.before(t))):e.nextSibling?nf(e.nextSibling):ve.none();var t}function Km(r,o){return $m(o).orThunk(function(){return Wm(o)}).orThunk(function(){return e=r,n=ss.before((t=o).previousSibling||t.parentNode),tf(e,n).fold(function(){return ef(e,ss.after(t))},ve.some);var e,t,n})}function Xm(n,r){return Wm(r).orThunk(function(){return $m(r)}).orThunk(function(){return ef(e=n,ss.after(t=r)).fold(function(){return tf(e,ss.before(t))},ve.some);var e,t})}function Ym(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})}function Gm(e,t){return t&&ke(e.schema.getBlockElements(),Nt(t))}function Jm(e){if(Wr(e)){var t=kt.fromHtml('<br data-mce-bogus="1">');return Xt(e),Pn(e,t),ve.some(ss.before(t.dom))}return ve.none()}function Qm(t,n,e,r){void 0===r&&(r=!0);var o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(p=n,h=t.getBody(),v=e.dom,(p?Xm:Km)(h,v).map(R(qm,v))),y=gr(e,R(Gm,t),(o=t.getBody(),function(e){return e.dom===o})),C=(u=b,i=a=e,s=ke(t.schema.getTextInlineElements(),Nt(i)),m=Bt(a).filter(_n),g=Pt(a).filter(_n),Ln(a),l=g,f=u,d=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Vm(r,o,s),n.container()===o?ss(r,i):n},((c=m).isSome()&&l.isSome()&&f.isSome()?ve.some(d(c.getOrDie(),l.getOrDie(),f.getOrDie())):ve.none()).orThunk(function(){return s&&(m.each(function(e){return jm(e.dom,e.dom.length)}),g.each(function(e){return Hm(e.dom,0)})),u}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):y.bind(Jm).fold(function(){r&&Ym(t,n,C)},function(e){r&&Ym(t,n,ve.some(e))})}function Zm(e){return bu(e,"td,th")}function eg(e,t){return{start:e,end:t}}function tg(e,t){return br(kt.fromDom(e),"td,th",t)}function ng(e){return!je(e.start,e.end)}function rg(e,n){return Dl(e.start,n).bind(function(t){return Dl(e.end,n).bind(function(e){return je(t,e)?ve.some(t):ve.none()})})}function og(e){return function(t){return rg(t,e).map(function(e){return{rng:t,table:e,cells:Zm(e)}})}}function ig(e,t,n,r){if(n.collapsed||!e.forall(ng))return ve.none();if(t.isSameTable){var o=e.bind(og(r));return ve.some({start:o,end:o})}var i,a,u=tg(n.startContainer,r),s=tg(n.endContainer,r),c=u.bind((a=r,function(t){return Dl(t,a).bind(function(e){return Z(Zm(e)).map(function(e){return eg(t,e)})})})).bind(og(r)),l=s.bind((i=r,function(t){return Dl(t,i).bind(function(e){return Q(Zm(e)).map(function(e){return eg(e,t)})})})).bind(og(r));return ve.some({start:c,end:l})}function ag(e,t){return z(e,function(e){return je(e,t)})}function ug(n){return dn(ag(n.cells,n.rng.start),ag(n.cells,n.rng.end),function(e,t){return n.cells.slice(e,t+1)})}function sg(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each(function(e){return o.setStartAfter(e.dom)}),r.each(function(e){return o.setEndBefore(e.dom)}),o}function cg(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(n=e,function(e){return je(n,e)}),y=dn(tg((r=t).startContainer,o=b),tg(r.endContainer,o),eg),C=(l=b,f=x((c=t).startContainer),d=x(c.endContainer),m=f.isSome(),g=d.isSome(),p=dn(f,d,je).getOr(!1),{startTable:f,endTable:d,isStartInTable:m,isEndInTable:g,isSameTable:p,isMultiTable:!p&&m&&g});function x(e){return Dl(kt.fromDom(e),l)}return h=t,v=b,y.exists(function(e){return!ng(t=e)&&rg(t,v).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&Tl(e.start,h);var t})?y.map(function(e){return fp.singleCellTable(t,e.start)}):C.isMultiTable?ig(y,u=C,s=t,b).bind(function(e){var t=e.start,n=e.end,r=t.bind(ug).getOr([]),o=n.bind(ug).getOr([]);if(0<r.length&&0<o.length){var i=sg(s,u);return ve.some(fp.multiTable(r,o,i))}return ve.none()}):ig(y,i=C,a=t,b).bind(function(e){var t=e.start,n=e.end;return t.or(n)}).bind(function(e){var t=i.isSameTable,n=ug(e).getOr([]);if(t&&e.cells.length===n.length)return ve.some(fp.fullTable(e.table));if(0<n.length){if(t)return ve.some(fp.partialTable(n,ve.none()));var r=sg(a,i);return ve.some(fp.partialTable(n,ve.some(_e(_e({},i),{rng:r}))))}return ve.none()})}function lg(e){return Y(e,function(e){yn(e,"contenteditable"),hm(e)}),0}function fg(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),mp(e,o,t,!1)}function dg(e){var t=Rl(e),n=kt.fromDom(e.selection.getNode());Gn(n.dom)&&Wr(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),1<t.length&&F(t,function(e){return je(e,n)})&&pn(n,"data-mce-selected","1")}function mg(s,c,e){var l=s.selection.getRng();return lg(e.bind(function(e){var t,n,r,o=e.rng,i=e.isStartInTable,a=(t=i?o.endContainer:o.startContainer,ve.from(s.dom.getParent(t,s.dom.isBlock)).map(kt.fromDom));o.deleteContents(),n=s,r=i,a.filter(Wr).each(function(e){r?Ln(e):(hm(e),n.selection.setCursorLocation(e.dom,0))});var u=i?c[0]:c[c.length-1];return fg(s,u,l,i),Wr(u)?ve.none():ve.some(i?c.slice(1):c.slice(0,-1))}).getOr(c)),dg(s),!0}function gg(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];fg(e,i,o,!0),fg(e,a,o,!1);var u=Wr(i)?t:t.slice(1),s=Wr(a)?n:n.slice(0,-1);return lg(u.concat(s)),r.deleteContents(),dg(e),!0}function pg(e,t){return Qm(e,!1,t),!0}function hg(e,t){return M(ym(t,e),bo)}function vg(e,t){return(e?tp:np)(t)}function bg(f,d,s){var m=kt.fromDom(f.getBody());return gp(m,s).fold(function(){return o=f,i=d,a=m,e=s,u=ss.fromRangeStart(o.selection.getRng()),hg(a,e).bind(function(e){return Wr(e)?pp(o,e):(t=a,n=e,r=u,zc(i,o.getBody(),r).bind(function(e){return hg(t,kt.fromDom(e.getNode())).map(function(e){return!1===je(e,n)})}));var t,n,r}).getOr(!1)||(n=d,r=ss.fromRangeStart((t=f).selection.getRng()),vg(n,r)||Ql(n,t.getBody(),r).exists(function(e){return vg(n,e)}));var o,i,a,e,u,t,n,r},function(e){return n=d,r=m,o=e,i=ss.fromRangeStart((t=f).selection.getRng()),(Wr(o)?pp(t,o):(u=r,c=o,l=i,zc(s=n,(a=t).getBody(),l).bind(function(e){return r=s,o=l,i=e,nf((n=c).dom).bind(function(t){return rf(n.dom).map(function(e){return r?o.isEqual(t)&&i.isEqual(e):o.isEqual(e)&&i.isEqual(t)})}).getOr(!0)?pp(a,c):(t=c,gp(u,kt.fromDom(e.getNode())).map(function(e){return!1===je(e,t)}));var t,n,r,o,i}).or(ve.some(!0)))).getOr(!1);var a,u,s,c,l,t,n,r,o,i})}function yg(e,t){var n,r,o,i,a,u,s,c,l=kt.fromDom(e.selection.getStart(!0)),f=Rl(e);return e.selection.isCollapsed()&&0===f.length?bg(e,t,l):(r=l,o=f,i=kt.fromDom((n=e).getBody()),a=n.selection.getRng(),0!==o.length?mg(n,o,ve.none()):(u=n,c=a,gp(s=i,r).fold(function(){return t=u,cg(s,c).map(function(e){return e.fold(R(mp,t),R(pg,t),R(mg,t),R(gg,t))});var t},function(e){return pp(u,e)}).getOr(!1)))}function Cg(e){return e.collapsed?e:(a=e,u=ss.fromRangeStart(a),s=ss.fromRangeEnd(a),c=a.commonAncestorContainer,Ql(!1,c,s).map(function(e){return!Js(u,s,c)&&Js(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a));var a,u,s,c}function xg(e,t){var n,r,o,i,a,u=t.firstChild,s=t.lastChild;return u&&"meta"===u.name&&(u=u.next),r=s=s&&"mce_marker"===s.attr("id")?s.prev:s,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||(i=r,n.getBlockElements()[i.name]&&i.firstChild&&i.firstChild===i.lastChild&&("br"===(a=i.firstChild).name||a.value===xo)))&&(s=s.prev),u&&u===s&&("ul"===u.name||"ol"===u.name)}function wg(e){return 0<e.length&&(!(r=e[e.length-1]).firstChild||(t=r)&&t.firstChild&&t.firstChild===t.lastChild&&((n=t.firstChild).data===xo||Wn(n)))?e.slice(0,-1):e;var t,n,r}function Sg(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null}function Eg(e,t){var n=ss.after(e),r=Ic(t).prev(n);return r?r.toRange():null}function kg(e,o,i,t){function n(e){var t=ss.fromRangeStart(i),n=Ic(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Sg(o,r.getNode())!==R}var r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,S,E,k,N,_,A=(r=o,c=e.serialize(t),u=(a=r.createFragment(c)).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),R=Sg(o,i.startContainer),D=wg(U(A.firstChild.childNodes,function(e){return"LI"===e.nodeName})),T=o.getRoot();return n(1)?(S=T,_=(w=R).parentNode,Et.each(D,function(e){_.insertBefore(e,w)}),E=S,k=ss.before(w),(N=Ic(E).next(k))?N.toRange():null):n(2)?(l=R,d=T,o.insertAfter((f=D).reverse(),l),Eg(f[0],d)):(g=D,p=T,h=m=R,b=(v=i).cloneRange(),y=v.cloneRange(),b.setStartBefore(h),y.setEndAfter(h),C=[b.cloneContents(),y.cloneContents()],(x=m.parentNode).insertBefore(C[0],m),Et.each(g,function(e){x.insertBefore(e,m)}),x.insertBefore(C[1],m),x.removeChild(m),Eg(g[g.length-1],p))}function Ng(e,t,n){var r,o,i,a,u=e.selection,s=e.dom;/^ | $/.test(t)&&(r=s,o=u.getRng(),i=t,i=Bm(a=kt.fromDom(r.getRoot()),ss.fromRangeStart(o))?i.replace(/^ /,"&nbsp;"):i.replace(/^&nbsp;/," "),t=i=Pm(a,ss.fromRangeEnd(o))?i.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):i.replace(/&nbsp;(<br( \/)?>)?$/," "));var c=e.parser,l=n.merge,f=im({validate:e.getParam("validate")},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',m=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(m.isDefaultPrevented())e.fire("SetContent",{content:m.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=m.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var g,p,h=(g=u.getRng()).startContainer||(g.parentElement?g.parentElement():null),v=e.getBody();h===v&&u.isCollapsed()&&s.isBlock(v.firstChild)&&((p=v.firstChild)&&!e.schema.getShortEndedElements()[p.nodeName])&&s.isEmpty(v.firstChild)&&((g=s.createRng()).setStart(v.firstChild,0),g.setEnd(v.firstChild,0),u.setRng(g)),u.isCollapsed()||function(e){var t=e.dom,n=Cg(e.selection.getRng());e.selection.setRng(n);var r,o=t.getParent(n.startContainer,hp),i=n;null!==(r=o)&&r===t.getParent(i.endContainer,hp)&&Tl(kt.fromDom(r),i)?mp(e,n,kt.fromDom(o)):e.getDoc().execCommand("Delete",!1,null)}(e);var b,y,C,x,w,S,E,k,N,_,A,R,D,T,O={context:(I=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},B=c.parse(t,O);if(!0===n.paste&&xg(e.schema,B)&&Sg(s,I))return g=kg(f,s,u.getRng(),B),u.setRng(g),void e.fire("SetContent",m);if(function(){for(var e=B;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(),"mce_marker"===(L=B.lastChild).attr("id"))for(var P=L,L=L.prev;L;L=L.walk(!0))if(3===L.type||!s.isBlock(L.name)){e.schema.isValidChild(L.parent.name,"span")&&L.parent.insert(P,L,"br"===L.name);break}if(e._selectionOverrides.showBlockCaretContainer(I),O.invalid){e.selection.setContent(d);var I=u.getNode(),M=e.getBody();for(9===I.nodeType?I=L=M:L=I;L!==M;)L=(I=L).parentNode;t=I===M?M.innerHTML:s.getOuterHTML(I),t=f.serialize(c.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return f.serialize(B)}))),I===M?s.setHTML(M,t):s.setOuterHTML(I,t)}else b=e,y=t=f.serialize(B),"all"===(C=I).getAttribute("data-mce-bogus")?C.parentNode.insertBefore(b.dom.createFragment(y),C):(x=C.firstChild,w=C.lastChild,!x||x===w&&"BR"===x.nodeName?b.dom.setHTML(C,y):b.selection.setContent(y));E=l,_=(S=e).schema.getTextInlineElements(),A=S.dom,E&&(k=S.getBody(),N=rm(A),Et.each(A.select("*[data-mce-fragment]"),function(e){if(V(_[e.nodeName.toLowerCase()])&&j(lm(A,e),function(e){return!cm.has(e)}))for(var t=e.parentNode;V(t)&&t!==k&&!function(r,o,i){function a(e){var t=r.getStyle(o,e),n=r.getStyle(i,e);return Be(t)&&Be(n)&&t!==n}var e=lm(r,o),u=lm(r,i);return F(e,function(t){function e(e){return F(e,function(e){return e===t})}if(e(u)||!e(Xg))return a(t);var n=U(u,function(t){return F(Xg,function(e){return Ge(t,e)})});return F(n,a)})}(A,e,t);t=t.parentNode)if(N.compare(t,e)){A.remove(e,!0);break}})),function(n,e){var t,r=n.dom,o=n.selection;if(e){o.scrollIntoView(e);var i=vf(n.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),o.select(i);var a,u=r.createRng(),s=e.previousSibling;jn(s)?(u.setStart(s,s.nodeValue.length),xt.ie||(a=e.nextSibling,jn(a)&&(s.appendData(a.data),a.parentNode.removeChild(a)))):(u.setStartBefore(e),u.setEndBefore(e));var c=r.getParent(e,r.isBlock);r.remove(e),c&&r.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),hp(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=ss.fromRangeStart(e);if(t=Ic(n.getBody()).next(t))return t.toRange()}(u))?r.add(c,r.create("br",{"data-mce-bogus":"1"})):(u=t,r.remove(c))),o.setRng(u)}}(e,s.get("mce_marker")),R=e.getBody(),Et.each(R.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),D=s,T=u.getStart(),ve.from(D.getParent(T,"td,th")).map(kt.fromDom).each(vm),e.fire("SetContent",m),e.addVisual()}}function _g(e){return e instanceof Hd}function Ag(e,t,n){var r;e.dom.setHTML(e.getBody(),t),!0!==n&&yd(r=e)&&nf(r.getBody()).each(function(e){var t=e.getNode(),n=cn(t)?nf(t).getOr(e):e;r.selection.setRng(n.toRange())})}function Rg(u,s,e){var t,n=(t=s,_e(_e({format:"html"},e),{set:!0,content:_g(t)?"":t})),c=e.no_events?n:u.fire("BeforeSetContent",n);return _g(s)||(s=c.content),ve.from(u.getBody()).fold(J(s),function(e){return _g(s)?function(e,t,n,r){var o,i,u,a;o=e.parser.getNodeFilters(),i=e.parser.getAttributeFilters(),u=n,a=function(e,n){var t,r,o={},i={},a=[];for(t in u.firstChild&&vp(u.firstChild,function(t){Y(e,function(e){e.name===t.name&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})}),Y(n,function(e){"string"==typeof t.attr(e.name)&&(i[e.name]?i[e.name].nodes.push(t):i[e.name]={filter:e,nodes:[t]})})}),o)ke(o,t)&&a.push(o[t]);for(r in i)ke(i,r)&&a.push(i[r]);return a}(o,i),Y(a,function(t){Y(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})});var s=im({validate:e.validate},e.schema).serialize(n);return r.content=yo(kt.fromDom(t))?s:Et.trim(s),Ag(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(i='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+i+"</li>"),r=(a=ks(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),a.toLowerCase())?(r=i,t.dom.createHTML(a,Ns(t),r)):r||'<br data-mce-bogus="1">',Ag(t,r,o.no_selection),t.fire("SetContent",o)):("raw"!==o.format&&(r=im({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=yo(kt.fromDom(n))?r:Et.trim(r),Ag(t,o.content,o.no_selection),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})}function Dg(e){return y(e)?e:D}function Tg(i,e,t){var n=e(i),a=Dg(t);return n.orThunk(function(){return a(i)?ve.none():function(e){for(var t=i.dom,n=Dg(a);t.parentNode;){var t=t.parentNode,r=kt.fromDom(t),o=e(r);if(o.isSome())return o;if(n(r))break}return ve.none()}(e)})}function Og(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(ml(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return 1}}function Bg(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,function(e){return!!Og(t,e,n)||e.parentNode===i||!!yp(t,e,n,r,!0)}),!!yp(t,e,n,r,o))}function Pg(e,t,n){return!!bp(t,n.inline)||!!bp(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)}function Lg(e,t,n,r,o,i){var a=n[r];if(y(n.onmatch))return n.onmatch(t,n,r);if(a)if(b(a.length)){for(var u in a)if(ke(a,u)){var s="attributes"===r?e.getAttrib(t,u):sl(e,t,u),c=il(a[u],i),l=K(s)||Pe(s);if(!l||!K(c)){if(o&&l&&!n.exact)return;if((!o||n.exact)&&!bp(s,ul(e,c,u)))return}}}else for(var f=0;f<a.length;f++)if("attributes"===r?e.getAttrib(t,a[f]):sl(e,t,a[f]))return 1;return 1}function Ig(e,t,n,r,o){if(r)return Bg(e,r,t,n,o);if(r=e.selection.getNode(),Bg(e,r,t,n,o))return!0;var i=e.selection.getStart();return!(i===r||!Bg(e,i,t,n,o))}function Mg(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==Cp||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length}function Fg(e){if(e){var t=new Rr(e,e);for(e=t.current();e;e=t.next())if(jn(e))return e}return null}function Ug(e){var t=kt.fromTag("span");return hn(t,{id:xp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Pn(t,kt.fromText(Cp)),t}function zg(e,t,n){void 0===n&&(n=!0);var r,o,i,a,u,s,c,l,f=e.dom,d=e.selection;Mg(t)?Qm(e,!1,kt.fromDom(t),n):(r=d.getRng(),o=f.getParent(t,f.isBlock),i=r.startContainer,a=r.startOffset,u=r.endContainer,s=r.endOffset,(l=Fg(t))&&l.nodeValue.charAt(0)===Cp&&l.deleteData(0,1),c=l,f.remove(t,!0),i===c&&0<a&&r.setStart(c,a-1),u===c&&0<s&&r.setEnd(c,s-1),o&&f.isEmpty(o)&&hm(kt.fromDom(o)),d.setRng(r))}function Hg(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)zg(e,t,n);else if(!(t=Vc(e.getBody(),o.getStart())))for(;t=r.get(xp);)zg(e,t,!1)}function jg(e,t){return e.appendChild(t),t}function Vg(e,t){var n=P(e,function(e,t){return jg(e,t.cloneNode(!1))},t);return jg(n,n.ownerDocument.createTextNode(Cp))}function qg(o,e,t,i,n,r){var a,u,s=o.formatter,c=o.dom,l=U(we(s.get()),function(e){return e!==i&&!Te(e,"removeformat")});if(0<U((a=o,u=t,L(l,function(e,t){var n=fl(a,t);return a.formatter.matchNode(u,t,{},n)?e.concat([t]):e},[])),function(e){return n=i,r=["inline","block","selector","attributes","styles","classes"],!F((t=o).formatter.get(e),function(e){var i=a(e);return F(t.formatter.get(n),function(e){var t,n=a(e),r=i,o=n;return d(t=void 0===t?p:t).eq(r,o)})});function a(e){return ae(e,function(e,t){return F(r,function(e){return e===t})})}var t,n,r}).length){var f=t.cloneNode(!1);return c.add(e,f),s.remove(i,n,f,r),c.remove(f),ve.some(f)}return ve.none()}function $g(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom,C=e.selection,x=[],w=C.getRng(),S=w.startContainer,E=w.startOffset,k=S;for(3===S.nodeType&&(E!==S.nodeValue.length&&(o=!0),k=k.parentNode);k;){if(yp(e,k,t,n,r)){i=k;break}k.nextSibling&&(o=!0),x.push(k),k=k.parentNode}i&&(o?(a=C.getBookmark(),w.collapse(!0),u=Bf(kl(e,w,e.formatter.get(t),!0)),e.formatter.remove(t,n,u,r),C.moveToBookmark(a)):(s=Vc(e.getBody(),i),d=c=Ug(!1).dom,(p=(g=e.dom).getParent(m=null!==s?s:i,R(rl,e)))&&g.isEmpty(p)?m.parentNode.replaceChild(d,m):(h=kt.fromDom(m),v=bu(h,"br"),b=U(function(){for(var e=[],t=h.dom;t;)e.push(kt.fromDom(t)),t=t.lastChild;return e}().slice(-1),Br),v.length===b.length&&Y(b,Ln),g.isEmpty(m)?m.parentNode.replaceChild(d,m):g.insertAfter(d,m)),l=qg(e,c,i,t,n,r),f=Vg(x.concat(l.toArray()),c),zg(e,s,!1),C.setCursorLocation(f,1),y.isEmpty(i)&&y.remove(i)))}function Wg(e,t){var n=e.schema.getTextInlineElements();return ke(n,Nt(t))&&!jc(t.dom)&&!sn(t.dom)}Y(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],function(e){cm.add(e)});var Kg,Xg=["font","text-decoration","text-emphasis"],Yg=R(fm,!0,Qc),Gg=R(fm,!1,Qc),Jg=mm(!0,gm),Qg=mm(!1,gm),Zg=mm(!0,Jn),ep=mm(!1,Jn),tp=mm(!0,cn),np=mm(!1,cn),rp=mm(!0,pm),op=mm(!1,pm),ip=R(Sm,!1),ap=R(Sm,!0),up=R(wm,!1),sp=R(wm,!0),cp=R(km,!1),lp=R(km,!0),fp=or([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),dp=function(e){var t;return(8===_t(t=e)||"#comment"===Nt(t)?Bt:Ut)(e).bind(dp).orThunk(function(){return ve.some(e)})},mp=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=dp(n).getOr(n),a=kt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Wr(a)&&(hm(a),r&&e.selection.setCursorLocation(a.dom,0)),je(n,a)||Y((fn(Ot(a),n)?[]:Ot(o=a).map(Dn).map(function(e){return U(e,function(e){return!je(o,e)})}).getOr([])).concat(Dn(n)),function(e){je(e,a)||Ve(e,a)||!Wr(e)||Ln(e)}),!0},gp=function(e,t){return M(ym(t,e),function(e){return Nn(e)&&"caption"===Nt(e)})},pp=function(e,t){return hm(t),e.selection.setCursorLocation(t.dom,0),ve.some(!0)},hp=Gn,vp=function(e,t){t(e),e.firstChild&&vp(e.firstChild,t),e.next&&vp(e.next,t)},bp=al,yp=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var s=i[u];if(Pg(e.dom,t,s)&&Lg(a,t,s,"attributes",o,r)&&Lg(a,t,s,"styles",o,r)){var c=s.classes;if(c)for(var l=0;l<c.length;l++)if(!e.dom.hasClass(t,il(c[l],r)))return;return s}}},Cp=wo,xp="_mce_caret",wp={},Sp=fe,Ep=ce;function kp(e){return zn(e)&&!Jc(e)&&!jc(e)&&!sn(e)}function Np(e,t){for(var n=e;n;n=n[t]){if(jn(n)&&Be(n.data))return e;if(zn(n)&&!Jc(n))return n}return e}function _p(e,t,n){var r=rm(e);if(t&&n&&(t=Np(t,"previousSibling"),n=Np(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o,o=o.nextSibling;t.appendChild(i)}return e.remove(n),Et.each(Et.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n}function Ap(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=_p(e,nl(r),r),_p(e,o,nl(o,!0)))}function Rp(t,n){return function(e){return!(!e||!sl(t,e,n))}}function Dp(r,o,i){return function(e){var t,n;r.setStyle(e,o,i),""===e.getAttribute("style")&&e.removeAttribute("style"),t=r,"SPAN"===(n=e).nodeName&&0===t.getAttribs(n).length&&t.remove(n,!0)}}function Tp(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)}function Op(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return zn(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r<i?r:i]),jn(o)&&n&&i>=o.nodeValue.length&&(o=new Rr(o,e.getBody()).next()||o),jn(o)&&!n&&0===i&&new Rr(o,e.getBody()).prev()||o}function Bp(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e}function Pp(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o}function Lp(e,t,n,r,o){var i=kt.fromDom(t),a=kt.fromDom(e.create(r,o));return Kt(a,(n?It:Lt)(i)),n?(qt(i,a),Wt(a,i)):($t(i,a),Pn(a,i)),a.dom}function Ip(e,t,n,r){var o=nl(t,n,r);return K(o)||"BR"===o.nodeName||e.isBlock(o)}function Mp(e,r,o,t,i){var n,a,u=e.dom,s=u,c=t;if(!(gl(a=r)&&Rh(c,a.inline)||dl(a)&&Rh(c,a.block)||ml(a)&&(zn(c)&&s.is(c,a.selector))||r.links&&"A"===t.nodeName))return Nh.keep();var l,f,d,m,g,p,h,v,b=t;if(gl(r)&&"all"===r.remove&&S(r.preserve_attributes)){var y=U(u.getAttribs(b),function(e){return T(r.preserve_attributes,e.name.toLowerCase())});if(u.removeAllAttribs(b),Y(y,function(e){return u.setAttrib(b,e.name,e.value)}),0<y.length)return Nh.rename("span")}if("all"!==r.remove){Ah(r.styles,function(e,t){e=ul(u,il(e,o),t+""),E(t)&&(t=e,i=null),!r.remove_similar&&i&&!Rh(sl(u,i,t),e)||u.setStyle(b,t,""),n=!0}),n&&""===u.getAttrib(b,"style")&&(b.removeAttribute("style"),b.removeAttribute("data-mce-style")),Ah(r.attributes,function(e,t){var n;if(e=il(e,o),E(t)&&(t=e,i=null),r.remove_similar||!i||Rh(u.getAttrib(i,t),e))if("class"===t&&(e=u.getAttrib(b,t))&&(n="",Y(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))u.setAttrib(b,t,n);else{if(_h.test(t)&&b.removeAttribute("data-mce-"+t),"style"===t&&on(["li"])(b)&&"none"===u.getStyle(b,"list-style-type"))return b.removeAttribute(t),void u.setStyle(b,"list-style-type","none");"class"===t&&b.removeAttribute("className"),b.removeAttribute(t)}}),Ah(r.classes,function(e){e=il(e,o),i&&!u.hasClass(i,e)||u.removeClass(b,e)});for(var C=u.getAttribs(b),x=0;x<C.length;x++){var w=C[x].nodeName;if(0!==w.indexOf("_")&&0!==w.indexOf("data-"))return Nh.keep()}}return"none"!==r.remove?(l=e,d=r,p=(f=b).parentNode,h=l.dom,v=ks(l),dl(d)&&(v?p===h.getRoot()&&(d.list_block&&Rh(f,d.list_block)||Y(xe(f.childNodes),function(e){ol(l,v,e.nodeName.toLowerCase())?m?m.appendChild(e):(m=Pp(h,e,v),h.setAttribs(m,l.settings.forced_root_block_attrs)):m=null})):h.isBlock(f)&&!h.isBlock(p)&&(Ip(h,f,!1)||Ip(h,f.firstChild,!0,!0)||f.insertBefore(h.create("br"),f.firstChild),Ip(h,f,!0)||Ip(h,f.lastChild,!1,!0)||f.appendChild(h.create("br")))),ml(g=d)&&gl(g)&&fn(ue(g,"mixed"),!0)&&!Rh(d.inline,f)||h.remove(f,!0),Nh.removed()):Nh.keep()}function Fp(t,e,n,r,o){return Mp(t,e,n,r,o).fold(D,function(e){return t.dom.rename(r,e),!0},w)}function Up(u,s,c,e,l){function a(e){var n,r,o,i,a,t=(r=s,o=c,i=l,Y(ll((n=u).dom,e.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=yp(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l=e.dom;if(n){for(var f=n.parentNode,d=r.parentNode;d&&d!==f;d=d.parentNode){for(var m=l.clone(d,!1),g=0;g<t.length&&null!==(m=function(t,e,n){return Mp(t,e,u,n,n).fold(J(n),function(e){return t.dom.createFragment().appendChild(n),t.dom.rename(n,e)},J(null))}(e,t[g],m));g++);m&&(s&&m.appendChild(s),c=c||m,s=m)}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),c.appendChild(o),gl(a)&&Ap(l,a,0,s))}return r}(u,m,t,e,e,!0,g,c)}function f(t){return F(m,function(e){return Fp(u,e,c,t,t)})}function d(e){var t,n=h.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return Jc(t=r)&&zn(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),jn(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),h.remove(n,!0),r}function t(e){var t=kl(u,e,m,e.collapsed);if(g.split){if(t=Bf(t),(r=Op(u,t,!0))!==(o=Op(u,t))){if(r=Bp(r,!0),o=Bp(o,!1),Tp(h,r,o)){var n=ve.from(r.firstChild).getOr(r);return a(Lp(h,n,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(Tp(h,o,r))return n=ve.from(o.lastChild).getOr(o),a(Lp(h,n,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);var r=Pp(h,r,"span",{id:"_start","data-mce-type":"bookmark"}),o=Pp(h,o,"span",{id:"_end","data-mce-type":"bookmark"}),i=h.createRng();i.setStartAfter(r),i.setEndBefore(o),Nl(h,i,function(e){Y(e,function(e){Jc(e)||Jc(e.parentNode)||a(e)})}),a(r),a(o),r=d(!0),o=d()}else r=o=a(r);t.startContainer=r.parentNode||r,t.startOffset=h.nodeIndex(r),t.endContainer=o.parentNode||o,t.endOffset=h.nodeIndex(o)+1}Nl(h,t,function(e){Y(e,v)})}var n,m=u.formatter.get(s),g=m[0],p=!0,h=u.dom,r=u.selection,v=function(t){var e=!0,n=!1;zn(t)&&h.getContentEditable(t)&&(e=p,p="true"===h.getContentEditable(t),n=!0);var r,o,i=xe(t.childNodes);if(p&&!n&&(r=f(t)||F(m,function(e){return Pg(h,t,e)}),o=t.parentNode,!r&&V(o)&&pl(g)&&f(o)),g.deep&&i.length){for(var a=0;a<i.length;a++)v(i[a]);n&&(p=e)}Y(["underline","line-through","overline"],function(e){zn(t)&&u.dom.getStyle(t,"text-decoration")===e&&t.parentNode&&cl(h,t.parentNode)===e&&Fp(u,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:e}},null,t)})};if(e)return el(e)?((n=h.createRng()).setStartBefore(e),n.setEndAfter(e),t(n)):t(e),void xf(u,s,e,c);if("false"!==h.getContentEditable(r.getNode()))r.isCollapsed()&&gl(g)&&!Rl(u).length?$g(u,s,c,l):(Ll(r,!0,function(){Pl(u,t)}),gl(g)&&Ig(u,s,c,r.getStart())&&tl(h,r,r.getRng()),u.nodeChanged()),xf(u,s,e,c);else{e=r.getNode();for(var o=0;o<m.length&&(!m[o].ceFalseOverride||!Fp(u,m[o],c,e,e));o++);xf(u,s,e,c)}}function zp(e){return zn(e)&&!Jc(e)&&!jc(e)&&!sn(e)}function Hp(e){return ke(e,"vars")}function jp(n,e,r,o,i){return I(e,function(e){var t=n.formatter.matchNode(e,r,null!=i?i:{},o);return!b(t)},function(e){return Og(n,e,r)||!o&&V(n.formatter.matchNode(e,r,i,!0))})}function Vp(e,t){var n=null!=t?t:Bh(e);return U(ll(e.dom,n),function(e){return zn(e)&&!sn(e)})}function qp(e,o,i,a,t,n){var r,u,s,c,l,f,d,m,g;return null===o.get()&&(u=e,(r=o).set({}),u.on("NodeChange",function(e){Ph(u,e.element,r.get())}),u.on("FormatApply FormatRemove",function(e){var t=ve.from(e.node).map(function(e){return el(e)?e:e.startContainer}).bind(function(e){return zn(e)?ve.some(e):ve.from(e.parentElement)}).getOrThunk(function(){return Bh(u)});Ph(u,t,r.get())})),s=e,l=i,f=a,d=t,m=n,g=(c=o).get(),Y(l.split(","),function(t){function e(){var e=Vp(s);return jp(s,e,t,d,m).isSome()}var n,r=ue(g,t).getOrThunk(function(){var e={withSimilar:{state:iu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:iu(!1),similar:!1,callbacks:[]},withVars:[]};return g[t]=e});b(m)?((n=d?r.withSimilar:r.withoutSimilar).callbacks.push(f),1===n.callbacks.length&&n.state.set(e())):r.withVars.push({state:iu(e()),similar:d,vars:m,callback:f})}),c.set(g),{unbind:function(){var e,t=i,n=a,r=(e=o).get();Y(t.split(","),function(t){return ue(r,t).each(function(e){r[t]={withSimilar:_e(_e({},e.withSimilar),{callbacks:U(e.withSimilar.callbacks,function(e){return e!==n})}),withoutSimilar:_e(_e({},e.withoutSimilar),{callbacks:U(e.withoutSimilar.callbacks,function(e){return e!==n})}),withVars:U(e.withVars,function(e){return e.callback!==n})}})}),e.set(r)}}}function $p(e,t){var n=(t||document).createDocumentFragment();return Y(e,function(e){n.appendChild(e.dom)}),kt.fromDom(n)}function Wp(e,t,n){return{element:e,width:t,rows:n}}function Kp(e,t){return{element:e,cells:t}}function Xp(e,t){var n=parseInt(vn(e,t),10);return isNaN(n)?1:n}function Yp(e){return L(e,function(e,t){return t.cells.length>e?t.cells.length:e},0)}function Gp(e,t){for(var n=e.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(je(o[i],t))return ve.some({x:i,y:r});return ve.none()}function Jp(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var s=a[u].cells,c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Kp(a[u].element,c))}return i}function Qp(e){var o=Wp(Eu(e),0,[]);return Y(bu(e,"tr"),function(n,r){Y(bu(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Xp(o,"rowspan"),a=Xp(o,"colspan"),u=e.rows,s=n;s<n+i;s++){u[s]||(u[s]=Kp(ku(r),[]));for(var c=t;c<t+a;c++)u[s].cells[c]=s===n&&c===t?o:Eu(o)}}(o,function(e,t,n){for(;r=t,((o=e.rows)[n]?o[n].cells:[])[r];)t++;var r,o;return t}(o,t,r),r,n,e)})}),Wp(o.element,Yp(o.rows),o.rows)}function Zp(e,t){var n,r,o,i=kt.fromDom(t.commonAncestorContainer),a=ym(i,e),u=U(a,function(e){return Or(e)||fo(e)}),s=(o=t,M(r=a,function(e){return"li"===Nt(e)&&Tl(e,o)}).fold(J([]),function(e){return M(r,function(e){return"ul"===Nt(e)||"ol"===Nt(e)}).map(function(e){var t=kt.fromTag(Nt(e));return Cn(t,ae(Sn(e),function(e,t){return Ge(t,"list-style")})),[kt.fromTag("li"),t]}).getOr([])}));return A(u.concat(s.length?s:ho(n=i)?Ot(n).filter(po).fold(J([]),function(e){return[n,e]}):po(n)?[n]:[]),Eu)}function eh(){return $p([])}function th(e,i){return hr(i[0],"table",R(je,e)).bind(function(e){var s,t,n=i[0],r=i[i.length-1],o=Qp(e);return t=r,Gp(s=o,n).bind(function(u){return Gp(s,t).map(function(e){return t=s,n=u.x,r=u.y,o=e.x,a=r<(i=e.y)?Jp(t,n,r,o,i):Jp(t,n,i,o,r),Wp(t.element,Yp(a),a);var t,n,r,o,i,a})}).map(function(e){return $p([(n=A((t=e).rows,function(e){var t=A(e.cells,function(e){var t=ku(e);return yn(t,"colspan"),yn(t,"rowspan"),t}),n=Eu(e.element);return Kt(n,t),n}),r=Eu(t.element),Kt(o=kt.fromTag("tbody"),n),Pn(r,o),r)]);var t,n,r,o})}).getOrThunk(eh)}function nh(e,t){var n,r,o,i,a,u,s,c=Al(t,e);return 0<c.length?th(e,c):(n=e,0<(r=t).length&&r[0].collapsed?eh():(o=n,i=r[0],a=kt.fromDom(i.cloneContents()),s=L(u=Zp(o,i),function(e,t){return Pn(t,e),t},a),0<u.length?$p([s]):s))}function rh(e,t){return 0<=t&&t<e.length&&Qc(e.charAt(t))}function oh(e,t){var n=Eo(e.innerText);return t?n.replace(/^[ \f\n\r\t\v]+/,""):n}function ih(e){return zn(e)?e.outerHTML:jn(e)?Qo.encodeRaw(e.data,!1):Vn(e)?"\x3c!--"+e.data+"--\x3e":""}function ah(e,c){var l=0;Y(e,function(e){var t,n,r,o,i,a,u,s;0===e[0]?l++:1===e[0]?(o=c,i=e[1],a=l,s=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(i),o.hasChildNodes()&&a<o.childNodes.length?(u=o.childNodes[a]).parentNode.insertBefore(s,u):o.appendChild(s),l++):2===e[0]&&(n=l,(t=c).hasChildNodes()&&n<t.childNodes.length&&(r=t.childNodes[n]).parentNode.removeChild(r))})}function uh(n){var e,t=H((e=n.getBody(),U(A(xe(e.childNodes),ih),function(e){return 0<e.length})),function(e){var t=nm(n.serializer,e);return 0<t.length?[t]:[]}),r=t.join("");return-1!==r.indexOf("</iframe>")?{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:r,bookmark:null,beforeBookmark:null}}function sh(e,t,n){var r,o,i,g,p,a,h,v,c,l,u,s=n?t.beforeBookmark:t.bookmark;function b(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}}"fragmented"===t.type?(r=t.fragments,o=e.getBody(),i=A(xe(o.childNodes),ih),ah((p=r,a=(g=i).length+p.length+2,h=new Array(a),v=new Array(a),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0==o||0==i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:1+d)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},u=[],c(0,g.length,0,p.length,u),u),o)):e.setContent(t.content,{format:"raw",no_selection:!V(s)||!qc(s)||!s.isFakeCaret}),e.selection.moveToBookmark(s)}function ch(e){return"fragmented"===e.type?e.fragments.join(""):e.content}function lh(e){var t=kt.fromTag("body",Lh());return wu(t,ch(e)),Y(bu(t,"*[data-mce-bogus]"),Yt),t.dom.innerHTML}function fh(e,t){return!(!e||!t)&&(r=t,ch(e)===ch(r)||(n=t,lh(e)===lh(n)));var n,r}function dh(e){return 0===e.get()}function mh(e,t,n){dh(n)&&(e.typing=t)}function gh(e,t){e.typing&&(mh(e,!1,t),e.add())}function ph(c){return{undoManager:{beforeChange:function(e,t){var n=c,r=t;dh(e)&&r.set(pc(n.selection))},add:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=uh(e);if(i=Et.extend(i=i||{},u),!1===dh(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&fh(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam("custom_undo_redo_levels",0,"number");if(c&&t.data.length>c){for(var l=0;l<t.data.length-1;l++)t.data[l]=t.data[l+1];t.data.length--,n.set(t.data.length)}i.bookmark=pc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var f={level:i,lastLevel:s,originalEvent:a};return 0<n.get()?(e.setDirty(!0),e.fire("AddUndo",f),e.fire("change",f)):e.fire("AddUndo",f),i}(c,e,t,n,r,o,i)},undo:function(e,t,n){return r=c,i=t,a=n,(o=e).typing&&(o.add(),o.typing=!1,mh(o,!1,i)),0<a.get()&&(a.set(a.get()-1),sh(r,u=o.data[a.get()],!0),r.setDirty(!0),r.fire("Undo",{level:u})),u;var r,o,i,a,u},redo:function(e,t){return n=c,o=t,(r=e).get()<o.length-1&&(r.set(r.get()+1),sh(n,i=o[r.get()],!1),n.setDirty(!0),n.fire("Redo",{level:i})),i;var n,r,o,i},clear:function(e,t){var n,r=c,o=t;(n=e).data=[],o.set(0),n.typing=!1,r.fire("ClearUndos")},reset:function(e){var t;(t=e).clear(),t.add()},hasUndo:function(e,t){return n=c,r=e,0<t.get()||r.typing&&r.data[0]&&!fh(uh(n),r.data[0]);var n,r},hasRedo:function(e,t){return n=e,t.get()<n.data.length-1&&!n.typing;var n},transact:function(e,t,n){return o=n,gh(r=e,t),r.beforeChange(),r.ignore(o),r.add();var r,o},ignore:function(e,t){try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}},extra:function(e,t,n,r){var o,i,a=c,u=t,s=r;(o=e).transact(n)&&(i=o.data[u.get()].bookmark,sh(a,o.data[u.get()-1],!0),o.transact(s)&&(o.data[u.get()-1].beforeBookmark=i))}},formatter:{match:function(e,t,n,r){return Ig(c,e,t,n,r)},matchAll:function(e,t){return o=e,i=t,a=[],u={},n=(r=c).selection.getStart(),r.dom.getParent(n,function(e){for(var t=0;t<o.length;t++){var n=o[t];!u[n]&&yp(r,e,n,i)&&(u[n]=!0,a.push(n))}},r.dom.getRoot()),a;var r,o,i,a,u,n},matchNode:function(e,t,n,r){return yp(c,e,t,n,r)},canApply:function(u){return function(e){var t=e.formatter.get(u),n=e.dom;if(t)for(var r=ll(n,e.selection.getStart()),o=t.length-1;0<=o;o--){var i=t[o];if(!ml(i)||V(i.defaultBlock))return!0;for(var a=r.length-1;0<=a;a--)if(n.is(r[a],i.selector))return!0}return!1}(c)},closest:function(e){return r=c,o=e,ve.from(r.selection.getStart(!0)).bind(function(e){return Tg(kt.fromDom(e),function(n){return ee(o,function(e){return yp(r,n.dom,t=e)?ve.some(t):ve.none();var t})},t)}).getOrNull();function t(e){return je(e,kt.fromDom(r.getBody()))}var r,o},apply:function(e,t,n){return Oh(c,e,t,n)},remove:function(e,t,n,r){return Up(c,e,t,n,r)},toggle:function(e,t,n){var r,o=e,i=t,a=n,u=(r=c).formatter.get(o);(!Ig(r,o,i,a)||"toggle"in u[0]&&!u[0].toggle?Oh:Up)(r,o,i,a)},formatChanged:function(e,t,n,r,o){return qp(c,e,t,n,r,o)}},editor:{getContent:function(e,t){return d=c,m=e,g=t,ve.from(d.getBody()).fold(J("tree"===m.format?new Hd("body",11):""),function(e){return t=d,r=e,o=g,c=_e(_e({},n=m),{format:o,get:!0,getInner:!0}),l=n.no_events?c:t.fire("BeforeGetContent",c),f="raw"===l.format?Et.trim(am(t.serializer,r.innerHTML)):"text"===l.format?t.dom.isEmpty(r)?"":Eo(r.innerText||r.textContent):"tree"===l.format?t.serializer.serialize(r,l):(a=(i=t).serializer.serialize(r,l),u=ks(i),s=new RegExp("^(<"+u+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+u+">[\r\n]*|<br \\/>[\r\n]*)$"),a.replace(s,"")),T(["text","tree"],l.format)||yo(kt.fromDom(r))?l.content=f:l.content=Et.trim(f),(l.no_events?l:t.fire("GetContent",l)).content;var t,n,r,o,i,a,u,s,c,l,f});var d,m,g},setContent:function(e,t){return Rg(c,e,t)},insertContent:function(e,t){return Ng(c,e,t)},addVisual:function(e){var i,t=e,a=(i=c).dom,n=V(t)?t:i.getBody();b(i.hasVisual)&&(i.hasVisual=i.getParam("visual",!0,"boolean")),Y(a.select("table,a",n),function(e){switch(e.nodeName){case"TABLE":var t=i.getParam("visual_table_class","mce-item-table","string"),n=a.getAttrib(e,"border");n&&"0"!==n||!i.hasVisual?a.removeClass(e,t):a.addClass(e,t);break;case"A":var r,o;a.getAttrib(e,"href")||(r=a.getAttrib(e,"name")||e.id,o=i.getParam("visual_anchor_class","mce-item-anchor","string"),r&&i.hasVisual?a.addClass(e,o):a.removeClass(e,o))}}),i.fire("VisualAid",{element:t,hasVisual:i.hasVisual})}},selection:{getContent:function(e,t){return function(e,t,n){var r,o=(r=t,_e(_e({},n=void 0===n?{}:n),{format:r,get:!0,selection:!0})),i=e.fire("BeforeGetContent",o);if(i.isDefaultPrevented())return e.fire("GetContent",i),i.content;if("text"===i.format)return m=e,ve.from(m.selection.getRng()).map(function(e){var t=ve.from(m.dom.getParent(e.commonAncestorContainer,m.dom.isBlock)),n=m.getBody(),r=t.map(function(e){return e.nodeName}).getOr("div").toLowerCase(),o=xt.browser.isIE()&&"pre"!==r,i=m.dom.add(n,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=oh(i,o),u=Eo(i.textContent);if(m.dom.remove(i),rh(u,0)||rh(u,u.length-1)){var s=oh(t.getOr(n),o),c=s.indexOf(a);return-1===c?a:(rh(s,c-1)?" ":"")+a+(rh(s,c+a.length)?" ":"")}return a}).getOr("");i.getInner=!0;var a,u,s,c,l,f,d,m,g=(u=i,s=(a=e).selection.getRng(),c=a.dom.create("body"),l=a.selection.getSel(),f=Ed(a,_l(l)),(d=u.contextual?nh(kt.fromDom(a.getBody()),f).dom:s.cloneContents())&&c.appendChild(d),a.selection.serializer.serialize(c,u));return"tree"===i.format?g:(i.content=e.selection.isCollapsed()?"":g,e.fire("GetContent",i),i.content)}(c,e,t)}},raw:{getModel:function(){return ve.none()}}}}function hh(e){return ke(e.plugins,"rtc")}function vh(e){var u=e;return ue(e.plugins,"rtc").bind(function(e){return ve.from(e.setup)}).fold(function(){return u.rtcInstance=ph(e),ve.none()},function(e){var t,n;return u.rtcInstance=(t=J(null),n=J(""),{undoManager:{beforeChange:te,add:t,undo:t,redo:t,clear:te,reset:te,hasUndo:D,hasRedo:D,transact:t,ignore:te,extra:te},formatter:{match:D,matchAll:J([]),matchNode:J(void 0),canApply:D,closest:n,apply:te,remove:te,toggle:te,formatChanged:J({unbind:te})},editor:{getContent:n,setContent:n,insertContent:te,addVisual:te},selection:{getContent:n},raw:{getModel:J(ve.none())}}),ve.some(function(){return e().then(function(e){return u.rtcInstance=(i=e.undoManager,a=e.formatter,n=e.editor,r=e.selection,t=e.raw,{undoManager:{beforeChange:i.beforeChange,add:i.add,undo:i.undo,redo:i.redo,clear:i.clear,reset:i.reset,hasUndo:i.hasUndo,hasRedo:i.hasRedo,transact:function(e,t,n){return i.transact(n)},ignore:function(e,t){return i.ignore(t)},extra:function(e,t,n,r){return i.extra(n,r)}},formatter:{match:function(e,t,n,r){return a.match(e,o(t),r)},matchAll:a.matchAll,matchNode:a.matchNode,canApply:function(e){return a.canApply(e)},closest:function(e){return a.closest(e)},apply:function(e,t,n){return a.apply(e,o(t))},remove:function(e,t,n,r){return a.remove(e,o(t))},toggle:function(e,t,n){return a.toggle(e,o(t))},formatChanged:function(e,t,n,r,o){return a.formatChanged(t,n,r,o)}},editor:{getContent:function(e,t){return n.getContent(e)},setContent:function(e,t){return n.setContent(e,t)},insertContent:function(e,t){return n.insertContent(e)},addVisual:n.addVisual},selection:{getContent:function(e,t){return r.getContent(t)}},raw:{getModel:function(){return ve.some(t.getRawModel())}}}),e.rtc.isRemote;function o(e){return h(e)?e:{}}var i,a,n,r,t})})})}function bh(e){return e.rtcInstance||ph(e)}function yh(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")}function Ch(e){return 0===e.dom.length?(Ln(e),ve.none()):ve.some(e)}function xh(e,t,u,s){e.bind(function(a){return(s?jm:Hm)(a.dom,s?a.dom.length:0),t.filter(_n).map(function(e){var t=u,n=s,r=a.dom,o=e.dom,i=(n?r:o).length;n?(Vm(r,o,!1,!n),t.setStart(o,i)):(Vm(o,r,!1,!n),t.setEnd(o,i))})}).orThunk(function(){var e=s;return t.filter(function(e){return zl.isBookmarkNode(e.dom)}).bind(e?Pt:Bt).or(t).filter(_n).map(function(e){var n,r=s;Ot(n=e).each(function(e){var t=n.dom;r&&Bm(e,ss(t,0))?Hm(t,0):!r&&Pm(e,ss(t,t.length))&&jm(t,t.length)})})})}function wh(e,t,n){var r,o=(r=t,_e(_e({format:"html"},n=void 0===n?{}:n),{set:!0,selection:!0,content:r})),i=o;if(!o.no_events){var a=e.fire("BeforeSetContent",o);if(a.isDefaultPrevented())return void e.fire("SetContent",a);i=a}i.content=function(e,t){if("raw"===t.format)return t.content;var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,_e(_e({isRootContent:!0,forced_root_block:!1},o),t));return im({validate:e.validate},e.schema).serialize(i)}(e,i);var u=e.selection.getRng();!function(e,t){var n=ve.from(t.firstChild).map(kt.fromDom),r=ve.from(t.lastChild).map(kt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Bt).filter(_n).bind(Ch),i=r.bind(Pt).filter(_n).bind(Ch);xh(o,n,e,!0),xh(i,r,e,!1),e.collapse(!1)}(u,u.createContextualFragment(i.content)),e.selection.setRng(u),td(e,u),i.no_events||e.fire("SetContent",i)}function Sh(e,t,n){var r;e&&ke(e,t)&&(0===(r=U(e[t],function(e){return e!==n})).length?delete e[t]:e[t]=r)}Kg=function(e){var t,n=e.selection.getRng(),r=on(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Ep(Sp(Sp(t,r),function(e){return r(e.previousSibling)&&-1!==de(t,e.previousSibling)}),function(e){var t,n=e.previousSibling;Xa(t=e).remove(),Xa(n).append("<br><br>").append(t.childNodes)}))},wp["pre"]||(wp.pre=[]),wp.pre.push(Kg);var Eh=Et.each,kh=function(e,t,n){Eh(e.childNodes,function(e){kp(e)&&(t(e)&&n(e),e.hasChildNodes()&&kh(e,t,n))})},Nh=or([{keep:[]},{rename:["name"]},{removed:[]}]),_h=/^(src|href|style)$/,Ah=Et.each,Rh=al,Dh=Et.each,Th=Et.each,Oh=function(S,E,k,r){function N(n,e){var t;y((e=void 0===e?A:e).onformat)&&e.onformat(n,e,k,r),Th(e.styles,function(e,t){u.setStyle(n,t,il(e,k))}),!e.styles||(t=u.getAttrib(n,"style"))&&u.setAttrib(n,"data-mce-style",t),Th(e.attributes,function(e,t){u.setAttrib(n,t,il(e,k))}),Th(e.classes,function(e){e=il(e,k),u.hasClass(n,e)||u.addClass(n,e)})}function g(e,t){var n=!1;return Th(e,function(e){return!!ml(e)&&(V(e.collapsed)&&e.collapsed!==a||!u.is(t,e.selector)||jc(t)?void 0:(N(t,e),!(n=!0)))}),n}function o(x,e,l){var w=[],f=!0,d=A.inline||A.block,m=function(e){if(X(e)){var t=u.create(e);return N(t),t}return null}(d);Nl(x,e,function(e){var s,c=function(e){var t=!1,n=f,r=e.nodeName.toLowerCase(),o=e.parentNode,i=o.nodeName.toLowerCase();if(zn(e)&&x.getContentEditable(e)&&(n=f,f="true"===x.getContentEditable(e),t=!0),Wn(e)&&!function(e,t,n,r){if(e.getParam("format_empty_lines",!1,"boolean")&&gl(t)){var o=to(e.schema),i=(a=kt.fromDom(n),s=function(e){return jc(e.dom)},((c=(u=a).dom).parentNode?kr(kt.fromDom(c.parentNode),function(e){return!je(u,e)&&s(e)}):ve.none()).isSome());return se(o,r)&&Wr(kt.fromDom(n.parentNode),!1)&&!i}var a,u,s,c}(S,A,e,i))return s=null,void(dl(A)&&x.remove(e));if(dl(A)&&A.wrapper&&yp(S,e,E,k))s=null;else{if(f&&!t&&dl(A)&&!A.wrapper&&rl(S,r)&&ol(S,i,d)){var a=x.rename(e,d);return N(a),w.push(a),void(s=null)}if(ml(A)){var u=g(_,e);if(!u&&V(o)&&pl(A)&&(u=g(_,o)),!gl(A)||u)return void(s=null)}!f||t||!ol(S,d,r)||!ol(S,i,d)||!l&&jn(e)&&So(e.data)||jc(e)||gl(A)&&x.isBlock(e)?(s=null,Y(xe(e.childNodes),c),t&&(f=n),s=null):(s||(s=x.clone(m,!1),e.parentNode.insertBefore(s,e),w.push(s)),s.appendChild(e))}};Y(e,c)}),!0===A.links&&Y(w,function(e){var t=function(e){"A"===e.nodeName&&N(e,A),Y(xe(e.childNodes),t)};t(e)}),Y(w,function(e){var n,t,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=(n=0,Y(e.childNodes,function(e){var t;V(t=e)&&jn(t)&&0===t.length||Jc(e)||n++}),n);function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=cl(m,e.parentNode),m.getStyle(e,"color")&&t?m.setStyle(e,"text-decoration",t):m.getStyle(e,"text-decoration")===t&&m.setStyle(e,"text-decoration",null))}!(1<w.length)&&x.isBlock(e)||0!==y?(gl(A)||dl(A)&&A.wrapper)&&(A.exact||1!==y||(e=M((d=e).childNodes,zp).filter(function(e){return Pg(x,e,A)}).map(function(e){var t=x.clone(e,!1);return N(t),x.replace(t,d,!0),x.remove(e,!0),t}).getOr(d)),h=S,v=k,b=e,Dh(_,function(t){var r,e,n;gl(t)&&Dh(h.dom.select(t.inline,b),function(e){kp(e)&&Fp(h,t,v,e,t.exact?e:null)}),r=h.dom,(e=t).clear_child_styles&&(n=e.links?"*:not(a)":"*",Eh(r.select(n,b),function(n){kp(n)&&Eh(e.styles,function(e,t){r.setStyle(n,t,"")})}))}),s=A,yp(u=S,(f=e).parentNode,c=E,l=k)&&Fp(u,s,l,f)||s.merge_with_parents&&u.dom.getParent(f.parentNode,function(e){if(yp(u,e,c,l))return Fp(u,s,l,f),!0}),a=e,(i=A).styles&&i.styles.backgroundColor&&kh(a,Rp(x,"fontSize"),Dp(x,"backgroundColor",il(i.styles.backgroundColor,k))),m=x,p=e,(g=A).styles&&(g.styles.color||g.styles.textDecoration)&&(Et.walk(p,C,"childNodes"),C(p)),t=x,o=e,!gl(r=A)||"sub"!==r.inline&&"sup"!==r.inline||(kh(o,Rp(t,"fontSize"),Dp(t,"fontSize","")),t.remove(t.select("sup"===r.inline?"sub":"sup",o),!0)),Ap(x,A,0,e)):x.remove(e,!0)})}var e,t,n,i,_=S.formatter.get(E),A=_[0],a=!r&&S.selection.isCollapsed(),u=S.dom,s=S.selection;if("false"!==u.getContentEditable(s.getNode()))A&&(r?el(r)?g(_,r)||((e=u.createRng()).setStartBefore(r),e.setEndAfter(r),o(u,kl(S,e,_),!0)):o(u,r,!0):a&&gl(A)&&!Rl(S).length?function(e,t,n){var r,o=e.selection,i=o.getRng(),a=i.startOffset,u=i.startContainer.nodeValue,s=Vc(e.getBody(),o.getStart());s&&(r=Fg(s));var c,l,f,d,m=/[^\s\u00a0\u00ad\u200b\ufeff]/;u&&0<a&&a<u.length&&m.test(u.charAt(a))&&m.test(u.charAt(a-1))?(c=o.getBookmark(),i.collapse(!0),l=Bf(kl(e,i,e.formatter.get(t))),e.formatter.apply(t,n,l),o.moveToBookmark(c)):(s&&r.nodeValue===Cp||(f=e.getDoc(),d=Ug(!0).dom,r=(s=f.importNode(d,!0)).firstChild,i.insertNode(s),a=1),e.formatter.apply(t,n,s),o.setCursorLocation(r,a))}(S,E,k):(t=s.getNode(),n=_[0],S.settings.forced_root_block||!n.defaultBlock||u.getParent(t,u.isBlock)||Oh(S,n.defaultBlock),s.setRng(Cg(s.getRng())),Ll(s,!0,function(){Pl(S,function(e,t){var n=t?e:kl(S,e,_);o(u,n,!1)})}),tl(u,s,s.getRng()),S.nodeChanged()),i=S,Ep(wp[E],function(e){e(i)})),Cf(S,E,r,k);else{r=s.getNode();for(var c=0,l=_.length;c<l;c++){var f=_[c];if(f.ceFalseOverride&&ml(f)&&u.is(r,f.selector)){N(r,f);break}}Cf(S,E,r,k)}},Bh=function(e){return e.selection.getStart()},Ph=function(i,a,e){var u=Vp(i,a);ne(e,function(e,o){function t(e){var t,n=jp(i,u,o,e.similar,Hp(e)?e.vars:void 0),r=n.isSome();e.state.get()!==r&&(e.state.set(r),t=n.getOr(a),Hp(e)?e.callback(r,{node:t,format:o,parents:u}):Y(e.callbacks,function(e){return e(r,{node:t,format:o,parents:u})}))}Y([e.withSimilar,e.withoutSimilar],t),Y(e.withVars,t)})},Lh=Re(function(){return document.implementation.createHTMLDocument("undo")});function Ih(e){return e.select}function Mh(e){return e&&e.ownerDocument&&Ve(kt.fromDom(e.ownerDocument),kt.fromDom(e))}function Fh(a,u,e,s){function t(e,t){return wh(s,e,t)}function n(){var e=c(),t=null==e?void 0:e.anchorNode,n=null==e?void 0:e.focusNode;if(!e||!t||!n||rn(t)||rn(n))return!0;var r=a.createRng();r.setStart(t,e.anchorOffset),r.collapse(!0);var o=a.createRng();return o.setStart(n,e.focusOffset),o.collapse(!0),r.compareBoundaryPoints(r.START_TO_START,o)<=0}function r(e){var t=p();t.collapse(!!e),h(t)}function c(){return u.getSelection?u.getSelection():u.document.selection}var l,f,o,i,d,m,g=function(e,t){return d||(d={},m={},i.on("NodeChange",function(e){var n=e.element,r=x(n),o={};Et.each(d,function(e,n){C(n,r).each(function(t){m[n]||(Y(e,function(e){e(!0,{node:t,selector:n,parents:r})}),m[n]=e),o[n]=e})}),Et.each(m,function(e,t){o[t]||(delete m[t],Et.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),d[e]||(d[e]=[]),d[e].push(t),C(e,x(i.selection.getStart())).each(function(){m[e]=d[e]}),{unbind:function(){Sh(d,e,t),Sh(m,e,t)}}},p=function(){function e(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return-1}}var t,n,r,o=u.document;if(void 0!==s.bookmark&&!1===yd(s)){var i=dd(s);if(i.isSome())return i.map(function(e){return Ed(s,[e])[0]}).getOr(o.createRange())}try{(t=c())&&!rn(t.anchorNode)&&(n=0<t.rangeCount?t.getRangeAt(0):(t.createRange?t:o).createRange(),n=Ed(s,[n])[0])}catch(e){}return(n=n||(o.createRange?o.createRange():o.body.createTextRange())).setStart&&9===n.startContainer.nodeType&&n.collapsed&&(r=a.getRoot(),n.setStart(r,0),n.setEnd(r,0)),l&&f&&(0===e(n.START_TO_START,n,l)&&0===e(n.END_TO_END,n,l)?n=f:f=l=null),n},h=function(e,t){var n;if((r=e)&&(Ih(r)||Mh(r.startContainer)&&Mh(r.endContainer))){var r,o=Ih(e)?e:null;if(o){f=null;try{o.select()}catch(e){}}else{var i=c();if(e=s.fire("SetSelectionRange",{range:e,forward:t}).range,i){f=e;try{i.removeAllRanges(),i.addRange(e)}catch(e){}!1===t&&i.extend&&(i.collapse(e.endContainer,e.endOffset),i.extend(e.startContainer,e.startOffset)),l=0<i.rangeCount?i.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!i.setBaseAndExtent||xt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(i.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),i.anchorNode===e.startContainer&&i.focusNode===e.endContainer||i.setBaseAndExtent(n,0,n,1)),s.fire("AfterSetSelectionRange",{range:e,forward:t})}}},v={bookmarkManager:null,controlSelection:null,dom:o=a,win:u,serializer:e,editor:i=s,collapse:r,setCursorLocation:function(e,t){var n=a.createRng();V(e)&&V(t)?(n.setStart(e,t),n.setEnd(e,t),h(n),r(!1)):(Ol(a,n,s.getBody(),!0),h(n))},getContent:function(e){return n=(t=void 0===(t=e)?{}:t).format||"html",r=t,yh(s).selection.getContent(n,r);var t,n,r},setContent:t,getBookmark:function(e,t){return b.getBookmark(e,t)},moveToBookmark:function(e){return b.moveToBookmark(e)},select:function(e,t){var r=a,o=t;return ve.from(e).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Ol(r,n,e,!0),Ol(r,n,e,!1)),n}).each(h),e},isCollapsed:function(){var e=p(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:n,setNode:function(e){return t(a.getOuterHTML(e)),e},getNode:function(){return function(e,t){if(!t)return e;var n=t.startContainer,r=t.endContainer,o=t.startOffset,i=t.endOffset,a=t.commonAncestorContainer;return!t.collapsed&&(n===r&&i-o<2&&n.hasChildNodes()&&(a=n.childNodes[o]),3===n.nodeType&&3===r.nodeType&&(n=n.length===o?Sd(n.nextSibling,!0):n.parentNode,r=0===i?Sd(r.previousSibling,!1):r.parentNode,n&&n===r))?n:a&&3===a.nodeType?a.parentNode:a}(s.getBody(),p())},getSel:c,setRng:h,getRng:p,getStart:function(e){return xd(s.getBody(),p(),e)},getEnd:function(e){return wd(s.getBody(),p(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o=[],i=e.getRoot();if(n=e.getParent(n||xd(i,t,t.collapsed),e.isBlock),r=e.getParent(r||wd(i,t,t.collapsed),e.isBlock),n&&n!==i&&o.push(n),n&&r&&n!==r)for(var a,u=new Rr(n,i);(a=u.next())&&a!==r;)e.isBlock(a)&&o.push(a);return r&&n!==r&&r!==i&&o.push(r),o}(a,p(),e,t)},normalize:function(){var e=p();if(1<_l(c()).length||!Bl(s))return e;var t=Tf(a,e);return t.each(function(e){h(e,n())}),t.getOr(e)},selectorChanged:function(e,t){return g(e,t),v},selectorChangedWithUnbind:g,getScrollContainer:function(){for(var e,t=a.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){V(e)?(s.inline?Qf:ed)(s,e,t):td(s,p(),t)},placeCaretAt:function(e,t){return h(Ef(e,t,s.getDoc()))},getBoundingClientRect:function(){var e=p();return e.collapsed?ss.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){u=l=f=null,y.destroy()}},b=zl(v),y=wf(v,s);function C(t,e){return M(e,function(e){return o.is(e,t)})}function x(e){return o.getParents(e,null,o.getRoot())}return v.bookmarkManager=b,v.controlSelection=y,v}function Uh(e,t){var n,r,a,u,o=io();t.convert_fonts_to_spans&&(r=e,a=o,u=Et.explode(t.font_size_legacy_values),r.addNodeFilter("font",function(e){Y(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,Y(["color","face","size"],function(e){t.attr(e,null)})})})),n=o,e.addNodeFilter("strike",function(e){Y(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})}function zh(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}}function Hh(e,t){var n;try{n=atob(t)}catch(e){return ve.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return ve.some(new Blob([r],{type:e}))}function jh(e){return 0===e.indexOf("blob:")?(o=e,new Nr(function(e,t){function n(){t("Cannot convert "+o+" to Blob. Resource might not exist or is inaccessible.")}try{var r=new XMLHttpRequest;r.open("GET",o,!0),r.responseType="blob",r.onload=function(){200===r.status?e(r.response):n()},r.onerror=n,r.send()}catch(e){n()}})):0===e.indexOf("data:")?(n=e,new Nr(function(e){var t=zh(n);Hh(t.type,t.data).fold(function(){return e(new Blob([]))},e)})):null;var o,n}function Vh(e){return(e||"blobid")+mv++}function qh(r,d){var o={};return{findAll:function(e,n){n=n||w;var t=A(U(e?xe(e.getElementsByTagName("img")):[],function(e){var t=e.src;return xt.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&t&&t!==xt.transparentSrc&&(0===t.indexOf("blob:")?!r.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))}),function(f){if(void 0!==o[f.src])return new Nr(function(t){o[f.src].then(function(e){return"string"==typeof e?e:void t({image:f,blobInfo:e.blobInfo})})});var e=new Nr(function(e,t){var r,o,i,n,a,u,s,c,l;r=d,i=e,n=t,0!==(o=f).src.indexOf("blob:")?(u=(a=zh(o.src)).data,s=a.type,c=u,(l=r.getByData(c,s))?i({image:o,blobInfo:l}):jh(o.src).then(function(e){l=r.create(Vh(),e,c),r.add(l),i({image:o,blobInfo:l})},function(e){n(e)})):(l=r.getByUri(o.src))?i({image:o,blobInfo:l}):jh(o.src).then(function(t){var n=t;new Nr(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){c=zh(e).data,l=r.create(Vh(),t,c),r.add(l),i({image:o,blobInfo:l})})},function(e){n(e)})}).then(function(e){return delete o[e.image.src],e}).catch(function(e){return delete o[f.src],e});return o[f.src]=e});return Nr.all(t)}}}function $h(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Hd("br",1)).shortEnded=!0:r.empty().append(new Hd("#text",3)).value=xo}function Wh(n,e,t,r){return r.isEmpty(e,t,function(e){return(t=n.getElementRule(e.name))&&t.paddEmpty;var t})}function Kh(e,p){var t,o,i,h=e.schema;function n(t){var e,n,r=t.attr("src");(e=t).attr("src")===xt.transparentSrc||V(e.attr("data-mce-placeholder"))||V(t.attr("data-mce-bogus"))||((n=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(r))?ve.some({type:n[1],data:decodeURIComponent(n[2])}):ve.none()).filter(function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),ne(e.attributes.map,function(e,t){n.setAttribute(t,e)}),t.images_dataimg_filter(n)}return!0}(t,o)}).bind(function(e){var t=e.type,n=e.data;return ve.from(i.getByData(n,t)).orThunk(function(){return Hh(t,n).map(function(e){var t=i.create(Vh(),e,n);return i.add(t),t})})}).each(function(e){t.attr("src",e.blobUri())})}p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Et.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getWhiteSpaceElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){"br"===s&&(o=null);break}u=u.prev}o&&(o.remove(),Wh(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&$h(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new Hd("#text",3)).value=xo,o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r=e.length;if(!p.allow_unsafe_link_target)for(;r--;){var o=e[r];"a"===o.name&&"_blank"===o.attr("target")&&o.attr("rel",(n=void 0,n=(t=o.attr("rel"))?Et.trim(t):"",/\b(noopener)\b/g.test(n)?n:n.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r,o=e.length;o--;)"ul"!==(r=(n=e[o]).parent).name&&"ol"!==r.name||(n.prev&&"li"===n.prev.name?n.prev.append(n):((t=new Hd("li",1)).attr("style","list-style-type: none"),n.wrap(t)))}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t=h.getValidClasses(),n=e.length;n--;){for(var r=e[n],o=r.attr("class").split(" "),i="",a=0;a<o.length;a++){var u=o[a],s=!1,c=t["*"];c&&c[u]&&(s=!0),c=t[r.name],(s=!(s||!c||!c[u])||s)&&(i&&(i+=" "),i+=u)}i.length||(i=null),r.attr("class",i)}}),t=e,(i=(o=p).blob_cache)&&t.addAttributeFilter("src",function(e){return Y(e,n)})}function Xh(A,R){void 0===R&&(R=ro());var D={},T=[],O={},B={};(A=A||{}).validate=!("validate"in A)||A.validate,A.root_name=A.root_name||"body";function P(e){var t=e.name;t in D&&((r=O[t])?r.push(e):O[t]=[e]);for(var n=T.length;n--;){var r,o=T[n].name;o in e.attributes.map&&((r=B[o])?r.push(e):B[o]=[e])}return e}var e={schema:R,addAttributeFilter:function(e,n){hv(vv(e),function(e){for(var t=0;t<T.length;t++)if(T[t].name===e)return void T[t].callbacks.push(n);T.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(T)},addNodeFilter:function(e,n){hv(vv(e),function(e){var t=D[e];t||(D[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e,t=[];for(e in D)ke(D,e)&&t.push({name:e,callbacks:D[e]});return t},filterNode:P,parse:function(e,s){var t,n,r,o,i,c,a,l,f=[];function d(e){for(var t=R.getBlockElements(),n=e.prev;n&&3===n.type;){var r=n.value.replace(w,"");if(0<r.length)return n.value=r,0;var o=n.next;if(o){if(3===o.type&&o.value.length){n=n.prev;continue}if(!t[o.name]&&"script"!==o.name&&"style"!==o.name){n=n.prev;continue}}var i=n.prev;n.remove(),n=i}}s=s||{},O={},B={};function m(e,t){var n,r=new Hd(e,t);return e in D&&((n=O[e])?n.push(r):O[e]=[r]),r}var g=bv(pv("script,style,head,html,body,title,meta,param"),R.getBlockElements()),p=to(R),h=R.getNonEmptyElements(),v=R.children,b=A.validate,u=("forced_root_block"in s?s:A).forced_root_block,y=!1===u?"":!0===u?"p":u,C=R.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,w=/[ \t\r\n]+$/,S=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/,k=ke(C,s.context)||ke(C,A.root_name),N=Qd({validate:b,document:A.document,allow_html_data_urls:A.allow_html_data_urls,allow_svg_data_urls:A.allow_svg_data_urls,allow_script_urls:A.allow_script_urls,allow_conditional_comments:A.allow_conditional_comments,preserve_cdata:A.preserve_cdata,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(R.getSelfClosingElements()),cdata:function(e){l.append(m("#cdata",4)).value=e},text:function(e,t){var n,r;k||(e=e.replace(S," "),(r=l.lastChild)&&(ke(g,r.name)||"br"===r.name)&&(e=e.replace(x,""))),0!==e.length&&((n=m("#text",3)).raw=!!t,l.append(n).value=e)},comment:function(e){l.append(m("#comment",8)).value=e},pi:function(e,t){l.append(m(e,7)).value=t,d(l)},doctype:function(e){l.append(m("#doctype",10)).value=e,d(l)},start:function(e,t,n){var r=b?R.getElementRule(e):{};if(r){var o=m(r.outputName||e,1);o.attributes=t,o.shortEnded=n,l.append(o);var i=v[l.name];i&&v[o.name]&&!i[o.name]&&f.push(o);for(var a=T.length;a--;){var u=T[a].name;u in t.map&&((c=B[u])?c.push(o):B[u]=[o])}g[e]&&d(o),n||(l=o),!k&&C[e]&&(k=!0)}},end:function(e){var t,n,r,o,i=b?R.getElementRule(e):{};if(i){if(g[e]&&!k){if((t=l.firstChild)&&3===t.type)if(0<(n=t.value.replace(x,"")).length)t.value=n,t=t.next;else for(r=t.next,t.remove(),t=r;t&&3===t.type;)n=t.value,r=t.next,0!==n.length&&!E.test(n)||(t.remove(),t=r),t=r;if((t=l.lastChild)&&3===t.type)if(0<(n=t.value.replace(w,"")).length)t.value=n,t=t.prev;else for(r=t.prev,t.remove(),t=r;t&&3===t.type;)n=t.value,r=t.prev,0!==n.length&&!E.test(n)||(t.remove(),t=r),t=r}k&&C[e]&&(k=!1);var a=Wh(R,h,C,l),u=l.parent;i.paddInEmptyBlock&&a&&function(){for(var e=l;V(e);){if(e.name in p)return Wh(R,h,C,e);e=e.parent}}()?$h(A,s,g,l):i.removeEmpty&&a?g[l.name]?l.empty().remove():l.unwrap():i.paddEmpty&&(gv(o=l,"#text")&&o.firstChild.value===xo||a)&&$h(A,s,g,l),l=u}}},R),_=l=new Hd(s.context||A.root_name,11);if(N.parse(e,s.format),b&&f.length&&(s.context?s.invalid=!0:function(e){for(var t=pv("tr,td,th,tbody,thead,tfoot,table"),n=R.getNonEmptyElements(),r=R.getWhiteSpaceElements(),o=R.getTextBlockElements(),i=R.getSpecialElements(),a=function(e,t){if(void 0===t&&(t=e.parent),i[e.name])e.empty().remove();else{for(var n=0,r=e.children();n<r.length;n++){var o=r[n];R.isValidChild(t.name,o.name)||a(o,t)}e.unwrap()}},u=0;u<e.length;u++){var s,c=e[u],l=void 0,f=void 0;if(c.parent&&!c.fixed)if(o[c.name]&&"li"===c.parent.name){for(var d=c.next;d&&o[d.name];)d.name="li",d.fixed=!0,c.parent.insert(d,c.parent),d=d.next;c.unwrap()}else{for(var m=[c],l=c.parent;l&&!R.isValidChild(l.name,c.name)&&!t[l.name];l=l.parent)m.push(l);if(l&&1<m.length)if(R.isValidChild(l.name,c.name)){m.reverse();for(var g=s=P(m[0].clone()),p=0;p<m.length-1;p++){R.isValidChild(g.name,m[p].name)?(f=P(m[p].clone()),g.append(f)):f=g;for(var h=m[p].firstChild;h&&h!==m[p+1];){var v=h.next;f.append(h),h=v}g=f}Wh(R,n,r,s)?l.insert(c,m[0],!0):(l.insert(s,m[0],!0),l.insert(c,s)),l=m[0],(Wh(R,n,r,l)||gv(l,"br"))&&l.empty().remove()}else a(c);else c.parent&&("li"!==c.name?R.isValidChild(c.parent.name,"div")&&R.isValidChild("div",c.name)?c.wrap(P(new Hd("div",1))):a(c):!(d=c.prev)||"ul"!==d.name&&"ol"!==d.name?!(d=c.next)||"ul"!==d.name&&"ol"!==d.name?c.wrap(P(new Hd("ul",1))):d.insert(c,d.firstChild,!0):d.append(c))}}}(f)),y&&("body"===_.name||s.isRootContent)&&function(){function e(e){e&&((t=e.firstChild)&&3===t.type&&(t.value=t.value.replace(x,"")),(t=e.lastChild)&&3===t.type&&(t.value=t.value.replace(w,"")))}var t=_.firstChild,n=null;if(R.isValidChild(_.name,y.toLowerCase())){for(;t;){var r=t.next;3===t.type||1===t.type&&"p"!==t.name&&!g[t.name]&&!t.attr("data-mce-type")?(n||((n=m(y,1)).attr(A.forced_root_block_attrs),_.insert(n,t)),n.append(t)):(e(n),n=null),t=r}e(n)}}(),!s.invalid){for(a in O)if(ke(O,a)){for(c=D[a],o=(t=O[a]).length;o--;)t[o].parent||t.splice(o,1);for(n=0,r=c.length;n<r;n++)c[n](t,a,s)}for(n=0,r=T.length;n<r;n++)if((c=T[n]).name in B){for(o=(t=B[c.name]).length;o--;)t[o].parent||t.splice(o,1);for(o=0,i=c.callbacks.length;o<i;o++)c.callbacks[o](t,c.name,s)}}return _}};return Kh(e,A),A.inline_styles&&Uh(e,A),e}function Yh(e,t,n){-1===Et.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))}function Gh(L,I){var e=["data-mce-selected"],M=I&&I.dom?I.dom:Za.DOM,F=I&&I.schema?I.schema:ro(L);L.entity_encoding=L.entity_encoding||"named",L.remove_trailing_brs=!("remove_trailing_brs"in L)||L.remove_trailing_brs;var t,U=Xh(L,F),s=L,c=M;return(t=U).addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null)}}),t.addAttributeFilter("src,href,style",function(e,t){for(var n="data-mce-"+t,r=s.url_converter,o=s.url_converter_scope,i=e.length;i--;){var a=e[i],u=a.attr(n);void 0!==u?(a.attr(t,0<u.length?u:null),a.attr(n,null)):(u=a.attr(t),"style"===t?u=c.serializeStyle(c.parseStyle(u),a.name):r&&(u=r.call(o,u,t,a.name)),a.attr(t,0<u.length?u:null))}}),t.addAttributeFilter("class",function(e){for(var t=e.length;t--;){var n,r=e[t];r.attr("class")&&(n=r.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),r.attr("class",0<n.length?n:null))}}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length;r--;){var o=e[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(ve.from(o.firstChild).exists(function(e){return!So(e.value)})?o.unwrap():o.remove())}}),t.addNodeFilter("noscript",function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=Qo.decode(n.value))}}),t.addNodeFilter("script,style",function(e,t){for(var n=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},r=e.length;r--;){var o,i=e[r],a=i.firstChild?i.firstChild.value:"";"script"===t?((o=i.attr("type"))&&i.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<a.length&&(i.firstChild.value="// <![CDATA[\n"+n(a)+"\n// ]]>")):"xhtml"===s.element_format&&0<a.length&&(i.firstChild.value="\x3c!--\n"+n(a)+"\n--\x3e")}}),t.addNodeFilter("#comment",function(e){for(var t=e.length;t--;){var n=e[t];s.preserve_cdata&&0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=c.decode(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))}}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"))}}),t.addAttributeFilter("data-mce-type",function(e){Y(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:F,addNodeFilter:U.addNodeFilter,addAttributeFilter:U.addAttributeFilter,serialize:function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,S,E,k,N,_,A,R,D,T=_e({format:"html"},t=void 0===t?{}:t),O=(n=(m=e,E=g=T,(d=I)&&d.hasEventListeners("PreProcess")&&!E.no_events?(h=g,x=(p=d).dom,w=m.cloneNode(!0),(S=document.implementation).createHTMLDocument&&(b=S.createHTMLDocument(""),Et.each("BODY"===w.nodeName?w.childNodes:[w],function(e){b.body.appendChild(b.importNode(e,!0))}),w="BODY"!==w.nodeName?b.body.firstChild:b.body,v=x.doc,x.doc=b),y=p,C=_e(_e({},h),{node:w}),y.fire("PreProcess",C),v&&(x.doc=v),w):m),o=Eo((r=T).getInner?n.innerHTML:M.getOuterHTML(n)),r.selection||yo(kt.fromDom(n))?o:Et.trim(o)),B=(i=U,a=O,s=(u=T).selection?_e({forced_root_block:!1},u):u,c=i.parse(a,s),!P(f=c.lastChild)||P(l=f.prev)&&(f.remove(),l.remove()),c);function P(e){return e&&"br"===e.name}return"tree"===T.format?B:(k=I,N=T,_=B,D=im(L,F).serialize(_),N.no_events||!k?D:(A=k,R=_e(_e({},N),{content:D}),A.fire("PostProcess",R).content))},addRules:F.addValidElements,setRules:F.setValidElements,addTempAttr:R(Yh,U,e),getTempAttrs:J(e),getNodeFilters:U.getNodeFilters,getAttributeFilters:U.getAttributeFilters}}function Jh(e,t){var n=Gh(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}}function Qh(e,t,n){return r=n=void 0===n?{}:n,bh(e).editor.setContent(t,r);var r}function Zh(e){return ve.from(e).each(function(e){return e.destroy()})}function ev(e,t){var n,r,o,i,a,u,s,c=(n=e,r=U(xv,function(e){return ke(n,e)}),!1!==(o=n.forced_root_block)&&""!==o||r.push("forced_root_block (false only)"),W(r)),l=(s=Et.makeMap(t.plugins," "),W(Ae(Ae([],U(wv,g),!0),H(Sv,function(e){return g(e)?[e+" (moving to premium)"]:[]}),!0))),f=0<l.length,d=0<c.length,m="mobile"===t.theme;function g(e){return ke(s,e)}(f||d||m)&&(i=m?"\n\nThemes:\n- mobile":"",a=f?"\n\nPlugins:\n- "+l.join("\n- "):"",u=d?"\n\nSettings:\n- "+c.join("\n- "):"",console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+i+a+u))}function tv(e){var t=S(e)?e.join(" "):e;return U(A(X(t)?t.split(" "):[],Je),function(e){return 0<e.length})}function nv(e,t){return ke(e.sections(),t)}function rv(e,t){return ue(e,"toolbar_mode").orThunk(function(){return ue(e,"toolbar_drawer").map(function(e){return!1===e?"wrap":e})}).getOr(t)}function ov(e,t,n,r){var o,i,a,u,s,c,l,f,d=tv(n.forced_plugins),m=tv(r.plugins),g=nv(o=t,"mobile")?o.sections().mobile:{},p=g.plugins?tv(g.plugins):m,h=(i=(u=t,s=m,c=p,(a=e)&&(0,f=(l=u).sections(),nv(l,"mobile")&&"mobile"===f.mobile.theme)?U(c,R(T,Av)):a&&nv(u,"mobile")?c:s),[].concat(tv(d)).concat(tv(i)));if(xt.browser.isIE()&&T(h,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return Et.extend(r,{plugins:h.join(" ")})}function iv(e,t,n,r,o){var i,a,u,s,c,l,f,d,m=e?{mobile:(i=t,a={resize:!1,toolbar_mode:rv(o.mobile||{},"scrolling"),toolbar_sticky:!1},_e(_e(_e({},Rv),a),i?{menubar:!1}:{}))}:{},g=(c=["mobile"],ie(Cv(m,o),function(e,t){return T(c,t)},oe(l={}),oe(f={})),{sections:J((d={t:l,f:f}).t),settings:J(d.f)}),p=Et.extend(n,r,g.settings(),e&&nv(g,"mobile")?function(e){void 0===e&&(e={});var t=ue(g.sections(),"mobile").getOr({});return Et.extend({},e,t)}():{},{validate:!0,external_plugins:(u=r,s=g.settings().external_plugins||{},u&&u.external_plugins?Et.extend({},u.external_plugins,s):s)});return ov(e,g,r,p)}function av(e,t,n){return ve.from(t.settings[n]).filter(e)}function uv(e,t){return t.dom[e]}function sv(e,t){return parseInt(xn(t,e),10)}function cv(e,t,n){var r,o,i,a,u,s,c=kt.fromDom(e.getBody()),l=e.inline?c:kt.fromDom(Dt(c).dom.documentElement),f=(r=e.inline,i=t,a=n,u=(o=l).dom.getBoundingClientRect(),{x:i-(r?u.left+o.dom.clientLeft+Pv(o):0),y:a-(r?u.top+o.dom.clientTop+Bv(o):0)}),d=f.x,m=f.y,g=Tv(s=l),p=Ov(s);return 0<=d&&0<=m&&d<=g&&m<=p}function lv(o){function i(){var e=o.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():{open:t,close:t,reposition:t,getArgs:t};function t(){throw new Error("Theme did not provide a NotificationManager implementation.")}}function a(){return ve.from(c[0])}function u(){0<c.length&&i().reposition(c)}function s(t){z(c,function(e){return e===t}).each(function(e){c.splice(e,1)})}function t(n,e){if(void 0===e&&(e=!0),!o.removed&&(r=(t=o).inline?t.getBody():t.getContentAreaContainer(),ve.from(r).map(kt.fromDom).map(In).getOr(!1)))return e&&o.fire("BeforeOpenNotification",{notification:n}),M(c,function(e){return!((t=i().getArgs(e)).type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t}).getOrThunk(function(){o.editorManager.setActive(o);var e=i().open(n,function(){s(e),u(),a().fold(function(){return o.focus()},function(e){return kt.fromDom(e.getEl()).dom.focus()})});return c.push(e),u(),o.fire("OpenNotification",{notification:_e({},e)}),e});var t,r}var n,c=[],e=J(c);return(n=o).on("SkinLoaded",function(){var e=n.getParam("service_message");e&&t({text:e,type:"warning",timeout:0},!1),u()}),n.on("show ResizeEditor ResizeWindow NodeChange",function(){_r.requestAnimationFrame(u)}),n.on("remove",function(){Y(c.slice(),function(e){i().close(e)})}),{open:t,close:function(){a().each(function(e){i().close(e),s(e),u()})},getNotifications:e}}var fv,dv,mv=0,gv=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},pv=Et.makeMap,hv=Et.each,vv=Et.explode,bv=Et.extend,yv=Za.DOM,Cv=(fv=function(e,t){return h(e)&&h(t)?Cv(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o,i=e[r];for(o in i)ke(i,o)&&(n[o]=fv(n[o],i[o]))}return n}),xv="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),wv="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Sv="imagetools,toc".split(","),Ev=dt().deviceType,kv=Ev.isTouch(),Nv=Ev.isPhone(),_v=Ev.isTablet(),Av=["lists","autolink","autosave"],Rv={table_grid:!1,object_resizing:!1,resize:!1},Dv=(dv={},{add:function(e,t){dv[e]=t},get:function(e){return dv[e]||{icons:{}}},has:function(e){return ke(dv,e)}}),Tv=R(uv,"clientWidth"),Ov=R(uv,"clientHeight"),Bv=R(sv,"margin-top"),Pv=R(sv,"margin-left"),Lv=lu.PluginManager,Iv=lu.ThemeManager;function Mv(r){function o(){var e=r.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():{open:t,openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t};function t(){throw new Error("Theme did not provide a WindowManager implementation.")}}function i(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r?r.apply(n,e):void 0}}function n(t){r.fire("CloseWindow",{dialog:t}),0===(u=U(u,function(e){return e!==t})).length&&r.focus()}function a(e){r.editorManager.setActive(r),fd(r);var t,n=e();return t=n,u.push(t),r.fire("OpenWindow",{dialog:t}),n}var u=[];return r.on("remove",function(){Y(u,function(e){o().close(e)})}),{open:function(e,t){return a(function(){return o().open(e,t,n)})},openUrl:function(e){return a(function(){return o().openUrl(e,n)})},alert:function(e,t,n){var r=o();r.alert(e,i(n||r,t))},confirm:function(e,t,n){var r=o();r.confirm(e,i(n||r,t))},close:function(){ve.from(u[u.length-1]).each(function(e){o().close(e),n(e)})}}}function Fv(e,t){e.notificationManager.open({type:"error",text:t})}function Uv(e,t){e._skinLoaded?Fv(e,t):e.on("SkinLoaded",function(){Fv(e,t)})}function zv(e,t,n){yf(e,t,{message:n}),console.error(n)}function Hv(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t}function jv(e,t,n){zv(e,"PluginLoadError",Hv("plugin",t,n))}function Vv(e){var t,n;e.contentCSS=e.contentCSS.concat(dy(e,(n=(t=e).getParam("content_css"),X(n)?A(n.split(","),Je):S(n)?n:!1===n||t.inline?[]:["default"])),dy(e,Os(e)))}function qv(){function n(e,t){return{status:e,resultUri:t}}function t(e){return e in r}var r={};return{hasBlobUri:t,getResultUri:function(e){var t=r[e];return t?t.resultUri:null},isPending:function(e){return!!t(e)&&1===r[e].status},isUploaded:function(e){return!!t(e)&&2===r[e].status},markPending:function(e){r[e]=n(1,null)},markUploaded:function(e,t){r[e]=n(2,t)},removeFailed:function(e){delete r[e]},destroy:function(){r={}}}}function $v(e){return e+my+++("s"+(new Date).getTime().toString(36)+t()+t()+t());function t(){return Math.round(4294967295*Math.random()).toString(36)}}function Wv(){function e(e){return M(n,e).getOrUndefined()}function i(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t=e.id||$v("blobid"),n=e.name||t,r=e.blob;return{id:J(t),name:J(n),filename:J(e.filename||n+"."+({"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.type.toLowerCase()]||"dat")),blob:J(r),base64:J(e.base64),blobUri:J(e.blobUri||URL.createObjectURL(r)),uri:J(e.uri)}}function t(t){return e(function(e){return e.id()===t})}var n=[];return{create:function(e,t,n,r,o){if(X(e))return i({id:e,name:r,filename:o,blob:t,base64:n});if(h(e))return i(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t,getByUri:function(t){return e(function(e){return e.blobUri()===t})},getByData:function(t,n){return e(function(e){return e.base64()===t&&e.blob().type===n})},findFirst:e,removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||void URL.revokeObjectURL(e.blobUri())})},destroy:function(){Y(n,function(e){URL.revokeObjectURL(e.blobUri())}),n=[]}}}function Kv(u,s){function o(e,r,o,t){var i=new XMLHttpRequest;i.open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)};var n=new FormData;n.append("file",e.blob(),e.filename()),i.send(n)}function c(e,t){return{url:t,blobInfo:e,status:!0}}function l(e,t,n){return{url:"",blobInfo:e,status:!1,error:{message:t,options:n}}}function f(e,t){Et.each(d[e],function(e){e(t)}),delete d[e]}var d={};return!1===y(s.handler)&&(s.handler=o),{upload:function(e,t){return s.url||s.handler!==o?(n=e,r=t,n=Et.grep(e,function(e){return!u.isUploaded(e.blobUri())}),Nr.all(Et.map(n,function(e){return u.isPending(e.blobUri())?(n=e.blobUri(),new Nr(function(e){d[n]=d[n]||[],d[n].push(e)})):(i=e,t=s.handler,a=r,u.markPending(i.blobUri()),new Nr(function(r){var n;try{var o=function(){n&&n.close()};t(i,function(e){o(),u.markUploaded(i.blobUri(),e),f(i.blobUri(),c(i,e)),r(c(i,e))},function(e,t){var n=t||{};o(),u.removeFailed(i.blobUri()),f(i.blobUri(),l(i,e,n)),r(l(i,e,n))},function(t){t<0||100<t||ve.from(n).orThunk(function(){return ve.from(a).map(C)}).each(function(e){(n=e).progressBar.value(t)})})}catch(e){r(l(i,e.message,{}))}}));var i,t,a,n}))):new Nr(function(e){e([])});var n,r}}}function Xv(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}}function Yv(e,t){return Kv(t,{url:e.getParam("images_upload_url","","string"),basePath:e.getParam("images_upload_base_path","","string"),credentials:e.getParam("images_upload_credentials",!1,"boolean"),handler:e.getParam("images_upload_handler",null,"function")})}function Gv(l){function t(t){return function(e){return l.selection?t(e):[]}}function r(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e}function o(e,t,n){return e=r(e,'src="'+t+'"','src="'+n+'"'+(n===xt.transparentSrc?' data-mce-placeholder="1"':"")),r(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function f(t,n){Y(l.undoManager.data,function(e){"fragmented"===e.type?e.fragments=A(e.fragments,function(e){return o(e,t,n)}):e.content=o(e.content,t,n)})}function n(n){return u=u||Yv(l,g),v().then(t(function(c){var e=A(c,function(e){return e.blobInfo});return u.upload(e,Xv(l)).then(t(function(e){var s=[],t=A(e,function(e,t){var n,r,o,i,a=c[t].blobInfo,u=c[t].image;return e.status&&l.getParam("images_replace_blob_uris",!0,"boolean")?(m.removeByUri(u.src),hh(l)||(r=u,o=e.url,i=l.convertURL(o,"src"),f(r.src,o),l.$(r).attr({src:l.getParam("images_reuse_filename",!1,"boolean")?o+(-1===o.indexOf("?")?"?":"&")+(new Date).getTime():o,"data-mce-src":i}))):e.error&&(e.error.options.remove&&(f(u.getAttribute("src"),xt.transparentSrc),s.push(u)),n=e.error.message,Uv(l,cu.translate(["Failed to upload image: {0}",n]))),{element:u,status:e.status,uploadUri:e.url,blobInfo:a}});return 0<t.length&&h.fireIfChanged(),0<s.length&&(hh(l)?console.error("Removing images on failed uploads is currently unsupported for RTC"):l.undoManager.transact(function(){Y(s,function(e){l.dom.remove(e),m.removeByUri(e.src)})})),n&&n(t),t}))}))}function e(e){if(_s(l))return n(e)}function i(t){return!1!==j(p,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||l.getParam("images_dataimg_filter",w,"function")(t))}function a(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=g.getResultUri(n);if(t)return'src="'+t+'"';var r=(r=m.getByUri(n))||L(l.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null);return r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})}var u,s,c,d,m=Wv(),g=qv(),p=[],h=(d=iu(null),(c=l).on("change AddUndo",function(e){d.set(_e({},e.level))}),{fireIfChanged:function(){var t=c.undoManager.data;Z(t).filter(function(e){return!fh(d.get(),e)}).each(function(e){c.setDirty(!0),c.fire("change",{level:e,lastLevel:G(t,t.length-2).getOrNull()})})}}),v=function(){return(s=s||qh(g,m)).findAll(l.getBody(),i).then(t(function(e){return e=U(e,function(e){return"string"!=typeof e||void Uv(l,e)}),hh(l)||Y(e,function(e){f(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))};return l.on("SetContent",function(){(_s(l)?e:v)()}),l.on("RawSaveContent",function(e){e.content=a(e.content)}),l.on("GetContent",function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=a(e.content))}),l.on("PostRender",function(){l.parser.addNodeFilter("img",function(e){Y(e,function(e){var t,n=e.attr("src");m.getByUri(n)||(t=g.getResultUri(n))&&e.attr("src",t)})})}),{blobCache:m,addFilter:function(e){p.push(e)},uploadImages:n,uploadImagesAuto:e,scanForImages:v,destroy:function(){m.destroy(),g.destroy(),s=u=null}}}function Jv(e,t){function m(e){o="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t,n=py.create(o.name),r=n;return(t=o).classes.length&&py.addClass(r,t.classes.join(" ")),py.setAttribs(r,t.attrs),n}var n,o,r,g=t&&t.schema||ro({}),p=function(n,e,t){var r,o,i,a,u,s,c,l=0<e.length&&e[0],f=l&&l.name,d=(a=f,u="string"!=typeof(i=n)?i.nodeName.toLowerCase():i,!(!(c=(s=g.getElementRule(u))&&s.parentsRequired)||!c.length)&&(a&&-1!==Et.inArray(c,a)?a:c[0]));if(d)f===d?(o=e[0],e=e.slice(1)):o=d;else if(l)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=m(o)).appendChild(n),t&&(r||(r=py.create("div")).appendChild(n),Et.each(t,function(e){var t=m(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(n=m(o=e[0]),(r=py.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""}function Qv(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Et.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Et.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}var i;return"["!==r||(i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(a.attrs[i[1]]=i[2]),""})),a.name=t||"div",a}function Zv(n,e){var r,t,o="",i=(t=n.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),X(t)?t:"");if(""===i)return"";function a(e){return e.replace(/%(\w+)/g,"")}if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}if("preview"in e){var u=ue(e,"preview");if(fn(u,!1))return"";i=u.getOr(i)}var s,c=e.block||e.inline||"span",l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Et.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Et.map(e.split(/(?:~\+|~|\+)/),Qv),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=c),c=e.selector,Jv(l,n)):Jv([c],n),d=py.select(c,f)[0]||f.firstChild;return gy(e.styles,function(e,t){var n=a(e);n&&py.setStyle(d,t,n)}),gy(e.attributes,function(e,t){var n=a(e);n&&py.setAttrib(d,t,n)}),gy(e.classes,function(e){var t=a(e);py.hasClass(d,t)||py.addClass(d,t)}),n.fire("PreviewFormats"),py.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=py.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,gy(i.split(" "),function(e){var t=py.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=py.getStyle(n.getBody(),e,!0),"#ffffff"===py.toHex(t).toLowerCase())||"color"===e&&"#000000"===py.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),py.remove(f),o}function eb(c){var e,r,t,n,o,i,a=(n={},(o=function(e,t){e&&(X(e)?(Y(t=!S(t)?[t]:t,function(e){b(e.deep)&&(e.deep=!ml(e)),b(e.split)&&(e.split=!ml(e)||gl(e)),b(e.remove)&&ml(e)&&!gl(e)&&(e.remove="none"),ml(e)&&gl(e)&&(e.mixed=!0,e.block_expand=!0),X(e.classes)&&(e.classes=e.classes.split(/\s+/))}),n[e]=t):ne(e,function(e,t){o(t,e)}))})((r=(e=c).dom,t={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,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return zn(e)&&e.hasAttribute("href")},onformat:function(n,e,t){Et.each(t,function(e,t){r.setAttrib(n,t,e)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",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}]},Et.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t)),o(e.getParam("formats")),{get:function(e){return V(e)?n[e]:n},has:function(e){return ke(n,e)},register:o,unregister:function(e){return e&&n[e]&&delete n[e],n}}),l=iu(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(c),(i=c).on("mouseup keydown",function(e){var t=i,n=e.keyCode,r=t.selection,o=t.getBody();Hg(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==Cp||Hg(t,Vc(o,r.getStart())),37!==n&&39!==n||Hg(t,Vc(o,r.getStart()))}),{get:a.get,has:a.has,register:a.register,unregister:a.unregister,apply:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o=e,i=t,a=n,u=r;yh(c).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.toggle(r,o,i)},match:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.match(o,i,a,u);var o,i,a,u},closest:function(e){return t=e,yh(c).formatter.closest(t);var t},matchAll:function(e,t){return n=e,r=t,yh(c).formatter.matchAll(n,r);var n,r},matchNode:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.matchNode(o,i,a,u);var o,i,a,u},canApply:function(e){return t=e,yh(c).formatter.canApply(t);var t},formatChanged:function(e,t,n,r){return o=l,i=e,a=t,u=n,s=r,yh(c).formatter.formatChanged(o,i,a,u,s);var o,i,a,u,s},getCssText:R(Zv,c)}}function tb(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return 1;default:return}}function nb(s){var e,n,r,o,i,c=fu(),l=iu(0),f=iu(0),d={data:[],typing:!1,beforeChange:function(){var e=l,t=c;yh(s).undoManager.beforeChange(e,t)},add:function(e,t){return n=d,r=f,o=l,i=c,a=e,u=t,yh(s).undoManager.add(n,r,o,i,a,u);var n,r,o,i,a,u},undo:function(){return e=d,t=l,n=f,yh(s).undoManager.undo(e,t,n);var e,t,n},redo:function(){return e=f,t=d.data,yh(s).undoManager.redo(e,t);var e,t},clear:function(){var e=d,t=f;yh(s).undoManager.clear(e,t)},reset:function(){var e=d;yh(s).undoManager.reset(e)},hasUndo:function(){return e=d,t=f,yh(s).undoManager.hasUndo(e,t);var e,t},hasRedo:function(){return e=d,t=f,yh(s).undoManager.hasRedo(e,t);var e,t},transact:function(e){return t=d,n=l,r=e,yh(s).undoManager.transact(t,n,r);var t,n,r},ignore:function(e){var t=l,n=e;yh(s).undoManager.ignore(t,n)},extra:function(e,t){var n=d,r=f,o=e,i=t;yh(s).undoManager.extra(n,r,o,i)}};return hh(s)||(r=d,o=l,i=iu(!1),(n=s).on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){tb(e.command)||(gh(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){tb(e.command)||a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===fh(uh(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20<n)||224===n||91===n||r.typing||t||(r.beforeChange(),mh(r,!0,o),r.add({},e),i.set(!0))))}),n.on("mousedown",function(e){r.typing&&a(e)}),n.on("input",function(e){e.inputType&&("insertReplacementText"===e.inputType||"insertText"===e.inputType&&null===e.data||"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)&&a(e)}),n.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||n.nodeChanged()})),(e=s).addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),d;function a(e){mh(r,!1,o),r.add({},e)}}function rb(e){return"keydown"===e.type||"keyup"===e.type}function ob(e){var t=e.keyCode;return t===Lf.BACKSPACE||t===Lf.DELETE}function ib(e,t){return ze(kt.fromDom(t),e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string"))}function ab(e,t,n){var r,o,i=(r=e,o=t,U(Za.DOM.getParents(n.container(),"*",o),r));return ve.from(i[i.length-1])}function ub(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Lr(n)?jn(n.nextSibling)?ss(n.nextSibling,0):ss.after(n):Fr(t)?ss(n,r+1):t:Lr(n)?jn(n.previousSibling)?ss(n.previousSibling,n.previousSibling.data.length):ss.before(n):Ur(t)?ss(n,r-1):t}function sb(e){return go(e)||ho(e)}function cb(e,t){return Ve(e,t)?pr(t,sb,(n=e,function(e){return je(n,kt.fromDom(e.dom.parentNode))})):ve.none();var n}function lb(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),r=(n=(t=e).getBody()).firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))}function fb(e,t){return{from:e,to:t}}function db(e,t){return cb(kt.fromDom(e),kt.fromDom(t.container())).map(function(e){return{block:e,position:t}})}function mb(e){var t,n=z(t=Dn(e),mo).fold(J(t),function(e){return t.slice(0,e)});return Y(n,Ln),n}function gb(e,t){return M(ym(t,e).reverse(),function(e){return Wr(e)}).each(Ln)}function pb(e,t,n,r){if(Wr(n))return hm(n),nf(n.dom);0===U(Lt(r),function(e){return!Wr(e)}).length&&Wr(t)&&qt(r,kt.fromTag("br"));var o=tf(n.dom,ss.before(r.dom));return Y(mb(t),function(e){qt(r,e)}),gb(e,t),o}function hb(e,t,n){if(Wr(n))return Ln(n),Wr(t)&&hm(t),nf(t.dom);var r=rf(n.dom);return Y(mb(t),function(e){Pn(n,e)}),gb(e,t),r}function vb(e,t){Hc(e,t.dom).map(function(e){return e.getNode()}).map(kt.fromDom).filter(Br).each(Ln)}function bb(e,t,n){return vb(!0,t),vb(!1,n),(Ve(o=n,r=t)?(i=ym(r,o),ve.from(i[i.length-1])):ve.none()).fold(R(hb,e,t,n),R(pb,e,t,n));var r,o,i}function yb(e,t,n,r){return t?bb(e,r,n):bb(e,n,r)}function Cb(t,n){var e,r,o,i,a,u,s,c=kt.fromDom(t.getBody()),l=(e=c.dom,r=n,((o=t.selection.getRng()).collapsed?(a=r,u=db(i=e,ss.fromRangeStart(o)),s=u.bind(function(e){return Ql(a,i,e.position).bind(function(e){return db(i,e).map(function(e){return t=i,n=a,Wn((r=e).position.getNode())&&!1===Wr(r.block)?Hc(!1,r.block.dom).bind(function(e){return e.isEqual(r.position)?Ql(n,t,e).bind(function(e){return db(t,e)}):ve.some(r)}).getOr(r):r;var t,n,r})})}),dn(u,s,fb).filter(function(e){return!1===je(e.from.block,e.to.block)&&Ot((n=e).from.block).bind(function(t){return Ot(n.to.block).filter(function(e){return je(t,e)})}).isSome()&&!1===Yn((t=e).from.block.dom)&&!1===Yn(t.to.block.dom);var t,n})):ve.none()).bind(function(e){return yb(c,n,e.from.block,e.to.block)}));return l.each(function(e){t.selection.setRng(e.toRange())}),l.isSome()}function xb(e,t){var n=kt.fromDom(t),r=R(je,e);return gr(n,bo,r).isSome()}function wb(e){var n,r,o,t,i,a,u,s,c,l,f=kt.fromDom(e.getBody()),d=e.selection.getRng();return a=d,c=tf((i=f).dom,ss.fromRangeStart(a)).isNone(),l=ef(i.dom,ss.fromRangeEnd(a)).isNone(),!xb(u=i,(s=a).startContainer)&&!xb(u,s.endContainer)&&c&&l?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=f,r=e.selection,o=r.getRng(),dn(cb(n,kt.fromDom(o.startContainer)),cb(n,kt.fromDom(o.endContainer)),function(e,t){return!1===je(e,t)&&(o.deleteContents(),yb(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))}function Sb(e,t){return!e.selection.isCollapsed()&&wb(e)}function Eb(e,t,n,r,o){return ve.from(t._selectionOverrides.showCaret(e,n,r,o))}function kb(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?ve.none():ve.some(((r=(n=t).ownerDocument.createRange()).selectNode(n),r))}function Nb(e,t,n){var r=tc(1,e.getBody(),t),o=ss.fromRangeStart(r),i=o.getNode();if(Ec(i))return Eb(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Ec(a))return Eb(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return wy(e)||xy(e)});return Ec(u)?Eb(1,e,u,!1,n):ve.none()}function _b(e,t,n){return t.collapsed?Nb(e,t,n).getOr(t):t}function Ab(e){return rp(e)||Zg(e)}function Rb(e){return op(e)||ep(e)}function Db(n,r,e,t,o,i){var a,u;return Eb(t,n,i.getNode(!o),o,!0).each(function(e){var t;r.collapsed?(t=r.cloneRange(),o?t.setEnd(e.startContainer,e.startOffset):t.setStart(e.endContainer,e.endOffset),t.deleteContents()):r.deleteContents(),n.selection.setRng(e)}),a=n.dom,jn(u=e)&&0===u.data.length&&a.remove(u),!0}function Tb(e,t){var n=e.selection.getRng();if(!jn(n.commonAncestorContainer))return!1;var r=t?uc.Forwards:uc.Backwards,o=Ic(e.getBody()),i=R(ic,t?o.next:o.prev),a=t?Ab:Rb,u=rc(r,e.getBody(),n),s=ub(t,i(u));if(!s||!ac(u,s))return!1;if(a(s))return Db(e,n,u.getNode(),r,t,s);var c=i(s);return!!(c&&a(c)&&ac(s,c))&&Db(e,n,u.getNode(),r,t,c)}function Ob(l,f,d){return Ql(f,l,d).bind(function(e){return s=e.getNode(),bo(kt.fromDom(s))||ho(kt.fromDom(s))||(o=l,u=e,nc(!(i=f),a=d).fold(function(){return nc(i,u).fold(D,c)},c))?ve.none():f&&Yn(e.getNode())||!1===f&&Yn(e.getNode(!0))?(t=l,n=d,r=e.getNode(!1===f),cb(kt.fromDom(t),kt.fromDom(n.getNode())).map(function(e){return Wr(e)?Sy.remove(e.dom):Sy.moveToElement(r)}).orThunk(function(){return ve.some(Sy.moveToElement(r))})):f&&op(d)||!1===f&&rp(d)?ve.some(Sy.moveToPosition(e)):ve.none();var t,n,r,o,i,a,u,s;function c(e){return Or(kt.fromDom(e))&&!Js(a,u,o)}})}function Bb(e,t){return ve.from(vf(e.getBody(),t))}function Pb(m,g){var e=m.selection.getNode();return Bb(m,e).filter(Yn).fold(function(){return s=m.getBody(),l=tc((c=g)?1:-1,s,m.selection.getRng()),f=ss.fromRangeStart(l),d=kt.fromDom(s),(!1===c&&op(f)?ve.some(Sy.remove(f.getNode(!0))):c&&rp(f)?ve.some(Sy.remove(f.getNode())):!1===c&&rp(f)&&_m(d,f)?cp(d,f).map(function(e){return Sy.remove(e.getNode())}):c&&op(f)&&Nm(d,f)?lp(d,f).map(function(e){return Sy.remove(e.getNode())}):(r=s,e=c,a=(o=f).getNode(!1===(i=e)),u=i?"after":"before",zn(a)&&a.getAttribute("data-mce-caret")===u?(n=o.getNode(!1===(t=e)),(t&&Yn(n.nextSibling)?ve.some(Sy.moveToElement(n.nextSibling)):!1===t&&Yn(n.previousSibling)?ve.some(Sy.moveToElement(n.previousSibling)):ve.none()).fold(function(){return Ob(r,e,o)},ve.some)):Ob(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return ve.some(Sy.remove(e))},function(e){return ve.some(Sy.moveToElement(e))},function(e){return Js(n,e,t)?ve.none():ve.some(Sy.moveToPosition(e))});var t,n}))).exists(function(e){return e.fold(function(e){return o._selectionOverrides.hideFakeCaret(),Qm(o,i,kt.fromDom(e)),!0},(r=i=g,function(e){var t=r?ss.before(e):ss.after(e);return n.selection.setRng(t.toRange()),!0}),(t=n=o=m,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i});var r,e,o,t,n,i,a,u,s,c,l,f,d},w)}function Lb(e,t){var n=e.selection.getNode();return!(!Yn(n)||Gn(n))&&Bb(e,n.parentNode).filter(Yn).fold(function(){return Y(bu(kt.fromDom(e.getBody()),".mce-offscreen-selection"),Ln),Qm(e,t,kt.fromDom(e.selection.getNode())),lb(e),!0},w)}function Ib(e){var t,n=e.dom,r=e.selection,o=vf(e.getBody(),r.getNode());return Xn(o)&&n.isBlock(o)&&n.isEmpty(o)&&(t=n.create("br",{"data-mce-bogus":"1"}),n.setHTML(o,""),o.appendChild(t),r.setRng(ss.before(t).toRange())),!0}function Mb(e,t){return(e.selection.isCollapsed()?Pb:Lb)(e,t)}function Fb(e,t){return!!e.selection.isCollapsed()&&(n=e,r=t,o=ss.fromRangeStart(n.selection.getRng()),Ql(r,n.getBody(),o).filter(function(e){return(r?Jg:Qg)(e)}).bind(function(e){return ve.from(Qs(r?0:-1,e))}).exists(function(e){return n.selection.select(e),!0}));var n,r,o}function Ub(e){return Ey(e)&&e.data[0]===wo}function zb(e){return Ey(e)&&e.data[e.data.length-1]===wo}function Hb(e){return e.ownerDocument.createTextNode(wo)}function jb(e,t){return(e?function(e){if(Ey(e.previousSibling))return zb(e.previousSibling)||e.previousSibling.appendData(wo),e.previousSibling;if(Ey(e))return Ub(e)||e.insertData(0,wo),e;var t=Hb(e);return e.parentNode.insertBefore(t,e),t}:function(e){if(Ey(e.nextSibling))return Ub(e.nextSibling)||e.nextSibling.insertData(0,wo),e.nextSibling;if(Ey(e))return zb(e)||e.appendData(wo),e;var t=Hb(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t})(t)}function Vb(e,t){return jn(e.container())?jb(t,e.container()):jb(t,e.getNode())}function qb(e,t){var n=t.get();return n&&e.container()===n&&Lr(n)}function $b(n,e){return e.fold(function(e){yc(n.get());var t=ky(e);return n.set(t),ve.some(ss(t,t.length-1))},function(e){return nf(e).map(function(e){if(qb(e,n))return ss(n.get(),1);yc(n.get());var t=Vb(e,!0);return n.set(t),ss(t,1)})},function(e){return rf(e).map(function(e){if(qb(e,n))return ss(n.get(),n.get().length-1);yc(n.get());var t=Vb(e,!1);return n.set(t),ss(t,t.length-1)})},function(e){yc(n.get());var t=Ny(e);return n.set(t),ve.some(ss(t,1))})}function Wb(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return ve.none()}function Kb(e,t){return Gs(t,e)||e}function Xb(e,t,n){var r=yy(n),o=Kb(t,r.container());return ab(e,o,r).fold(function(){return ef(o,r).bind(R(ab,e,o)).map(function(e){return _y.before(e)})},ve.none)}function Yb(e,t){return null===Vc(e,t)}function Gb(e,t,n){return ab(e,t,n).filter(R(Yb,t))}function Jb(e,t,n){var r=Cy(n);return Gb(e,t,r).bind(function(e){return tf(e,r).isNone()?ve.some(_y.start(e)):ve.none()})}function Qb(e,t,n){var r=yy(n);return Gb(e,t,r).bind(function(e){return ef(e,r).isNone()?ve.some(_y.end(e)):ve.none()})}function Zb(e,t,n){var r=Cy(n),o=Kb(t,r.container());return ab(e,o,r).fold(function(){return tf(o,r).bind(R(ab,e,o)).map(function(e){return _y.after(e)})},ve.none)}function ey(e){return!1===(t=Ay(e),"rtl"===Za.DOM.getStyle(t,"direction",!0)||(n=t.textContent,by.test(n)));var t,n}function ty(e,t,n){return Wb([Xb,Jb,Qb,Zb],[e,t,n]).filter(ey)}function ny(e){return e.fold(J("before"),J("start"),J("end"),J("after"))}function ry(e){return e.fold(_y.before,_y.before,_y.after,_y.after)}function oy(e){return e.fold(_y.start,_y.start,_y.end,_y.end)}function iy(a,e,u,t,n,s){return dn(ab(e,u,t),ab(e,u,n),function(e,t){return e!==t&&(r=t,o=Gs(e,n=u),i=Gs(r,n),o&&o===i)?_y.after(a?e:t):s;var n,r,o,i}).getOr(s)}function ay(e,r){return e.fold(w,function(e){return n=r,!(ny(t=e)===ny(n)&&Ay(t)===Ay(n));var t,n})}function uy(e,t){return e?t.fold(i(ve.some,_y.start),ve.none,i(ve.some,_y.after),ve.none):t.fold(ve.none,i(ve.some,_y.before),ve.none,i(ve.some,_y.end))}function sy(e,a,u,s){var t=ub(e,s),c=ty(a,u,t);return ty(a,u,t).bind(R(uy,e)).orThunk(function(){return n=a,r=u,o=c,i=ub(t=e,s),Ql(t,r,i).map(R(ub,t)).fold(function(){return o.map(ry)},function(e){return ty(n,r,e).map(R(iy,t,n,r,i,e)).filter(R(ay,o))}).filter(ey);var t,n,r,o,i})}function cy(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error||r.log).apply(r,Ae([e],t,!1))}var ly,fy,dy=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return A(e,function(e){return/^[a-z0-9\-]+$/i.test(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)})},my=0,gy=Et.each,py=Za.DOM,hy=[9,27,Lf.HOME,Lf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Lf.DOWN,Lf.UP,Lf.LEFT,Lf.RIGHT].concat(xt.browser.isFirefox()?[224]:[]),vy="data-mce-placeholder",by=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,yy=R(ub,!0),Cy=R(ub,!1),xy=Xn,wy=Yn,Sy=or([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Ey=jn,ky=R(jb,!0),Ny=R(jb,!1),_y=or([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Ay=function(e){return e.fold(u,u,u,u)};function Ry(e,t,n){var r=e?1:-1;return t.setRng(ss(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0}function Dy(e,t){return e===uc.Backwards?q(t):t}function Ty(e,t,n,r){for(var o,i,a,u,s=Ic(n),c=r,l=[];c;){var f=(a=s,u=c,t===uc.Forwards?a.next(u):a.prev(u));if(!f)break;if(Wn(f.getNode(!1)))return t===uc.Forwards?{positions:Dy(t,l).concat([f]),breakType:ly.Br,breakAt:ve.some(f)}:{positions:Dy(t,l),breakType:ly.Br,breakAt:ve.some(f)};if(f.isVisible()){if(e(c,f)){var d=(o=c,Wn((i=f).getNode(t===uc.Forwards))?ly.Br:!1===Js(o,i)?ly.Block:ly.Wrap);return{positions:Dy(t,l),breakType:d,breakAt:ve.some(f)}}l.push(f),c=f}else c=f}return{positions:Dy(t,l),breakType:ly.Eol,breakAt:ve.none()}}function Oy(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===uc.Backwards?t.concat(e):[e].concat(t)}).getOr([])}function By(e,i){return L(e,function(e,o){return e.fold(function(){return ve.some(o)},function(r){return dn(Q(r.getClientRects()),Q(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},ve.none())}function Py(t,e){return Q(e.getClientRects()).bind(function(e){return By(t,e.left)})}function Ly(n){function e(e){return A(e,function(e){var t=Au(e);return t.node=n,t})}if(zn(n))return e(n.getClientRects());if(jn(n)){var t=n.ownerDocument.createRange();return t.setStart(n,0),t.setEnd(n,n.data.length),e(t.getClientRects())}}function Iy(e){return H(e,Ly)}R(sy,!1),R(sy,!0),(fy=ly={})[fy.Br=0]="Br",fy[fy.Block=1]="Block",fy[fy.Wrap=2]="Wrap",fy[fy.Eol=3]="Eol";var My,Fy,Uy=R(Ty,ss.isAbove,-1),zy=R(Ty,ss.isBelow,1),Hy=R(Oy,-1,Uy),jy=R(Oy,1,zy);function Vy(o,i,a,e,u,t){function n(e){var t=Iy([e]);-1===o&&(t=t.reverse());for(var n=0;n<t.length;n++){var r=t[n];if(!a(r,l)){if(0<c.length&&i(r,pe(c))&&s++,r.line=s,u(r))return!0;c.push(r)}}}var s=0,c=[],l=pe(t.getClientRects());if(!l)return c;var r=t.getNode();return n(r),function(e,t,n,r){for(;r=Ys(r,e,Vr,t);)if(n(r))return}(o,e,n,r),c}function qy(t){return function(e){return e.line>t}}function $y(t){return function(e){return e.line===t}}function Wy(e,t){return Math.abs(e.left-t)}function Ky(e,t){return Math.abs(e.right-t)}function Xy(e,t){return e>=t.left&&e<=t.right}function Yy(e,t){return e>=t.top&&e<=t.bottom}function Gy(e,o,i){return void 0===i&&(i=w),me(e,function(e,t){if(Xy(o,t))return i(t)?t:e;if(Xy(o,e))return i(e)?e:t;var n=Math.min(Wy(e,o),Ky(e,o)),r=Math.min(Wy(t,o),Ky(t,o));return r===n&&se(t,"node")&&zC(t.node)||r<n?t:e})}function Jy(e,t,n,r,o){var i=HC(r,e,Vr,t,!o);do{if(!i||n(i))return}while(i=HC(i,e,Vr,t))}function Qy(e,t,n){function r(e){return!cn(e.node)&&!Jn(e.node)}var o,i,a,u=Iy(U(xe(e.getElementsByTagName("*")),Ks)),s=U(u,R(Yy,n));if((a=Gy(s,t,r))&&((a=Gy(function(e,r,t){function n(t,e){var n=U(Iy([e]),function(e){return!t(e,r)});return o=o.concat(n),0===n.length}void 0===t&&(t=!0);var o=[];return o.push(r),Jy(My.Up,e,R(n,Tu),r.node,t),Jy(My.Down,e,R(n,Ou),r.node,t),o}(e,a,r(a)),t,r))&&Ks(a.node)))return{node:(o=a).node,before:Wy(o,i=t)<Ky(o,i)};return null}function Zy(e,t){e.selection.setRng(t),td(e,e.selection.getRng())}function e0(e,t,n){return ve.some(_b(e,t,n))}function t0(e,t,n,r,o,i){var a=t===uc.Forwards,u=Ic(e.getBody()),s=R(ic,a?u.next:u.prev),c=a?r:o;if(!n.collapsed){var l=Pu(n);if(i(l))return Eb(t,e,l,t===uc.Backwards,!1)}var f=rc(t,e.getBody(),n);if(c(f))return kb(e,f.getNode(!a));var d=ub(a,s(f)),m=Hr(n);if(!d)return m?ve.some(n):ve.none();if(c(d))return Eb(t,e,d.getNode(!a),a,!1);var g=s(d);return g&&c(g)&&ac(d,g)?Eb(t,e,g.getNode(!a),a,!1):m?e0(e,d.toRange(),!1):ve.none()}function n0(t,e,n,r,o,i){var a=rc(e,t.getBody(),n),u=pe(a.getClientRects()),s=e===My.Down;if(!u)return ve.none();var c,l=U((s?UC:FC)(t.getBody(),qy(1),a),$y(1)),f=u.left,d=Gy(l,f);if(d&&i(d.node)){var m=Math.abs(f-d.left),g=Math.abs(f-d.right);return Eb(e,t,d.node,m<g,!1)}if(c=r(a)?a.getNode():o(a)?a.getNode(!0):Pu(n)){var p=function(e,t,n,r){function o(e){return pe(e.getClientRects())}var i,a,u,s=Ic(t),c=[],l=0,f=1===e?(i=s.next,a=Ou,u=Tu,ss.after(r)):(i=s.prev,a=Tu,u=Ou,ss.before(r)),d=o(f);do{if(f.isVisible()){var m=o(f);if(!u(m,d)){0<c.length&&a(m,pe(c))&&l++;var g=Au(m);if(g.position=f,g.line=l,n(g))return c;c.push(g)}}}while(f=i(f));return c}(e,t.getBody(),qy(1),c),h=Gy(U(p,$y(1)),f);if(h)return e0(t,h.position.toRange(),!1);if(h=pe(U(p,$y(0))))return e0(t,h.position.toRange(),!1)}return 0===l.length?jC(t,s).filter(s?o:r).map(function(e){return _b(t,e.toRange(),!1)}):ve.none()}function r0(t,e,n){return jC(t,e).filter(n).exists(function(e){return t.selection.setRng(e.toRange()),!0})}function o0(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)}function i0(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")}function a0(t,e,n){return $b(e,n).map(function(e){return o0(t,e),n})}function u0(e,t,n){return!!Is(e)&&(o=t,i=n,a=(r=e).getBody(),u=ss.fromRangeStart(r.selection.getRng()),sy(i,R(ib,r),a,u).bind(function(e){return a0(r,o,e)}).isSome());var r,o,i,a,u}function s0(e,t,n){return!!Is(t)&&(r=e,i=(o=t).selection.getRng(),a=r?ss.fromRangeEnd(i):ss.fromRangeStart(i),!!y(o.selection.getSel().modify)&&(r&&Fr(a)?Ry(!0,o.selection,a):!(r||!Ur(a))&&Ry(!1,o.selection,a)));var r,o,i,a}function c0(g){var p=iu(null),h=R(ib,g);return g.on("NodeChange",function(e){var n,r,o,t,i,a,u,s,c,l,f,d,m;!Is(g)||xt.browser.isIE()&&e.initial||(i=h,a=g.dom,u=e.parents,Y($(s=U(A(bu(kt.fromDom(a.getRoot()),'*[data-mce-selected="inline-boundary"]'),function(e){return e.dom}),i),c=U(u,i)),R(i0,!1)),Y($(c,s),R(i0,!0)),f=p,(l=g).selection.isCollapsed()&&!0!==l.composing&&f.get()&&(d=ss.fromRangeStart(l.selection.getRng()),ss.isTextPosition(d)&&!1===(Fr(m=d)||Ur(m))&&(o0(l,Vs(f.get(),d)),f.set(null))),n=h,r=g,o=p,t=e.parents,r.selection.isCollapsed()&&Y(U(t,n),function(e){var t=ss.fromRangeStart(r.selection.getRng());ty(n,r.getBody(),t).bind(function(e){return a0(r,o,e)})}))}),p}function l0(n,t,r){if(Is(n)){var e=jC(n,t).getOrThunk(function(){var e=n.selection.getRng();return t?ss.fromRangeEnd(e):ss.fromRangeStart(e)});return ty(R(ib,n),n.getBody(),e).exists(function(e){var t=ry(e);return $b(r,t).exists(function(e){return o0(n,e),!0})})}return!1}function f0(t,n){return function(e){return $b(n,e).exists(function(e){return o0(t,e),!0})}}function d0(r,o,i,a){var u=r.getBody(),s=R(ib,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),ty(s,u,ss.fromRangeStart(r.selection.getRng())).map(oy).map(f0(r,o))}),r.nodeChanged()}function m0(e,t,n){if(e.selection.isCollapsed()&&Is(e)){var r=ss.fromRangeStart(e.selection.getRng());return o=t,a=n,u=r,s=(i=e).getBody(),c=Gs(u.container(),s)||s,l=R(ib,i),(f=ty(l,c,u)).bind(function(e){return a?e.fold(J(ve.some(oy(e))),ve.none,J(ve.some(ry(e))),ve.none):e.fold(ve.none,J(ve.some(ry(e))),ve.none,J(ve.some(oy(e))))}).map(f0(i,o)).getOrThunk(function(){var t=zc(a,c,u),e=t.bind(function(e){return ty(l,c,e)});return dn(f,e,function(){return ab(l,c,u).exists(function(e){return!!dn(nf(o=e),rf(o),function(e,t){var n=ub(!0,e),r=ub(!1,t);return ef(o,n).forall(function(e){return e.isEqual(r)})}).getOr(!0)&&(Qm(i,a,kt.fromDom(e)),!0);var o})}).orThunk(function(){return e.bind(function(e){return t.map(function(e){return a?d0(i,o,u,e):d0(i,o,e,u),!0})})}).getOr(!1)})}var i,o,a,u,s,c,l,f;return!1}function g0(e){return 1===zt(e)}function p0(g,p){var t,e=kt.fromDom(g.getBody()),n=kt.fromDom(g.selection.getStart()),h=U(z(t=ym(n,e),mo).fold(J(t),function(e){return t.slice(0,e)}),g0);return Z(h).exists(function(e){var t,n,r,o,i,a,u,s,c,l=ss.fromRangeStart(g.selection.getRng()),f=p,d=l,m=e.dom;return!(!dn(nf(m),rf(m),function(e,t){var n=ub(!0,e),r=ub(!1,t),o=ub(!1,d);return f?ef(m,o).exists(function(e){return e.isEqual(r)&&d.isEqual(n)}):tf(m,o).exists(function(e){return e.isEqual(n)&&d.isEqual(r)})}).getOr(!0)||jc((t=e).dom)&&Mg(t.dom)||(n=p,o=e,0===(c=A(U(h,R(Wg,r=g)),function(e){return e.dom})).length?Qm(r,n,o):(a=o.dom,s=Vg(c,(u=Ug(!1)).dom),qt(kt.fromDom(a),u),Ln(kt.fromDom(a)),i=ss(s,0),r.selection.setRng(i.toRange())),0))})}function h0(e,t){return!!e.selection.isCollapsed()&&p0(e,t)}function v0(e,t,n){return e._selectionOverrides.hideFakeCaret(),Qm(e,t,kt.fromDom(n)),!0}function b0(e,t){return e.selection.isCollapsed()?(i=e,u=(a=t)?Zg:ep,s=a?uc.Forwards:uc.Backwards,c=rc(s,i.getBody(),i.selection.getRng()),u(c)?v0(i,a,c.getNode(!a)):ve.from(ub(a,c)).filter(function(e){return u(e)&&ac(c,e)}).exists(function(e){return v0(i,a,e.getNode(!a))})):(r=t,o=(n=e).selection.getNode(),!!Jn(o)&&v0(n,r,o));var n,r,o,i,a,u,s,c}function y0(e){var t=parseInt(e,10);return isNaN(t)?0:t}function C0(e,t){return(e||"table"===Nt(t)?"margin":"padding")+("rtl"===xn(t,"direction")?"-right":"-left")}function x0(e){var n,t=$C(e);return!e.mode.isReadOnly()&&(1<t.length||(n=e,j(t,function(e){var t=wn(e,C0(Ts(n),e)).map(y0).getOr(0);return"false"!==n.dom.getContentEditable(e.dom)&&0<t})))}function w0(e){return po(e)||ho(e)}function S0(e,s){var c=e.dom,t=e.selection,n=e.formatter,r=e.getParam("indentation","40px","string"),l=/[a-z%]+$/i.exec(r)[0],f=parseInt(r,10),d=Ts(e),o=ks(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==o||c.getParent(t.getNode(),c.isBlock)||n.apply("div"),Y($C(e),function(e){var t,n=c,r=s,o=f,i=l,a=e.dom,u=C0(d,kt.fromDom(a));"outdent"===r?(t=Math.max(0,y0(a.style[u])-o),n.setStyle(a,u,t?t+i:"")):(t=y0(a.style[u])+o+i,n.setStyle(a,u,t))})}function E0(e,t){if(e.selection.isCollapsed()&&x0(e)){var n=e.dom,r=e.selection.getRng(),o=ss.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&ip(kt.fromDom(i),o))return S0(e,"outdent"),!0}return!1}function k0(e,t){e.getDoc().execCommand(t,!1,null)}function N0(e){return void 0===e.touches||1!==e.touches.length?ve.none():ve.some(e.touches[0])}function _0(e,t){return ke(e,t.nodeName)}function A0(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),s=i.getStart(),c=e.getBody(),l=ks(e);if(s&&zn(s)&&l){var f=c.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&(d=u,m=c,g=s,!F(bm(kt.fromDom(g),kt.fromDom(m)),function(e){return _0(d,e.dom)}))){for(var d,m,g,p,h,v=i.getRng(),b=v.startContainer,y=v.startOffset,C=v.endContainer,x=v.endOffset,w=yd(e),s=c.firstChild;s;)p=u,jn(h=s)||zn(h)&&!_0(p,h)&&!Jc(h)?function(e,t){if(jn(t)){if(0===t.nodeValue.length)return 1;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||_0(e,t.nextSibling)))return 1}}(u,s)?(s=(n=s).nextSibling,o.remove(n)):(t||(t=o.create(l,Ns(e)),s.parentNode.insertBefore(t,s),r=!0),s=(n=s).nextSibling,t.appendChild(n)):(t=null,s=s.nextSibling);r&&w&&(v.setStart(b,y),v.setEnd(C,x),i.setRng(v),e.nodeChanged())}}}function R0(e,t){t.hasAttribute("data-mce-caret")&&(zr(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))}function D0(e,t){var n=vr(kt.fromDom(e.getBody()),"*[data-mce-caret]").map(function(e){return e.dom}).getOrNull();if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void R0(e,n)):void(Mr(n)&&(R0(e,n),e.undoManager.add()))}function T0(e,t,n){var r,o,i,a=Ic(e.getBody()),u=R(ic,1===t?a.next:a.prev);!n.collapsed||""===ks(e)||(r=e.dom.getParent(n.startContainer,"PRE"))&&(u(ss.fromRangeStart(n))||(i=e.dom.create(ks(e)),(!xt.ie||11<=xt.ie)&&(i.innerHTML='<br data-mce-bogus="1">'),o=i,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse()))}function O0(t,e){return n=t,r=e?uc.Forwards:uc.Backwards,o=n.selection.getRng(),t0(n,r,o,rp,op,WC).orThunk(function(){return T0(n,r,o),ve.none()}).exists(function(e){return Zy(t,e),!0});var n,r,o}function B0(t,e){return r=e?1:-1,o=(n=t).selection.getRng(),n0(n,r,o,function(e){return rp(e)||tp(e)},function(e){return op(e)||np(e)},WC).orThunk(function(){return T0(n,r,o),ve.none()}).exists(function(e){return Zy(t,e),!0});var n,r,o}function P0(e,t){return r0(e,t,t?op:rp)}function L0(e){return T(["figcaption"],Nt(e))}function I0(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t}function M0(e,t,n){(n?Pn:Wt)(e,t)}function F0(h,v){var b=kt.fromDom(h.getBody()),y=ss.fromRangeStart(h.selection.getRng()),C=ks(h),x=Ns(h),e=y,t=R(je,b);return pr(kt.fromDom(e.container()),mo,t).filter(L0).exists(function(){if(d=b,m=y,v?(p=d.dom,zy(p,m).breakAt.isNone()):(g=d.dom,Uy(g,m).breakAt.isNone())){var e=(t=b,r=x,o=v,""===(n=C)?(l=o,M0(t,f=kt.fromTag("br"),l),I0(f)):(i=t,a=o,u=r,s=kt.fromTag(n),c=kt.fromTag("br"),hn(s,u),Pn(s,c),M0(i,s,a),I0(c)));return h.selection.setRng(e),!0}var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p;return!1})}function U0(e,t){return!!e.selection.isCollapsed()&&F0(e,t)}function z0(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}}function H0(e,t){return M((n=t,H(A(e,function(e){return _e({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:te},e)}),function(e){return n.keyCode===e.keyCode&&n.shiftKey===e.shiftKey&&n.altKey===e.altKey&&n.ctrlKey===e.ctrlKey&&n.metaKey===e.metaKey?[e]:[]})),function(e){return e.action()});var n}function j0(t,e){var n=e?uc.Forwards:uc.Backwards,r=t.selection.getRng();return t0(t,n,r,Zg,ep,Jn).exists(function(e){return Zy(t,e),!0})}function V0(t,e){var n=e?1:-1,r=t.selection.getRng();return n0(t,n,r,Zg,ep,Jn).exists(function(e){return Zy(t,e),!0})}function q0(e,t){return r0(e,t,t?ep:Zg)}function $0(e,t,n,r,o){var i,a=bu(kt.fromDom(n),"td,th,caption").map(function(e){return e.dom}),u=U((i=e,H(a,function(e){var t,n={left:(t=Au(e.getBoundingClientRect())).left- -1,top:t.top- -1,right:t.right+-2,bottom:t.bottom+-2,width:t.width+-1,height:t.height+-1};return[{x:n.left,y:i(n),cell:e},{x:n.right,y:i(n),cell:e}]})),function(e){return t(e,o)}),s=r,c=o;return L(u,function(e,r){return e.fold(function(){return ve.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-s)+Math.abs(e.y-c)),n=Math.sqrt(Math.abs(r.x-s)+Math.abs(r.y-c));return ve.some(n<t?r:e)})},ve.none()).map(function(e){return e.cell})}function W0(e,t,n){var r,o,i=e(t,n);return i.breakType===ly.Wrap&&0===i.positions.length||!Wn(n.getNode())&&i.breakType===ly.Br&&1===i.positions.length?(r=e,o=t,!i.breakAt.exists(function(e){return r(o,e).breakAt.isSome()})):i.breakAt.isNone()}function K0(t,e,n,r){var o,i,a,u=t.selection.getRng(),s=e?1:-1;return!(!Ws()||(o=e,i=n,a=ss.fromRangeStart(u),!Hc(!o,i).exists(function(e){return e.isEqual(a)}))||(Eb(s,t,n,!e,!1).each(function(e){Zy(t,e)}),0))}function X0(u,s,c){var e,t,n=(e=!!s,t=c.getNode(e),zn(t)&&"TABLE"===t.nodeName?ve.some(t):ve.none()),r=!1===s;n.fold(function(){return Zy(u,c.toRange())},function(a){return Hc(r,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Zy(u,c.toRange())},function(e){var n,r,o=s,i=a,t=c;(r=ks(n=u))?n.undoManager.transact(function(){var e=kt.fromTag(r);hn(e,Ns(n)),Pn(e,kt.fromTag("br")),(o?$t:qt)(kt.fromDom(i),e);var t=n.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),Zy(n,t)}):Zy(n,t.toRange())})})}function Y0(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.selection.getRng(),p=ss.fromRangeStart(g),h=e.getBody();if(t||!YC(r,p))return!(!t||!GC(r,p))&&(o=h,d=i=n,X0(e,t,v=Z((m=a=p).getClientRects()).bind(function(e){return XC(d,e.left,e.top)}).bind(function(e){return Py(nf(t=e).map(function(e){return[e].concat(zy(t,e).positions)}).getOr([]),m);var t}).orThunk(function(){return Q(a.getClientRects()).bind(function(e){return By(jy(o,ss.after(i)),e.left)})}).getOr(ss.after(i))),!0);var v=(u=h,l=s=n,Q((f=c=p).getClientRects()).bind(function(e){return KC(l,e.left,e.top)}).bind(function(e){return Py(rf(t=e).map(function(e){return Uy(t,e).positions.concat(e)}).getOr([]),f);var t}).orThunk(function(){return Q(c.getClientRects()).bind(function(e){return By(Hy(u,ss.before(s)),e.left)})}).getOr(ss.before(s)));return X0(e,t,v),!0}function G0(n,r,o){return ve.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return ve.from(n.dom.getParent(t,"table")).map(function(e){return o(n,r,e,t)})}).getOr(!1)}function J0(e,t){return G0(e,t,K0)}function Q0(e,t){return G0(e,t,Y0)}function Z0(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(xo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var s=new Rr(t,t);n=s.current();){if(jn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=s.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else Wn(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),td(e,u)}}function eC(e){return ve.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))}function tC(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t}function nC(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)}function rC(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e}function oC(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!zn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t}function iC(e){e.innerHTML='<br data-mce-bogus="1">'}function aC(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t}function uC(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)}function sC(e,t,n){return!1===jn(t)?n:e?1===n&&t.data.charAt(n-1)===wo?0:n:n===t.data.length-1&&t.data.charAt(n)===wo?t.data.length:n}function cC(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}function lC(e,t){var n=ks(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;ve.from(t.style).map(i.parseStyle).each(function(e){var t=Sn(kt.fromDom(o)),n=_e(_e({},t),e);i.setStyles(o,n)}),dn(ve.from(t.class).map(function(e){return e.split(/\s+/)}),ve.from(o.className).map(function(e){return U(e.split(/\s+/),function(e){return""!==e})}),function(t,e){var n=U(e,function(e){return!T(t,e)}),r=Ae(Ae([],t,!0),n,!0);i.setAttrib(o,"class",r.join(" "))});var n=["style","class"],r=ae(t,function(e,t){return!T(n,t)});i.setAttribs(o,r)}(e,t,Ns(e))}function fC(a,e){function t(e){var t,n=m,r=l.getTextInlineElements(),o=e||"TABLE"===C||"HR"===C?c.create(e||p):b.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))c.setAttrib(o,"style",null),c.setAttrib(o,"class",null);else for(;r[n.nodeName]&&(jc(n)||Jc(n)||(t=n.cloneNode(!1),c.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t))),(n=n.parentNode)&&n!==F;);return lC(a,o),iC(i),o}function n(e){var t,n,r=sC(e,m,g);if(!jn(m)||!(e?0<r:r<m.nodeValue.length)){if(m.parentNode===b&&s&&!e)return 1;if(e&&zn(m)&&m===b.firstChild)return 1;if(aC(m,"TABLE")||aC(m,"HR"))return s&&!e||!s&&e;var o=new Rr(m,b);for(jn(m)&&(e&&0===r?o.prev():e||r!==m.nodeValue.length||o.next());t=o.current();){if(zn(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),f[n]&&"br"!==n))return}else if(jn(t)&&!qr(t.nodeValue))return;e?o.prev():o.next()}return 1}}function r(){u=/^(H[1-6]|PRE|FIGURE)$/.test(C)&&"HGROUP"!==x?t(p):t(),a.getParam("end_container_on_empty_block",!1)&&uC(c,y)&&c.isEmpty(b)?u=c.split(y,b):c.insertAfter(u,b),Z0(a,u)}var o,u,i,s,c=a.dom,l=a.schema,f=l.getNonEmptyElements(),d=a.selection.getRng();Tf(c,d).each(function(e){d.setStart(e.startContainer,e.startOffset),d.setEnd(e.endContainer,e.endOffset)});var m=d.startContainer,g=d.startOffset,p=ks(a),h=!(!e||!e.shiftKey),v=!(!e||!e.ctrlKey);zn(m)&&m.hasChildNodes()&&(s=g>m.childNodes.length-1,m=m.childNodes[Math.min(g,m.childNodes.length-1)]||m,g=s&&jn(m)?m.nodeValue.length:0);var b,y,C,x,w,S,p,E,k,N,_,A,R,D,T,O,B,P,L,I,M,F=cC(c,m);F&&((p&&!h||!p&&h)&&(m=function(e,t,n,r){var o,i,a,u,s,c,l=p||"P",f=e.dom,d=cC(f,n),m=f.getParent(n,f.isBlock);if(!m||!uC(f,m)){if(s=((m=m||d)===e.getBody()||(c=m)&&/^(TD|TH|CAPTION)$/.test(c.nodeName)?m:m.parentNode).nodeName.toLowerCase(),!m.hasChildNodes())return lC(e,o=f.create(l)),m.appendChild(o),t.setStart(o,0),t.setEnd(o,0),o;for(a=n;a.parentNode!==m;)a=a.parentNode;for(;a&&!f.isBlock(a);)a=(i=a).previousSibling;if(i&&e.schema.isValidChild(s,l.toLowerCase())){for(lC(e,o=f.create(l)),i.parentNode.insertBefore(o,i),a=i;a&&!f.isBlock(a);)u=a.nextSibling,o.appendChild(a),a=u;t.setStart(n,r),t.setEnd(n,r)}}return n}(a,d,m,g)),y=(b=c.getParent(m,c.isBlock))?c.getParent(b.parentNode,c.isBlock):null,C=b?b.nodeName.toUpperCase():"","LI"!==(x=y?y.nodeName.toUpperCase():"")||v||(y=(b=y).parentNode,C=x),/^(LI|DT|DD)$/.test(C)&&c.isEmpty(b)?(k=t,N=y,_=b,A=p,I=(E=a).dom,M=E.selection.getRng(),N!==E.getBody()&&(D=(A=nC(R=N)&&nC(R.parentNode)?"LI":A)?k(A):I.create("BR"),oC(N,_,!0)&&oC(N,_,!1)?tC(N,"LI")?(T=rC(N),I.insertAfter(D,T),(null===(L=(P=N).parentNode)||void 0===L?void 0:L.firstChild)===P?I.remove(T):I.remove(N)):I.replace(D,N):(oC(N,_,!0)?tC(N,"LI")?(I.insertAfter(D,rC(N)),D.appendChild(I.doc.createTextNode(" ")),D.appendChild(N)):N.parentNode.insertBefore(D,N):oC(N,_,!1)?I.insertAfter(D,rC(N)):(N=rC(N),(O=M.cloneRange()).setStartAfter(_),O.setEndAfter(N),B=O.extractContents(),"LI"===A&&(B.firstChild&&"LI"===B.firstChild.nodeName)?(D=B.firstChild,I.insertAfter(B,N)):(I.insertAfter(B,N),I.insertAfter(D,N))),I.remove(_)),Z0(E,D))):p&&b===a.getBody()||(p=p||"P",Pr(b)?(u=zr(b),c.isEmpty(b)&&iC(b),lC(a,u),Z0(a,u)):n()?r():n(!0)?(u=b.parentNode.insertBefore(t(),b),Z0(a,aC(b,"HR")?u:b)):((S=(w=d).cloneRange()).setStart(w.startContainer,sC(!0,w.startContainer,w.startOffset)),S.setEnd(w.endContainer,sC(!1,w.endContainer,w.endOffset)),(o=S.cloneRange()).setEndAfter(b),i=o.extractContents(),Y(Vu(kt.fromDom(i),_n),function(e){var t=e.dom;t.nodeValue=Eo(t.nodeValue)}),function(e){for(;jn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(i),u=i.firstChild,c.insertAfter(i,b),function(e,t){var n,r,o=u,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;zn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(n=i.length;n--;)!(o=i[n]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(r=o)&&"A"===r.nodeName&&e.isEmpty(r)&&e.remove(o)}}(c,f),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(c,b),c.isEmpty(b)&&iC(b),u.normalize(),c.isEmpty(u)?(c.remove(u),r()):(lC(a,u),Z0(a,u))),c.setAttrib(u,"id",""),a.fire("NewBlock",{newBlock:u})))}function dC(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),td(e,r)}function mC(e,t){var n=kt.fromTag("br");qt(kt.fromDom(t),n),e.undoManager.add()}function gC(e,t){JC(e.getBody(),t)||$t(kt.fromDom(t),kt.fromTag("br"));var n=kt.fromTag("br");$t(kt.fromDom(t),n),dC(e,n.dom,!1),e.undoManager.add()}function pC(e){return e&&"A"===e.nodeName&&"href"in e}function hC(e){return e.fold(D,pC,pC,D)}function vC(e,t){t.fold(te,R(mC,e),R(gC,e),te)}function bC(e,t){var n,r,o,i=(r=R(ib,n=e),o=ss.fromRangeStart(n.selection.getRng()),ty(r,n.getBody(),o).filter(hC));i.isSome()?i.each(R(vC,e)):function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Tf(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e){for(var t,n=new Rr(c,l),r=e.getNonEmptyElements();t=n.next();)if(r[t.nodeName.toLowerCase()]||0<t.length)return 1}(e.schema)&&(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0),n=i.create("br"),ls(i,a,n),dC(e,n,r),e.undoManager.add()}(e,t)}function yC(e,t){return eC(e).filter(function(e){return 0<t.length&&ze(kt.fromDom(e),t)}).isSome()}function CC(e,t){return yC(e,e.getParam("no_newline_selector",""))}function xC(n){return function(e,t){return""===ks(e)===n}}function wC(n){return function(e,t){return eC(e).filter(function(e){return ho(kt.fromDom(e))}).isSome()===n}}function SC(n,r){return function(e,t){return eC(e).fold(J(""),function(e){return e.nodeName.toUpperCase()})===n.toUpperCase()===r}}function EC(e){return SC("pre",e)}function kC(n){return function(e,t){return e.getParam("br_in_pre",!0)===n}}function NC(e,t){return yC(e,e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption"))}function _C(e,t){return t}function AC(e){var t=ks(e),n=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")}function RC(e,t){return function(n,r){return L(e,function(e,t){return e&&t(n,r)},!0)?ve.some(t):ve.none()}}function DC(e,t){var n,r;n=e,r=t,Wb([RC([CC],QC.none()),RC([SC("summary",!0)],QC.br()),RC([EC(!0),kC(!1),_C],QC.br()),RC([EC(!0),kC(!1)],QC.block()),RC([EC(!0),kC(!0),_C],QC.block()),RC([EC(!0),kC(!0)],QC.br()),RC([wC(!0),_C],QC.br()),RC([wC(!0)],QC.block()),RC([xC(!0),_C,AC],QC.block()),RC([xC(!0)],QC.br()),RC([NC],QC.br()),RC([xC(!1),_C],QC.br()),RC([AC],QC.block())],[n,!(!r||!r.shiftKey)]).getOr(QC.none()).fold(function(){bC(e,t)},function(){fC(e,t)},te)}function TC(e){return e.stopImmediatePropagation()}function OC(e){return e.keyCode===Lf.PAGE_UP||e.keyCode===Lf.PAGE_DOWN}function BC(e,t,n){n&&!e.get()?t.on("NodeChange",TC,!0):!n&&e.get()&&t.off("NodeChange",TC),e.set(n)}function PC(n,r){var e=r.container(),t=r.offset();return jn(e)?(e.insertData(t,n),ve.some(ss(e,t+n.length))):oc(r).map(function(e){var t=kt.fromText(n);return(r.isAtEnd()?$t:qt)(e,t),ss(t.dom,n.length)})}function LC(i,a){return function(e){return r=i,(!Om(o=e)&&(n=o,tf((t=r).dom,n).isNone()||ef(t.dom,n).isNone()||ip(t,n)||ap(t,n)||_m(t,n)||Nm(t,n)||Dm(r,o)||Tm(r,o))?t1:n1)(a);var t,n,r,o}}function IC(e){var t,n,r=ss.fromRangeStart(e.selection.getRng()),o=kt.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=R(ib,e),a=ss.fromRangeStart(e.selection.getRng());return ty(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return tf(n.dom,ss.before(e))},function(e){return nf(e)},function(e){return rf(e)},function(e){return ef(n.dom,ss.after(e))})})).bind(LC(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1}function MC(e){var o,i,a,u,s,t,n,r,c,l,f,d,m,g,p=c0(e);return e.on("keyup compositionstart",R(D0,e)),g=p,(m=e).on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=m,n=g,r=e,o=dt().os,H0([{keyCode:Lf.RIGHT,action:z0(O0,t,!0)},{keyCode:Lf.LEFT,action:z0(O0,t,!1)},{keyCode:Lf.UP,action:z0(B0,t,!1)},{keyCode:Lf.DOWN,action:z0(B0,t,!0)},{keyCode:Lf.RIGHT,action:z0(J0,t,!0)},{keyCode:Lf.LEFT,action:z0(J0,t,!1)},{keyCode:Lf.UP,action:z0(Q0,t,!1)},{keyCode:Lf.DOWN,action:z0(Q0,t,!0)},{keyCode:Lf.RIGHT,action:z0(j0,t,!0)},{keyCode:Lf.LEFT,action:z0(j0,t,!1)},{keyCode:Lf.UP,action:z0(V0,t,!1)},{keyCode:Lf.DOWN,action:z0(V0,t,!0)},{keyCode:Lf.RIGHT,action:z0(u0,t,n,!0)},{keyCode:Lf.LEFT,action:z0(u0,t,n,!1)},{keyCode:Lf.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:z0(VC,t,n)},{keyCode:Lf.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:z0(qC,t,n)},{keyCode:Lf.UP,action:z0(U0,t,!1)},{keyCode:Lf.DOWN,action:z0(U0,t,!0)}],r).each(function(e){r.preventDefault()}))}),d=p,(f=e).on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=d,r=e,H0([{keyCode:Lf.BACKSPACE,action:z0(E0,t=f,!1)},{keyCode:Lf.BACKSPACE,action:z0(Mb,t,!1)},{keyCode:Lf.DELETE,action:z0(Mb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Tb,t,!1)},{keyCode:Lf.DELETE,action:z0(Tb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(m0,t,n,!1)},{keyCode:Lf.DELETE,action:z0(m0,t,n,!0)},{keyCode:Lf.BACKSPACE,action:z0(yg,t,!1)},{keyCode:Lf.DELETE,action:z0(yg,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Fb,t,!1)},{keyCode:Lf.DELETE,action:z0(Fb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(b0,t,!1)},{keyCode:Lf.DELETE,action:z0(b0,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Sb,t,!1)},{keyCode:Lf.DELETE,action:z0(Sb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(Cb,t,!1)},{keyCode:Lf.DELETE,action:z0(Cb,t,!0)},{keyCode:Lf.BACKSPACE,action:z0(h0,t,!1)},{keyCode:Lf.DELETE,action:z0(h0,t,!0)}],r).each(function(e){r.preventDefault()}))}),f.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(n=e,H0([{keyCode:Lf.BACKSPACE,action:z0(Ib,t=f)},{keyCode:Lf.DELETE,action:z0(Ib,t)}],n))}),(l=e).on("keydown",function(e){var t,n,r;e.keyCode===Lf.ENTER&&(t=l,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),DC(t,n)})))}),(c=e).on("keydown",function(e){var t;!1===e.isDefaultPrevented()&&(t=e,H0([{keyCode:Lf.SPACEBAR,action:z0(IC,c)}],t).each(function(e){t.preventDefault()}))}),n=t=e,r=du(function(){n.composing||Um(n)},0),ZC.isIE()&&(n.on("keypress",function(e){r.throttle()}),n.on("remove",function(e){r.cancel()})),t.on("input",function(e){!1===e.isComposing&&Um(t)}),s=p,(u=e).on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=s,r=e,H0([{keyCode:Lf.END,action:z0(P0,t=u,!0)},{keyCode:Lf.HOME,action:z0(P0,t,!1)},{keyCode:Lf.END,action:z0(q0,t,!0)},{keyCode:Lf.HOME,action:z0(q0,t,!1)},{keyCode:Lf.END,action:z0(l0,t,!0,n)},{keyCode:Lf.HOME,action:z0(l0,t,!1,n)}],r).each(function(e){r.preventDefault()}))}),o=e,i=p,e1.os.isOSX()||(a=iu(!1),o.on("keydown",function(e){OC(e)&&BC(a,o,!0)}),o.on("keyup",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(r=e,H0([{keyCode:Lf.PAGE_UP,action:z0(l0,t=o,!1,n=i)},{keyCode:Lf.PAGE_DOWN,action:z0(l0,t,!0,n)}],r)),OC(e)&&a.get()&&(BC(a,o,!1),o.nodeChanged())})),p}(Fy=My=My||{})[Fy.Up=-1]="Up",Fy[Fy.Down=1]="Down";var FC=R(Vy,My.Up,Tu,Ou),UC=R(Vy,My.Down,Ou,Tu),zC=Yn,HC=Ys,jC=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=ss.fromRangeEnd(n),i=zy(r,o);return Z(i.positions)}return o=ss.fromRangeStart(n),Q((i=Uy(r,o)).positions)},VC=R(s0,!0),qC=R(s0,!1),$C=function(e){return U(A(e.selection.getSelectedBlocks(),kt.fromDom),function(e){return!w0(e)&&!Ot(e).exists(w0)&&pr(e,function(e){return Xn(e.dom)||Yn(e.dom)}).exists(function(e){return Xn(e.dom)})})},WC=Yn,KC=R($0,function(e){return e.bottom},function(e,t){return e.y<t}),XC=R($0,function(e){return e.top},function(e,t){return e.y>t}),YC=R(W0,Uy),GC=R(W0,zy),JC=function(e,t){return n=ss.after(t),!!Wn(n.getNode())||ef(e,ss.after(t)).map(function(e){return Wn(e.getNode())}).getOr(!1);var n},QC=or([{br:[]},{block:[]},{none:[]}]),ZC=dt().browser,e1=dt(),t1=R(PC,xo),n1=R(PC," "),r1=(o1.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,function(e){return e===r||void n.push(e)}),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e))},o1.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;0<=t&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},o1);function o1(r){var o;this.lastPath=[],this.editor=r;var t=this;"onselectionchange"in r.getDoc()||r.on("NodeChange click mouseup keyup focus",function(e){var t=r.selection.getRng(),n={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};"nodechange"!==e.type&&kf(n,o)||r.fire("SelectionChange"),o=n}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!e||!xt.range&&r.selection.isCollapsed()||Bl(r)&&!t.isSameElementPath(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("mouseup",function(e){!e.isDefaultPrevented()&&Bl(r)&&("IMG"===r.selection.getNode().nodeName?_r.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())})}function i1(e){return zn(e)&&go(kt.fromDom(e))}function a1(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}}function u1(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function s1(e,S){var E=_r.throttle(function(e,t){S._selectionOverrides.hideFakeCaret(),S.selection.placeCaretAt(e,t)},0);return S.on("remove",E.stop),function(w){return e.on(function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x=Math.max(Math.abs(w.screenX-e.screenX),Math.abs(w.screenY-e.screenY));if(!e.dragging&&10<x){if(S.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,S.focus()}e.dragging&&(d=e,t={pageX:(p=w,h=(g=S).inline?a1(g.getBody()):{left:0,top:0},C=(y=g).getBody(),v=y.inline?{left:C.scrollLeft,top:C.scrollTop}:{left:0,top:0},(m={pageX:(b=function(e,t){if(t.target.ownerDocument===e.getDoc())return{left:t.pageX,top:t.pageY};var n,r,o,i,a,u=a1(e.getContentAreaContainer()),s=(r=(n=e).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:t.pageX-u.left+s.left,top:t.pageY-u.top+s.top}}(g,p)).left-h.left+v.left,pageY:b.top-h.top+v.top}).pageX-d.relX),pageY:m.pageY+5},l=e.ghost,f=S.getBody(),l.parentNode!==f&&f.appendChild(l),n=e.ghost,o=e.width,i=e.height,a=e.maxX,u=e.maxY,c=s=0,n.style.left=(r=t).pageX+"px",n.style.top=r.pageY+"px",u<r.pageY+i&&(c=r.pageY+i-u),n.style.width=o-(s=a<r.pageX+o?r.pageX+o-a:s)+"px",n.style.height=i-c+"px",E(w.clientX,w.clientY))})}}function c1(e){function t(e){var t,n,r,o,i,a;0===e.button&&(t=M(c.dom.getParents(e.target),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}}(P1,L1)).getOr(null),i=c.getBody(),P1(a=t)&&a!==i&&(n=c.dom.getPos(t),r=c.getBody(),o=c.getDoc().documentElement,u.set({element:t,dragging:!1,screenX:e.screenX,screenY:e.screenY,maxX:(c.inline?r.scrollWidth:o.offsetWidth)-2,maxY:(c.inline?r.scrollHeight:o.offsetHeight)-2,relX:e.pageX-n.x,relY:e.pageY-n.y,width:t.offsetWidth,height:t.offsetHeight,ghost:function(e,t,n){var r=c.dom,o=e.cloneNode(!0);r.setStyles(o,{width:t,height:n}),r.setAttrib(o,"data-mce-selected",null);var i=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:t,height:n}),r.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,t.offsetWidth,t.offsetHeight)})))}function n(u){i.on(function(e){var t,n,r,o,i,a;e.dragging&&((o=3===(a=(r=s).selection.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a)===(i=e.element)||r.dom.isChildOf(o,i)||P1(o)||((n=e.element.cloneNode(!0)).removeAttribute("data-mce-selected"),t=n,s.fire("drop",{clientX:u.clientX,clientY:u.clientY}).isDefaultPrevented()||s.undoManager.transact(function(){u1(e.element),s.insertContent(s.dom.getOuterHTML(t)),s._selectionOverrides.hideFakeCaret()})),s.fire("dragend"))}),I1(i)}var r,o,i,s,u,c,a=fu(),l=Za.DOM,f=document,d=s1(u=a,c=e),m=(r=i=a,function(){r.on(function(e){e.dragging&&o.fire("dragend")}),I1(r)});(o=s=e).on("mousedown",t),e.on("mousemove",d),e.on("mouseup",n),l.bind(f,"mousemove",d),l.bind(f,"mouseup",m),e.on("remove",function(){l.unbind(f,"mousemove",d),l.unbind(f,"mouseup",m)}),e.on("keydown",function(e){e.keyCode===Lf.ESC&&m()})}function l1(e){var n,i;function a(e){var t;e.isDefaultPrevented()||(t=e.dataTransfer)&&(T(t.types,"Files")||0<t.files.length)&&(e.preventDefault(),"drop"===e.type&&Uv(i,"Dropped file type is not supported"))}function u(e){gd(i,e.target)&&a(e)}function t(){var t=Za.DOM,n=i.dom,r=document,o=i.inline?i.getBody():i.getDoc(),e=["drop","dragover"];Y(e,function(e){t.bind(r,e,u),n.bind(o,e,a)}),i.on("remove",function(){Y(e,function(e){t.unbind(r,e,u),n.unbind(o,e,a)})})}c1(e),(n=e).on("drop",function(e){var t=void 0!==e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;!P1(t)&&"false"!==n.dom.getContentEditableParent(t)||e.preventDefault()}),e.getParam("block_unsupported_drop",!0,"boolean")&&(i=e).on("init",function(){_r.setEditorTimeout(i,t,0)})}function f1(e,t){return vf(e.getBody(),t)}function d1(l){function f(e){return e!==x&&(F1(e)||Jn(e))&&y.isChildOf(e,x)}function c(e){return rp(e)||op(e)||Zg(e)||ep(e)}function d(e){e&&b.setRng(e)}function m(e,t,n,r){return void 0===r&&(r=!0),l.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&b.scrollIntoView(t,-1===e),i.show(n,t))}function t(e){return Ir(e)||_o(e)||Ao(e)}function g(e){return t(e.startContainer)||t(e.endContainer)}function p(e,t){if(!e)return null;if(e.collapsed){if(!g(e)){var n=t?1:-1,r=rc(n,x,e),o=r.getNode(!t);if(Ks(o))return m(n,o,!!t&&!r.isAtEnd(),!1);var i=r.getNode(t);if(Ks(i))return m(n,i,!t&&!r.isAtEnd(),!1)}return null}var a=e.startContainer,u=e.startOffset,s=e.endOffset;if(3===a.nodeType&&0===u&&F1(a.parentNode)&&(a=a.parentNode,u=y.nodeIndex(a),a=a.parentNode),1!==a.nodeType)return null;if(s===u+1&&a===e.endContainer){var c=a.childNodes[u];if(f(c))return function(e){var t=e.cloneNode(!0),n=l.fire("ObjectSelected",{target:e,targetClone:t});if(n.isDefaultPrevented())return null;var r=function(e,t,n){var r=l.$,o=vr(kt.fromDom(l.getBody()),"#"+w).fold(function(){return r([])},function(e){return r([e.dom])});0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",w)).appendTo(l.getBody());var i=y.createRng();t===n&&xt.ie?(o.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(t),i.setStartAfter(o[0].firstChild.firstChild),i.setEndAfter(t)):(o.empty().append(xo).append(t).append(xo),i.setStart(o[0].firstChild,1),i.setEnd(o[0].lastChild,0)),o.css({top:y.getPos(e,l.getBody()).y}),o[0].focus();var a=b.getSel();return a.removeAllRanges(),a.addRange(i),i}(e,n.targetClone,t),o=kt.fromDom(e);return Y(bu(kt.fromDom(l.getBody()),"*[data-mce-selected]"),function(e){je(o,e)||yn(e,S)}),y.getAttrib(e,S)||e.setAttribute(S,"1"),v=e,E(),r}(c)}return null}function h(){v&&v.removeAttribute(S),vr(kt.fromDom(l.getBody()),"#"+w).each(Ln),v=null}var v,n,e,o,b=l.selection,y=l.dom,C=y.isBlock,x=l.getBody(),i=$s(l,x,C,function(){return yd(l)}),w="sel-"+y.uniqueId(),S="data-mce-selected",r=b.getRng,E=function(){i.hide()};return xt.ceFalse&&!hh(l)&&(l.on("mouseup",function(e){var t=r();t.collapsed&&cv(l,e.clientX,e.clientY)&&Nb(l,t,!1).each(d)}),l.on("click",function(e){var t=f1(l,e.target);t&&(F1(t)&&(e.preventDefault(),l.focus()),M1(t)&&y.isChildOf(t,b.getNode())&&h())}),l.on("blur NewBlock",h),l.on("ResizeWindow FullscreenStateChanged",i.reposition),l.on("tap",function(e){var t=e.target,n=f1(l,t);F1(n)?(e.preventDefault(),kb(l,n).each(p)):f(t)&&kb(l,t).each(p)},!0),l.on("mousedown",function(e){var t,n,r,o,i,a,u,s=e.target;s!==x&&"HTML"!==s.nodeName&&!y.isChildOf(s,x)||!1===cv(l,e.clientX,e.clientY)||((t=f1(l,s))?F1(t)?(e.preventDefault(),kb(l,t).each(p)):(h(),M1(t)&&e.shiftKey||bf(e.clientX,e.clientY,b.getRng())||(E(),b.placeCaretAt(e.clientX,e.clientY))):f(s)?kb(l,s).each(p):!1===Ks(s)&&(h(),E(),(n=Qy(x,e.clientX,e.clientY))&&(r=s,o=n.node,a=y.getParent(r,C),u=y.getParent(o,C),!K(a)&&(r!==u&&y.isChildOf(a,u)&&!1===F1(f1(l,a))||!y.isChildOf(u,a)&&(i=u,y.getParent(a,C)!==y.getParent(i,C))&&function(e){var t=e.firstChild;if(!K(t)){var n=ss.before(t);if(Wn(n.getNode())&&1===e.childNodes.length)return!c(n);var r=Ic(e).next(n);return r&&!c(r)}}(a))||(e.preventDefault(),d(m(1,n.node,n.before,!1)),l.getBody().focus()))))}),l.on("keypress",function(e){Lf.modifierPressed(e)||F1(b.getNode())&&e.preventDefault()}),l.on("GetSelectionRange",function(e){var t=e.range;v&&(v.parentNode?((t=t.cloneRange()).selectNode(v),e.range=t):v=null)}),l.on("SetSelectionRange",function(e){var t,n,r,o,i,a,u;e.range=(t=e.range,n=l.schema.getShortEndedElements(),r=y.createRng(),o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,ke(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),ke(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r);var s=p(e.range,e.forward);s&&(e.range=s)}),l.on("AfterSetSelectionRange",function(e){var t=e.range,n=t.startContainer.parentNode;g(t)||"mcepastebin"===n.id||E(),y.hasClass(n,"mce-offscreen-selection")||h()}),l.on("copy",function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||xt.ie||(t=(n=y.get(w))&&n.getElementsByTagName("*")[0])&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))}),l1(l),e=du(function(){var e,t;n.removed||!n.getBody().contains(document.activeElement)||(e=n.selection.getRng()).collapsed&&(t=_b(n,e,!1),n.selection.setRng(t))},0),(n=l).on("focus",function(){e.throttle()}),n.on("blur",function(){e.cancel()}),(o=l).on("init",function(){o.on("focusin",function(e){var t,n,r=e.target;Jn(r)&&(t=vf(o.getBody(),r),n=Yn(t)?t:r,o.selection.getNode()!==n&&kb(o,n).each(function(e){return o.selection.setRng(e)}))})})),{showCaret:m,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(zr(e),d(r()),b.scrollIntoView(e))},hideFakeCaret:E,destroy:function(){i.destroy(),v=null}}}function m1(a){function e(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(e){}}function u(e){return e.isDefaultPrevented()}function t(){a.shortcuts.add("meta+a",null,"SelectAll")}function n(){a.inline||b.bind(a.getDoc(),"mousedown mouseup",function(e){var t;e.target===a.getDoc().documentElement&&(t=y.getRng(),a.getBody().focus(),"mousedown"===e.type?Ir(t.startContainer)||y.placeCaretAt(e.clientX,e.clientY):y.setRng(t))})}function r(){Range.prototype.getClientRects||a.on("mousedown",function(e){var t;u(e)||"HTML"!==e.target.nodeName||((t=a.getBody()).blur(),_r.setEditorTimeout(a,function(){t.focus()}))})}function o(){a.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==b.getContentEditableParent(t)&&(e.preventDefault(),a.selection.select(t),a.nodeChanged()),"A"===t.nodeName&&b.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),y.select(t))})}function i(){a.on("keydown",function(e){if(!u(e)&&e.keyCode===h&&y.isCollapsed()&&0===y.getRng().startOffset){var t=y.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function s(){a.getParam("readonly")||a.on("BeforeExecCommand mousedown",function(){e("StyleWithCSS",!1),e("enableInlineTableEditing",!1),Bs(a)||e("enableObjectResizing",!1)})}function c(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function l(){a.inline||a.on("keydown",function(){document.activeElement===document.body&&a.getWin().focus()})}function f(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){var t;"HTML"===e.target.nodeName&&(11<xt.ie?a.getBody().focus():(t=a.selection.getRng(),a.getBody().focus(),a.selection.setRng(t),a.selection.normalize(),a.nodeChanged()))}))}function d(){xt.mac&&a.on("keydown",function(e){!Lf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),a.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})}function m(){a.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function g(){a.on("init",function(){a.dom.bind(a.getBody(),"submit",function(e){e.preventDefault()})})}var p=Et.each,h=Lf.BACKSPACE,v=Lf.DELETE,b=a.dom,y=a.selection,C=a.parser,x=xt.gecko,w=xt.ie,S=xt.webkit,E="data:text/mce-internal,",k=w?"Text":"URL",N=te;return hh(a)?(S&&(n(),o(),g(),t(),xt.iOS&&(l(),f(),m())),x&&(r(),s(),c(),d())):(a.on("keydown",function(e){if(!u(e)&&e.keyCode===Lf.BACKSPACE){var t,n=(t=y.getRng()).startContainer,r=t.startOffset,o=b.getRoot(),i=n;if(t.collapsed&&0===r){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(a.formatter.toggle("blockquote",null,i),(t=b.createRng()).setStart(n,0),t.setEnd(n,0),y.setRng(t))}}}),a.on("keydown",function(e){var t,n,r,o,i=e.keyCode;u(e)||i!==v&&i!==h||(t=a.selection.isCollapsed(),n=a.getBody(),t&&!b.isEmpty(n)||!t&&(r=R(a.selection.getRng()),(o=b.createRng()).selectNode(a.getBody()),r!==R(o))||(e.preventDefault(),a.setContent(""),n.firstChild&&b.isBlock(n.firstChild)?a.selection.setCursorLocation(n.firstChild,0):a.selection.setCursorLocation(n,0),a.nodeChanged()))}),xt.windowsPhone||a.on("keyup focusin mouseup",function(e){Lf.modifierPressed(e)||y.normalize()},!0),S&&(n(),o(),ks(a)&&a.on("init",function(){e("DefaultParagraphSeparator",ks(a))}),g(),i(),C.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),xt.iOS?(l(),f(),m()):t()),11<=xt.ie&&(f(),i()),xt.ie&&(t(),e("AutoUrlDetect",!1),a.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(a.selection.isCollapsed()&&"IMG"===t.target.tagName&&y.select(t.target),0<(n=a.selection.getContent()).length&&(r=E+escape(a.id)+","+escape(n),t.dataTransfer.setData(k,r)))}),a.on("drop",function(e){var t,n,r,o;u(e)||(t=e.dataTransfer&&(o=e.dataTransfer.getData(k))&&0<=o.indexOf(E)?(o=o.substr(E.length).split(","),{id:unescape(o[0]),html:unescape(o[1])}):null)&&t.id!==a.id&&(e.preventDefault(),n=Ef(e.x,e.y,a.getDoc()),y.setRng(n),r=t.html,a.queryCommandSupported("mceInsertClipboardContent")?a.execCommand("mceInsertClipboardContent",!1,{content:r,internal:!0}):a.execCommand("mceInsertContent",!1,r))})),x&&(a.on("keydown",function(e){if(!u(e)&&e.keyCode===h&&a.getBody().getElementsByTagName("hr").length&&y.isCollapsed()&&0===y.getRng().startOffset){var t=y.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return b.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(b.remove(n),e.preventDefault())}}),r(),a.on("keypress",function(e){var t;if(!u(e)&&(8===e.keyCode||46===e.keyCode)&&A())return t=_(),a.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),b.bind(a.getDoc(),"cut",function(e){var t;!u(e)&&A()&&(t=_(),_r.setEditorTimeout(a,function(){t()}))}),s(),a.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||p(b.select("a"),function(e){var t=e.parentNode,n=b.getRoot();if(t.lastChild===e){for(;t&&!b.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}b.add(t,"br",{"data-mce-bogus":1})}})}),c(),d(),i())),{refreshContentEditable:N,isHidden:function(){if(!x||a.removed)return!1;var e=a.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}};function _(){var e=b.getAttribs(y.getStart().cloneNode(!1));return function(){var t=y.getStart();t!==a.getBody()&&(b.setAttrib(t,"style",null),p(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function A(){return!y.isCollapsed()&&b.getParent(y.getStart(),b.isBlock)!==b.getParent(y.getEnd(),b.isBlock)}function R(e){var t=b.create("body"),n=e.cloneContents();return t.appendChild(n),y.serializer.serialize(t,{format:"html"})}}function g1(e){return ae(e,function(e){return!1===b(e)})}function p1(e){var t=e.settings;return g1({block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements,padd_empty_block_inline_children:t.format_empty_lines})}function h1(e){var t=e.settings,n=e.editorUpload.blobCache;return g1({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:e.inline?e.getElement().nodeName.toLowerCase():void 0,validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})}function v1(e){var t,u,n;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("Init"),e.focus(!0),n=(u=e).dom.getRoot(),u.inline||Bl(u)&&u.selection.getStart(!0)!==n||nf(n).each(function(e){var t,n,r,o,i=e.getNode(),a=cn(i)?nf(i).getOr(e):e;xt.browser.isIE()?(t=u,n=a.toRange(),r=kt.fromDom(t.getBody()),o=(sd(t)?ve.from(n):ve.none()).map(cd).filter(ud(r)),t.bookmark=o.isSome()?o:t.bookmark):u.selection.setRng(a.toRange())}),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&_r.setEditorTimeout(t,function(){var e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus);e.destroyed||e.focus()},100)}function b1(e){return(e.inline?e.ui:e.dom).styleSheetLoader}function y1(e){function t(){o.unloadAll(a),e.inline||e.ui.styleSheetLoader.unloadAll(i)}function n(){e.removed?t():e.on("remove",t)}var r,o=b1(e),i=Os(e),a=e.contentCSS;0<e.contentStyles.length&&(r="",Et.each(e.contentStyles,function(e){r+=e+"\r\n"}),e.dom.addStyle(r));var u,s,c,l,f,d,m,g,p,h=Nr.all((u=e,s=a,c=i,l=[new Nr(function(e,t){return b1(u).loadAll(s,e,t)})],u.inline?l:l.concat([new Nr(function(e,t){return u.ui.styleSheetLoader.loadAll(c,e,t)})]))).then(n).catch(n);return e.settings.content_style&&(d=(f=e).settings.content_style,m=kt.fromDom(f.getBody()),g=jt(Bn(m)),pn(p=kt.fromTag("style"),"type","text/css"),Pn(p,kt.fromText(d)),Pn(g,p),f.on("remove",function(){Ln(p)})),h}function C1(e){var t;!0!==e.removed&&(hh(t=e)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),v1(e))}function x1(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(U1.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var u,i,a,s,c,l,f,d,m,g,p,h,v=t.getBody();v.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===U1.getStyle(v,"position",!0)&&(v.style.position="relative"),v.contentEditable=t.getParam("content_editable_state",!0)),v.disabled=!1,t.editorUpload=Gv(t),t.schema=ro(p1(t)),t.dom=Za(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:t.getParam("content_css_cors",!1,"boolean"),referrerPolicy:Rs(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((i=Xh(h1(u=t),u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o=e.length,i=u.dom,a="data-mce-"+t;o--;)(r=(n=e[o]).attr(t))&&!n.attr(a)&&0!==r.indexOf("data:")&&0!==r.indexOf("blob:")&&("style"===t?((r=i.serializeStyle(i.parseStyle(r),n.name)).length||(r=null),n.attr(a,r),n.attr(t,r)):"tabindex"===t?(n.attr(a,r),n.attr(t,null)):n.attr(a,u.convertURL(r,t,n.name)))}),i.addNodeFilter("script",function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}}),u.settings.preserve_cdata&&i.addNodeFilter("#cdata",function(e){for(var t=e.length;t--;){var n=e[t];n.type=8,n.name="#comment",n.value="[CDATA["+u.dom.encode(n.value)+"]]"}}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,n=u.schema.getNonEmptyElements();t--;){var r=e[t];r.isEmpty(n)&&0===r.getAll("br").length&&(r.append(new Hd("br",1)).shortEnded=!0)}}),i),t.serializer=Jh((s=(a=t).settings,_e(_e(_e({},h1(a)),p1(a)),g1({url_converter:s.url_converter,url_converter_scope:s.url_converter_scope,element_format:s.element_format,entities:s.entities,entity_encoding:s.entity_encoding,indent:s.indent,indent_after:s.indent_after,indent_before:s.indent_before}))),t),t.selection=Fh(t.dom,t.getWin(),t.serializer,t),t.annotator=Ul(t),t.formatter=eb(t),t.undoManager=nb(t),t._nodeChangeDispatcher=new r1(t),t._selectionOverrides=d1(t),m=t,g=fu(),p=iu(!1),h=mu(function(e){m.fire("longpress",_e(_e({},e),{type:"longpress"})),p.set(!0)},400),m.on("touchstart",function(n){N0(n).each(function(e){h.cancel();var t={x:e.clientX,y:e.clientY,target:n.target};h.throttle(n),p.set(!1),g.set(t)})},!0),m.on("touchmove",function(e){h.cancel(),N0(e).each(function(i){g.on(function(e){var t=i,n=e,r=Math.abs(t.clientX-n.x),o=Math.abs(t.clientY-n.y);(5<r||5<o)&&(g.clear(),p.set(!1),m.fire("longpresscancel"))})})},!0),m.on("touchend touchcancel",function(t){h.cancel(),"touchcancel"!==t.type&&g.get().filter(function(e){return e.target.isEqualNode(t.target)}).each(function(){p.get()?t.preventDefault():m.fire("tap",_e(_e({},t),{type:"tap"}))})},!0),(f=l=t).on("click",function(e){f.dom.getParent(e.target,"details")&&e.preventDefault()}),(d=l).parser.addNodeFilter("details",function(e){Y(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),d.serializer.addNodeFilter("details",function(e){Y(e,function(e){var t=e.attr("data-mce-open");e.attr("open",X(t)?t:null),e.attr("data-mce-open",null)})}),hh(t)||(c=t).on("click",function(e){var t,n,r,o,i;3<=e.detail&&(r=(t=c).selection.getRng(),o=ss.fromRangeStart(r),i=ss.fromRangeEnd(r),!ss.isElementPosition(o)||i1(n=o.container())&&nf(n).each(function(e){return r.setStart(e.container(),e.offset())}),!ss.isElementPosition(i)||i1(n=o.container())&&rf(n).each(function(e){return r.setEnd(e.container(),e.offset())}),t.selection.setRng(Cg(r)))});var b,y,C,x,w,S,E,k,N,_=hh(b=t)?iu(null):MC(b);N=_,(k=t).addCommand("delete",function(){var e,t=N;E0(e=k)||Mb(e,!1)||Tb(e,!1)||m0(e,t,!1)||Cb(e,!1)||yg(e)||Fb(e,!1)||b0(e,!1)||Sb(e)||h0(e,!1)||(k0(e,"Delete"),lb(e))}),k.addCommand("forwardDelete",function(){var e,t=N;Mb(e=k,!0)||Tb(e,!0)||m0(e,t,!0)||Cb(e,!0)||yg(e)||Fb(e,!0)||b0(e,!0)||Sb(e)||h0(e,!0)||k0(e,"ForwardDelete")}),ks(y=t)&&y.on("NodeChange",R(A0,y)),x=(C=t).dom,w=ks(C),S=C.getParam("placeholder",hc.getAttrib(C.getElement(),"placeholder"),"string"),E=function(e,t){var n,r,o;!function(e){if(rb(e)){var t=e.keyCode;return!ob(e)&&(Lf.metaKeyPressed(e)||e.altKey||112<=t&&t<=123||T(hy,t))}}(e)&&(n=C.getBody(),r=!(rb(o=e)&&!(ob(o)||"keyup"===o.type&&229===o.keyCode))&&function(e,t,n){if(Wr(kt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return!o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(x,n,w),""!==x.getAttrib(n,vy)===r&&!t||(x.setAttrib(n,vy,r?S:null),x.setAttrib(n,"aria-placeholder",r?S:null),C.fire("PlaceholderToggle",{state:r}),C.on(r?"keydown":"keyup",E),C.off(r?"keyup":"keydown",E)))},S&&C.on("init",function(e){E(e,!0),C.on("change SetContent ExecCommand",E),C.on("paste",function(e){return _r.setEditorTimeout(C,function(){return E(e)})})});var A=vh(t);(function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();t.fire("PreInit"),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,U1.setAttrib(r,"spellcheck","false")),t.quirks=m1(t),t.fire("PostRender");var o=t.getParam("directionality",cu.isRtl()?"rtl":void 0);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",function(t){Et.each(e.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type})})(t),A.fold(function(){y1(t).then(function(){return C1(t)})},function(e){t.setProgressState(!0),y1(t).then(function(){e().then(function(e){t.setProgressState(!1),C1(t)},function(e){t.notificationManager.open({type:"error",text:String(e)}),C1(t)})})})}function w1(e,t){var n,r,o,i,a=e.translate("Rich Text Area"),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),hn(i=kt.fromTag("iframe"),o),hn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),hu(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(document.domain!==window.location.hostname&&xt.browser.isIE()){var n=$v("mce");e[n]=function(){x1(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return z1.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=function(e){var t=e.getParam("doctype","<!DOCTYPE html>")+"<html><head>";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=Ss(e,"body_id","tinymce"),r=Ss(e,"body_class",""),o=e.translate(e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string"));return Es(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+Es(e)+'" />'),t+('</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id)+'" aria-label="'+o+'"><br></body></html>'}(e),z1.add(t.iframeContainer,u),s}function S1(e){return e.replace(/^\-/,"")}function E1(e){return{editorContainer:e,iframeContainer:e,api:{}}}function k1(e){var t,n,r,o,i,a,u,s=e.getElement();return e.orgDisplay=s.style.display,X(Ls(e))?e.theme.renderUI():y(Ls(e))?(n=(t=e).getElement(),(r=Ls(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight||n.offsetHeight,r):(u=(o=e).getElement(),o.inline?E1(null):(i=u,a=H1.create("div"),H1.insertAfter(a,i),E1(a)))}function N1(e){var n,t,r,o,i,a,u,s;e.fire("ScriptsLoaded"),n=e,t=Et.trim(As(n)),r=n.ui.registry.getAll().icons,ne(_e(_e({},Dv.get("default").icons),Dv.get(t).icons),function(e,t){ke(r,t)||n.ui.registry.addIcon(t,e)}),a=Ls(o=e),X(a)?(o.settings.theme=S1(a),i=Iv.get(a),o.theme=new i(o,Iv.urls[a]),o.theme.init&&o.theme.init(o,Iv.urls[a]||o.documentBaseUrl.replace(/\/$/,""),o.$)):o.theme={},s=[],Et.each(Ms(u=e).split(/[ ,]/),function(e){j1(u,s,S1(e))});var c=k1(e),l=e,f=ve.from(c.api).getOr({}),d={show:ve.from(f.show).getOr(te),hide:ve.from(f.hide).getOr(te),disable:ve.from(f.disable).getOr(te),isDisabled:ve.from(f.isDisabled).getOr(D),enable:function(){l.mode.isReadOnly()||ve.from(f.enable).map(x)}};l.ui=_e(_e({},l.ui),d);var m,g,p,h={editorContainer:c.editorContainer,iframeContainer:c.iframeContainer};return e.editorContainer=h.editorContainer||null,Vv(e),e.inline?x1(e):(p=w1(m=e,g=h),g.editorContainer&&(z1.get(g.editorContainer).style.display=m.orgDisplay,m.hidden=z1.isHidden(g.editorContainer)),m.getElement().style.display="none",z1.setAttrib(m.id,"aria-hidden","true"),void(p||x1(m)))}function _1(e){return"-"===e.charAt(0)}function A1(t,e,n){return ve.from(e).filter(function(e){return 0<e.length&&!Dv.has(e)}).map(function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:ve.some(e)}})}function R1(c,l){var e,t,f=ru.ScriptLoader,n=f,r=l,o=function(){var r,o,t,n,e,i,a,u,s;e=f,u=Ds(i=c),s=i.getParam("language_url","","string"),!1===cu.hasCode(u)&&"en"!==u&&(a=""!==s?s:i.editorManager.baseURL+"/langs/"+u+".js",e.add(a,te,void 0,function(){zv(i,"LanguageLoadError",Hv("language",a,u))})),t=f,Y(function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t}([A1(n=c,"default",l),ve.from(n.getParam("icons_url","","string")).filter(function(e){return 0<e.length}).map(function(e){return{url:e,name:ve.none()}}).orThunk(function(){return A1(n,As(n),"")})]),function(e){t.add(e.url,te,void 0,function(){zv(n,"IconsLoadError",Hv("icons",e.url,e.name.getOrUndefined()))})}),r=c,o=l,Et.each(r.getParam("external_plugins"),function(e,t){Lv.load(t,e,te,void 0,function(){jv(r,e,t)}),r.settings.plugins+=" "+t}),Et.each(Ms(r).split(/[ ,]/),function(e){var t,n;(e=Et.trim(e))&&!Lv.urls[e]&&(_1(e)?(e=e.substr(1,e.length),t=Lv.dependencies(e),Et.each(t,function(e){var t=Lv.createUrl({prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"},e);Lv.load(t.resource,t,te,void 0,function(){jv(r,t.prefix+t.resource+t.suffix,t.resource)})})):(n={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"},Lv.load(e,n,te,void 0,function(){jv(r,n.prefix+n.resource+n.suffix,e)})))}),f.loadQueue(function(){c.removed||N1(c)},c,function(){c.removed||N1(c)})},i=Ls(e=c);X(i)?(_1(i)||ke(Iv.urls,i)||((t=e.getParam("theme_url"))?Iv.load(i,e.documentBaseURI.toAbsolute(t)):Iv.load(i,"themes/"+i+"/theme"+r+".js")),n.loadQueue(function(){Iv.waitFor(i,o)})):o()}function D1(a){return function(i,e){return ve.from(e).map(kt.fromDom).filter(Nn).bind(function(e){return n=a,t=i,r=e.dom,Tg(kt.fromDom(r),function(e){return wn(t=e,n).orThunk(function(){return"font"===Nt(t)?ue(q1,n).bind(function(e){return bn(t,e)}):ve.none()});var t},function(e){return je(kt.fromDom(t),e)}).or((o=e.dom,ve.from(Za.DOM.getStyle(o,a,!0))));var n,t,r,o}).getOr("")}}function T1(e){return nf(e.getBody()).map(function(e){var t=e.container();return jn(t)?t.parentNode:t})}function O1(e,t){return n=e,r=a(ve.some,t),o=n,ve.from(o.selection.getRng()).bind(function(e){var t=o.getBody();return e.startContainer===t&&0===e.startOffset?ve.none():ve.from(o.selection.getStart(!0))}).orThunk(R(T1,n)).map(kt.fromDom).filter(Nn).bind(r);var n,r,o}function B1(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=Et.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),o=Et.explode(e.getParam("font_size_classes",""));return o?o[n-1]||t:r[n-1]||t}return t}return t}var P1=Yn,L1=Xn,I1=function(e){e.on(function(e){u1(e.ghost)}),e.clear()},M1=Xn,F1=Yn,U1=Za.DOM,z1=Za.DOM,H1=Za.DOM,j1=function(t,n,r){var o,i,a,u,e=Lv.get(r),s=Lv.urls[r]||t.documentBaseUrl.replace(/\/$/,"");if(r=Et.trim(r),e&&-1===Et.inArray(n,r)&&(Et.each(Lv.dependencies(r),function(e){j1(t,n,e)}),!t.plugins[r]))try{var c=new e(t,s,t.$);(t.plugins[r]=c).init&&(c.init(t,s),n.push(r))}catch(e){i=r,a=e,yf(o=t,"PluginLoadError",{message:u=cu.translate(["Failed to initialize plugin: {0}",i])}),cy(u,a),Uv(o,u)}},V1=Za.DOM,q1={"font-size":"size","font-family":"face"},$1=D1("font-size"),W1=i(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},D1("font-family")),K1=Et.each,X1=Et.map,Y1=Et.inArray,G1=(J1.prototype.execCommand=function(t,n,r,e){var o,i,a=!1,u=this;if(!u.editor.removed){if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?dd(i=u.editor).each(function(e){return i.selection.setRng(e)}):u.editor.focus()),(e=u.editor.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;var s=t.toLowerCase();if(o=u.commands.exec[s])return o(s,n,r),u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(K1(this.editor.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,n,r))return u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=u.editor.getDoc().execCommand(t,n,r)}catch(e){}return!!a&&(u.editor.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},J1.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return!1}},J1.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},J1.prototype.addCommands=function(e,n){void 0===n&&(n="exec");var r=this;K1(e,function(t,e){K1(e.toLowerCase().split(","),function(e){r.commands[n][e]=t})})},J1.prototype.addCommand=function(e,o,i){var a=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,t,n,r){return o.call(i||a.editor,t,n,r)}},J1.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return!0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return!1},J1.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)}},J1.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)}},J1.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},J1.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},J1.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},J1.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged()},J1.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e)},J1.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},J1.prototype.setupCommands=function(u){var o=this;function e(r){return function(){var e=u.selection,t=e.isCollapsed()?[u.dom.getParent(e.getNode(),u.dom.isBlock)]:e.getSelectedBlocks(),n=X1(t,function(e){return!!u.formatter.matchNode(e,r)});return-1!==Y1(n,!0)}}this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":te,"mceEndUndoLevel,mceAddUndoLevel":function(){u.undoManager.add()},mceFocus:function(e,t,n){var r,o;o=n,(r=u).removed||(o?Ud:function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===yd(t)&&dd(t).each(function(e){t.selection.setRng(e),r=e});var o,i,a=(o=t,i=e.getNode(),o.dom.getParent(i,function(e){return"true"===o.dom.getContentEditable(e)}));if(t.$.contains(n,a))return bd(a),vd(t,r),Ud(t);t.inline||(xt.opera||bd(n),t.getWin().focus()),(xt.gecko||t.inline)&&(bd(n),vd(t,r)),Ud(t)})(r)},"Cut,Copy,Paste":function(e){var t,n,r=u.getDoc();try{o.execNativeCommand(e)}catch(e){t=!0}!(t="paste"===e&&!r.queryCommandEnabled(e)||t)&&r.queryCommandSupported(e)||(n=u.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."),xt.mac&&(n=n.replace(/Ctrl\+/g,"\u2318+")),u.notificationManager.open({text:n,type:"error"}))},unlink:function(){var e;u.selection.isCollapsed()?(e=u.dom.getParent(u.selection.getStart(),"a"))&&u.dom.remove(e,!0):u.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),K1("left,center,right,justify".split(","),function(e){t!==e&&u.formatter.remove("align"+e)}),"none"!==t&&o.toggleFormat("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t;o.execNativeCommand(e);var n=u.dom.getParent(u.selection.getNode(),"ol,ul");n&&(t=n.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(t.nodeName)&&(o.storeSelection(),u.dom.split(t,n),o.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){o.toggleFormat(e)},"ForeColor,HiliteColor":function(e,t,n){o.toggleFormat(e,{value:n})},FontName:function(e,t,n){var r,o;o=B1(r=u,n),r.formatter.toggle("fontname",{value:A(o.split(/\s*,\s*/),function(e){return-1===e.indexOf(" ")||Ge(e,'"')||Ge(e,"'")?e:"'"+e+"'"}).join(",")}),r.nodeChanged()},FontSize:function(e,t,n){var r;(r=u).formatter.toggle("fontsize",{value:B1(r,n)}),r.nodeChanged()},LineHeight:function(e,t,n){var r;(r=u).formatter.toggle("lineheight",{value:String(n)}),r.nodeChanged()},Lang:function(e,t,n){o.toggleFormat(e,{value:n.code,customValue:n.customCode})},RemoveFormat:function(e){u.formatter.remove(e)},mceBlockQuote:function(){o.toggleFormat("blockquote")},FormatBlock:function(e,t,n){return o.toggleFormat(n||"p")},mceCleanup:function(){var e=u.selection.getBookmark();u.setContent(u.getContent()),u.selection.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||u.selection.getNode();r!==u.getBody()&&(o.storeSelection(),u.dom.remove(r,!0),o.restoreSelection())},mceSelectNodeDepth:function(e,t,n){var r=0;u.dom.getParent(u.selection.getNode(),function(e){if(1===e.nodeType&&r++===n)return u.selection.select(e),!1},u.getBody())},mceSelectNode:function(e,t,n){u.selection.select(n)},mceInsertContent:function(e,t,n){var r,o,i,a;r=u,o=function(e){if("string"==typeof e)return{content:e,details:{}};var t=Et.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}(n),i=o.content,a=o.details,bh(r).editor.insertContent(i,a)},mceInsertRawHTML:function(e,t,n){u.selection.setContent("tiny_mce_marker");var r=u.getContent();u.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceInsertNewLine:function(e,t,n){DC(u,n)},mceToggleFormat:function(e,t,n){o.toggleFormat(n)},mceSetContent:function(e,t,n){u.setContent(n)},"Indent,Outdent":function(e){S0(u,e)},mceRepaint:te,InsertHorizontalRule:function(){u.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){u.hasVisual=!u.hasVisual,u.addVisual()},mceReplaceContent:function(e,t,n){u.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,u.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){"string"==typeof n&&(n={href:n});var r=u.dom.getParent(u.selection.getNode(),"a");n.href=n.href.replace(/ /g,"%20"),r&&n.href||u.formatter.remove("link"),n.href&&u.formatter.apply("link",n,r)},selectAll:function(){var e,t=u.dom.getParent(u.selection.getStart(),Xn);t&&((e=u.dom.createRng()).selectNodeContents(t),u.selection.setRng(e))},mceNewDocument:function(){u.setContent("")},InsertLineBreak:function(e,t,n){return bC(u,n),!0}}),o.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return o.isFormatMatch(e)},mceBlockQuote:function(){return o.isFormatMatch("blockquote")},Outdent:function(){return x0(u)},"InsertUnorderedList,InsertOrderedList":function(e){var t=u.dom.getParent(u.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),o.addCommands({Undo:function(){u.undoManager.undo()},Redo:function(){u.undoManager.redo()}}),o.addQueryValueHandler("FontName",function(){return O1(t=u,function(e){return W1(t.getBody(),e.dom)}).getOr("");var t},this),o.addQueryValueHandler("FontSize",function(){return O1(t=u,function(e){return $1(t.getBody(),e.dom)}).getOr("");var t},this),o.addQueryValueHandler("LineHeight",function(){return O1(t=u,function(n){var e=kt.fromDom(t.getBody());return Tg(n,function(e){return wn(e,"line-height")},R(je,e)).getOrThunk(function(){var e=parseFloat(xn(n,"line-height")),t=parseFloat(xn(n,"font-size"));return String(e/t)})}).getOr("");var t},this)},J1);function J1(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}function Q1(e,t,n){var r,o,i,a,u,s;vu(e,t)&&!1===n?(o=t,pu(r=e)?r.dom.classList.remove(o):(u=o,0<(s=U(gu(a=r,"class"),function(e){return e!==u})).length?pn(a,"class",s.join(" ")):yn(a,"class")),0===(pu(i=r)?i.dom.classList:gu(i,"class")).length&&yn(i,"class")):n&&hu(e,t)}function Z1(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(e){}}function ex(e,t){e.dom.contentEditable=t?"true":"false"}function tx(e,t){var n,r,o=kt.fromDom(e.getBody());Q1(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),ve.from(e.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")}),ex(o,!(e.readonly=!0)),Y(bu(o,'*[contenteditable="true"]'),function(e){pn(e,ox,"true"),ex(e,!1)})):(ex(o,!(e.readonly=!1)),Y(bu(o,"*["+ox+'="true"]'),function(e){yn(e,ox),ex(e,!0)}),Z1(e,"StyleWithCSS",!1),Z1(e,"enableInlineTableEditing",!1),Z1(e,"enableObjectResizing",!1),(yd(n=e)||(r=n,rd(Bn(kt.fromDom(r.getElement()))).filter(function(e){return!(void 0!==(t=e.dom.classList)&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body")))&&gd(r,e.dom);var t}).isSome()))&&e.focus(),e.selection.setRng(e.selection.getRng()),e.nodeChanged())}function nx(e){return e.readonly}function rx(t){t.parser.addAttributeFilter("contenteditable",function(e){nx(t)&&Y(e,function(e){e.attr(ox,e.attr("contenteditable")),e.attr("contenteditable","false")})}),t.serializer.addAttributeFilter(ox,function(e){nx(t)&&Y(e,function(e){e.attr("contenteditable",e.attr(ox))})}),t.serializer.addTempAttr(ox)}var ox="data-mce-contenteditable",ix=Et.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),ax=(ux.isNative=function(e){return!!ix[e.toLowerCase()]},ux.prototype.fire=function(e,t){var n=e.toLowerCase(),r=uo(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},ux.prototype.on=function(e,t,n,r){if(t=!1===t?D:t){var o={func:t,removed:!1};r&&Et.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],s=this.bindings[u];s||(s=[],this.toggleEvent(u,!0)),s=n?Ae([o],s,!0):Ae(Ae([],s,!0),[o],!1),this.bindings[u]=s}}return this},ux.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i,a=r[o],u=this.bindings[a];if(!a)return ne(this.bindings,function(e,t){n.toggleEvent(t,!1),delete n.bindings[t]}),this;u&&(t?(u=(i=B(u,function(e){return e.func===t})).fail,this.bindings[a]=u,Y(i.pass,function(e){e.removed=!0})):u.length=0,u.length||(this.toggleEvent(e,!1),delete this.bindings[a]))}else ne(this.bindings,function(e,t){n.toggleEvent(t,!1)}),this.bindings={};return this},ux.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},ux.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},ux);function ux(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}function sx(n){return n._eventDispatcher||(n._eventDispatcher=new ax({scope:n,toggleEvent:function(e,t){ax.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher}function cx(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=Ps(e);return n?(e.eventRoot||(e.eventRoot=hx.select(n)[0]),e.eventRoot):e.getBody()}function lx(e,t,n){var r,o,i,a;e.hidden||nx(e)?nx(e)&&(r=e,"click"!==(o=n).type||Lf.metaKeyPressed(o)||(i=kt.fromDom(o.target),a=r,br(i,"a",function(e){return je(e,kt.fromDom(a.getBody()))}).bind(function(e){return bn(e,"href")}).each(function(e){var t,n;o.preventDefault(),/^#/.test(e)?(t=r.dom.select(e+',[name="'+(Ge(n=e,"#")?n.substring("#".length):n)+'"]')).length&&r.selection.scrollIntoView(t[0],!0):window.open(e,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))):e.fire(t,n)}function fx(i,a){var e,t;i.delegates||(i.delegates={}),i.delegates[a]||i.removed||(t=cx(i,a),Ps(i)?(gx||(gx={},i.editorManager.on("removeEditor",function(){i.editorManager.activeEditor||gx&&(ne(gx,function(e,t){i.dom.unbind(cx(i,t))}),gx=null)})),gx[a]||(gx[a]=e=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();o!==t&&!hx.isChildOf(t,o)||lx(n[r],a,e)}},hx.bind(t,a,e))):(hx.bind(t,a,e=function(e){lx(i,a,e)}),i.delegates[a]=e))}function dx(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate()}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&tx(e,i.editorReadOnly),t.set(r),e.fire("SwitchMode",{mode:r})}function mx(e){var t,n={};yx(Cx(e.toLowerCase(),"+"),function(e){e in wx?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=xx[e]||e.toUpperCase().charCodeAt(0))});var r=[n.keyCode];for(t in wx)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,xt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(xt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n}var gx,px={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;var r=sx(this).fire(e,t);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(e,r,!1),o=o.parent();return r},on:function(e,t,n){return sx(this).on(e,t,n)},off:function(e,t){return sx(this).off(e,t)},once:function(e,t){return sx(this).once(e,t)},hasEventListeners:function(e){return sx(this).has(e)}},hx=Za.DOM,vx=_e(_e({},px),{bindPendingEventDelegates:function(){var t=this;Et.each(t._pendingNativeEvents,function(e){fx(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?fx(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(cx(n,e),e,n.delegates[e]),delete n.delegates[e])))},unbindAllNativeEvents:function(){var n=this,e=n.getBody(),t=n.dom;n.delegates&&(ne(n.delegates,function(e,t){n.dom.unbind(cx(n,t),t,e)}),delete n.delegates),!n.inline&&e&&t&&(e.onload=null,t.unbind(n.getWin()),t.unbind(n.getDoc())),t&&(t.unbind(e),t.unbind(n.getContainer()))}}),bx=["design","readonly"],yx=Et.each,Cx=Et.explode,xx={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},wx=Et.makeMap("alt,ctrl,shift,meta,access"),Sx=(Ex.prototype.add=function(e,n,t,r){var o=this,i=o.normalizeCommandFunc(t);return yx(Cx(Et.trim(e)),function(e){var t=o.createShortcut(e,n,i,r);o.shortcuts[t.id]=t}),!0},Ex.prototype.remove=function(e){var t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},Ex.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return"string"==typeof n?function(){t.editor.execCommand(n,!1,null)}:Et.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2])}:n},Ex.prototype.createShortcut=function(e,t,n,r){var o=Et.map(Cx(e,">"),mx);return o[o.length-1]=Et.extend(o[o.length-1],{func:n,scope:r||this.editor}),Et.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},Ex.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},Ex.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},Ex.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},Ex.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},Ex);function Ex(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(yx(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var kx=Za.DOM,Nx=Et.extend,_x=Et.each,Ax=Et.resolve,Rx=xt.ie,Dx=(Tx.prototype.render=function(){!function(t){var e=t.id;cu.setCode(Ds(t));var n,r,o,i,a=function(){V1.unbind(window,"ready",a),t.render()};si.Event.domLoaded?t.getElement()&&xt.contentEditable&&(n=kt.fromDom(t.getElement()),r=L(n.dom.attributes,function(e,t){return e[t.name]=t.value,e},{}),t.on("remove",function(){O(n.dom.attributes,function(e){return yn(n,e.name),0}),hn(n,r)}),t.ui.styleSheetLoader=Ar.forElement(n,{contentCssCors:(o=t).getParam("content_css_cors"),referrerPolicy:Rs(o)}),t.getParam("inline")?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"),(i=t.getElement().form||V1.getParent(e,"form"))&&(t.formElement=i,t.getParam("hidden_input")&&!Hn(t.getElement())&&(V1.insertAfter(V1.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},V1.bind(i,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!t.getParam("submit_patch")||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Mv(t),t.notificationManager=lv(t),"xml"===t.getParam("encoding")&&t.on("GetContent",function(e){e.save&&(e.content=V1.encode(e.content))}),t.getParam("add_form_submit_trigger")&&t.on("submit",function(){t.initialized&&t.save()}),t.getParam("add_unload_trigger")&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),R1(t,t.suffix)):V1.bind(window,"ready",a)}(this)},Tx.prototype.focus=function(e){this.execCommand("mceFocus",!1,e)},Tx.prototype.hasFocus=function(){return yd(this)},Tx.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Ax(r):0,o=Ax(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,t)},Tx.prototype.translate=function(e){return cu.translate(e)},Tx.prototype.getParam=function(e,t,n){return i=t,a=n,l=(o=e)in(r=this).settings?r.settings[o]:i,"hash"===a?(c={},"string"==typeof(s=l)?Y(0<s.indexOf("=")?s.split(/[;,](?![^=;,]*(?:[;,]|$))/):s.split(","),function(e){var t=e.split("=");1<t.length?c[Et.trim(t[0])]=Et.trim(t[1]):c[Et.trim(t[0])]=Et.trim(t[0])}):c=s,c):"string"===a?av(X,r,o).getOr(i):"number"===a?av(E,r,o).getOr(i):"boolean"===a?av(v,r,o).getOr(i):"object"===a?av(h,r,o).getOr(i):"array"===a?av(S,r,o).getOr(i):"string[]"===a?av((u=X,function(e){return S(e)&&j(e,u)}),r,o).getOr(i):"function"===a?av(y,r,o).getOr(i):l;var r,o,i,a,u,s,c,l},Tx.prototype.hasPlugin=function(e,t){return!(!T(Ms(this).split(/[ ,]/),e)||t&&void 0===Lv.get(e))},Tx.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e)},Tx.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n)},Tx.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},Tx.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},Tx.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r)},Tx.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},Tx.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},Tx.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},Tx.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},Tx.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(kx.show(this.getContainer()),kx.hide(this.id)),this.load(),this.fire("show"))},Tx.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(Rx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(kx.hide(e.getContainer()),kx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},Tx.prototype.isHidden=function(){return!!this.hidden},Tx.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t})},Tx.prototype.load=function(e){var t=this.getElement();if(this.removed)return"";if(t){(e=e||{}).load=!0;var n=Hn(t)?t.value:t.innerHTML,r=this.setContent(n,e);return e.element=t,e.no_events||this.fire("LoadContent",e),e.element=t=null,r}},Tx.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,Hn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=kx.getParent(r.id,"form"))&&_x(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},Tx.prototype.setContent=function(e,t){return Qh(this,e,t)},Tx.prototype.getContent=function(e){return t=this,r=(n=void 0===(n=e)?{}:n).format||"html",o=n,bh(t).editor.getContent(o,r);var t,n,r,o},Tx.prototype.insertContent=function(e,t){t&&(e=Nx({content:e},t)),this.execCommand("mceInsertContent",!1,e)},Tx.prototype.resetContent=function(e){void 0===e?Qh(this,this.startContent,{format:"raw"}):Qh(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},Tx.prototype.isDirty=function(){return!this.isNotDirty},Tx.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},Tx.prototype.getContainer=function(){return this.container||(this.container=kx.get(this.editorContainer||this.id+"_parent")),this.container},Tx.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},Tx.prototype.getElement=function(){return this.targetElm||(this.targetElm=kx.get(this.id)),this.targetElm},Tx.prototype.getWin=function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},Tx.prototype.getDoc=function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},Tx.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},Tx.prototype.convertURL=function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):this.documentBaseURI.toAbsolute(e,r.remove_script_host)},Tx.prototype.addVisual=function(e){var t;t=e,yh(this).editor.addVisual(t)},Tx.prototype.remove=function(){var e,t,n,r,o;(e=this).removed||(t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement(),r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&yv.remove(o.nextSibling),e.fire("remove"),e.editorManager.remove(e),!e.inline&&r&&yv.setStyle(e.id,"display",e.orgDisplay),e.fire("detach"),yv.remove(e.getContainer()),Zh(t),Zh(n),e.destroy())},Tx.prototype.destroy=function(e){var t,n,r,o,i,a,u;n=e,a=(t=this).selection,u=t.dom,t.destroyed||(n||t.removed?(n||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Zh(a),Zh(u)),(o=(r=t).formElement)&&(o._mceOldSubmit&&(o.submit=o._mceOldSubmit,o._mceOldSubmit=null),yv.unbind(o,"submit reset",r.formEventDelegate)),(i=t).contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null,i.selection&&(i.selection=i.selection.win=i.selection.dom=i.selection.dom.doc=null),t.destroyed=!0):t.remove())},Tx.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},Tx.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},Tx.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},Tx.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},Tx.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},Tx.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},Tx);function Tx(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x=this;function w(n,r){return function(e,t){return n[e.toLowerCase()]=_e(_e({},t),{type:r})}}this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,Nx(this,vx),this.settings=(d=(f=this).documentBaseUrl,m=n.defaultSettings,p=d,h=kv,v=f,b={id:e,theme:"silver",toolbar_mode:rv(g=t,"floating"),plugins:"",document_base_url:p,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:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,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,summary,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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:v.convertURL,url_converter_scope:v},y=_e(_e({},b),h?Rv:{}),!1!==(C=iv(Nv||_v,Nv,y,m,g)).deprecation_warnings&&ev(g,C),C),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ru.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Za.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),lu.languageLoad=this.settings.language_load,lu.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new Yd(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new Sx(this),this.editorCommands=new G1(this),this.settings.cache_suffix&&(xt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:{addAutocompleter:(u={},(r={addButton:w(o={},"button"),addGroupToolbarButton:w(o,"grouptoolbarbutton"),addToggleButton:w(o,"togglebutton"),addMenuButton:w(o,"menubutton"),addSplitButton:w(o,"splitbutton"),addMenuItem:w(i={},"menuitem"),addNestedMenuItem:w(i,"nestedmenuitem"),addToggleMenuItem:w(i,"togglemenuitem"),addAutocompleter:w(a={},"autocompleter"),addContextMenu:w(s={},"contextmenu"),addContextToolbar:w(c={},"contexttoolbar"),addContextForm:w(c,"contextform"),addSidebar:w(l={},"sidebar"),addIcon:function(e,t){return u[e.toLowerCase()]=t},getAll:function(){return{buttons:o,menuItems:i,icons:u,popups:a,contextMenus:s,contextToolbars:c,sidebars:l}}}).addAutocompleter),addButton:r.addButton,addContextForm:r.addContextForm,addContextMenu:r.addContextMenu,addContextToolbar:r.addContextToolbar,addIcon:r.addIcon,addMenuButton:r.addMenuButton,addMenuItem:r.addMenuItem,addNestedMenuItem:r.addNestedMenuItem,addSidebar:r.addSidebar,addSplitButton:r.addSplitButton,addToggleButton:r.addToggleButton,addGroupToolbarButton:r.addGroupToolbarButton,addToggleMenuItem:r.addToggleMenuItem,getAll:r.getAll},styleSheetLoader:void 0,show:te,hide:te,enable:te,disable:te,isDisabled:D};var S,E,k,N,_,A=(N=iu("design"),_=iu({design:{activate:te,deactivate:te,editorReadOnly:!1},readonly:{activate:te,deactivate:te,editorReadOnly:!0}}),(E=S=this).serializer?rx(E):E.on("PreInit",function(){rx(E)}),(k=S).on("ShowCaret",function(e){nx(k)&&e.preventDefault()}),k.on("ObjectSelected",function(e){nx(k)&&e.preventDefault()}),{isReadOnly:function(){return nx(S)},set:function(e){return function(e,t,n,r){if(r!==n.get()){if(!ke(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?dx(e,n,t,r):e.on("init",function(){return dx(e,n,t,r)})}}(S,_.get(),N,e)},get:function(){return N.get()},register:function(e,t){_.set(function(e,t,n){var r;if(T(bx,t))throw new Error("Cannot override default mode "+t);return _e(_e({},e),((r={})[t]=_e(_e({},n),{deactivate:function(){try{n.deactivate()}catch(e){console.error("problem while deactivating editor mode "+t+":",e)}}}),r))}(_.get(),e,t))}});this.mode=A,this.setMode=A.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Xa.overrideDefaults(function(){return{context:x.inline?x.getBody():x.getDoc(),element:x.getBody()}})}function Ox(t){var n=t.type;Fx($x.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})}function Bx(e){e!==Hx&&(e?Xa(window).on("resize scroll",Ox):Xa(window).off("resize scroll",Ox),Hx=e)}function Px(t){var e=Vx;delete jx[t.id];for(var n=0;n<jx.length;n++)if(jx[n]===t){jx.splice(n,1);break}return Vx=U(Vx,function(e){return t!==e}),$x.activeEditor===t&&($x.activeEditor=0<Vx.length?Vx[0]:null),$x.focusedEditor===t&&($x.focusedEditor=null),e.length!==Vx.length}var Lx,Ix=Za.DOM,Mx=Et.explode,Fx=Et.each,Ux=Et.extend,zx=0,Hx=!1,jx=[],Vx=[],qx="CSS1Compat"!==document.compatMode,$x=_e(_e({},px),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Xa,majorVersion:"5",minorVersion:"10.7",releaseDate:"2022-12-06",editors:jx,i18n:cu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t="",n=Yd.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var r=window.tinymce||window.tinyMCEPreInit;if(r)e=r.base||r.baseURL,t=r.suffix;else{for(var o,i=document.getElementsByTagName("script"),a=0;a<i.length;a++)if(""!==(o=i[a].src||"")){var u=o.substring(o.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(o)){-1!==u.indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(o=document.currentScript.src).indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/")))}this.baseURL=new Yd(n).toAbsolute(e),this.documentBaseURL=n,this.baseURI=new Yd(this.baseURL),this.suffix=t,this.on("AddEditor",R(pd,this)),this.on("RemoveEditor",R(hd,this))},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;void 0!==r&&ne(r,function(e,t){lu.PluginManager.urls[t]=e})},init:function(r){function u(e){var t=e.id;return t||(t=ue(e,"name").filter(function(e){return!Ix.get(e)}).getOrThunk(Ix.uniqueId),e.setAttribute("id",t)),t}function s(e,t){return t.constructor===RegExp?t.test(e.className):Ix.hasClass(e,t)}var n,c=this,l=Et.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),f=function(e){n=e},t=function(){function n(e,t,n){var r=new Dx(e,t,c);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()}var o,e,i=0,a=[];Ix.unbind(window,"ready",t),(e=r.onpageload)&&e.apply(c,[]),o=Xa.unique(function(t){var n=[];if(xt.browser.isIE()&&xt.browser.version.major<11)return cy("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(qx)return cy("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return Fx(t.types,function(e){n=n.concat(Ix.select(e.selector))}),n;if(t.selector)return Ix.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var e=t.elements||"";0<e.length&&Fx(Mx(e),function(t){var e=Ix.get(t);e?n.push(e):Fx(document.forms,function(e){Fx(e.elements,function(e){e.name===t&&(t="mce_editor_"+zx++,Ix.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Fx(Ix.select("textarea"),function(e){t.editor_deselector&&s(e,t.editor_deselector)||t.editor_selector&&!s(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?Fx(r.types,function(t){Et.each(o,function(e){return!Ix.is(e,t.selector)||(n(u(e),Ux({},r,t),e),!1)})}):(Et.each(o,function(e){var t;(t=c.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(Px(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0)}),0===(o=Et.grep(o,function(e){return!c.get(e.id)})).length?f([]):Fx(o,function(e){var t=e;r.inline&&t.tagName.toLowerCase()in l?cy("Could not initialize inline editor on invalid inline target element",e):n(u(e),r,e)}))};return c.settings=r,Ix.bind(window,"ready",t),new Nr(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?Vx.slice(0):X(t)?M(Vx,function(e){return e.id===t}).getOr(null):E(t)&&Vx[t]||null},add:function(e){var n=this;return jx[e.id]===e||(null===n.get(e.id)&&("length"!==e.id&&(jx[e.id]=e),jx.push(e),Vx.push(e)),Bx(!0),n.activeEditor=e,n.fire("AddEditor",{editor:e}),Lx||(Lx=function(e){var t=n.fire("BeforeUnload");if(t.returnValue)return e.preventDefault(),e.returnValue=t.returnValue,t.returnValue},window.addEventListener("beforeunload",Lx))),e},createEditor:function(e,t){return this.add(new Dx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!X(e))return n=e,l(r.get(n.id))?null:(Px(n)&&r.fire("RemoveEditor",{editor:n}),0===Vx.length&&window.removeEventListener("beforeunload",Lx),n.remove(),Bx(0<Vx.length),n);Fx(Ix.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=Vx.length-1;0<=t;t--)r.remove(Vx[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Dx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",!1,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Fx(Vx,function(e){e.save()})},addI18n:function(e,t){cu.add(e,t)},translate:function(e){return cu.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},_setBaseUrl:function(e){this.baseURL=new Yd(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new Yd(this.baseURL)}});function Wx(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,c=(n||"").split("");return"b"===c[0]&&(o+=s),"r"===c[1]&&(r+=u),"c"===c[0]&&(o+=tw(s/2)),"c"===c[1]&&(r+=tw(u/2)),"b"===c[3]&&(o-=a),"r"===c[4]&&(r-=i),"c"===c[3]&&(o-=tw(a/2)),"c"===c[4]&&(r-=tw(i/2)),Xx(r,o,i,a)}function Kx(){}$x.setup();function Xx(e,t,n,r){return{x:e,y:t,w:n,h:r}}var Yx,Gx,Jx,Qx,Zx=Math.min,ew=Math.max,tw=Math.round,nw={inflate:function(e,t,n){return Xx(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Wx,findBestRelativePosition:function(e,t,n,r){for(var o,i=0;i<r.length;i++)if((o=Wx(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=ew(e.x,t.x),r=ew(e.y,t.y),o=Zx(e.x+e.w,t.x+t.w),i=Zx(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:Xx(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=ew(0,t.x-r),l=ew(0,t.y-o),f=ew(0,i-u),d=ew(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),Xx(r,o,(i-=f)-r,(a-=d)-o)},create:Xx,fromClientRect:function(e){return Xx(e.left,e.top,e.width,e.height)}},rw=(Yx={},Gx={},{load:function(r,o){var i='Script at URL "'+o+'" failed to load',a='Script at URL "'+o+"\" did not call `tinymce.Resource.add('"+r+"', data)` within 1 second";if(void 0!==Yx[r])return Yx[r];var e=new Nr(function(e,t){var n=function(e,t,n){function r(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o||(o=!0,null!==i&&(clearTimeout(i),i=null),n.apply(null,e))}}void 0===n&&(n=1e3);var o=!1,i=null,a=r(e),u=r(t);return{start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o||null!==i||(i=setTimeout(function(){return u.apply(null,e)},n))},resolve:a,reject:u}}(e,t);Gx[r]=n.resolve,ru.ScriptLoader.loadScript(o,function(){return n.start(a)},function(){return n.reject(i)})});return Yx[r]=e},add:function(e,t){void 0!==Gx[e]&&(Gx[e](t),delete Gx[e]),Yx[e]=Nr.resolve(t)}}),ow=Et.each,iw=Et.extend;Kx.extend=Jx=function(n){function r(){var e,t,n;if(!Qx&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)}function t(){return this}var o=this.prototype;Qx=!0;var i=new this;return Qx=!1,n.Mixins&&(ow(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&ow(n.Methods.split(","),function(e){n[e]=t}),n.Properties&&ow(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return void 0!==e?(this[t]=e,this):this[t]}}),n.Statics&&ow(n.Statics,function(e,t){r[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=iw({},o.Defaults,n.Defaults)),ne(n,function(e,t){var n,r;"function"==typeof e&&o[t]?i[t]=(n=t,r=e,function(){var e=this._super;this._super=o[n];var t=r.apply(this,arguments);return this._super=e,t}):i[t]=e}),r.prototype=i,(r.constructor=r).extend=Jx,r};var aw,uw,sw,cw=Math.min,lw=Math.max,fw=Math.round,dw={serialize:function(e){var t=JSON.stringify(e);return X(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},mw={callbacks:{},count:0,send:function(t){var n=this,r=Za.DOM,o=(void 0!==t.count?t:n).count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},gw=_e(_e({},px),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):_r.setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",gw.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Et.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=gw.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();_r.setTimeout(r,10)}}),pw=Et.extend,hw=(vw.sendRPC=function(e){return(new vw).send(e)},vw.prototype.send=function(e){var n=e.error,r=e.success,o=pw(this.settings,e);o.success=function(e,t){(e=void 0===(e=dw.parse(e))?{error:"JSON Parse error."}:e).error?n.call(o.error_scope||o.scope,e.error,t):r.call(o.success_scope||o.scope,e.result)},o.error=function(e,t){n&&n.call(o.error_scope||o.scope,e,t)},o.data=dw.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),o.content_type="application/json",gw.send(o)},vw);function vw(e){this.settings=pw({},e),this.count=0}try{var bw,yw="__storage_test__";(bw=window.localStorage).setItem(yw,yw),bw.removeItem(yw)}catch(e){aw={},uw=[],sw={getItem:function(e){return aw[e]||null},setItem:function(e,t){uw.push(e),aw[e]=String(t)},key:function(e){return uw[e]},removeItem:function(t){uw=uw.filter(function(e){return e===t}),delete aw[t]},clear:function(){uw=[],aw={}},length:0},Object.defineProperty(sw,"length",{get:function(){return uw.length},configurable:!1,enumerable:!1}),bw=sw}var Cw={geom:{Rect:nw},util:{Promise:Nr,Delay:_r,Tools:Et,VK:Lf,URI:Yd,Class:Kx,EventDispatcher:ax,Observable:px,I18n:cu,XHR:gw,JSON:dw,JSONRequest:hw,JSONP:mw,LocalStorage:bw,Color:function(e){function t(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=lw(0,cw(t,1)),n=lw(0,cw(n,1)),0!==t){var r=e/60,o=n*t,i=o*(1-Math.abs(r%2-1)),a=n-o;switch(Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=fw(255*(u+a)),s=fw(255*(s+a)),c=fw(255*(c+a))}else u=s=c=fw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n}var n={},u=0,s=0,c=0;return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=cw(e/=255,cw(t/=255,n/=255)))===(a=lw(e,lw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:fw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:fw(100*r),v:fw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){function e(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+e(u)+e(s)+e(c)},n.parse=t,n},ImageUploader:function(n){var e=qv(),r=Yv(n,e);return{upload:function(e,t){return r.upload(e,(t=void 0===t||t)?Xv(n):void 0)}}}},dom:{EventUtils:si,Sizzle:sa,DomQuery:Xa,TreeWalker:Rr,TextSeeker:_u,DOMUtils:Za,ScriptLoader:ru,RangeUtils:Pf,Serializer:Jh,StyleSheetLoader:wr,ControlSelection:wf,BookmarkManager:zl,Selection:Fh,Event:si.Event},html:{Styles:io,Entities:Qo,Node:Hd,Schema:ro,SaxParser:Qd,DomParser:Xh,Writer:om,Serializer:im},Env:xt,AddOnManager:lu,Annotator:Ul,Formatter:eb,UndoManager:nb,EditorCommands:G1,WindowManager:Mv,NotificationManager:lv,EditorObservable:vx,Shortcuts:Sx,Editor:Dx,FocusManager:Md,EditorManager:$x,DOM:Za.DOM,ScriptLoader:ru.ScriptLoader,PluginManager:Lv,ThemeManager:Iv,IconManager:Dv,Resource:rw,trim:Et.trim,isArray:Et.isArray,is:Et.is,toArray:Et.toArray,makeMap:Et.makeMap,each:Et.each,map:Et.map,grep:Et.grep,inArray:Et.inArray,extend:Et.extend,create:Et.create,walk:Et.walk,createNS:Et.createNS,resolve:Et.resolve,explode:Et.explode,_addCacheSuffix:Et._addCacheSuffix,isOpera:xt.opera,isWebKit:xt.webkit,isIE:xt.ie,isGecko:xt.gecko,isMac:xt.mac},xw=Et.extend($x,Cw),ww=xw;window.tinymce=ww,window.tinyMCE=ww,function(e){if("object"==typeof module)try{module.exports=e}catch(e){}}(xw)}();