fuck-tiny-cloud/plugins/powerpaste/plugin.min.js

10 lines
175 KiB
JavaScript
Raw Normal View History

2023-11-01 22:54:59 -04:00
/* !
* Tiny PowerPaste plugin
*
* Copyright (c) 2023 Ephox Corporation DBA Tiny Technologies, Inc.
* Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
*
* Version: 6.2.4-639
2023-11-01 22:54:59 -04:00
*/
!function(){"use strict";const e=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&((e,t,n)=>{var r,o;return o=e,!!t.prototype.isPrototypeOf(o)||(null===(r=e.constructor)||void 0===r?void 0:r.name)===t.name})(e,String)?"string":t})(t)===e,t=e=>t=>typeof t===e,n=e("string"),r=e("object"),o=e("array"),s=t("boolean"),a=(void 0,e=>undefined===e);const i=e=>null==e,l=e=>!i(e),c=t("function"),u=t("number"),d=()=>{},h=(e,t)=>(...n)=>e(t.apply(null,n)),m=e=>()=>e,p=e=>e,f=(e,t)=>e===t;function g(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}const v=e=>()=>{throw new Error(e)},y=e=>e(),b=m(!1),x=m(!0);class k{constructor(e,t){this.tag=e,this.value=t}static some(e){return new k(!0,e)}static none(){return k.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?k.some(e(this.value)):k.none()}bind(e){return this.tag?e(this.value):k.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:k.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return l(e)?k.some(e):k.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}k.singletonNone=new k(!1);const w=Array.prototype.slice,S=Array.prototype.indexOf,C=Array.prototype.push,T=(e,t)=>((e,t)=>S.call(e,t))(e,t)>-1,I=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},A=(e,t)=>{const n=e.length,r=new Array(n);for(let o=0;o<n;o++){const n=e[o];r[o]=t(n,o)}return r},O=(e,t)=>{for(let n=0,r=e.length;n<r;n++)t(e[n],n)},E=(e,t)=>{const n=[],r=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];(t(s,o)?n:r).push(s)}return{pass:n,fail:r}},L=(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];t(o,r)&&n.push(o)}return n},N=(e,t,n)=>(O(e,((e,r)=>{n=t(n,e,r)})),n),_=(e,t)=>((e,t,n)=>{for(let r=0,o=e.length;r<o;r++){const o=e[r];if(t(o,r))return k.some(o);if(n(o,r))break}return k.none()})(e,t,b),D=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(t(e[n],n))return k.some(n);return k.none()},P=e=>{const t=[];for(let n=0,r=e.length;n<r;++n){if(!o(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);C.apply(t,e[n])}return t},R=(e,t)=>P(A(e,t)),M=(e,t)=>{for(let n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},j=(e,t)=>{const n={};for(let r=0,o=e.length;r<o;r++){const o=e[r];n[String(o)]=t(o,r)}return n},F=(e,t)=>{const n=w.call(e,0);return n.sort(t),n},U=e=>((e,t)=>0<e.length?k.some(e[0]):k.none())(e),B=(e,t)=>{for(let n=0;n<e.length;n++){const r=t(e[n],n);if(r.isSome())return r}return k.none()},z=(e,t,n)=>""===t||e.length>=t.length&&e.substr(n,n+t.length)===t,H=(e,t)=>$(e,t)?((e,t)=>e.substring(t))(e,t.length):e,W=(e,t,n=0,r)=>{const o=e.indexOf(t,n);return-1!==o&&(!!a(r)||o+t.length<=r)},$=(e,t)=>z(e,t,0),V=(e,t)=>z(e,t,e.length-t.length),G=(q=/^\s+|\s+$/g,e=>e.replace(q,""));var q;const K=e=>parseInt(e,10),J=(e,t)=>{const n=e-t;return 0===n?0:n>0?1:-1},Y=(e,t,n)=>({major:e,minor:t,patch:n}),X=e=>{const t=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(e);return t?Y(K(t[1]),K(t[2]),K(t[3])):Y(0,0,0)},Z=e=>t=>t.options.get(e),Q=Z("paste_as_text"),ee=Z("paste_merge_formats"),te=Z("paste_tab_spaces"),ne=Z("smart_paste"),re=Z("cache_suffix"),oe=Z("automatic_uploads"),se=Z("indent_use_margin"),ae=Z("powerpaste_block_drop"),ie=Z("powerpaste_keep_unsupported_src"),le=Z("powerpaste_allow_local_images"),ce=Z("powerpaste_word_import"),ue=Z("powerpaste_googledocs_import"),de=Z("powerpaste_html_import"),he=Z("powerpaste_clean_filtered_inline_elements"),me=Z("link_default_protocol"),pe=e=>{var t;return tinymce.explode(null!==(t=e.options.get("images_file_types"))&&void