if (value !== 'normal') {
outputStyles[name] = value;
if (/^(comment|comment-list)$/i.test(value)) {
if (name.indexOf('mso-comment') === 0) {
if (name.indexOf('mso-') === 0) {
if (Settings.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
outputStyles[name] = value;
if (/(bold)/i.test(outputStyles['font-weight'])) {
delete outputStyles['font-weight'];
node.wrap(new global$9('b', 1));
if (/(italic)/i.test(outputStyles['font-style'])) {
delete outputStyles['font-style'];
node.wrap(new global$9('i', 1));
outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
var filterWordContent = function (editor, content) {
var retainStyleProperties, validStyles;
retainStyleProperties = Settings.getRetainStyleProps(editor);
if (retainStyleProperties) {
validStyles = global$4.makeMap(retainStyleProperties.split(/[, ]/));
content = Utils.filter(content, [
/<br class="?Apple-interchange-newline"?>/gi,
/<b[^>]+id="?docs-internal-[^>]*>/gi,
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
var validElements = Settings.getWordValidElements(editor);
valid_elements: validElements,
global$4.each(schema.elements, function (rule) {
if (!rule.attributes.class) {
rule.attributes.class = {};
rule.attributesOrder.push('class');
if (!rule.attributes.style) {
rule.attributes.style = {};
rule.attributesOrder.push('style');
var domParser = global$7({}, schema);
domParser.addAttributeFilter('style', function (nodes) {
var i = nodes.length, node;
node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
if (node.name === 'span' && node.parent && !node.attributes.length) {
domParser.addAttributeFilter('class', function (nodes) {
var i = nodes.length, node, className;
className = node.attr('class');
if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
node.attr('class', null);
domParser.addNodeFilter('del', function (nodes) {
domParser.addNodeFilter('a', function (nodes) {
var i = nodes.length, node, href, name;
href = node.attr('href');
name = node.attr('name');
if (href && href.indexOf('#_msocom_') !== -1) {
if (href && href.indexOf('file://') === 0) {
href = href.split('#')[1];
if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
var rootNode = domParser.parse(content);
if (Settings.shouldConvertWordFakeLists(editor)) {
convertFakeListsToProperLists(rootNode);
content = global$8({ validate: editor.settings.validate }, schema).serialize(rootNode);
var preProcess = function (editor, content) {
return Settings.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
isWordContent: isWordContent
var preProcess$1 = function (editor, html) {
var parser = global$7({}, editor.schema);
parser.addNodeFilter('meta', function (nodes) {
global$4.each(nodes, function (node) {
var fragment = parser.parse(html, {
forced_root_block: false,
return global$8({ validate: editor.settings.validate }, editor.schema).serialize(fragment);
var processResult = function (content, cancelled) {
var postProcessFilter = function (editor, html, internal, isWordHtml) {
var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
var postProcessArgs = Events.firePastePostProcess(editor, tempBody, internal, isWordHtml);
return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
var filterContent = function (editor, content, internal, isWordHtml) {
var preProcessArgs = Events.firePastePreProcess(editor, content, internal, isWordHtml);
var filteredContent = preProcess$1(editor, preProcessArgs.content);
if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
return postProcessFilter(editor, filteredContent, internal, isWordHtml);
return processResult(filteredContent, preProcessArgs.isDefaultPrevented());
var process = function (editor, html, internal) {
var isWordHtml = WordFilter.isWordContent(html);
var content = isWordHtml ? WordFilter.preProcess(editor, html) : html;
return filterContent(editor, content, internal, isWordHtml);
var ProcessFilters = { process: process };
var pasteHtml = function (editor, html) {
editor.insertContent(html, {
merge: Settings.shouldMergeFormats(editor),
var isAbsoluteUrl = function (url) {
return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
var isImageUrl = function (url) {
return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url);
var createImage = function (editor, url, pasteHtmlFn) {
editor.undoManager.extra(function () {
pasteHtmlFn(editor, url);
editor.insertContent('<img src="' + url + '">');
var createLink = function (editor, url, pasteHtmlFn) {
editor.undoManager.extra(function () {
pasteHtmlFn(editor, url);
editor.execCommand('mceInsertLink', false, url);
var linkSelection = function (editor, html, pasteHtmlFn) {
return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
var insertImage = function (editor, html, pasteHtmlFn) {
return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false;
var smartInsertContent = function (editor, html) {
return action(editor, html, pasteHtml) !== true;
var insertContent = function (editor, html) {
if (Settings.isSmartPasteEnabled(editor) === false) {
smartInsertContent(editor, html);
isAbsoluteUrl: isAbsoluteUrl,
insertContent: insertContent
var constant = function (value) {
for (var _i = 1; _i < arguments.length; _i++) {
initialArgs[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
restArgs[_i] = arguments[_i];
var all = initialArgs.concat(restArgs);
return fn.apply(null, all);
var never = constant(false);
var always = constant(true);
var call = function (thunk) {
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
getOrNull: constant(null),
getOrUndefined: constant(undefined),
toString: constant('none()')
var some = function (a) {
var constant_a = constant(a);
var bind = function (f) {
getOrUndefined: constant_a,
return 'some(' + a + ')';
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
var typeOf = function (x) {
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
var isFunction = isType('function');
var nativeSlice = Array.prototype.slice;
var map = function (xs, f) {
for (var i = 0; i < len; i++) {
var each = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var filter$1 = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
return nativeSlice.call(x);
var exports$1 = {}, module = { exports: exports$1 };
(function (define, exports, module, require) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
} else if (typeof define === 'function' && define.amd) {
if (typeof window !== 'undefined') {
} else if (typeof global !== 'undefined') {
} else if (typeof self !== 'undefined') {
g.EphoxContactWrapper = f();
var c = 'function' == typeof require && require;
var a = new Error('Cannot find module \'' + i + '\'');
throw a.code = 'MODULE_NOT_FOUND', a;
var p = n[i] = { exports: {} };
e[i][0].call(p.exports, function (r) {
}, p, p.exports, r, e, n, t);
for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)
function (require, module, exports) {
var process = module.exports = {};
function defaultSetTimout() {