policybot/fassets/js/components/tinymce/plugins/paste/plugin.min.js

9 lines
22 KiB
JavaScript
Raw Normal View History

2021-11-30 10:56:55 +00:00
/**
* 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.8.1 (2021-05-20)
*/
!function(){"use strict";var t,e,n,r,a,o,d=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),P=function(e){return!(null===(t=e)||t===undefined);var t},s=function(e){return typeof e===t},u=function(){},l=function(e){return function(){return e}},c=l(!(t="function")),f=l(!0),m=function(){return p},p=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:c,isSome:c,isNone:f,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:r,orThunk:n,map:m,each:u,bind:m,exists:c,forall:f,filter:m,equals:e,equals_:e,toArray:function(){return[]},toString:l("none()")}),g=function(n){var e=l(n),t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return g(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:p},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 a},v={some:g,none:m,from:function(e){return null===e||e===undefined?p:g(e)}},h=Array.prototype.slice,y=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},b=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a)}return r},x=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},w=s(Array.from)?Array.from:function(e){return h.call(e)},_=function(){var t=d(v.none());return{clear:function(){return t.set(v.none())},set:function(e){return t.set(v.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},C=function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t},T=tinymce.util.Tools.resolve("tinymce.Env"),D=tinymce.util.Tools.resolve("tinymce.util.Delay"),k=tinymce.util.Tools.resolve("tinymce.util.Promise"),S=tinymce.util.Tools.resolve("tinymce.util.VK"),O=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},j=tinymce.util.Tools.resolve("tinymce.util.Tools"),R=function(e){return e.getParam("paste_data_images",!1)},A=function(e){return e.getParam("paste_retain_style_properties")},I=function(e){return e.getParam("validate")},F=function(e){return e.getParam("paste_data_images",!1,"boolean")},E=function(e){return j.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},M="x-tinymce/html",N="\x3c!-- "+M+" --\x3e",B=function(e){return-1!==e.indexOf(N)},L=tinymce.util.Tools.resolve("tinymce.html.Entities"),H=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+L.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),o="</"+t+">",i=j.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===i.length?i[0]:j.map(i,function(e){return a+e+o}).join("")},$=tinymce.util.Tools.resolve("tinymce.html.DomParser"),z=tinymce.util.Tools.resolve("tinymce.html.Serializer"),U=tinymce.util.Tools.resolve("tinymce.html.Node"),q=tinymce.util.Tools.resolve("tinymce.html.Schema"),V=function(t,e){return j.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t},K=function(e){return e=V(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},X=function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)},W=function(e){for(var a,o,i=1,n=function(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return