UNPKG

ngx-extended-pdf-viewer

Version:

Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.

22 lines 468 kB
window.ngxZone.runOutsideAngular(() => { /** * @licstart The following is the entire license notice for the * JavaScript code in this page * * Copyright 2022 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * JavaScript code in this page */(()=>{var e=[,(e,t,i)=>{var n=i(2),r=i(3),s=i(4),o=i(8),a=i(62),l=i(17),c=l("iterator"),h=l("toStringTag"),d=o.values,handlePrototype=function(e,t){if(e){if(e[c]!==d)try{a(e,c,d)}catch(t){e[c]=d}e[h]||a(e,h,t);if(r[t])for(var i in o)if(e[i]!==o[i])try{a(e,i,o[i])}catch(t){e[i]=o[i]}}};for(var u in r)handlePrototype(n[u]&&n[u].prototype,u);handlePrototype(s,"DOMTokenList")},e=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},(e,t,i)=>{var n=i(5)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},(e,t,i)=>{var n=i(2),r=i(6),s=n.document,o=r(s)&&r(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},(e,t,i)=>{var n=i(7);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},e=>{e.exports=function(e){return"function"==typeof e}},(e,t,i)=>{"use strict";var n=i(9),r=i(16),s=i(58),o=i(59),a=i(35).f,l=i(64),c=i(19),h=i(33),d="Array Iterator",u=o.set,p=o.getterFor(d);e.exports=l(Array,"Array",(function(e,t){u(this,{type:d,target:n(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.kind,n=e.index++;if(!t||n>=t.length){e.target=void 0;return{value:void 0,done:!0}}return"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var g=s.Arguments=s.Array;r("keys");r("values");r("entries");if(!c&&h&&"values"!==g.name)try{a(g,"name",{value:"values"})}catch(e){}},(e,t,i)=>{var n=i(10),r=i(15);e.exports=function(e){return n(r(e))}},(e,t,i)=>{var n=i(11),r=i(13),s=i(14),o=Object,a=n("".split);e.exports=r((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?a(e,""):o(e)}:o},(e,t,i)=>{var n=i(12),r=Function.prototype,s=r.bind,o=r.call,a=n&&s.bind(o,o);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return o.apply(e,arguments)}}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,i)=>{var n=i(11),r=n({}.toString),s=n("".slice);e.exports=function(e){return s(r(e),8,-1)}},e=>{var t=TypeError;e.exports=function(e){if(null==e)throw t("Can't call method on "+e);return e}},(e,t,i)=>{var n=i(17),r=i(30),s=i(35).f,o=n("unscopables"),a=Array.prototype;null==a[o]&&s(a,o,{configurable:!0,value:r(null)});e.exports=function(e){a[o][e]=!0}},(e,t,i)=>{var n=i(2),r=i(18),s=i(22),o=i(24),a=i(25),l=i(29),c=r("wks"),h=n.Symbol,d=h&&h.for,u=l?h:h&&h.withoutSetter||o;e.exports=function(e){if(!s(c,e)||!a&&"string"!=typeof c[e]){var t="Symbol."+e;a&&s(h,e)?c[e]=h[e]:c[e]=l&&d?d(t):u(t)}return c[e]}},(e,t,i)=>{var n=i(19),r=i(20);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,i)=>{var n=i(2),r=i(21),s="__core-js_shared__",o=n[s]||r(s,{});e.exports=o},(e,t,i)=>{var n=i(2),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},(e,t,i)=>{var n=i(11),r=i(23),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return s(r(e),t)}},(e,t,i)=>{var n=i(15),r=Object;e.exports=function(e){return r(n(e))}},(e,t,i)=>{var n=i(11),r=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+s,36)}},(e,t,i)=>{var n=i(26),r=i(13);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,i)=>{var n,r,s=i(2),o=i(27),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(r=(n=h.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1]));!r&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(r=+n[1]);e.exports=r},(e,t,i)=>{var n=i(28);e.exports=n("navigator","userAgent")||""},(e,t,i)=>{var n=i(2),r=i(7),aFunction=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(n[e]):n[e]&&n[e][t]}},(e,t,i)=>{var n=i(25);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,i)=>{var n,r=i(31),s=i(32),o=i(55),a=i(54),l=i(56),c=i(5),h=i(57),d=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<script>"+e+"</"+"script>"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag(""));e.close();var t=e.parentWindow.Object;e=null;return t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):function(){var e,t=c("iframe");t.style.display="none";l.appendChild(t);t.src=String("javascript:");(e=t.contentWindow.document).open();e.write(scriptTag("document.F=Object"));e.close();return e.F}():NullProtoObjectViaActiveX(n);for(var e=o.length;e--;)delete NullProtoObject.prototype[o[e]];return NullProtoObject()};a[d]=!0;e.exports=Object.create||function create(e,t){var i;if(null!==e){EmptyConstructor.prototype=r(e);i=new EmptyConstructor;EmptyConstructor.prototype=null;i[d]=e}else i=NullProtoObject();return void 0===t?i:s.f(i,t)}},(e,t,i)=>{var n=i(6),r=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not an object")}},(e,t,i)=>{var n=i(33),r=i(34),s=i(35),o=i(31),a=i(9),l=i(46);t.f=n&&!r?Object.defineProperties:function defineProperties(e,t){o(e);for(var i,n=a(t),r=l(t),c=r.length,h=0;c>h;)s.f(e,i=r[h++],n[i]);return e}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},(e,t,i)=>{var n=i(33),r=i(13);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,i)=>{var n=i(33),r=i(36),s=i(34),o=i(31),a=i(37),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";t.f=n?s?function defineProperty(e,t,i){o(e);t=a(t);o(i);if("function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i.writable){var n=h(e,t);if(n&&n.writable){e[t]=i.value;i={configurable:u in i?i.configurable:n.configurable,enumerable:d in i?i.enumerable:n.enumerable,writable:!1}}}return c(e,t,i)}:c:function defineProperty(e,t,i){o(e);t=a(t);o(i);if(r)try{return c(e,t,i)}catch(e){}if("get"in i||"set"in i)throw l("Accessors not supported");"value"in i&&(e[t]=i.value);return e}},(e,t,i)=>{var n=i(33),r=i(13),s=i(5);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},(e,t,i)=>{var n=i(38),r=i(40);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},(e,t,i)=>{var n=i(39),r=i(6),s=i(40),o=i(42),a=i(45),l=i(17),c=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!r(e)||s(e))return e;var i,l=o(e,h);if(l){void 0===t&&(t="default");i=n(l,e,t);if(!r(i)||s(i))return i;throw c("Can't convert object to primitive value")}void 0===t&&(t="number");return a(e,t)}},(e,t,i)=>{var n=i(12),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},(e,t,i)=>{var n=i(28),r=i(7),s=i(41),o=i(29),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&s(t.prototype,a(e))}},(e,t,i)=>{var n=i(11);e.exports=n({}.isPrototypeOf)},(e,t,i)=>{var n=i(43);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},(e,t,i)=>{var n=i(7),r=i(44),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not a function")}},e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,i)=>{var n=i(39),r=i(7),s=i(6),o=TypeError;e.exports=function(e,t){var i,a;if("string"===t&&r(i=e.toString)&&!s(a=n(i,e)))return a;if(r(i=e.valueOf)&&!s(a=n(i,e)))return a;if("string"!==t&&r(i=e.toString)&&!s(a=n(i,e)))return a;throw o("Can't convert object to primitive value")}},(e,t,i)=>{var n=i(47),r=i(55);e.exports=Object.keys||function keys(e){return n(e,r)}},(e,t,i)=>{var n=i(11),r=i(22),s=i(9),o=i(48).indexOf,a=i(54),l=n([].push);e.exports=function(e,t){var i,n=s(e),c=0,h=[];for(i in n)!r(a,i)&&r(n,i)&&l(h,i);for(;t.length>c;)r(n,i=t[c++])&&(~o(h,i)||l(h,i));return h}},(e,t,i)=>{var n=i(9),r=i(49),s=i(52),createMethod=function(e){return function(t,i,o){var a,l=n(t),c=s(l),h=r(o,c);if(e&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===i)return e||h||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(e,t,i)=>{var n=i(50),r=Math.max,s=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):s(i,t)}},(e,t,i)=>{var n=i(51);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?i:t)(n)}},(e,t,i)=>{var n=i(53);e.exports=function(e){return n(e.length)}},(e,t,i)=>{var n=i(50),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},e=>{e.exports={}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t,i)=>{var n=i(28);e.exports=n("document","documentElement")},(e,t,i)=>{var n=i(18),r=i(24),s=n("keys");e.exports=function(e){return s[e]||(s[e]=r(e))}},e=>{e.exports={}},(e,t,i)=>{var n,r,s,o=i(60),a=i(2),l=i(11),c=i(6),h=i(62),d=i(22),u=i(20),p=i(57),g=i(54),f="Object already initialized",m=a.TypeError,v=a.WeakMap;if(o||u.state){var w=u.state||(u.state=new v),_=l(w.get),y=l(w.has),b=l(w.set);n=function(e,t){if(y(w,e))throw new m(f);t.facade=e;b(w,e,t);return t};r=function(e){return _(w,e)||{}};s=function(e){return y(w,e)}}else{var P=p("state");g[P]=!0;n=function(e,t){if(d(e,P))throw new m(f);t.facade=e;h(e,P,t);return t};r=function(e){return d(e,P)?e[P]:{}};s=function(e){return d(e,P)}}e.exports={set:n,get:r,has:s,enforce:function(e){return s(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!c(t)||(i=r(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return i}}}},(e,t,i)=>{var n=i(2),r=i(7),s=i(61),o=n.WeakMap;e.exports=r(o)&&/native code/.test(s(o))},(e,t,i)=>{var n=i(11),r=i(7),s=i(20),o=n(Function.toString);r(s.inspectSource)||(s.inspectSource=function(e){return o(e)});e.exports=s.inspectSource},(e,t,i)=>{var n=i(33),r=i(35),s=i(63);e.exports=n?function(e,t,i){return r.f(e,t,s(1,i))}:function(e,t,i){e[t]=i;return e}},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,i)=>{"use strict";var n=i(65),r=i(39),s=i(19),o=i(70),a=i(7),l=i(76),c=i(78),h=i(81),d=i(80),u=i(62),p=i(68),g=i(17),f=i(58),m=i(77),v=o.PROPER,w=o.CONFIGURABLE,_=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,b=g("iterator"),P="keys",S="values",E="entries",returnThis=function(){return this};e.exports=function(e,t,i,o,g,m,x){l(i,t,o);var C,T,I,getIterationMethod=function(e){if(e===g&&k)return k;if(!y&&e in A)return A[e];switch(e){case P:return function keys(){return new i(this,e)};case S:return function values(){return new i(this,e)};case E:return function entries(){return new i(this,e)}}return function(){return new i(this)}},M=t+" Iterator",L=!1,A=e.prototype,D=A[b]||A["@@iterator"]||g&&A[g],k=!y&&D||getIterationMethod(g),O="Array"==t&&A.entries||D;if(O&&(C=c(O.call(new e)))!==Object.prototype&&C.next){s||c(C)===_||(h?h(C,_):a(C[b])||p(C,b,returnThis));d(C,M,!0,!0);s&&(f[M]=returnThis)}if(v&&g==S&&D&&D.name!==S)if(!s&&w)u(A,"name",S);else{L=!0;k=function values(){return r(D,this)}}if(g){T={values:getIterationMethod(S),keys:m?k:getIterationMethod(P),entries:getIterationMethod(E)};if(x)for(I in T)(y||L||!(I in A))&&p(A,I,T[I]);else n({target:t,proto:!0,forced:y||L},T)}s&&!x||A[b]===k||p(A,b,k,{name:g});f[t]=k;return T}},(e,t,i)=>{var n=i(2),r=i(66).f,s=i(62),o=i(68),a=i(21),l=i(71),c=i(75);e.exports=function(e,t){var i,h,d,u,p,g=e.target,f=e.global,m=e.stat;if(i=f?n:m?n[g]||a(g,{}):(n[g]||{}).prototype)for(h in t){u=t[h];d=e.dontCallGetSet?(p=r(i,h))&&p.value:i[h];if(!c(f?h:g+(m?".":"#")+h,e.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(e.sham||d&&d.sham)&&s(u,"sham",!0);o(i,h,u,e)}}},(e,t,i)=>{var n=i(33),r=i(39),s=i(67),o=i(63),a=i(9),l=i(37),c=i(22),h=i(36),d=Object.getOwnPropertyDescriptor;t.f=n?d:function getOwnPropertyDescriptor(e,t){e=a(e);t=l(t);if(h)try{return d(e,t)}catch(e){}if(c(e,t))return o(!r(s.f,e,t),e[t])}},(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:i},(e,t,i)=>{var n=i(7),r=i(35),s=i(69),o=i(21);e.exports=function(e,t,i,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;n(i)&&s(i,c,a);if(a.global)l?e[t]=i:o(t,i);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},(e,t,i)=>{var n=i(13),r=i(7),s=i(22),o=i(33),a=i(70).CONFIGURABLE,l=i(61),c=i(59),h=c.enforce,d=c.get,u=Object.defineProperty,p=o&&!n((function(){return 8!==u((function(){}),"length",{value:8}).length})),g=String(String).split("String"),f=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(t="get "+t);i&&i.setter&&(t="set "+t);(!s(e,"name")||a&&e.name!==t)&&(o?u(e,"name",{value:t,configurable:!0}):e.name=t);p&&i&&s(i,"arity")&&e.length!==i.arity&&u(e,"length",{value:i.arity});try{i&&s(i,"constructor")&&i.constructor?o&&u(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);s(n,"source")||(n.source=g.join("string"==typeof t?t:""));return e};Function.prototype.toString=f((function toString(){return r(this)&&d(this).source||l(this)}),"toString")},(e,t,i)=>{var n=i(33),r=i(22),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=r(s,"name"),l=a&&"something"===function something(){}.name,c=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},(e,t,i)=>{var n=i(22),r=i(72),s=i(66),o=i(35);e.exports=function(e,t,i){for(var a=r(t),l=o.f,c=s.f,h=0;h<a.length;h++){var d=a[h];n(e,d)||i&&n(i,d)||l(e,d,c(t,d))}}},(e,t,i)=>{var n=i(28),r=i(11),s=i(73),o=i(74),a=i(31),l=r([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=s.f(a(e)),i=o.f;return i?l(t,i(e)):t}},(e,t,i)=>{var n=i(47),r=i(55).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,r)}},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,i)=>{var n=i(13),r=i(7),s=/#|\.prototype\./,isForced=function(e,t){var i=a[o(e)];return i==c||i!=l&&(r(t)?n(t):!!t)},o=isForced.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";e.exports=isForced},(e,t,i)=>{"use strict";var n=i(77).IteratorPrototype,r=i(30),s=i(63),o=i(80),a=i(58),returnThis=function(){return this};e.exports=function(e,t,i,l){var c=t+" Iterator";e.prototype=r(n,{next:s(+!l,i)});o(e,c,!1,!0);a[c]=returnThis;return e}},(e,t,i)=>{"use strict";var n,r,s,o=i(13),a=i(7),l=i(30),c=i(78),h=i(68),d=i(17),u=i(19),p=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(r=c(c(s)))!==Object.prototype&&(n=r):g=!0);null==n||o((function(){var e={};return n[p].call(e)!==e}))?n={}:u&&(n=l(n));a(n[p])||h(n,p,(function(){return this}));e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},(e,t,i)=>{var n=i(22),r=i(7),s=i(23),o=i(57),a=i(79),l=o("IE_PROTO"),c=Object,h=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=s(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?h:null}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(e,t,i)=>{var n=i(35).f,r=i(22),s=i(17)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype);e&&!r(e,s)&&n(e,s,{configurable:!0,value:t})}},(e,t,i)=>{var n=i(11),r=i(31),s=i(82);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]);t=i instanceof Array}catch(e){}return function setPrototypeOf(i,n){r(i);s(n);t?e(i,n):i.__proto__=n;return i}}():void 0)},(e,t,i)=>{var n=i(7),r=String,s=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw s("Can't set "+r(e)+" as a prototype")}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;i(84);const n=Object.create(null);t.compatibilityParams=n;{const e=navigator.userAgent||"",t=navigator.platform||"",i=navigator.maxTouchPoints||1,r=/Android/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&i>1;!function checkCanvasSizeLimitation(){(s||r)&&(n.maxCanvasPixels=5242880)}()}const r={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=r;const s={annotationEditorMode:{value:-1,kind:r.VIEWER+r.PREFERENCE},annotationMode:{value:2,kind:r.VIEWER+r.PREFERENCE},cursorToolOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},defaultZoomValue:{value:"",kind:r.VIEWER+r.PREFERENCE},disableHistory:{value:!1,kind:r.VIEWER},disablePageLabels:{value:!1,kind:r.VIEWER+r.PREFERENCE},enablePermissions:{value:!1,kind:r.VIEWER+r.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:r.VIEWER+r.PREFERENCE},enableScripting:{value:!0,kind:r.VIEWER+r.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:r.VIEWER},externalLinkTarget:{value:0,kind:r.VIEWER+r.PREFERENCE},historyUpdateUrl:{value:!1,kind:r.VIEWER+r.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:r.VIEWER+r.PREFERENCE},imageResourcesPath:{value:"./images/",kind:r.VIEWER},maxCanvasPixels:{value:16777216,kind:r.VIEWER},forcePageColors:{value:!1,kind:r.VIEWER+r.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:r.VIEWER+r.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:r.VIEWER+r.PREFERENCE},pdfBugEnabled:{value:!1,kind:r.VIEWER+r.PREFERENCE},printResolution:{value:150,kind:r.VIEWER},removePageBorders:{value:!1,kind:r.VIEWER+r.PREFERENCE},sidebarViewOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},scrollModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},spreadModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},textLayerMode:{value:1,kind:r.VIEWER+r.PREFERENCE},useOnlyCssZoom:{value:!1,kind:r.VIEWER+r.PREFERENCE},viewerCssTheme:{value:0,kind:r.VIEWER+r.PREFERENCE},viewOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},cMapPacked:{value:!0,kind:r.API},cMapUrl:{value:"../web/cmaps/",kind:r.API},disableAutoFetch:{value:!1,kind:r.API+r.PREFERENCE},disableFontFace:{value:!1,kind:r.API+r.PREFERENCE},disableRange:{value:!1,kind:r.API+r.PREFERENCE},disableStream:{value:!1,kind:r.API+r.PREFERENCE},docBaseUrl:{value:"",kind:r.API},enableXfa:{value:!0,kind:r.API+r.PREFERENCE},fontExtraProperties:{value:!1,kind:r.API},isEvalSupported:{value:!0,kind:r.API},maxImageSize:{value:-1,kind:r.API},pdfBug:{value:!1,kind:r.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:r.API},verbosity:{value:1,kind:r.API},workerPort:{value:null,kind:r.WORKER},workerSrc:{value:"./assets/pdf.worker.js",kind:r.WORKER}};s.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:r.VIEWER};s.disablePreferences={value:!1,kind:r.VIEWER};s.locale={value:navigator.language||"en-US",kind:r.VIEWER};s.renderer={value:"canvas",kind:r.VIEWER+r.PREFERENCE};s.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:r.VIEWER};const o=Object.create(null);if(globalThis.pdfDefaultOptions)for(const e in globalThis.pdfDefaultOptions)o[e]=globalThis.pdfDefaultOptions[e];t.AppOptions=class AppOptions{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=o[e];if(void 0!==t)return t;const i=s[e];if(void 0!==i){var r;return null!==(r=n[e])&&void 0!==r?r:i.value}}static getAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=Object.create(null);for(const a in s){var i;const l=s[a];if(e){if(0==(e&l.kind))continue;if(e===r.PREFERENCE){const e=l.value,i=typeof e;if("boolean"===i||"string"===i||"number"===i&&Number.isInteger(e)){t[a]=e;continue}throw new Error("Invalid type for preference: ".concat(a))}}const c=o[a];t[a]=void 0!==c?c:null!==(i=n[a])&&void 0!==i?i:l.value}return t}static set(e,t){o[e]=t}static setAll(e){for(const t in e)o[t]=e[t]}static remove(e){delete o[e]}static _hasUserOptions(){return Object.keys(o).length>0}}},(e,t,i)=>{"use strict";var n=i(65),r=i(85);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},(e,t,i)=>{"use strict";var n=i(39),r=i(11),s=i(86),o=i(89),a=i(90),l=i(18),c=i(30),h=i(59).get,d=i(91),u=i(92),p=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,f=g,m=r("".charAt),v=r("".indexOf),w=r("".replace),_=r("".slice),y=function(){var e=/a/,t=/b*/g;n(g,e,"a");n(g,t,"a");return 0!==e.lastIndex||0!==t.lastIndex}(),b=a.BROKEN_CARET,P=void 0!==/()??/.exec("")[1];(y||P||b||d||u)&&(f=function exec(e){var t,i,r,a,l,d,u,S=this,E=h(S),x=s(e),C=E.raw;if(C){C.lastIndex=S.lastIndex;t=n(f,C,x);S.lastIndex=C.lastIndex;return t}var T=E.groups,I=b&&S.sticky,M=n(o,S),L=S.source,A=0,D=x;if(I){M=w(M,"y","");-1===v(M,"g")&&(M+="g");D=_(x,S.lastIndex);if(S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(x,S.lastIndex-1))){L="(?: "+L+")";D=" "+D;A++}i=new RegExp("^(?:"+L+")",M)}P&&(i=new RegExp("^"+L+"$(?!\\s)",M));y&&(r=S.lastIndex);a=n(g,I?i:S,D);if(I)if(a){a.input=_(a.input,A);a[0]=_(a[0],A);a.index=S.lastIndex;S.lastIndex+=a[0].length}else S.lastIndex=0;else y&&a&&(S.lastIndex=S.global?a.index+a[0].length:r);P&&a&&a.length>1&&n(p,a[0],i,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(a[l]=void 0)}));if(a&&T){a.groups=d=c(null);for(l=0;l<T.length;l++)d[(u=T[l])[0]]=a[u[1]]}return a});e.exports=f},(e,t,i)=>{var n=i(87),r=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},(e,t,i)=>{var n=i(88),r=i(7),s=i(14),o=i(17)("toStringTag"),a=Object,l="Arguments"==s(function(){return arguments}());e.exports=n?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?i:l?s(t):"Object"==(n=s(t))&&r(t.callee)?"Arguments":n}},(e,t,i)=>{var n={};n[i(17)("toStringTag")]="z";e.exports="[object z]"===String(n)},(e,t,i)=>{"use strict";var n=i(31);e.exports=function(){var e=n(this),t="";e.hasIndices&&(t+="d");e.global&&(t+="g");e.ignoreCase&&(t+="i");e.multiline&&(t+="m");e.dotAll&&(t+="s");e.unicode&&(t+="u");e.unicodeSets&&(t+="v");e.sticky&&(t+="y");return t}},(e,t,i)=>{var n=i(13),r=i(2).RegExp,s=n((function(){var e=r("a","y");e.lastIndex=2;return null!=e.exec("abcd")})),o=s||n((function(){return!r("a","y").sticky})),a=s||n((function(){var e=r("^r","gy");e.lastIndex=2;return null!=e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},(e,t,i)=>{var n=i(13),r=i(2).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},(e,t,i)=>{var n=i(13),r=i(2).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFViewerApplication=t.PDFPrintServiceFactory=t.DefaultExternalServices=void 0;i(1);i(94);i(84);i(132);i(133);i(139);i(153);var n=i(154),r=i(156),s=i(83),o=i(157),a=i(158),l=i(160),c=i(161),h=i(162),d=i(164),u=i(165),p=i(167),g=i(168),f=i(169),m=i(178),v=i(179),w=i(180),_=i(181),y=i(182),b=i(184),P=i(185),S=i(186),E=i(187),x=i(189),C=i(250),T=i(251),I=i(252);const M=-1,L=1,A={AUTOMATIC:0,LIGHT:1,DARK:2},D=["1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0","2.1","2.2","2.3"],k=["acrobat distiller","acrobat pdfwriter","adobe livecycle","adobe pdf library","adobe photoshop","ghostscript","tcpdf","cairo","dvipdfm","dvips","pdftex","pdfkit","itext","prince","quarkxpress","mac os x","microsoft","openoffice","oracle","luradocument","pdf-xchange","antenna house","aspose.cells","fpdf"];class DefaultExternalServices{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(e){}static updateFindMatchesCount(e){}static initPassiveLoading(e){}static reportTelemetry(e){}static createDownloadManager(e){throw new Error("Not implemented: createDownloadManager")}static createPreferences(){throw new Error("Not implemented: createPreferences")}static createL10n(e){throw new Error("Not implemented: createL10n")}static createScripting(e){throw new Error("Not implemented: createScripting")}static get supportsIntegratedFind(){return(0,r.shadow)(this,"supportsIntegratedFind",!1)}static get supportsDocumentFonts(){return(0,r.shadow)(this,"supportsDocumentFonts",!0)}static get supportedMouseWheelZoomModifierKeys(){return(0,r.shadow)(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}static get isInAutomation(){return(0,r.shadow)(this,"isInAutomation",!1)}static updateEditorStates(e){throw new Error("Not implemented: updateEditorStates")}}t.DefaultExternalServices=DefaultExternalServices;const O={initialBookmark:document.location.hash.substring(1),_initializedCapability:(0,r.createPromiseCapability)(),appConfig:null,pdfDocument:null,pdfLoadingTask:null,printService:null,pdfViewer:null,pdfThumbnailViewer:null,pdfRenderingQueue:null,pdfPresentationMode:null,pdfDocumentProperties:null,pdfLinkService:null,pdfHistory:null,pdfSidebar:null,pdfSidebarResizer:null,pdfOutlineViewer:null,pdfAttachmentViewer:null,pdfLayerViewer:null,pdfCursorTools:null,pdfScriptingManager:null,store:null,downloadManager:null,overlayManager:null,preferences:null,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,annotationEditorParams:null,isInitialViewSet:!1,downloadComplete:!1,isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",_downloadUrl:"",externalServices:DefaultExternalServices,_boundEvents:Object.create(null),documentInfo:null,metadata:null,_contentDispositionFilename:null,_contentLength:null,_saveInProgress:!1,_docStats:null,_wheelUnusedTicks:0,_idleCallbacks:new Set,_PDFBug:null,_printAnnotationStoragePromise:null,async initialize(e){this.preferences=this.externalServices.createPreferences();this.appConfig=e;await this._readPreferences();await this._parseHashParameters();this._forceCssTheme();await this._initializeL10n();this.isViewerEmbedded&&s.AppOptions.get("externalLinkTarget")===l.LinkTarget.NONE&&s.AppOptions.set("externalLinkTarget",l.LinkTarget.TOP);await this._initializeViewerComponents();this.bindEvents();this.bindWindowEvents();const t=e.appContainer||document.documentElement;this.l10n.translate(t).then((()=>{this.eventBus.dispatch("localized",{source:this})}));this._initializedCapability.resolve();this.initializeLoadingBar()},async _readPreferences(){if(!s.AppOptions.get("disablePreferences")){s.AppOptions._hasUserOptions()&&Window.ngxConsole.warn('_readPreferences: The Preferences may override manually set AppOptions; please use the "disablePreferences"-option in order to prevent that.');try{s.AppOptions.setAll(await this.preferences.getAll())}catch(e){Window.ngxConsole.error('_readPreferences: "'.concat(null==e?void 0:e.message,'".'))}}},async _parseHashParameters(){if(!s.AppOptions.get("pdfBugEnabled"))return;const e=document.location.hash.substring(1);if(!e)return;const{mainContainer:t,viewerContainer:i}=this.appConfig,o=(0,n.parseQueryString)(e);if("true"===o.get("disableworker"))try{await async function loadFakeWorker(){r.GlobalWorkerOptions.workerSrc||(r.GlobalWorkerOptions.workerSrc=s.AppOptions.get("workerSrc"));"Function"===r.GlobalWorkerOptions.workerSrc.constructor.name&&(r.GlobalWorkerOptions.workerSrc=r.GlobalWorkerOptions.workerSrc());await(0,r.loadScript)(r.PDFWorker.workerSrc)}()}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}o.has("disablerange")&&s.AppOptions.set("disableRange","true"===o.get("disablerange"));o.has("disablestream")&&s.AppOptions.set("disableStream","true"===o.get("disablestream"));o.has("disableautofetch")&&s.AppOptions.set("disableAutoFetch","true"===o.get("disableautofetch"));o.has("disablefontface")&&s.AppOptions.set("disableFontFace","true"===o.get("disablefontface"));o.has("disablehistory")&&s.AppOptions.set("disableHistory","true"===o.get("disablehistory"));o.has("verbosity")&&s.AppOptions.set("verbosity",0|o.get("verbosity"));if(o.has("textlayer"))switch(o.get("textlayer")){case"off":s.AppOptions.set("textLayerMode",n.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":i.classList.add("textLayer-".concat(o.get("textlayer")));try{await loadPDFBug(this);this._PDFBug.loadCSS()}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}}if(o.has("pdfbug")){s.AppOptions.set("pdfBug",!0);s.AppOptions.set("fontExtraProperties",!0);const e=o.get("pdfbug").split(",");try{await loadPDFBug(this);this._PDFBug.init({OPS:r.OPS},t,e)}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}}o.has("locale")&&s.AppOptions.set("locale",o.get("locale"))},async _initializeL10n(){this.l10n=this.externalServices.createL10n({locale:s.AppOptions.get("locale")});const e=await this.l10n.getDirection();document.getElementsByTagName("html")[0].dir=e},_forceCssTheme(){const e=s.AppOptions.get("viewerCssTheme");if(e!==A.AUTOMATIC&&Object.values(A).includes(e))try{const i=document.styleSheets[0],n=(null==i?void 0:i.cssRules)||[];for(let r=0,s=n.length;r<s;r++){var t;const s=n[r];if(s instanceof CSSMediaRule&&"(prefers-color-scheme: dark)"===(null===(t=s.media)||void 0===t?void 0:t[0])){if(e===A.LIGHT){i.deleteRule(r);return}const t=/^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(s.cssText);if(null!=t&&t[1]){i.deleteRule(r);i.insertRule(t[1],r)}return}}}catch(e){Window.ngxConsole.error('_forceCssTheme: "'.concat(null==e?void 0:e.message,'".'))}},async _initializeViewerComponents(){const{appConfig:e,externalServices:t}=this,i=t.isInAutomation?new o.AutomationEventBus:new o.EventBus;this.eventBus=i;this.overlayManager=new h.OverlayManager;const n=new y.PDFRenderingQueue;n.onIdle=this._cleanup.bind(this);this.pdfRenderingQueue=n;const I=new l.PDFLinkService({eventBus:i,externalLinkTarget:s.AppOptions.get("externalLinkTarget"),externalLinkRel:s.AppOptions.get("externalLinkRel"),ignoreDestinationZoom:s.AppOptions.get("ignoreDestinationZoom")});this.pdfLinkService=I;const M=t.createDownloadManager();this.downloadManager=M;const L=new f.PDFFindController({linkService:I,eventBus:i,pageViewMode:s.AppOptions.get("pageViewMode")});this.findController=L;const A=new b.PDFScriptingManager({eventBus:i,sandboxBundleSrc:s.AppOptions.get("sandboxBundleSrc"),scriptingFactory:t,docPropertiesLookup:this._scriptingDocProperties.bind(this)});this.pdfScriptingManager=A;const D=e.mainContainer,k=e.viewerContainer,O=s.AppOptions.get("annotationEditorMode"),R=s.AppOptions.get("forcePageColors")||window.matchMedia("(forced-colors: active)").matches?{background:s.AppOptions.get("pageColorsBackground"),foreground:s.AppOptions.get("pageColorsForeground")}:null;this.pdfViewer=new x.PDFViewer({container:D,viewer:k,eventBus:i,renderingQueue:n,linkService:I,downloadManager:M,findController:L,scriptingManager:s.AppOptions.get("enableScripting")&&A,renderer:s.AppOptions.get("renderer"),l10n:this.l10n,textLayerMode:s.AppOptions.get("textLayerMode"),annotationMode:s.AppOptions.get("annotationMode"),annotationEditorMode:O,imageResourcesPath:s.AppOptions.get("imageResourcesPath"),removePageBorders:s.AppOptions.get("removePageBorders"),enablePrintAutoRotate:s.AppOptions.get("enablePrintAutoRotate"),useOnlyCssZoom:s.AppOptions.get("useOnlyCssZoom"),maxCanvasPixels:s.AppOptions.get("maxCanvasPixels"),pageViewMode:s.AppOptions.get("pageViewMode"),enablePermissions:s.AppOptions.get("enablePermissions"),pageColors:R});n.setViewer(this.pdfViewer);I.setViewer(this.pdfViewer);A.setViewer(this.pdfViewer);this.pdfThumbnailViewer=new E.PDFThumbnailViewer({container:e.sidebar.thumbnailView,eventBus:i,renderingQueue:n,linkService:I,l10n:this.l10n,pageColors:R});n.setThumbnailViewer(this.pdfThumbnailViewer);if(!this.isViewerEmbedded&&!s.AppOptions.get("disableHistory")){this.pdfHistory=new m.PDFHistory({linkService:I,eventBus:i});I.setHistory(this.pdfHistory)}this.supportsIntegratedFind||(this.findBar=new g.PDFFindBar(e.findBar,i,this.l10n));if(O!==r.AnnotationEditorType.DISABLE){this.annotationEditorParams=new c.AnnotationEditorParams(e.annotationEditorParams,i);for(const e of[document.getElementById("editorModeButtons"),document.getElementById("editorModeSeparator")])e.classList.remove("hidden")}this.pdfDocumentProperties=new p.PDFDocumentProperties(e.documentProperties,this.overlayManager,i,this.l10n,(()=>this._docFilename));this.pdfCursorTools=new a.PDFCursorTools({container:D,eventBus:i,cursorToolOnLoad:s.AppOptions.get("cursorToolOnLoad")});this.toolbar=new T.Toolbar(e.toolbar,i,this.l10n);this.secondaryToolbar=new C.SecondaryToolbar(e.secondaryToolbar,i);this.supportsFullscreen&&(this.pdfPresentationMode=new _.PDFPresentationMode({container:D,pdfViewer:this.pdfViewer,eventBus:i}));let B=s.AppOptions.get("passwordPrompt");B||(B=new d.PasswordPrompt(e.passwordOverlay,this.overlayManager,this.l10n,this.isViewerEmbedded));this.passwordPrompt=B;this.pdfOutlineViewer=new w.PDFOutlineViewer({container:e.sidebar.outlineView,eventBus:i,linkService:I});this.pdfAttachmentViewer=new u.PDFAttachmentViewer({container:e.sidebar.attachmentsView,eventBus:i,downloadManager:M});this.pdfLayerViewer=new v.PDFLayerViewer({container:e.sidebar.layersView,eventBus:i,l10n:this.l10n});this.pdfSidebar=new P.PDFSidebar({elements:e.sidebar,pdfViewer:this.pdfViewer,pdfThumbnailViewer:this.pdfThumbnailViewer,eventBus:i,l10n:this.l10n});this.pdfSidebar.onToggled=this.forceRendering.bind(this);this.pdfSidebarResizer=new S.PDFSidebarResizer(e.sidebarResizer,i,this.l10n)},run(e){this.initialize(e).then(webViewerInitialized)},get initialized(){return this._initializedCapability.settled},get initializedPromise(){return this._initializedCapability.promise},zoomIn(e){this.pdfViewer.isInPresentationMode||this.pdfViewer.increaseScale(e)},zoomOut(e){this.pdfViewer.isInPresentationMode||this.pdfViewer.decreaseScale(e)},zoomReset(){this.pdfViewer.isInPresentationMode||(this.pdfViewer.currentScaleValue=n.DEFAULT_SCALE_VALUE)},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},get page(){return this.pdfViewer.currentPageNumber},set page(e){this.pdfViewer.currentPageNumber=e},get supportsPrinting(){return N.instance.supportsPrinting},get supportsFullscreen(){return(0,r.shadow)(this,"supportsFullscreen",document.fullscreenEnabled)},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},initializeLoadingBar(){const e=new n.ProgressBar("loadingBar");e.hide();return(0,r.shadow)(this,"loadingBar",e)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.url=e;this.baseUrl=e.split("#")[0];t&&(this._downloadUrl=t===e?this.baseUrl:t.split("#")[0]);let i=(0,r.getPdfFilenameFromUrl)(e,"");if(!i)try{i=decodeURIComponent((0,r.getFilenameFromUrl)(e))||e}catch(t){i=e}this.setTitle(i)},setTitle(e){this.isViewerEmbedded||(document.title=e)},get _docFilename(){return this._contentDispositionFilename||(0,r.getPdfFilenameFromUrl)(this.url)},_hideViewBookmark(){const{toolbar:e,secondaryToolbar:t}=this.appConfig;e.viewBookmark.hidden=!0;t.viewBookmarkButton.hidden=!0},_cancelIdleCallbacks(){if(this._idleCallbacks.size){for(const e of this._idleCallbacks)window.cancelIdleCallback(e);this._idleCallbacks.clear()}},async close(){var e,t,i,n;this._unblockDocumentLoadEvent();this._hideViewBookmark();const{container:r}=this.appConfig.errorWrapper;r.hidden=!0;if(!this.pdfLoadingTask)return;if((null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.size)>0&&this._annotationStorageModified)try{await this.save()}catch(e){}const s=[];s.push(this.pdfLoadingTask.destroy());this.pdfLoadingTask=null;if(this.pdfDocument){this.pdfDocument=null;this.pdfThumbnailViewer.setDocument(null);this.pdfViewer.setDocument(null);this.pdfLinkService.setDocument(null);this.pdfDocumentProperties.setDocument(null)}this.pdfLinkService.externalLinkEnabled=!0;this.store=null;this.isInitialViewSet=!1;this.downloadComplete=!1;this.url="";this.baseUrl="";this._downloadUrl="";this.documentInfo=null;this.metadata=null;this._contentDispositionFilename=null;this._contentLength=null;this._saveInProgress=!1;this._docStats=null;this._cancelIdleCallbacks();s.push(this.pdfScriptingManager.destroyPromise);this.pdfSidebar.reset();this.pdfOutlineViewer.reset();this.pdfAttachmentViewer.reset();this.pdfLayerViewer.reset();null===(t=this.pdfHistory)||void 0===t||t.reset();null===(i=this.findBar)||void 0===i||i.reset();this.toolbar.reset();this.secondaryToolbar.reset();null===(n=this._PDFBug)||void 0===n||n.cleanup();await Promise.all(s)},async open(e,t){window.adjacentPagesLoader=void 0;window.ngxZone.runOutsideAngular((async()=>{this.pdfLoadingTask&&await this.close();const i=s.AppOptions.getAll(s.OptionKind.WORKER);for(const e in i)r.GlobalWorkerOptions[e]=i[e];const n=Object.create(null);if("string"==typeof e){this.setTitleUsingUrl(e,e);n.url=e}else if(e&&"byteLength"in e)n.data=e;else if(e.url&&e.originalUrl){this.setTitleUsingUrl(e.originalUrl,e.url);n.url=e.url}const o=s.AppOptions.getAll(s.OptionKind.API);for(const e in o){let t=o[e];n[e]=t}if(t)for(const e in t)n[e]=t[e];const a=(0,r.getDocument)(n);this.pdfLoadingTask=a;a.onPassword=(e,t)=>{this.pdfLinkService.externalLinkEnabled=!1;this.passwordPrompt.setUpdateCallback(e,t);this.passwordPrompt.open()};a.onProgress=e=>{let{loaded:t,total:i}=e;this.progress(t/i);this.eventBus.dispatch("progress",{source:this,type:"load",total:i,loaded:t,percent:100*t/i})};a.onUnsupportedFeature=this.fallback.bind(this);this.loadingBar.show();return a.promise.then((e=>{this.load(e)}),(e=>{if(a!==this.pdfLoadingTask)return;let t="loading_error";e instanceof r.InvalidPDFException?t="invalid_file_error":e instanceof r.MissingPDFException?t="missing_file_error":e instanceof r.UnexpectedResponseException&&(t="unexpected_response_error");O.onError&&O.onError(e);return this.l10n.get(t).then((t=>{this._documentError(t,{message:null==e?void 0:e.message});throw e}))}))}))},_ensureDownloadComplete(){if(!this.pdfDocument||!this.downloadComplete)throw new Error("PDF document not downloaded.")},async download(){const e=this._downloadUrl,t=this._docFilename;try{this._ensureDownloadComplete();const i=await this.pdfDocument.getData(),n=new Blob([i],{type:"application/pdf"});await this.downloadManager.download(n,e,t)}catch(i){await this.downloadManager.downloadUrl(e,t)}},async save(){var e;if(this._saveInProgress)return;this._saveInProgress=!0;await this.pdfScriptingManager.dispatchWillSave();const t=this._downloadUrl,i=this._docFilename;try{this._ensureDownloadComplete();const e=await this.pdfDocument.saveDocument(),n=new Blob([e],{type:"application/pdf"});await this.downloadManager.download(n,t,i)}catch(e){Window.ngxConsole.error("Error when saving the document: ".concat(e.message));await this.download()}finally{await this.pdfScriptingManager.dispatchDidSave();this._saveInProgress=!1}null!==(e=this.pdfDocument)&&void 0!==e&&e.annotationStorage.hasAnnotationEditors&&this.externalServices.reportTelemetry({type:"editing",data:{type:"save"}})},downloadOrSave(){var e;(null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.size)>0?this.save():this.download()},fallback(e){this.externalServices.reportTelemetry({type:"unsupportedFeature",featureId:e})},_documentError(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._unblockDocumentLoadEvent();this._otherError(e,i);this.eventBus.dispatch("documenterror",{source:this,message:e,reason:null!==(t=null==i?void 0:i.message)&&void 0!==t?t:null})},_otherError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.l10n.get("error_version_info",{version:r.version||"?",build:r.build||"?"})];if(t){i.push(this.l10n.get("error_message",{message:t.message}));if(t.stack)i.push(this.l10n.get("error_stack",{stack:t.stack}));else{t.filename&&i.push(this.l10n.get("error_file",{file:t.filename}));t.lineNumber&&i.push(this.l10n.get("error_line",{line:t.lineNumber}))}}const s=this.appConfig.errorWrapper,o=s.container;o.hidden=!1;s.errorMessage.textContent=e;const a=s.closeButton;a.onclick=function(){o.hidden=!0};const l=s.errorMoreInfo,c=s.moreInfoButton,h=s.lessInfoButton;c.onclick=function(){l.hidden=!1;c.hidden=!0;h.hidden=!1;l.style.height=l.scrollHeight+"px"};h.onclick=function(){l.hidden=!0;c.hidden=!1;h.hidden=!0};c.oncontextmenu=n.noContextMenuHandler;h.oncontextmenu=n.noContextMenuHandler;a.oncontextmenu=n.noContextMenuHandler;c.hidden=!1;h.hidden=!0;Promise.all(i).then((e=>{l.value=e.join("\n")}))},progress(e){var t,i;if(this.downloadComplete)return;const n=Math.round(100*e);if(n<=this.loadingBar.percent)return;this.loadingBar.percent=n;if((null!==(t=null===(i=this.pdfDocument)||void 0===i?void 0:i.loadingParams.disableAutoFetch)&&void 0!==t?t:s.AppOptions.get("disableAutoFetch"))&&!isNaN(n)){if(this.disableAutoFetchLoadingBarTimeout){clearTimeout(this.disableAutoFetchLoadingBarTimeout);this.disableAutoFetchLoadingBarTimeout=null}this.loadingBar.show();this.disableAutoFetchLoadingBarTimeout=setTimeout((()=>{this.loadingBar.hide();this.disableAutoFetchLoadingBarTimeout=null}),5e3)}},load(e){this.pdfDocument=e;e.getDownloadInfo().then((e=>{let{length:t}=e;this._contentLength=t;this.downloadComplete=!0;this.loadingBar.hide();l.then((()=>{this.eventBus.dispatch("documentloaded",{source:this})}))}));const t=e.getPageLayout().catch((function(){})),i=e.getPageMode().catch((function(){})),r=e.getOpenAction().catch((function(){}));this.toolbar.setPagesCount(e.numPages,!1);this.secondaryToolbar.setPagesCount(e.numPages);let o;o=null;this.pdfLinkService.setDocument(e,null);this.pdfDocumentProperties.setDocument(e);const a=this.pdfViewer;a.setDocument(e);const{firstPagePromise:l,onePageRendered:c,pagesPromise:h}=a;this.pdfThumbnailViewer.setDocument(e);const d=(this.store=new I.ViewHistory(e.fingerprints[0])).getMultiple({page:null,zoom:n.DEFAULT_SCALE_VALUE,scrollLeft:"0",scrollTop:"0",rotation:null,sidebarView:n.SidebarView.UNKNOWN,scrollMode:n.ScrollMode.UNKNOWN,spreadMode:n.SpreadMode.UNKNOWN}).catch((()=>Object.create(null)));l.then((o=>{this.loadingBar.setWidth(this.appConfig.viewerContainer);this._initializeAnnotationStorageCallbacks(e);Promise.all([n.animationStarted,d,t,i,r]).then((async t=>{let[i,r,o,l,c]=t;const d=s.AppOptions.get("viewOnLoad");this._initializePdfHistory({fingerprint:e.fingerprints[0],viewOnLoad:d,initialDest:null==c?void 0:c.dest});const u=this.initialBookmark,p=s.AppOptions.get("defaultZoomValue");let g=p?"zoom=".concat(p):null,f=null,m=s.AppOptions.get("sidebarViewOnLoad"),v=s.AppOptions.get("scrollModeOnLoad"),w=s.AppOptions.get("spreadModeOnLoad");if(r.page&&d!==L){g="page=".concat(r.page,"&zoom=").concat(p||r.zoom,",")+"".concat(r.scrollLeft,",").concat(r.scrollTop);f=parseInt(r.rotation,10);m===n.SidebarView.UNKNOWN&&(m=0|r.sidebarView);v===n.ScrollMode.UNKNOWN&&(v=0|r.scrollMode);w===n.SpreadMode.UNKNOWN&&(w=0|r.spreadMode)}l&&m===n.SidebarView.UNKNOWN&&(m=(0,n.apiPageModeToSidebarView)(l));if(o&&v===n.ScrollMode.UNKNOWN&&w===n.SpreadMode.UNKNOWN){w=(0,n.apiPageLayoutToViewerModes)(o).spreadMode}this.setInitialView(g,{rotation:f,sidebarView:m,scrollMode:v,spreadMode:w});this.eventBus.dispatch("documentinit",{source:this});this.isViewerEmbedded||a.focus();await Promise.race([h,new Promise((e=>{setTimeout(e,10)}))]);if((u||g)&&!a.hasEqualPageSizes){this.initialBookmark=u;a.currentScaleValue=a.currentScaleValue;this.setInitialView(g)}})).catch((()=>{this.setInitialView()})).then((function(){a.update()}))}));h.then((()=>{this._unblockDocumentLoadEvent();this._initializeAutoPrint(e,r)}),(e=>{O.onError&&O.onError(e);this.l10n.get("loading_error").then((t=>{this._documentError(t,{message:null==e?void 0:e.message})}))}));c.then((t=>{this.externalServices.reportTelemetry({type:"pageInfo",timestamp:t.timestamp});e.getOutline().then((t=>{e===this.pdfDocument&&this.pdfOutlineViewer.render({outline:t,pdfDocument:e})}));e.getAttachments().then((t=>{e===this.pdfDocument&&this.pdfAttachmentViewer.render({attachments:t})}));a.optionalContentConfigPromise.then((t=>{e===this.pdfDocument&&this.pdfLayerViewer.render({optionalContentConfig:t,pdfDocument:e})}));if("requestIdleCallback"in window){const t=window.requestIdleCallback((()=>{this._collectTelemetry(e);this._idleCallbacks.delete(t)}),{timeout:1e3});this._idleCallbacks.add(t)}}));this._initializePageLabels(e);this._initializeMetadata(e)},async _scriptingDocProperties(e){var t,i;if(!this.documentInfo){await new Promise((e=>{this.eventBus._on("metadataloaded",e,{once:!0})}));if(e!==this.pdfDocument)return null}if(!this._contentLength){await new Promise((e=>{this.eventBus._on("documentloaded",e,{once:!0})}));if(e!==this.pdfDocument)return null}return{...this.documentInfo,baseURL:this.baseUrl,filesize:this._contentLength,filename:this._docFilename,metadata:null===(t=this.metadata)||void 0===t?void 0:t.getRaw(),authors:null===(i=this.metadata)||void 0===i?void 0:i.get("dc:creator"),numPages:this.pagesCount,URL:this.url}},async _collectTelemetry(e){const t=await this.pdfDocument.getMarkInfo();if(e!==this.pdfDocument)return;const i=(null==t?void 0:t.Marked)||!1;this.externalServices.reportTelemetry({type:"tagged",tagged:i})},async _initializeAutoPrint(e,t){const[i,s]=await Promise.all([t,this.pdfViewer.enableScripting?null:e.getJavaScript()]);if(e!==this.pdfDocument)return;let o=!1;"Print"===(null==i?void 0:i.action)&&(o=!0);if(s){s.some((e=>{if(!e)return!1;Window.ngxConsole.warn("Warning: JavaScript support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.javaScript);return!0}));if(!o)for(const e of s)if(e&&n.AutoPrintRegExp.test(e)){o=!0;break}}o&&this.triggerPrinting()},async _initializeMetadata(e){var t,i;const{info:n,metadata:s,contentDispositionFilename:o,contentLength:a}=await e.getMetadata();if(e!==this.pdfDocument)return;this.documentInfo=n;this.metadata=s;null!==(t=this._contentDispositionFilename)&&void 0!==t||(this._contentDispositionFilename=o);null!==(i=this._contentLength)&&void 0!==i||(this._contentLength=a);const l=window.PDFViewerApplicationOptions;if(!l||l.get("verbosity")>0){Window.ngxConsole.log("PDF viewer: ngx-extended-pdf-viewer running on pdf.js "+(window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"].version:" developer version (?)"));Window.ngxConsole.log("PDF ".concat(e.fingerprints[0]," [").concat(n.PDFFormatVersion," ")+"".concat((n.Producer||"-").trim()," / ").concat((n.Creator||"-").trim(),"] ")+"(PDF.js: ".concat(r.version||"-")+"".concat(this.pdfViewer.enableWebGL?" [WebGL]":"",") modified by ngx-extended-pdf-viewer)"))}let c=null==n?void 0:n.Title;const h=null==s?void 0:s.get("dc:title");h&&("Untitled"===h||/[\uFFF0-\uFFFF]/g.test(h)||(c=h));c?this.setTitle("".concat(c," - ").concat(this._contentDispositionFilename||document.title)):this._contentDispositionFilename&&this.setTitle(this._contentDispositionFilename);if(!n.IsXFAPresent||n.IsAcroFormPresent||e.isPureXfa){if((n.IsAcroFormPresent||n.IsXFAPresent)&&!this.pdfViewer.renderForms){Window.ngxConsole.warn("Warning: Interactive form support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.forms)}}else{e.loadingParams.enableXfa?Window.ngxConsole.warn("Warning: XFA Foreground documents are not supported"):Window.ngxConsole.warn("Warning: XFA support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.forms)}if(n.IsSignaturesPresent){Window.ngxConsole.warn("Warning: Digital signatures validation is not supported");this.fallback(r.UNSUPPORTED_FEATURES.signatures)}let d="other";D.includes(n.PDFFormatVersion)&&(d="v".concat(n.PDFFormatVersion.replace(".","_")));let u="other";if(n.Producer){const e=n.Producer.toLowerCase();k.some((function(t){if(!e.includes(t))return!1;u=t.replace(/[ .