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

10 lines
54 KiB
JavaScript
Raw Permalink Normal View History

2023-11-01 22:54:59 -04:00
/*!
2024-03-21 17:16:22 -04:00
* Tiny Enhanced Tables plugin
2023-11-01 22:54:59 -04:00
*
* Copyright (c) 2023 Ephox Corporation DBA Tiny Technologies, Inc.
* Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
*
2024-03-21 17:16:22 -04:00
* Version: 7.0.0-22
2023-11-01 22:54:59 -04:00
*/
2024-03-21 17:16:22 -04:00
!function(){"use strict";const e=e=>parseInt(e,10),t=(e,t)=>{const o=e-t;return 0===o?0:o>0?1:-1},o=(e,t,o)=>({major:e,minor:t,patch:o}),n=t=>{const n=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(t);return n?o(e(n[1]),e(n[2]),e(n[3])):o(0,0,0)},r=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var o,n,r,s})(t)===e,s=e=>t=>typeof t===e,l=e=>t=>e===t,c=r("string"),i=r("object"),a=r("array"),m=l(null),u=s("boolean"),d=l(void 0),h=e=>null==e,p=e=>!h(e),g=s("function"),f=s("number");class w{constructor(e,t){this.tag=e,this.value=t}static some(e){return new w(!0,e)}static none(){return w.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?w.some(e(this.value)):w.none()}bind(e){return this.tag?e(this.value):w.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:w.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 p(e)?w.some(e):w.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()"}}w.singletonNone=new w(!1);const b=()=>{},v=e=>()=>e,y=e=>e,C=(e,t)=>e===t;function x(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const S=v(!1),T=v(!0),R=Array.prototype.slice,D=Array.prototype.indexOf,O=Array.prototype.push,A=(e,t)=>{return o=e,n=t,D.call(o,n)>-1;var o,n},E=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},k=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},N=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},W=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},L=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r<s;r++){const s=e[r];(t(s,r)?o:n).push(s)}return{pass:o,fail:n}},M=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},j=(e,t)=>{if(0===e.length)return[];{let o=t(e[0]);const n=[];let r=[];for(let s=0,l=e.length;s<l;s++){const l=e[s],c=t(l);c!==o&&(n.push(r),r=[]),o=c,r.push(l)}return 0!==r.length&&n.push(r),n}},B=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),I=(e,t,o)=>(W(e,((e,n)=>{o=t(o,e,n)})),o),P=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return w.some(r);if(o(r,n))break}return w.none()})(e,t,S),z=(e,t)=>(e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!a(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);O.apply(t,e[o])}return t})(N(e,t)),_=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},F=(e,t)=>{const o=R.call(e,0);return o.sort(t),o},$=(e,t)=>t>=0&&t<e.length?w.some(e[t]):w.none(),V=e=>$(e,0),G=e=>$(e,e.length-1),q=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return w.none()},H=(e,t,o=C)=>e.exists((e=>o(e,t))),U=(e,t,o)=>e.isSome()&&t.isSome()?w.some(o(e.getOrDie(),t.getOrDie())):w.none(),K=e=>e.bind(y),Q=(e,t)=>e?w.some(t):w.none(),X=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Y={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return X(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return X(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return X(o)},fromDom:X,fromPoint:(e,t,o)=>w.from(e.dom.elementFromPoint(t,o)).map(X)},J="undefined"!=typeof window?window:Function("return this;