1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
|
this.wp=this.wp||{},this.wp.richText=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=371)}({1:function(t,e){!function(){t.exports=this.lodash}()},16:function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return r})},21:function(t,e,n){"use strict";var r=n(33);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||Object(r.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(e,"a",function(){return o})},27:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(t)}n.d(e,"a",function(){return o})},33:function(t,e,n){"use strict";function r(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}n.d(e,"a",function(){return r})},371:function(t,e,n){"use strict";n.r(e);var r=n(1);function o(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.type!==e.type)return!1;var n=t.attributes,r=e.attributes;if(n===r)return!0;if(!n||!r)return!1;var o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;for(var a=o.length,u=0;u<a;u++){var f=o[u];if(n[f]!==r[f])return!1}return!0}function i(t){var e=t.formats,n=t.text,r=t.start,i=t.end,a=e.slice(0);return a.forEach(function(t,e){var n=a[e-1];if(n){var r=t.slice(0);r.forEach(function(t,e){var i=n[e];o(t,i)&&(r[e]=i)}),a[e]=r}}),{formats:a,text:n,start:r,end:i}}function a(t,e){var n=t.formats,o=t.text,a=t.start,f=t.end,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f,s=n.slice(0);if(c===l){for(var d=Object(r.find)(s[c],{type:e.type});Object(r.find)(s[c],d);)u(s,c,e),c--;for(l++;Object(r.find)(s[l],d);)u(s,l,e),l++}else for(var m=c;m<l;m++)u(s,m,e);return i({formats:s,text:o,start:a,end:f})}function u(t,e,n){if(t[e]){var r=t[e].filter(function(t){return t.type!==n.type});r.push(n),t[e]=r}else t[e]=[n]}function f(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return i(e.reduce(function(t,e){var n=e.formats,r=e.text;return{text:t.text+r,formats:t.formats.concat(n)}}))}var c=n(21),l=n(27);function s(t){return 0===t.text.length}function d(t){var e=t.text,n=t.start,r=t.end;return n===r&&(0===e.length||(0===n&&"\u2028"===e.slice(0,1)||(n===e.length&&"\u2028"===e.slice(-1)||"\u2028\u2028"===e.slice(n-1,r+1))))}var m=window.Node,p=m.TEXT_NODE,v=m.ELEMENT_NODE;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.element,n=t.text,r=t.html,o=t.range,i=t.multilineTag,a=t.removeNode,u=t.unwrapNode,f=t.filterString,c=t.removeAttribute;return"string"==typeof n&&n.length>0?{formats:Array(n.length),text:n}:("string"==typeof r&&r.length>0&&(
|