SmartIT_Extensions/BMC/smart-it-full/scripts/vendor/pdfjs/compatibility.min.js

21 lines
7.1 KiB
JavaScript

"undefined"===typeof PDFJS&&(("undefined"!==typeof window?window:this).PDFJS={});
(function(){function a(a,c){return new b(this.slice(a,c))}function c(b,a){2>arguments.length&&(a=0);for(var c=0,g=b.length;c<g;++c,++a)this[a]=b[c]&255}function b(b){var f,d,g;if("number"===typeof b)for(f=[],d=0;d<b;++d)f[d]=0;else if("slice"in b)f=b.slice(0);else for(f=[],d=0,g=b.length;d<g;++d)f[d]=b[d];f.subarray=a;f.buffer=f;f.byteLength=f.length;f.set=c;"object"===typeof b&&b.buffer&&(f.buffer=b.buffer);return f}"undefined"!==typeof Uint8Array?("undefined"===typeof Uint8Array.prototype.subarray&&
(Uint8Array.prototype.subarray=function(b,a){return new Uint8Array(this.slice(b,a))},Float32Array.prototype.subarray=function(b,a){return new Float32Array(this.slice(b,a))}),"undefined"===typeof Float64Array&&(window.Float64Array=Float32Array)):(window.Uint8Array=b,window.Int8Array=b,window.Uint32Array=b,window.Int32Array=b,window.Uint16Array=b,window.Float32Array=b,window.Float64Array=b)})();(function(){window.URL||(window.URL=window.webkitURL)})();
(function(){if("undefined"!==typeof Object.defineProperty){var a=!0;try{Object.defineProperty(new Image,"id",{value:"test"});var c=function(){};c.prototype={get id(){}};Object.defineProperty(new c,"id",{value:"",configurable:!0,enumerable:!0,writable:!1})}catch(b){a=!1}if(a)return}Object.defineProperty=function(b,a,c){delete b[a];"get"in c&&b.__defineGetter__(a,c.get);"set"in c&&b.__defineSetter__(a,c.set);"value"in c&&(b.__defineSetter__(a,function(b){this.__defineGetter__(a,function(){return b});
return b}),b[a]=c.value)}})();
(function(){var a=XMLHttpRequest.prototype,c=new XMLHttpRequest;"overrideMimeType"in c||Object.defineProperty(a,"overrideMimeType",{value:function(b){}});"responseType"in c||(PDFJS.disableWorker=!0,Object.defineProperty(a,"responseType",{get:function(){return this._responseType||"text"},set:function(b){if("text"===b||"arraybuffer"===b)this._responseType=b,"arraybuffer"===b&&"function"===typeof this.overrideMimeType&&this.overrideMimeType("text/plain; charset=x-user-defined")}}),"undefined"!==typeof VBArray?
Object.defineProperty(a,"response",{get:function(){return"arraybuffer"===this.responseType?new Uint8Array((new VBArray(this.responseBody)).toArray()):this.responseText}}):Object.defineProperty(a,"response",{get:function(){if("arraybuffer"!==this.responseType)return this.responseText;var b=this.responseText,a,c=b.length,d=new Uint8Array(c);for(a=0;a<c;++a)d[a]=b.charCodeAt(a)&255;return d.buffer}}))})();
(function(){"btoa"in window||(window.btoa=function(a){var c="",b,e;b=0;for(e=a.length;b<e;b+=3)var f=a.charCodeAt(b)&255,d=a.charCodeAt(b+1)&255,g=a.charCodeAt(b+2)&255,h=(f&3)<<4|d>>4,d=b+1<e?(d&15)<<2|g>>6:64,g=b+2<e?g&63:64,c=c+("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g));
return c})})();(function(){"atob"in window||(window.atob=function(a){a=a.replace(/=+$/,"");if(1===a.length%4)throw Error("bad atob input");for(var c=0,b,e,f=0,d="";e=a.charAt(f++);~e&&(b=c%4?64*b+e:e,c++%4)?d+=String.fromCharCode(255&b>>(-2*c&6)):0)e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e);return d})})();
(function(){"undefined"===typeof Function.prototype.bind&&(Function.prototype.bind=function(a){var c=this,b=Array.prototype.slice.call(arguments,1);return function(){var e=b.concat(Array.prototype.slice.call(arguments));return c.apply(a,e)}})})();
(function(){"dataset"in document.createElement("div")||Object.defineProperty(HTMLElement.prototype,"dataset",{get:function(){if(this._dataset)return this._dataset;for(var a={},c=0,b=this.attributes.length;c<b;c++){var e=this.attributes[c];if("data-"===e.name.substring(0,5)){var f=e.name.substring(5).replace(/\-([a-z])/g,function(b,a){return a.toUpperCase()});a[f]=e.value}}Object.defineProperty(this,"_dataset",{value:a,writable:!1,enumerable:!1});return a},enumerable:!0})})();
(function(){function a(b,a,c,d){var g=(b.className||"").split(/\s+/g);""===g[0]&&g.shift();var h=g.indexOf(a);0>h&&c&&g.push(a);0<=h&&d&&g.splice(h,1);b.className=g.join(" ");return 0<=h}if(!("classList"in document.createElement("div"))){var c={add:function(b){a(this.element,b,!0,!1)},contains:function(b){return a(this.element,b,!1,!1)},remove:function(b){a(this.element,b,!1,!0)},toggle:function(b){a(this.element,b,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList;
var b=Object.create(c,{element:{value:this,writable:!1,enumerable:!0}});Object.defineProperty(this,"_classList",{value:b,writable:!1,enumerable:!1});return b},enumerable:!0})}})();
(function(){"console"in window?"bind"in console.log||(console.log=function(a){return function(c){return a(c)}}(console.log),console.error=function(a){return function(c){return a(c)}}(console.error),console.warn=function(a){return function(c){return a(c)}}(console.warn)):window.console={log:function(){},error:function(){},warn:function(){}}})();
(function(){function a(b){c(b.target)&&b.stopPropagation()}function c(b){return b.disabled||b.parentNode&&c(b.parentNode)}-1!==navigator.userAgent.indexOf("Opera")&&document.addEventListener("click",a,!0)})();(function(){0<=navigator.userAgent.indexOf("Trident")&&(PDFJS.disableCreateObjectURL=!0)})();
(function(){if(!("language"in navigator&&/^[a-z]+(-[A-Z]+)?$/.test(navigator.language))){var a=PDFJS,c;c=(navigator.language||navigator.userLanguage||"en-US").split(/[-_]/);c[0]=c[0].toLowerCase();1<c.length&&(c[1]=c[1].toUpperCase());c=c.join("-");a.locale=c}})();(function(){var a=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor"),c=/Android\s[0-2][^\d]/.test(navigator.userAgent);if(a||c)PDFJS.disableRange=!0,PDFJS.disableStream=!0})();
(function(){if(!history.pushState||0<=navigator.userAgent.indexOf("Android 2."))PDFJS.disableHistory=!0})();
(function(){if(window.CanvasPixelArray)"function"!==typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(a){for(var b=0,e=this.length;b<e;b++)this[b]=a[b]});else{var a=!1;0<=navigator.userAgent.indexOf("Chrom")?a=(a=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./))&&21>parseInt(a[2]):0<=navigator.userAgent.indexOf("Android")?a=/Android\s[0-4][^\d]/g.test(navigator.userAgent):0<=navigator.userAgent.indexOf("Safari")&&(a=(a=navigator.userAgent.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//))&&
6>parseInt(a[1]));a&&(a=window.CanvasRenderingContext2D.prototype,a._createImageData=a.createImageData,a.createImageData=function(a,b){var e=this._createImageData(a,b);e.data.set=function(a){for(var b=0,c=this.length;b<c;b++)this[b]=a[b]};return e})}})();
(function(){function a(a){window.setTimeout(a,20)}/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?window.requestAnimationFrame=a:"requestAnimationFrame"in window||(window.requestAnimationFrame=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||a)})();(function(){var a=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),c=/Android/g.test(navigator.userAgent);if(a||c)PDFJS.maxCanvasPixels=5242880})();