2 lines
31 KiB
JavaScript
2 lines
31 KiB
JavaScript
/*! For license information please see comicsPlayer-plugin.69bfe13f659ce6243479.chunk.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[41542],{79145:function(e,t,n){n.r(t),n.d(t,{ComicsPlayer:function(){return me},default:function(){return be}}),n(29305),n(32733),n(84701),n(81678),n(2623),n(24776),n(14382),n(69892),n(76281),n(44962),n(17731),n(89336),n(26448),n(4754),n(10849),n(58551),n(70389),n(94),n(36947),n(26437),n(52697),n(78557),n(90076),n(95021),n(73687),n(50987),n(83994),n(23630),n(82367),n(24362),n(76218),n(99102);var r=n(71857);function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function c(n,r,i,a){var c=r&&r.prototype instanceof u?r:u,l=Object.create(c.prototype);return o(l,"_invoke",function(n,r,i){var o,a,c,u=0,l=i||[],f=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,a=0,c=e,h.n=n,s}};function p(n,r){for(a=n,c=r,t=0;!f&&u&&!i&&t<l.length;t++){var i,o=l[t],p=h.p,v=o[2];n>3?(i=v===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=n<2&&p<o[1])?(a=0,h.v=r,h.n=o[1]):p<v&&(i=n<3||o[0]>r||r>v)&&(o[4]=n,o[5]=r,h.n=v,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,v){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,v),a=l,c=v;(t=a<2?e:c)||!f;){o||(a?a<3?(a>1&&(h.n=-1),p(a,c)):h.n=c:h.v=c);try{if(u=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=h.n<0)?c:n.call(r,h))!==s)break}catch(t){o=e,a=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,i,a),!0),l}var s={};function u(){}function l(){}function f(){}t=Object.getPrototypeOf;var h=[][r]?t(t([][r]())):(o(t={},r,(function(){return this})),t),p=f.prototype=u.prototype=Object.create(h);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=f,o(p,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(p),o(p,a,"Generator"),o(p,r,(function(){return this})),o(p,"toString",(function(){return"[object Generator]"})),(i=function(){return{w:c,m:v}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var a=function(t,n){o(e,t,(function(e){return this._invoke(t,n,e)}))};a("next",0),a("throw",1),a("return",2)}},o(e,t,n,r)}function a(e,t,n,r,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function c(e){a(o,r,i,c,s,"next",e)}function s(e){a(o,r,i,c,s,"throw",e)}c(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,c=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return c}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function g(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}n(86765),n(86584),n(20518),n(72915),n(77575),n(83810),n(21359),n(646),n(84518),n(82402);var S=Symbol("Comlink.proxy"),E=Symbol("Comlink.endpoint"),P=Symbol("Comlink.releaseProxy"),k=Symbol("Comlink.finalizer"),_=Symbol("Comlink.thrown"),O=function(e){return"object"==w(e)&&null!==e||"function"==typeof e},T=new Map([["proxy",{canHandle:function(e){return O(e)&&e[S]},serialize:function(e){var t=new MessageChannel,n=t.port1,r=t.port2;return j(e,n),[r,[r]]},deserialize:function(e){return e.start(),I(e)}}],["throw",{canHandle:function(e){return O(e)&&_ in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["*"];t.addEventListener("message",(function r(i){if(i&&i.data)if(function(e,t){var n,r=m(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t===i||"*"===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}catch(e){r.e(e)}finally{r.f()}return!1}(n,i.origin)){var o,a=Object.assign({path:[]},i.data),c=a.id,s=a.type,u=a.path,l=(i.data.argumentList||[]).map(V);try{var p=u.slice(0,-1).reduce((function(e,t){return e[t]}),e),g=u.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":o=g;break;case"SET":p[u.slice(-1)[0]]=V(i.data.value),o=!0;break;case"APPLY":o=g.apply(p,l);break;case"CONSTRUCT":o=F(function(e,t,n){if(d())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&v(i,n.prototype),i}(g,y(l)));break;case"ENDPOINT":var b=new MessageChannel,w=b.port1,S=b.port2;j(e,S),o=function(e,t){return z.set(e,t),e}(w,[w]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=h({value:e},_,0)}Promise.resolve(o).catch((function(e){return h({value:e},_,0)})).then((function(n){var i=f(N(n),2),o=i[0],a=i[1];t.postMessage(Object.assign(Object.assign({},o),{id:c}),a),"RELEASE"===s&&(t.removeEventListener("message",r),C(t),k in e&&"function"==typeof e[k]&&e[k]())})).catch((function(e){var n=f(N(h({value:new TypeError("Unserializable return value")},_,0)),2),r=n[0],i=n[1];t.postMessage(Object.assign(Object.assign({},r),{id:c}),i)}))}else console.warn("Invalid origin '".concat(i.origin,"' for comlink proxy"))})),t.start&&t.start()}function C(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function I(e,t){return x(e,[],t)}function L(e){if(e)throw new Error("Proxy has been released and is not useable")}function A(e){return U(e,{type:"RELEASE"}).then((function(){C(e)}))}var D=new WeakMap,R="FinalizationRegistry"in globalThis&&new FinalizationRegistry((function(e){var t=(D.get(e)||0)-1;D.set(e,t),0===t&&A(e)}));function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!1,r=new Proxy(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},{get:function(i,o){if(L(n),o===P)return function(){!function(e){R&&R.unregister(e)}(r),A(e),n=!0};if("then"===o){if(0===t.length)return{then:function(){return r}};var a=U(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(V);return a.then.bind(a)}return x(e,[].concat(y(t),[o]))},set:function(r,i,o){L(n);var a=f(N(o),2),c=a[0],s=a[1];return U(e,{type:"SET",path:[].concat(y(t),[i]).map((function(e){return e.toString()})),value:c},s).then(V)},apply:function(r,i,o){L(n);var a=t[t.length-1];if(a===E)return U(e,{type:"ENDPOINT"}).then(V);if("bind"===a)return x(e,t.slice(0,-1));var c=f(M(o),2),s=c[0],u=c[1];return U(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:s},u).then(V)},construct:function(r,i){L(n);var o=f(M(i),2),a=o[0],c=o[1];return U(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:a},c).then(V)}});return function(e,t){var n=(D.get(t)||0)+1;D.set(t,n),R&&R.register(e,t,e)}(r,e),r}function M(e){var t,n=e.map(N);return[n.map((function(e){return e[0]})),(t=n.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var z=new WeakMap;function F(e){return Object.assign(e,h({},S,!0))}function N(e){var t,n=m(T);try{for(n.s();!(t=n.n()).done;){var r=f(t.value,2),i=r[0],o=r[1];if(o.canHandle(e)){var a=f(o.serialize(e),2);return[{type:"HANDLER",name:i,value:a[0]},a[1]]}}}catch(e){n.e(e)}finally{n.f()}return[{type:"RAW",value:e},z.get(e)||[]]}function V(e){switch(e.type){case"HANDLER":return T.get(e.name).deserialize(e.value);case"RAW":return e.value}}function U(e,t,n){return new Promise((function(r){var i=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===i&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)}))}var G=function(){return l((function e(t,n,r,i,o){s(this,e),this._name=t,this._size=n,this._path=r,this._lastModified=i,this._archiveRef=o}),[{key:"name",get:function(){return this._name}},{key:"size",get:function(){return this._size}},{key:"lastModified",get:function(){return this._lastModified}},{key:"extract",value:function(){return this._archiveRef.extractSingleFile(this._path)}}])}();function W(e){if(e instanceof File||e instanceof G||null===e)return e;for(var t={},n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];t[i]=W(e[i])}return t}function B(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];e[o]instanceof File||e[o]instanceof G||null===e[o]?n.push({file:e[o]||o,path:t}):n.push.apply(n,y(B(e[o],"".concat(t).concat(o,"/"))))}return n}function q(e,t){var n=t.split("/");""===n[n.length-1]&&n.pop();var r,i=e,o=null,a=m(n);try{for(a.s();!(r=a.n()).done;){var c=r.value;i[c]=i[c]||{},o=i,i=i[c]}}catch(e){a.e(e)}finally{a.f()}return[o,n[n.length-1]]}var Z,K,H=function(){return l((function e(t,n,r){s(this,e),this._content={},this._processed=0,this.file=t,this.client=n,this.worker=r}),[{key:"open",value:function(){var e=this;return this._content={},this._processed=0,new Promise((function(t,n){e.client.open(e.file,F((function(){t(e)})))}))}},{key:"close",value:(u=c(i().m((function e(){var t;return i().w((function(e){for(;;)switch(e.n){case 0:null===(t=this.worker)||void 0===t||t.terminate(),this.worker=null,this.client=null,this.file=null;case 1:return e.a(2)}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"hasEncryptedData",value:(a=c(i().m((function e(){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.client.hasEncryptedData();case 1:return e.a(2,e.v)}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"usePassword",value:(o=c(i().m((function e(t){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.client.usePassword(t);case 1:return e.a(2)}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"setLocale",value:(r=c(i().m((function e(t){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.client.setLocale(t);case 1:return e.a(2)}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getFilesObject",value:(n=c(i().m((function e(){var t=this;return i().w((function(e){for(;;)switch(e.n){case 0:if(!(this._processed>0)){e.n=1;break}return e.a(2,Promise.resolve().then((function(){return t._content})));case 1:return e.n=2,this.client.listFiles();case 2:return e.v.forEach((function(e){var n=f(q(t._content,e.path),2),r=n[0],i=n[1];"FILE"===e.type&&(r[i]=new G(e.fileName,e.size,e.path,e.lastModified,t))})),this._processed=1,e.a(2,W(this._content))}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getFilesArray",value:function(){return this.getFilesObject().then((function(e){return B(e)}))}},{key:"extractSingleFile",value:(t=c(i().m((function e(t){var n;return i().w((function(e){for(;;)switch(e.n){case 0:if(null!==this.worker){e.n=1;break}throw new Error("Archive already closed");case 1:return e.n=2,this.client.extractSingleFile(t);case 2:return n=e.v,e.a(2,new File([n.fileData],n.fileName,{type:"application/octet-stream",lastModified:n.lastModified/1e6}))}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"extractFiles",value:(e=c(i().m((function e(){var t,n,r=this,o=arguments;return i().w((function(e){for(;;)switch(e.n){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:void 0,!(this._processed>1)){e.n=1;break}return e.a(2,Promise.resolve().then((function(){return r._content})));case 1:return e.n=2,this.client.extractFiles();case 2:return e.v.forEach((function(e){var n=f(q(r._content,e.path),2),i=n[0],o=n[1];"FILE"===e.type&&(i[o]=new File([e.fileData],e.fileName,{type:"application/octet-stream"}),void 0!==t&&setTimeout(t.bind(null,{file:i[o],path:e.path})))})),this._processed=2,null===(n=this.worker)||void 0===n||n.terminate(),e.a(2,W(this._content))}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e,t,n,r,o,a,u}();!function(e){e.SEVEN_ZIP="7zip",e.AR="ar",e.ARBSD="arbsd",e.ARGNU="argnu",e.ARSVR4="arsvr4",e.BIN="bin",e.BSDTAR="bsdtar",e.CD9660="cd9660",e.CPIO="cpio",e.GNUTAR="gnutar",e.ISO="iso",e.ISO9660="iso9660",e.MTREE="mtree",e.MTREE_CLASSIC="mtree-classic",e.NEWC="newc",e.ODC="odc",e.OLDTAR="oldtar",e.PAX="pax",e.PAXR="paxr",e.POSIX="posix",e.PWB="pwb",e.RAW="raw",e.RPAX="rpax",e.SHAR="shar",e.SHARDUMP="shardump",e.USTAR="ustar",e.V7TAR="v7tar",e.V7="v7",e.WARC="warc",e.XAR="xar",e.ZIP="zip"}(Z||(Z={})),function(e){e.B64ENCODE="b64encode",e.BZIP2="bzip2",e.COMPRESS="compress",e.GRZIP="grzip",e.GZIP="gzip",e.LRZIP="lrzip",e.LZ4="lz4",e.LZIP="lzip",e.LZMA="lzma",e.LZOP="lzop",e.UUENCODE="uuencode",e.XZ="xz",e.ZSTD="zstd",e.NONE="none"}(K||(K={}));var X=function(){function e(){s(this,e)}return l(e,null,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e._options=t||{},e._options}},{key:"open",value:(o=c(i().m((function t(n){var r,o,a;return i().w((function(t){for(;;)switch(t.n){case 0:return r=e.getWorker(e._options),t.n=1,e.getClient(r,e._options);case 1:return o=t.v,a=new H(n,o,r),t.n=2,a.open();case 2:return t.a(2,t.v)}}),t)}))),function(e){return o.apply(this,arguments)})},{key:"write",value:(r=c(i().m((function t(n){var r,o,a,c,s,u,l,f,h;return i().w((function(t){for(;;)switch(t.n){case 0:return r=n.files,o=n.outputFileName,a=n.compression,c=n.format,s=n.passphrase,u=void 0===s?null:s,l=e.getWorker(e._options),t.n=1,e.getClient(l,e._options);case 1:return f=t.v,t.n=2,f.writeArchive(r,a,c,u);case 2:return h=t.v,t.a(2,(l.terminate(),new File([h],o,{type:"application/octet-stream"})))}}),t)}))),function(e){return r.apply(this,arguments)})},{key:"getWorker",value:function(e){return e.getWorker?e.getWorker():new Worker(e.workerUrl||new URL(Object(function(){var e=new Error("Cannot find module './worker-bundle.js'");throw e.code="MODULE_NOT_FOUND",e}()),n.b),{type:"module"})}},{key:"getClient",value:(t=c(i().m((function e(t,n){var r,o,a,c,s,u;return i().w((function(e){for(;;)switch(e.n){case 0:return o=(null===(r=n.createClient)||void 0===r?void 0:r.call(n,t))||I(t),a=Promise.withResolvers(),c=a.promise,s=a.resolve,e.n=1,new o(F((function(){s()})));case 1:return u=e.v,e.n=2,c;case 2:return e.a(2,u)}}),e)}))),function(e,n){return t.apply(this,arguments)})}]);var t,r,o}();X._options={},Promise.withResolvers||(Promise.withResolvers=function(){var e,t,n=new this((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}});var Y=n(67430),Q=n(75384),$=n(8566),J=n(79754),ee=n(74550),te=n(70267),ne=n(82885),re=n(38783);function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function oe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return ae(u,"_invoke",function(n,r,i){var o,c,s,u=0,l=i||[],f=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,c=0,s=e,h.n=n,a}};function p(n,r){for(c=n,s=r,t=0;!f&&u&&!i&&t<l.length;t++){var i,o=l[t],p=h.p,v=o[2];n>3?(i=v===r)&&(s=o[(c=o[4])?5:(c=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=n<2&&p<o[1])?(c=0,h.v=r,h.n=o[1]):p<v&&(i=n<3||o[0]>r||r>v)&&(o[4]=n,o[5]=r,h.n=v,c=0))}if(i||n>1)return a;throw f=!0,r}return function(i,l,v){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,v),c=l,s=v;(t=c<2?e:s)||!f;){o||(c?c<3?(c>1&&(h.n=-1),p(c,s)):h.n=s:h.v=s);try{if(u=2,o){if(c||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=o.return)&&t.call(o),c<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),c=1);o=e}else if((t=(f=h.n<0)?s:n.call(r,h))!==a)break}catch(t){o=e,c=1,s=t}finally{u=1}}return{value:t,done:f}}}(n,i,o),!0),u}var a={};function c(){}function s(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(ae(t={},r,(function(){return this})),t),f=u.prototype=c.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ae(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=u,ae(f,"constructor",u),ae(u,"constructor",s),s.displayName="GeneratorFunction",ae(u,i,"GeneratorFunction"),ae(f),ae(f,i,"Generator"),ae(f,r,(function(){return this})),ae(f,"toString",(function(){return"[object Generator]"})),(oe=function(){return{w:o,m:h}})()}function ae(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}ae=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var o=function(t,n){ae(e,t,(function(e){return this._invoke(t,n,e)}))};o("next",0),o("throw",1),o("return",2)}},ae(e,t,n,r)}function ce(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return se(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ue(e,t,n,r,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}function le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ve(r.key),r)}}function he(e,t,n){return t&&fe(e.prototype,t),n&&fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pe(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e){var t=function(e){if("object"!=ie(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(t)?t:t+""}var de=[".cbr",".cbt",".cbz",".cb7"],ye=["jpg","jpeg","jpe","jif","jfif","jfi","png","avif","gif","bmp","dib","tiff","tif","webp"],me=function(){return he((function e(){var t=this;le(this,e),pe(this,"onDirChanged",(function(){var e=t.comicsPlayerSettings.langDir;e=e&&"ltr"!==e?"ltr":"rtl",t.changeLanguageDirection(e),t.comicsPlayerSettings.langDir=e})),pe(this,"onViewChanged",(function(){var e=t.comicsPlayerSettings.pagesPerView;e=e&&1!==e?1:2,t.changeView(e),t.comicsPlayerSettings.pagesPerView=e})),this.name="Comics Player",this.type=re.Q.MediaPlayer,this.id="comicsplayer",this.priority=1,this.imageMap=new Map,this.onDialogClosed=this.onDialogClosed.bind(this),this.onWindowKeyDown=this.onWindowKeyDown.bind(this)}),[{key:"play",value:function(e){this.currentPage=0,this.pageCount=0;var t=e.items[0].Id;this.comicsPlayerSettings=ne.getComicsPlayerSettings(t);var n=this.createMediaElement();return this.setCurrentSrc(n,e)}},{key:"stop",value:function(){var e;this.unbindEvents();var t={src:this.item};Events.trigger(this,"stopped",[t]);var n=this.item.Id;ne.setComicsPlayerSettings(this.comicsPlayerSettings,n),null===(e=this.archiveSource)||void 0===e||e.release();var r=this.mediaElement;r&&(J.default.close(r),this.mediaElement=null),$.Ay.hide()}},{key:"destroy",value:function(){}},{key:"currentTime",value:function(){return this.currentPage}},{key:"duration",value:function(){return this.pageCount}},{key:"currentItem",value:function(){return this.item}},{key:"volume",value:function(){return 100}},{key:"isMuted",value:function(){return!1}},{key:"paused",value:function(){return!1}},{key:"seekable",value:function(){return!0}},{key:"onDialogClosed",value:function(){this.stop()}},{key:"changeLanguageDirection",value:function(e){var t=this.currentPage;this.swiperInstance.changeLanguageDirection(e);var n="ltr"===e?"arrow_circle_left":"arrow_circle_right";this.mediaElement.querySelector(".btnToggleLangDir > span").classList.remove(n);var r="ltr"===e?"arrow_circle_right":"arrow_circle_left";this.mediaElement.querySelector(".btnToggleLangDir > span").classList.add(r);var i="ltr"===e?"Right To Left":"Left To Right";this.mediaElement.querySelector(".btnToggleLangDir").title=i,this.reload(t)}},{key:"changeView",value:function(e){var t=this.currentPage;this.swiperInstance.params.slidesPerView=e,this.swiperInstance.params.slidesPerGroup=e;var n=1===e?"devices_fold":"import_contacts";this.mediaElement.querySelector(".btnToggleView > span").classList.remove(n);var r=1===e?"import_contacts":"devices_fold";this.mediaElement.querySelector(".btnToggleView > span").classList.add(r);var i=1===e?"Double Page View":"Single Page View";this.mediaElement.querySelector(".btnToggleView").title=i,this.reload(t)}},{key:"reload",value:function(e){var t=this.swiperInstance.params.effect;this.swiperInstance.params.effect="none",this.swiperInstance.update(),this.swiperInstance.slideNext(),this.swiperInstance.slidePrev(),this.currentPage!=e&&(this.swiperInstance.slideTo(e),this.swiperInstance.update()),this.swiperInstance.params.effect=t,this.swiperInstance.update()}},{key:"onWindowKeyDown",value:function(e){e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||"Escape"===ee.Ay.getKeyName(e)&&(e.preventDefault(),this.stop())}},{key:"bindMediaElementEvents",value:function(){var e=this.mediaElement;null==e||e.addEventListener("close",this.onDialogClosed,{once:!0}),null==e||e.querySelector(".btnExit").addEventListener("click",this.onDialogClosed,{once:!0}),null==e||e.querySelector(".btnToggleLangDir").addEventListener("click",this.onDirChanged),null==e||e.querySelector(".btnToggleView").addEventListener("click",this.onViewChanged)}},{key:"bindEvents",value:function(){this.bindMediaElementEvents(),document.addEventListener("keydown",this.onWindowKeyDown)}},{key:"unbindMediaElementEvents",value:function(){var e=this.mediaElement;null==e||e.removeEventListener("close",this.onDialogClosed),null==e||e.querySelector(".btnExit").removeEventListener("click",this.onDialogClosed),null==e||e.querySelector(".btnToggleLangDir").removeEventListener("click",this.onDirChanged),null==e||e.querySelector(".btnToggleView").removeEventListener("click",this.onViewChanged)}},{key:"unbindEvents",value:function(){this.unbindMediaElementEvents(),document.removeEventListener("keydown",this.onWindowKeyDown)}},{key:"createMediaElement",value:function(){var e=this.mediaElement;if(e)return e;if(!(e=document.getElementById("comicsPlayer"))){e=J.default.createDialog({exitAnimationDuration:400,size:"fullscreen",autoFocus:!1,scrollY:!1,exitAnimation:"fadeout",removeOnClose:!0});var t=1===this.comicsPlayerSettings.pagesPerView?"import_contacts":"devices_fold",n="ltr"===this.comicsPlayerSettings.langDir?"arrow_circle_right":"arrow_circle_left";e.id="comicsPlayer",e.classList.add("slideshowDialog"),e.innerHTML="<div dir=".concat(this.comicsPlayerSettings.langDir,' class="slideshowSwiperContainer">\n <div class="swiper-wrapper"></div>\n <div class="swiper-button-next actionButtonIcon"></div>\n <div class="swiper-button-prev actionButtonIcon"></div>\n <div class="swiper-pagination"></div>\n </div>\n <div class="actionButtons">\n <button is="paper-icon-button-light" class="autoSize btnToggleLangDir" tabindex="-1">\n <span class="material-icons actionButtonIcon ').concat(n,'" aria-hidden="true"></span>\n </button>\n <button is="paper-icon-button-light" class="autoSize btnToggleView" tabindex="-1">\n <span class="material-icons actionButtonIcon ').concat(t,'" aria-hidden="true"></span>\n </button>\n <button is="paper-icon-button-light" class="autoSize btnExit" tabindex="-1">\n <span class="material-icons actionButtonIcon close" aria-hidden="true"></span>\n </button>\n </div>'),J.default.open(e)}this.mediaElement=e;var r="ltr"===this.comicsPlayerSettings.langDir?"Right To Left":"Left To Right";this.mediaElement.querySelector(".btnToggleLangDir").title=r;var i=1===this.comicsPlayerSettings.pagesPerView?"Double Page View":"Single Page View";return this.mediaElement.querySelector(".btnToggleView").title=i,this.bindEvents(),e}},{key:"setCurrentSrc",value:function(e,t){var i=this,o=t.items[0];this.item=o,this.streamInfo={started:!0,ended:!1,item:this.item,mediaSource:{Id:o.Id}},$.Ay.show(),X.init({workerUrl:te.appRouter.baseUrl()+"/libraries/worker-bundle.js"});var a=(0,Q.C)(Y.tF.getApiClient(o)),c=(0,r.Q)(a).getDownloadUrl({itemId:o.Id});return this.archiveSource=new ge(c),Promise.all([n.e(76173),n.e(86678)]).then(n.bind(n,43653)),this.archiveSource.load().then((function(){return Promise.all([n.e(76173),n.e(29469)]).then(n.bind(n,43634))})).then((function(n){var r=n.Swiper;$.Ay.hide(),i.pageCount=i.archiveSource.urls.length,i.currentPage=t.startPositionTicks/1e4||0,i.swiperInstance=new r(e.querySelector(".slideshowSwiperContainer"),{direction:"horizontal",loop:!1,zoom:{minRatio:1,toggle:!0,containerClass:"slider-zoom-container"},autoplay:!1,keyboard:{enabled:!0},preloadImages:!0,slidesPerView:i.comicsPlayerSettings.pagesPerView,slidesPerGroup:i.comicsPlayerSettings.pagesPerView,slidesPerColumn:1,initialSlide:i.currentPage,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},pagination:{el:".swiper-pagination",clickable:!0,type:"fraction"},virtual:{slides:i.archiveSource.urls,cache:!0,renderSlide:i.getImgFromUrl,addSlidesBefore:1,addSlidesAfter:1}}),i.swiperInstance.on("slideChange",(function(){i.currentPage=i.swiperInstance.activeIndex,Events.trigger(i,"pause")}))}))}},{key:"getImgFromUrl",value:function(e){return'<div class="swiper-slide">\n <div class="slider-zoom-container">\n <img src="'.concat(e,'" class="swiper-slide-img">\n </div>\n </div>')}},{key:"canPlayMediaType",value:function(e){return"book"===(e||"").toLowerCase()}},{key:"canPlayItem",value:function(e){return e.Path&&de.some((function(t){return e.Path.endsWith(t)}))}}])}(),ge=function(){return he((function e(t){le(this,e),this.url=t,this.files=[],this.urls=[]}),[{key:"load",value:(e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ue(o,r,i,a,c,"next",e)}function c(e){ue(o,r,i,a,c,"throw",e)}a(void 0)}))}}(oe().m((function e(){var t,n,r,i,o,a,c;return oe().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,fetch(this.url);case 1:if((t=e.v).ok){e.n=2;break}return e.a(2);case 2:return e.n=3,t.blob();case 3:return n=e.v,e.n=4,X.open(n);case 4:return this.archive=e.v,e.n=5,this.archive.getFilesArray();case 5:return this.raw=e.v,e.n=6,this.archive.extractFiles();case 6:return e.n=7,this.archive.getFilesArray();case 7:r=(r=e.v).filter((function(e){var t=e.file.name,n=t.lastIndexOf(".");return-1!==n&&ye.includes(t.slice(n+1).toLowerCase())})),r.sort((function(e,t){return e.file.name<t.file.name?-1:1})),i=ce(r);try{for(i.s();!(o=i.n()).done;)a=o.value,c=URL.createObjectURL(a.file),this.urls.push(c)}catch(e){i.e(e)}finally{i.f()}case 8:return e.a(2)}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"release",value:function(){this.files=[],this.urls.forEach(URL.revokeObjectURL),this.urls=[]}}]);var e}(),be=me}}]); |