mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-31 00:48:41 +03:00
7 lines
1.7 MiB
JavaScript
7 lines
1.7 MiB
JavaScript
|
|
/**
|
||
|
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
||
|
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
||
|
|
*/
|
||
|
|
let e;try{e={window:window,document:document}}catch{e={window:{},document:{}}}function t(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const i=t(),n={isMac:s(i),isWindows:o(i),isGecko:r(i),isSafari:a(i),isiOS:l(i),isAndroid:c(i),isBlink:u(i),get isMediaForcedColors(){return h()},get isMotionReduced(){return m()},features:{isRegExpUnicodePropertySupported:d()}};function s(e){return e.indexOf("macintosh")>-1}function o(e){return e.indexOf("windows")>-1}function r(e){return!!e.match(/gecko\/\d+/)}function a(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function l(e){return!!e.match(/iphone|ipad/i)||s(e)&&navigator.maxTouchPoints>0}function c(e){return e.indexOf("android")>-1}function u(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function d(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch{}return e}function h(){return!!e.window.matchMedia&&e.window.matchMedia("(forced-colors: active)").matches}function m(){return!!e.window.matchMedia&&e.window.matchMedia("(prefers-reduced-motion)").matches}function g(e,t,i,n){i=i||function(e,t){return e===t};const s=Array.isArray(e)?e:Array.prototype.slice.call(e),o=Array.isArray(t)?t:Array.prototype.slice.call(t),r=function(e,t,i){const n=f(e,t,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=p(e,n),o=p(t,n),r=f(s,o,i),a=e.length-r,l=t.length-r;return{firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(s,o,i),a=n?function(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:s}=e;if(-1===i)return Array(t).fill("equal");let o=[];i>0&&(o=o.concat(Array(i).fill("equal")));s-i>0&&(o=o.concat(Array(s-i).fill("insert")));n-i>0&&(o=o.concat(Array(n-i).fill("delete")));s<t&&(o=o.concat(Array(t-s).fill("equal")));return o}(r,o.length):function(e,t){const i=[],{firstIndex:n,lastIndexOld:s,lastIndexNew:o}=t;o-n>0&&i.push({index:n,type:"insert",values:e.slice(n,o)});s-n>0&&i.push({index:n+(o-n),type:"delete",howMany:s-n});return i}(o,r);return a}function f(e,t,i){for(let n=0;n<Math.max(e.length,t.length);n++)if(void 0===e[n]||void 0===t[n]||!i(e[n],t[n]))return n;return-1}function p(e,t){return e.slice(t).reverse()}function b(e,t,i){i=i||function(e,t){return e===t};const n=e.length,s=t.length;if(n>200||s>200||n+s>300)return b.fastDiff(e,t,i,!0);let o,r;if(s<n){const i=e;e=t,t=i,o="delete",r="insert"}else o="insert",r="delete";const a=e.length,l=t.length,c=l-a,u={},d={};function h(n){const s=(void 0!==d[n-1]?d[n-1]:-1)+1,c=void 0!==d[n+1]?d[n+1]:-1,h=s>c?-1:1;u[n+h]&&(u[n]=u[n+h].slice(0)),u[n]||(u[n]=[]),u[n].push(s>c?o:r);let m=Math.max(s,c),g=m-n;for(;g<a&&m<l&&i(e[g],t[m]);)g++,m++,u[n].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)d[m]=h(m);for(m=c+g;m>c;m--)d[m]=h(m);d[c]=h(c),g++}while(d[c]!==l);return u[c].slice(1)}function w(e,t){const i=[];let n=0,s=null;return e.forEach(e=>{"equal"==e?(o(),n++):"insert"==e?(s&&"insert"==s.type?s.values.push(t[n]):(o(),s={type:"insert",index:n,values:[t[n]]}),n++):s&&"delete"==s.type?s.howMany++:(o(),s={type:"delete",index:n,howMany:1})}),o(),i;function o(){s&&(i.push(s),s=null)}}function v(e,t){if(e===t&&("object"==typeof(i=e)&&null!==i))return!0;var i;const n=_(e),s=_(t);for(const e of n)if(s.has(e))return!0;return!1}function _(e){const t=[e],i=new Set;for(;t.length>0;){const e=t.shift();if(!i.has(e)&&!y(e))if(i.add(e),e[Symbol.iterator])try{t.push(...e)}catch{}else t.push(...Object.values(e))}return i}function y(e){const t=Object.prototype.toString.call(e);return"[object Number]"===t||"[object Boolean]"===t||"[object String]"===t||"[object Symbol]"===t||"[object Function]"===t||"[object Date]"===t||"[object RegExp]"===t||null==e||e instanceof EventTarget||e instanceof Event}function k(){return function e(){e.called=!0}}b.fastDiff=g;class C{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const x=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function A(){const[e,t,i,n]=crypto.getRandomValues(new Uint32Array(4));return"e"+x[255&e]+x[e>>8&
|
||
|
|
//# sourceMappingURL=ckeditor5.js.map
|