Files
fad_oa/ruoyi-ui/public/file-viewer/assets/image-blob-reduce.esm-NzmDxm1v.js

2 lines
44 KiB
JavaScript
Raw Normal View History

var e=function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=Object(arguments[n]),t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};function t(e,t){var n={};return t.forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n}function n(e){return t(e,[`alpha`,`unsharpAmount`,`unsharpRadius`,`unsharpThreshold`,`cancelToken`])}var r={assign:e,pick:t,pick_pica_resize_options:n};function i(e){var t={exports:{}};return e(t,t.exports),t.exports}function a(e){throw Error(`Could not dynamically require "`+e+`". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.`)}var o=i(function(e,t){(function(t){e.exports=t()})(function(){return(function(){function e(t,n,r){function i(s,c){if(!n[s]){if(!t[s]){var l=typeof a==`function`&&a;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[s]={exports:{}};t[s][0].call(d.exports,function(e){var n=t[s][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[s].exports}for(var o=typeof a==`function`&&a,s=0;s<r.length;s++)i(r[s]);return i}return e})()({1:[function(e,t,n){var r=e(`inherits`),i=e(`multimath`),a=e(`./mm_unsharp_mask`),o=e(`./mm_resize`);function s(e){var t=e||[],n={js:t.indexOf(`js`)>=0,wasm:t.indexOf(`wasm`)>=0};i.call(this,n),this.features={js:n.js,wasm:n.wasm&&this.has_wasm()},this.use(a),this.use(o)}r(s,i),s.prototype.resizeAndUnsharp=function(e,t){var n=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(n,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),n},t.exports=s},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(e,t,n){function r(e){return e<0?0:e>255?255:e}function i(e,t,n,i,a,o){var s,c,l,u,d,f,p,m,h,g,_,v=0,y=0;for(h=0;h<i;h++){for(d=0,g=0;g<a;g++){for(f=o[d++],p=o[d++],m=v+f*4|0,s=c=l=u=0;p>0;p--)_=o[d++],u=u+_*e[m+3]|0,l=l+_*e[m+2]|0,c=c+_*e[m+1]|0,s=s+_*e[m]|0,m=m+4|0;t[y+3]=r(u+8192>>14),t[y+2]=r(l+8192>>14),t[y+1]=r(c+8192>>14),t[y]=r(s+8192>>14),y=y+i*4|0}y=(h+1)*4|0,v=(h+1)*n*4|0}}function a(e,t,n,i,a,o){var s,c,l,u,d,f,p,m,h,g,_,v=0,y=0;for(h=0;h<i;h++){for(d=0,g=0;g<a;g++){for(f=o[d++],p=o[d++],m=v+f*4|0,s=c=l=u=0;p>0;p--)_=o[d++],u=u+_*e[m+3]|0,l=l+_*e[m+2]|0,c=c+_*e[m+1]|0,s=s+_*e[m]|0,m=m+4|0;t[y+3]=r(u+8192>>14),t[y+2]=r(l+8192>>14),t[y+1]=r(c+8192>>14),t[y]=r(s+8192>>14),y=y+i*4|0}y=(h+1)*4|0,v=(h+1)*n*4|0}}t.exports={convolveHorizontally:i,convolveVertically:a}},{}],3:[function(e,t,n){t.exports=`AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEXA2AAAGAGf39/f39/AGAHf39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMEAwABAgYGAX8AQQALB1cFEV9fd2FzbV9jYWxsX2N0b3JzAAAIY29udm9sdmUAAQpjb252b2x2ZUhWAAIMX19kc29faGFuZGxlAwAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAAK7AMDAwABC8YDAQ9/AkAgA0UNACAERQ0AA0AgDCENQQAhE0EAIQcDQCAHQQJqIQYCfyAHQQF0IAVqIgcuAQIiFEUEQEGAwAAhCEGAwAAhCUGAwAAhCkGAwAAhCyAGDAELIBIgBy4BAGohCEEAIQsgFCEHQQAhDiAGIQlBACEPQQAhEANAIAUgCUEBdGouAQAiESAAIAhBAnRqKAIAIgpBGHZsIBBqIRAgCkH/AXEgEWwgC2ohCyAKQRB2Qf8BcSARbCAPaiEPIApBCHZB/wFxIBFsIA5qIQ4gCEEBaiEIIAlBAWohCSAHQQFrIgcNAAsgC0GAQGshCCAOQYBAayEJIA9BgEBrIQogEEGAQGshCyAGIBRqCyEHIAEgDUECdGogCUEOdSIGQf8BIAZB/wFIGyIGQQAgBkEAShtBCHRBgP4DcSAKQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EQdEGAgPwHcSALQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EYdHJyIAhBDnUiBkH/ASAGQf8BSBsiBkEAIAZBAEobcjYCACADIA1qIQ0gE0EBaiITIARHDQALIAxBAWoiDCACbCESIAMgDEcNAAsLCx4AQQAgAiADIAQgBSAAEAEgAkEAIAQgBSAGIAEQAQs=`},{}],4:[function(e,t,n){t.exports={name:`resize`,fn:e(`./resize`),wasm_fn:e(`./resize_wasm`),wasm_src:e(`./convolve_wasm_base64`)}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(e,t,n){var r=e(`./resize_filter_gen`),i=e(`./convolve`).convolveHorizontally,a=e(`./convolve`).convolveVertically;function o(e,t,n){for(var r=3,i=t*n*4|0;r<i;)e[r]=255,r=r+4|0}t.exports=function(e){var t=e.src,n=e.width,s=e.height,c=e.toWidth,l=e.toHeight,u=e.scaleX||e.toWidth/e.width,d=e.scaleY||e.toHeight/e.height,f=e.offsetX||0,p=e.offsetY||0,m=e.dest||new Uint8Array(c*l*4),h=e.quality===void 0?3:e.quality,g=e.alpha||!1,_=r(h,n,c,u,f),v
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(e,t){if(e){if(typeof e==`string`)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}}function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function c(e){if(Array.isArray(e))return e}var l=e(`object-assign`),u=e(`webworkify`),d=e(`./lib/mathlib`),f=e(`./lib/pool`),p=e(`./lib/utils`),m=e(`./lib/worker`),h=e(`./lib/stepper`),g=e(`./lib/tiler`),_={},v=!1;try{typeof navigator<`u`&&navigator.userAgent&&(v=navigator.userAgent.indexOf(`Safari`)>=0)}catch{}var y=1;typeof navigator<`u`&&(y=Math.min(navigator.hardwareConcurrency||1,4));var b={tile:1024,concurrency:y,features:[`js`,`wasm`,`ww`],idle:2e3,createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n}},x={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},S=!1,C=!1,w=!1,T=!1,E=!1;function D(){return{value:u(m),destroy:function(){if(this.value.terminate(),typeof window<`u`){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function O(e){if(!(this instanceof O))return new O(e);this.options=l({},b,e||{});var t=`lk_${this.options.concurrency}`;this.__limit=_[t]||p.limiter(this.options.concurrency),_[t]||(_[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}O.prototype.init=function(){var t=this;if(this.__initPromise)return this.__initPromise;if(typeof ImageData<`u`&&typeof Uint8ClampedArray<`u`)try{new ImageData(new Uint8ClampedArray(400),10,10),S=!0}catch{}typeof ImageBitmap<`u`&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?C=!0:this.debug(`ImageBitmap does not support .close(), disabled`));var n=this.options.features.slice();if(n.indexOf(`all`)>=0&&(n=[`cib`,`wasm`,`js`,`ww`]),this.__requested_features=n,this.__mathlib=new d(n),n.indexOf(`ww`)>=0&&typeof window<`u`&&`Worker`in window)try{e(`webworkify`)(function(){}).terminate(),this.features.ww=!0;var r=`wp_${JSON.stringify(this.options)}`;_[r]?this.__workersPool=_[r]:(this.__workersPool=new f(D,this.options.idle),_[r]=this.__workersPool)}catch{}var i=this.__mathlib.init().then(function(e){l(t.features,e.features)}),a=C?p.cib_support(this.options.createCanvas).then(function(e){if(t.features.cib&&n.indexOf(`cib`)<0){t.debug(`createImageBitmap() resize supported, but disabled by config`);return}n.indexOf(`cib`)>=0&&(t.features.cib=e)}):Promise.resolve(!1);w=p.can_use_canvas(this.options.createCanvas);var o=C&&S&&n.indexOf(`ww`)!==-1?p.worker_offscreen_canvas_support():Promise.resolve(!1);o=o.then(function(e){T=e});var s=p.cib_can_use_region().then(function(e){E=e});return this.__initPromise=Promise.all([i,a,o,s]).then(function(){return t}),this.__initPromise},O.prototype.__invokeResize=function(e,t){var n=this;return t.__mathCache=t.__mathCache||{},Promise.resolve().then(function(){return n.features.ww?new Promise(function(r,i){var a=n.__workersPool.acquire();t.cancelToken&&t.cancelToken.catch(function(e){return i(e)}),a.value.onmessage=function(e){a.release(),e.data.err?i(e.data.err):r(e.data)};var o=[];e.src&&o.push(e.src.buffer),e.srcBitmap&&o.push(e.srcBitmap),a.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},o)}):{data:n.__mathlib.resizeAndUnsharp(e,t.__mathCache)}})},O.prototype.__extractTileData=function(e,t,n,r,i){if(this.features.ww&&T&&(p.isCanvas(t)||E))return this.debug(`Create tile for O