## Description - This PR includes basic tests for connecting to a MsSQL ds & running simple queries on it ## Type of change - New script (non-breaking change which functional tests the MsSql ds) ## How Has This Been Tested? - Cypress local & CI run ## Checklist: ### QA activity: - [X] Added Test Plan Approved label after reviewing all Cypress test
24213 lines
749 KiB
JavaScript
24213 lines
749 KiB
JavaScript
/**
|
|
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
|
* Licensed under the LGPL or a commercial license.
|
|
* For LGPL see License.txt in the project root for license information.
|
|
* For commercial licenses see https://www.tiny.cloud/
|
|
*
|
|
* Version: 5.1.6 (2020-01-28)
|
|
*/
|
|
!(function (j) {
|
|
"use strict";
|
|
function i() {}
|
|
var q = function (n, r) {
|
|
return function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
return n(r.apply(null, e));
|
|
};
|
|
},
|
|
$ = function (e) {
|
|
return function () {
|
|
return e;
|
|
};
|
|
},
|
|
W = function (e) {
|
|
return e;
|
|
};
|
|
function d(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(n) {
|
|
return function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
return !n.apply(null, e);
|
|
};
|
|
}
|
|
function e() {
|
|
return u;
|
|
}
|
|
var t,
|
|
c = $(!1),
|
|
a = $(!0),
|
|
u =
|
|
((t = {
|
|
fold: function (e, t) {
|
|
return e();
|
|
},
|
|
is: c,
|
|
isSome: c,
|
|
isNone: a,
|
|
getOr: o,
|
|
getOrThunk: r,
|
|
getOrDie: function (e) {
|
|
throw new Error(e || "error: getOrDie called on none.");
|
|
},
|
|
getOrNull: $(null),
|
|
getOrUndefined: $(undefined),
|
|
or: o,
|
|
orThunk: r,
|
|
map: e,
|
|
each: i,
|
|
bind: e,
|
|
exists: c,
|
|
forall: a,
|
|
filter: e,
|
|
equals: n,
|
|
equals_: n,
|
|
toArray: function () {
|
|
return [];
|
|
},
|
|
toString: $("none()"),
|
|
}),
|
|
Object.freeze && Object.freeze(t),
|
|
t);
|
|
function n(e) {
|
|
return e.isNone();
|
|
}
|
|
function r(e) {
|
|
return e();
|
|
}
|
|
function o(e) {
|
|
return e;
|
|
}
|
|
function l(t) {
|
|
return function (e) {
|
|
return (
|
|
(function (e) {
|
|
if (null === e) return "null";
|
|
var t = typeof e;
|
|
return "object" == t &&
|
|
(Array.prototype.isPrototypeOf(e) ||
|
|
(e.constructor && "Array" === e.constructor.name))
|
|
? "array"
|
|
: "object" == t &&
|
|
(String.prototype.isPrototypeOf(e) ||
|
|
(e.constructor && "String" === e.constructor.name))
|
|
? "string"
|
|
: t;
|
|
})(e) === t
|
|
);
|
|
};
|
|
}
|
|
function f(e, t) {
|
|
return B.call(e, t);
|
|
}
|
|
function h(e, t) {
|
|
return -1 < f(e, t);
|
|
}
|
|
function C(e, t) {
|
|
for (var n = 0, r = e.length; n < r; n++) {
|
|
if (t(e[n], n)) return !0;
|
|
}
|
|
return !1;
|
|
}
|
|
function z(e, t) {
|
|
for (var n = 0, r = e.length; n < r; n++) {
|
|
t(e[n], n);
|
|
}
|
|
}
|
|
function y(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 m(e, t, n) {
|
|
return (
|
|
(function (e, t) {
|
|
for (var n = e.length - 1; 0 <= n; n--) {
|
|
t(e[n], n);
|
|
}
|
|
})(e, function (e) {
|
|
n = t(n, e);
|
|
}),
|
|
n
|
|
);
|
|
}
|
|
function b(e, t, n) {
|
|
return (
|
|
z(e, function (e) {
|
|
n = t(n, e);
|
|
}),
|
|
n
|
|
);
|
|
}
|
|
function g(e, t) {
|
|
for (var n = 0, r = e.length; n < r; n++) {
|
|
var o = e[n];
|
|
if (t(o, n)) return k.some(o);
|
|
}
|
|
return k.none();
|
|
}
|
|
function p(e, t) {
|
|
for (var n = 0, r = e.length; n < r; n++) {
|
|
if (t(e[n], n)) return k.some(n);
|
|
}
|
|
return k.none();
|
|
}
|
|
function v(e, t) {
|
|
return (function (e) {
|
|
for (var t = [], n = 0, r = e.length; n < r; ++n) {
|
|
if (!A(e[n]))
|
|
throw new Error(
|
|
"Arr.flatten item " + n + " was not an array, input: " + e,
|
|
);
|
|
H.apply(t, e[n]);
|
|
}
|
|
return t;
|
|
})(X(e, t));
|
|
}
|
|
function w(e, t) {
|
|
for (var n = 0, r = e.length; n < r; ++n) {
|
|
if (!0 !== t(e[n], n)) return !1;
|
|
}
|
|
return !0;
|
|
}
|
|
function x(e, t) {
|
|
return y(e, function (e) {
|
|
return !h(t, e);
|
|
});
|
|
}
|
|
function E(e) {
|
|
return 0 === e.length ? k.none() : k.some(e[0]);
|
|
}
|
|
function N(e) {
|
|
return 0 === e.length ? k.none() : k.some(e[e.length - 1]);
|
|
}
|
|
var S = function (n) {
|
|
function e() {
|
|
return o;
|
|
}
|
|
function t(e) {
|
|
return e(n);
|
|
}
|
|
var r = $(n),
|
|
o = {
|
|
fold: function (e, t) {
|
|
return t(n);
|
|
},
|
|
is: function (e) {
|
|
return n === e;
|
|
},
|
|
isSome: a,
|
|
isNone: c,
|
|
getOr: r,
|
|
getOrThunk: r,
|
|
getOrDie: r,
|
|
getOrNull: r,
|
|
getOrUndefined: r,
|
|
or: e,
|
|
orThunk: e,
|
|
map: function (e) {
|
|
return S(e(n));
|
|
},
|
|
each: function (e) {
|
|
e(n);
|
|
},
|
|
bind: t,
|
|
exists: t,
|
|
forall: t,
|
|
filter: function (e) {
|
|
return e(n) ? o : u;
|
|
},
|
|
toArray: function () {
|
|
return [n];
|
|
},
|
|
toString: function () {
|
|
return "some(" + n + ")";
|
|
},
|
|
equals: function (e) {
|
|
return e.is(n);
|
|
},
|
|
equals_: function (e, t) {
|
|
return e.fold(c, function (e) {
|
|
return t(n, e);
|
|
});
|
|
},
|
|
};
|
|
return o;
|
|
},
|
|
k = {
|
|
some: S,
|
|
none: e,
|
|
from: function (e) {
|
|
return null === e || e === undefined ? u : S(e);
|
|
},
|
|
},
|
|
K = l("string"),
|
|
T = l("object"),
|
|
A = l("array"),
|
|
M = l("null"),
|
|
R = l("boolean"),
|
|
D = l("function"),
|
|
_ = l("number"),
|
|
O = Array.prototype.slice,
|
|
B = Array.prototype.indexOf,
|
|
H = Array.prototype.push,
|
|
X = function (e, t) {
|
|
for (var n = e.length, r = new Array(n), o = 0; o < n; o++) {
|
|
var i = e[o];
|
|
r[o] = t(i, o);
|
|
}
|
|
return r;
|
|
},
|
|
Y = function (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 };
|
|
},
|
|
P = D(Array.from)
|
|
? Array.from
|
|
: function (e) {
|
|
return O.call(e);
|
|
},
|
|
G = function () {
|
|
return (G =
|
|
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 L(t) {
|
|
return function (e) {
|
|
return !!e && e.nodeType === t;
|
|
};
|
|
}
|
|
function V(e) {
|
|
var n = e.map(function (e) {
|
|
return e.toLowerCase();
|
|
});
|
|
return function (e) {
|
|
if (e && e.nodeName) {
|
|
var t = e.nodeName.toLowerCase();
|
|
return h(n, t);
|
|
}
|
|
return !1;
|
|
};
|
|
}
|
|
function I(t) {
|
|
return function (e) {
|
|
if (Fe(e)) {
|
|
if (e.contentEditable === t) return !0;
|
|
if (e.getAttribute("data-mce-contenteditable") === t) return !0;
|
|
}
|
|
return !1;
|
|
};
|
|
}
|
|
function F(e, t) {
|
|
var n = (function (e, t) {
|
|
for (var n = 0; n < e.length; n++) {
|
|
var r = e[n];
|
|
if (r.test(t)) return r;
|
|
}
|
|
return undefined;
|
|
})(e, t);
|
|
if (!n) return { major: 0, minor: 0 };
|
|
function r(e) {
|
|
return Number(t.replace(n, "$" + e));
|
|
}
|
|
return Ze(r(1), r(2));
|
|
}
|
|
function U(e, t) {
|
|
return function () {
|
|
return t === e;
|
|
};
|
|
}
|
|
function J(e, t) {
|
|
return function () {
|
|
return t === e;
|
|
};
|
|
}
|
|
function Q(e, t) {
|
|
var n = String(t).toLowerCase();
|
|
return g(e, function (e) {
|
|
return e.search(n);
|
|
});
|
|
}
|
|
function Z(e, t) {
|
|
return -1 !== e.indexOf(t);
|
|
}
|
|
function ee(e, t) {
|
|
return (function (e, t, n) {
|
|
return (
|
|
"" === t || (!(e.length < t.length) && e.substr(n, n + t.length) === t)
|
|
);
|
|
})(e, t, 0);
|
|
}
|
|
function te(e) {
|
|
return e.replace(/^\s+|\s+$/g, "");
|
|
}
|
|
function ne(e) {
|
|
return e.replace(/\s+$/g, "");
|
|
}
|
|
function re(t) {
|
|
return function (e) {
|
|
return Z(e, t);
|
|
};
|
|
}
|
|
function oe() {
|
|
return vt.get();
|
|
}
|
|
function ie(e) {
|
|
return e.dom().nodeName.toLowerCase();
|
|
}
|
|
function ae(t) {
|
|
return function (e) {
|
|
return (
|
|
(function (e) {
|
|
return e.dom().nodeType;
|
|
})(e) === t
|
|
);
|
|
};
|
|
}
|
|
function ue(e, t) {
|
|
for (var n = Nt(e), r = 0, o = n.length; r < o; r++) {
|
|
var i = n[r];
|
|
t(e[i], i);
|
|
}
|
|
}
|
|
function se(e, n) {
|
|
return kt(e, function (e, t) {
|
|
return { k: t, v: n(e, t) };
|
|
});
|
|
}
|
|
function ce(e, n) {
|
|
var r = {},
|
|
o = {};
|
|
return (
|
|
ue(e, function (e, t) {
|
|
(n(e, t) ? r : o)[t] = e;
|
|
}),
|
|
{ t: r, f: o }
|
|
);
|
|
}
|
|
function le(e, t) {
|
|
return Tt(e, t) ? k.from(e[t]) : k.none();
|
|
}
|
|
function fe(e) {
|
|
return e.style !== undefined && D(e.style.getPropertyValue);
|
|
}
|
|
function de(e) {
|
|
var t = Et(e) ? e.dom().parentNode : e.dom();
|
|
return t !== undefined && null !== t && t.ownerDocument.body.contains(t);
|
|
}
|
|
function he(e, t, n) {
|
|
if (!(K(n) || R(n) || _(n)))
|
|
throw (
|
|
(j.console.error(
|
|
"Invalid call to Attr.set. Key ",
|
|
t,
|
|
":: Value ",
|
|
n,
|
|
":: Element ",
|
|
e,
|
|
),
|
|
new Error("Attribute value was not simple"))
|
|
);
|
|
e.setAttribute(t, n + "");
|
|
}
|
|
function me(e, t) {
|
|
var n = e.dom();
|
|
ue(t, function (e, t) {
|
|
he(n, t, e);
|
|
});
|
|
}
|
|
function ge(e, t) {
|
|
var n = e.dom().getAttribute(t);
|
|
return null === n ? undefined : n;
|
|
}
|
|
function pe(e, t) {
|
|
e.dom().removeAttribute(t);
|
|
}
|
|
function ve(e, t) {
|
|
var n = e.dom(),
|
|
r = j.window.getComputedStyle(n).getPropertyValue(t),
|
|
o = "" !== r || de(e) ? r : Mt(n, t);
|
|
return null === o ? undefined : o;
|
|
}
|
|
function ye(e, t) {
|
|
var n = e.dom(),
|
|
r = Mt(n, t);
|
|
return k.from(r).filter(function (e) {
|
|
return 0 < e.length;
|
|
});
|
|
}
|
|
function be() {
|
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
return function () {
|
|
for (var n = [], e = 0; e < arguments.length; e++) n[e] = arguments[e];
|
|
if (t.length !== n.length)
|
|
throw new Error(
|
|
'Wrong number of arguments to struct. Expected "[' +
|
|
t.length +
|
|
']", got ' +
|
|
n.length +
|
|
" arguments",
|
|
);
|
|
var r = {};
|
|
return (
|
|
z(t, function (e, t) {
|
|
r[e] = $(n[t]);
|
|
}),
|
|
r
|
|
);
|
|
};
|
|
}
|
|
function Ce(e, t, n) {
|
|
return 0 != (e.compareDocumentPosition(t) & n);
|
|
}
|
|
function we(e, t) {
|
|
var n = e.dom();
|
|
if (n.nodeType !== _t) return !1;
|
|
var r = n;
|
|
if (r.matches !== undefined) return r.matches(t);
|
|
if (r.msMatchesSelector !== undefined) return r.msMatchesSelector(t);
|
|
if (r.webkitMatchesSelector !== undefined)
|
|
return r.webkitMatchesSelector(t);
|
|
if (r.mozMatchesSelector !== undefined) return r.mozMatchesSelector(t);
|
|
throw new Error("Browser lacks native selectors");
|
|
}
|
|
function xe(e) {
|
|
return (
|
|
(e.nodeType !== _t && e.nodeType !== Ot) || 0 === e.childElementCount
|
|
);
|
|
}
|
|
function ze(e, t) {
|
|
return e.dom() === t.dom();
|
|
}
|
|
function Ee(e) {
|
|
return bt.fromDom(e.dom().ownerDocument);
|
|
}
|
|
function Ne(e) {
|
|
return bt.fromDom(e.dom().ownerDocument.defaultView);
|
|
}
|
|
function Se(e) {
|
|
return k.from(e.dom().parentNode).map(bt.fromDom);
|
|
}
|
|
function ke(e) {
|
|
return k.from(e.dom().previousSibling).map(bt.fromDom);
|
|
}
|
|
function Te(e) {
|
|
return k.from(e.dom().nextSibling).map(bt.fromDom);
|
|
}
|
|
function Ae(e) {
|
|
return (function (e) {
|
|
var t = O.call(e, 0);
|
|
return t.reverse(), t;
|
|
})(Rt(e, ke));
|
|
}
|
|
function Me(e) {
|
|
return Rt(e, Te);
|
|
}
|
|
function Re(e) {
|
|
return X(e.dom().childNodes, bt.fromDom);
|
|
}
|
|
function De(e, t) {
|
|
var n = e.dom().childNodes;
|
|
return k.from(n[t]).map(bt.fromDom);
|
|
}
|
|
function _e(e) {
|
|
return De(e, 0);
|
|
}
|
|
function Oe(e) {
|
|
return De(e, e.dom().childNodes.length - 1);
|
|
}
|
|
function Be(e) {
|
|
return g(e, zt);
|
|
}
|
|
function He(e, t) {
|
|
return e.children && h(e.children, t);
|
|
}
|
|
var Pe,
|
|
Le,
|
|
Ve,
|
|
Ie,
|
|
Fe = L(1),
|
|
Ue = V(["textarea", "input"]),
|
|
je = L(3),
|
|
qe = L(8),
|
|
$e = L(9),
|
|
We = L(11),
|
|
Ke = V(["br"]),
|
|
Xe = I("true"),
|
|
Ye = I("false"),
|
|
Ge = {
|
|
isText: je,
|
|
isElement: Fe,
|
|
isComment: qe,
|
|
isDocument: $e,
|
|
isDocumentFragment: We,
|
|
isBr: Ke,
|
|
isContentEditableTrue: Xe,
|
|
isContentEditableFalse: Ye,
|
|
isRestrictedNode: function (e) {
|
|
return !!e && !Object.getPrototypeOf(e);
|
|
},
|
|
matchNodeNames: V,
|
|
hasPropValue: function (t, n) {
|
|
return function (e) {
|
|
return Fe(e) && e[t] === n;
|
|
};
|
|
},
|
|
hasAttribute: function (t, e) {
|
|
return function (e) {
|
|
return Fe(e) && e.hasAttribute(t);
|
|
};
|
|
},
|
|
hasAttributeValue: function (t, n) {
|
|
return function (e) {
|
|
return Fe(e) && e.getAttribute(t) === n;
|
|
};
|
|
},
|
|
matchStyleValues: function (r, e) {
|
|
var o = e.toLowerCase().split(" ");
|
|
return function (e) {
|
|
var t;
|
|
if (Fe(e))
|
|
for (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;
|
|
};
|
|
},
|
|
isBogus: function (e) {
|
|
return Fe(e) && e.hasAttribute("data-mce-bogus");
|
|
},
|
|
isBogusAll: function (e) {
|
|
return Fe(e) && "all" === e.getAttribute("data-mce-bogus");
|
|
},
|
|
isTable: function (e) {
|
|
return Fe(e) && "TABLE" === e.tagName;
|
|
},
|
|
isTextareaOrInput: Ue,
|
|
},
|
|
Je = function (e) {
|
|
function t() {
|
|
return n;
|
|
}
|
|
var n = e;
|
|
return {
|
|
get: t,
|
|
set: function (e) {
|
|
n = e;
|
|
},
|
|
clone: function () {
|
|
return Je(t());
|
|
},
|
|
};
|
|
},
|
|
Qe = function () {
|
|
return Ze(0, 0);
|
|
},
|
|
Ze = function (e, t) {
|
|
return { major: e, minor: t };
|
|
},
|
|
et = {
|
|
nu: Ze,
|
|
detect: function (e, t) {
|
|
var n = String(t).toLowerCase();
|
|
return 0 === e.length ? Qe() : F(e, n);
|
|
},
|
|
unknown: Qe,
|
|
},
|
|
tt = "Firefox",
|
|
nt = function (e) {
|
|
var t = e.current;
|
|
return {
|
|
current: t,
|
|
version: e.version,
|
|
isEdge: U("Edge", t),
|
|
isChrome: U("Chrome", t),
|
|
isIE: U("IE", t),
|
|
isOpera: U("Opera", t),
|
|
isFirefox: U(tt, t),
|
|
isSafari: U("Safari", t),
|
|
};
|
|
},
|
|
rt = {
|
|
unknown: function () {
|
|
return nt({ current: undefined, version: et.unknown() });
|
|
},
|
|
nu: nt,
|
|
edge: $("Edge"),
|
|
chrome: $("Chrome"),
|
|
ie: $("IE"),
|
|
opera: $("Opera"),
|
|
firefox: $(tt),
|
|
safari: $("Safari"),
|
|
},
|
|
ot = "Windows",
|
|
it = "Android",
|
|
at = "Solaris",
|
|
ut = "FreeBSD",
|
|
st = "ChromeOS",
|
|
ct = function (e) {
|
|
var t = e.current;
|
|
return {
|
|
current: t,
|
|
version: e.version,
|
|
isWindows: J(ot, t),
|
|
isiOS: J("iOS", t),
|
|
isAndroid: J(it, t),
|
|
isOSX: J("OSX", t),
|
|
isLinux: J("Linux", t),
|
|
isSolaris: J(at, t),
|
|
isFreeBSD: J(ut, t),
|
|
isChromeOS: J(st, t),
|
|
};
|
|
},
|
|
lt = {
|
|
unknown: function () {
|
|
return ct({ current: undefined, version: et.unknown() });
|
|
},
|
|
nu: ct,
|
|
windows: $(ot),
|
|
ios: $("iOS"),
|
|
android: $(it),
|
|
linux: $("Linux"),
|
|
osx: $("OSX"),
|
|
solaris: $(at),
|
|
freebsd: $(ut),
|
|
chromeos: $(st),
|
|
},
|
|
ft = function (e, n) {
|
|
return Q(e, n).map(function (e) {
|
|
var t = et.detect(e.versionRegexes, n);
|
|
return { current: e.name, version: t };
|
|
});
|
|
},
|
|
dt = function (e, n) {
|
|
return Q(e, n).map(function (e) {
|
|
var t = et.detect(e.versionRegexes, n);
|
|
return { current: e.name, version: t };
|
|
});
|
|
},
|
|
ht = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
|
|
mt = [
|
|
{
|
|
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",
|
|
versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/, ht],
|
|
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: [ht, /.*?opera\/([0-9]+)\.([0-9]+).*/],
|
|
search: re("opera"),
|
|
},
|
|
{
|
|
name: "Firefox",
|
|
versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
|
|
search: re("firefox"),
|
|
},
|
|
{
|
|
name: "Safari",
|
|
versionRegexes: [ht, /.*?cpu os ([0-9]+)_([0-9]+).*/],
|
|
search: function (e) {
|
|
return (Z(e, "safari") || Z(e, "mobile/")) && Z(e, "applewebkit");
|
|
},
|
|
},
|
|
],
|
|
gt = [
|
|
{
|
|
name: "Windows",
|
|
search: re("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: re("android"),
|
|
versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/],
|
|
},
|
|
{
|
|
name: "OSX",
|
|
search: re("mac os x"),
|
|
versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/],
|
|
},
|
|
{ name: "Linux", search: re("linux"), versionRegexes: [] },
|
|
{ name: "Solaris", search: re("sunos"), versionRegexes: [] },
|
|
{ name: "FreeBSD", search: re("freebsd"), versionRegexes: [] },
|
|
{
|
|
name: "ChromeOS",
|
|
search: re("cros"),
|
|
versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/],
|
|
},
|
|
],
|
|
pt = { browsers: $(mt), oses: $(gt) },
|
|
vt = Je(
|
|
(function (e, t) {
|
|
var n = pt.browsers(),
|
|
r = pt.oses(),
|
|
o = ft(n, e).fold(rt.unknown, rt.nu),
|
|
i = dt(r, e).fold(lt.unknown, lt.nu);
|
|
return {
|
|
browser: o,
|
|
os: i,
|
|
deviceType: (function (e, t, n, r) {
|
|
var o = e.isiOS() && !0 === /ipad/i.test(n),
|
|
i = e.isiOS() && !o,
|
|
a = e.isiOS() || e.isAndroid(),
|
|
u = a || r("(pointer:coarse)"),
|
|
s = o || (!i && a && r("(min-device-width:768px)")),
|
|
c = i || (a && !s),
|
|
l = t.isSafari() && e.isiOS() && !1 === /safari/i.test(n),
|
|
f = !c && !s && !l;
|
|
return {
|
|
isiPad: $(o),
|
|
isiPhone: $(i),
|
|
isTablet: $(s),
|
|
isPhone: $(c),
|
|
isTouch: $(u),
|
|
isAndroid: e.isAndroid,
|
|
isiOS: e.isiOS,
|
|
isWebView: $(l),
|
|
isDesktop: $(f),
|
|
};
|
|
})(i, o, e, t),
|
|
};
|
|
})(j.navigator.userAgent, function (e) {
|
|
return j.window.matchMedia(e).matches;
|
|
}),
|
|
),
|
|
yt = function (e) {
|
|
if (null === e || e === undefined)
|
|
throw new Error("Node cannot be null or undefined");
|
|
return { dom: $(e) };
|
|
},
|
|
bt = {
|
|
fromHtml: function (e, t) {
|
|
var n = (t || j.document).createElement("div");
|
|
if (((n.innerHTML = e), !n.hasChildNodes() || 1 < n.childNodes.length))
|
|
throw (
|
|
(j.console.error("HTML does not have a single root node", e),
|
|
new Error("HTML must have a single root node"))
|
|
);
|
|
return yt(n.childNodes[0]);
|
|
},
|
|
fromTag: function (e, t) {
|
|
var n = (t || j.document).createElement(e);
|
|
return yt(n);
|
|
},
|
|
fromText: function (e, t) {
|
|
var n = (t || j.document).createTextNode(e);
|
|
return yt(n);
|
|
},
|
|
fromDom: yt,
|
|
fromPoint: function (e, t, n) {
|
|
var r = e.dom();
|
|
return k.from(r.elementFromPoint(t, n)).map(yt);
|
|
},
|
|
},
|
|
Ct =
|
|
(j.Node.ATTRIBUTE_NODE,
|
|
j.Node.CDATA_SECTION_NODE,
|
|
j.Node.COMMENT_NODE,
|
|
j.Node.DOCUMENT_NODE),
|
|
wt =
|
|
(j.Node.DOCUMENT_TYPE_NODE,
|
|
j.Node.DOCUMENT_FRAGMENT_NODE,
|
|
j.Node.ELEMENT_NODE),
|
|
xt = j.Node.TEXT_NODE,
|
|
zt =
|
|
(j.Node.PROCESSING_INSTRUCTION_NODE,
|
|
j.Node.ENTITY_REFERENCE_NODE,
|
|
j.Node.ENTITY_NODE,
|
|
j.Node.NOTATION_NODE,
|
|
"undefined" != typeof j.window ? j.window : Function("return this;")(),
|
|
ae(wt)),
|
|
Et = ae(xt),
|
|
Nt = Object.keys,
|
|
St = Object.hasOwnProperty,
|
|
kt = function (e, r) {
|
|
var o = {};
|
|
return (
|
|
ue(e, function (e, t) {
|
|
var n = r(e, t);
|
|
o[n.k] = n.v;
|
|
}),
|
|
o
|
|
);
|
|
},
|
|
Tt = function (e, t) {
|
|
return St.call(e, t);
|
|
},
|
|
At = function (e, t, n) {
|
|
he(e.dom(), t, n);
|
|
},
|
|
Mt = function (e, t) {
|
|
return fe(e) ? e.style.getPropertyValue(t) : "";
|
|
},
|
|
Rt = function (e, t) {
|
|
for (
|
|
var n = [],
|
|
r = function (e) {
|
|
return n.push(e), t(e);
|
|
},
|
|
o = t(e);
|
|
(o = o.bind(r)).isSome();
|
|
|
|
);
|
|
return n;
|
|
},
|
|
Dt = function (e, t) {
|
|
return Ce(e, t, j.Node.DOCUMENT_POSITION_CONTAINED_BY);
|
|
},
|
|
_t = wt,
|
|
Ot = Ct,
|
|
Bt = oe().browser.isIE()
|
|
? function (e, t) {
|
|
return Dt(e.dom(), t.dom());
|
|
}
|
|
: function (e, t) {
|
|
var n = e.dom(),
|
|
r = t.dom();
|
|
return n !== r && n.contains(r);
|
|
},
|
|
Ht = (be("element", "offset"), oe().browser),
|
|
Pt = {
|
|
getPos: function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i = 0,
|
|
a = 0,
|
|
u = e.ownerDocument;
|
|
if (((n = n || e), t)) {
|
|
if (
|
|
n === e &&
|
|
t.getBoundingClientRect &&
|
|
"static" === ve(bt.fromDom(e), "position")
|
|
)
|
|
return {
|
|
x: (i =
|
|
(o = t.getBoundingClientRect()).left +
|
|
(u.documentElement.scrollLeft || e.scrollLeft) -
|
|
u.documentElement.clientLeft),
|
|
y: (a =
|
|
o.top +
|
|
(u.documentElement.scrollTop || e.scrollTop) -
|
|
u.documentElement.clientTop),
|
|
};
|
|
for (r = t; r && r !== n && r.nodeType && !He(r, n); )
|
|
(i += r.offsetLeft || 0),
|
|
(a += r.offsetTop || 0),
|
|
(r = r.offsetParent);
|
|
for (r = t.parentNode; r && r !== n && r.nodeType && !He(r, n); )
|
|
(i -= r.scrollLeft || 0),
|
|
(a -= r.scrollTop || 0),
|
|
(r = r.parentNode);
|
|
a += (function (e) {
|
|
return Ht.isFirefox() && "table" === ie(e)
|
|
? Be(Re(e))
|
|
.filter(function (e) {
|
|
return "caption" === ie(e);
|
|
})
|
|
.bind(function (o) {
|
|
return Be(Me(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;
|
|
})(bt.fromDom(t));
|
|
}
|
|
return { x: i, y: a };
|
|
},
|
|
},
|
|
Lt = {},
|
|
Vt = { exports: Lt };
|
|
(Pe = undefined),
|
|
(Le = Lt),
|
|
(Ve = Vt),
|
|
(Ie = undefined),
|
|
(function (e) {
|
|
"object" == typeof Le && void 0 !== Ve
|
|
? (Ve.exports = e())
|
|
: "function" == typeof Pe && Pe.amd
|
|
? Pe([], e)
|
|
: (("undefined" != typeof window
|
|
? window
|
|
: "undefined" != typeof global
|
|
? global
|
|
: "undefined" != typeof self
|
|
? self
|
|
: this
|
|
).EphoxContactWrapper = e());
|
|
})(function () {
|
|
return (function l(i, a, u) {
|
|
function s(t, e) {
|
|
if (!a[t]) {
|
|
if (!i[t]) {
|
|
var n = "function" == typeof Ie && Ie;
|
|
if (!e && n) return n(t, !0);
|
|
if (c) return c(t, !0);
|
|
var r = new Error("Cannot find module '" + t + "'");
|
|
throw ((r.code = "MODULE_NOT_FOUND"), r);
|
|
}
|
|
var o = (a[t] = { exports: {} });
|
|
i[t][0].call(
|
|
o.exports,
|
|
function (e) {
|
|
return s(i[t][1][e] || e);
|
|
},
|
|
o,
|
|
o.exports,
|
|
l,
|
|
i,
|
|
a,
|
|
u,
|
|
);
|
|
}
|
|
return a[t].exports;
|
|
}
|
|
for (var c = "function" == typeof Ie && Ie, e = 0; e < u.length; e++)
|
|
s(u[e]);
|
|
return s;
|
|
})(
|
|
{
|
|
1: [
|
|
function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i = (t.exports = {});
|
|
function a() {
|
|
throw new Error("setTimeout has not been defined");
|
|
}
|
|
function u() {
|
|
throw new Error("clearTimeout has not been defined");
|
|
}
|
|
function s(e) {
|
|
if (r === setTimeout) return setTimeout(e, 0);
|
|
if ((r === a || !r) && setTimeout)
|
|
return (r = setTimeout), setTimeout(e, 0);
|
|
try {
|
|
return r(e, 0);
|
|
} catch (t) {
|
|
try {
|
|
return r.call(null, e, 0);
|
|
} catch (t) {
|
|
return r.call(this, e, 0);
|
|
}
|
|
}
|
|
}
|
|
!(function () {
|
|
try {
|
|
r = "function" == typeof setTimeout ? setTimeout : a;
|
|
} catch (e) {
|
|
r = a;
|
|
}
|
|
try {
|
|
o = "function" == typeof clearTimeout ? clearTimeout : u;
|
|
} catch (e) {
|
|
o = u;
|
|
}
|
|
})();
|
|
var c,
|
|
l = [],
|
|
f = !1,
|
|
d = -1;
|
|
function h() {
|
|
f &&
|
|
c &&
|
|
((f = !1),
|
|
c.length ? (l = c.concat(l)) : (d = -1),
|
|
l.length && m());
|
|
}
|
|
function m() {
|
|
if (!f) {
|
|
var e = s(h);
|
|
f = !0;
|
|
for (var t = l.length; t; ) {
|
|
for (c = l, l = []; ++d < t; ) c && c[d].run();
|
|
(d = -1), (t = l.length);
|
|
}
|
|
(c = null),
|
|
(f = !1),
|
|
(function n(e) {
|
|
if (o === clearTimeout) return clearTimeout(e);
|
|
if ((o === u || !o) && clearTimeout)
|
|
return (o = clearTimeout), clearTimeout(e);
|
|
try {
|
|
return o(e);
|
|
} catch (t) {
|
|
try {
|
|
return o.call(null, e);
|
|
} catch (t) {
|
|
return o.call(this, e);
|
|
}
|
|
}
|
|
})(e);
|
|
}
|
|
}
|
|
function g(e, t) {
|
|
(this.fun = e), (this.array = t);
|
|
}
|
|
function p() {}
|
|
(i.nextTick = function (e) {
|
|
var t = new Array(arguments.length - 1);
|
|
if (1 < arguments.length)
|
|
for (var n = 1; n < arguments.length; n++)
|
|
t[n - 1] = arguments[n];
|
|
l.push(new g(e, t)), 1 !== l.length || f || s(m);
|
|
}),
|
|
(g.prototype.run = function () {
|
|
this.fun.apply(null, this.array);
|
|
}),
|
|
(i.title = "browser"),
|
|
(i.browser = !0),
|
|
(i.env = {}),
|
|
(i.argv = []),
|
|
(i.version = ""),
|
|
(i.versions = {}),
|
|
(i.on = p),
|
|
(i.addListener = p),
|
|
(i.once = p),
|
|
(i.off = p),
|
|
(i.removeListener = p),
|
|
(i.removeAllListeners = p),
|
|
(i.emit = p),
|
|
(i.prependListener = p),
|
|
(i.prependOnceListener = p),
|
|
(i.listeners = function (e) {
|
|
return [];
|
|
}),
|
|
(i.binding = function (e) {
|
|
throw new Error("process.binding is not supported");
|
|
}),
|
|
(i.cwd = function () {
|
|
return "/";
|
|
}),
|
|
(i.chdir = function (e) {
|
|
throw new Error("process.chdir is not supported");
|
|
}),
|
|
(i.umask = function () {
|
|
return 0;
|
|
});
|
|
},
|
|
{},
|
|
],
|
|
2: [
|
|
function (e, f, t) {
|
|
(function (t) {
|
|
function r() {}
|
|
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 = undefined),
|
|
(this._deferreds = []),
|
|
l(e, this);
|
|
}
|
|
function o(r, o) {
|
|
for (; 3 === r._state; ) r = r._value;
|
|
0 !== r._state
|
|
? ((r._handled = !0),
|
|
i._immediateFn(function () {
|
|
var e = 1 === r._state ? o.onFulfilled : o.onRejected;
|
|
if (null !== e) {
|
|
var t;
|
|
try {
|
|
t = e(r._value);
|
|
} catch (n) {
|
|
return void u(o.promise, n);
|
|
}
|
|
a(o.promise, t);
|
|
} else (1 === r._state ? a : u)(o.promise, r._value);
|
|
}))
|
|
: r._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 l(
|
|
(function r(e, t) {
|
|
return function () {
|
|
e.apply(t, arguments);
|
|
};
|
|
})(n, t),
|
|
e,
|
|
);
|
|
}
|
|
(e._state = 1), (e._value = t), s(e);
|
|
} catch (o) {
|
|
u(e, o);
|
|
}
|
|
}
|
|
function u(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++)
|
|
o(e, e._deferreds[t]);
|
|
e._deferreds = null;
|
|
}
|
|
function c(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), a(t, e));
|
|
},
|
|
function (e) {
|
|
n || ((n = !0), u(t, e));
|
|
},
|
|
);
|
|
} catch (r) {
|
|
if (n) return;
|
|
(n = !0), u(t, r);
|
|
}
|
|
}
|
|
var e, n;
|
|
(e = this),
|
|
(n = setTimeout),
|
|
(i.prototype["catch"] = function (e) {
|
|
return this.then(null, e);
|
|
}),
|
|
(i.prototype.then = function (e, t) {
|
|
var n = new this.constructor(r);
|
|
return o(this, new c(e, t, n)), n;
|
|
}),
|
|
(i.all = function (e) {
|
|
var s = Array.prototype.slice.call(e);
|
|
return new i(function (o, i) {
|
|
if (0 === s.length) return o([]);
|
|
var a = s.length;
|
|
function u(t, e) {
|
|
try {
|
|
if (
|
|
e &&
|
|
("object" == typeof e || "function" == typeof e)
|
|
) {
|
|
var n = e.then;
|
|
if ("function" == typeof n)
|
|
return void n.call(
|
|
e,
|
|
function (e) {
|
|
u(t, e);
|
|
},
|
|
i,
|
|
);
|
|
}
|
|
(s[t] = e), 0 == --a && o(s);
|
|
} catch (r) {
|
|
i(r);
|
|
}
|
|
}
|
|
for (var e = 0; e < s.length; e++) u(e, s[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 t
|
|
? function (e) {
|
|
t(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;
|
|
}),
|
|
void 0 !== f && f.exports
|
|
? (f.exports = i)
|
|
: e.Promise || (e.Promise = i);
|
|
}).call(this, e("timers").setImmediate);
|
|
},
|
|
{ timers: 3 },
|
|
],
|
|
3: [
|
|
function (s, e, c) {
|
|
(function (e, t) {
|
|
var r = s("process/browser.js").nextTick,
|
|
n = Function.prototype.apply,
|
|
o = Array.prototype.slice,
|
|
i = {},
|
|
a = 0;
|
|
function u(e, t) {
|
|
(this._id = e), (this._clearFn = t);
|
|
}
|
|
(c.setTimeout = function () {
|
|
return new u(
|
|
n.call(setTimeout, window, arguments),
|
|
clearTimeout,
|
|
);
|
|
}),
|
|
(c.setInterval = function () {
|
|
return new u(
|
|
n.call(setInterval, window, arguments),
|
|
clearInterval,
|
|
);
|
|
}),
|
|
(c.clearTimeout = c.clearInterval =
|
|
function (e) {
|
|
e.close();
|
|
}),
|
|
(u.prototype.unref = u.prototype.ref = function () {}),
|
|
(u.prototype.close = function () {
|
|
this._clearFn.call(window, this._id);
|
|
}),
|
|
(c.enroll = function (e, t) {
|
|
clearTimeout(e._idleTimeoutId), (e._idleTimeout = t);
|
|
}),
|
|
(c.unenroll = function (e) {
|
|
clearTimeout(e._idleTimeoutId), (e._idleTimeout = -1);
|
|
}),
|
|
(c._unrefActive = c.active =
|
|
function (e) {
|
|
clearTimeout(e._idleTimeoutId);
|
|
var t = e._idleTimeout;
|
|
0 <= t &&
|
|
(e._idleTimeoutId = setTimeout(function () {
|
|
e._onTimeout && e._onTimeout();
|
|
}, t));
|
|
}),
|
|
(c.setImmediate =
|
|
"function" == typeof e
|
|
? e
|
|
: function (e) {
|
|
var t = a++,
|
|
n = !(arguments.length < 2) && o.call(arguments, 1);
|
|
return (
|
|
(i[t] = !0),
|
|
r(function () {
|
|
i[t] &&
|
|
(n ? e.apply(null, n) : e.call(null),
|
|
c.clearImmediate(t));
|
|
}),
|
|
t
|
|
);
|
|
}),
|
|
(c.clearImmediate =
|
|
"function" == typeof t
|
|
? t
|
|
: function (e) {
|
|
delete i[e];
|
|
});
|
|
}).call(
|
|
this,
|
|
s("timers").setImmediate,
|
|
s("timers").clearImmediate,
|
|
);
|
|
},
|
|
{ "process/browser.js": 1, timers: 3 },
|
|
],
|
|
4: [
|
|
function (e, t, n) {
|
|
var r = e("promise-polyfill"),
|
|
o =
|
|
"undefined" != typeof window
|
|
? window
|
|
: Function("return this;")();
|
|
t.exports = { boltExport: o.Promise || r };
|
|
},
|
|
{ "promise-polyfill": 2 },
|
|
],
|
|
},
|
|
{},
|
|
[4],
|
|
)(4);
|
|
});
|
|
function It(e) {
|
|
j.setTimeout(function () {
|
|
throw e;
|
|
}, 0);
|
|
}
|
|
function Ft(i, e) {
|
|
return e(function (n) {
|
|
var r = [],
|
|
o = 0;
|
|
0 === i.length
|
|
? n([])
|
|
: z(i, function (e, t) {
|
|
e.get(
|
|
(function (t) {
|
|
return function (e) {
|
|
(r[t] = e), ++o >= i.length && n(r);
|
|
};
|
|
})(t),
|
|
);
|
|
});
|
|
});
|
|
}
|
|
var Ut,
|
|
jt,
|
|
qt,
|
|
$t = Vt.exports.boltExport,
|
|
Wt = function (e) {
|
|
var n = k.none(),
|
|
t = [],
|
|
r = function (e) {
|
|
o() ? a(e) : t.push(e);
|
|
},
|
|
o = function () {
|
|
return n.isSome();
|
|
},
|
|
i = function (e) {
|
|
z(e, a);
|
|
},
|
|
a = function (t) {
|
|
n.each(function (e) {
|
|
j.setTimeout(function () {
|
|
t(e);
|
|
}, 0);
|
|
});
|
|
};
|
|
return (
|
|
e(function (e) {
|
|
(n = k.some(e)), i(t), (t = []);
|
|
}),
|
|
{
|
|
get: r,
|
|
map: function (n) {
|
|
return Wt(function (t) {
|
|
r(function (e) {
|
|
t(n(e));
|
|
});
|
|
});
|
|
},
|
|
isReady: o,
|
|
}
|
|
);
|
|
},
|
|
Kt = {
|
|
nu: Wt,
|
|
pure: function (t) {
|
|
return Wt(function (e) {
|
|
e(t);
|
|
});
|
|
},
|
|
},
|
|
Xt = function (n) {
|
|
function e(e) {
|
|
n().then(e, It);
|
|
}
|
|
return {
|
|
map: function (e) {
|
|
return Xt(function () {
|
|
return n().then(e);
|
|
});
|
|
},
|
|
bind: function (t) {
|
|
return Xt(function () {
|
|
return n().then(function (e) {
|
|
return t(e).toPromise();
|
|
});
|
|
});
|
|
},
|
|
anonBind: function (e) {
|
|
return Xt(function () {
|
|
return n().then(function () {
|
|
return e.toPromise();
|
|
});
|
|
});
|
|
},
|
|
toLazy: function () {
|
|
return Kt.nu(e);
|
|
},
|
|
toCached: function () {
|
|
var e = null;
|
|
return Xt(function () {
|
|
return null === e && (e = n()), e;
|
|
});
|
|
},
|
|
toPromise: n,
|
|
get: e,
|
|
};
|
|
},
|
|
Yt = {
|
|
nu: function (e) {
|
|
return Xt(function () {
|
|
return new $t(e);
|
|
});
|
|
},
|
|
pure: function (e) {
|
|
return Xt(function () {
|
|
return $t.resolve(e);
|
|
});
|
|
},
|
|
},
|
|
Gt = function (e) {
|
|
return Ft(e, Yt.nu);
|
|
},
|
|
Jt = function (n) {
|
|
return {
|
|
is: function (e) {
|
|
return n === e;
|
|
},
|
|
isValue: a,
|
|
isError: c,
|
|
getOr: $(n),
|
|
getOrThunk: $(n),
|
|
getOrDie: $(n),
|
|
or: function (e) {
|
|
return Jt(n);
|
|
},
|
|
orThunk: function (e) {
|
|
return Jt(n);
|
|
},
|
|
fold: function (e, t) {
|
|
return t(n);
|
|
},
|
|
map: function (e) {
|
|
return Jt(e(n));
|
|
},
|
|
mapError: function (e) {
|
|
return Jt(n);
|
|
},
|
|
each: function (e) {
|
|
e(n);
|
|
},
|
|
bind: function (e) {
|
|
return e(n);
|
|
},
|
|
exists: function (e) {
|
|
return e(n);
|
|
},
|
|
forall: function (e) {
|
|
return e(n);
|
|
},
|
|
toOption: function () {
|
|
return k.some(n);
|
|
},
|
|
};
|
|
},
|
|
Qt = function (n) {
|
|
return {
|
|
is: c,
|
|
isValue: c,
|
|
isError: a,
|
|
getOr: W,
|
|
getOrThunk: function (e) {
|
|
return e();
|
|
},
|
|
getOrDie: function () {
|
|
return (function (e) {
|
|
return function () {
|
|
throw new Error(e);
|
|
};
|
|
})(String(n))();
|
|
},
|
|
or: function (e) {
|
|
return e;
|
|
},
|
|
orThunk: function (e) {
|
|
return e();
|
|
},
|
|
fold: function (e, t) {
|
|
return e(n);
|
|
},
|
|
map: function (e) {
|
|
return Qt(n);
|
|
},
|
|
mapError: function (e) {
|
|
return Qt(e(n));
|
|
},
|
|
each: i,
|
|
bind: function (e) {
|
|
return Qt(n);
|
|
},
|
|
exists: c,
|
|
forall: a,
|
|
toOption: k.none,
|
|
};
|
|
},
|
|
Zt = {
|
|
value: Jt,
|
|
error: Qt,
|
|
fromOption: function (e, t) {
|
|
return e.fold(function () {
|
|
return Qt(t);
|
|
}, Jt);
|
|
},
|
|
},
|
|
en = window.Promise
|
|
? window.Promise
|
|
: ((Ut =
|
|
Array.isArray ||
|
|
function (e) {
|
|
return "[object Array]" === Object.prototype.toString.call(e);
|
|
}),
|
|
(jt =
|
|
nn.immediateFn ||
|
|
("function" == typeof j.setImmediate && j.setImmediate) ||
|
|
function (e) {
|
|
j.setTimeout(e, 1);
|
|
}),
|
|
(nn.prototype["catch"] = function (e) {
|
|
return this.then(null, e);
|
|
}),
|
|
(nn.prototype.then = function (n, r) {
|
|
var o = this;
|
|
return new nn(function (e, t) {
|
|
rn.call(o, new sn(n, r, e, t));
|
|
});
|
|
}),
|
|
(nn.all = function () {
|
|
var s = Array.prototype.slice.call(
|
|
1 === arguments.length && Ut(arguments[0])
|
|
? arguments[0]
|
|
: arguments,
|
|
);
|
|
return new nn(function (o, i) {
|
|
if (0 === s.length) return o([]);
|
|
var a = s.length;
|
|
function u(t, e) {
|
|
try {
|
|
if (e && ("object" == typeof e || "function" == typeof e)) {
|
|
var n = e.then;
|
|
if ("function" == typeof n)
|
|
return void n.call(
|
|
e,
|
|
function (e) {
|
|
u(t, e);
|
|
},
|
|
i,
|
|
);
|
|
}
|
|
(s[t] = e), 0 == --a && o(s);
|
|
} catch (r) {
|
|
i(r);
|
|
}
|
|
}
|
|
for (var e = 0; e < s.length; e++) u(e, s[e]);
|
|
});
|
|
}),
|
|
(nn.resolve = function (t) {
|
|
return t && "object" == typeof t && t.constructor === nn
|
|
? t
|
|
: new nn(function (e) {
|
|
e(t);
|
|
});
|
|
}),
|
|
(nn.reject = function (n) {
|
|
return new nn(function (e, t) {
|
|
t(n);
|
|
});
|
|
}),
|
|
(nn.race = function (o) {
|
|
return new nn(function (e, t) {
|
|
for (var n = 0, r = o.length; n < r; n++) o[n].then(e, t);
|
|
});
|
|
}),
|
|
nn);
|
|
function tn(e, t) {
|
|
return function () {
|
|
e.apply(t, arguments);
|
|
};
|
|
}
|
|
function nn(e) {
|
|
if ("object" != typeof this)
|
|
throw new TypeError("Promises must be constructed via new");
|
|
if ("function" != typeof e) throw new TypeError("not a function");
|
|
(this._state = null),
|
|
(this._value = null),
|
|
(this._deferreds = []),
|
|
cn(e, tn(on, this), tn(an, this));
|
|
}
|
|
function rn(r) {
|
|
var o = this;
|
|
null !== this._state
|
|
? jt(function () {
|
|
var e = o._state ? r.onFulfilled : r.onRejected;
|
|
if (null !== e) {
|
|
var t;
|
|
try {
|
|
t = e(o._value);
|
|
} catch (n) {
|
|
return void r.reject(n);
|
|
}
|
|
r.resolve(t);
|
|
} else (o._state ? r.resolve : r.reject)(o._value);
|
|
})
|
|
: this._deferreds.push(r);
|
|
}
|
|
function on(e) {
|
|
try {
|
|
if (e === this)
|
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
if (e && ("object" == typeof e || "function" == typeof e)) {
|
|
var t = e.then;
|
|
if ("function" == typeof t)
|
|
return void cn(tn(t, e), tn(on, this), tn(an, this));
|
|
}
|
|
(this._state = !0), (this._value = e), un.call(this);
|
|
} catch (n) {
|
|
an.call(this, n);
|
|
}
|
|
}
|
|
function an(e) {
|
|
(this._state = !1), (this._value = e), un.call(this);
|
|
}
|
|
function un() {
|
|
for (var e = 0, t = this._deferreds.length; e < t; e++)
|
|
rn.call(this, this._deferreds[e]);
|
|
this._deferreds = null;
|
|
}
|
|
function sn(e, t, n, r) {
|
|
(this.onFulfilled = "function" == typeof e ? e : null),
|
|
(this.onRejected = "function" == typeof t ? t : null),
|
|
(this.resolve = n),
|
|
(this.reject = r);
|
|
}
|
|
function cn(e, t, n) {
|
|
var r = !1;
|
|
try {
|
|
e(
|
|
function (e) {
|
|
r || ((r = !0), t(e));
|
|
},
|
|
function (e) {
|
|
r || ((r = !0), n(e));
|
|
},
|
|
);
|
|
} catch (o) {
|
|
if (r) return;
|
|
(r = !0), n(o);
|
|
}
|
|
}
|
|
function ln(e, t) {
|
|
return "number" != typeof t && (t = 0), j.setTimeout(e, t);
|
|
}
|
|
function fn(e, t) {
|
|
return "number" != typeof t && (t = 1), j.setInterval(e, t);
|
|
}
|
|
function dn(n, r) {
|
|
var o, e;
|
|
return (
|
|
((e = function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
j.clearTimeout(o),
|
|
(o = ln(function () {
|
|
n.apply(this, e);
|
|
}, r));
|
|
}).stop = function () {
|
|
j.clearTimeout(o);
|
|
}),
|
|
e
|
|
);
|
|
}
|
|
function hn(e, t, n) {
|
|
var r, o;
|
|
if (!e) return 0;
|
|
if (((n = n || e), e.length !== undefined)) {
|
|
for (r = 0, o = e.length; r < o; r++)
|
|
if (!1 === t.call(n, e[r], r, e)) return 0;
|
|
} else
|
|
for (r in e)
|
|
if (e.hasOwnProperty(r) && !1 === t.call(n, e[r], r, e)) return 0;
|
|
return 1;
|
|
}
|
|
function mn(e, t, n) {
|
|
var r, o;
|
|
for (r = 0, o = e.length; r < o; r++) if (t.call(n, e[r], r, e)) return r;
|
|
return -1;
|
|
}
|
|
function gn(e) {
|
|
return null === e || e === undefined ? "" : ("" + e).replace(An, "");
|
|
}
|
|
function pn(e, t) {
|
|
return t
|
|
? !("array" !== t || !Tn.isArray(e)) || typeof e === t
|
|
: e !== undefined;
|
|
}
|
|
var vn = {
|
|
requestAnimationFrame: function (e, t) {
|
|
qt
|
|
? qt.then(e)
|
|
: (qt = new en(function (e) {
|
|
!(function (e, t) {
|
|
var n,
|
|
r = j.window.requestAnimationFrame,
|
|
o = ["ms", "moz", "webkit"];
|
|
for (n = 0; n < o.length && !r; n++)
|
|
r = j.window[o[n] + "RequestAnimationFrame"];
|
|
(r =
|
|
r ||
|
|
function (e) {
|
|
j.window.setTimeout(e, 0);
|
|
})(e, t);
|
|
})(e, (t = t || j.document.body));
|
|
}).then(e));
|
|
},
|
|
setTimeout: ln,
|
|
setInterval: fn,
|
|
setEditorTimeout: function (e, t, n) {
|
|
return ln(function () {
|
|
e.removed || t();
|
|
}, n);
|
|
},
|
|
setEditorInterval: function (e, t, n) {
|
|
var r;
|
|
return (r = fn(function () {
|
|
e.removed ? j.clearInterval(r) : t();
|
|
}, n));
|
|
},
|
|
debounce: dn,
|
|
throttle: dn,
|
|
clearInterval: function (e) {
|
|
return j.clearInterval(e);
|
|
},
|
|
clearTimeout: function (e) {
|
|
return j.clearTimeout(e);
|
|
},
|
|
},
|
|
yn = j.navigator.userAgent,
|
|
bn = oe(),
|
|
Cn = bn.browser,
|
|
wn = bn.os,
|
|
xn = bn.deviceType,
|
|
zn = /WebKit/.test(yn) && !Cn.isEdge(),
|
|
En =
|
|
"FormData" in j.window &&
|
|
"FileReader" in j.window &&
|
|
"URL" in j.window &&
|
|
!!j.URL.createObjectURL,
|
|
Nn = -1 !== yn.indexOf("Windows Phone"),
|
|
Sn = {
|
|
opera: Cn.isOpera(),
|
|
webkit: zn,
|
|
ie: !(!Cn.isIE() && !Cn.isEdge()) && Cn.version.major,
|
|
gecko: Cn.isFirefox(),
|
|
mac: wn.isOSX() || wn.isiOS(),
|
|
iOS: xn.isiPad() || xn.isiPhone(),
|
|
android: wn.isAndroid(),
|
|
contentEditable: !0,
|
|
transparentSrc:
|
|
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
caretAfter: !0,
|
|
range: j.window.getSelection && "Range" in j.window,
|
|
documentMode: Cn.isIE() ? j.document.documentMode || 7 : 10,
|
|
fileApi: En,
|
|
ceFalse: !0,
|
|
cacheSuffix: null,
|
|
container: null,
|
|
experimentalShadowDom: !1,
|
|
canHaveCSP: !Cn.isIE(),
|
|
desktop: xn.isDesktop(),
|
|
windowsPhone: Nn,
|
|
browser: {
|
|
current: Cn.current,
|
|
version: Cn.version,
|
|
isChrome: Cn.isChrome,
|
|
isEdge: Cn.isEdge,
|
|
isFirefox: Cn.isFirefox,
|
|
isIE: Cn.isIE,
|
|
isOpera: Cn.isOpera,
|
|
isSafari: Cn.isSafari,
|
|
},
|
|
os: {
|
|
current: wn.current,
|
|
version: wn.version,
|
|
isAndroid: wn.isAndroid,
|
|
isChromeOS: wn.isChromeOS,
|
|
isFreeBSD: wn.isFreeBSD,
|
|
isiOS: wn.isiOS,
|
|
isLinux: wn.isLinux,
|
|
isOSX: wn.isOSX,
|
|
isSolaris: wn.isSolaris,
|
|
isWindows: wn.isWindows,
|
|
},
|
|
deviceType: {
|
|
isDesktop: xn.isDesktop,
|
|
isiPad: xn.isiPad,
|
|
isiPhone: xn.isiPhone,
|
|
isPhone: xn.isPhone,
|
|
isTablet: xn.isTablet,
|
|
isTouch: xn.isTouch,
|
|
isWebView: xn.isWebView,
|
|
},
|
|
},
|
|
kn = Array.isArray,
|
|
Tn = {
|
|
isArray: kn,
|
|
toArray: function (e) {
|
|
var t,
|
|
n,
|
|
r = e;
|
|
if (!kn(e)) for (r = [], t = 0, n = e.length; t < n; t++) r[t] = e[t];
|
|
return r;
|
|
},
|
|
each: hn,
|
|
map: function (n, r) {
|
|
var o = [];
|
|
return (
|
|
hn(n, function (e, t) {
|
|
o.push(r(e, t, n));
|
|
}),
|
|
o
|
|
);
|
|
},
|
|
filter: function (n, r) {
|
|
var o = [];
|
|
return (
|
|
hn(n, function (e, t) {
|
|
(r && !r(e, t, n)) || o.push(e);
|
|
}),
|
|
o
|
|
);
|
|
},
|
|
indexOf: function (e, t) {
|
|
var n, r;
|
|
if (e) for (n = 0, r = e.length; n < r; n++) if (e[n] === t) return n;
|
|
return -1;
|
|
},
|
|
reduce: function (e, t, n, r) {
|
|
var o = 0;
|
|
for (arguments.length < 3 && (n = e[0]); o < e.length; o++)
|
|
n = t.call(r, n, e[o], o);
|
|
return n;
|
|
},
|
|
findIndex: mn,
|
|
find: function (e, t, n) {
|
|
var r = mn(e, t, n);
|
|
return -1 !== r ? e[r] : undefined;
|
|
},
|
|
last: function (e) {
|
|
return e[e.length - 1];
|
|
},
|
|
},
|
|
An = /^\s*|\s*$/g,
|
|
Mn = function (e, n, r, o) {
|
|
(o = o || this),
|
|
e &&
|
|
(r && (e = e[r]),
|
|
Tn.each(e, function (e, t) {
|
|
if (!1 === n.call(o, e, t, r)) return !1;
|
|
Mn(e, n, r, o);
|
|
}));
|
|
},
|
|
Rn = {
|
|
trim: gn,
|
|
isArray: Tn.isArray,
|
|
is: pn,
|
|
toArray: Tn.toArray,
|
|
makeMap: function (e, t, n) {
|
|
var r;
|
|
for (
|
|
t = t || ",",
|
|
"string" == typeof (e = e || []) && (e = e.split(t)),
|
|
n = n || {},
|
|
r = e.length;
|
|
r--;
|
|
|
|
)
|
|
n[e[r]] = {};
|
|
return n;
|
|
},
|
|
each: Tn.each,
|
|
map: Tn.map,
|
|
grep: Tn.filter,
|
|
inArray: Tn.indexOf,
|
|
hasOwn: function (e, t) {
|
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
},
|
|
extend: function (e, t) {
|
|
for (var n, r, o, i = [], a = 2; a < arguments.length; a++)
|
|
i[a - 2] = arguments[a];
|
|
var u,
|
|
s = arguments;
|
|
for (n = 1, r = s.length; n < r; n++)
|
|
for (o in (t = s[n]))
|
|
t.hasOwnProperty(o) && (u = t[o]) !== undefined && (e[o] = u);
|
|
return e;
|
|
},
|
|
create: function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s = this,
|
|
c = 0;
|
|
if (
|
|
((e = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(e)),
|
|
(i = e[3].match(/(^|\.)(\w+)$/i)[2]),
|
|
!(o = s.createNS(e[3].replace(/\.\w+$/, ""), n))[i])
|
|
) {
|
|
if ("static" === e[2])
|
|
return (
|
|
(o[i] = t),
|
|
void (this.onCreate && this.onCreate(e[2], e[3], o[i]))
|
|
);
|
|
t[i] || ((t[i] = function () {}), (c = 1)),
|
|
(o[i] = t[i]),
|
|
s.extend(o[i].prototype, t),
|
|
e[5] &&
|
|
((r = s.resolve(e[5]).prototype),
|
|
(a = e[5].match(/\.(\w+)$/i)[1]),
|
|
(u = o[i]),
|
|
(o[i] = c
|
|
? function () {
|
|
return r[a].apply(this, arguments);
|
|
}
|
|
: function () {
|
|
return (this.parent = r[a]), u.apply(this, arguments);
|
|
}),
|
|
(o[i].prototype[i] = o[i]),
|
|
s.each(r, function (e, t) {
|
|
o[i].prototype[t] = r[t];
|
|
}),
|
|
s.each(t, function (e, t) {
|
|
r[t]
|
|
? (o[i].prototype[t] = function () {
|
|
return (this.parent = r[t]), e.apply(this, arguments);
|
|
})
|
|
: t !== i && (o[i].prototype[t] = e);
|
|
})),
|
|
s.each(t["static"], function (e, t) {
|
|
o[i][t] = e;
|
|
});
|
|
}
|
|
},
|
|
walk: Mn,
|
|
createNS: function (e, t) {
|
|
var n, r;
|
|
for (t = t || j.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 || j.window, n = 0, r = (e = e.split(".")).length;
|
|
n < r && (t = t[e[n]]);
|
|
n++
|
|
);
|
|
return t;
|
|
},
|
|
explode: function (e, t) {
|
|
return !e || pn(e, "array") ? e : Tn.map(e.split(t || ","), gn);
|
|
},
|
|
_addCacheSuffix: function (e) {
|
|
var t = Sn.cacheSuffix;
|
|
return t && (e += (-1 === e.indexOf("?") ? "?" : "&") + t), e;
|
|
},
|
|
};
|
|
function Dn(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, $(!0))).hasOwnProperty(ie(e));
|
|
};
|
|
}
|
|
function _n(e) {
|
|
return zt(e) && !In(e);
|
|
}
|
|
function On(e) {
|
|
return zt(e) && "br" === ie(e);
|
|
}
|
|
function Bn(e) {
|
|
return (
|
|
e &&
|
|
"SPAN" === e.tagName &&
|
|
"bookmark" === e.getAttribute("data-mce-type")
|
|
);
|
|
}
|
|
var Hn,
|
|
Pn,
|
|
Ln,
|
|
Vn = Dn(["h1", "h2", "h3", "h4", "h5", "h6"]),
|
|
In = Dn([
|
|
"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",
|
|
]),
|
|
Fn = Dn([
|
|
"h1",
|
|
"h2",
|
|
"h3",
|
|
"h4",
|
|
"h5",
|
|
"h6",
|
|
"p",
|
|
"div",
|
|
"address",
|
|
"pre",
|
|
"form",
|
|
"blockquote",
|
|
"center",
|
|
"dir",
|
|
"fieldset",
|
|
"header",
|
|
"footer",
|
|
"article",
|
|
"section",
|
|
"hgroup",
|
|
"aside",
|
|
"nav",
|
|
"figure",
|
|
]),
|
|
Un = Dn(["ul", "ol", "dl"]),
|
|
jn = Dn(["li", "dd", "dt"]),
|
|
qn = Dn([
|
|
"area",
|
|
"base",
|
|
"basefont",
|
|
"br",
|
|
"col",
|
|
"frame",
|
|
"hr",
|
|
"img",
|
|
"input",
|
|
"isindex",
|
|
"link",
|
|
"meta",
|
|
"param",
|
|
"embed",
|
|
"source",
|
|
"wbr",
|
|
"track",
|
|
]),
|
|
$n = Dn(["thead", "tbody", "tfoot"]),
|
|
Wn = Dn(["td", "th"]),
|
|
Kn = Dn(["pre", "script", "textarea", "style"]),
|
|
Xn = function (e, t) {
|
|
var n,
|
|
r = t.childNodes;
|
|
if (!Ge.isElement(t) || !Bn(t)) {
|
|
for (n = r.length - 1; 0 <= n; n--) Xn(e, r[n]);
|
|
if (!1 === Ge.isDocument(t)) {
|
|
if (Ge.isText(t) && 0 < t.nodeValue.length) {
|
|
var o = Rn.trim(t.nodeValue).length;
|
|
if (e.isBlock(t.parentNode) || 0 < o) return;
|
|
if (
|
|
0 === o &&
|
|
(function (e) {
|
|
var t =
|
|
e.previousSibling && "SPAN" === e.previousSibling.nodeName,
|
|
n = e.nextSibling && "SPAN" === e.nextSibling.nodeName;
|
|
return t && n;
|
|
})(t)
|
|
)
|
|
return;
|
|
} else if (
|
|
Ge.isElement(t) &&
|
|
(1 === (r = t.childNodes).length &&
|
|
Bn(r[0]) &&
|
|
t.parentNode.insertBefore(r[0], t),
|
|
r.length || qn(bt.fromDom(t)))
|
|
)
|
|
return;
|
|
e.remove(t);
|
|
}
|
|
return t;
|
|
}
|
|
},
|
|
Yn = { trimNode: Xn },
|
|
Gn = Rn.makeMap,
|
|
Jn =
|
|
/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
|
Qn = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
|
Zn = /[<>&\"\']/g,
|
|
er = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi,
|
|
tr = {
|
|
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",
|
|
};
|
|
(Pn = {
|
|
'"': """,
|
|
"'": "'",
|
|
"<": "<",
|
|
">": ">",
|
|
"&": "&",
|
|
"`": "`",
|
|
}),
|
|
(Ln = {
|
|
"<": "<",
|
|
">": ">",
|
|
"&": "&",
|
|
""": '"',
|
|
"'": "'",
|
|
});
|
|
function nr(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))),
|
|
Pn[r] || ((o = "&" + e[n + 1] + ";"), (i[r] = o), (i[o] = r));
|
|
return i;
|
|
}
|
|
}
|
|
Hn = nr(
|
|
"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,
|
|
);
|
|
function rr(e, t) {
|
|
return e.replace(t ? Jn : Qn, function (e) {
|
|
return Pn[e] || e;
|
|
});
|
|
}
|
|
function or(e, t) {
|
|
return e.replace(t ? Jn : Qn, function (e) {
|
|
return 1 < e.length
|
|
? "&#" +
|
|
(1024 * (e.charCodeAt(0) - 55296) +
|
|
(e.charCodeAt(1) - 56320) +
|
|
65536) +
|
|
";"
|
|
: Pn[e] || "&#" + e.charCodeAt(0) + ";";
|
|
});
|
|
}
|
|
function ir(e, t, n) {
|
|
return (
|
|
(n = n || Hn),
|
|
e.replace(t ? Jn : Qn, function (e) {
|
|
return Pn[e] || n[e] || e;
|
|
})
|
|
);
|
|
}
|
|
var ar = {
|
|
encodeRaw: rr,
|
|
encodeAllRaw: function (e) {
|
|
return ("" + e).replace(Zn, function (e) {
|
|
return Pn[e] || e;
|
|
});
|
|
},
|
|
encodeNumeric: or,
|
|
encodeNamed: ir,
|
|
getEncodeFunc: function (e, t) {
|
|
var n = nr(t) || Hn,
|
|
r = Gn(e.replace(/\+/g, ","));
|
|
return r.named && r.numeric
|
|
? function (e, t) {
|
|
return e.replace(t ? Jn : Qn, function (e) {
|
|
return Pn[e] !== undefined
|
|
? Pn[e]
|
|
: n[e] !== undefined
|
|
? 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 ir(e, t, n);
|
|
}
|
|
: ir
|
|
: r.numeric
|
|
? or
|
|
: rr;
|
|
},
|
|
decode: function (e) {
|
|
return e.replace(er, 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)))
|
|
: tr[t] || String.fromCharCode(t)
|
|
: Ln[e] ||
|
|
Hn[e] ||
|
|
(function (e) {
|
|
var t;
|
|
return (
|
|
((t = bt.fromTag("div").dom()).innerHTML = e),
|
|
t.textContent || t.innerText || e
|
|
);
|
|
})(e);
|
|
});
|
|
},
|
|
},
|
|
ur = {},
|
|
sr = {},
|
|
cr = Rn.makeMap,
|
|
lr = Rn.each,
|
|
fr = Rn.extend,
|
|
dr = Rn.explode,
|
|
hr = Rn.inArray,
|
|
mr = function (e, t) {
|
|
return (e = Rn.trim(e)) ? e.split(t || " ") : [];
|
|
},
|
|
gr = function (e) {
|
|
function t(e, t, n) {
|
|
function r(e, t) {
|
|
var n,
|
|
r,
|
|
o = {};
|
|
for (n = 0, r = e.length; n < r; n++) o[e[n]] = t || {};
|
|
return o;
|
|
}
|
|
var o, i, a;
|
|
for (
|
|
t = t || "",
|
|
"string" == typeof (n = n || []) && (n = mr(n)),
|
|
o = (e = mr(e)).length;
|
|
o--;
|
|
|
|
)
|
|
(a = {
|
|
attributes: r((i = mr([u, t].join(" ")))),
|
|
attributesOrder: i,
|
|
children: r(n, sr),
|
|
}),
|
|
(c[e[o]] = a);
|
|
}
|
|
function n(e, t) {
|
|
var n, r, o, i;
|
|
for (n = (e = mr(e)).length, t = mr(t); n--; )
|
|
for (r = c[e[n]], o = 0, i = t.length; o < i; o++)
|
|
(r.attributes[t[o]] = {}), r.attributesOrder.push(t[o]);
|
|
}
|
|
var u,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
s,
|
|
c = {};
|
|
return ur[e]
|
|
? ur[e]
|
|
: ((u = "id accesskey class dir lang style tabindex title role"),
|
|
(r =
|
|
"address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),
|
|
(o =
|
|
"a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),
|
|
"html4" !== e &&
|
|
((u +=
|
|
" contenteditable contextmenu draggable dropzone hidden spellcheck translate"),
|
|
(r +=
|
|
" article aside details dialog figure main header footer hgroup section nav"),
|
|
(o +=
|
|
" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen")),
|
|
"html5-strict" !== e &&
|
|
((u += " xml:lang"),
|
|
(o = [o, (s = "acronym applet basefont big font strike tt")].join(
|
|
" ",
|
|
)),
|
|
lr(mr(s), function (e) {
|
|
t(e, "", o);
|
|
}),
|
|
(r = [r, (a = "center dir isindex noframes")].join(" ")),
|
|
(i = [r, o].join(" ")),
|
|
lr(mr(a), function (e) {
|
|
t(e, "", i);
|
|
})),
|
|
(i = i || [r, o].join(" ")),
|
|
t("html", "manifest", "head body"),
|
|
t("head", "", "base command link meta noscript script style title"),
|
|
t("title hr noscript br"),
|
|
t("base", "href target"),
|
|
t("link", "href rel media hreflang type sizes hreflang"),
|
|
t("meta", "name http-equiv content charset"),
|
|
t("style", "media type scoped"),
|
|
t("script", "src async defer type charset"),
|
|
t(
|
|
"body",
|
|
"onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",
|
|
i,
|
|
),
|
|
t("address dt dd div caption", "", i),
|
|
t(
|
|
"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",
|
|
"",
|
|
o,
|
|
),
|
|
t("blockquote", "cite", i),
|
|
t("ol", "reversed start type", "li"),
|
|
t("ul", "", "li"),
|
|
t("li", "value", i),
|
|
t("dl", "", "dt dd"),
|
|
t("a", "href target rel media hreflang type", o),
|
|
t("q", "cite", o),
|
|
t("ins del", "cite datetime", i),
|
|
t("img", "src sizes srcset alt usemap ismap width height"),
|
|
t("iframe", "src name width height", i),
|
|
t("embed", "src type width height"),
|
|
t(
|
|
"object",
|
|
"data type typemustmatch name usemap form width height",
|
|
[i, "param"].join(" "),
|
|
),
|
|
t("param", "name value"),
|
|
t("map", "name", [i, "area"].join(" ")),
|
|
t("area", "alt coords shape href target rel media hreflang type"),
|
|
t(
|
|
"table",
|
|
"border",
|
|
"caption colgroup thead tfoot tbody tr" +
|
|
("html4" === e ? " col" : ""),
|
|
),
|
|
t("colgroup", "span", "col"),
|
|
t("col", "span"),
|
|
t("tbody thead tfoot", "", "tr"),
|
|
t("tr", "", "td th"),
|
|
t("td", "colspan rowspan headers", i),
|
|
t("th", "colspan rowspan headers scope abbr", i),
|
|
t(
|
|
"form",
|
|
"accept-charset action autocomplete enctype method name novalidate target",
|
|
i,
|
|
),
|
|
t("fieldset", "disabled form name", [i, "legend"].join(" ")),
|
|
t("label", "form for", o),
|
|
t(
|
|
"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",
|
|
),
|
|
t(
|
|
"button",
|
|
"disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
|
|
"html4" === e ? i : o,
|
|
),
|
|
t(
|
|
"select",
|
|
"disabled form multiple name required size",
|
|
"option optgroup",
|
|
),
|
|
t("optgroup", "disabled label", "option"),
|
|
t("option", "disabled label selected value"),
|
|
t(
|
|
"textarea",
|
|
"cols dirname disabled form maxlength name readonly required rows wrap",
|
|
),
|
|
t("menu", "type label", [i, "li"].join(" ")),
|
|
t("noscript", "", i),
|
|
"html4" !== e &&
|
|
(t("wbr"),
|
|
t("ruby", "", [o, "rt rp"].join(" ")),
|
|
t("figcaption", "", i),
|
|
t("mark rt rp summary bdi", "", o),
|
|
t("canvas", "width height", i),
|
|
t(
|
|
"video",
|
|
"src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",
|
|
[i, "track source"].join(" "),
|
|
),
|
|
t(
|
|
"audio",
|
|
"src crossorigin preload autoplay mediagroup loop muted controls buffered volume",
|
|
[i, "track source"].join(" "),
|
|
),
|
|
t("picture", "", "img source"),
|
|
t("source", "src srcset type media sizes"),
|
|
t("track", "kind src srclang label default"),
|
|
t("datalist", "", [o, "option"].join(" ")),
|
|
t("article section nav aside main header footer", "", i),
|
|
t("hgroup", "", "h1 h2 h3 h4 h5 h6"),
|
|
t("figure", "", [i, "figcaption"].join(" ")),
|
|
t("time", "datetime", o),
|
|
t("dialog", "open", i),
|
|
t("command", "type label icon disabled checked radiogroup command"),
|
|
t("output", "for form name", o),
|
|
t("progress", "value max", o),
|
|
t("meter", "value min max low high optimum", o),
|
|
t("details", "open", [i, "summary"].join(" ")),
|
|
t("keygen", "autofocus challenge disabled form keytype name")),
|
|
"html5-strict" !== e &&
|
|
(n("script", "language xml:space"),
|
|
n("style", "xml:space"),
|
|
n(
|
|
"object",
|
|
"declare classid code codebase codetype archive standby align border hspace vspace",
|
|
),
|
|
n("embed", "align name hspace vspace"),
|
|
n("param", "valuetype type"),
|
|
n("a", "charset name rev shape coords"),
|
|
n("br", "clear"),
|
|
n(
|
|
"applet",
|
|
"codebase archive code object alt name width height align hspace vspace",
|
|
),
|
|
n("img", "name longdesc align border hspace vspace"),
|
|
n(
|
|
"iframe",
|
|
"longdesc frameborder marginwidth marginheight scrolling align",
|
|
),
|
|
n("font basefont", "size color face"),
|
|
n("input", "usemap align"),
|
|
n("select", "onchange"),
|
|
n("textarea"),
|
|
n("h1 h2 h3 h4 h5 h6 div p legend caption", "align"),
|
|
n("ul", "type compact"),
|
|
n("li", "type"),
|
|
n("ol dl menu dir", "compact"),
|
|
n("pre", "width xml:space"),
|
|
n("hr", "align noshade size width"),
|
|
n("isindex", "prompt"),
|
|
n(
|
|
"table",
|
|
"summary width frame rules cellspacing cellpadding align bgcolor",
|
|
),
|
|
n("col", "width align char charoff valign"),
|
|
n("colgroup", "width align char charoff valign"),
|
|
n("thead", "align char charoff valign"),
|
|
n("tr", "align char charoff valign bgcolor"),
|
|
n(
|
|
"th",
|
|
"axis align char charoff valign nowrap bgcolor width height",
|
|
),
|
|
n("form", "accept"),
|
|
n(
|
|
"td",
|
|
"abbr axis scope align char charoff valign nowrap bgcolor width height",
|
|
),
|
|
n("tfoot", "align char charoff valign"),
|
|
n("tbody", "align char charoff valign"),
|
|
n("area", "nohref"),
|
|
n("body", "background bgcolor text link vlink alink")),
|
|
"html4" !== e &&
|
|
(n("input button select textarea", "autofocus"),
|
|
n("input textarea", "placeholder"),
|
|
n("a", "download"),
|
|
n("link script img", "crossorigin"),
|
|
n("iframe", "sandbox seamless allowfullscreen")),
|
|
lr(mr("a form meter progress dfn"), function (e) {
|
|
c[e] && delete c[e].children[e];
|
|
}),
|
|
delete c.caption.children.table,
|
|
delete c.script,
|
|
(ur[e] = c));
|
|
},
|
|
pr = function (e, n) {
|
|
var r;
|
|
return (
|
|
e &&
|
|
((r = {}),
|
|
"string" == typeof e && (e = { "*": e }),
|
|
lr(e, function (e, t) {
|
|
r[t] = r[t.toUpperCase()] =
|
|
"map" === n ? cr(e, /[, ]/) : dr(e, /[, ]/);
|
|
})),
|
|
r
|
|
);
|
|
};
|
|
function vr(i) {
|
|
function e(e, t, n) {
|
|
var r = i[e];
|
|
return (
|
|
r
|
|
? (r = cr(r, /[, ]/, cr(r.toUpperCase(), /[, ]/)))
|
|
: (r = ur[e]) ||
|
|
((r = cr(t, " ", cr(t.toUpperCase(), " "))),
|
|
(r = fr(r, n)),
|
|
(ur[e] = r)),
|
|
r
|
|
);
|
|
}
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
z = {},
|
|
g = {},
|
|
E = [],
|
|
p = {},
|
|
v = {};
|
|
(r = gr((i = i || {}).schema)),
|
|
!1 === i.verify_html && (i.valid_elements = "*[*]"),
|
|
(t = pr(i.valid_styles)),
|
|
(n = pr(i.invalid_styles, "map")),
|
|
(c = pr(i.valid_classes, "map")),
|
|
(o = e(
|
|
"whitespace_elements",
|
|
"pre script noscript style textarea video audio iframe object code",
|
|
)),
|
|
(a = e(
|
|
"self_closing_elements",
|
|
"colgroup dd dt li option p td tfoot th thead tr",
|
|
)),
|
|
(u = e(
|
|
"short_ended_elements",
|
|
"area base basefont br col frame hr img input isindex link meta param embed source wbr track",
|
|
)),
|
|
(s = e(
|
|
"boolean_attributes",
|
|
"checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls",
|
|
)),
|
|
(f = e(
|
|
"non_empty_elements",
|
|
"td th iframe video audio object script pre code",
|
|
u,
|
|
)),
|
|
(d = e("move_caret_before_on_enter_elements", "table", f)),
|
|
(h = 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",
|
|
)),
|
|
(l = 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",
|
|
h,
|
|
)),
|
|
(m = e(
|
|
"text_inline_elements",
|
|
"span strong b em i font strike u var cite dfn code mark q sup sub samp",
|
|
)),
|
|
lr(
|
|
(
|
|
i.special ||
|
|
"script noscript noframes noembed title style textarea xmp"
|
|
).split(" "),
|
|
function (e) {
|
|
v[e] = new RegExp("</" + e + "[^>]*>", "gi");
|
|
},
|
|
);
|
|
function N(e) {
|
|
return new RegExp("^" + e.replace(/([?+*])/g, ".$1") + "$");
|
|
}
|
|
function y(e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
g,
|
|
p,
|
|
v,
|
|
y,
|
|
b,
|
|
C = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
|
|
w = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
|
|
x = /[*?+]/;
|
|
if (e)
|
|
for (
|
|
e = mr(e, ","),
|
|
z["@"] && ((p = z["@"].attributes), (v = z["@"].attributesOrder)),
|
|
t = 0,
|
|
n = e.length;
|
|
t < n;
|
|
t++
|
|
)
|
|
if ((i = C.exec(e[t]))) {
|
|
if (
|
|
((m = i[1]),
|
|
(c = i[2]),
|
|
(g = i[3]),
|
|
(s = i[5]),
|
|
(a = { attributes: (d = {}), attributesOrder: (h = []) }),
|
|
"#" === m && (a.paddEmpty = !0),
|
|
"-" === m && (a.removeEmpty = !0),
|
|
"!" === i[4] && (a.removeEmptyAttrs = !0),
|
|
p)
|
|
) {
|
|
for (y in p) d[y] = p[y];
|
|
h.push.apply(h, v);
|
|
}
|
|
if (s)
|
|
for (r = 0, o = (s = mr(s, "|")).length; r < o; r++)
|
|
if ((i = w.exec(s[r]))) {
|
|
if (
|
|
((u = {}),
|
|
(f = i[1]),
|
|
(l = i[2].replace(/[\\:]:/g, ":")),
|
|
(m = i[3]),
|
|
(b = i[4]),
|
|
"!" === f &&
|
|
((a.attributesRequired = a.attributesRequired || []),
|
|
a.attributesRequired.push(l),
|
|
(u.required = !0)),
|
|
"-" === f)
|
|
) {
|
|
delete d[l], h.splice(hr(h, l), 1);
|
|
continue;
|
|
}
|
|
m &&
|
|
("=" === m &&
|
|
((a.attributesDefault = a.attributesDefault || []),
|
|
a.attributesDefault.push({ name: l, value: b }),
|
|
(u.defaultValue = b)),
|
|
":" === m &&
|
|
((a.attributesForced = a.attributesForced || []),
|
|
a.attributesForced.push({ name: l, value: b }),
|
|
(u.forcedValue = b)),
|
|
"<" === m && (u.validValues = cr(b, "?"))),
|
|
x.test(l)
|
|
? ((a.attributePatterns = a.attributePatterns || []),
|
|
(u.pattern = N(l)),
|
|
a.attributePatterns.push(u))
|
|
: (d[l] || h.push(l), (d[l] = u));
|
|
}
|
|
p || "@" !== c || ((p = d), (v = h)),
|
|
g && ((a.outputName = c), (z[g] = a)),
|
|
x.test(c) ? ((a.pattern = N(c)), E.push(a)) : (z[c] = a);
|
|
}
|
|
}
|
|
function b(e) {
|
|
(z = {}),
|
|
(E = []),
|
|
y(e),
|
|
lr(r, function (e, t) {
|
|
g[t] = e.children;
|
|
});
|
|
}
|
|
function C(e) {
|
|
var a = /^(~)?(.+)$/;
|
|
e &&
|
|
((ur.text_block_elements = ur.block_elements = null),
|
|
lr(mr(e, ","), function (e) {
|
|
var t = a.exec(e),
|
|
n = "~" === t[1],
|
|
r = n ? "span" : "div",
|
|
o = t[2];
|
|
if (
|
|
((g[o] = g[r]),
|
|
(p[o] = r),
|
|
n || ((l[o.toUpperCase()] = {}), (l[o] = {})),
|
|
!z[o])
|
|
) {
|
|
var i = z[r];
|
|
delete (i = fr({}, i)).removeEmptyAttrs,
|
|
delete i.removeEmpty,
|
|
(z[o] = i);
|
|
}
|
|
lr(g, function (e, t) {
|
|
e[r] && ((g[t] = e = fr({}, g[t])), (e[o] = e[r]));
|
|
});
|
|
}));
|
|
}
|
|
function w(e) {
|
|
var o = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
|
|
(ur[i.schema] = null),
|
|
e &&
|
|
lr(mr(e, ","), function (e) {
|
|
var t,
|
|
n,
|
|
r = o.exec(e);
|
|
r &&
|
|
((n = r[1]),
|
|
(t = n ? g[r[2]] : (g[r[2]] = { "#comment": {} })),
|
|
(t = g[r[2]]),
|
|
lr(mr(r[3], "|"), function (e) {
|
|
"-" === n ? delete t[e] : (t[e] = {});
|
|
}));
|
|
});
|
|
}
|
|
function x(e) {
|
|
var t,
|
|
n = z[e];
|
|
if (n) return n;
|
|
for (t = E.length; t--; ) if ((n = E[t]).pattern.test(e)) return n;
|
|
}
|
|
i.valid_elements
|
|
? b(i.valid_elements)
|
|
: (lr(r, function (e, t) {
|
|
(z[t] = {
|
|
attributes: e.attributes,
|
|
attributesOrder: e.attributesOrder,
|
|
}),
|
|
(g[t] = e.children);
|
|
}),
|
|
"html5" !== i.schema &&
|
|
lr(mr("strong/b em/i"), function (e) {
|
|
(e = mr(e, "/")), (z[e[1]].outputName = e[0]);
|
|
}),
|
|
lr(
|
|
mr(
|
|
"ol ul sub sup blockquote span font a table tbody tr strong em b i",
|
|
),
|
|
function (e) {
|
|
z[e] && (z[e].removeEmpty = !0);
|
|
},
|
|
),
|
|
lr(
|
|
mr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),
|
|
function (e) {
|
|
z[e].paddEmpty = !0;
|
|
},
|
|
),
|
|
lr(mr("span"), function (e) {
|
|
z[e].removeEmptyAttrs = !0;
|
|
})),
|
|
C(i.custom_elements),
|
|
w(i.valid_children),
|
|
y(i.extended_valid_elements),
|
|
w("+ol[ul|ol],+ul[ul|ol]"),
|
|
lr(
|
|
{
|
|
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) {
|
|
z[t] && (z[t].parentsRequired = mr(e));
|
|
},
|
|
),
|
|
i.invalid_elements &&
|
|
lr(dr(i.invalid_elements), function (e) {
|
|
z[e] && delete z[e];
|
|
}),
|
|
x("span") || y("span[!data-mce-type|*]");
|
|
return {
|
|
children: g,
|
|
elements: z,
|
|
getValidStyles: function () {
|
|
return t;
|
|
},
|
|
getValidClasses: function () {
|
|
return c;
|
|
},
|
|
getBlockElements: function () {
|
|
return l;
|
|
},
|
|
getInvalidStyles: function () {
|
|
return n;
|
|
},
|
|
getShortEndedElements: function () {
|
|
return u;
|
|
},
|
|
getTextBlockElements: function () {
|
|
return h;
|
|
},
|
|
getTextInlineElements: function () {
|
|
return m;
|
|
},
|
|
getBoolAttrs: function () {
|
|
return s;
|
|
},
|
|
getElementRule: x,
|
|
getSelfClosingElements: function () {
|
|
return a;
|
|
},
|
|
getNonEmptyElements: function () {
|
|
return f;
|
|
},
|
|
getMoveCaretBeforeOnEnterElements: function () {
|
|
return d;
|
|
},
|
|
getWhiteSpaceElements: function () {
|
|
return o;
|
|
},
|
|
getSpecialElements: function () {
|
|
return v;
|
|
},
|
|
isValidChild: function (e, t) {
|
|
var n = g[e.toLowerCase()];
|
|
return !(!n || !n[t.toLowerCase()]);
|
|
},
|
|
isValid: function (e, t) {
|
|
var n,
|
|
r,
|
|
o = x(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: function () {
|
|
return p;
|
|
},
|
|
addValidElements: y,
|
|
setValidElements: b,
|
|
addCustomElements: C,
|
|
addValidChildren: w,
|
|
};
|
|
}
|
|
function yr(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 br(e, t, n, r) {
|
|
e.addEventListener
|
|
? e.addEventListener(t, n, r || !1)
|
|
: e.attachEvent && e.attachEvent("on" + t, n);
|
|
}
|
|
function Cr(e, t, n, r) {
|
|
e.removeEventListener
|
|
? e.removeEventListener(t, n, r || !1)
|
|
: e.detachEvent && e.detachEvent("on" + t, n);
|
|
}
|
|
function wr(e, t) {
|
|
var n,
|
|
r = t || {};
|
|
for (n in e) Nr[n] || (r[n] = e[n]);
|
|
if (
|
|
(r.target || (r.target = r.srcElement || j.document),
|
|
Sn.experimentalShadowDom &&
|
|
(r.target = (function (e, t) {
|
|
if (e.composedPath) {
|
|
var n = e.composedPath();
|
|
if (n && 0 < n.length) return n[0];
|
|
}
|
|
return t;
|
|
})(e, r.target)),
|
|
e && Er.test(e.type) && e.pageX === undefined && e.clientX !== undefined)
|
|
) {
|
|
var o = r.target.ownerDocument || j.document,
|
|
i = o.documentElement,
|
|
a = o.body;
|
|
(r.pageX =
|
|
e.clientX +
|
|
((i && i.scrollLeft) || (a && a.scrollLeft) || 0) -
|
|
((i && i.clientLeft) || (a && a.clientLeft) || 0)),
|
|
(r.pageY =
|
|
e.clientY +
|
|
((i && i.scrollTop) || (a && a.scrollTop) || 0) -
|
|
((i && i.clientTop) || (a && a.clientTop) || 0));
|
|
}
|
|
return (
|
|
(r.preventDefault = function () {
|
|
(r.isDefaultPrevented = kr),
|
|
e && (e.preventDefault ? e.preventDefault() : (e.returnValue = !1));
|
|
}),
|
|
(r.stopPropagation = function () {
|
|
(r.isPropagationStopped = kr),
|
|
e &&
|
|
(e.stopPropagation ? e.stopPropagation() : (e.cancelBubble = !0));
|
|
}),
|
|
!(r.stopImmediatePropagation = function () {
|
|
(r.isImmediatePropagationStopped = kr), r.stopPropagation();
|
|
}) ===
|
|
(function (e) {
|
|
return e.isDefaultPrevented === kr || e.isDefaultPrevented === Sr;
|
|
})(r) &&
|
|
((r.isDefaultPrevented = Sr),
|
|
(r.isPropagationStopped = Sr),
|
|
(r.isImmediatePropagationStopped = Sr)),
|
|
"undefined" == typeof r.metaKey && (r.metaKey = !1),
|
|
r
|
|
);
|
|
}
|
|
function xr(e, t, n) {
|
|
var r = e.document,
|
|
o = { type: "ready" };
|
|
if (n.domLoaded) t(o);
|
|
else {
|
|
var i = function () {
|
|
Cr(e, "DOMContentLoaded", i),
|
|
Cr(e, "load", i),
|
|
n.domLoaded || ((n.domLoaded = !0), t(o));
|
|
};
|
|
"complete" === r.readyState || ("interactive" === r.readyState && r.body)
|
|
? i()
|
|
: br(e, "DOMContentLoaded", i),
|
|
br(e, "load", i);
|
|
}
|
|
}
|
|
var zr = function (b, e) {
|
|
var C,
|
|
t,
|
|
c,
|
|
l,
|
|
w = /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,
|
|
z = /\s*([^:]+):\s*([^;]+);?/g,
|
|
E = /\s+$/,
|
|
N = {},
|
|
S = "\ufeff";
|
|
for (
|
|
b = b || {},
|
|
e && ((c = e.getValidStyles()), (l = e.getInvalidStyles())),
|
|
t = ("\\\" \\' \\; \\: ; : " + S).split(" "),
|
|
C = 0;
|
|
C < t.length;
|
|
C++
|
|
)
|
|
(N[t[C]] = S + C), (N[S + C] = t[C]);
|
|
return {
|
|
toHex: function (e) {
|
|
return e.replace(w, yr);
|
|
},
|
|
parse: function (e) {
|
|
function t(e, t, n) {
|
|
var r, o, i, a;
|
|
if (
|
|
(r = p[e + "-top" + t]) &&
|
|
(o = p[e + "-right" + t]) &&
|
|
(i = p[e + "-bottom" + t]) &&
|
|
(a = p[e + "-left" + t])
|
|
) {
|
|
var u = [r, o, i, a];
|
|
for (C = u.length - 1; C-- && u[C] === u[C + 1]; );
|
|
(-1 < C && n) ||
|
|
((p[e + t] = -1 === C ? 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 !1;
|
|
return (p[e] = n[0]), !0;
|
|
}
|
|
}
|
|
function r(e) {
|
|
return (f = !0), N[e];
|
|
}
|
|
function u(e, t) {
|
|
return (
|
|
f &&
|
|
(e = e.replace(/\uFEFF[0-9]/g, function (e) {
|
|
return N[e];
|
|
})),
|
|
t || (e = e.replace(/\\([\'\";:])/g, "$1")),
|
|
e
|
|
);
|
|
}
|
|
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 (
|
|
v && (t = v.call(y, t, "style")),
|
|
"url('" + t.replace(/\'/g, "\\'") + "')"
|
|
);
|
|
}
|
|
var s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
g,
|
|
p = {},
|
|
v = b.url_converter,
|
|
y = b.url_converter_scope || this;
|
|
if (e) {
|
|
for (
|
|
e = (e = e.replace(/[\u0000-\u001F]/g, ""))
|
|
.replace(/\\[\"\';:\uFEFF]/g, r)
|
|
.replace(/\"[^\"]+\"|\'[^\']+\'/g, function (e) {
|
|
return e.replace(/[;:]/g, r);
|
|
});
|
|
(s = z.exec(e));
|
|
|
|
)
|
|
if (
|
|
((z.lastIndex = s.index + s[0].length),
|
|
(c = s[1].replace(E, "").toLowerCase()),
|
|
(l = s[2].replace(E, "")),
|
|
c && l)
|
|
) {
|
|
if (
|
|
((c = i(c)),
|
|
(l = i(l)),
|
|
-1 !== c.indexOf(S) || -1 !== c.indexOf('"'))
|
|
)
|
|
continue;
|
|
if (
|
|
!b.allow_script_urls &&
|
|
("behavior" === c || /expression\s*\(|\/\*|\*\//.test(l))
|
|
)
|
|
continue;
|
|
"font-weight" === c && "700" === l
|
|
? (l = "bold")
|
|
: ("color" !== c && "background-color" !== c) ||
|
|
(l = l.toLowerCase()),
|
|
(l = (l = l.replace(w, yr)).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", ""),
|
|
(d = "border"),
|
|
(m = "border-style"),
|
|
(g = "border-color"),
|
|
n((h = "border-width")) &&
|
|
n(m) &&
|
|
n(g) &&
|
|
((p[d] = p[h] + " " + p[m] + " " + p[g]),
|
|
delete p[h],
|
|
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, e) {
|
|
function t(e) {
|
|
var t, n, r, o;
|
|
if ((t = c[e]))
|
|
for (n = 0, r = t.length; n < r; n++)
|
|
(e = t[n]),
|
|
(o = i[e]) &&
|
|
(s += (0 < s.length ? " " : "") + e + ": " + o + ";");
|
|
}
|
|
var n,
|
|
r,
|
|
o,
|
|
a,
|
|
u,
|
|
s = "";
|
|
if (e && c) t("*"), t(e);
|
|
else
|
|
for (n in i)
|
|
!(r = i[n]) ||
|
|
(l &&
|
|
((o = n),
|
|
(a = e),
|
|
(u = void 0),
|
|
((u = l["*"]) && u[o]) || ((u = l[a]) && u[o]))) ||
|
|
(s += (0 < s.length ? " " : "") + n + ": " + r + ";");
|
|
return s;
|
|
},
|
|
};
|
|
},
|
|
Er = /^(?:mouse|contextmenu)|click/,
|
|
Nr = {
|
|
keyLocation: 1,
|
|
layerX: 1,
|
|
layerY: 1,
|
|
returnValue: 1,
|
|
webkitMovementX: 1,
|
|
webkitMovementY: 1,
|
|
keyIdentifier: 1,
|
|
mozPressure: 1,
|
|
},
|
|
Sr = function () {
|
|
return !1;
|
|
},
|
|
kr = function () {
|
|
return !0;
|
|
},
|
|
Tr =
|
|
((Ar.prototype.bind = function (e, t, n, r) {
|
|
function o(e) {
|
|
d.executeHandlers(wr(e || h.event), i);
|
|
}
|
|
var i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d = this,
|
|
h = j.window;
|
|
if (e && 3 !== e.nodeType && 8 !== e.nodeType) {
|
|
e[d.expando]
|
|
? (i = e[d.expando])
|
|
: ((i = d.count++), (e[d.expando] = i), (d.events[i] = {})),
|
|
(r = r || e);
|
|
var m = t.split(" ");
|
|
for (u = m.length; u--; )
|
|
(l = o),
|
|
(c = f = !1),
|
|
"DOMContentLoaded" === (s = m[u]) && (s = "ready"),
|
|
d.domLoaded && "ready" === s && "complete" === e.readyState
|
|
? n.call(r, wr({ type: s }))
|
|
: (d.hasMouseEnterLeave ||
|
|
((c = d.mouseEnterLeave[s]) &&
|
|
(l = function (e) {
|
|
var t, n;
|
|
if (
|
|
((t = e.currentTarget),
|
|
(n = e.relatedTarget) && t.contains)
|
|
)
|
|
n = t.contains(n);
|
|
else for (; n && n !== t; ) n = n.parentNode;
|
|
n ||
|
|
(((e = wr(e || h.event)).type =
|
|
"mouseout" === e.type
|
|
? "mouseleave"
|
|
: "mouseenter"),
|
|
(e.target = t),
|
|
d.executeHandlers(e, i));
|
|
})),
|
|
d.hasFocusIn ||
|
|
("focusin" !== s && "focusout" !== s) ||
|
|
((f = !0),
|
|
(c = "focusin" === s ? "focus" : "blur"),
|
|
(l = function (e) {
|
|
((e = wr(e || h.event)).type =
|
|
"focus" === e.type ? "focusin" : "focusout"),
|
|
d.executeHandlers(e, i);
|
|
})),
|
|
(a = d.events[i][s])
|
|
? "ready" === s && d.domLoaded
|
|
? n(wr({ type: s }))
|
|
: a.push({ func: n, scope: r })
|
|
: ((d.events[i][s] = a = [{ func: n, scope: r }]),
|
|
(a.fakeName = c),
|
|
(a.capture = f),
|
|
(a.nativeHandler = l),
|
|
"ready" === s ? xr(e, l, d) : br(e, c || s, l, f)));
|
|
return (e = a = 0), n;
|
|
}
|
|
}),
|
|
(Ar.prototype.unbind = function (e, t, n) {
|
|
var r, o, i, a, u, s;
|
|
if (!e || 3 === e.nodeType || 8 === e.nodeType) return this;
|
|
if ((r = e[this.expando])) {
|
|
if (((s = this.events[r]), t)) {
|
|
var c = t.split(" ");
|
|
for (i = c.length; i--; )
|
|
if ((o = s[(u = c[i])])) {
|
|
if (n)
|
|
for (a = o.length; a--; )
|
|
if (o[a].func === n) {
|
|
var l = o.nativeHandler,
|
|
f = o.fakeName,
|
|
d = o.capture;
|
|
((o = o
|
|
.slice(0, a)
|
|
.concat(o.slice(a + 1))).nativeHandler = l),
|
|
(o.fakeName = f),
|
|
(o.capture = d),
|
|
(s[u] = o);
|
|
}
|
|
(n && 0 !== o.length) ||
|
|
(delete s[u],
|
|
Cr(e, o.fakeName || u, o.nativeHandler, o.capture));
|
|
}
|
|
} else {
|
|
for (u in s)
|
|
(o = s[u]), Cr(e, o.fakeName || u, o.nativeHandler, o.capture);
|
|
s = {};
|
|
}
|
|
for (u in s) return this;
|
|
delete this.events[r];
|
|
try {
|
|
delete e[this.expando];
|
|
} catch (h) {
|
|
e[this.expando] = null;
|
|
}
|
|
}
|
|
return this;
|
|
}),
|
|
(Ar.prototype.fire = function (e, t, n) {
|
|
var r;
|
|
if (!e || 3 === e.nodeType || 8 === e.nodeType) return this;
|
|
var o = wr(null, n);
|
|
for (
|
|
o.type = t, o.target = e;
|
|
(r = e[this.expando]) && this.executeHandlers(o, r),
|
|
(e =
|
|
e.parentNode ||
|
|
e.ownerDocument ||
|
|
e.defaultView ||
|
|
e.parentWindow) && !o.isPropagationStopped();
|
|
|
|
);
|
|
return this;
|
|
}),
|
|
(Ar.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.getElementsByTagName || (e = e.document),
|
|
e && e.getElementsByTagName)
|
|
)
|
|
for (
|
|
this.unbind(e), t = (n = e.getElementsByTagName("*")).length;
|
|
t--;
|
|
|
|
)
|
|
(e = n[t])[this.expando] && this.unbind(e);
|
|
return this;
|
|
}),
|
|
(Ar.prototype.destroy = function () {
|
|
this.events = {};
|
|
}),
|
|
(Ar.prototype.cancel = function (e) {
|
|
return e && (e.preventDefault(), e.stopImmediatePropagation()), !1;
|
|
}),
|
|
(Ar.prototype.executeHandlers = function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a = this.events[t];
|
|
if ((n = a && a[e.type]))
|
|
for (r = 0, o = n.length; r < o; r++)
|
|
if (
|
|
((i = n[r]) &&
|
|
!1 === i.func.call(i.scope, e) &&
|
|
e.preventDefault(),
|
|
e.isImmediatePropagationStopped())
|
|
)
|
|
return;
|
|
}),
|
|
(Ar.Event = new Ar()),
|
|
Ar);
|
|
function Ar() {
|
|
(this.domLoaded = !1),
|
|
(this.events = {}),
|
|
(this.count = 1),
|
|
(this.expando = "mce-data-" + (+new Date()).toString(32)),
|
|
(this.hasMouseEnterLeave = "onmouseenter" in j.document.documentElement),
|
|
(this.hasFocusIn = "onfocusin" in j.document.documentElement),
|
|
(this.count = 1);
|
|
}
|
|
function Mr(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 Rr,
|
|
Dr,
|
|
_r,
|
|
Or,
|
|
Br,
|
|
Hr,
|
|
Pr,
|
|
Lr,
|
|
Vr,
|
|
Ir,
|
|
Fr,
|
|
Ur,
|
|
jr,
|
|
qr,
|
|
$r,
|
|
Wr,
|
|
Kr,
|
|
Xr,
|
|
Yr = "sizzle" + -new Date(),
|
|
Gr = j.window.document,
|
|
Jr = 0,
|
|
Qr = 0,
|
|
Zr = Ro(),
|
|
eo = Ro(),
|
|
to = Ro(),
|
|
no = function (e, t) {
|
|
return e === t && (Fr = !0), 0;
|
|
},
|
|
ro = typeof undefined,
|
|
oo = {}.hasOwnProperty,
|
|
io = [],
|
|
ao = io.pop,
|
|
uo = io.push,
|
|
so = io.push,
|
|
co = io.slice,
|
|
lo =
|
|
io.indexOf ||
|
|
function (e) {
|
|
for (var t = 0, n = this.length; t < n; t++)
|
|
if (this[t] === e) return t;
|
|
return -1;
|
|
},
|
|
fo = "[\\x20\\t\\r\\n\\f]",
|
|
ho = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
|
|
mo =
|
|
"\\[" +
|
|
fo +
|
|
"*(" +
|
|
ho +
|
|
")(?:" +
|
|
fo +
|
|
"*([*^$|!~]?=)" +
|
|
fo +
|
|
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" +
|
|
ho +
|
|
"))|)" +
|
|
fo +
|
|
"*\\]",
|
|
go =
|
|
":(" +
|
|
ho +
|
|
")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" +
|
|
mo +
|
|
")*)|.*)\\)|)",
|
|
po = new RegExp("^" + fo + "+|((?:^|[^\\\\])(?:\\\\.)*)" + fo + "+$", "g"),
|
|
vo = new RegExp("^" + fo + "*," + fo + "*"),
|
|
yo = new RegExp("^" + fo + "*([>+~]|" + fo + ")" + fo + "*"),
|
|
bo = new RegExp("=" + fo + "*([^\\]'\"]*?)" + fo + "*\\]", "g"),
|
|
Co = new RegExp(go),
|
|
wo = new RegExp("^" + ho + "$"),
|
|
xo = {
|
|
ID: new RegExp("^#(" + ho + ")"),
|
|
CLASS: new RegExp("^\\.(" + ho + ")"),
|
|
TAG: new RegExp("^(" + ho + "|[*])"),
|
|
ATTR: new RegExp("^" + mo),
|
|
PSEUDO: new RegExp("^" + go),
|
|
CHILD: new RegExp(
|
|
"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
|
|
fo +
|
|
"*(even|odd|(([+-]|)(\\d*)n|)" +
|
|
fo +
|
|
"*(?:([+-]|)" +
|
|
fo +
|
|
"*(\\d+)|))" +
|
|
fo +
|
|
"*\\)|)",
|
|
"i",
|
|
),
|
|
bool: new RegExp(
|
|
"^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$",
|
|
"i",
|
|
),
|
|
needsContext: new RegExp(
|
|
"^" +
|
|
fo +
|
|
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
|
|
fo +
|
|
"*((?:-\\d)?\\d*)" +
|
|
fo +
|
|
"*\\)|)(?=[^-]|$)",
|
|
"i",
|
|
),
|
|
},
|
|
zo = /^(?:input|select|textarea|button)$/i,
|
|
Eo = /^h\d$/i,
|
|
No = /^[^{]+\{\s*\[native \w/,
|
|
So = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
|
ko = /[+~]/,
|
|
To = /'|\\/g,
|
|
Ao = new RegExp("\\\\([\\da-f]{1,6}" + fo + "?|(" + fo + ")|.)", "ig");
|
|
try {
|
|
so.apply((io = co.call(Gr.childNodes)), Gr.childNodes),
|
|
io[Gr.childNodes.length].nodeType;
|
|
} catch (xN) {
|
|
so = {
|
|
apply: io.length
|
|
? function (e, t) {
|
|
uo.apply(e, co.call(t));
|
|
}
|
|
: function (e, t) {
|
|
for (var n = e.length, r = 0; (e[n++] = t[r++]); );
|
|
e.length = n - 1;
|
|
},
|
|
};
|
|
}
|
|
var Mo = function (e, t, n, r) {
|
|
var o, i, a, u, s, c, l, f, d, h;
|
|
if (
|
|
((t ? t.ownerDocument || t : Gr) !== jr && Ur(t),
|
|
(n = n || []),
|
|
!e || "string" != typeof e)
|
|
)
|
|
return n;
|
|
if (1 !== (u = (t = t || jr).nodeType) && 9 !== u) return [];
|
|
if ($r && !r) {
|
|
if ((o = So.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)) &&
|
|
Xr(t, i) &&
|
|
i.id === a
|
|
)
|
|
return n.push(i), n;
|
|
} else {
|
|
if (o[2]) return so.apply(n, t.getElementsByTagName(e)), n;
|
|
if ((a = o[3]) && Dr.getElementsByClassName)
|
|
return so.apply(n, t.getElementsByClassName(a)), n;
|
|
}
|
|
if (Dr.qsa && (!Wr || !Wr.test(e))) {
|
|
if (
|
|
((f = l = Yr),
|
|
(d = t),
|
|
(h = 9 === u && e),
|
|
1 === u && "object" !== t.nodeName.toLowerCase())
|
|
) {
|
|
for (
|
|
c = Hr(e),
|
|
(l = t.getAttribute("id"))
|
|
? (f = l.replace(To, "\\$&"))
|
|
: t.setAttribute("id", f),
|
|
f = "[id='" + f + "'] ",
|
|
s = c.length;
|
|
s--;
|
|
|
|
)
|
|
c[s] = f + Vo(c[s]);
|
|
(d = (ko.test(e) && Po(t.parentNode)) || t), (h = c.join(","));
|
|
}
|
|
if (h)
|
|
try {
|
|
return so.apply(n, d.querySelectorAll(h)), n;
|
|
} catch (m) {
|
|
} finally {
|
|
l || t.removeAttribute("id");
|
|
}
|
|
}
|
|
}
|
|
return Lr(e.replace(po, "$1"), t, n, r);
|
|
};
|
|
function Ro() {
|
|
var n = [];
|
|
return function r(e, t) {
|
|
return (
|
|
n.push(e + " ") > _r.cacheLength && delete r[n.shift()],
|
|
(r[e + " "] = t)
|
|
);
|
|
};
|
|
}
|
|
function Do(e) {
|
|
return (e[Yr] = !0), e;
|
|
}
|
|
function _o(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 Oo(t) {
|
|
return function (e) {
|
|
return "input" === e.nodeName.toLowerCase() && e.type === t;
|
|
};
|
|
}
|
|
function Bo(n) {
|
|
return function (e) {
|
|
var t = e.nodeName.toLowerCase();
|
|
return ("input" === t || "button" === t) && e.type === n;
|
|
};
|
|
}
|
|
function Ho(a) {
|
|
return Do(function (i) {
|
|
return (
|
|
(i = +i),
|
|
Do(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 Po(e) {
|
|
return e && typeof e.getElementsByTagName != ro && e;
|
|
}
|
|
for (Rr in ((Dr = Mo.support = {}),
|
|
(Br = Mo.isXML =
|
|
function (e) {
|
|
var t = e && (e.ownerDocument || e).documentElement;
|
|
return !!t && "HTML" !== t.nodeName;
|
|
}),
|
|
(Ur = Mo.setDocument =
|
|
function (e) {
|
|
var t,
|
|
s = e ? e.ownerDocument || e : Gr,
|
|
n = s.defaultView;
|
|
return s !== jr && 9 === s.nodeType && s.documentElement
|
|
? ((qr = (jr = s).documentElement),
|
|
($r = !Br(s)),
|
|
n &&
|
|
n !==
|
|
(function r(e) {
|
|
try {
|
|
return e.top;
|
|
} catch (t) {}
|
|
return null;
|
|
})(n) &&
|
|
(n.addEventListener
|
|
? n.addEventListener(
|
|
"unload",
|
|
function () {
|
|
Ur();
|
|
},
|
|
!1,
|
|
)
|
|
: n.attachEvent &&
|
|
n.attachEvent("onunload", function () {
|
|
Ur();
|
|
})),
|
|
(Dr.attributes = !0),
|
|
(Dr.getElementsByTagName = !0),
|
|
(Dr.getElementsByClassName = No.test(s.getElementsByClassName)),
|
|
(Dr.getById = !0),
|
|
(_r.find.ID = function (e, t) {
|
|
if (typeof t.getElementById != ro && $r) {
|
|
var n = t.getElementById(e);
|
|
return n && n.parentNode ? [n] : [];
|
|
}
|
|
}),
|
|
(_r.filter.ID = function (e) {
|
|
var t = e.replace(Ao, Mr);
|
|
return function (e) {
|
|
return e.getAttribute("id") === t;
|
|
};
|
|
}),
|
|
(_r.find.TAG = Dr.getElementsByTagName
|
|
? function (e, t) {
|
|
if (typeof t.getElementsByTagName != ro)
|
|
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;
|
|
}),
|
|
(_r.find.CLASS =
|
|
Dr.getElementsByClassName &&
|
|
function (e, t) {
|
|
if ($r) return t.getElementsByClassName(e);
|
|
}),
|
|
(Kr = []),
|
|
(Wr = []),
|
|
(Dr.disconnectedMatch = !0),
|
|
(Wr = Wr.length && new RegExp(Wr.join("|"))),
|
|
(Kr = Kr.length && new RegExp(Kr.join("|"))),
|
|
(t = No.test(qr.compareDocumentPosition)),
|
|
(Xr =
|
|
t || No.test(qr.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;
|
|
}),
|
|
(no = t
|
|
? function (e, t) {
|
|
if (e === t) return (Fr = !0), 0;
|
|
var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
|
|
return (
|
|
n ||
|
|
(1 &
|
|
(n =
|
|
(e.ownerDocument || e) === (t.ownerDocument || t)
|
|
? e.compareDocumentPosition(t)
|
|
: 1) ||
|
|
(!Dr.sortDetached && t.compareDocumentPosition(e) === n)
|
|
? e === s || (e.ownerDocument === Gr && Xr(Gr, e))
|
|
? -1
|
|
: t === s || (t.ownerDocument === Gr && Xr(Gr, t))
|
|
? 1
|
|
: Ir
|
|
? lo.call(Ir, e) - lo.call(Ir, t)
|
|
: 0
|
|
: 4 & n
|
|
? -1
|
|
: 1)
|
|
);
|
|
}
|
|
: function (e, t) {
|
|
if (e === t) return (Fr = !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
|
|
: Ir
|
|
? lo.call(Ir, e) - lo.call(Ir, t)
|
|
: 0;
|
|
if (o === i) return _o(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
|
|
? _o(a[r], u[r])
|
|
: a[r] === Gr
|
|
? -1
|
|
: u[r] === Gr
|
|
? 1
|
|
: 0;
|
|
}),
|
|
s)
|
|
: jr;
|
|
}),
|
|
(Mo.matches = function (e, t) {
|
|
return Mo(e, null, null, t);
|
|
}),
|
|
(Mo.matchesSelector = function (e, t) {
|
|
if (
|
|
((e.ownerDocument || e) !== jr && Ur(e),
|
|
(t = t.replace(bo, "='$1']")),
|
|
Dr.matchesSelector && $r && (!Kr || !Kr.test(t)) && (!Wr || !Wr.test(t)))
|
|
)
|
|
try {
|
|
var n = (void 0).call(e, t);
|
|
if (
|
|
n ||
|
|
Dr.disconnectedMatch ||
|
|
(e.document && 11 !== e.document.nodeType)
|
|
)
|
|
return n;
|
|
} catch (xN) {}
|
|
return 0 < Mo(t, jr, null, [e]).length;
|
|
}),
|
|
(Mo.contains = function (e, t) {
|
|
return (e.ownerDocument || e) !== jr && Ur(e), Xr(e, t);
|
|
}),
|
|
(Mo.attr = function (e, t) {
|
|
(e.ownerDocument || e) !== jr && Ur(e);
|
|
var n = _r.attrHandle[t.toLowerCase()],
|
|
r =
|
|
n && oo.call(_r.attrHandle, t.toLowerCase()) ? n(e, t, !$r) : undefined;
|
|
return r !== undefined
|
|
? r
|
|
: Dr.attributes || !$r
|
|
? e.getAttribute(t)
|
|
: (r = e.getAttributeNode(t)) && r.specified
|
|
? r.value
|
|
: null;
|
|
}),
|
|
(Mo.error = function (e) {
|
|
throw new Error("Syntax error, unrecognized expression: " + e);
|
|
}),
|
|
(Mo.uniqueSort = function (e) {
|
|
var t,
|
|
n = [],
|
|
r = 0,
|
|
o = 0;
|
|
if (
|
|
((Fr = !Dr.detectDuplicates),
|
|
(Ir = !Dr.sortStable && e.slice(0)),
|
|
e.sort(no),
|
|
Fr)
|
|
) {
|
|
for (; (t = e[o++]); ) t === e[o] && (r = n.push(o));
|
|
for (; r--; ) e.splice(n[r], 1);
|
|
}
|
|
return (Ir = null), e;
|
|
}),
|
|
(Or = Mo.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 += Or(e);
|
|
} else if (3 === o || 4 === o) return e.nodeValue;
|
|
} else for (; (t = e[r++]); ) n += Or(t);
|
|
return n;
|
|
}),
|
|
((_r = Mo.selectors =
|
|
{
|
|
cacheLength: 50,
|
|
createPseudo: Do,
|
|
match: xo,
|
|
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(Ao, Mr)),
|
|
(e[3] = (e[3] || e[4] || e[5] || "").replace(Ao, Mr)),
|
|
"~=" === 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] || Mo.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] && Mo.error(e[0]),
|
|
e
|
|
);
|
|
},
|
|
PSEUDO: function (e) {
|
|
var t,
|
|
n = !e[6] && e[2];
|
|
return xo.CHILD.test(e[0])
|
|
? null
|
|
: (e[3]
|
|
? (e[2] = e[4] || e[5] || "")
|
|
: n &&
|
|
Co.test(n) &&
|
|
(t = Hr(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(Ao, Mr).toLowerCase();
|
|
return "*" === e
|
|
? function () {
|
|
return !0;
|
|
}
|
|
: function (e) {
|
|
return e.nodeName && e.nodeName.toLowerCase() === t;
|
|
};
|
|
},
|
|
CLASS: function (e) {
|
|
var t = Zr[e + " "];
|
|
return (
|
|
t ||
|
|
((t = new RegExp("(^|" + fo + ")" + e + "(" + fo + "|$)")) &&
|
|
Zr(e, function (e) {
|
|
return t.test(
|
|
("string" == typeof e.className && e.className) ||
|
|
(typeof e.getAttribute != ro && e.getAttribute("class")) ||
|
|
"",
|
|
);
|
|
}))
|
|
);
|
|
},
|
|
ATTR: function (n, r, o) {
|
|
return function (e) {
|
|
var t = Mo.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 (h, e, t, m, g) {
|
|
var p = "nth" !== h.slice(0, 3),
|
|
v = "last" !== h.slice(-4),
|
|
y = "of-type" === e;
|
|
return 1 === m && 0 === g
|
|
? function (e) {
|
|
return !!e.parentNode;
|
|
}
|
|
: function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c = p != v ? "nextSibling" : "previousSibling",
|
|
l = e.parentNode,
|
|
f = y && e.nodeName.toLowerCase(),
|
|
d = !n && !y;
|
|
if (l) {
|
|
if (p) {
|
|
for (; c; ) {
|
|
for (i = e; (i = i[c]); )
|
|
if (
|
|
y ? i.nodeName.toLowerCase() === f : 1 === i.nodeType
|
|
)
|
|
return !1;
|
|
s = c = "only" === h && !s && "nextSibling";
|
|
}
|
|
return !0;
|
|
}
|
|
if (((s = [v ? l.firstChild : l.lastChild]), v && d)) {
|
|
for (
|
|
u =
|
|
(r = (o = l[Yr] || (l[Yr] = {}))[h] || [])[0] === Jr &&
|
|
r[1],
|
|
a = r[0] === Jr && 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[h] = [Jr, u, a];
|
|
break;
|
|
}
|
|
} else if (
|
|
d &&
|
|
(r = (e[Yr] || (e[Yr] = {}))[h]) &&
|
|
r[0] === Jr
|
|
)
|
|
a = r[1];
|
|
else
|
|
for (
|
|
;
|
|
(i = (++u && i && i[c]) || (a = u = 0) || s.pop()) &&
|
|
((y
|
|
? i.nodeName.toLowerCase() !== f
|
|
: 1 !== i.nodeType) ||
|
|
!++a ||
|
|
(d && ((i[Yr] || (i[Yr] = {}))[h] = [Jr, a]), i !== e));
|
|
|
|
);
|
|
return (a -= g) === m || (a % m == 0 && 0 <= a / m);
|
|
}
|
|
};
|
|
},
|
|
PSEUDO: function (e, i) {
|
|
var t,
|
|
a =
|
|
_r.pseudos[e] ||
|
|
_r.setFilters[e.toLowerCase()] ||
|
|
Mo.error("unsupported pseudo: " + e);
|
|
return a[Yr]
|
|
? a(i)
|
|
: 1 < a.length
|
|
? ((t = [e, e, "", i]),
|
|
_r.setFilters.hasOwnProperty(e.toLowerCase())
|
|
? Do(function (e, t) {
|
|
for (var n, r = a(e, i), o = r.length; o--; )
|
|
e[(n = lo.call(e, r[o]))] = !(t[n] = r[o]);
|
|
})
|
|
: function (e) {
|
|
return a(e, 0, t);
|
|
})
|
|
: a;
|
|
},
|
|
},
|
|
pseudos: {
|
|
not: Do(function (e) {
|
|
var r = [],
|
|
o = [],
|
|
u = Pr(e.replace(po, "$1"));
|
|
return u[Yr]
|
|
? Do(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), !o.pop();
|
|
};
|
|
}),
|
|
has: Do(function (t) {
|
|
return function (e) {
|
|
return 0 < Mo(t, e).length;
|
|
};
|
|
}),
|
|
contains: Do(function (t) {
|
|
return (
|
|
(t = t.replace(Ao, Mr)),
|
|
function (e) {
|
|
return -1 < (e.textContent || e.innerText || Or(e)).indexOf(t);
|
|
}
|
|
);
|
|
}),
|
|
lang: Do(function (n) {
|
|
return (
|
|
wo.test(n || "") || Mo.error("unsupported lang: " + n),
|
|
(n = n.replace(Ao, Mr).toLowerCase()),
|
|
function (e) {
|
|
var t;
|
|
do {
|
|
if (
|
|
(t = $r
|
|
? 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 = j.window.location && j.window.location.hash;
|
|
return t && t.slice(1) === e.id;
|
|
},
|
|
root: function (e) {
|
|
return e === qr;
|
|
},
|
|
focus: function (e) {
|
|
return (
|
|
e === jr.activeElement &&
|
|
(!jr.hasFocus || jr.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 !_r.pseudos.empty(e);
|
|
},
|
|
header: function (e) {
|
|
return Eo.test(e.nodeName);
|
|
},
|
|
input: function (e) {
|
|
return zo.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: Ho(function () {
|
|
return [0];
|
|
}),
|
|
last: Ho(function (e, t) {
|
|
return [t - 1];
|
|
}),
|
|
eq: Ho(function (e, t, n) {
|
|
return [n < 0 ? n + t : n];
|
|
}),
|
|
even: Ho(function (e, t) {
|
|
for (var n = 0; n < t; n += 2) e.push(n);
|
|
return e;
|
|
}),
|
|
odd: Ho(function (e, t) {
|
|
for (var n = 1; n < t; n += 2) e.push(n);
|
|
return e;
|
|
}),
|
|
lt: Ho(function (e, t, n) {
|
|
for (var r = n < 0 ? n + t : n; 0 <= --r; ) e.push(r);
|
|
return e;
|
|
}),
|
|
gt: Ho(function (e, t, n) {
|
|
for (var r = n < 0 ? n + t : n; ++r < t; ) e.push(r);
|
|
return e;
|
|
}),
|
|
},
|
|
}).pseudos.nth = _r.pseudos.eq),
|
|
{ radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }))
|
|
_r.pseudos[Rr] = Oo(Rr);
|
|
for (Rr in { submit: !0, reset: !0 }) _r.pseudos[Rr] = Bo(Rr);
|
|
function Lo() {}
|
|
function Vo(e) {
|
|
for (var t = 0, n = e.length, r = ""; t < n; t++) r += e[t].value;
|
|
return r;
|
|
}
|
|
function Io(a, e, t) {
|
|
var u = e.dir,
|
|
s = t && "parentNode" === u,
|
|
c = Qr++;
|
|
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 = [Jr, 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[Yr] || (e[Yr] = {}))[u]) &&
|
|
r[0] === Jr &&
|
|
r[1] === c
|
|
)
|
|
return (i[2] = r[2]);
|
|
if (((o[u] = i)[2] = a(e, t, n))) return !0;
|
|
}
|
|
};
|
|
}
|
|
function Fo(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 Uo(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 jo(m, g, p, v, y, e) {
|
|
return (
|
|
v && !v[Yr] && (v = jo(v)),
|
|
y && !y[Yr] && (y = jo(y, e)),
|
|
Do(function (e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a,
|
|
u = [],
|
|
s = [],
|
|
c = t.length,
|
|
l =
|
|
e ||
|
|
(function h(e, t, n) {
|
|
for (var r = 0, o = t.length; r < o; r++) Mo(e, t[r], n);
|
|
return n;
|
|
})(g || "*", n.nodeType ? [n] : n, []),
|
|
f = !m || (!e && g) ? l : Uo(l, u, m, n, r),
|
|
d = p ? (y || (e ? m : c || v) ? [] : t) : f;
|
|
if ((p && p(f, d, n, r), v))
|
|
for (o = Uo(d, s), v(o, [], n, r), i = o.length; i--; )
|
|
(a = o[i]) && (d[s[i]] = !(f[s[i]] = a));
|
|
if (e) {
|
|
if (y || m) {
|
|
if (y) {
|
|
for (o = [], i = d.length; i--; )
|
|
(a = d[i]) && o.push((f[i] = a));
|
|
y(null, (d = []), o, r);
|
|
}
|
|
for (i = d.length; i--; )
|
|
(a = d[i]) &&
|
|
-1 < (o = y ? lo.call(e, a) : u[i]) &&
|
|
(e[o] = !(t[o] = a));
|
|
}
|
|
} else (d = Uo(d === t ? d.splice(c, d.length) : d)), y ? y(null, t, d, r) : so.apply(t, d);
|
|
})
|
|
);
|
|
}
|
|
function qo(e) {
|
|
for (
|
|
var r,
|
|
t,
|
|
n,
|
|
o = e.length,
|
|
i = _r.relative[e[0].type],
|
|
a = i || _r.relative[" "],
|
|
u = i ? 1 : 0,
|
|
s = Io(
|
|
function (e) {
|
|
return e === r;
|
|
},
|
|
a,
|
|
!0,
|
|
),
|
|
c = Io(
|
|
function (e) {
|
|
return -1 < lo.call(r, e);
|
|
},
|
|
a,
|
|
!0,
|
|
),
|
|
l = [
|
|
function (e, t, n) {
|
|
return (
|
|
(!i && (n || t !== Vr)) ||
|
|
((r = t).nodeType ? s(e, t, n) : c(e, t, n))
|
|
);
|
|
},
|
|
];
|
|
u < o;
|
|
u++
|
|
)
|
|
if ((t = _r.relative[e[u].type])) l = [Io(Fo(l), t)];
|
|
else {
|
|
if ((t = _r.filter[e[u].type].apply(null, e[u].matches))[Yr]) {
|
|
for (n = ++u; n < o && !_r.relative[e[n].type]; n++);
|
|
return jo(
|
|
1 < u && Fo(l),
|
|
1 < u &&
|
|
Vo(
|
|
e
|
|
.slice(0, u - 1)
|
|
.concat({ value: " " === e[u - 2].type ? "*" : "" }),
|
|
).replace(po, "$1"),
|
|
t,
|
|
u < n && qo(e.slice(u, n)),
|
|
n < o && qo((e = e.slice(n))),
|
|
n < o && Vo(e),
|
|
);
|
|
}
|
|
l.push(t);
|
|
}
|
|
return Fo(l);
|
|
}
|
|
(Lo.prototype = _r.filters = _r.pseudos),
|
|
(_r.setFilters = new Lo()),
|
|
(Hr = Mo.tokenize =
|
|
function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c = eo[e + " "];
|
|
if (c) return t ? 0 : c.slice(0);
|
|
for (a = e, u = [], s = _r.preFilter; a; ) {
|
|
for (i in ((n && !(r = vo.exec(a))) ||
|
|
(r && (a = a.slice(r[0].length) || a), u.push((o = []))),
|
|
(n = !1),
|
|
(r = yo.exec(a)) &&
|
|
((n = r.shift()),
|
|
o.push({ value: n, type: r[0].replace(po, " ") }),
|
|
(a = a.slice(n.length))),
|
|
_r.filter))
|
|
_r.filter.hasOwnProperty(i) &&
|
|
(!(r = xo[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 ? Mo.error(e) : eo(e, u).slice(0);
|
|
}),
|
|
(Pr = Mo.compile =
|
|
function (e, t) {
|
|
var n,
|
|
r = [],
|
|
o = [],
|
|
i = to[e + " "];
|
|
if (!i) {
|
|
for (n = (t = t || Hr(e)).length; n--; )
|
|
(i = qo(t[n]))[Yr] ? r.push(i) : o.push(i);
|
|
(i = to(
|
|
e,
|
|
(function a(p, v) {
|
|
function e(e, t, n, r, o) {
|
|
var i,
|
|
a,
|
|
u,
|
|
s = 0,
|
|
c = "0",
|
|
l = e && [],
|
|
f = [],
|
|
d = Vr,
|
|
h = e || (b && _r.find.TAG("*", o)),
|
|
m = (Jr += null == d ? 1 : Math.random() || 0.1),
|
|
g = h.length;
|
|
for (
|
|
o && (Vr = t !== jr && t);
|
|
c !== g && null != (i = h[c]);
|
|
c++
|
|
) {
|
|
if (b && i) {
|
|
for (a = 0; (u = p[a++]); )
|
|
if (u(i, t, n)) {
|
|
r.push(i);
|
|
break;
|
|
}
|
|
o && (Jr = m);
|
|
}
|
|
y && ((i = !u && i) && s--, e && l.push(i));
|
|
}
|
|
if (((s += c), y && 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] = ao.call(r));
|
|
f = Uo(f);
|
|
}
|
|
so.apply(r, f),
|
|
o &&
|
|
!e &&
|
|
0 < f.length &&
|
|
1 < s + v.length &&
|
|
Mo.uniqueSort(r);
|
|
}
|
|
return o && ((Jr = m), (Vr = d)), l;
|
|
}
|
|
var y = 0 < v.length,
|
|
b = 0 < p.length;
|
|
return y ? Do(e) : e;
|
|
})(o, r),
|
|
)).selector = e;
|
|
}
|
|
return i;
|
|
}),
|
|
(Lr = Mo.select =
|
|
function (e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c = "function" == typeof e && e,
|
|
l = !r && Hr((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 &&
|
|
Dr.getById &&
|
|
9 === t.nodeType &&
|
|
$r &&
|
|
_r.relative[i[1].type]
|
|
) {
|
|
if (!(t = (_r.find.ID(a.matches[0].replace(Ao, Mr), t) || [])[0]))
|
|
return n;
|
|
c && (t = t.parentNode), (e = e.slice(i.shift().value.length));
|
|
}
|
|
for (
|
|
o = xo.needsContext.test(e) ? 0 : i.length;
|
|
o-- && ((a = i[o]), !_r.relative[(u = a.type)]);
|
|
|
|
)
|
|
if (
|
|
(s = _r.find[u]) &&
|
|
(r = s(
|
|
a.matches[0].replace(Ao, Mr),
|
|
(ko.test(i[0].type) && Po(t.parentNode)) || t,
|
|
))
|
|
) {
|
|
if ((i.splice(o, 1), !(e = r.length && Vo(i))))
|
|
return so.apply(n, r), n;
|
|
break;
|
|
}
|
|
}
|
|
return (
|
|
(c || Pr(e, l))(r, t, !$r, n, (ko.test(e) && Po(t.parentNode)) || t),
|
|
n
|
|
);
|
|
}),
|
|
(Dr.sortStable = Yr.split("").sort(no).join("") === Yr),
|
|
(Dr.detectDuplicates = !!Fr),
|
|
Ur(),
|
|
(Dr.sortDetached = !0);
|
|
function $o(e) {
|
|
return void 0 !== e;
|
|
}
|
|
function Wo(e) {
|
|
return "string" == typeof e;
|
|
}
|
|
function Ko(e, t) {
|
|
var n, r, o;
|
|
for (
|
|
o = (t = t || ei).createElement("div"),
|
|
n = t.createDocumentFragment(),
|
|
o.innerHTML = e;
|
|
(r = o.firstChild);
|
|
|
|
)
|
|
n.appendChild(r);
|
|
return n;
|
|
}
|
|
function Xo(e, t) {
|
|
return e && t && -1 !== (" " + e.className + " ").indexOf(" " + t + " ");
|
|
}
|
|
function Yo(e, t, n) {
|
|
var r, o;
|
|
return (
|
|
(t = yi(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 Go(e, t) {
|
|
return new yi.fn.init(e, t);
|
|
}
|
|
function Jo(e) {
|
|
return null === e || e === undefined ? "" : ("" + e).replace(hi, "");
|
|
}
|
|
function Qo(e, t) {
|
|
var n, r, o, i;
|
|
if (e)
|
|
if ((n = e.length) === undefined) {
|
|
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 Zo(e, n) {
|
|
var r = [];
|
|
return (
|
|
Qo(e, function (e, t) {
|
|
n(t, e) && r.push(t);
|
|
}),
|
|
r
|
|
);
|
|
}
|
|
var ei = j.document,
|
|
ti = Array.prototype.push,
|
|
ni = Array.prototype.slice,
|
|
ri = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
|
oi = Tr.Event,
|
|
ii = Rn.makeMap("children,contents,next,prev"),
|
|
ai = function (e, t, n, r) {
|
|
var o;
|
|
if (Wo(t)) t = Ko(t, mi(e[0]));
|
|
else if (t.length && !t.nodeType) {
|
|
if (((t = yi.makeArray(t)), r))
|
|
for (o = t.length - 1; 0 <= o; o--) ai(e, t[o], n, r);
|
|
else for (o = 0; o < t.length; o++) ai(e, t[o], n, r);
|
|
return e;
|
|
}
|
|
if (t.nodeType) for (o = e.length; o--; ) n.call(e[o], t);
|
|
return e;
|
|
},
|
|
ui = Rn.makeMap(
|
|
"fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom",
|
|
" ",
|
|
),
|
|
si = Rn.makeMap(
|
|
"checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected",
|
|
" ",
|
|
),
|
|
ci = { for: "htmlFor", class: "className", readonly: "readOnly" },
|
|
li = { float: "cssFloat" },
|
|
fi = {},
|
|
di = {},
|
|
hi = /^\s*|\s*$/g,
|
|
mi = function (e) {
|
|
return e ? (9 === e.nodeType ? e : e.ownerDocument) : ei;
|
|
};
|
|
(Go.fn = Go.prototype =
|
|
{
|
|
constructor: Go,
|
|
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 yi(e).attr(t);
|
|
o.context = t = j.document;
|
|
}
|
|
if (Wo(e)) {
|
|
if (
|
|
!(n =
|
|
"<" === (o.selector = e).charAt(0) &&
|
|
">" === e.charAt(e.length - 1) &&
|
|
3 <= e.length
|
|
? [null, e, null]
|
|
: ri.exec(e))
|
|
)
|
|
return yi(t).find(e);
|
|
if (n[1])
|
|
for (r = Ko(e, mi(t)).firstChild; r; )
|
|
ti.call(o, r), (r = r.nextSibling);
|
|
else {
|
|
if (!(r = mi(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 Rn.toArray(this);
|
|
},
|
|
add: function (e, t) {
|
|
var n, r;
|
|
if (Wo(e)) return this.add(yi(e));
|
|
if (!1 !== t)
|
|
for (
|
|
n = yi.unique(this.toArray().concat(yi.makeArray(e))),
|
|
this.length = n.length,
|
|
r = 0;
|
|
r < n.length;
|
|
r++
|
|
)
|
|
this[r] = n[r];
|
|
else ti.apply(this, yi.makeArray(e));
|
|
return this;
|
|
},
|
|
attr: function (t, n) {
|
|
var e,
|
|
r = this;
|
|
if ("object" == typeof t)
|
|
Qo(t, function (e, t) {
|
|
r.attr(e, t);
|
|
});
|
|
else {
|
|
if (!$o(n)) {
|
|
if (r[0] && 1 === r[0].nodeType) {
|
|
if ((e = fi[t]) && e.get) return e.get(r[0], t);
|
|
if (si[t]) return r.prop(t) ? t : undefined;
|
|
null === (n = r[0].getAttribute(t, 2)) && (n = undefined);
|
|
}
|
|
return n;
|
|
}
|
|
this.each(function () {
|
|
var e;
|
|
if (1 === this.nodeType) {
|
|
if ((e = fi[t]) && e.set) return void 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 = ci[e] || e))
|
|
Qo(e, function (e, t) {
|
|
n.prop(e, t);
|
|
});
|
|
else {
|
|
if (!$o(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 (n, r) {
|
|
function e(e) {
|
|
return e.replace(/-(\D)/g, function (e, t) {
|
|
return t.toUpperCase();
|
|
});
|
|
}
|
|
function o(e) {
|
|
return e.replace(/[A-Z]/g, function (e) {
|
|
return "-" + e;
|
|
});
|
|
}
|
|
var t,
|
|
i,
|
|
a = this;
|
|
if ("object" == typeof n)
|
|
Qo(n, function (e, t) {
|
|
a.css(e, t);
|
|
});
|
|
else if ($o(r))
|
|
(n = e(n)),
|
|
"number" != typeof r || ui[n] || (r = r.toString() + "px"),
|
|
a.each(function () {
|
|
var e = this.style;
|
|
if ((i = di[n]) && i.set) i.set(this, r);
|
|
else {
|
|
try {
|
|
this.style[li[n] || n] = r;
|
|
} catch (t) {}
|
|
(null !== r && "" !== r) ||
|
|
(e.removeProperty
|
|
? e.removeProperty(o(n))
|
|
: e.removeAttribute(n));
|
|
}
|
|
});
|
|
else {
|
|
if (((t = a[0]), (i = di[n]) && i.get)) return i.get(t);
|
|
if (!t.ownerDocument.defaultView)
|
|
return t.currentStyle ? t.currentStyle[e(n)] : "";
|
|
try {
|
|
return t.ownerDocument.defaultView
|
|
.getComputedStyle(t, null)
|
|
.getPropertyValue(o(n));
|
|
} catch (u) {
|
|
return undefined;
|
|
}
|
|
}
|
|
return a;
|
|
},
|
|
remove: function () {
|
|
for (var e, t = this.length; t--; )
|
|
(e = this[t]),
|
|
oi.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 (e) {
|
|
var t,
|
|
n = this;
|
|
if ($o(e)) {
|
|
t = n.length;
|
|
try {
|
|
for (; t--; ) n[t].innerHTML = e;
|
|
} catch (r) {
|
|
yi(n[t]).empty().append(e);
|
|
}
|
|
return n;
|
|
}
|
|
return n[0] ? n[0].innerHTML : "";
|
|
},
|
|
text: function (e) {
|
|
var t;
|
|
if ($o(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 ai(this, arguments, function (e) {
|
|
(1 === this.nodeType || (this.host && 1 === this.host.nodeType)) &&
|
|
this.appendChild(e);
|
|
});
|
|
},
|
|
prepend: function () {
|
|
return ai(
|
|
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
|
|
? ai(this, arguments, function (e) {
|
|
this.parentNode.insertBefore(e, this);
|
|
})
|
|
: this;
|
|
},
|
|
after: function () {
|
|
return this[0] && this[0].parentNode
|
|
? ai(
|
|
this,
|
|
arguments,
|
|
function (e) {
|
|
this.parentNode.insertBefore(e, this.nextSibling);
|
|
},
|
|
!0,
|
|
)
|
|
: this;
|
|
},
|
|
appendTo: function (e) {
|
|
return yi(e).append(this), this;
|
|
},
|
|
prependTo: function (e) {
|
|
return yi(e).prepend(this), this;
|
|
},
|
|
replaceWith: function (e) {
|
|
return this.before(e).remove();
|
|
},
|
|
wrap: function (e) {
|
|
return Yo(this, e);
|
|
},
|
|
wrapAll: function (e) {
|
|
return Yo(this, e, !0);
|
|
},
|
|
wrapInner: function (e) {
|
|
return (
|
|
this.each(function () {
|
|
yi(this).contents().wrapAll(e);
|
|
}),
|
|
this
|
|
);
|
|
},
|
|
unwrap: function () {
|
|
return this.parent().each(function () {
|
|
yi(this).replaceWith(this.childNodes);
|
|
});
|
|
},
|
|
clone: function () {
|
|
var e = [];
|
|
return (
|
|
this.each(function () {
|
|
e.push(this.cloneNode(!0));
|
|
}),
|
|
yi(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(" ")
|
|
? Qo(o.split(" "), function () {
|
|
e.toggleClass(this, i);
|
|
})
|
|
: e.each(function (e, t) {
|
|
var n, r;
|
|
(r = Xo(t, o)) !== i &&
|
|
((n = t.className),
|
|
r
|
|
? (t.className = Jo(
|
|
(" " + n + " ").replace(" " + o + " ", " "),
|
|
))
|
|
: (t.className += n ? " " + o : o));
|
|
})),
|
|
e
|
|
);
|
|
},
|
|
hasClass: function (e) {
|
|
return Xo(this[0], e);
|
|
},
|
|
each: function (e) {
|
|
return Qo(this, e);
|
|
},
|
|
on: function (e, t) {
|
|
return this.each(function () {
|
|
oi.bind(this, e, t);
|
|
});
|
|
},
|
|
off: function (e, t) {
|
|
return this.each(function () {
|
|
oi.unbind(this, e, t);
|
|
});
|
|
},
|
|
trigger: function (e) {
|
|
return this.each(function () {
|
|
"object" == typeof e ? oi.fire(this, e.type, e) : oi.fire(this, e);
|
|
});
|
|
},
|
|
show: function () {
|
|
return this.css("display", "");
|
|
},
|
|
hide: function () {
|
|
return this.css("display", "none");
|
|
},
|
|
slice: function () {
|
|
return new yi(ni.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) {
|
|
var t,
|
|
n,
|
|
r = [];
|
|
for (t = 0, n = this.length; t < n; t++) yi.find(e, this[t], r);
|
|
return yi(r);
|
|
},
|
|
filter: function (n) {
|
|
return yi(
|
|
"function" == typeof n
|
|
? Zo(this.toArray(), function (e, t) {
|
|
return n(t, e);
|
|
})
|
|
: yi.filter(n, this.toArray()),
|
|
);
|
|
},
|
|
closest: function (n) {
|
|
var r = [];
|
|
return (
|
|
n instanceof yi && (n = n[0]),
|
|
this.each(function (e, t) {
|
|
for (; t; ) {
|
|
if ("string" == typeof n && yi(t).is(n)) {
|
|
r.push(t);
|
|
break;
|
|
}
|
|
if (t === n) {
|
|
r.push(t);
|
|
break;
|
|
}
|
|
t = t.parentNode;
|
|
}
|
|
}),
|
|
yi(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: ti,
|
|
sort: Array.prototype.sort,
|
|
splice: Array.prototype.splice,
|
|
}),
|
|
Rn.extend(Go, {
|
|
extend: Rn.extend,
|
|
makeArray: function (e) {
|
|
return (function (e) {
|
|
return e && e === e.window;
|
|
})(e) || e.nodeType
|
|
? [e]
|
|
: Rn.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: Rn.isArray,
|
|
each: Qo,
|
|
trim: Jo,
|
|
grep: Zo,
|
|
find: Mo,
|
|
expr: Mo.selectors,
|
|
unique: Mo.uniqueSort,
|
|
text: Mo.getText,
|
|
contains: Mo.contains,
|
|
filter: function (e, t, n) {
|
|
var r = t.length;
|
|
for (n && (e = ":not(" + e + ")"); r--; )
|
|
1 !== t[r].nodeType && t.splice(r, 1);
|
|
return (t =
|
|
1 === t.length
|
|
? yi.find.matchesSelector(t[0], e)
|
|
? [t[0]]
|
|
: []
|
|
: yi.find.matches(e, t));
|
|
},
|
|
});
|
|
function gi(e, t, n) {
|
|
var r = [],
|
|
o = e[t];
|
|
for (
|
|
"string" != typeof n && n instanceof yi && (n = n[0]);
|
|
o && 9 !== o.nodeType;
|
|
|
|
) {
|
|
if (n !== undefined) {
|
|
if (o === n) break;
|
|
if ("string" == typeof n && yi(o).is(n)) break;
|
|
}
|
|
1 === o.nodeType && r.push(o), (o = o[t]);
|
|
}
|
|
return r;
|
|
}
|
|
function pi(e, t, n, r) {
|
|
var o = [];
|
|
for (r instanceof yi && (r = r[0]); e; e = e[t])
|
|
if (!n || e.nodeType === n) {
|
|
if (r !== undefined) {
|
|
if (e === r) break;
|
|
if ("string" == typeof r && yi(e).is(r)) break;
|
|
}
|
|
o.push(e);
|
|
}
|
|
return o;
|
|
}
|
|
function vi(e, t, n) {
|
|
for (e = e[t]; e; e = e[t]) if (e.nodeType === n) return e;
|
|
return null;
|
|
}
|
|
Qo(
|
|
{
|
|
parent: function (e) {
|
|
var t = e.parentNode;
|
|
return t && 11 !== t.nodeType ? t : null;
|
|
},
|
|
parents: function (e) {
|
|
return gi(e, "parentNode");
|
|
},
|
|
next: function (e) {
|
|
return vi(e, "nextSibling", 1);
|
|
},
|
|
prev: function (e) {
|
|
return vi(e, "previousSibling", 1);
|
|
},
|
|
children: function (e) {
|
|
return pi(e.firstChild, "nextSibling", 1);
|
|
},
|
|
contents: function (e) {
|
|
return Rn.toArray(
|
|
("iframe" === e.nodeName
|
|
? e.contentDocument || e.contentWindow.document
|
|
: e
|
|
).childNodes,
|
|
);
|
|
},
|
|
},
|
|
function (r, o) {
|
|
Go.fn[r] = function (t) {
|
|
var n = [];
|
|
this.each(function () {
|
|
var e = o.call(n, this, t, n);
|
|
e && (yi.isArray(e) ? n.push.apply(n, e) : n.push(e));
|
|
}),
|
|
1 < this.length &&
|
|
(ii[r] || (n = yi.unique(n)),
|
|
0 === r.indexOf("parents") && (n = n.reverse()));
|
|
var e = yi(n);
|
|
return t ? e.filter(t) : e;
|
|
};
|
|
},
|
|
),
|
|
Qo(
|
|
{
|
|
parentsUntil: function (e, t) {
|
|
return gi(e, "parentNode", t);
|
|
},
|
|
nextUntil: function (e, t) {
|
|
return pi(e, "nextSibling", 1, t).slice(1);
|
|
},
|
|
prevUntil: function (e, t) {
|
|
return pi(e, "previousSibling", 1, t).slice(1);
|
|
},
|
|
},
|
|
function (o, i) {
|
|
Go.fn[o] = function (t, e) {
|
|
var n = [];
|
|
this.each(function () {
|
|
var e = i.call(n, this, t, n);
|
|
e && (yi.isArray(e) ? n.push.apply(n, e) : n.push(e));
|
|
}),
|
|
1 < this.length &&
|
|
((n = yi.unique(n)),
|
|
(0 !== o.indexOf("parents") && "prevUntil" !== o) ||
|
|
(n = n.reverse()));
|
|
var r = yi(n);
|
|
return e ? r.filter(e) : r;
|
|
};
|
|
},
|
|
),
|
|
(Go.fn.is = function (e) {
|
|
return !!e && 0 < this.filter(e).length;
|
|
}),
|
|
(Go.fn.init.prototype = Go.fn),
|
|
(Go.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 yi.extend(o, this), o;
|
|
}),
|
|
(Go.attrHooks = fi),
|
|
(Go.cssHooks = di);
|
|
var yi = Go,
|
|
bi =
|
|
((Ci.prototype.current = function () {
|
|
return this.node;
|
|
}),
|
|
(Ci.prototype.next = function (e) {
|
|
return (
|
|
(this.node = this.findSibling(
|
|
this.node,
|
|
"firstChild",
|
|
"nextSibling",
|
|
e,
|
|
)),
|
|
this.node
|
|
);
|
|
}),
|
|
(Ci.prototype.prev = function (e) {
|
|
return (
|
|
(this.node = this.findSibling(
|
|
this.node,
|
|
"lastChild",
|
|
"previousSibling",
|
|
e,
|
|
)),
|
|
this.node
|
|
);
|
|
}),
|
|
(Ci.prototype.prev2 = function (e) {
|
|
return (
|
|
(this.node = this.findPreviousNode(
|
|
this.node,
|
|
"lastChild",
|
|
"previousSibling",
|
|
e,
|
|
)),
|
|
this.node
|
|
);
|
|
}),
|
|
(Ci.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;
|
|
}
|
|
}
|
|
}),
|
|
(Ci.prototype.findPreviousNode = function (e, t, n, r) {
|
|
var o, i, a;
|
|
if (e) {
|
|
if (((o = e[n]), this.rootNode && o === this.rootNode)) return;
|
|
if (o) {
|
|
if (!r) for (a = o[t]; a; a = a[t]) if (!a[t]) return a;
|
|
return o;
|
|
}
|
|
if ((i = e.parentNode) && i !== this.rootNode) return i;
|
|
}
|
|
}),
|
|
Ci);
|
|
function Ci(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 wi(t, n) {
|
|
Se(t).each(function (e) {
|
|
e.dom().insertBefore(n.dom(), t.dom());
|
|
});
|
|
}
|
|
function xi(e, t) {
|
|
Te(e).fold(
|
|
function () {
|
|
Se(e).each(function (e) {
|
|
_i(e, t);
|
|
});
|
|
},
|
|
function (e) {
|
|
wi(e, t);
|
|
},
|
|
);
|
|
}
|
|
function zi(t, n) {
|
|
_e(t).fold(
|
|
function () {
|
|
_i(t, n);
|
|
},
|
|
function (e) {
|
|
t.dom().insertBefore(n.dom(), e.dom());
|
|
},
|
|
);
|
|
}
|
|
function Ei(t, e) {
|
|
z(e, function (e) {
|
|
_i(t, e);
|
|
});
|
|
}
|
|
function Ni(e) {
|
|
(e.dom().textContent = ""),
|
|
z(Re(e), function (e) {
|
|
Oi(e);
|
|
});
|
|
}
|
|
function Si(e) {
|
|
var t = Re(e);
|
|
0 < t.length &&
|
|
(function (t, e) {
|
|
z(e, function (e) {
|
|
wi(t, e);
|
|
});
|
|
})(e, t),
|
|
Oi(e);
|
|
}
|
|
function ki(e, t) {
|
|
return e !== undefined ? e : t !== undefined ? t : 0;
|
|
}
|
|
function Ti(e) {
|
|
var t = e !== undefined ? e.dom() : j.document,
|
|
n = t.body.scrollLeft || t.documentElement.scrollLeft,
|
|
r = t.body.scrollTop || t.documentElement.scrollTop;
|
|
return Hi(n, r);
|
|
}
|
|
function Ai(e, t, n) {
|
|
(n !== undefined ? n.dom() : j.document).defaultView.scrollTo(e, t);
|
|
}
|
|
function Mi(e, t) {
|
|
Li && D(e.dom().scrollIntoViewIfNeeded)
|
|
? e.dom().scrollIntoViewIfNeeded(!1)
|
|
: e.dom().scrollIntoView(t);
|
|
}
|
|
function Ri(e, t, n, r) {
|
|
return {
|
|
x: $(e),
|
|
y: $(t),
|
|
width: $(n),
|
|
height: $(r),
|
|
right: $(e + n),
|
|
bottom: $(t + r),
|
|
};
|
|
}
|
|
var Di,
|
|
_i = function (e, t) {
|
|
e.dom().appendChild(t.dom());
|
|
},
|
|
Oi = function (e) {
|
|
var t = e.dom();
|
|
null !== t.parentNode && t.parentNode.removeChild(t);
|
|
},
|
|
Bi = function (n, r) {
|
|
return {
|
|
left: $(n),
|
|
top: $(r),
|
|
translate: function (e, t) {
|
|
return Bi(n + e, r + t);
|
|
},
|
|
};
|
|
},
|
|
Hi = Bi,
|
|
Pi = function (e) {
|
|
var t = e.dom(),
|
|
n = t.ownerDocument.body;
|
|
return n === t
|
|
? Hi(n.offsetLeft, n.offsetTop)
|
|
: de(e)
|
|
? (function (e) {
|
|
var t = e.getBoundingClientRect();
|
|
return Hi(t.left, t.top);
|
|
})(t)
|
|
: Hi(0, 0);
|
|
},
|
|
Li = oe().browser.isSafari(),
|
|
Vi = function (e) {
|
|
var t = e === undefined ? j.window : e,
|
|
n = t.document,
|
|
r = Ti(bt.fromDom(n)),
|
|
o = t.visualViewport;
|
|
if (o !== undefined)
|
|
return Ri(
|
|
Math.max(o.pageLeft, r.left()),
|
|
Math.max(o.pageTop, r.top()),
|
|
o.width,
|
|
o.height,
|
|
);
|
|
var i = n.documentElement,
|
|
a = i.clientWidth,
|
|
u = i.clientHeight;
|
|
return Ri(r.left(), r.top(), a, u);
|
|
},
|
|
Ii = Rn.each,
|
|
Fi = Rn.grep,
|
|
Ui = Sn.ie,
|
|
ji = /^([a-z0-9],?)+$/i,
|
|
qi = /^[ \t\r\n]*$/,
|
|
$i = function (n, r, o) {
|
|
var i = r.keep_values,
|
|
e = {
|
|
set: function (e, t, n) {
|
|
r.url_converter &&
|
|
(t = r.url_converter.call(
|
|
r.url_converter_scope || o(),
|
|
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
|
|
? (i && e.attr("data-mce-style", t), e.attr("style", t))
|
|
: e.css(t);
|
|
},
|
|
get: function (e) {
|
|
var t = e.attr("data-mce-style") || e.attr("style");
|
|
return (t = n.serialize(n.parse(t), e[0].nodeName));
|
|
},
|
|
},
|
|
};
|
|
return i && (t.href = t.src = e), t;
|
|
},
|
|
Wi = function (e, t) {
|
|
var n = t.attr("style"),
|
|
r = e.serialize(e.parse(n), t[0].nodeName);
|
|
(r = r || null), t.attr("data-mce-style", r);
|
|
},
|
|
Ki = function (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;
|
|
};
|
|
function Xi(a, u) {
|
|
var s,
|
|
c = this;
|
|
void 0 === u && (u = {});
|
|
function l(e) {
|
|
if (e && a && "string" == typeof e) {
|
|
var t = a.getElementById(e);
|
|
return t && t.id !== e ? a.getElementsByName(e)[1] : t;
|
|
}
|
|
return e;
|
|
}
|
|
function f(e) {
|
|
return "string" == typeof e && (e = l(e)), H(e);
|
|
}
|
|
function r(e, t, n) {
|
|
var r,
|
|
o,
|
|
i = f(e);
|
|
return (
|
|
i.length && (o = (r = s[t]) && r.get ? r.get(i, t) : i.attr(t)),
|
|
void 0 === o && (o = n || ""),
|
|
o
|
|
);
|
|
}
|
|
function d(e) {
|
|
var t = l(e);
|
|
return t ? t.attributes : [];
|
|
}
|
|
function o(e, t, n) {
|
|
var r, o;
|
|
"" === n && (n = null);
|
|
var i = f(e);
|
|
(r = i.attr(t)),
|
|
i.length &&
|
|
((o = s[t]) && o.set ? o.set(i, n, t) : i.attr(t, n),
|
|
r !== n &&
|
|
u.onSetAttrib &&
|
|
u.onSetAttrib({ attrElm: i, attrName: t, attrValue: n }));
|
|
}
|
|
function h() {
|
|
return u.root_element || a.body;
|
|
}
|
|
function i(e, t) {
|
|
return Pt.getPos(a.body, l(e), t);
|
|
}
|
|
function m(e, t, n) {
|
|
var r = f(e);
|
|
return n
|
|
? r.css(t)
|
|
: ("float" ===
|
|
(t = t.replace(/-(\D)/g, function (e, t) {
|
|
return t.toUpperCase();
|
|
})) && (t = Sn.browser.isIE() ? "styleFloat" : "cssFloat"),
|
|
r[0] && r[0].style ? r[0].style[t] : undefined);
|
|
}
|
|
function g(e) {
|
|
var t, n;
|
|
return (
|
|
(e = l(e)),
|
|
(t = m(e, "width")),
|
|
(n = m(e, "height")),
|
|
-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 p(e, t) {
|
|
var n;
|
|
if (!e) return !1;
|
|
if (!Array.isArray(e)) {
|
|
if ("*" === t) return 1 === e.nodeType;
|
|
if (ji.test(t)) {
|
|
var r = t.toLowerCase().split(/,/),
|
|
o = e.nodeName.toLowerCase();
|
|
for (n = r.length - 1; 0 <= n; n--) if (r[n] === o) return !0;
|
|
return !1;
|
|
}
|
|
if (e.nodeType && 1 !== e.nodeType) return !1;
|
|
}
|
|
var i = Array.isArray(e) ? e : [e];
|
|
return 0 < Mo(t, i[0].ownerDocument || i[0], null, i).length;
|
|
}
|
|
function v(e, t, n, r) {
|
|
var o,
|
|
i = [],
|
|
a = l(e);
|
|
for (
|
|
r = r === undefined,
|
|
n = n || ("BODY" !== h().nodeName ? h().parentNode : null),
|
|
Rn.is(t, "string") &&
|
|
(t =
|
|
"*" === (o = t)
|
|
? function (e) {
|
|
return 1 === e.nodeType;
|
|
}
|
|
: function (e) {
|
|
return p(e, o);
|
|
});
|
|
a && a !== n && a.nodeType && 9 !== a.nodeType;
|
|
|
|
) {
|
|
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 p(e, t);
|
|
}),
|
|
e = e[n];
|
|
e;
|
|
e = e[n]
|
|
)
|
|
if ("function" == typeof r && r(e)) return e;
|
|
return null;
|
|
}
|
|
function y(e, n, r) {
|
|
var o,
|
|
t = "string" == typeof e ? l(e) : e;
|
|
if (!t) return !1;
|
|
if (Rn.isArray(t) && (t.length || 0 === t.length))
|
|
return (
|
|
(o = []),
|
|
Ii(t, function (e, t) {
|
|
e && ("string" == typeof e && (e = l(e)), o.push(n.call(r, e, t)));
|
|
}),
|
|
o
|
|
);
|
|
var i = r || c;
|
|
return n.call(i, t);
|
|
}
|
|
function b(e, t) {
|
|
f(e).each(function (e, n) {
|
|
Ii(t, function (e, t) {
|
|
o(n, t, e);
|
|
});
|
|
});
|
|
}
|
|
function C(e, r) {
|
|
var t = f(e);
|
|
Ui
|
|
? t.each(function (e, t) {
|
|
if (!1 !== t.canHaveHTML) {
|
|
for (; t.firstChild; ) t.removeChild(t.firstChild);
|
|
try {
|
|
(t.innerHTML = "<br>" + r), t.removeChild(t.firstChild);
|
|
} catch (n) {
|
|
yi("<div></div>")
|
|
.html("<br>" + r)
|
|
.contents()
|
|
.slice(1)
|
|
.appendTo(t);
|
|
}
|
|
return r;
|
|
}
|
|
})
|
|
: t.html(r);
|
|
}
|
|
function w(e, n, r, o, i) {
|
|
return y(e, function (e) {
|
|
var t = "string" == typeof n ? a.createElement(n) : n;
|
|
return (
|
|
b(t, r),
|
|
o &&
|
|
("string" != typeof o && o.nodeType
|
|
? t.appendChild(o)
|
|
: "string" == typeof o && C(t, o)),
|
|
i ? t : e.appendChild(t)
|
|
);
|
|
});
|
|
}
|
|
function x(e, t, n) {
|
|
return w(a.createElement(e), e, t, n, !0);
|
|
}
|
|
function z(e, t) {
|
|
var n = f(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);
|
|
})
|
|
.remove()
|
|
: n.remove(),
|
|
1 < n.length ? n.toArray() : n[0]
|
|
);
|
|
}
|
|
function E(e, t, n) {
|
|
f(e)
|
|
.toggleClass(t, n)
|
|
.each(function () {
|
|
"" === this.className && yi(this).attr("class", null);
|
|
});
|
|
}
|
|
function N(t, e, n) {
|
|
return y(e, function (e) {
|
|
return (
|
|
Rn.is(e, "array") && (t = t.cloneNode(!0)),
|
|
n &&
|
|
Ii(Fi(e.childNodes), function (e) {
|
|
t.appendChild(e);
|
|
}),
|
|
e.parentNode.replaceChild(t, e)
|
|
);
|
|
});
|
|
}
|
|
function S() {
|
|
return a.createRange();
|
|
}
|
|
function k(e) {
|
|
if (e && Ge.isElement(e)) {
|
|
var t = e.getAttribute("data-mce-contenteditable");
|
|
return t && "inherit" !== t
|
|
? t
|
|
: "inherit" !== e.contentEditable
|
|
? e.contentEditable
|
|
: null;
|
|
}
|
|
return null;
|
|
}
|
|
var T = {},
|
|
A = j.window,
|
|
M = {},
|
|
t = 0,
|
|
e = (function U(m, g) {
|
|
void 0 === g && (g = {});
|
|
var p,
|
|
v = 0,
|
|
y = {};
|
|
function b(e) {
|
|
m.getElementsByTagName("head")[0].appendChild(e);
|
|
}
|
|
function n(e, t, n) {
|
|
function r(e) {
|
|
(l.status = e),
|
|
(l.passed = []),
|
|
(l.failed = []),
|
|
u && ((u.onload = null), (u.onerror = null), (u = null));
|
|
}
|
|
function o() {
|
|
for (var e = l.passed, t = e.length; t--; ) e[t]();
|
|
r(2);
|
|
}
|
|
function i() {
|
|
for (var e = l.failed, t = e.length; t--; ) e[t]();
|
|
r(3);
|
|
}
|
|
function a(e, t) {
|
|
e() || (new Date().getTime() - c < p ? vn.setTimeout(t) : i());
|
|
}
|
|
var u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = function () {
|
|
a(function () {
|
|
for (var e, t, n = m.styleSheets, r = n.length; r--; )
|
|
if (
|
|
(t = (e = n[r]).ownerNode
|
|
? e.ownerNode
|
|
: e.owningElement) &&
|
|
t.id === u.id
|
|
)
|
|
return o(), !0;
|
|
}, f);
|
|
},
|
|
d = function () {
|
|
a(function () {
|
|
try {
|
|
var e = s.sheet.cssRules;
|
|
return o(), !!e;
|
|
} catch (t) {}
|
|
}, d);
|
|
};
|
|
if (
|
|
((e = Rn._addCacheSuffix(e)),
|
|
y[e] ? (l = y[e]) : ((l = { passed: [], failed: [] }), (y[e] = l)),
|
|
t && l.passed.push(t),
|
|
n && l.failed.push(n),
|
|
1 !== l.status)
|
|
)
|
|
if (2 !== l.status)
|
|
if (3 !== l.status) {
|
|
if (
|
|
((l.status = 1),
|
|
((u = m.createElement("link")).rel = "stylesheet"),
|
|
(u.type = "text/css"),
|
|
(u.id = "u" + v++),
|
|
(u.async = !1),
|
|
(u.defer = !1),
|
|
(c = new Date().getTime()),
|
|
g.contentCssCors && (u.crossOrigin = "anonymous"),
|
|
g.referrerPolicy &&
|
|
At(bt.fromDom(u), "referrerpolicy", g.referrerPolicy),
|
|
"onload" in u &&
|
|
!(
|
|
(h = j.navigator.userAgent.match(/WebKit\/(\d*)/)) &&
|
|
parseInt(h[1], 10) < 536
|
|
))
|
|
)
|
|
(u.onload = f), (u.onerror = i);
|
|
else {
|
|
if (0 < j.navigator.userAgent.indexOf("Firefox"))
|
|
return (
|
|
((s = m.createElement("style")).textContent =
|
|
'@import "' + e + '"'),
|
|
d(),
|
|
void b(s)
|
|
);
|
|
f();
|
|
}
|
|
var h;
|
|
b(u), (u.href = e);
|
|
} else i();
|
|
else o();
|
|
}
|
|
function t(t) {
|
|
return Yt.nu(function (e) {
|
|
n(t, q(e, $(Zt.value(t))), q(e, $(Zt.error(t))));
|
|
});
|
|
}
|
|
function o(e) {
|
|
return e.fold(W, W);
|
|
}
|
|
return (
|
|
(p = g.maxLoadTime || 5e3),
|
|
{
|
|
load: n,
|
|
loadAll: function (e, n, r) {
|
|
Gt(X(e, t)).get(function (e) {
|
|
var t = Y(e, function (e) {
|
|
return e.isValue();
|
|
});
|
|
0 < t.fail.length ? r(t.fail.map(o)) : n(t.pass.map(o));
|
|
});
|
|
},
|
|
_setReferrerPolicy: function (e) {
|
|
g.referrerPolicy = e;
|
|
},
|
|
}
|
|
);
|
|
})(a, {
|
|
contentCssCors: u.contentCssCors,
|
|
referrerPolicy: u.referrerPolicy,
|
|
}),
|
|
R = [],
|
|
D = u.schema ? u.schema : vr({}),
|
|
_ = zr(
|
|
{
|
|
url_converter: u.url_converter,
|
|
url_converter_scope: u.url_converter_scope,
|
|
},
|
|
u.schema,
|
|
),
|
|
O = u.ownEvents ? new Tr() : Tr.Event,
|
|
B = D.getBlockElements(),
|
|
H = yi.overrideDefaults(function () {
|
|
return { context: a, element: F.getRoot() };
|
|
}),
|
|
P = ar.decode,
|
|
L = ar.encodeAllRaw,
|
|
V = function (e, t, n, r) {
|
|
if (Rn.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 !== A) || R.push([e, t, n, r]),
|
|
O.bind(e, t, n, r || F)
|
|
);
|
|
},
|
|
I = function (e, t, n) {
|
|
var r;
|
|
if (Rn.isArray(e)) {
|
|
r = e.length;
|
|
for (var o = []; r--; ) o[r] = I(e[r], t, n);
|
|
return o;
|
|
}
|
|
if (R && (e === a || e === A))
|
|
for (r = R.length; r--; ) {
|
|
var i = R[r];
|
|
e !== i[0] ||
|
|
(t && t !== i[1]) ||
|
|
(n && n !== i[2]) ||
|
|
O.unbind(i[0], i[1], i[2]);
|
|
}
|
|
return O.unbind(e, t, n);
|
|
},
|
|
F = {
|
|
doc: a,
|
|
settings: u,
|
|
win: A,
|
|
files: M,
|
|
stdMode: !0,
|
|
boxModel: !0,
|
|
styleSheetLoader: e,
|
|
boundEvents: R,
|
|
styles: _,
|
|
schema: D,
|
|
events: O,
|
|
isBlock: function (e) {
|
|
if ("string" == typeof e) return !!B[e];
|
|
if (e) {
|
|
var t = e.nodeType;
|
|
if (t) return !(1 !== t || !B[e.nodeName]);
|
|
}
|
|
return !1;
|
|
},
|
|
$: H,
|
|
$$: f,
|
|
root: null,
|
|
clone: function (t, e) {
|
|
if (!Ui || 1 !== t.nodeType || e) return t.cloneNode(e);
|
|
if (e) return null;
|
|
var n = a.createElement(t.nodeName);
|
|
return (
|
|
Ii(d(t), function (e) {
|
|
o(n, e.nodeName, r(t, e.nodeName));
|
|
}),
|
|
n
|
|
);
|
|
},
|
|
getRoot: h,
|
|
getViewPort: function (e) {
|
|
var t = Vi(e);
|
|
return { x: t.x(), y: t.y(), w: t.width(), h: t.height() };
|
|
},
|
|
getRect: function (e) {
|
|
var t, n;
|
|
return (
|
|
(e = l(e)),
|
|
(t = i(e)),
|
|
(n = g(e)),
|
|
{ x: t.x, y: t.y, w: n.w, h: n.h }
|
|
);
|
|
},
|
|
getSize: g,
|
|
getParent: function (e, t, n) {
|
|
var r = v(e, t, n, !1);
|
|
return r && 0 < r.length ? r[0] : null;
|
|
},
|
|
getParents: v,
|
|
get: l,
|
|
getNext: function (e, t) {
|
|
return n(e, t, "nextSibling");
|
|
},
|
|
getPrev: function (e, t) {
|
|
return n(e, t, "previousSibling");
|
|
},
|
|
select: function (e, t) {
|
|
return Mo(e, l(t) || u.root_element || a, []);
|
|
},
|
|
is: p,
|
|
add: w,
|
|
create: x,
|
|
createHTML: function (e, t, n) {
|
|
var r,
|
|
o = "";
|
|
for (r in ((o += "<" + e), t))
|
|
t.hasOwnProperty(r) &&
|
|
null !== t[r] &&
|
|
"undefined" != typeof t[r] &&
|
|
(o += " " + r + '="' + L(t[r]) + '"');
|
|
return void 0 !== n ? o + ">" + n + "</" + e + ">" : o + " />";
|
|
},
|
|
createFragment: function (e) {
|
|
var t,
|
|
n = a.createElement("div"),
|
|
r = a.createDocumentFragment();
|
|
for (e && (n.innerHTML = e); (t = n.firstChild); ) r.appendChild(t);
|
|
return r;
|
|
},
|
|
remove: z,
|
|
setStyle: function (e, t, n) {
|
|
var r = K(t) ? f(e).css(t, n) : f(e).css(t);
|
|
u.update_styles && Wi(_, r);
|
|
},
|
|
getStyle: m,
|
|
setStyles: function (e, t) {
|
|
var n = f(e).css(t);
|
|
u.update_styles && Wi(_, n);
|
|
},
|
|
removeAllAttribs: function (e) {
|
|
return y(e, function (e) {
|
|
var t,
|
|
n = e.attributes;
|
|
for (t = n.length - 1; 0 <= t; t--)
|
|
e.removeAttributeNode(n.item(t));
|
|
});
|
|
},
|
|
setAttrib: o,
|
|
setAttribs: b,
|
|
getAttrib: r,
|
|
getPos: i,
|
|
parseStyle: function (e) {
|
|
return _.parse(e);
|
|
},
|
|
serializeStyle: function (e, t) {
|
|
return _.serialize(e, t);
|
|
},
|
|
addStyle: function (e) {
|
|
var t, n;
|
|
if (F !== Xi.DOM && a === j.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) {
|
|
var n;
|
|
F === Xi.DOM || a !== j.document
|
|
? ((e = e || ""),
|
|
(n = a.getElementsByTagName("head")[0]),
|
|
Ii(e.split(","), function (e) {
|
|
var t;
|
|
(e = Rn._addCacheSuffix(e)),
|
|
M[e] ||
|
|
((M[e] = !0),
|
|
(t = x(
|
|
"link",
|
|
G(
|
|
G(
|
|
{ rel: "stylesheet", type: "text/css", href: e },
|
|
u.contentCssCors ? { crossOrigin: "anonymous" } : {},
|
|
),
|
|
u.referrerPolicy
|
|
? { referrerPolicy: u.referrerPolicy }
|
|
: {},
|
|
),
|
|
)),
|
|
n.appendChild(t));
|
|
}))
|
|
: Xi.DOM.loadCSS(e);
|
|
},
|
|
addClass: function (e, t) {
|
|
f(e).addClass(t);
|
|
},
|
|
removeClass: function (e, t) {
|
|
E(e, t, !1);
|
|
},
|
|
hasClass: function (e, t) {
|
|
return f(e).hasClass(t);
|
|
},
|
|
toggleClass: E,
|
|
show: function (e) {
|
|
f(e).show();
|
|
},
|
|
hide: function (e) {
|
|
f(e).hide();
|
|
},
|
|
isHidden: function (e) {
|
|
return "none" === f(e).css("display");
|
|
},
|
|
uniqueId: function (e) {
|
|
return (e || "mce_") + t++;
|
|
},
|
|
setHTML: C,
|
|
getOuterHTML: function (e) {
|
|
var t = "string" == typeof e ? l(e) : e;
|
|
return Ge.isElement(t)
|
|
? t.outerHTML
|
|
: yi("<div></div>").append(yi(t).clone()).html();
|
|
},
|
|
setOuterHTML: function (e, t) {
|
|
f(e).each(function () {
|
|
try {
|
|
if ("outerHTML" in this) return void (this.outerHTML = t);
|
|
} catch (e) {}
|
|
z(yi(this).html(t), !0);
|
|
});
|
|
},
|
|
decode: P,
|
|
encode: L,
|
|
insertAfter: function (e, t) {
|
|
var r = l(t);
|
|
return y(e, function (e) {
|
|
var t, n;
|
|
return (
|
|
(t = r.parentNode),
|
|
(n = r.nextSibling) ? t.insertBefore(e, n) : t.appendChild(e),
|
|
e
|
|
);
|
|
});
|
|
},
|
|
replace: N,
|
|
rename: function (t, e) {
|
|
var n;
|
|
return (
|
|
t.nodeName !== e.toUpperCase() &&
|
|
((n = x(e)),
|
|
Ii(d(t), function (e) {
|
|
o(n, e.nodeName, r(t, e.nodeName));
|
|
}),
|
|
N(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 _.toHex(Rn.trim(e));
|
|
},
|
|
run: y,
|
|
getAttribs: d,
|
|
isEmpty: function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a = 0;
|
|
if ((e = e.firstChild)) {
|
|
var u = new bi(e, e.parentNode),
|
|
s = D ? D.getWhiteSpaceElements() : {};
|
|
t = t || (D ? D.getNonEmptyElements() : null);
|
|
do {
|
|
if (((o = e.nodeType), Ge.isElement(e))) {
|
|
var c = e.getAttribute("data-mce-bogus");
|
|
if (c) {
|
|
e = u.next("all" === c);
|
|
continue;
|
|
}
|
|
if (((i = e.nodeName.toLowerCase()), t && t[i])) {
|
|
if ("br" !== i) return !1;
|
|
a++, (e = u.next());
|
|
continue;
|
|
}
|
|
for (n = (r = d(e)).length; n--; )
|
|
if (
|
|
"name" === (i = r[n].nodeName) ||
|
|
"data-mce-bookmark" === i
|
|
)
|
|
return !1;
|
|
}
|
|
if (8 === o) return !1;
|
|
if (3 === o && !qi.test(e.nodeValue)) return !1;
|
|
if (
|
|
3 === o &&
|
|
e.parentNode &&
|
|
s[e.parentNode.nodeName] &&
|
|
qi.test(e.nodeValue)
|
|
)
|
|
return !1;
|
|
e = u.next();
|
|
} while (e);
|
|
}
|
|
return a <= 1;
|
|
},
|
|
createRng: S,
|
|
nodeIndex: Ki,
|
|
split: function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a = S();
|
|
if (e && t)
|
|
return (
|
|
a.setStart(e.parentNode, Ki(e)),
|
|
a.setEnd(t.parentNode, Ki(t)),
|
|
(r = a.extractContents()),
|
|
(a = S()).setStart(t.parentNode, Ki(t) + 1),
|
|
a.setEnd(e.parentNode, Ki(e) + 1),
|
|
(o = a.extractContents()),
|
|
(i = e.parentNode).insertBefore(Yn.trimNode(F, r), e),
|
|
n ? i.insertBefore(n, e) : i.insertBefore(t, e),
|
|
i.insertBefore(Yn.trimNode(F, o), e),
|
|
z(e),
|
|
n || t
|
|
);
|
|
},
|
|
bind: V,
|
|
unbind: I,
|
|
fire: function (e, t, n) {
|
|
return O.fire(e, t, n);
|
|
},
|
|
getContentEditable: k,
|
|
getContentEditableParent: function (e) {
|
|
for (
|
|
var t = h(), n = null;
|
|
e && e !== t && null === (n = k(e));
|
|
e = e.parentNode
|
|
);
|
|
return n;
|
|
},
|
|
destroy: function () {
|
|
if (R)
|
|
for (var e = R.length; e--; ) {
|
|
var t = R[e];
|
|
O.unbind(t[0], t[1], t[2]);
|
|
}
|
|
Mo.setDocument && Mo.setDocument();
|
|
},
|
|
isChildOf: function (e, t) {
|
|
for (; e; ) {
|
|
if (t === e) return !0;
|
|
e = e.parentNode;
|
|
}
|
|
return !1;
|
|
},
|
|
dumpRng: function (e) {
|
|
return (
|
|
"startContainer: " +
|
|
e.startContainer.nodeName +
|
|
", startOffset: " +
|
|
e.startOffset +
|
|
", endContainer: " +
|
|
e.endContainer.nodeName +
|
|
", endOffset: " +
|
|
e.endOffset
|
|
);
|
|
},
|
|
};
|
|
return (
|
|
(s = $i(_, u, function () {
|
|
return F;
|
|
})),
|
|
F
|
|
);
|
|
}
|
|
((Di = Xi = Xi || {}).DOM = Di(j.document)), (Di.nodeIndex = Ki);
|
|
var Yi = Xi,
|
|
Gi = Yi.DOM,
|
|
Ji = Rn.each,
|
|
Qi = Rn.grep,
|
|
Zi =
|
|
((ea.prototype._setReferrerPolicy = function (e) {
|
|
this.settings.referrerPolicy = e;
|
|
}),
|
|
(ea.prototype.loadScript = function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i = Gi;
|
|
(o = i.uniqueId()),
|
|
((r = j.document.createElement("script")).id = o),
|
|
(r.type = "text/javascript"),
|
|
(r.src = Rn._addCacheSuffix(e)),
|
|
this.settings.referrerPolicy &&
|
|
i.setAttrib(r, "referrerpolicy", this.settings.referrerPolicy),
|
|
(r.onload = function () {
|
|
i.remove(o), r && (r.onreadystatechange = r.onload = r = null), t();
|
|
}),
|
|
(r.onerror = function () {
|
|
D(n)
|
|
? n()
|
|
: "undefined" != typeof j.console &&
|
|
j.console.log &&
|
|
j.console.log("Failed to load script: " + e);
|
|
}),
|
|
(
|
|
j.document.getElementsByTagName("head")[0] || j.document.body
|
|
).appendChild(r);
|
|
}),
|
|
(ea.prototype.isDone = function (e) {
|
|
return 2 === this.states[e];
|
|
}),
|
|
(ea.prototype.markDone = function (e) {
|
|
this.states[e] = 2;
|
|
}),
|
|
(ea.prototype.add = function (e, t, n, r) {
|
|
this.states[e] === undefined &&
|
|
(this.queue.push(e), (this.states[e] = 0)),
|
|
t &&
|
|
(this.scriptLoadedCallbacks[e] ||
|
|
(this.scriptLoadedCallbacks[e] = []),
|
|
this.scriptLoadedCallbacks[e].push({
|
|
success: t,
|
|
failure: r,
|
|
scope: n || this,
|
|
}));
|
|
}),
|
|
(ea.prototype.load = function (e, t, n, r) {
|
|
return this.add(e, t, n, r);
|
|
}),
|
|
(ea.prototype.remove = function (e) {
|
|
delete this.states[e], delete this.scriptLoadedCallbacks[e];
|
|
}),
|
|
(ea.prototype.loadQueue = function (e, t, n) {
|
|
this.loadScripts(this.queue, e, t, n);
|
|
}),
|
|
(ea.prototype.loadScripts = function (n, e, t, r) {
|
|
function o(t, e) {
|
|
Ji(a.scriptLoadedCallbacks[e], function (e) {
|
|
D(e[t]) && e[t].call(e.scope);
|
|
}),
|
|
(a.scriptLoadedCallbacks[e] = undefined);
|
|
}
|
|
var i,
|
|
a = this,
|
|
u = [];
|
|
a.queueLoadedCallbacks.push({
|
|
success: e,
|
|
failure: r,
|
|
scope: t || this,
|
|
}),
|
|
(i = function () {
|
|
var e = Qi(n);
|
|
if (
|
|
((n.length = 0),
|
|
Ji(e, function (e) {
|
|
2 !== a.states[e]
|
|
? 3 !== a.states[e]
|
|
? 1 !== a.states[e] &&
|
|
((a.states[e] = 1),
|
|
a.loading++,
|
|
a.loadScript(
|
|
e,
|
|
function () {
|
|
(a.states[e] = 2), a.loading--, o("success", e), i();
|
|
},
|
|
function () {
|
|
(a.states[e] = 3),
|
|
a.loading--,
|
|
u.push(e),
|
|
o("failure", e),
|
|
i();
|
|
},
|
|
))
|
|
: o("failure", e)
|
|
: o("success", e);
|
|
}),
|
|
!a.loading)
|
|
) {
|
|
var t = a.queueLoadedCallbacks.slice(0);
|
|
(a.queueLoadedCallbacks.length = 0),
|
|
Ji(t, function (e) {
|
|
0 === u.length
|
|
? D(e.success) && e.success.call(e.scope)
|
|
: D(e.failure) && e.failure.call(e.scope, u);
|
|
});
|
|
}
|
|
})();
|
|
}),
|
|
(ea.ScriptLoader = new ea()),
|
|
ea);
|
|
function ea(e) {
|
|
void 0 === e && (e = {}),
|
|
(this.states = {}),
|
|
(this.queue = []),
|
|
(this.scriptLoadedCallbacks = {}),
|
|
(this.queueLoadedCallbacks = []),
|
|
(this.loading = 0),
|
|
(this.settings = e);
|
|
}
|
|
var ta,
|
|
na = {},
|
|
ra = Je("en"),
|
|
oa = {
|
|
getData: function () {
|
|
return se(na, function (e) {
|
|
return G({}, e);
|
|
});
|
|
},
|
|
setCode: function (e) {
|
|
e && ra.set(e);
|
|
},
|
|
getCode: function () {
|
|
return ra.get();
|
|
},
|
|
add: function (e, t) {
|
|
var n = na[e];
|
|
for (var r in (n || (na[e] = n = {}), t)) n[r.toLowerCase()] = t[r];
|
|
},
|
|
translate: function (e) {
|
|
function r(e) {
|
|
return D(e) ? Object.prototype.toString.call(e) : a(e) ? "" : "" + e;
|
|
}
|
|
function t(e) {
|
|
var t = r(e),
|
|
n = t.toLowerCase();
|
|
return Tt(i, n) ? r(i[n]) : t;
|
|
}
|
|
function n(e) {
|
|
return e.replace(/{context:\w+}$/, "");
|
|
}
|
|
function o(e) {
|
|
return e;
|
|
}
|
|
var i = na[ra.get()] || {},
|
|
a = function (e) {
|
|
return "" === e || null === e || e === undefined;
|
|
};
|
|
if (a(e)) return o("");
|
|
if (
|
|
(function (e) {
|
|
return T(e) && Tt(e, "raw");
|
|
})(e)
|
|
)
|
|
return o(r(e.raw));
|
|
if (
|
|
(function (e) {
|
|
return A(e) && 1 < e.length;
|
|
})(e)
|
|
) {
|
|
var u = e.slice(1);
|
|
return o(
|
|
n(
|
|
t(e[0]).replace(/\{([0-9]+)\}/g, function (e, t) {
|
|
return Tt(u, t) ? r(u[t]) : e;
|
|
}),
|
|
),
|
|
);
|
|
}
|
|
return o(n(t(e)));
|
|
},
|
|
isRtl: function () {
|
|
return le(na, ra.get())
|
|
.bind(function (e) {
|
|
return le(e, "_dir");
|
|
})
|
|
.exists(function (e) {
|
|
return "rtl" === e;
|
|
});
|
|
},
|
|
hasCode: function (e) {
|
|
return Tt(na, e);
|
|
},
|
|
},
|
|
ia = Rn.each;
|
|
function aa() {
|
|
function i(e) {
|
|
var t;
|
|
return c[e] && (t = c[e].dependencies), t || [];
|
|
}
|
|
function a(e, t) {
|
|
return "object" == typeof t
|
|
? t
|
|
: "string" == typeof e
|
|
? { prefix: "", resource: t, suffix: "" }
|
|
: { prefix: e.prefix, resource: t, suffix: e.suffix };
|
|
}
|
|
function u(e, n, t, r) {
|
|
var o = i(e);
|
|
ia(o, function (e) {
|
|
var t = a(n, e);
|
|
f(t.resource, t, undefined, undefined);
|
|
}),
|
|
t && (r ? t.call(r) : t.call(Zi));
|
|
}
|
|
var r = this,
|
|
o = [],
|
|
s = {},
|
|
c = {},
|
|
l = [],
|
|
f = function (e, t, n, r, o) {
|
|
if (!s[e]) {
|
|
var i = "string" == typeof t ? t : t.prefix + t.resource + t.suffix;
|
|
0 !== i.indexOf("/") &&
|
|
-1 === i.indexOf("://") &&
|
|
(i = aa.baseURL + "/" + i),
|
|
(s[e] = i.substring(0, i.lastIndexOf("/"))),
|
|
c[e]
|
|
? u(e, t, n, r)
|
|
: Zi.ScriptLoader.add(
|
|
i,
|
|
function () {
|
|
return u(e, t, n, r);
|
|
},
|
|
r,
|
|
o,
|
|
);
|
|
}
|
|
};
|
|
return {
|
|
items: o,
|
|
urls: s,
|
|
lookup: c,
|
|
_listeners: l,
|
|
get: function (e) {
|
|
return c[e] ? c[e].instance : undefined;
|
|
},
|
|
dependencies: i,
|
|
requireLangPack: function (e, t) {
|
|
var n = oa.getCode();
|
|
if (n && !1 !== aa.languageLoad) {
|
|
if (t)
|
|
if (-1 !== (t = "," + t + ",").indexOf("," + n.substr(0, 2) + ","))
|
|
n = n.substr(0, 2);
|
|
else if (-1 === t.indexOf("," + n + ",")) return;
|
|
Zi.ScriptLoader.add(s[e] + "/langs/" + n + ".js");
|
|
}
|
|
},
|
|
add: function (t, e, n) {
|
|
o.push(e), (c[t] = { instance: e, dependencies: n });
|
|
var r = Y(l, function (e) {
|
|
return e.name === t;
|
|
});
|
|
return (
|
|
(l = r.fail),
|
|
ia(r.pass, function (e) {
|
|
e.callback();
|
|
}),
|
|
e
|
|
);
|
|
},
|
|
remove: function (e) {
|
|
delete s[e], delete c[e];
|
|
},
|
|
createUrl: a,
|
|
addComponents: function (e, t) {
|
|
var n = r.urls[e];
|
|
ia(t, function (e) {
|
|
Zi.ScriptLoader.add(n + "/" + e);
|
|
});
|
|
},
|
|
load: f,
|
|
waitFor: function (e, t) {
|
|
c.hasOwnProperty(e) ? t() : l.push({ name: e, callback: t });
|
|
},
|
|
};
|
|
}
|
|
((ta = aa = aa || {}).PluginManager = ta()), (ta.ThemeManager = ta());
|
|
function ua(n, r) {
|
|
var o = null;
|
|
return {
|
|
cancel: function () {
|
|
null !== o && (j.clearTimeout(o), (o = null));
|
|
},
|
|
throttle: function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
null === o &&
|
|
(o = j.setTimeout(function () {
|
|
n.apply(null, e), (o = null);
|
|
}, r));
|
|
},
|
|
};
|
|
}
|
|
function sa(e, t) {
|
|
var n = ge(e, t);
|
|
return n === undefined || "" === n ? [] : n.split(" ");
|
|
}
|
|
function ca(e) {
|
|
return e.dom().classList !== undefined;
|
|
}
|
|
function la(e, t) {
|
|
return (function (e, t, n) {
|
|
var r = sa(e, t).concat([n]);
|
|
return At(e, t, r.join(" ")), !0;
|
|
})(e, "class", t);
|
|
}
|
|
function fa(e, t) {
|
|
return (function (e, t, n) {
|
|
var r = y(sa(e, t), function (e) {
|
|
return e !== n;
|
|
});
|
|
return 0 < r.length ? At(e, t, r.join(" ")) : pe(e, t), !1;
|
|
})(e, "class", t);
|
|
}
|
|
function da(e, t) {
|
|
ca(e) ? e.dom().classList.add(t) : la(e, t);
|
|
}
|
|
function ha(e) {
|
|
0 ===
|
|
(ca(e)
|
|
? e.dom().classList
|
|
: (function (e) {
|
|
return sa(e, "class");
|
|
})(e)
|
|
).length && pe(e, "class");
|
|
}
|
|
function ma(e, t) {
|
|
return ca(e) && e.dom().classList.contains(t);
|
|
}
|
|
function ga(e, t) {
|
|
return (function (e, t) {
|
|
var n = t === undefined ? j.document : t.dom();
|
|
return xe(n) ? [] : X(n.querySelectorAll(e), bt.fromDom);
|
|
})(t, e);
|
|
}
|
|
var pa = aa,
|
|
va = function (e, t) {
|
|
var n = [];
|
|
return (
|
|
z(Re(e), function (e) {
|
|
t(e) && (n = n.concat([e])), (n = n.concat(va(e, t)));
|
|
}),
|
|
n
|
|
);
|
|
};
|
|
function ya(e, t, n, r, o) {
|
|
return e(n, r) ? k.some(n) : D(o) && o(n) ? k.none() : t(n, r, o);
|
|
}
|
|
function ba(e, t, n) {
|
|
for (var r = e.dom(), o = D(n) ? n : $(!1); r.parentNode; ) {
|
|
r = r.parentNode;
|
|
var i = bt.fromDom(r);
|
|
if (t(i)) return k.some(i);
|
|
if (o(i)) break;
|
|
}
|
|
return k.none();
|
|
}
|
|
function Ca(e, t, n) {
|
|
return ya(
|
|
function (e, t) {
|
|
return t(e);
|
|
},
|
|
ba,
|
|
e,
|
|
t,
|
|
n,
|
|
);
|
|
}
|
|
function wa(e, t, n) {
|
|
return ba(
|
|
e,
|
|
function (e) {
|
|
return we(e, t);
|
|
},
|
|
n,
|
|
);
|
|
}
|
|
function xa(e, t) {
|
|
return (function (e, t) {
|
|
var n = t === undefined ? j.document : t.dom();
|
|
return xe(n) ? k.none() : k.from(n.querySelector(e)).map(bt.fromDom);
|
|
})(t, e);
|
|
}
|
|
function za(e, t, n) {
|
|
return ya(we, wa, e, t, n);
|
|
}
|
|
function Ea(r, e) {
|
|
function t(e, t) {
|
|
return (function (e, t) {
|
|
var n = e.dom();
|
|
return !(!n || !n.hasAttribute) && n.hasAttribute(t);
|
|
})(e, t)
|
|
? k.some(ge(e, t))
|
|
: k.none();
|
|
}
|
|
var n = r.selection.getRng(),
|
|
o = bt.fromDom(n.startContainer),
|
|
i = bt.fromDom(r.getBody()),
|
|
a = e.fold(
|
|
function () {
|
|
return "." + ru();
|
|
},
|
|
function (e) {
|
|
return "[" + ou() + '="' + e + '"]';
|
|
},
|
|
),
|
|
u = De(o, n.startOffset).getOr(o);
|
|
return za(u, a, function (e) {
|
|
return ze(e, i);
|
|
}).bind(function (e) {
|
|
return t(e, "" + iu()).bind(function (n) {
|
|
return t(e, "" + ou()).map(function (e) {
|
|
var t = au(r, n);
|
|
return { uid: n, name: e, elements: t };
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function Na(n, e) {
|
|
function a(e, t) {
|
|
r(e, function (e) {
|
|
return t(e), e;
|
|
});
|
|
}
|
|
var o = Je({}),
|
|
r = function (e, t) {
|
|
var n = o.get(),
|
|
r = t(
|
|
n.hasOwnProperty(e)
|
|
? n[e]
|
|
: { listeners: [], previous: Je(k.none()) },
|
|
);
|
|
(n[e] = r), o.set(n);
|
|
},
|
|
t = (function (n, r) {
|
|
var o = null;
|
|
return {
|
|
cancel: function () {
|
|
null !== o && (j.clearTimeout(o), (o = null));
|
|
},
|
|
throttle: function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
e[t] = arguments[t];
|
|
null !== o && j.clearTimeout(o),
|
|
(o = j.setTimeout(function () {
|
|
n.apply(null, e), (o = null);
|
|
}, r));
|
|
},
|
|
};
|
|
})(function () {
|
|
var e = o.get(),
|
|
t = (function (e, t) {
|
|
var n = O.call(e, 0);
|
|
return n.sort(t), n;
|
|
})(Nt(e));
|
|
z(t, function (e) {
|
|
r(e, function (o) {
|
|
var i = o.previous.get();
|
|
return (
|
|
Ea(n, k.some(e)).fold(
|
|
function () {
|
|
i.isSome() &&
|
|
((function (t) {
|
|
a(t, function (e) {
|
|
z(e.listeners, function (e) {
|
|
return e(!1, t);
|
|
});
|
|
});
|
|
})(e),
|
|
o.previous.set(k.none()));
|
|
},
|
|
function (e) {
|
|
var t = e.uid,
|
|
n = e.name,
|
|
r = e.elements;
|
|
i.is(t) ||
|
|
((function (t, n, r) {
|
|
a(t, function (e) {
|
|
z(e.listeners, function (e) {
|
|
return e(!0, t, {
|
|
uid: n,
|
|
nodes: X(r, function (e) {
|
|
return e.dom();
|
|
}),
|
|
});
|
|
});
|
|
});
|
|
})(n, t, r),
|
|
o.previous.set(k.some(t)));
|
|
},
|
|
),
|
|
{ previous: o.previous, listeners: o.listeners }
|
|
);
|
|
});
|
|
});
|
|
}, 30);
|
|
return (
|
|
n.on("remove", function () {
|
|
t.cancel();
|
|
}),
|
|
n.on("NodeChange", function () {
|
|
t.throttle();
|
|
}),
|
|
{
|
|
addListener: function (e, t) {
|
|
r(e, function (e) {
|
|
return { previous: e.previous, listeners: e.listeners.concat([t]) };
|
|
});
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function Sa(e, n) {
|
|
e.on("init", function () {
|
|
e.serializer.addNodeFilter("span", function (e) {
|
|
z(e, function (t) {
|
|
(function (e) {
|
|
return k.from(e.attr(ou())).bind(n.lookup);
|
|
})(t).each(function (e) {
|
|
!1 === e.persistent && t.unwrap();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function ka(e, t) {
|
|
return bt.fromDom(e.dom().cloneNode(t));
|
|
}
|
|
function Ta(e) {
|
|
return ka(e, !1);
|
|
}
|
|
function Aa(e) {
|
|
return ka(e, !0);
|
|
}
|
|
function Ma(e, t) {
|
|
var n = Ee(e).dom(),
|
|
r = bt.fromDom(n.createDocumentFragment()),
|
|
o = (function (e, t) {
|
|
var n = (t || j.document).createElement("div");
|
|
return (n.innerHTML = e), Re(bt.fromDom(n));
|
|
})(t, n);
|
|
Ei(r, o), Ni(e), _i(e, r);
|
|
}
|
|
function Ra(e) {
|
|
return (
|
|
hu(e) && (e = e.parentNode), du(e) && e.hasAttribute("data-mce-caret")
|
|
);
|
|
}
|
|
function Da(e) {
|
|
return hu(e) && cu(e.data);
|
|
}
|
|
function _a(e) {
|
|
return Ra(e) || Da(e);
|
|
}
|
|
function Oa(e) {
|
|
return e.firstChild !== e.lastChild || !Ge.isBr(e.firstChild);
|
|
}
|
|
function Ba(e) {
|
|
var t = e.container();
|
|
return (
|
|
!(!e || !Ge.isText(t)) &&
|
|
(t.data.charAt(e.offset()) === lu ||
|
|
(e.isAtStart() && Da(t.previousSibling)))
|
|
);
|
|
}
|
|
function Ha(e) {
|
|
var t = e.container();
|
|
return (
|
|
!(!e || !Ge.isText(t)) &&
|
|
(t.data.charAt(e.offset() - 1) === lu ||
|
|
(e.isAtEnd() && Da(t.nextSibling)))
|
|
);
|
|
}
|
|
function Pa(e, t, n) {
|
|
var r, o;
|
|
return (
|
|
(r = t.ownerDocument.createElement(e)).setAttribute(
|
|
"data-mce-caret",
|
|
n ? "before" : "after",
|
|
),
|
|
r.setAttribute("data-mce-bogus", "all"),
|
|
r.appendChild(
|
|
(function () {
|
|
var e = j.document.createElement("br");
|
|
return e.setAttribute("data-mce-bogus", "1"), e;
|
|
})(),
|
|
),
|
|
(o = t.parentNode),
|
|
n
|
|
? o.insertBefore(r, t)
|
|
: t.nextSibling
|
|
? o.insertBefore(r, t.nextSibling)
|
|
: o.appendChild(r),
|
|
r
|
|
);
|
|
}
|
|
function La(e) {
|
|
return e && e.hasAttribute("data-mce-caret")
|
|
? ((function (e) {
|
|
var t = e.getElementsByTagName("br"),
|
|
n = t[t.length - 1];
|
|
Ge.isBogus(n) && n.parentNode.removeChild(n);
|
|
})(e),
|
|
e.removeAttribute("data-mce-caret"),
|
|
e.removeAttribute("data-mce-bogus"),
|
|
e.removeAttribute("style"),
|
|
e.removeAttribute("_moz_abspos"),
|
|
e)
|
|
: null;
|
|
}
|
|
function Va(e) {
|
|
return (
|
|
!zu(e) && (bu(e) ? !Cu(e.parentNode) : wu(e) || yu(e) || xu(e) || Eu(e))
|
|
);
|
|
}
|
|
function Ia(e, t) {
|
|
return (
|
|
Va(e) &&
|
|
(function (e, t) {
|
|
for (e = e.parentNode; e && e !== t; e = e.parentNode) {
|
|
if (Eu(e)) return !1;
|
|
if (pu(e)) return !0;
|
|
}
|
|
return !0;
|
|
})(e, t)
|
|
);
|
|
}
|
|
function Fa(e) {
|
|
return e
|
|
? {
|
|
left: Nu(e.left),
|
|
top: Nu(e.top),
|
|
bottom: Nu(e.bottom),
|
|
right: Nu(e.right),
|
|
width: Nu(e.width),
|
|
height: Nu(e.height),
|
|
}
|
|
: { left: 0, top: 0, bottom: 0, right: 0, width: 0, height: 0 };
|
|
}
|
|
function Ua(e, t) {
|
|
return (
|
|
(e = Fa(e)),
|
|
t || (e.left = e.left + e.width),
|
|
(e.right = e.left),
|
|
(e.width = 0),
|
|
e
|
|
);
|
|
}
|
|
function ja(e, t, n) {
|
|
return 0 <= e && e <= Math.min(t.height, n.height) / 2;
|
|
}
|
|
function qa(e, t) {
|
|
return (
|
|
e.bottom - e.height / 2 < t.top ||
|
|
(!(e.top > t.bottom) && ja(t.top - e.bottom, e, t))
|
|
);
|
|
}
|
|
function $a(e, t) {
|
|
return (
|
|
e.top > t.bottom || (!(e.bottom < t.top) && ja(t.bottom - e.top, e, t))
|
|
);
|
|
}
|
|
function Wa(e, t, n) {
|
|
return t >= e.left && t <= e.right && n >= e.top && n <= e.bottom;
|
|
}
|
|
function Ka(e) {
|
|
var t = e.startContainer,
|
|
n = e.startOffset;
|
|
return t.hasChildNodes() && e.endOffset === n + 1 ? t.childNodes[n] : null;
|
|
}
|
|
function Xa(e, t) {
|
|
return (
|
|
1 === e.nodeType &&
|
|
e.hasChildNodes() &&
|
|
(t >= e.childNodes.length && (t = e.childNodes.length - 1),
|
|
(e = e.childNodes[t])),
|
|
e
|
|
);
|
|
}
|
|
function Ya(e) {
|
|
return "string" == typeof e && 768 <= e.charCodeAt(0) && Su.test(e);
|
|
}
|
|
function Ga(e, t, n) {
|
|
return e.isSome() && t.isSome()
|
|
? k.some(n(e.getOrDie(), t.getOrDie()))
|
|
: k.none();
|
|
}
|
|
function Ja(e) {
|
|
return e && /[\r\n\t ]/.test(e);
|
|
}
|
|
function Qa(e) {
|
|
return !!e.setStart && !!e.setEnd;
|
|
}
|
|
function Za(e) {
|
|
var t,
|
|
n = e.startContainer,
|
|
r = e.startOffset;
|
|
return !!(
|
|
Ja(e.toString()) &&
|
|
Bu(n.parentNode) &&
|
|
Ge.isText(n) &&
|
|
((t = n.data), Ja(t[r - 1]) || Ja(t[r + 1]))
|
|
);
|
|
}
|
|
function eu(e) {
|
|
return 0 === e.left && 0 === e.right && 0 === e.top && 0 === e.bottom;
|
|
}
|
|
function tu(e, t) {
|
|
var n = Ua(e, t);
|
|
return (n.width = 1), (n.right = n.left + 1), n;
|
|
}
|
|
var nu,
|
|
ru = $("mce-annotation"),
|
|
ou = $("data-mce-annotation"),
|
|
iu = $("data-mce-annotation-uid"),
|
|
au = function (e, t) {
|
|
var n = bt.fromDom(e.getBody());
|
|
return ga(n, "[" + iu() + '="' + t + '"]');
|
|
},
|
|
uu = 0,
|
|
su = "\ufeff",
|
|
cu = function (e) {
|
|
return e === su;
|
|
},
|
|
lu = su,
|
|
fu = function (e) {
|
|
return e.replace(new RegExp(su, "g"), "");
|
|
},
|
|
du = Ge.isElement,
|
|
hu = Ge.isText,
|
|
mu = function (e) {
|
|
return hu(e) && e.data[0] === lu;
|
|
},
|
|
gu = function (e) {
|
|
return hu(e) && e.data[e.data.length - 1] === lu;
|
|
},
|
|
pu = Ge.isContentEditableTrue,
|
|
vu = Ge.isContentEditableFalse,
|
|
yu = Ge.isBr,
|
|
bu = Ge.isText,
|
|
Cu = Ge.matchNodeNames(["script", "style", "textarea"]),
|
|
wu = Ge.matchNodeNames([
|
|
"img",
|
|
"input",
|
|
"textarea",
|
|
"hr",
|
|
"iframe",
|
|
"video",
|
|
"audio",
|
|
"object",
|
|
]),
|
|
xu = Ge.matchNodeNames(["table"]),
|
|
zu = _a,
|
|
Eu = function (e) {
|
|
return (
|
|
!1 ===
|
|
(function (e) {
|
|
return Ge.isElement(e) && "true" === e.getAttribute("unselectable");
|
|
})(e) && vu(e)
|
|
);
|
|
},
|
|
Nu = Math.round,
|
|
Su = 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]",
|
|
),
|
|
ku = [].slice,
|
|
Tu = function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
var n = ku.call(arguments);
|
|
return function (e) {
|
|
for (var t = 0; t < n.length; t++) if (!n[t](e)) return !1;
|
|
return !0;
|
|
};
|
|
},
|
|
Au = function () {
|
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
var n = ku.call(arguments);
|
|
return function (e) {
|
|
for (var t = 0; t < n.length; t++) if (n[t](e)) return !0;
|
|
return !1;
|
|
};
|
|
},
|
|
Mu = Ge.isElement,
|
|
Ru = Va,
|
|
Du = Ge.matchStyleValues("display", "block table"),
|
|
_u = Ge.matchStyleValues("float", "left right"),
|
|
Ou = Tu(Mu, Ru, s(_u)),
|
|
Bu = s(Ge.matchStyleValues("white-space", "pre pre-line pre-wrap")),
|
|
Hu = Ge.isText,
|
|
Pu = Ge.isBr,
|
|
Lu = Yi.nodeIndex,
|
|
Vu = Xa,
|
|
Iu = function (e) {
|
|
return "createRange" in e ? e.createRange() : Yi.DOM.createRng();
|
|
},
|
|
Fu = function (e) {
|
|
var t, n;
|
|
return (
|
|
(t =
|
|
0 < (n = e.getClientRects()).length
|
|
? Fa(n[0])
|
|
: Fa(e.getBoundingClientRect())),
|
|
!Qa(e) && Pu(e) && eu(t)
|
|
? (function (e) {
|
|
var t,
|
|
n = e.ownerDocument,
|
|
r = Iu(n),
|
|
o = n.createTextNode("\xa0"),
|
|
i = e.parentNode;
|
|
return (
|
|
i.insertBefore(o, e),
|
|
r.setStart(o, 0),
|
|
r.setEnd(o, 1),
|
|
(t = Fa(r.getBoundingClientRect())),
|
|
i.removeChild(o),
|
|
t
|
|
);
|
|
})(e)
|
|
: eu(t) && Qa(e)
|
|
? (function (e) {
|
|
var t = e.startContainer,
|
|
n = e.endContainer,
|
|
r = e.startOffset,
|
|
o = e.endOffset;
|
|
if (t === n && Ge.isText(n) && 0 === r && 1 === o) {
|
|
var i = e.cloneRange();
|
|
return i.setEndAfter(n), Fu(i);
|
|
}
|
|
return null;
|
|
})(e)
|
|
: t
|
|
);
|
|
},
|
|
Uu = function (e) {
|
|
function r(e) {
|
|
0 !== e.height &&
|
|
((0 < i.length &&
|
|
(function (e, t) {
|
|
return (
|
|
e.left === t.left &&
|
|
e.top === t.top &&
|
|
e.bottom === t.bottom &&
|
|
e.right === t.right
|
|
);
|
|
})(e, i[i.length - 1])) ||
|
|
i.push(e));
|
|
}
|
|
function t(e, t) {
|
|
var n = Iu(e.ownerDocument);
|
|
if (t < e.data.length) {
|
|
if (Ya(e.data[t])) return i;
|
|
if (
|
|
Ya(e.data[t - 1]) &&
|
|
(n.setStart(e, t), n.setEnd(e, t + 1), !Za(n))
|
|
)
|
|
return r(tu(Fu(n), !1)), i;
|
|
}
|
|
0 < t &&
|
|
(n.setStart(e, t - 1), n.setEnd(e, t), Za(n) || r(tu(Fu(n), !1))),
|
|
t < e.data.length &&
|
|
(n.setStart(e, t), n.setEnd(e, t + 1), Za(n) || r(tu(Fu(n), !0)));
|
|
}
|
|
var n,
|
|
o,
|
|
i = [];
|
|
if (Hu(e.container())) return t(e.container(), e.offset()), i;
|
|
if (Mu(e.container()))
|
|
if (e.isAtEnd())
|
|
(o = Vu(e.container(), e.offset())),
|
|
Hu(o) && t(o, o.data.length),
|
|
Ou(o) && !Pu(o) && r(tu(Fu(o), !1));
|
|
else {
|
|
if (
|
|
((o = Vu(e.container(), e.offset())),
|
|
Hu(o) && t(o, 0),
|
|
Ou(o) && e.isAtEnd())
|
|
)
|
|
return r(tu(Fu(o), !1)), i;
|
|
(n = Vu(e.container(), e.offset() - 1)),
|
|
Ou(n) &&
|
|
!Pu(n) &&
|
|
((!Du(n) && !Du(o) && Ou(o)) || r(tu(Fu(n), !1))),
|
|
Ou(o) && r(tu(Fu(o), !0));
|
|
}
|
|
return i;
|
|
};
|
|
function ju(t, n, e) {
|
|
function r() {
|
|
return (e = e || Uu(ju(t, n)));
|
|
}
|
|
return {
|
|
container: $(t),
|
|
offset: $(n),
|
|
toRange: function () {
|
|
var e;
|
|
return (e = Iu(t.ownerDocument)).setStart(t, n), e.setEnd(t, n), e;
|
|
},
|
|
getClientRects: r,
|
|
isVisible: function () {
|
|
return 0 < r().length;
|
|
},
|
|
isAtStart: function () {
|
|
return Hu(t), 0 === n;
|
|
},
|
|
isAtEnd: function () {
|
|
return Hu(t) ? n >= t.data.length : n >= t.childNodes.length;
|
|
},
|
|
isEqual: function (e) {
|
|
return e && t === e.container() && n === e.offset();
|
|
},
|
|
getNode: function (e) {
|
|
return Vu(t, e ? n - 1 : n);
|
|
},
|
|
};
|
|
}
|
|
((nu = ju = ju || {}).fromRangeStart = function (e) {
|
|
return nu(e.startContainer, e.startOffset);
|
|
}),
|
|
(nu.fromRangeEnd = function (e) {
|
|
return nu(e.endContainer, e.endOffset);
|
|
}),
|
|
(nu.after = function (e) {
|
|
return nu(e.parentNode, Lu(e) + 1);
|
|
}),
|
|
(nu.before = function (e) {
|
|
return nu(e.parentNode, Lu(e));
|
|
}),
|
|
(nu.isAbove = function (e, t) {
|
|
return Ga(E(t.getClientRects()), N(e.getClientRects()), qa).getOr(!1);
|
|
}),
|
|
(nu.isBelow = function (e, t) {
|
|
return Ga(N(t.getClientRects()), E(e.getClientRects()), $a).getOr(!1);
|
|
}),
|
|
(nu.isAtStart = function (e) {
|
|
return !!e && e.isAtStart();
|
|
}),
|
|
(nu.isAtEnd = function (e) {
|
|
return !!e && e.isAtEnd();
|
|
}),
|
|
(nu.isTextPosition = function (e) {
|
|
return !!e && Ge.isText(e.container());
|
|
}),
|
|
(nu.isElementPosition = function (e) {
|
|
return !1 === nu.isTextPosition(e);
|
|
});
|
|
function qu(t) {
|
|
return function (e) {
|
|
return t === e;
|
|
};
|
|
}
|
|
function $u(e) {
|
|
return (
|
|
(Os(e) ? "text()" : e.nodeName.toLowerCase()) +
|
|
"[" +
|
|
(function (e) {
|
|
var r, t, n;
|
|
return (
|
|
(r = Ls(Ps(e))),
|
|
(t = Tn.findIndex(r, qu(e), e)),
|
|
(r = r.slice(0, t + 1)),
|
|
(n = Tn.reduce(
|
|
r,
|
|
function (e, t, n) {
|
|
return Os(t) && Os(r[n - 1]) && e++, e;
|
|
},
|
|
0,
|
|
)),
|
|
(r = Tn.filter(r, Ge.matchNodeNames([e.nodeName]))),
|
|
(t = Tn.findIndex(r, qu(e), e)) - n
|
|
);
|
|
})(e) +
|
|
"]"
|
|
);
|
|
}
|
|
function Wu(e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = [];
|
|
return (
|
|
(n = t.container()),
|
|
(r = t.offset()),
|
|
Os(n)
|
|
? (o = (function (e, t) {
|
|
for (; (e = e.previousSibling) && Os(e); ) t += e.data.length;
|
|
return t;
|
|
})(n, r))
|
|
: (r >= (i = n.childNodes).length
|
|
? ((o = "after"), (r = i.length - 1))
|
|
: (o = "before"),
|
|
(n = i[r])),
|
|
u.push($u(n)),
|
|
(a = (function (e, t, n) {
|
|
var r = [];
|
|
for (t = t.parentNode; t !== e && (!n || !n(t)); t = t.parentNode)
|
|
r.push(t);
|
|
return r;
|
|
})(e, n)),
|
|
(a = Tn.filter(a, s(Ge.isBogus))),
|
|
(u = u.concat(
|
|
Tn.map(a, function (e) {
|
|
return $u(e);
|
|
}),
|
|
))
|
|
.reverse()
|
|
.join("/") +
|
|
"," +
|
|
o
|
|
);
|
|
}
|
|
function Ku(e, t) {
|
|
var n, r, o;
|
|
return t
|
|
? ((t = (n = t.split(","))[0].split("/")),
|
|
(o = 1 < n.length ? n[1] : "before"),
|
|
(r = Tn.reduce(
|
|
t,
|
|
function (e, t) {
|
|
return (t = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))
|
|
? ("text()" === t[1] && (t[1] = "#text"),
|
|
(function (e, t, n) {
|
|
var r = Ls(e);
|
|
return (
|
|
(r = Tn.filter(r, function (e, t) {
|
|
return !Os(e) || !Os(r[t - 1]);
|
|
})),
|
|
(r = Tn.filter(r, Ge.matchNodeNames([t])))[n]
|
|
);
|
|
})(e, t[1], parseInt(t[2], 10)))
|
|
: null;
|
|
},
|
|
e,
|
|
))
|
|
? Os(r)
|
|
? (function (e, t) {
|
|
for (var n, r = e, o = 0; Os(r); ) {
|
|
if (((n = r.data.length), o <= t && t <= o + n)) {
|
|
(e = r), (t -= o);
|
|
break;
|
|
}
|
|
if (!Os(r.nextSibling)) {
|
|
(e = r), (t = n);
|
|
break;
|
|
}
|
|
(o += n), (r = r.nextSibling);
|
|
}
|
|
return (
|
|
Os(e) && t > e.data.length && (t = e.data.length), _s(e, t)
|
|
);
|
|
})(r, parseInt(o, 10))
|
|
: ((o = "after" === o ? Hs(r) + 1 : Hs(r)), _s(r.parentNode, o))
|
|
: null)
|
|
: null;
|
|
}
|
|
function Xu(e, t) {
|
|
Ge.isText(t) && 0 === t.data.length && e.remove(t);
|
|
}
|
|
function Yu(e, t, n) {
|
|
Ge.isDocumentFragment(n)
|
|
? (function (t, e, n) {
|
|
var r = k.from(n.firstChild),
|
|
o = k.from(n.lastChild);
|
|
e.insertNode(n),
|
|
r.each(function (e) {
|
|
return Xu(t, e.previousSibling);
|
|
}),
|
|
o.each(function (e) {
|
|
return Xu(t, e.nextSibling);
|
|
});
|
|
})(e, t, n)
|
|
: (function (e, t, n) {
|
|
t.insertNode(n), Xu(e, n.previousSibling), Xu(e, n.nextSibling);
|
|
})(e, t, n);
|
|
}
|
|
function Gu(e, t, n, r, o) {
|
|
var i,
|
|
a = r[o ? "startContainer" : "endContainer"],
|
|
u = r[o ? "startOffset" : "endOffset"],
|
|
s = [],
|
|
c = 0,
|
|
l = e.getRoot();
|
|
for (
|
|
Ge.isText(a)
|
|
? s.push(
|
|
n
|
|
? (function (e, t, n) {
|
|
var r, o;
|
|
for (
|
|
o = e(t.data.slice(0, n)).length, r = t.previousSibling;
|
|
r && Ge.isText(r);
|
|
r = r.previousSibling
|
|
)
|
|
o += e(r.data).length;
|
|
return o;
|
|
})(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 Ju(e, t, n) {
|
|
var r = 0;
|
|
return (
|
|
Rn.each(e.select(t), function (e) {
|
|
if ("all" !== e.getAttribute("data-mce-bogus"))
|
|
return e !== n && void r++;
|
|
}),
|
|
r
|
|
);
|
|
}
|
|
function Qu(e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i = t ? "start" : "end";
|
|
(n = e[i + "Container"]),
|
|
(r = e[i + "Offset"]),
|
|
Ge.isElement(n) &&
|
|
"TR" === n.nodeName &&
|
|
(n = (o = n.childNodes)[Math.min(t ? r : r - 1, o.length - 1)]) &&
|
|
((r = t ? 0 : n.childNodes.length),
|
|
e["set" + (t ? "Start" : "End")](n, r));
|
|
}
|
|
function Zu(e) {
|
|
return Qu(e, !0), Qu(e, !1), e;
|
|
}
|
|
function es(e, t) {
|
|
var n;
|
|
if (Ge.isElement(e) && ((e = Xa(e, t)), Vs(e))) return e;
|
|
if (_a(e)) {
|
|
if (
|
|
(Ge.isText(e) && Ra(e) && (e = e.parentNode),
|
|
(n = e.previousSibling),
|
|
Vs(n))
|
|
)
|
|
return n;
|
|
if (((n = e.nextSibling), Vs(n))) return n;
|
|
}
|
|
}
|
|
function ts(e, t, n) {
|
|
var r = n.getNode(),
|
|
o = r ? r.nodeName : null,
|
|
i = n.getRng();
|
|
if (Vs(r) || "IMG" === o) return { name: o, index: Ju(n.dom, o, r) };
|
|
var a = (function (e) {
|
|
return (
|
|
es(e.startContainer, e.startOffset) || es(e.endContainer, e.endOffset)
|
|
);
|
|
})(i);
|
|
return a
|
|
? { name: (o = a.tagName), index: Ju(n.dom, o, a) }
|
|
: (function (e, t, n, r) {
|
|
var o = t.dom,
|
|
i = {};
|
|
return (
|
|
(i.start = Gu(o, e, n, r, !0)),
|
|
t.isCollapsed() || (i.end = Gu(o, e, n, r, !1)),
|
|
i
|
|
);
|
|
})(e, n, t, i);
|
|
}
|
|
function ns(e, t, n) {
|
|
var r = {
|
|
"data-mce-type": "bookmark",
|
|
id: t,
|
|
style: "overflow:hidden;line-height:0px",
|
|
};
|
|
return n ? e.create("span", r, "") : e.create("span", r);
|
|
}
|
|
function rs(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: Ju(n, u, a) };
|
|
var s = Zu(r.cloneRange());
|
|
if (!i) {
|
|
s.collapse(!1);
|
|
var c = ns(n, o + "_end", t);
|
|
Yu(n, s, c);
|
|
}
|
|
(r = Zu(r)).collapse(!0);
|
|
var l = ns(n, o + "_start", t);
|
|
return Yu(n, r, l), e.moveToBookmark({ id: o, keep: 1 }), { id: o };
|
|
}
|
|
function os(e) {
|
|
return Ge.isElement(e) && e.id === Fs;
|
|
}
|
|
function is(e, t) {
|
|
for (; t && t !== e; ) {
|
|
if (t.id === Fs) return t;
|
|
t = t.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function as(e) {
|
|
var t = e.parentNode;
|
|
t && t.removeChild(e);
|
|
}
|
|
function us(e, t) {
|
|
0 === t.length ? as(e) : (e.nodeValue = t);
|
|
}
|
|
function ss(e) {
|
|
var t = fu(e);
|
|
return { count: e.length - t.length, text: t };
|
|
}
|
|
function cs(e, t) {
|
|
return qs(e), t;
|
|
}
|
|
function ls(e, t) {
|
|
var n = t.container(),
|
|
r = (function (e, t) {
|
|
var n = f(e, t);
|
|
return -1 === n ? k.none() : k.some(n);
|
|
})(P(n.childNodes), e)
|
|
.map(function (e) {
|
|
return e < t.offset() ? _s(n, t.offset() - 1) : t;
|
|
})
|
|
.getOr(t);
|
|
return qs(e), r;
|
|
}
|
|
function fs(e, t) {
|
|
return js(e) && t.container() === e
|
|
? (function (e, t) {
|
|
var n = ss(e.data.substr(0, t.offset())),
|
|
r = ss(e.data.substr(t.offset())),
|
|
o = n.text + r.text;
|
|
return 0 < o.length ? (us(e, o), _s(e, t.offset() - n.count)) : t;
|
|
})(e, t)
|
|
: cs(e, t);
|
|
}
|
|
function ds(e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s = Ua(t.getBoundingClientRect(), n);
|
|
return (
|
|
(i =
|
|
"BODY" === e.tagName
|
|
? ((r = e.ownerDocument.documentElement),
|
|
(o = e.scrollLeft || r.scrollLeft),
|
|
e.scrollTop || r.scrollTop)
|
|
: ((u = e.getBoundingClientRect()),
|
|
(o = e.scrollLeft - u.left),
|
|
e.scrollTop - u.top)),
|
|
(s.left += o),
|
|
(s.right += o),
|
|
(s.top += i),
|
|
(s.bottom += i),
|
|
(s.width = 1),
|
|
0 < (a = t.offsetWidth - t.clientWidth) &&
|
|
(n && (a *= -1), (s.left += a), (s.right += a)),
|
|
s
|
|
);
|
|
}
|
|
function hs(i, a, e) {
|
|
var t,
|
|
u,
|
|
s = Je(k.none()),
|
|
c = function () {
|
|
!(function (e) {
|
|
var t, n, r, o, i;
|
|
for (t = yi("*[contentEditable=false]", e), o = 0; o < t.length; o++)
|
|
(r = (n = t[o]).previousSibling),
|
|
gu(r) &&
|
|
(1 === (i = r.data).length
|
|
? r.parentNode.removeChild(r)
|
|
: r.deleteData(i.length - 1, 1)),
|
|
(r = n.nextSibling),
|
|
mu(r) &&
|
|
(1 === (i = r.data).length
|
|
? r.parentNode.removeChild(r)
|
|
: r.deleteData(0, 1));
|
|
})(i),
|
|
u && ($s.remove(u), (u = null)),
|
|
s.get().each(function (e) {
|
|
yi(e.caret).remove(), s.set(k.none());
|
|
}),
|
|
vn.clearInterval(t);
|
|
},
|
|
l = function () {
|
|
t = vn.setInterval(function () {
|
|
e()
|
|
? yi("div.mce-visual-caret", i).toggleClass(
|
|
"mce-visual-caret-hidden",
|
|
)
|
|
: yi("div.mce-visual-caret", i).addClass("mce-visual-caret-hidden");
|
|
}, 500);
|
|
};
|
|
return {
|
|
show: function (t, e) {
|
|
var n, r;
|
|
if (
|
|
(c(),
|
|
(function (e) {
|
|
return Ge.isElement(e) && /^(TD|TH)$/i.test(e.tagName);
|
|
})(e))
|
|
)
|
|
return null;
|
|
if (!a(e))
|
|
return (
|
|
(u = (function (e, t) {
|
|
var n, r, o;
|
|
if (
|
|
((r = e.ownerDocument.createTextNode(lu)),
|
|
(o = e.parentNode),
|
|
t)
|
|
) {
|
|
if (((n = e.previousSibling), hu(n))) {
|
|
if (_a(n)) return n;
|
|
if (gu(n)) return n.splitText(n.data.length - 1);
|
|
}
|
|
o.insertBefore(r, e);
|
|
} else {
|
|
if (((n = e.nextSibling), hu(n))) {
|
|
if (_a(n)) return n;
|
|
if (mu(n)) return n.splitText(1), n;
|
|
}
|
|
e.nextSibling
|
|
? o.insertBefore(r, e.nextSibling)
|
|
: o.appendChild(r);
|
|
}
|
|
return r;
|
|
})(e, t)),
|
|
(r = e.ownerDocument.createRange()),
|
|
Ks(u.nextSibling)
|
|
? (r.setStart(u, 0), r.setEnd(u, 0))
|
|
: (r.setStart(u, 1), r.setEnd(u, 1)),
|
|
r
|
|
);
|
|
(u = Pa("p", e, t)), (n = ds(i, e, t)), yi(u).css("top", n.top);
|
|
var o = yi('<div class="mce-visual-caret" data-mce-bogus="all"></div>')
|
|
.css(n)
|
|
.appendTo(i)[0];
|
|
return (
|
|
s.set(k.some({ caret: o, element: e, before: t })),
|
|
s.get().each(function (e) {
|
|
t && yi(e.caret).addClass("mce-visual-caret-before");
|
|
}),
|
|
l(),
|
|
(r = e.ownerDocument.createRange()).setStart(u, 0),
|
|
r.setEnd(u, 0),
|
|
r
|
|
);
|
|
},
|
|
hide: c,
|
|
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 () {
|
|
s.get().each(function (e) {
|
|
var t = ds(i, e.element, e.before);
|
|
yi(e.caret).css(G({}, t));
|
|
});
|
|
},
|
|
destroy: function () {
|
|
return vn.clearInterval(t);
|
|
},
|
|
};
|
|
}
|
|
function ms() {
|
|
return Ws.isIE() || Ws.isEdge() || Ws.isFirefox();
|
|
}
|
|
function gs(e) {
|
|
return Ks(e) || (Ge.isTable(e) && ms());
|
|
}
|
|
function ps(e) {
|
|
return 0 < e;
|
|
}
|
|
function vs(e) {
|
|
return e < 0;
|
|
}
|
|
function ys(e, t) {
|
|
for (var n; (n = e(t)); ) if (!Js(n)) return n;
|
|
return null;
|
|
}
|
|
function bs(e, t, n, r, o) {
|
|
var i = new bi(e, r);
|
|
if (vs(t)) {
|
|
if ((Xs(e) || Js(e)) && n((e = ys(i.prev, !0)))) return e;
|
|
for (; (e = ys(i.prev, o)); ) if (n(e)) return e;
|
|
}
|
|
if (ps(t)) {
|
|
if ((Xs(e) || Js(e)) && n((e = ys(i.next, !0)))) return e;
|
|
for (; (e = ys(i.next, o)); ) if (n(e)) return e;
|
|
}
|
|
return null;
|
|
}
|
|
function Cs(e, t) {
|
|
for (; e && e !== t; ) {
|
|
if (Ys(e)) return e;
|
|
e = e.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function ws(e, t, n) {
|
|
return Cs(e.container(), n) === Cs(t.container(), n);
|
|
}
|
|
function xs(e, t) {
|
|
var n, r;
|
|
return t
|
|
? ((n = t.container()),
|
|
(r = t.offset()),
|
|
Qs(n) ? n.childNodes[r + e] : null)
|
|
: 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 Es(e, t, n) {
|
|
var r, o, i, a;
|
|
for (o = e ? "previousSibling" : "nextSibling"; n && n !== t; ) {
|
|
if (((r = n[o]), Gs(r) && (r = r[o]), Xs(r))) {
|
|
if (((a = n), Cs(r, (i = t)) === Cs(a, i))) return r;
|
|
break;
|
|
}
|
|
if (Zs(r)) break;
|
|
n = n.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function Ns(e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = d(Es, !0, t),
|
|
s = d(Es, !1, t);
|
|
if (((o = n.startContainer), (i = n.startOffset), Ra(o))) {
|
|
if (
|
|
(Qs(o) || (o = o.parentNode),
|
|
"before" === (a = o.getAttribute("data-mce-caret")) &&
|
|
((r = o.nextSibling), gs(r)))
|
|
)
|
|
return ec(r);
|
|
if ("after" === a && ((r = o.previousSibling), gs(r))) return tc(r);
|
|
}
|
|
if (!n.collapsed) return n;
|
|
if (Ge.isText(o)) {
|
|
if (Gs(o)) {
|
|
if (1 === e) {
|
|
if ((r = s(o))) return ec(r);
|
|
if ((r = u(o))) return tc(r);
|
|
}
|
|
if (-1 === e) {
|
|
if ((r = u(o))) return tc(r);
|
|
if ((r = s(o))) return ec(r);
|
|
}
|
|
return n;
|
|
}
|
|
if (gu(o) && i >= o.data.length - 1)
|
|
return 1 === e && (r = s(o)) ? ec(r) : n;
|
|
if (mu(o) && i <= 1) return -1 === e && (r = u(o)) ? tc(r) : n;
|
|
if (i === o.data.length) return (r = s(o)) ? ec(r) : n;
|
|
if (0 === i) return (r = u(o)) ? tc(r) : n;
|
|
}
|
|
return n;
|
|
}
|
|
function Ss(e, t) {
|
|
return k.from(xs(e ? 0 : -1, t)).filter(Xs);
|
|
}
|
|
function ks(e, t, n) {
|
|
var r = Ns(e, t, n);
|
|
return -1 === e ? ju.fromRangeStart(r) : ju.fromRangeEnd(r);
|
|
}
|
|
function Ts(e) {
|
|
return k.from(e.getNode()).map(bt.fromDom);
|
|
}
|
|
function As(e, t) {
|
|
for (; (t = e(t)); ) if (t.isVisible()) return t;
|
|
return t;
|
|
}
|
|
function Ms(e, t) {
|
|
var n = ws(e, t);
|
|
return !(n || !Ge.isBr(e.getNode())) || n;
|
|
}
|
|
var Rs,
|
|
Ds,
|
|
_s = ju,
|
|
Os = Ge.isText,
|
|
Bs = Ge.isBogus,
|
|
Hs = Yi.nodeIndex,
|
|
Ps = function (e) {
|
|
var t = e.parentNode;
|
|
return Bs(t) ? Ps(t) : t;
|
|
},
|
|
Ls = function (e) {
|
|
return e
|
|
? Tn.reduce(
|
|
e.childNodes,
|
|
function (e, t) {
|
|
return (
|
|
Bs(t) && "BR" !== t.nodeName
|
|
? (e = e.concat(Ls(t)))
|
|
: e.push(t),
|
|
e
|
|
);
|
|
},
|
|
[],
|
|
)
|
|
: [];
|
|
},
|
|
Vs = Ge.isContentEditableFalse,
|
|
Is = {
|
|
getBookmark: function (e, t, n) {
|
|
return 2 === t
|
|
? ts(fu, n, e)
|
|
: 3 === t
|
|
? (function (e) {
|
|
var t = e.getRng();
|
|
return {
|
|
start: Wu(e.dom.getRoot(), _s.fromRangeStart(t)),
|
|
end: Wu(e.dom.getRoot(), _s.fromRangeEnd(t)),
|
|
};
|
|
})(e)
|
|
: t
|
|
? (function (e) {
|
|
return { rng: e.getRng() };
|
|
})(e)
|
|
: rs(e, !1);
|
|
},
|
|
getUndoBookmark: d(ts, W, !0),
|
|
getPersistentBookmark: rs,
|
|
},
|
|
Fs = "_mce_caret",
|
|
Us = Ge.isElement,
|
|
js = Ge.isText,
|
|
qs = function (e) {
|
|
if (
|
|
(Us(e) &&
|
|
_a(e) &&
|
|
(Oa(e) ? e.removeAttribute("data-mce-caret") : as(e)),
|
|
js(e))
|
|
) {
|
|
var t = fu(
|
|
(function (e) {
|
|
try {
|
|
return e.nodeValue;
|
|
} catch (t) {
|
|
return "";
|
|
}
|
|
})(e),
|
|
);
|
|
us(e, t);
|
|
}
|
|
},
|
|
$s = {
|
|
removeAndReposition: function (e, t) {
|
|
return _s.isTextPosition(t)
|
|
? fs(e, t)
|
|
: (function (e, t) {
|
|
return t.container() === e.parentNode ? ls(e, t) : cs(e, t);
|
|
})(e, t);
|
|
},
|
|
remove: qs,
|
|
},
|
|
Ws = oe().browser,
|
|
Ks = Ge.isContentEditableFalse,
|
|
Xs = Ge.isContentEditableFalse,
|
|
Ys = Ge.matchStyleValues(
|
|
"display",
|
|
"block table table-cell table-caption list-item",
|
|
),
|
|
Gs = _a,
|
|
Js = Ra,
|
|
Qs = Ge.isElement,
|
|
Zs = Va,
|
|
ec = d(zs, !0),
|
|
tc = d(zs, !1);
|
|
((Ds = Rs = Rs || {})[(Ds.Backwards = -1)] = "Backwards"),
|
|
(Ds[(Ds.Forwards = 1)] = "Forwards");
|
|
function nc(e, t) {
|
|
return e.hasChildNodes() && t < e.childNodes.length
|
|
? e.childNodes[t]
|
|
: null;
|
|
}
|
|
function rc(e, t) {
|
|
if (ps(e)) {
|
|
if (Mc(t.previousSibling) && !kc(t.previousSibling)) return _s.before(t);
|
|
if (kc(t)) return _s(t, 0);
|
|
}
|
|
if (vs(e)) {
|
|
if (Mc(t.nextSibling) && !kc(t.nextSibling)) return _s.after(t);
|
|
if (kc(t)) return _s(t, t.data.length);
|
|
}
|
|
return vs(e) ? (Ac(t) ? _s.before(t) : _s.after(t)) : _s.before(t);
|
|
}
|
|
function oc(t) {
|
|
return {
|
|
next: function (e) {
|
|
return _c(Rs.Forwards, e, t);
|
|
},
|
|
prev: function (e) {
|
|
return _c(Rs.Backwards, e, t);
|
|
},
|
|
};
|
|
}
|
|
function ic(e) {
|
|
return _s.isTextPosition(e) ? 0 === e.offset() : Va(e.getNode());
|
|
}
|
|
function ac(e) {
|
|
if (_s.isTextPosition(e)) {
|
|
var t = e.container();
|
|
return e.offset() === t.data.length;
|
|
}
|
|
return Va(e.getNode(!0));
|
|
}
|
|
function uc(e, t) {
|
|
return (
|
|
!_s.isTextPosition(e) &&
|
|
!_s.isTextPosition(t) &&
|
|
e.getNode() === t.getNode(!0)
|
|
);
|
|
}
|
|
function sc(e, t, n) {
|
|
return e
|
|
? !uc(t, n) &&
|
|
!(function (e) {
|
|
return !_s.isTextPosition(e) && Ge.isBr(e.getNode());
|
|
})(t) &&
|
|
ac(t) &&
|
|
ic(n)
|
|
: !uc(n, t) && ic(t) && ac(n);
|
|
}
|
|
function cc(t, n, r) {
|
|
return Oc(t, n, r).bind(function (e) {
|
|
return ws(r, e, n) && sc(t, r, e) ? Oc(t, n, e) : k.some(e);
|
|
});
|
|
}
|
|
function lc(e, t) {
|
|
var n = e ? t.firstChild : t.lastChild;
|
|
return Ge.isText(n)
|
|
? k.some(_s(n, e ? 0 : n.data.length))
|
|
: n
|
|
? Va(n)
|
|
? k.some(
|
|
e
|
|
? _s.before(n)
|
|
: (function (e) {
|
|
return Ge.isBr(e) ? _s.before(e) : _s.after(e);
|
|
})(n),
|
|
)
|
|
: (function (e, t, n) {
|
|
var r = e ? _s.before(n) : _s.after(n);
|
|
return Oc(e, t, r);
|
|
})(e, t, n)
|
|
: k.none();
|
|
}
|
|
function fc(e, t) {
|
|
return (
|
|
Ge.isElement(t) &&
|
|
e.isBlock(t) &&
|
|
!t.innerHTML &&
|
|
!Sn.ie &&
|
|
(t.innerHTML = '<br data-mce-bogus="1" />'),
|
|
t
|
|
);
|
|
}
|
|
function dc(e, t) {
|
|
return Lc.lastPositionIn(e).fold(
|
|
function () {
|
|
return !1;
|
|
},
|
|
function (e) {
|
|
return (
|
|
t.setStart(e.container(), e.offset()),
|
|
t.setEnd(e.container(), e.offset()),
|
|
!0
|
|
);
|
|
},
|
|
);
|
|
}
|
|
function hc(e, t, n) {
|
|
return (
|
|
!(
|
|
!(function (e) {
|
|
return !1 === e.hasChildNodes();
|
|
})(t) || !is(e, t)
|
|
) &&
|
|
((function (e, t) {
|
|
var n = e.ownerDocument.createTextNode(lu);
|
|
e.appendChild(n), t.setStart(n, 0), t.setEnd(n, 0);
|
|
})(t, n),
|
|
!0)
|
|
);
|
|
}
|
|
function mc(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), hc(c, i, r))) return !0;
|
|
if (s[o] > u.length - 1) return !!hc(c, i, r) || dc(i, 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 !0;
|
|
}
|
|
function gc(e) {
|
|
return Ge.isText(e) && 0 < e.data.length;
|
|
}
|
|
function pc(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),
|
|
(s =
|
|
((u =
|
|
((o =
|
|
"start" === t
|
|
? l
|
|
? c.hasChildNodes()
|
|
? ((r = c.firstChild), 1)
|
|
: gc(c.nextSibling)
|
|
? ((r = c.nextSibling), 0)
|
|
: gc(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)
|
|
: gc(c.previousSibling)
|
|
? ((r = c.previousSibling), c.previousSibling.data.length)
|
|
: ((r = c.parentNode), e.nodeIndex(c))
|
|
: e.nodeIndex(c)),
|
|
r)),
|
|
o)),
|
|
!l)
|
|
) {
|
|
for (
|
|
a = c.previousSibling,
|
|
i = c.nextSibling,
|
|
Rn.each(Rn.grep(c.childNodes), function (e) {
|
|
Ge.isText(e) &&
|
|
(e.nodeValue = e.nodeValue.replace(/\uFEFF/g, ""));
|
|
});
|
|
(c = e.get(n.id + "_" + t));
|
|
|
|
)
|
|
e.remove(c, !0);
|
|
a &&
|
|
i &&
|
|
a.nodeType === i.nodeType &&
|
|
Ge.isText(a) &&
|
|
!Sn.opera &&
|
|
((o = a.nodeValue.length),
|
|
a.appendData(i.nodeValue),
|
|
e.remove(i),
|
|
(s = ((u = a), o)));
|
|
}
|
|
return k.some(_s(u, s));
|
|
}
|
|
return k.none();
|
|
}
|
|
function vc(e) {
|
|
return e && /^(IMG)$/.test(e.nodeName);
|
|
}
|
|
function yc(e, t, n) {
|
|
return (
|
|
("color" !== n && "backgroundColor" !== n) || (t = e.toHex(t)),
|
|
"fontWeight" === n && 700 === t && (t = "bold"),
|
|
"fontFamily" === n &&
|
|
(t = t.replace(/[\'\"]/g, "").replace(/,\s+/g, ",")),
|
|
"" + t
|
|
);
|
|
}
|
|
function bc(e, t) {
|
|
for (
|
|
void 0 === t && (t = 3 === e.nodeType ? e.length : e.childNodes.length);
|
|
e && e.hasChildNodes();
|
|
|
|
)
|
|
(e = e.childNodes[t]) &&
|
|
(t = 3 === e.nodeType ? e.length : e.childNodes.length);
|
|
return { node: e, offset: t };
|
|
}
|
|
function Cc(e, t) {
|
|
for (var n = t; n; ) {
|
|
if (1 === n.nodeType && e.getContentEditable(n))
|
|
return "false" === e.getContentEditable(n) ? n : t;
|
|
n = n.parentNode;
|
|
}
|
|
return t;
|
|
}
|
|
function wc(e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a = n.nodeValue;
|
|
return (
|
|
void 0 === r && (r = e ? a.length : 0),
|
|
e
|
|
? ((o = a.lastIndexOf(" ", r)),
|
|
-1 !== (o = (i = a.lastIndexOf("\xa0", r)) < o ? o : i) &&
|
|
!t &&
|
|
(o < r || !e) &&
|
|
o <= a.length &&
|
|
o++)
|
|
: ((o = a.indexOf(" ", r)),
|
|
(i = a.indexOf("\xa0", r)),
|
|
(o = -1 !== o && (-1 === i || o < i) ? o : i)),
|
|
o
|
|
);
|
|
}
|
|
function xc(e, t, n, r, o, i) {
|
|
var a, u, s;
|
|
if (3 === n.nodeType) {
|
|
if (-1 !== (u = wc(o, i, n, r))) return { container: n, offset: u };
|
|
s = n;
|
|
}
|
|
for (
|
|
var c = new bi(n, e.getParent(n, e.isBlock) || t);
|
|
(a = c[o ? "prev" : "next"]());
|
|
|
|
)
|
|
if (3 !== a.nodeType || $c(a.parentNode)) {
|
|
if (e.isBlock(a) || qc.isEq(a, "BR")) break;
|
|
} else if (-1 !== (u = wc(o, i, (s = a))))
|
|
return { container: a, offset: u };
|
|
if (s) return { container: s, offset: (r = o ? 0 : s.length) };
|
|
}
|
|
function zc(e, t, n, r, o) {
|
|
var i, a, u, s;
|
|
for (
|
|
3 === r.nodeType && 0 === r.nodeValue.length && r[o] && (r = r[o]),
|
|
i = Wc(e, r),
|
|
a = 0;
|
|
a < i.length;
|
|
a++
|
|
)
|
|
for (u = 0; u < t.length; u++)
|
|
if (
|
|
!("collapsed" in (s = t[u]) && s.collapsed !== n.collapsed) &&
|
|
e.is(i[a], s.selector)
|
|
)
|
|
return i[a];
|
|
return r;
|
|
}
|
|
function Ec(t, e, n, r) {
|
|
var o,
|
|
i = t.dom,
|
|
a = i.getRoot();
|
|
if ((e[0].wrapper || (o = i.getParent(n, e[0].block, a)), !o)) {
|
|
var u = i.getParent(n, "LI,TD,TH");
|
|
o = i.getParent(
|
|
3 === n.nodeType ? n.parentNode : n,
|
|
function (e) {
|
|
return e !== a && Xc(t, e);
|
|
},
|
|
u,
|
|
);
|
|
}
|
|
if ((o && e[0].wrapper && (o = Wc(i, o, "ul,ol").reverse()[0] || o), !o))
|
|
for (
|
|
o = n;
|
|
o[r] && !i.isBlock(o[r]) && ((o = o[r]), !qc.isEq(o, "br"));
|
|
|
|
);
|
|
return o || n;
|
|
}
|
|
function Nc(e, t, n, r, o, i, a) {
|
|
var u, s, c, l, f, d;
|
|
if (
|
|
((u = s = a ? n : o),
|
|
(l = a ? "previousSibling" : "nextSibling"),
|
|
(f = e.getRoot()),
|
|
3 === u.nodeType && !Kc(u) && (a ? 0 < r : i < u.nodeValue.length))
|
|
)
|
|
return u;
|
|
for (;;) {
|
|
if (!t[0].block_expand && e.isBlock(s)) return s;
|
|
for (c = s[l]; c; c = c[l])
|
|
if (
|
|
!$c(c) &&
|
|
!Kc(c) &&
|
|
("BR" !== (d = c).nodeName ||
|
|
!d.getAttribute("data-mce-bogus") ||
|
|
d.nextSibling)
|
|
)
|
|
return s;
|
|
if (s === f || s.parentNode === f) {
|
|
u = s;
|
|
break;
|
|
}
|
|
s = s.parentNode;
|
|
}
|
|
return u;
|
|
}
|
|
var Sc = Ge.isContentEditableFalse,
|
|
kc = Ge.isText,
|
|
Tc = Ge.isElement,
|
|
Ac = Ge.isBr,
|
|
Mc = Va,
|
|
Rc = function (e) {
|
|
return (
|
|
wu(e) ||
|
|
(function (e) {
|
|
return (
|
|
!!Eu(e) &&
|
|
!0 !==
|
|
b(
|
|
P(e.getElementsByTagName("*")),
|
|
function (e, t) {
|
|
return e || pu(t);
|
|
},
|
|
!1,
|
|
)
|
|
);
|
|
})(e)
|
|
);
|
|
},
|
|
Dc = Ia,
|
|
_c = function (e, t, n) {
|
|
var r, o, i, a, u;
|
|
if (!Tc(n) || !t) return null;
|
|
if (t.isEqual(_s.after(n)) && n.lastChild) {
|
|
if (
|
|
((u = _s.after(n.lastChild)),
|
|
vs(e) && Mc(n.lastChild) && Tc(n.lastChild))
|
|
)
|
|
return Ac(n.lastChild) ? _s.before(n.lastChild) : u;
|
|
} else u = t;
|
|
var s = u.container(),
|
|
c = u.offset();
|
|
if (kc(s)) {
|
|
if (vs(e) && 0 < c) return _s(s, --c);
|
|
if (ps(e) && c < s.length) return _s(s, ++c);
|
|
r = s;
|
|
} else {
|
|
if (vs(e) && 0 < c && ((o = nc(s, c - 1)), Mc(o)))
|
|
return !Rc(o) && (i = bs(o, e, Dc, o))
|
|
? kc(i)
|
|
? _s(i, i.data.length)
|
|
: _s.after(i)
|
|
: kc(o)
|
|
? _s(o, o.data.length)
|
|
: _s.before(o);
|
|
if (ps(e) && c < s.childNodes.length && ((o = nc(s, c)), Mc(o)))
|
|
return Ac(o)
|
|
? (function (e, t) {
|
|
var n = t.nextSibling;
|
|
return n && Mc(n)
|
|
? kc(n)
|
|
? _s(n, 0)
|
|
: _s.before(n)
|
|
: _c(Rs.Forwards, _s.after(t), e);
|
|
})(n, o)
|
|
: !Rc(o) && (i = bs(o, e, Dc, o))
|
|
? kc(i)
|
|
? _s(i, 0)
|
|
: _s.before(i)
|
|
: kc(o)
|
|
? _s(o, 0)
|
|
: _s.after(o);
|
|
r = o || u.getNode();
|
|
}
|
|
return ((ps(e) && u.isAtEnd()) || (vs(e) && u.isAtStart())) &&
|
|
((r = bs(r, e, $(!0), n, !0)), Dc(r, n))
|
|
? rc(e, r)
|
|
: ((o = bs(r, e, Dc, n)),
|
|
!(a = Tn.last(
|
|
y(
|
|
(function (e, t) {
|
|
for (var n = []; e && e !== t; ) n.push(e), (e = e.parentNode);
|
|
return n;
|
|
})(s, n),
|
|
Sc,
|
|
),
|
|
)) ||
|
|
(o && a.contains(o))
|
|
? o
|
|
? rc(e, o)
|
|
: null
|
|
: (u = ps(e) ? _s.after(a) : _s.before(a)));
|
|
},
|
|
Oc = function (e, t, n) {
|
|
var r = oc(t);
|
|
return k.from(e ? r.next(n) : r.prev(n));
|
|
},
|
|
Bc = function (t, n, e, r) {
|
|
return cc(t, n, e).bind(function (e) {
|
|
return r(e) ? Bc(t, n, e, r) : k.some(e);
|
|
});
|
|
},
|
|
Hc = d(Oc, !0),
|
|
Pc = d(Oc, !1),
|
|
Lc = {
|
|
fromPosition: Oc,
|
|
nextPosition: Hc,
|
|
prevPosition: Pc,
|
|
navigate: cc,
|
|
navigateIgnore: Bc,
|
|
positionIn: lc,
|
|
firstPositionIn: d(lc, !0),
|
|
lastPositionIn: d(lc, !1),
|
|
},
|
|
Vc = function (e, t) {
|
|
var n = e.dom;
|
|
if (t) {
|
|
if (
|
|
(function (e) {
|
|
return Rn.isArray(e.start);
|
|
})(t)
|
|
)
|
|
return (function (e, t) {
|
|
var n = e.createRng();
|
|
return mc(e, !0, t, n) && mc(e, !1, t, n) ? k.some(n) : k.none();
|
|
})(n, t);
|
|
if (
|
|
(function (e) {
|
|
return "string" == typeof e.start;
|
|
})(t)
|
|
)
|
|
return k.some(
|
|
(function (e, t) {
|
|
var n, r;
|
|
return (
|
|
(n = e.createRng()),
|
|
(r = Ku(e.getRoot(), t.start)),
|
|
n.setStart(r.container(), r.offset()),
|
|
(r = Ku(e.getRoot(), t.end)),
|
|
n.setEnd(r.container(), r.offset()),
|
|
n
|
|
);
|
|
})(n, t),
|
|
);
|
|
if (
|
|
(function (e) {
|
|
return e.hasOwnProperty("id");
|
|
})(t)
|
|
)
|
|
return (function (r, e) {
|
|
var t = pc(r, "start", e),
|
|
n = pc(r, "end", e);
|
|
return Ga(t, n.or(t), function (e, t) {
|
|
var n = r.createRng();
|
|
return (
|
|
n.setStart(fc(r, e.container()), e.offset()),
|
|
n.setEnd(fc(r, t.container()), t.offset()),
|
|
n
|
|
);
|
|
});
|
|
})(n, t);
|
|
if (
|
|
(function (e) {
|
|
return e.hasOwnProperty("name");
|
|
})(t)
|
|
)
|
|
return (function (n, e) {
|
|
return k.from(n.select(e.name)[e.index]).map(function (e) {
|
|
var t = n.createRng();
|
|
return t.selectNode(e), t;
|
|
});
|
|
})(n, t);
|
|
if (
|
|
(function (e) {
|
|
return e.hasOwnProperty("rng");
|
|
})(t)
|
|
)
|
|
return k.some(t.rng);
|
|
}
|
|
return k.none();
|
|
},
|
|
Ic = function (e, t, n) {
|
|
return Is.getBookmark(e, t, n);
|
|
},
|
|
Fc = function (t, e) {
|
|
Vc(t, e).each(function (e) {
|
|
t.setRng(e);
|
|
});
|
|
},
|
|
Uc = function (e) {
|
|
return (
|
|
Ge.isElement(e) &&
|
|
"SPAN" === e.tagName &&
|
|
"bookmark" === e.getAttribute("data-mce-type")
|
|
);
|
|
},
|
|
jc = function (e) {
|
|
return e && 3 === e.nodeType && /^([\t \r\n]+|)$/.test(e.nodeValue);
|
|
},
|
|
qc = {
|
|
isInlineBlock: vc,
|
|
moveStart: function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a = n.startOffset,
|
|
u = n.startContainer;
|
|
if (
|
|
(n.startContainer !== n.endContainer ||
|
|
!vc(n.startContainer.childNodes[n.startOffset])) &&
|
|
1 === u.nodeType
|
|
)
|
|
for (
|
|
a < (i = u.childNodes).length
|
|
? ((u = i[a]), (r = new bi(u, e.getParent(u, e.isBlock))))
|
|
: ((u = i[i.length - 1]),
|
|
(r = new bi(u, e.getParent(u, e.isBlock))).next(!0)),
|
|
o = r.current();
|
|
o;
|
|
o = r.next()
|
|
)
|
|
if (3 === o.nodeType && !jc(o))
|
|
return n.setStart(o, 0), void t.setRng(n);
|
|
},
|
|
getNonWhiteSpaceSibling: function (e, t, n) {
|
|
if (e)
|
|
for (
|
|
t = t ? "nextSibling" : "previousSibling", e = n ? e : e[t];
|
|
e;
|
|
e = e[t]
|
|
)
|
|
if (1 === e.nodeType || !jc(e)) return e;
|
|
},
|
|
isTextBlock: function (e, t) {
|
|
return (
|
|
t.nodeType && (t = t.nodeName),
|
|
!!e.schema.getTextBlockElements()[t.toLowerCase()]
|
|
);
|
|
},
|
|
isValid: function (e, t, n) {
|
|
return e.schema.isValidChild(t, n);
|
|
},
|
|
isWhiteSpaceNode: jc,
|
|
replaceVars: function (e, n) {
|
|
return (
|
|
"string" != typeof e
|
|
? (e = e(n))
|
|
: n &&
|
|
(e = e.replace(/%(\w+)/g, function (e, t) {
|
|
return n[t] || e;
|
|
})),
|
|
e
|
|
);
|
|
},
|
|
isEq: function (e, t) {
|
|
return (
|
|
(e = "" + ((e = e || "").nodeName || e)),
|
|
(t = "" + ((t = t || "").nodeName || t)),
|
|
e.toLowerCase() === t.toLowerCase()
|
|
);
|
|
},
|
|
normalizeStyleValue: yc,
|
|
getStyle: function (e, t, n) {
|
|
return yc(e, e.getStyle(t, n), n);
|
|
},
|
|
getTextDecoration: function (t, e) {
|
|
var n;
|
|
return (
|
|
t.getParent(e, function (e) {
|
|
return (n = t.getStyle(e, "text-decoration")) && "none" !== n;
|
|
}),
|
|
n
|
|
);
|
|
},
|
|
getParents: function (e, t, n) {
|
|
return e.getParents(t, n, e.getRoot());
|
|
},
|
|
},
|
|
$c = Uc,
|
|
Wc = qc.getParents,
|
|
Kc = qc.isWhiteSpaceNode,
|
|
Xc = qc.isTextBlock,
|
|
Yc = function (e, t, n, r) {
|
|
var o,
|
|
i = t.startContainer,
|
|
a = t.startOffset,
|
|
u = t.endContainer,
|
|
s = t.endOffset,
|
|
c = e.dom;
|
|
return (
|
|
1 === i.nodeType &&
|
|
i.hasChildNodes() &&
|
|
3 === (i = Xa(i, a)).nodeType &&
|
|
(a = 0),
|
|
1 === u.nodeType &&
|
|
u.hasChildNodes() &&
|
|
3 === (u = Xa(u, t.collapsed ? s : s - 1)).nodeType &&
|
|
(s = u.nodeValue.length),
|
|
(i = Cc(c, i)),
|
|
(u = Cc(c, u)),
|
|
($c(i.parentNode) || $c(i)) &&
|
|
((i = $c(i) ? i : i.parentNode),
|
|
3 ===
|
|
(i = t.collapsed ? i.previousSibling || i : i.nextSibling || i)
|
|
.nodeType && (a = t.collapsed ? i.length : 0)),
|
|
($c(u.parentNode) || $c(u)) &&
|
|
((u = $c(u) ? u : u.parentNode),
|
|
3 ===
|
|
(u = t.collapsed ? u.nextSibling || u : u.previousSibling || u)
|
|
.nodeType && (s = t.collapsed ? 0 : u.length)),
|
|
t.collapsed &&
|
|
((o = xc(c, e.getBody(), i, a, !0, r)) &&
|
|
((i = o.container), (a = o.offset)),
|
|
(o = xc(c, e.getBody(), u, s, !1, r)) &&
|
|
((u = o.container), (s = o.offset))),
|
|
n[0].inline &&
|
|
(u = r
|
|
? u
|
|
: (function (e, t) {
|
|
var n = bc(e, t);
|
|
if (n.node) {
|
|
for (; n.node && 0 === n.offset && n.node.previousSibling; )
|
|
n = bc(n.node.previousSibling);
|
|
n.node &&
|
|
0 < n.offset &&
|
|
3 === n.node.nodeType &&
|
|
" " === n.node.nodeValue.charAt(n.offset - 1) &&
|
|
1 < n.offset &&
|
|
(e = n.node).splitText(n.offset - 1);
|
|
}
|
|
return e;
|
|
})(u, s)),
|
|
(n[0].inline || n[0].block_expand) &&
|
|
((n[0].inline && 3 === i.nodeType && 0 !== a) ||
|
|
(i = Nc(c, n, i, a, u, s, !0)),
|
|
(n[0].inline && 3 === u.nodeType && s !== u.nodeValue.length) ||
|
|
(u = Nc(c, n, i, a, u, s, !1))),
|
|
n[0].selector &&
|
|
!1 !== n[0].expand &&
|
|
!n[0].inline &&
|
|
((i = zc(c, n, t, i, "previousSibling")),
|
|
(u = zc(c, n, t, u, "nextSibling"))),
|
|
(n[0].block || n[0].selector) &&
|
|
((i = Ec(e, n, i, "previousSibling")),
|
|
(u = Ec(e, n, u, "nextSibling")),
|
|
n[0].block &&
|
|
(c.isBlock(i) || (i = Nc(c, n, i, a, u, s, !0)),
|
|
c.isBlock(u) || (u = Nc(c, n, i, a, u, s, !1)))),
|
|
1 === i.nodeType && ((a = c.nodeIndex(i)), (i = i.parentNode)),
|
|
1 === u.nodeType && ((s = c.nodeIndex(u) + 1), (u = u.parentNode)),
|
|
{ startContainer: i, startOffset: a, endContainer: u, endOffset: s }
|
|
);
|
|
},
|
|
Gc = Rn.each,
|
|
Jc = function (e, t, o) {
|
|
var n,
|
|
r,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l = t.startContainer,
|
|
f = t.startOffset,
|
|
d = t.endContainer,
|
|
h = t.endOffset;
|
|
if (
|
|
0 < (c = e.select("td[data-mce-selected],th[data-mce-selected]")).length
|
|
)
|
|
Gc(c, function (e) {
|
|
o([e]);
|
|
});
|
|
else {
|
|
var m = function (e) {
|
|
var t;
|
|
return (
|
|
3 === (t = e[0]).nodeType &&
|
|
t === l &&
|
|
f >= t.nodeValue.length &&
|
|
e.splice(0, 1),
|
|
(t = e[e.length - 1]),
|
|
0 === h &&
|
|
0 < e.length &&
|
|
t === d &&
|
|
3 === t.nodeType &&
|
|
e.splice(e.length - 1, 1),
|
|
e
|
|
);
|
|
},
|
|
g = function (e, t, n) {
|
|
for (var r = []; e && e !== n; e = e[t]) r.push(e);
|
|
return r;
|
|
},
|
|
p = function (e, t) {
|
|
do {
|
|
if (e.parentNode === t) return e;
|
|
e = e.parentNode;
|
|
} while (e);
|
|
},
|
|
v = function (e, t, n) {
|
|
var r = n ? "nextSibling" : "previousSibling";
|
|
for (u = (a = e).parentNode; a && a !== t; a = u)
|
|
(u = a.parentNode),
|
|
(s = g(a === e ? a : a[r], r)).length &&
|
|
(n || s.reverse(), o(m(s)));
|
|
};
|
|
if (
|
|
(1 === l.nodeType && l.hasChildNodes() && (l = l.childNodes[f]),
|
|
1 === d.nodeType &&
|
|
d.hasChildNodes() &&
|
|
(d = (function (e, t) {
|
|
var n = e.childNodes;
|
|
return (
|
|
--t > n.length - 1 ? (t = n.length - 1) : t < 0 && (t = 0),
|
|
n[t] || e
|
|
);
|
|
})(d, h)),
|
|
l === d)
|
|
)
|
|
return o(m([l]));
|
|
for (n = e.findCommonAncestor(l, d), a = l; a; a = a.parentNode) {
|
|
if (a === d) return v(l, n, !0);
|
|
if (a === n) break;
|
|
}
|
|
for (a = d; a; a = a.parentNode) {
|
|
if (a === l) return v(d, n);
|
|
if (a === n) break;
|
|
}
|
|
(r = p(l, n) || l),
|
|
(i = p(d, n) || d),
|
|
v(l, r, !0),
|
|
(s = g(
|
|
r === l ? r : r.nextSibling,
|
|
"nextSibling",
|
|
i === d ? i.nextSibling : i,
|
|
)).length && o(m(s)),
|
|
v(d, i);
|
|
}
|
|
};
|
|
function Qc(e) {
|
|
return il.get(e);
|
|
}
|
|
function Zc(t, n, r, o) {
|
|
return Se(n).fold(
|
|
function () {
|
|
return "skipping";
|
|
},
|
|
function (e) {
|
|
return "br" === o ||
|
|
(function (e) {
|
|
return Et(e) && "\ufeff" === Qc(e);
|
|
})(n)
|
|
? "valid"
|
|
: (function (e) {
|
|
return zt(e) && ma(e, ru());
|
|
})(n)
|
|
? "existing"
|
|
: os(n)
|
|
? "caret"
|
|
: qc.isValid(t, r, o) && qc.isValid(t, ie(e), r)
|
|
? "valid"
|
|
: "invalid-child";
|
|
},
|
|
);
|
|
}
|
|
function el(e, t, n, r) {
|
|
var o = t.uid,
|
|
i =
|
|
void 0 === o
|
|
? (function (e) {
|
|
var t = new Date().getTime();
|
|
return (
|
|
e + "_" + Math.floor(1e9 * Math.random()) + ++uu + String(t)
|
|
);
|
|
})("mce-annotation")
|
|
: o,
|
|
a = (function h(e, t) {
|
|
var n = {};
|
|
for (var r in e)
|
|
Object.prototype.hasOwnProperty.call(e, r) &&
|
|
t.indexOf(r) < 0 &&
|
|
(n[r] = e[r]);
|
|
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
|
|
var o = 0;
|
|
for (r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
t.indexOf(r[o]) < 0 &&
|
|
Object.prototype.propertyIsEnumerable.call(e, r[o]) &&
|
|
(n[r[o]] = e[r[o]]);
|
|
}
|
|
return n;
|
|
})(t, ["uid"]),
|
|
u = bt.fromTag("span", e);
|
|
da(u, ru()), At(u, "" + iu(), i), At(u, "" + ou(), n);
|
|
var s = r(i, a),
|
|
c = s.attributes,
|
|
l = void 0 === c ? {} : c,
|
|
f = s.classes,
|
|
d = void 0 === f ? [] : f;
|
|
return (
|
|
me(u, l),
|
|
(function (t, e) {
|
|
z(e, function (e) {
|
|
da(t, e);
|
|
});
|
|
})(u, d),
|
|
u
|
|
);
|
|
}
|
|
function tl(n, e, t, r, o) {
|
|
function i() {
|
|
c.set(k.none());
|
|
}
|
|
function a(e) {
|
|
z(e, l);
|
|
}
|
|
var u = [],
|
|
s = el(n.getDoc(), o, t, r),
|
|
c = Je(k.none()),
|
|
l = function (e) {
|
|
switch (Zc(n, e, "span", ie(e))) {
|
|
case "invalid-child":
|
|
i();
|
|
var t = Re(e);
|
|
a(t), i();
|
|
break;
|
|
case "valid":
|
|
!(function (e, t) {
|
|
wi(e, t), _i(t, e);
|
|
})(
|
|
e,
|
|
c.get().getOrThunk(function () {
|
|
var e = Ta(s);
|
|
return u.push(e), c.set(k.some(e)), e;
|
|
}),
|
|
);
|
|
}
|
|
};
|
|
return (
|
|
Jc(n.dom, e, function (e) {
|
|
i(),
|
|
(function (e) {
|
|
var t = X(e, bt.fromDom);
|
|
a(t);
|
|
})(e);
|
|
}),
|
|
u
|
|
);
|
|
}
|
|
function nl(o, i, a, u) {
|
|
o.undoManager.transact(function () {
|
|
var e = o.selection.getRng();
|
|
if (
|
|
(e.collapsed &&
|
|
(function (e, t) {
|
|
var n = Yc(
|
|
e,
|
|
t,
|
|
[{ inline: !0 }],
|
|
(function (e) {
|
|
return (
|
|
3 === e.startContainer.nodeType &&
|
|
e.startContainer.nodeValue.length >= e.startOffset &&
|
|
"\xa0" === e.startContainer.nodeValue[e.startOffset]
|
|
);
|
|
})(t),
|
|
);
|
|
t.setStart(n.startContainer, n.startOffset),
|
|
t.setEnd(n.endContainer, n.endOffset),
|
|
e.selection.setRng(t);
|
|
})(o, e),
|
|
o.selection.getRng().collapsed)
|
|
) {
|
|
var t = el(o.getDoc(), u, i, a.decorate);
|
|
Ma(t, "\xa0"),
|
|
o.selection.getRng().insertNode(t.dom()),
|
|
o.selection.select(t.dom());
|
|
} else {
|
|
var n = Is.getPersistentBookmark(o.selection, !1),
|
|
r = o.selection.getRng();
|
|
tl(o, r, i, a.decorate, u), o.selection.moveToBookmark(n);
|
|
}
|
|
});
|
|
}
|
|
function rl(r) {
|
|
var o = (function () {
|
|
var n = {};
|
|
return {
|
|
register: function (e, t) {
|
|
n[e] = { name: e, settings: t };
|
|
},
|
|
lookup: function (e) {
|
|
return n.hasOwnProperty(e)
|
|
? k.from(n[e]).map(function (e) {
|
|
return e.settings;
|
|
})
|
|
: k.none();
|
|
},
|
|
};
|
|
})();
|
|
Sa(r, o);
|
|
var n = Na(r);
|
|
return {
|
|
register: function (e, t) {
|
|
o.register(e, t);
|
|
},
|
|
annotate: function (t, n) {
|
|
o.lookup(t).each(function (e) {
|
|
nl(r, t, e, n);
|
|
});
|
|
},
|
|
annotationChanged: function (e, t) {
|
|
n.addListener(e, t);
|
|
},
|
|
remove: function (e) {
|
|
Ea(r, k.some(e)).each(function (e) {
|
|
var t = e.elements;
|
|
z(t, Si);
|
|
});
|
|
},
|
|
getAll: function (e) {
|
|
var t = (function (e, t) {
|
|
var n = bt.fromDom(e.getBody()),
|
|
r = ga(n, "[" + ou() + '="' + t + '"]'),
|
|
o = {};
|
|
return (
|
|
z(r, function (e) {
|
|
var t = ge(e, iu()),
|
|
n = o.hasOwnProperty(t) ? o[t] : [];
|
|
o[t] = n.concat([e]);
|
|
}),
|
|
o
|
|
);
|
|
})(r, e);
|
|
return se(t, function (e) {
|
|
return X(e, function (e) {
|
|
return e.dom();
|
|
});
|
|
});
|
|
},
|
|
};
|
|
}
|
|
function ol(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;
|
|
}
|
|
}
|
|
var il = (function zN(n, r) {
|
|
var t = function (e) {
|
|
return n(e) ? k.from(e.dom().nodeValue) : k.none();
|
|
};
|
|
return {
|
|
get: function (e) {
|
|
if (!n(e))
|
|
throw new Error("Can only get " + r + " value of a " + r + " node");
|
|
return t(e).getOr("");
|
|
},
|
|
getOption: t,
|
|
set: function (e, t) {
|
|
if (!n(e))
|
|
throw new Error(
|
|
"Can only set raw " + r + " value of a " + r + " node",
|
|
);
|
|
e.dom().nodeValue = t;
|
|
},
|
|
};
|
|
})(Et, "text"),
|
|
al = /^[ \t\r\n]*$/,
|
|
ul = {
|
|
"#text": 3,
|
|
"#comment": 8,
|
|
"#cdata": 4,
|
|
"#pi": 7,
|
|
"#doctype": 10,
|
|
"#document-fragment": 11,
|
|
},
|
|
sl =
|
|
((cl.create = function (e, t) {
|
|
var n = new cl(e, ul[e] || 1);
|
|
if (t) for (var r in t) n.attr(r, t[r]);
|
|
return n;
|
|
}),
|
|
(cl.prototype.replace = function (e) {
|
|
return (
|
|
e.parent && e.remove(), this.insert(e, this), this.remove(), this
|
|
);
|
|
}),
|
|
(cl.prototype.attr = function (e, t) {
|
|
var n;
|
|
if ("string" != typeof e) {
|
|
for (var r in e) this.attr(r, e[r]);
|
|
return this;
|
|
}
|
|
if ((n = this.attributes)) {
|
|
if (t === undefined) 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), this;
|
|
}
|
|
return this;
|
|
}
|
|
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), this;
|
|
}
|
|
}),
|
|
(cl.prototype.clone = function () {
|
|
var e,
|
|
t = new cl(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;
|
|
}),
|
|
(cl.prototype.wrap = function (e) {
|
|
return this.parent.insert(e, this), e.append(this), this;
|
|
}),
|
|
(cl.prototype.unwrap = function () {
|
|
for (var e = this.firstChild; e; ) {
|
|
var t = e.next;
|
|
this.insert(e, this, !0), (e = t);
|
|
}
|
|
this.remove();
|
|
}),
|
|
(cl.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
|
|
);
|
|
}),
|
|
(cl.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
|
|
);
|
|
}),
|
|
(cl.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
|
|
);
|
|
}),
|
|
(cl.prototype.getAll = function (e) {
|
|
for (var t = [], n = this.firstChild; n; n = ol(n, this))
|
|
n.name === e && t.push(n);
|
|
return t;
|
|
}),
|
|
(cl.prototype.empty = function () {
|
|
if (this.firstChild) {
|
|
for (var e = [], t = this.firstChild; t; t = ol(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;
|
|
}),
|
|
(cl.prototype.isEmpty = function (e, t, n) {
|
|
void 0 === t && (t = {});
|
|
var r = this.firstChild;
|
|
if (r)
|
|
do {
|
|
if (1 === r.type) {
|
|
if (r.attr("data-mce-bogus")) continue;
|
|
if (e[r.name]) return !1;
|
|
for (var o = r.attributes.length; o--; ) {
|
|
var i = r.attributes[o].name;
|
|
if ("name" === i || 0 === i.indexOf("data-mce-bookmark"))
|
|
return !1;
|
|
}
|
|
}
|
|
if (8 === r.type) return !1;
|
|
if (3 === r.type && !al.test(r.value)) return !1;
|
|
if (
|
|
3 === r.type &&
|
|
r.parent &&
|
|
t[r.parent.name] &&
|
|
al.test(r.value)
|
|
)
|
|
return !1;
|
|
if (n && n(r)) return !1;
|
|
} while ((r = ol(r, this)));
|
|
return !0;
|
|
}),
|
|
(cl.prototype.walk = function (e) {
|
|
return ol(this, null, e);
|
|
}),
|
|
cl);
|
|
function cl(e, t) {
|
|
(this.name = e),
|
|
1 === (this.type = t) &&
|
|
((this.attributes = []), (this.attributes.map = {}));
|
|
}
|
|
function ll(e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = 1;
|
|
for (
|
|
a = e.getShortEndedElements(),
|
|
(i =
|
|
/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex =
|
|
r =
|
|
n;
|
|
(o = i.exec(t));
|
|
|
|
) {
|
|
if (((r = i.lastIndex), "/" === o[1])) u--;
|
|
else if (!o[1]) {
|
|
if (o[2] in a) continue;
|
|
u++;
|
|
}
|
|
if (0 === u) break;
|
|
}
|
|
return r;
|
|
}
|
|
function fl(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;
|
|
}
|
|
function dl(V, I) {
|
|
void 0 === I && (I = vr());
|
|
function e() {}
|
|
!1 !== (V = V || {}).fix_self_closing && (V.fix_self_closing = !0);
|
|
var F = V.comment ? V.comment : e,
|
|
U = V.cdata ? V.cdata : e,
|
|
j = V.text ? V.text : e,
|
|
q = V.start ? V.start : e,
|
|
$ = V.end ? V.end : e,
|
|
W = V.pi ? V.pi : e,
|
|
K = V.doctype ? V.doctype : e;
|
|
return {
|
|
parse: function (e) {
|
|
function t(e) {
|
|
var t, n;
|
|
for (t = _.length; t-- && _[t].name !== e; );
|
|
if (0 <= t) {
|
|
for (n = _.length - 1; t <= n; n--) (e = _[n]).valid && $(e.name);
|
|
_.length = t;
|
|
}
|
|
}
|
|
function n(e, t, n, r, o) {
|
|
var i, a;
|
|
if (
|
|
((n = (t = t.toLowerCase()) in h ? t : B(n || r || o || "")),
|
|
g &&
|
|
!l &&
|
|
!1 ===
|
|
(function (e) {
|
|
return 0 === e.indexOf("data-") || 0 === e.indexOf("aria-");
|
|
})(t))
|
|
) {
|
|
if (!(i = C[t]) && w) {
|
|
for (a = w.length; a-- && !(i = w[a]).pattern.test(t); );
|
|
-1 === a && (i = null);
|
|
}
|
|
if (!i) return;
|
|
if (i.validValues && !(n in i.validValues)) return;
|
|
}
|
|
if (H[t] && !V.allow_script_urls) {
|
|
var u = n.replace(/[\s\u0000-\u001F]+/g, "");
|
|
try {
|
|
u = decodeURIComponent(u);
|
|
} catch (s) {
|
|
u = unescape(u);
|
|
}
|
|
if (P.test(u)) return;
|
|
if (
|
|
(function (e, t) {
|
|
return (
|
|
!e.allow_html_data_urls &&
|
|
(/^data:image\//i.test(t)
|
|
? !1 === e.allow_svg_data_urls &&
|
|
/^data:image\/svg\+xml/i.test(t)
|
|
: /^data:/i.test(t))
|
|
);
|
|
})(V, u)
|
|
)
|
|
return;
|
|
}
|
|
(l && (t in H || 0 === t.indexOf("on"))) ||
|
|
((c.map[t] = n), c.push({ name: t, value: n }));
|
|
}
|
|
var r,
|
|
o,
|
|
i,
|
|
c,
|
|
a,
|
|
u,
|
|
s,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
g,
|
|
p,
|
|
v,
|
|
y,
|
|
b,
|
|
C,
|
|
w,
|
|
x,
|
|
z,
|
|
E,
|
|
N,
|
|
S,
|
|
k,
|
|
T,
|
|
A,
|
|
M,
|
|
R,
|
|
D = 0,
|
|
_ = [],
|
|
O = 0,
|
|
B = ar.decode,
|
|
H = Rn.makeMap(
|
|
"src,href,data,background,formaction,poster,xlink:href",
|
|
),
|
|
P = /((java|vb)script|mhtml):/i;
|
|
for (
|
|
k = new RegExp(
|
|
"<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))",
|
|
"g",
|
|
),
|
|
T =
|
|
/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,
|
|
d = I.getShortEndedElements(),
|
|
S = V.self_closing_elements || I.getSelfClosingElements(),
|
|
h = I.getBoolAttrs(),
|
|
g = V.validate,
|
|
f = V.remove_internals,
|
|
R = V.fix_self_closing,
|
|
A = I.getSpecialElements(),
|
|
N = e + ">";
|
|
(r = k.exec(N));
|
|
|
|
) {
|
|
if ((D < r.index && j(B(e.substr(D, r.index - D))), (o = r[6])))
|
|
":" === (o = o.toLowerCase()).charAt(0) && (o = o.substr(1)), t(o);
|
|
else if ((o = r[7])) {
|
|
if (r.index + r[0].length > e.length) {
|
|
j(B(e.substr(r.index))), (D = r.index + r[0].length);
|
|
continue;
|
|
}
|
|
":" === (o = o.toLowerCase()).charAt(0) && (o = o.substr(1)),
|
|
(m = o in d),
|
|
R && S[o] && 0 < _.length && _[_.length - 1].name === o && t(o);
|
|
var L = fl(T, r[8]);
|
|
if (null !== L) {
|
|
if ("all" === L) {
|
|
(D = ll(I, e, k.lastIndex)), (k.lastIndex = D);
|
|
continue;
|
|
}
|
|
v = !1;
|
|
}
|
|
if (!g || (p = I.getElementRule(o))) {
|
|
if (
|
|
((v = !0),
|
|
g && ((C = p.attributes), (w = p.attributePatterns)),
|
|
(b = r[8])
|
|
? ((l = -1 !== b.indexOf("data-mce-type")) && f && (v = !1),
|
|
((c = []).map = {}),
|
|
b.replace(T, n))
|
|
: ((c = []).map = {}),
|
|
g && !l)
|
|
) {
|
|
if (
|
|
((x = p.attributesRequired),
|
|
(z = p.attributesDefault),
|
|
(E = p.attributesForced),
|
|
p.removeEmptyAttrs && !c.length && (v = !1),
|
|
E)
|
|
)
|
|
for (a = E.length; a--; )
|
|
(s = (y = E[a]).name),
|
|
"{$uid}" === (M = y.value) && (M = "mce_" + O++),
|
|
(c.map[s] = M),
|
|
c.push({ name: s, value: M });
|
|
if (z)
|
|
for (a = z.length; a--; )
|
|
(s = (y = z[a]).name) in c.map ||
|
|
("{$uid}" === (M = y.value) && (M = "mce_" + O++),
|
|
(c.map[s] = M),
|
|
c.push({ name: s, value: M }));
|
|
if (x) {
|
|
for (a = x.length; a-- && !(x[a] in c.map); );
|
|
-1 === a && (v = !1);
|
|
}
|
|
if ((y = c.map["data-mce-bogus"])) {
|
|
if ("all" === y) {
|
|
(D = ll(I, e, k.lastIndex)), (k.lastIndex = D);
|
|
continue;
|
|
}
|
|
v = !1;
|
|
}
|
|
}
|
|
v && q(o, c, m);
|
|
} else v = !1;
|
|
if ((i = A[o])) {
|
|
(i.lastIndex = D = r.index + r[0].length),
|
|
(D = (r = i.exec(e))
|
|
? (v && (u = e.substr(D, r.index - D)), r.index + r[0].length)
|
|
: ((u = e.substr(D)), e.length)),
|
|
v && (0 < u.length && j(u, !0), $(o)),
|
|
(k.lastIndex = D);
|
|
continue;
|
|
}
|
|
m ||
|
|
(b && b.indexOf("/") === b.length - 1
|
|
? v && $(o)
|
|
: _.push({ name: o, valid: v }));
|
|
} else
|
|
(o = r[1])
|
|
? (">" === o.charAt(0) && (o = " " + o),
|
|
V.allow_conditional_comments ||
|
|
"[if" !== o.substr(0, 3).toLowerCase() ||
|
|
(o = " " + o),
|
|
F(o))
|
|
: (o = r[2])
|
|
? U(o.replace(/<!--|--!?>/g, ""))
|
|
: (o = r[3])
|
|
? K(o)
|
|
: (o = r[4]) && W(o, r[5]);
|
|
D = r.index + r[0].length;
|
|
}
|
|
for (D < e.length && j(B(e.substr(D))), a = _.length - 1; 0 <= a; a--)
|
|
(o = _[a]).valid && $(o.name);
|
|
},
|
|
};
|
|
}
|
|
(dl = dl || {}).findEndTag = ll;
|
|
function hl(e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = t,
|
|
s = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,
|
|
c = e.schema;
|
|
for (
|
|
u = (function (e, t) {
|
|
var n = new RegExp(
|
|
["\\s?(" + e.join("|") + ')="[^"]+"'].join("|"),
|
|
"gi",
|
|
);
|
|
return t.replace(n, "");
|
|
})(e.getTempAttrs(), u),
|
|
a = c.getShortEndedElements();
|
|
(i = s.exec(u));
|
|
|
|
)
|
|
(r = s.lastIndex),
|
|
(o = i[0].length),
|
|
(n = a[i[1]] ? r : af.findEndTag(c, u, r)),
|
|
(u = u.substring(0, r - o) + u.substring(n)),
|
|
(s.lastIndex = r - o);
|
|
return fu(u);
|
|
}
|
|
function ml(e, t, n) {
|
|
var r = e.getParam(t, n);
|
|
if (-1 === r.indexOf("=")) return r;
|
|
var o = e.getParam(t, "", "hash");
|
|
return o.hasOwnProperty(e.id) ? o[e.id] : n;
|
|
}
|
|
function gl(e, t, n) {
|
|
var r;
|
|
if (
|
|
((t.format = t.format ? t.format : "html"),
|
|
(t.get = !0),
|
|
(t.getInner = !0),
|
|
t.no_events || e.fire("BeforeGetContent", t),
|
|
"raw" === t.format)
|
|
)
|
|
r = Rn.trim(uf.trimExternal(e.serializer, n.innerHTML));
|
|
else if ("text" === t.format) r = fu(n.innerText || n.textContent);
|
|
else {
|
|
if ("tree" === t.format) return e.serializer.serialize(n, t);
|
|
r = (function (e, t) {
|
|
var n = gf(e),
|
|
r = new RegExp(
|
|
"^(<" +
|
|
n +
|
|
"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/" +
|
|
n +
|
|
">[\r\n]*|<br \\/>[\r\n]*)$",
|
|
);
|
|
return t.replace(r, "");
|
|
})(e, e.serializer.serialize(n, t));
|
|
}
|
|
return (
|
|
"text" === t.format || Kn(bt.fromDom(n))
|
|
? (t.content = r)
|
|
: (t.content = Rn.trim(r)),
|
|
t.no_events || e.fire("GetContent", t),
|
|
t.content
|
|
);
|
|
}
|
|
function pl(e) {
|
|
var u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d = [];
|
|
return (
|
|
(u = (e = e || {}).indent),
|
|
(s = Uf(e.indent_before || "")),
|
|
(c = Uf(e.indent_after || "")),
|
|
(l = ar.getEncodeFunc(e.entity_encoding || "raw", e.entities)),
|
|
(f = "html" === e.element_format),
|
|
{
|
|
start: function (e, t, n) {
|
|
var r, o, i, a;
|
|
if (
|
|
(u &&
|
|
s[e] &&
|
|
0 < d.length &&
|
|
0 < (a = d[d.length - 1]).length &&
|
|
"\n" !== a &&
|
|
d.push("\n"),
|
|
d.push("<", e),
|
|
t)
|
|
)
|
|
for (r = 0, o = t.length; r < o; r++)
|
|
(i = t[r]), d.push(" ", i.name, '="', l(i.value, !0), '"');
|
|
(d[d.length] = !n || f ? ">" : " />"),
|
|
n &&
|
|
u &&
|
|
c[e] &&
|
|
0 < d.length &&
|
|
0 < (a = d[d.length - 1]).length &&
|
|
"\n" !== a &&
|
|
d.push("\n");
|
|
},
|
|
end: function (e) {
|
|
var t;
|
|
d.push("</", e, ">"),
|
|
u &&
|
|
c[e] &&
|
|
0 < d.length &&
|
|
0 < (t = d[d.length - 1]).length &&
|
|
"\n" !== t &&
|
|
d.push("\n");
|
|
},
|
|
text: function (e, t) {
|
|
0 < e.length && (d[d.length] = t ? e : l(e));
|
|
},
|
|
cdata: function (e) {
|
|
d.push("<![CDATA[", e, "]]>");
|
|
},
|
|
comment: function (e) {
|
|
d.push("\x3c!--", e, "--\x3e");
|
|
},
|
|
pi: function (e, t) {
|
|
t ? d.push("<?", e, " ", l(t), "?>") : d.push("<?", e, "?>"),
|
|
u && d.push("\n");
|
|
},
|
|
doctype: function (e) {
|
|
d.push("<!DOCTYPE", e, ">", u ? "\n" : "");
|
|
},
|
|
reset: function () {
|
|
d.length = 0;
|
|
},
|
|
getContent: function () {
|
|
return d.join("").replace(/\n$/, "");
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function vl(t, m) {
|
|
void 0 === m && (m = vr());
|
|
var g = pl(t);
|
|
return (
|
|
((t = t || {}).validate = !("validate" in t) || t.validate),
|
|
{
|
|
serialize: function (e) {
|
|
var f, d;
|
|
(d = t.validate),
|
|
(f = {
|
|
3: function (e) {
|
|
g.text(e.value, e.raw);
|
|
},
|
|
8: function (e) {
|
|
g.comment(e.value);
|
|
},
|
|
7: function (e) {
|
|
g.pi(e.name, e.value);
|
|
},
|
|
10: function (e) {
|
|
g.doctype(e.value);
|
|
},
|
|
4: function (e) {
|
|
g.cdata(e.value);
|
|
},
|
|
11: function (e) {
|
|
if ((e = e.firstChild)) for (; h(e), (e = e.next); );
|
|
},
|
|
}),
|
|
g.reset();
|
|
var h = function (e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l = f[e.type];
|
|
if (l) l(e);
|
|
else {
|
|
if (
|
|
((t = e.name),
|
|
(n = e.shortEnded),
|
|
(r = e.attributes),
|
|
d &&
|
|
r &&
|
|
1 < r.length &&
|
|
(((a = []).map = {}), (c = m.getElementRule(e.name))))
|
|
) {
|
|
for (u = 0, s = c.attributesOrder.length; u < s; u++)
|
|
(o = c.attributesOrder[u]) in r.map &&
|
|
((i = r.map[o]),
|
|
(a.map[o] = i),
|
|
a.push({ name: o, value: i }));
|
|
for (u = 0, s = r.length; u < s; u++)
|
|
(o = r[u].name) in a.map ||
|
|
((i = r.map[o]),
|
|
(a.map[o] = i),
|
|
a.push({ name: o, value: i }));
|
|
r = a;
|
|
}
|
|
if ((g.start(e.name, r, n), !n)) {
|
|
if ((e = e.firstChild)) for (; h(e), (e = e.next); );
|
|
g.end(t);
|
|
}
|
|
}
|
|
};
|
|
return 1 !== e.type || t.inner ? f[11](e) : h(e), g.getContent();
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function yl(e, t, n) {
|
|
var r = (function (e, n, t) {
|
|
var r = {},
|
|
o = {},
|
|
i = [];
|
|
for (var a in (t.firstChild &&
|
|
jf(t.firstChild, function (t) {
|
|
z(e, function (e) {
|
|
e.name === t.name &&
|
|
(r[e.name]
|
|
? r[e.name].nodes.push(t)
|
|
: (r[e.name] = { filter: e, nodes: [t] }));
|
|
}),
|
|
z(n, function (e) {
|
|
"string" == typeof t.attr(e.name) &&
|
|
(o[e.name]
|
|
? o[e.name].nodes.push(t)
|
|
: (o[e.name] = { filter: e, nodes: [t] }));
|
|
});
|
|
}),
|
|
r))
|
|
r.hasOwnProperty(a) && i.push(r[a]);
|
|
for (var a in o) o.hasOwnProperty(a) && i.push(o[a]);
|
|
return i;
|
|
})(e, t, n);
|
|
z(r, function (t) {
|
|
z(t.filter.callbacks, function (e) {
|
|
e(t.nodes, t.filter.name, {});
|
|
});
|
|
});
|
|
}
|
|
function bl(e) {
|
|
var t = Ee(e).dom();
|
|
return e.dom() === t.activeElement;
|
|
}
|
|
function Cl(e) {
|
|
var t = e !== undefined ? e.dom() : j.document;
|
|
return k.from(t.activeElement).map(bt.fromDom);
|
|
}
|
|
function wl(e, t) {
|
|
var n = Et(t) ? Qc(t).length : Re(t).length + 1;
|
|
return n < e ? n : e < 0 ? 0 : e;
|
|
}
|
|
function xl(e) {
|
|
return Yf.range(
|
|
e.start(),
|
|
wl(e.soffset(), e.start()),
|
|
e.finish(),
|
|
wl(e.foffset(), e.finish()),
|
|
);
|
|
}
|
|
function zl(e, t) {
|
|
return !Ge.isRestrictedNode(t.dom()) && (Bt(e, t) || ze(e, t));
|
|
}
|
|
function El(t) {
|
|
return function (e) {
|
|
return zl(t, e.start()) && zl(t, e.finish());
|
|
};
|
|
}
|
|
function Nl(e) {
|
|
return !0 === e.inline || Gf.isIE();
|
|
}
|
|
function Sl(e) {
|
|
return Yf.range(
|
|
bt.fromDom(e.startContainer),
|
|
e.startOffset,
|
|
bt.fromDom(e.endContainer),
|
|
e.endOffset,
|
|
);
|
|
}
|
|
function kl(e) {
|
|
var t = e.getSelection();
|
|
return (t && 0 !== t.rangeCount ? k.from(t.getRangeAt(0)) : k.none()).map(
|
|
Sl,
|
|
);
|
|
}
|
|
function Tl(e) {
|
|
var t = Ne(e);
|
|
return kl(t.dom()).filter(El(e));
|
|
}
|
|
function Al(e, t) {
|
|
return k.from(t).filter(El(e)).map(xl);
|
|
}
|
|
function Ml(e) {
|
|
var t = j.document.createRange();
|
|
try {
|
|
return (
|
|
t.setStart(e.start().dom(), e.soffset()),
|
|
t.setEnd(e.finish().dom(), e.foffset()),
|
|
k.some(t)
|
|
);
|
|
} catch (n) {
|
|
return k.none();
|
|
}
|
|
}
|
|
function Rl(t) {
|
|
return (t.bookmark ? t.bookmark : k.none())
|
|
.bind(function (e) {
|
|
return Al(bt.fromDom(t.getBody()), e);
|
|
})
|
|
.bind(Ml);
|
|
}
|
|
function Dl(t, e) {
|
|
oe().browser.isIE()
|
|
? (function (e) {
|
|
e.on("focusout", function () {
|
|
Jf(e);
|
|
});
|
|
})(t)
|
|
: (function (e, t) {
|
|
e.on("mouseup touchend", function (e) {
|
|
t.throttle();
|
|
});
|
|
})(t, e),
|
|
t.on("keyup NodeChange", function (e) {
|
|
!(function (e) {
|
|
return "nodechange" === e.type && e.selectionChange;
|
|
})(e) && Jf(t);
|
|
});
|
|
}
|
|
function _l(e) {
|
|
return ed.isEditorUIElement(e);
|
|
}
|
|
function Ol(t, e) {
|
|
var n = t ? t.settings.custom_ui_selector : "";
|
|
return (
|
|
null !==
|
|
nd.getParent(e, function (e) {
|
|
return _l(e) || (!!n && t.dom.is(e, n));
|
|
})
|
|
);
|
|
}
|
|
function Bl(r, e) {
|
|
var t = e.editor;
|
|
td(t),
|
|
t.on("focusin", function () {
|
|
var e = r.focusedEditor;
|
|
e !== this &&
|
|
(e && e.fire("blur", { focusedEditor: this }),
|
|
r.setActive(this),
|
|
(r.focusedEditor = this).fire("focus", { blurredEditor: e }),
|
|
this.focus(!0));
|
|
}),
|
|
t.on("focusout", function () {
|
|
var t = this;
|
|
vn.setEditorTimeout(t, function () {
|
|
var e = r.focusedEditor;
|
|
Ol(
|
|
t,
|
|
(function () {
|
|
try {
|
|
return j.document.activeElement;
|
|
} catch (e) {
|
|
return j.document.body;
|
|
}
|
|
})(),
|
|
) ||
|
|
e !== t ||
|
|
(t.fire("blur", { focusedEditor: null }), (r.focusedEditor = null));
|
|
});
|
|
}),
|
|
of ||
|
|
((of = function (e) {
|
|
var t,
|
|
n = r.activeEditor;
|
|
(t = e.target),
|
|
n &&
|
|
t.ownerDocument === j.document &&
|
|
(t === j.document.body ||
|
|
Ol(n, t) ||
|
|
r.focusedEditor !== n ||
|
|
(n.fire("blur", { focusedEditor: null }),
|
|
(r.focusedEditor = null)));
|
|
}),
|
|
nd.bind(j.document, "focusin", of));
|
|
}
|
|
function Hl(e, t) {
|
|
e.focusedEditor === t.editor && (e.focusedEditor = null),
|
|
e.activeEditor || (nd.unbind(j.document, "focusin", of), (of = null));
|
|
}
|
|
function Pl(t, e) {
|
|
return (function (e) {
|
|
return e.collapsed
|
|
? k.from(Xa(e.startContainer, e.startOffset)).map(bt.fromDom)
|
|
: k.none();
|
|
})(e).bind(function (e) {
|
|
return $n(e) ? k.some(e) : !1 === Bt(t, e) ? k.some(t) : k.none();
|
|
});
|
|
}
|
|
function Ll(t, e) {
|
|
Pl(bt.fromDom(t.getBody()), e)
|
|
.bind(function (e) {
|
|
return Lc.firstPositionIn(e.dom());
|
|
})
|
|
.fold(
|
|
function () {
|
|
t.selection.normalize();
|
|
},
|
|
function (e) {
|
|
return t.selection.setRng(e.toRange());
|
|
},
|
|
);
|
|
}
|
|
function Vl(e) {
|
|
if (e.setActive)
|
|
try {
|
|
e.setActive();
|
|
} catch (t) {
|
|
e.focus();
|
|
}
|
|
else e.focus();
|
|
}
|
|
function Il(e) {
|
|
return (
|
|
bl(e) ||
|
|
(function (t) {
|
|
return Cl(Ee(t)).filter(function (e) {
|
|
return t.dom().contains(e.dom());
|
|
});
|
|
})(e).isSome()
|
|
);
|
|
}
|
|
function Fl(e) {
|
|
return e.inline
|
|
? (function (e) {
|
|
var t = e.getBody();
|
|
return t && Il(bt.fromDom(t));
|
|
})(e)
|
|
: (function (e) {
|
|
return e.iframeElement && bl(bt.fromDom(e.iframeElement));
|
|
})(e);
|
|
}
|
|
function Ul(e) {
|
|
return e instanceof sl;
|
|
}
|
|
function jl(e, t) {
|
|
e.dom.setHTML(e.getBody(), t),
|
|
(function (r) {
|
|
sd(r) &&
|
|
Lc.firstPositionIn(r.getBody()).each(function (e) {
|
|
var t = e.getNode(),
|
|
n = Ge.isTable(t) ? Lc.firstPositionIn(t).getOr(e) : e;
|
|
r.selection.setRng(n.toRange());
|
|
});
|
|
})(e);
|
|
}
|
|
function ql(t, n, r) {
|
|
return (
|
|
void 0 === r && (r = {}),
|
|
(r.format = r.format ? r.format : "html"),
|
|
(r.set = !0),
|
|
(r.content = Ul(n) ? "" : n),
|
|
Ul(n) || r.no_events || (t.fire("BeforeSetContent", r), (n = r.content)),
|
|
k.from(t.getBody()).fold($(n), function (e) {
|
|
return Ul(n)
|
|
? (function (e, t, n, r) {
|
|
yl(e.parser.getNodeFilters(), e.parser.getAttributeFilters(), n);
|
|
var o = vl({ validate: e.validate }, e.schema).serialize(n);
|
|
return (
|
|
(r.content = Kn(bt.fromDom(t)) ? o : Rn.trim(o)),
|
|
jl(e, r.content),
|
|
r.no_events || e.fire("SetContent", r),
|
|
n
|
|
);
|
|
})(t, e, n, r)
|
|
: (function (e, t, n, r) {
|
|
var o, i;
|
|
return (
|
|
0 === n.length || /^\s+$/.test(n)
|
|
? ((i = '<br data-mce-bogus="1">'),
|
|
"TABLE" === t.nodeName
|
|
? (n = "<tr><td>" + i + "</td></tr>")
|
|
: /^(UL|OL)$/.test(t.nodeName) &&
|
|
(n = "<li>" + i + "</li>"),
|
|
(n =
|
|
(o = gf(e)) &&
|
|
e.schema.isValidChild(
|
|
t.nodeName.toLowerCase(),
|
|
o.toLowerCase(),
|
|
)
|
|
? ((n = i),
|
|
e.dom.createHTML(
|
|
o,
|
|
e.settings.forced_root_block_attrs,
|
|
n,
|
|
))
|
|
: n || '<br data-mce-bogus="1">'),
|
|
jl(e, n),
|
|
e.fire("SetContent", r))
|
|
: ("raw" !== r.format &&
|
|
(n = vl({ validate: e.validate }, e.schema).serialize(
|
|
e.parser.parse(n, { isRootContent: !0, insert: !0 }),
|
|
)),
|
|
(r.content = Kn(bt.fromDom(t)) ? n : Rn.trim(n)),
|
|
jl(e, r.content),
|
|
r.no_events || e.fire("SetContent", r)),
|
|
r.content
|
|
);
|
|
})(t, e, n, r);
|
|
})
|
|
);
|
|
}
|
|
function $l(e) {
|
|
return k.from(e).each(function (e) {
|
|
return e.destroy();
|
|
});
|
|
}
|
|
function Wl(e) {
|
|
if (!e.removed) {
|
|
var 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 && vd.remove(o.nextSibling),
|
|
dd(e),
|
|
e.editorManager.remove(e),
|
|
!e.inline &&
|
|
r &&
|
|
(function (e) {
|
|
vd.setStyle(e.id, "display", e.orgDisplay);
|
|
})(e),
|
|
hd(e),
|
|
vd.remove(e.getContainer()),
|
|
$l(t),
|
|
$l(n),
|
|
e.destroy();
|
|
}
|
|
}
|
|
function Kl(e, t) {
|
|
var n = e.selection,
|
|
r = e.dom;
|
|
e.destroyed ||
|
|
(t || e.removed
|
|
? (t ||
|
|
(e.editorManager.off("beforeunload", e._beforeUnload),
|
|
e.theme && e.theme.destroy && e.theme.destroy(),
|
|
$l(n),
|
|
$l(r)),
|
|
(function (e) {
|
|
var t = e.formElement;
|
|
t &&
|
|
(t._mceOldSubmit &&
|
|
((t.submit = t._mceOldSubmit), (t._mceOldSubmit = null)),
|
|
vd.unbind(t, "submit reset", e.formEventDelegate));
|
|
})(e),
|
|
(function (e) {
|
|
(e.contentAreaContainer =
|
|
e.formElement =
|
|
e.container =
|
|
e.editorContainer =
|
|
null),
|
|
(e.bodyElement = e.contentDocument = e.contentWindow = null),
|
|
(e.iframeElement = e.targetElm = null),
|
|
e.selection &&
|
|
(e.selection =
|
|
e.selection.win =
|
|
e.selection.dom =
|
|
e.selection.dom.doc =
|
|
null);
|
|
})(e),
|
|
(e.destroyed = !0))
|
|
: e.remove());
|
|
}
|
|
function Xl(a) {
|
|
return function () {
|
|
for (var e = new Array(arguments.length), t = 0; t < e.length; t++)
|
|
e[t] = arguments[t];
|
|
if (0 === e.length) throw new Error("Can't merge zero objects");
|
|
for (var n = {}, r = 0; r < e.length; r++) {
|
|
var o = e[r];
|
|
for (var i in o) yd.call(o, i) && (n[i] = a(n[i], o[i]));
|
|
}
|
|
return n;
|
|
};
|
|
}
|
|
function Yl(e) {
|
|
var t = A(e) ? e.join(" ") : e,
|
|
n = X(K(t) ? t.split(" ") : [], te);
|
|
return y(n, function (e) {
|
|
return 0 < e.length;
|
|
});
|
|
}
|
|
function Gl(e, t) {
|
|
return e.sections().hasOwnProperty(t);
|
|
}
|
|
function Jl(e, t, n, r) {
|
|
var o = Yl(n.forced_plugins),
|
|
i = Yl(r.plugins),
|
|
a = (function (e, t) {
|
|
return Gl(e, t) ? e.sections()[t] : {};
|
|
})(t, "mobile"),
|
|
u = a.plugins ? Yl(a.plugins) : i,
|
|
s = (function (e, t) {
|
|
return [].concat(Yl(e)).concat(Yl(t));
|
|
})(
|
|
o,
|
|
e &&
|
|
(function (e, t, n) {
|
|
var r = e.sections();
|
|
return Gl(e, t) && r[t].theme === n;
|
|
})(t, "mobile", "mobile")
|
|
? (function (e) {
|
|
return y(e, d(h, Sd));
|
|
})(u)
|
|
: e && Gl(t, "mobile")
|
|
? u
|
|
: i,
|
|
);
|
|
return Rn.extend(r, { plugins: s.join(" ") });
|
|
}
|
|
function Ql(e, t, n, r, o) {
|
|
var i = e
|
|
? {
|
|
mobile: (function (e) {
|
|
return G(
|
|
G(G({}, kd), {
|
|
resize: !1,
|
|
toolbar_drawer: "scrolling",
|
|
toolbar_sticky: !1,
|
|
}),
|
|
e ? { menubar: !1 } : {},
|
|
);
|
|
})(t),
|
|
}
|
|
: {},
|
|
a = (function (n, e) {
|
|
var t = ce(e, function (e, t) {
|
|
return h(n, t);
|
|
});
|
|
return wd(t.t, t.f);
|
|
})(["mobile"], bd(i, o)),
|
|
u = Rn.extend(
|
|
n,
|
|
r,
|
|
a.settings(),
|
|
(function (e, t) {
|
|
return e && Gl(t, "mobile");
|
|
})(e, a)
|
|
? (function (e, t, n) {
|
|
void 0 === n && (n = {});
|
|
var r = e.sections(),
|
|
o = r.hasOwnProperty(t) ? r[t] : {};
|
|
return Rn.extend({}, n, o);
|
|
})(a, "mobile")
|
|
: {},
|
|
{
|
|
validate: !0,
|
|
external_plugins: (function (e, t) {
|
|
var n = t.external_plugins ? t.external_plugins : {};
|
|
return e && e.external_plugins
|
|
? Rn.extend({}, e.external_plugins, n)
|
|
: n;
|
|
})(r, a.settings()),
|
|
},
|
|
);
|
|
return Jl(e, a, r, u);
|
|
}
|
|
function Zl(e, t, n, r, o) {
|
|
var i = (function (e, t, n, r) {
|
|
var o = {
|
|
id: e,
|
|
theme: "silver",
|
|
toolbar_drawer: "floating",
|
|
plugins: "",
|
|
document_base_url: t,
|
|
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: r.convertURL,
|
|
url_converter_scope: r,
|
|
};
|
|
return G(G({}, o), n ? kd : {});
|
|
})(t, n, zd, e);
|
|
return Ql(Ed || Nd, Ed, i, r, o);
|
|
}
|
|
function ef(e, t, n) {
|
|
return k.from(t.settings[n]).filter(e);
|
|
}
|
|
function tf(e, t, n, r) {
|
|
var o = t in e.settings ? e.settings[t] : n;
|
|
return "hash" === r
|
|
? (function (e) {
|
|
var n = {};
|
|
return (
|
|
"string" == typeof e
|
|
? z(
|
|
0 < e.indexOf("=")
|
|
? e.split(/[;,](?![^=;,]*(?:[;,]|$))/)
|
|
: e.split(","),
|
|
function (e) {
|
|
var t = e.split("=");
|
|
1 < t.length
|
|
? (n[Rn.trim(t[0])] = Rn.trim(t[1]))
|
|
: (n[Rn.trim(t[0])] = Rn.trim(t[0]));
|
|
},
|
|
)
|
|
: (n = e),
|
|
n
|
|
);
|
|
})(o)
|
|
: "string" === r
|
|
? ef(K, e, t).getOr(n)
|
|
: "number" === r
|
|
? ef(_, e, t).getOr(n)
|
|
: "boolean" === r
|
|
? ef(R, e, t).getOr(n)
|
|
: "object" === r
|
|
? ef(T, e, t).getOr(n)
|
|
: "array" === r
|
|
? ef(A, e, t).getOr(n)
|
|
: "string[]" === r
|
|
? ef(
|
|
(function (t) {
|
|
return function (e) {
|
|
return A(e) && w(e, t);
|
|
};
|
|
})(K),
|
|
e,
|
|
t,
|
|
).getOr(n)
|
|
: "function" === r
|
|
? ef(D, e, t).getOr(n)
|
|
: o;
|
|
}
|
|
function nf(e, t) {
|
|
return t.dom()[e];
|
|
}
|
|
function rf(e, t) {
|
|
return parseInt(ve(t, e), 10);
|
|
}
|
|
var of,
|
|
af = dl,
|
|
uf = { trimExternal: hl, trimInternal: hl },
|
|
sf = function (e) {
|
|
return e.getParam("iframe_attrs", {});
|
|
},
|
|
cf = function (e) {
|
|
return e.getParam("doctype", "<!DOCTYPE html>");
|
|
},
|
|
lf = function (e) {
|
|
return e.getParam("document_base_url", "");
|
|
},
|
|
ff = function (e) {
|
|
return ml(e, "body_id", "tinymce");
|
|
},
|
|
df = function (e) {
|
|
return ml(e, "body_class", "");
|
|
},
|
|
hf = function (e) {
|
|
return e.getParam("content_security_policy", "");
|
|
},
|
|
mf = function (e) {
|
|
return e.getParam("br_in_pre", !0);
|
|
},
|
|
gf = function (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;
|
|
},
|
|
pf = function (e) {
|
|
return e.getParam("forced_root_block_attrs", {});
|
|
},
|
|
vf = function (e) {
|
|
return e.getParam(
|
|
"br_newline_selector",
|
|
".mce-toc h2,figcaption,caption",
|
|
);
|
|
},
|
|
yf = function (e) {
|
|
return e.getParam("no_newline_selector", "");
|
|
},
|
|
bf = function (e) {
|
|
return e.getParam("keep_styles", !0);
|
|
},
|
|
Cf = function (e) {
|
|
return e.getParam("end_container_on_empty_block", !1);
|
|
},
|
|
wf = function (e) {
|
|
return Rn.explode(
|
|
e.getParam(
|
|
"font_size_style_values",
|
|
"xx-small,x-small,small,medium,large,x-large,xx-large",
|
|
),
|
|
);
|
|
},
|
|
xf = function (e) {
|
|
return Rn.explode(e.getParam("font_size_classes", ""));
|
|
},
|
|
zf = function (e) {
|
|
return e.getParam("icons", "", "string");
|
|
},
|
|
Ef = function (e) {
|
|
return e.getParam("icons_url", "", "string");
|
|
},
|
|
Nf = function (e) {
|
|
return e.getParam("images_dataimg_filter", $(!0), "function");
|
|
},
|
|
Sf = function (e) {
|
|
return e.getParam("automatic_uploads", !0, "boolean");
|
|
},
|
|
kf = function (e) {
|
|
return e.getParam("images_reuse_filename", !1, "boolean");
|
|
},
|
|
Tf = function (e) {
|
|
return e.getParam("images_replace_blob_uris", !0, "boolean");
|
|
},
|
|
Af = function (e) {
|
|
return e.getParam("images_upload_url", "", "string");
|
|
},
|
|
Mf = function (e) {
|
|
return e.getParam("images_upload_base_path", "", "string");
|
|
},
|
|
Rf = function (e) {
|
|
return e.getParam("images_upload_credentials", !1, "boolean");
|
|
},
|
|
Df = function (e) {
|
|
return e.getParam("images_upload_handler", null, "function");
|
|
},
|
|
_f = function (e) {
|
|
return e.getParam("content_css_cors", !1, "boolean");
|
|
},
|
|
Of = function (e) {
|
|
return e.getParam("referrer_policy", "", "string");
|
|
},
|
|
Bf = function (e) {
|
|
return e.getParam("language", "en", "string");
|
|
},
|
|
Hf = function (e) {
|
|
return e.getParam("language_url", "", "string");
|
|
},
|
|
Pf = function (e) {
|
|
return e.getParam("indent_use_margin", !1);
|
|
},
|
|
Lf = function (e) {
|
|
return e.getParam("indentation", "40px", "string");
|
|
},
|
|
Vf = function (e) {
|
|
var t = e.settings.content_css;
|
|
return K(t)
|
|
? X(t.split(","), te)
|
|
: A(t)
|
|
? t
|
|
: !1 === t || e.inline
|
|
? []
|
|
: ["default"];
|
|
},
|
|
If = function (e) {
|
|
return e.getParam("directionality", oa.isRtl() ? "rtl" : undefined);
|
|
},
|
|
Ff = function (e) {
|
|
return e.getParam(
|
|
"inline_boundaries_selector",
|
|
"a[href],code,.mce-annotation",
|
|
"string",
|
|
);
|
|
},
|
|
Uf = Rn.makeMap,
|
|
jf = function (e, t) {
|
|
t(e), e.firstChild && jf(e.firstChild, t), e.next && jf(e.next, t);
|
|
},
|
|
qf = function (a) {
|
|
if (!A(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 (
|
|
z(a, function (e, r) {
|
|
var t = Nt(e);
|
|
if (1 !== t.length) throw new Error("one and only one name per case");
|
|
var o = t[0],
|
|
i = e[o];
|
|
if (n[o] !== undefined)
|
|
throw new Error("duplicate key detected:" + o);
|
|
if ("cata" === o)
|
|
throw new Error("cannot have a case named cata (sorry)");
|
|
if (!A(i)) throw new Error("case arguments must be an array");
|
|
u.push(o),
|
|
(n[o] = function () {
|
|
var e = arguments.length;
|
|
if (e !== i.length)
|
|
throw new Error(
|
|
"Wrong number of arguments to case " +
|
|
o +
|
|
". Expected " +
|
|
i.length +
|
|
" (" +
|
|
i +
|
|
"), got " +
|
|
e,
|
|
);
|
|
for (var n = new Array(e), t = 0; t < n.length; t++)
|
|
n[t] = arguments[t];
|
|
return {
|
|
fold: function () {
|
|
if (arguments.length !== a.length)
|
|
throw new Error(
|
|
"Wrong number of arguments to fold. Expected " +
|
|
a.length +
|
|
", got " +
|
|
arguments.length,
|
|
);
|
|
return arguments[r].apply(null, n);
|
|
},
|
|
match: function (e) {
|
|
var t = Nt(e);
|
|
if (u.length !== t.length)
|
|
throw new Error(
|
|
"Wrong number of arguments to match. Expected: " +
|
|
u.join(",") +
|
|
"\nActual: " +
|
|
t.join(","),
|
|
);
|
|
if (
|
|
!w(u, function (e) {
|
|
return h(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) {
|
|
j.console.log(e, {
|
|
constructors: u,
|
|
constructor: o,
|
|
params: n,
|
|
});
|
|
},
|
|
};
|
|
});
|
|
}),
|
|
n
|
|
);
|
|
},
|
|
$f = { create: be("start", "soffset", "finish", "foffset") },
|
|
Wf = qf([
|
|
{ before: ["element"] },
|
|
{ on: ["element", "offset"] },
|
|
{ after: ["element"] },
|
|
]),
|
|
Kf =
|
|
(Wf.before,
|
|
Wf.on,
|
|
Wf.after,
|
|
function (e) {
|
|
return e.fold(W, W, W);
|
|
}),
|
|
Xf = qf([
|
|
{ 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 t = (function (e) {
|
|
return e.match({
|
|
domRange: function (e) {
|
|
return bt.fromDom(e.startContainer);
|
|
},
|
|
relative: function (e, t) {
|
|
return Kf(e);
|
|
},
|
|
exact: function (e, t, n, r) {
|
|
return e;
|
|
},
|
|
});
|
|
})(e);
|
|
return Ne(t);
|
|
},
|
|
range: $f.create,
|
|
},
|
|
Gf = oe().browser,
|
|
Jf = function (e) {
|
|
var t = Nl(e) ? Tl(bt.fromDom(e.getBody())) : k.none();
|
|
e.bookmark = t.isSome() ? t : e.bookmark;
|
|
},
|
|
Qf = function (t) {
|
|
Rl(t).each(function (e) {
|
|
t.selection.setRng(e);
|
|
});
|
|
},
|
|
Zf = Rl,
|
|
ed = {
|
|
isEditorUIElement: function (e) {
|
|
var t = e.className.toString();
|
|
return -1 !== t.indexOf("tox-") || -1 !== t.indexOf("mce-");
|
|
},
|
|
},
|
|
td = function (e) {
|
|
var t = ua(function () {
|
|
Jf(e);
|
|
}, 0);
|
|
e.on("init", function () {
|
|
e.inline &&
|
|
(function (e, t) {
|
|
function n() {
|
|
t.throttle();
|
|
}
|
|
Yi.DOM.bind(j.document, "mouseup", n),
|
|
e.on("remove", function () {
|
|
Yi.DOM.unbind(j.document, "mouseup", n);
|
|
});
|
|
})(e, t),
|
|
Dl(e, t);
|
|
}),
|
|
e.on("remove", function () {
|
|
t.cancel();
|
|
});
|
|
},
|
|
nd = Yi.DOM,
|
|
rd = function (e) {
|
|
e.on("AddEditor", d(Bl, e)), e.on("RemoveEditor", d(Hl, e));
|
|
},
|
|
od = function (e) {
|
|
var t = e.classList;
|
|
return (
|
|
t !== undefined &&
|
|
(t.contains("tox-edit-area") ||
|
|
t.contains("tox-edit-area__iframe") ||
|
|
t.contains("mce-content-body"))
|
|
);
|
|
},
|
|
id = Ol,
|
|
ad = function (e) {
|
|
return e.editorManager.setActive(e);
|
|
},
|
|
ud = function (e, t) {
|
|
e.removed ||
|
|
(t
|
|
? ad(e)
|
|
: (function (t) {
|
|
var e = t.selection,
|
|
n = t.getBody(),
|
|
r = e.getRng();
|
|
t.quirks.refreshContentEditable(),
|
|
t.bookmark !== undefined &&
|
|
!1 === Fl(t) &&
|
|
Zf(t).each(function (e) {
|
|
t.selection.setRng(e), (r = e);
|
|
});
|
|
var o = (function (t, e) {
|
|
return t.dom.getParent(e, function (e) {
|
|
return "true" === t.dom.getContentEditable(e);
|
|
});
|
|
})(t, e.getNode());
|
|
if (t.$.contains(n, o)) return Vl(o), Ll(t, r), ad(t);
|
|
t.inline || (Sn.opera || Vl(n), t.getWin().focus()),
|
|
(Sn.gecko || t.inline) && (Vl(n), Ll(t, r)),
|
|
ad(t);
|
|
})(e));
|
|
},
|
|
sd = Fl,
|
|
cd = function (e) {
|
|
return (
|
|
Fl(e) ||
|
|
(function (t) {
|
|
return Cl()
|
|
.filter(function (e) {
|
|
return !od(e.dom()) && id(t, e.dom());
|
|
})
|
|
.isSome();
|
|
})(e)
|
|
);
|
|
},
|
|
ld = function (e, t) {
|
|
return e.fire("PreProcess", t);
|
|
},
|
|
fd = function (e, t) {
|
|
return e.fire("PostProcess", t);
|
|
},
|
|
dd = function (e) {
|
|
return e.fire("remove");
|
|
},
|
|
hd = function (e) {
|
|
return e.fire("detach");
|
|
},
|
|
md = function (e, t) {
|
|
return e.fire("SwitchMode", { mode: t });
|
|
},
|
|
gd = function (e, t, n, r) {
|
|
e.fire("ObjectResizeStart", { target: t, width: n, height: r });
|
|
},
|
|
pd = function (e, t, n, r) {
|
|
e.fire("ObjectResized", { target: t, width: n, height: r });
|
|
},
|
|
vd = Yi.DOM,
|
|
yd = Object.prototype.hasOwnProperty,
|
|
bd = Xl(function (e, t) {
|
|
return T(e) && T(t) ? bd(e, t) : t;
|
|
}),
|
|
Cd = Xl(function (e, t) {
|
|
return t;
|
|
}),
|
|
wd = be("sections", "settings"),
|
|
xd = oe().deviceType,
|
|
zd = xd.isTouch(),
|
|
Ed = xd.isPhone(),
|
|
Nd = xd.isTablet(),
|
|
Sd = ["lists", "autolink", "autosave"],
|
|
kd = { table_grid: !1, object_resizing: !1, resize: !1 },
|
|
Td = d(nf, "clientWidth"),
|
|
Ad = d(nf, "clientHeight"),
|
|
Md = d(rf, "margin-top"),
|
|
Rd = d(rf, "margin-left"),
|
|
Dd = function (e, t, n) {
|
|
var r = bt.fromDom(e.getBody()),
|
|
o = e.inline
|
|
? r
|
|
: (function (e) {
|
|
return bt.fromDom(e.dom().ownerDocument.documentElement);
|
|
})(r),
|
|
i = (function (e, t, n, r) {
|
|
var o = (function (e) {
|
|
return e.dom().getBoundingClientRect();
|
|
})(t);
|
|
return {
|
|
x: n - (e ? o.left + t.dom().clientLeft + Rd(t) : 0),
|
|
y: r - (e ? o.top + t.dom().clientTop + Md(t) : 0),
|
|
};
|
|
})(e.inline, o, t, n);
|
|
return (function (e, t, n) {
|
|
var r = Td(e),
|
|
o = Ad(e);
|
|
return 0 <= t && 0 <= n && t <= r && n <= o;
|
|
})(o, i.x, i.y);
|
|
},
|
|
_d = function (e) {
|
|
return (function (e) {
|
|
return k.from(e).map(bt.fromDom);
|
|
})(e.inline ? e.getBody() : e.getContentAreaContainer())
|
|
.map(function (e) {
|
|
return Bt(Ee(e), e);
|
|
})
|
|
.getOr(!1);
|
|
};
|
|
function Od(n) {
|
|
function r() {
|
|
var e = n.theme;
|
|
return e && e.getNotificationManagerImpl
|
|
? e.getNotificationManagerImpl()
|
|
: (function t() {
|
|
function e() {
|
|
throw new Error(
|
|
"Theme did not provide a NotificationManager implementation.",
|
|
);
|
|
}
|
|
return { open: e, close: e, reposition: e, getArgs: e };
|
|
})();
|
|
}
|
|
function o() {
|
|
0 < u.length && r().reposition(u);
|
|
}
|
|
function i(t) {
|
|
p(u, function (e) {
|
|
return e === t;
|
|
}).each(function (e) {
|
|
u.splice(e, 1);
|
|
});
|
|
}
|
|
function t(t) {
|
|
if (!n.removed && _d(n))
|
|
return g(u, function (e) {
|
|
return (function (e, t) {
|
|
return !(
|
|
e.type !== t.type ||
|
|
e.text !== t.text ||
|
|
e.progressBar ||
|
|
e.timeout ||
|
|
t.progressBar ||
|
|
t.timeout
|
|
);
|
|
})(r().getArgs(e), t);
|
|
}).getOrThunk(function () {
|
|
n.editorManager.setActive(n);
|
|
var e = r().open(t, function () {
|
|
i(e), o();
|
|
});
|
|
return (
|
|
(function (e) {
|
|
u.push(e);
|
|
})(e),
|
|
o(),
|
|
e
|
|
);
|
|
});
|
|
}
|
|
var a,
|
|
u = [];
|
|
return (
|
|
(a = n).on("SkinLoaded", function () {
|
|
var e = a.settings.service_message;
|
|
e && t({ text: e, type: "warning", timeout: 0 });
|
|
}),
|
|
a.on("ResizeEditor ResizeWindow NodeChange", function () {
|
|
vn.requestAnimationFrame(o);
|
|
}),
|
|
a.on("remove", function () {
|
|
z(u.slice(), function (e) {
|
|
r().close(e);
|
|
});
|
|
}),
|
|
{
|
|
open: t,
|
|
close: function () {
|
|
k.from(u[0]).each(function (e) {
|
|
r().close(e), i(e), o();
|
|
});
|
|
},
|
|
getNotifications: function () {
|
|
return u;
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function Bd(n) {
|
|
function r() {
|
|
var e = n.theme;
|
|
return e && e.getWindowManagerImpl
|
|
? e.getWindowManagerImpl()
|
|
: (function t() {
|
|
function e() {
|
|
throw new Error(
|
|
"Theme did not provide a WindowManager implementation.",
|
|
);
|
|
}
|
|
return {
|
|
open: e,
|
|
openUrl: e,
|
|
alert: e,
|
|
confirm: e,
|
|
close: e,
|
|
getParams: e,
|
|
setParams: e,
|
|
};
|
|
})();
|
|
}
|
|
function o(e, t) {
|
|
return function () {
|
|
return t ? t.apply(e, arguments) : undefined;
|
|
};
|
|
}
|
|
function i(e) {
|
|
s.push(e),
|
|
(function (e) {
|
|
n.fire("OpenWindow", { dialog: e });
|
|
})(e);
|
|
}
|
|
function a(t) {
|
|
!(function (e) {
|
|
n.fire("CloseWindow", { dialog: e });
|
|
})(t),
|
|
0 ===
|
|
(s = y(s, function (e) {
|
|
return e !== t;
|
|
})).length && n.focus();
|
|
}
|
|
function u(e) {
|
|
n.editorManager.setActive(n), Jf(n);
|
|
var t = e();
|
|
return i(t), t;
|
|
}
|
|
var s = [];
|
|
return (
|
|
n.on("remove", function () {
|
|
z(s, function (e) {
|
|
r().close(e);
|
|
});
|
|
}),
|
|
{
|
|
open: function (e, t) {
|
|
return u(function () {
|
|
return r().open(e, t, a);
|
|
});
|
|
},
|
|
openUrl: function (e) {
|
|
return u(function () {
|
|
return r().openUrl(e, a);
|
|
});
|
|
},
|
|
alert: function (e, t, n) {
|
|
r().alert(e, o(n || this, t));
|
|
},
|
|
confirm: function (e, t, n) {
|
|
r().confirm(e, o(n || this, t));
|
|
},
|
|
close: function () {
|
|
k.from(s[s.length - 1]).each(function (e) {
|
|
r().close(e), a(e);
|
|
});
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function Hd(e, t) {
|
|
e.notificationManager.open({ type: "error", text: t });
|
|
}
|
|
function Pd(e, t) {
|
|
e._skinLoaded
|
|
? Hd(e, t)
|
|
: e.on("SkinLoaded", function () {
|
|
Hd(e, t);
|
|
});
|
|
}
|
|
function Ld(e) {
|
|
j.console.error(e);
|
|
}
|
|
function Vd(e, t, n) {
|
|
return n
|
|
? "Failed to load " + e + ": " + n + " from url " + t
|
|
: "Failed to load " + e + " url: " + t;
|
|
}
|
|
function Id(e) {
|
|
var t,
|
|
n,
|
|
r = decodeURIComponent(e).split(",");
|
|
return (
|
|
(n = /data:([^;]+)/.exec(r[0])) && (t = n[1]), { type: t, data: r[1] }
|
|
);
|
|
}
|
|
function Fd(e) {
|
|
return (e || "blobid") + Jd++;
|
|
}
|
|
var Ud,
|
|
jd = function (e) {
|
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
t[n - 1] = arguments[n];
|
|
var r = j.window.console;
|
|
r && (r.error ? r.error.apply(r, arguments) : r.log.apply(r, arguments));
|
|
},
|
|
qd = {
|
|
pluginLoadError: function (e, t) {
|
|
Ld(Vd("plugin", e, t));
|
|
},
|
|
iconsLoadError: function (e, t) {
|
|
Ld(Vd("icons", e, t));
|
|
},
|
|
languageLoadError: function (e, t) {
|
|
Ld(Vd("language", e, t));
|
|
},
|
|
pluginInitError: function (e, t, n) {
|
|
var r = oa.translate(["Failed to initialize plugin: {0}", t]);
|
|
jd(r, n), Pd(e, r);
|
|
},
|
|
uploadError: function (e, t) {
|
|
Pd(e, oa.translate(["Failed to upload image: {0}", t]));
|
|
},
|
|
displayError: Pd,
|
|
initError: jd,
|
|
},
|
|
$d =
|
|
((Ud = {}),
|
|
{
|
|
add: function (e, t) {
|
|
Ud[e] = t;
|
|
},
|
|
get: function (e) {
|
|
return Ud[e] ? Ud[e] : { icons: {} };
|
|
},
|
|
has: function (e) {
|
|
return Tt(Ud, e);
|
|
},
|
|
}),
|
|
Wd = pa.PluginManager,
|
|
Kd = pa.ThemeManager,
|
|
Xd = function (e) {
|
|
return 0 === e.indexOf("blob:")
|
|
? (function (i) {
|
|
return new en(function (e, t) {
|
|
function n() {
|
|
t(
|
|
"Cannot convert " +
|
|
i +
|
|
" to Blob. Resource might not exist or is inaccessible.",
|
|
);
|
|
}
|
|
try {
|
|
var r = new j.XMLHttpRequest();
|
|
r.open("GET", i, !0),
|
|
(r.responseType = "blob"),
|
|
(r.onload = function () {
|
|
200 === this.status ? e(this.response) : n();
|
|
}),
|
|
(r.onerror = n),
|
|
r.send();
|
|
} catch (o) {
|
|
n();
|
|
}
|
|
});
|
|
})(e)
|
|
: 0 === e.indexOf("data:")
|
|
? (function (i) {
|
|
return new en(function (e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o = Id(i);
|
|
try {
|
|
t = j.atob(o.data);
|
|
} catch (xN) {
|
|
return void e(new j.Blob([]));
|
|
}
|
|
for (n = new Uint8Array(t.length), r = 0; r < n.length; r++)
|
|
n[r] = t.charCodeAt(r);
|
|
e(new j.Blob([n], { type: o.type }));
|
|
});
|
|
})(e)
|
|
: null;
|
|
},
|
|
Yd = function (n) {
|
|
return new en(function (e) {
|
|
var t = new j.FileReader();
|
|
(t.onloadend = function () {
|
|
e(t.result);
|
|
}),
|
|
t.readAsDataURL(n);
|
|
});
|
|
},
|
|
Gd = Id,
|
|
Jd = 0;
|
|
function Qd(o, i) {
|
|
var a = {};
|
|
return {
|
|
findAll: function (e, n) {
|
|
var t;
|
|
(n = n || $(!0)),
|
|
(t = y(
|
|
(function (e) {
|
|
return e ? P(e.getElementsByTagName("img")) : [];
|
|
})(e),
|
|
function (e) {
|
|
var t = e.src;
|
|
return (
|
|
!!Sn.fileApi &&
|
|
!e.hasAttribute("data-mce-bogus") &&
|
|
!e.hasAttribute("data-mce-placeholder") &&
|
|
!(!t || t === Sn.transparentSrc) &&
|
|
(0 === t.indexOf("blob:")
|
|
? !o.isUploaded(t) && n(e)
|
|
: 0 === t.indexOf("data:") && n(e))
|
|
);
|
|
},
|
|
));
|
|
var r = X(t, function (n) {
|
|
if (a[n.src])
|
|
return new en(function (t) {
|
|
a[n.src].then(function (e) {
|
|
if ("string" == typeof e) return e;
|
|
t({ image: n, blobInfo: e.blobInfo });
|
|
});
|
|
});
|
|
var e = new en(function (e, t) {
|
|
!(function (n, r, o, t) {
|
|
var i, a;
|
|
0 !== r.src.indexOf("blob:")
|
|
? ((i = Gd(r.src).data),
|
|
(a = n.findFirst(function (e) {
|
|
return e.base64() === i;
|
|
}))
|
|
? o({ image: r, blobInfo: a })
|
|
: Xd(r.src).then(
|
|
function (e) {
|
|
(a = n.create(Fd(), e, i)),
|
|
n.add(a),
|
|
o({ image: r, blobInfo: a });
|
|
},
|
|
function (e) {
|
|
t(e);
|
|
},
|
|
))
|
|
: (a = n.getByUri(r.src))
|
|
? o({ image: r, blobInfo: a })
|
|
: Xd(r.src).then(
|
|
function (t) {
|
|
Yd(t).then(function (e) {
|
|
(i = Gd(e).data),
|
|
(a = n.create(Fd(), t, i)),
|
|
n.add(a),
|
|
o({ image: r, blobInfo: a });
|
|
});
|
|
},
|
|
function (e) {
|
|
t(e);
|
|
},
|
|
);
|
|
})(i, n, e, t);
|
|
})
|
|
.then(function (e) {
|
|
return delete a[e.image.src], e;
|
|
})
|
|
["catch"](function (e) {
|
|
return delete a[n.src], e;
|
|
});
|
|
return (a[n.src] = e);
|
|
});
|
|
return en.all(r);
|
|
},
|
|
};
|
|
}
|
|
function Zd(s, a) {
|
|
function n(e, t, n, r) {
|
|
var o, i;
|
|
(o = new j.XMLHttpRequest()).open("POST", a.url),
|
|
(o.withCredentials = a.credentials),
|
|
(o.upload.onprogress = function (e) {
|
|
r((e.loaded / e.total) * 100);
|
|
}),
|
|
(o.onerror = function () {
|
|
n(
|
|
"Image upload failed due to a XHR Transport error. Code: " +
|
|
o.status,
|
|
);
|
|
}),
|
|
(o.onload = function () {
|
|
var e;
|
|
o.status < 200 || 300 <= o.status
|
|
? n("HTTP Error: " + o.status)
|
|
: (e = JSON.parse(o.responseText)) && "string" == typeof e.location
|
|
? t(
|
|
(function (e, t) {
|
|
return e
|
|
? e.replace(/\/$/, "") + "/" + t.replace(/^\//, "")
|
|
: t;
|
|
})(a.basePath, e.location),
|
|
)
|
|
: n("Invalid JSON: " + o.responseText);
|
|
}),
|
|
(i = new j.FormData()).append("file", e.blob(), e.filename()),
|
|
o.send(i);
|
|
}
|
|
function c(e, t) {
|
|
return { url: t, blobInfo: e, status: !0 };
|
|
}
|
|
function l(e, t) {
|
|
return { url: "", blobInfo: e, status: !1, error: t };
|
|
}
|
|
function f(e, t) {
|
|
Rn.each(o[e], function (e) {
|
|
e(t);
|
|
}),
|
|
delete o[e];
|
|
}
|
|
function r(e, t) {
|
|
return (
|
|
(e = Rn.grep(e, function (e) {
|
|
return !s.isUploaded(e.blobUri());
|
|
})),
|
|
en.all(
|
|
Rn.map(e, function (e) {
|
|
return s.isPending(e.blobUri())
|
|
? (function (e) {
|
|
var t = e.blobUri();
|
|
return new en(function (e) {
|
|
(o[t] = o[t] || []), o[t].push(e);
|
|
});
|
|
})(e)
|
|
: (function (i, a, u) {
|
|
return (
|
|
s.markPending(i.blobUri()),
|
|
new en(function (t) {
|
|
function e() {}
|
|
var n;
|
|
try {
|
|
var r = function () {
|
|
n && (n.close(), e);
|
|
};
|
|
a(
|
|
i,
|
|
function (e) {
|
|
r(),
|
|
s.markUploaded(i.blobUri(), e),
|
|
f(i.blobUri(), c(i, e)),
|
|
t(c(i, e));
|
|
},
|
|
function (e) {
|
|
r(),
|
|
s.removeFailed(i.blobUri()),
|
|
f(i.blobUri(), l(i, e)),
|
|
t(l(i, e));
|
|
},
|
|
function (e) {
|
|
e < 0 ||
|
|
100 < e ||
|
|
(n = n || u()).progressBar.value(e);
|
|
},
|
|
);
|
|
} catch (o) {
|
|
t(l(i, o.message));
|
|
}
|
|
})
|
|
);
|
|
})(e, a.handler, t);
|
|
}),
|
|
)
|
|
);
|
|
}
|
|
var o = {};
|
|
return (
|
|
!1 === D(a.handler) && (a.handler = n),
|
|
{
|
|
upload: function (e, t) {
|
|
return !a.url &&
|
|
(function (e) {
|
|
return e === n;
|
|
})(a.handler)
|
|
? new en(function (e) {
|
|
e([]);
|
|
})
|
|
: r(e, t);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function eh(o) {
|
|
function t(t) {
|
|
return function (e) {
|
|
return o.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 i(e, t, n) {
|
|
return (
|
|
(e = r(e, 'src="' + t + '"', 'src="' + n + '"')),
|
|
(e = r(e, 'data-mce-src="' + t + '"', 'data-mce-src="' + n + '"'))
|
|
);
|
|
}
|
|
function n(t, n) {
|
|
z(o.undoManager.data, function (e) {
|
|
"fragmented" === e.type
|
|
? (e.fragments = X(e.fragments, function (e) {
|
|
return i(e, t, n);
|
|
}))
|
|
: (e.content = i(e.content, t, n));
|
|
});
|
|
}
|
|
function a() {
|
|
return o.notificationManager.open({
|
|
text: o.translate("Image uploading..."),
|
|
type: "info",
|
|
timeout: -1,
|
|
progressBar: !0,
|
|
});
|
|
}
|
|
function u(e, t) {
|
|
h.removeByUri(e.src),
|
|
n(e.src, t),
|
|
o.$(e).attr({
|
|
src: kf(o) ? t + "?" + new Date().getTime() : t,
|
|
"data-mce-src": o.convertURL(t, "src"),
|
|
});
|
|
}
|
|
function s(n) {
|
|
return (
|
|
(f =
|
|
f ||
|
|
Zd(m, {
|
|
url: Af(o),
|
|
basePath: Mf(o),
|
|
credentials: Rf(o),
|
|
handler: Df(o),
|
|
})),
|
|
p().then(
|
|
t(function (r) {
|
|
var e = X(r, function (e) {
|
|
return e.blobInfo;
|
|
});
|
|
return f.upload(e, a).then(
|
|
t(function (e) {
|
|
var t = X(e, function (e, t) {
|
|
var n = r[t].image;
|
|
return (
|
|
e.status && Tf(o)
|
|
? u(n, e.url)
|
|
: e.error && qd.uploadError(o, e.error),
|
|
{ element: n, status: e.status }
|
|
);
|
|
});
|
|
return n && n(t), t;
|
|
}),
|
|
);
|
|
}),
|
|
)
|
|
);
|
|
}
|
|
function e(e) {
|
|
if (Sf(o)) return s(e);
|
|
}
|
|
function c(t) {
|
|
return (
|
|
!1 !==
|
|
w(g, function (e) {
|
|
return e(t);
|
|
}) &&
|
|
(0 !== t.getAttribute("src").indexOf("data:") || Nf(o)(t))
|
|
);
|
|
}
|
|
function l(e) {
|
|
return e.replace(/src="(blob:[^"]+)"/g, function (e, n) {
|
|
var t = m.getResultUri(n);
|
|
if (t) return 'src="' + t + '"';
|
|
var r = h.getByUri(n);
|
|
return (r =
|
|
r ||
|
|
b(
|
|
o.editorManager.get(),
|
|
function (e, t) {
|
|
return (
|
|
e || (t.editorUpload && t.editorUpload.blobCache.getByUri(n))
|
|
);
|
|
},
|
|
null,
|
|
))
|
|
? 'src="data:' + r.blob().type + ";base64," + r.base64() + '"'
|
|
: e;
|
|
});
|
|
}
|
|
var f,
|
|
d,
|
|
h = (function () {
|
|
var n = [],
|
|
o = function (e) {
|
|
var t, n;
|
|
if (!e.blob || !e.base64)
|
|
throw new Error(
|
|
"blob and base64 representations of the image are required for BlobInfo to be created",
|
|
);
|
|
return (
|
|
(t = e.id || lh("blobid")),
|
|
(n = e.name || t),
|
|
{
|
|
id: $(t),
|
|
name: $(n),
|
|
filename: $(
|
|
n +
|
|
"." +
|
|
(function (e) {
|
|
return (
|
|
{
|
|
"image/jpeg": "jpg",
|
|
"image/jpg": "jpg",
|
|
"image/gif": "gif",
|
|
"image/png": "png",
|
|
}[e.toLowerCase()] || "dat"
|
|
);
|
|
})(e.blob.type),
|
|
),
|
|
blob: $(e.blob),
|
|
base64: $(e.base64),
|
|
blobUri: $(e.blobUri || j.URL.createObjectURL(e.blob)),
|
|
uri: $(e.uri),
|
|
}
|
|
);
|
|
},
|
|
t = function (t) {
|
|
return e(function (e) {
|
|
return e.id() === t;
|
|
});
|
|
},
|
|
e = function (e) {
|
|
return y(n, e)[0];
|
|
};
|
|
return {
|
|
create: function (e, t, n, r) {
|
|
if (K(e)) return o({ id: e, name: r, blob: t, base64: n });
|
|
if (T(e)) return o(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;
|
|
});
|
|
},
|
|
findFirst: e,
|
|
removeByUri: function (t) {
|
|
n = y(n, function (e) {
|
|
return (
|
|
e.blobUri() !== t || (j.URL.revokeObjectURL(e.blobUri()), !1)
|
|
);
|
|
});
|
|
},
|
|
destroy: function () {
|
|
z(n, function (e) {
|
|
j.URL.revokeObjectURL(e.blobUri());
|
|
}),
|
|
(n = []);
|
|
},
|
|
};
|
|
})(),
|
|
m = (function v() {
|
|
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 = {};
|
|
},
|
|
};
|
|
})(),
|
|
g = [],
|
|
p = function () {
|
|
return (d = d || Qd(m, h)).findAll(o.getBody(), c).then(
|
|
t(function (e) {
|
|
return (
|
|
(e = y(e, function (e) {
|
|
return "string" != typeof e || (qd.displayError(o, e), !1);
|
|
})),
|
|
z(e, function (e) {
|
|
n(e.image.src, e.blobInfo.blobUri()),
|
|
(e.image.src = e.blobInfo.blobUri()),
|
|
e.image.removeAttribute("data-mce-src");
|
|
}),
|
|
e
|
|
);
|
|
}),
|
|
);
|
|
};
|
|
return (
|
|
o.on("SetContent", function () {
|
|
Sf(o) ? e() : p();
|
|
}),
|
|
o.on("RawSaveContent", function (e) {
|
|
e.content = l(e.content);
|
|
}),
|
|
o.on("GetContent", function (e) {
|
|
e.source_view || "raw" === e.format || (e.content = l(e.content));
|
|
}),
|
|
o.on("PostRender", function () {
|
|
o.parser.addNodeFilter("img", function (e) {
|
|
z(e, function (e) {
|
|
var t = e.attr("src");
|
|
if (!h.getByUri(t)) {
|
|
var n = m.getResultUri(t);
|
|
n && e.attr("src", n);
|
|
}
|
|
});
|
|
});
|
|
}),
|
|
{
|
|
blobCache: h,
|
|
addFilter: function (e) {
|
|
g.push(e);
|
|
},
|
|
uploadImages: s,
|
|
uploadImagesAuto: e,
|
|
scanForImages: p,
|
|
destroy: function () {
|
|
h.destroy(), m.destroy(), (d = f = null);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function th(e, t, n) {
|
|
return Bt(t, e)
|
|
? (function (e) {
|
|
return e.slice(0, -1);
|
|
})(
|
|
(function (e, t) {
|
|
for (
|
|
var n = D(t) ? t : c, r = e.dom(), o = [];
|
|
null !== r.parentNode && r.parentNode !== undefined;
|
|
|
|
) {
|
|
var i = r.parentNode,
|
|
a = bt.fromDom(i);
|
|
if ((o.push(a), !0 === n(a))) break;
|
|
r = i;
|
|
}
|
|
return o;
|
|
})(e, function (e) {
|
|
return n(e) || ze(e, t);
|
|
}),
|
|
)
|
|
: [];
|
|
}
|
|
function nh(e, t) {
|
|
return th(e, t, $(!1));
|
|
}
|
|
function rh(e, t) {
|
|
return e.hasOwnProperty(t.nodeName);
|
|
}
|
|
function oh(e, t) {
|
|
if (Ge.isText(t)) {
|
|
if (0 === t.nodeValue.length) return !0;
|
|
if (/^\s+$/.test(t.nodeValue) && (!t.nextSibling || rh(e, t.nextSibling)))
|
|
return !0;
|
|
}
|
|
return !1;
|
|
}
|
|
function ih(e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = e.dom,
|
|
d = e.selection,
|
|
h = e.schema,
|
|
m = h.getBlockElements(),
|
|
g = d.getStart(),
|
|
p = e.getBody(),
|
|
v = gf(e);
|
|
if (
|
|
g &&
|
|
Ge.isElement(g) &&
|
|
v &&
|
|
((l = p.nodeName.toLowerCase()),
|
|
h.isValidChild(l, v.toLowerCase()) &&
|
|
!(function (t, e, n) {
|
|
return C(fh(bt.fromDom(n), bt.fromDom(e)), function (e) {
|
|
return rh(t, e.dom());
|
|
});
|
|
})(m, p, g))
|
|
) {
|
|
for (
|
|
n = (t = d.getRng()).startContainer,
|
|
r = t.startOffset,
|
|
o = t.endContainer,
|
|
i = t.endOffset,
|
|
c = sd(e),
|
|
g = p.firstChild;
|
|
g;
|
|
|
|
)
|
|
if (
|
|
((y = m),
|
|
(b = g),
|
|
Ge.isText(b) || (Ge.isElement(b) && !rh(y, b) && !Uc(b)))
|
|
) {
|
|
if (oh(m, g)) {
|
|
(g = (u = g).nextSibling), f.remove(u);
|
|
continue;
|
|
}
|
|
a ||
|
|
((a = f.create(v, pf(e))),
|
|
g.parentNode.insertBefore(a, g),
|
|
(s = !0)),
|
|
(g = (u = g).nextSibling),
|
|
a.appendChild(u);
|
|
} else (a = null), (g = g.nextSibling);
|
|
var y, b;
|
|
s &&
|
|
c &&
|
|
(t.setStart(n, r), t.setEnd(o, i), d.setRng(t), e.nodeChanged());
|
|
}
|
|
}
|
|
function ah(o, e) {
|
|
return Ga(
|
|
(function (e) {
|
|
var t = e.startContainer,
|
|
n = e.startOffset;
|
|
return Ge.isText(t)
|
|
? 0 === n
|
|
? k.some(bt.fromDom(t))
|
|
: k.none()
|
|
: k.from(t.childNodes[n]).map(bt.fromDom);
|
|
})(e),
|
|
(function (e) {
|
|
var t = e.endContainer,
|
|
n = e.endOffset;
|
|
return Ge.isText(t)
|
|
? n === t.data.length
|
|
? k.some(bt.fromDom(t))
|
|
: k.none()
|
|
: k.from(t.childNodes[n - 1]).map(bt.fromDom);
|
|
})(e),
|
|
function (e, t) {
|
|
var n = g(gh(o), d(ze, e)),
|
|
r = g(ph(o), d(ze, t));
|
|
return n.isSome() && r.isSome();
|
|
},
|
|
).getOr(!1);
|
|
}
|
|
function uh(e, t, n, r) {
|
|
var o = n,
|
|
i = new bi(n, o),
|
|
a = e.schema.getNonEmptyElements();
|
|
do {
|
|
if (3 === n.nodeType && 0 !== Rn.trim(n.nodeValue).length)
|
|
return void (r ? t.setStart(n, 0) : t.setEnd(n, n.nodeValue.length));
|
|
if (a[n.nodeName] && !/^(TD|TH)$/.test(n.nodeName))
|
|
return void (r
|
|
? t.setStartBefore(n)
|
|
: "BR" === n.nodeName
|
|
? t.setEndBefore(n)
|
|
: t.setEndAfter(n));
|
|
} while ((n = r ? i.next() : i.prev()));
|
|
"BODY" === o.nodeName &&
|
|
(r ? t.setStart(o, 0) : t.setEnd(o, o.childNodes.length));
|
|
}
|
|
function sh(e) {
|
|
var t = e.selection.getSel();
|
|
return t && 0 < t.rangeCount;
|
|
}
|
|
var ch = 0,
|
|
lh = function (e) {
|
|
return (
|
|
e +
|
|
ch++ +
|
|
(function () {
|
|
function e() {
|
|
return Math.round(4294967295 * Math.random()).toString(36);
|
|
}
|
|
return "s" + new Date().getTime().toString(36) + e() + e() + e();
|
|
})()
|
|
);
|
|
},
|
|
fh = nh,
|
|
dh = function (e, t) {
|
|
return [e].concat(nh(e, t));
|
|
},
|
|
hh = function (e) {
|
|
gf(e) && e.on("NodeChange", d(ih, e));
|
|
},
|
|
mh = function (e, t) {
|
|
return (
|
|
e &&
|
|
t &&
|
|
e.startContainer === t.startContainer &&
|
|
e.startOffset === t.startOffset &&
|
|
e.endContainer === t.endContainer &&
|
|
e.endOffset === t.endOffset
|
|
);
|
|
},
|
|
gh = function (t) {
|
|
return _e(t).fold($([t]), function (e) {
|
|
return [t].concat(gh(e));
|
|
});
|
|
},
|
|
ph = function (t) {
|
|
return Oe(t).fold($([t]), function (e) {
|
|
return "br" === ie(e)
|
|
? ke(e)
|
|
.map(function (e) {
|
|
return [t].concat(ph(e));
|
|
})
|
|
.getOr([])
|
|
: [t].concat(ph(e));
|
|
});
|
|
},
|
|
vh =
|
|
((yh.prototype.nodeChanged = function (e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o = this.editor.selection;
|
|
this.editor.initialized &&
|
|
o &&
|
|
!this.editor.settings.disable_nodechange &&
|
|
!this.editor.readonly &&
|
|
((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) {
|
|
if (e === r) return !0;
|
|
n.push(e);
|
|
}),
|
|
((e = e || {}).element = t),
|
|
(e.parents = n),
|
|
this.editor.fire("NodeChange", e));
|
|
}),
|
|
(yh.prototype.isSameElementPath = function (e) {
|
|
var t, n;
|
|
if (
|
|
(n = this.editor.$(e).parentsUntil(this.editor.getBody()).add(e))
|
|
.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;
|
|
}),
|
|
yh);
|
|
function yh(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, n;
|
|
(n = {
|
|
startContainer: (t = r.selection.getRng()).startContainer,
|
|
startOffset: t.startOffset,
|
|
endContainer: t.endContainer,
|
|
endOffset: t.endOffset,
|
|
}),
|
|
("nodechange" !== e.type && mh(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 ||
|
|
(!Sn.range && r.selection.isCollapsed()) ||
|
|
(sh(r) &&
|
|
!t.isSameElementPath(e) &&
|
|
r.dom.isChildOf(e, r.getBody()) &&
|
|
r.nodeChanged({ selectionChange: !0 }));
|
|
}),
|
|
r.on("mouseup", function (e) {
|
|
!e.isDefaultPrevented() &&
|
|
sh(r) &&
|
|
("IMG" === r.selection.getNode().nodeName
|
|
? vn.setEditorTimeout(r, function () {
|
|
r.nodeChanged();
|
|
})
|
|
: r.nodeChanged());
|
|
});
|
|
}
|
|
function bh(e) {
|
|
return /^[\r\n\t ]$/.test(e);
|
|
}
|
|
function Ch(e) {
|
|
return !bh(e) && !Rh(e);
|
|
}
|
|
function wh(n, r, o) {
|
|
return k
|
|
.from(o.container())
|
|
.filter(Ge.isText)
|
|
.exists(function (e) {
|
|
var t = n ? 0 : -1;
|
|
return r(e.data.charAt(o.offset() + t));
|
|
});
|
|
}
|
|
function xh(e) {
|
|
var t = e.container();
|
|
return Ge.isText(t) && 0 === t.data.length;
|
|
}
|
|
function zh(t, n) {
|
|
return function (e) {
|
|
return k
|
|
.from(xs(t ? 0 : -1, e))
|
|
.filter(n)
|
|
.isSome();
|
|
};
|
|
}
|
|
function Eh(e) {
|
|
return "IMG" === e.nodeName && "block" === ve(bt.fromDom(e), "display");
|
|
}
|
|
function Nh(e) {
|
|
return Ge.isContentEditableFalse(e) && !Ge.isBogusAll(e);
|
|
}
|
|
function Sh(e) {
|
|
return b(
|
|
e,
|
|
function (e, t) {
|
|
return e.concat(
|
|
(function (t) {
|
|
function e(e) {
|
|
return X(e, function (e) {
|
|
return ((e = Fa(e)).node = t), e;
|
|
});
|
|
}
|
|
if (Ge.isElement(t)) return e(t.getClientRects());
|
|
if (Ge.isText(t)) {
|
|
var n = t.ownerDocument.createRange();
|
|
return (
|
|
n.setStart(t, 0),
|
|
n.setEnd(t, t.data.length),
|
|
e(n.getClientRects())
|
|
);
|
|
}
|
|
})(t),
|
|
);
|
|
},
|
|
[],
|
|
);
|
|
}
|
|
var kh,
|
|
Th,
|
|
Ah,
|
|
Mh = {
|
|
BACKSPACE: 8,
|
|
DELETE: 46,
|
|
DOWN: 40,
|
|
ENTER: 13,
|
|
LEFT: 37,
|
|
RIGHT: 39,
|
|
SPACEBAR: 32,
|
|
TAB: 9,
|
|
UP: 38,
|
|
END: 35,
|
|
HOME: 36,
|
|
modifierPressed: function (e) {
|
|
return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
|
|
},
|
|
metaKeyPressed: function (e) {
|
|
return Sn.mac ? e.metaKey : e.ctrlKey && !e.altKey;
|
|
},
|
|
},
|
|
Rh =
|
|
((kh = "\xa0"),
|
|
function (e) {
|
|
return kh === e;
|
|
}),
|
|
Dh = d(wh, !0, bh),
|
|
_h = d(wh, !1, bh),
|
|
Oh = zh(!0, Eh),
|
|
Bh = zh(!1, Eh),
|
|
Hh = zh(!0, Ge.isTable),
|
|
Ph = zh(!1, Ge.isTable),
|
|
Lh = zh(!0, Nh),
|
|
Vh = zh(!1, Nh);
|
|
((Ah = Th = Th || {})[(Ah.Up = -1)] = "Up"), (Ah[(Ah.Down = 1)] = "Down");
|
|
function Ih(o, i, a, e, u, t) {
|
|
function n(e) {
|
|
var t, n, r;
|
|
for (r = Sh([e]), -1 === o && (r = r.reverse()), t = 0; t < r.length; t++)
|
|
if (((n = r[t]), !a(n, s))) {
|
|
if ((0 < l.length && i(n, Tn.last(l)) && c++, (n.line = c), u(n)))
|
|
return !0;
|
|
l.push(n);
|
|
}
|
|
}
|
|
var r,
|
|
s,
|
|
c = 0,
|
|
l = [];
|
|
return (
|
|
(s = Tn.last(t.getClientRects())) &&
|
|
(n((r = t.getNode())),
|
|
(function (e, t, n, r) {
|
|
for (; (r = bs(r, e, Ia, t)); ) if (n(r)) return;
|
|
})(o, e, n, r)),
|
|
l
|
|
);
|
|
}
|
|
function Fh(t) {
|
|
return function (e) {
|
|
return (function (e, t) {
|
|
return t.line > e;
|
|
})(t, e);
|
|
};
|
|
}
|
|
function Uh(t) {
|
|
return function (e) {
|
|
return (function (e, t) {
|
|
return t.line === e;
|
|
})(t, e);
|
|
};
|
|
}
|
|
function jh(e, t) {
|
|
return Math.abs(e.left - t);
|
|
}
|
|
function qh(e, t) {
|
|
return Math.abs(e.right - t);
|
|
}
|
|
function $h(e, t) {
|
|
return e >= t.left && e <= t.right;
|
|
}
|
|
function Wh(e, o) {
|
|
return Tn.reduce(e, function (e, t) {
|
|
var n, r;
|
|
return (
|
|
(n = Math.min(jh(e, o), qh(e, o))),
|
|
(r = Math.min(jh(t, o), qh(t, o))),
|
|
$h(o, t) ? t : $h(o, e) ? e : r === n && Gm(t.node) ? t : r < n ? t : e
|
|
);
|
|
});
|
|
}
|
|
function Kh(e, t, n, r) {
|
|
for (; (r = Jm(r, e, Ia, t)); ) if (n(r)) return;
|
|
}
|
|
function Xh(e, t, n) {
|
|
var r,
|
|
o = Sh(
|
|
(function (e) {
|
|
return y(P(e.getElementsByTagName("*")), gs);
|
|
})(e),
|
|
),
|
|
i = y(o, function (e) {
|
|
return n >= e.top && n <= e.bottom;
|
|
});
|
|
return (r =
|
|
(r = Wh(i, t)) &&
|
|
Wh(
|
|
(function (e, r) {
|
|
function t(t, e) {
|
|
var n;
|
|
return (
|
|
(n = y(Sh([e]), function (e) {
|
|
return !t(e, r);
|
|
})),
|
|
(o = o.concat(n)),
|
|
0 === n.length
|
|
);
|
|
}
|
|
var o = [];
|
|
return (
|
|
o.push(r),
|
|
Kh(Th.Up, e, d(t, qa), r.node),
|
|
Kh(Th.Down, e, d(t, $a), r.node),
|
|
o
|
|
);
|
|
})(e, r),
|
|
t,
|
|
)) && gs(r.node)
|
|
? (function (e, t) {
|
|
return { node: e.node, before: jh(e, t) < qh(e, t) };
|
|
})(r, t)
|
|
: null;
|
|
}
|
|
function Yh(e) {
|
|
var t, n, r, o;
|
|
return (
|
|
(o = e.getBoundingClientRect()),
|
|
(n = (t = e.ownerDocument).documentElement),
|
|
(r = t.defaultView),
|
|
{
|
|
top: o.top + r.pageYOffset - n.clientTop,
|
|
left: o.left + r.pageXOffset - n.clientLeft,
|
|
}
|
|
);
|
|
}
|
|
function Gh(e) {
|
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
}
|
|
function Jh(i, a) {
|
|
return function (e) {
|
|
if (
|
|
(function (e) {
|
|
return 0 === e.button;
|
|
})(e)
|
|
) {
|
|
var t = g(a.dom.getParents(e.target), Au(eg, tg)).getOr(null);
|
|
if (
|
|
(function (e, t) {
|
|
return eg(t) && t !== e;
|
|
})(a.getBody(), t)
|
|
) {
|
|
var n = a.dom.getPos(t),
|
|
r = a.getBody(),
|
|
o = a.getDoc().documentElement;
|
|
(i.element = t),
|
|
(i.screenX = e.screenX),
|
|
(i.screenY = e.screenY),
|
|
(i.maxX = (a.inline ? r.scrollWidth : o.offsetWidth) - 2),
|
|
(i.maxY = (a.inline ? r.scrollHeight : o.offsetHeight) - 2),
|
|
(i.relX = e.pageX - n.x),
|
|
(i.relY = e.pageY - n.y),
|
|
(i.width = t.offsetWidth),
|
|
(i.height = t.offsetHeight),
|
|
(i.ghost = (function (e, t, n, r) {
|
|
var o = t.cloneNode(!0);
|
|
e.dom.setStyles(o, { width: n, height: r }),
|
|
e.dom.setAttrib(o, "data-mce-selected", null);
|
|
var i = e.dom.create("div", {
|
|
class: "mce-drag-container",
|
|
"data-mce-bogus": "all",
|
|
unselectable: "on",
|
|
contenteditable: "false",
|
|
});
|
|
return (
|
|
e.dom.setStyles(i, {
|
|
position: "absolute",
|
|
opacity: 0.5,
|
|
overflow: "hidden",
|
|
border: 0,
|
|
padding: 0,
|
|
margin: 0,
|
|
width: n,
|
|
height: r,
|
|
}),
|
|
e.dom.setStyles(o, { margin: 0, boxSizing: "border-box" }),
|
|
i.appendChild(o),
|
|
i
|
|
);
|
|
})(a, t, i.width, i.height));
|
|
}
|
|
}
|
|
};
|
|
}
|
|
function Qh(r, o) {
|
|
return function (e) {
|
|
if (
|
|
r.dragging &&
|
|
(function (e, t, n) {
|
|
return t !== n && !e.dom.isChildOf(t, n) && !eg(t);
|
|
})(
|
|
o,
|
|
(function (e) {
|
|
var t = e.getSel().getRangeAt(0).startContainer;
|
|
return 3 === t.nodeType ? t.parentNode : t;
|
|
})(o.selection),
|
|
r.element,
|
|
)
|
|
) {
|
|
var t = (function (e) {
|
|
var t = e.cloneNode(!0);
|
|
return t.removeAttribute("data-mce-selected"), t;
|
|
})(r.element),
|
|
n = o.fire("drop", {
|
|
targetClone: t,
|
|
clientX: e.clientX,
|
|
clientY: e.clientY,
|
|
});
|
|
n.isDefaultPrevented() ||
|
|
((t = n.targetClone),
|
|
o.undoManager.transact(function () {
|
|
Gh(r.element),
|
|
o.insertContent(o.dom.getOuterHTML(t)),
|
|
o._selectionOverrides.hideFakeCaret();
|
|
}));
|
|
}
|
|
ng(r);
|
|
};
|
|
}
|
|
function Zh(e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = {};
|
|
(t = Yi.DOM),
|
|
(a = j.document),
|
|
(n = Jh(u, e)),
|
|
(r = (function (r, o) {
|
|
var i = vn.throttle(function (e, t) {
|
|
o._selectionOverrides.hideFakeCaret(), o.selection.placeCaretAt(e, t);
|
|
}, 0);
|
|
return function (e) {
|
|
var t = Math.max(
|
|
Math.abs(e.screenX - r.screenX),
|
|
Math.abs(e.screenY - r.screenY),
|
|
);
|
|
if (
|
|
(function (e) {
|
|
return e.element;
|
|
})(r) &&
|
|
!r.dragging &&
|
|
10 < t
|
|
) {
|
|
if (o.fire("dragstart", { target: r.element }).isDefaultPrevented())
|
|
return;
|
|
(r.dragging = !0), o.focus();
|
|
}
|
|
if (r.dragging) {
|
|
var n = (function (e, t) {
|
|
return { pageX: t.pageX - e.relX, pageY: t.pageY + 5 };
|
|
})(r, Zm(o, e));
|
|
!(function (e, t) {
|
|
e.parentNode !== t && t.appendChild(e);
|
|
})(r.ghost, o.getBody()),
|
|
(function (e, t, n, r, o, i) {
|
|
var a = 0,
|
|
u = 0;
|
|
(e.style.left = t.pageX + "px"),
|
|
(e.style.top = t.pageY + "px"),
|
|
t.pageX + n > o && (a = t.pageX + n - o),
|
|
t.pageY + r > i && (u = t.pageY + r - i),
|
|
(e.style.width = n - a + "px"),
|
|
(e.style.height = r - u + "px");
|
|
})(r.ghost, n, r.width, r.height, r.maxX, r.maxY),
|
|
i(e.clientX, e.clientY);
|
|
}
|
|
};
|
|
})(u, e)),
|
|
(o = Qh(u, e)),
|
|
(i = (function (e, t) {
|
|
return function () {
|
|
e.dragging && t.fire("dragend"), ng(e);
|
|
};
|
|
})(u, e)),
|
|
e.on("mousedown", n),
|
|
e.on("mousemove", r),
|
|
e.on("mouseup", o),
|
|
t.bind(a, "mousemove", r),
|
|
t.bind(a, "mouseup", i),
|
|
e.on("remove", function () {
|
|
t.unbind(a, "mousemove", r), t.unbind(a, "mouseup", i);
|
|
});
|
|
}
|
|
function em(e, t, n, r, o) {
|
|
return t._selectionOverrides.showCaret(e, n, r, o);
|
|
}
|
|
function tm(e, t) {
|
|
return e.fire("BeforeObjectSelected", { target: t }).isDefaultPrevented()
|
|
? null
|
|
: (function (e) {
|
|
var t = e.ownerDocument.createRange();
|
|
return t.selectNode(e), t;
|
|
})(t);
|
|
}
|
|
function nm(e, t, n) {
|
|
var r = Ns(1, e.getBody(), t),
|
|
o = _s.fromRangeStart(r),
|
|
i = o.getNode();
|
|
if (ig(i)) return em(1, e, i, !o.isAtEnd(), !1);
|
|
var a = o.getNode(!0);
|
|
if (ig(a)) return em(1, e, a, !1, !1);
|
|
var u = e.dom.getParent(o.getNode(), function (e) {
|
|
return ig(e) || og(e);
|
|
});
|
|
return ig(u) ? em(1, e, u, !1, n) : null;
|
|
}
|
|
function rm(e, t, n) {
|
|
if (!t || !t.collapsed) return t;
|
|
var r = nm(e, t, n);
|
|
return r || t;
|
|
}
|
|
function om(e, t) {
|
|
for (var n = e.getBody(); t && t !== n; ) {
|
|
if (ug(t) || sg(t)) return t;
|
|
t = t.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function im(g) {
|
|
function a(e) {
|
|
e && g.selection.setRng(e);
|
|
}
|
|
function o() {
|
|
return g.selection.getRng();
|
|
}
|
|
function p(e, t, n, r) {
|
|
return (
|
|
void 0 === r && (r = !0),
|
|
g
|
|
.fire("ShowCaret", { target: t, direction: e, before: n })
|
|
.isDefaultPrevented()
|
|
? null
|
|
: (r && g.selection.scrollIntoView(t, -1 === e), u.show(n, t))
|
|
);
|
|
}
|
|
function t(e) {
|
|
return _a(e) || mu(e) || gu(e);
|
|
}
|
|
var v,
|
|
y = g.getBody(),
|
|
u = hs(
|
|
g.getBody(),
|
|
function (e) {
|
|
return g.dom.isBlock(e);
|
|
},
|
|
function () {
|
|
return sd(g);
|
|
},
|
|
),
|
|
b = "sel-" + g.dom.uniqueId(),
|
|
C = function (e) {
|
|
return t(e.startContainer) || t(e.endContainer);
|
|
},
|
|
s = function (e) {
|
|
var t = g.schema.getShortEndedElements(),
|
|
n = g.dom.createRng(),
|
|
r = e.startContainer,
|
|
o = e.startOffset,
|
|
i = e.endContainer,
|
|
a = e.endOffset;
|
|
return (
|
|
Tt(t, r.nodeName.toLowerCase())
|
|
? 0 === o
|
|
? n.setStartBefore(r)
|
|
: n.setStartAfter(r)
|
|
: n.setStart(r, o),
|
|
Tt(t, i.nodeName.toLowerCase())
|
|
? 0 === a
|
|
? n.setEndBefore(i)
|
|
: n.setEndAfter(i)
|
|
: n.setEnd(i, a),
|
|
n
|
|
);
|
|
},
|
|
c = function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d = g.$,
|
|
h = g.dom;
|
|
if (!e) return null;
|
|
if (e.collapsed) {
|
|
if (!C(e))
|
|
if (!1 === t) {
|
|
if (((c = ks(-1, y, e)), gs(c.getNode(!0))))
|
|
return p(-1, c.getNode(!0), !1, !1);
|
|
if (gs(c.getNode())) return p(-1, c.getNode(), !c.isAtEnd(), !1);
|
|
} else {
|
|
if (((c = ks(1, y, e)), gs(c.getNode())))
|
|
return p(1, c.getNode(), !c.isAtEnd(), !1);
|
|
if (gs(c.getNode(!0))) return p(1, c.getNode(!0), !1, !1);
|
|
}
|
|
return null;
|
|
}
|
|
if (
|
|
((i = e.startContainer),
|
|
(a = e.startOffset),
|
|
(u = e.endOffset),
|
|
3 === i.nodeType &&
|
|
0 === a &&
|
|
sg(i.parentNode) &&
|
|
((i = i.parentNode), (a = h.nodeIndex(i)), (i = i.parentNode)),
|
|
1 !== i.nodeType)
|
|
)
|
|
return null;
|
|
if (
|
|
(u === a + 1 && i === e.endContainer && (n = i.childNodes[a]), !sg(n))
|
|
)
|
|
return null;
|
|
if (
|
|
((l = f = n.cloneNode(!0)),
|
|
(s = g.fire("ObjectSelected", {
|
|
target: n,
|
|
targetClone: l,
|
|
})).isDefaultPrevented())
|
|
)
|
|
return null;
|
|
(r = xa(bt.fromDom(g.getBody()), "#" + b).fold(
|
|
function () {
|
|
return d([]);
|
|
},
|
|
function (e) {
|
|
return d([e.dom()]);
|
|
},
|
|
)),
|
|
(l = s.targetClone),
|
|
0 === r.length &&
|
|
(r = d(
|
|
'<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',
|
|
).attr("id", b)).appendTo(g.getBody()),
|
|
(e = g.dom.createRng()),
|
|
l === f && Sn.ie
|
|
? (r
|
|
.empty()
|
|
.append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>')
|
|
.append(l),
|
|
e.setStartAfter(r[0].firstChild.firstChild),
|
|
e.setEndAfter(l))
|
|
: (r.empty().append("\xa0").append(l).append("\xa0"),
|
|
e.setStart(r[0].firstChild, 1),
|
|
e.setEnd(r[0].lastChild, 0)),
|
|
r.css({ top: h.getPos(n, g.getBody()).y }),
|
|
r[0].focus(),
|
|
(o = g.selection.getSel()).removeAllRanges(),
|
|
o.addRange(e);
|
|
var m = bt.fromDom(n);
|
|
return (
|
|
z(ga(bt.fromDom(g.getBody()), "*[data-mce-selected]"), function (e) {
|
|
ze(m, e) || pe(e, "data-mce-selected");
|
|
}),
|
|
g.dom.getAttrib(n, "data-mce-selected") ||
|
|
n.setAttribute("data-mce-selected", "1"),
|
|
(v = n),
|
|
w(),
|
|
e
|
|
);
|
|
},
|
|
l = function () {
|
|
v &&
|
|
(v.removeAttribute("data-mce-selected"),
|
|
xa(bt.fromDom(g.getBody()), "#" + b).each(Oi),
|
|
(v = null)),
|
|
xa(bt.fromDom(g.getBody()), "#" + b).each(Oi),
|
|
(v = null);
|
|
},
|
|
w = function () {
|
|
u.hide();
|
|
};
|
|
return (
|
|
Sn.ceFalse &&
|
|
(function () {
|
|
g.on("mouseup", function (e) {
|
|
var t = o();
|
|
t.collapsed && Dd(g, e.clientX, e.clientY) && a(nm(g, t, !1));
|
|
}),
|
|
g.on("click", function (e) {
|
|
var t;
|
|
(t = om(g, e.target)) &&
|
|
(sg(t) && (e.preventDefault(), g.focus()),
|
|
ug(t) && g.dom.isChildOf(t, g.selection.getNode()) && l());
|
|
}),
|
|
g.on("blur NewBlock", function () {
|
|
l();
|
|
}),
|
|
g.on("ResizeWindow FullscreenStateChanged", function () {
|
|
return u.reposition();
|
|
});
|
|
function i(e, t) {
|
|
var n = g.dom.getParent(e, g.dom.isBlock),
|
|
r = g.dom.getParent(t, g.dom.isBlock);
|
|
return (
|
|
!(!n || !g.dom.isChildOf(n, r) || !1 !== sg(om(g, n))) ||
|
|
(n &&
|
|
!(function (e, t) {
|
|
return (
|
|
g.dom.getParent(e, g.dom.isBlock) ===
|
|
g.dom.getParent(t, g.dom.isBlock)
|
|
);
|
|
})(n, r) &&
|
|
(function (e) {
|
|
var t = oc(e);
|
|
if (!e.firstChild) return !1;
|
|
var n = _s.before(e.firstChild),
|
|
r = t.next(n);
|
|
return r && !Lh(r) && !Vh(r);
|
|
})(n))
|
|
);
|
|
}
|
|
var n, r;
|
|
(r = !1),
|
|
(n = g).on("touchstart", function () {
|
|
r = !1;
|
|
}),
|
|
n.on("touchmove", function () {
|
|
r = !0;
|
|
}),
|
|
n.on(
|
|
"touchend",
|
|
function (e) {
|
|
if (!r) {
|
|
var t = om(n, e.target);
|
|
sg(t) && (e.preventDefault(), c(tm(n, t)));
|
|
}
|
|
},
|
|
!0,
|
|
),
|
|
g.on("mousedown", function (e) {
|
|
var t,
|
|
n = e.target;
|
|
if (
|
|
(n === y || "HTML" === n.nodeName || g.dom.isChildOf(n, y)) &&
|
|
!1 !== Dd(g, e.clientX, e.clientY)
|
|
)
|
|
if ((t = om(g, n)))
|
|
sg(t)
|
|
? (e.preventDefault(), c(tm(g, t)))
|
|
: (l(),
|
|
(ug(t) && e.shiftKey) ||
|
|
Qm(e.clientX, e.clientY, g.selection.getRng()) ||
|
|
(w(), g.selection.placeCaretAt(e.clientX, e.clientY)));
|
|
else if (!1 === gs(n)) {
|
|
l(), w();
|
|
var r = Xh(y, e.clientX, e.clientY);
|
|
if (r && !i(e.target, r.node)) {
|
|
e.preventDefault();
|
|
var o = p(1, r.node, r.before, !1);
|
|
g.getBody().focus(), a(o);
|
|
}
|
|
}
|
|
}),
|
|
g.on("keypress", function (e) {
|
|
Mh.modifierPressed(e) ||
|
|
(e.keyCode, sg(g.selection.getNode()) && e.preventDefault());
|
|
}),
|
|
g.on("GetSelectionRange", function (e) {
|
|
var t = e.range;
|
|
if (v) {
|
|
if (!v.parentNode) return void (v = null);
|
|
(t = t.cloneRange()).selectNode(v), (e.range = t);
|
|
}
|
|
}),
|
|
g.on("SetSelectionRange", function (e) {
|
|
e.range = s(e.range);
|
|
var t = c(e.range, e.forward);
|
|
t && (e.range = t);
|
|
});
|
|
g.on("AfterSetSelectionRange", function (e) {
|
|
var t = e.range;
|
|
C(t) ||
|
|
(function (e) {
|
|
return "mcepastebin" === e.id;
|
|
})(t.startContainer.parentNode) ||
|
|
w(),
|
|
(function (e) {
|
|
return g.dom.hasClass(e, "mce-offscreen-selection");
|
|
})(t.startContainer.parentNode) || l();
|
|
}),
|
|
g.on("copy", function (e) {
|
|
var t = e.clipboardData;
|
|
if (!e.isDefaultPrevented() && e.clipboardData && !Sn.ie) {
|
|
var n = (function () {
|
|
var e = g.dom.get(b);
|
|
return e ? e.getElementsByTagName("*")[0] : e;
|
|
})();
|
|
n &&
|
|
(e.preventDefault(),
|
|
t.clearData(),
|
|
t.setData("text/html", n.outerHTML),
|
|
t.setData("text/plain", n.outerText));
|
|
}
|
|
}),
|
|
rg(g),
|
|
ag(g);
|
|
})(),
|
|
{
|
|
showCaret: p,
|
|
showBlockCaretContainer: function (e) {
|
|
e.hasAttribute("data-mce-caret") &&
|
|
(La(e), a(o()), g.selection.scrollIntoView(e));
|
|
},
|
|
hideFakeCaret: w,
|
|
destroy: function () {
|
|
u.destroy(), (v = null);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function am(e) {
|
|
return Ge.isElement(e)
|
|
? e.outerHTML
|
|
: Ge.isText(e)
|
|
? ar.encodeRaw(e.data, !1)
|
|
: Ge.isComment(e)
|
|
? "\x3c!--" + e.data + "--\x3e"
|
|
: "";
|
|
}
|
|
function um(e, t, n) {
|
|
var r = (function (e) {
|
|
var t, n, r;
|
|
for (
|
|
r = j.document.createElement("div"),
|
|
t = j.document.createDocumentFragment(),
|
|
e && (r.innerHTML = e);
|
|
(n = r.firstChild);
|
|
|
|
)
|
|
t.appendChild(n);
|
|
return t;
|
|
})(t);
|
|
if (e.hasChildNodes() && n < e.childNodes.length) {
|
|
var o = e.childNodes[n];
|
|
o.parentNode.insertBefore(r, o);
|
|
} else e.appendChild(r);
|
|
}
|
|
function sm(e) {
|
|
return {
|
|
type: "fragmented",
|
|
fragments: e,
|
|
content: "",
|
|
bookmark: null,
|
|
beforeBookmark: null,
|
|
};
|
|
}
|
|
function cm(e) {
|
|
return {
|
|
type: "complete",
|
|
fragments: null,
|
|
content: e,
|
|
bookmark: null,
|
|
beforeBookmark: null,
|
|
};
|
|
}
|
|
function lm(e) {
|
|
return "fragmented" === e.type ? e.fragments.join("") : e.content;
|
|
}
|
|
function fm(e) {
|
|
var t = bt.fromTag(
|
|
"body",
|
|
gg.get().getOrThunk(function () {
|
|
var e = j.document.implementation.createHTMLDocument("undo");
|
|
return gg.set(k.some(e)), e;
|
|
}),
|
|
);
|
|
return (
|
|
Ma(t, lm(e)),
|
|
z(ga(t, "*[data-mce-bogus]"), Si),
|
|
(function (e) {
|
|
return e.dom().innerHTML;
|
|
})(t)
|
|
);
|
|
}
|
|
function dm(e) {
|
|
return 0 === e.get();
|
|
}
|
|
function hm(e, t, n) {
|
|
dm(n) && (e.typing = t);
|
|
}
|
|
function mm(e, t) {
|
|
e.typing && (hm(e, !1, t), e.add());
|
|
}
|
|
function gm(n) {
|
|
var r = Je(k.none()),
|
|
o = Je(0),
|
|
i = Je(0),
|
|
a = {
|
|
data: [],
|
|
typing: !1,
|
|
beforeChange: function () {
|
|
!(function (e, t, n) {
|
|
dm(t) && n.set(k.some(Is.getUndoBookmark(e.selection)));
|
|
})(n, o, r);
|
|
},
|
|
add: function (e, t) {
|
|
return (function (e, t, n, r, o, i, a) {
|
|
var u = e.settings,
|
|
s = pg(e);
|
|
if (
|
|
((i = i || {}), (i = Rn.extend(i, s)), !1 === dm(r) || e.removed)
|
|
)
|
|
return null;
|
|
var c = t.data[n.get()];
|
|
if (
|
|
e
|
|
.fire("BeforeAddUndo", {
|
|
level: i,
|
|
lastLevel: c,
|
|
originalEvent: a,
|
|
})
|
|
.isDefaultPrevented()
|
|
)
|
|
return null;
|
|
if (c && yg(c, i)) return null;
|
|
if (
|
|
(t.data[n.get()] &&
|
|
o.get().each(function (e) {
|
|
t.data[n.get()].beforeBookmark = e;
|
|
}),
|
|
u.custom_undo_redo_levels &&
|
|
t.data.length > u.custom_undo_redo_levels)
|
|
) {
|
|
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 = Is.getUndoBookmark(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: c, originalEvent: a };
|
|
return (
|
|
e.fire("AddUndo", f),
|
|
0 < n.get() && (e.setDirty(!0), e.fire("change", f)),
|
|
i
|
|
);
|
|
})(n, a, i, o, r, e, t);
|
|
},
|
|
undo: function () {
|
|
return (function (e, t, n, r) {
|
|
var o;
|
|
return (
|
|
t.typing && (t.add(), (t.typing = !1), hm(t, !1, n)),
|
|
0 < r.get() &&
|
|
(r.set(r.get() - 1),
|
|
(o = t.data[r.get()]),
|
|
vg(e, o, !0),
|
|
e.setDirty(!0),
|
|
e.fire("Undo", { level: o })),
|
|
o
|
|
);
|
|
})(n, a, o, i);
|
|
},
|
|
redo: function () {
|
|
return (function (e, t, n) {
|
|
var r;
|
|
return (
|
|
t.get() < n.length - 1 &&
|
|
(t.set(t.get() + 1),
|
|
(r = n[t.get()]),
|
|
vg(e, r, !1),
|
|
e.setDirty(!0),
|
|
e.fire("Redo", { level: r })),
|
|
r
|
|
);
|
|
})(n, i, a.data);
|
|
},
|
|
clear: function () {
|
|
!(function (e, t, n) {
|
|
(t.data = []), n.set(0), (t.typing = !1), e.fire("ClearUndos");
|
|
})(n, a, i);
|
|
},
|
|
reset: function () {
|
|
!(function (e) {
|
|
e.clear(), e.add();
|
|
})(a);
|
|
},
|
|
hasUndo: function () {
|
|
return (function (e, t, n) {
|
|
return (
|
|
0 < n.get() || (t.typing && t.data[0] && !yg(pg(e), t.data[0]))
|
|
);
|
|
})(n, a, i);
|
|
},
|
|
hasRedo: function () {
|
|
return (function (e, t) {
|
|
return t.get() < e.data.length - 1 && !e.typing;
|
|
})(a, i);
|
|
},
|
|
transact: function (e) {
|
|
return (function (e, t, n) {
|
|
return mm(e, t), e.beforeChange(), e.ignore(n), e.add();
|
|
})(a, o, e);
|
|
},
|
|
ignore: function (e) {
|
|
!(function (e, t) {
|
|
try {
|
|
e.set(e.get() + 1), t();
|
|
} finally {
|
|
e.set(e.get() - 1);
|
|
}
|
|
})(o, e);
|
|
},
|
|
extra: function (e, t) {
|
|
!(function (e, t, n, r, o) {
|
|
if (t.transact(r)) {
|
|
var i = t.data[n.get()].bookmark,
|
|
a = t.data[n.get() - 1];
|
|
vg(e, a, !0),
|
|
t.transact(o) && (t.data[n.get() - 1].beforeBookmark = i);
|
|
}
|
|
})(n, a, i, e, t);
|
|
},
|
|
};
|
|
return (
|
|
(function (n, r, o) {
|
|
function i(e) {
|
|
hm(r, !1, o), r.add({}, e);
|
|
}
|
|
var a = Je(!1);
|
|
n.on("init", function () {
|
|
r.add();
|
|
}),
|
|
n.on("BeforeExecCommand", function (e) {
|
|
var t = e.command;
|
|
"Undo" !== t &&
|
|
"Redo" !== t &&
|
|
"mceRepaint" !== t &&
|
|
(mm(r, o), r.beforeChange());
|
|
}),
|
|
n.on("ExecCommand", function (e) {
|
|
var t = e.command;
|
|
"Undo" !== t && "Redo" !== t && "mceRepaint" !== t && i(e);
|
|
}),
|
|
n.on("ObjectResizeStart cut", function () {
|
|
r.beforeChange();
|
|
}),
|
|
n.on("SaveContent ObjectResized blur", i),
|
|
n.on("dragend", i),
|
|
n.on("keyup", function (e) {
|
|
var t = e.keyCode;
|
|
e.isDefaultPrevented() ||
|
|
(((33 <= t && t <= 36) ||
|
|
(37 <= t && t <= 40) ||
|
|
45 === t ||
|
|
e.ctrlKey) &&
|
|
(i(), n.nodeChanged()),
|
|
(46 !== t && 8 !== t) || n.nodeChanged(),
|
|
a.get() &&
|
|
r.typing &&
|
|
!1 === yg(pg(n), r.data[0]) &&
|
|
(!1 === n.isDirty() &&
|
|
(n.setDirty(!0),
|
|
n.fire("change", { level: r.data[0], lastLevel: null })),
|
|
n.fire("TypingUndo"),
|
|
a.set(!1),
|
|
n.nodeChanged()));
|
|
}),
|
|
n.on("keydown", function (e) {
|
|
var t = e.keyCode;
|
|
if (!e.isDefaultPrevented())
|
|
if ((33 <= t && t <= 36) || (37 <= t && t <= 40) || 45 === t)
|
|
r.typing && i(e);
|
|
else {
|
|
var n = (e.ctrlKey && !e.altKey) || e.metaKey;
|
|
!(t < 16 || 20 < t) ||
|
|
224 === t ||
|
|
91 === t ||
|
|
r.typing ||
|
|
n ||
|
|
(r.beforeChange(), hm(r, !0, o), r.add({}, e), a.set(!0));
|
|
}
|
|
}),
|
|
n.on("mousedown", function (e) {
|
|
r.typing && i(e);
|
|
});
|
|
n.on("input", function (e) {
|
|
e.inputType &&
|
|
((function (e) {
|
|
return "insertReplacementText" === e.inputType;
|
|
})(e) ||
|
|
(function (e) {
|
|
return "insertText" === e.inputType && null === e.data;
|
|
})(e)) &&
|
|
i(e);
|
|
}),
|
|
n.on("AddUndo Undo Redo ClearUndos", function (e) {
|
|
e.isDefaultPrevented() || n.nodeChanged();
|
|
});
|
|
})(n, a, o),
|
|
(function (e) {
|
|
e.addShortcut("meta+z", "", "Undo"),
|
|
e.addShortcut("meta+y,meta+shift+z", "", "Redo");
|
|
})(n),
|
|
a
|
|
);
|
|
}
|
|
function pm(e, t, n) {
|
|
var r = e.formatter.get(n);
|
|
if (r)
|
|
for (var o = 0; o < r.length; o++)
|
|
if (!1 === r[o].inherit && e.dom.is(t, r[o].selector)) return !0;
|
|
return !1;
|
|
}
|
|
function vm(t, e, n, r) {
|
|
var o = t.dom.getRoot();
|
|
return (
|
|
e !== o &&
|
|
((e = t.dom.getParent(e, function (e) {
|
|
return !!pm(t, e, n) || e.parentNode === o || !!zg(t, e, n, r, !0);
|
|
})),
|
|
zg(t, e, n, r))
|
|
);
|
|
}
|
|
function ym(e, t, n) {
|
|
return (
|
|
!!xg(t, n.inline) ||
|
|
!!xg(t, n.block) ||
|
|
(n.selector ? 1 === t.nodeType && e.is(t, n.selector) : void 0)
|
|
);
|
|
}
|
|
function bm(e, t, n, r, o, i) {
|
|
var a,
|
|
u,
|
|
s,
|
|
c = n[r];
|
|
if (n.onmatch) return n.onmatch(t, n, r);
|
|
if (c)
|
|
if ("undefined" == typeof c.length) {
|
|
for (a in c)
|
|
if (c.hasOwnProperty(a)) {
|
|
if (
|
|
((u =
|
|
"attributes" === r ? e.getAttrib(t, a) : qc.getStyle(e, t, a)),
|
|
o && !u && !n.exact)
|
|
)
|
|
return;
|
|
if (
|
|
(!o || n.exact) &&
|
|
!xg(u, qc.normalizeStyleValue(e, qc.replaceVars(c[a], i), a))
|
|
)
|
|
return;
|
|
}
|
|
} else
|
|
for (s = 0; s < c.length; s++)
|
|
if (
|
|
"attributes" === r ? e.getAttrib(t, c[s]) : qc.getStyle(e, t, c[s])
|
|
)
|
|
return n;
|
|
return n;
|
|
}
|
|
function Cm(e, t) {
|
|
return e.splitText(t);
|
|
}
|
|
function wm(e) {
|
|
var t = e.startContainer,
|
|
n = e.startOffset,
|
|
r = e.endContainer,
|
|
o = e.endOffset;
|
|
return (
|
|
t === r && Ge.isText(t)
|
|
? 0 < n &&
|
|
n < t.nodeValue.length &&
|
|
((t = (r = Cm(t, n)).previousSibling),
|
|
n < o
|
|
? ((t = r = Cm(r, (o -= n)).previousSibling),
|
|
(o = r.nodeValue.length),
|
|
(n = 0))
|
|
: (o = 0))
|
|
: (Ge.isText(t) &&
|
|
0 < n &&
|
|
n < t.nodeValue.length &&
|
|
((t = Cm(t, n)), (n = 0)),
|
|
Ge.isText(r) &&
|
|
0 < o &&
|
|
o < r.nodeValue.length &&
|
|
(o = (r = Cm(r, o).previousSibling).nodeValue.length)),
|
|
{ startContainer: t, startOffset: n, endContainer: r, endOffset: o }
|
|
);
|
|
}
|
|
function xm(e, t, n) {
|
|
if (0 !== n) {
|
|
var r = e.data.slice(t, t + n),
|
|
o = t + n >= e.data.length,
|
|
i = 0 === t;
|
|
e.replaceData(
|
|
t,
|
|
n,
|
|
(function (n, r, o) {
|
|
return b(
|
|
n,
|
|
function (e, t) {
|
|
return (function (e) {
|
|
return -1 !== " \f\n\r\t\x0B".indexOf(e);
|
|
})(t) || "\xa0" === t
|
|
? e.previousCharIsSpace ||
|
|
("" === e.str && r) ||
|
|
(e.str.length === n.length - 1 && o)
|
|
? { previousCharIsSpace: !1, str: e.str + "\xa0" }
|
|
: { previousCharIsSpace: !0, str: e.str + " " }
|
|
: { previousCharIsSpace: !1, str: e.str + t };
|
|
},
|
|
{ previousCharIsSpace: !1, str: "" },
|
|
).str;
|
|
})(r, i, o),
|
|
);
|
|
}
|
|
}
|
|
function zm(e, t) {
|
|
var n = e.data.slice(t),
|
|
r =
|
|
n.length -
|
|
(function (e) {
|
|
return e.replace(/^\s+/g, "");
|
|
})(n).length;
|
|
return xm(e, t, r);
|
|
}
|
|
function Em(e, t) {
|
|
var n = bt.fromDom(e);
|
|
return (function (e, t, n) {
|
|
return wa(e, t, n).isSome();
|
|
})(bt.fromDom(t), "pre,code", d(ze, n));
|
|
}
|
|
function Nm(e, t) {
|
|
return (
|
|
(Va(t) &&
|
|
!1 ===
|
|
(function (e, t) {
|
|
return (
|
|
Ge.isText(t) && /^[ \t\r\n]*$/.test(t.data) && !1 === Em(e, t)
|
|
);
|
|
})(e, t)) ||
|
|
(function (e) {
|
|
return Ge.isElement(e) && "A" === e.nodeName && e.hasAttribute("name");
|
|
})(t) ||
|
|
Ng(t)
|
|
);
|
|
}
|
|
function Sm(e, t) {
|
|
return (function (e, t) {
|
|
var n = e.container(),
|
|
r = e.offset();
|
|
return (
|
|
!1 === _s.isTextPosition(e) &&
|
|
n === t.parentNode &&
|
|
r > _s.before(t).offset()
|
|
);
|
|
})(t, e)
|
|
? _s(t.container(), t.offset() - 1)
|
|
: t;
|
|
}
|
|
function km(e) {
|
|
return Va(e.previousSibling)
|
|
? k.some(
|
|
(function (e) {
|
|
return Ge.isText(e) ? _s(e, e.data.length) : _s.after(e);
|
|
})(e.previousSibling),
|
|
)
|
|
: e.previousSibling
|
|
? Lc.lastPositionIn(e.previousSibling)
|
|
: k.none();
|
|
}
|
|
function Tm(e) {
|
|
return Va(e.nextSibling)
|
|
? k.some(
|
|
(function (e) {
|
|
return Ge.isText(e) ? _s(e, 0) : _s.before(e);
|
|
})(e.nextSibling),
|
|
)
|
|
: e.nextSibling
|
|
? Lc.firstPositionIn(e.nextSibling)
|
|
: k.none();
|
|
}
|
|
function Am(e, t) {
|
|
return km(t)
|
|
.orThunk(function () {
|
|
return Tm(t);
|
|
})
|
|
.orThunk(function () {
|
|
return (function (e, t) {
|
|
var n = _s.before(
|
|
t.previousSibling ? t.previousSibling : t.parentNode,
|
|
);
|
|
return Lc.prevPosition(e, n).fold(function () {
|
|
return Lc.nextPosition(e, _s.after(t));
|
|
}, k.some);
|
|
})(e, t);
|
|
});
|
|
}
|
|
function Mm(e, t) {
|
|
return Tm(t)
|
|
.orThunk(function () {
|
|
return km(t);
|
|
})
|
|
.orThunk(function () {
|
|
return (function (e, t) {
|
|
return Lc.nextPosition(e, _s.after(t)).fold(function () {
|
|
return Lc.prevPosition(e, _s.before(t));
|
|
}, k.some);
|
|
})(e, t);
|
|
});
|
|
}
|
|
function Rm(e, t, n) {
|
|
return (function (e, t, n) {
|
|
return e ? Mm(t, n) : Am(t, n);
|
|
})(e, t, n).map(d(Sm, n));
|
|
}
|
|
function Dm(t, n, e) {
|
|
e.fold(
|
|
function () {
|
|
t.focus();
|
|
},
|
|
function (e) {
|
|
t.selection.setRng(e.toRange(), n);
|
|
},
|
|
);
|
|
}
|
|
function _m(e, t) {
|
|
return t && e.schema.getBlockElements().hasOwnProperty(ie(t));
|
|
}
|
|
function Om(e) {
|
|
if (Tg(e)) {
|
|
var t = bt.fromHtml('<br data-mce-bogus="1">');
|
|
return Ni(e), _i(e, t), k.some(_s.before(t.dom()));
|
|
}
|
|
return k.none();
|
|
}
|
|
function Bm(e, t, a) {
|
|
var n = ke(e).filter(Et),
|
|
r = Te(e).filter(Et);
|
|
return (
|
|
Oi(e),
|
|
(function (e, t, n, r) {
|
|
return e.isSome() && t.isSome() && n.isSome()
|
|
? k.some(r(e.getOrDie(), t.getOrDie(), n.getOrDie()))
|
|
: k.none();
|
|
})(n, r, t, function (e, t, n) {
|
|
var r = e.dom(),
|
|
o = t.dom(),
|
|
i = r.data.length;
|
|
return (
|
|
(function (e, t, n) {
|
|
var r = ne(e.data).length;
|
|
e.appendData(t.data), Oi(bt.fromDom(t)), n && zm(e, r);
|
|
})(r, o, a),
|
|
n.container() === o ? _s(r, i) : n
|
|
);
|
|
}).orThunk(function () {
|
|
return (
|
|
a &&
|
|
(n.each(function (e) {
|
|
return (function (e, t) {
|
|
var n = e.data.slice(0, t),
|
|
r = n.length - ne(n).length;
|
|
return xm(e, t - r, r);
|
|
})(e.dom(), e.dom().length);
|
|
}),
|
|
r.each(function (e) {
|
|
return zm(e.dom(), 0);
|
|
})),
|
|
t
|
|
);
|
|
})
|
|
);
|
|
}
|
|
function Hm(e) {
|
|
return (
|
|
0 <
|
|
(function (e) {
|
|
for (var t = []; e; ) {
|
|
if (
|
|
(3 === e.nodeType && e.nodeValue !== Mg) ||
|
|
1 < e.childNodes.length
|
|
)
|
|
return [];
|
|
1 === e.nodeType && t.push(e), (e = e.firstChild);
|
|
}
|
|
return t;
|
|
})(e).length
|
|
);
|
|
}
|
|
function Pm(e) {
|
|
if (e) {
|
|
var t = new bi(e, e);
|
|
for (e = t.current(); e; e = t.next()) if (3 === e.nodeType) return e;
|
|
}
|
|
return null;
|
|
}
|
|
function Lm(e) {
|
|
var t = bt.fromTag("span");
|
|
return (
|
|
me(t, { id: Rg, "data-mce-bogus": "1", "data-mce-type": "format-caret" }),
|
|
e && _i(t, bt.fromText(Mg)),
|
|
t
|
|
);
|
|
}
|
|
function Vm(e, t, n) {
|
|
void 0 === n && (n = !0);
|
|
var r = e.dom,
|
|
o = e.selection;
|
|
if (Hm(t)) Ag(e, !1, bt.fromDom(t), n);
|
|
else {
|
|
var i = o.getRng(),
|
|
a = r.getParent(t, r.isBlock),
|
|
u = (function (e) {
|
|
var t = Pm(e);
|
|
return t && t.nodeValue.charAt(0) === Mg && t.deleteData(0, 1), t;
|
|
})(t);
|
|
i.startContainer === u &&
|
|
0 < i.startOffset &&
|
|
i.setStart(u, i.startOffset - 1),
|
|
i.endContainer === u && 0 < i.endOffset && i.setEnd(u, i.endOffset - 1),
|
|
r.remove(t, !0),
|
|
a && r.isEmpty(a) && Cg(bt.fromDom(a)),
|
|
o.setRng(i);
|
|
}
|
|
}
|
|
function Im(e, t, n) {
|
|
void 0 === n && (n = !0);
|
|
var r = e.dom,
|
|
o = e.selection;
|
|
if (t) Vm(e, t, n);
|
|
else if (!(t = is(e.getBody(), o.getStart())))
|
|
for (; (t = r.get(Rg)); ) Vm(e, t, !1);
|
|
}
|
|
function Fm(e, t, n) {
|
|
var r = e.dom,
|
|
o = r.getParent(n, d(qc.isTextBlock, e));
|
|
o && r.isEmpty(o)
|
|
? n.parentNode.replaceChild(t, n)
|
|
: (bg(bt.fromDom(n)),
|
|
r.isEmpty(n) ? n.parentNode.replaceChild(t, n) : r.insertAfter(t, n));
|
|
}
|
|
function Um(e, t) {
|
|
return e.appendChild(t), t;
|
|
}
|
|
function jm(e, t) {
|
|
var n = m(
|
|
e,
|
|
function (e, t) {
|
|
return Um(e, t.cloneNode(!1));
|
|
},
|
|
t,
|
|
);
|
|
return Um(n, n.ownerDocument.createTextNode(Mg));
|
|
}
|
|
function qm(t) {
|
|
t.on("mouseup keydown", function (e) {
|
|
!(function (e, t) {
|
|
var n = e.selection,
|
|
r = e.getBody();
|
|
Im(e, null, !1),
|
|
(8 !== t && 46 !== t) ||
|
|
!n.isCollapsed() ||
|
|
n.getStart().innerHTML !== Mg ||
|
|
Im(e, is(r, n.getStart())),
|
|
(37 !== t && 39 !== t) || Im(e, is(r, n.getStart()));
|
|
})(t, e.keyCode);
|
|
});
|
|
}
|
|
function $m(e, t) {
|
|
return (
|
|
e.schema.getTextInlineElements().hasOwnProperty(ie(t)) &&
|
|
!os(t.dom()) &&
|
|
!Ge.isBogus(t.dom())
|
|
);
|
|
}
|
|
var Wm,
|
|
Km,
|
|
Xm = d(Ih, Th.Up, qa, $a),
|
|
Ym = d(Ih, Th.Down, $a, qa),
|
|
Gm = Ge.isContentEditableFalse,
|
|
Jm = bs,
|
|
Qm = function (t, n, e) {
|
|
if (e.collapsed) return !1;
|
|
if (
|
|
Sn.browser.isIE() &&
|
|
e.startOffset === e.endOffset - 1 &&
|
|
e.startContainer === e.endContainer
|
|
) {
|
|
var r = e.startContainer.childNodes[e.startOffset];
|
|
if (Ge.isElement(r))
|
|
return C(r.getClientRects(), function (e) {
|
|
return Wa(e, t, n);
|
|
});
|
|
}
|
|
return C(e.getClientRects(), function (e) {
|
|
return Wa(e, t, n);
|
|
});
|
|
},
|
|
Zm = function (e, t) {
|
|
return (function (e, t, n) {
|
|
return {
|
|
pageX: n.left - e.left + t.left,
|
|
pageY: n.top - e.top + t.top,
|
|
};
|
|
})(
|
|
(function (e) {
|
|
return e.inline ? Yh(e.getBody()) : { left: 0, top: 0 };
|
|
})(e),
|
|
(function (e) {
|
|
var t = e.getBody();
|
|
return e.inline
|
|
? { left: t.scrollLeft, top: t.scrollTop }
|
|
: { left: 0, top: 0 };
|
|
})(e),
|
|
(function (e, t) {
|
|
if (t.target.ownerDocument === e.getDoc())
|
|
return { left: t.pageX, top: t.pageY };
|
|
var n = Yh(e.getContentAreaContainer()),
|
|
r = (function (e) {
|
|
var t = e.getBody(),
|
|
n = e.getDoc().documentElement,
|
|
r = { left: t.scrollLeft, top: t.scrollTop },
|
|
o = {
|
|
left: t.scrollLeft || n.scrollLeft,
|
|
top: t.scrollTop || n.scrollTop,
|
|
};
|
|
return e.inline ? r : o;
|
|
})(e);
|
|
return {
|
|
left: t.pageX - n.left + r.left,
|
|
top: t.pageY - n.top + r.top,
|
|
};
|
|
})(e, t),
|
|
);
|
|
},
|
|
eg = Ge.isContentEditableFalse,
|
|
tg = Ge.isContentEditableTrue,
|
|
ng = function (e) {
|
|
(e.dragging = !1), (e.element = null), Gh(e.ghost);
|
|
},
|
|
rg = function (e) {
|
|
Zh(e),
|
|
(function (n) {
|
|
n.on("drop", function (e) {
|
|
var t =
|
|
"undefined" != typeof e.clientX
|
|
? n.getDoc().elementFromPoint(e.clientX, e.clientY)
|
|
: null;
|
|
(eg(t) || eg(n.dom.getContentEditableParent(t))) &&
|
|
e.preventDefault();
|
|
});
|
|
})(e);
|
|
},
|
|
og = Ge.isContentEditableTrue,
|
|
ig = Ge.isContentEditableFalse,
|
|
ag = function (t) {
|
|
var e = ua(function () {
|
|
if (
|
|
!t.removed &&
|
|
t.getBody().contains(j.document.activeElement) &&
|
|
t.selection.getRng().collapsed
|
|
) {
|
|
var e = rm(t, t.selection.getRng(), !1);
|
|
t.selection.setRng(e);
|
|
}
|
|
}, 0);
|
|
t.on("focus", function () {
|
|
e.throttle();
|
|
}),
|
|
t.on("blur", function () {
|
|
e.cancel();
|
|
});
|
|
},
|
|
ug = Ge.isContentEditableTrue,
|
|
sg = Ge.isContentEditableFalse,
|
|
cg = 0,
|
|
lg = 2,
|
|
fg = 1,
|
|
dg = function (m, g) {
|
|
function p(e, t, n, r) {
|
|
for (var o = e; o - t < r && o < n && m[o] === g[o - t]; ) ++o;
|
|
return (function (e, t, n) {
|
|
return { start: e, end: t, diag: n };
|
|
})(e, o, t);
|
|
}
|
|
var e = m.length + g.length + 2,
|
|
v = new Array(e),
|
|
y = new Array(e),
|
|
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 && m[a] === g[u]
|
|
? (o.push([0, m[a]]), ++a, ++u)
|
|
: r - n < t - e
|
|
? (o.push([2, m[a]]), ++a)
|
|
: (o.push([1, g[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, m[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,
|
|
h = (d % 2 == 0 ? d : 1 + d) / 2;
|
|
for (v[1 + h] = e, y[1 + h] = t + 1, a = 0; a <= h; ++a) {
|
|
for (u = -a; u <= a; u += 2) {
|
|
for (
|
|
s = u + h,
|
|
u === -a || (u !== a && v[s - 1] < v[s + 1])
|
|
? (v[s] = v[s + 1])
|
|
: (v[s] = v[s - 1] + 1),
|
|
l = (c = v[s]) - e + n - u;
|
|
c < t && l < r && m[c] === g[l];
|
|
|
|
)
|
|
(v[s] = ++c), ++l;
|
|
if (f % 2 != 0 && f - a <= u && u <= f + a && y[s - f] <= v[s])
|
|
return p(y[s - f], u + e - n, t, r);
|
|
}
|
|
for (u = f - a; u <= f + a; u += 2) {
|
|
for (
|
|
s = u + h - f,
|
|
u === f - a || (u !== f + a && y[s + 1] <= y[s - 1])
|
|
? (y[s] = y[s + 1] - 1)
|
|
: (y[s] = y[s - 1]),
|
|
l = (c = y[s] - 1) - e + n - u;
|
|
e <= c && n <= l && m[c] === g[l];
|
|
|
|
)
|
|
(y[s] = c--), l--;
|
|
if (f % 2 == 0 && -a <= u && u <= a && y[s] <= v[s + f])
|
|
return p(y[s], u + e - n, t, r);
|
|
}
|
|
}
|
|
},
|
|
t = [];
|
|
return c(0, m.length, 0, g.length, t), t;
|
|
},
|
|
hg = function (e) {
|
|
return y(X(P(e.childNodes), am), function (e) {
|
|
return 0 < e.length;
|
|
});
|
|
},
|
|
mg = function (e, t) {
|
|
var n = X(P(t.childNodes), am);
|
|
return (
|
|
(function (e, t) {
|
|
var n = 0;
|
|
z(e, function (e) {
|
|
e[0] === cg
|
|
? n++
|
|
: e[0] === fg
|
|
? (um(t, e[1], n), n++)
|
|
: e[0] === lg &&
|
|
(function (e, t) {
|
|
if (e.hasChildNodes() && t < e.childNodes.length) {
|
|
var n = e.childNodes[t];
|
|
n.parentNode.removeChild(n);
|
|
}
|
|
})(t, n);
|
|
});
|
|
})(dg(n, e), t),
|
|
t
|
|
);
|
|
},
|
|
gg = Je(k.none()),
|
|
pg = function (n) {
|
|
var e, t, r;
|
|
return (
|
|
(e = hg(n.getBody())),
|
|
(function (e) {
|
|
return -1 !== e.indexOf("</iframe>");
|
|
})(
|
|
(t = (r = v(e, function (e) {
|
|
var t = uf.trimInternal(n.serializer, e);
|
|
return 0 < t.length ? [t] : [];
|
|
})).join("")),
|
|
)
|
|
? sm(r)
|
|
: cm(t)
|
|
);
|
|
},
|
|
vg = function (e, t, n) {
|
|
"fragmented" === t.type
|
|
? mg(t.fragments, e.getBody())
|
|
: e.setContent(t.content, { format: "raw" }),
|
|
e.selection.moveToBookmark(n ? t.beforeBookmark : t.bookmark);
|
|
},
|
|
yg = function (e, t) {
|
|
return (
|
|
!(!e || !t) &&
|
|
(!!(function (e, t) {
|
|
return lm(e) === lm(t);
|
|
})(e, t) ||
|
|
(function (e, t) {
|
|
return fm(e) === fm(t);
|
|
})(e, t))
|
|
);
|
|
},
|
|
bg = function (e) {
|
|
var t = ga(e, "br"),
|
|
n = y(
|
|
(function (e) {
|
|
for (var t = [], n = e.dom(); n; )
|
|
t.push(bt.fromDom(n)), (n = n.lastChild);
|
|
return t;
|
|
})(e).slice(-1),
|
|
On,
|
|
);
|
|
t.length === n.length && z(n, Oi);
|
|
},
|
|
Cg = function (e) {
|
|
Ni(e), _i(e, bt.fromHtml('<br data-mce-bogus="1">'));
|
|
},
|
|
wg = function (n) {
|
|
Oe(n).each(function (t) {
|
|
ke(t).each(function (e) {
|
|
In(n) && On(t) && In(e) && Oi(t);
|
|
});
|
|
});
|
|
},
|
|
xg = qc.isEq,
|
|
zg = function (e, t, n, r, o) {
|
|
var i,
|
|
a,
|
|
u,
|
|
s,
|
|
c = e.formatter.get(n),
|
|
l = e.dom;
|
|
if (c && t)
|
|
for (a = 0; a < c.length; a++)
|
|
if (
|
|
((i = c[a]),
|
|
ym(e.dom, t, i) &&
|
|
bm(l, t, i, "attributes", o, r) &&
|
|
bm(l, t, i, "styles", o, r))
|
|
) {
|
|
if ((s = i.classes))
|
|
for (u = 0; u < s.length; u++)
|
|
if (!e.dom.hasClass(t, s[u])) return;
|
|
return i;
|
|
}
|
|
},
|
|
Eg = {
|
|
matchNode: zg,
|
|
matchName: ym,
|
|
match: function (e, t, n, r) {
|
|
var o;
|
|
return r
|
|
? vm(e, r, t, n)
|
|
: ((r = e.selection.getNode()),
|
|
!!vm(e, r, t, n) ||
|
|
!((o = e.selection.getStart()) === r || !vm(e, o, t, n)));
|
|
},
|
|
matchAll: function (r, o, i) {
|
|
var e,
|
|
a = [],
|
|
u = {};
|
|
return (
|
|
(e = r.selection.getStart()),
|
|
r.dom.getParent(
|
|
e,
|
|
function (e) {
|
|
var t, n;
|
|
for (t = 0; t < o.length; t++)
|
|
(n = o[t]), !u[n] && zg(r, e, n, i) && ((u[n] = !0), a.push(n));
|
|
},
|
|
r.dom.getRoot(),
|
|
),
|
|
a
|
|
);
|
|
},
|
|
canApply: function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = e.formatter.get(t),
|
|
s = e.dom;
|
|
if (u)
|
|
for (
|
|
n = e.selection.getStart(),
|
|
r = qc.getParents(s, n),
|
|
i = u.length - 1;
|
|
0 <= i;
|
|
i--
|
|
) {
|
|
if (!(a = u[i].selector) || u[i].defaultBlock) return !0;
|
|
for (o = r.length - 1; 0 <= o; o--) if (s.is(r[o], a)) return !0;
|
|
}
|
|
return !1;
|
|
},
|
|
matchesUnInheritedFormatSelector: pm,
|
|
},
|
|
Ng = Ge.hasAttribute("data-mce-bookmark"),
|
|
Sg = Ge.hasAttribute("data-mce-bogus"),
|
|
kg = Ge.hasAttributeValue("data-mce-bogus", "all"),
|
|
Tg = function (e) {
|
|
return (function (e) {
|
|
var t,
|
|
n = 0;
|
|
if (Nm(e, e)) return !1;
|
|
if (!(t = e.firstChild)) return !0;
|
|
var r = new bi(t, e);
|
|
do {
|
|
if (kg(t)) t = r.next(!0);
|
|
else if (Sg(t)) t = r.next();
|
|
else if (Ge.isBr(t)) n++, (t = r.next());
|
|
else {
|
|
if (Nm(e, t)) return !1;
|
|
t = r.next();
|
|
}
|
|
} while (t);
|
|
return n <= 1;
|
|
})(e.dom());
|
|
},
|
|
Ag = function (t, n, e, r) {
|
|
void 0 === r && (r = !0);
|
|
var o = Rm(n, t.getBody(), e.dom()),
|
|
i = ba(
|
|
e,
|
|
d(_m, t),
|
|
(function (t) {
|
|
return function (e) {
|
|
return e.dom() === t;
|
|
};
|
|
})(t.getBody()),
|
|
),
|
|
a = Bm(
|
|
e,
|
|
o,
|
|
(function (e, t) {
|
|
return Tt(e.schema.getTextInlineElements(), ie(t));
|
|
})(t, e),
|
|
);
|
|
t.dom.isEmpty(t.getBody())
|
|
? (t.setContent(""), t.selection.setCursorLocation())
|
|
: i.bind(Om).fold(
|
|
function () {
|
|
r && Dm(t, n, a);
|
|
},
|
|
function (e) {
|
|
r && Dm(t, n, k.some(e));
|
|
},
|
|
);
|
|
},
|
|
Mg = lu,
|
|
Rg = "_mce_caret",
|
|
Dg = {},
|
|
_g = Tn.filter,
|
|
Og = Tn.each;
|
|
(Km = function (e) {
|
|
var t,
|
|
n,
|
|
r = e.selection.getRng();
|
|
(t = Ge.matchNodeNames(["pre"])),
|
|
r.collapsed ||
|
|
((n = e.selection.getSelectedBlocks()),
|
|
Og(
|
|
_g(_g(n, t), function (e) {
|
|
return (
|
|
t(e.previousSibling) && -1 !== Tn.indexOf(n, e.previousSibling)
|
|
);
|
|
}),
|
|
function (e) {
|
|
!(function (e, t) {
|
|
yi(t).remove(), yi(e).append("<br><br>").append(t.childNodes);
|
|
})(e.previousSibling, e);
|
|
},
|
|
));
|
|
}),
|
|
Dg[(Wm = "pre")] || (Dg[Wm] = []),
|
|
Dg[Wm].push(Km);
|
|
function Bg(o) {
|
|
this.compare = function (e, t) {
|
|
if (e.nodeName !== t.nodeName) return !1;
|
|
function n(n) {
|
|
var r = {};
|
|
return (
|
|
Jg(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 (e.hasOwnProperty(r)) {
|
|
if (void 0 === (n = t[r])) return !1;
|
|
if (e[r] !== n) return !1;
|
|
delete t[r];
|
|
}
|
|
for (r in t) if (t.hasOwnProperty(r)) return !1;
|
|
return !0;
|
|
}
|
|
return (
|
|
!!r(n(e), n(t)) &&
|
|
!!r(
|
|
o.parseStyle(o.getAttrib(e, "style")),
|
|
o.parseStyle(o.getAttrib(t, "style")),
|
|
) &&
|
|
!Uc(e) &&
|
|
!Uc(t)
|
|
);
|
|
};
|
|
}
|
|
function Hg(e, t, n) {
|
|
return e.isChildOf(t, n) && t !== n && !e.isBlock(n);
|
|
}
|
|
function Pg(e, t, n) {
|
|
var r, o, i;
|
|
return (
|
|
(r = t[n ? "startContainer" : "endContainer"]),
|
|
(o = t[n ? "startOffset" : "endOffset"]),
|
|
Ge.isElement(r) &&
|
|
((i = r.childNodes.length - 1),
|
|
!n && o && o--,
|
|
(r = r.childNodes[i < o ? i : o])),
|
|
Ge.isText(r) &&
|
|
n &&
|
|
o >= r.nodeValue.length &&
|
|
(r = new bi(r, e.getBody()).next() || r),
|
|
Ge.isText(r) && !n && 0 === o && (r = new bi(r, e.getBody()).prev() || r),
|
|
r
|
|
);
|
|
}
|
|
function Lg(e, t, n, r) {
|
|
var o = e.create(n, r);
|
|
return t.parentNode.insertBefore(o, t), o.appendChild(t), o;
|
|
}
|
|
function Vg(e, t, n, r, o) {
|
|
var i = bt.fromDom(t),
|
|
a = bt.fromDom(e.create(r, o)),
|
|
u = n ? Me(i) : Ae(i);
|
|
return Ei(a, u), n ? (wi(i, a), zi(a, i)) : (xi(i, a), _i(a, i)), a.dom();
|
|
}
|
|
function Ig(e, t, n, r) {
|
|
return (
|
|
!(t = qc.getNonWhiteSpaceSibling(t, n, r)) ||
|
|
"BR" === t.nodeName ||
|
|
e.isBlock(t)
|
|
);
|
|
}
|
|
function Fg(e, r, o, i, a) {
|
|
var t,
|
|
n,
|
|
u,
|
|
s = e.dom;
|
|
if (
|
|
!(function (e, t, n) {
|
|
return (
|
|
!!ep(t, n.inline) ||
|
|
!!ep(t, n.block) ||
|
|
(n.selector ? Ge.isElement(t) && e.is(t, n.selector) : void 0)
|
|
);
|
|
})(s, i, r) &&
|
|
!(function (e, t) {
|
|
return t.links && "A" === e.tagName;
|
|
})(i, r)
|
|
)
|
|
return !1;
|
|
if ("all" !== r.remove)
|
|
for (
|
|
Zg(r.styles, function (e, t) {
|
|
(e = qc.normalizeStyleValue(s, qc.replaceVars(e, o), t)),
|
|
"number" == typeof t && ((t = e), (a = 0)),
|
|
(!r.remove_similar && a && !ep(qc.getStyle(s, a, t), e)) ||
|
|
s.setStyle(i, t, ""),
|
|
(u = 1);
|
|
}),
|
|
u &&
|
|
"" === s.getAttrib(i, "style") &&
|
|
(i.removeAttribute("style"), i.removeAttribute("data-mce-style")),
|
|
Zg(r.attributes, function (e, t) {
|
|
var n;
|
|
if (
|
|
((e = qc.replaceVars(e, o)),
|
|
"number" == typeof t && ((t = e), (a = 0)),
|
|
r.remove_similar || !a || ep(s.getAttrib(a, t), e))
|
|
) {
|
|
if (
|
|
"class" === t &&
|
|
(e = s.getAttrib(i, t)) &&
|
|
((n = ""),
|
|
Zg(e.split(/\s+/), function (e) {
|
|
/mce\-\w+/.test(e) && (n += (n ? " " : "") + e);
|
|
}),
|
|
n)
|
|
)
|
|
return void s.setAttrib(i, t, n);
|
|
"class" === t && i.removeAttribute("className"),
|
|
Qg.test(t) && i.removeAttribute("data-mce-" + t),
|
|
i.removeAttribute(t);
|
|
}
|
|
}),
|
|
Zg(r.classes, function (e) {
|
|
(e = qc.replaceVars(e, o)),
|
|
(a && !s.hasClass(a, e)) || s.removeClass(i, e);
|
|
}),
|
|
n = s.getAttribs(i),
|
|
t = 0;
|
|
t < n.length;
|
|
t++
|
|
) {
|
|
var c = n[t].nodeName;
|
|
if (0 !== c.indexOf("_") && 0 !== c.indexOf("data-")) return !1;
|
|
}
|
|
return "none" !== r.remove
|
|
? ((function (t, e, n) {
|
|
var r,
|
|
o = e.parentNode,
|
|
i = t.dom,
|
|
a = gf(t);
|
|
n.block &&
|
|
(a
|
|
? o === i.getRoot() &&
|
|
((n.list_block && ep(e, n.list_block)) ||
|
|
Zg(Rn.grep(e.childNodes), function (e) {
|
|
qc.isValid(t, a, e.nodeName.toLowerCase())
|
|
? r
|
|
? r.appendChild(e)
|
|
: ((r = Lg(i, e, a)),
|
|
i.setAttribs(r, t.settings.forced_root_block_attrs))
|
|
: (r = 0);
|
|
}))
|
|
: i.isBlock(e) &&
|
|
!i.isBlock(o) &&
|
|
(Ig(i, e, !1) ||
|
|
Ig(i, e.firstChild, !0, 1) ||
|
|
e.insertBefore(i.create("br"), e.firstChild),
|
|
Ig(i, e, !0) ||
|
|
Ig(i, e.lastChild, !1, 1) ||
|
|
e.appendChild(i.create("br")))),
|
|
(n.selector && n.inline && !ep(n.inline, e)) || i.remove(e, 1);
|
|
})(e, i, r),
|
|
!0)
|
|
: void 0;
|
|
}
|
|
function Ug(e) {
|
|
return e && 1 === e.nodeType && !Uc(e) && !os(e) && !Ge.isBogus(e);
|
|
}
|
|
function jg(e, t) {
|
|
var n;
|
|
for (n = e; n; n = n[t]) {
|
|
if (3 === n.nodeType && 0 !== n.nodeValue.length) return e;
|
|
if (1 === n.nodeType && !Uc(n)) return n;
|
|
}
|
|
return e;
|
|
}
|
|
function qg(e, t, n) {
|
|
var r,
|
|
o,
|
|
i = new Bg(e);
|
|
if (
|
|
t &&
|
|
n &&
|
|
((t = jg(t, "previousSibling")),
|
|
(n = jg(n, "nextSibling")),
|
|
i.compare(t, n))
|
|
) {
|
|
for (r = t.nextSibling; r && r !== n; )
|
|
(r = (o = r).nextSibling), t.appendChild(o);
|
|
return (
|
|
e.remove(n),
|
|
Rn.each(Rn.grep(n.childNodes), function (e) {
|
|
t.appendChild(e);
|
|
}),
|
|
t
|
|
);
|
|
}
|
|
return n;
|
|
}
|
|
function $g(n, e) {
|
|
return d(function (e, t) {
|
|
return !(!t || !qc.getStyle(n, t, e));
|
|
}, e);
|
|
}
|
|
function Wg(r, e, t) {
|
|
return d(
|
|
function (e, t, n) {
|
|
r.setStyle(n, e, t),
|
|
"" === n.getAttribute("style") && n.removeAttribute("style"),
|
|
ip(r, n);
|
|
},
|
|
e,
|
|
t,
|
|
);
|
|
}
|
|
function Kg(e, t) {
|
|
var n;
|
|
1 === t.nodeType &&
|
|
t.parentNode &&
|
|
1 === t.parentNode.nodeType &&
|
|
((n = qc.getTextDecoration(e, t.parentNode)),
|
|
e.getStyle(t, "color") && n
|
|
? e.setStyle(t, "text-decoration", n)
|
|
: e.getStyle(t, "text-decoration") === n &&
|
|
e.setStyle(t, "text-decoration", null));
|
|
}
|
|
function Xg(t) {
|
|
var n = _s.fromRangeStart(t),
|
|
r = _s.fromRangeEnd(t),
|
|
o = t.commonAncestorContainer;
|
|
return Lc.fromPosition(!1, o, r)
|
|
.map(function (e) {
|
|
return !ws(n, r, o) && ws(n, e, o)
|
|
? (function (e, t, n, r) {
|
|
var o = j.document.createRange();
|
|
return o.setStart(e, t), o.setEnd(n, r), o;
|
|
})(n.container(), n.offset(), e.container(), e.offset())
|
|
: t;
|
|
})
|
|
.getOr(t);
|
|
}
|
|
function Yg(e, t, n, r, o) {
|
|
return (
|
|
null === t.get() &&
|
|
(function (t, n) {
|
|
var r = Je({});
|
|
t.set({}),
|
|
n.on("NodeChange", function (e) {
|
|
pp(n, e.element, r, t.get());
|
|
});
|
|
})(t, e),
|
|
(function (e, t, n, r) {
|
|
var o = e.get();
|
|
z(t.split(","), function (e) {
|
|
o[e] || (o[e] = { similar: r, callbacks: [] }),
|
|
o[e].callbacks.push(n);
|
|
}),
|
|
e.set(o);
|
|
})(t, n, r, o),
|
|
{
|
|
unbind: function () {
|
|
return (function (e, t, n) {
|
|
var r = e.get();
|
|
z(t.split(","), function (e) {
|
|
(r[e].callbacks = y(r[e].callbacks, function (e) {
|
|
return e !== n;
|
|
})),
|
|
0 === r[e].callbacks.length && delete r[e];
|
|
}),
|
|
e.set(r);
|
|
})(t, n, r);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
var Gg = function (e, t) {
|
|
Og(Dg[e], function (e) {
|
|
e(t);
|
|
});
|
|
},
|
|
Jg = Rn.each,
|
|
Qg = /^(src|href|style)$/,
|
|
Zg = Rn.each,
|
|
ep = qc.isEq,
|
|
tp = Fg,
|
|
np = function (a, n, u, e, r) {
|
|
function i(e) {
|
|
var t = (function (n, e, r, o, i) {
|
|
var a;
|
|
return (
|
|
Zg(qc.getParents(n.dom, e.parentNode).reverse(), function (e) {
|
|
var t;
|
|
a ||
|
|
"_start" === e.id ||
|
|
"_end" === e.id ||
|
|
((t = Eg.matchNode(n, e, r, o, i)) &&
|
|
!1 !== t.split &&
|
|
(a = e));
|
|
}),
|
|
a
|
|
);
|
|
})(a, e, n, u, r);
|
|
return (function (e, t, n, r, o, i, a, u) {
|
|
var s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m = e.dom;
|
|
if (n) {
|
|
for (
|
|
h = n.parentNode, s = r.parentNode;
|
|
s && s !== h;
|
|
s = s.parentNode
|
|
) {
|
|
for (c = m.clone(s, !1), d = 0; d < t.length; d++)
|
|
if (Fg(e, t[d], u, c, c)) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
c && (l && c.appendChild(l), (f = f || c), (l = c));
|
|
}
|
|
!i || (a.mixed && m.isBlock(n)) || (r = m.split(n, r)),
|
|
l && (o.parentNode.insertBefore(l, o), f.appendChild(o));
|
|
}
|
|
return r;
|
|
})(a, l, t, e, e, !0, f, u);
|
|
}
|
|
function s(e) {
|
|
var t = h.get(e ? "_start" : "_end"),
|
|
n = t[e ? "firstChild" : "lastChild"];
|
|
return (
|
|
(function (e) {
|
|
return (
|
|
Uc(e) && Ge.isElement(e) && ("_start" === e.id || "_end" === e.id)
|
|
);
|
|
})(n) && (n = n[e ? "firstChild" : "lastChild"]),
|
|
Ge.isText(n) &&
|
|
0 === n.data.length &&
|
|
(n = e
|
|
? t.previousSibling || t.nextSibling
|
|
: t.nextSibling || t.previousSibling),
|
|
h.remove(t, !0),
|
|
n
|
|
);
|
|
}
|
|
function t(e) {
|
|
var t,
|
|
n,
|
|
r = e.commonAncestorContainer;
|
|
if (((e = Yc(a, e, l, !0)), f.split)) {
|
|
if (((e = wm(e)), (t = Pg(a, e, !0)) !== (n = Pg(a, e)))) {
|
|
if (
|
|
(/^(TR|TH|TD)$/.test(t.nodeName) &&
|
|
t.firstChild &&
|
|
(t =
|
|
"TR" === t.nodeName
|
|
? t.firstChild.firstChild || t
|
|
: t.firstChild || t),
|
|
r &&
|
|
/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName) &&
|
|
(function (e) {
|
|
return /^(TH|TD)$/.test(e.nodeName);
|
|
})(n) &&
|
|
n.firstChild &&
|
|
(n = n.firstChild || n),
|
|
Hg(h, t, n))
|
|
) {
|
|
var o = k.from(t.firstChild).getOr(t);
|
|
return (
|
|
i(
|
|
Vg(h, o, !0, "span", {
|
|
id: "_start",
|
|
"data-mce-type": "bookmark",
|
|
}),
|
|
),
|
|
void s(!0)
|
|
);
|
|
}
|
|
if (Hg(h, n, t)) {
|
|
o = k.from(n.lastChild).getOr(n);
|
|
return (
|
|
i(
|
|
Vg(h, o, !1, "span", {
|
|
id: "_end",
|
|
"data-mce-type": "bookmark",
|
|
}),
|
|
),
|
|
void s(!1)
|
|
);
|
|
}
|
|
(t = Lg(h, t, "span", {
|
|
id: "_start",
|
|
"data-mce-type": "bookmark",
|
|
})),
|
|
(n = Lg(h, n, "span", {
|
|
id: "_end",
|
|
"data-mce-type": "bookmark",
|
|
})),
|
|
i(t),
|
|
i(n),
|
|
(t = s(!0)),
|
|
(n = s());
|
|
} else t = n = i(t);
|
|
(e.startContainer = t.parentNode ? t.parentNode : t),
|
|
(e.startOffset = h.nodeIndex(t)),
|
|
(e.endContainer = n.parentNode ? n.parentNode : n),
|
|
(e.endOffset = h.nodeIndex(n) + 1);
|
|
}
|
|
Jc(h, e, function (e) {
|
|
Zg(e, function (e) {
|
|
g(e),
|
|
Ge.isElement(e) &&
|
|
"underline" === a.dom.getStyle(e, "text-decoration") &&
|
|
e.parentNode &&
|
|
"underline" === qc.getTextDecoration(h, e.parentNode) &&
|
|
Fg(
|
|
a,
|
|
{
|
|
deep: !1,
|
|
exact: !0,
|
|
inline: "span",
|
|
styles: { textDecoration: "underline" },
|
|
},
|
|
null,
|
|
e,
|
|
);
|
|
});
|
|
});
|
|
}
|
|
var o,
|
|
c,
|
|
l = a.formatter.get(n),
|
|
f = l[0],
|
|
d = !0,
|
|
h = a.dom,
|
|
m = a.selection,
|
|
g = function (e) {
|
|
var t, n, r, o, i;
|
|
if (
|
|
(Ge.isElement(e) &&
|
|
h.getContentEditable(e) &&
|
|
((o = d), (d = "true" === h.getContentEditable(e)), (i = !0)),
|
|
(t = Rn.grep(e.childNodes)),
|
|
d && !i)
|
|
)
|
|
for (n = 0, r = l.length; n < r && !Fg(a, l[n], u, e, e); n++);
|
|
if (f.deep && t.length) {
|
|
for (n = 0, r = t.length; n < r; n++) g(t[n]);
|
|
i && (d = o);
|
|
}
|
|
};
|
|
if (e)
|
|
e.nodeType
|
|
? ((c = h.createRng()).setStartBefore(e), c.setEndAfter(e), t(c))
|
|
: t(e);
|
|
else if ("false" !== h.getContentEditable(m.getNode()))
|
|
m.isCollapsed() &&
|
|
f.inline &&
|
|
!h.select("td[data-mce-selected],th[data-mce-selected]").length
|
|
? (function (e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = e.dom,
|
|
d = e.selection,
|
|
h = [],
|
|
m = d.getRng();
|
|
for (
|
|
o = m.startContainer,
|
|
i = m.startOffset,
|
|
3 === (s = o).nodeType &&
|
|
(i !== o.nodeValue.length && (u = !0), (s = s.parentNode));
|
|
s;
|
|
|
|
) {
|
|
if (Eg.matchNode(e, s, t, n, r)) {
|
|
c = s;
|
|
break;
|
|
}
|
|
s.nextSibling && (u = !0), h.push(s), (s = s.parentNode);
|
|
}
|
|
if (c)
|
|
if (u) {
|
|
(a = d.getBookmark()), m.collapse(!0);
|
|
var g = Yc(e, m, e.formatter.get(t), !0);
|
|
(g = wm(g)), e.formatter.remove(t, n, g), d.moveToBookmark(a);
|
|
} else {
|
|
l = is(e.getBody(), c);
|
|
var p = Lm(!1).dom(),
|
|
v = jm(h, p);
|
|
Fm(e, p, l || c),
|
|
Vm(e, l, !1),
|
|
d.setCursorLocation(v, 1),
|
|
f.isEmpty(c) && f.remove(c);
|
|
}
|
|
})(a, n, u, r)
|
|
: ((o = Is.getPersistentBookmark(a.selection, !0)),
|
|
t(m.getRng()),
|
|
m.moveToBookmark(o),
|
|
f.inline &&
|
|
Eg.match(a, n, u, m.getStart()) &&
|
|
qc.moveStart(h, m, m.getRng()),
|
|
a.nodeChanged());
|
|
else {
|
|
e = m.getNode();
|
|
for (
|
|
var p = 0, v = l.length;
|
|
p < v && (!l[p].ceFalseOverride || !Fg(a, l[p], u, e, e));
|
|
p++
|
|
);
|
|
}
|
|
},
|
|
rp = Rn.each,
|
|
op = function (e, t, n) {
|
|
rp(e.childNodes, function (e) {
|
|
Ug(e) && (t(e) && n(e), e.hasChildNodes() && op(e, t, n));
|
|
});
|
|
},
|
|
ip = function (e, t) {
|
|
"SPAN" === t.nodeName && 0 === e.getAttribs(t).length && e.remove(t, !0);
|
|
},
|
|
ap = function (n, e, r, o) {
|
|
rp(e, function (t) {
|
|
rp(n.dom.select(t.inline, o), function (e) {
|
|
Ug(e) && tp(n, t, r, e, t.exact ? e : null);
|
|
}),
|
|
(function (r, e, t) {
|
|
if (e.clear_child_styles) {
|
|
var n = e.links ? "*:not(a)" : "*";
|
|
rp(r.select(n, t), function (n) {
|
|
Ug(n) &&
|
|
rp(e.styles, function (e, t) {
|
|
r.setStyle(n, t, "");
|
|
});
|
|
});
|
|
}
|
|
})(n.dom, t, o);
|
|
});
|
|
},
|
|
up = function (e, t, n, r) {
|
|
(t.styles.color || t.styles.textDecoration) &&
|
|
(Rn.walk(r, d(Kg, e), "childNodes"), Kg(e, r));
|
|
},
|
|
sp = function (e, t, n, r) {
|
|
t.styles &&
|
|
t.styles.backgroundColor &&
|
|
op(
|
|
r,
|
|
$g(e, "fontSize"),
|
|
Wg(e, "backgroundColor", qc.replaceVars(t.styles.backgroundColor, n)),
|
|
);
|
|
},
|
|
cp = function (e, t, n, r) {
|
|
("sub" !== t.inline && "sup" !== t.inline) ||
|
|
(op(r, $g(e, "fontSize"), Wg(e, "fontSize", "")),
|
|
e.remove(e.select("sup" === t.inline ? "sub" : "sup", r), !0));
|
|
},
|
|
lp = function (e, t, n, r) {
|
|
r &&
|
|
!1 !== t.merge_siblings &&
|
|
((r = qg(e, qc.getNonWhiteSpaceSibling(r), r)),
|
|
(r = qg(e, r, qc.getNonWhiteSpaceSibling(r, !0))));
|
|
},
|
|
fp = function (t, n, r, o, i) {
|
|
(Eg.matchNode(t, i.parentNode, r, o) && tp(t, n, o, i)) ||
|
|
(n.merge_with_parents &&
|
|
t.dom.getParent(i.parentNode, function (e) {
|
|
if (Eg.matchNode(t, e, r, o)) return tp(t, n, o, i), !0;
|
|
}));
|
|
},
|
|
dp = function (e) {
|
|
return e.collapsed ? e : Xg(e);
|
|
},
|
|
hp = Rn.each,
|
|
mp = function (m, g, p, r) {
|
|
function v(n, e) {
|
|
if (((e = e || C), n)) {
|
|
if (
|
|
(e.onformat && e.onformat(n, e, p, r),
|
|
hp(e.styles, function (e, t) {
|
|
i.setStyle(n, t, qc.replaceVars(e, p));
|
|
}),
|
|
e.styles)
|
|
) {
|
|
var t = i.getAttrib(n, "style");
|
|
t && n.setAttribute("data-mce-style", t);
|
|
}
|
|
hp(e.attributes, function (e, t) {
|
|
i.setAttrib(n, t, qc.replaceVars(e, p));
|
|
}),
|
|
hp(e.classes, function (e) {
|
|
(e = qc.replaceVars(e, p)), i.hasClass(n, e) || i.addClass(n, e);
|
|
});
|
|
}
|
|
}
|
|
function y(e, t) {
|
|
var n = !1;
|
|
return (
|
|
!!C.selector &&
|
|
(hp(e, function (e) {
|
|
if (!("collapsed" in e && e.collapsed !== o))
|
|
return i.is(t, e.selector) && !os(t)
|
|
? (v(t, e), !(n = !0))
|
|
: void 0;
|
|
}),
|
|
n)
|
|
);
|
|
}
|
|
function e(s, e, t, c) {
|
|
var l,
|
|
f,
|
|
d = [],
|
|
h = !0;
|
|
(l = C.inline || C.block),
|
|
(f = s.create(l)),
|
|
v(f),
|
|
Jc(s, e, function (e) {
|
|
var a,
|
|
u = function (e) {
|
|
var t, n, r, o;
|
|
if (
|
|
((o = h),
|
|
(t = e.nodeName.toLowerCase()),
|
|
(n = e.parentNode.nodeName.toLowerCase()),
|
|
1 === e.nodeType &&
|
|
s.getContentEditable(e) &&
|
|
((o = h),
|
|
(h = "true" === s.getContentEditable(e)),
|
|
(r = !0)),
|
|
qc.isEq(t, "br"))
|
|
)
|
|
return (a = 0), void (C.block && s.remove(e));
|
|
if (C.wrapper && Eg.matchNode(m, e, g, p)) a = 0;
|
|
else {
|
|
if (
|
|
h &&
|
|
!r &&
|
|
C.block &&
|
|
!C.wrapper &&
|
|
qc.isTextBlock(m, t) &&
|
|
qc.isValid(m, n, l)
|
|
)
|
|
return (e = s.rename(e, l)), v(e), d.push(e), void (a = 0);
|
|
if (C.selector) {
|
|
var i = y(b, e);
|
|
if (!C.inline || i) return void (a = 0);
|
|
}
|
|
!h ||
|
|
r ||
|
|
!qc.isValid(m, l, t) ||
|
|
!qc.isValid(m, n, l) ||
|
|
(!c &&
|
|
3 === e.nodeType &&
|
|
1 === e.nodeValue.length &&
|
|
65279 === e.nodeValue.charCodeAt(0)) ||
|
|
os(e) ||
|
|
(C.inline && s.isBlock(e))
|
|
? ((a = 0),
|
|
hp(Rn.grep(e.childNodes), u),
|
|
r && (h = o),
|
|
(a = 0))
|
|
: (a ||
|
|
((a = s.clone(f, !1)),
|
|
e.parentNode.insertBefore(a, e),
|
|
d.push(a)),
|
|
a.appendChild(e));
|
|
}
|
|
};
|
|
hp(e, u);
|
|
}),
|
|
!0 === C.links &&
|
|
hp(d, function (e) {
|
|
var t = function (e) {
|
|
"A" === e.nodeName && v(e, C), hp(Rn.grep(e.childNodes), t);
|
|
};
|
|
t(e);
|
|
}),
|
|
hp(d, function (e) {
|
|
function t(e) {
|
|
var t = !1;
|
|
return (
|
|
hp(e.childNodes, function (e) {
|
|
if (
|
|
(function (e) {
|
|
return (
|
|
e &&
|
|
1 === e.nodeType &&
|
|
!Uc(e) &&
|
|
!os(e) &&
|
|
!Ge.isBogus(e)
|
|
);
|
|
})(e)
|
|
)
|
|
return (t = e), !1;
|
|
}),
|
|
t
|
|
);
|
|
}
|
|
var n, r, o, i, a;
|
|
((r = 0),
|
|
hp(e.childNodes, function (e) {
|
|
qc.isWhiteSpaceNode(e) || Uc(e) || r++;
|
|
}),
|
|
(n = r),
|
|
(!(1 < d.length) && s.isBlock(e)) || 0 !== n)
|
|
? (C.inline || C.wrapper) &&
|
|
(C.exact ||
|
|
1 !== n ||
|
|
((i = t((o = e))) &&
|
|
!Uc(i) &&
|
|
Eg.matchName(s, i, C) &&
|
|
((a = s.clone(i, !1)),
|
|
v(a),
|
|
s.replace(a, o, !0),
|
|
s.remove(i, 1)),
|
|
(e = a || o)),
|
|
ap(m, b, p, e),
|
|
fp(m, C, g, p, e),
|
|
sp(s, C, p, e),
|
|
cp(s, C, p, e),
|
|
lp(s, C, p, e))
|
|
: s.remove(e, 1);
|
|
});
|
|
}
|
|
var t,
|
|
n,
|
|
b = m.formatter.get(g),
|
|
C = b[0],
|
|
o = !r && m.selection.isCollapsed(),
|
|
i = m.dom,
|
|
a = m.selection;
|
|
if ("false" !== i.getContentEditable(a.getNode())) {
|
|
if (C) {
|
|
if (r)
|
|
r.nodeType
|
|
? y(b, r) ||
|
|
((n = i.createRng()).setStartBefore(r),
|
|
n.setEndAfter(r),
|
|
e(i, Yc(m, n, b), 0, !0))
|
|
: e(i, r, 0, !0);
|
|
else if (
|
|
o &&
|
|
C.inline &&
|
|
!i.select("td[data-mce-selected],th[data-mce-selected]").length
|
|
)
|
|
!(function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c = e.selection;
|
|
(a = (r = c.getRng()).startOffset),
|
|
(s = r.startContainer.nodeValue),
|
|
(o = is(e.getBody(), c.getStart())) && (i = Pm(o));
|
|
var l = /[^\s\u00a0\u00ad\u200b\ufeff]/;
|
|
s &&
|
|
0 < a &&
|
|
a < s.length &&
|
|
l.test(s.charAt(a)) &&
|
|
l.test(s.charAt(a - 1))
|
|
? ((u = c.getBookmark()),
|
|
r.collapse(!0),
|
|
(r = Yc(e, r, e.formatter.get(t))),
|
|
(r = wm(r)),
|
|
e.formatter.apply(t, n, r),
|
|
c.moveToBookmark(u))
|
|
: ((o && i.nodeValue === Mg) ||
|
|
((i = (o = (function (e, t) {
|
|
return e.importNode(t, !0);
|
|
})(e.getDoc(), Lm(!0).dom())).firstChild),
|
|
r.insertNode(o),
|
|
(a = 1)),
|
|
e.formatter.apply(t, n, o),
|
|
c.setCursorLocation(i, a));
|
|
})(m, g, p);
|
|
else {
|
|
var u = m.selection.getNode();
|
|
m.settings.forced_root_block ||
|
|
!b[0].defaultBlock ||
|
|
i.getParent(u, i.isBlock) ||
|
|
mp(m, b[0].defaultBlock),
|
|
m.selection.setRng(dp(m.selection.getRng())),
|
|
(t = Is.getPersistentBookmark(m.selection, !0)),
|
|
e(i, Yc(m, a.getRng(), b)),
|
|
C.styles && up(i, C, p, u),
|
|
a.moveToBookmark(t),
|
|
qc.moveStart(i, a, a.getRng()),
|
|
m.nodeChanged();
|
|
}
|
|
Gg(g, m);
|
|
}
|
|
} else {
|
|
r = a.getNode();
|
|
for (var s = 0, c = b.length; s < c; s++)
|
|
if (b[s].ceFalseOverride && i.is(r, b[s].selector))
|
|
return void v(r, b[s]);
|
|
}
|
|
},
|
|
gp = { applyFormat: mp },
|
|
pp = function (r, e, t, n) {
|
|
var o = Nt(t.get()),
|
|
i = {},
|
|
a = {},
|
|
u = y(qc.getParents(r.dom, e), function (e) {
|
|
return 1 === e.nodeType && !e.getAttribute("data-mce-bogus");
|
|
});
|
|
ue(n, function (e, n) {
|
|
Rn.each(u, function (t) {
|
|
return r.formatter.matchNode(t, n, {}, e.similar)
|
|
? (-1 === o.indexOf(n) &&
|
|
(z(e.callbacks, function (e) {
|
|
e(!0, { node: t, format: n, parents: u });
|
|
}),
|
|
(i[n] = e.callbacks)),
|
|
(a[n] = e.callbacks),
|
|
!1)
|
|
: !Eg.matchesUnInheritedFormatSelector(r, t, n) && void 0;
|
|
});
|
|
});
|
|
var s = vp(t.get(), a, e, u);
|
|
t.set(G(G({}, i), s));
|
|
},
|
|
vp = function (e, n, r, o) {
|
|
return ce(e, function (e, t) {
|
|
return (
|
|
!!Tt(n, t) ||
|
|
(z(e, function (e) {
|
|
e(!1, { node: r, format: t, parents: o });
|
|
}),
|
|
!1)
|
|
);
|
|
}).t;
|
|
},
|
|
yp = function (r) {
|
|
var 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",
|
|
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",
|
|
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",
|
|
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" },
|
|
{ inline: "span", styles: { fontWeight: "bold" } },
|
|
{ inline: "b", remove: "all" },
|
|
],
|
|
italic: [
|
|
{ inline: "em", remove: "all" },
|
|
{ inline: "span", styles: { fontStyle: "italic" } },
|
|
{ inline: "i", remove: "all" },
|
|
],
|
|
underline: [
|
|
{
|
|
inline: "span",
|
|
styles: { textDecoration: "underline" },
|
|
exact: !0,
|
|
},
|
|
{ inline: "u", remove: "all" },
|
|
],
|
|
strikethrough: [
|
|
{
|
|
inline: "span",
|
|
styles: { textDecoration: "line-through" },
|
|
exact: !0,
|
|
},
|
|
{ inline: "strike", remove: "all" },
|
|
],
|
|
forecolor: {
|
|
inline: "span",
|
|
styles: { color: "%value" },
|
|
links: !0,
|
|
remove_similar: !0,
|
|
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,
|
|
},
|
|
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 () {
|
|
return !0;
|
|
},
|
|
onformat: function (n, e, t) {
|
|
Rn.each(t, function (e, t) {
|
|
r.setAttrib(n, t, e);
|
|
});
|
|
},
|
|
},
|
|
removeformat: [
|
|
{
|
|
selector:
|
|
"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",
|
|
remove: "all",
|
|
split: !0,
|
|
expand: !1,
|
|
block_expand: !0,
|
|
deep: !0,
|
|
},
|
|
{
|
|
selector: "span",
|
|
attributes: ["style", "class"],
|
|
remove: "empty",
|
|
split: !0,
|
|
expand: !1,
|
|
deep: !0,
|
|
},
|
|
{
|
|
selector: "*",
|
|
attributes: ["style", "class"],
|
|
split: !1,
|
|
expand: !1,
|
|
deep: !0,
|
|
},
|
|
],
|
|
};
|
|
return (
|
|
Rn.each(
|
|
"p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),
|
|
function (e) {
|
|
t[e] = { block: e, remove: "all" };
|
|
},
|
|
),
|
|
t
|
|
);
|
|
};
|
|
function bp(e, t) {
|
|
function s(e) {
|
|
var t;
|
|
return (
|
|
(r = "string" == typeof e ? { name: e, classes: [], attrs: {} } : e),
|
|
(function (e, t) {
|
|
t.classes.length && Dp.addClass(e, t.classes.join(" ")),
|
|
Dp.setAttribs(e, t.attrs);
|
|
})((t = Dp.create(r.name)), r),
|
|
t
|
|
);
|
|
}
|
|
var n,
|
|
r,
|
|
o,
|
|
c = (t && t.schema) || vr({}),
|
|
l = function (n, e, t) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a = 0 < e.length && e[0],
|
|
u = a && a.name;
|
|
if (
|
|
(i = (function (e, t) {
|
|
var n = "string" != typeof e ? e.nodeName.toLowerCase() : e,
|
|
r = c.getElementRule(n),
|
|
o = r && r.parentsRequired;
|
|
return (
|
|
!(!o || !o.length) && (t && -1 !== Rn.inArray(o, t) ? t : o[0])
|
|
);
|
|
})(n, u))
|
|
)
|
|
u === i ? ((o = e[0]), (e = e.slice(1))) : (o = i);
|
|
else if (a) (o = e[0]), (e = e.slice(1));
|
|
else if (!t) return n;
|
|
return (
|
|
o && (r = s(o)).appendChild(n),
|
|
t &&
|
|
(r || (r = Dp.create("div")).appendChild(n),
|
|
Rn.each(t, function (e) {
|
|
var t = s(e);
|
|
r.insertBefore(t, n);
|
|
})),
|
|
l(r, e, o && o.siblings)
|
|
);
|
|
};
|
|
return e && e.length
|
|
? ((r = e[0]),
|
|
(n = s(r)),
|
|
(o = Dp.create("div")).appendChild(l(n, e.slice(1), r.siblings)),
|
|
o)
|
|
: "";
|
|
}
|
|
function Cp(e) {
|
|
var t,
|
|
a = { classes: [], attrs: {} };
|
|
return (
|
|
"*" !== (e = a.selector = Rn.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 !==
|
|
Rn.inArray(
|
|
"checked disabled enabled read-only required".split(" "),
|
|
n,
|
|
) && (a.attrs[n] = n);
|
|
}
|
|
if ("[" === r) {
|
|
var i = o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);
|
|
i && (a.attrs[i[1]] = i[2]);
|
|
}
|
|
return "";
|
|
},
|
|
)),
|
|
(a.name = t || "div"),
|
|
a
|
|
);
|
|
}
|
|
function wp(e) {
|
|
var t = (function o(e) {
|
|
var n = {},
|
|
r = function (e, t) {
|
|
e &&
|
|
("string" != typeof e
|
|
? Rn.each(e, function (e, t) {
|
|
r(t, e);
|
|
})
|
|
: (A(t) || (t = [t]),
|
|
Rn.each(t, function (e) {
|
|
"undefined" == typeof e.deep && (e.deep = !e.selector),
|
|
"undefined" == typeof e.split &&
|
|
(e.split = !e.selector || e.inline),
|
|
"undefined" == typeof e.remove &&
|
|
e.selector &&
|
|
!e.inline &&
|
|
(e.remove = "none"),
|
|
e.selector &&
|
|
e.inline &&
|
|
((e.mixed = !0), (e.block_expand = !0)),
|
|
"string" == typeof e.classes &&
|
|
(e.classes = e.classes.split(/\s+/));
|
|
}),
|
|
(n[e] = t)));
|
|
};
|
|
return (
|
|
r(yp(e.dom)),
|
|
r(e.settings.formats),
|
|
{
|
|
get: function (e) {
|
|
return e ? n[e] : n;
|
|
},
|
|
has: function (e) {
|
|
return Tt(n, e);
|
|
},
|
|
register: r,
|
|
unregister: function (e) {
|
|
return e && n[e] && delete n[e], n;
|
|
},
|
|
}
|
|
);
|
|
})(e),
|
|
n = Je(null);
|
|
return (
|
|
Hp(e),
|
|
qm(e),
|
|
{
|
|
get: t.get,
|
|
has: t.has,
|
|
register: t.register,
|
|
unregister: t.unregister,
|
|
apply: d(gp.applyFormat, e),
|
|
remove: d(np, e),
|
|
toggle: d(Bp, e, t),
|
|
match: d(Eg.match, e),
|
|
matchAll: d(Eg.matchAll, e),
|
|
matchNode: d(Eg.matchNode, e),
|
|
canApply: d(Eg.canApply, e),
|
|
formatChanged: d(Yg, e, n),
|
|
getCssText: d(Op, e),
|
|
}
|
|
);
|
|
}
|
|
function xp(e, i, a) {
|
|
e.addNodeFilter("font", function (e) {
|
|
z(e, function (e) {
|
|
var t = i.parse(e.attr("style")),
|
|
n = e.attr("color"),
|
|
r = e.attr("face"),
|
|
o = e.attr("size");
|
|
n && (t.color = n),
|
|
r && (t["font-family"] = r),
|
|
o && (t["font-size"] = a[parseInt(e.attr("size"), 10) - 1]),
|
|
(e.name = "span"),
|
|
e.attr("style", i.serialize(t)),
|
|
(function (t, e) {
|
|
z(e, function (e) {
|
|
t.attr(e, null);
|
|
});
|
|
})(e, ["color", "face", "size"]);
|
|
});
|
|
});
|
|
}
|
|
function zp(e, t) {
|
|
var n = zr();
|
|
t.convert_fonts_to_spans && xp(e, n, Rn.explode(t.font_size_legacy_values)),
|
|
(function (e, n) {
|
|
e.addNodeFilter("strike", function (e) {
|
|
z(e, function (e) {
|
|
var t = n.parse(e.attr("style"));
|
|
(t["text-decoration"] = "line-through"),
|
|
(e.name = "span"),
|
|
e.attr("style", n.serialize(t));
|
|
});
|
|
});
|
|
})(e, n);
|
|
}
|
|
function Ep(e, t, n, r) {
|
|
(e.padd_empty_with_br || t.insert) && n[r.name]
|
|
? (r.empty().append(new sl("br", 1)).shortEnded = !0)
|
|
: (r.empty().append(new sl("#text", 3)).value = "\xa0");
|
|
}
|
|
function Np(t, e, n, r) {
|
|
return r.isEmpty(e, n, function (e) {
|
|
return (function (e, t) {
|
|
var n = e.getElementRule(t.name);
|
|
return n && n.paddEmpty;
|
|
})(t, e);
|
|
});
|
|
}
|
|
function Sp(T, A) {
|
|
void 0 === A && (A = vr());
|
|
var M = {},
|
|
R = [],
|
|
D = {},
|
|
_ = {};
|
|
((T = T || {}).validate = !("validate" in T) || T.validate),
|
|
(T.root_name = T.root_name || "body");
|
|
var O = function (e) {
|
|
var t, n, r;
|
|
(n = e.name) in M && ((r = D[n]) ? r.push(e) : (D[n] = [e])),
|
|
(t = R.length);
|
|
for (; t--; )
|
|
(n = R[t].name) in e.attributes.map &&
|
|
((r = _[n]) ? r.push(e) : (_[n] = [e]));
|
|
return e;
|
|
},
|
|
e = {
|
|
schema: A,
|
|
addAttributeFilter: function (e, n) {
|
|
jp(qp(e), function (e) {
|
|
var t;
|
|
for (t = 0; t < R.length; t++)
|
|
if (R[t].name === e) return void R[t].callbacks.push(n);
|
|
R.push({ name: e, callbacks: [n] });
|
|
});
|
|
},
|
|
getAttributeFilters: function () {
|
|
return [].concat(R);
|
|
},
|
|
addNodeFilter: function (e, n) {
|
|
jp(qp(e), function (e) {
|
|
var t = M[e];
|
|
t || (M[e] = t = []), t.push(n);
|
|
});
|
|
},
|
|
getNodeFilters: function () {
|
|
var e = [];
|
|
for (var t in M)
|
|
M.hasOwnProperty(t) && e.push({ name: t, callbacks: M[t] });
|
|
return e;
|
|
},
|
|
filterNode: O,
|
|
parse: function (e, a) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h = [];
|
|
(a = a || {}),
|
|
(D = {}),
|
|
(_ = {}),
|
|
(l = $p(
|
|
Up("script,style,head,html,body,title,meta,param"),
|
|
A.getBlockElements(),
|
|
));
|
|
var m,
|
|
g = A.getNonEmptyElements(),
|
|
p = A.children,
|
|
v = T.validate,
|
|
y =
|
|
"forced_root_block" in a
|
|
? a.forced_root_block
|
|
: T.forced_root_block,
|
|
b = !1 === (m = y) ? "" : !0 === m ? "p" : m,
|
|
C = A.getWhiteSpaceElements(),
|
|
w = /^[ \t\r\n]+/,
|
|
x = /[ \t\r\n]+$/,
|
|
z = /[ \t\r\n]+/g,
|
|
E = /^[ \t\r\n]+$/;
|
|
f = C.hasOwnProperty(a.context) || C.hasOwnProperty(T.root_name);
|
|
function N(e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o,
|
|
i = A.getBlockElements();
|
|
for (t = e.prev; t && 3 === t.type; ) {
|
|
if (0 < (r = t.value.replace(x, "")).length)
|
|
return void (t.value = r);
|
|
if ((n = t.next)) {
|
|
if (3 === n.type && n.value.length) {
|
|
t = t.prev;
|
|
continue;
|
|
}
|
|
if (!i[n.name] && "script" !== n.name && "style" !== n.name) {
|
|
t = t.prev;
|
|
continue;
|
|
}
|
|
}
|
|
(o = t.prev), t.remove(), (t = o);
|
|
}
|
|
}
|
|
var S = function (e, t) {
|
|
var n,
|
|
r = new sl(e, t);
|
|
return e in M && ((n = D[e]) ? n.push(r) : (D[e] = [r])), r;
|
|
};
|
|
t = af(
|
|
{
|
|
validate: v,
|
|
allow_script_urls: T.allow_script_urls,
|
|
allow_conditional_comments: T.allow_conditional_comments,
|
|
self_closing_elements: (function (e) {
|
|
var t,
|
|
n = {};
|
|
for (t in e) "li" !== t && "p" !== t && (n[t] = e[t]);
|
|
return n;
|
|
})(A.getSelfClosingElements()),
|
|
cdata: function (e) {
|
|
d.append(S("#cdata", 4)).value = e;
|
|
},
|
|
text: function (e, t) {
|
|
var n;
|
|
f ||
|
|
((e = e.replace(z, " ")),
|
|
(function (e, t) {
|
|
return e && (t[e.name] || "br" === e.name);
|
|
})(d.lastChild, l) && (e = e.replace(w, ""))),
|
|
0 !== e.length &&
|
|
(((n = S("#text", 3)).raw = !!t), (d.append(n).value = e));
|
|
},
|
|
comment: function (e) {
|
|
d.append(S("#comment", 8)).value = e;
|
|
},
|
|
pi: function (e, t) {
|
|
(d.append(S(e, 7)).value = t), N(d);
|
|
},
|
|
doctype: function (e) {
|
|
(d.append(S("#doctype", 10)).value = e), N(d);
|
|
},
|
|
start: function (e, t, n) {
|
|
var r, o, i, a, u;
|
|
if ((i = v ? A.getElementRule(e) : {})) {
|
|
for (
|
|
(r = S(i.outputName || e, 1)).attributes = t,
|
|
r.shortEnded = n,
|
|
d.append(r),
|
|
(u = p[d.name]) && p[r.name] && !u[r.name] && h.push(r),
|
|
o = R.length;
|
|
o--;
|
|
|
|
)
|
|
(a = R[o].name) in t.map &&
|
|
((s = _[a]) ? s.push(r) : (_[a] = [r]));
|
|
l[e] && N(r), n || (d = r), !f && C[e] && (f = !0);
|
|
}
|
|
},
|
|
end: function (e) {
|
|
var t, n, r, o, i;
|
|
if ((n = v ? A.getElementRule(e) : {})) {
|
|
if (l[e] && !f) {
|
|
if ((t = d.firstChild) && 3 === t.type)
|
|
if (0 < (r = t.value.replace(w, "")).length)
|
|
(t.value = r), (t = t.next);
|
|
else
|
|
for (o = t.next, t.remove(), t = o; t && 3 === t.type; )
|
|
(r = t.value),
|
|
(o = t.next),
|
|
(0 !== r.length && !E.test(r)) ||
|
|
(t.remove(), (t = o)),
|
|
(t = o);
|
|
if ((t = d.lastChild) && 3 === t.type)
|
|
if (0 < (r = t.value.replace(x, "")).length)
|
|
(t.value = r), (t = t.prev);
|
|
else
|
|
for (o = t.prev, t.remove(), t = o; t && 3 === t.type; )
|
|
(r = t.value),
|
|
(o = t.prev),
|
|
(0 !== r.length && !E.test(r)) ||
|
|
(t.remove(), (t = o)),
|
|
(t = o);
|
|
}
|
|
if (
|
|
(f && C[e] && (f = !1),
|
|
n.removeEmpty &&
|
|
Np(A, g, C, d) &&
|
|
!d.attr("name") &&
|
|
!d.attr("id"))
|
|
)
|
|
return (
|
|
(i = d.parent),
|
|
l[d.name] ? d.empty().remove() : d.unwrap(),
|
|
void (d = i)
|
|
);
|
|
n.paddEmpty &&
|
|
((function (e) {
|
|
return Fp(e, "#text") && "\xa0" === e.firstChild.value;
|
|
})(d) ||
|
|
Np(A, g, C, d)) &&
|
|
Ep(T, a, l, d),
|
|
(d = d.parent);
|
|
}
|
|
},
|
|
},
|
|
A,
|
|
);
|
|
var k = (d = new sl(a.context || T.root_name, 11));
|
|
if (
|
|
(t.parse(e),
|
|
v &&
|
|
h.length &&
|
|
(a.context
|
|
? (a.invalid = !0)
|
|
: (function (e) {
|
|
var t, n, r, o, i, a, u, s, c, l, f, d, h, m, g, p;
|
|
for (
|
|
d = Up("tr,td,th,tbody,thead,tfoot,table"),
|
|
l = A.getNonEmptyElements(),
|
|
f = A.getWhiteSpaceElements(),
|
|
h = A.getTextBlockElements(),
|
|
m = A.getSpecialElements(),
|
|
t = 0;
|
|
t < e.length;
|
|
t++
|
|
)
|
|
if ((n = e[t]).parent && !n.fixed)
|
|
if (h[n.name] && "li" === n.parent.name) {
|
|
for (g = n.next; g && h[g.name]; )
|
|
(g.name = "li"),
|
|
(g.fixed = !0),
|
|
n.parent.insert(g, n.parent),
|
|
(g = g.next);
|
|
n.unwrap(n);
|
|
} else {
|
|
for (
|
|
o = [n], r = n.parent;
|
|
r && !A.isValidChild(r.name, n.name) && !d[r.name];
|
|
r = r.parent
|
|
)
|
|
o.push(r);
|
|
if (r && 1 < o.length) {
|
|
for (
|
|
o.reverse(), i = a = O(o[0].clone()), c = 0;
|
|
c < o.length - 1;
|
|
c++
|
|
) {
|
|
for (
|
|
A.isValidChild(a.name, o[c].name)
|
|
? ((u = O(o[c].clone())), a.append(u))
|
|
: (u = a),
|
|
s = o[c].firstChild;
|
|
s && s !== o[c + 1];
|
|
|
|
)
|
|
(p = s.next), u.append(s), (s = p);
|
|
a = u;
|
|
}
|
|
Np(A, l, f, i)
|
|
? r.insert(n, o[0], !0)
|
|
: (r.insert(i, o[0], !0), r.insert(n, i)),
|
|
(r = o[0]),
|
|
(Np(A, l, f, r) || Fp(r, "br")) &&
|
|
r.empty().remove();
|
|
} else if (n.parent) {
|
|
if ("li" === n.name) {
|
|
if (
|
|
(g = n.prev) &&
|
|
("ul" === g.name || "ul" === g.name)
|
|
) {
|
|
g.append(n);
|
|
continue;
|
|
}
|
|
if (
|
|
(g = n.next) &&
|
|
("ul" === g.name || "ul" === g.name)
|
|
) {
|
|
g.insert(n, g.firstChild, !0);
|
|
continue;
|
|
}
|
|
n.wrap(O(new sl("ul", 1)));
|
|
continue;
|
|
}
|
|
A.isValidChild(n.parent.name, "div") &&
|
|
A.isValidChild("div", n.name)
|
|
? n.wrap(O(new sl("div", 1)))
|
|
: m[n.name]
|
|
? n.empty().remove()
|
|
: n.unwrap();
|
|
}
|
|
}
|
|
})(h)),
|
|
b &&
|
|
("body" === k.name || a.isRootContent) &&
|
|
(function () {
|
|
function e(e) {
|
|
e &&
|
|
((r = e.firstChild) &&
|
|
3 === r.type &&
|
|
(r.value = r.value.replace(w, "")),
|
|
(r = e.lastChild) &&
|
|
3 === r.type &&
|
|
(r.value = r.value.replace(x, "")));
|
|
}
|
|
var t,
|
|
n,
|
|
r = k.firstChild;
|
|
if (A.isValidChild(k.name, b.toLowerCase())) {
|
|
for (; r; )
|
|
(t = r.next),
|
|
3 === r.type ||
|
|
(1 === r.type &&
|
|
"p" !== r.name &&
|
|
!l[r.name] &&
|
|
!r.attr("data-mce-type"))
|
|
? (n ||
|
|
((n = S(b, 1)).attr(T.forced_root_block_attrs),
|
|
k.insert(n, r)),
|
|
n.append(r))
|
|
: (e(n), (n = null)),
|
|
(r = t);
|
|
e(n);
|
|
}
|
|
})(),
|
|
!a.invalid)
|
|
) {
|
|
for (c in D)
|
|
if (D.hasOwnProperty(c)) {
|
|
for (s = M[c], i = (n = D[c]).length; i--; )
|
|
n[i].parent || n.splice(i, 1);
|
|
for (r = 0, o = s.length; r < o; r++) s[r](n, c, a);
|
|
}
|
|
for (r = 0, o = R.length; r < o; r++)
|
|
if ((s = R[r]).name in _) {
|
|
for (i = (n = _[s.name]).length; i--; )
|
|
n[i].parent || n.splice(i, 1);
|
|
for (i = 0, u = s.callbacks.length; i < u; i++)
|
|
s.callbacks[i](n, s.name, a);
|
|
}
|
|
}
|
|
return k;
|
|
},
|
|
};
|
|
return (
|
|
(function (e, g) {
|
|
var p = e.schema;
|
|
g.remove_trailing_brs &&
|
|
e.addNodeFilter("br", function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = e.length,
|
|
d = Rn.extend({}, p.getBlockElements()),
|
|
h = p.getNonEmptyElements(),
|
|
m = p.getNonEmptyElements();
|
|
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")
|
|
) {
|
|
if ("br" !== s) break;
|
|
if ("br" === s) {
|
|
o = null;
|
|
break;
|
|
}
|
|
}
|
|
u = u.prev;
|
|
}
|
|
o &&
|
|
(o.remove(),
|
|
Np(p, h, m, i) &&
|
|
(c = p.getElementRule(i.name)) &&
|
|
(c.removeEmpty
|
|
? i.remove()
|
|
: c.paddEmpty && Ep(g, n, d, i)));
|
|
} else {
|
|
for (
|
|
a = o;
|
|
i &&
|
|
i.firstChild === a &&
|
|
i.lastChild === a &&
|
|
!d[(a = i).name];
|
|
|
|
)
|
|
i = i.parent;
|
|
a === i &&
|
|
!0 !== g.padd_empty_with_br &&
|
|
(((l = new sl("#text", 3)).value = "\xa0"), o.replace(l));
|
|
}
|
|
}),
|
|
e.addAttributeFilter("href", function (e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o = e.length;
|
|
if (!g.allow_unsafe_link_target)
|
|
for (; o--; )
|
|
"a" === (t = e[o]).name &&
|
|
"_blank" === t.attr("target") &&
|
|
t.attr(
|
|
"rel",
|
|
((n = t.attr("rel")),
|
|
void 0,
|
|
(r = n ? Rn.trim(n) : ""),
|
|
/\b(noopener)\b/g.test(r)
|
|
? r
|
|
: r
|
|
.split(" ")
|
|
.filter(function (e) {
|
|
return 0 < e.length;
|
|
})
|
|
.concat(["noopener"])
|
|
.sort()
|
|
.join(" ")),
|
|
);
|
|
}),
|
|
g.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);
|
|
|
|
);
|
|
}),
|
|
g.fix_list_elements &&
|
|
e.addNodeFilter("ul,ol", function (e) {
|
|
for (var t, n, r = e.length; r--; )
|
|
if ("ul" === (n = (t = e[r]).parent).name || "ol" === n.name)
|
|
if (t.prev && "li" === t.prev.name) t.prev.append(t);
|
|
else {
|
|
var o = new sl("li", 1);
|
|
o.attr("style", "list-style-type: none"), t.wrap(o);
|
|
}
|
|
}),
|
|
g.validate &&
|
|
p.getValidClasses() &&
|
|
e.addAttributeFilter("class", function (e) {
|
|
for (
|
|
var t, n, r, o, i, a, u, s = e.length, c = p.getValidClasses();
|
|
s--;
|
|
|
|
) {
|
|
for (
|
|
n = (t = e[s]).attr("class").split(" "), i = "", r = 0;
|
|
r < n.length;
|
|
r++
|
|
)
|
|
(o = n[r]),
|
|
(u = !1),
|
|
(a = c["*"]) && a[o] && (u = !0),
|
|
(a = c[t.name]),
|
|
!u && a && a[o] && (u = !0),
|
|
u && (i && (i += " "), (i += o));
|
|
i.length || (i = null), t.attr("class", i);
|
|
}
|
|
});
|
|
})(e, T),
|
|
Ip(e, T),
|
|
e
|
|
);
|
|
}
|
|
function kp(e, t, n) {
|
|
-1 === Rn.inArray(t, n) &&
|
|
(e.addAttributeFilter(n, function (e, t) {
|
|
for (var n = e.length; n--; ) e[n].attr(t, null);
|
|
}),
|
|
t.push(n));
|
|
}
|
|
function Tp(e, t, n, r, o) {
|
|
return (function (e, t, n) {
|
|
return t.no_events || !e ? n : fd(e, Cd(t, { content: n })).content;
|
|
})(
|
|
e,
|
|
o,
|
|
(function (e, t, n) {
|
|
return vl(e, t).serialize(n);
|
|
})(t, n, r),
|
|
);
|
|
}
|
|
function Ap(a, u) {
|
|
var s,
|
|
c,
|
|
l,
|
|
e = ["data-mce-selected"];
|
|
return (
|
|
(s = u && u.dom ? u.dom : Yi.DOM),
|
|
(c = u && u.schema ? u.schema : vr(a)),
|
|
(a.entity_encoding = a.entity_encoding || "named"),
|
|
(a.remove_trailing_brs =
|
|
!("remove_trailing_brs" in a) || a.remove_trailing_brs),
|
|
(l = Sp(a, c)),
|
|
Pp(l, a, s),
|
|
{
|
|
schema: c,
|
|
addNodeFilter: l.addNodeFilter,
|
|
addAttributeFilter: l.addAttributeFilter,
|
|
serialize: function (e, t) {
|
|
var n = Cd({ format: "html" }, t || {}),
|
|
r = Vp(u, e, n),
|
|
o = (function (e, t, n) {
|
|
var r = fu(n.getInner ? t.innerHTML : e.getOuterHTML(t));
|
|
return n.selection || Kn(bt.fromDom(t)) ? r : Rn.trim(r);
|
|
})(s, r, n),
|
|
i = (function (e, t, n) {
|
|
var r = n.selection ? Cd({ forced_root_block: !1 }, n) : n,
|
|
o = e.parse(t, r);
|
|
return Lp(o), o;
|
|
})(l, o, n);
|
|
return "tree" === n.format ? i : Tp(u, a, c, i, n);
|
|
},
|
|
addRules: function (e) {
|
|
c.addValidElements(e);
|
|
},
|
|
setRules: function (e) {
|
|
c.setValidElements(e);
|
|
},
|
|
addTempAttr: d(kp, l, e),
|
|
getTempAttrs: function () {
|
|
return e;
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function Mp(e, t) {
|
|
var n = Ap(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,
|
|
};
|
|
}
|
|
var Rp = Rn.each,
|
|
Dp = Yi.DOM,
|
|
_p = function (e) {
|
|
return e && "string" == typeof e
|
|
? ((e = (e = e.split(/\s*,\s*/)[0]).replace(
|
|
/\s*(~\+|~|\+|>)\s*/g,
|
|
"$1",
|
|
)),
|
|
Rn.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/), function (e) {
|
|
var t = Rn.map(e.split(/(?:~\+|~|\+)/), Cp),
|
|
n = t.pop();
|
|
return t.length && (n.siblings = t), n;
|
|
}).reverse())
|
|
: [];
|
|
},
|
|
Op = function (n, e) {
|
|
var t,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s = "";
|
|
if (!1 === (u = n.settings.preview_styles)) return "";
|
|
"string" != typeof u &&
|
|
(u =
|
|
"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");
|
|
function c(e) {
|
|
return e.replace(/%(\w+)/g, "");
|
|
}
|
|
if ("string" == typeof e) {
|
|
if (!(e = n.formatter.get(e))) return;
|
|
e = e[0];
|
|
}
|
|
return "preview" in e && !1 === (u = e.preview)
|
|
? ""
|
|
: ((t = e.block || e.inline || "span"),
|
|
(r = (i = _p(e.selector)).length
|
|
? (i[0].name || (i[0].name = t), (t = e.selector), bp(i, n))
|
|
: bp([t], n)),
|
|
(o = Dp.select(t, r)[0] || r.firstChild),
|
|
Rp(e.styles, function (e, t) {
|
|
(e = c(e)) && Dp.setStyle(o, t, e);
|
|
}),
|
|
Rp(e.attributes, function (e, t) {
|
|
(e = c(e)) && Dp.setAttrib(o, t, e);
|
|
}),
|
|
Rp(e.classes, function (e) {
|
|
(e = c(e)), Dp.hasClass(o, e) || Dp.addClass(o, e);
|
|
}),
|
|
n.fire("PreviewFormats"),
|
|
Dp.setStyles(r, { position: "absolute", left: -65535 }),
|
|
n.getBody().appendChild(r),
|
|
(a = Dp.getStyle(n.getBody(), "fontSize", !0)),
|
|
(a = /px$/.test(a) ? parseInt(a, 10) : 0),
|
|
Rp(u.split(" "), function (e) {
|
|
var t = Dp.getStyle(o, e, !0);
|
|
if (
|
|
!(
|
|
("background-color" === e &&
|
|
/transparent|rgba\s*\([^)]+,\s*0\)/.test(t) &&
|
|
((t = Dp.getStyle(n.getBody(), e, !0)),
|
|
"#ffffff" === Dp.toHex(t).toLowerCase())) ||
|
|
("color" === e && "#000000" === Dp.toHex(t).toLowerCase())
|
|
)
|
|
) {
|
|
if ("font-size" === e && /em|%$/.test(t)) {
|
|
if (0 === a) return;
|
|
t = (parseFloat(t) / (/%$/.test(t) ? 100 : 1)) * a + "px";
|
|
}
|
|
"border" === e && t && (s += "padding:0 2px;"),
|
|
(s += e + ":" + t + ";");
|
|
}
|
|
}),
|
|
n.fire("AfterPreviewFormats"),
|
|
Dp.remove(r),
|
|
s);
|
|
},
|
|
Bp = function (e, t, n, r, o) {
|
|
var i = t.get(n);
|
|
!Eg.match(e, n, r, o) || ("toggle" in i[0] && !i[0].toggle)
|
|
? gp.applyFormat(e, n, r, o)
|
|
: np(e, n, r, o);
|
|
},
|
|
Hp = 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"]);
|
|
},
|
|
Pp = function (t, s, c) {
|
|
t.addAttributeFilter("data-mce-tabindex", function (e, t) {
|
|
for (var n, r = e.length; r--; )
|
|
(n = e[r]).attr("tabindex", n.attr("data-mce-tabindex")),
|
|
n.attr(t, null);
|
|
}),
|
|
t.addAttributeFilter("src,href,style", function (e, t) {
|
|
for (
|
|
var n,
|
|
r,
|
|
o = e.length,
|
|
i = "data-mce-" + t,
|
|
a = s.url_converter,
|
|
u = s.url_converter_scope;
|
|
o--;
|
|
|
|
)
|
|
(r = (n = e[o]).attr(i)) !== undefined
|
|
? (n.attr(t, 0 < r.length ? r : null), n.attr(i, null))
|
|
: ((r = n.attr(t)),
|
|
"style" === t
|
|
? (r = c.serializeStyle(c.parseStyle(r), n.name))
|
|
: a && (r = a.call(u, r, t, n.name)),
|
|
n.attr(t, 0 < r.length ? r : null));
|
|
}),
|
|
t.addAttributeFilter("class", function (e) {
|
|
for (var t, n, r = e.length; r--; )
|
|
(n = (t = e[r]).attr("class")) &&
|
|
((n = t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g, "")),
|
|
t.attr("class", 0 < n.length ? n : null));
|
|
}),
|
|
t.addAttributeFilter("data-mce-type", function (e, t, n) {
|
|
for (var r, o = e.length; o--; ) {
|
|
if ("bookmark" === (r = e[o]).attr("data-mce-type") && !n.cleanup)
|
|
k.from(r.firstChild).exists(function (e) {
|
|
return !cu(e.value);
|
|
})
|
|
? r.unwrap()
|
|
: r.remove();
|
|
}
|
|
}),
|
|
t.addNodeFilter("noscript", function (e) {
|
|
for (var t, n = e.length; n--; )
|
|
(t = e[n].firstChild) && (t.value = ar.decode(t.value));
|
|
}),
|
|
t.addNodeFilter("script,style", function (e, t) {
|
|
for (
|
|
var n,
|
|
r,
|
|
o,
|
|
i = e.length,
|
|
a = 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,
|
|
"",
|
|
);
|
|
};
|
|
i--;
|
|
|
|
)
|
|
(r = (n = e[i]).firstChild ? n.firstChild.value : ""),
|
|
"script" === t
|
|
? ((o = n.attr("type")) &&
|
|
n.attr(
|
|
"type",
|
|
"mce-no/type" === o ? null : o.replace(/^mce\-/, ""),
|
|
),
|
|
"xhtml" === s.element_format &&
|
|
0 < r.length &&
|
|
(n.firstChild.value = "// <![CDATA[\n" + a(r) + "\n// ]]>"))
|
|
: "xhtml" === s.element_format &&
|
|
0 < r.length &&
|
|
(n.firstChild.value = "\x3c!--\n" + a(r) + "\n--\x3e");
|
|
}),
|
|
t.addNodeFilter("#comment", function (e) {
|
|
for (var t, n = e.length; n--; )
|
|
0 === (t = e[n]).value.indexOf("[CDATA[")
|
|
? ((t.name = "#cdata"),
|
|
(t.type = 4),
|
|
(t.value = t.value.replace(/^\[CDATA\[|\]\]$/g, "")))
|
|
: 0 === t.value.indexOf("mce:protected ") &&
|
|
((t.name = "#text"),
|
|
(t.type = 3),
|
|
(t.raw = !0),
|
|
(t.value = unescape(t.value).substr(14)));
|
|
}),
|
|
t.addNodeFilter("xml:namespace,input", function (e, t) {
|
|
for (var n, r = e.length; r--; )
|
|
7 === (n = e[r]).type
|
|
? n.remove()
|
|
: 1 === n.type &&
|
|
("input" !== t || n.attr("type") || n.attr("type", "text"));
|
|
}),
|
|
t.addAttributeFilter("data-mce-type", function (e) {
|
|
z(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",
|
|
function (e, t) {
|
|
for (var n = e.length; n--; ) e[n].attr(t, null);
|
|
},
|
|
);
|
|
},
|
|
Lp = function (e) {
|
|
function t(e) {
|
|
return e && "br" === e.name;
|
|
}
|
|
var n, r;
|
|
t((n = e.lastChild)) && t((r = n.prev)) && (n.remove(), r.remove());
|
|
},
|
|
Vp = function (e, t, n) {
|
|
return (function (e, t) {
|
|
return e && e.hasEventListeners("PreProcess") && !t.no_events;
|
|
})(e, n)
|
|
? (function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a = e.dom;
|
|
return (
|
|
(t = t.cloneNode(!0)),
|
|
(r = j.document.implementation).createHTMLDocument &&
|
|
((o = r.createHTMLDocument("")),
|
|
Rn.each(
|
|
"BODY" === t.nodeName ? t.childNodes : [t],
|
|
function (e) {
|
|
o.body.appendChild(o.importNode(e, !0));
|
|
},
|
|
),
|
|
(t = "BODY" !== t.nodeName ? o.body.firstChild : o.body),
|
|
(i = a.doc),
|
|
(a.doc = o)),
|
|
ld(e, Cd(n, { node: t })),
|
|
i && (a.doc = i),
|
|
t
|
|
);
|
|
})(e, t, n)
|
|
: t;
|
|
},
|
|
Ip = function (e, t) {
|
|
t.inline_styles && zp(e, t);
|
|
},
|
|
Fp = function (e, t) {
|
|
return (
|
|
e &&
|
|
e.firstChild &&
|
|
e.firstChild === e.lastChild &&
|
|
e.firstChild.name === t
|
|
);
|
|
},
|
|
Up = Rn.makeMap,
|
|
jp = Rn.each,
|
|
qp = Rn.explode,
|
|
$p = Rn.extend;
|
|
function Wp(e) {
|
|
return { getBookmark: d(Ic, e), moveToBookmark: d(Fc, e) };
|
|
}
|
|
(Wp = Wp || {}).isBookmarkNode = Uc;
|
|
function Kp(r, a) {
|
|
var u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
g,
|
|
p,
|
|
v,
|
|
y,
|
|
i,
|
|
b,
|
|
C,
|
|
w,
|
|
x,
|
|
z = a.dom,
|
|
E = Rn.each,
|
|
N = a.getDoc(),
|
|
S = j.document,
|
|
k = Math.abs,
|
|
T = Math.round,
|
|
A = a.getBody();
|
|
function M(e) {
|
|
return e && ("IMG" === e.nodeName || a.dom.is(e, "figure.image"));
|
|
}
|
|
function e(e) {
|
|
var t = e.target;
|
|
!(function (e, t) {
|
|
if ("longpress" !== e.type && 0 !== e.type.indexOf("touch"))
|
|
return M(e.target) && !Qm(e.clientX, e.clientY, t);
|
|
var n = e.touches[0];
|
|
return M(e.target) && !Qm(n.clientX, n.clientY, t);
|
|
})(e, a.selection.getRng()) ||
|
|
e.isDefaultPrevented() ||
|
|
a.selection.select(t);
|
|
}
|
|
function R(e) {
|
|
return a.dom.is(e, "figure.image") ? e.querySelector("img") : e;
|
|
}
|
|
function D(e) {
|
|
var t = a.settings.object_resizing;
|
|
return (
|
|
!1 !== t &&
|
|
!Sn.iOS &&
|
|
("string" != typeof t && (t = "table,img,figure.image,div"),
|
|
"false" !== e.getAttribute("data-mce-resize") &&
|
|
e !== a.getBody() &&
|
|
we(bt.fromDom(e), t))
|
|
);
|
|
}
|
|
function _(e) {
|
|
var t, n, r, o;
|
|
(t = e.screenX - d),
|
|
(n = e.screenY - h),
|
|
(b = t * f[2] + p),
|
|
(C = n * f[3] + v),
|
|
(b = b < 5 ? 5 : b),
|
|
(C = C < 5 ? 5 : C),
|
|
(M(u) && !1 !== a.settings.resize_img_proportional
|
|
? !Mh.modifierPressed(e)
|
|
: Mh.modifierPressed(e) || (M(u) && f[2] * f[3] != 0)) &&
|
|
(k(t) > k(n)
|
|
? ((C = T(b * y)), (b = T(C / y)))
|
|
: ((b = T(C / y)), (C = T(b * y)))),
|
|
z.setStyles(R(s), { width: b, height: C }),
|
|
(r = 0 < (r = f.startPos.x + t) ? r : 0),
|
|
(o = 0 < (o = f.startPos.y + n) ? o : 0),
|
|
z.setStyles(c, { left: r, top: o, display: "block" }),
|
|
(c.innerHTML = b + " × " + C),
|
|
f[2] < 0 && s.clientWidth <= b && z.setStyle(s, "left", m + (p - b)),
|
|
f[3] < 0 && s.clientHeight <= C && z.setStyle(s, "top", g + (v - C)),
|
|
(t = A.scrollWidth - w) + (n = A.scrollHeight - x) !== 0 &&
|
|
z.setStyles(c, { left: r - t, top: o - n }),
|
|
i || (gd(a, u, p, v), (i = !0));
|
|
}
|
|
function n(e) {
|
|
function t(e, t) {
|
|
if (e)
|
|
do {
|
|
if (e === t) return !0;
|
|
} while ((e = e.parentNode));
|
|
}
|
|
var n;
|
|
i ||
|
|
a.removed ||
|
|
(E(
|
|
z.select("img[data-mce-selected],hr[data-mce-selected]"),
|
|
function (e) {
|
|
e.removeAttribute("data-mce-selected");
|
|
},
|
|
),
|
|
(n = "mousedown" === e.type ? e.target : r.getNode()),
|
|
t((n = z.$(n).closest("table,img,figure.image,hr")[0]), A) &&
|
|
(L(), t(r.getStart(!0), n) && t(r.getEnd(!0), n))
|
|
? B(n)
|
|
: H());
|
|
}
|
|
function o(e) {
|
|
return Yp(
|
|
(function (e, t) {
|
|
for (; t && t !== e; ) {
|
|
if (Gp(t) || Yp(t)) return t;
|
|
t = t.parentNode;
|
|
}
|
|
return null;
|
|
})(a.getBody(), e),
|
|
);
|
|
}
|
|
l = {
|
|
nw: [0, 0, -1, -1],
|
|
ne: [1, 0, 1, -1],
|
|
se: [1, 1, 1, 1],
|
|
sw: [0, 1, -1, 1],
|
|
};
|
|
var O = function () {
|
|
i = !1;
|
|
function e(e, t) {
|
|
t &&
|
|
(u.style[e] || !a.schema.isValid(u.nodeName.toLowerCase(), e)
|
|
? z.setStyle(R(u), e, t)
|
|
: z.setAttrib(R(u), e, t));
|
|
}
|
|
e("width", b),
|
|
e("height", C),
|
|
z.unbind(N, "mousemove", _),
|
|
z.unbind(N, "mouseup", O),
|
|
S !== N && (z.unbind(S, "mousemove", _), z.unbind(S, "mouseup", O)),
|
|
z.remove(s),
|
|
z.remove(c),
|
|
B(u),
|
|
pd(a, u, b, C),
|
|
z.setAttrib(u, "style", z.getAttrib(u, "style")),
|
|
a.nodeChanged();
|
|
},
|
|
B = function (e) {
|
|
var t, r, o, n, i;
|
|
H(),
|
|
P(),
|
|
(t = z.getPos(e, A)),
|
|
(m = t.x),
|
|
(g = t.y),
|
|
(i = e.getBoundingClientRect()),
|
|
(r = i.width || i.right - i.left),
|
|
(o = i.height || i.bottom - i.top),
|
|
u !== e && ((u = e), (b = C = 0)),
|
|
(n = a.fire("ObjectSelected", { target: e })),
|
|
D(e) && !n.isDefaultPrevented()
|
|
? E(l, function (t, e) {
|
|
var n;
|
|
(n = z.get("mceResizeHandle" + e)) && z.remove(n),
|
|
(n = z.add(A, "div", {
|
|
id: "mceResizeHandle" + e,
|
|
"data-mce-bogus": "all",
|
|
class: "mce-resizehandle",
|
|
unselectable: !0,
|
|
style: "cursor:" + e + "-resize; margin:0; padding:0",
|
|
})),
|
|
11 === Sn.ie && (n.contentEditable = !1),
|
|
z.bind(n, "mousedown", function (e) {
|
|
e.stopImmediatePropagation(),
|
|
e.preventDefault(),
|
|
(function (e) {
|
|
(d = e.screenX),
|
|
(h = e.screenY),
|
|
(p = R(u).clientWidth),
|
|
(v = R(u).clientHeight),
|
|
(y = v / p),
|
|
((f = t).startPos = {
|
|
x: r * t[0] + m,
|
|
y: o * t[1] + g,
|
|
}),
|
|
(w = A.scrollWidth),
|
|
(x = A.scrollHeight),
|
|
(s = u.cloneNode(!0)),
|
|
z.addClass(s, "mce-clonedresizable"),
|
|
z.setAttrib(s, "data-mce-bogus", "all"),
|
|
(s.contentEditable = !1),
|
|
(s.unSelectabe = !0),
|
|
z.setStyles(s, { left: m, top: g, margin: 0 }),
|
|
s.removeAttribute("data-mce-selected"),
|
|
A.appendChild(s),
|
|
z.bind(N, "mousemove", _),
|
|
z.bind(N, "mouseup", O),
|
|
S !== N &&
|
|
(z.bind(S, "mousemove", _),
|
|
z.bind(S, "mouseup", O)),
|
|
(c = z.add(
|
|
A,
|
|
"div",
|
|
{
|
|
class: "mce-resize-helper",
|
|
"data-mce-bogus": "all",
|
|
},
|
|
p + " × " + v,
|
|
));
|
|
})(e);
|
|
}),
|
|
(t.elm = n),
|
|
z.setStyles(n, {
|
|
left: r * t[0] + m - n.offsetWidth / 2,
|
|
top: o * t[1] + g - n.offsetHeight / 2,
|
|
});
|
|
})
|
|
: H(),
|
|
u.setAttribute("data-mce-selected", "1");
|
|
},
|
|
H = function () {
|
|
var e, t;
|
|
for (e in (P(), u && u.removeAttribute("data-mce-selected"), l))
|
|
(t = z.get("mceResizeHandle" + e)) && (z.unbind(t), z.remove(t));
|
|
},
|
|
P = function () {
|
|
for (var e in l) {
|
|
var t = l[e];
|
|
t.elm && (z.unbind(t.elm), delete t.elm);
|
|
}
|
|
},
|
|
L = function () {
|
|
try {
|
|
a.getDoc().execCommand("enableObjectResizing", !1, !1);
|
|
} catch (e) {}
|
|
};
|
|
return (
|
|
a.on("init", function () {
|
|
L(),
|
|
(Sn.browser.isIE() || Sn.browser.isEdge()) &&
|
|
(a.on("mousedown click", function (e) {
|
|
var t = e.target,
|
|
n = t.nodeName;
|
|
i ||
|
|
!/^(TABLE|IMG|HR)$/.test(n) ||
|
|
o(t) ||
|
|
(2 !== e.button && a.selection.select(t, "TABLE" === n),
|
|
"mousedown" === e.type && a.nodeChanged());
|
|
}),
|
|
a.dom.bind(A, "mscontrolselect", function (e) {
|
|
function t(e) {
|
|
vn.setEditorTimeout(a, function () {
|
|
a.selection.select(e);
|
|
});
|
|
}
|
|
if (o(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));
|
|
}));
|
|
var t = vn.throttle(function (e) {
|
|
a.composing || n(e);
|
|
});
|
|
a.on(
|
|
"nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",
|
|
t,
|
|
),
|
|
a.on("keyup compositionend", function (e) {
|
|
u && "TABLE" === u.nodeName && t(e);
|
|
}),
|
|
a.on("hide blur", H),
|
|
a.on("contextmenu longpress", e, !0);
|
|
}),
|
|
a.on("remove", P),
|
|
{
|
|
isResizable: D,
|
|
showResizeRect: B,
|
|
hideResizeRect: H,
|
|
updateResizeRect: n,
|
|
destroy: function () {
|
|
u = s = null;
|
|
},
|
|
}
|
|
);
|
|
}
|
|
var Xp = Wp,
|
|
Yp = Ge.isContentEditableFalse,
|
|
Gp = Ge.isContentEditableTrue;
|
|
function Jp(e) {
|
|
var t = bt.fromDom(j.document),
|
|
n = Ti(t),
|
|
r = (function (e, t) {
|
|
var n = t.owner(e);
|
|
return Iv(t, n);
|
|
})(e, Fv),
|
|
o = Pi(e),
|
|
i = m(
|
|
r,
|
|
function (e, t) {
|
|
var n = Pi(t);
|
|
return { left: e.left + n.left(), top: e.top + n.top() };
|
|
},
|
|
{ left: 0, top: 0 },
|
|
);
|
|
return Hi(i.left + o.left() + n.left(), i.top + o.top() + n.top());
|
|
}
|
|
function Qp(e) {
|
|
return "textarea" === ie(e);
|
|
}
|
|
function Zp(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 Hi(n.offsetLeft, n.offsetTop);
|
|
var i = ki(r.pageYOffset, o.scrollTop),
|
|
a = ki(r.pageXOffset, o.scrollLeft),
|
|
u = ki(o.clientTop, n.clientTop),
|
|
s = ki(o.clientLeft, n.clientLeft);
|
|
return Pi(e).translate(a - s, i - u);
|
|
})(e),
|
|
r = (function (e) {
|
|
return Vv.get(e);
|
|
})(e);
|
|
return { element: e, bottom: n.top() + r, pos: n, cleanup: t };
|
|
}
|
|
function ev(e, t) {
|
|
var n = (function (e, t) {
|
|
var n = Re(e);
|
|
if (0 === n.length || Qp(e)) return { element: e, offset: t };
|
|
if (t < n.length && !Qp(n[t])) return { element: n[t], offset: 0 };
|
|
var r = n[n.length - 1];
|
|
return Qp(r)
|
|
? { element: e, offset: t }
|
|
: "img" === ie(r)
|
|
? { element: r, offset: 1 }
|
|
: Et(r)
|
|
? { element: r, offset: Qc(r).length }
|
|
: { element: r, offset: Re(r).length };
|
|
})(e, t),
|
|
r = bt.fromHtml('<span data-mce-bogus="all">' + lu + "</span>");
|
|
return (
|
|
wi(n.element, r),
|
|
Zp(r, function () {
|
|
return Oi(r);
|
|
})
|
|
);
|
|
}
|
|
function tv(e) {
|
|
return Zp(bt.fromDom(e), i);
|
|
}
|
|
function nv(n, r, o, i) {
|
|
jv(
|
|
n,
|
|
function (e, t) {
|
|
return Uv(n, r, o, i);
|
|
},
|
|
o,
|
|
);
|
|
}
|
|
function rv(e, t, n, r) {
|
|
var o = bt.fromDom(e.getDoc());
|
|
n(o, Ti(o).top(), t, r);
|
|
}
|
|
function ov(e, t, n, r) {
|
|
var o = e.pos;
|
|
if (n) Ai(o.left(), o.top(), r);
|
|
else {
|
|
var i = o.top() - t + (e.bottom - o.top());
|
|
Ai(o.left(), i, r);
|
|
}
|
|
}
|
|
function iv(e, t, n, r, o) {
|
|
r.pos.top() < t
|
|
? ov(r, n, !1 !== o, e)
|
|
: r.bottom > n + t && ov(r, n, !0 === o, e);
|
|
}
|
|
function av(e, t, n, r) {
|
|
var o = e.dom().defaultView.innerHeight;
|
|
iv(e, t, o, n, r);
|
|
}
|
|
function uv(e, t, n, r, o) {
|
|
var i = t.dom().defaultView.innerHeight;
|
|
iv(t, n, i, r, o);
|
|
var a = Jp(r.element),
|
|
u = Vi(j.window);
|
|
a.top() < u.y()
|
|
? Mi(r.element, !1 !== o)
|
|
: a.top() > u.bottom() && Mi(r.element, !0 === o);
|
|
}
|
|
function sv(e, t, n) {
|
|
return nv(e, d(av), t, n);
|
|
}
|
|
function cv(e, t, n) {
|
|
return rv(e, tv(t), d(av), n);
|
|
}
|
|
function lv(e, t, n) {
|
|
return nv(e, d(uv, e), t, n);
|
|
}
|
|
function fv(e, t, n) {
|
|
return rv(e, tv(t), d(uv, e), n);
|
|
}
|
|
function dv(e) {
|
|
return Ge.isContentEditableTrue(e) || Ge.isContentEditableFalse(e);
|
|
}
|
|
function hv(e, t) {
|
|
var n = (t || j.document).createDocumentFragment();
|
|
return (
|
|
z(e, function (e) {
|
|
n.appendChild(e.dom());
|
|
}),
|
|
bt.fromDom(n)
|
|
);
|
|
}
|
|
function mv(e, t) {
|
|
var n = parseInt(ge(e, t), 10);
|
|
return isNaN(n) ? 1 : n;
|
|
}
|
|
function gv(e) {
|
|
return b(
|
|
e,
|
|
function (e, t) {
|
|
return t.cells().length > e ? t.cells().length : e;
|
|
},
|
|
0,
|
|
);
|
|
}
|
|
function pv(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 (ze(o[i], t)) return k.some(Gv(i, r));
|
|
return k.none();
|
|
}
|
|
function vv(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(Yv(a[u].element(), c));
|
|
}
|
|
return i;
|
|
}
|
|
function yv(e) {
|
|
var t = [];
|
|
if (e) for (var n = 0; n < e.rangeCount; n++) t.push(e.getRangeAt(n));
|
|
return t;
|
|
}
|
|
function bv(e) {
|
|
return y(ty(e), Wn);
|
|
}
|
|
function Cv(e) {
|
|
return ga(e, "td[data-mce-selected],th[data-mce-selected]");
|
|
}
|
|
function wv(e, t) {
|
|
var n = Cv(t),
|
|
r = bv(e);
|
|
return 0 < n.length ? n : r;
|
|
}
|
|
function xv(t, n) {
|
|
return g(t, function (e) {
|
|
return "li" === ie(e) && ah(e, n);
|
|
}).fold($([]), function (e) {
|
|
return (function (e) {
|
|
return g(e, function (e) {
|
|
return "ul" === ie(e) || "ol" === ie(e);
|
|
});
|
|
})(t)
|
|
.map(function (e) {
|
|
return [bt.fromTag("li"), bt.fromTag(ie(e))];
|
|
})
|
|
.getOr([]);
|
|
});
|
|
}
|
|
function zv(e, t) {
|
|
var n = bt.fromDom(t.commonAncestorContainer),
|
|
r = dh(n, e),
|
|
o = y(r, function (e) {
|
|
return _n(e) || Vn(e);
|
|
}),
|
|
i = xv(r, t),
|
|
a = o.concat(
|
|
i.length
|
|
? i
|
|
: (function (t) {
|
|
return jn(t)
|
|
? Se(t)
|
|
.filter(Un)
|
|
.fold($([]), function (e) {
|
|
return [t, e];
|
|
})
|
|
: Un(t)
|
|
? [t]
|
|
: [];
|
|
})(n),
|
|
);
|
|
return X(a, Ta);
|
|
}
|
|
function Ev() {
|
|
return hv([]);
|
|
}
|
|
function Nv(e, t) {
|
|
return (function (e, t) {
|
|
var n = b(
|
|
t,
|
|
function (e, t) {
|
|
return _i(t, e), t;
|
|
},
|
|
e,
|
|
);
|
|
return 0 < t.length ? hv([n]) : n;
|
|
})(bt.fromDom(t.cloneContents()), zv(e, t));
|
|
}
|
|
function Sv(e, o) {
|
|
return (function (e, t) {
|
|
return wa(t, "table", d(ze, e));
|
|
})(e, o[0])
|
|
.bind(function (e) {
|
|
var t = o[0],
|
|
n = o[o.length - 1],
|
|
r = Jv(e);
|
|
return Zv(r, t, n).map(function (e) {
|
|
return hv([Qv(e)]);
|
|
});
|
|
})
|
|
.getOrThunk(Ev);
|
|
}
|
|
function kv(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 Tv(e, t, n) {
|
|
return kv(e, t, function (e) {
|
|
return e.nodeName === n;
|
|
});
|
|
}
|
|
function Av(e) {
|
|
return e && "TABLE" === e.nodeName;
|
|
}
|
|
function Mv(e, t, n) {
|
|
for (
|
|
var r = new bi(t, e.getParent(t.parentNode, e.isBlock) || e.getRoot());
|
|
(t = r[n ? "prev" : "next"]());
|
|
|
|
)
|
|
if (Ge.isBr(t)) return !0;
|
|
}
|
|
function Rv(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 && Ge.isBr(o) && t && e.isEmpty(c))
|
|
return k.some(ju(o.parentNode, e.nodeIndex(o)));
|
|
for (var l, f, d = new bi(o, c); (a = d[r ? "prev" : "next"]()); ) {
|
|
if (
|
|
"false" === e.getContentEditableParent(a) ||
|
|
((f = u), _a((l = a)) && !1 === kv(l, f, os))
|
|
)
|
|
return k.none();
|
|
if (Ge.isText(a) && 0 < a.nodeValue.length)
|
|
return !1 === Tv(a, u, "A")
|
|
? k.some(ju(a, r ? a.nodeValue.length : 0))
|
|
: k.none();
|
|
if (e.isBlock(a) || s[a.nodeName.toLowerCase()]) return k.none();
|
|
i = a;
|
|
}
|
|
return n && i ? k.some(ju(i, 0)) : k.none();
|
|
}
|
|
function Dv(e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = e.getRoot(),
|
|
d = !1;
|
|
if (
|
|
((o = r[(n ? "start" : "end") + "Container"]),
|
|
(i = r[(n ? "start" : "end") + "Offset"]),
|
|
(c = Ge.isElement(o) && i === o.childNodes.length),
|
|
(u = e.schema.getNonEmptyElements()),
|
|
(s = n),
|
|
_a(o))
|
|
)
|
|
return k.none();
|
|
if (
|
|
(Ge.isElement(o) && i > o.childNodes.length - 1 && (s = !1),
|
|
Ge.isDocument(o) && ((o = f), (i = 0)),
|
|
o === f)
|
|
) {
|
|
if (s && (a = o.childNodes[0 < i ? i - 1 : 0])) {
|
|
if (_a(a)) return k.none();
|
|
if (u[a.nodeName] || Av(a)) return k.none();
|
|
}
|
|
if (o.hasChildNodes()) {
|
|
if (
|
|
((i = Math.min(!s && 0 < i ? i - 1 : i, o.childNodes.length - 1)),
|
|
(o = o.childNodes[i]),
|
|
(i = Ge.isText(o) && c ? o.data.length : 0),
|
|
!t && o === f.lastChild && Av(o))
|
|
)
|
|
return k.none();
|
|
if (
|
|
(function (e, t) {
|
|
for (; t && t !== e; ) {
|
|
if (Ge.isContentEditableFalse(t)) return !0;
|
|
t = t.parentNode;
|
|
}
|
|
return !1;
|
|
})(f, o) ||
|
|
_a(o)
|
|
)
|
|
return k.none();
|
|
if (o.hasChildNodes() && !1 === Av(o)) {
|
|
var h = new bi((a = o), f);
|
|
do {
|
|
if (Ge.isContentEditableFalse(a) || _a(a)) {
|
|
d = !1;
|
|
break;
|
|
}
|
|
if (Ge.isText(a) && 0 < a.nodeValue.length) {
|
|
(i = s ? 0 : a.nodeValue.length), (o = a), (d = !0);
|
|
break;
|
|
}
|
|
if (
|
|
u[a.nodeName.toLowerCase()] &&
|
|
(!(l = a) || !/^(TD|TH|CAPTION)$/.test(l.nodeName))
|
|
) {
|
|
(i = e.nodeIndex(a)), (o = a.parentNode), s || i++, (d = !0);
|
|
break;
|
|
}
|
|
} while ((a = s ? h.next() : h.prev()));
|
|
}
|
|
}
|
|
}
|
|
return (
|
|
t &&
|
|
(Ge.isText(o) &&
|
|
0 === i &&
|
|
Rv(e, c, t, !0, o).each(function (e) {
|
|
(o = e.container()), (i = e.offset()), (d = !0);
|
|
}),
|
|
Ge.isElement(o) &&
|
|
(!(a = (a = o.childNodes[i]) || o.childNodes[i - 1]) ||
|
|
!Ge.isBr(a) ||
|
|
(function (e, t) {
|
|
return e.previousSibling && e.previousSibling.nodeName === t;
|
|
})(a, "A") ||
|
|
Mv(e, a, !1) ||
|
|
Mv(e, a, !0) ||
|
|
Rv(e, c, t, !0, a).each(function (e) {
|
|
(o = e.container()), (i = e.offset()), (d = !0);
|
|
}))),
|
|
s &&
|
|
!t &&
|
|
Ge.isText(o) &&
|
|
i === o.nodeValue.length &&
|
|
Rv(e, c, t, !1, o).each(function (e) {
|
|
(o = e.container()), (i = e.offset()), (d = !0);
|
|
}),
|
|
d ? k.some(ju(o, i)) : k.none()
|
|
);
|
|
}
|
|
function _v(e) {
|
|
return 0 === e.dom().length ? (Oi(e), k.none()) : k.some(e);
|
|
}
|
|
function Ov(e, t, n, r, o) {
|
|
var i = n ? t.startContainer : t.endContainer,
|
|
a = n ? t.startOffset : t.endOffset;
|
|
return k
|
|
.from(i)
|
|
.map(bt.fromDom)
|
|
.map(function (e) {
|
|
return r && t.collapsed ? e : De(e, o(e, a)).getOr(e);
|
|
})
|
|
.bind(function (e) {
|
|
return zt(e) ? k.some(e) : Se(e);
|
|
})
|
|
.map(function (e) {
|
|
return e.dom();
|
|
})
|
|
.getOr(e);
|
|
}
|
|
function Bv(e, t, n) {
|
|
return Ov(e, t, !0, n, function (e, t) {
|
|
return Math.min(
|
|
(function (e) {
|
|
return e.dom().childNodes.length;
|
|
})(e),
|
|
t,
|
|
);
|
|
});
|
|
}
|
|
function Hv(e, t, n) {
|
|
return Ov(e, t, !1, n, function (e, t) {
|
|
return 0 < t ? t - 1 : t;
|
|
});
|
|
}
|
|
function Pv(e, t) {
|
|
for (var n = e; e && Ge.isText(e) && 0 === e.length; )
|
|
e = t ? e.nextSibling : e.previousSibling;
|
|
return e || n;
|
|
}
|
|
function Lv(e, t, n) {
|
|
if (e && e.hasOwnProperty(t)) {
|
|
var r = y(e[t], function (e) {
|
|
return e !== n;
|
|
});
|
|
0 === r.length ? delete e[t] : (e[t] = r);
|
|
}
|
|
}
|
|
var Vv = (function EN(r, o) {
|
|
function e(e) {
|
|
var t = o(e);
|
|
if (t <= 0 || null === t) {
|
|
var n = ve(e, r);
|
|
return parseFloat(n) || 0;
|
|
}
|
|
return t;
|
|
}
|
|
function i(o, e) {
|
|
return b(
|
|
e,
|
|
function (e, t) {
|
|
var n = ve(o, t),
|
|
r = n === undefined ? 0 : parseInt(n, 10);
|
|
return isNaN(r) ? e : e + r;
|
|
},
|
|
0,
|
|
);
|
|
}
|
|
return {
|
|
set: function (e, t) {
|
|
if (!_(t) && !t.match(/^[0-9]+$/))
|
|
throw new Error(
|
|
r + ".set accepts only positive integer values. Value was " + t,
|
|
);
|
|
var n = e.dom();
|
|
fe(n) && (n.style[r] = t + "px");
|
|
},
|
|
get: e,
|
|
getOuter: e,
|
|
aggregate: i,
|
|
max: function (e, t, n) {
|
|
var r = i(e, n);
|
|
return r < t ? t - r : 0;
|
|
},
|
|
};
|
|
})("height", function (e) {
|
|
var t = e.dom();
|
|
return de(e) ? t.getBoundingClientRect().height : t.offsetHeight;
|
|
}),
|
|
Iv = function (r, e) {
|
|
return r.view(e).fold($([]), function (e) {
|
|
var t = r.owner(e),
|
|
n = Iv(r, t);
|
|
return [e].concat(n);
|
|
});
|
|
},
|
|
Fv = /* */ Object.freeze({
|
|
view: function (e) {
|
|
return (
|
|
e.dom() === j.document
|
|
? k.none()
|
|
: k.from(e.dom().defaultView.frameElement)
|
|
).map(bt.fromDom);
|
|
},
|
|
owner: function (e) {
|
|
return Ee(e);
|
|
},
|
|
}),
|
|
Uv = function (e, t, n, r) {
|
|
var o = bt.fromDom(e.getBody()),
|
|
i = bt.fromDom(e.getDoc());
|
|
!(function (e) {
|
|
e.dom().offsetWidth;
|
|
})(o);
|
|
var a = Ti(i).top(),
|
|
u = ev(bt.fromDom(n.startContainer), n.startOffset);
|
|
t(i, a, u, r), u.cleanup();
|
|
},
|
|
jv = function (e, t, n) {
|
|
var r = n.startContainer,
|
|
o = n.startOffset,
|
|
i = n.endContainer,
|
|
a = n.endOffset;
|
|
t(bt.fromDom(r), bt.fromDom(i));
|
|
var u = e.dom.createRng();
|
|
u.setStart(r, o), u.setEnd(i, a), e.selection.setRng(n);
|
|
},
|
|
qv = function (e, t, n) {
|
|
!(function (e, t, n) {
|
|
return e
|
|
.fire("ScrollIntoView", { elm: t, alignToTop: n })
|
|
.isDefaultPrevented();
|
|
})(e, t, n) && (e.inline ? cv : fv)(e, t, n);
|
|
},
|
|
$v = function (e, t, n) {
|
|
(e.inline ? sv : lv)(e, t, n);
|
|
},
|
|
Wv = function (e, t, n) {
|
|
var r,
|
|
o,
|
|
i = n;
|
|
if (i.caretPositionFromPoint)
|
|
(o = i.caretPositionFromPoint(e, t)) &&
|
|
((r = n.createRange()).setStart(o.offsetNode, o.offset),
|
|
r.collapse(!0));
|
|
else if (n.caretRangeFromPoint) r = n.caretRangeFromPoint(e, t);
|
|
else if (i.body.createTextRange) {
|
|
r = i.body.createTextRange();
|
|
try {
|
|
r.moveToPoint(e, t), r.collapse(!0);
|
|
} catch (a) {
|
|
r = (function (e, n, t) {
|
|
var r, o, i;
|
|
if (
|
|
((r = t.elementFromPoint(e, n)),
|
|
(o = t.body.createTextRange()),
|
|
(r && "HTML" !== r.tagName) || (r = t.body),
|
|
o.moveToElementText(r),
|
|
0 <
|
|
(i = (i = Rn.toArray(o.getClientRects())).sort(function (e, t) {
|
|
return (
|
|
(e = Math.abs(Math.max(e.top - n, e.bottom - n))) -
|
|
(t = Math.abs(Math.max(t.top - n, t.bottom - n)))
|
|
);
|
|
})).length)
|
|
) {
|
|
n = (i[0].bottom + i[0].top) / 2;
|
|
try {
|
|
return o.moveToPoint(e, n), o.collapse(!0), o;
|
|
} catch (a) {}
|
|
}
|
|
return null;
|
|
})(e, t, n);
|
|
}
|
|
return (function (e, t) {
|
|
var n = e && e.parentElement ? e.parentElement() : null;
|
|
return Ge.isContentEditableFalse(
|
|
(function (e, t, n) {
|
|
for (; e && e !== t; ) {
|
|
if (n(e)) return e;
|
|
e = e.parentNode;
|
|
}
|
|
return null;
|
|
})(n, t, dv),
|
|
)
|
|
? null
|
|
: e;
|
|
})(r, n.body);
|
|
}
|
|
return r;
|
|
},
|
|
Kv = function (n, e) {
|
|
return X(e, function (e) {
|
|
var t = n.fire("GetSelectionRange", { range: e });
|
|
return t.range !== e ? t.range : e;
|
|
});
|
|
},
|
|
Xv = be("element", "width", "rows"),
|
|
Yv = be("element", "cells"),
|
|
Gv = be("x", "y"),
|
|
Jv = function (e) {
|
|
var o = Xv(Ta(e), 0, []);
|
|
return (
|
|
z(ga(e, "tr"), function (n, r) {
|
|
z(ga(n, "td,th"), function (e, t) {
|
|
!(function (e, t, n, r, o) {
|
|
for (
|
|
var i = mv(o, "rowspan"),
|
|
a = mv(o, "colspan"),
|
|
u = e.rows(),
|
|
s = n;
|
|
s < n + i;
|
|
s++
|
|
) {
|
|
u[s] || (u[s] = Yv(Aa(r), []));
|
|
for (var c = t; c < t + a; c++) {
|
|
u[s].cells()[c] = s === n && c === t ? o : Ta(o);
|
|
}
|
|
}
|
|
})(
|
|
o,
|
|
(function (e, t, n) {
|
|
for (
|
|
;
|
|
(r = t),
|
|
(o = n),
|
|
(i = void 0),
|
|
((i = e.rows())[o] ? i[o].cells() : [])[r];
|
|
|
|
)
|
|
t++;
|
|
var r, o, i;
|
|
return t;
|
|
})(o, t, r),
|
|
r,
|
|
n,
|
|
e,
|
|
);
|
|
});
|
|
}),
|
|
Xv(o.element(), gv(o.rows()), o.rows())
|
|
);
|
|
},
|
|
Qv = function (e) {
|
|
return (function (e, t) {
|
|
var n = Ta(e.element()),
|
|
r = bt.fromTag("tbody");
|
|
return Ei(r, t), _i(n, r), n;
|
|
})(
|
|
e,
|
|
(function (e) {
|
|
return X(e.rows(), function (e) {
|
|
var t = X(e.cells(), function (e) {
|
|
var t = Aa(e);
|
|
return pe(t, "colspan"), pe(t, "rowspan"), t;
|
|
}),
|
|
n = Ta(e.element());
|
|
return Ei(n, t), n;
|
|
});
|
|
})(e),
|
|
);
|
|
},
|
|
Zv = function (n, e, r) {
|
|
return pv(n, e).bind(function (t) {
|
|
return pv(n, r).map(function (e) {
|
|
return (function (e, t, n) {
|
|
var r = t.x(),
|
|
o = t.y(),
|
|
i = n.x(),
|
|
a = n.y(),
|
|
u = o < a ? vv(e, r, o, i, a) : vv(e, r, a, i, o);
|
|
return Xv(e.element(), gv(u), u);
|
|
})(n, t, e);
|
|
});
|
|
});
|
|
},
|
|
ey = yv,
|
|
ty = function (e) {
|
|
return v(e, function (e) {
|
|
var t = Ka(e);
|
|
return t ? [bt.fromDom(t)] : [];
|
|
});
|
|
},
|
|
ny = function (e) {
|
|
return 1 < yv(e).length;
|
|
},
|
|
ry = wv,
|
|
oy = function (e) {
|
|
return wv(ey(e.selection.getSel()), bt.fromDom(e.getBody()));
|
|
},
|
|
iy = function (e, t) {
|
|
var n = ry(t, e);
|
|
return 0 < n.length
|
|
? Sv(e, n)
|
|
: (function (e, t) {
|
|
return 0 < t.length && t[0].collapsed ? Ev() : Nv(e, t[0]);
|
|
})(e, t);
|
|
},
|
|
ay = function (e, t) {
|
|
if (
|
|
(void 0 === t && (t = {}),
|
|
(t.get = !0),
|
|
(t.format = t.format || "html"),
|
|
(t.selection = !0),
|
|
(t = e.fire("BeforeGetContent", t)).isDefaultPrevented())
|
|
)
|
|
return e.fire("GetContent", t), t.content;
|
|
if ("text" === t.format)
|
|
return (function (r) {
|
|
return k
|
|
.from(r.selection.getRng())
|
|
.map(function (e) {
|
|
var t = r.dom.add(
|
|
r.getBody(),
|
|
"div",
|
|
{
|
|
"data-mce-bogus": "all",
|
|
style: "overflow: hidden; opacity: 0;",
|
|
},
|
|
e.cloneContents(),
|
|
),
|
|
n = fu(t.innerText);
|
|
return r.dom.remove(t), n;
|
|
})
|
|
.getOr("");
|
|
})(e);
|
|
t.getInner = !0;
|
|
var n = (function (e, t) {
|
|
var n,
|
|
r = e.selection.getRng(),
|
|
o = e.dom.create("body"),
|
|
i = e.selection.getSel(),
|
|
a = Kv(e, ey(i));
|
|
return (
|
|
(n = t.contextual
|
|
? iy(bt.fromDom(e.getBody()), a).dom()
|
|
: r.cloneContents()) && o.appendChild(n),
|
|
e.selection.serializer.serialize(o, t)
|
|
);
|
|
})(e, t);
|
|
return "tree" === t.format
|
|
? n
|
|
: ((t.content = e.selection.isCollapsed() ? "" : n),
|
|
e.fire("GetContent", t),
|
|
t.content);
|
|
},
|
|
uy = function (e, t) {
|
|
var n = t.collapsed,
|
|
r = t.cloneRange(),
|
|
o = ju.fromRangeStart(t);
|
|
return (
|
|
Dv(e, n, !0, r).each(function (e) {
|
|
(n && ju.isAbove(o, e)) || r.setStart(e.container(), e.offset());
|
|
}),
|
|
n ||
|
|
Dv(e, n, !1, r).each(function (e) {
|
|
r.setEnd(e.container(), e.offset());
|
|
}),
|
|
n && r.collapse(!0),
|
|
mh(t, r) ? k.none() : k.some(r)
|
|
);
|
|
},
|
|
sy = function (e, t, n) {
|
|
if (
|
|
(n = (function (e, t) {
|
|
return (
|
|
((e = e || { format: "html" }).set = !0),
|
|
(e.selection = !0),
|
|
(e.content = t),
|
|
e
|
|
);
|
|
})(n, t)).no_events ||
|
|
!(n = e.fire("BeforeSetContent", n)).isDefaultPrevented()
|
|
) {
|
|
var r = e.selection.getRng();
|
|
!(function (r, e) {
|
|
var t = k.from(e.firstChild).map(bt.fromDom),
|
|
n = k.from(e.lastChild).map(bt.fromDom);
|
|
r.deleteContents(), r.insertNode(e);
|
|
var o = t.bind(ke).filter(Et).bind(_v),
|
|
i = n.bind(Te).filter(Et).bind(_v);
|
|
Ga(o, t.filter(Et), function (e, t) {
|
|
!(function (e, t) {
|
|
e.insertData(0, t);
|
|
})(t.dom(), e.dom().data),
|
|
Oi(e);
|
|
}),
|
|
Ga(i, n.filter(Et), function (e, t) {
|
|
var n = t.dom().length;
|
|
t.dom().appendData(e.dom().data), r.setEnd(t.dom(), n), Oi(e);
|
|
}),
|
|
r.collapse(!1);
|
|
})(r, r.createContextualFragment(n.content)),
|
|
e.selection.setRng(r),
|
|
$v(e, r),
|
|
n.no_events || e.fire("SetContent", n);
|
|
} else e.fire("SetContent", n);
|
|
};
|
|
function cy(e) {
|
|
return !!e.select;
|
|
}
|
|
function ly(e) {
|
|
return (
|
|
!(!e || !e.ownerDocument) &&
|
|
Bt(bt.fromDom(e.ownerDocument), bt.fromDom(e))
|
|
);
|
|
}
|
|
function fy(u, s, e, c) {
|
|
function t(e, t) {
|
|
return sy(c, e, t);
|
|
}
|
|
function r() {
|
|
var e,
|
|
t,
|
|
n = d();
|
|
return (
|
|
!(n && n.anchorNode && n.focusNode) ||
|
|
((e = u.createRng()).setStart(n.anchorNode, n.anchorOffset),
|
|
e.collapse(!0),
|
|
(t = u.createRng()).setStart(n.focusNode, n.focusOffset),
|
|
t.collapse(!0),
|
|
e.compareBoundaryPoints(e.START_TO_START, t) <= 0)
|
|
);
|
|
}
|
|
var n,
|
|
o,
|
|
l,
|
|
f,
|
|
i = (function p(i, n) {
|
|
var a, u;
|
|
return {
|
|
selectorChangedWithUnbind: function (e, t) {
|
|
return (
|
|
a ||
|
|
((a = {}),
|
|
(u = {}),
|
|
n.on("NodeChange", function (e) {
|
|
var n = e.element,
|
|
r = i.getParents(n, null, i.getRoot()),
|
|
o = {};
|
|
Rn.each(a, function (e, n) {
|
|
Rn.each(r, function (t) {
|
|
if (i.is(t, n))
|
|
return (
|
|
u[n] ||
|
|
(Rn.each(e, function (e) {
|
|
e(!0, { node: t, selector: n, parents: r });
|
|
}),
|
|
(u[n] = e)),
|
|
(o[n] = e),
|
|
!1
|
|
);
|
|
});
|
|
}),
|
|
Rn.each(u, function (e, t) {
|
|
o[t] ||
|
|
(delete u[t],
|
|
Rn.each(e, function (e) {
|
|
e(!1, { node: n, selector: t, parents: r });
|
|
}));
|
|
});
|
|
})),
|
|
a[e] || (a[e] = []),
|
|
a[e].push(t),
|
|
{
|
|
unbind: function () {
|
|
Lv(a, e, t), Lv(u, e, t);
|
|
},
|
|
}
|
|
);
|
|
},
|
|
};
|
|
})(u, c).selectorChangedWithUnbind,
|
|
a = function (e) {
|
|
var t = h();
|
|
t.collapse(!!e), m(t);
|
|
},
|
|
d = function () {
|
|
return s.getSelection ? s.getSelection() : s.document.selection;
|
|
},
|
|
h = function () {
|
|
function e(e, t, n) {
|
|
try {
|
|
return t.compareBoundaryPoints(e, n);
|
|
} catch (r) {
|
|
return -1;
|
|
}
|
|
}
|
|
var t, n, r, o;
|
|
if (!s) return null;
|
|
if (null == (o = s.document)) return null;
|
|
if (c.bookmark !== undefined && !1 === sd(c)) {
|
|
var i = Zf(c);
|
|
if (i.isSome())
|
|
return i
|
|
.map(function (e) {
|
|
return Kv(c, [e])[0];
|
|
})
|
|
.getOr(o.createRange());
|
|
}
|
|
try {
|
|
(t = d()) &&
|
|
!Ge.isRestrictedNode(t.anchorNode) &&
|
|
(n =
|
|
0 < t.rangeCount
|
|
? t.getRangeAt(0)
|
|
: t.createRange
|
|
? t.createRange()
|
|
: o.createRange());
|
|
} catch (a) {}
|
|
return (
|
|
(n =
|
|
(n = Kv(c, [n])[0]) ||
|
|
(o.createRange ? o.createRange() : o.body.createTextRange()))
|
|
.setStart &&
|
|
9 === n.startContainer.nodeType &&
|
|
n.collapsed &&
|
|
((r = u.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
|
|
);
|
|
},
|
|
m = function (e, t) {
|
|
var n, r;
|
|
if (
|
|
(function (e) {
|
|
return (
|
|
!!e && (!!cy(e) || (ly(e.startContainer) && ly(e.endContainer)))
|
|
);
|
|
})(e)
|
|
) {
|
|
var o = cy(e) ? e : null;
|
|
if (o) {
|
|
f = null;
|
|
try {
|
|
o.select();
|
|
} catch (i) {}
|
|
} else {
|
|
if (
|
|
((n = d()),
|
|
(e = c.fire("SetSelectionRange", { range: e, forward: t }).range),
|
|
n)
|
|
) {
|
|
f = e;
|
|
try {
|
|
n.removeAllRanges(), n.addRange(e);
|
|
} catch (i) {}
|
|
!1 === t &&
|
|
n.extend &&
|
|
(n.collapse(e.endContainer, e.endOffset),
|
|
n.extend(e.startContainer, e.startOffset)),
|
|
(l = 0 < n.rangeCount ? n.getRangeAt(0) : null);
|
|
}
|
|
e.collapsed ||
|
|
e.startContainer !== e.endContainer ||
|
|
!n.setBaseAndExtent ||
|
|
Sn.ie ||
|
|
(e.endOffset - e.startOffset < 2 &&
|
|
e.startContainer.hasChildNodes() &&
|
|
(r = e.startContainer.childNodes[e.startOffset]) &&
|
|
"IMG" === r.tagName &&
|
|
(n.setBaseAndExtent(
|
|
e.startContainer,
|
|
e.startOffset,
|
|
e.endContainer,
|
|
e.endOffset,
|
|
),
|
|
(n.anchorNode === e.startContainer &&
|
|
n.focusNode === e.endContainer) ||
|
|
n.setBaseAndExtent(r, 0, r, 1))),
|
|
c.fire("AfterSetSelectionRange", { range: e, forward: t });
|
|
}
|
|
}
|
|
},
|
|
g = {
|
|
bookmarkManager: null,
|
|
controlSelection: null,
|
|
dom: u,
|
|
win: s,
|
|
serializer: e,
|
|
editor: c,
|
|
collapse: a,
|
|
setCursorLocation: function (e, t) {
|
|
var n = u.createRng();
|
|
e
|
|
? (n.setStart(e, t), n.setEnd(e, t), m(n), a(!1))
|
|
: (uh(u, n, c.getBody(), !0), m(n));
|
|
},
|
|
getContent: function (e) {
|
|
return ay(c, e);
|
|
},
|
|
setContent: t,
|
|
getBookmark: function (e, t) {
|
|
return n.getBookmark(e, t);
|
|
},
|
|
moveToBookmark: function (e) {
|
|
return n.moveToBookmark(e);
|
|
},
|
|
select: function (e, t) {
|
|
return (
|
|
(function (r, e, o) {
|
|
return k.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 && (uh(r, n, e, !0), uh(r, n, e, !1)),
|
|
n
|
|
);
|
|
});
|
|
})(u, e, t).each(m),
|
|
e
|
|
);
|
|
},
|
|
isCollapsed: function () {
|
|
var e = h(),
|
|
t = d();
|
|
return (
|
|
!(!e || e.item) &&
|
|
(e.compareEndPoints
|
|
? 0 === e.compareEndPoints("StartToEnd", e)
|
|
: !t || e.collapsed)
|
|
);
|
|
},
|
|
isForward: r,
|
|
setNode: function (e) {
|
|
return t(u.getOuterHTML(e)), e;
|
|
},
|
|
getNode: function () {
|
|
return (function (e, t) {
|
|
var n, r, o, i, a;
|
|
return t
|
|
? ((r = t.startContainer),
|
|
(o = t.endContainer),
|
|
(i = t.startOffset),
|
|
(a = t.endOffset),
|
|
(n = t.commonAncestorContainer),
|
|
!t.collapsed &&
|
|
(r === o &&
|
|
a - i < 2 &&
|
|
r.hasChildNodes() &&
|
|
(n = r.childNodes[i]),
|
|
3 === r.nodeType &&
|
|
3 === o.nodeType &&
|
|
((r = r.length === i ? Pv(r.nextSibling, !0) : r.parentNode),
|
|
(o = 0 === a ? Pv(o.previousSibling, !1) : o.parentNode),
|
|
r && r === o))
|
|
? r
|
|
: n && 3 === n.nodeType
|
|
? n.parentNode
|
|
: n)
|
|
: e;
|
|
})(c.getBody(), h());
|
|
},
|
|
getSel: d,
|
|
setRng: m,
|
|
getRng: h,
|
|
getStart: function (e) {
|
|
return Bv(c.getBody(), h(), e);
|
|
},
|
|
getEnd: function (e) {
|
|
return Hv(c.getBody(), h(), e);
|
|
},
|
|
getSelectedBlocks: function (e, t) {
|
|
return (function (e, t, n, r) {
|
|
var o,
|
|
i,
|
|
a = [];
|
|
if (
|
|
((i = e.getRoot()),
|
|
(n = e.getParent(n || Bv(i, t, t.collapsed), e.isBlock)),
|
|
(r = e.getParent(r || Hv(i, t, t.collapsed), e.isBlock)),
|
|
n && n !== i && a.push(n),
|
|
n && r && n !== r)
|
|
)
|
|
for (var u = new bi((o = n), i); (o = u.next()) && o !== r; )
|
|
e.isBlock(o) && a.push(o);
|
|
return r && n !== r && r !== i && a.push(r), a;
|
|
})(u, h(), e, t);
|
|
},
|
|
normalize: function () {
|
|
var e = h(),
|
|
t = d();
|
|
if (ny(t) || !sh(c)) return e;
|
|
var n = uy(u, e);
|
|
return (
|
|
n.each(function (e) {
|
|
m(e, r());
|
|
}),
|
|
n.getOr(e)
|
|
);
|
|
},
|
|
selectorChanged: function (e, t) {
|
|
return i(e, t), g;
|
|
},
|
|
selectorChangedWithUnbind: i,
|
|
getScrollContainer: function () {
|
|
for (var e, t = u.getRoot(); t && "BODY" !== t.nodeName; ) {
|
|
if (t.scrollHeight > t.clientHeight) {
|
|
e = t;
|
|
break;
|
|
}
|
|
t = t.parentNode;
|
|
}
|
|
return e;
|
|
},
|
|
scrollIntoView: function (e, t) {
|
|
return qv(c, e, t);
|
|
},
|
|
placeCaretAt: function (e, t) {
|
|
return m(Wv(e, t, c.getDoc()));
|
|
},
|
|
getBoundingClientRect: function () {
|
|
var e = h();
|
|
return e.collapsed
|
|
? _s.fromRangeStart(e).getClientRects()[0]
|
|
: e.getBoundingClientRect();
|
|
},
|
|
destroy: function () {
|
|
(s = l = f = null), o.destroy();
|
|
},
|
|
};
|
|
return (
|
|
(n = Xp(g)),
|
|
(o = Kp(g, c)),
|
|
(g.bookmarkManager = n),
|
|
(g.controlSelection = o),
|
|
g
|
|
);
|
|
}
|
|
function dy(e) {
|
|
return jy(e) && e.data[0] === lu;
|
|
}
|
|
function hy(e) {
|
|
return jy(e) && e.data[e.data.length - 1] === lu;
|
|
}
|
|
function my(e) {
|
|
return e.ownerDocument.createTextNode(lu);
|
|
}
|
|
function gy(e, t) {
|
|
return e
|
|
? (function (e) {
|
|
if (jy(e.previousSibling))
|
|
return (
|
|
hy(e.previousSibling) || e.previousSibling.appendData(lu),
|
|
e.previousSibling
|
|
);
|
|
if (jy(e)) return dy(e) || e.insertData(0, lu), e;
|
|
var t = my(e);
|
|
return e.parentNode.insertBefore(t, e), t;
|
|
})(t)
|
|
: (function (e) {
|
|
if (jy(e.nextSibling))
|
|
return (
|
|
dy(e.nextSibling) || e.nextSibling.insertData(0, lu),
|
|
e.nextSibling
|
|
);
|
|
if (jy(e)) return hy(e) || e.appendData(lu), e;
|
|
var t = my(e);
|
|
return (
|
|
e.nextSibling
|
|
? e.parentNode.insertBefore(t, e.nextSibling)
|
|
: e.parentNode.appendChild(t),
|
|
t
|
|
);
|
|
})(t);
|
|
}
|
|
function py(e, t) {
|
|
return Ge.isText(e.container()) ? gy(t, e.container()) : gy(t, e.getNode());
|
|
}
|
|
function vy(e, t) {
|
|
var n = t.get();
|
|
return n && e.container() === n && Da(n);
|
|
}
|
|
function yy(e, t) {
|
|
if (!t) return t;
|
|
var n = t.container(),
|
|
r = t.offset();
|
|
return e
|
|
? Da(n)
|
|
? Ge.isText(n.nextSibling)
|
|
? _s(n.nextSibling, 0)
|
|
: _s.after(n)
|
|
: Ba(t)
|
|
? _s(n, r + 1)
|
|
: t
|
|
: Da(n)
|
|
? Ge.isText(n.previousSibling)
|
|
? _s(n.previousSibling, n.previousSibling.data.length)
|
|
: _s.before(n)
|
|
: Ha(t)
|
|
? _s(n, r - 1)
|
|
: t;
|
|
}
|
|
function by(e, t) {
|
|
var n = Cs(t, e);
|
|
return n || e;
|
|
}
|
|
function Cy(e, t, n) {
|
|
var r = Xy.normalizeForwards(n),
|
|
o = by(t, r.container());
|
|
return Xy.findRootInline(e, o, r).fold(function () {
|
|
return Lc.nextPosition(o, r)
|
|
.bind(d(Xy.findRootInline, e, o))
|
|
.map(function (e) {
|
|
return Gy.before(e);
|
|
});
|
|
}, k.none);
|
|
}
|
|
function wy(e, t) {
|
|
return null === is(e, t);
|
|
}
|
|
function xy(e, t, n) {
|
|
return Xy.findRootInline(e, t, n).filter(d(wy, t));
|
|
}
|
|
function zy(e, t, n) {
|
|
var r = Xy.normalizeBackwards(n);
|
|
return xy(e, t, r).bind(function (e) {
|
|
return Lc.prevPosition(e, r).isNone() ? k.some(Gy.start(e)) : k.none();
|
|
});
|
|
}
|
|
function Ey(e, t, n) {
|
|
var r = Xy.normalizeForwards(n);
|
|
return xy(e, t, r).bind(function (e) {
|
|
return Lc.nextPosition(e, r).isNone() ? k.some(Gy.end(e)) : k.none();
|
|
});
|
|
}
|
|
function Ny(e, t, n) {
|
|
var r = Xy.normalizeBackwards(n),
|
|
o = by(t, r.container());
|
|
return Xy.findRootInline(e, o, r).fold(function () {
|
|
return Lc.prevPosition(o, r)
|
|
.bind(d(Xy.findRootInline, e, o))
|
|
.map(function (e) {
|
|
return Gy.after(e);
|
|
});
|
|
}, k.none);
|
|
}
|
|
function Sy(e) {
|
|
return !1 === Xy.isRtl(Jy(e));
|
|
}
|
|
function ky(e, t, n) {
|
|
return Yy([Cy, zy, Ey, Ny], [e, t, n]).filter(Sy);
|
|
}
|
|
function Ty(e) {
|
|
return e.fold($("before"), $("start"), $("end"), $("after"));
|
|
}
|
|
function Ay(e) {
|
|
return e.fold(Gy.before, Gy.before, Gy.after, Gy.after);
|
|
}
|
|
function My(n, e, r, t, o, i) {
|
|
return Ga(
|
|
Xy.findRootInline(e, r, t),
|
|
Xy.findRootInline(e, r, o),
|
|
function (e, t) {
|
|
return e !== t && Xy.hasSameParentBlock(r, e, t)
|
|
? Gy.after(n ? e : t)
|
|
: i;
|
|
},
|
|
).getOr(i);
|
|
}
|
|
function Ry(e, t) {
|
|
return e.fold($(!0), function (e) {
|
|
return !(function (e, t) {
|
|
return Ty(e) === Ty(t) && Jy(e) === Jy(t);
|
|
})(e, t);
|
|
});
|
|
}
|
|
function Dy(e, t) {
|
|
return e
|
|
? t.fold(q(k.some, Gy.start), k.none, q(k.some, Gy.after), k.none)
|
|
: t.fold(k.none, q(k.some, Gy.before), k.none, q(k.some, Gy.end));
|
|
}
|
|
function _y(e, t, n, r) {
|
|
var o = Xy.normalizePosition(e, r),
|
|
i = ky(t, n, o);
|
|
return ky(t, n, o)
|
|
.bind(d(Dy, e))
|
|
.orThunk(function () {
|
|
return (function (t, n, r, o, e) {
|
|
var i = Xy.normalizePosition(t, e);
|
|
return Lc.fromPosition(t, r, i)
|
|
.map(d(Xy.normalizePosition, t))
|
|
.fold(
|
|
function () {
|
|
return o.map(Ay);
|
|
},
|
|
function (e) {
|
|
return ky(n, r, e).map(d(My, t, n, r, i, e)).filter(d(Ry, o));
|
|
},
|
|
)
|
|
.filter(Sy);
|
|
})(e, t, n, i, r);
|
|
});
|
|
}
|
|
function Oy(e) {
|
|
return D(e.selection.getSel().modify);
|
|
}
|
|
function By(e, t, n) {
|
|
var r = e ? 1 : -1;
|
|
return (
|
|
t.setRng(_s(n.container(), n.offset() + r).toRange()),
|
|
t.getSel().modify("move", e ? "forward" : "backward", "word"),
|
|
!0
|
|
);
|
|
}
|
|
function Hy(e, t) {
|
|
var n = e.dom.createRng();
|
|
n.setStart(t.container(), t.offset()),
|
|
n.setEnd(t.container(), t.offset()),
|
|
e.selection.setRng(n);
|
|
}
|
|
function Py(e) {
|
|
return !1 !== e.settings.inline_boundaries;
|
|
}
|
|
function Ly(e, t) {
|
|
e
|
|
? t.setAttribute("data-mce-selected", "inline-boundary")
|
|
: t.removeAttribute("data-mce-selected");
|
|
}
|
|
function Vy(t, e, n) {
|
|
return Wy(e, n).map(function (e) {
|
|
return Hy(t, e), n;
|
|
});
|
|
}
|
|
function Iy(e, t, n) {
|
|
return function () {
|
|
return !!Py(t) && nb(e, t);
|
|
};
|
|
}
|
|
var Fy,
|
|
Uy,
|
|
jy = Ge.isText,
|
|
qy = d(gy, !0),
|
|
$y = d(gy, !1),
|
|
Wy = function (n, e) {
|
|
return e.fold(
|
|
function (e) {
|
|
$s.remove(n.get());
|
|
var t = qy(e);
|
|
return n.set(t), k.some(_s(t, t.length - 1));
|
|
},
|
|
function (e) {
|
|
return Lc.firstPositionIn(e).map(function (e) {
|
|
if (vy(e, n)) return _s(n.get(), 1);
|
|
$s.remove(n.get());
|
|
var t = py(e, !0);
|
|
return n.set(t), _s(t, 1);
|
|
});
|
|
},
|
|
function (e) {
|
|
return Lc.lastPositionIn(e).map(function (e) {
|
|
if (vy(e, n)) return _s(n.get(), n.get().length - 1);
|
|
$s.remove(n.get());
|
|
var t = py(e, !1);
|
|
return n.set(t), _s(t, t.length - 1);
|
|
});
|
|
},
|
|
function (e) {
|
|
$s.remove(n.get());
|
|
var t = $y(e);
|
|
return n.set(t), k.some(_s(t, 1));
|
|
},
|
|
);
|
|
},
|
|
Ky = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,
|
|
Xy = {
|
|
isInlineTarget: function (e, t) {
|
|
return we(bt.fromDom(t), Ff(e));
|
|
},
|
|
findRootInline: function (e, t, n) {
|
|
var r = (function (e, t, n) {
|
|
return y(Yi.DOM.getParents(n.container(), "*", t), e);
|
|
})(e, t, n);
|
|
return k.from(r[r.length - 1]);
|
|
},
|
|
isRtl: function (e) {
|
|
return (
|
|
"rtl" === Yi.DOM.getStyle(e, "direction", !0) ||
|
|
(function (e) {
|
|
return Ky.test(e);
|
|
})(e.textContent)
|
|
);
|
|
},
|
|
isAtZwsp: function (e) {
|
|
return Ba(e) || Ha(e);
|
|
},
|
|
normalizePosition: yy,
|
|
normalizeForwards: d(yy, !0),
|
|
normalizeBackwards: d(yy, !1),
|
|
hasSameParentBlock: function (e, t, n) {
|
|
var r = Cs(t, e),
|
|
o = Cs(n, e);
|
|
return r && r === o;
|
|
},
|
|
},
|
|
Yy = function (e, t) {
|
|
for (var n = 0; n < e.length; n++) {
|
|
var r = e[n].apply(null, t);
|
|
if (r.isSome()) return r;
|
|
}
|
|
return k.none();
|
|
},
|
|
Gy = qf([
|
|
{ before: ["element"] },
|
|
{ start: ["element"] },
|
|
{ end: ["element"] },
|
|
{ after: ["element"] },
|
|
]),
|
|
Jy = function (e) {
|
|
return e.fold(W, W, W, W);
|
|
},
|
|
Qy = ky,
|
|
Zy = _y,
|
|
eb = (d(_y, !1), d(_y, !0), Ay),
|
|
tb = function (e) {
|
|
return e.fold(Gy.start, Gy.start, Gy.end, Gy.end);
|
|
},
|
|
nb = function (e, t) {
|
|
var n = t.selection.getRng(),
|
|
r = e ? _s.fromRangeEnd(n) : _s.fromRangeStart(n);
|
|
return (
|
|
!!Oy(t) &&
|
|
(e && Ba(r)
|
|
? By(!0, t.selection, r)
|
|
: !(e || !Ha(r)) && By(!1, t.selection, r))
|
|
);
|
|
},
|
|
rb = {
|
|
move: function (e, t, n) {
|
|
return function () {
|
|
return (
|
|
!!Py(e) &&
|
|
(function (t, n, e) {
|
|
var r = t.getBody(),
|
|
o = _s.fromRangeStart(t.selection.getRng()),
|
|
i = d(Xy.isInlineTarget, t);
|
|
return Zy(e, i, r, o).bind(function (e) {
|
|
return Vy(t, n, e);
|
|
});
|
|
})(e, t, n).isSome()
|
|
);
|
|
};
|
|
},
|
|
moveNextWord: d(Iy, !0),
|
|
movePrevWord: d(Iy, !1),
|
|
setupSelectedState: function (t) {
|
|
var n = Je(null),
|
|
r = d(Xy.isInlineTarget, t);
|
|
return (
|
|
t.on("NodeChange", function (e) {
|
|
Py(t) &&
|
|
((function (e, t, n) {
|
|
var r = y(
|
|
t.select('*[data-mce-selected="inline-boundary"]'),
|
|
e,
|
|
),
|
|
o = y(n, e);
|
|
z(x(r, o), d(Ly, !1)), z(x(o, r), d(Ly, !0));
|
|
})(r, t.dom, e.parents),
|
|
(function (e, t) {
|
|
if (
|
|
e.selection.isCollapsed() &&
|
|
!0 !== e.composing &&
|
|
t.get()
|
|
) {
|
|
var n = _s.fromRangeStart(e.selection.getRng());
|
|
_s.isTextPosition(n) &&
|
|
!1 === Xy.isAtZwsp(n) &&
|
|
(Hy(e, $s.removeAndReposition(t.get(), n)), t.set(null));
|
|
}
|
|
})(t, n),
|
|
(function (n, r, o, e) {
|
|
if (r.selection.isCollapsed()) {
|
|
var t = y(e, n);
|
|
z(t, function (e) {
|
|
var t = _s.fromRangeStart(r.selection.getRng());
|
|
Qy(n, r.getBody(), t).bind(function (e) {
|
|
return Vy(r, o, e);
|
|
});
|
|
});
|
|
}
|
|
})(r, t, n, e.parents));
|
|
}),
|
|
n
|
|
);
|
|
},
|
|
setCaretPosition: Hy,
|
|
};
|
|
((Uy = Fy = Fy || {})[(Uy.Br = 0)] = "Br"),
|
|
(Uy[(Uy.Block = 1)] = "Block"),
|
|
(Uy[(Uy.Wrap = 2)] = "Wrap"),
|
|
(Uy[(Uy.Eol = 3)] = "Eol");
|
|
function ob(e, t) {
|
|
return e === Rs.Backwards ? t.reverse() : t;
|
|
}
|
|
function ib(e, t, n, r) {
|
|
for (
|
|
var o, i, a, u, s, c, l = oc(n), f = r, d = [];
|
|
f && ((s = l), (c = f), (o = t === Rs.Forwards ? s.next(c) : s.prev(c)));
|
|
|
|
) {
|
|
if (Ge.isBr(o.getNode(!1)))
|
|
return t === Rs.Forwards
|
|
? {
|
|
positions: ob(t, d).concat([o]),
|
|
breakType: Fy.Br,
|
|
breakAt: k.some(o),
|
|
}
|
|
: { positions: ob(t, d), breakType: Fy.Br, breakAt: k.some(o) };
|
|
if (o.isVisible()) {
|
|
if (e(f, o)) {
|
|
var h =
|
|
((i = t),
|
|
(a = f),
|
|
(u = o),
|
|
Ge.isBr(u.getNode(i === Rs.Forwards))
|
|
? Fy.Br
|
|
: !1 === ws(a, u)
|
|
? Fy.Block
|
|
: Fy.Wrap);
|
|
return { positions: ob(t, d), breakType: h, breakAt: k.some(o) };
|
|
}
|
|
d.push(o), (f = o);
|
|
} else f = o;
|
|
}
|
|
return { positions: ob(t, d), breakType: Fy.Eol, breakAt: k.none() };
|
|
}
|
|
function ab(n, r, o, e) {
|
|
return r(o, e)
|
|
.breakAt.map(function (e) {
|
|
var t = r(o, e).positions;
|
|
return n === Rs.Backwards ? t.concat(e) : [e].concat(t);
|
|
})
|
|
.getOr([]);
|
|
}
|
|
function ub(e, i) {
|
|
return b(
|
|
e,
|
|
function (e, o) {
|
|
return e.fold(
|
|
function () {
|
|
return k.some(o);
|
|
},
|
|
function (r) {
|
|
return Ga(
|
|
E(r.getClientRects()),
|
|
E(o.getClientRects()),
|
|
function (e, t) {
|
|
var n = Math.abs(i - e.left);
|
|
return Math.abs(i - t.left) <= n ? o : r;
|
|
},
|
|
).or(e);
|
|
},
|
|
);
|
|
},
|
|
k.none(),
|
|
);
|
|
}
|
|
function sb(t, e) {
|
|
return E(e.getClientRects()).bind(function (e) {
|
|
return ub(t, e.left);
|
|
});
|
|
}
|
|
function cb(e, t, n, r) {
|
|
var o = e === Rs.Forwards,
|
|
i = o ? Lh : Vh;
|
|
if (!r.collapsed) {
|
|
var a = mx(r);
|
|
if (hx(a)) return em(e, t, a, e === Rs.Backwards, !0);
|
|
}
|
|
var u = (function (e) {
|
|
return Ra(e.startContainer);
|
|
})(r),
|
|
s = ks(e, t.getBody(), r);
|
|
if (i(s)) return tm(t, s.getNode(!o));
|
|
var c = Xy.normalizePosition(o, n(s));
|
|
if (!c) return u ? r : null;
|
|
if (i(c)) return em(e, t, c.getNode(!o), o, !0);
|
|
var l = n(c);
|
|
return l && i(l) && Ms(c, l)
|
|
? em(e, t, l.getNode(!o), o, !0)
|
|
: u
|
|
? rm(t, c.toRange(), !0)
|
|
: null;
|
|
}
|
|
function lb(e, t, n, r) {
|
|
var o, i, a, u, s, c, l, f, d;
|
|
if (
|
|
((d = mx(r)),
|
|
(o = ks(e, t.getBody(), r)),
|
|
(i = n(t.getBody(), Fh(1), o)),
|
|
(a = y(i, Uh(1))),
|
|
(s = Tn.last(o.getClientRects())),
|
|
(Lh(o) || Hh(o)) && (d = o.getNode()),
|
|
(Vh(o) || Ph(o)) && (d = o.getNode(!0)),
|
|
!s)
|
|
)
|
|
return null;
|
|
if (((c = s.left), (u = Wh(a, c)) && hx(u.node)))
|
|
return (
|
|
(l = Math.abs(c - u.left)),
|
|
(f = Math.abs(c - u.right)),
|
|
em(e, t, u.node, l < f, !0)
|
|
);
|
|
if (d) {
|
|
var h = (function (e, t, n, r) {
|
|
function o(e) {
|
|
return Tn.last(e.getClientRects());
|
|
}
|
|
var i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = oc(t),
|
|
d = [],
|
|
h = 0;
|
|
l = o(
|
|
(s =
|
|
1 === e
|
|
? ((i = f.next), (a = $a), (u = qa), _s.after(r))
|
|
: ((i = f.prev), (a = qa), (u = $a), _s.before(r))),
|
|
);
|
|
do {
|
|
if (s.isVisible() && !u((c = o(s)), l)) {
|
|
if (
|
|
(0 < d.length && a(c, Tn.last(d)) && h++,
|
|
((c = Fa(c)).position = s),
|
|
(c.line = h),
|
|
n(c))
|
|
)
|
|
return d;
|
|
d.push(c);
|
|
}
|
|
} while ((s = i(s)));
|
|
return d;
|
|
})(e, t.getBody(), Fh(1), d);
|
|
if ((u = Wh(y(h, Uh(1)), c))) return rm(t, u.position.toRange(), !0);
|
|
if ((u = Tn.last(y(h, Uh(0))))) return rm(t, u.position.toRange(), !0);
|
|
}
|
|
}
|
|
function fb(e, t, n) {
|
|
var r,
|
|
o,
|
|
i = oc(e.getBody()),
|
|
a = d(As, i.next),
|
|
u = d(As, i.prev);
|
|
if (n.collapsed && e.settings.forced_root_block) {
|
|
if (!(r = e.dom.getParent(n.startContainer, "PRE"))) return;
|
|
(1 === t ? a(_s.fromRangeStart(n)) : u(_s.fromRangeStart(n))) ||
|
|
((o = (function (e) {
|
|
var t = e.dom.create(gf(e));
|
|
return (
|
|
(!Sn.ie || 11 <= Sn.ie) &&
|
|
(t.innerHTML = '<br data-mce-bogus="1">'),
|
|
t
|
|
);
|
|
})(e)),
|
|
1 === t ? e.$(r).after(o) : e.$(r).before(o),
|
|
e.selection.select(o, !0),
|
|
e.selection.collapse());
|
|
}
|
|
}
|
|
function db(t, n) {
|
|
return function () {
|
|
var e = (function (e, t) {
|
|
var n,
|
|
r = oc(e.getBody()),
|
|
o = d(As, r.next),
|
|
i = d(As, r.prev),
|
|
a = t ? Rs.Forwards : Rs.Backwards,
|
|
u = t ? o : i,
|
|
s = e.selection.getRng();
|
|
return (n = cb(a, e, u, s)) ? n : (n = fb(e, a, s)) || null;
|
|
})(t, n);
|
|
return !!e && (t.selection.setRng(e), !0);
|
|
};
|
|
}
|
|
function hb(t, n) {
|
|
return function () {
|
|
var e = (function (e, t) {
|
|
var n,
|
|
r = t ? 1 : -1,
|
|
o = t ? Ym : Xm,
|
|
i = e.selection.getRng();
|
|
return (n = lb(r, e, o, i)) ? n : (n = fb(e, r, i)) || null;
|
|
})(t, n);
|
|
return !!e && (t.selection.setRng(e), !0);
|
|
};
|
|
}
|
|
function mb(n, r) {
|
|
return function () {
|
|
var e = r
|
|
? _s.fromRangeEnd(n.selection.getRng())
|
|
: _s.fromRangeStart(n.selection.getRng()),
|
|
t = r ? lx(n.getBody(), e) : cx(n.getBody(), e);
|
|
return (r ? N(t.positions) : E(t.positions))
|
|
.filter(
|
|
(function (t) {
|
|
return function (e) {
|
|
return t ? Vh(e) : Lh(e);
|
|
};
|
|
})(r),
|
|
)
|
|
.fold($(!1), function (e) {
|
|
return n.selection.setRng(e.toRange()), !0;
|
|
});
|
|
};
|
|
}
|
|
function gb(e, t, n, r, o) {
|
|
var i = ga(bt.fromDom(n), "td,th,caption").map(function (e) {
|
|
return e.dom();
|
|
});
|
|
return (function (e, o, i) {
|
|
return b(
|
|
e,
|
|
function (e, r) {
|
|
return e.fold(
|
|
function () {
|
|
return k.some(r);
|
|
},
|
|
function (e) {
|
|
var t = Math.sqrt(Math.abs(e.x - o) + Math.abs(e.y - i)),
|
|
n = Math.sqrt(Math.abs(r.x - o) + Math.abs(r.y - i));
|
|
return k.some(n < t ? r : e);
|
|
},
|
|
);
|
|
},
|
|
k.none(),
|
|
);
|
|
})(
|
|
y(
|
|
(function (n, e) {
|
|
return v(e, function (e) {
|
|
var t = (function (e, t) {
|
|
return {
|
|
left: e.left - t,
|
|
top: e.top - t,
|
|
right: e.right + 2 * t,
|
|
bottom: e.bottom + 2 * t,
|
|
width: e.width + t,
|
|
height: e.height + t,
|
|
};
|
|
})(Fa(e.getBoundingClientRect()), -1);
|
|
return [
|
|
{ x: t.left, y: n(t), cell: e },
|
|
{ x: t.right, y: n(t), cell: e },
|
|
];
|
|
});
|
|
})(e, i),
|
|
function (e) {
|
|
return t(e, o);
|
|
},
|
|
),
|
|
r,
|
|
o,
|
|
).map(function (e) {
|
|
return e.cell;
|
|
});
|
|
}
|
|
function pb(t, n) {
|
|
return E(n.getClientRects())
|
|
.bind(function (e) {
|
|
return gx(t, e.left, e.top);
|
|
})
|
|
.bind(function (e) {
|
|
return sb(
|
|
(function (t) {
|
|
return Lc.lastPositionIn(t)
|
|
.map(function (e) {
|
|
return cx(t, e).positions.concat(e);
|
|
})
|
|
.getOr([]);
|
|
})(e),
|
|
n,
|
|
);
|
|
});
|
|
}
|
|
function vb(t, n) {
|
|
return N(n.getClientRects())
|
|
.bind(function (e) {
|
|
return px(t, e.left, e.top);
|
|
})
|
|
.bind(function (e) {
|
|
return sb(
|
|
(function (t) {
|
|
return Lc.firstPositionIn(t)
|
|
.map(function (e) {
|
|
return [e].concat(lx(t, e).positions);
|
|
})
|
|
.getOr([]);
|
|
})(e),
|
|
n,
|
|
);
|
|
});
|
|
}
|
|
function yb(e, t) {
|
|
e.selection.setRng(t), $v(e, t);
|
|
}
|
|
function bb(e, t, n) {
|
|
var r = e(t, n);
|
|
return (function (e) {
|
|
return e.breakType === Fy.Wrap && 0 === e.positions.length;
|
|
})(r) ||
|
|
(!Ge.isBr(n.getNode()) &&
|
|
(function (e) {
|
|
return e.breakType === Fy.Br && 1 === e.positions.length;
|
|
})(r))
|
|
? !(function (t, n, e) {
|
|
return e.breakAt
|
|
.map(function (e) {
|
|
return t(n, e).breakAt.isSome();
|
|
})
|
|
.getOr(!1);
|
|
})(e, t, r)
|
|
: r.breakAt.isNone();
|
|
}
|
|
function Cb(e, t, n, r) {
|
|
var o = e.selection.getRng(),
|
|
i = t ? 1 : -1;
|
|
if (
|
|
ms() &&
|
|
(function (e, t, n) {
|
|
var r = _s.fromRangeStart(t);
|
|
return Lc.positionIn(!e, n)
|
|
.map(function (e) {
|
|
return e.isEqual(r);
|
|
})
|
|
.getOr(!1);
|
|
})(t, o, n)
|
|
) {
|
|
var a = em(i, e, n, !t, !0);
|
|
return yb(e, a), !0;
|
|
}
|
|
return !1;
|
|
}
|
|
function wb(e, t) {
|
|
var n = t.getNode(e);
|
|
return Ge.isElement(n) && "TABLE" === n.nodeName ? k.some(n) : k.none();
|
|
}
|
|
function xb(n, r, o) {
|
|
var e = wb(!!r, o),
|
|
i = !1 === r;
|
|
e.fold(
|
|
function () {
|
|
return yb(n, o.toRange());
|
|
},
|
|
function (t) {
|
|
return Lc.positionIn(i, n.getBody())
|
|
.filter(function (e) {
|
|
return e.isEqual(o);
|
|
})
|
|
.fold(
|
|
function () {
|
|
return yb(n, o.toRange());
|
|
},
|
|
function (e) {
|
|
return (function (n, r, o, e) {
|
|
var i = gf(r);
|
|
i
|
|
? r.undoManager.transact(function () {
|
|
var e = bt.fromTag(i);
|
|
me(e, pf(r)),
|
|
_i(e, bt.fromTag("br")),
|
|
n ? xi(bt.fromDom(o), e) : wi(bt.fromDom(o), e);
|
|
var t = r.dom.createRng();
|
|
t.setStart(e.dom(), 0), t.setEnd(e.dom(), 0), yb(r, t);
|
|
})
|
|
: yb(r, e.toRange());
|
|
})(r, n, t, o);
|
|
},
|
|
);
|
|
},
|
|
);
|
|
}
|
|
function zb(e, t, n, r) {
|
|
var o = e.selection.getRng(),
|
|
i = _s.fromRangeStart(o),
|
|
a = e.getBody();
|
|
if (!t && vx(r, i)) {
|
|
var u = (function (t, n, e) {
|
|
return pb(n, e)
|
|
.orThunk(function () {
|
|
return E(e.getClientRects()).bind(function (e) {
|
|
return ub(fx(t, _s.before(n)), e.left);
|
|
});
|
|
})
|
|
.getOr(_s.before(n));
|
|
})(a, n, i);
|
|
return xb(e, t, u), !0;
|
|
}
|
|
if (t && yx(r, i)) {
|
|
u = (function (t, n, e) {
|
|
return vb(n, e)
|
|
.orThunk(function () {
|
|
return E(e.getClientRects()).bind(function (e) {
|
|
return ub(dx(t, _s.after(n)), e.left);
|
|
});
|
|
})
|
|
.getOr(_s.after(n));
|
|
})(a, n, i);
|
|
return xb(e, t, u), !0;
|
|
}
|
|
return !1;
|
|
}
|
|
function Eb(t, n) {
|
|
return function () {
|
|
return k
|
|
.from(t.dom.getParent(t.selection.getNode(), "td,th"))
|
|
.bind(function (e) {
|
|
return k.from(t.dom.getParent(e, "table")).map(function (e) {
|
|
return Cb(t, n, e);
|
|
});
|
|
})
|
|
.getOr(!1);
|
|
};
|
|
}
|
|
function Nb(n, r) {
|
|
return function () {
|
|
return k
|
|
.from(n.dom.getParent(n.selection.getNode(), "td,th"))
|
|
.bind(function (t) {
|
|
return k.from(n.dom.getParent(t, "table")).map(function (e) {
|
|
return zb(n, r, e, t);
|
|
});
|
|
})
|
|
.getOr(!1);
|
|
};
|
|
}
|
|
function Sb(e) {
|
|
return h(["figcaption"], ie(e));
|
|
}
|
|
function kb(e) {
|
|
var t = j.document.createRange();
|
|
return t.setStartBefore(e.dom()), t.setEndBefore(e.dom()), t;
|
|
}
|
|
function Tb(e, t, n) {
|
|
n ? _i(e, t) : zi(e, t);
|
|
}
|
|
function Ab(e, t, n, r) {
|
|
return "" === t
|
|
? (function (e, t) {
|
|
var n = bt.fromTag("br");
|
|
return Tb(e, n, t), kb(n);
|
|
})(e, r)
|
|
: (function (e, t, n, r) {
|
|
var o = bt.fromTag(n),
|
|
i = bt.fromTag("br");
|
|
return me(o, r), _i(o, i), Tb(e, o, t), kb(i);
|
|
})(e, r, t, n);
|
|
}
|
|
function Mb(e, t, n) {
|
|
return t
|
|
? (function (e, t) {
|
|
return lx(e, t).breakAt.isNone();
|
|
})(e.dom(), n)
|
|
: (function (e, t) {
|
|
return cx(e, t).breakAt.isNone();
|
|
})(e.dom(), n);
|
|
}
|
|
function Rb(t, n) {
|
|
var r = bt.fromDom(t.getBody()),
|
|
o = _s.fromRangeStart(t.selection.getRng()),
|
|
i = gf(t),
|
|
a = pf(t);
|
|
return (function (e, t) {
|
|
var n = d(ze, t);
|
|
return Ca(bt.fromDom(e.container()), In, n).filter(Sb);
|
|
})(o, r).exists(function () {
|
|
if (Mb(r, n, o)) {
|
|
var e = Ab(r, i, a, n);
|
|
return t.selection.setRng(e), !0;
|
|
}
|
|
return !1;
|
|
});
|
|
}
|
|
function Db(e, t) {
|
|
return function () {
|
|
return !!e.selection.isCollapsed() && Rb(e, t);
|
|
};
|
|
}
|
|
function _b(e, t) {
|
|
return v(
|
|
(function (e) {
|
|
return X(e, function (e) {
|
|
return Cd(
|
|
{
|
|
shiftKey: !1,
|
|
altKey: !1,
|
|
ctrlKey: !1,
|
|
metaKey: !1,
|
|
keyCode: 0,
|
|
action: i,
|
|
},
|
|
e,
|
|
);
|
|
});
|
|
})(e),
|
|
function (e) {
|
|
return (function (e, t) {
|
|
return (
|
|
t.keyCode === e.keyCode &&
|
|
t.shiftKey === e.shiftKey &&
|
|
t.altKey === e.altKey &&
|
|
t.ctrlKey === e.ctrlKey &&
|
|
t.metaKey === e.metaKey
|
|
);
|
|
})(e, t)
|
|
? [e]
|
|
: [];
|
|
},
|
|
);
|
|
}
|
|
function Ob(e, t) {
|
|
return { from: $(e), to: $(t) };
|
|
}
|
|
function Bb(e, t) {
|
|
var n = bt.fromDom(e),
|
|
r = bt.fromDom(t.container());
|
|
return xx(n, r).map(function (e) {
|
|
return (function (e, t) {
|
|
return { block: $(e), position: $(t) };
|
|
})(e, t);
|
|
});
|
|
}
|
|
function Hb(t, n, e) {
|
|
var r = Bb(t, _s.fromRangeStart(e)),
|
|
o = r.bind(function (e) {
|
|
return Lc.fromPosition(n, t, e.position()).bind(function (e) {
|
|
return Bb(t, e).map(function (e) {
|
|
return (function (t, n, r) {
|
|
return Ge.isBr(r.position().getNode()) && !1 === Tg(r.block())
|
|
? Lc.positionIn(!1, r.block().dom())
|
|
.bind(function (e) {
|
|
return e.isEqual(r.position())
|
|
? Lc.fromPosition(n, t, e).bind(function (e) {
|
|
return Bb(t, e);
|
|
})
|
|
: k.some(r);
|
|
})
|
|
.getOr(r)
|
|
: r;
|
|
})(t, n, e);
|
|
});
|
|
});
|
|
});
|
|
return Ga(r, o, Ob).filter(function (e) {
|
|
return (
|
|
(function (e) {
|
|
return !1 === ze(e.from().block(), e.to().block());
|
|
})(e) &&
|
|
(function (e) {
|
|
return Se(e.from().block())
|
|
.bind(function (t) {
|
|
return Se(e.to().block()).filter(function (e) {
|
|
return ze(t, e);
|
|
});
|
|
})
|
|
.isSome();
|
|
})(e) &&
|
|
(function (e) {
|
|
return (
|
|
!1 === Ge.isContentEditableFalse(e.from().block().dom()) &&
|
|
!1 === Ge.isContentEditableFalse(e.to().block().dom())
|
|
);
|
|
})(e)
|
|
);
|
|
});
|
|
}
|
|
function Pb(e) {
|
|
var t = (function (e) {
|
|
var t = Re(e);
|
|
return p(t, In).fold(
|
|
function () {
|
|
return t;
|
|
},
|
|
function (e) {
|
|
return t.slice(0, e);
|
|
},
|
|
);
|
|
})(e);
|
|
return z(t, Oi), t;
|
|
}
|
|
function Lb(e, t) {
|
|
var n = dh(t, e);
|
|
return g(n.reverse(), Tg).each(Oi);
|
|
}
|
|
function Vb(e, t, n, r) {
|
|
if (Tg(n)) return Cg(n), Lc.firstPositionIn(n.dom());
|
|
(function (e) {
|
|
return (
|
|
0 ===
|
|
y(Ae(e), function (e) {
|
|
return !Tg(e);
|
|
}).length
|
|
);
|
|
})(r) &&
|
|
Tg(t) &&
|
|
wi(r, bt.fromTag("br"));
|
|
var o = Lc.prevPosition(n.dom(), _s.before(r.dom()));
|
|
return (
|
|
z(Pb(t), function (e) {
|
|
wi(r, e);
|
|
}),
|
|
Lb(e, t),
|
|
o
|
|
);
|
|
}
|
|
function Ib(e, t, n) {
|
|
if (Tg(n)) return Oi(n), Tg(t) && Cg(t), Lc.firstPositionIn(t.dom());
|
|
var r = Lc.lastPositionIn(n.dom());
|
|
return (
|
|
z(Pb(t), function (e) {
|
|
_i(n, e);
|
|
}),
|
|
Lb(e, t),
|
|
r
|
|
);
|
|
}
|
|
function Fb(e, t) {
|
|
return Bt(t, e)
|
|
? (function (e, t) {
|
|
var n = dh(t, e);
|
|
return k.from(n[n.length - 1]);
|
|
})(t, e)
|
|
: k.none();
|
|
}
|
|
function Ub(e, t) {
|
|
Lc.positionIn(e, t.dom())
|
|
.map(function (e) {
|
|
return e.getNode();
|
|
})
|
|
.map(bt.fromDom)
|
|
.filter(On)
|
|
.each(Oi);
|
|
}
|
|
function jb(e, t, n) {
|
|
return Ub(!0, t), Ub(!1, n), Fb(t, n).fold(d(Ib, e, t, n), d(Vb, e, t, n));
|
|
}
|
|
function qb(e, t) {
|
|
var n = bt.fromDom(t),
|
|
r = d(ze, e);
|
|
return ba(n, Wn, r).isSome();
|
|
}
|
|
function $b(e, t) {
|
|
var n = Lc.prevPosition(e.dom(), _s.fromRangeStart(t)).isNone(),
|
|
r = Lc.nextPosition(e.dom(), _s.fromRangeEnd(t)).isNone();
|
|
return (
|
|
!(function (e, t) {
|
|
return qb(e, t.startContainer) || qb(e, t.endContainer);
|
|
})(e, t) &&
|
|
n &&
|
|
r
|
|
);
|
|
}
|
|
function Wb(e) {
|
|
var t = bt.fromDom(e.getBody()),
|
|
n = e.selection.getRng();
|
|
return $b(t, n)
|
|
? (function (e) {
|
|
return e.setContent(""), e.selection.setCursorLocation(), !0;
|
|
})(e)
|
|
: (function (n, r) {
|
|
var o = r.getRng();
|
|
return Ga(
|
|
xx(n, bt.fromDom(o.startContainer)),
|
|
xx(n, bt.fromDom(o.endContainer)),
|
|
function (e, t) {
|
|
return (
|
|
!1 === ze(e, t) &&
|
|
(o.deleteContents(),
|
|
Sx(n, !0, e, t).each(function (e) {
|
|
r.setRng(e.toRange());
|
|
}),
|
|
!0)
|
|
);
|
|
},
|
|
).getOr(!1);
|
|
})(t, e.selection);
|
|
}
|
|
function Kb(e) {
|
|
return Ts(e).exists(On);
|
|
}
|
|
function Xb(e, t, n) {
|
|
var r = y(dh(bt.fromDom(n.container()), t), In),
|
|
o = E(r).getOr(t);
|
|
return Lc.fromPosition(e, o.dom(), n).filter(Kb);
|
|
}
|
|
function Yb(e, t) {
|
|
return Ts(t).exists(On) || Xb(!0, e, t).isSome();
|
|
}
|
|
function Gb(e, t) {
|
|
return (
|
|
(function (e) {
|
|
return k.from(e.getNode(!0)).map(bt.fromDom);
|
|
})(t).exists(On) || Xb(!1, e, t).isSome()
|
|
);
|
|
}
|
|
function Jb(e, t, n, r) {
|
|
var o = r.getNode(!1 === t);
|
|
return xx(bt.fromDom(e), bt.fromDom(n.getNode()))
|
|
.map(function (e) {
|
|
return Tg(e) ? Rx.remove(e.dom()) : Rx.moveToElement(o);
|
|
})
|
|
.orThunk(function () {
|
|
return k.some(Rx.moveToElement(o));
|
|
});
|
|
}
|
|
function Qb(t, n, r) {
|
|
return Lc.fromPosition(n, t, r).bind(function (e) {
|
|
return (function (e) {
|
|
return Wn(bt.fromDom(e)) || jn(bt.fromDom(e));
|
|
})(e.getNode())
|
|
? k.none()
|
|
: (function (t, e, n, r) {
|
|
function o(e) {
|
|
return _n(bt.fromDom(e)) && !ws(n, r, t);
|
|
}
|
|
return Ss(!e, n).fold(function () {
|
|
return Ss(e, r).fold($(!1), o);
|
|
}, o);
|
|
})(t, n, r, e)
|
|
? k.none()
|
|
: n && Ge.isContentEditableFalse(e.getNode())
|
|
? Jb(t, n, r, e)
|
|
: !1 === n && Ge.isContentEditableFalse(e.getNode(!0))
|
|
? Jb(t, n, r, e)
|
|
: n && Vh(r)
|
|
? k.some(Rx.moveToPosition(e))
|
|
: !1 === n && Lh(r)
|
|
? k.some(Rx.moveToPosition(e))
|
|
: k.none();
|
|
});
|
|
}
|
|
function Zb(t, e, n) {
|
|
return (function (e, t) {
|
|
var n = t.getNode(!1 === e),
|
|
r = e ? "after" : "before";
|
|
return Ge.isElement(n) && n.getAttribute("data-mce-caret") === r;
|
|
})(e, n)
|
|
? (function (e, t) {
|
|
return e && Ge.isContentEditableFalse(t.nextSibling)
|
|
? k.some(Rx.moveToElement(t.nextSibling))
|
|
: !1 === e && Ge.isContentEditableFalse(t.previousSibling)
|
|
? k.some(Rx.moveToElement(t.previousSibling))
|
|
: k.none();
|
|
})(e, n.getNode(!1 === e)).fold(function () {
|
|
return Qb(t, e, n);
|
|
}, k.some)
|
|
: Qb(t, e, n).bind(function (e) {
|
|
return (function (t, n, e) {
|
|
return e.fold(
|
|
function (e) {
|
|
return k.some(Rx.remove(e));
|
|
},
|
|
function (e) {
|
|
return k.some(Rx.moveToElement(e));
|
|
},
|
|
function (e) {
|
|
return ws(n, e, t) ? k.none() : k.some(Rx.moveToPosition(e));
|
|
},
|
|
);
|
|
})(t, n, e);
|
|
});
|
|
}
|
|
function eC(e, t) {
|
|
return k.from(Dx(e.getBody(), t));
|
|
}
|
|
function tC(t, n) {
|
|
var e = t.selection.getNode();
|
|
return eC(t, e)
|
|
.filter(Ge.isContentEditableFalse)
|
|
.fold(
|
|
function () {
|
|
return (function (e, t, n) {
|
|
var r = Ns(t ? 1 : -1, e, n),
|
|
o = _s.fromRangeStart(r),
|
|
i = bt.fromDom(e);
|
|
return !1 === t && Vh(o)
|
|
? k.some(Rx.remove(o.getNode(!0)))
|
|
: t && Lh(o)
|
|
? k.some(Rx.remove(o.getNode()))
|
|
: !1 === t && Lh(o) && Gb(i, o)
|
|
? Ax(i, o).map(function (e) {
|
|
return Rx.remove(e.getNode());
|
|
})
|
|
: t && Vh(o) && Yb(i, o)
|
|
? Mx(i, o).map(function (e) {
|
|
return Rx.remove(e.getNode());
|
|
})
|
|
: Zb(e, t, o);
|
|
})(t.getBody(), n, t.selection.getRng())
|
|
.map(function (e) {
|
|
return e.fold(
|
|
(function (t, n) {
|
|
return function (e) {
|
|
return (
|
|
t._selectionOverrides.hideFakeCaret(),
|
|
Ag(t, n, bt.fromDom(e)),
|
|
!0
|
|
);
|
|
};
|
|
})(t, n),
|
|
(function (n, r) {
|
|
return function (e) {
|
|
var t = r ? _s.before(e) : _s.after(e);
|
|
return n.selection.setRng(t.toRange()), !0;
|
|
};
|
|
})(t, n),
|
|
(function (t) {
|
|
return function (e) {
|
|
return t.selection.setRng(e.toRange()), !0;
|
|
};
|
|
})(t),
|
|
);
|
|
})
|
|
.getOr(!1);
|
|
},
|
|
function () {
|
|
return !0;
|
|
},
|
|
);
|
|
}
|
|
function nC(e, t) {
|
|
var n = e.selection.getNode();
|
|
return (
|
|
!!Ge.isContentEditableFalse(n) &&
|
|
eC(e, n.parentNode)
|
|
.filter(Ge.isContentEditableFalse)
|
|
.fold(
|
|
function () {
|
|
return (
|
|
(function (e) {
|
|
z(ga(e, ".mce-offscreen-selection"), Oi);
|
|
})(bt.fromDom(e.getBody())),
|
|
Ag(e, t, bt.fromDom(e.selection.getNode())),
|
|
zx(e),
|
|
!0
|
|
);
|
|
},
|
|
function () {
|
|
return !0;
|
|
},
|
|
)
|
|
);
|
|
}
|
|
function rC(e, t, n, r, o, i) {
|
|
var a = em(r, e, i.getNode(!o), o, !0);
|
|
if (t.collapsed) {
|
|
var u = t.cloneRange();
|
|
o
|
|
? u.setEnd(a.startContainer, a.startOffset)
|
|
: u.setStart(a.endContainer, a.endOffset),
|
|
u.deleteContents();
|
|
} else t.deleteContents();
|
|
return (
|
|
e.selection.setRng(a),
|
|
(function (e, t) {
|
|
Ge.isText(t) && 0 === t.data.length && e.remove(t);
|
|
})(e.dom, n),
|
|
!0
|
|
);
|
|
}
|
|
function oC(t, n) {
|
|
return function (e) {
|
|
return Wy(n, e)
|
|
.map(function (e) {
|
|
return rb.setCaretPosition(t, e), !0;
|
|
})
|
|
.getOr(!1);
|
|
};
|
|
}
|
|
function iC(e, t, n, r) {
|
|
var o = e.getBody(),
|
|
i = d(Xy.isInlineTarget, e);
|
|
e.undoManager.ignore(function () {
|
|
e.selection.setRng(
|
|
(function (e, t) {
|
|
var n = j.document.createRange();
|
|
return (
|
|
n.setStart(e.container(), e.offset()),
|
|
n.setEnd(t.container(), t.offset()),
|
|
n
|
|
);
|
|
})(n, r),
|
|
),
|
|
e.execCommand("Delete"),
|
|
Qy(i, o, _s.fromRangeStart(e.selection.getRng())).map(tb).map(oC(e, t));
|
|
}),
|
|
e.nodeChanged();
|
|
}
|
|
function aC(n, r, o, i) {
|
|
var a = (function (e, t) {
|
|
var n = Cs(t, e);
|
|
return n || e;
|
|
})(n.getBody(), i.container()),
|
|
u = d(Xy.isInlineTarget, n),
|
|
s = Qy(u, a, i);
|
|
return s
|
|
.bind(function (e) {
|
|
return o
|
|
? e.fold($(k.some(tb(e))), k.none, $(k.some(eb(e))), k.none)
|
|
: e.fold(k.none, $(k.some(eb(e))), k.none, $(k.some(tb(e))));
|
|
})
|
|
.map(oC(n, r))
|
|
.getOrThunk(function () {
|
|
var t = Lc.navigate(o, a, i),
|
|
e = t.bind(function (e) {
|
|
return Qy(u, a, e);
|
|
});
|
|
return s.isSome() && e.isSome()
|
|
? Xy.findRootInline(u, a, i)
|
|
.map(function (e) {
|
|
return (
|
|
!!(function (o) {
|
|
return Ga(
|
|
Lc.firstPositionIn(o),
|
|
Lc.lastPositionIn(o),
|
|
function (e, t) {
|
|
var n = Xy.normalizePosition(!0, e),
|
|
r = Xy.normalizePosition(!1, t);
|
|
return Lc.nextPosition(o, n)
|
|
.map(function (e) {
|
|
return e.isEqual(r);
|
|
})
|
|
.getOr(!0);
|
|
},
|
|
).getOr(!0);
|
|
})(e) && (Ag(n, o, bt.fromDom(e)), !0)
|
|
);
|
|
})
|
|
.getOr(!1)
|
|
: e
|
|
.bind(function (e) {
|
|
return t.map(function (e) {
|
|
return o ? iC(n, r, i, e) : iC(n, r, e, i), !0;
|
|
});
|
|
})
|
|
.getOr(!1);
|
|
});
|
|
}
|
|
function uC(e) {
|
|
return 1 === Re(e).length;
|
|
}
|
|
function sC(e, t, n, r) {
|
|
var o = d($m, t),
|
|
i = X(y(r, o), function (e) {
|
|
return e.dom();
|
|
});
|
|
if (0 === i.length) Ag(t, e, n);
|
|
else {
|
|
var a = (function (e, t) {
|
|
var n = Lm(!1),
|
|
r = jm(t, n.dom());
|
|
return wi(bt.fromDom(e), n), Oi(bt.fromDom(e)), _s(r, 0);
|
|
})(n.dom(), i);
|
|
t.selection.setRng(a.toRange());
|
|
}
|
|
}
|
|
function cC(n, r) {
|
|
var e = bt.fromDom(n.getBody()),
|
|
t = bt.fromDom(n.selection.getStart()),
|
|
o = y(
|
|
(function (e, t) {
|
|
var n = dh(t, e);
|
|
return p(n, In).fold($(n), function (e) {
|
|
return n.slice(0, e);
|
|
});
|
|
})(e, t),
|
|
uC,
|
|
);
|
|
return N(o)
|
|
.map(function (e) {
|
|
var t = _s.fromRangeStart(n.selection.getRng());
|
|
return (
|
|
!(
|
|
!Ex(r, t, e.dom()) ||
|
|
(function (e) {
|
|
return os(e.dom()) && Hm(e.dom());
|
|
})(e)
|
|
) && (sC(r, n, e, o), !0)
|
|
);
|
|
})
|
|
.getOr(!1);
|
|
}
|
|
function lC(e, t) {
|
|
return { start: $(e), end: $(t) };
|
|
}
|
|
function fC(e, t) {
|
|
return za(bt.fromDom(e), "td,th", t);
|
|
}
|
|
function dC(e, t) {
|
|
return wa(e, "table", t);
|
|
}
|
|
function hC(e) {
|
|
return !1 === ze(e.start(), e.end());
|
|
}
|
|
function mC(e, n) {
|
|
return dC(e.start(), n).bind(function (t) {
|
|
return dC(e.end(), n).bind(function (e) {
|
|
return (function (e, t) {
|
|
return e ? k.some(t) : k.none();
|
|
})(ze(t, e), t);
|
|
});
|
|
});
|
|
}
|
|
function gC(e) {
|
|
return ga(e, "td,th");
|
|
}
|
|
function pC(n, e) {
|
|
var t = fC(e.startContainer, n),
|
|
r = fC(e.endContainer, n);
|
|
return e.collapsed
|
|
? k.none()
|
|
: Ga(t, r, lC).fold(
|
|
function () {
|
|
return t.fold(
|
|
function () {
|
|
return r.bind(function (t) {
|
|
return dC(t, n).bind(function (e) {
|
|
return E(gC(e)).map(function (e) {
|
|
return lC(e, t);
|
|
});
|
|
});
|
|
});
|
|
},
|
|
function (t) {
|
|
return dC(t, n).bind(function (e) {
|
|
return N(gC(e)).map(function (e) {
|
|
return lC(t, e);
|
|
});
|
|
});
|
|
},
|
|
);
|
|
},
|
|
function (e) {
|
|
return Vx(n, e)
|
|
? k.none()
|
|
: (function (t, e) {
|
|
return dC(t.start(), e).bind(function (e) {
|
|
return N(gC(e)).map(function (e) {
|
|
return lC(t.start(), e);
|
|
});
|
|
});
|
|
})(e, n);
|
|
},
|
|
);
|
|
}
|
|
function vC(t, e) {
|
|
return mC(t, e).map(function (e) {
|
|
return (function (e, t, n) {
|
|
return { rng: $(e), table: $(t), cells: $(n) };
|
|
})(t, e, gC(e));
|
|
});
|
|
}
|
|
function yC(e, t) {
|
|
var n = (function (t) {
|
|
return function (e) {
|
|
return ze(t, e);
|
|
};
|
|
})(e);
|
|
return (function (e, t) {
|
|
var n = fC(e.startContainer, t),
|
|
r = fC(e.endContainer, t);
|
|
return Ga(n, r, lC)
|
|
.filter(hC)
|
|
.filter(function (e) {
|
|
return Vx(t, e);
|
|
})
|
|
.orThunk(function () {
|
|
return pC(t, e);
|
|
});
|
|
})(t, n).bind(function (e) {
|
|
return vC(e, n);
|
|
});
|
|
}
|
|
function bC(e, t) {
|
|
return p(e, function (e) {
|
|
return ze(e, t);
|
|
});
|
|
}
|
|
function CC(n) {
|
|
return (function (n) {
|
|
return Ga(
|
|
bC(n.cells(), n.rng().start()),
|
|
bC(n.cells(), n.rng().end()),
|
|
function (e, t) {
|
|
return n.cells().slice(e, t + 1);
|
|
},
|
|
);
|
|
})(n).map(function (e) {
|
|
var t = n.cells();
|
|
return e.length === t.length
|
|
? Lx.removeTable(n.table())
|
|
: Lx.emptyCells(e);
|
|
});
|
|
}
|
|
function wC(e, t) {
|
|
return z(t, Cg), e.selection.setCursorLocation(t[0].dom(), 0), !0;
|
|
}
|
|
function xC(e, t) {
|
|
return Ag(e, !1, t), !0;
|
|
}
|
|
function zC(t, e, n) {
|
|
return (function (e, t) {
|
|
return yC(e, t).bind(CC);
|
|
})(e, n).map(function (e) {
|
|
return e.fold(d(xC, t), d(wC, t));
|
|
});
|
|
}
|
|
function EC(t, e, n, r) {
|
|
return Ix(e, r)
|
|
.fold(
|
|
function () {
|
|
return zC(t, e, n);
|
|
},
|
|
function (e) {
|
|
return (function (e, t) {
|
|
return Fx(e, t);
|
|
})(t, e);
|
|
},
|
|
)
|
|
.getOr(!1);
|
|
}
|
|
function NC(e, t) {
|
|
return g(dh(t, e), Wn);
|
|
}
|
|
function SC(t, n, r, o, i) {
|
|
return Lc.navigate(r, t.getBody(), i)
|
|
.bind(function (e) {
|
|
return (function (e, n, r, o) {
|
|
return Lc.firstPositionIn(e.dom())
|
|
.bind(function (t) {
|
|
return Lc.lastPositionIn(e.dom()).map(function (e) {
|
|
return n
|
|
? r.isEqual(t) && o.isEqual(e)
|
|
: r.isEqual(e) && o.isEqual(t);
|
|
});
|
|
})
|
|
.getOr(!0);
|
|
})(o, r, i, e)
|
|
? (function (e, t) {
|
|
return Fx(e, t);
|
|
})(t, o)
|
|
: (function (e, t, n) {
|
|
return Ix(e, bt.fromDom(n.getNode())).map(function (e) {
|
|
return !1 === ze(e, t);
|
|
});
|
|
})(n, o, e);
|
|
})
|
|
.or(k.some(!0));
|
|
}
|
|
function kC(t, n, r, e) {
|
|
var o = _s.fromRangeStart(t.selection.getRng());
|
|
return NC(r, e)
|
|
.bind(function (e) {
|
|
return Tg(e)
|
|
? Fx(t, e)
|
|
: (function (e, t, n, r, o) {
|
|
return Lc.navigate(n, e.getBody(), o).bind(function (e) {
|
|
return NC(t, bt.fromDom(e.getNode())).map(function (e) {
|
|
return !1 === ze(e, r);
|
|
});
|
|
});
|
|
})(t, r, n, e, o);
|
|
})
|
|
.getOr(!1);
|
|
}
|
|
function TC(e, t) {
|
|
return e ? Hh(t) : Ph(t);
|
|
}
|
|
function AC(t, n, e) {
|
|
var r = bt.fromDom(t.getBody());
|
|
return Ix(r, e).fold(
|
|
function () {
|
|
return (
|
|
kC(t, n, r, e) ||
|
|
(function (e, t) {
|
|
var n = _s.fromRangeStart(e.selection.getRng());
|
|
return (
|
|
TC(t, n) ||
|
|
Lc.fromPosition(t, e.getBody(), n)
|
|
.map(function (e) {
|
|
return TC(t, e);
|
|
})
|
|
.getOr(!1)
|
|
);
|
|
})(t, n)
|
|
);
|
|
},
|
|
function (e) {
|
|
return (function (e, t, n, r) {
|
|
var o = _s.fromRangeStart(e.selection.getRng());
|
|
return Tg(r) ? Fx(e, r) : SC(e, n, t, r, o);
|
|
})(t, n, r, e).getOr(!1);
|
|
},
|
|
);
|
|
}
|
|
function MC(e) {
|
|
var t = parseInt(e, 10);
|
|
return isNaN(t) ? 0 : t;
|
|
}
|
|
function RC(e, t) {
|
|
return (
|
|
(e ||
|
|
(function (e) {
|
|
return "table" === ie(e);
|
|
})(t)
|
|
? "margin"
|
|
: "padding") + ("rtl" === ve(t, "direction") ? "-right" : "-left")
|
|
);
|
|
}
|
|
function DC(e) {
|
|
var t = qx(e);
|
|
return (
|
|
!0 !== e.readonly &&
|
|
(1 < t.length ||
|
|
(function (r, e) {
|
|
return w(e, function (e) {
|
|
var t = RC(Pf(r), e),
|
|
n = ye(e, t).map(MC).getOr(0);
|
|
return "false" !== r.dom.getContentEditable(e.dom()) && 0 < n;
|
|
});
|
|
})(e, t))
|
|
);
|
|
}
|
|
function _C(e) {
|
|
return Un(e) || jn(e);
|
|
}
|
|
function OC(e, t) {
|
|
var n = e.dom,
|
|
r = e.selection,
|
|
o = e.formatter,
|
|
i = Lf(e),
|
|
a = /[a-z%]+$/i.exec(i)[0],
|
|
u = parseInt(i, 10),
|
|
s = Pf(e),
|
|
c = gf(e);
|
|
e.queryCommandState("InsertUnorderedList") ||
|
|
e.queryCommandState("InsertOrderedList") ||
|
|
"" !== c ||
|
|
n.getParent(r.getNode(), n.isBlock) ||
|
|
o.apply("div"),
|
|
z(qx(e), function (e) {
|
|
!(function (e, t, n, r, o, i) {
|
|
var a = RC(n, bt.fromDom(i));
|
|
if ("outdent" === t) {
|
|
var u = Math.max(0, MC(i.style[a]) - r);
|
|
e.setStyle(i, a, u ? u + o : "");
|
|
} else {
|
|
u = MC(i.style[a]) + r + o;
|
|
e.setStyle(i, a, u);
|
|
}
|
|
})(n, t, s, u, a, e.dom());
|
|
});
|
|
}
|
|
function BC(e, t, n) {
|
|
return Lc.navigateIgnore(e, t, n, xh);
|
|
}
|
|
function HC(e, t) {
|
|
return g(dh(bt.fromDom(t.container()), e), In);
|
|
}
|
|
function PC(e, n, r) {
|
|
return BC(e, n.dom(), r).forall(function (t) {
|
|
return HC(n, r).fold(
|
|
function () {
|
|
return !1 === ws(t, r, n.dom());
|
|
},
|
|
function (e) {
|
|
return !1 === ws(t, r, n.dom()) && Bt(e, bt.fromDom(t.container()));
|
|
},
|
|
);
|
|
});
|
|
}
|
|
function LC(t, n, r) {
|
|
return HC(n, r).fold(
|
|
function () {
|
|
return BC(t, n.dom(), r).forall(function (e) {
|
|
return !1 === ws(e, r, n.dom());
|
|
});
|
|
},
|
|
function (e) {
|
|
return BC(t, e.dom(), r).isNone();
|
|
},
|
|
);
|
|
}
|
|
function VC(e) {
|
|
return k.from(e.dom.getParent(e.selection.getStart(!0), e.dom.isBlock));
|
|
}
|
|
function IC(e, t) {
|
|
return e && e.parentNode && e.parentNode.nodeName === t;
|
|
}
|
|
function FC(e) {
|
|
return e && /^(OL|UL|LI)$/.test(e.nodeName);
|
|
}
|
|
function UC(e) {
|
|
var t = e.parentNode;
|
|
return /^(LI|DT|DD)$/.test(t.nodeName) ? t : e;
|
|
}
|
|
function jC(e, t, n) {
|
|
for (var r = e[n ? "firstChild" : "lastChild"]; r && !Ge.isElement(r); )
|
|
r = r[n ? "nextSibling" : "previousSibling"];
|
|
return r === t;
|
|
}
|
|
function qC(e) {
|
|
e.innerHTML = '<br data-mce-bogus="1">';
|
|
}
|
|
function $C(e, t) {
|
|
return (
|
|
e.nodeName === t ||
|
|
(e.previousSibling && e.previousSibling.nodeName === t)
|
|
);
|
|
}
|
|
function WC(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 KC(e, t, n) {
|
|
return !1 === Ge.isText(t)
|
|
? n
|
|
: e
|
|
? 1 === n && t.data.charAt(n - 1) === lu
|
|
? 0
|
|
: n
|
|
: n === t.data.length - 1 && t.data.charAt(n) === lu
|
|
? t.data.length
|
|
: n;
|
|
}
|
|
function XC(e, t) {
|
|
var n,
|
|
r,
|
|
o = e.getRoot();
|
|
for (n = t; n !== o && "false" !== e.getContentEditable(n); )
|
|
"true" === e.getContentEditable(n) && (r = n), (n = n.parentNode);
|
|
return n !== o ? r : o;
|
|
}
|
|
function YC(e, t) {
|
|
var n = gf(e);
|
|
n &&
|
|
n.toLowerCase() === t.tagName.toLowerCase() &&
|
|
e.dom.setAttribs(t, pf(e));
|
|
}
|
|
function GC(e, t, n) {
|
|
var r = e.create("span", {}, " ");
|
|
n.parentNode.insertBefore(r, n), t.scrollIntoView(r), e.remove(r);
|
|
}
|
|
function JC(e, t, n, r) {
|
|
var o = e.createRng();
|
|
r
|
|
? (o.setStartBefore(n), o.setEndBefore(n))
|
|
: (o.setStartAfter(n), o.setEndAfter(n)),
|
|
t.setRng(o);
|
|
}
|
|
function QC(e, t) {
|
|
var n,
|
|
r,
|
|
o = e.selection,
|
|
i = e.dom,
|
|
a = o.getRng();
|
|
uy(i, a).each(function (e) {
|
|
a.setStart(e.startContainer, e.startOffset),
|
|
a.setEnd(e.endContainer, e.endOffset);
|
|
});
|
|
var u = a.startOffset,
|
|
s = a.startContainer;
|
|
if (1 === s.nodeType && s.hasChildNodes()) {
|
|
var c = u > s.childNodes.length - 1;
|
|
(s = s.childNodes[Math.min(u, s.childNodes.length - 1)] || s),
|
|
(u = c && 3 === s.nodeType ? s.nodeValue.length : 0);
|
|
}
|
|
var l = i.getParent(s, i.isBlock),
|
|
f = l ? i.getParent(l.parentNode, i.isBlock) : null,
|
|
d = f ? f.nodeName.toUpperCase() : "",
|
|
h = !(!t || !t.ctrlKey);
|
|
"LI" !== d || h || (l = f),
|
|
s &&
|
|
3 === s.nodeType &&
|
|
u >= s.nodeValue.length &&
|
|
!(function (e, t, n) {
|
|
for (
|
|
var r, o = new bi(t, n), i = e.getNonEmptyElements();
|
|
(r = o.next());
|
|
|
|
)
|
|
if (i[r.nodeName.toLowerCase()] || 0 < r.length) return !0;
|
|
})(e.schema, s, l) &&
|
|
((n = i.create("br")),
|
|
a.insertNode(n),
|
|
a.setStartAfter(n),
|
|
a.setEndAfter(n),
|
|
(r = !0)),
|
|
(n = i.create("br")),
|
|
Yu(i, a, n),
|
|
GC(i, o, n),
|
|
JC(i, o, n, r),
|
|
e.undoManager.add();
|
|
}
|
|
function ZC(e, t) {
|
|
var n = bt.fromTag("br");
|
|
wi(bt.fromDom(t), n), e.undoManager.add();
|
|
}
|
|
function ew(e, t) {
|
|
oz(e.getBody(), t) || xi(bt.fromDom(t), bt.fromTag("br"));
|
|
var n = bt.fromTag("br");
|
|
xi(bt.fromDom(t), n),
|
|
GC(e.dom, e.selection, n.dom()),
|
|
JC(e.dom, e.selection, n.dom(), !1),
|
|
e.undoManager.add();
|
|
}
|
|
function tw(e) {
|
|
return e && "A" === e.nodeName && "href" in e;
|
|
}
|
|
function nw(e) {
|
|
return e.fold($(!1), tw, tw, $(!1));
|
|
}
|
|
function rw(e, t) {
|
|
t.fold(i, d(ZC, e), d(ew, e), i);
|
|
}
|
|
function ow(e, t) {
|
|
return Zx(e)
|
|
.filter(function (e) {
|
|
return 0 < t.length && we(bt.fromDom(e), t);
|
|
})
|
|
.isSome();
|
|
}
|
|
function iw(e, t) {
|
|
return uz(e);
|
|
}
|
|
function aw(n) {
|
|
return function (e, t) {
|
|
return ("" === gf(e)) === n;
|
|
};
|
|
}
|
|
function uw(n) {
|
|
return function (e, t) {
|
|
return tz(e) === n;
|
|
};
|
|
}
|
|
function sw(n, r) {
|
|
return function (e, t) {
|
|
return (ez(e) === n.toUpperCase()) === r;
|
|
};
|
|
}
|
|
function cw(e) {
|
|
return sw("pre", e);
|
|
}
|
|
function lw(n) {
|
|
return function (e, t) {
|
|
return mf(e) === n;
|
|
};
|
|
}
|
|
function fw(e, t) {
|
|
return az(e);
|
|
}
|
|
function dw(e, t) {
|
|
return t;
|
|
}
|
|
function hw(e) {
|
|
var t = gf(e),
|
|
n = Qx(e.dom, e.selection.getStart());
|
|
return n && e.schema.isValidChild(n.nodeName, t || "P");
|
|
}
|
|
function mw(e, t) {
|
|
return function (n, r) {
|
|
return b(
|
|
e,
|
|
function (e, t) {
|
|
return e && t(n, r);
|
|
},
|
|
!0,
|
|
)
|
|
? k.some(t)
|
|
: k.none();
|
|
};
|
|
}
|
|
function gw(n, r) {
|
|
var e = r.container(),
|
|
t = r.offset();
|
|
return Ge.isText(e)
|
|
? (e.insertData(t, n), k.some(ju(e, t + n.length)))
|
|
: Ts(r).map(function (e) {
|
|
var t = bt.fromText(n);
|
|
return r.isAtEnd() ? xi(e, t) : wi(e, t), ju(t.dom(), n.length);
|
|
});
|
|
}
|
|
function pw(e) {
|
|
return ju.isTextPosition(e) && !e.isAtStart() && !e.isAtEnd();
|
|
}
|
|
function vw(e, t) {
|
|
var n = y(dh(bt.fromDom(t.container()), e), In);
|
|
return E(n).getOr(e);
|
|
}
|
|
function yw(e, t) {
|
|
return pw(t)
|
|
? _h(t)
|
|
: _h(t) || Lc.prevPosition(vw(e, t).dom(), t).exists(_h);
|
|
}
|
|
function bw(e, t) {
|
|
return pw(t)
|
|
? Dh(t)
|
|
: Dh(t) || Lc.nextPosition(vw(e, t).dom(), t).exists(Dh);
|
|
}
|
|
function Cw(e) {
|
|
return Ts(e)
|
|
.bind(function (e) {
|
|
return Ca(e, zt);
|
|
})
|
|
.exists(function (e) {
|
|
return (function (e) {
|
|
return h(["pre", "pre-wrap"], e);
|
|
})(ve(e, "white-space"));
|
|
});
|
|
}
|
|
function ww(e, t) {
|
|
return (
|
|
(function (e, t) {
|
|
return Lc.prevPosition(e.dom(), t).isNone();
|
|
})(e, t) ||
|
|
(function (e, t) {
|
|
return Lc.nextPosition(e.dom(), t).isNone();
|
|
})(e, t) ||
|
|
$x(e, t) ||
|
|
Wx(e, t) ||
|
|
Gb(e, t) ||
|
|
Yb(e, t)
|
|
);
|
|
}
|
|
function xw(e, t) {
|
|
var n = (function (e) {
|
|
var t = e.container(),
|
|
n = e.offset();
|
|
return Ge.isText(t) && n < t.data.length ? ju(t, n + 1) : e;
|
|
})(t);
|
|
return !Cw(n) && (Wx(e, n) || Xx(e, n) || Yb(e, n) || bw(e, n));
|
|
}
|
|
function zw(e, t) {
|
|
return (
|
|
(function (e, t) {
|
|
return !Cw(t) && ($x(e, t) || Kx(e, t) || Gb(e, t) || yw(e, t));
|
|
})(e, t) || xw(e, t)
|
|
);
|
|
}
|
|
function Ew(e, t) {
|
|
return Rh(e.charAt(t));
|
|
}
|
|
function Nw(e) {
|
|
var t = e.container();
|
|
return Ge.isText(t) && Z(t.data, "\xa0");
|
|
}
|
|
function Sw(e) {
|
|
var t = e.data,
|
|
n = (function (e) {
|
|
var n = e.split("");
|
|
return X(n, function (e, t) {
|
|
return Rh(e) &&
|
|
0 < t &&
|
|
t < n.length - 1 &&
|
|
Ch(n[t - 1]) &&
|
|
Ch(n[t + 1])
|
|
? " "
|
|
: e;
|
|
}).join("");
|
|
})(t);
|
|
return n !== t && ((e.data = n), !0);
|
|
}
|
|
function kw(n, e) {
|
|
return k
|
|
.some(e)
|
|
.filter(Nw)
|
|
.bind(function (e) {
|
|
var t = e.container();
|
|
return (function (e, t) {
|
|
var n = t.data,
|
|
r = ju(t, 0);
|
|
return !(!Ew(n, 0) || zw(e, r)) && ((t.data = " " + n.slice(1)), !0);
|
|
})(n, t) ||
|
|
Sw(t) ||
|
|
(function (e, t) {
|
|
var n = t.data,
|
|
r = ju(t, n.length - 1);
|
|
return (
|
|
!(!Ew(n, n.length - 1) || zw(e, r)) &&
|
|
((t.data = n.slice(0, -1) + " "), !0)
|
|
);
|
|
})(n, t)
|
|
? k.some(e)
|
|
: k.none();
|
|
});
|
|
}
|
|
function Tw(t) {
|
|
var e = bt.fromDom(t.getBody());
|
|
t.selection.isCollapsed() &&
|
|
kw(e, ju.fromRangeStart(t.selection.getRng())).each(function (e) {
|
|
t.selection.setRng(e.toRange());
|
|
});
|
|
}
|
|
function Aw(t, n) {
|
|
return function (e) {
|
|
return (function (e, t) {
|
|
return !Cw(t) && (ww(e, t) || yw(e, t) || bw(e, t));
|
|
})(t, e)
|
|
? dz(n)
|
|
: hz(n);
|
|
};
|
|
}
|
|
function Mw(e) {
|
|
var t = _s.fromRangeStart(e.selection.getRng()),
|
|
n = bt.fromDom(e.getBody());
|
|
if (e.selection.isCollapsed()) {
|
|
var r = d(Xy.isInlineTarget, e),
|
|
o = _s.fromRangeStart(e.selection.getRng());
|
|
return Qy(r, e.getBody(), o)
|
|
.bind(
|
|
(function (t) {
|
|
return function (e) {
|
|
return e.fold(
|
|
function (e) {
|
|
return Lc.prevPosition(t.dom(), _s.before(e));
|
|
},
|
|
function (e) {
|
|
return Lc.firstPositionIn(e);
|
|
},
|
|
function (e) {
|
|
return Lc.lastPositionIn(e);
|
|
},
|
|
function (e) {
|
|
return Lc.nextPosition(t.dom(), _s.after(e));
|
|
},
|
|
);
|
|
};
|
|
})(n),
|
|
)
|
|
.bind(Aw(n, t))
|
|
.exists(
|
|
(function (t) {
|
|
return function (e) {
|
|
return t.selection.setRng(e.toRange()), t.nodeChanged(), !0;
|
|
};
|
|
})(e),
|
|
);
|
|
}
|
|
return !1;
|
|
}
|
|
function Rw(e, t) {
|
|
t.hasAttribute("data-mce-caret") &&
|
|
(La(t),
|
|
(function (e) {
|
|
e.selection.setRng(e.selection.getRng());
|
|
})(e),
|
|
e.selection.scrollIntoView(t));
|
|
}
|
|
function Dw(e, t) {
|
|
var n = (function (e) {
|
|
return xa(bt.fromDom(e.getBody()), "*[data-mce-caret]").fold(
|
|
$(null),
|
|
function (e) {
|
|
return e.dom();
|
|
},
|
|
);
|
|
})(e);
|
|
if (n)
|
|
return "compositionstart" === t.type
|
|
? (t.preventDefault(), t.stopPropagation(), void Rw(e, n))
|
|
: void (Oa(n) && (Rw(e, n), e.undoManager.add()));
|
|
}
|
|
function _w(t) {
|
|
!(function (e) {
|
|
var t = ua(function () {
|
|
e.composing || Tw(e);
|
|
}, 0);
|
|
pz.isIE() &&
|
|
(e.on("keypress", function (e) {
|
|
t.throttle();
|
|
}),
|
|
e.on("remove", function (e) {
|
|
t.cancel();
|
|
}));
|
|
})(t),
|
|
t.on("input", function (e) {
|
|
!1 === e.isComposing && Tw(t);
|
|
});
|
|
}
|
|
function Ow(a) {
|
|
function e(e, t) {
|
|
try {
|
|
a.getDoc().execCommand(e, !1, t);
|
|
} catch (n) {}
|
|
}
|
|
function u(e) {
|
|
return e.isDefaultPrevented();
|
|
}
|
|
function t() {
|
|
a.shortcuts.add("meta+a", null, "SelectAll");
|
|
}
|
|
function n() {
|
|
a.on("keydown", function (e) {
|
|
if (
|
|
!u(e) &&
|
|
e.keyCode === i &&
|
|
l.isCollapsed() &&
|
|
0 === l.getRng().startOffset
|
|
) {
|
|
var t = l.getNode().previousSibling;
|
|
if (t && t.nodeName && "table" === t.nodeName.toLowerCase())
|
|
return e.preventDefault(), !1;
|
|
}
|
|
});
|
|
}
|
|
function r() {
|
|
a.inline ||
|
|
(a.contentStyles.push("body {min-height: 150px}"),
|
|
a.on("click", function (e) {
|
|
var t;
|
|
if ("HTML" === e.target.nodeName) {
|
|
if (11 < Sn.ie) return void a.getBody().focus();
|
|
(t = a.selection.getRng()),
|
|
a.getBody().focus(),
|
|
a.selection.setRng(t),
|
|
a.selection.normalize(),
|
|
a.nodeChanged();
|
|
}
|
|
}));
|
|
}
|
|
var o = Rn.each,
|
|
i = Mh.BACKSPACE,
|
|
s = Mh.DELETE,
|
|
c = a.dom,
|
|
l = a.selection,
|
|
f = a.settings,
|
|
d = a.parser,
|
|
h = Sn.gecko,
|
|
m = Sn.ie,
|
|
g = Sn.webkit,
|
|
p = "data:text/mce-internal,",
|
|
v = m ? "Text" : "URL";
|
|
function y(e) {
|
|
var t = c.create("body"),
|
|
n = e.cloneContents();
|
|
return t.appendChild(n), l.serializer.serialize(t, { format: "html" });
|
|
}
|
|
function b() {
|
|
var e = c.getAttribs(l.getStart().cloneNode(!1));
|
|
return function () {
|
|
var t = l.getStart();
|
|
t !== a.getBody() &&
|
|
(c.setAttrib(t, "style", null),
|
|
o(e, function (e) {
|
|
t.setAttributeNode(e.cloneNode(!0));
|
|
}));
|
|
};
|
|
}
|
|
function C() {
|
|
return (
|
|
!l.isCollapsed() &&
|
|
c.getParent(l.getStart(), c.isBlock) !==
|
|
c.getParent(l.getEnd(), c.isBlock)
|
|
);
|
|
}
|
|
return (
|
|
a.on("keydown", function (e) {
|
|
var t, n, r, o, i;
|
|
if (
|
|
!u(e) &&
|
|
e.keyCode === Mh.BACKSPACE &&
|
|
((n = (t = l.getRng()).startContainer),
|
|
(r = t.startOffset),
|
|
(o = c.getRoot()),
|
|
(i = n),
|
|
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 = c.createRng()).setStart(n, 0),
|
|
t.setEnd(n, 0),
|
|
l.setRng(t));
|
|
}
|
|
}),
|
|
a.on("keydown", function (e) {
|
|
var t,
|
|
n,
|
|
r = e.keyCode;
|
|
if (!u(e) && (r === s || r === i)) {
|
|
if (
|
|
((t = a.selection.isCollapsed()),
|
|
(n = a.getBody()),
|
|
t && !c.isEmpty(n))
|
|
)
|
|
return;
|
|
if (
|
|
!t &&
|
|
!(function (e) {
|
|
var t = y(e),
|
|
n = c.createRng();
|
|
return n.selectNode(a.getBody()), t === y(n);
|
|
})(a.selection.getRng())
|
|
)
|
|
return;
|
|
e.preventDefault(),
|
|
a.setContent(""),
|
|
n.firstChild && c.isBlock(n.firstChild)
|
|
? a.selection.setCursorLocation(n.firstChild, 0)
|
|
: a.selection.setCursorLocation(n, 0),
|
|
a.nodeChanged();
|
|
}
|
|
}),
|
|
Sn.windowsPhone ||
|
|
a.on(
|
|
"keyup focusin mouseup",
|
|
function (e) {
|
|
Mh.modifierPressed(e) || l.normalize();
|
|
},
|
|
!0,
|
|
),
|
|
g &&
|
|
(a.inline ||
|
|
c.bind(a.getDoc(), "mousedown mouseup", function (e) {
|
|
var t;
|
|
if (e.target === a.getDoc().documentElement)
|
|
if (
|
|
((t = l.getRng()), a.getBody().focus(), "mousedown" === e.type)
|
|
) {
|
|
if (_a(t.startContainer)) return;
|
|
l.placeCaretAt(e.clientX, e.clientY);
|
|
} else l.setRng(t);
|
|
}),
|
|
a.on("click", function (e) {
|
|
var t = e.target;
|
|
/^(IMG|HR)$/.test(t.nodeName) &&
|
|
"false" !== c.getContentEditableParent(t) &&
|
|
(e.preventDefault(), a.selection.select(t), a.nodeChanged()),
|
|
"A" === t.nodeName &&
|
|
c.hasClass(t, "mce-item-anchor") &&
|
|
(e.preventDefault(), l.select(t));
|
|
}),
|
|
f.forced_root_block &&
|
|
a.on("init", function () {
|
|
e("DefaultParagraphSeparator", gf(a));
|
|
}),
|
|
a.on("init", function () {
|
|
a.dom.bind(a.getBody(), "submit", function (e) {
|
|
e.preventDefault();
|
|
});
|
|
}),
|
|
n(),
|
|
d.addNodeFilter("br", function (e) {
|
|
for (var t = e.length; t--; )
|
|
"Apple-interchange-newline" === e[t].attr("class") && e[t].remove();
|
|
}),
|
|
Sn.iOS
|
|
? (a.inline ||
|
|
a.on("keydown", function () {
|
|
j.document.activeElement === j.document.body &&
|
|
a.getWin().focus();
|
|
}),
|
|
r(),
|
|
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}",
|
|
))
|
|
: t()),
|
|
11 <= Sn.ie && (r(), n()),
|
|
Sn.ie &&
|
|
(t(),
|
|
e("AutoUrlDetect", !1),
|
|
a.on("dragstart", function (e) {
|
|
!(function (e) {
|
|
var t, n;
|
|
e.dataTransfer &&
|
|
(a.selection.isCollapsed() &&
|
|
"IMG" === e.target.tagName &&
|
|
l.select(e.target),
|
|
0 < (t = a.selection.getContent()).length &&
|
|
((n = p + escape(a.id) + "," + escape(t)),
|
|
e.dataTransfer.setData(v, n)));
|
|
})(e);
|
|
}),
|
|
a.on("drop", function (e) {
|
|
if (!u(e)) {
|
|
var t = (function (e) {
|
|
var t;
|
|
return e.dataTransfer &&
|
|
(t = e.dataTransfer.getData(v)) &&
|
|
0 <= t.indexOf(p)
|
|
? ((t = t.substr(p.length).split(",")),
|
|
{ id: unescape(t[0]), html: unescape(t[1]) })
|
|
: null;
|
|
})(e);
|
|
if (t && t.id !== a.id) {
|
|
e.preventDefault();
|
|
var n = Wv(e.x, e.y, a.getDoc());
|
|
l.setRng(n),
|
|
(function (e, t) {
|
|
a.queryCommandSupported("mceInsertClipboardContent")
|
|
? a.execCommand("mceInsertClipboardContent", !1, {
|
|
content: e,
|
|
internal: t,
|
|
})
|
|
: a.execCommand("mceInsertContent", !1, e);
|
|
})(t.html, !0);
|
|
}
|
|
}
|
|
})),
|
|
h &&
|
|
(a.on("keydown", function (e) {
|
|
if (!u(e) && e.keyCode === i) {
|
|
if (!a.getBody().getElementsByTagName("hr").length) return;
|
|
if (l.isCollapsed() && 0 === l.getRng().startOffset) {
|
|
var t = l.getNode(),
|
|
n = t.previousSibling;
|
|
if ("HR" === t.nodeName)
|
|
return c.remove(t), void e.preventDefault();
|
|
n &&
|
|
n.nodeName &&
|
|
"hr" === n.nodeName.toLowerCase() &&
|
|
(c.remove(n), e.preventDefault());
|
|
}
|
|
}
|
|
}),
|
|
j.Range.prototype.getClientRects ||
|
|
a.on("mousedown", function (e) {
|
|
if (!u(e) && "HTML" === e.target.nodeName) {
|
|
var t = a.getBody();
|
|
t.blur(),
|
|
vn.setEditorTimeout(a, function () {
|
|
t.focus();
|
|
});
|
|
}
|
|
}),
|
|
a.on("keypress", function (e) {
|
|
var t;
|
|
if (!u(e) && (8 === e.keyCode || 46 === e.keyCode) && C())
|
|
return (
|
|
(t = b()),
|
|
a.getDoc().execCommand("delete", !1, null),
|
|
t(),
|
|
e.preventDefault(),
|
|
!1
|
|
);
|
|
}),
|
|
c.bind(a.getDoc(), "cut", function (e) {
|
|
var t;
|
|
!u(e) &&
|
|
C() &&
|
|
((t = b()),
|
|
vn.setEditorTimeout(a, function () {
|
|
t();
|
|
}));
|
|
}),
|
|
f.readonly ||
|
|
a.on("BeforeExecCommand mousedown", function () {
|
|
e("StyleWithCSS", !1),
|
|
e("enableInlineTableEditing", !1),
|
|
f.object_resizing || e("enableObjectResizing", !1);
|
|
}),
|
|
a.on("SetContent ExecCommand", function (e) {
|
|
("setcontent" !== e.type && "mceInsertLink" !== e.command) ||
|
|
o(c.select("a"), function (e) {
|
|
var t = e.parentNode,
|
|
n = c.getRoot();
|
|
if (t.lastChild === e) {
|
|
for (; t && !c.isBlock(t); ) {
|
|
if (t.parentNode.lastChild !== t || t === n) return;
|
|
t = t.parentNode;
|
|
}
|
|
c.add(t, "br", { "data-mce-bogus": 1 });
|
|
}
|
|
});
|
|
}),
|
|
a.contentStyles.push(
|
|
"img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}",
|
|
),
|
|
Sn.mac &&
|
|
a.on("keydown", function (e) {
|
|
!Mh.metaKeyPressed(e) ||
|
|
e.shiftKey ||
|
|
(37 !== e.keyCode && 39 !== e.keyCode) ||
|
|
(e.preventDefault(),
|
|
a.selection
|
|
.getSel()
|
|
.modify(
|
|
"move",
|
|
37 === e.keyCode ? "backward" : "forward",
|
|
"lineboundary",
|
|
));
|
|
}),
|
|
n()),
|
|
{
|
|
refreshContentEditable: function () {},
|
|
isHidden: function () {
|
|
var e;
|
|
return (
|
|
!(!h || a.removed) &&
|
|
(!(e = a.selection.getSel()) || !e.rangeCount || 0 === e.rangeCount)
|
|
);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
function Bw(e) {
|
|
return Ge.isElement(e) && Fn(bt.fromDom(e));
|
|
}
|
|
function Hw(t) {
|
|
t.on("click", function (e) {
|
|
3 <= e.detail &&
|
|
(function (e) {
|
|
var t = e.selection.getRng(),
|
|
n = ju.fromRangeStart(t),
|
|
r = ju.fromRangeEnd(t);
|
|
if (ju.isElementPosition(n)) {
|
|
var o = n.container();
|
|
Bw(o) &&
|
|
Lc.firstPositionIn(o).each(function (e) {
|
|
return t.setStart(e.container(), e.offset());
|
|
});
|
|
}
|
|
if (ju.isElementPosition(r)) {
|
|
o = n.container();
|
|
Bw(o) &&
|
|
Lc.lastPositionIn(o).each(function (e) {
|
|
return t.setEnd(e.container(), e.offset());
|
|
});
|
|
}
|
|
e.selection.setRng(dp(t));
|
|
})(t);
|
|
});
|
|
}
|
|
function Pw(e) {
|
|
!(function (t) {
|
|
t.on("click", function (e) {
|
|
t.dom.getParent(e.target, "details") && e.preventDefault();
|
|
});
|
|
})(e),
|
|
(function (e) {
|
|
e.parser.addNodeFilter("details", function (e) {
|
|
z(e, function (e) {
|
|
e.attr("data-mce-open", e.attr("open")), e.attr("open", "open");
|
|
});
|
|
}),
|
|
e.serializer.addNodeFilter("details", function (e) {
|
|
z(e, function (e) {
|
|
var t = e.attr("data-mce-open");
|
|
e.attr("open", K(t) ? t : null), e.attr("data-mce-open", null);
|
|
});
|
|
});
|
|
})(e);
|
|
}
|
|
function Lw(e) {
|
|
e.bindPendingEventDelegates(),
|
|
(e.initialized = !0),
|
|
e.fire("init"),
|
|
e.focus(!0),
|
|
e.nodeChanged({ initial: !0 }),
|
|
e.execCallback("init_instance_callback", e),
|
|
(function (t) {
|
|
t.settings.auto_focus &&
|
|
vn.setEditorTimeout(
|
|
t,
|
|
function () {
|
|
var e;
|
|
(e =
|
|
!0 === t.settings.auto_focus
|
|
? t
|
|
: t.editorManager.get(t.settings.auto_focus)).destroyed ||
|
|
e.focus();
|
|
},
|
|
100,
|
|
);
|
|
})(e);
|
|
}
|
|
function Vw(e, t) {
|
|
var n = e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),
|
|
r = (function (e, t, n, r) {
|
|
var o = bt.fromTag("iframe");
|
|
return (
|
|
me(o, r),
|
|
me(o, {
|
|
id: e + "_ifr",
|
|
frameBorder: "0",
|
|
allowTransparency: "true",
|
|
title: t,
|
|
}),
|
|
da(o, "tox-edit-area__iframe"),
|
|
o
|
|
);
|
|
})(e.id, n, t.height, sf(e)).dom();
|
|
r.onload = function () {
|
|
(r.onload = null), e.fire("load");
|
|
};
|
|
var o = (function (e, t) {
|
|
if (
|
|
j.document.domain !== j.window.location.hostname &&
|
|
Sn.browser.isIE()
|
|
) {
|
|
var n = lh("mce");
|
|
e[n] = function () {
|
|
Cz(e);
|
|
};
|
|
var r =
|
|
'javascript:(function(){document.open();document.domain="' +
|
|
j.document.domain +
|
|
'";var ed = window.parent.tinymce.get("' +
|
|
e.id +
|
|
'");document.write(ed.iframeHTML);document.close();ed.' +
|
|
n +
|
|
"(true);})()";
|
|
return wz.setAttrib(t, "src", r), !0;
|
|
}
|
|
return !1;
|
|
})(e, r);
|
|
return (
|
|
(e.contentAreaContainer = t.iframeContainer),
|
|
(e.iframeElement = r),
|
|
(e.iframeHTML = (function (e) {
|
|
var t, n, r;
|
|
return (
|
|
(r = cf(e) + "<html><head>"),
|
|
lf(e) !== e.documentBaseUrl &&
|
|
(r += '<base href="' + e.documentBaseURI.getURI() + '" />'),
|
|
(r +=
|
|
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'),
|
|
(t = ff(e)),
|
|
(n = df(e)),
|
|
hf(e) &&
|
|
(r +=
|
|
'<meta http-equiv="Content-Security-Policy" content="' +
|
|
hf(e) +
|
|
'" />'),
|
|
(r +=
|
|
'</head><body id="' +
|
|
t +
|
|
'" class="mce-content-body ' +
|
|
n +
|
|
'" data-id="' +
|
|
e.id +
|
|
'"><br></body></html>')
|
|
);
|
|
})(e)),
|
|
wz.add(t.iframeContainer, r),
|
|
o
|
|
);
|
|
}
|
|
function Iw(e) {
|
|
e.contentCSS = e.contentCSS.concat(
|
|
(function (t) {
|
|
var e = Vf(t),
|
|
n = t.editorManager.baseURL + "/skins/content",
|
|
r = "content" + t.editorManager.suffix + ".css",
|
|
o = !0 === t.inline;
|
|
return X(e, function (e) {
|
|
return (function (e) {
|
|
return /^[a-z0-9\-]+$/i.test(e);
|
|
})(e) && !o
|
|
? n + "/" + e + "/" + r
|
|
: t.documentBaseURI.toAbsolute(e);
|
|
});
|
|
})(e),
|
|
);
|
|
}
|
|
function Fw(e) {
|
|
return e.replace(/^\-/, "");
|
|
}
|
|
function Uw(e) {
|
|
return { editorContainer: e, iframeContainer: e };
|
|
}
|
|
function jw(e) {
|
|
var t = e.getElement();
|
|
return e.inline
|
|
? Uw(null)
|
|
: (function (e) {
|
|
var t = zz.create("div");
|
|
return zz.insertAfter(t, e), Uw(t);
|
|
})(t);
|
|
}
|
|
function qw(e) {
|
|
return "-" === e.charAt(0);
|
|
}
|
|
function $w(t, e) {
|
|
(function (e) {
|
|
return k
|
|
.from(Ef(e))
|
|
.filter(function (e) {
|
|
return 0 < e.length;
|
|
})
|
|
.map(function (e) {
|
|
return { url: e, name: k.none() };
|
|
});
|
|
})(e)
|
|
.orThunk(function () {
|
|
return (function (t) {
|
|
return k
|
|
.from(zf(t))
|
|
.filter(function (e) {
|
|
return 0 < e.length && !$d.has(e);
|
|
})
|
|
.map(function (e) {
|
|
return {
|
|
url: t.editorManager.baseURL + "/icons/" + e + "/icons.js",
|
|
name: k.some(e),
|
|
};
|
|
});
|
|
})(e);
|
|
})
|
|
.each(function (e) {
|
|
t.add(e.url, i, undefined, function () {
|
|
qd.iconsLoadError(e.url, e.name.getOrUndefined());
|
|
});
|
|
});
|
|
}
|
|
function Ww(e, t) {
|
|
var n = Zi.ScriptLoader;
|
|
!(function (e, t, n, r) {
|
|
var o = t.settings,
|
|
i = o.theme;
|
|
if (K(i)) {
|
|
if (!qw(i) && !Kd.urls.hasOwnProperty(i)) {
|
|
var a = o.theme_url;
|
|
a
|
|
? Kd.load(i, t.documentBaseURI.toAbsolute(a))
|
|
: Kd.load(i, "themes/" + i + "/theme" + n + ".js");
|
|
}
|
|
e.loadQueue(function () {
|
|
Kd.waitFor(i, r);
|
|
});
|
|
} else r();
|
|
})(n, e, t, function () {
|
|
!(function (e, t) {
|
|
var n = Bf(t),
|
|
r = Hf(t);
|
|
if (!1 === oa.hasCode(n) && "en" !== n) {
|
|
var o =
|
|
"" !== r ? r : t.editorManager.baseURL + "/langs/" + n + ".js";
|
|
e.add(o, i, undefined, function () {
|
|
qd.languageLoadError(o, n);
|
|
});
|
|
}
|
|
})(n, e),
|
|
$w(n, e),
|
|
(function (n, r) {
|
|
A(n.plugins) && (n.plugins = n.plugins.join(" ")),
|
|
Rn.each(n.external_plugins, function (e, t) {
|
|
Wd.load(t, e, i, undefined, function () {
|
|
qd.pluginLoadError(t, e);
|
|
}),
|
|
(n.plugins += " " + t);
|
|
}),
|
|
Rn.each(n.plugins.split(/[ ,]/), function (e) {
|
|
if ((e = Rn.trim(e)) && !Wd.urls[e])
|
|
if (qw(e)) {
|
|
e = e.substr(1, e.length);
|
|
var t = Wd.dependencies(e);
|
|
Rn.each(t, function (e) {
|
|
var t = {
|
|
prefix: "plugins/",
|
|
resource: e,
|
|
suffix: "/plugin" + r + ".js",
|
|
};
|
|
(e = Wd.createUrl(t, e)),
|
|
Wd.load(e.resource, e, i, undefined, function () {
|
|
qd.pluginLoadError(
|
|
e.prefix + e.resource + e.suffix,
|
|
e.resource,
|
|
);
|
|
});
|
|
});
|
|
} else {
|
|
var n = {
|
|
prefix: "plugins/",
|
|
resource: e,
|
|
suffix: "/plugin" + r + ".js",
|
|
};
|
|
Wd.load(e, n, i, undefined, function () {
|
|
qd.pluginLoadError(n.prefix + n.resource + n.suffix, e);
|
|
});
|
|
}
|
|
});
|
|
})(e.settings, t),
|
|
n.loadQueue(
|
|
function () {
|
|
e.removed || Nz(e);
|
|
},
|
|
e,
|
|
function () {
|
|
e.removed || Nz(e);
|
|
},
|
|
);
|
|
});
|
|
}
|
|
function Kw(e) {
|
|
return Rn.grep(e.childNodes, function (e) {
|
|
return "LI" === e.nodeName;
|
|
});
|
|
}
|
|
function Xw(e) {
|
|
return (
|
|
e &&
|
|
e.firstChild &&
|
|
e.firstChild === e.lastChild &&
|
|
(function (e) {
|
|
return "\xa0" === e.data || Ge.isBr(e);
|
|
})(e.firstChild)
|
|
);
|
|
}
|
|
function Yw(e) {
|
|
return 0 < e.length &&
|
|
(function (e) {
|
|
return !e.firstChild || Xw(e);
|
|
})(e[e.length - 1])
|
|
? e.slice(0, -1)
|
|
: e;
|
|
}
|
|
function Gw(e, t) {
|
|
var n = e.getParent(t, e.isBlock);
|
|
return n && "LI" === n.nodeName ? n : null;
|
|
}
|
|
function Jw(e, t) {
|
|
var n = _s.after(e),
|
|
r = oc(t).prev(n);
|
|
return r ? r.toRange() : null;
|
|
}
|
|
function Qw(t, e, n) {
|
|
var r = t.parentNode;
|
|
return (
|
|
Rn.each(e, function (e) {
|
|
r.insertBefore(e, t);
|
|
}),
|
|
(function (e, t) {
|
|
var n = _s.before(e),
|
|
r = oc(t).next(n);
|
|
return r ? r.toRange() : null;
|
|
})(t, n)
|
|
);
|
|
}
|
|
function Zw(e, t) {
|
|
var n = e.selection.getRng(),
|
|
r = n.startContainer,
|
|
o = n.startOffset;
|
|
n.collapsed &&
|
|
(function (e, t) {
|
|
return Ge.isText(e) && "\xa0" === e.nodeValue[t - 1];
|
|
})(r, o) &&
|
|
Ge.isText(r) &&
|
|
(r.insertData(o - 1, " "),
|
|
r.deleteData(o, 1),
|
|
n.setStart(r, o),
|
|
n.setEnd(r, o),
|
|
e.selection.setRng(n)),
|
|
e.selection.setContent(t);
|
|
}
|
|
function ex(e, t, n) {
|
|
var r,
|
|
o,
|
|
i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m = e.selection,
|
|
g = e.dom;
|
|
if (
|
|
(/^ | $/.test(t) &&
|
|
(t = (function (e, t) {
|
|
var n, r;
|
|
(n = e.startContainer), (r = e.startOffset);
|
|
function o(e) {
|
|
return n[e] && 3 === n[e].nodeType;
|
|
}
|
|
return (
|
|
3 === n.nodeType &&
|
|
(0 < r
|
|
? (t = t.replace(/^ /, " "))
|
|
: o("previousSibling") || (t = t.replace(/^ /, " ")),
|
|
r < n.length
|
|
? (t = t.replace(/ (<br>|)$/, " "))
|
|
: o("nextSibling") ||
|
|
(t = t.replace(/( | )(<br>|)$/, " "))),
|
|
t
|
|
);
|
|
})(m.getRng(), t)),
|
|
(r = e.parser),
|
|
(h = n.merge),
|
|
(o = vl({ validate: e.settings.validate }, e.schema)),
|
|
(d =
|
|
'<span id="mce_marker" data-mce-type="bookmark">​</span>'),
|
|
(s = { content: t, format: "html", selection: !0, paste: n.paste }),
|
|
(s = e.fire("BeforeSetContent", s)).isDefaultPrevented())
|
|
)
|
|
e.fire("SetContent", {
|
|
content: s.content,
|
|
format: "html",
|
|
selection: !0,
|
|
paste: n.paste,
|
|
});
|
|
else {
|
|
-1 === (t = s.content).indexOf("{$caret}") && (t += "{$caret}"),
|
|
(t = t.replace(/\{\$caret\}/, d));
|
|
var p =
|
|
(l = m.getRng()).startContainer ||
|
|
(l.parentElement ? l.parentElement() : null),
|
|
v = e.getBody();
|
|
p === v &&
|
|
m.isCollapsed() &&
|
|
g.isBlock(v.firstChild) &&
|
|
(function (e, t) {
|
|
return t && !e.schema.getShortEndedElements()[t.nodeName];
|
|
})(e, v.firstChild) &&
|
|
g.isEmpty(v.firstChild) &&
|
|
((l = g.createRng()).setStart(v.firstChild, 0),
|
|
l.setEnd(v.firstChild, 0),
|
|
m.setRng(l)),
|
|
m.isCollapsed() ||
|
|
(e.selection.setRng(dp(e.selection.getRng())),
|
|
e.getDoc().execCommand("Delete", !1, null),
|
|
(t = (function (e, t) {
|
|
var n, r;
|
|
return (
|
|
(n = e.startContainer),
|
|
(r = e.startOffset),
|
|
3 === n.nodeType &&
|
|
e.collapsed &&
|
|
("\xa0" === n.data[r]
|
|
? (n.deleteData(r, 1), /[\u00a0| ]$/.test(t) || (t += " "))
|
|
: "\xa0" === n.data[r - 1] &&
|
|
(n.deleteData(r - 1, 1),
|
|
/[\u00a0| ]$/.test(t) || (t = " " + t))),
|
|
t
|
|
);
|
|
})(e.selection.getRng(), t)));
|
|
var y = {
|
|
context: (i = m.getNode()).nodeName.toLowerCase(),
|
|
data: n.data,
|
|
insert: !0,
|
|
};
|
|
if (((u = r.parse(t, y)), !0 === n.paste && Tz(e.schema, u) && Mz(g, i)))
|
|
return (
|
|
(l = Az(o, g, e.selection.getRng(), u)),
|
|
e.selection.setRng(l),
|
|
void e.fire("SetContent", s)
|
|
);
|
|
if (
|
|
((function (e) {
|
|
for (var t = e; (t = t.walk()); )
|
|
1 === t.type && t.attr("data-mce-fragment", "1");
|
|
})(u),
|
|
"mce_marker" === (f = u.lastChild).attr("id"))
|
|
)
|
|
for (f = (c = f).prev; f; f = f.walk(!0))
|
|
if (3 === f.type || !g.isBlock(f.name)) {
|
|
e.schema.isValidChild(f.parent.name, "span") &&
|
|
f.parent.insert(c, f, "br" === f.name);
|
|
break;
|
|
}
|
|
if ((e._selectionOverrides.showBlockCaretContainer(i), y.invalid)) {
|
|
for (
|
|
Zw(e, d),
|
|
i = m.getNode(),
|
|
a = e.getBody(),
|
|
9 === i.nodeType ? (i = f = a) : (f = i);
|
|
f !== a;
|
|
|
|
)
|
|
f = (i = f).parentNode;
|
|
(t = i === a ? a.innerHTML : g.getOuterHTML(i)),
|
|
(t = o.serialize(
|
|
r.parse(
|
|
t.replace(
|
|
/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,
|
|
function () {
|
|
return o.serialize(u);
|
|
},
|
|
),
|
|
),
|
|
)),
|
|
i === a ? g.setHTML(a, t) : g.setOuterHTML(i, t);
|
|
} else
|
|
!(function (e, t, n) {
|
|
if ("all" === n.getAttribute("data-mce-bogus"))
|
|
n.parentNode.insertBefore(e.dom.createFragment(t), n);
|
|
else {
|
|
var r = n.firstChild,
|
|
o = n.lastChild;
|
|
!r || (r === o && "BR" === r.nodeName)
|
|
? e.dom.setHTML(n, t)
|
|
: Zw(e, t);
|
|
}
|
|
})(e, (t = o.serialize(u)), i);
|
|
!(function (e, t) {
|
|
var n = e.schema.getTextInlineElements(),
|
|
r = e.dom;
|
|
if (t) {
|
|
var o = e.getBody(),
|
|
i = new Bg(r);
|
|
Rn.each(r.select("*[data-mce-fragment]"), function (e) {
|
|
for (var t = e.parentNode; t && t !== o; t = t.parentNode)
|
|
n[e.nodeName.toLowerCase()] && i.compare(t, e) && r.remove(e, !0);
|
|
});
|
|
}
|
|
})(e, h),
|
|
(function (n, e) {
|
|
var t,
|
|
r,
|
|
o,
|
|
i,
|
|
a,
|
|
u = n.dom,
|
|
s = n.selection;
|
|
if (e) {
|
|
if (
|
|
(n.selection.scrollIntoView(e),
|
|
(t = (function (e) {
|
|
for (var t = n.getBody(); e && e !== t; e = e.parentNode)
|
|
if ("false" === n.dom.getContentEditable(e)) return e;
|
|
return null;
|
|
})(e)))
|
|
)
|
|
return u.remove(e), s.select(t);
|
|
var c = u.createRng();
|
|
(i = e.previousSibling) && 3 === i.nodeType
|
|
? (c.setStart(i, i.nodeValue.length),
|
|
Sn.ie ||
|
|
((a = e.nextSibling) &&
|
|
3 === a.nodeType &&
|
|
(i.appendData(a.data), a.parentNode.removeChild(a))))
|
|
: (c.setStartBefore(e), c.setEndBefore(e));
|
|
(r = u.getParent(e, u.isBlock)),
|
|
u.remove(e),
|
|
r &&
|
|
u.isEmpty(r) &&
|
|
(n.$(r).empty(),
|
|
c.setStart(r, 0),
|
|
c.setEnd(r, 0),
|
|
Rz(r) ||
|
|
(function (e) {
|
|
return !!e.getAttribute("data-mce-fragment");
|
|
})(r) ||
|
|
!(o = (function (e) {
|
|
var t = _s.fromRangeStart(e);
|
|
if ((t = oc(n.getBody()).next(t))) return t.toRange();
|
|
})(c))
|
|
? u.add(r, u.create("br", { "data-mce-bogus": "1" }))
|
|
: ((c = o), u.remove(r))),
|
|
s.setRng(c);
|
|
}
|
|
})(e, g.get("mce_marker")),
|
|
(function (e) {
|
|
Rn.each(e.getElementsByTagName("*"), function (e) {
|
|
e.removeAttribute("data-mce-fragment");
|
|
});
|
|
})(e.getBody()),
|
|
(function (e, t) {
|
|
k.from(e.getParent(t, "td,th")).map(bt.fromDom).each(wg);
|
|
})(e.dom, e.selection.getStart()),
|
|
e.fire("SetContent", s),
|
|
e.addVisual();
|
|
}
|
|
}
|
|
function tx(e, t) {
|
|
e.getDoc().execCommand(t, !1, null);
|
|
}
|
|
function nx(e, t, n) {
|
|
return t(e).orThunk(function () {
|
|
return n(e)
|
|
? k.none()
|
|
: (function (e, t, n) {
|
|
for (var r = e.dom(), o = D(n) ? n : $(!1); r.parentNode; ) {
|
|
r = r.parentNode;
|
|
var i = bt.fromDom(r),
|
|
a = t(i);
|
|
if (a.isSome()) return a;
|
|
if (o(i)) break;
|
|
}
|
|
return k.none();
|
|
})(e, t, n);
|
|
});
|
|
}
|
|
function rx(e, t, n) {
|
|
function r(t) {
|
|
return ye(t, e).orThunk(function () {
|
|
return "font" === ie(t)
|
|
? le(Bz, e).bind(function (e) {
|
|
return (function (e, t) {
|
|
return k.from(ge(e, t));
|
|
})(t, e);
|
|
})
|
|
: k.none();
|
|
});
|
|
}
|
|
return nx(
|
|
bt.fromDom(n),
|
|
function (e) {
|
|
return r(e);
|
|
},
|
|
function (e) {
|
|
return ze(bt.fromDom(t), e);
|
|
},
|
|
);
|
|
}
|
|
function ox(n) {
|
|
return function (t, e) {
|
|
return k
|
|
.from(e)
|
|
.map(bt.fromDom)
|
|
.filter(zt)
|
|
.bind(function (e) {
|
|
return rx(n, t, e.dom()).or(
|
|
(function (e, t) {
|
|
return k.from(Yi.DOM.getStyle(t, e, !0));
|
|
})(n, e.dom()),
|
|
);
|
|
})
|
|
.getOr("");
|
|
};
|
|
}
|
|
function ix(e) {
|
|
return Lc.firstPositionIn(e.getBody()).map(function (e) {
|
|
var t = e.container();
|
|
return Ge.isText(t) ? t.parentNode : t;
|
|
});
|
|
}
|
|
function ax(t) {
|
|
return k.from(t.selection.getRng()).bind(function (e) {
|
|
return (function (e, t) {
|
|
return e.startContainer === t && 0 === e.startOffset;
|
|
})(e, t.getBody())
|
|
? k.none()
|
|
: k.from(t.selection.getStart(!0));
|
|
});
|
|
}
|
|
function ux(e, t) {
|
|
if (/^[0-9\.]+$/.test(t)) {
|
|
var n = parseInt(t, 10);
|
|
if (1 <= n && n <= 7) {
|
|
var r = wf(e),
|
|
o = xf(e);
|
|
return o ? o[n - 1] || t : r[n - 1] || t;
|
|
}
|
|
return t;
|
|
}
|
|
return t;
|
|
}
|
|
function sx(e, t) {
|
|
var n = ux(e, t);
|
|
e.formatter.toggle("fontname", {
|
|
value: (function (e) {
|
|
var t = e.split(/\s*,\s*/);
|
|
return X(t, function (e) {
|
|
return -1 === e.indexOf(" ") || ee(e, '"') || ee(e, "'")
|
|
? e
|
|
: "'" + e + "'";
|
|
}).join(",");
|
|
})(n),
|
|
}),
|
|
e.nodeChanged();
|
|
}
|
|
var cx = d(ib, ju.isAbove, -1),
|
|
lx = d(ib, ju.isBelow, 1),
|
|
fx = d(ab, -1, cx),
|
|
dx = d(ab, 1, lx),
|
|
hx = Ge.isContentEditableFalse,
|
|
mx = Ka,
|
|
gx = d(
|
|
gb,
|
|
function (e) {
|
|
return e.bottom;
|
|
},
|
|
function (e, t) {
|
|
return e.y < t;
|
|
},
|
|
),
|
|
px = d(
|
|
gb,
|
|
function (e) {
|
|
return e.top;
|
|
},
|
|
function (e, t) {
|
|
return e.y > t;
|
|
},
|
|
),
|
|
vx = d(bb, cx),
|
|
yx = d(bb, lx),
|
|
bx = function (e) {
|
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
t[n - 1] = arguments[n];
|
|
var r = Array.prototype.slice.call(arguments, 1);
|
|
return function () {
|
|
return e.apply(null, r);
|
|
};
|
|
},
|
|
Cx = function (e, t) {
|
|
return g(_b(e, t), function (e) {
|
|
return e.action();
|
|
});
|
|
},
|
|
wx = function (t, n) {
|
|
t.on("keydown", function (e) {
|
|
!1 === e.isDefaultPrevented() &&
|
|
(function (e, t, n) {
|
|
var r = oe().os;
|
|
Cx(
|
|
[
|
|
{ keyCode: Mh.RIGHT, action: db(e, !0) },
|
|
{ keyCode: Mh.LEFT, action: db(e, !1) },
|
|
{ keyCode: Mh.UP, action: hb(e, !1) },
|
|
{ keyCode: Mh.DOWN, action: hb(e, !0) },
|
|
{ keyCode: Mh.RIGHT, action: Eb(e, !0) },
|
|
{ keyCode: Mh.LEFT, action: Eb(e, !1) },
|
|
{ keyCode: Mh.UP, action: Nb(e, !1) },
|
|
{ keyCode: Mh.DOWN, action: Nb(e, !0) },
|
|
{ keyCode: Mh.RIGHT, action: rb.move(e, t, !0) },
|
|
{ keyCode: Mh.LEFT, action: rb.move(e, t, !1) },
|
|
{
|
|
keyCode: Mh.RIGHT,
|
|
ctrlKey: !r.isOSX(),
|
|
altKey: r.isOSX(),
|
|
action: rb.moveNextWord(e, t),
|
|
},
|
|
{
|
|
keyCode: Mh.LEFT,
|
|
ctrlKey: !r.isOSX(),
|
|
altKey: r.isOSX(),
|
|
action: rb.movePrevWord(e, t),
|
|
},
|
|
{ keyCode: Mh.UP, action: Db(e, !1) },
|
|
{ keyCode: Mh.DOWN, action: Db(e, !0) },
|
|
],
|
|
n,
|
|
).each(function (e) {
|
|
n.preventDefault();
|
|
});
|
|
})(t, n, e);
|
|
});
|
|
},
|
|
xx = function (e, t) {
|
|
return Bt(e, t)
|
|
? Ca(
|
|
t,
|
|
function (e) {
|
|
return Fn(e) || jn(e);
|
|
},
|
|
(function (t) {
|
|
return function (e) {
|
|
return ze(t, bt.fromDom(e.dom().parentNode));
|
|
};
|
|
})(e),
|
|
)
|
|
: k.none();
|
|
},
|
|
zx = function (e) {
|
|
e.dom.isEmpty(e.getBody()) &&
|
|
(e.setContent(""),
|
|
(function (e) {
|
|
var t = e.getBody(),
|
|
n = t.firstChild && e.dom.isBlock(t.firstChild) ? t.firstChild : t;
|
|
e.selection.setCursorLocation(n, 0);
|
|
})(e));
|
|
},
|
|
Ex = function (i, a, u) {
|
|
return Ga(Lc.firstPositionIn(u), Lc.lastPositionIn(u), function (e, t) {
|
|
var n = Xy.normalizePosition(!0, e),
|
|
r = Xy.normalizePosition(!1, t),
|
|
o = Xy.normalizePosition(!1, a);
|
|
return i
|
|
? Lc.nextPosition(u, o)
|
|
.map(function (e) {
|
|
return e.isEqual(r) && a.isEqual(n);
|
|
})
|
|
.getOr(!1)
|
|
: Lc.prevPosition(u, o)
|
|
.map(function (e) {
|
|
return e.isEqual(n) && a.isEqual(r);
|
|
})
|
|
.getOr(!1);
|
|
}).getOr(!0);
|
|
},
|
|
Nx = function (e, t, n) {
|
|
return n.collapsed ? Hb(e, t, n) : k.none();
|
|
},
|
|
Sx = function (e, t, n, r) {
|
|
return t ? jb(e, r, n) : jb(e, n, r);
|
|
},
|
|
kx = function (t, n) {
|
|
var r = bt.fromDom(t.getBody()),
|
|
e = Nx(r.dom(), n, t.selection.getRng()).bind(function (e) {
|
|
return Sx(r, n, e.from().block(), e.to().block());
|
|
});
|
|
return (
|
|
e.each(function (e) {
|
|
t.selection.setRng(e.toRange());
|
|
}),
|
|
e.isSome()
|
|
);
|
|
},
|
|
Tx = function (e, t) {
|
|
return !e.selection.isCollapsed() && Wb(e);
|
|
},
|
|
Ax = d(Xb, !1),
|
|
Mx = d(Xb, !0),
|
|
Rx = qf([
|
|
{ remove: ["element"] },
|
|
{ moveToElement: ["element"] },
|
|
{ moveToPosition: ["position"] },
|
|
]),
|
|
Dx = function (e, t) {
|
|
for (; t && t !== e; ) {
|
|
if (Ge.isContentEditableTrue(t) || Ge.isContentEditableFalse(t))
|
|
return t;
|
|
t = t.parentNode;
|
|
}
|
|
return null;
|
|
},
|
|
_x = function (e, t) {
|
|
return e.selection.isCollapsed() ? tC(e, t) : nC(e, t);
|
|
},
|
|
Ox = function (e) {
|
|
var t,
|
|
n = Dx(e.getBody(), e.selection.getNode());
|
|
return (
|
|
Ge.isContentEditableTrue(n) &&
|
|
e.dom.isBlock(n) &&
|
|
e.dom.isEmpty(n) &&
|
|
((t = e.dom.create("br", { "data-mce-bogus": "1" })),
|
|
e.dom.setHTML(n, ""),
|
|
n.appendChild(t),
|
|
e.selection.setRng(_s.before(t).toRange())),
|
|
!0
|
|
);
|
|
},
|
|
Bx = function (e, t) {
|
|
return (function (e, t) {
|
|
var n = e.selection.getRng();
|
|
if (!Ge.isText(n.commonAncestorContainer)) return !1;
|
|
var r = t ? Rs.Forwards : Rs.Backwards,
|
|
o = oc(e.getBody()),
|
|
i = d(As, o.next),
|
|
a = d(As, o.prev),
|
|
u = t ? i : a,
|
|
s = t ? Lh : Vh,
|
|
c = ks(r, e.getBody(), n),
|
|
l = Xy.normalizePosition(t, u(c));
|
|
if (!l || !Ms(c, l)) return !1;
|
|
if (s(l)) return rC(e, n, c.getNode(), r, t, l);
|
|
var f = u(l);
|
|
return !!(f && s(f) && Ms(l, f)) && rC(e, n, c.getNode(), r, t, f);
|
|
})(e, t);
|
|
},
|
|
Hx = function (e, t, n) {
|
|
if (
|
|
e.selection.isCollapsed() &&
|
|
(function (e) {
|
|
return !1 !== e.settings.inline_boundaries;
|
|
})(e)
|
|
) {
|
|
var r = _s.fromRangeStart(e.selection.getRng());
|
|
return aC(e, t, n, r);
|
|
}
|
|
return !1;
|
|
},
|
|
Px = function (e, t) {
|
|
return !!e.selection.isCollapsed() && cC(e, t);
|
|
},
|
|
Lx = qf([{ removeTable: ["element"] }, { emptyCells: ["cells"] }]),
|
|
Vx = function (e, t) {
|
|
return mC(t, e).isSome();
|
|
},
|
|
Ix = function (e, t) {
|
|
return g(dh(t, e), function (e) {
|
|
return "caption" === ie(e);
|
|
});
|
|
},
|
|
Fx = function (e, t) {
|
|
return Cg(t), e.selection.setCursorLocation(t.dom(), 0), k.some(!0);
|
|
},
|
|
Ux = function (e, t) {
|
|
var n = bt.fromDom(e.selection.getStart(!0)),
|
|
r = oy(e);
|
|
return e.selection.isCollapsed() && 0 === r.length
|
|
? AC(e, t, n)
|
|
: (function (e, t) {
|
|
var n = bt.fromDom(e.getBody()),
|
|
r = e.selection.getRng(),
|
|
o = oy(e);
|
|
return 0 !== o.length ? wC(e, o) : EC(e, n, r, t);
|
|
})(e, n);
|
|
},
|
|
jx = function (e, t) {
|
|
return (
|
|
!!e.selection.isCollapsed() &&
|
|
(function (t, n) {
|
|
var e = _s.fromRangeStart(t.selection.getRng());
|
|
return Lc.fromPosition(n, t.getBody(), e)
|
|
.filter(function (e) {
|
|
return n ? Oh(e) : Bh(e);
|
|
})
|
|
.bind(function (e) {
|
|
return k.from(xs(n ? 0 : -1, e));
|
|
})
|
|
.map(function (e) {
|
|
return t.selection.select(e), !0;
|
|
})
|
|
.getOr(!1);
|
|
})(e, t)
|
|
);
|
|
},
|
|
qx = function (e) {
|
|
return y(X(e.selection.getSelectedBlocks(), bt.fromDom), function (e) {
|
|
return (
|
|
!_C(e) &&
|
|
!(function (e) {
|
|
return Se(e).map(_C).getOr(!1);
|
|
})(e) &&
|
|
(function (e) {
|
|
return Ca(e, function (e) {
|
|
return (
|
|
Ge.isContentEditableTrue(e.dom()) ||
|
|
Ge.isContentEditableFalse(e.dom())
|
|
);
|
|
}).exists(function (e) {
|
|
return Ge.isContentEditableTrue(e.dom());
|
|
});
|
|
})(e)
|
|
);
|
|
});
|
|
},
|
|
$x = d(LC, !1),
|
|
Wx = d(LC, !0),
|
|
Kx = d(PC, !1),
|
|
Xx = d(PC, !0),
|
|
Yx = function (e, t, n) {
|
|
if (e.selection.isCollapsed() && DC(e)) {
|
|
var r = e.dom,
|
|
o = e.selection.getRng(),
|
|
i = _s.fromRangeStart(o),
|
|
a = r.getParent(o.startContainer, r.isBlock);
|
|
if (null !== a && $x(bt.fromDom(a), i)) return OC(e, "outdent"), !0;
|
|
}
|
|
return !1;
|
|
},
|
|
Gx = function (t, n) {
|
|
t.on("keydown", function (e) {
|
|
!1 === e.isDefaultPrevented() &&
|
|
(function (e, t, n) {
|
|
Cx(
|
|
[
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Yx, e, !1) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(_x, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(_x, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Bx, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(Bx, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Hx, e, t, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(Hx, e, t, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Ux, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(Ux, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(jx, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(jx, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Tx, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(Tx, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(kx, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(kx, e, !0) },
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Px, e, !1) },
|
|
{ keyCode: Mh.DELETE, action: bx(Px, e, !0) },
|
|
],
|
|
n,
|
|
).each(function (e) {
|
|
n.preventDefault();
|
|
});
|
|
})(t, n, e);
|
|
}),
|
|
t.on("keyup", function (e) {
|
|
!1 === e.isDefaultPrevented() &&
|
|
(function (e, t) {
|
|
Cx(
|
|
[
|
|
{ keyCode: Mh.BACKSPACE, action: bx(Ox, e) },
|
|
{ keyCode: Mh.DELETE, action: bx(Ox, e) },
|
|
],
|
|
t,
|
|
);
|
|
})(t, e);
|
|
});
|
|
},
|
|
Jx = function (e, t) {
|
|
var n,
|
|
r,
|
|
o = t,
|
|
i = e.dom,
|
|
a = e.schema.getMoveCaretBeforeOnEnterElements();
|
|
if (t) {
|
|
if (/^(LI|DT|DD)$/.test(t.nodeName)) {
|
|
var u = (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);
|
|
u &&
|
|
/^(UL|OL|DL)$/.test(u.nodeName) &&
|
|
t.insertBefore(i.doc.createTextNode("\xa0"), t.firstChild);
|
|
}
|
|
if (((r = i.createRng()), t.normalize(), t.hasChildNodes())) {
|
|
for (var s = new bi(t, t); (n = s.current()); ) {
|
|
if (Ge.isText(n)) {
|
|
r.setStart(n, 0), r.setEnd(n, 0);
|
|
break;
|
|
}
|
|
if (a[n.nodeName.toLowerCase()]) {
|
|
r.setStartBefore(n), r.setEndBefore(n);
|
|
break;
|
|
}
|
|
(o = n), (n = s.next());
|
|
}
|
|
n || (r.setStart(o, 0), r.setEnd(o, 0));
|
|
} else
|
|
Ge.isBr(t)
|
|
? t.nextSibling && i.isBlock(t.nextSibling)
|
|
? (r.setStartBefore(t), r.setEndBefore(t))
|
|
: (r.setStartAfter(t), r.setEndAfter(t))
|
|
: (r.setStart(t, 0), r.setEnd(t, 0));
|
|
e.selection.setRng(r), e.selection.scrollIntoView(t);
|
|
}
|
|
},
|
|
Qx = function (e, t) {
|
|
var n,
|
|
r,
|
|
o = e.getRoot();
|
|
for (n = t; n !== o && "false" !== e.getContentEditable(n); )
|
|
"true" === e.getContentEditable(n) && (r = n), (n = n.parentNode);
|
|
return n !== o ? r : o;
|
|
},
|
|
Zx = VC,
|
|
ez = function (e) {
|
|
return VC(e).fold($(""), function (e) {
|
|
return e.nodeName.toUpperCase();
|
|
});
|
|
},
|
|
tz = function (e) {
|
|
return VC(e)
|
|
.filter(function (e) {
|
|
return jn(bt.fromDom(e));
|
|
})
|
|
.isSome();
|
|
},
|
|
nz = function (e, t, n, r, o) {
|
|
var i = e.dom,
|
|
a = e.selection.getRng();
|
|
if (n !== e.getBody()) {
|
|
!(function (e) {
|
|
return FC(e) && FC(e.parentNode);
|
|
})(n) || (o = "LI");
|
|
var u = o ? t(o) : i.create("BR");
|
|
if (jC(n, r, !0) && jC(n, r, !1))
|
|
IC(n, "LI") ? i.insertAfter(u, UC(n)) : i.replace(u, n);
|
|
else if (jC(n, r, !0))
|
|
IC(n, "LI")
|
|
? (i.insertAfter(u, UC(n)),
|
|
u.appendChild(i.doc.createTextNode(" ")),
|
|
u.appendChild(n))
|
|
: n.parentNode.insertBefore(u, n);
|
|
else if (jC(n, r, !1)) i.insertAfter(u, UC(n));
|
|
else {
|
|
n = UC(n);
|
|
var s = a.cloneRange();
|
|
s.setStartAfter(r), s.setEndAfter(n);
|
|
var c = s.extractContents();
|
|
"LI" === o &&
|
|
(function (e, t) {
|
|
return e.firstChild && e.firstChild.nodeName === t;
|
|
})(c, "LI")
|
|
? ((u = c.firstChild), i.insertAfter(c, n))
|
|
: (i.insertAfter(c, n), i.insertAfter(u, n));
|
|
}
|
|
i.remove(r), Jx(e, u);
|
|
}
|
|
},
|
|
rz = function (a, e) {
|
|
function t(e) {
|
|
var t,
|
|
n,
|
|
r,
|
|
o = s,
|
|
i = b.getTextInlineElements();
|
|
if (
|
|
(e || "TABLE" === m || "HR" === m
|
|
? ((t = y.create(e || p)), YC(a, t))
|
|
: (t = c.cloneNode(!1)),
|
|
(r = t),
|
|
!1 === bf(a))
|
|
)
|
|
y.setAttrib(t, "style", null), y.setAttrib(t, "class", null);
|
|
else
|
|
do {
|
|
if (i[o.nodeName]) {
|
|
if (os(o) || Uc(o)) continue;
|
|
(n = o.cloneNode(!1)),
|
|
y.setAttrib(n, "id", ""),
|
|
t.hasChildNodes() ? n.appendChild(t.firstChild) : (r = n),
|
|
t.appendChild(n);
|
|
}
|
|
} while ((o = o.parentNode) && o !== u);
|
|
return qC(r), t;
|
|
}
|
|
function n(e) {
|
|
var t,
|
|
n,
|
|
r = KC(e, s, i);
|
|
if (Ge.isText(s) && (e ? 0 < r : r < s.nodeValue.length)) return !1;
|
|
if (s.parentNode === c && v && !e) return !0;
|
|
if (e && Ge.isElement(s) && s === c.firstChild) return !0;
|
|
if ($C(s, "TABLE") || $C(s, "HR")) return (v && !e) || (!v && e);
|
|
var o = new bi(s, c);
|
|
for (
|
|
Ge.isText(s) &&
|
|
(e && 0 === r ? o.prev() : e || r !== s.nodeValue.length || o.next());
|
|
(t = o.current());
|
|
|
|
) {
|
|
if (Ge.isElement(t)) {
|
|
if (
|
|
!t.getAttribute("data-mce-bogus") &&
|
|
((n = t.nodeName.toLowerCase()), C[n] && "br" !== n)
|
|
)
|
|
return !1;
|
|
} else if (Ge.isText(t) && !/^[ \t\r\n]*$/.test(t.nodeValue))
|
|
return !1;
|
|
e ? o.prev() : o.next();
|
|
}
|
|
return !0;
|
|
}
|
|
function r() {
|
|
(f = /^(H[1-6]|PRE|FIGURE)$/.test(m) && "HGROUP" !== g ? t(p) : t()),
|
|
Cf(a) && WC(y, h) && y.isEmpty(c)
|
|
? (f = y.split(h, c))
|
|
: y.insertAfter(f, c),
|
|
Jx(a, f);
|
|
}
|
|
var o,
|
|
u,
|
|
s,
|
|
i,
|
|
c,
|
|
l,
|
|
f,
|
|
d,
|
|
h,
|
|
m,
|
|
g,
|
|
p,
|
|
v,
|
|
y = a.dom,
|
|
b = a.schema,
|
|
C = b.getNonEmptyElements(),
|
|
w = a.selection.getRng();
|
|
uy(y, w).each(function (e) {
|
|
w.setStart(e.startContainer, e.startOffset),
|
|
w.setEnd(e.endContainer, e.endOffset);
|
|
}),
|
|
(s = w.startContainer),
|
|
(i = w.startOffset),
|
|
(p = gf(a)),
|
|
(l = !(!e || !e.shiftKey));
|
|
var x = !(!e || !e.ctrlKey);
|
|
Ge.isElement(s) &&
|
|
s.hasChildNodes() &&
|
|
((v = i > s.childNodes.length - 1),
|
|
(s = s.childNodes[Math.min(i, s.childNodes.length - 1)] || s),
|
|
(i = v && Ge.isText(s) ? s.nodeValue.length : 0)),
|
|
(u = XC(y, s)) &&
|
|
(((p && !l) || (!p && l)) &&
|
|
(s = (function (e, t, n, r, o) {
|
|
var i,
|
|
a,
|
|
u,
|
|
s,
|
|
c,
|
|
l,
|
|
f = t || "P",
|
|
d = e.dom,
|
|
h = XC(d, r);
|
|
if (!(a = d.getParent(r, d.isBlock)) || !WC(d, a)) {
|
|
if (
|
|
((l =
|
|
(a = a || h) === e.getBody() ||
|
|
(function (e) {
|
|
return e && /^(TD|TH|CAPTION)$/.test(e.nodeName);
|
|
})(a)
|
|
? a.nodeName.toLowerCase()
|
|
: a.parentNode.nodeName.toLowerCase()),
|
|
!a.hasChildNodes())
|
|
)
|
|
return (
|
|
(i = d.create(f)),
|
|
YC(e, i),
|
|
a.appendChild(i),
|
|
n.setStart(i, 0),
|
|
n.setEnd(i, 0),
|
|
i
|
|
);
|
|
for (s = r; s.parentNode !== a; ) s = s.parentNode;
|
|
for (; s && !d.isBlock(s); ) s = (u = s).previousSibling;
|
|
if (u && e.schema.isValidChild(l, f.toLowerCase())) {
|
|
for (
|
|
i = d.create(f),
|
|
YC(e, i),
|
|
u.parentNode.insertBefore(i, u),
|
|
s = u;
|
|
s && !d.isBlock(s);
|
|
|
|
)
|
|
(c = s.nextSibling), i.appendChild(s), (s = c);
|
|
n.setStart(r, o), n.setEnd(r, o);
|
|
}
|
|
}
|
|
return r;
|
|
})(a, p, w, s, i)),
|
|
(c = y.getParent(s, y.isBlock)),
|
|
(h = c ? y.getParent(c.parentNode, y.isBlock) : null),
|
|
(m = c ? c.nodeName.toUpperCase() : ""),
|
|
"LI" !== (g = h ? h.nodeName.toUpperCase() : "") ||
|
|
x ||
|
|
((h = (c = h).parentNode), (m = g)),
|
|
/^(LI|DT|DD)$/.test(m) && y.isEmpty(c)
|
|
? nz(a, t, h, c, p)
|
|
: (p && c === a.getBody()) ||
|
|
((p = p || "P"),
|
|
Ra(c)
|
|
? ((f = La(c)), y.isEmpty(c) && qC(c), Jx(a, f))
|
|
: n()
|
|
? r()
|
|
: n(!0)
|
|
? ((f = c.parentNode.insertBefore(t(), c)),
|
|
Jx(a, $C(c, "HR") ? f : c))
|
|
: ((o = (function (e) {
|
|
var t = e.cloneRange();
|
|
return (
|
|
t.setStart(
|
|
e.startContainer,
|
|
KC(!0, e.startContainer, e.startOffset),
|
|
),
|
|
t.setEnd(
|
|
e.endContainer,
|
|
KC(!1, e.endContainer, e.endOffset),
|
|
),
|
|
t
|
|
);
|
|
})(w).cloneRange()).setEndAfter(c),
|
|
(function (e) {
|
|
z(va(bt.fromDom(e), Et), function (e) {
|
|
var t = e.dom();
|
|
t.nodeValue = fu(t.nodeValue);
|
|
});
|
|
})((d = o.extractContents())),
|
|
(function (e) {
|
|
for (
|
|
;
|
|
Ge.isText(e) &&
|
|
(e.nodeValue = e.nodeValue.replace(/^[\r\n]+/, "")),
|
|
(e = e.firstChild);
|
|
|
|
);
|
|
})(d),
|
|
(f = d.firstChild),
|
|
y.insertAfter(d, c),
|
|
(function (e, t, n) {
|
|
var r,
|
|
o = n,
|
|
i = [];
|
|
if (o) {
|
|
for (; (o = o.firstChild); ) {
|
|
if (e.isBlock(o)) return;
|
|
Ge.isElement(o) &&
|
|
!t[o.nodeName.toLowerCase()] &&
|
|
i.push(o);
|
|
}
|
|
for (r = i.length; r--; )
|
|
!(o = i[r]).hasChildNodes() ||
|
|
(o.firstChild === o.lastChild &&
|
|
"" === o.firstChild.nodeValue)
|
|
? e.remove(o)
|
|
: ((a = e),
|
|
(u = o) &&
|
|
"A" === u.nodeName &&
|
|
a.isEmpty(u) &&
|
|
e.remove(o));
|
|
var a, u;
|
|
}
|
|
})(y, C, f),
|
|
(function (e, t) {
|
|
var n;
|
|
t.normalize(),
|
|
((n = t.lastChild) &&
|
|
!/^(left|right)$/gi.test(e.getStyle(n, "float", !0))) ||
|
|
e.add(t, "br");
|
|
})(y, c),
|
|
y.isEmpty(c) && qC(c),
|
|
f.normalize(),
|
|
y.isEmpty(f) ? (y.remove(f), r()) : Jx(a, f)),
|
|
y.setAttrib(f, "id", ""),
|
|
a.fire("NewBlock", { newBlock: f })));
|
|
},
|
|
oz = function (e, t) {
|
|
return (
|
|
!!(function (e) {
|
|
return Ge.isBr(e.getNode());
|
|
})(_s.after(t)) ||
|
|
Lc.nextPosition(e, _s.after(t))
|
|
.map(function (e) {
|
|
return Ge.isBr(e.getNode());
|
|
})
|
|
.getOr(!1)
|
|
);
|
|
},
|
|
iz = function (e, t) {
|
|
var n = (function (e) {
|
|
var t = d(Xy.isInlineTarget, e),
|
|
n = _s.fromRangeStart(e.selection.getRng());
|
|
return Qy(t, e.getBody(), n).filter(nw);
|
|
})(e);
|
|
n.isSome() ? n.each(d(rw, e)) : QC(e, t);
|
|
},
|
|
az = function (e) {
|
|
return ow(e, vf(e));
|
|
},
|
|
uz = function (e) {
|
|
return ow(e, yf(e));
|
|
},
|
|
sz = qf([{ br: [] }, { block: [] }, { none: [] }]),
|
|
cz = function (e, t) {
|
|
return Yy(
|
|
[
|
|
mw([iw], sz.none()),
|
|
mw([sw("summary", !0)], sz.br()),
|
|
mw([cw(!0), lw(!1), dw], sz.br()),
|
|
mw([cw(!0), lw(!1)], sz.block()),
|
|
mw([cw(!0), lw(!0), dw], sz.block()),
|
|
mw([cw(!0), lw(!0)], sz.br()),
|
|
mw([uw(!0), dw], sz.br()),
|
|
mw([uw(!0)], sz.block()),
|
|
mw([aw(!0), dw, hw], sz.block()),
|
|
mw([aw(!0)], sz.br()),
|
|
mw([fw], sz.br()),
|
|
mw([aw(!1), dw], sz.br()),
|
|
mw([hw], sz.block()),
|
|
],
|
|
[e, !(!t || !t.shiftKey)],
|
|
).getOr(sz.none());
|
|
},
|
|
lz = function (e, t) {
|
|
cz(e, t).fold(
|
|
function () {
|
|
iz(e, t);
|
|
},
|
|
function () {
|
|
rz(e, t);
|
|
},
|
|
i,
|
|
);
|
|
},
|
|
fz = function (t) {
|
|
t.on("keydown", function (e) {
|
|
e.keyCode === Mh.ENTER &&
|
|
(function (e, t) {
|
|
t.isDefaultPrevented() ||
|
|
(t.preventDefault(),
|
|
(function (e) {
|
|
e.typing && ((e.typing = !1), e.add());
|
|
})(e.undoManager),
|
|
e.undoManager.transact(function () {
|
|
!1 === e.selection.isCollapsed() && e.execCommand("Delete"),
|
|
lz(e, t);
|
|
}));
|
|
})(t, e);
|
|
});
|
|
},
|
|
dz = d(gw, "\xa0"),
|
|
hz = d(gw, " "),
|
|
mz = function (t) {
|
|
t.on("keydown", function (e) {
|
|
!1 === e.isDefaultPrevented() &&
|
|
(function (e, t) {
|
|
Cx([{ keyCode: Mh.SPACEBAR, action: bx(Mw, e) }], t).each(function (
|
|
e,
|
|
) {
|
|
t.preventDefault();
|
|
});
|
|
})(t, e);
|
|
});
|
|
},
|
|
gz = function (e) {
|
|
e.on("keyup compositionstart", d(Dw, e));
|
|
},
|
|
pz = oe().browser,
|
|
vz = function (t) {
|
|
t.on("keydown", function (e) {
|
|
!1 === e.isDefaultPrevented() &&
|
|
(function (e, t) {
|
|
Cx(
|
|
[
|
|
{ keyCode: Mh.END, action: mb(e, !0) },
|
|
{ keyCode: Mh.HOME, action: mb(e, !1) },
|
|
],
|
|
t,
|
|
).each(function (e) {
|
|
t.preventDefault();
|
|
});
|
|
})(t, e);
|
|
});
|
|
},
|
|
yz = function (e) {
|
|
var t = rb.setupSelectedState(e);
|
|
gz(e), wx(e, t), Gx(e, t), fz(e), mz(e), _w(e), vz(e);
|
|
},
|
|
bz = Yi.DOM,
|
|
Cz = function (t, e) {
|
|
var n,
|
|
r,
|
|
o = t.settings,
|
|
i = t.getElement(),
|
|
a = t.getDoc();
|
|
o.inline || (t.getElement().style.visibility = t.orgVisibility),
|
|
e || t.inline || (a.open(), a.write(t.iframeHTML), a.close()),
|
|
t.inline &&
|
|
(t.on("remove", function () {
|
|
var e = this.getBody();
|
|
bz.removeClass(e, "mce-content-body"),
|
|
bz.removeClass(e, "mce-edit-focus"),
|
|
bz.setAttrib(e, "contentEditable", null);
|
|
}),
|
|
bz.addClass(i, "mce-content-body"),
|
|
(t.contentDocument = a = j.document),
|
|
(t.contentWindow = j.window),
|
|
(t.bodyElement = i),
|
|
(t.contentAreaContainer = i),
|
|
(o.root_name = i.nodeName.toLowerCase())),
|
|
((n = t.getBody()).disabled = !0),
|
|
(t.readonly = o.readonly),
|
|
t.readonly ||
|
|
(t.inline &&
|
|
"static" === bz.getStyle(n, "position", !0) &&
|
|
(n.style.position = "relative"),
|
|
(n.contentEditable = t.getParam("content_editable_state", !0))),
|
|
(n.disabled = !1),
|
|
(t.editorUpload = eh(t)),
|
|
(t.schema = vr(o)),
|
|
(t.dom = Yi(a, {
|
|
keep_values: !0,
|
|
url_converter: t.convertURL,
|
|
url_converter_scope: t,
|
|
hex_colors: o.force_hex_style_colors,
|
|
update_styles: !0,
|
|
root_element: t.inline ? t.getBody() : null,
|
|
collect: function () {
|
|
return t.inline;
|
|
},
|
|
schema: t.schema,
|
|
contentCssCors: _f(t),
|
|
referrerPolicy: Of(t),
|
|
onSetAttrib: function (e) {
|
|
t.fire("SetAttrib", e);
|
|
},
|
|
})),
|
|
(t.parser = (function (u) {
|
|
var e = Sp(u.settings, u.schema);
|
|
return (
|
|
e.addAttributeFilter("src,href,style,tabindex", function (e, t) {
|
|
for (var n, r, o, i = e.length, a = u.dom; i--; )
|
|
if (
|
|
((r = (n = e[i]).attr(t)), (o = "data-mce-" + t), !n.attr(o))
|
|
) {
|
|
if (0 === r.indexOf("data:") || 0 === r.indexOf("blob:"))
|
|
continue;
|
|
"style" === t
|
|
? ((r = a.serializeStyle(a.parseStyle(r), n.name)).length ||
|
|
(r = null),
|
|
n.attr(o, r),
|
|
n.attr(t, r))
|
|
: "tabindex" === t
|
|
? (n.attr(o, r), n.attr(t, null))
|
|
: n.attr(o, u.convertURL(r, t, n.name));
|
|
}
|
|
}),
|
|
e.addNodeFilter("script", function (e) {
|
|
for (var t, n, r = e.length; r--; )
|
|
0 !==
|
|
(n = (t = e[r]).attr("type") || "no/type").indexOf("mce-") &&
|
|
t.attr("type", "mce-" + n);
|
|
}),
|
|
e.addNodeFilter("#cdata", function (e) {
|
|
for (var t, n = e.length; n--; )
|
|
((t = e[n]).type = 8),
|
|
(t.name = "#comment"),
|
|
(t.value = "[CDATA[" + t.value + "]]");
|
|
}),
|
|
e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div", function (e) {
|
|
for (
|
|
var t, n = e.length, r = u.schema.getNonEmptyElements();
|
|
n--;
|
|
|
|
)
|
|
(t = e[n]).isEmpty(r) &&
|
|
0 === t.getAll("br").length &&
|
|
(t.append(new sl("br", 1)).shortEnded = !0);
|
|
}),
|
|
e
|
|
);
|
|
})(t)),
|
|
(t.serializer = Mp(o, t)),
|
|
(t.selection = fy(t.dom, t.getWin(), t.serializer, t)),
|
|
(t.annotator = rl(t)),
|
|
(t.formatter = wp(t)),
|
|
(t.undoManager = gm(t)),
|
|
(t._nodeChangeDispatcher = new vh(t)),
|
|
(t._selectionOverrides = im(t)),
|
|
Pw(t),
|
|
Hw(t),
|
|
yz(t),
|
|
hh(t),
|
|
t.fire("PreInit"),
|
|
o.browser_spellcheck ||
|
|
o.gecko_spellcheck ||
|
|
((a.body.spellcheck = !1), bz.setAttrib(n, "spellcheck", "false")),
|
|
(t.quirks = Ow(t)),
|
|
t.fire("PostRender");
|
|
var u = If(t);
|
|
u !== undefined && (n.dir = u),
|
|
o.protect &&
|
|
t.on("BeforeSetContent", function (t) {
|
|
Rn.each(o.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.load({ initial: !0, format: "html" }),
|
|
(t.startContent = t.getContent({ format: "raw" })),
|
|
t.on("compositionstart compositionend", function (e) {
|
|
t.composing = "compositionstart" === e.type;
|
|
}),
|
|
0 < t.contentStyles.length &&
|
|
((r = ""),
|
|
Rn.each(t.contentStyles, function (e) {
|
|
r += e + "\r\n";
|
|
}),
|
|
t.dom.addStyle(r)),
|
|
(function (e) {
|
|
return e.inline ? bz.styleSheetLoader : e.dom.styleSheetLoader;
|
|
})(t).loadAll(
|
|
t.contentCSS,
|
|
function (e) {
|
|
Lw(t);
|
|
},
|
|
function (e) {
|
|
Lw(t);
|
|
},
|
|
),
|
|
o.content_style &&
|
|
(function (e, t) {
|
|
var n = bt.fromDom(e.getDoc().head),
|
|
r = bt.fromTag("style");
|
|
At(r, "type", "text/css"), _i(r, bt.fromText(t)), _i(n, r);
|
|
})(t, o.content_style);
|
|
},
|
|
wz = Yi.DOM,
|
|
xz = function (e, t) {
|
|
var n = Vw(e, t);
|
|
t.editorContainer &&
|
|
((wz.get(t.editorContainer).style.display = e.orgDisplay),
|
|
(e.hidden = wz.isHidden(t.editorContainer))),
|
|
(e.getElement().style.display = "none"),
|
|
wz.setAttrib(e.id, "aria-hidden", "true"),
|
|
n || Cz(e);
|
|
},
|
|
zz = Yi.DOM,
|
|
Ez = function (t, n, e) {
|
|
var r = Wd.get(e),
|
|
o = Wd.urls[e] || t.documentBaseUrl.replace(/\/$/, "");
|
|
if (((e = Rn.trim(e)), r && -1 === Rn.inArray(n, e))) {
|
|
if (
|
|
(Rn.each(Wd.dependencies(e), function (e) {
|
|
Ez(t, n, e);
|
|
}),
|
|
t.plugins[e])
|
|
)
|
|
return;
|
|
try {
|
|
var i = new r(t, o, t.$);
|
|
(t.plugins[e] = i).init && (i.init(t, o), n.push(e));
|
|
} catch (xN) {
|
|
qd.pluginInitError(t, e, xN);
|
|
}
|
|
}
|
|
},
|
|
Nz = function (e) {
|
|
e.fire("ScriptsLoaded"),
|
|
(function (n) {
|
|
var e = Rn.trim(n.settings.icons),
|
|
r = n.ui.registry.getAll().icons,
|
|
t = G(
|
|
G(
|
|
{},
|
|
{
|
|
"accessibility-check":
|
|
'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',
|
|
"action-next":
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',
|
|
"action-prev":
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3z"/></svg>',
|
|
"align-center":
|
|
'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
"align-justify":
|
|
'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
"align-left":
|
|
'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
"align-none":
|
|
'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 1 1 0-2h9.2zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h6.8zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h4.4zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 0 1 0-2h2zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',
|
|
"align-right":
|
|
'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
"arrow-left":
|
|
'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8z" fill-rule="evenodd"/></svg>',
|
|
"arrow-right":
|
|
'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8z" fill-rule="evenodd"/></svg>',
|
|
bold: '<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',
|
|
bookmark:
|
|
'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1z" fill-rule="nonzero"/></svg>',
|
|
"border-width":
|
|
'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 1 1 0-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 0 1-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></svg>',
|
|
brightness:
|
|
'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0zm-10-7l-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',
|
|
browse:
|
|
'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6z" fill-rule="nonzero"/></svg>',
|
|
cancel:
|
|
'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8zM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',
|
|
"change-case":
|
|
'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 1 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',
|
|
"character-count":
|
|
'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',
|
|
"checklist-rtl":
|
|
'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',
|
|
checklist:
|
|
'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',
|
|
checkmark:
|
|
'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',
|
|
"chevron-down":
|
|
'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',
|
|
"chevron-left":
|
|
'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',
|
|
"chevron-right":
|
|
'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',
|
|
"chevron-up":
|
|
'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',
|
|
close:
|
|
'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5z" fill-rule="evenodd"/></svg>',
|
|
"code-sample":
|
|
'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',
|
|
"color-levels":
|
|
'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5z" fill-rule="evenodd"/></svg>',
|
|
"color-picker":
|
|
'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z" fill-rule="nonzero"/></svg>',
|
|
"color-swatch-remove-color":
|
|
'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',
|
|
"color-swatch":
|
|
'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',
|
|
"comment-add":
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2z"/></g></svg>',
|
|
comment:
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z"/></svg>',
|
|
contrast:
|
|
'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6z" fill-rule="evenodd"/></svg>',
|
|
copy: '<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',
|
|
crop: '<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',
|
|
cut: '<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',
|
|
"document-properties":
|
|
'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',
|
|
drag: '<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',
|
|
duplicate:
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1z"/></g></svg>',
|
|
"edit-block":
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',
|
|
"edit-image":
|
|
'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9zM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',
|
|
"embed-page":
|
|
'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2z" fill-rule="nonzero"/></svg>',
|
|
embed:
|
|
'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4z" fill-rule="nonzero"/></svg>',
|
|
emoji:
|
|
'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13z" fill-rule="nonzero"/></svg>',
|
|
fill: '<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',
|
|
"flip-horizontally":
|
|
'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" fill-rule="nonzero"/></svg>',
|
|
"flip-vertically":
|
|
'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2zm2 14h-2v2a2 2 0 0 0 2-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',
|
|
"format-painter":
|
|
'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',
|
|
fullscreen:
|
|
'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',
|
|
gallery:
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4zM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1z"/></svg>',
|
|
gamma:
|
|
'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0z" fill-rule="nonzero"/></svg>',
|
|
help: '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1zM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',
|
|
"highlight-bg-color":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',
|
|
home: '<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',
|
|
"horizontal-rule":
|
|
'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',
|
|
"image-options":
|
|
'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" fill-rule="nonzero"/></svg>',
|
|
image:
|
|
'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" fill-rule="nonzero"/></svg>',
|
|
indent:
|
|
'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',
|
|
info: '<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',
|
|
"insert-character":
|
|
'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',
|
|
"insert-time":
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',
|
|
invert:
|
|
'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',
|
|
italic:
|
|
'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',
|
|
line: '<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',
|
|
link: '<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2.1 2a2 2 0 1 0 2.7 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',
|
|
"list-bull-circle":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',
|
|
"list-bull-default":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',
|
|
"list-bull-square":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',
|
|
"list-num-default-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',
|
|
"list-num-default":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',
|
|
"list-num-lower-alpha-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-lower-alpha":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-lower-greek-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-lower-greek":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-lower-roman-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',
|
|
"list-num-lower-roman":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',
|
|
"list-num-upper-alpha-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-upper-alpha":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',
|
|
"list-num-upper-roman-rtl":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',
|
|
"list-num-upper-roman":
|
|
'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',
|
|
lock: '<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" fill-rule="evenodd"/></svg>',
|
|
ltr: '<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',
|
|
"more-drawer":
|
|
'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" fill-rule="nonzero"/></svg>',
|
|
"new-document":
|
|
'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',
|
|
"new-tab":
|
|
'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',
|
|
"non-breaking":
|
|
'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',
|
|
notice:
|
|
'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',
|
|
"ordered-list-rtl":
|
|
'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19zm-1 8.8l.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',
|
|
"ordered-list":
|
|
'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',
|
|
orientation:
|
|
'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1z" fill-rule="nonzero"/></svg>',
|
|
outdent:
|
|
'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',
|
|
"page-break":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',
|
|
"paste-text":
|
|
'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',
|
|
paste:
|
|
'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',
|
|
"permanent-pen":
|
|
'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',
|
|
plus: '<svg width="24" height="24"><g fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="#000" stroke-width="2"><path d="M12 5v14M5 12h14"/></g></svg>',
|
|
preferences:
|
|
'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" fill-rule="evenodd"/></svg>',
|
|
preview:
|
|
'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6z" fill-rule="nonzero"/></svg>',
|
|
print:
|
|
'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',
|
|
quote:
|
|
'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3z" fill-rule="nonzero"/></svg>',
|
|
redo: '<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',
|
|
reload:
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1z"/></g></svg>',
|
|
"remove-formatting":
|
|
'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" fill-rule="evenodd"/></svg>',
|
|
remove:
|
|
'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4z" fill-rule="nonzero"/></svg>',
|
|
"resize-handle":
|
|
'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7zM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3z"/></g></svg>',
|
|
resize:
|
|
'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5z" fill-rule="evenodd"/></svg>',
|
|
"restore-draft":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></g></svg>',
|
|
"rotate-left":
|
|
'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></svg>',
|
|
"rotate-right":
|
|
'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',
|
|
rtl: '<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',
|
|
save: '<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6z" fill-rule="nonzero"/></svg>',
|
|
search:
|
|
'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" fill-rule="nonzero"/></svg>',
|
|
"select-all":
|
|
'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 0 0-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 0 0 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',
|
|
selected:
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3z"/></svg>',
|
|
settings:
|
|
'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',
|
|
sharpen:
|
|
'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',
|
|
sourcecode:
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',
|
|
"spell-check":
|
|
'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',
|
|
"strike-through":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" fill-rule="nonzero"/></g></svg>',
|
|
subscript:
|
|
'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',
|
|
superscript:
|
|
'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',
|
|
"table-cell-properties":
|
|
'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',
|
|
"table-cell-select-all":
|
|
'<svg width="24" height="24"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" fill-rule="nonzero"/></svg>',
|
|
"table-cell-select-inner":
|
|
'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z"/></g></svg>',
|
|
"table-delete-column":
|
|
'<svg width="24" height="24"><path d="M9 11.2l1 1v.2l-1 1v-2.2zm5 1l1-1v2.2l-1-1v-.2zM20 5v14H4V5h16zm-1 2h-4v.8l-.2-.2-.8.8V7h-4v1.4l-.8-.8-.2.2V7H5v11h4v-1.8l.5.5.5-.4V18h4v-1.8l.8.8.2-.3V18h4V7zm-3.9 3.4l-1.8 1.9 1.8 1.9c.4.3.4.9 0 1.2-.3.3-.8.3-1.2 0L12 13.5l-1.8 1.9a.8.8 0 0 1-1.2 0 .9.9 0 0 1 0-1.2l1.8-1.9-1.9-2a.9.9 0 0 1 1.2-1.2l2 2 1.8-1.8c.3-.4.9-.4 1.2 0a.8.8 0 0 1 0 1.1z" fill-rule="evenodd"/></svg>',
|
|
"table-delete-row":
|
|
'<svg width="24" height="24"><path d="M16.7 8.8l1.1 1.2-2.4 2.5L18 15l-1.2 1.2-2.5-2.5-2.4 2.5-1.3-1.2 2.5-2.5-2.5-2.5 1.2-1.3 2.6 2.6 2.4-2.5zM4 5h16v14H4V5zm15 5V7H5v3h4.8l1 1H5v3h5.8l-1 1H5v3h14v-3h-.4l-1-1H19v-3h-1.3l1-1h.3z" fill-rule="evenodd"/></svg>',
|
|
"table-delete-table":
|
|
'<svg width="24" height="26"><path d="M4 6h16v14H4V6zm1 2v11h14V8H5zm11.7 8.7l-1.5 1.5L12 15l-3.3 3.2-1.4-1.5 3.2-3.2-3.3-3.2 1.5-1.5L12 12l3.2-3.2 1.5 1.5-3.2 3.2 3.2 3.2z" fill-rule="evenodd"/></svg>',
|
|
"table-insert-column-after":
|
|
'<svg width="24" height="24"><path d="M14.3 9c.4 0 .7.3.7.6v2.2h2.1c.4 0 .7.3.7.7 0 .4-.3.7-.7.7H15v2.2c0 .3-.3.6-.7.6a.7.7 0 0 1-.6-.6v-2.2h-2.2a.7.7 0 0 1 0-1.4h2.2V9.6c0-.3.3-.6.6-.6zM4 5h16v14H4V5zm5 13v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8V7h-9v11h9z" fill-rule="evenodd"/></svg>',
|
|
"table-insert-column-before":
|
|
'<svg width="24" height="24"><path d="M9.7 16a.7.7 0 0 1-.7-.6v-2.2H6.9a.7.7 0 0 1 0-1.4H9V9.6c0-.3.3-.6.7-.6.3 0 .6.3.6.6v2.2h2.2c.4 0 .8.3.8.7 0 .4-.4.7-.8.7h-2.2v2.2c0 .3-.3.6-.6.6zM4 5h16v14H4V5zm10 13V7H5v11h9zm5 0v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V7h-4v3h4z" fill-rule="evenodd"/></svg>',
|
|
"table-insert-row-above":
|
|
'<svg width="24" height="24"><path d="M14.8 10.5c0 .3-.2.5-.5.5h-1.8v1.8c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.6V11H9.7a.5.5 0 0 1 0-1h1.8V8.3c0-.3.2-.6.5-.6s.5.3.5.6V10h1.8c.3 0 .5.2.5.5zM4 5h16v14H4V5zm5 13v-3H5v3h4zm5 0v-3h-4v3h4zm5 0v-3h-4v3h4zm0-4V7H5v7h14z" fill-rule="evenodd"/></svg>',
|
|
"table-insert-row-after":
|
|
'<svg width="24" height="24"><path d="M9.2 14.5c0-.3.2-.5.5-.5h1.8v-1.8c0-.3.2-.5.5-.5s.5.2.5.6V14h1.8c.3 0 .5.2.5.5s-.2.5-.5.5h-1.8v1.7c0 .3-.2.6-.5.6a.5.5 0 0 1-.5-.6V15H9.7a.5.5 0 0 1-.5-.5zM4 5h16v14H4V5zm6 2v3h4V7h-4zM5 7v3h4V7H5zm14 11v-7H5v7h14zm0-8V7h-4v3h4z" fill-rule="evenodd"/></svg>',
|
|
"table-left-header":
|
|
'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" fill-rule="evenodd"/></svg>',
|
|
"table-merge-cells":
|
|
'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" fill-rule="evenodd"/></svg>',
|
|
"table-row-properties":
|
|
'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',
|
|
"table-split-cells":
|
|
'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 2v3h4V7h-4zM9 18v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8v-7h-9v7h9zm0-8V7h-4v3h4zm-3.5 4.5l1.5 1.6c.3.2.3.7 0 1-.2.2-.7.2-1 0l-1.5-1.6-1.6 1.5c-.2.3-.7.3-1 0a.7.7 0 0 1 0-1l1.6-1.5-1.5-1.6a.7.7 0 0 1 1-1l1.5 1.6 1.6-1.5c.2-.3.7-.3 1 0 .2.2.2.7 0 1l-1.6 1.5z" fill-rule="evenodd"/></svg>',
|
|
"table-top-header":
|
|
'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" fill-rule="evenodd"/></svg>',
|
|
table:
|
|
'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 9h4v-3h-4v3zm4 1h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',
|
|
template:
|
|
'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',
|
|
"temporary-placeholder":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',
|
|
"text-color":
|
|
'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',
|
|
toc: '<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
translate:
|
|
'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 1 1 2 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',
|
|
underline:
|
|
'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',
|
|
undo: '<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',
|
|
unlink:
|
|
'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2zM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1zM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19z" fill-rule="nonzero"/></svg>',
|
|
unlock:
|
|
'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',
|
|
"unordered-list":
|
|
'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',
|
|
unselected:
|
|
'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',
|
|
upload:
|
|
'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12zM11 6.4L8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4z" fill-rule="nonzero"/></svg>',
|
|
user: '<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',
|
|
visualblocks:
|
|
'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 0 1-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 0 1-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 0 1 2 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',
|
|
visualchars:
|
|
'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5z" fill-rule="evenodd"/></svg>',
|
|
warning:
|
|
'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',
|
|
"zoom-in":
|
|
'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>',
|
|
"zoom-out":
|
|
'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>',
|
|
},
|
|
),
|
|
$d.get(e).icons,
|
|
);
|
|
ue(t, function (e, t) {
|
|
Tt(r, t) || n.ui.registry.addIcon(t, e);
|
|
});
|
|
})(e),
|
|
(function (e) {
|
|
var t = e.settings.theme;
|
|
if (K(t)) {
|
|
e.settings.theme = Fw(t);
|
|
var n = Kd.get(t);
|
|
(e.theme = new n(e, Kd.urls[t])),
|
|
e.theme.init &&
|
|
e.theme.init(
|
|
e,
|
|
Kd.urls[t] || e.documentBaseUrl.replace(/\/$/, ""),
|
|
e.$,
|
|
);
|
|
} else e.theme = {};
|
|
})(e),
|
|
(function (t) {
|
|
var n = [];
|
|
Rn.each(t.settings.plugins.split(/[ ,]/), function (e) {
|
|
Ez(t, n, Fw(e));
|
|
});
|
|
})(e);
|
|
var t = (function (e) {
|
|
var t = e.getElement();
|
|
return (
|
|
(e.orgDisplay = t.style.display),
|
|
K(e.settings.theme)
|
|
? (function (e) {
|
|
return e.theme.renderUI();
|
|
})(e)
|
|
: D(e.settings.theme)
|
|
? (function (e) {
|
|
var t = e.getElement(),
|
|
n = (0, e.settings.theme)(e, t);
|
|
return (
|
|
n.editorContainer.nodeType &&
|
|
(n.editorContainer.id =
|
|
n.editorContainer.id || e.id + "_parent"),
|
|
n.iframeContainer &&
|
|
n.iframeContainer.nodeType &&
|
|
(n.iframeContainer.id =
|
|
n.iframeContainer.id || e.id + "_iframecontainer"),
|
|
(n.height = n.iframeHeight ? n.iframeHeight : t.offsetHeight),
|
|
n
|
|
);
|
|
})(e)
|
|
: jw(e)
|
|
);
|
|
})(e);
|
|
return (
|
|
(e.editorContainer = t.editorContainer ? t.editorContainer : null),
|
|
Iw(e),
|
|
e.inline ? Cz(e) : xz(e, t)
|
|
);
|
|
},
|
|
Sz = Yi.DOM,
|
|
kz = function (t) {
|
|
var e = t.settings,
|
|
n = t.id;
|
|
oa.setCode(Bf(t));
|
|
var r = function () {
|
|
Sz.unbind(j.window, "ready", r), t.render();
|
|
};
|
|
if (Tr.Event.domLoaded) {
|
|
if (t.getElement() && Sn.contentEditable) {
|
|
e.inline
|
|
? (t.inline = !0)
|
|
: ((t.orgVisibility = t.getElement().style.visibility),
|
|
(t.getElement().style.visibility = "hidden"));
|
|
var o = t.getElement().form || Sz.getParent(n, "form");
|
|
o &&
|
|
((t.formElement = o),
|
|
e.hidden_input &&
|
|
!Ge.isTextareaOrInput(t.getElement()) &&
|
|
(Sz.insertAfter(
|
|
Sz.create("input", { type: "hidden", name: n }),
|
|
n,
|
|
),
|
|
(t.hasHiddenInput = !0)),
|
|
(t.formEventDelegate = function (e) {
|
|
t.fire(e.type, e);
|
|
}),
|
|
Sz.bind(o, "submit reset", t.formEventDelegate),
|
|
t.on("reset", function () {
|
|
t.resetContent();
|
|
}),
|
|
!e.submit_patch ||
|
|
o.submit.nodeType ||
|
|
o.submit.length ||
|
|
o._mceOldSubmit ||
|
|
((o._mceOldSubmit = o.submit),
|
|
(o.submit = function () {
|
|
return (
|
|
t.editorManager.triggerSave(),
|
|
t.setDirty(!1),
|
|
o._mceOldSubmit(o)
|
|
);
|
|
}))),
|
|
(t.windowManager = Bd(t)),
|
|
(t.notificationManager = Od(t)),
|
|
"xml" === e.encoding &&
|
|
t.on("GetContent", function (e) {
|
|
e.save && (e.content = Sz.encode(e.content));
|
|
}),
|
|
e.add_form_submit_trigger &&
|
|
t.on("submit", function () {
|
|
t.initialized && t.save();
|
|
}),
|
|
e.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),
|
|
Ww(t, t.suffix);
|
|
}
|
|
} else Sz.bind(j.window, "ready", r);
|
|
},
|
|
Tz = function (e, t) {
|
|
var n = t.firstChild,
|
|
r = t.lastChild;
|
|
return (
|
|
n && "meta" === n.name && (n = n.next),
|
|
r && "mce_marker" === r.attr("id") && (r = r.prev),
|
|
(function (e, t) {
|
|
var n = e.getNonEmptyElements();
|
|
return (
|
|
t &&
|
|
(t.isEmpty(n) ||
|
|
(function (e, t) {
|
|
return (
|
|
e.getBlockElements()[t.name] &&
|
|
(function (e) {
|
|
return e.firstChild && e.firstChild === e.lastChild;
|
|
})(t) &&
|
|
(function (e) {
|
|
return "br" === e.name || "\xa0" === e.value;
|
|
})(t.firstChild)
|
|
);
|
|
})(e, t))
|
|
);
|
|
})(e, r) && (r = r.prev),
|
|
!(!n || n !== r) && ("ul" === n.name || "ol" === n.name)
|
|
);
|
|
},
|
|
Az = function (e, o, i, t) {
|
|
function n(e) {
|
|
var t = _s.fromRangeStart(i),
|
|
n = oc(o.getRoot()),
|
|
r = 1 === e ? n.prev(t) : n.next(t);
|
|
return !r || Gw(o, r.getNode()) !== a;
|
|
}
|
|
var r = (function (e, t, n) {
|
|
var r = t.serialize(n);
|
|
return (function (e) {
|
|
var t = e.firstChild,
|
|
n = e.lastChild;
|
|
return (
|
|
t && "META" === t.nodeName && t.parentNode.removeChild(t),
|
|
n && "mce_marker" === n.id && n.parentNode.removeChild(n),
|
|
e
|
|
);
|
|
})(e.createFragment(r));
|
|
})(o, e, t),
|
|
a = Gw(o, i.startContainer),
|
|
u = Yw(Kw(r.firstChild)),
|
|
s = o.getRoot();
|
|
return n(1)
|
|
? Qw(a, u, s)
|
|
: n(2)
|
|
? (function (e, t, n, r) {
|
|
return r.insertAfter(t.reverse(), e), Jw(t[0], n);
|
|
})(a, u, s, o)
|
|
: (function (t, e, n, r) {
|
|
var o = (function (e, t) {
|
|
var n = t.cloneRange(),
|
|
r = t.cloneRange();
|
|
return (
|
|
n.setStartBefore(e),
|
|
r.setEndAfter(e),
|
|
[n.cloneContents(), r.cloneContents()]
|
|
);
|
|
})(t, r),
|
|
i = t.parentNode;
|
|
return (
|
|
i.insertBefore(o[0], t),
|
|
Rn.each(e, function (e) {
|
|
i.insertBefore(e, t);
|
|
}),
|
|
i.insertBefore(o[1], t),
|
|
i.removeChild(t),
|
|
Jw(e[e.length - 1], n)
|
|
);
|
|
})(a, u, s, i);
|
|
},
|
|
Mz = function (e, t) {
|
|
return !!Gw(e, t);
|
|
},
|
|
Rz = Ge.matchNodeNames(["td", "th"]),
|
|
Dz = function (e, t) {
|
|
var n = (function (e) {
|
|
var t;
|
|
return "string" != typeof e
|
|
? ((t = Rn.extend({ paste: e.paste, data: { paste: e.paste } }, e)),
|
|
{ content: e.content, details: t })
|
|
: { content: e, details: {} };
|
|
})(t);
|
|
ex(e, n.content, n.details);
|
|
},
|
|
_z = function (e) {
|
|
Yx(e, !1) ||
|
|
_x(e, !1) ||
|
|
Bx(e, !1) ||
|
|
Hx(e, !1) ||
|
|
kx(e, !1) ||
|
|
Ux(e) ||
|
|
Tx(e, !1) ||
|
|
Px(e, !1) ||
|
|
(tx(e, "Delete"), zx(e));
|
|
},
|
|
Oz = function (e) {
|
|
_x(e, !0) ||
|
|
Bx(e, !0) ||
|
|
Hx(e, !0) ||
|
|
kx(e, !0) ||
|
|
Ux(e) ||
|
|
Tx(e, !0) ||
|
|
Px(e, !0) ||
|
|
tx(e, "ForwardDelete");
|
|
},
|
|
Bz = { "font-size": "size", "font-family": "face" },
|
|
Hz = {
|
|
getFontSize: ox("font-size"),
|
|
getFontFamily: q(function (e) {
|
|
return e.replace(/[\'\"\\]/g, "").replace(/,\s+/g, ",");
|
|
}, ox("font-family")),
|
|
toPt: function (e, t) {
|
|
return /[0-9.]+px$/.test(e)
|
|
? (function (e, t) {
|
|
var n = Math.pow(10, t);
|
|
return Math.round(e * n) / n;
|
|
})((72 * parseInt(e, 10)) / 96, t || 0) + "pt"
|
|
: e;
|
|
},
|
|
},
|
|
Pz = Rn.each,
|
|
Lz = Rn.map,
|
|
Vz = Rn.inArray,
|
|
Iz =
|
|
((Fz.prototype.execCommand = function (t, n, r, e) {
|
|
var o,
|
|
i,
|
|
a = !1,
|
|
u = this;
|
|
if (!u.editor.removed) {
|
|
if (
|
|
(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(
|
|
t,
|
|
) ||
|
|
(e && e.skip_focus)
|
|
? Qf(u.editor)
|
|
: u.editor.focus(),
|
|
(e = u.editor.fire("BeforeExecCommand", {
|
|
command: t,
|
|
ui: n,
|
|
value: r,
|
|
})).isDefaultPrevented())
|
|
)
|
|
return !1;
|
|
if (((i = t.toLowerCase()), (o = u.commands.exec[i])))
|
|
return (
|
|
o(i, n, r),
|
|
u.editor.fire("ExecCommand", { command: t, ui: n, value: r }),
|
|
!0
|
|
);
|
|
if (
|
|
(Pz(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 (s) {}
|
|
return (
|
|
!!a &&
|
|
(u.editor.fire("ExecCommand", { command: t, ui: n, value: r }), !0)
|
|
);
|
|
}
|
|
}),
|
|
(Fz.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 (n) {}
|
|
return !1;
|
|
}
|
|
}),
|
|
(Fz.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 (n) {}
|
|
}
|
|
}),
|
|
(Fz.prototype.addCommands = function (e, n) {
|
|
var r = this;
|
|
(n = n || "exec"),
|
|
Pz(e, function (t, e) {
|
|
Pz(e.toLowerCase().split(","), function (e) {
|
|
r.commands[n][e] = t;
|
|
});
|
|
});
|
|
}),
|
|
(Fz.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);
|
|
});
|
|
}),
|
|
(Fz.prototype.queryCommandSupported = function (e) {
|
|
if (((e = e.toLowerCase()), this.commands.exec[e])) return !0;
|
|
try {
|
|
return this.editor.getDoc().queryCommandSupported(e);
|
|
} catch (t) {}
|
|
return !1;
|
|
}),
|
|
(Fz.prototype.addQueryStateHandler = function (e, t, n) {
|
|
var r = this;
|
|
(e = e.toLowerCase()),
|
|
(this.commands.state[e] = function () {
|
|
return t.call(n || r.editor);
|
|
});
|
|
}),
|
|
(Fz.prototype.addQueryValueHandler = function (e, t, n) {
|
|
var r = this;
|
|
(e = e.toLowerCase()),
|
|
(this.commands.value[e] = function () {
|
|
return t.call(n || r.editor);
|
|
});
|
|
}),
|
|
(Fz.prototype.hasCustomCommand = function (e) {
|
|
return (e = e.toLowerCase()), !!this.commands.exec[e];
|
|
}),
|
|
(Fz.prototype.execNativeCommand = function (e, t, n) {
|
|
return (
|
|
t === undefined && (t = !1),
|
|
n === undefined && (n = null),
|
|
this.editor.getDoc().execCommand(e, t, n)
|
|
);
|
|
}),
|
|
(Fz.prototype.isFormatMatch = function (e) {
|
|
return this.editor.formatter.match(e);
|
|
}),
|
|
(Fz.prototype.toggleFormat = function (e, t) {
|
|
this.editor.formatter.toggle(e, t ? { value: t } : undefined),
|
|
this.editor.nodeChanged();
|
|
}),
|
|
(Fz.prototype.storeSelection = function (e) {
|
|
this.selectionBookmark = this.editor.selection.getBookmark(e);
|
|
}),
|
|
(Fz.prototype.restoreSelection = function () {
|
|
this.editor.selection.moveToBookmark(this.selectionBookmark);
|
|
}),
|
|
(Fz.prototype.setupCommands = function (i) {
|
|
var a = this;
|
|
function e(n) {
|
|
return function () {
|
|
var e = i.selection.isCollapsed()
|
|
? [i.dom.getParent(i.selection.getNode(), i.dom.isBlock)]
|
|
: i.selection.getSelectedBlocks(),
|
|
t = Lz(e, function (e) {
|
|
return !!i.formatter.matchNode(e, n);
|
|
});
|
|
return -1 !== Vz(t, !0);
|
|
};
|
|
}
|
|
this.addCommands({
|
|
"mceResetDesignMode,mceBeginUndoLevel": function () {},
|
|
"mceEndUndoLevel,mceAddUndoLevel": function () {
|
|
i.undoManager.add();
|
|
},
|
|
"Cut,Copy,Paste": function (e) {
|
|
var t,
|
|
n = i.getDoc();
|
|
try {
|
|
a.execNativeCommand(e);
|
|
} catch (o) {
|
|
t = !0;
|
|
}
|
|
if (
|
|
("paste" !== e || n.queryCommandEnabled(e) || (t = !0),
|
|
t || !n.queryCommandSupported(e))
|
|
) {
|
|
var r = i.translate(
|
|
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.",
|
|
);
|
|
Sn.mac && (r = r.replace(/Ctrl\+/g, "\u2318+")),
|
|
i.notificationManager.open({ text: r, type: "error" });
|
|
}
|
|
},
|
|
unlink: function () {
|
|
if (i.selection.isCollapsed()) {
|
|
var e = i.dom.getParent(i.selection.getStart(), "a");
|
|
e && i.dom.remove(e, !0);
|
|
} else i.formatter.remove("link");
|
|
},
|
|
"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":
|
|
function (e) {
|
|
var t = e.substring(7);
|
|
"full" === t && (t = "justify"),
|
|
Pz("left,center,right,justify".split(","), function (e) {
|
|
t !== e && i.formatter.remove("align" + e);
|
|
}),
|
|
"none" !== t && a.toggleFormat("align" + t);
|
|
},
|
|
"InsertUnorderedList,InsertOrderedList": function (e) {
|
|
var t, n;
|
|
a.execNativeCommand(e),
|
|
(t = i.dom.getParent(i.selection.getNode(), "ol,ul")) &&
|
|
((n = t.parentNode),
|
|
/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName) &&
|
|
(a.storeSelection(),
|
|
i.dom.split(n, t),
|
|
a.restoreSelection()));
|
|
},
|
|
"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":
|
|
function (e) {
|
|
a.toggleFormat(e);
|
|
},
|
|
"ForeColor,HiliteColor": function (e, t, n) {
|
|
a.toggleFormat(e, n);
|
|
},
|
|
FontName: function (e, t, n) {
|
|
sx(i, n);
|
|
},
|
|
FontSize: function (e, t, n) {
|
|
!(function (e, t) {
|
|
e.formatter.toggle("fontsize", { value: ux(e, t) }),
|
|
e.nodeChanged();
|
|
})(i, n);
|
|
},
|
|
RemoveFormat: function (e) {
|
|
i.formatter.remove(e);
|
|
},
|
|
mceBlockQuote: function () {
|
|
a.toggleFormat("blockquote");
|
|
},
|
|
FormatBlock: function (e, t, n) {
|
|
return a.toggleFormat(n || "p");
|
|
},
|
|
mceCleanup: function () {
|
|
var e = i.selection.getBookmark();
|
|
i.setContent(i.getContent()), i.selection.moveToBookmark(e);
|
|
},
|
|
mceRemoveNode: function (e, t, n) {
|
|
var r = n || i.selection.getNode();
|
|
r !== i.getBody() &&
|
|
(a.storeSelection(), i.dom.remove(r, !0), a.restoreSelection());
|
|
},
|
|
mceSelectNodeDepth: function (e, t, n) {
|
|
var r = 0;
|
|
i.dom.getParent(
|
|
i.selection.getNode(),
|
|
function (e) {
|
|
if (1 === e.nodeType && r++ === n)
|
|
return i.selection.select(e), !1;
|
|
},
|
|
i.getBody(),
|
|
);
|
|
},
|
|
mceSelectNode: function (e, t, n) {
|
|
i.selection.select(n);
|
|
},
|
|
mceInsertContent: function (e, t, n) {
|
|
Dz(i, n);
|
|
},
|
|
mceInsertRawHTML: function (e, t, n) {
|
|
i.selection.setContent("tiny_mce_marker");
|
|
var r = i.getContent();
|
|
i.setContent(
|
|
r.replace(/tiny_mce_marker/g, function () {
|
|
return n;
|
|
}),
|
|
);
|
|
},
|
|
mceInsertNewLine: function (e, t, n) {
|
|
lz(i, n);
|
|
},
|
|
mceToggleFormat: function (e, t, n) {
|
|
a.toggleFormat(n);
|
|
},
|
|
mceSetContent: function (e, t, n) {
|
|
i.setContent(n);
|
|
},
|
|
"Indent,Outdent": function (e) {
|
|
OC(i, e);
|
|
},
|
|
mceRepaint: function () {},
|
|
InsertHorizontalRule: function () {
|
|
i.execCommand("mceInsertContent", !1, "<hr />");
|
|
},
|
|
mceToggleVisualAid: function () {
|
|
(i.hasVisual = !i.hasVisual), i.addVisual();
|
|
},
|
|
mceReplaceContent: function (e, t, n) {
|
|
i.execCommand(
|
|
"mceInsertContent",
|
|
!1,
|
|
n.replace(
|
|
/\{\$selection\}/g,
|
|
i.selection.getContent({ format: "text" }),
|
|
),
|
|
);
|
|
},
|
|
mceInsertLink: function (e, t, n) {
|
|
var r;
|
|
"string" == typeof n && (n = { href: n }),
|
|
(r = i.dom.getParent(i.selection.getNode(), "a")),
|
|
(n.href = n.href.replace(/ /g, "%20")),
|
|
(r && n.href) || i.formatter.remove("link"),
|
|
n.href && i.formatter.apply("link", n, r);
|
|
},
|
|
selectAll: function () {
|
|
var e = i.dom.getParent(
|
|
i.selection.getStart(),
|
|
Ge.isContentEditableTrue,
|
|
);
|
|
if (e) {
|
|
var t = i.dom.createRng();
|
|
t.selectNodeContents(e), i.selection.setRng(t);
|
|
}
|
|
},
|
|
delete: function () {
|
|
_z(i);
|
|
},
|
|
forwardDelete: function () {
|
|
Oz(i);
|
|
},
|
|
mceNewDocument: function () {
|
|
i.setContent("");
|
|
},
|
|
InsertLineBreak: function (e, t, n) {
|
|
return iz(i, n), !0;
|
|
},
|
|
}),
|
|
a.addCommands(
|
|
{
|
|
JustifyLeft: e("alignleft"),
|
|
JustifyCenter: e("aligncenter"),
|
|
JustifyRight: e("alignright"),
|
|
JustifyFull: e("alignjustify"),
|
|
"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":
|
|
function (e) {
|
|
return a.isFormatMatch(e);
|
|
},
|
|
mceBlockQuote: function () {
|
|
return a.isFormatMatch("blockquote");
|
|
},
|
|
Outdent: function () {
|
|
return DC(i);
|
|
},
|
|
"InsertUnorderedList,InsertOrderedList": function (e) {
|
|
var t = i.dom.getParent(i.selection.getNode(), "ul,ol");
|
|
return (
|
|
t &&
|
|
(("insertunorderedlist" === e && "UL" === t.tagName) ||
|
|
("insertorderedlist" === e && "OL" === t.tagName))
|
|
);
|
|
},
|
|
},
|
|
"state",
|
|
),
|
|
a.addCommands({
|
|
Undo: function () {
|
|
i.undoManager.undo();
|
|
},
|
|
Redo: function () {
|
|
i.undoManager.redo();
|
|
},
|
|
}),
|
|
a.addQueryValueHandler(
|
|
"FontName",
|
|
function () {
|
|
return (function (t) {
|
|
return ax(t).fold(
|
|
function () {
|
|
return ix(t)
|
|
.map(function (e) {
|
|
return Hz.getFontFamily(t.getBody(), e);
|
|
})
|
|
.getOr("");
|
|
},
|
|
function (e) {
|
|
return Hz.getFontFamily(t.getBody(), e);
|
|
},
|
|
);
|
|
})(i);
|
|
},
|
|
this,
|
|
),
|
|
a.addQueryValueHandler(
|
|
"FontSize",
|
|
function () {
|
|
return (function (t) {
|
|
return ax(t).fold(
|
|
function () {
|
|
return ix(t)
|
|
.map(function (e) {
|
|
return Hz.getFontSize(t.getBody(), e);
|
|
})
|
|
.getOr("");
|
|
},
|
|
function (e) {
|
|
return Hz.getFontSize(t.getBody(), e);
|
|
},
|
|
);
|
|
})(i);
|
|
},
|
|
this,
|
|
);
|
|
}),
|
|
Fz);
|
|
function Fz(e) {
|
|
(this.commands = { state: {}, exec: {}, value: {} }),
|
|
(this.editor = e),
|
|
this.setupCommands(e);
|
|
}
|
|
var Uz = Rn.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",
|
|
" ",
|
|
),
|
|
jz =
|
|
((qz.isNative = function (e) {
|
|
return !!Uz[e.toLowerCase()];
|
|
}),
|
|
(qz.prototype.fire = function (e, t) {
|
|
var n, r, o, i;
|
|
if (
|
|
((e = e.toLowerCase()),
|
|
((t = t || {}).type = e),
|
|
t.target || (t.target = this.scope),
|
|
t.preventDefault ||
|
|
((t.preventDefault = function () {
|
|
t.isDefaultPrevented = a;
|
|
}),
|
|
(t.stopPropagation = function () {
|
|
t.isPropagationStopped = a;
|
|
}),
|
|
(t.stopImmediatePropagation = function () {
|
|
t.isImmediatePropagationStopped = a;
|
|
}),
|
|
(t.isDefaultPrevented = c),
|
|
(t.isPropagationStopped = c),
|
|
(t.isImmediatePropagationStopped = c)),
|
|
this.settings.beforeFire && this.settings.beforeFire(t),
|
|
(n = this.bindings[e]))
|
|
)
|
|
for (r = 0, o = n.length; r < o; r++) {
|
|
if (
|
|
((i = n[r]).once && this.off(e, i.func),
|
|
t.isImmediatePropagationStopped())
|
|
)
|
|
return t.stopPropagation(), t;
|
|
if (!1 === i.func.call(this.scope, t)) return t.preventDefault(), t;
|
|
}
|
|
return t;
|
|
}),
|
|
(qz.prototype.on = function (e, t, n, r) {
|
|
var o, i, a;
|
|
if ((!1 === t && (t = c), t)) {
|
|
var u = { func: t };
|
|
for (
|
|
r && Rn.extend(u, r), a = (i = e.toLowerCase().split(" ")).length;
|
|
a--;
|
|
|
|
)
|
|
(e = i[a]),
|
|
(o = this.bindings[e]) ||
|
|
((o = this.bindings[e] = []), this.toggleEvent(e, !0)),
|
|
n ? o.unshift(u) : o.push(u);
|
|
}
|
|
return this;
|
|
}),
|
|
(qz.prototype.off = function (e, t) {
|
|
var n, r, o, i, a;
|
|
if (e)
|
|
for (n = (i = e.toLowerCase().split(" ")).length; n--; ) {
|
|
if (((e = i[n]), (r = this.bindings[e]), !e)) {
|
|
for (o in this.bindings)
|
|
this.toggleEvent(o, !1), delete this.bindings[o];
|
|
return this;
|
|
}
|
|
if (r) {
|
|
if (t)
|
|
for (a = r.length; a--; )
|
|
r[a].func === t &&
|
|
((r = r.slice(0, a).concat(r.slice(a + 1))),
|
|
(this.bindings[e] = r));
|
|
else r.length = 0;
|
|
r.length || (this.toggleEvent(e, !1), delete this.bindings[e]);
|
|
}
|
|
}
|
|
else {
|
|
for (e in this.bindings) this.toggleEvent(e, !1);
|
|
this.bindings = {};
|
|
}
|
|
return this;
|
|
}),
|
|
(qz.prototype.once = function (e, t, n) {
|
|
return this.on(e, t, n, { once: !0 });
|
|
}),
|
|
(qz.prototype.has = function (e) {
|
|
return (
|
|
(e = e.toLowerCase()),
|
|
!(!this.bindings[e] || 0 === this.bindings[e].length)
|
|
);
|
|
}),
|
|
qz);
|
|
function qz(e) {
|
|
(this.bindings = {}),
|
|
(this.settings = e || {}),
|
|
(this.scope = this.settings.scope || this),
|
|
(this.toggleEvent = this.settings.toggleEvent || c);
|
|
}
|
|
function $z(n) {
|
|
return (
|
|
n._eventDispatcher ||
|
|
(n._eventDispatcher = new jz({
|
|
scope: n,
|
|
toggleEvent: function (e, t) {
|
|
jz.isNative(e) && n.toggleNativeEvent && n.toggleNativeEvent(e, t);
|
|
},
|
|
})),
|
|
n._eventDispatcher
|
|
);
|
|
}
|
|
function Wz(e, t, n) {
|
|
ma(e, t) && !1 === n
|
|
? (function (e, t) {
|
|
ca(e) ? e.dom().classList.remove(t) : fa(e, t);
|
|
ha(e);
|
|
})(e, t)
|
|
: n && da(e, t);
|
|
}
|
|
function Kz(e, t, n) {
|
|
try {
|
|
e.getDoc().execCommand(t, !1, n);
|
|
} catch (r) {}
|
|
}
|
|
function Xz(e, t) {
|
|
e.dom().contentEditable = t ? "true" : "false";
|
|
}
|
|
function Yz(e, t) {
|
|
var n = bt.fromDom(e.getBody());
|
|
Wz(n, "mce-content-readonly", t),
|
|
t
|
|
? (e.selection.controlSelection.hideResizeRect(),
|
|
e._selectionOverrides.hideFakeCaret(),
|
|
(function (e) {
|
|
k.from(e.selection.getNode()).each(function (e) {
|
|
e.removeAttribute("data-mce-selected");
|
|
});
|
|
})(e),
|
|
(e.readonly = !0),
|
|
Xz(n, !1),
|
|
(function (e) {
|
|
z(ga(e, '*[contenteditable="true"]'), function (e) {
|
|
At(e, iE, "true"), Xz(e, !1);
|
|
});
|
|
})(n))
|
|
: ((e.readonly = !1),
|
|
Xz(n, !0),
|
|
(function (e) {
|
|
z(ga(e, "*[" + iE + '="true"]'), function (e) {
|
|
pe(e, iE), Xz(e, !0);
|
|
});
|
|
})(n),
|
|
Kz(e, "StyleWithCSS", !1),
|
|
Kz(e, "enableInlineTableEditing", !1),
|
|
Kz(e, "enableObjectResizing", !1),
|
|
cd(e) && e.focus(),
|
|
(function (e) {
|
|
e.selection.setRng(e.selection.getRng());
|
|
})(e),
|
|
e.nodeChanged());
|
|
}
|
|
function Gz(e) {
|
|
return !0 === e.readonly;
|
|
}
|
|
function Jz(t) {
|
|
t.parser.addAttributeFilter("contenteditable", function (e) {
|
|
Gz(t) &&
|
|
z(e, function (e) {
|
|
e.attr(iE, e.attr("contenteditable")),
|
|
e.attr("contenteditable", "false");
|
|
});
|
|
}),
|
|
t.serializer.addAttributeFilter(iE, function (e) {
|
|
Gz(t) &&
|
|
z(e, function (e) {
|
|
e.attr("contenteditable", e.attr(iE));
|
|
});
|
|
}),
|
|
t.serializer.addTempAttr(iE);
|
|
}
|
|
function Qz(e, t) {
|
|
return "selectionchange" === t
|
|
? e.getDoc()
|
|
: !e.inline &&
|
|
/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)
|
|
? e.getDoc().documentElement
|
|
: e.settings.event_root
|
|
? (e.eventRoot || (e.eventRoot = aE.select(e.settings.event_root)[0]),
|
|
e.eventRoot)
|
|
: e.getBody();
|
|
}
|
|
function Zz(e, t, n) {
|
|
!(function (e) {
|
|
return !e.hidden && !Gz(e);
|
|
})(e)
|
|
? Gz(e) &&
|
|
(function (e, t) {
|
|
var n = t.target;
|
|
!(function (e) {
|
|
return "click" === e.type;
|
|
})(t) ||
|
|
Mh.metaKeyPressed(t) ||
|
|
!(function (e, t) {
|
|
return null !== e.dom.getParent(t, "a");
|
|
})(e, n) ||
|
|
t.preventDefault();
|
|
})(e, n)
|
|
: e.fire(t, n);
|
|
}
|
|
function eE(i, a) {
|
|
var e, t;
|
|
if ((i.delegates || (i.delegates = {}), !i.delegates[a] && !i.removed))
|
|
if (((e = Qz(i, a)), i.settings.event_root)) {
|
|
if (
|
|
(rE ||
|
|
((rE = {}),
|
|
i.editorManager.on("removeEditor", function () {
|
|
var e;
|
|
if (!i.editorManager.activeEditor && rE) {
|
|
for (e in rE) i.dom.unbind(Qz(i, e));
|
|
rE = null;
|
|
}
|
|
})),
|
|
rE[a])
|
|
)
|
|
return;
|
|
(t = function (e) {
|
|
for (
|
|
var t = e.target, n = i.editorManager.get(), r = n.length;
|
|
r--;
|
|
|
|
) {
|
|
var o = n[r].getBody();
|
|
(o !== t && !aE.isChildOf(t, o)) || Zz(n[r], a, e);
|
|
}
|
|
}),
|
|
(rE[a] = t),
|
|
aE.bind(e, a, t);
|
|
} else
|
|
(t = function (e) {
|
|
Zz(i, a, e);
|
|
}),
|
|
aE.bind(e, a, t),
|
|
(i.delegates[a] = t);
|
|
}
|
|
function tE(e, t, n, r) {
|
|
var o = n[t.get()],
|
|
i = n[r];
|
|
try {
|
|
i.activate();
|
|
} catch (xN) {
|
|
return void j.console.error(
|
|
"problem while activating editor mode " + r + ":",
|
|
xN,
|
|
);
|
|
}
|
|
o.deactivate(),
|
|
o.editorReadOnly !== i.editorReadOnly && Yz(e, i.editorReadOnly),
|
|
t.set(r),
|
|
md(e, r);
|
|
}
|
|
function nE(t) {
|
|
var n = Je("design"),
|
|
r = Je({
|
|
design: { activate: i, deactivate: i, editorReadOnly: !1 },
|
|
readonly: { activate: i, deactivate: i, editorReadOnly: !0 },
|
|
});
|
|
return (
|
|
(function (e) {
|
|
e.serializer
|
|
? Jz(e)
|
|
: e.on("PreInit", function () {
|
|
Jz(e);
|
|
});
|
|
})(t),
|
|
(function (t) {
|
|
t.on("ShowCaret", function (e) {
|
|
Gz(t) && e.preventDefault();
|
|
}),
|
|
t.on("ObjectSelected", function (e) {
|
|
Gz(t) && e.preventDefault();
|
|
});
|
|
})(t),
|
|
{
|
|
isReadOnly: function () {
|
|
return Gz(t);
|
|
},
|
|
set: function (e) {
|
|
return (function (e, t, n, r) {
|
|
if (r !== n.get()) {
|
|
if (!Tt(t, r))
|
|
throw new Error("Editor mode '" + r + "' is invalid");
|
|
e.initialized
|
|
? tE(e, n, t, r)
|
|
: e.on("init", function () {
|
|
return tE(e, n, t, r);
|
|
});
|
|
}
|
|
})(t, r.get(), n, e);
|
|
},
|
|
get: function () {
|
|
return n.get();
|
|
},
|
|
register: function (e, t) {
|
|
r.set(
|
|
(function (e, t, n) {
|
|
var r;
|
|
if (h(sE, t))
|
|
throw new Error("Cannot override default mode " + t);
|
|
return G(
|
|
G({}, e),
|
|
(((r = {})[t] = G(G({}, n), {
|
|
deactivate: function () {
|
|
try {
|
|
n.deactivate();
|
|
} catch (xN) {
|
|
j.console.error(
|
|
"problem while deactivating editor mode " + t + ":",
|
|
xN,
|
|
);
|
|
}
|
|
},
|
|
})),
|
|
r),
|
|
);
|
|
})(r.get(), e, t),
|
|
);
|
|
},
|
|
}
|
|
);
|
|
}
|
|
var rE,
|
|
oE = {
|
|
fire: function (e, t, n) {
|
|
if (this.removed && "remove" !== e && "detach" !== e) return t;
|
|
var r = $z(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 $z(this).on(e, t, n);
|
|
},
|
|
off: function (e, t) {
|
|
return $z(this).off(e, t);
|
|
},
|
|
once: function (e, t) {
|
|
return $z(this).once(e, t);
|
|
},
|
|
hasEventListeners: function (e) {
|
|
return $z(this).has(e);
|
|
},
|
|
},
|
|
iE = "data-mce-contenteditable",
|
|
aE = Yi.DOM,
|
|
uE = G(G({}, oE), {
|
|
bindPendingEventDelegates: function () {
|
|
var t = this;
|
|
Rn.each(t._pendingNativeEvents, function (e) {
|
|
eE(t, e);
|
|
});
|
|
},
|
|
toggleNativeEvent: function (e, t) {
|
|
var n = this;
|
|
"focus" !== e &&
|
|
"blur" !== e &&
|
|
(t
|
|
? n.initialized
|
|
? eE(n, e)
|
|
: n._pendingNativeEvents
|
|
? n._pendingNativeEvents.push(e)
|
|
: (n._pendingNativeEvents = [e])
|
|
: n.initialized &&
|
|
(n.dom.unbind(Qz(n, e), e, n.delegates[e]),
|
|
delete n.delegates[e]));
|
|
},
|
|
unbindAllNativeEvents: function () {
|
|
var e,
|
|
t = this,
|
|
n = t.getBody(),
|
|
r = t.dom;
|
|
if (t.delegates) {
|
|
for (e in t.delegates) t.dom.unbind(Qz(t, e), e, t.delegates[e]);
|
|
delete t.delegates;
|
|
}
|
|
!t.inline &&
|
|
n &&
|
|
r &&
|
|
((n.onload = null), r.unbind(t.getWin()), r.unbind(t.getDoc())),
|
|
r && (r.unbind(n), r.unbind(t.getContainer()));
|
|
},
|
|
}),
|
|
sE = ["design", "readonly"],
|
|
cE = Rn.each,
|
|
lE = Rn.explode,
|
|
fE = {
|
|
f1: 112,
|
|
f2: 113,
|
|
f3: 114,
|
|
f4: 115,
|
|
f5: 116,
|
|
f6: 117,
|
|
f7: 118,
|
|
f8: 119,
|
|
f9: 120,
|
|
f10: 121,
|
|
f11: 122,
|
|
f12: 123,
|
|
},
|
|
dE = Rn.makeMap("alt,ctrl,shift,meta,access"),
|
|
hE =
|
|
((mE.prototype.add = function (e, n, r, o) {
|
|
var t,
|
|
i = this;
|
|
return (
|
|
"string" == typeof (t = r)
|
|
? (r = function () {
|
|
i.editor.execCommand(t, !1, null);
|
|
})
|
|
: Rn.isArray(t) &&
|
|
(r = function () {
|
|
i.editor.execCommand(t[0], t[1], t[2]);
|
|
}),
|
|
cE(lE(Rn.trim(e)), function (e) {
|
|
var t = i.createShortcut(e, n, r, o);
|
|
i.shortcuts[t.id] = t;
|
|
}),
|
|
!0
|
|
);
|
|
}),
|
|
(mE.prototype.remove = function (e) {
|
|
var t = this.createShortcut(e);
|
|
return !!this.shortcuts[t.id] && (delete this.shortcuts[t.id], !0);
|
|
}),
|
|
(mE.prototype.parseShortcut = function (e) {
|
|
var t,
|
|
n,
|
|
r = {};
|
|
for (n in (cE(lE(e.toLowerCase(), "+"), function (e) {
|
|
e in dE
|
|
? (r[e] = !0)
|
|
: /^[0-9]{2,}$/.test(e)
|
|
? (r.keyCode = parseInt(e, 10))
|
|
: ((r.charCode = e.charCodeAt(0)),
|
|
(r.keyCode = fE[e] || e.toUpperCase().charCodeAt(0)));
|
|
}),
|
|
(t = [r.keyCode]),
|
|
dE))
|
|
r[n] ? t.push(n) : (r[n] = !1);
|
|
return (
|
|
(r.id = t.join(",")),
|
|
r.access && ((r.alt = !0), Sn.mac ? (r.ctrl = !0) : (r.shift = !0)),
|
|
r.meta && (Sn.mac ? (r.meta = !0) : ((r.ctrl = !0), (r.meta = !1))),
|
|
r
|
|
);
|
|
}),
|
|
(mE.prototype.createShortcut = function (e, t, n, r) {
|
|
var o;
|
|
return (
|
|
((o = Rn.map(lE(e, ">"), this.parseShortcut))[o.length - 1] =
|
|
Rn.extend(o[o.length - 1], { func: n, scope: r || this.editor })),
|
|
Rn.extend(o[0], {
|
|
desc: this.editor.translate(t),
|
|
subpatterns: o.slice(1),
|
|
})
|
|
);
|
|
}),
|
|
(mE.prototype.hasModifier = function (e) {
|
|
return e.altKey || e.ctrlKey || e.metaKey;
|
|
}),
|
|
(mE.prototype.isFunctionKey = function (e) {
|
|
return "keydown" === e.type && 112 <= e.keyCode && e.keyCode <= 123;
|
|
}),
|
|
(mE.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)
|
|
);
|
|
}),
|
|
(mE.prototype.executeShortcutAction = function (e) {
|
|
return e.func ? e.func.call(e.scope) : null;
|
|
}),
|
|
mE);
|
|
function mE(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() ||
|
|
(cE(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()));
|
|
});
|
|
}
|
|
function gE() {
|
|
var e = (function () {
|
|
function e(n, r) {
|
|
return function (e, t) {
|
|
return (n[e.toLowerCase()] = G(G({}, t), { type: r }));
|
|
};
|
|
}
|
|
var t = {},
|
|
n = {},
|
|
r = {},
|
|
o = {},
|
|
i = {},
|
|
a = {},
|
|
u = {};
|
|
return {
|
|
addButton: e(t, "button"),
|
|
addToggleButton: e(t, "togglebutton"),
|
|
addMenuButton: e(t, "menubutton"),
|
|
addSplitButton: e(t, "splitbutton"),
|
|
addMenuItem: e(n, "menuitem"),
|
|
addNestedMenuItem: e(n, "nestedmenuitem"),
|
|
addToggleMenuItem: e(n, "togglemenuitem"),
|
|
addAutocompleter: e(r, "autocompleter"),
|
|
addContextMenu: e(i, "contextmenu"),
|
|
addContextToolbar: e(a, "contexttoolbar"),
|
|
addContextForm: e(a, "contextform"),
|
|
addSidebar: e(u, "sidebar"),
|
|
addIcon: function (e, t) {
|
|
return (o[e.toLowerCase()] = t);
|
|
},
|
|
getAll: function () {
|
|
return {
|
|
buttons: t,
|
|
menuItems: n,
|
|
icons: o,
|
|
popups: r,
|
|
contextMenus: i,
|
|
contextToolbars: a,
|
|
sidebars: u,
|
|
};
|
|
},
|
|
};
|
|
})();
|
|
return {
|
|
addAutocompleter: e.addAutocompleter,
|
|
addButton: e.addButton,
|
|
addContextForm: e.addContextForm,
|
|
addContextMenu: e.addContextMenu,
|
|
addContextToolbar: e.addContextToolbar,
|
|
addIcon: e.addIcon,
|
|
addMenuButton: e.addMenuButton,
|
|
addMenuItem: e.addMenuItem,
|
|
addNestedMenuItem: e.addNestedMenuItem,
|
|
addSidebar: e.addSidebar,
|
|
addSplitButton: e.addSplitButton,
|
|
addToggleButton: e.addToggleButton,
|
|
addToggleMenuItem: e.addToggleMenuItem,
|
|
getAll: e.getAll,
|
|
};
|
|
}
|
|
var pE = Rn.each,
|
|
vE = Rn.trim,
|
|
yE =
|
|
"source protocol authority userInfo user password host port relative path directory file query anchor".split(
|
|
" ",
|
|
),
|
|
bE = { ftp: 21, http: 80, https: 443, mailto: 25 },
|
|
CE =
|
|
((wE.parseDataUri = function (e) {
|
|
var t,
|
|
n = decodeURIComponent(e).split(","),
|
|
r = /data:([^;]+)/.exec(n[0]);
|
|
return r && (t = r[1]), { type: t, data: n[1] };
|
|
}),
|
|
(wE.getDocumentBaseUrl = function (e) {
|
|
var t;
|
|
return (
|
|
(t =
|
|
0 !== e.protocol.indexOf("http") && "file:" !== e.protocol
|
|
? e.href
|
|
: e.protocol + "//" + e.host + e.pathname),
|
|
/^[^:]+:\/\/\/?[^\/]+\//.test(t) &&
|
|
((t = t.replace(/[\?#].*$/, "").replace(/[\/\\][^\/]+$/, "")),
|
|
/[\/\\]$/.test(t) || (t += "/")),
|
|
t
|
|
);
|
|
}),
|
|
(wE.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();
|
|
}),
|
|
(wE.prototype.toRelative = function (e) {
|
|
var t;
|
|
if ("./" === e) return e;
|
|
var n = new wE(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);
|
|
}),
|
|
(wE.prototype.toAbsolute = function (e, t) {
|
|
var n = new wE(e, { base_uri: this });
|
|
return n.getURI(t && this.isSameOrigin(n));
|
|
}),
|
|
(wE.prototype.isSameOrigin = function (e) {
|
|
if (this.host == e.host && this.protocol == e.protocol) {
|
|
if (this.port == e.port) return !0;
|
|
var t = bE[this.protocol];
|
|
if (t && (this.port || t) == (e.port || t)) return !0;
|
|
}
|
|
return !1;
|
|
}),
|
|
(wE.prototype.toRelPath = function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i = 0,
|
|
a = "",
|
|
u = e.substring(0, e.lastIndexOf("/")).split("/");
|
|
if (((n = t.split("/")), u.length >= n.length))
|
|
for (r = 0, o = u.length; r < o; r++)
|
|
if (r >= n.length || u[r] !== n[r]) {
|
|
i = r + 1;
|
|
break;
|
|
}
|
|
if (u.length < n.length)
|
|
for (r = 0, o = n.length; r < o; r++)
|
|
if (r >= u.length || u[r] !== n[r]) {
|
|
i = r + 1;
|
|
break;
|
|
}
|
|
if (1 === i) return t;
|
|
for (r = 0, o = u.length - (i - 1); r < o; r++) a += "../";
|
|
for (r = i - 1, o = n.length; r < o; r++)
|
|
a += r !== i - 1 ? "/" + n[r] : n[r];
|
|
return a;
|
|
}),
|
|
(wE.prototype.toAbsPath = function (e, t) {
|
|
var n,
|
|
r,
|
|
o,
|
|
i = 0,
|
|
a = [];
|
|
r = /\/$/.test(t) ? "/" : "";
|
|
var u = e.split("/"),
|
|
s = t.split("/");
|
|
for (
|
|
pE(u, function (e) {
|
|
e && a.push(e);
|
|
}),
|
|
u = a,
|
|
n = s.length - 1,
|
|
a = [];
|
|
0 <= n;
|
|
n--
|
|
)
|
|
0 !== s[n].length &&
|
|
"." !== s[n] &&
|
|
(".." !== s[n] ? (0 < i ? i-- : a.push(s[n])) : i++);
|
|
return (
|
|
0 !==
|
|
(o =
|
|
(n = u.length - i) <= 0
|
|
? a.reverse().join("/")
|
|
: u.slice(0, n).join("/") +
|
|
"/" +
|
|
a.reverse().join("/")).indexOf("/") && (o = "/" + o),
|
|
r && o.lastIndexOf("/") !== o.length - 1 && (o += r),
|
|
o
|
|
);
|
|
}),
|
|
(wE.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
|
|
);
|
|
}),
|
|
wE);
|
|
function wE(e, t) {
|
|
(e = vE(e)), (this.settings = t || {});
|
|
var n = this.settings.base_uri,
|
|
r = this;
|
|
if (/^([\w\-]+):([^\/]{2})/i.test(e) || /^\s*#/.test(e)) r.source = e;
|
|
else {
|
|
var o = 0 === e.indexOf("//");
|
|
if (
|
|
(0 !== e.indexOf("/") ||
|
|
o ||
|
|
(e = ((n && n.protocol) || "http") + "://mce_host" + e),
|
|
!/^[\w\-]*:?\/\//.test(e))
|
|
) {
|
|
var i = this.settings.base_uri
|
|
? this.settings.base_uri.path
|
|
: new wE(j.document.location.href).directory;
|
|
if (this.settings.base_uri && "" == this.settings.base_uri.protocol)
|
|
e = "//mce_host" + r.toAbsPath(i, e);
|
|
else {
|
|
var a = /([^#?]*)([#?]?.*)/.exec(e);
|
|
e =
|
|
((n && n.protocol) || "http") +
|
|
"://mce_host" +
|
|
r.toAbsPath(i, a[1]) +
|
|
a[2];
|
|
}
|
|
}
|
|
e = e.replace(/@@/g, "(mce_at)");
|
|
var u =
|
|
/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(
|
|
e,
|
|
);
|
|
pE(yE, function (e, t) {
|
|
var n = u[t];
|
|
(n = n && n.replace(/\(mce_at\)/g, "@@")), (r[e] = n);
|
|
}),
|
|
n &&
|
|
(r.protocol || (r.protocol = n.protocol),
|
|
r.userInfo || (r.userInfo = n.userInfo),
|
|
r.port || "mce_host" !== r.host || (r.port = n.port),
|
|
(r.host && "mce_host" !== r.host) || (r.host = n.host),
|
|
(r.source = "")),
|
|
o && (r.protocol = "");
|
|
}
|
|
}
|
|
var xE = Yi.DOM,
|
|
zE = Rn.extend,
|
|
EE = Rn.each,
|
|
NE = Rn.resolve,
|
|
SE = Sn.ie,
|
|
kE =
|
|
((TE.prototype.render = function () {
|
|
kz(this);
|
|
}),
|
|
(TE.prototype.focus = function (e) {
|
|
ud(this, e);
|
|
}),
|
|
(TE.prototype.hasFocus = function () {
|
|
return sd(this);
|
|
}),
|
|
(TE.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+$/, "")) ? NE(r) : 0),
|
|
(o = NE(o)),
|
|
(this.callbackLookup = this.callbackLookup || {}),
|
|
(this.callbackLookup[e] = { func: o, scope: r })),
|
|
o.apply(r || this, Array.prototype.slice.call(arguments, 1))
|
|
);
|
|
}),
|
|
(TE.prototype.translate = function (e) {
|
|
return oa.translate(e);
|
|
}),
|
|
(TE.prototype.getParam = function (e, t, n) {
|
|
return tf(this, e, t, n);
|
|
}),
|
|
(TE.prototype.nodeChanged = function (e) {
|
|
this._nodeChangeDispatcher.nodeChanged(e);
|
|
}),
|
|
(TE.prototype.addCommand = function (e, t, n) {
|
|
this.editorCommands.addCommand(e, t, n);
|
|
}),
|
|
(TE.prototype.addQueryStateHandler = function (e, t, n) {
|
|
this.editorCommands.addQueryStateHandler(e, t, n);
|
|
}),
|
|
(TE.prototype.addQueryValueHandler = function (e, t, n) {
|
|
this.editorCommands.addQueryValueHandler(e, t, n);
|
|
}),
|
|
(TE.prototype.addShortcut = function (e, t, n, r) {
|
|
this.shortcuts.add(e, t, n, r);
|
|
}),
|
|
(TE.prototype.execCommand = function (e, t, n, r) {
|
|
return this.editorCommands.execCommand(e, t, n, r);
|
|
}),
|
|
(TE.prototype.queryCommandState = function (e) {
|
|
return this.editorCommands.queryCommandState(e);
|
|
}),
|
|
(TE.prototype.queryCommandValue = function (e) {
|
|
return this.editorCommands.queryCommandValue(e);
|
|
}),
|
|
(TE.prototype.queryCommandSupported = function (e) {
|
|
return this.editorCommands.queryCommandSupported(e);
|
|
}),
|
|
(TE.prototype.show = function () {
|
|
this.hidden &&
|
|
((this.hidden = !1),
|
|
this.inline
|
|
? (this.getBody().contentEditable = "true")
|
|
: (xE.show(this.getContainer()), xE.hide(this.id)),
|
|
this.load(),
|
|
this.fire("show"));
|
|
}),
|
|
(TE.prototype.hide = function () {
|
|
var e = this,
|
|
t = e.getDoc();
|
|
e.hidden ||
|
|
(SE && t && !e.inline && t.execCommand("SelectAll"),
|
|
e.save(),
|
|
e.inline
|
|
? ((e.getBody().contentEditable = "false"),
|
|
e === e.editorManager.focusedEditor &&
|
|
(e.editorManager.focusedEditor = null))
|
|
: (xE.hide(e.getContainer()),
|
|
xE.setStyle(e.id, "display", e.orgDisplay)),
|
|
(e.hidden = !0),
|
|
e.fire("hide"));
|
|
}),
|
|
(TE.prototype.isHidden = function () {
|
|
return !!this.hidden;
|
|
}),
|
|
(TE.prototype.setProgressState = function (e, t) {
|
|
this.fire("ProgressState", { state: e, time: t });
|
|
}),
|
|
(TE.prototype.load = function (e) {
|
|
var t,
|
|
n = this.getElement();
|
|
if (this.removed) return "";
|
|
if (n) {
|
|
(e = e || {}).load = !0;
|
|
var r = Ge.isTextareaOrInput(n) ? n.value : n.innerHTML;
|
|
return (
|
|
(t = this.setContent(r, e)),
|
|
(e.element = n),
|
|
e.no_events || this.fire("LoadContent", e),
|
|
(e.element = n = null),
|
|
t
|
|
);
|
|
}
|
|
}),
|
|
(TE.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),
|
|
Ge.isTextareaOrInput(o)
|
|
? (o.value = t)
|
|
: ((!e.is_removing && r.inline) || (o.innerHTML = t),
|
|
(n = xE.getParent(r.id, "form")) &&
|
|
EE(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
|
|
);
|
|
}),
|
|
(TE.prototype.setContent = function (e, t) {
|
|
return ql(this, e, t);
|
|
}),
|
|
(TE.prototype.getContent = function (e) {
|
|
return (function (t, n) {
|
|
return (
|
|
void 0 === n && (n = {}),
|
|
k
|
|
.from(t.getBody())
|
|
.fold(
|
|
$("tree" === n.format ? new sl("body", 11) : ""),
|
|
function (e) {
|
|
return gl(t, n, e);
|
|
},
|
|
)
|
|
);
|
|
})(this, e);
|
|
}),
|
|
(TE.prototype.insertContent = function (e, t) {
|
|
t && (e = zE({ content: e }, t)),
|
|
this.execCommand("mceInsertContent", !1, e);
|
|
}),
|
|
(TE.prototype.resetContent = function (e) {
|
|
e === undefined
|
|
? ql(this, this.startContent, { format: "raw" })
|
|
: ql(this, e),
|
|
this.undoManager.reset(),
|
|
this.setDirty(!1),
|
|
this.nodeChanged();
|
|
}),
|
|
(TE.prototype.isDirty = function () {
|
|
return !this.isNotDirty;
|
|
}),
|
|
(TE.prototype.setDirty = function (e) {
|
|
var t = !this.isNotDirty;
|
|
(this.isNotDirty = !e), e && e !== t && this.fire("dirty");
|
|
}),
|
|
(TE.prototype.getContainer = function () {
|
|
return (
|
|
this.container ||
|
|
(this.container = xE.get(
|
|
this.editorContainer || this.id + "_parent",
|
|
)),
|
|
this.container
|
|
);
|
|
}),
|
|
(TE.prototype.getContentAreaContainer = function () {
|
|
return this.contentAreaContainer;
|
|
}),
|
|
(TE.prototype.getElement = function () {
|
|
return (
|
|
this.targetElm || (this.targetElm = xE.get(this.id)), this.targetElm
|
|
);
|
|
}),
|
|
(TE.prototype.getWin = function () {
|
|
var e;
|
|
return (
|
|
this.contentWindow ||
|
|
((e = this.iframeElement) &&
|
|
(this.contentWindow = e.contentWindow)),
|
|
this.contentWindow
|
|
);
|
|
}),
|
|
(TE.prototype.getDoc = function () {
|
|
var e;
|
|
return (
|
|
this.contentDocument ||
|
|
((e = this.getWin()) && (this.contentDocument = e.document)),
|
|
this.contentDocument
|
|
);
|
|
}),
|
|
(TE.prototype.getBody = function () {
|
|
var e = this.getDoc();
|
|
return this.bodyElement || (e ? e.body : null);
|
|
}),
|
|
(TE.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)
|
|
: (e = this.documentBaseURI.toAbsolute(e, r.remove_script_host));
|
|
}),
|
|
(TE.prototype.addVisual = function (e) {
|
|
var n,
|
|
r = this,
|
|
o = r.settings,
|
|
i = r.dom;
|
|
(e = e || r.getBody()),
|
|
r.hasVisual === undefined && (r.hasVisual = o.visual),
|
|
EE(i.select("table,a", e), function (e) {
|
|
var t;
|
|
switch (e.nodeName) {
|
|
case "TABLE":
|
|
return (
|
|
(n = o.visual_table_class || "mce-item-table"),
|
|
void (((t = i.getAttrib(e, "border")) && "0" !== t) ||
|
|
!r.hasVisual
|
|
? i.removeClass(e, n)
|
|
: i.addClass(e, n))
|
|
);
|
|
case "A":
|
|
return void (
|
|
i.getAttrib(e, "href") ||
|
|
((t = i.getAttrib(e, "name") || e.id),
|
|
(n = o.visual_anchor_class || "mce-item-anchor"),
|
|
t && r.hasVisual ? i.addClass(e, n) : i.removeClass(e, n))
|
|
);
|
|
}
|
|
}),
|
|
r.fire("VisualAid", { element: e, hasVisual: r.hasVisual });
|
|
}),
|
|
(TE.prototype.remove = function () {
|
|
Wl(this);
|
|
}),
|
|
(TE.prototype.destroy = function (e) {
|
|
Kl(this, e);
|
|
}),
|
|
(TE.prototype.uploadImages = function (e) {
|
|
return this.editorUpload.uploadImages(e);
|
|
}),
|
|
(TE.prototype._scanForImages = function () {
|
|
return this.editorUpload.scanForImages();
|
|
}),
|
|
(TE.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",
|
|
);
|
|
}),
|
|
(TE.prototype.addSidebar = function () {
|
|
throw new Error(
|
|
"editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead",
|
|
);
|
|
}),
|
|
(TE.prototype.addMenuItem = function () {
|
|
throw new Error(
|
|
"editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead",
|
|
);
|
|
}),
|
|
(TE.prototype.addContextToolbar = function () {
|
|
throw new Error(
|
|
"editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead",
|
|
);
|
|
}),
|
|
TE);
|
|
function TE(e, t, n) {
|
|
var r = this;
|
|
(this.plugins = {}),
|
|
(this.contentCSS = []),
|
|
(this.contentStyles = []),
|
|
(this.loadedCSS = {}),
|
|
(this.isNotDirty = !1),
|
|
(this.editorManager = n),
|
|
(this.documentBaseUrl = n.documentBaseURL),
|
|
zE(this, uE),
|
|
(this.settings = Zl(this, e, this.documentBaseUrl, n.defaultSettings, t)),
|
|
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 &&
|
|
(Zi.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),
|
|
Yi.DOM.styleSheetLoader._setReferrerPolicy(
|
|
this.settings.referrer_policy,
|
|
)),
|
|
(pa.languageLoad = this.settings.language_load),
|
|
(pa.baseURL = n.baseURL),
|
|
(this.id = e),
|
|
this.setDirty(!1),
|
|
(this.documentBaseURI = new CE(this.settings.document_base_url, {
|
|
base_uri: this.baseUri,
|
|
})),
|
|
(this.baseURI = this.baseUri),
|
|
(this.inline = !!this.settings.inline),
|
|
(this.shortcuts = new hE(this)),
|
|
(this.editorCommands = new Iz(this)),
|
|
this.settings.cache_suffix &&
|
|
(Sn.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, "")),
|
|
(this.ui = { registry: gE() });
|
|
var o = nE(this);
|
|
(this.mode = o),
|
|
(this.setMode = o.set),
|
|
n.fire("SetupEditor", { editor: this }),
|
|
this.execCallback("setup", this),
|
|
(this.$ = yi.overrideDefaults(function () {
|
|
return {
|
|
context: r.inline ? r.getBody() : r.getDoc(),
|
|
element: r.getBody(),
|
|
};
|
|
}));
|
|
}
|
|
function AE(t) {
|
|
var n = t.type;
|
|
HE(jE.get(), function (e) {
|
|
switch (n) {
|
|
case "scroll":
|
|
e.fire("ScrollWindow", t);
|
|
break;
|
|
case "resize":
|
|
e.fire("ResizeWindow", t);
|
|
}
|
|
});
|
|
}
|
|
function ME(e) {
|
|
e !== VE &&
|
|
(e
|
|
? yi(window).on("resize scroll", AE)
|
|
: yi(window).off("resize scroll", AE),
|
|
(VE = e));
|
|
}
|
|
function RE(t) {
|
|
var e = FE;
|
|
delete IE[t.id];
|
|
for (var n = 0; n < IE.length; n++)
|
|
if (IE[n] === t) {
|
|
IE.splice(n, 1);
|
|
break;
|
|
}
|
|
return (
|
|
(FE = y(FE, function (e) {
|
|
return t !== e;
|
|
})),
|
|
jE.activeEditor === t && (jE.activeEditor = 0 < FE.length ? FE[0] : null),
|
|
jE.focusedEditor === t && (jE.focusedEditor = null),
|
|
e.length !== FE.length
|
|
);
|
|
}
|
|
var DE,
|
|
_E,
|
|
OE = Yi.DOM,
|
|
BE = Rn.explode,
|
|
HE = Rn.each,
|
|
PE = Rn.extend,
|
|
LE = 0,
|
|
VE = !1,
|
|
IE = [],
|
|
FE = [],
|
|
UE = "CSS1Compat" !== j.document.compatMode,
|
|
jE = G(G({}, oE), {
|
|
baseURI: null,
|
|
baseURL: null,
|
|
defaultSettings: {},
|
|
documentBaseURL: null,
|
|
suffix: null,
|
|
$: yi,
|
|
majorVersion: "5",
|
|
minorVersion: "1.6",
|
|
releaseDate: "2020-01-28",
|
|
editors: IE,
|
|
i18n: oa,
|
|
activeEditor: null,
|
|
focusedEditor: null,
|
|
settings: {},
|
|
setup: function () {
|
|
var e,
|
|
t,
|
|
n = "";
|
|
(t = CE.getDocumentBaseUrl(j.document.location)),
|
|
/^[^:]+:\/\/\/?[^\/]+\//.test(t) &&
|
|
((t = t.replace(/[\?#].*$/, "").replace(/[\/\\][^\/]+$/, "")),
|
|
/[\/\\]$/.test(t) || (t += "/"));
|
|
var r = window.tinymce || window.tinyMCEPreInit;
|
|
if (r) (e = r.base || r.baseURL), (n = r.suffix);
|
|
else {
|
|
for (
|
|
var o = j.document.getElementsByTagName("script"), i = 0;
|
|
i < o.length;
|
|
i++
|
|
) {
|
|
var a;
|
|
if ("" !== (a = o[i].src || "")) {
|
|
var u = a.substring(a.lastIndexOf("/"));
|
|
if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)) {
|
|
-1 !== u.indexOf(".min") && (n = ".min"),
|
|
(e = a.substring(0, a.lastIndexOf("/")));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (!e && j.document.currentScript)
|
|
-1 !== (a = j.document.currentScript.src).indexOf(".min") &&
|
|
(n = ".min"),
|
|
(e = a.substring(0, a.lastIndexOf("/")));
|
|
}
|
|
(this.baseURL = new CE(t).toAbsolute(e)),
|
|
(this.documentBaseURL = t),
|
|
(this.baseURI = new CE(this.baseURL)),
|
|
(this.suffix = n),
|
|
rd(this);
|
|
},
|
|
overrideDefaults: function (e) {
|
|
var t, n;
|
|
(t = e.base_url) && this._setBaseUrl(t),
|
|
(n = e.suffix),
|
|
e.suffix && (this.suffix = n);
|
|
var r = (this.defaultSettings = e).plugin_base_urls;
|
|
for (var o in r) pa.PluginManager.urls[o] = r[o];
|
|
},
|
|
init: function (r) {
|
|
var n,
|
|
u,
|
|
s = this;
|
|
u = Rn.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",
|
|
" ",
|
|
);
|
|
function c(e) {
|
|
var t = e.id;
|
|
return (
|
|
t ||
|
|
((t = (t = e.name) && !OE.get(t) ? e.name : OE.uniqueId()),
|
|
e.setAttribute("id", t)),
|
|
t
|
|
);
|
|
}
|
|
function l(e, t) {
|
|
return t.constructor === RegExp
|
|
? t.test(e.className)
|
|
: OE.hasClass(e, t);
|
|
}
|
|
var f = function (e) {
|
|
n = e;
|
|
},
|
|
e = function () {
|
|
function n(e, t, n) {
|
|
var r = new kE(e, t, s);
|
|
a.push(r),
|
|
r.on("init", function () {
|
|
++i === o.length && f(a);
|
|
}),
|
|
(r.targetElm = r.targetElm || n),
|
|
r.render();
|
|
}
|
|
var o,
|
|
i = 0,
|
|
a = [];
|
|
OE.unbind(window, "ready", e),
|
|
(function (e) {
|
|
var t = r[e];
|
|
if (t) t.apply(s, Array.prototype.slice.call(arguments, 2));
|
|
})("onpageload"),
|
|
(o = yi.unique(
|
|
(function (t) {
|
|
var e,
|
|
n = [];
|
|
if (Sn.browser.isIE() && Sn.browser.version.major < 11)
|
|
return (
|
|
qd.initError(
|
|
"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 (UE)
|
|
return (
|
|
qd.initError(
|
|
"Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.",
|
|
),
|
|
[]
|
|
);
|
|
if (t.types)
|
|
return (
|
|
HE(t.types, function (e) {
|
|
n = n.concat(OE.select(e.selector));
|
|
}),
|
|
n
|
|
);
|
|
if (t.selector) return OE.select(t.selector);
|
|
if (t.target) return [t.target];
|
|
switch (t.mode) {
|
|
case "exact":
|
|
0 < (e = t.elements || "").length &&
|
|
HE(BE(e), function (t) {
|
|
var e;
|
|
(e = OE.get(t))
|
|
? n.push(e)
|
|
: HE(j.document.forms, function (e) {
|
|
HE(e.elements, function (e) {
|
|
e.name === t &&
|
|
((t = "mce_editor_" + LE++),
|
|
OE.setAttrib(e, "id", t),
|
|
n.push(e));
|
|
});
|
|
});
|
|
});
|
|
break;
|
|
case "textareas":
|
|
case "specific_textareas":
|
|
HE(OE.select("textarea"), function (e) {
|
|
(t.editor_deselector && l(e, t.editor_deselector)) ||
|
|
(t.editor_selector && !l(e, t.editor_selector)) ||
|
|
n.push(e);
|
|
});
|
|
}
|
|
return n;
|
|
})(r),
|
|
)),
|
|
r.types
|
|
? HE(r.types, function (t) {
|
|
Rn.each(o, function (e) {
|
|
return (
|
|
!OE.is(e, t.selector) || (n(c(e), PE({}, r, t), e), !1)
|
|
);
|
|
});
|
|
})
|
|
: (Rn.each(o, function (e) {
|
|
!(function (e) {
|
|
e &&
|
|
e.initialized &&
|
|
!(e.getContainer() || e.getBody()).parentNode &&
|
|
(RE(e),
|
|
e.unbindAllNativeEvents(),
|
|
e.destroy(!0),
|
|
(e.removed = !0),
|
|
(e = null));
|
|
})(s.get(e.id));
|
|
}),
|
|
0 ===
|
|
(o = Rn.grep(o, function (e) {
|
|
return !s.get(e.id);
|
|
})).length
|
|
? f([])
|
|
: HE(o, function (e) {
|
|
!(function (e, t) {
|
|
return e.inline && t.tagName.toLowerCase() in u;
|
|
})(r, e)
|
|
? n(c(e), r, e)
|
|
: qd.initError(
|
|
"Could not initialize inline editor on invalid inline target element",
|
|
e,
|
|
);
|
|
}));
|
|
};
|
|
return (
|
|
(s.settings = r),
|
|
OE.bind(window, "ready", e),
|
|
new en(function (t) {
|
|
n
|
|
? t(n)
|
|
: (f = function (e) {
|
|
t(e);
|
|
});
|
|
})
|
|
);
|
|
},
|
|
get: function (t) {
|
|
return 0 === arguments.length
|
|
? FE.slice(0)
|
|
: K(t)
|
|
? g(FE, function (e) {
|
|
return e.id === t;
|
|
}).getOr(null)
|
|
: _(t) && FE[t]
|
|
? FE[t]
|
|
: null;
|
|
},
|
|
add: function (e) {
|
|
var n = this;
|
|
return (
|
|
IE[e.id] === e ||
|
|
(null === n.get(e.id) &&
|
|
((function (e) {
|
|
return "length" !== e;
|
|
})(e.id) && (IE[e.id] = e),
|
|
IE.push(e),
|
|
FE.push(e)),
|
|
ME(!0),
|
|
(n.activeEditor = e),
|
|
n.fire("AddEditor", { editor: e }),
|
|
DE ||
|
|
((DE = function (e) {
|
|
var t = n.fire("BeforeUnload");
|
|
if (t.returnValue)
|
|
return (
|
|
e.preventDefault(),
|
|
(e.returnValue = t.returnValue),
|
|
t.returnValue
|
|
);
|
|
}),
|
|
window.addEventListener("beforeunload", DE))),
|
|
e
|
|
);
|
|
},
|
|
createEditor: function (e, t) {
|
|
return this.add(new kE(e, t, this));
|
|
},
|
|
remove: function (e) {
|
|
var t,
|
|
n,
|
|
r = this;
|
|
if (e) {
|
|
if (!K(e))
|
|
return (
|
|
(n = e),
|
|
M(r.get(n.id))
|
|
? null
|
|
: (RE(n) && r.fire("RemoveEditor", { editor: n }),
|
|
0 === FE.length &&
|
|
window.removeEventListener("beforeunload", DE),
|
|
n.remove(),
|
|
ME(0 < FE.length),
|
|
n)
|
|
);
|
|
HE(OE.select(e), function (e) {
|
|
(n = r.get(e.id)) && r.remove(n);
|
|
});
|
|
} else for (t = FE.length - 1; 0 <= t; t--) r.remove(FE[t]);
|
|
},
|
|
execCommand: function (e, t, n) {
|
|
var r = this.get(n);
|
|
switch (e) {
|
|
case "mceAddEditor":
|
|
return this.get(n) || new kE(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", 0, n),
|
|
!0
|
|
);
|
|
}
|
|
return !!this.activeEditor && this.activeEditor.execCommand(e, t, n);
|
|
},
|
|
triggerSave: function () {
|
|
HE(FE, function (e) {
|
|
e.save();
|
|
});
|
|
},
|
|
addI18n: function (e, t) {
|
|
oa.add(e, t);
|
|
},
|
|
translate: function (e) {
|
|
return oa.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 CE(this.documentBaseURL).toAbsolute(
|
|
e.replace(/\/+$/, ""),
|
|
)),
|
|
(this.baseURI = new CE(this.baseURL));
|
|
},
|
|
});
|
|
function qE(n) {
|
|
return {
|
|
walk: function (e, t) {
|
|
return Jc(n, e, t);
|
|
},
|
|
split: wm,
|
|
normalize: function (t) {
|
|
return uy(n, t).fold($(!1), function (e) {
|
|
return (
|
|
t.setStart(e.startContainer, e.startOffset),
|
|
t.setEnd(e.endContainer, e.endOffset),
|
|
!0
|
|
);
|
|
});
|
|
},
|
|
};
|
|
}
|
|
jE.setup(),
|
|
((_E = qE = qE || {}).compareRanges = mh),
|
|
(_E.getCaretRangeFromPoint = Wv),
|
|
(_E.getSelectedNode = Ka),
|
|
(_E.getNode = Xa);
|
|
function $E(e, t, n) {
|
|
var r, o, i, a, u, s;
|
|
return (
|
|
(r = t.x),
|
|
(o = t.y),
|
|
(i = e.w),
|
|
(a = e.h),
|
|
(u = t.w),
|
|
(s = t.h),
|
|
"b" === (n = (n || "").split(""))[0] && (o += s),
|
|
"r" === n[1] && (r += u),
|
|
"c" === n[0] && (o += tN(s / 2)),
|
|
"c" === n[1] && (r += tN(u / 2)),
|
|
"b" === n[3] && (o -= a),
|
|
"r" === n[4] && (r -= i),
|
|
"c" === n[3] && (o -= tN(a / 2)),
|
|
"c" === n[4] && (r -= tN(i / 2)),
|
|
nN(r, o, i, a)
|
|
);
|
|
}
|
|
function WE() {}
|
|
var KE,
|
|
XE,
|
|
YE,
|
|
GE,
|
|
JE = qE,
|
|
QE =
|
|
((KE = {}),
|
|
(XE = {}),
|
|
{
|
|
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 (KE[r] !== undefined) return KE[r];
|
|
var e = new en(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 && (j.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 = j.setTimeout(function () {
|
|
return u.apply(null, e);
|
|
}, n));
|
|
},
|
|
resolve: a,
|
|
reject: u,
|
|
};
|
|
})(e, t);
|
|
(XE[r] = n.resolve),
|
|
Zi.ScriptLoader.loadScript(
|
|
o,
|
|
function () {
|
|
return n.start(a);
|
|
},
|
|
function () {
|
|
return n.reject(i);
|
|
},
|
|
);
|
|
});
|
|
return (KE[r] = e);
|
|
},
|
|
add: function (e, t) {
|
|
XE[e] !== undefined && (XE[e](t), delete XE[e]),
|
|
(KE[e] = en.resolve(t));
|
|
},
|
|
}),
|
|
ZE = Math.min,
|
|
eN = Math.max,
|
|
tN = Math.round,
|
|
nN = function (e, t, n, r) {
|
|
return { x: e, y: t, w: n, h: r };
|
|
},
|
|
rN = {
|
|
inflate: function (e, t, n) {
|
|
return nN(e.x - t, e.y - n, e.w + 2 * t, e.h + 2 * n);
|
|
},
|
|
relativePosition: $E,
|
|
findBestRelativePosition: function (e, t, n, r) {
|
|
var o, i;
|
|
for (i = 0; i < r.length; i++)
|
|
if (
|
|
(o = $E(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, r, o, i;
|
|
return (
|
|
(n = eN(e.x, t.x)),
|
|
(r = eN(e.y, t.y)),
|
|
(o = ZE(e.x + e.w, t.x + t.w)),
|
|
(i = ZE(e.y + e.h, t.y + t.h)),
|
|
o - n < 0 || i - r < 0 ? null : nN(n, r, o - n, i - r)
|
|
);
|
|
},
|
|
clamp: function (e, t, n) {
|
|
var r, o, i, a, u, s, c, l, f, d;
|
|
return (
|
|
(u = e.x),
|
|
(s = e.y),
|
|
(c = e.x + e.w),
|
|
(l = e.y + e.h),
|
|
(f = t.x + t.w),
|
|
(d = t.y + t.h),
|
|
(r = eN(0, t.x - u)),
|
|
(o = eN(0, t.y - s)),
|
|
(i = eN(0, c - f)),
|
|
(a = eN(0, l - d)),
|
|
(u += r),
|
|
(s += o),
|
|
n && ((c += r), (l += o), (u -= i), (s -= a)),
|
|
nN(u, s, (c -= i) - u, (l -= a) - s)
|
|
);
|
|
},
|
|
create: nN,
|
|
fromClientRect: function (e) {
|
|
return nN(e.left, e.top, e.width, e.height);
|
|
},
|
|
},
|
|
oN = Rn.each,
|
|
iN = Rn.extend;
|
|
WE.extend = YE = function (n) {
|
|
function r() {
|
|
var e, t, n;
|
|
if (
|
|
!GE &&
|
|
(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;
|
|
}
|
|
function e(n, r) {
|
|
return function () {
|
|
var e,
|
|
t = this._super;
|
|
return (
|
|
(this._super = u[n]),
|
|
(e = r.apply(this, arguments)),
|
|
(this._super = t),
|
|
e
|
|
);
|
|
};
|
|
}
|
|
var o,
|
|
i,
|
|
a,
|
|
u = this.prototype;
|
|
for (i in ((GE = !0),
|
|
(o = new this()),
|
|
(GE = !1),
|
|
n.Mixins &&
|
|
(oN(n.Mixins, function (e) {
|
|
for (var t in e) "init" !== t && (n[t] = e[t]);
|
|
}),
|
|
u.Mixins && (n.Mixins = u.Mixins.concat(n.Mixins))),
|
|
n.Methods &&
|
|
oN(n.Methods.split(","), function (e) {
|
|
n[e] = t;
|
|
}),
|
|
n.Properties &&
|
|
oN(n.Properties.split(","), function (e) {
|
|
var t = "_" + e;
|
|
n[e] = function (e) {
|
|
return e !== undefined ? ((this[t] = e), this) : this[t];
|
|
};
|
|
}),
|
|
n.Statics &&
|
|
oN(n.Statics, function (e, t) {
|
|
r[t] = e;
|
|
}),
|
|
n.Defaults && u.Defaults && (n.Defaults = iN({}, u.Defaults, n.Defaults)),
|
|
n))
|
|
"function" == typeof (a = n[i]) && u[i] ? (o[i] = e(i, a)) : (o[i] = a);
|
|
return (r.prototype = o), ((r.constructor = r).extend = YE), r;
|
|
};
|
|
var aN = Math.min,
|
|
uN = Math.max,
|
|
sN = Math.round,
|
|
cN = {
|
|
serialize: function (e) {
|
|
var t = JSON.stringify(e);
|
|
return K(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 (t) {}
|
|
},
|
|
},
|
|
lN = {
|
|
callbacks: {},
|
|
count: 0,
|
|
send: function (t) {
|
|
var n = this,
|
|
r = Yi.DOM,
|
|
o = t.count !== undefined ? t.count : 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++;
|
|
},
|
|
},
|
|
fN = G(G({}, oE), {
|
|
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))
|
|
: vn.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 || ""),
|
|
fN.fire("beforeInitialize", { settings: e }),
|
|
(t = new j.XMLHttpRequest()))
|
|
) {
|
|
if (
|
|
(t.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 &&
|
|
Rn.each(e.requestheaders, function (e) {
|
|
t.setRequestHeader(e.key, e.value);
|
|
}),
|
|
t.setRequestHeader("X-Requested-With", "XMLHttpRequest"),
|
|
(t = fN.fire("beforeSend", { xhr: t, settings: e }).xhr).send(
|
|
e.data,
|
|
),
|
|
!e.async)
|
|
)
|
|
return r();
|
|
vn.setTimeout(r, 10);
|
|
}
|
|
},
|
|
}),
|
|
dN = Rn.extend,
|
|
hN =
|
|
((mN.sendRPC = function (e) {
|
|
return new mN().send(e);
|
|
}),
|
|
(mN.prototype.send = function (e) {
|
|
var n = e.error,
|
|
r = e.success,
|
|
o = dN(this.settings, e);
|
|
(o.success = function (e, t) {
|
|
void 0 === (e = cN.parse(e)) && (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 = cN.serialize({
|
|
id: e.id || "c" + this.count++,
|
|
method: e.method,
|
|
params: e.params,
|
|
})),
|
|
(o.content_type = "application/json"),
|
|
fN.send(o);
|
|
}),
|
|
mN);
|
|
function mN(e) {
|
|
(this.settings = dN({}, e)), (this.count = 0);
|
|
}
|
|
var gN, pN, vN, yN;
|
|
try {
|
|
gN = j.window.localStorage;
|
|
} catch (xN) {
|
|
(pN = {}),
|
|
(vN = []),
|
|
(yN = {
|
|
getItem: function (e) {
|
|
var t = pN[e];
|
|
return t || null;
|
|
},
|
|
setItem: function (e, t) {
|
|
vN.push(e), (pN[e] = String(t));
|
|
},
|
|
key: function (e) {
|
|
return vN[e];
|
|
},
|
|
removeItem: function (t) {
|
|
(vN = vN.filter(function (e) {
|
|
return e === t;
|
|
})),
|
|
delete pN[t];
|
|
},
|
|
clear: function () {
|
|
(vN = []), (pN = {});
|
|
},
|
|
length: 0,
|
|
}),
|
|
Object.defineProperty(yN, "length", {
|
|
get: function () {
|
|
return vN.length;
|
|
},
|
|
configurable: !1,
|
|
enumerable: !1,
|
|
}),
|
|
(gN = yN);
|
|
}
|
|
var bN,
|
|
CN = {
|
|
geom: { Rect: rN },
|
|
util: {
|
|
Promise: en,
|
|
Delay: vn,
|
|
Tools: Rn,
|
|
VK: Mh,
|
|
URI: CE,
|
|
Class: WE,
|
|
EventDispatcher: jz,
|
|
Observable: oE,
|
|
I18n: oa,
|
|
XHR: fN,
|
|
JSON: cN,
|
|
JSONRequest: hN,
|
|
JSONP: lN,
|
|
LocalStorage: gN,
|
|
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) {
|
|
var r, o, i, a;
|
|
if (
|
|
((e = (parseInt(e, 10) || 0) % 360),
|
|
(t = parseInt(t, 10) / 100),
|
|
(n = parseInt(n, 10) / 100),
|
|
(t = uN(0, aN(t, 1))),
|
|
(n = uN(0, aN(n, 1))),
|
|
0 !== t)
|
|
) {
|
|
switch (
|
|
((r = e / 60),
|
|
(i = (o = n * t) * (1 - Math.abs((r % 2) - 1))),
|
|
(a = n - o),
|
|
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 = sN(255 * (u + a))),
|
|
(s = sN(255 * (s + a))),
|
|
(c = sN(255 * (c + a)));
|
|
} else u = s = c = sN(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 (function (e, t, n) {
|
|
var r, o, i, a;
|
|
return (
|
|
(o = 0),
|
|
(i = aN((e /= 255), aN((t /= 255), (n /= 255)))) ===
|
|
(a = uN(e, uN(t, n)))
|
|
? { h: 0, s: 0, v: 100 * (o = i) }
|
|
: ((r = (a - i) / a),
|
|
{
|
|
h: sN(
|
|
60 *
|
|
((e === i ? 3 : n === i ? 1 : 5) -
|
|
(e === i ? t - n : n === i ? e - t : n - e) /
|
|
((o = a) - i)),
|
|
),
|
|
s: sN(100 * r),
|
|
v: sN(100 * o),
|
|
})
|
|
);
|
|
})(u, s, c);
|
|
}),
|
|
(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
|
|
);
|
|
},
|
|
},
|
|
dom: {
|
|
EventUtils: Tr,
|
|
Sizzle: Mo,
|
|
DomQuery: yi,
|
|
TreeWalker: bi,
|
|
DOMUtils: Yi,
|
|
ScriptLoader: Zi,
|
|
RangeUtils: JE,
|
|
Serializer: Mp,
|
|
ControlSelection: Kp,
|
|
BookmarkManager: Xp,
|
|
Selection: fy,
|
|
Event: Tr.Event,
|
|
},
|
|
html: {
|
|
Styles: zr,
|
|
Entities: ar,
|
|
Node: sl,
|
|
Schema: vr,
|
|
SaxParser: af,
|
|
DomParser: Sp,
|
|
Writer: pl,
|
|
Serializer: vl,
|
|
},
|
|
Env: Sn,
|
|
AddOnManager: pa,
|
|
Annotator: rl,
|
|
Formatter: wp,
|
|
UndoManager: gm,
|
|
EditorCommands: Iz,
|
|
WindowManager: Bd,
|
|
NotificationManager: Od,
|
|
EditorObservable: uE,
|
|
Shortcuts: hE,
|
|
Editor: kE,
|
|
FocusManager: ed,
|
|
EditorManager: jE,
|
|
DOM: Yi.DOM,
|
|
ScriptLoader: Zi.ScriptLoader,
|
|
PluginManager: pa.PluginManager,
|
|
ThemeManager: pa.ThemeManager,
|
|
IconManager: $d,
|
|
Resource: QE,
|
|
trim: Rn.trim,
|
|
isArray: Rn.isArray,
|
|
is: Rn.is,
|
|
toArray: Rn.toArray,
|
|
makeMap: Rn.makeMap,
|
|
each: Rn.each,
|
|
map: Rn.map,
|
|
grep: Rn.grep,
|
|
inArray: Rn.inArray,
|
|
extend: Rn.extend,
|
|
create: Rn.create,
|
|
walk: Rn.walk,
|
|
createNS: Rn.createNS,
|
|
resolve: Rn.resolve,
|
|
explode: Rn.explode,
|
|
_addCacheSuffix: Rn._addCacheSuffix,
|
|
isOpera: Sn.opera,
|
|
isWebKit: Sn.webkit,
|
|
isIE: Sn.ie,
|
|
isGecko: Sn.gecko,
|
|
isMac: Sn.mac,
|
|
},
|
|
wN = Rn.extend(jE, CN);
|
|
(bN = wN),
|
|
(window.tinymce = bN),
|
|
(window.tinyMCE = bN),
|
|
(function (e) {
|
|
if ("object" == typeof module)
|
|
try {
|
|
module.exports = e;
|
|
} catch (t) {}
|
|
})(wN);
|
|
})(window);
|
|
|
|
/* Ephox Fluffy plugin
|
|
*
|
|
* Copyright 2010-2016 Ephox Corporation. All rights reserved.
|
|
*
|
|
* Version: 2.4.0-12
|
|
*/
|
|
|
|
!(function (a) {
|
|
"use strict";
|
|
var n,
|
|
t,
|
|
r,
|
|
e,
|
|
u = void 0 !== a.window ? a.window : Function("return this;")(),
|
|
i = function (n, t) {
|
|
return { isRequired: n, applyPatch: t };
|
|
},
|
|
c = function (i, o) {
|
|
return function () {
|
|
for (var n = [], t = 0; t < arguments.length; t++) n[t] = arguments[t];
|
|
var r = o.apply(this, n),
|
|
e = void 0 === r ? n : r;
|
|
return i.apply(this, e);
|
|
};
|
|
},
|
|
o = function (n, t) {
|
|
if (n)
|
|
for (var r = 0; r < t.length; r++)
|
|
t[r].isRequired(n) && t[r].applyPatch(n);
|
|
return n;
|
|
},
|
|
f = function () {},
|
|
l = function (n) {
|
|
return function () {
|
|
return n;
|
|
};
|
|
},
|
|
s = l(!1),
|
|
g = l(!0),
|
|
p = function () {
|
|
return d;
|
|
},
|
|
d =
|
|
((n = function (n) {
|
|
return n.isNone();
|
|
}),
|
|
(e = {
|
|
fold: function (n, t) {
|
|
return n();
|
|
},
|
|
is: s,
|
|
isSome: s,
|
|
isNone: g,
|
|
getOr: (r = function (n) {
|
|
return n;
|
|
}),
|
|
getOrThunk: (t = function (n) {
|
|
return n();
|
|
}),
|
|
getOrDie: function (n) {
|
|
throw new Error(n || "error: getOrDie called on none.");
|
|
},
|
|
getOrNull: l(null),
|
|
getOrUndefined: l(void 0),
|
|
or: r,
|
|
orThunk: t,
|
|
map: p,
|
|
each: f,
|
|
bind: p,
|
|
exists: s,
|
|
forall: g,
|
|
filter: p,
|
|
equals: n,
|
|
equals_: n,
|
|
toArray: function () {
|
|
return [];
|
|
},
|
|
toString: l("none()"),
|
|
}),
|
|
Object.freeze && Object.freeze(e),
|
|
e),
|
|
h = function (r) {
|
|
var n = l(r),
|
|
t = function () {
|
|
return i;
|
|
},
|
|
e = function (n) {
|
|
return n(r);
|
|
},
|
|
i = {
|
|
fold: function (n, t) {
|
|
return t(r);
|
|
},
|
|
is: function (n) {
|
|
return r === n;
|
|
},
|
|
isSome: g,
|
|
isNone: s,
|
|
getOr: n,
|
|
getOrThunk: n,
|
|
getOrDie: n,
|
|
getOrNull: n,
|
|
getOrUndefined: n,
|
|
or: t,
|
|
orThunk: t,
|
|
map: function (n) {
|
|
return h(n(r));
|
|
},
|
|
each: function (n) {
|
|
n(r);
|
|
},
|
|
bind: e,
|
|
exists: e,
|
|
forall: e,
|
|
filter: function (n) {
|
|
return n(r) ? i : d;
|
|
},
|
|
toArray: function () {
|
|
return [r];
|
|
},
|
|
toString: function () {
|
|
return "some(" + r + ")";
|
|
},
|
|
equals: function (n) {
|
|
return n.is(r);
|
|
},
|
|
equals_: function (n, t) {
|
|
return n.fold(s, function (n) {
|
|
return t(r, n);
|
|
});
|
|
},
|
|
};
|
|
return i;
|
|
},
|
|
v = p,
|
|
y = function (n) {
|
|
return null == n ? d : h(n);
|
|
},
|
|
m = function (t) {
|
|
return function (n) {
|
|
return (
|
|
(function (n) {
|
|
if (null === n) return "null";
|
|
var t = typeof n;
|
|
return "object" === t &&
|
|
(Array.prototype.isPrototypeOf(n) ||
|
|
(n.constructor && "Array" === n.constructor.name))
|
|
? "array"
|
|
: "object" === t &&
|
|
(String.prototype.isPrototypeOf(n) ||
|
|
(n.constructor && "String" === n.constructor.name))
|
|
? "string"
|
|
: t;
|
|
})(n) === t
|
|
);
|
|
};
|
|
},
|
|
w = m("object"),
|
|
O = m("array"),
|
|
b = m("undefined"),
|
|
j = m("function"),
|
|
A = (Array.prototype.slice, Array.prototype.indexOf),
|
|
x = Array.prototype.push,
|
|
E = function (n, t) {
|
|
return (r = n), (e = t), -1 < A.call(r, e);
|
|
var r, e;
|
|
},
|
|
S = function (n, t) {
|
|
return (function (n) {
|
|
for (var t = [], r = 0, e = n.length; r < e; ++r) {
|
|
if (!O(n[r]))
|
|
throw new Error(
|
|
"Arr.flatten item " + r + " was not an array, input: " + n,
|
|
);
|
|
x.apply(t, n[r]);
|
|
}
|
|
return t;
|
|
})(
|
|
(function (n, t) {
|
|
for (var r = n.length, e = new Array(r), i = 0; i < r; i++) {
|
|
var o = n[i];
|
|
e[i] = t(o, i);
|
|
}
|
|
return e;
|
|
})(n, t),
|
|
);
|
|
},
|
|
M = (j(Array.from) && Array.from, Object.prototype.hasOwnProperty),
|
|
_ = function (u) {
|
|
return function () {
|
|
for (var n = new Array(arguments.length), t = 0; t < n.length; t++)
|
|
n[t] = arguments[t];
|
|
if (0 === n.length) throw new Error("Can't merge zero objects");
|
|
for (var r = {}, e = 0; e < n.length; e++) {
|
|
var i = n[e];
|
|
for (var o in i) M.call(i, o) && (r[o] = u(r[o], i[o]));
|
|
}
|
|
return r;
|
|
};
|
|
},
|
|
D = _(function (n, t) {
|
|
return w(n) && w(t) ? D(n, t) : t;
|
|
}),
|
|
P = _(function (n, t) {
|
|
return t;
|
|
}),
|
|
U = Object.keys,
|
|
N = Object.hasOwnProperty,
|
|
R = function (n, t) {
|
|
for (var r = U(n), e = 0, i = r.length; e < i; e++) {
|
|
var o = r[e];
|
|
t(n[o], o);
|
|
}
|
|
},
|
|
T = function (n, t) {
|
|
return q(n, t) ? y(n[t]) : v();
|
|
},
|
|
q = function (n, t) {
|
|
return N.call(n, t);
|
|
},
|
|
C = function (n) {
|
|
if (b(n) || "" === n) return [];
|
|
var t = O(n)
|
|
? S(n, function (n) {
|
|
return n.split(/[\s+,]/);
|
|
})
|
|
: n.split(/[\s+,]/);
|
|
return S(t, function (n) {
|
|
return 0 < n.length ? [n.trim()] : [];
|
|
});
|
|
},
|
|
I = function (n, t) {
|
|
var r,
|
|
e,
|
|
i,
|
|
o = D(n, t),
|
|
u = C(t.plugins),
|
|
a = T(o, "custom_plugin_urls").getOr({}),
|
|
c =
|
|
((r = function (n, t) {
|
|
return E(u, t);
|
|
}),
|
|
(e = {}),
|
|
(i = {}),
|
|
R(a, function (n, t) {
|
|
(r(n, t) ? e : i)[t] = n;
|
|
}),
|
|
{ t: e, f: i }),
|
|
f = T(o, "external_plugins").getOr({}),
|
|
l = {};
|
|
R(c.t, function (n, t) {
|
|
l[t] = n;
|
|
});
|
|
var s = P(l, f);
|
|
return P(t, 0 === U(s).length ? {} : { external_plugins: s });
|
|
},
|
|
k = {
|
|
getCustomPluginUrls: I,
|
|
patch: i(
|
|
function () {
|
|
return !0;
|
|
},
|
|
function (t) {
|
|
t.EditorManager.init = c(t.EditorManager.init, function (n) {
|
|
return [I(t.defaultSettings, n)];
|
|
});
|
|
},
|
|
),
|
|
},
|
|
L = function (n, t) {
|
|
return (function (n, t) {
|
|
for (var r = null != t ? t : u, e = 0; e < n.length && null != r; ++e)
|
|
r = r[n[e]];
|
|
return r;
|
|
})(n.split("."), t);
|
|
},
|
|
z = function (n) {
|
|
return parseInt(n, 10);
|
|
},
|
|
V = function (n, t) {
|
|
var r = n - t;
|
|
return 0 === r ? 0 : 0 < r ? 1 : -1;
|
|
},
|
|
B = function (n, t, r) {
|
|
return { major: n, minor: t, patch: r };
|
|
},
|
|
F = function (n) {
|
|
var t = /([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(n);
|
|
return t ? B(z(t[1]), z(t[2]), z(t[3])) : B(0, 0, 0);
|
|
},
|
|
$ = function (n, t) {
|
|
return (
|
|
!!n &&
|
|
-1 ===
|
|
(function (n, t) {
|
|
var r = V(n.major, t.major);
|
|
if (0 !== r) return r;
|
|
var e = V(n.minor, t.minor);
|
|
if (0 !== e) return e;
|
|
var i = V(n.patch, t.patch);
|
|
return 0 !== i ? i : 0;
|
|
})(
|
|
F(
|
|
[(r = n).majorVersion, r.minorVersion]
|
|
.join(".")
|
|
.split(".")
|
|
.slice(0, 3)
|
|
.join("."),
|
|
),
|
|
F(t),
|
|
)
|
|
);
|
|
var r;
|
|
},
|
|
G = {
|
|
patch: i(
|
|
function (n) {
|
|
return $(n, "4.7.0");
|
|
},
|
|
function (n) {
|
|
var o;
|
|
n.EditorManager.init = c(
|
|
n.EditorManager.init,
|
|
((o = n.EditorManager),
|
|
function (n) {
|
|
var t = L("tinymce.util.Tools", u),
|
|
r = C(n.plugins),
|
|
e = o.defaultSettings.forced_plugins || [],
|
|
i = 0 < e.length ? r.concat(e) : r;
|
|
return [t.extend({}, n, { plugins: i })];
|
|
}),
|
|
);
|
|
},
|
|
),
|
|
},
|
|
H = function () {
|
|
return new Date().getTime();
|
|
},
|
|
J = function (n, t, r, e, i) {
|
|
var o,
|
|
u = H();
|
|
o = a.setInterval(function () {
|
|
n() && (a.clearInterval(o), t()),
|
|
H() - u > i && (a.clearInterval(o), r());
|
|
}, e);
|
|
},
|
|
K = function (i) {
|
|
return function () {
|
|
var n,
|
|
t,
|
|
r,
|
|
e = ((n = i),
|
|
(t = "position"),
|
|
(r = n.currentStyle
|
|
? n.currentStyle[t]
|
|
: a.window.getComputedStyle(n, null)[t]),
|
|
r || "").toLowerCase();
|
|
return "absolute" === e || "fixed" === e;
|
|
};
|
|
},
|
|
Q = function (n) {
|
|
n.parentNode.removeChild(n);
|
|
},
|
|
W = function (n, t) {
|
|
var r,
|
|
e =
|
|
(((r = a.document.createElement("div")).style.display = "none"),
|
|
(r.className = "mce-floatpanel"),
|
|
r);
|
|
a.document.body.appendChild(e),
|
|
J(
|
|
K(e),
|
|
function () {
|
|
Q(e), n();
|
|
},
|
|
function () {
|
|
Q(e), t();
|
|
},
|
|
10,
|
|
5e3,
|
|
);
|
|
},
|
|
X = function (n, t) {
|
|
n.notificationManager
|
|
? n.notificationManager.open({
|
|
text: t,
|
|
type: "warning",
|
|
timeout: 0,
|
|
icon: "",
|
|
})
|
|
: n.windowManager.alert(t);
|
|
},
|
|
Y = function (n) {
|
|
n.EditorManager.on("AddEditor", function (n) {
|
|
var t = n.editor,
|
|
r = t.settings.service_message;
|
|
r &&
|
|
W(
|
|
function () {
|
|
X(t, t.settings.service_message);
|
|
},
|
|
function () {
|
|
a.alert(r);
|
|
},
|
|
);
|
|
});
|
|
},
|
|
Z = function (n) {
|
|
var t,
|
|
r,
|
|
e = L("tinymce.util.URI", u);
|
|
(t = n.base_url) &&
|
|
((this.baseURL = new e(this.documentBaseURL).toAbsolute(
|
|
t.replace(/\/+$/, ""),
|
|
)),
|
|
(this.baseURI = new e(this.baseURL))),
|
|
(r = n.suffix),
|
|
n.suffix && (this.suffix = r),
|
|
(this.defaultSettings = n);
|
|
},
|
|
nn = function (n) {
|
|
return [L("tinymce.util.Tools", u).extend({}, this.defaultSettings, n)];
|
|
},
|
|
tn = {
|
|
patch: i(
|
|
function (n) {
|
|
return "function" != typeof n.overrideDefaults;
|
|
},
|
|
function (n) {
|
|
Y(n),
|
|
(n.overrideDefaults = Z),
|
|
(n.EditorManager.init = c(n.EditorManager.init, nn));
|
|
},
|
|
),
|
|
},
|
|
rn = {
|
|
patch: i(
|
|
function (n) {
|
|
return $(n, "4.5.0");
|
|
},
|
|
function (n) {
|
|
var e;
|
|
n.overrideDefaults = c(
|
|
n.overrideDefaults,
|
|
((e = n),
|
|
function (n) {
|
|
var t = n.plugin_base_urls;
|
|
for (var r in t) e.PluginManager.urls[r] = t[r];
|
|
}),
|
|
);
|
|
},
|
|
),
|
|
},
|
|
en = function (n) {
|
|
o(n, [tn.patch, rn.patch, G.patch, k.patch]);
|
|
};
|
|
en(u.tinymce);
|
|
})(window);
|
|
|
|
(function (cloudSettings) {
|
|
tinymce.overrideDefaults(cloudSettings);
|
|
})({
|
|
imagetools_proxy: "https://imageproxy.tiny.cloud/2/image",
|
|
suffix: ".min",
|
|
linkchecker_service_url: "https://hyperlinking.tiny.cloud",
|
|
spellchecker_rpc_url: "https://spelling.tiny.cloud",
|
|
spellchecker_api_key: "no-api-key",
|
|
tinydrive_service_url: "https://catalog.tiny.cloud",
|
|
api_key: "no-api-key",
|
|
imagetools_api_key: "no-api-key",
|
|
tinydrive_api_key: "no-api-key",
|
|
forced_plugins: ["chiffer"],
|
|
referrer_policy: "origin",
|
|
content_css_cors: true,
|
|
custom_plugin_urls: {},
|
|
chiffer_snowplow_service_url: "https://sp.tinymce.com/i",
|
|
mediaembed_api_key: "no-api-key",
|
|
linkchecker_api_key: "no-api-key",
|
|
mediaembed_service_url: "https://hyperlinking.tiny.cloud",
|
|
service_message:
|
|
'This domain is not registered with Tiny Cloud. \u003ca target="_blank" href="https://www.tiny.cloud/auth/signup/"\u003eStart a free trial\u003c/a\u003e to discover our premium cloud services and pro support.',
|
|
});
|
|
tinymce.baseURL = "https://cdn.tiny.cloud/1/no-api-key/tinymce/5.1.6-68";
|
|
|
|
/* Ephox chiffer plugin
|
|
*
|
|
* Copyright 2010-2019 Tiny Technologies Inc. All rights reserved.
|
|
*
|
|
* Version: 1.4.2-9
|
|
*/
|
|
|
|
!(function (u) {
|
|
"use strict";
|
|
for (
|
|
var t,
|
|
a = function () {
|
|
return new Date().getTime();
|
|
},
|
|
c =
|
|
((t = "string"),
|
|
function (n) {
|
|
return (
|
|
(function (n) {
|
|
if (null === n) return "null";
|
|
var t = typeof n;
|
|
return "object" === t &&
|
|
(Array.prototype.isPrototypeOf(n) ||
|
|
(n.constructor && "Array" === n.constructor.name))
|
|
? "array"
|
|
: "object" === t &&
|
|
(String.prototype.isPrototypeOf(n) ||
|
|
(n.constructor && "String" === n.constructor.name))
|
|
? "string"
|
|
: t;
|
|
})(n) === t
|
|
);
|
|
}),
|
|
o = [],
|
|
n = 0;
|
|
n < 256;
|
|
++n
|
|
)
|
|
o[n] = (n + 256).toString(16).substr(1);
|
|
var f = function () {
|
|
var n,
|
|
t,
|
|
r,
|
|
e = (function () {
|
|
for (var n = new Array(16), t = 0, r = 0; r < 16; r++)
|
|
0 == (3 & r) && (t = 4294967296 * Math.random()),
|
|
(n[r] = (t >>> ((3 & r) << 3)) & 255);
|
|
return n;
|
|
})();
|
|
return (
|
|
(e[6] = (15 & e[6]) | 64),
|
|
(e[8] = (63 & e[8]) | 128),
|
|
(t = 0),
|
|
(r = o)[(n = e)[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
"-" +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
"-" +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
"-" +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
"-" +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]] +
|
|
r[n[t++]]
|
|
);
|
|
},
|
|
s = function () {},
|
|
d = function (n, t) {
|
|
var i,
|
|
c,
|
|
r,
|
|
e =
|
|
((i = n),
|
|
(c = t),
|
|
{
|
|
send: function (n, t, r) {
|
|
var e =
|
|
"?aid=" +
|
|
c +
|
|
"&tna=tinymce_cloud&p=web&dtm=" +
|
|
t +
|
|
"&stm=" +
|
|
a() +
|
|
"&tz=" +
|
|
("undefined" != typeof Intl
|
|
? encodeURIComponent(
|
|
Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
)
|
|
: "N%2FA") +
|
|
"&e=se&se_ca=" +
|
|
n +
|
|
"&eid=" +
|
|
f() +
|
|
"&fp=none&tv=js-2.6.1",
|
|
o = u.document.createElement("img");
|
|
(o.src = i.chiffer_snowplow_service_url + e),
|
|
(o.onload = function () {
|
|
r(!0);
|
|
}),
|
|
(o.onerror = function () {
|
|
r(!1);
|
|
});
|
|
},
|
|
});
|
|
return (
|
|
(r = e),
|
|
{
|
|
sendStat: function (n) {
|
|
return function () {
|
|
r.send(n, a(), s);
|
|
};
|
|
},
|
|
}
|
|
);
|
|
};
|
|
return function () {
|
|
var n,
|
|
t,
|
|
r = tinymce.defaultSettings,
|
|
e = {
|
|
load: function (n) {
|
|
return s;
|
|
},
|
|
},
|
|
o = ((n = r.api_key), c(n) ? n : void 0),
|
|
i =
|
|
void 0 === o
|
|
? e
|
|
: ((t = d(r, o)).sendStat("script_load")(),
|
|
{
|
|
load: function (n) {
|
|
n.once("init", t.sendStat("init")),
|
|
n.once("focus", t.sendStat("focus"));
|
|
},
|
|
});
|
|
tinymce.PluginManager.add("chiffer", i.load);
|
|
};
|
|
})(window)();
|