@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 15.5 kB
JavaScript
;(self.webpackChunkUV=self.webpackChunkUV||[]).push([[944],{3664(e,t,n){n.d(t,{$:()=>r});var r=function(){function e(e){this.options=e,this.options.data=Object.assign({},this.data(),e.data)}return e.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML="",!0):(console.warn("element not found"),!1)},e.prototype.data=function(){return{}},e.prototype.on=function(e,t,n){var r=this._e||(this._e={});(r[e]||(r[e]=[])).push({fn:t,ctx:n})},e.prototype.fire=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=[].slice.call(arguments,1),o=((this._e||(this._e={}))[e]||[]).slice(),i=0,a=o.length;i<a;i++)o[i].fn.apply(o[i].ctx,r)},e.prototype._resize=function(){},e.prototype.set=function(e){},e}()},6233(e,t,n){n.d(t,{a:()=>j,b:()=>ie,c:()=>ae,g:()=>se,h:()=>H,r:()=>d});var r,o=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=0,a=!1,s=!1,l=window,u=document,c={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,n,r){return e.addEventListener(t,n,r)},rel:function(e,t,n,r){return e.removeEventListener(t,n,r)}},$=function(){var e=!1;try{u.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){e=!0}}))}catch(e){}return e}(),f=function(){try{return new CSSStyleSheet,!0}catch(e){}return!1}(),h=new WeakMap,p=function(e){return h.get(e)},d=function(e,t){return h.set(t.$lazyInstance$=e,t)},m=function(e,t){return t in e},v=function(e){return console.error(e)},g=new Map,y=new Map,b=[],w=[],S=[],E=function(e,t){return function(n){e.push(n),a||(a=!0,t&&4&c.$flags$?k(R):c.raf(R))}},L=function(e,t){for(var n=0,r=0;n<e.length&&(r=performance.now())<t;)try{e[n++](r)}catch(e){v(e)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},R=function(){i++,function(e){for(var t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){v(e)}e.length=0}(b);var e=2==(6&c.$flags$)?performance.now()+10*Math.ceil(i*(1/22)):1/0;L(w,e),L(S,e),w.length>0&&(S.push.apply(S,w),w.length=0),(a=b.length+w.length+S.length>0)?c.raf(R):i=0},k=function(e){return Promise.resolve().then(e)},_=E(w,!0),x={},P=function(e){return"object"==(e=typeof e)||"function"===e},j=function(){return l.CSS&&l.CSS.supports&&l.CSS.supports("color","var(--c)")?Promise.resolve():n.e(2957).then(n.t.bind(n,2957,23)).then((function(){if(c.$cssShim$=l.__stencil_cssshim,c.$cssShim$)return c.$cssShim$.initShim()}))},N="hydrated",C=function(e,t){return void 0===t&&(t=""),function(){}},M=new WeakMap,O=function(e,t,n){var r=C(0,t.$tagName$);!function(e,t,n,r){var o=T(t.$tagName$),i=y.get(o);if(e=11===e.nodeType?e:u,i)if("string"==typeof i){e=e.head||e;var a=M.get(e),s=void 0;if(a||M.set(e,a=new Set),!a.has(o)){if(c.$cssShim$){var l=(s=c.$cssShim$.createHostStyle(r,o,i,!!(10&t.$flags$)))["s-sc"];l&&(o=l,a=null)}else(s=u.createElement("style")).innerHTML=i;e.insertBefore(s,e.querySelector("link")),a&&a.add(o)}}else e.adoptedStyleSheets.includes(i)||(e.adoptedStyleSheets=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(e.adoptedStyleSheets,[i]))}(e.getRootNode(),t,0,e),r()},T=function(e,t){return"sc-"+e},H=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=null,i=!1,a=!1,s=[],l=function(t){for(var n=0;n<t.length;n++)o=t[n],Array.isArray(o)?l(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!P(o))&&(o=String(o)),i&&a?s[s.length-1].$text$+=o:s.push(i?I(null,o):o),a=i)};if(l(n),t){var u=t.className||t.class;u&&(t.class="object"!=typeof u?u:Object.keys(u).filter((function(e){return u[e]})).join(" "))}var c=I(e,null);return c.$attrs$=t,s.length>0&&(c.$children$=s),c},I=function(e,t){return{$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null}},A={},z=function(e,t,n,r,o,i){if(n!==r){var a=m(e,t),s=t.toLowerCase();if("class"===t){var u=e.classList,$=q(n),f=q(r);u.remove.apply(u,$.filter((function(e){return e&&!f.includes(e)}))),u.add.apply(u,f.filter((function(e){return e&&!$.includes(e)})))}else if("ref"===t)r&&r(e);else if(a||"o"!==t[0]||"n"!==t[1]){var h=P(r);if((a||h&&null!==r)&&!o)try{if(e.tagName.includes("-"))e[t]=r;else{var p=null==r?"":r;"list"===t?a=!1:null!=n&&e[t]==p||(e[t]=p)}}catch(e){}null==r||!1===r?e.removeAttribute(t):(!a||4&i||o)&&!h&&(r=!0===r?"":r,e.setAttribute(t,r))}else t="-"===t[2]?t.slice(3):m(l,s)?s.slice(2):s[2]+t.slice(3),n&&c.rel(e,t,n,!1),r&&c.ael(e,t,r,!1)}},U=/\s/,q=function(e){return e?e.split(U):[]},B=function(e,t,n,r){var o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||x,a=t.$attrs$||x;for(r in i)r in a||z(o,r,i[r],void 0,n,t.$flags$);for(r in a)z(o,r,i[r],a[r],n,t.$flags$)},W=function(e,t,n,r){var o,i,a=t.$children$[n],l=0;if(null!==a.$text$)o=a.$elm$=u.createTextNode(a.$text$);else if(o=a.$elm$=u.createElement(a.$tag$),B(null,a,s),a.$children$)for(l=0;l<a.$children$.length;++l)(i=W(e,a,l))&&o.appendChild(i);return o},V=function(e,t,n,r,o,i){for(var a,s=e;o<=i;++o)r[o]&&(a=W(null,n,o))&&(r[o].$elm$=a,s.insertBefore(a,t))},D=function(e,t,n,r,o){for(;t<=n;++t)(r=e[t])&&(o=r.$elm$,K(r),o.remove())},F=function(e,t){return e.$tag$===t.$tag$},G=function(e,t){var n=t.$elm$=e.$elm$,r=e.$children$,o=t.$children$;null===t.$text$?(B(e,t,s),null!==r&&null!==o?function(e,t,n,r){for(var o,i=0,a=0,s=t.length-1,l=t[0],u=t[s],c=r.length-1,$=r[0],f=r[c];i<=s&&a<=c;)null==l?l=t[++i]:null==u?u=t[--s]:null==$?$=r[++a]:null==f?f=r[--c]:F(l,$)?(G(l,$),l=t[++i],$=r[++a]):F(u,f)?(G(u,f),u=t[--s],f=r[--c]):F(l,f)?(G(l,f),e.insertBefore(l.$elm$,u.$elm$.nextSibling),l=t[++i],f=r[--c]):F(u,$)?(G(u,$),e.insertBefore(u.$elm$,l.$elm$),u=t[--s],$=r[++a]):(o=W(t&&t[a],n,a),$=r[++a],o&&l.$elm$.parentNode.insertBefore(o,l.$elm$));i>s?V(e,null==r[c+1]?null:r[c+1].$elm$,n,r,a,c):a>c&&D(t,i,s)}(n,r,t,o):null!==o?(null!==e.$text$&&(n.textContent=""),V(n,null,t,o,0,o.length-1)):null!==r&&D(r,0,r.length-1)):e.$text$!==t.$text$&&(n.data=t.$text$)},K=function(e){e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.forEach(K)},Q=function(e,t){t&&!e.$onRenderResolve$&&t["s-p"].push(new Promise((function(t){return e.$onRenderResolve$=t})))},J=function(e,t,n,r){if(t.$flags$|=16,!(4&t.$flags$)){var o=C(0,n.$tagName$),i=t.$ancestorComponent$,a=t.$lazyInstance$,s=function(){return X(e,t,n,a,r)};return Q(t,i),r&&(t.$flags$|=256,t.$queuedListeners$&&(t.$queuedListeners$.forEach((function(e){var t=e[0],n=e[1];return ee(a,t,n)})),t.$queuedListeners$=null)),o(),te(void 0,(function(){return _(s)}))}t.$flags$|=512},X=function(e,t,n,r,o){var i=C(0,n.$tagName$),a=e["s-rc"];o&&O(e,n,t.$modeName$);var s=C(0,n.$tagName$);try{!function(e,t,n,r){var o,i=t.$vnode$||I(null,null),a=(o=r)&&o.$tag$===A?r:H(null,null,r);a.$tag$=null,a.$flags$|=4,t.$vnode$=a,a.$elm$=i.$elm$=e,G(i,a)}(e,t,0,r.render())}catch(e){v(e)}c.$cssShim$&&c.$cssShim$.updateHost(e),t.$flags$&=-17,t.$flags$|=2,a&&(a.forEach((function(e){return e()})),e["s-rc"]=void 0),s(),i();var l=e["s-p"],u=function(){return Y(e,t,n)};0===l.length?u():(Promise.all(l).then(u),t.$flags$|=4,l.length=0)},Y=function(e,t,n){var r=C(0,n.$tagName$),o=t.$lazyInstance$,i=t.$ancestorComponent$;64&t.$flags$?(ee(o,"componentDidUpdate"),r()):(t.$flags$|=64,e.classList.add(N),r(),t.$onReadyResolve$(e),i||Z()),t.$onInstanceResolve$(e),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),512&t.$flags$&&k((function(){return J(e,t,n,!1)})),t.$flags$&=-517},Z=function(e){u.documentElement.classList.add(N),c.$flags$|=2},ee=function(e,t,n){if(e&&e[t])try{return e[t](n)}catch(e){v(e)}},te=function(e,t){return e&&e.then?e.then(t):t()},ne=function(e,t,n){if(t.$members$){var r=Object.entries(t.$members$),o=e.prototype;if(r.forEach((function(e){var r=e[0],i=e[1][0];31&i||2&n&&32&i?Object.defineProperty(o,r,{get:function(){return e=r,p(this).$instanceValues$.get(e);var e},set:function(e){!function(e,t,n,r){var o,i,a=p(e),s=a.$hostElement$,l=a.$instanceValues$.get(t),u=a.$flags$,c=a.$lazyInstance$;o=n,i=r.$members$[t][0],(n=null==o||P(o)?o:4&i?"false"!==o&&(""===o||!!o):2&i?parseFloat(o):1&i?String(o):o)===l||8&u&&void 0!==l||(a.$instanceValues$.set(t,n),c&&2==(18&u)&&J(s,a,r,!1))}(this,r,e,t)},configurable:!0,enumerable:!0}):1&n&&64&i&&Object.defineProperty(o,r,{value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=p(this);return n.$onInstancePromise$.then((function(){var t;return(t=n.$lazyInstance$)[r].apply(t,e)}))}})})),1&n){var i=new Map;o.attributeChangedCallback=function(e,t,n){var r=this;c.jmp((function(){var t=i.get(e);r[t]=(null!==n||"boolean"!=typeof r[t])&&n}))},e.observedAttributes=r.filter((function(e){return e[0],15&e[1][0]})).map((function(e){var t=e[0],n=e[1][1]||t;return i.set(n,t),n}))}}return e},re=function(e,t,r,o,i){return a=void 0,s=void 0,u=function(){var o,a,s,l,u,c,$;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(h){switch(h.label){case 0:return 32&t.$flags$?[3,3]:(t.$flags$|=32,i=function(e){var t=e.$tagName$.replace(/-/g,"_"),r=e.$lazyBundleIds$,o=g.get(r);return o?o[t]:n(2339)("./"+r+".entry.js").then((function(e){return g.set(r,e),e[t]}),v)}(r),i.then?(o=function(){},[4,i]):[3,2]);case 1:i=h.sent(),o(),h.label=2;case 2:i.isProxied||(ne(i,r,2),i.isProxied=!0),a=C(0,r.$tagName$),t.$flags$|=8;try{new i(t)}catch(e){v(e)}t.$flags$&=-9,a(),s=T(r.$tagName$),!y.has(s)&&i.style&&(l=C(0,r.$tagName$),u=i.style,function(e,t,n){var r=y.get(e);f&&n?(r=r||new CSSStyleSheet).replace(t):r=t,y.set(e,r)}(s,u,!!(1&r.$flags$)),l()),h.label=3;case 3:return c=t.$ancestorComponent$,$=function(){return J(e,t,r,!0)},c&&c["s-rc"]?c["s-rc"].push($):$(),[2]}}))},new((l=void 0)||(l=Promise))((function(e,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function r(e){try{o(u.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof l?o:new l((function(e){e(o)}))).then(n,r)}o((u=u.apply(a,s||[])).next())}));var a,s,l,u},oe=function(e,t){if(!(1&c.$flags$)){var n=C(0,t.$tagName$),r=p(e);if(t.$listeners$&&(r.$rmListeners$=function(e,t,n){t.$queuedListeners$=t.$queuedListeners$||[];var r=n.map((function(n){var r=n[0],o=n[1],i=n[2],a=function(e,t){return 8&t?l:e}(e,r),s=function(e,t){return function(n){256&e.$flags$?e.$lazyInstance$[t](n):e.$queuedListeners$.push([t,n])}}(t,i),u=function(e){return $?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e)}(r);return c.ael(a,o,s,u),function(){return c.rel(a,o,s,u)}}));return function(){return r.forEach((function(e){return e()}))}}(e,r,t.$listeners$)),!(1&r.$flags$)){r.$flags$|=1;for(var o=e;o=o.parentNode||o.host;)if(o["s-p"]){Q(r,r.$ancestorComponent$=o);break}t.$members$&&Object.entries(t.$members$).forEach((function(t){var n=t[0];if(31&t[1][0]&&e.hasOwnProperty(n)){var r=e[n];delete e[n],e[n]=r}})),k((function(){return re(e,r,t)}))}n()}},ie=function(e,t){void 0===t&&(t={});var n,r=C(),i=[],a=t.exclude||[],s=u.head,$=l.customElements,f=s.querySelector("meta[charset]"),d=u.createElement("style"),m=[],v=!0;Object.assign(c,t),c.$resourcesUrl$=new URL(t.resourcesUrl||"./",u.baseURI).href,t.syncQueue&&(c.$flags$|=4),e.forEach((function(e){return e[1].forEach((function(t){var r={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};r.$members$=t[2],r.$listeners$=t[3];var s=r.$tagName$,l=function(e){function t(t){var n,r,o=e.call(this,t)||this;return(r={$flags$:0,$hostElement$:n=t=o,$instanceValues$:new Map}).$onInstancePromise$=new Promise((function(e){return r.$onInstanceResolve$=e})),r.$onReadyPromise$=new Promise((function(e){return r.$onReadyResolve$=e})),n["s-p"]=[],n["s-rc"]=[],h.set(n,r),o}return o(t,e),t.prototype.connectedCallback=function(){var e=this;n&&(clearTimeout(n),n=null),v?m.push(this):c.jmp((function(){return oe(e,r)}))},t.prototype.disconnectedCallback=function(){var e=this;c.jmp((function(){return function(e){if(!(1&c.$flags$)){var t=p(e);t.$rmListeners$&&(t.$rmListeners$(),t.$rmListeners$=void 0),c.$cssShim$&&c.$cssShim$.removeHost(e)}}(e)}))},t.prototype["s-hmr"]=function(e){},t.prototype.forceUpdate=function(){!function(e,t){var n=p(e);2==(18&n.$flags$)&&J(e,n,t,!1)}(this,r)},t.prototype.componentOnReady=function(){return p(this).$onReadyPromise$},t}(HTMLElement);r.$lazyBundleIds$=e[0],a.includes(s)||$.get(s)||(i.push(s),$.define(s,ne(l,r,1)))}))})),d.innerHTML=i+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),s.insertBefore(d,f?f.nextSibling:s.firstChild),v=!1,m.length>0?m.forEach((function(e){return e.connectedCallback()})):c.jmp((function(){return n=setTimeout(Z,30,"timeout")})),r()},ae=function(e,t,n){var r=se(e);return{emit:function(e){return r.dispatchEvent(new CustomEvent(t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e}))}}},se=function(e){return p(e).$hostElement$}},2111(e,t,n){function r(){var e=window,t=[];return e.customElements&&(!e.Element||e.Element.prototype.closest&&e.Element.prototype.matches&&e.Element.prototype.remove)||t.push(n.e(2520).then(n.t.bind(n,2520,23))),"function"==typeof Object.assign&&Object.entries&&Array.prototype.find&&Array.prototype.includes&&String.prototype.startsWith&&String.prototype.endsWith&&(!e.NodeList||e.NodeList.prototype.forEach)&&e.fetch&&function(){try{var e=new URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(e){return!1}}()&&"undefined"!=typeof WeakMap||t.push(n.e(3105).then(n.t.bind(n,3105,23))),Promise.all(t)}n.d(t,{r:()=>r,u:()=>i});var o=n(6233),i=function(e,t){return(0,o.a)().then((function(){(0,o.b)([["uv-ebook-reader_2",[[0,"uv-ebook-reader",{width:[1],height:[1],mobileWidth:[2,"mobile-width"],minSpreadWidth:[2,"min-spread-width"],_bookPath:[32],_bookReady:[32],_prevEnabled:[32],_mobile:[32],_nextEnabled:[32],_showDivider:[32],load:[64],resize:[64],display:[64],getBook:[64]},[[8,"keydown","handleKeyDown"]]],[0,"uv-ebook-toc",{toc:[16],selected:[1025],disabled:[4]}]]]],t)}))};!function(){if(void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}()}}]);