huchuan2025/.obsidian/plugins/obsidian-epub-plugin/main.js

41 lines
376 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var vd=Object.create;var ar=Object.defineProperty,gd=Object.defineProperties,md=Object.getOwnPropertyDescriptor,_d=Object.getOwnPropertyDescriptors,yd=Object.getOwnPropertyNames,Eo=Object.getOwnPropertySymbols,bd=Object.getPrototypeOf,xo=Object.prototype.hasOwnProperty,wd=Object.prototype.propertyIsEnumerable;var So=(r,e,t)=>e in r?ar(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,or=(r,e)=>{for(var t in e||(e={}))xo.call(e,t)&&So(r,t,e[t]);if(Eo)for(var t of Eo(e))wd.call(e,t)&&So(r,t,e[t]);return r},lr=(r,e)=>gd(r,_d(e)),To=r=>ar(r,"__esModule",{value:!0});var As=(r,e)=>()=>(r&&(e=r(r=0)),e);var $=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ko=(r,e)=>{To(r);for(var t in e)ar(r,t,{get:e[t],enumerable:!0})},Ed=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yd(e))!xo.call(r,i)&&i!=="default"&&ar(r,i,{get:()=>e[i],enumerable:!(t=md(e,i))||t.enumerable});return r},Zr=r=>Ed(To(ar(r!=null?vd(bd(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Tt=(r,e,t)=>new Promise((i,n)=>{var s=l=>{try{o(t.next(l))}catch(u){n(u)}},a=l=>{try{o(t.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,a);o((t=t.apply(r,e)).next())});function Jt(r,e){for(var t in e)r[t]=e[t];return r}function Do(r){var e=r.parentNode;e&&e.removeChild(r)}function et(r,e,t){var i,n,s,a={};for(s in e)s=="key"?i=e[s]:s=="ref"?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?ur.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(s in r.defaultProps)a[s]===void 0&&(a[s]=r.defaultProps[s]);return fr(r,a,i,n,null)}function fr(r,e,t,i,n){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:n==null?++Co:n};return n==null&&ue.vnode!=null&&ue.vnode(s),s}function Yr(){return{current:null}}function kt(r){return r.children}function mt(r,e){this.props=r,this.context=e}function Ai(r,e){if(e==null)return r.__?Ai(r.__,r.__.__k.indexOf(r)+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?Ai(r):null}function Po(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Po(r)}}function Ds(r){(!r.__d&&(r.__d=!0)&&hr.push(r)&&!Gr.__r++||Ro!==ue.debounceRendering)&&((Ro=ue.debounceRendering)||No)(Gr)}function Gr(){for(var r;Gr.__r=hr.length;)r=hr.sort(function(e,t){return e.__v.__b-t.__v.__b}),hr=[],r.some(function(e){var t,i,n,s,a,o;e.__d&&(a=(s=(t=e).__v).__e,(o=t.__P)&&(i=[],(n=Jt({},s)).__v=s.__v+1,Ps(o,s,n,t.__n,o.ownerSVGElement!==void 0,s.__h!=null?[a]:null,i,a==null?Ai(s):a,s.__h),qo(i,s),s.__e!=a&&Po(s)))})}function Lo(r,e,t,i,n,s,a,o,l,u){var f,d,c,v,g,O,k,_=i&&i.__k||Io,p=_.length;for(t.__k=[],f=0;f<e.length;f++)if((v=t.__k[f]=(v=e[f])==null||typeof v=="boolean"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"?fr(null,v,null,null,v):Array.isArray(v)?fr(kt,{children:v},null,null,null):v.__b>0?fr(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=t,v.__b=t.__b+1,(c=_[f])===null||c&&v.key==c.key&&v.type===c.type)_[f]=void 0;else for(d=0;d<p;d++){if((c=_[d])&&v.key==c.key&&v.type===c.type){_[d]=void 0;break}c=null}Ps(r,v,c=c||Xr,n,s,a,o,l,u),g=v.__e,(d=v.ref)&&c.ref!=d&&(k||(k=[]),c.ref&&k.push(c.ref,null,v),k.push(d,v.__c||g,v)),g!=null?(O==null&&(O=g),typeof v.type=="function"&&v.__k===c.__k?v.__d=l=zo(v,l,r):l=Mo(r,v,c,_,g,l),typeof t.type=="function"&&(t.__d=l)):l&&c.__e==l&&l.parentNode!=r&&(l=Ai(c))}for(t.__e=O,f=p;f--;)_[f]!=null&&(typeof t.type=="function"&&_[f].__e!=null&&_[f].__e==t.__d&&(t.__d=Ai(i,f+1)),jo(_[f],_[f]));if(k)for(f=0;f<k.length;f++)Wo(k[f],k[++f],k[++f])}function zo(r,e,t){for(var i,n=r.__k,s=0;n&&s<n.length;s++)(i=n[s])&&(i.__=r,e=typeof i.type=="function"?zo(i,e,t):Mo(t,i,i,n,i.__e,e));return e}function Zt(r,e){return e=e||[],r==null||typeof r=="boolean"||(Array.isArray(r)?r.some(function(t){Zt(t,e)}):e.push(r)),e}function Mo(r,e,t,i,n,s){var a,o,l;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(t==null||n!=s||n.parentNode==null)e:if(s==null||s.parentNode!==r)r.appendChild(n),a=null;else{for(o=s,l=0;(o=o.nextSibling)&&l<i.length;l+=2)if(o==n)break e;r.insertBefore(n,s),a=s}return a!==void 0?a:n.nextSibling}function kd(r,e,t,i,n){var s;for(s in t)s==="children"||s==="key"||s in e||$r(r,s,null,t[s],i);for(s in e)n&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||t[s]===e[s]||$r(r,s,e[s],t[s],i)}function Bo(r,e,t){e[0]==="-"?r.setProperty(e,t):r[e]=t==null?"":typeof t!="number"||Td.test(e)?t:t+"px"}function $r(r,e,t,i,n){var s;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||Bo(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||Bo(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?i||r.addEventListener(e,s?Fo:Uo,s):r.removeEventListener(e,s?Fo:Uo,s);else if(e!=="dangerouslySetInnerHTML"){if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in r)try{r[e]=t==null?"":t;break e}catch(a){}typeof t=="function"||(t!=null&&(t!==!1||e[0]==="a"&&e[1]==="r")?r.setAttribute(e,t):r.removeAttribute(e))}}function Uo(r){this.l[r.type+!1](ue.event?ue.event(r):r)}function Fo(r){this.l[r.type+!0](ue.event?ue.event(r):r)}function Ps(r,e,t,i,n,s,a,o,l){var u,f,d,c,v,g,O,k,_,p,y,T=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,o=e.__e=t.__e,e.__h=null,s=[o]),(u=ue.__b)&&u(e);try{e:if(typeof T=="function"){if(k=e.props,_=(u=T.contextType)&&i[u.__c],p=u?_?_.props.value:u.__:i,t.__c?O=(f=e.__c=t.__c).__=f.__E:("prototype"in T&&T.prototype.render?e.__c=f=new T(k,p):(e.__c=f=new mt(k,p),f.constructor=T,f.render=Cd),_&&_.sub(f),f.props=k,f.state||(f.state={}),f.context=p,f.__n=i,d=f.__d=!0,f.__h=[]),f.__s==null&&(f.__s=f.state),T.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Jt({},f.__s)),Jt(f.__s,T.getDerivedStateFromProps(k,f.__s))),c=f.props,v=f.state,d)T.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T.getDerivedStateFromProps==null&&k!==c&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(k,p),!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(k,f.__s,p)===!1||e.__v===t.__v){f.props=k,f.state=f.__s,e.__v!==t.__v&&(f.__d=!1),f.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(P){P&&(P.__=e)}),f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(k,f.__s,p),f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(c,v,g)})}f.context=p,f.props=k,f.state=f.__s,(u=ue.__r)&&u(e),f.__d=!1,f.__v=e,f.__P=r,u=f.render(f.props,f.state,f.context),f.state=f.__s,f.getChildContext!=null&&(i=Jt(Jt({},i),f.getChildContext())),d||f.getSnapshotBeforeUpdate==null||(g=f.getSnapshotBeforeUpdate(c,v)),y=u!=null&&u.type===kt&&u.key==null?u.props.children:u,Lo(r,Array.isArray(y)?y:[y],e,t,i,n,s,a,o,l),f.base=e.__e,e.__h=null,f.__h.length&&a.push(f),O&&(f.__E=f.__=null),f.__e=!1}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Od(t.__e,e,t,i,n,s,a,l);(u=ue.diffed)&&u(e)}catch(P){e.__v=null,(l||s!=null)&&(e.__e=o,e.__h=!!l,s[s.indexOf(o)]=null),ue.__e(P,e,t)}}function qo(r,e){ue.__c&&ue.__c(e,r),r.some(function(t){try{r=t.__h,t.__h=[],r.some(function(i){i.call(t)})}catch(i){ue.__e(i,t.__v)}})}function Od(r,e,t,i,n,s,a,o){var l,u,f,d=t.props,c=e.props,v=e.type,g=0;if(v==="svg"&&(n=!0),s!=null){for(;g<s.length;g++)if((l=s[g])&&"setAttribute"in l==!!v&&(v?l.localName===v:l.nodeType===3)){r=l,s[g]=null;break}}if(r==null){if(v===null)return document.createTextNode(c);r=n?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,c.is&&c),s=null,o=!1}if(v===null)d===c||o&&r.data===c||(r.data=c);else{if(s=s&&ur.call(r.childNodes),u=(d=t.props||Xr).dangerouslySetInnerHTML,f=c.dangerouslySetInnerHTML,!o){if(s!=null)for(d={},g=0;g<r.attributes.length;g++)d[r.attributes[g].name]=r.attributes[g].value;(f||u)&&(f&&(u&&f.__html==u.__html||f.__html===r.innerHTML)||(r.innerHTML=f&&f.__html||""))}if(kd(r,c,d,n,o),f)e.__k=[];else if(g=e.props.children,Lo(r,Array.isArray(g)?g:[g],e,t,i,n&&v!=="foreignObject",s,a,s?s[0]:t.__k&&Ai(t,0),o),s!=null)for(g=s.length;g--;)s[g]!=null&&Do(s[g]);o||("value"in c&&(g=c.value)!==void 0&&(g!==r.value||v==="progress"&&!g||v==="option"&&g!==d.value)&&$r(r,"value",g,d.value,!1),"checked"in c&&(g=c.checked)!==void 0&&g!==r.checked&&$r(r,"checked",g,d.checked,!1))}return r}function Wo(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(i){ue.__e(i,t)}}function jo(r,e,t){var i,n;if(ue.unmount&&ue.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||Wo(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){ue.__e(s,e)}i.base=i.__P=null}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&jo(i[n],e,typeof r.type!="function");t||r.__e==null||Do(r.__e),r.__e=r.__d=void 0}function Cd(r,e,t){return this.constructor(r,t)}function Ii(r,e,t){var i,n,s;ue.__&&ue.__(r,e),n=(i=typeof t=="function")?null:t&&t.__k||e.__k,s=[],Ps(e,r=(!i&&t||e).__k=et(kt,null,[r]),n||Xr,Xr,e.ownerSVGElement!==void 0,!i&&t?[t]:n?null:e.firstChild?ur.call(e.childNodes):null,s,!i&&t?t:n?n.__e:e.firstChild,i),qo(s,r)}function Ls(r,e){Ii(r,e,Ls)}function Vo(r,e,t){var i,n,s,a=Jt({},r.props);for(s in e)s=="key"?i=e[s]:s=="ref"?n=e[s]:a[s]=e[s];return arguments.length>2&&(a.children=arguments.length>3?ur.call(arguments,2):t),fr(r.type,a,i||r.key,n||r.ref,null)}function Kr(r,e){var t={__c:e="__cC"+Ao++,__:r,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,s;return this.getChildContext||(n=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&n.some(Ds)},this.sub=function(a){n.push(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){n.splice(n.indexOf(a),1),o&&o.call(a)}}),i.children}};return t.Provider.__=t.Consumer.contextType=t}var ur,ue,Co,Sd,hr,No,Ro,Ao,Xr,Io,Td,Jr=As(()=>{Xr={},Io=[],Td=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;ur=Io.slice,ue={__e:function(r,e,t,i){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(r)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),a=n.__d),a)return n.__E=n}catch(o){r=o}throw r}},Co=0,Sd=function(r){return r!=null&&r.constructor===void 0},mt.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Jt({},this.state),typeof r=="function"&&(r=r(Jt({},t),this.props)),r&&Jt(t,r),r!=null&&this.__v&&(e&&this.__h.push(e),Ds(this))},mt.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),Ds(this))},mt.prototype.render=kt,hr=[],No=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gr.__r=0,Ao=0});function Pi(r,e){ue.__h&&ue.__h(tt,r,Di||e),Di=0;var t=tt.__H||(tt.__H={__:[],__h:[]});return r>=t.__.length&&t.__.push({}),t.__[r]}function Li(r){return Di=1,Qr(Qo,r)}function Qr(r,e,t){var i=Pi(di++,2);return i.t=r,i.__c||(i.__=[t?t(e):Qo(void 0,e),function(n){var s=i.t(i.__[0],n);i.__[0]!==s&&(i.__=[s,i.__[1]],i.__c.setState({}))}],i.__c=tt),i.__}function cr(r,e){var t=Pi(di++,3);!ue.__s&&qs(t.__H,e)&&(t.__=r,t.__H=e,tt.__H.__h.push(t))}function en(r,e){var t=Pi(di++,4);!ue.__s&&qs(t.__H,e)&&(t.__=r,t.__H=e,tt.__h.push(t))}function dr(r){return Di=5,pr(function(){return{current:r}},[])}function zs(r,e,t){Di=6,en(function(){return typeof r=="function"?(r(e()),function(){return r(null)}):r?(r.current=e(),function(){return r.current=null}):void 0},t==null?t:t.concat(r))}function pr(r,e){var t=Pi(di++,7);return qs(t.__H,e)&&(t.__=r(),t.__H=e,t.__h=r),t.__}function Ms(r,e){return Di=8,pr(function(){return r},e)}function Bs(r){var e=tt.context[r.__c],t=Pi(di++,9);return t.c=r,e?(t.__==null&&(t.__=!0,e.sub(tt)),e.props.value):r.__}function Us(r,e){ue.useDebugValue&&ue.useDebugValue(e?e(r):r)}function Nd(r){var e=Pi(di++,10),t=Li();return e.__=r,tt.componentDidCatch||(tt.componentDidCatch=function(i){e.__&&e.__(i),t[1](i)}),[t[0],function(){t[1](void 0)}]}function Rd(){for(var r;r=Zo.shift();)if(r.__P)try{r.__H.__h.forEach(tn),r.__H.__h.forEach(Fs),r.__H.__h=[]}catch(e){r.__H.__h=[],ue.__e(e,r.__v)}}function tn(r){var e=tt,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),tt=e}function Fs(r){var e=tt;r.__c=r.__(),tt=e}function qs(r,e){return!r||r.length!==e.length||e.some(function(t,i){return t!==r[i]})}function Qo(r,e){return typeof e=="function"?e(r):e}var di,tt,Ho,Di,Zo,Xo,Yo,Go,$o,Ko,Jo,Ws=As(()=>{Jr();Di=0,Zo=[],Xo=ue.__b,Yo=ue.__r,Go=ue.diffed,$o=ue.__c,Ko=ue.unmount;ue.__b=function(r){tt=null,Xo&&Xo(r)},ue.__r=function(r){Yo&&Yo(r),di=0;var e=(tt=r.__c).__H;e&&(e.__h.forEach(tn),e.__h.forEach(Fs),e.__h=[])},ue.diffed=function(r){Go&&Go(r);var e=r.__c;e&&e.__H&&e.__H.__h.length&&(Zo.push(e)!==1&&Ho===ue.requestAnimationFrame||((Ho=ue.requestAnimationFrame)||function(t){var i,n=function(){clearTimeout(s),Jo&&cancelAnimationFrame(i),setTimeout(t)},s=setTimeout(n,100);Jo&&(i=requestAnimationFrame(n))})(Rd)),tt=null},ue.__c=function(r,e){e.some(function(t){try{t.__h.forEach(tn),t.__h=t.__h.filter(function(i){return!i.__||Fs(i)})}catch(i){e.some(function(n){n.__h&&(n.__h=[])}),e=[],ue.__e(i,t.__v)}}),$o&&$o(r,e)},ue.unmount=function(r){Ko&&Ko(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(i){try{tn(i)}catch(n){e=n}}),e&&ue.__e(e,t.__v))};Jo=typeof requestAnimationFrame=="function"});var Sl={};ko(Sl,{Children:()=>sl,Component:()=>mt,Fragment:()=>kt,PureComponent:()=>rn,StrictMode:()=>Wd,Suspense:()=>vr,SuspenseList:()=>zi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>_l,cloneElement:()=>bl,createContext:()=>Kr,createElement:()=>et,createFactory:()=>yl,createPortal:()=>hl,createRef:()=>Yr,default:()=>Hs,findDOMNode:()=>wl,flushSync:()=>xl,forwardRef:()=>rl,hydrate:()=>cl,isValidElement:()=>Vs,lazy:()=>ll,memo:()=>tl,render:()=>nn,unmountComponentAtNode:()=>gr,unstable_batchedUpdates:()=>El,useCallback:()=>Ms,useContext:()=>Bs,useDebugValue:()=>Us,useEffect:()=>cr,useErrorBoundary:()=>Nd,useImperativeHandle:()=>zs,useLayoutEffect:()=>en,useMemo:()=>pr,useReducer:()=>Qr,useRef:()=>dr,useState:()=>Li,version:()=>qd});function el(r,e){for(var t in e)r[t]=e[t];return r}function js(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var i in e)if(i!=="__source"&&r[i]!==e[i])return!0;return!1}function rn(r){this.props=r}function tl(r,e){function t(n){var s=this.props.ref,a=s==n.ref;return!a&&s&&(s.call?s(null):s.current=null),e?!e(this.props,n)||!a:js(this.props,n)}function i(n){return this.shouldComponentUpdate=t,et(r,n)}return i.displayName="Memo("+(r.displayName||r.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}function rl(r){function e(t){var i=el({},t);return delete i.ref,r(i,t.ref||null)}return e.$$typeof=Ad,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(r.displayName||r.name)+")",e}function vr(){this.__u=0,this.t=null,this.__b=null}function ol(r){var e=r.__.__c;return e&&e.__e&&e.__e(r)}function ll(r){var e,t,i;function n(s){if(e||(e=r()).then(function(a){t=a.default||a},function(a){i=a}),i)throw i;if(!t)throw e;return et(t,s)}return n.displayName="Lazy",n.__f=!0,n}function zi(){this.u=null,this.o=null}function Dd(r){return this.getChildContext=function(){return r.context},r.children}function Pd(r){var e=this,t=r.i;e.componentWillUnmount=function(){Ii(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),r.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(i){this.childNodes.push(i),e.i.appendChild(i)},insertBefore:function(i,n){this.childNodes.push(i),e.i.appendChild(i)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),e.i.removeChild(i)}}),Ii(et(Dd,{context:e.context},r.__v),e.l)):e.l&&e.componentWillUnmount()}function hl(r,e){return et(Pd,{__v:r,i:e})}function nn(r,e,t){return e.__k==null&&(e.textContent=""),Ii(r,e),typeof t=="function"&&t(),r?r.__c:null}function cl(r,e,t){return Ls(r,e),typeof t=="function"&&t(),r?r.__c:null}function Bd(){}function Ud(){return this.cancelBubble}function Fd(){return this.defaultPrevented}function yl(r){return et.bind(null,r)}function Vs(r){return!!r&&r.$$typeof===fl}function bl(r){return Vs(r)?Vo.apply(null,arguments):r}function gr(r){return!!r.__k&&(Ii(null,r),!0)}function wl(r){return r&&(r.base||r.nodeType===1&&r)||null}var il,Ad,nl,sl,Id,al,ul,fl,Ld,zd,Md,dl,pl,vl,gl,ml,_l,qd,El,xl,Wd,Hs,Mi=As(()=>{Ws();Ws();Jr();Jr();(rn.prototype=new mt).isPureReactComponent=!0,rn.prototype.shouldComponentUpdate=function(r,e){return js(this.props,r)||js(this.state,e)};il=ue.__b;ue.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),il&&il(r)};Ad=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;nl=function(r,e){return r==null?null:Zt(Zt(r).map(e))},sl={map:nl,forEach:nl,count:function(r){return r?Zt(r).length:0},only:function(r){var e=Zt(r);if(e.length!==1)throw"Children.only";return e[0]},toArray:Zt},Id=ue.__e;ue.__e=function(r,e,t,i){if(r.then){for(var n,s=e;s=s.__;)if((n=s.__c)&&n.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),n.__c(r,e)}Id(r,e,t,i)};al=ue.unmount;ue.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),al&&al(r)},(vr.prototype=new mt).__c=function(r,e){var t=e.__c,i=this;i.t==null&&(i.t=[]),i.t.push(t);var n=ol(i.__v),s=!1,a=function(){s||(s=!0,t.__R=null,n?n(o):o())};t.__R=a;var o=function(){if(!--i.__u){if(i.state.__e){var u=i.state.__e;i.__v.__k[0]=function d(c,v,g){return c&&(c.__v=null,c.__k=c.__k&&c.__k.map(function(O){return d(O,v,g)}),c.__c&&c.__c.__P===v&&(c.__e&&g.insertBefore(c.__e,c.__d),c.__c.__e=!0,c.__c.__P=g)),c}(u,u.__c.__P,u.__c.__O)}var f;for(i.setState({__e:i.__b=null});f=i.t.pop();)f.forceUpdate()}},l=e.__h===!0;i.__u++||l||i.setState({__e:i.__b=i.__v.__k[0]}),r.then(a,a)},vr.prototype.componentWillUnmount=function(){this.t=[]},vr.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function s(a,o,l){return a&&(a.__c&&a.__c.__H&&(a.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),a.__c.__H=null),(a=el({},a)).__c!=null&&(a.__c.__P===l&&(a.__c.__P=o),a.__c=null),a.__k=a.__k&&a.__k.map(function(u){return s(u,o,l)})),a}(this.__b,t,i.__O=i.__P)}this.__b=null}var n=e.__e&&et(kt,null,r.fallback);return n&&(n.__h=null),[et(kt,null,e.__e?null:r.children),n]};ul=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;r.u=t=t[2]}};(zi.prototype=new mt).__e=function(r){var e=this,t=ol(e.__v),i=e.o.get(r);return i[0]++,function(n){var s=function(){e.props.revealOrder?(i.push(n),ul(e,r,i)):n()};t?t(s):s()}},zi.prototype.render=function(r){this.u=null,this.o=new Map;var e=Zt(r.children);r.revealOrder&&r.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return r.children},zi.prototype.componentDidUpdate=zi.prototype.componentDidMount=function(){var r=this;this.o.forEach(function(e,t){ul(r,t,e)})};fl=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Ld=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,zd=typeof document!="undefined",Md=function(r){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(r)};mt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(r){Object.defineProperty(mt.prototype,r,{configurable:!0,get:function(){return this["UNSAFE_"+r]},set:function(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})});dl=ue.event;ue.event=function(r){return dl&&(r=dl(r)),r.persist=Bd,r.isPropagationStopped=Ud,r.isDefaultPrevented=Fd,r.nativeEvent=r};vl={configurable:!0,get:function(){return this.class}},gl=ue.vnode;ue.vnode=function(r){var e=r.type,t=r.props,i=t;if(typeof e=="string"){var n=e.indexOf("-")===-1;for(var s in i={},t){var a=t[s];zd&&s==="children"&&e==="noscript"||s==="value"&&"defaultValue"in t&&a==null||(s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&a===!0?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!Md(t.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():n&&Ld.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():a===null&&(a=void 0),i[s]=a)}e=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Zt(t.children).forEach(function(o){o.props.selected=i.value.indexOf(o.props.value)!=-1})),e=="select"&&i.defaultValue!=null&&(i.value=Zt(t.children).forEach(function(o){o.props.selected=i.multiple?i.defaultValue.indexOf(o.props.value)!=-1:i.defaultValue==o.props.value})),r.props=i,t.class!=t.className&&(vl.enumerable="className"in t,t.className!=null&&(i.class=t.className),Object.defineProperty(i,"className",vl))}r.$$typeof=fl,gl&&gl(r)};ml=ue.__r;ue.__r=function(r){ml&&ml(r),pl=r.__c};_l={ReactCurrentDispatcher:{current:{readContext:function(r){return pl.__n[r.__c].props.value}}}},qd="17.0.2";El=function(r,e){return r(e)},xl=function(r,e){return r(e)},Wd=kt,Hs={useState:Li,useReducer:Qr,useEffect:cr,useLayoutEffect:en,useRef:dr,useImperativeHandle:zs,useMemo:pr,useCallback:Ms,useContext:Bs,useDebugValue:Us,version:"17.0.2",Children:sl,render:nn,hydrate:cl,unmountComponentAtNode:gr,createPortal:hl,createElement:et,createContext:Kr,createFactory:yl,cloneElement:bl,createRef:Yr,Fragment:kt,isValidElement:Vs,findDOMNode:wl,Component:mt,PureComponent:rn,memo:tl,forwardRef:rl,flushSync:xl,unstable_batchedUpdates:El,StrictMode:kt,Suspense:vr,SuspenseList:zi,lazy:ll,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:_l}});var sn=$((Uy,Tl)=>{Tl.exports=(Mi(),Sl)});var Ol=$((Fy,kl)=>{"use strict";var jd="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";kl.exports=jd});var Al=$((qy,Rl)=>{"use strict";var Vd=Ol();function Cl(){}function Nl(){}Nl.resetWarningCache=Cl;Rl.exports=function(){function r(i,n,s,a,o,l){if(l!==Vd){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}r.isRequired=r;function e(){return r}var t={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Nl,resetWarningCache:Cl};return t.PropTypes=t,t}});var Zs=$((Vy,Il)=>{Il.exports=Al()();var Wy,jy});var Xs=$((Hy,Dl)=>{"use strict";var Hd=void 0;Dl.exports=function(r){return r!==Hd&&r!==null}});var Ll=$((Zy,Pl)=>{"use strict";var Zd=Xs(),Xd={object:!0,function:!0,undefined:!0};Pl.exports=function(r){return Zd(r)?hasOwnProperty.call(Xd,typeof r):!1}});var Ml=$((Xy,zl)=>{"use strict";var Yd=Ll();zl.exports=function(r){if(!Yd(r))return!1;try{return r.constructor?r.constructor.prototype===r:!1}catch(e){return!1}}});var Ul=$((Yy,Bl)=>{"use strict";var Gd=Ml();Bl.exports=function(r){if(typeof r!="function"||!hasOwnProperty.call(r,"length"))return!1;try{if(typeof r.length!="number"||typeof r.call!="function"||typeof r.apply!="function")return!1}catch(e){return!1}return!Gd(r)}});var ql=$((Gy,Fl)=>{"use strict";var $d=Ul(),Kd=/^\s*class[\s{/}]/,Jd=Function.prototype.toString;Fl.exports=function(r){return!(!$d(r)||Kd.test(Jd.call(r)))}});var jl=$(($y,Wl)=>{"use strict";Wl.exports=function(){var r=Object.assign,e;return typeof r!="function"?!1:(e={foo:"raz"},r(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}});var Hl=$((Ky,Vl)=>{"use strict";Vl.exports=function(){try{return Object.keys("primitive"),!0}catch(r){return!1}}});var Xl=$((Jy,Zl)=>{"use strict";Zl.exports=function(){}});var an=$((Qy,Yl)=>{"use strict";var Qd=Xl()();Yl.exports=function(r){return r!==Qd&&r!==null}});var $l=$((e0,Gl)=>{"use strict";var ep=an(),tp=Object.keys;Gl.exports=function(r){return tp(ep(r)?Object(r):r)}});var Jl=$((t0,Kl)=>{"use strict";Kl.exports=Hl()()?Object.keys:$l()});var eu=$((i0,Ql)=>{"use strict";var ip=an();Ql.exports=function(r){if(!ip(r))throw new TypeError("Cannot use null or undefined");return r}});var iu=$((r0,tu)=>{"use strict";var rp=Jl(),np=eu(),sp=Math.max;tu.exports=function(r,e){var t,i,n=sp(arguments.length,2),s;for(r=Object(np(r)),s=function(a){try{r[a]=e[a]}catch(o){t||(t=o)}},i=1;i<n;++i)e=arguments[i],rp(e).forEach(s);if(t!==void 0)throw t;return r}});var nu=$((n0,ru)=>{"use strict";ru.exports=jl()()?Object.assign:iu()});var au=$((s0,su)=>{"use strict";var ap=an(),op=Array.prototype.forEach,lp=Object.create,up=function(r,e){var t;for(t in r)e[t]=r[t]};su.exports=function(r){var e=lp(null);return op.call(arguments,function(t){!ap(t)||up(Object(t),e)}),e}});var lu=$((a0,ou)=>{"use strict";var Ys="razdwatrzy";ou.exports=function(){return typeof Ys.contains!="function"?!1:Ys.contains("dwa")===!0&&Ys.contains("foo")===!1}});var hu=$((o0,uu)=>{"use strict";var hp=String.prototype.indexOf;uu.exports=function(r){return hp.call(this,r,arguments[1])>-1}});var cu=$((l0,fu)=>{"use strict";fu.exports=lu()()?String.prototype.contains:hu()});var mu=$((u0,gu)=>{"use strict";var on=Xs(),du=ql(),pu=nu(),vu=au(),mr=cu(),fp=gu.exports=function(r,e){var t,i,n,s,a;return arguments.length<2||typeof r!="string"?(s=e,e=r,r=null):s=arguments[2],on(r)?(t=mr.call(r,"c"),i=mr.call(r,"e"),n=mr.call(r,"w")):(t=n=!0,i=!1),a={value:e,configurable:t,enumerable:i,writable:n},s?pu(vu(s),a):a};fp.gs=function(r,e,t){var i,n,s,a;return typeof r!="string"?(s=t,t=e,e=r,r=null):s=arguments[3],on(e)?du(e)?on(t)?du(t)||(s=t,t=void 0):t=void 0:(s=e,e=t=void 0):e=void 0,on(r)?(i=mr.call(r,"c"),n=mr.call(r,"e")):(i=!0,n=!1),a={get:e,set:t,configurable:i,enumerable:n},s?pu(vu(s),a):a}});var yu=$((h0,_u)=>{"use strict";_u.exports=function(r){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}});var Ft=$((ra,Su)=>{"use strict";var ln=mu(),Gs=yu(),$s=Function.prototype.apply,Ks=Function.prototype.call,bu=Object.create,cp=Object.defineProperty,wu=Object.defineProperties,Js=Object.prototype.hasOwnProperty,Qs={configurable:!0,enumerable:!1,writable:!0},un,ea,hn,ta,Eu,ia,xu;un=function(r,e){var t;return Gs(e),Js.call(this,"__ee__")?t=this.__ee__:(t=Qs.value=bu(null),cp(this,"__ee__",Qs),Qs.value=null),t[r]?typeof t[r]=="object"?t[r].push(e):t[r]=[t[r],e]:t[r]=e,this};ea=function(r,e){var t,i;return Gs(e),i=this,un.call(this,r,t=function(){hn.call(i,r,t),$s.call(e,this,arguments)}),t.__eeOnceListener__=e,this};hn=function(r,e){var t,i,n,s;if(Gs(e),!Js.call(this,"__ee__"))return this;if(t=this.__ee__,!t[r])return this;if(i=t[r],typeof i=="object")for(s=0;n=i[s];++s)(n===e||n.__eeOnceListener__===e)&&(i.length===2?t[r]=i[s?0:1]:i.splice(s,1));else(i===e||i.__eeOnceListener__===e)&&delete t[r];return this};ta=function(r){var e,t,i,n,s;if(!!Js.call(this,"__ee__")&&(n=this.__ee__[r],!!n))if(typeof n=="object"){for(t=arguments.length,s=new Array(t-1),e=1;e<t;++e)s[e-1]=arguments[e];for(n=n.slice(),e=0;i=n[e];++e)$s.call(i,this,s)}else switch(arguments.length){case 1:Ks.call(n,this);break;case 2:Ks.call(n,this,arguments[1]);break;case 3:Ks.call(n,this,arguments[1],arguments[2]);break;default:for(t=arguments.length,s=new Array(t-1),e=1;e<t;++e)s[e-1]=arguments[e];$s.call(n,this,s)}};Eu={on:un,once:ea,off:hn,emit:ta};ia={on:ln(un),once:ln(ea),off:ln(hn),emit:ln(ta)};xu=wu({},ia);Su.exports=ra=function(r){return r==null?bu(xu):wu(Object(r),ia)};ra.methods=Eu});var _r=$(fn=>{"use strict";function na(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}var Tu=na({HTML:"text/html",isHTML:function(r){return r===Tu.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ku=na({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===ku.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});fn.freeze=na;fn.MIME_TYPE=Tu;fn.NAMESPACE=ku});var pa=$(si=>{var dp=_r(),yr=dp.NAMESPACE;function pp(r){return r!==""}function vp(r){return r?r.split(/[\t\n\f\r ]+/).filter(pp):[]}function gp(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}function Ou(r){if(!r)return[];var e=vp(r);return Object.keys(e.reduce(gp,{}))}function mp(r){return function(e){return r&&r.indexOf(e)!==-1}}function br(r,e){for(var t in r)e[t]=r[t]}function vt(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};var i=n;n.prototype=e.prototype,n=new n,br(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var gt={},qt=gt.ELEMENT_NODE=1,Bi=gt.ATTRIBUTE_NODE=2,cn=gt.TEXT_NODE=3,Cu=gt.CDATA_SECTION_NODE=4,Nu=gt.ENTITY_REFERENCE_NODE=5,_p=gt.ENTITY_NODE=6,Ru=gt.PROCESSING_INSTRUCTION_NODE=7,Au=gt.COMMENT_NODE=8,Iu=gt.DOCUMENT_NODE=9,Du=gt.DOCUMENT_TYPE_NODE=10,Qt=gt.DOCUMENT_FRAGMENT_NODE=11,yp=gt.NOTATION_NODE=12,st={},Je={},c0=st.INDEX_SIZE_ERR=(Je[1]="Index size error",1),d0=st.DOMSTRING_SIZE_ERR=(Je[2]="DOMString size error",2),bp=st.HIERARCHY_REQUEST_ERR=(Je[3]="Hierarchy request error",3),p0=st.WRONG_DOCUMENT_ERR=(Je[4]="Wrong document",4),v0=st.INVALID_CHARACTER_ERR=(Je[5]="Invalid character",5),g0=st.NO_DATA_ALLOWED_ERR=(Je[6]="No data allowed",6),m0=st.NO_MODIFICATION_ALLOWED_ERR=(Je[7]="No modification allowed",7),wp=st.NOT_FOUND_ERR=(Je[8]="Not found",8),_0=st.NOT_SUPPORTED_ERR=(Je[9]="Not supported",9),Pu=st.INUSE_ATTRIBUTE_ERR=(Je[10]="Attribute in use",10),y0=st.INVALID_STATE_ERR=(Je[11]="Invalid state",11),b0=st.SYNTAX_ERR=(Je[12]="Syntax error",12),w0=st.INVALID_MODIFICATION_ERR=(Je[13]="Invalid modification",13),E0=st.NAMESPACE_ERR=(Je[14]="Invalid namespace",14),x0=st.INVALID_ACCESS_ERR=(Je[15]="Invalid access",15);function pi(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Je[r]),this.message=Je[r],Error.captureStackTrace&&Error.captureStackTrace(this,pi);return t.code=r,e&&(this.message=this.message+": "+e),t}pi.prototype=Error.prototype;br(st,pi);function ei(){}ei.prototype={length:0,item:function(r){return this[r]||null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)Fi(this[i],t,r,e);return t.join("")}};function Ui(r,e){this._node=r,this._refresh=e,sa(this)}function sa(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!=e){var t=r._refresh(r._node);Gu(r,"length",t.length),br(t,r),r._inc=e}}Ui.prototype.item=function(r){return sa(this),this[r]};vt(Ui,ei);function dn(){}function Lu(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function zu(r,e,t,i){if(i?e[Lu(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var n=r.ownerDocument;n&&(i&&Fu(n,r,i),Ep(n,r,t))}}function Mu(r,e,t){var i=Lu(e,t);if(i>=0){for(var n=e.length-1;i<n;)e[i]=e[++i];if(e.length=n,r){var s=r.ownerDocument;s&&(Fu(s,r,t),t.ownerElement=null)}}else throw pi(wp,new Error(r.tagName+"@"+t))}dn.prototype={length:0,item:ei.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new pi(Pu);var t=this.getNamedItem(r.nodeName);return zu(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new pi(Pu);return t=this.getNamedItemNS(r.namespaceURI,r.localName),zu(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return Mu(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return Mu(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function Bu(){}Bu.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var i=new Er;if(i.implementation=this,i.childNodes=new ei,i.doctype=t||null,t&&i.appendChild(t),e){var n=i.createElementNS(r,e);i.appendChild(n)}return i},createDocumentType:function(r,e,t){var i=new vn;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function at(){}at.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return Wu(this,r,e)},replaceChild:function(r,e){this.insertBefore(r,e),e&&this.removeChild(e)},removeChild:function(r){return qu(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return da(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==cn&&r.nodeType==cn?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(t[i]==r)return i}e=e.nodeType==Bi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&r in t)return t[r];e=e.nodeType==Bi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function Uu(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}br(gt,at);br(gt,at.prototype);function wr(r,e){if(e(r))return!0;if(r=r.firstChild)do if(wr(r,e))return!0;while(r=r.nextSibling)}function Er(){}function Ep(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===yr.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Fu(r,e,t,i){r&&r._inc++;var n=t.namespaceURI;n===yr.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function aa(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else{for(var n=e.firstChild,s=0;n;)i[s++]=n,n=n.nextSibling;i.length=s}}}function qu(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,aa(r.ownerDocument,r),e}function Wu(r,e,t){var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===Qt){var n=e.firstChild;if(n==null)return e;var s=e.lastChild}else n=s=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,s.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=s:t.previousSibling=s;do n.parentNode=r;while(n!==s&&(n=n.nextSibling));return aa(r.ownerDocument||r,r),e.nodeType==Qt&&(e.firstChild=e.lastChild=null),e}function xp(r,e){var t=e.parentNode;if(t){var i=r.lastChild;t.removeChild(e);var i=r.lastChild}var i=r.lastChild;return e.parentNode=r,e.previousSibling=i,e.nextSibling=null,i?i.nextSibling=e:r.firstChild=e,r.lastChild=e,aa(r.ownerDocument,r,e),e}Er.prototype={nodeName:"#document",nodeType:Iu,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Qt){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i}return r}return this.documentElement==null&&r.nodeType==qt&&(this.documentElement=r),Wu(this,r,e),r.ownerDocument=this,r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),qu(this,r)},importNode:function(r,e){return Yu(this,r,e)},getElementById:function(r){var e=null;return wr(this.documentElement,function(t){if(t.nodeType==qt&&t.getAttribute("id")==r)return e=t,!0}),e},getElementsByClassName:function(r){var e=Ou(r);return new Ui(this,function(t){var i=[];return e.length>0&&wr(t.documentElement,function(n){if(n!==t&&n.nodeType===qt){var s=n.getAttribute("class");if(s){var a=r===s;if(!a){var o=Ou(s);a=e.every(mp(o))}a&&i.push(n)}}}),i})},createElement:function(r){var e=new vi;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new ei;var t=e.attributes=new dn;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new gn;return r.ownerDocument=this,r.childNodes=new ei,r},createTextNode:function(r){var e=new oa;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new la;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new ua;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new fa;return t.ownerDocument=this,t.tagName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new pn;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){var e=new ha;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new vi,i=e.split(":"),n=t.attributes=new dn;return t.childNodes=new ei,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,n._ownerElement=t,t},createAttributeNS:function(r,e){var t=new pn,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};vt(Er,at);function vi(){this._nsMap={}}vi.prototype={nodeType:qt,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},appendChild:function(r){return r.nodeType===Qt?this.insertBefore(r,null):xp(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new Ui(this,function(e){var t=[];return wr(e,function(i){i!==e&&i.nodeType==qt&&(r==="*"||i.tagName==r)&&t.push(i)}),t})},getElementsByTagNameNS:function(r,e){return new Ui(this,function(t){var i=[];return wr(t,function(n){n!==t&&n.nodeType===qt&&(r==="*"||n.namespaceURI===r)&&(e==="*"||n.localName==e)&&i.push(n)}),i})}};Er.prototype.getElementsByTagName=vi.prototype.getElementsByTagName;Er.prototype.getElementsByTagNameNS=vi.prototype.getElementsByTagNameNS;vt(vi,at);function pn(){}pn.prototype.nodeType=Bi;vt(pn,at);function xr(){}xr.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},appendChild:function(r){throw new Error(Je[bp])},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var i=this.data.substring(0,r),n=this.data.substring(r+e);t=i+t+n,this.nodeValue=this.data=t,this.length=t.length}};vt(xr,at);function oa(){}oa.prototype={nodeName:"#text",nodeType:cn,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};vt(oa,xr);function la(){}la.prototype={nodeName:"#comment",nodeType:Au};vt(la,xr);function ua(){}ua.prototype={nodeName:"#cdata-section",nodeType:Cu};vt(ua,xr);function vn(){}vn.prototype.nodeType=Du;vt(vn,at);function ju(){}ju.prototype.nodeType=yp;vt(ju,at);function Vu(){}Vu.prototype.nodeType=_p;vt(Vu,at);function ha(){}ha.prototype.nodeType=Nu;vt(ha,at);function gn(){}gn.prototype.nodeName="#document-fragment";gn.prototype.nodeType=Qt;vt(gn,at);function fa(){}fa.prototype.nodeType=Ru;vt(fa,at);function Hu(){}Hu.prototype.serializeToString=function(r,e,t){return Zu.call(r,e,t)};at.prototype.toString=Zu;function Zu(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,n=i.prefix,s=i.namespaceURI;if(s&&n==null){var n=i.lookupPrefix(s);if(n==null)var a=[{namespace:s,prefix:null}]}return Fi(this,t,r,e,a),t.join("")}function Xu(r,e,t){var i=r.prefix||"",n=r.namespaceURI;if(!n||i==="xml"&&n===yr.XML||n===yr.XMLNS)return!1;for(var s=t.length;s--;){var a=t[s];if(a.prefix===i)return a.namespace!==n}return!0}function ca(r,e,t){r.push(" ",e,'="',t.replace(/[<&"]/g,Uu),'"')}function Fi(r,e,t,i,n){if(n||(n=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case qt:var s=r.attributes,a=s.length,o=r.firstChild,l=r.tagName;t=yr.isHTML(r.namespaceURI)||t;var u=l;if(!t&&!r.prefix&&r.namespaceURI){for(var f,d=0;d<s.length;d++)if(s.item(d).name==="xmlns"){f=s.item(d).value;break}if(!f)for(var c=n.length-1;c>=0;c--){var v=n[c];if(v.prefix===""&&v.namespace===r.namespaceURI){f=v.namespace;break}}if(f!==r.namespaceURI)for(var c=n.length-1;c>=0;c--){var v=n[c];if(v.namespace===r.namespaceURI){v.prefix&&(u=v.prefix+":"+l);break}}}e.push("<",u);for(var g=0;g<a;g++){var O=s.item(g);O.prefix=="xmlns"?n.push({prefix:O.localName,namespace:O.value}):O.nodeName=="xmlns"&&n.push({prefix:"",namespace:O.value})}for(var g=0;g<a;g++){var O=s.item(g);if(Xu(O,t,n)){var k=O.prefix||"",_=O.namespaceURI;ca(e,k?"xmlns:"+k:"xmlns",_),n.push({prefix:k,namespace:_})}Fi(O,e,t,i,n)}if(l===u&&Xu(r,t,n)){var k=r.prefix||"",_=r.namespaceURI;ca(e,k?"xmlns:"+k:"xmlns",_),n.push({prefix:k,namespace:_})}if(o||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(e.push(">"),t&&/^script$/i.test(l))for(;o;)o.data?e.push(o.data):Fi(o,e,t,i,n.slice()),o=o.nextSibling;else for(;o;)Fi(o,e,t,i,n.slice()),o=o.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Iu:case Qt:for(var o=r.firstChild;o;)Fi(o,e,t,i,n.slice()),o=o.nextSibling;return;case Bi:return ca(e,r.name,r.value);case cn:return e.push(r.data.replace(/[<&]/g,Uu).replace(/]]>/g,"]]&gt;"));case Cu:return e.push("<![CDATA[",r.data,"]]>");case Au:return e.push("<!--",r.data,"-->");case Du:var p=r.publicId,y=r.systemId;if(e.push("<!DOCTYPE ",r.name),p)e.push(" PUBLIC ",p),y&&y!="."&&e.push(" ",y),e.push(">");else if(y&&y!=".")e.push(" SYSTEM ",y,">");else{var T=r.internalSubset;T&&e.push(" [",T,"]"),e.push(">")}return;case Ru:return e.push("<?",r.target," ",r.data,"?>");case Nu:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}function Yu(r,e,t){var i;switch(e.nodeType){case qt:i=e.cloneNode(!1),i.ownerDocument=r;case Qt:break;case Bi:t=!0;break}if(i||(i=e.cloneNode(!1)),i.ownerDocument=r,i.parentNode=null,t)for(var n=e.firstChild;n;)i.appendChild(Yu(r,n,t)),n=n.nextSibling;return i}function da(r,e,t){var i=new e.constructor;for(var n in e){var s=e[n];typeof s!="object"&&s!=i[n]&&(i[n]=s)}switch(e.childNodes&&(i.childNodes=new ei),i.ownerDocument=r,i.nodeType){case qt:var a=e.attributes,o=i.attributes=new dn,l=a.length;o._ownerElement=i;for(var u=0;u<l;u++)i.setAttributeNode(da(r,a.item(u),!0));break;case Bi:t=!0}if(t)for(var f=e.firstChild;f;)i.appendChild(da(r,f,t)),f=f.nextSibling;return i}function Gu(r,e,t){r[e]=t}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case qt:case Qt:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};S0=r,Object.defineProperty(Ui.prototype,"length",{get:function(){return sa(this),this.$$length}}),Object.defineProperty(at.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case qt:case Qt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Gu=function(e,t,i){e["$$"+t]=i}}}catch(r){}var S0;si.DocumentType=vn;si.DOMException=pi;si.DOMImplementation=Bu;si.Element=vi;si.Node=at;si.NodeList=ei;si.XMLSerializer=Hu});var Ku=$(Sr=>{var $u=_r().freeze;Sr.XML_ENTITIES=$u({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Sr.HTML_ENTITIES=$u({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",divide:"\xF7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",euro:"\u20AC",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"});Sr.entityMap=Sr.HTML_ENTITIES});var sh=$(ga=>{var Tr=_r().NAMESPACE,va=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Ju=new RegExp("[\\-\\.0-9"+va.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Qu=new RegExp("^"+va.source+Ju.source+"*(?::"+va.source+Ju.source+"*)?$"),kr=0,ai=1,qi=2,Or=3,Wi=4,ji=5,Cr=6,mn=7;function Vi(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Vi)}Vi.prototype=new Error;Vi.prototype.name=Vi.name;function eh(){}eh.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),rh(e,e={}),Sp(r,e,t,i,this.errorHandler),i.endDocument()}};function Sp(r,e,t,i,n){function s(ie){if(ie>65535){ie-=65536;var de=55296+(ie>>10),fe=56320+(ie&1023);return String.fromCharCode(de,fe)}else return String.fromCharCode(ie)}function a(ie){var de=ie.slice(1,-1);return de in t?t[de]:de.charAt(0)==="#"?s(parseInt(de.substr(1).replace("x","0x"))):(n.error("entity not found:"+ie),ie)}function o(ie){if(ie>O){var de=r.substring(O,ie).replace(/&#?\w+;/g,a);c&&l(O),i.characters(de,0,ie-O),O=ie}}function l(ie,de){for(;ie>=f&&(de=d.exec(r));)u=de.index,f=u+de[0].length,c.lineNumber++;c.columnNumber=ie-u+1}for(var u=0,f=0,d=/.*(?:\r\n?|\n)|.*$/g,c=i.locator,v=[{currentNSMap:e}],g={},O=0;;){try{var k=r.indexOf("<",O);if(k<0){if(!r.substr(O).match(/^\s*$/)){var _=i.doc,p=_.createTextNode(r.substr(O));_.appendChild(p),i.currentElement=p}return}switch(k>O&&o(k),r.charAt(k+1)){case"/":var y=r.indexOf(">",k+3),T=r.substring(k+2,y).replace(/[ \t\n\r]+$/g,""),P=v.pop();y<0?(T=r.substring(k+2).replace(/[\s<].*/,""),n.error("end tag name: "+T+" is not complete:"+P.tagName),y=k+1+T.length):T.match(/\s</)&&(T=T.replace(/[\s<].*/,""),n.error("end tag name: "+T+" maybe not complete"),y=k+1+T.length);var w=P.localNSMap,N=P.tagName==T,C=N||P.tagName&&P.tagName.toLowerCase()==T.toLowerCase();if(C){if(i.endElement(P.uri,P.localName,T),w)for(var M in w)i.endPrefixMapping(M);N||n.fatalError("end tag name: "+T+" is not match the current start tagName:"+P.tagName)}else v.push(P);y++;break;case"?":c&&l(k),y=Np(r,k,i);break;case"!":c&&l(k),y=Cp(r,k,i,n);break;default:c&&l(k);var j=new nh,q=v[v.length-1].currentNSMap,y=Tp(r,k,j,q,a,n),G=j.length;if(!j.closed&&Op(r,y,j.tagName,g)&&(j.closed=!0,t.nbsp||n.warning("unclosed xml attribute")),c&&G){for(var H=th(c,{}),re=0;re<G;re++){var pe=j[re];l(pe.offset),pe.locator=th(c,{})}i.locator=H,ih(j,i,q)&&v.push(j),i.locator=c}else ih(j,i,q)&&v.push(j);Tr.isHTML(j.uri)&&!j.closed?y=kp(r,y,j.tagName,a,i):y++}}catch(ie){if(ie instanceof Vi)throw ie;n.error("element parse error: "+ie),y=-1}y>O?O=y:o(Math.max(k,O)+1)}}function th(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function Tp(r,e,t,i,n,s){function a(v,g,O){t.attributeNames.hasOwnProperty(v)&&s.fatalError("Attribute "+v+" redefined"),t.addValue(v,g,O)}for(var o,l,u=++e,f=kr;;){var d=r.charAt(u);switch(d){case"=":if(f===ai)o=r.slice(e,u),f=Or;else if(f===qi)f=Or;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===Or||f===ai)if(f===ai&&(s.warning('attribute value must after "="'),o=r.slice(e,u)),e=u+1,u=r.indexOf(d,e),u>0)l=r.slice(e,u).replace(/&#?\w+;/g,n),a(o,l,e-1),f=ji;else throw new Error("attribute value no end '"+d+"' match");else if(f==Wi)l=r.slice(e,u).replace(/&#?\w+;/g,n),a(o,l,e),s.warning('attribute "'+o+'" missed start quot('+d+")!!"),e=u+1,f=ji;else throw new Error('attribute value must after "="');break;case"/":switch(f){case kr:t.setTagName(r.slice(e,u));case ji:case Cr:case mn:f=mn,t.closed=!0;case Wi:case ai:case qi:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),f==kr&&t.setTagName(r.slice(e,u)),u;case">":switch(f){case kr:t.setTagName(r.slice(e,u));case ji:case Cr:case mn:break;case Wi:case ai:l=r.slice(e,u),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case qi:f===qi&&(l=o),f==Wi?(s.warning('attribute "'+l+'" missed quot(")!'),a(o,l.replace(/&#?\w+;/g,n),e)):((!Tr.isHTML(i[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Or:throw new Error("attribute value missed!!")}return u;case"\x80":d=" ";default:if(d<=" ")switch(f){case kr:t.setTagName(r.slice(e,u)),f=Cr;break;case ai:o=r.slice(e,u),f=qi;break;case Wi:var l=r.slice(e,u).replace(/&#?\w+;/g,n);s.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case ji:f=Cr;break}else switch(f){case qi:var c=t.tagName;(!Tr.isHTML(i[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=u,f=ai;break;case ji:s.warning('attribute space is required"'+o+'"!!');case Cr:f=ai,e=u;break;case Or:f=Wi,e=u;break;case mn:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function ih(r,e,t){for(var i=r.tagName,n=null,s=r.length;s--;){var a=r[s],o=a.qName,l=a.value,c=o.indexOf(":");if(c>0)var u=a.prefix=o.slice(0,c),f=o.slice(c+1),d=u==="xmlns"&&f;else f=o,u=null,d=o==="xmlns"&&"";a.localName=f,d!==!1&&(n==null&&(n={},rh(t,t={})),t[d]=n[d]=l,a.uri=Tr.XMLNS,e.startPrefixMapping(d,l))}for(var s=r.length;s--;){a=r[s];var u=a.prefix;u&&(u==="xml"&&(a.uri=Tr.XML),u!=="xmlns"&&(a.uri=t[u||""]))}var c=i.indexOf(":");c>0?(u=r.prefix=i.slice(0,c),f=r.localName=i.slice(c+1)):(u=null,f=r.localName=i);var v=r.uri=t[u||""];if(e.startElement(v,f,i,r),r.closed){if(e.endElement(v,f,i),n)for(u in n)e.endPrefixMapping(u)}else return r.currentNSMap=t,r.localNSMap=n,!0}function kp(r,e,t,i,n){if(/^(?:script|textarea)$/i.test(t)){var s=r.indexOf("</"+t+">",e),a=r.substring(e+1,s);if(/[&<]/.test(a))return/^script$/i.test(t)?(n.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,i),n.characters(a,0,a.length),s)}return e+1}function Op(r,e,t,i){var n=i[t];return n==null&&(n=r.lastIndexOf("</"+t+">"),n<e&&(n=r.lastIndexOf("</"+t)),i[t]=n),n<e}function rh(r,e){for(var t in r)e[t]=r[t]}function Cp(r,e,t,i){var n=r.charAt(e+2);switch(n){case"-":if(r.charAt(e+3)==="-"){var s=r.indexOf("-->",e+4);return s>e?(t.comment(r,e+4,s-e-4),s+3):(i.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var s=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,s-e-9),t.endCDATA(),s+3}var a=Rp(r,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],u=!1,f=!1;o>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],f=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(f=a[3][0]));var d=a[o-1];return t.startDTD(l,u,f),t.endDTD(),d.index+d[0].length}}return-1}function Np(r,e,t){var i=r.indexOf("?>",e);if(i){var n=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){var s=n[0].length;return t.processingInstruction(n[1],n[2]),i+2}else return-1}return-1}function nh(){this.attributeNames={}}nh.prototype={setTagName:function(r){if(!Qu.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!Qu.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function Rp(r,e){var t,i=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=e,n.exec(r);t=n.exec(r);)if(i.push(t),t[1])return i}ga.XMLReader=eh;ga.ParseError=Vi});var fh=$(Rr=>{var Ap=_r(),ma=pa(),ah=Ku(),oh=sh(),Ip=ma.DOMImplementation,lh=Ap.NAMESPACE,Dp=oh.ParseError,Pp=oh.XMLReader;function uh(r){this.options=r||{locator:{}}}uh.prototype.parseFromString=function(r,e){var t=this.options,i=new Pp,n=t.domBuilder||new Nr,s=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),u=l?ah.HTML_ENTITIES:ah.XML_ENTITIES;return a&&n.setDocumentLocator(a),i.errorHandler=Lp(s,n,a),i.domBuilder=t.domBuilder||n,l&&(o[""]=lh.HTML),o.xml=o.xml||lh.XML,r&&typeof r=="string"?i.parse(r,o,u):i.errorHandler.error("invalid doc source"),n.doc};function Lp(r,e,t){if(!r){if(e instanceof Nr)return e;r=e}var i={},n=r instanceof Function;t=t||{};function s(a){var o=r[a];!o&&n&&(o=r.length==2?function(l){r(a,l)}:r),i[a]=o&&function(l){o("[xmldom "+a+"] "+l+_a(t))}||function(){}}return s("warning"),s("error"),s("fatalError"),i}function Nr(){this.cdata=!1}function Hi(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}Nr.prototype={startDocument:function(){this.doc=new Ip().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,e,t,i){var n=this.doc,s=n.createElementNS(r,t||e),a=i.length;_n(this,s),this.currentElement=s,this.locator&&Hi(this.locator,s);for(var o=0;o<a;o++){var r=i.getURI(o),l=i.getValue(o),t=i.getQName(o),u=n.createAttributeNS(r,t);this.locator&&Hi(i.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(r,e,t){var i=this.currentElement,n=i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Hi(this.locator,t),_n(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=hh.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&Hi(this.locator,i)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,e,t){r=hh.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&Hi(this.locator,i),_n(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,e,t){var i=this.doc.implementation;if(i&&i.createDocumentType){var n=i.createDocumentType(r,e,t);this.locator&&Hi(this.locator,n),_n(this,n),this.doc.doctype=n}},warning:function(r){console.warn("[xmldom warning] "+r,_a(this.locator))},error:function(r){console.error("[xmldom error] "+r,_a(this.locator))},fatalError:function(r){throw new Dp(r,this.locator)}};function _a(r){if(r)return`
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function hh(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Nr.prototype[r]=function(){return null}});function _n(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}Rr.__DOMHandler=Nr;Rr.DOMParser=uh;Rr.DOMImplementation=ma.DOMImplementation;Rr.XMLSerializer=ma.XMLSerializer});var ya=$(yn=>{var ch=pa();yn.DOMImplementation=ch.DOMImplementation;yn.XMLSerializer=ch.XMLSerializer;yn.DOMParser=fh().DOMParser});var Ie=$(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.RangeObject=void 0;ve.blob2base64=lv;ve.borders=Yp;ve.bounds=Xp;ve.createBase64Url=iv;ve.createBlob=gh;ve.createBlobUrl=ev;ve.defaults=Vp;ve.defer=uv;ve.documentHeight=Fp;ve.extend=Hp;ve.filterChildren=cv;ve.findChildren=fv;ve.getParentByTagName=dv;ve.indexOfElementNode=Jp;ve.indexOfNode=wa;ve.indexOfSorted=ba;ve.indexOfTextNode=Kp;ve.insert=Zp;ve.isElement=qp;ve.isFloat=Wp;ve.isNumber=vh;ve.isXml=Qp;ve.locationOf=bn;ve.nodeBounds=Gp;ve.parents=xa;ve.parse=nv;ve.prefixed=jp;ve.qs=sv;ve.qsa=mh;ve.qsp=av;ve.querySelectorByType=hv;ve.requestAnimationFrame=void 0;ve.revokeBlobUrl=tv;ve.sprint=ov;ve.treeWalker=_h;ve.type=rv;ve.uuid=ph;ve.walk=Ea;ve.windowBounds=$p;var zp=ya(),Mp=typeof window!="undefined"?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1;ve.requestAnimationFrame=Mp;var Bp=1,Up=3,dh=typeof URL!="undefined"?URL:typeof window!="undefined"?window.URL||window.webkitURL||window.mozURL:void 0;function ph(){var r=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(t=="x"?i:i&7|8).toString(16)});return e}function Fp(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function qp(r){return!!(r&&r.nodeType==1)}function vh(r){return!isNaN(parseFloat(r))&&isFinite(r)}function Wp(r){let e=parseFloat(r);return vh(r)===!1?!1:typeof r=="string"&&r.indexOf(".")>-1?!0:Math.floor(e)!==e}function jp(r){var e=["Webkit","webkit","Moz","O","ms"],t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=r.toLowerCase(),n=e.length;if(typeof document=="undefined"||typeof document.body.style[i]!="undefined")return r;for(var s=0;s<n;s++)if(typeof document.body.style[t[s]+i]!="undefined")return t[s]+i;return r}function Vp(r){for(var e=1,t=arguments.length;e<t;e++){var i=arguments[e];for(var n in i)r[n]===void 0&&(r[n]=i[n])}return r}function Hp(r){var e=[].slice.call(arguments,1);return e.forEach(function(t){!t||Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}),r}function Zp(r,e,t){var i=bn(r,e,t);return e.splice(i,0,r),i}function bn(r,e,t,i,n){var s=i||0,a=n||e.length,o=parseInt(s+(a-s)/2),l;return t||(t=function(u,f){if(u>f)return 1;if(u<f)return-1;if(u==f)return 0}),a-s<=0?o:(l=t(e[o],r),a-s==1?l>=0?o:o+1:l===0?o:l===-1?bn(r,e,t,o,a):bn(r,e,t,s,o))}function ba(r,e,t,i,n){var s=i||0,a=n||e.length,o=parseInt(s+(a-s)/2),l;return t||(t=function(u,f){if(u>f)return 1;if(u<f)return-1;if(u==f)return 0}),a-s<=0?-1:(l=t(e[o],r),a-s==1?l===0?o:-1:l===0?o:l===-1?ba(r,e,t,o,a):ba(r,e,t,s,o))}function Xp(r){var e=window.getComputedStyle(r),t=["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],n=0,s=0;return t.forEach(function(a){n+=parseFloat(e[a])||0}),i.forEach(function(a){s+=parseFloat(e[a])||0}),{height:s,width:n}}function Yp(r){var e=window.getComputedStyle(r),t=["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],n=0,s=0;return t.forEach(function(a){n+=parseFloat(e[a])||0}),i.forEach(function(a){s+=parseFloat(e[a])||0}),{height:s,width:n}}function Gp(r){let e,t=r.ownerDocument;if(r.nodeType==Node.TEXT_NODE){let i=t.createRange();i.selectNodeContents(r),e=i.getBoundingClientRect()}else e=r.getBoundingClientRect();return e}function $p(){var r=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:r,bottom:e,width:r,height:e}}function wa(r,e){for(var t=r.parentNode,i=t.childNodes,n,s=-1,a=0;a<i.length&&(n=i[a],n.nodeType===e&&s++,n!=r);a++);return s}function Kp(r){return wa(r,Up)}function Jp(r){return wa(r,Bp)}function Qp(r){return["xml","opf","ncx"].indexOf(r)>-1}function gh(r,e){return new Blob([r],{type:e})}function ev(r,e){var t,i=gh(r,e);return t=dh.createObjectURL(i),t}function tv(r){return dh.revokeObjectURL(r)}function iv(r,e){var t,i;if(typeof r=="string")return t=btoa(r),i="data:"+e+";base64,"+t,i}function rv(r){return Object.prototype.toString.call(r).slice(8,-1)}function nv(r,e,t){var i,n;return typeof DOMParser=="undefined"||t?n=zp.DOMParser:n=DOMParser,r.charCodeAt(0)===65279&&(r=r.slice(1)),i=new n().parseFromString(r,e),i}function sv(r,e){var t;if(!r)throw new Error("No Element Provided");if(typeof r.querySelector!="undefined")return r.querySelector(e);if(t=r.getElementsByTagName(e),t.length)return t[0]}function mh(r,e){return typeof r.querySelector!="undefined"?r.querySelectorAll(e):r.getElementsByTagName(e)}function av(r,e,t){var i,n;if(typeof r.querySelector!="undefined"){e+="[";for(var s in t)e+=s+"~='"+t[s]+"'";return e+="]",r.querySelector(e)}else if(i=r.getElementsByTagName(e),n=Array.prototype.slice.call(i,0).filter(function(a){for(var o in t)if(a.getAttribute(o)===t[o])return!0;return!1}),n)return n[0]}function ov(r,e){var t=r.ownerDocument||r;typeof t.createTreeWalker!="undefined"?_h(r,e,NodeFilter.SHOW_TEXT):Ea(r,function(i){i&&i.nodeType===3&&e(i)},!0)}function _h(r,e,t){var i=document.createTreeWalker(r,t,null,!1);let n;for(;n=i.nextNode();)e(n)}function Ea(r,e){if(e(r))return!0;if(r=r.firstChild,r)do{if(Ea(r,e))return!0;r=r.nextSibling}while(r)}function lv(r){return new Promise(function(e,t){var i=new FileReader;i.readAsDataURL(r),i.onloadend=function(){e(i.result)}})}function uv(){this.resolve=null,this.reject=null,this.id=ph(),this.promise=new Promise((r,e)=>{this.resolve=r,this.reject=e}),Object.freeze(this)}function hv(r,e,t){var i;if(typeof r.querySelector!="undefined"&&(i=r.querySelector(`${e}[*|type="${t}"]`)),!i||i.length===0){i=mh(r,e);for(var n=0;n<i.length;n++)if(i[n].getAttributeNS("http://www.idpf.org/2007/ops","type")===t||i[n].getAttribute("epub:type")===t)return i[n]}else return i}function fv(r){for(var e=[],t=r.childNodes,i=0;i<t.length;i++){let n=t[i];n.nodeType===1&&e.push(n)}return e}function xa(r){for(var e=[r];r;r=r.parentNode)e.unshift(r);return e}function cv(r,e,t){for(var i=[],n=r.childNodes,s=0;s<n.length;s++){let a=n[s];if(a.nodeType===1&&a.nodeName.toLowerCase()===e){if(t)return a;i.push(a)}}if(!t)return i}function dv(r,e){let t;if(!(r===null||e===""))for(t=r.parentNode;t.nodeType===1;){if(t.tagName.toLowerCase()===e)return t;t=t.parentNode}}var yh=class{constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,t){this.startContainer=e,this.startOffset=t,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,t){this.endContainer=e,this.endOffset=t,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let t=e.parentNode,i=Array.prototype.indexOf.call(t.childNodes,e);this.setStart(t,i),this.setEnd(t,i+1)}selectNodeContents(e){let t=e.childNodes[e.childNodes-1],i=e.nodeType===3?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,i)}_commonAncestorContainer(e,t){var i=xa(e||this.startContainer),n=xa(t||this.endContainer);if(i[0]==n[0]){for(var s=0;s<i.length;s++)if(i[s]!=n[s])return i[s-1]}}_checkCollapsed(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}toString(){}};ve.RangeObject=yh});var Ar=$((A0,wh)=>{"use strict";Sa||(Sa={cwd:function(){return"/"}});var Sa;function Xt(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+r)}function bh(r,e){for(var t="",i=-1,n=0,s,a=0;a<=r.length;++a){if(a<r.length)s=r.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||n===1))if(i!==a-1&&n===2){if(t.length<2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){for(var o=t.length-1,l=o;l>=0&&t.charCodeAt(l)!==47;--l);if(l!==o){l===-1?t="":t=t.slice(0,l),i=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=a,n=0;continue}}e&&(t.length>0?t+="/..":t="..")}else t.length>0?t+="/"+r.slice(i+1,a):t=r.slice(i+1,a);i=a,n=0}else s===46&&n!==-1?++n:n=-1}return t}function pv(r,e){var t=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+i:t+r+i:i}var wn={resolve:function(){for(var e="",t=!1,i,n=arguments.length-1;n>=-1&&!t;n--){var s;n>=0?s=arguments[n]:(i===void 0&&(i=Sa.cwd()),s=i),Xt(s),s.length!==0&&(e=s+"/"+e,t=s.charCodeAt(0)===47)}return e=bh(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(Xt(e),e.length===0)return".";var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=bh(e,!t),e.length===0&&!t&&(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return Xt(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var i=arguments[t];Xt(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":wn.normalize(e)},relative:function(e,t){if(Xt(e),Xt(t),e===t||(e=wn.resolve(e),t=wn.resolve(t),e===t))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var n=e.length,s=n-i,a=1;a<t.length&&t.charCodeAt(a)===47;++a);for(var o=t.length,l=o-a,u=s<l?s:l,f=-1,d=0;d<=u;++d){if(d===u){if(l>u){if(t.charCodeAt(a+d)===47)return t.slice(a+d+1);if(d===0)return t.slice(a+d)}else s>u&&(e.charCodeAt(i+d)===47?f=d:d===0&&(f=0));break}var c=e.charCodeAt(i+d),v=t.charCodeAt(a+d);if(c!==v)break;c===47&&(f=d)}var g="";for(d=i+f+1;d<=n;++d)(d===n||e.charCodeAt(d)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+t.slice(a+f):(a+=f,t.charCodeAt(a)===47&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(Xt(e),e.length===0)return".";for(var t=e.charCodeAt(0),i=t===47,n=-1,s=!0,a=e.length-1;a>=1;--a)if(t=e.charCodeAt(a),t===47){if(!s){n=a;break}}else s=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xt(e);var i=0,n=-1,s=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,l=-1;for(a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){i=a+1;break}}else l===-1&&(s=!1,l=a+1),o>=0&&(u===t.charCodeAt(o)?--o==-1&&(n=a):(o=-1,n=l))}return i===n?n=l:n===-1&&(n=e.length),e.slice(i,n)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!s){i=a+1;break}}else n===-1&&(s=!1,n=a+1);return n===-1?"":e.slice(i,n)}},extname:function(e){Xt(e);for(var t=-1,i=0,n=-1,s=!0,a=0,o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!s){i=o+1;break}continue}n===-1&&(s=!1,n=o+1),l===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||n===-1||a===0||a===1&&t===n-1&&t===i+1?"":e.slice(t,n)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('Parameter "pathObject" must be an object, not '+typeof e);return pv("/",e)},parse:function(e){Xt(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var i=e.charCodeAt(0),n=i===47,s;n?(t.root="/",s=1):s=0;for(var a=-1,o=0,l=-1,u=!0,f=e.length-1,d=0;f>=s;--f){if(i=e.charCodeAt(f),i===47){if(!u){o=f+1;break}continue}l===-1&&(u=!1,l=f+1),i===46?a===-1?a=f:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===o+1?l!==-1&&(o===0&&n?t.base=t.name=e.slice(1,l):t.base=t.name=e.slice(o,l)):(o===0&&n?(t.name=e.slice(1,a),t.base=e.slice(1,l)):(t.name=e.slice(o,a),t.base=e.slice(o,l)),t.ext=e.slice(a,l)),o>0?t.dir=e.slice(0,o-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",posix:null};wh.exports=wn});var oi=$(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.default=void 0;var En=vv(Ar());function vv(r){return r&&r.__esModule?r:{default:r}}var Eh=class{constructor(e){var t,i;t=e.indexOf("://"),t>-1&&(e=new URL(e).pathname),i=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=i.dir+"/",this.filename=i.base,this.extension=i.ext.slice(1)}parse(e){return En.default.parse(e)}isAbsolute(e){return En.default.isAbsolute(e||this.path)}isDirectory(e){return e.charAt(e.length-1)==="/"}resolve(e){return En.default.resolve(this.directory,e)}relative(e){var t=e&&e.indexOf("://")>-1;return t?e:En.default.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}},gv=Eh;xn.default=gv});var Ir=$(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.default=void 0;var xh=Th(oi()),Sh=Th(Ar());function Th(r){return r&&r.__esModule?r:{default:r}}var kh=class{constructor(e,t){var i=e.indexOf("://")>-1,n=e,s;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=t,!i&&t!==!1&&typeof t!="string"&&window&&window.location&&(this.base=window.location.href),i||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,n=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(a){this.Url=void 0,this.base&&(s=new xh.default(this.base),n=s.resolve(n))}this.Path=new xh.default(n),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t=e.indexOf("://")>-1,i;return t?e:(i=Sh.default.resolve(this.directory,e),this.origin+i)}relative(e){return Sh.default.relative(e,this.directory)}toString(){return this.href}},mv=kh;Sn.default=mv});var _t=$(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.default=void 0;var li=Ie(),Zi=1,Ot=3,_v=9,ui=class{constructor(e,t,i){var n;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof ui))return new ui(e,t,i);if(typeof t=="string"?this.base=this.parseComponent(t):typeof t=="object"&&t.steps&&(this.base=t),n=this.checkType(e),n==="string")return this.str=e,(0,li.extend)(this,this.parse(e));if(n==="range")return(0,li.extend)(this,this.fromRange(e,this.base,i));if(n==="node")return(0,li.extend)(this,this.fromNode(e,this.base,i));if(n==="EpubCFI"&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}checkType(e){return this.isCfiString(e)?"string":e&&typeof e=="object"&&((0,li.type)(e)==="Range"||typeof e.startContainer!="undefined")?"range":e&&typeof e=="object"&&typeof e.nodeType!="undefined"?"node":e&&typeof e=="object"&&e instanceof ui?"EpubCFI":!1}parse(e){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},i,n,s;return typeof e!="string"?{spinePos:-1}:(e.indexOf("epubcfi(")===0&&e[e.length-1]===")"&&(e=e.slice(8,e.length-1)),i=this.getChapterComponent(e),i?(t.base=this.parseComponent(i),n=this.getPathComponent(e),t.path=this.parseComponent(n),s=this.getRange(e),s&&(t.range=!0,t.start=this.parseComponent(s[0]),t.end=this.parseComponent(s[1])),t.spinePos=t.base.steps[1].index,t):{spinePos:-1})}parseComponent(e){var t={steps:[],terminal:{offset:null,assertion:null}},i=e.split(":"),n=i[0].split("/"),s;return i.length>1&&(s=i[1],t.terminal=this.parseTerminal(s)),n[0]===""&&n.shift(),t.steps=n.map(function(a){return this.parseStep(a)}.bind(this)),t}parseStep(e){var t,i,n,s,a;if(s=e.match(/\[(.*)\]/),s&&s[1]&&(a=s[1]),i=parseInt(e),!isNaN(i))return i%2==0?(t="element",n=i/2-1):(t="text",n=(i-1)/2),{type:t,index:n,id:a||null}}parseTerminal(e){var t,i,n=e.match(/\[(.*)\]/);return n&&n[1]?(t=parseInt(e.split("[")[0]),i=n[1]):t=parseInt(e),(0,li.isNumber)(t)||(t=null),{offset:t,assertion:i}}getChapterComponent(e){var t=e.split("!");return t[0]}getPathComponent(e){var t=e.split("!");if(t[1])return t[1].split(",")[0]}getRange(e){var t=e.split(",");return t.length===3?[t[1],t[2]]:!1}getCharecterOffsetComponent(e){var t=e.split(":");return t[1]||""}joinSteps(e){return e?e.map(function(t){var i="";return t.type==="element"&&(i+=(t.index+1)*2),t.type==="text"&&(i+=1+2*t.index),t.id&&(i+="["+t.id+"]"),i}).join("/"):""}segmentString(e){var t="/";return t+=this.joinSteps(e.steps),e.terminal&&e.terminal.offset!=null&&(t+=":"+e.terminal.offset),e.terminal&&e.terminal.assertion!=null&&(t+="["+e.terminal.assertion+"]"),t}toString(){var e="epubcfi(";return e+=this.segmentString(this.base),e+="!",e+=this.segmentString(this.path),this.range&&this.start&&(e+=",",e+=this.segmentString(this.start)),this.range&&this.end&&(e+=",",e+=this.segmentString(this.end)),e+=")",e}compare(e,t){var i,n,s,a,o,l,u,u,f,d,c,v;if(typeof e=="string"&&(e=new ui(e)),typeof t=="string"&&(t=new ui(t)),e.spinePos>t.spinePos)return 1;if(e.spinePos<t.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),s=e.start.terminal):(i=e.path.steps,s=e.path.terminal),t.range?(n=t.path.steps.concat(t.start.steps),a=t.start.terminal):(n=t.path.steps,a=t.path.terminal);for(var g=0;g<i.length;g++){if(!i[g])return-1;if(!n[g]||i[g].index>n[g].index)return 1;if(i[g].index<n[g].index)return-1}return i.length<n.length?-1:s.offset>a.offset?1:s.offset<a.offset?-1:0}step(e){var t=e.nodeType===Ot?"text":"element";return{id:e.id,tagName:e.tagName,type:t,index:this.position(e)}}filteredStep(e,t){var i=this.filter(e,t),n;if(!!i)return n=i.nodeType===Ot?"text":"element",{id:i.id,tagName:i.tagName,type:n,index:this.filteredPosition(i,t)}}pathTo(e,t,i){for(var n={steps:[],terminal:{offset:null,assertion:null}},s=e,a;s&&s.parentNode&&s.parentNode.nodeType!=_v;)i?a=this.filteredStep(s,i):a=this.step(s),a&&n.steps.unshift(a),s=s.parentNode;return t!=null&&t>=0&&(n.terminal.offset=t,n.steps[n.steps.length-1].type!="text"&&n.steps.push({type:"text",index:0})),n}equalStep(e,t){return!e||!t?!1:e.index===t.index&&e.id===t.id&&e.type===t.type}fromRange(e,t,i){var n={range:!1,base:{},path:{},start:null,end:null},s=e.startContainer,a=e.endContainer,o=e.startOffset,l=e.endOffset,u=!1;if(i&&(u=s.ownerDocument.querySelector("."+i)!=null),typeof t=="string"?(n.base=this.parseComponent(t),n.spinePos=n.base.steps[1].index):typeof t=="object"&&(n.base=t),e.collapsed)u&&(o=this.patchOffset(s,o,i)),n.path=this.pathTo(s,o,i);else{n.range=!0,u&&(o=this.patchOffset(s,o,i)),n.start=this.pathTo(s,o,i),u&&(l=this.patchOffset(a,l,i)),n.end=this.pathTo(a,l,i),n.path={steps:[],terminal:null};var f=n.start.steps.length,d;for(d=0;d<f&&this.equalStep(n.start.steps[d],n.end.steps[d]);d++)d===f-1?n.start.terminal===n.end.terminal&&(n.path.steps.push(n.start.steps[d]),n.range=!1):n.path.steps.push(n.start.steps[d]);n.start.steps=n.start.steps.slice(n.path.steps.length),n.end.steps=n.end.steps.slice(n.path.steps.length)}return n}fromNode(e,t,i){var n={range:!1,base:{},path:{},start:null,end:null};return typeof t=="string"?(n.base=this.parseComponent(t),n.spinePos=n.base.steps[1].index):typeof t=="object"&&(n.base=t),n.path=this.pathTo(e,null,i),n}filter(e,t){var i,n,s,a,o,l=!1;return e.nodeType===Ot?(l=!0,s=e.parentNode,i=e.parentNode.classList.contains(t)):(l=!1,i=e.classList.contains(t)),i&&l?(a=s.previousSibling,o=s.nextSibling,a&&a.nodeType===Ot?n=a:o&&o.nodeType===Ot&&(n=o),n||e):i&&!l?!1:e}patchOffset(e,t,i){if(e.nodeType!=Ot)throw new Error("Anchor must be a text node");var n=e,s=t;for(e.parentNode.classList.contains(i)&&(n=e.parentNode);n.previousSibling;){if(n.previousSibling.nodeType===Zi)if(n.previousSibling.classList.contains(i))s+=n.previousSibling.textContent.length;else break;else s+=n.previousSibling.textContent.length;n=n.previousSibling}return s}normalizedMap(e,t,i){var n={},s=-1,a,o=e.length,l,u;for(a=0;a<o;a++)l=e[a].nodeType,l===Zi&&e[a].classList.contains(i)&&(l=Ot),a>0&&l===Ot&&u===Ot?n[a]=s:t===l&&(s=s+1,n[a]=s),u=l;return n}position(e){var t,i;return e.nodeType===Zi?(t=e.parentNode.children,t||(t=(0,li.findChildren)(e.parentNode)),i=Array.prototype.indexOf.call(t,e)):(t=this.textNodes(e.parentNode),i=t.indexOf(e)),i}filteredPosition(e,t){var i,n,s;return e.nodeType===Zi?(i=e.parentNode.children,s=this.normalizedMap(i,Zi,t)):(i=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(e=e.parentNode,i=e.parentNode.childNodes),s=this.normalizedMap(i,Ot,t)),n=Array.prototype.indexOf.call(i,e),s[n]}stepsToXpath(e){var t=[".","*"];return e.forEach(function(i){var n=i.index+1;i.id?t.push("*[position()="+n+" and @id='"+i.id+"']"):i.type==="text"?t.push("text()["+n+"]"):t.push("*["+n+"]")}),t.join("/")}stepsToQuerySelector(e){var t=["html"];return e.forEach(function(i){var n=i.index+1;i.id?t.push("#"+i.id):i.type==="text"||t.push("*:nth-child("+n+")")}),t.join(">")}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(i){return i.nodeType===Ot?!0:!!(t&&i.classList.contains(t))})}walkToNode(e,t,i){var n=t||document,s=n.documentElement,a,o,l=e.length,u;for(u=0;u<l&&(o=e[u],o.type==="element"?o.id?s=n.getElementById(o.id):(a=s.children||(0,li.findChildren)(s),s=a[o.index]):o.type==="text"&&(s=this.textNodes(s,i)[o.index]),!!s);u++);return s}findNode(e,t,i){var n=t||document,s,a;return!i&&typeof n.evaluate!="undefined"?(a=this.stepsToXpath(e),s=n.evaluate(a,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue):i?s=this.walkToNode(e,n,i):s=this.walkToNode(e,n),s}fixMiss(e,t,i,n){var s=this.findNode(e.slice(0,-1),i,n),a=s.childNodes,o=this.normalizedMap(a,Ot,n),l,u,f=e[e.length-1].index;for(let d in o){if(!o.hasOwnProperty(d))return;if(o[d]===f)if(l=a[d],u=l.textContent.length,t>u)t=t-u;else{l.nodeType===Zi?s=l.childNodes[0]:s=l;break}}return{container:s,offset:t}}toRange(e,t){var i=e||document,n,s,a,o,l,u=this,f,d,c=t?i.querySelector("."+t)!=null:!1,v;if(typeof i.createRange!="undefined"?n=i.createRange():n=new li.RangeObject,u.range?(s=u.start,f=u.path.steps.concat(s.steps),o=this.findNode(f,i,c?t:null),a=u.end,d=u.path.steps.concat(a.steps),l=this.findNode(d,i,c?t:null)):(s=u.path,f=u.path.steps,o=this.findNode(u.path.steps,i,c?t:null)),o)try{s.terminal.offset!=null?n.setStart(o,s.terminal.offset):n.setStart(o,0)}catch(g){v=this.fixMiss(f,s.terminal.offset,i,c?t:null),n.setStart(v.container,v.offset)}else return console.log("No startContainer found for",this.toString()),null;if(l)try{a.terminal.offset!=null?n.setEnd(l,a.terminal.offset):n.setEnd(l,0)}catch(g){v=this.fixMiss(d,u.end.terminal.offset,i,c?t:null),n.setEnd(v.container,v.offset)}return n}isCfiString(e){return typeof e=="string"&&e.indexOf("epubcfi(")===0&&e[e.length-1]===")"}generateChapterComponent(e,t,i){var n=parseInt(t),s=(e+1)*2,a="/"+s+"/";return a+=(n+1)*2,i&&(a+="["+i+"]"),a}collapse(e){!this.range||(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}},yv=ui;Tn.default=yv});var On=$(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.default=void 0;var Oh=class{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if(typeof arguments[e]=="function")this.hooks.push(arguments[e]);else for(var t=0;t<arguments[e].length;++t)this.hooks.push(arguments[e][t])}deregister(e){let t;for(let i=0;i<this.hooks.length;i++)if(t=this.hooks[i],t===e){this.hooks.splice(i,1);break}}trigger(){var e=arguments,t=this.context,i=[];return this.hooks.forEach(function(n){try{var s=n.apply(t,e)}catch(a){console.log(a)}s&&typeof s.then=="function"&&i.push(s)}),Promise.all(i)}list(){return this.hooks}clear(){return this.hooks=[]}},bv=Oh;kn.default=bv});var Dr=$(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.replaceBase=Ev;mi.replaceCanonical=xv;mi.replaceLinks=Tv;mi.replaceMeta=Sv;mi.substitute=kv;var gi=Ie(),wv=Ch(Ir()),z0=Ch(oi());function Ch(r){return r&&r.__esModule?r:{default:r}}function Ev(r,e){var t,i,n=e.url,s=n.indexOf("://")>-1;!r||(i=(0,gi.qs)(r,"head"),t=(0,gi.qs)(i,"base"),t||(t=r.createElement("base"),i.insertBefore(t,i.firstChild)),!s&&window&&window.location&&(n=window.location.origin+n),t.setAttribute("href",n))}function xv(r,e){var t,i,n=e.canonical;!r||(t=(0,gi.qs)(r,"head"),i=(0,gi.qs)(t,"link[rel='canonical']"),i?i.setAttribute("href",n):(i=r.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",n),t.appendChild(i)))}function Sv(r,e){var t,i,n=e.idref;!r||(t=(0,gi.qs)(r,"head"),i=(0,gi.qs)(t,"link[property='dc.identifier']"),i?i.setAttribute("content",n):(i=r.createElement("meta"),i.setAttribute("name","dc.identifier"),i.setAttribute("content",n),t.appendChild(i)))}function Tv(r,e){var t=r.querySelectorAll("a[href]");if(!!t.length)for(var i=(0,gi.qs)(r.ownerDocument,"base"),n=i?i.getAttribute("href"):void 0,s=function(o){var l=o.getAttribute("href");if(l.indexOf("mailto:")!==0){var u=l.indexOf("://")>-1;if(u)o.setAttribute("target","_blank");else{var f;try{f=new wv.default(l,n)}catch(d){}o.onclick=function(){return f&&f.hash?e(f.Path.path+f.hash):e(f?f.Path.path:l),!1}}}}.bind(this),a=0;a<t.length;a++)s(t[a])}function kv(r,e,t){return e.forEach(function(i,n){i&&t[n]&&(i=i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),r=r.replace(new RegExp(i,"g"),t[n]))}),r}});var Pr=$(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.default=void 0;var Xi=Ie(),Ov=Cv(oi());function Cv(r){return r&&r.__esModule?r:{default:r}}function Nv(r,e,t,i){var n=typeof window!="undefined"?window.URL:!1,s=n?"blob":"arraybuffer",a=new Xi.defer,o=new XMLHttpRequest,l=XMLHttpRequest.prototype,u;"overrideMimeType"in l||Object.defineProperty(l,"overrideMimeType",{value:function(){}}),t&&(o.withCredentials=!0),o.onreadystatechange=d,o.onerror=f,o.open("GET",r,!0);for(u in i)o.setRequestHeader(u,i[u]);e=="json"&&o.setRequestHeader("Accept","application/json"),e||(e=new Ov.default(r).extension),e=="blob"&&(o.responseType=s),(0,Xi.isXml)(e)&&o.overrideMimeType("text/xml"),e=="xhtml",e=="html"||e=="htm",e=="binary"&&(o.responseType="arraybuffer"),o.send();function f(c){a.reject(c)}function d(){if(this.readyState===XMLHttpRequest.DONE){var c=!1;if((this.responseType===""||this.responseType==="document")&&(c=this.responseXML),this.status===200||this.status===0||c){var v;if(!this.response&&!c)return a.reject({status:this.status,message:"Empty Response",stack:new Error().stack}),a.promise;if(this.status===403)return a.reject({status:this.status,response:this.response,message:"Forbidden",stack:new Error().stack}),a.promise;c?v=this.responseXML:(0,Xi.isXml)(e)?v=(0,Xi.parse)(this.response,"text/xml"):e=="xhtml"?v=(0,Xi.parse)(this.response,"application/xhtml+xml"):e=="html"||e=="htm"?v=(0,Xi.parse)(this.response,"text/html"):e=="json"?v=JSON.parse(this.response):e=="blob"?n?v=this.response:v=new Blob([this.response]):v=this.response,a.resolve(v)}else a.reject({status:this.status,message:this.response,stack:new Error().stack})}}return a.promise}var Rv=Nv;Cn.default=Rv});var Ih=$(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.default=void 0;var Ta=Ie(),Nh=ka(_t()),Rh=ka(On()),Av=Dr(),Iv=ka(Pr()),Dv=ya();function ka(r){return r&&r.__esModule?r:{default:r}}var Ah=class{constructor(e,t){this.idref=e.idref,this.linear=e.linear==="yes",this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,t?this.hooks=t:(this.hooks={},this.hooks.serialize=new Rh.default(this),this.hooks.content=new Rh.default(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var t=e||this.request||Iv.default,i=new Ta.defer,n=i.promise;return this.contents?i.resolve(this.contents):t(this.url).then(function(s){return this.document=s,this.contents=s.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){i.resolve(this.contents)}.bind(this)).catch(function(s){i.reject(s)}),n}base(){return(0,Av.replaceBase)(this.document,this)}render(e){var t=new Ta.defer,i=t.promise;return this.output,this.load(e).then(function(n){var s=typeof navigator!="undefined"&&navigator.userAgent||"",a=s.indexOf("Trident")>=0,o;typeof XMLSerializer=="undefined"||a?o=Dv.DOMParser:o=XMLSerializer;var l=new o;return this.output=l.serializeToString(n),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){t.resolve(this.output)}.bind(this)).catch(function(n){t.reject(n)}),i}find(e){var t=this,i=[],n=e.toLowerCase(),s=function(a){for(var o=a.textContent.toLowerCase(),l=t.document.createRange(),u,f,d=-1,c,v=150;f!=-1;)f=o.indexOf(n,d+1),f!=-1&&(l=t.document.createRange(),l.setStart(a,f),l.setEnd(a,f+n.length),u=t.cfiFromRange(l),a.textContent.length<v?c=a.textContent:(c=a.textContent.substring(f-v/2,f+v/2),c="..."+c+"..."),i.push({cfi:u,excerpt:c})),d=f};return(0,Ta.sprint)(t.document,function(a){s(a)}),i}search(e,t=5){if(typeof document.createTreeWalker=="undefined")return this.find(e);let i=[],n=150,s=this,a=e.toLowerCase(),o=function(d){let g=d.reduce((O,k)=>O+k.textContent,"").toLowerCase().indexOf(a);if(g!=-1){let O=0,k=g+a.length,_=0,p=0;if(g<d[O].length){let y;for(;_<d.length-1&&(p+=d[_].length,!(k<=p));)_+=1;let T=d[O],P=d[_],w=s.document.createRange();w.setStart(T,g);let N=d.slice(0,_).reduce((M,j)=>M+j.textContent.length,0);w.setEnd(P,N>k?k:k-N),y=s.cfiFromRange(w);let C=d.slice(0,_+1).reduce((M,j)=>M+j.textContent,"");C.length>n&&(C=C.substring(g-n/2,g+n/2),C="..."+C+"..."),i.push({cfi:y,excerpt:C})}}},l=document.createTreeWalker(s.document,NodeFilter.SHOW_TEXT,null,!1),u,f=[];for(;u=l.nextNode();)f.push(u),f.length==t&&(o(f.slice(0,t)),f=f.slice(1,t));return f.length>0&&o(f),i}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(i){var n=i.replace("rendition:",""),s=n.indexOf("-"),a,o;s!=-1&&(a=n.slice(0,s),o=n.slice(s+1),t[a]=o)}),t}cfiFromRange(e){return new Nh.default(e,this.cfiBase).toString()}cfiFromElement(e){return new Nh.default(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}},Pv=Ah;Nn.default=Pv});var zh=$(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.default=void 0;var Dh=Ca(_t()),Ph=Ca(On()),Lv=Ca(Ih()),Oa=Dr();function Ca(r){return r&&r.__esModule?r:{default:r}}var Lh=class{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new Ph.default,this.hooks.content=new Ph.default,this.hooks.content.register(Oa.replaceBase),this.hooks.content.register(Oa.replaceCanonical),this.hooks.content.register(Oa.replaceMeta),this.epubcfi=new Dh.default,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,i){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((n,s)=>{var a=this.manifest[n.idref],o;n.index=s,n.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,n.index,n.id),n.href&&(n.url=t(n.href,!0),n.canonical=i(n.href)),a&&(n.href=a.href,n.url=t(n.href,!0),n.canonical=i(n.href),a.properties.length&&n.properties.push.apply(n.properties,a.properties)),n.linear==="yes"?(n.prev=function(){let l=n.index;for(;l>0;){let u=this.get(l-1);if(u&&u.linear)return u;l-=1}}.bind(this),n.next=function(){let l=n.index;for(;l<this.spineItems.length-1;){let u=this.get(l+1);if(u&&u.linear)return u;l+=1}}.bind(this)):(n.prev=function(){},n.next=function(){}),o=new Lv.default(n,this.hooks),this.append(o)}),this.loaded=!0}get(e){var t=0;if(typeof e=="undefined")for(;t<this.spineItems.length;){let i=this.spineItems[t];if(i&&i.linear)break;t+=1}else this.epubcfi.isCfiString(e)?t=new Dh.default(e).spinePos:typeof e=="number"||isNaN(e)===!1?t=e:typeof e=="string"&&e.indexOf("#")===0?t=this.spineById[e.substring(1)]:typeof e=="string"&&(e=e.split("#")[0],t=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[t]||null}append(e){var t=this.spineItems.length;return e.index=t,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=t,this.spineByHref[encodeURI(e.href)]=t,this.spineByHref[e.href]=t,this.spineById[e.idref]=t,t}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(t,i){t.index=i}),0}remove(e){var t=this.spineItems.indexOf(e);if(t>-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let t=this.get(e);if(t&&t.linear)return t;e-=1}while(e>=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}},zv=Lh;Rn.default=zv});var In=$(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.default=Yi.Task=void 0;var An=Ie(),Mh=class{constructor(e){this._q=[],this.context=e,this.tick=An.requestAnimationFrame,this.running=!1,this.paused=!1}enqueue(){var e,t,i,n=[].shift.call(arguments),s=arguments;if(!n)throw new Error("No Task Provided");return typeof n=="function"?(e=new An.defer,t=e.promise,i={task:n,args:s,deferred:e,promise:t}):i={promise:n},this._q.push(i),this.paused==!1&&!this.running&&this.run(),i.promise}dequeue(){var e,t,i;if(this._q.length&&!this.paused){if(e=this._q.shift(),t=e.task,t)return i=t.apply(this.context,e.args),i&&typeof i.then=="function"?i.then(function(){e.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){e.deferred.reject.apply(this.context,arguments)}.bind(this)):(e.deferred.resolve.apply(this.context,i),e.promise);if(e.promise)return e.promise}else return e=new An.defer,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new An.defer),this.tick.call(window,()=>{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),this.paused==!0&&(this.paused=!1),this.defered.promise}flush(){if(this.running)return this.running;if(this._q.length)return this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}},Bh=class{constructor(e,t,i){return function(){var n=arguments||[];return new Promise((s,a)=>{var o=function(l,u){!l&&u?a(u):s(l)};n.push(o),e.apply(i||this,n)})}}};Yi.Task=Bh;var Mv=Mh;Yi.default=Mv});var Ct=$(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.EVENTS=hi.EPUBJS_VERSION=hi.DOM_EVENTS=void 0;var Bv="0.3";hi.EPUBJS_VERSION=Bv;var Uv=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"];hi.DOM_EVENTS=Uv;var Fv={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}};hi.EVENTS=Fv});var Uh=$(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.default=void 0;var _i=Ie(),qv=Na(In()),fi=Na(_t()),Wv=Ct(),jv=Na(Ft());function Na(r){return r&&r.__esModule?r:{default:r}}var Ra=class{constructor(e,t,i){this.spine=e,this.request=t,this.pause=i||100,this.q=new qv.default(this),this.epubcfi=new fi.default,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each(function(t){t.linear&&this.q.enqueue(this.process.bind(this),t)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then(function(t){var i=new _i.defer,n=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(n),e.unload(),this.processingTimeout=setTimeout(()=>i.resolve(n),this.pause),i.promise}.bind(this))}parse(e,t,i){var n=[],s,a=e.ownerDocument,o=(0,_i.qs)(a,"body"),l=0,u,f=i||this.break,d=function(c){var v=c.length,g,O=0;if(c.textContent.trim().length===0)return!1;for(l==0&&(s=this.createRange(),s.startContainer=c,s.startOffset=0),g=f-l,g>v&&(l+=v,O=v);O<v;)if(g=f-l,l===0&&(O+=1,s=this.createRange(),s.startContainer=c,s.startOffset=O),O+g>=v)l+=v-O,O=v;else{O+=g,s.endContainer=c,s.endOffset=O;let k=new fi.default(s,t).toString();n.push(k),l=0}u=c};if((0,_i.sprint)(o,d.bind(this)),s&&s.startContainer&&u){s.endContainer=u,s.endOffset=u.length;let c=new fi.default(s,t).toString();n.push(c),l=0}return n}generateFromWords(e,t,i){var n=e?new fi.default(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(s){s.linear&&(n?s.index>=n.spinePos&&this.q.enqueue(this.processWords.bind(this),s,t,n,i):this.q.enqueue(this.processWords.bind(this),s,t,n,i))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(e,t,i,n){return n&&this._locationsWords.length>=n?Promise.resolve():e.load(this.request).then(function(s){var a=new _i.defer,o=this.parseWords(s,e,t,i),l=n-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(o.length>=n?o.slice(0,l):o),e.unload(),this.processingTimeout=setTimeout(()=>a.resolve(o),this.pause),a.promise}.bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,`
`),e.split(" ").length}parseWords(e,t,i,n){var s=t.cfiBase,a=[],o=e.ownerDocument,l=(0,_i.qs)(o,"body"),u,f=i,d=n?n.spinePos!==t.index:!0,c;n&&t.index===n.spinePos&&(c=n.findNode(n.range?n.path.steps.concat(n.start.steps):n.path.steps,e.ownerDocument));var v=function(g){if(!d)if(g===c)d=!0;else return!1;if(g.textContent.length<10&&g.textContent.trim().length===0)return!1;var O=this.countWords(g.textContent),k,_=0;if(O===0)return!1;for(k=f-this._wordCounter,k>O&&(this._wordCounter+=O,_=O);_<O;)if(k=f-this._wordCounter,_+k>=O)this._wordCounter+=O-_,_=O;else{_+=k;let p=new fi.default(g,s);a.push({cfi:p.toString(),wordCount:this._wordCounter}),this._wordCounter=0}u=g};return(0,_i.sprint)(l,v.bind(this)),a}locationFromCfi(e){let t;return fi.default.prototype.isCfiString(e)&&(e=new fi.default(e)),this._locations.length===0?-1:(t=(0,_i.locationOf)(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(this._locations.length===0)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var t=-1;return typeof e!="number"&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(e>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let i=new fi.default(this._locations[this.total]);return i.collapse(),i.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return typeof e=="string"?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if(typeof e=="string")this._currentCfi=e;else if(typeof e=="number")this._current=e;else return;this._locations.length!==0&&(typeof e=="string"?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(Wv.EVENTS.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}};(0,jv.default)(Ra.prototype);var Vv=Ra;Dn.default=Vv});var qh=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.default=void 0;var Hv=Xv(Ar()),Zv=Ie();function Xv(r){return r&&r.__esModule?r:{default:r}}var Fh=class{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(t=(0,Zv.qs)(e,"rootfile"),!t)throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=Hv.default.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}},Yv=Fh;Pn.default=Yv});var jh=$(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.default=void 0;var Nt=Ie(),Wh=class{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,i,n;if(!e)throw new Error("Package File Not Found");if(t=(0,Nt.qs)(e,"metadata"),!t)throw new Error("No Metadata Found");if(i=(0,Nt.qs)(e,"manifest"),!i)throw new Error("No Manifest Found");if(n=(0,Nt.qs)(e,"spine"),!n)throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,n),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=(0,Nt.indexOfElementNode)(n),this.spine=this.parseSpine(n,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=n.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={};return t.title=this.getElementText(e,"title"),t.creator=this.getElementText(e,"creator"),t.description=this.getElementText(e,"description"),t.pubdate=this.getElementText(e,"date"),t.publisher=this.getElementText(e,"publisher"),t.identifier=this.getElementText(e,"identifier"),t.language=this.getElementText(e,"language"),t.rights=this.getElementText(e,"rights"),t.modified_date=this.getPropertyText(e,"dcterms:modified"),t.layout=this.getPropertyText(e,"rendition:layout"),t.orientation=this.getPropertyText(e,"rendition:orientation"),t.flow=this.getPropertyText(e,"rendition:flow"),t.viewport=this.getPropertyText(e,"rendition:viewport"),t.media_active_class=this.getPropertyText(e,"media:active-class"),t.spread=this.getPropertyText(e,"rendition:spread"),t}parseManifest(e){var t={},i=(0,Nt.qsa)(e,"item"),n=Array.prototype.slice.call(i);return n.forEach(function(s){var a=s.getAttribute("id"),o=s.getAttribute("href")||"",l=s.getAttribute("media-type")||"",u=s.getAttribute("media-overlay")||"",f=s.getAttribute("properties")||"";t[a]={href:o,type:l,overlay:u,properties:f.length?f.split(" "):[]}}),t}parseSpine(e,t){var i=[],n=(0,Nt.qsa)(e,"itemref"),s=Array.prototype.slice.call(n);return s.forEach(function(a,o){var l=a.getAttribute("idref"),u=a.getAttribute("properties")||"",f=u.length?u.split(" "):[],d={id:a.getAttribute("id"),idref:l,linear:a.getAttribute("linear")||"yes",properties:f,index:o};i.push(d)}),i}findUniqueIdentifier(e){var t=e.documentElement.getAttribute("unique-identifier");if(!t)return"";var i=e.getElementById(t);return i&&i.localName==="identifier"&&i.namespaceURI==="http://purl.org/dc/elements/1.1/"&&i.childNodes.length>0?i.childNodes[0].nodeValue.trim():""}findNavPath(e){var t=(0,Nt.qsp)(e,"item",{properties:"nav"});return t?t.getAttribute("href"):!1}findNcxPath(e,t){var i=(0,Nt.qsp)(e,"item",{"media-type":"application/x-dtbncx+xml"}),n;return i||(n=t.getAttribute("toc"),n&&(i=e.querySelector(`#${n}`))),i?i.getAttribute("href"):!1}findCoverPath(e){var t=(0,Nt.qs)(e,"package"),i=t.getAttribute("version"),n=(0,Nt.qsp)(e,"item",{properties:"cover-image"});if(n)return n.getAttribute("href");var s=(0,Nt.qsp)(e,"meta",{name:"cover"});if(s){var a=s.getAttribute("content"),o=e.getElementById(a);return o?o.getAttribute("href"):""}else return!1}getElementText(e,t){var i=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",t),n;return!i||i.length===0?"":(n=i[0],n.childNodes.length?n.childNodes[0].nodeValue:"")}getPropertyText(e,t){var i=(0,Nt.qsp)(e,"meta",{property:t});return i&&i.childNodes.length?i.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((i,n)=>(i.index=n,i.linear=i.linear||"yes",i)),e.resources.forEach((i,n)=>{this.manifest[n]=i,i.rel&&i.rel[0]==="cover"&&(this.coverPath=i.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((i,n)=>(i.label=i.title,i)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}},Gv=Wh;Ln.default=Gv});var Hh=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=void 0;var yt=Ie(),Vh=class{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t=e.nodeType,i,n;t&&(i=(0,yt.qs)(e,"html"),n=(0,yt.qs)(e,"ncx")),t?i?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):n&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t,i=0;i<e.length;i++)t=e[i],t.href&&(this.tocByHref[t.href]=i),t.id&&(this.tocById[t.id]=i),this.length++,t.subitems.length&&this.unpack(t.subitems)}get(e){var t;return e?(e.indexOf("#")===0?t=this.tocById[e.substring(1)]:e in this.tocByHref&&(t=this.tocByHref[e]),this.getByIndex(e,t,this.toc)):this.toc}getByIndex(e,t,i){if(i.length===0)return;let n=i[t];if(n&&(e===n.id||e===n.href))return n;{let s;for(let a=0;a<i.length&&(s=this.getByIndex(e,t,i[a].subitems),!s);++a);return s}}landmark(e){var t;return e?(t=this.landmarksByType[e],this.landmarks[t]):this.landmarks}parseNav(e){var t=(0,yt.querySelectorByType)(e,"nav","toc"),i=[];if(!t)return i;let n=(0,yt.filterChildren)(t,"ol",!0);return n&&(i=this.parseNavList(n)),i}parseNavList(e,t){let i=[];if(!e||!e.children)return i;for(let n=0;n<e.children.length;n++){let s=this.navItem(e.children[n],t);s&&i.push(s)}return i}navItem(e,t){let i=e.getAttribute("id")||void 0,n=(0,yt.filterChildren)(e,"a",!0)||(0,yt.filterChildren)(e,"span",!0);if(!n)return;let s=n.getAttribute("href")||"";i||(i=s);let a=n.textContent||"",o=[],l=(0,yt.filterChildren)(e,"ol",!0);return l&&(o=this.parseNavList(l,i)),{id:i,href:s,label:a,subitems:o,parent:t}}parseLandmarks(e){var t=(0,yt.querySelectorByType)(e,"nav","landmarks"),i=t?(0,yt.qsa)(t,"li"):[],n=i.length,s,a=[],o;if(!i||n===0)return a;for(s=0;s<n;++s)o=this.landmarkItem(i[s]),o&&(a.push(o),this.landmarksByType[o.type]=s);return a}landmarkItem(e){let t=(0,yt.filterChildren)(e,"a",!0);if(!t)return;let i=t.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0,n=t.getAttribute("href")||"",s=t.textContent||"";return{href:n,label:s,type:i}}parseNcx(e){var t=(0,yt.qsa)(e,"navPoint"),i=t.length,n,s={},a=[],o,l;if(!t||i===0)return a;for(n=0;n<i;++n)o=this.ncxItem(t[n]),s[o.id]=o,o.parent?(l=s[o.parent],l.subitems.push(o)):a.push(o);return a}ncxItem(e){var t=e.getAttribute("id")||!1,i=(0,yt.qs)(e,"content"),n=i.getAttribute("src"),s=(0,yt.qs)(e,"navLabel"),a=s.textContent?s.textContent:"",o=[],l=e.parentNode,u;return l&&(l.nodeName==="navPoint"||l.nodeName.split(":").slice(-1)[0]==="navPoint")&&(u=l.getAttribute("id")),{id:t,href:n,label:a,subitems:o,parent:u}}load(e){return e.map(t=>(t.label=t.title,t.subitems=t.children?this.load(t.children):[],t))}forEach(e){return this.toc.forEach(e)}},$v=Vh;zn.default=$v});var Bn=$(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.default=void 0;var Lr={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},Kv=function(){var r,e,t,i,n={};for(r in Lr)if(Lr.hasOwnProperty(r)){for(e in Lr[r])if(Lr[r].hasOwnProperty(e))if(t=Lr[r][e],typeof t=="string")n[t]=r+"/"+e;else for(i=0;i<t.length;i++)n[t[i]]=r+"/"+e}return n}(),Jv="text/plain";function Qv(r){return r&&Kv[r.split(".").pop().toLowerCase()]||Jv}var eg={lookup:Qv};Mn.default=eg});var Gh=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.default=void 0;var Zh=Dr(),zr=Ie(),tg=Un(Ir()),ig=Un(Bn()),Xh=Un(oi()),rg=Un(Ar());function Un(r){return r&&r.__esModule?r:{default:r}}var Yh=class{constructor(e,t){this.settings={replacements:t&&t.replacements||"base64",archive:t&&t.archive,resolver:t&&t.resolver,request:t&&t.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(t){return e[t]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if(e.type==="application/xhtml+xml"||e.type==="text/html")return!0}),this.assets=this.resources.filter(function(e){if(e.type!=="application/xhtml+xml"&&e.type!=="text/html")return!0}),this.css=this.resources.filter(function(e){if(e.type==="text/css")return!0})}splitUrls(){this.urls=this.assets.map(function(e){return e.href}.bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var t=new tg.default(e),i=ig.default.lookup(t.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:this.settings.replacements==="base64"}):this.settings.replacements==="base64"?this.settings.request(e,"blob").then(n=>(0,zr.blob2base64)(n)).then(n=>(0,zr.createBase64Url)(n,i)):this.settings.request(e,"blob").then(n=>(0,zr.createBlobUrl)(n,i))}replacements(){if(this.settings.replacements==="none")return new Promise(function(t){t(this.urls)}.bind(this));var e=this.urls.map(t=>{var i=this.settings.resolver(t);return this.createUrl(i).catch(n=>(console.error(n),null))});return Promise.all(e).then(t=>(this.replacementUrls=t.filter(i=>typeof i=="string"),t))}replaceCss(e,t){var i=[];return e=e||this.settings.archive,t=t||this.settings.resolver,this.cssUrls.forEach(function(n){var s=this.createCssFile(n,e,t).then(function(a){var o=this.urls.indexOf(n);o>-1&&(this.replacementUrls[o]=a)}.bind(this));i.push(s)}.bind(this)),Promise.all(i)}createCssFile(e){var t;if(rg.default.isAbsolute(e))return new Promise(function(a){a()});var i=this.settings.resolver(e),n;this.settings.archive?n=this.settings.archive.getText(i):n=this.settings.request(i,"text");var s=this.urls.map(a=>{var o=this.settings.resolver(a),l=new Xh.default(i).relative(o);return l});return n?n.then(a=>(a=(0,Zh.substitute)(a,s,this.replacementUrls),this.settings.replacements==="base64"?t=(0,zr.createBase64Url)(a,"text/css"):t=(0,zr.createBlobUrl)(a,"text/css"),t),a=>new Promise(function(o){o()})):new Promise(function(a){a()})}relativeTo(e,t){return t=t||this.settings.resolver,this.urls.map(function(i){var n=t(i),s=new Xh.default(e).relative(n);return s}.bind(this))}get(e){var t=this.urls.indexOf(e);if(t!==-1)return this.replacementUrls.length?new Promise(function(i,n){i(this.replacementUrls[t])}.bind(this)):this.createUrl(e)}substitute(e,t){var i;return t?i=this.relativeTo(t):i=this.urls,(0,Zh.substitute)(e,i,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}},ng=Yh;Fn.default=ng});var Kh=$(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.default=void 0;var sg=ag(_t()),Rt=Ie();function ag(r){return r&&r.__esModule?r:{default:r}}var $h=class{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new sg.default,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=(0,Rt.qs)(e,"html"),i=(0,Rt.qs)(e,"ncx");if(t)return this.parseNav(e);if(i)return this.parseNcx(e)}parseNav(e){var t=(0,Rt.querySelectorByType)(e,"nav","page-list"),i=t?(0,Rt.qsa)(t,"li"):[],n=i.length,s,a=[],o;if(!i||n===0)return a;for(s=0;s<n;++s)o=this.item(i[s]),a.push(o);return a}parseNcx(e){var t=[],i=0,n,s,a,o=0;if(s=(0,Rt.qs)(e,"pageList"),!s||(a=(0,Rt.qsa)(s,"pageTarget"),o=a.length,!a||a.length===0))return t;for(i=0;i<o;++i)n=this.ncxItem(a[i]),t.push(n);return t}ncxItem(e){var t=(0,Rt.qs)(e,"navLabel"),i=(0,Rt.qs)(t,"text"),n=i.textContent,s=(0,Rt.qs)(e,"content"),a=s.getAttribute("src"),o=parseInt(n,10);return{href:a,page:o}}item(e){var t=(0,Rt.qs)(e,"a"),i=t.getAttribute("href")||"",n=t.textContent||"",s=parseInt(n),a=i.indexOf("epubcfi"),o,l,u;return a!=-1?(o=i.split("#"),l=o[0],u=o.length>1?o[1]:!1,{cfi:u,href:i,packageUrl:l,page:s}):{href:i,page:s}}process(e){e.forEach(function(t){this.pages.push(t.page),t.cfi&&this.locations.push(t.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var t=-1;if(this.locations.length===0)return-1;var i=(0,Rt.indexOfSorted)(e,this.locations,this.epubcfi.compare);return i!=-1?t=this.pages[i]:(i=(0,Rt.locationOf)(e,this.locations,this.epubcfi.compare),t=i-1>=0?this.pages[i-1]:this.pages[0],t!==void 0||(t=-1)),t}cfiFromPage(e){var t=-1;typeof e!="number"&&(e=parseInt(e));var i=this.pages.indexOf(e);return i!=-1&&(t=this.locations[i]),t}pageFromPercentage(e){var t=Math.round(this.totalPages*e);return t}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(t*1e3)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e),i=this.percentageFromPage(t);return i}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}},og=$h;qn.default=og});var Ia=$(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.default=void 0;var lg=Ie(),ug=Ct(),hg=fg(Ft());function fg(r){return r&&r.__esModule?r:{default:r}}var Aa=class{constructor(e){this.settings=e,this.name=e.layout||"reflowable",this._spread=e.spread!=="none",this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,e.flow==="scrolled"||e.flow==="scrolled-continuous"||e.flow==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}flow(e){return typeof e!="undefined"&&(e==="scrolled"||e==="scrolled-continuous"||e==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.update({flow:this._flow})),this._flow}spread(e,t){return e&&(this._spread=e!=="none",this.update({spread:this._spread})),t>=0&&(this._minSpreadWidth=t),this._spread}calculate(e,t,i){var n=1,s=i||0,a=e,o=t,l=Math.floor(a/12),u,f,d,c;this._spread&&a>=this._minSpreadWidth?n=2:n=1,this.name==="reflowable"&&this._flow==="paginated"&&!(i>=0)&&(s=l%2==0?l:l-1),this.name==="pre-paginated"&&(s=0),n>1?(u=a/n-s,d=u+s):(u=a,d=a),this.name==="pre-paginated"&&n>1&&(a=u),f=u*n+s,c=a,this.width=a,this.height=o,this.spreadWidth=f,this.pageWidth=d,this.delta=c,this.columnWidth=u,this.gap=s,this.divisor=n,this.update({width:a,height:o,spreadWidth:f,pageWidth:d,delta:c,columnWidth:u,gap:s,divisor:n})}format(e,t,i){var n;return this.name==="pre-paginated"?n=e.fit(this.columnWidth,this.height,t):this._flow==="paginated"?n=e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&i==="horizontal"?n=e.size(null,this.height):n=e.size(this.width,null),n}count(e,t){let i,n;return this.name==="pre-paginated"?(i=1,n=1):this._flow==="paginated"?(t=t||this.delta,i=Math.ceil(e/t),n=i*this.divisor):(t=t||this.height,i=Math.ceil(e/t),n=i),{spreads:i,pages:n}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),Object.keys(e).length>0){let t=(0,lg.extend)(this.props,e);this.emit(ug.EVENTS.LAYOUT.UPDATED,t,e)}}};(0,hg.default)(Aa.prototype);var cg=Aa;Wn.default=cg});var Qh=$(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.default=void 0;var dg=pg(Ir());function pg(r){return r&&r.__esModule?r:{default:r}}var Jh=class{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(arguments.length!==0){if(arguments.length===1&&typeof arguments[0]=="object")return this.registerThemes(arguments[0]);if(arguments.length===1&&typeof arguments[0]=="string")return this.default(arguments[0]);if(arguments.length===2&&typeof arguments[1]=="string")return this.registerUrl(arguments[0],arguments[1]);if(arguments.length===2&&typeof arguments[1]=="object")return this.registerRules(arguments[0],arguments[1])}}default(e){if(!!e){if(typeof e=="string")return this.registerUrl("default",e);if(typeof e=="object")return this.registerRules("default",e)}}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&(typeof e[t]=="string"?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||e=="default")&&this.update(e)}registerUrl(e,t){var i=new dg.default(t);this._themes[e]={url:i.toString()},(this._injected[e]||e=="default")&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||e=="default")&&this.update(e)}select(e){var t=this._current,i;this._current=e,this.update(e),i=this.rendition.getContents(),i.forEach(n=>{n.removeClass(t),n.addClass(e)})}update(e){var t=this.rendition.getContents();t.forEach(i=>{this.add(e,i)})}inject(e){var t=[],i=this._themes,n;for(var s in i)i.hasOwnProperty(s)&&(s===this._current||s==="default")&&(n=i[s],(n.rules&&Object.keys(n.rules).length>0||n.url&&t.indexOf(n.url)===-1)&&this.add(s,e),this._injected.push(s));this._current!="default"&&e.addClass(this._current)}add(e,t){var i=this._themes[e];!i||!t||(i.url?t.addStylesheet(i.url):i.serialized?(t.addStylesheetCss(i.serialized,e),i.injected=!0):i.rules&&(t.addStylesheetRules(i.rules,e),i.injected=!0))}override(e,t,i){var n=this.rendition.getContents();this._overrides[e]={value:t,priority:i===!0},n.forEach(s=>{s.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(i=>{i.css(e)})}overrides(e){var t=this._overrides;for(var i in t)t.hasOwnProperty(i)&&e.css(i,t[i].value,t[i].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}},vg=Jh;jn.default=vg});var Da=$(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.default=void 0;var Vn=gg(_t()),ef=Ie();function gg(r){return r&&r.__esModule?r:{default:r}}var tf=class{constructor(e,t,i,n=!1){this.layout=e,this.horizontal=i==="horizontal",this.direction=t||"ltr",this._dev=n}section(e){var t=this.findRanges(e),i=this.rangeListToCfiList(e.section.cfiBase,t);return i}page(e,t,i,n){var s=e&&e.document?e.document.body:!1,a;if(!!s){if(a=this.rangePairToCfiPair(t,{start:this.findStart(s,i,n),end:this.findEnd(s,i,n)}),this._dev===!0){let o=e.document,l=new Vn.default(a.start).toRange(o),u=new Vn.default(a.end).toRange(o),f=o.defaultView.getSelection(),d=o.createRange();f.removeAllRanges(),d.setStart(l.startContainer,l.startOffset),d.setEnd(u.endContainer,u.endOffset),f.addRange(d)}return a}}walk(e,t){if(!(e&&e.nodeType===Node.TEXT_NODE)){var i={acceptNode:function(l){return l.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},n=i.acceptNode;n.acceptNode=i.acceptNode;for(var s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,n,!1),a,o;(a=s.nextNode())&&(o=t(a),!o););return o}}findRanges(e){for(var t=[],i=e.contents.scrollWidth(),n=Math.ceil(i/this.layout.spreadWidth),s=n*this.layout.divisor,a=this.layout.columnWidth,o=this.layout.gap,l,u,f=0;f<s.pages;f++)l=(a+o)*f,u=a*(f+1)+o*f,t.push({start:this.findStart(e.document.body,l,u),end:this.findEnd(e.document.body,l,u)});return t}findStart(e,t,i){for(var n=[e],s,a,o=e;n.length;)if(s=n.shift(),a=this.walk(s,l=>{var u,f,d,c,v,g;if(v=(0,ef.nodeBounds)(l),this.horizontal&&this.direction==="ltr"){if(u=this.horizontal?v.left:v.top,f=this.horizontal?v.right:v.bottom,u>=t&&u<=i)return l;if(f>t)return l;o=l,n.push(l)}else if(this.horizontal&&this.direction==="rtl"){if(u=v.left,f=v.right,f<=i&&f>=t)return l;if(u<i)return l;o=l,n.push(l)}else{if(d=v.top,c=v.bottom,d>=t&&d<=i)return l;if(c>t)return l;o=l,n.push(l)}}),a)return this.findTextStartRange(a,t,i);return this.findTextStartRange(o,t,i)}findEnd(e,t,i){for(var n=[e],s,a=e,o;n.length;)if(s=n.shift(),o=this.walk(s,l=>{var u,f,d,c,v,g;if(v=(0,ef.nodeBounds)(l),this.horizontal&&this.direction==="ltr"){if(u=Math.round(v.left),f=Math.round(v.right),u>i&&a)return a;if(f>i)return l;a=l,n.push(l)}else if(this.horizontal&&this.direction==="rtl"){if(u=Math.round(this.horizontal?v.left:v.top),f=Math.round(this.horizontal?v.right:v.bottom),f<t&&a)return a;if(u<t)return l;a=l,n.push(l)}else{if(d=Math.round(v.top),c=Math.round(v.bottom),d>i&&a)return a;if(c>i)return l;a=l,n.push(l)}}),o)return this.findTextEndRange(o,t,i);return this.findTextEndRange(a,t,i)}findTextStartRange(e,t,i){for(var n=this.splitTextNodeIntoRanges(e),s,a,o,l,u,f=0;f<n.length;f++)if(s=n[f],a=s.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(o=a.left,o>=t)return s}else if(this.horizontal&&this.direction==="rtl"){if(u=a.right,u<=i)return s}else if(l=a.top,l>=t)return s;return n[0]}findTextEndRange(e,t,i){for(var n=this.splitTextNodeIntoRanges(e),s,a,o,l,u,f,d,c=0;c<n.length;c++){if(a=n[c],o=a.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(l=o.left,u=o.right,l>i&&s)return s;if(u>i)return a}else if(this.horizontal&&this.direction==="rtl"){if(l=o.left,u=o.right,u<t&&s)return s;if(l<t)return a}else{if(f=o.top,d=o.bottom,f>i&&s)return s;if(d>i)return a}s=a}return n[n.length-1]}splitTextNodeIntoRanges(e,t){var i=[],n=e.textContent||"",s=n.trim(),a,o=e.ownerDocument,l=t||" ",u=s.indexOf(l);if(u===-1||e.nodeType!=Node.TEXT_NODE)return a=o.createRange(),a.selectNodeContents(e),[a];for(a=o.createRange(),a.setStart(e,0),a.setEnd(e,u),i.push(a),a=!1;u!=-1;)u=s.indexOf(l,u+1),u>0&&(a&&(a.setEnd(e,u),i.push(a)),a=o.createRange(),a.setStart(e,u+1));return a&&(a.setEnd(e,s.length),i.push(a)),i}rangePairToCfiPair(e,t){var i=t.start,n=t.end;i.collapse(!0),n.collapse(!1);let s=new Vn.default(i,e).toString(),a=new Vn.default(n,e).toString();return{start:s,end:a}}rangeListToCfiList(e,t){for(var i=[],n,s=0;s<t.length;s++)n=this.rangePairToCfiPair(e,t[s]),i.push(n);return i}axis(e){return e&&(this.horizontal=e==="horizontal"),this.horizontal}},mg=tf;Hn.default=mg});var Mr=$(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.default=void 0;var _g=Pa(Ft()),Wt=Ie(),Gi=Pa(_t()),rf=Pa(Da()),yg=Dr(),ti=Ct();function Pa(r){return r&&r.__esModule?r:{default:r}}var nf=typeof navigator!="undefined",bg=nf&&/Chrome/.test(navigator.userAgent),sf=nf&&!bg&&/AppleWebKit/.test(navigator.userAgent),wg=1,La=class{constructor(e,t,i,n){this.epubcfi=new Gi.default,this.document=e,this.documentElement=this.document.documentElement,this.content=t||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=n||0,this.cfiBase=i||"",this.epubReadingSystem("epub.js",ti.EPUBJS_VERSION),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return ti.DOM_EVENTS}width(e){var t=this.content;return e&&(0,Wt.isNumber)(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}height(e){var t=this.content;return e&&(0,Wt.isNumber)(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}contentWidth(e){var t=this.content||this.document.body;return e&&(0,Wt.isNumber)(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}contentHeight(e){var t=this.content||this.document.body;return e&&(0,Wt.isNumber)(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}textWidth(){let e,t,i=this.document.createRange(),n=this.content||this.document.body,s=(0,Wt.borders)(n);return i.selectNodeContents(n),e=i.getBoundingClientRect(),t=e.width,s&&s.width&&(t+=s.width),Math.round(t)}textHeight(){let e,t,i=this.document.createRange(),n=this.content||this.document.body;return i.selectNodeContents(n),e=i.getBoundingClientRect(),t=e.bottom,Math.round(t)}scrollWidth(){var e=this.documentElement.scrollWidth;return e}scrollHeight(){var e=this.documentElement.scrollHeight;return e}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,t,i){var n=this.content||this.document.body;return t?n.style.setProperty(e,t,i?"important":""):n.style.removeProperty(e),this.window.getComputedStyle(n)[e]}viewport(e){var t,i,n,s,a,o,l=this.document.querySelector("meta[name='viewport']"),u={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},f=[],d={};if(l&&l.hasAttribute("content")){let c=l.getAttribute("content"),v=c.match(/width\s*=\s*([^,]*)/),g=c.match(/height\s*=\s*([^,]*)/),O=c.match(/initial-scale\s*=\s*([^,]*)/),k=c.match(/minimum-scale\s*=\s*([^,]*)/),_=c.match(/maximum-scale\s*=\s*([^,]*)/),p=c.match(/user-scalable\s*=\s*([^,]*)/);v&&v.length&&typeof v[1]!="undefined"&&(u.width=v[1]),g&&g.length&&typeof g[1]!="undefined"&&(u.height=g[1]),O&&O.length&&typeof O[1]!="undefined"&&(u.scale=O[1]),k&&k.length&&typeof k[1]!="undefined"&&(u.minimum=k[1]),_&&_.length&&typeof _[1]!="undefined"&&(u.maximum=_[1]),p&&p.length&&typeof p[1]!="undefined"&&(u.scalable=p[1])}return d=(0,Wt.defaults)(e||{},u),e&&(d.width&&f.push("width="+d.width),d.height&&f.push("height="+d.height),d.scale&&f.push("initial-scale="+d.scale),d.scalable==="no"?(f.push("minimum-scale="+d.scale),f.push("maximum-scale="+d.scale),f.push("user-scalable="+d.scalable)):(d.scalable&&f.push("user-scalable="+d.scalable),d.minimum&&f.push("minimum-scale="+d.minimum),d.maximum&&f.push("minimum-scale="+d.maximum)),l||(l=this.document.createElement("meta"),l.setAttribute("name","viewport"),this.document.querySelector("head").appendChild(l)),l.setAttribute("content",f.join(", ")),this.window.scrollTo(0,0)),d}expand(){this.emit(ti.EVENTS.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),typeof ResizeObserver=="undefined"?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),t=this.textHeight();(e!=this._size.width||t!=this._size.height)&&(this._size={width:e,height:t},this.onResize&&this.onResize(this._size),this.emit(ti.EVENTS.CONTENTS.RESIZE,this._size))}resizeListeners(){var e,t;clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.active===!1?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=function(o){o.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),i=0;i<e.length;i+=1){var n;try{n=e[i].cssRules}catch(o){return}if(!n)return;for(var s=0;s<n.length;s+=1)if(n[s].media){var a=this.window.matchMedia(n[s].media.mediaText);a.addListener(t)}}}resizeObservers(){this.observer=new ResizeObserver(e=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(t=>{this.resizeCheck()});let e={attributes:!0,childList:!0,characterData:!0,subtree:!0};this.observer.observe(this.document,e)}imageLoadListeners(){for(var e=this.document.querySelectorAll("img"),t,i=0;i<e.length;i++)t=e[i],typeof t.naturalWidth!="undefined"&&t.naturalWidth===0&&(t.onload=this.expand.bind(this))}fontLoadListeners(){!this.document||!this.document.fonts||this.document.fonts.ready.then(function(){this.resizeCheck()}.bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,t){var i,n={left:0,top:0};if(!this.document)return n;if(this.epubcfi.isCfiString(e)){let s=new Gi.default(e).toRange(this.document,t);if(s){try{if(!s.endContainer||s.startContainer==s.endContainer&&s.startOffset==s.endOffset){let a=s.startContainer.textContent.indexOf(" ",s.startOffset);a==-1&&(a=s.startContainer.textContent.length),s.setEnd(s.startContainer,a)}}catch(a){console.error("setting end offset to start container length failed",a)}if(s.startContainer.nodeType===Node.ELEMENT_NODE)i=s.startContainer.getBoundingClientRect(),n.left=i.left,n.top=i.top;else if(sf){let a=s.startContainer,o=new Range;try{a.nodeType===wg?i=a.getBoundingClientRect():s.startOffset+2<a.length?(o.setStart(a,s.startOffset),o.setEnd(a,s.startOffset+2),i=o.getBoundingClientRect()):s.startOffset-2>0?(o.setStart(a,s.startOffset-2),o.setEnd(a,s.startOffset),i=o.getBoundingClientRect()):i=a.parentNode.getBoundingClientRect()}catch(l){console.error(l,l.stack)}}else i=s.getBoundingClientRect()}}else if(typeof e=="string"&&e.indexOf("#")>-1){let s=e.substring(e.indexOf("#")+1),a=this.document.getElementById(s);if(a)if(sf){let o=new Range;o.selectNode(a),i=o.getBoundingClientRect()}else i=a.getBoundingClientRect()}return i&&(n.left=i.left,n.top=i.top),n}addStylesheet(e){return new Promise(function(t,i){var n,s=!1;if(!this.document){t(!1);return}if(n=this.document.querySelector("link[href='"+e+"']"),n){t(!0);return}n=this.document.createElement("link"),n.type="text/css",n.rel="stylesheet",n.href=e,n.onload=n.onreadystatechange=function(){!s&&(!this.readyState||this.readyState=="complete")&&(s=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(n)}.bind(this))}_getStylesheetNode(e){var t;return e="epubjs-inserted-css-"+(e||""),this.document?(t=this.document.getElementById(e),t||(t=this.document.createElement("style"),t.id=e,this.document.head.appendChild(t)),t):!1}addStylesheetCss(e,t){if(!this.document||!e)return!1;var i;return i=this._getStylesheetNode(t),i.innerHTML=e,!0}addStylesheetRules(e,t){var i;if(!(!this.document||!e||e.length===0))if(i=this._getStylesheetNode(t).sheet,Object.prototype.toString.call(e)==="[object Array]")for(var n=0,s=e.length;n<s;n++){var a=1,o=e[n],l=e[n][0],u="";Object.prototype.toString.call(o[1][0])==="[object Array]"&&(o=o[1],a=0);for(var f=o.length;a<f;a++){var d=o[a];u+=d[0]+":"+d[1]+(d[2]?" !important":"")+`;
`}i.insertRule(l+"{"+u+"}",i.cssRules.length)}else Object.keys(e).forEach(v=>{let g=e[v];if(Array.isArray(g))g.forEach(O=>{let _=Object.keys(O).map(p=>`${p}:${O[p]}`).join(";");i.insertRule(`${v}{${_}}`,i.cssRules.length)});else{let k=Object.keys(g).map(_=>`${_}:${g[_]}`).join(";");i.insertRule(`${v}{${k}}`,i.cssRules.length)}})}addScript(e){return new Promise(function(t,i){var n,s=!1;if(!this.document){t(!1);return}n=this.document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){!s&&(!this.readyState||this.readyState=="complete")&&(s=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(n)}.bind(this))}addClass(e){var t;!this.document||(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;!this.document||(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){!this.document||(this._triggerEvent=this.triggerEvent.bind(this),ti.DOM_EVENTS.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){!this.document||(ti.DOM_EVENTS.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){!this.document||(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){!this.document||(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}.bind(this),250)}triggerSelectedEvent(e){var t,i;e&&e.rangeCount>0&&(t=e.getRangeAt(0),t.collapsed||(i=new Gi.default(t,this.cfiBase).toString(),this.emit(ti.EVENTS.CONTENTS.SELECTED,i),this.emit(ti.EVENTS.CONTENTS.SELECTED_RANGE,t)))}range(e,t){var i=new Gi.default(e);return i.toRange(this.document,t)}cfiFromRange(e,t){return new Gi.default(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new Gi.default(e,this.cfiBase,t).toString()}map(e){var t=new rf.default(e);return t.section()}size(e,t){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),i.width=e,this.css("padding","0 "+e/12+"px")),t>=0&&(this.height(t),i.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(e,t,i,n,s){let a=(0,Wt.prefixed)("column-axis"),o=(0,Wt.prefixed)("column-gap"),l=(0,Wt.prefixed)("column-width"),u=(0,Wt.prefixed)("column-fill"),d=this.writingMode().indexOf("vertical")===0?"vertical":"horizontal";this.layoutStyle("paginated"),s==="rtl"&&d==="horizontal"&&this.direction(s),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),d==="vertical"?(this.css("padding-top",n/2+"px",!0),this.css("padding-bottom",n/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(a,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",n/2+"px",!0),this.css("padding-right",n/2+"px",!0),this.css(a,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(u,"auto"),this.css(o,n+"px"),this.css(l,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,i){var n="scale("+e+")",s="";this.css("transform-origin","top left"),(t>=0||i>=0)&&(s=" translate("+(t||0)+"px, "+(i||0)+"px )"),this.css("transform",n+s)}fit(e,t,i){var n=this.viewport(),s=parseInt(n.width),a=parseInt(n.height),o=e/s,l=t/a,u=o<l?o:l;if(this.layoutStyle("paginated"),this.width(s),this.height(a),this.overflow("hidden"),this.scaler(u,0,0),this.css("background-size",s*u+"px "+a*u+"px"),this.css("background-color","transparent"),i&&i.properties.includes("page-spread-left")){var f=e-s*u;this.css("margin-left",f+"px")}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,t,i,n,s){var a=new rf.default(t,s);return a.page(this,e,i,n)}linksHandler(){(0,yg.replaceLinks)(this.content,e=>{this.emit(ti.EVENTS.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=(0,Wt.prefixed)("writing-mode");return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(i){switch(i){case"dom-manipulation":return!0;case"layout-changes":return!0;case"touch-events":return!0;case"mouse-events":return!0;case"keyboard-events":return!0;case"spine-scripting":return!1;default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}};(0,_g.default)(La.prototype);var Eg=La;Zn.default=Eg});var uf=$(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.default=void 0;var xg=of(Ft()),Sg=of(_t()),af=Ct();function of(r){return r&&r.__esModule?r:{default:r}}var lf=class{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,i,n,s,a){let o=encodeURI(t+e),u=new Sg.default(t).spinePos,f=new za({type:e,cfiRange:t,data:i,sectionIndex:u,cb:n,className:s,styles:a});return this._annotations[o]=f,u in this._annotationsBySectionIndex?this._annotationsBySectionIndex[u].push(o):this._annotationsBySectionIndex[u]=[o],this.rendition.views().forEach(c=>{f.sectionIndex===c.index&&f.attach(c)}),f}remove(e,t){let i=encodeURI(e+t);if(i in this._annotations){let n=this._annotations[i];if(t&&n.type!==t)return;this.rendition.views().forEach(a=>{this._removeFromAnnotationBySectionIndex(n.sectionIndex,i),n.sectionIndex===a.index&&n.detach(a)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(i=>i!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,i,n,s){return this.add("highlight",e,t,i,n,s)}underline(e,t,i,n,s){return this.add("underline",e,t,i,n,s)}mark(e,t,i){return this.add("mark",e,t,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(n=>{this._annotations[n].attach(e)})}clear(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(n=>{this._annotations[n].detach(e)})}show(){}hide(){}},za=class{constructor({type:e,cfiRange:t,data:i,sectionIndex:n,cb:s,className:a,styles:o}){this.type=e,this.cfiRange=t,this.data=i,this.sectionIndex=n,this.mark=void 0,this.cb=s,this.className=a,this.styles=o}update(e){this.data=e}attach(e){let{cfiRange:t,data:i,type:n,mark:s,cb:a,className:o,styles:l}=this,u;return n==="highlight"?u=e.highlight(t,i,a,o,l):n==="underline"?u=e.underline(t,i,a,o,l):n==="mark"&&(u=e.mark(t,i,a)),this.mark=u,this.emit(af.EVENTS.ANNOTATION.ATTACH,u),u}detach(e){let{cfiRange:t,type:i}=this,n;return e&&(i==="highlight"?n=e.unhighlight(t):i==="underline"?n=e.ununderline(t):i==="mark"&&(n=e.unmark(t))),this.mark=void 0,this.emit(af.EVENTS.ANNOTATION.DETACH,n),n}text(){}};(0,xg.default)(za.prototype);var Tg=lf;Xn.default=Tg});var ff=$(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createElement=hf;function hf(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}Yn.default={createElement:hf}});var pf=$(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.proxyMouse=cf;Br.clone=df;Br.default={proxyMouse:cf};function cf(r,e){function t(a){for(var o=e.length-1;o>=0;o--){var l=e[o],u=a.clientX,f=a.clientY;if(a.touches&&a.touches.length&&(u=a.touches[0].clientX,f=a.touches[0].clientY),!!kg(l,r,u,f)){l.dispatchEvent(df(a));break}}}if(r.nodeName==="iframe"||r.nodeName==="IFRAME")try{this.target=r.contentDocument}catch(a){this.target=r}else this.target=r;for(var i=["mouseup","mousedown","click","touchstart"],n=0;n<i.length;n++){var s=i[n];this.target.addEventListener(s,function(a){return t(a)},!1)}}function df(r){var e=Object.assign({},r,{bubbles:!1});try{return new MouseEvent(r.type,e)}catch(i){var t=document.createEvent("MouseEvents");return t.initMouseEvent(r.type,!1,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),t}}function kg(r,e,t,i){var n=e.getBoundingClientRect();function s(f,d,c){var v=f.top-n.top,g=f.left-n.left,O=v+f.height,k=g+f.width;return v<=c&&g<=d&&O>c&&k>d}var a=r.getBoundingClientRect();if(!s(a,t,i))return!1;for(var o=r.getClientRects(),l=0,u=o.length;l<u;l++)if(s(o[l],t,i))return!0;return!1}});var _f=$(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Underline=Yt.Highlight=Yt.Mark=Yt.Pane=void 0;var Og=function r(e,t,i){e===null&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(n===void 0){var s=Object.getPrototypeOf(e);return s===null?void 0:r(s,t,i)}else{if("value"in n)return n.value;var a=n.get;return a===void 0?void 0:a.call(i)}},Gn=function(){function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}}(),Cg=ff(),Ur=vf(Cg),Ng=pf(),Rg=vf(Ng);function vf(r){return r&&r.__esModule?r:{default:r}}function gf(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function mf(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function $n(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var rb=Yt.Pane=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document.body;$n(this,r),this.target=e,this.element=Ur.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),Rg.default.proxyMouse(this.target,this.marks),this.container=t,this.container.appendChild(this.element),this.render()}return Gn(r,[{key:"addMark",value:function(t){var i=Ur.default.createElement("g");return this.element.appendChild(i),t.bind(i,this.container),this.marks.push(t),t.render(),t}},{key:"removeMark",value:function(t){var i=this.marks.indexOf(t);if(i!==-1){var n=t.unbind();this.element.removeChild(n),this.marks.splice(i,1)}}},{key:"render",value:function(){Pg(this.element,Dg(this.target,this.container));var t=!0,i=!1,n=void 0;try{for(var s=this.marks[Symbol.iterator](),a;!(t=(a=s.next()).done);t=!0){var o=a.value;o.render()}}catch(l){i=!0,n=l}finally{try{!t&&s.return&&s.return()}finally{if(i)throw n}}}}]),r}(),Ag=Yt.Mark=function(){function r(){$n(this,r),this.element=null}return Gn(r,[{key:"bind",value:function(t,i){this.element=t,this.container=i}},{key:"unbind",value:function(){var t=this.element;return this.element=null,t}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(t){!this.element||this.element.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var t=[],i=this.element.firstChild;i;)t.push(i.getBoundingClientRect()),i=i.nextSibling;return t}},{key:"filteredRanges",value:function(){var t=Array.from(this.range.getClientRects());return t.filter(function(i){for(var n=0;n<t.length;n++){if(t[n]===i)return!0;var s=Lg(t[n],i);if(s)return!1}return!0})}}]),r}(),Ig=Yt.Highlight=function(r){mf(e,r);function e(t,i,n,s){$n(this,e);var a=gf(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.range=t,a.className=i,a.data=n||{},a.attributes=s||{},a}return Gn(e,[{key:"bind",value:function(i,n){Og(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"bind",this).call(this,i,n);for(var s in this.data)this.data.hasOwnProperty(s)&&(this.element.dataset[s]=this.data[s]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&this.element.setAttribute(s,this.attributes[s]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var i=this.element.ownerDocument.createDocumentFragment(),n=this.filteredRanges(),s=this.element.getBoundingClientRect(),a=this.container.getBoundingClientRect(),o=0,l=n.length;o<l;o++){var u=n[o],f=Ur.default.createElement("rect");f.setAttribute("x",u.left-s.left+a.left),f.setAttribute("y",u.top-s.top+a.top),f.setAttribute("height",u.height),f.setAttribute("width",u.width),i.appendChild(f)}this.element.appendChild(i)}}]),e}(Ag),nb=Yt.Underline=function(r){mf(e,r);function e(t,i,n,s){return $n(this,e),gf(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,n,s))}return Gn(e,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var i=this.element.ownerDocument.createDocumentFragment(),n=this.filteredRanges(),s=this.element.getBoundingClientRect(),a=this.container.getBoundingClientRect(),o=0,l=n.length;o<l;o++){var u=n[o],f=Ur.default.createElement("rect");f.setAttribute("x",u.left-s.left+a.left),f.setAttribute("y",u.top-s.top+a.top),f.setAttribute("height",u.height),f.setAttribute("width",u.width),f.setAttribute("fill","none");var d=Ur.default.createElement("line");d.setAttribute("x1",u.left-s.left+a.left),d.setAttribute("x2",u.left-s.left+a.left+u.width),d.setAttribute("y1",u.top-s.top+a.top+u.height-1),d.setAttribute("y2",u.top-s.top+a.top+u.height-1),d.setAttribute("stroke-width",1),d.setAttribute("stroke","black"),d.setAttribute("stroke-linecap","square"),i.appendChild(f),i.appendChild(d)}this.element.appendChild(i)}}]),e}(Ig);function Dg(r,e){var t=e.getBoundingClientRect(),i=r.getBoundingClientRect();return{top:i.top-t.top,left:i.left-t.left,height:r.scrollHeight,width:r.scrollWidth}}function Pg(r,e){r.style.setProperty("top",e.top+"px","important"),r.style.setProperty("left",e.left+"px","important"),r.style.setProperty("height",e.height+"px","important"),r.style.setProperty("width",e.width+"px","important")}function Lg(r,e){return e.right<=r.right&&e.left>=r.left&&e.top>=r.top&&e.bottom<=r.bottom}});var Ua=$(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default=void 0;var zg=Ma(Ft()),it=Ie(),Mg=Ma(_t()),Bg=Ma(Mr()),bt=Ct(),Kn=_f();function Ma(r){return r&&r.__esModule?r:{default:r}}var Ba=class{constructor(e,t){this.settings=(0,it.extend)({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},t||{}),this.id="epubjs-view-"+(0,it.uuid)(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new Mg.default,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement("div");return t.classList.add("epub-view"),t.style.height="0px",t.style.width="0px",t.style.overflow="hidden",t.style.position="relative",t.style.display="block",e&&e=="horizontal"?t.style.flex="none":t.style.flex="initial",t}create(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.sandbox="allow-same-origin",this.settings.allowScriptedContent&&(this.iframe.sandbox+=" allow-scripts"),this.settings.allowPopups&&(this.iframe.sandbox+=" allow-popups"),this.iframe.setAttribute("enable-annotation","true"),this.resizing=!0,this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this.element.setAttribute("ref",this.index),this.added=!0,this.elementBounds=(0,it.bounds)(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write"),this.iframe)}render(e,t){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then(function(i){return this.load(i)}.bind(this)).then(function(){let i=this.contents.writingMode(),n;return this.settings.flow==="scrolled"?n=i.indexOf("vertical")===0?"horizontal":"vertical":n=i.indexOf("vertical")===0?"vertical":"horizontal",i.indexOf("vertical")===0&&this.settings.flow==="paginated"&&(this.layout.delta=this.layout.height),this.setAxis(n),this.emit(bt.EVENTS.VIEWS.AXIS,n),this.setWritingMode(i),this.emit(bt.EVENTS.VIEWS.WRITING_MODE,i),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((s,a)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),s()})}.bind(this),function(i){return this.emit(bt.EVENTS.VIEWS.LOAD_ERROR,i),new Promise((n,s)=>{s(i)})}.bind(this)).then(function(){this.emit(bt.EVENTS.VIEWS.RENDERED,this.section)}.bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var i=e||this.settings.width,n=t||this.settings.height;this.layout.name==="pre-paginated"?this.lock("both",i,n):this.settings.axis==="horizontal"?this.lock("height",i,n):this.lock("width",i,n),this.settings.width=i,this.settings.height=n}lock(e,t,i){var n=(0,it.borders)(this.element),s;this.iframe?s=(0,it.borders)(this.iframe):s={width:0,height:0},e=="width"&&(0,it.isNumber)(t)&&(this.lockedWidth=t-n.width-s.width),e=="height"&&(0,it.isNumber)(i)&&(this.lockedHeight=i-n.height-s.height),e==="both"&&(0,it.isNumber)(t)&&(0,it.isNumber)(i)&&(this.lockedWidth=t-n.width-s.width,this.lockedHeight=i-n.height-s.height),this.displayed&&this.iframe&&this.expand()}expand(e){var t=this.lockedWidth,i=this.lockedHeight,n,s,a;!this.iframe||this._expanding||(this._expanding=!0,this.layout.name==="pre-paginated"?(t=this.layout.columnWidth,i=this.layout.height):this.settings.axis==="horizontal"?(t=this.contents.textWidth(),t%this.layout.pageWidth>0&&(t=Math.ceil(t/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(n=t/this.layout.pageWidth,this.layout.divisor>1&&this.layout.name==="reflowable"&&n%2>0&&(t+=this.layout.pageWidth))):this.settings.axis==="vertical"&&(i=this.contents.textHeight(),this.settings.flow==="paginated"&&i%this.layout.height>0&&(i=Math.ceil(i/this.layout.height)*this.layout.height)),(this._needsReframe||t!=this._width||i!=this._height)&&this.reframe(t,i),this._expanding=!1)}reframe(e,t){var i;(0,it.isNumber)(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),(0,it.isNumber)(t)&&(this.element.style.height=t+"px",this.iframe.style.height=t+"px",this._height=t);let n=this.prevBounds?e-this.prevBounds.width:e,s=this.prevBounds?t-this.prevBounds.height:t;i={width:e,height:t,widthDelta:n,heightDelta:s},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let a;for(let o in this.marks)this.marks.hasOwnProperty(o)&&(a=this.marks[o],this.placeMark(a.element,a.range))}),this.onResize(this,i),this.emit(bt.EVENTS.VIEWS.RESIZED,i),this.prevBounds=i,this.elementBounds=(0,it.bounds)(this.element)}load(e){var t=new it.defer,i=t.promise;if(!this.iframe)return t.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=function(s){this.onLoad(s,t)}.bind(this),this.settings.method==="blobUrl")this.blobUrl=(0,it.createBlobUrl)(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if(this.settings.method==="srcdoc")this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(new Error("No Document Available")),i;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var n=this;MSApp.execUnsafeLocalFunction(function(){n.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return i}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new Bg.default(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var i=this.document.querySelector("link[rel='canonical']");i?i.setAttribute("href",this.section.canonical):(i=this.document.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(i)),this.contents.on(bt.EVENTS.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(bt.EVENTS.CONTENTS.RESIZE,n=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,e=="horizontal"?this.element.style.flex="none":this.element.style.flex="initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var t=new it.defer;return this.displayed?t.resolve(this):this.render(e).then(function(){this.emit(bt.EVENTS.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}.bind(this),function(i){t.reject(i,this)}),t.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(bt.EVENTS.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(bt.EVENTS.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){var t=this.iframe.getBoundingClientRect(),i=this.contents.locationOf(e,this.settings.ignoreClass);return{left:i.left,top:i.top}}onDisplayed(e){}onResize(e,t){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=(0,it.bounds)(this.element)),this.elementBounds}highlight(e,t={},i,n="epubjs-hl",s={}){if(!this.contents)return;let a=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},s),o=this.contents.range(e),l=()=>{this.emit(bt.EVENTS.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new Kn.Pane(this.iframe,this.element));let u=new Kn.Highlight(o,n,t,a),f=this.pane.addMark(u);return this.highlights[e]={mark:f,element:f.element,listeners:[l,i]},f.element.setAttribute("ref",n),f.element.addEventListener("click",l),f.element.addEventListener("touchstart",l),i&&(f.element.addEventListener("click",i),f.element.addEventListener("touchstart",i)),f}underline(e,t={},i,n="epubjs-ul",s={}){if(!this.contents)return;let a=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},s),o=this.contents.range(e),l=()=>{this.emit(bt.EVENTS.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new Kn.Pane(this.iframe,this.element));let u=new Kn.Underline(o,n,t,a),f=this.pane.addMark(u);return this.underlines[e]={mark:f,element:f.element,listeners:[l,i]},f.element.setAttribute("ref",n),f.element.addEventListener("click",l),f.element.addEventListener("touchstart",l),i&&(f.element.addEventListener("click",i),f.element.addEventListener("touchstart",i)),f}mark(e,t={},i){if(!this.contents)return;if(e in this.marks)return this.marks[e];let n=this.contents.range(e);if(!n)return;let s=n.commonAncestorContainer,a=s.nodeType===1?s:s.parentNode,o=u=>{this.emit(bt.EVENTS.VIEWS.MARK_CLICKED,e,t)};n.collapsed&&s.nodeType===1?(n=new Range,n.selectNodeContents(s)):n.collapsed&&(n=new Range,n.selectNodeContents(a));let l=this.document.createElement("a");return l.setAttribute("ref","epubjs-mk"),l.style.position="absolute",l.dataset.epubcfi=e,t&&Object.keys(t).forEach(u=>{l.dataset[u]=t[u]}),i&&(l.addEventListener("click",i),l.addEventListener("touchstart",i)),l.addEventListener("click",o),l.addEventListener("touchstart",o),this.placeMark(l,n),this.element.appendChild(l),this.marks[e]={element:l,range:n,listeners:[o,i]},a}placeMark(e,t){let i,n,s;if(this.layout.name==="pre-paginated"||this.settings.axis!=="horizontal"){let o=t.getBoundingClientRect();i=o.top,n=o.right}else{let o=t.getClientRects(),l;for(var a=0;a!=o.length;a++)l=o[a],(!s||l.left<s)&&(s=l.left,n=Math.ceil(s/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,i=l.top)}e.style.top=`${i}px`,e.style.left=`${n}px`}unhighlight(e){let t;e in this.highlights&&(t=this.highlights[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&(0,it.revokeBlobUrl)(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&(this.pane.element.remove(),this.pane=void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}};(0,zg.default)(Ba.prototype);var Ug=Ba;Jn.default=Ug});var bf=$(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.createDefiner=yf;Qn.default=Fg;function Fg(){var r="reverse",e=yf();return document.body.appendChild(e),e.scrollLeft>0?r="default":typeof Element!="undefined"&&Element.prototype.scrollIntoView?(e.children[0].children[1].scrollIntoView(),e.scrollLeft<0&&(r="negative")):(e.scrollLeft=1,e.scrollLeft===0&&(r="negative")),document.body.removeChild(e),r}function yf(){var r=document.createElement("div");r.dir="rtl",r.style.position="fixed",r.style.width="1px",r.style.height="1px",r.style.top="0px",r.style.left="0px",r.style.overflow="hidden";var e=document.createElement("div");e.style.width="2px";var t=document.createElement("span");t.style.width="1px",t.style.display="inline-block";var i=document.createElement("span");return i.style.width="1px",i.style.display="inline-block",e.appendChild(t),e.appendChild(i),r.appendChild(e),r}});var es=$((lb,wf)=>{function qg(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}wf.exports=qg});var xf=$((ub,Ef)=>{var Wg=typeof global=="object"&&global&&global.Object===Object&&global;Ef.exports=Wg});var Fa=$((hb,Sf)=>{var jg=xf(),Vg=typeof self=="object"&&self&&self.Object===Object&&self,Hg=jg||Vg||Function("return this")();Sf.exports=Hg});var kf=$((fb,Tf)=>{var Zg=Fa(),Xg=function(){return Zg.Date.now()};Tf.exports=Xg});var Cf=$((cb,Of)=>{var Yg=/\s/;function Gg(r){for(var e=r.length;e--&&Yg.test(r.charAt(e)););return e}Of.exports=Gg});var Rf=$((db,Nf)=>{var $g=Cf(),Kg=/^\s+/;function Jg(r){return r&&r.slice(0,$g(r)+1).replace(Kg,"")}Nf.exports=Jg});var qa=$((pb,Af)=>{var Qg=Fa(),em=Qg.Symbol;Af.exports=em});var Lf=$((vb,Pf)=>{var If=qa(),Df=Object.prototype,tm=Df.hasOwnProperty,im=Df.toString,Fr=If?If.toStringTag:void 0;function rm(r){var e=tm.call(r,Fr),t=r[Fr];try{r[Fr]=void 0;var i=!0}catch(s){}var n=im.call(r);return i&&(e?r[Fr]=t:delete r[Fr]),n}Pf.exports=rm});var Mf=$((gb,zf)=>{var nm=Object.prototype,sm=nm.toString;function am(r){return sm.call(r)}zf.exports=am});var qf=$((mb,Ff)=>{var Bf=qa(),om=Lf(),lm=Mf(),um="[object Null]",hm="[object Undefined]",Uf=Bf?Bf.toStringTag:void 0;function fm(r){return r==null?r===void 0?hm:um:Uf&&Uf in Object(r)?om(r):lm(r)}Ff.exports=fm});var jf=$((_b,Wf)=>{function cm(r){return r!=null&&typeof r=="object"}Wf.exports=cm});var Hf=$((yb,Vf)=>{var dm=qf(),pm=jf(),vm="[object Symbol]";function gm(r){return typeof r=="symbol"||pm(r)&&dm(r)==vm}Vf.exports=gm});var Gf=$((bb,Yf)=>{var mm=Rf(),Zf=es(),_m=Hf(),Xf=0/0,ym=/^[-+]0x[0-9a-f]+$/i,bm=/^0b[01]+$/i,wm=/^0o[0-7]+$/i,Em=parseInt;function xm(r){if(typeof r=="number")return r;if(_m(r))return Xf;if(Zf(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Zf(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=mm(r);var t=bm.test(r);return t||wm.test(r)?Em(r.slice(2),t?2:8):ym.test(r)?Xf:+r}Yf.exports=xm});var ja=$((wb,Kf)=>{var Sm=es(),Wa=kf(),$f=Gf(),Tm="Expected a function",km=Math.max,Om=Math.min;function Cm(r,e,t){var i,n,s,a,o,l,u=0,f=!1,d=!1,c=!0;if(typeof r!="function")throw new TypeError(Tm);e=$f(e)||0,Sm(t)&&(f=!!t.leading,d="maxWait"in t,s=d?km($f(t.maxWait)||0,e):s,c="trailing"in t?!!t.trailing:c);function v(w){var N=i,C=n;return i=n=void 0,u=w,a=r.apply(C,N),a}function g(w){return u=w,o=setTimeout(_,e),f?v(w):a}function O(w){var N=w-l,C=w-u,M=e-N;return d?Om(M,s-C):M}function k(w){var N=w-l,C=w-u;return l===void 0||N>=e||N<0||d&&C>=s}function _(){var w=Wa();if(k(w))return p(w);o=setTimeout(_,O(w))}function p(w){return o=void 0,c&&i?v(w):(i=n=void 0,a)}function y(){o!==void 0&&clearTimeout(o),u=0,i=l=n=o=void 0}function T(){return o===void 0?a:p(Wa())}function P(){var w=Wa(),N=k(w);if(i=arguments,n=this,l=w,N){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(_,e),v(l)}return o===void 0&&(o=setTimeout(_,e)),a}return P.cancel=y,P.flush=T,P}Kf.exports=Cm});var Qf=$((Eb,Jf)=>{var Nm=ja(),Rm=es(),Am="Expected a function";function Im(r,e,t){var i=!0,n=!0;if(typeof r!="function")throw new TypeError(Am);return Rm(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),Nm(r,e,{leading:i,maxWait:e,trailing:n})}Jf.exports=Im});var tc=$(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.default=void 0;var wt=Ie(),Dm=Pm(Qf());function Pm(r){return r&&r.__esModule?r:{default:r}}var ec=class{constructor(e){this.settings=e||{},this.id="epubjs-container-"+(0,wt.uuid)(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,i=e.width,n=e.overflow||!1,s=e.axis||"vertical",a=e.direction;(0,wt.extend)(this.settings,e),e.height&&(0,wt.isNumber)(e.height)&&(t=e.height+"px"),e.width&&(0,wt.isNumber)(e.width)&&(i=e.width+"px");let o=document.createElement("div");return o.id=this.id,o.classList.add("epub-container"),o.style.wordSpacing="0",o.style.lineHeight="0",o.style.verticalAlign="top",o.style.position="relative",s==="horizontal"&&(o.style.display="flex",o.style.flexDirection="row",o.style.flexWrap="nowrap"),i&&(o.style.width=i),t&&(o.style.height=t),n&&(n==="scroll"&&s==="vertical"?(o.style["overflow-y"]=n,o.style["overflow-x"]="hidden"):n==="scroll"&&s==="horizontal"?(o.style["overflow-y"]="hidden",o.style["overflow-x"]=n):o.style.overflow=n),a&&(o.dir=a,o.style.direction=a),a&&this.settings.fullsize&&(document.body.style.direction=a),o}wrap(e){var t=document.createElement("div");return t.style.visibility="hidden",t.style.overflow="hidden",t.style.width="0",t.style.height="0",t.appendChild(e),t}getElement(e){var t;if((0,wt.isElement)(e)?t=e:typeof e=="string"&&(t=document.getElementById(e)),!t)throw new Error("Not an Element");return t}attachTo(e){var t=this.getElement(e),i;if(!!t)return this.settings.hidden?i=this.wrapper:i=this.container,t.appendChild(i),this.element=t,t}getContainer(){return this.container}onResize(e){(!(0,wt.isNumber)(this.settings.width)||!(0,wt.isNumber)(this.settings.height))&&(this.resizeFunc=(0,Dm.default)(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,t){var i;let n=e||this.settings.width,s=t||this.settings.height;e===null?(i=this.element.getBoundingClientRect(),i.width&&(e=Math.floor(i.width),this.container.style.width=e+"px")):(0,wt.isNumber)(e)?this.container.style.width=e+"px":this.container.style.width=e,t===null?(i=i||this.element.getBoundingClientRect(),i.height&&(t=i.height,this.container.style.height=t+"px")):(0,wt.isNumber)(t)?this.container.style.height=t+"px":this.container.style.height=t,(0,wt.isNumber)(e)||(e=this.container.clientWidth),(0,wt.isNumber)(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let a=(0,wt.windowBounds)(),o=window.getComputedStyle(document.body),l={left:parseFloat(o["padding-left"])||0,right:parseFloat(o["padding-right"])||0,top:parseFloat(o["padding-top"])||0,bottom:parseFloat(o["padding-bottom"])||0};return n||(e=a.width-l.left-l.right),(this.settings.fullsize&&!s||!s)&&(t=a.height-l.top-l.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return this.container.style.overflow!=="visible"&&(e=this.container&&this.container.getBoundingClientRect()),!e||!e.width||!e.height?(0,wt.windowBounds)():e}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var i="#"+this.id+" ",n="";this.sheet||(this.sheet=this.getSheet()),t.forEach(function(s){for(var a in s)s.hasOwnProperty(a)&&(n+=a+":"+s[a]+";")}),this.sheet.insertRule(i+e+" {"+n+"}",0)}axis(e){e==="horizontal"?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&(e==="scroll"&&this.settings.axis==="vertical"?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):e==="scroll"&&this.settings.axis==="horizontal"?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){var e;this.element&&(this.settings.hidden?e=this.wrapper:e=this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}},Lm=ec;ts.default=Lm});var rc=$(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.default=void 0;var ic=class{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t<this.container.children.length?this.container.insertBefore(e.element,this.container.children[t]):this.container.appendChild(e.element)),this.length++,e}remove(e){var t=this._views.indexOf(e);t>-1&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,t=this.length;if(!!this.length){for(var i=0;i<t;i++)e=this._views[i],this.destroy(e);this._views=[],this.length=0}}find(e){for(var t,i=this.length,n=0;n<i;n++)if(t=this._views[n],t.displayed&&t.section.index==e.index)return t}displayed(){for(var e=[],t,i=this.length,n=0;n<i;n++)t=this._views[n],t.displayed&&e.push(t);return e}show(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.show();this.hidden=!1}hide(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.hide();this.hidden=!0}},zm=ic;is.default=zm});var ns=$(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.default=void 0;var Mm=Ki(Ft()),$i=Ie(),Bm=Ki(bf()),nc=Ki(Da()),Um=Ki(In()),Fm=Ki(tc()),qm=Ki(rc()),Et=Ct();function Ki(r){return r&&r.__esModule?r:{default:r}}var Va=class{constructor(e){this.name="default",this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new Um.default(this),this.settings=(0,$i.extend)(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0,allowScriptedContent:!1,allowPopups:!1}),(0,$i.extend)(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.rendered=!1}render(e,t){let i=e.tagName;typeof this.settings.fullsize=="undefined"&&i&&(i.toLowerCase()=="body"||i.toLowerCase()=="html")&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=t,this.settings.rtlScrollType=(0,Bm.default)(),this.stage=new Fm.default({width:t.width,height:t.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new qm.default(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener("unload",function(t){this.destroy()}.bind(this)),this.settings.fullsize?e=window:e=this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll)}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(e){let{orientation:t}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout(function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(Et.EVENTS.MANAGERS.ORIENTATION_CHANGE,t)}.bind(this),500)}onResized(e){this.resize()}resize(e,t,i){let n=this.stage.size(e,t);if(this.winBounds=(0,$i.windowBounds)(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height){this._stageSize=void 0;return}this._stageSize&&this._stageSize.width===n.width&&this._stageSize.height===n.height||(this._stageSize=n,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(Et.EVENTS.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},i))}createView(e,t){return new this.View(e,(0,$i.extend)(this.viewSettings,{forceRight:t}))}handleNextPrePaginated(e,t,i){let n;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1){if(e||t.index===0)return;if(n=t.next(),n&&!n.properties.includes("page-spread-left"))return i.call(this,n)}}display(e,t){var i=new $i.defer,n=i.promise;(t===e.href||(0,$i.isNumber)(t))&&(t=void 0);var s=this.views.find(e);if(s&&e&&this.layout.name!=="pre-paginated"){let o=s.offset();if(this.settings.direction==="ltr")this.scrollTo(o.left,o.top,!0);else{let l=s.width();this.scrollTo(o.left+l,o.top,!0)}if(t){let l=s.locationOf(t),u=s.width();this.moveTo(l,u)}return i.resolve(),n}this.clear();let a=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(a=!0),this.add(e,a).then(function(o){if(t){let l=o.locationOf(t),u=o.width();this.moveTo(l,u)}}.bind(this),o=>{i.reject(o)}).then(function(){return this.handleNextPrePaginated(a,e,this.add)}.bind(this)).then(function(){this.views.show(),i.resolve()}.bind(this)),n}afterDisplayed(e){this.emit(Et.EVENTS.MANAGERS.ADDED,e)}afterResized(e){this.emit(Et.EVENTS.MANAGERS.RESIZE,e.section)}moveTo(e,t){var i=0,n=0;this.isPaginated?(i=Math.floor(e.left/this.layout.delta)*this.layout.delta,i+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),n=Math.floor(e.top/this.layout.delta)*this.layout.delta,n+this.layout.delta>this.container.scrollHeight&&(n=this.container.scrollHeight-this.layout.delta)):n=e.top,this.settings.direction==="rtl"&&(i=i+this.layout.delta,i=i-t),this.scrollTo(i,n,!0)}add(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Et.EVENTS.VIEWS.AXIS,n=>{this.updateAxis(n)}),i.on(Et.EVENTS.VIEWS.WRITING_MODE,n=>{this.updateWritingMode(n)}),i.display(this.request)}append(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Et.EVENTS.VIEWS.AXIS,n=>{this.updateAxis(n)}),i.on(Et.EVENTS.VIEWS.WRITING_MODE,n=>{this.updateWritingMode(n)}),i.display(this.request)}prepend(e,t){var i=this.createView(e,t);return i.on(Et.EVENTS.VIEWS.RESIZED,n=>{this.counter(n)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Et.EVENTS.VIEWS.AXIS,n=>{this.updateAxis(n)}),i.on(Et.EVENTS.VIEWS.WRITING_MODE,n=>{this.updateWritingMode(n)}),i.display(this.request)}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,t;let i=this.settings.direction;if(!!this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,t<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft,t>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(t=this.container.scrollLeft+this.layout.delta*-1,t>this.container.scrollWidth*-1?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()):e=this.views.last().section.next(),e)){this.clear(),this.updateLayout();let n=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(n=!0),this.append(e,n).then(function(){return this.handleNextPrePaginated(n,e,this.append)}.bind(this),s=>s).then(function(){!this.isPaginated&&this.settings.axis==="horizontal"&&this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"&&this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}prev(){var e,t;let i=this.settings.direction;if(!!this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft,t>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft+this.container.offsetWidth,t<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(t=this.container.scrollLeft,t<0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()):e=this.views.first().section.prev(),e)){this.clear(),this.updateLayout();let n=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&typeof e.prev()!="object"&&(n=!0),this.prepend(e,n).then(function(){var s;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1&&(s=e.prev(),s))return this.prepend(s)}.bind(this),s=>s).then(function(){this.isPaginated&&this.settings.axis==="horizontal"&&(this.settings.direction==="rtl"?this.settings.rtlScrollType==="default"?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth*-1+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&this.settings.axis==="horizontal"?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=t.height<window.innerHeight?t.height:window.innerHeight,n=t.width<window.innerWidth?t.width:window.innerWidth,s=this.settings.axis==="vertical",a=this.settings.direction==="rtl",o=0,l=0;return this.settings.fullsize&&(o=s?window.scrollY:window.scrollX),e.map(f=>{let{index:d,href:c}=f.section,v=f.position(),g=f.width(),O=f.height(),k,_,p,y;s?(k=o+t.top-v.top+l,_=k+i-l,y=this.layout.count(O,i).pages,p=i):(k=o+t.left-v.left+l,_=k+n-l,y=this.layout.count(g,n).pages,p=n);let T=Math.ceil(k/p),P=[],w=Math.ceil(_/p);if(this.settings.direction==="rtl"&&!s){let M=T;T=y-w,w=y-M}P=[];for(var N=T;N<=w;N++){let M=N+1;P.push(M)}let C=this.mapping.page(f.contents,f.section.cfiBase,k,_);return{index:d,href:c,pages:P,totalPages:y,mapping:C}})}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=0,n=0;return this.settings.fullsize&&(i=window.scrollX),e.map(a=>{let{index:o,href:l}=a.section,u,f=a.position(),d=a.width(),c,v,g;this.settings.direction==="rtl"?(u=t.right-i,g=Math.min(Math.abs(u-f.left),this.layout.width)-n,v=f.width-(f.right-u)-n,c=v-g):(u=t.left+i,g=Math.min(f.right-u,this.layout.width)-n,c=u-f.left+n,v=c+g),n+=g;let O=this.mapping.page(a.contents,a.section.cfiBase,c,v),k=this.layout.count(d).pages,_=Math.floor(c/this.layout.pageWidth),p=[],y=Math.floor(v/this.layout.pageWidth);if(_<0&&(_=0,y=y+1),this.settings.direction==="rtl"){let P=_;_=k-y,y=k-P}for(var T=_+1;T<=y;T++){let P=T;p.push(P)}return{index:o,href:l,pages:p,totalPages:k,mapping:O}})}isVisible(e,t,i,n){var s=e.position(),a=n||this.bounds();return this.settings.axis==="horizontal"&&s.right>a.left-t&&s.left<a.right+i?!0:this.settings.axis==="vertical"&&s.bottom>a.top-t&&s.top<a.bottom+i}visible(){for(var e=this.bounds(),t=this.views.displayed(),i=t.length,n=[],s,a,o=0;o<i;o++)a=t[o],s=this.isVisible(a,0,0,e),s===!0&&n.push(a);return n}scrollBy(e,t,i){let n=this.settings.direction==="rtl"?-1:1;i&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*n,t*n):(e&&(this.container.scrollLeft+=e*n),t&&(this.container.scrollTop+=t)),this.scrolled=!0}scrollTo(e,t,i){i&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,t):(this.container.scrollLeft=e,this.container.scrollTop=t),this.scrolled=!0}onScroll(){let e,t;this.settings.fullsize?(e=window.scrollY,t=window.scrollX):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:(this.emit(Et.EVENTS.MANAGERS.SCROLL,{top:e,left:t}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit(Et.EVENTS.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),20))}bounds(){var e;return e=this.stage.bounds(),e}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&this.views.length>0&&this.layout.name==="pre-paginated"&&this.display(this.views.first().section)}updateLayout(){!this.stage||(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new nc.default(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(t){t&&t.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){!t&&e===this.settings.axis||(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new nc.default(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&(e==="vertical"?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t="auto"){let i=e==="paginated"||e==="auto";this.isPaginated=i,e==="scrolled-doc"||e==="scrolled-continuous"||e==="scrolled"?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views&&this.views.forEach(function(t){let i=t&&t.contents;i&&e.push(i)}),e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}};(0,Mm.default)(Va.prototype);var Wm=Va;rs.default=Wm});var oc=$(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.default=void 0;var sc=Ie(),ac=Ct(),jm=Vm(Ft());function Vm(r){return r&&r.__esModule?r:{default:r}}var Hm=Math.PI/2,Zm={easeOutSine:function(r){return Math.sin(r*Hm)},easeInOutSine:function(r){return-.5*(Math.cos(Math.PI*r)-1)},easeInOutQuint:function(r){return(r/=.5)<1?.5*Math.pow(r,5):.5*(Math.pow(r-2,5)+2)},easeInCubic:function(r){return Math.pow(r,3)}},Ha=class{constructor(e,t){this.settings=(0,sc.extend)({duration:80,minVelocity:.2,minDistance:10,easing:Zm.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=this.settings.duration*2,this.isVertical=this.manager.settings.axis==="vertical",!(!this.manager.isPaginated||this.isVertical)&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow="hidden"}enableScroll(){this.element.style.overflow=""}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this.on("touchstart",this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.on("touchmove",this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener("touchend",this._onTouchEnd,{passive:!0}),this.on("touchend",this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on(ac.EVENTS.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener("resize",this._onResize),this._onResize=void 0,this.scroller.removeEventListener("scroll",this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener("touchstart",this._onTouchStart,{passive:!0}),this.off("touchstart",this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener("touchmove",this._onTouchMove,{passive:!0}),this.off("touchmove",this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener("touchend",this._onTouchEnd,{passive:!0}),this.off("touchend",this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off(ac.EVENTS.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;["touchstart","touchmove","touchend"].forEach(i=>{t.on(i,n=>this.triggerViewEvent(n,t))})}triggerViewEvent(e,t){this.emit(e.type,e,t)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:t,screenY:i}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=t,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchMove(e){let{screenX:t,screenY:i}=e.touches[0],n=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&n<10&&(this.element.scrollLeft-=t-this.endTouchX),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let t=this.wasSwiped();t!==0?this.snap(t):this.snap(),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,i=Math.abs(t),n=this.endTime-this.startTime,s=t/n,a=this.settings.minVelocity;if(i<=this.settings.minDistance||i>=e)return 0;if(s>a)return-1;if(s<-a)return 1}needsSnap(){let e=this.scrollLeft,t=this.layout.pageWidth*this.layout.divisor;return e%t!=0}snap(e=0){let t=this.scrollLeft,i=this.layout.pageWidth*this.layout.divisor,n=Math.round(t/i)*i;return e&&(n+=e*i),this.smoothScrollTo(n)}smoothScrollTo(e){let t=new sc.defer,i=this.scrollLeft,n=this.now(),s=this.settings.duration,a=this.settings.easing;this.snapping=!0;function o(){let l=this.now(),u=Math.min(1,(l-n)/s),f=a(u);if(this.touchCanceler||this.resizeCanceler){this.resizeCanceler=!1,this.snapping=!1,t.resolve();return}u<1?(window.requestAnimationFrame(o.bind(this)),this.scrollTo(i+(e-i)*u,0)):(this.scrollTo(e,0),this.snapping=!1,t.resolve())}return o.call(this),t.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return"now"in window.performance?performance.now():new Date().getTime()}destroy(){!this.scroller||(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}};(0,jm.default)(Ha.prototype);var Xm=Ha;ss.default=Xm});var Xa=$(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.default=void 0;var yi=Ie(),lc=Za(ns()),uc=Za(oc()),At=Ct(),Ym=Za(ja());function Za(r){return r&&r.__esModule?r:{default:r}}var hc=class extends lc.default{constructor(e){super(e);this.name="continuous",this.settings=(0,yi.extend)(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10,allowScriptedContent:!1,allowPopups:!1}),(0,yi.extend)(this.settings,e.settings||{}),e.settings.gap!="undefined"&&e.settings.gap===0&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,t){return lc.default.prototype.display.call(this,e,t).then(function(){return this.fill()}.bind(this))}fill(e){var t=e||new yi.defer;return this.q.enqueue(()=>this.check()).then(i=>{i?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,i=0,n=0,s=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,n=t+this.settings.offsetDelta):(i=e.top,s=e.top+this.settings.offsetDelta),(t>0||i>0)&&this.scrollBy(t,i,!0)}afterResized(e){this.emit(At.EVENTS.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on(At.EVENTS.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(At.EVENTS.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(At.EVENTS.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on(At.EVENTS.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(At.EVENTS.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(At.EVENTS.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on(At.EVENTS.VIEWS.RESIZED,i=>{this.counter(i),t.expanded=!0}),t.on(At.EVENTS.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(At.EVENTS.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t=this.bounds(),i=this.views.all(),n=i.length,s=[],a=typeof e!="undefined"?e:this.settings.offset||0,o,l,u=new yi.defer,f=[],d=0;d<n;d++)if(l=i[d],o=this.isVisible(l,a,a,t),o===!0){if(l.displayed)l.show();else{let c=l.display(this.request).then(function(v){v.show()},v=>{l.hide()});f.push(c)}s.push(l)}else this.q.enqueue(l.destroy.bind(l)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return f.length?Promise.all(f).catch(c=>{u.reject(c)}):(u.resolve(),u.promise)}check(e,t){var i=new yi.defer,n=[],s=this.settings.axis==="horizontal",a=this.settings.offset||0;e&&s&&(a=e),t&&!s&&(a=t);var o=this._bounds;let l=s?this.scrollLeft:this.scrollTop,u=s?Math.floor(o.width):o.height,f=s?this.container.scrollWidth:this.container.scrollHeight,d=this.writingMode&&this.writingMode.indexOf("vertical")===0?"vertical":"horizontal",c=this.settings.rtlScrollType,v=this.settings.direction==="rtl";this.settings.fullsize?(s&&v&&c==="negative"||!s&&v&&c==="default")&&(l=l*-1):(v&&c==="default"&&d==="horizontal"&&(l=f-u-l),v&&c==="negative"&&d==="horizontal"&&(l=l*-1));let g=()=>{let y=this.views.first(),T=y&&y.section.prev();T&&n.push(this.prepend(T))},O=()=>{let y=this.views.last(),T=y&&y.section.next();T&&n.push(this.append(T))},k=l+u+a,_=l-a;k>=f&&O(),_<0&&g();let p=n.map(y=>y.display(this.request));return n.length?Promise.all(p).then(()=>this.check()).then(()=>this.update(a),y=>y):(this.q.enqueue(function(){this.update()}.bind(this)),i.resolve(!1),i.promise)}trim(){for(var e=new yi.defer,t=this.views.displayed(),i=t[0],n=t[t.length-1],s=this.views.indexOf(i),a=this.views.indexOf(n),o=this.views.slice(0,s),l=this.views.slice(a+1),u=0;u<o.length-1;u++)this.erase(o[u],o);for(var f=1;f<l.length;f++)this.erase(l[f]);return e.resolve(),e.promise}erase(e,t){var i,n;this.settings.fullsize?(i=window.scrollY,n=window.scrollX):(i=this.container.scrollTop,n=this.container.scrollLeft);var s=e.bounds();this.views.remove(e),t&&(this.settings.axis==="vertical"?this.scrollTo(0,i-s.height,!0):this.settings.direction==="rtl"?this.settings.fullsize?this.scrollTo(n+Math.floor(s.width),0,!0):this.scrollTo(n,0,!0):this.scrollTo(n-Math.floor(s.width),0,!0))}addEventListeners(e){window.addEventListener("unload",function(t){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new uc.default(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}addScrollListeners(){var e;this.tick=yi.requestAnimationFrame;let t=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*t,this.scrollLeft=window.scrollX*t):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll),this._scrolled=(0,Ym.default)(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}onScroll(){let e,t,i=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.settings.fullsize?(e=window.scrollY*i,t=window.scrollX*i):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(e-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(t-this.prevScrollLeft),this.prevScrollTop=e,this.prevScrollLeft=t,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue(function(){return this.check()}.bind(this)),this.emit(At.EVENTS.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(At.EVENTS.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),this.settings.afterScrolledTimeout)}next(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;!this.views.length||(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}prev(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;!this.views.length||(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new uc.default(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}},Gm=hc;as.default=Gm});var ls=$(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.default=void 0;var $m=jt(Ft()),qr=Ie(),bi=jt(On()),fc=jt(_t()),Km=jt(In()),Jm=jt(Ia()),Qm=jt(Qh()),Cb=jt(Mr()),e_=jt(uf()),De=Ct(),t_=jt(Ua()),i_=jt(ns()),r_=jt(Xa());function jt(r){return r&&r.__esModule?r:{default:r}}var Ya=class{constructor(e,t){this.settings=(0,qr.extend)(this.settings||{},{width:null,height:null,ignoreClass:"",manager:"default",view:"iframe",flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:"ltr",allowScriptedContent:!1,allowPopups:!1}),(0,qr.extend)(this.settings,t),typeof this.settings.manager=="object"&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new bi.default(this),this.hooks.serialize=new bi.default(this),this.hooks.content=new bi.default(this),this.hooks.unloaded=new bi.default(this),this.hooks.layout=new bi.default(this),this.hooks.render=new bi.default(this),this.hooks.show=new bi.default(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new Qm.default(this),this.annotations=new e_.default(this),this.epubcfi=new fc.default,this.q=new Km.default(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new qr.defer,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){var t;return typeof e=="string"&&e==="default"?t=i_.default:typeof e=="string"&&e==="continuous"?t=r_.default:t=e,t}requireView(e){var t;return typeof e=="string"&&e==="iframe"?t=t_.default:t=e,t}start(){switch(!this.settings.layout&&(this.book.package.metadata.layout==="pre-paginated"||this.book.displayOptions.fixedLayout==="true")&&(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0;break}this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(De.EVENTS.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(De.EVENTS.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(De.EVENTS.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(De.EVENTS.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(De.EVENTS.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(De.EVENTS.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue(function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(De.EVENTS.RENDITION.ATTACHED)}.bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(!!this.book){var t=this.epubcfi.isCfiString(e),i=new qr.defer,n=i.promise,s,a;return this.displaying=i,this.book.locations.length()&&(0,qr.isFloat)(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),s=this.book.spine.get(e),s?(this.manager.display(s,e).then(()=>{i.resolve(s),this.displaying=void 0,this.emit(De.EVENTS.RENDITION.DISPLAYED,s),this.reportLocation()},o=>{this.emit(De.EVENTS.RENDITION.DISPLAY_ERROR,o)}),n):(i.reject(new Error("No Section Found")),n)}}afterDisplayed(e){e.on(De.EVENTS.VIEWS.MARK_CLICKED,(t,i)=>this.triggerMarkEvent(t,i,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(De.EVENTS.RENDITION.RENDERED,e.section,e)}):this.emit(De.EVENTS.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(De.EVENTS.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit(De.EVENTS.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit(De.EVENTS.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,i){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,i)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var t,i=this.settings.layout||e.layout||"reflowable",n=this.settings.spread||e.spread||"auto",s=this.settings.orientation||e.orientation||"auto",a=this.settings.flow||e.flow||"auto",o=e.viewport||"",l=this.settings.minSpreadWidth||e.minSpreadWidth||800,u=this.settings.direction||e.direction||"ltr";return(this.settings.width===0||this.settings.width>0)&&(this.settings.height===0||this.settings.height>0),t={layout:i,spread:n,orientation:s,flow:a,viewport:o,minSpreadWidth:l,direction:u},t}flow(e){var t=e;(e==="scrolled"||e==="scrolled-doc"||e==="scrolled-continuous")&&(t="scrolled"),(e==="auto"||e==="paginated")&&(t="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new Jm.default(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(De.EVENTS.LAYOUT.UPDATED,(t,i)=>{this.emit(De.EVENTS.RENDITION.LAYOUT,t,i)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue(function(){requestAnimationFrame(function(){var i=this.manager.currentLocation();if(i&&i.then&&typeof i.then=="function")i.then(function(n){let s=this.located(n);!s||!s.start||!s.end||(this.location=s,this.emit(De.EVENTS.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(De.EVENTS.RENDITION.RELOCATED,this.location))}.bind(this));else if(i){let n=this.located(i);if(!n||!n.start||!n.end)return;this.location=n,this.emit(De.EVENTS.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(De.EVENTS.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then=="function")e.then(function(t){return this.located(t)}.bind(this));else if(e)return this.located(e)}located(e){if(!e.length)return{};let t=e[0],i=e[e.length-1],n={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},s=this.book.locations.locationFromCfi(t.mapping.start),a=this.book.locations.locationFromCfi(i.mapping.end);s!=null&&(n.start.location=s,n.start.percentage=this.book.locations.percentageFromLocation(s)),a!=null&&(n.end.location=a,n.end.percentage=this.book.locations.percentageFromLocation(a));let o=this.book.pageList.pageFromCfi(t.mapping.start),l=this.book.pageList.pageFromCfi(i.mapping.end);return o!=-1&&(n.start.page=o),l!=-1&&(n.end.page=l),i.index===this.book.spine.last().index&&n.end.displayed.page>=n.end.displayed.total&&(n.atEnd=!0),t.index===this.book.spine.first().index&&n.start.displayed.page===1&&(n.atStart=!0),n}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){De.DOM_EVENTS.forEach(t=>{e.on(t,i=>this.triggerViewEvent(i,e))}),e.on(De.EVENTS.CONTENTS.SELECTED,t=>this.triggerSelectedEvent(t,e))}triggerViewEvent(e,t){this.emit(e.type,e,t)}triggerSelectedEvent(e,t){this.emit(De.EVENTS.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,i){this.emit(De.EVENTS.RENDITION.MARK_CLICKED,e,t,i)}getRange(e,t){var i=new fc.default(e),n=this.manager.visible().filter(function(s){if(i.spinePos===s.index)return!0});if(n.length)return n[0].contents.range(i,t)}adjustImages(e){if(this._layout.name==="pre-paginated")return new Promise(function(s){s()});let t=e.window.getComputedStyle(e.content,null),i=(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)))*.95,n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-n+"px":"100%")+"!important","max-height":i+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-n+"px":"100%")+"!important","max-height":i+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise(function(s,a){setTimeout(function(){s()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on(De.EVENTS.CONTENTS.LINK_CLICKED,t=>{let i=this.book.path.relative(t);this.display(i)})}injectStylesheet(e,t){let i=e.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(i)}injectScript(e,t){let i=e.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",e.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(e,t){let i=this.book.packaging.metadata.identifier,n=e.createElement("meta");n.setAttribute("name","dc.relation.ispartof"),i&&n.setAttribute("content",i),e.getElementsByTagName("head")[0].appendChild(n)}};(0,$m.default)(Ya.prototype);var n_=Ya;os.default=n_});var dc=$((cc,Ga)=>{(function(r){if(typeof cc=="object"&&typeof Ga!="undefined")Ga.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.JSZip=r()}})(function(){var r,e,t;return function i(n,s,a){function o(f,d){if(!s[f]){if(!n[f]){var c=typeof require=="function"&&require;if(!d&&c)return c(f,!0);if(l)return l(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var g=s[f]={exports:{}};n[f][0].call(g.exports,function(O){var k=n[f][1][O];return o(k||O)},g,g.exports,i,n,s,a)}return s[f].exports}for(var l=typeof require=="function"&&require,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(i,n,s){"use strict";var a=i("./utils"),o=i("./support"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(u){for(var f=[],d,c,v,g,O,k,_,p=0,y=u.length,T=y,P=a.getTypeOf(u)!=="string";p<u.length;)T=y-p,P?(d=u[p++],c=p<y?u[p++]:0,v=p<y?u[p++]:0):(d=u.charCodeAt(p++),c=p<y?u.charCodeAt(p++):0,v=p<y?u.charCodeAt(p++):0),g=d>>2,O=(d&3)<<4|c>>4,k=T>1?(c&15)<<2|v>>6:64,_=T>2?v&63:64,f.push(l.charAt(g)+l.charAt(O)+l.charAt(k)+l.charAt(_));return f.join("")},s.decode=function(u){var f,d,c,v,g,O,k,_=0,p=0,y="data:";if(u.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");u=u.replace(/[^A-Za-z0-9\+\/\=]/g,"");var T=u.length*3/4;if(u.charAt(u.length-1)===l.charAt(64)&&T--,u.charAt(u.length-2)===l.charAt(64)&&T--,T%1!=0)throw new Error("Invalid base64 input, bad content length.");var P;for(o.uint8array?P=new Uint8Array(T|0):P=new Array(T|0);_<u.length;)v=l.indexOf(u.charAt(_++)),g=l.indexOf(u.charAt(_++)),O=l.indexOf(u.charAt(_++)),k=l.indexOf(u.charAt(_++)),f=v<<2|g>>4,d=(g&15)<<4|O>>2,c=(O&3)<<6|k,P[p++]=f,O!==64&&(P[p++]=d),k!==64&&(P[p++]=c);return P}},{"./support":30,"./utils":32}],2:[function(i,n,s){"use strict";var a=i("./external"),o=i("./stream/DataWorker"),l=i("./stream/Crc32Probe"),u=i("./stream/DataLengthProbe");function f(d,c,v,g,O){this.compressedSize=d,this.uncompressedSize=c,this.crc32=v,this.compression=g,this.compressedContent=O}f.prototype={getContentWorker:function(){var d=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),c=this;return d.on("end",function(){if(this.streamInfo.data_length!==c.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(d,c,v){return d.pipe(new l).pipe(new u("uncompressedSize")).pipe(c.compressWorker(v)).pipe(new u("compressedSize")).withStreamInfo("compression",c)},n.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,n,s){"use strict";var a=i("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(o){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},s.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,n,s){"use strict";var a=i("./utils");function o(){for(var d,c=[],v=0;v<256;v++){d=v;for(var g=0;g<8;g++)d=d&1?3988292384^d>>>1:d>>>1;c[v]=d}return c}var l=o();function u(d,c,v,g){var O=l,k=g+v;d=d^-1;for(var _=g;_<k;_++)d=d>>>8^O[(d^c[_])&255];return d^-1}function f(d,c,v,g){var O=l,k=g+v;d=d^-1;for(var _=g;_<k;_++)d=d>>>8^O[(d^c.charCodeAt(_))&255];return d^-1}n.exports=function(c,v){if(typeof c=="undefined"||!c.length)return 0;var g=a.getTypeOf(c)!=="string";return g?u(v|0,c,c.length,0):f(v|0,c,c.length,0)}},{"./utils":32}],5:[function(i,n,s){"use strict";s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(i,n,s){"use strict";var a=null;typeof Promise!="undefined"?a=Promise:a=i("lie"),n.exports={Promise:a}},{lie:37}],7:[function(i,n,s){"use strict";var a=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",o=i("pako"),l=i("./utils"),u=i("./stream/GenericWorker"),f=a?"uint8array":"array";s.magic="\b\0";function d(c,v){u.call(this,"FlateWorker/"+c),this._pako=null,this._pakoAction=c,this._pakoOptions=v,this.meta={}}l.inherits(d,u),d.prototype.processChunk=function(c){this.meta=c.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(f,c.data),!1)},d.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var c=this;this._pako.onData=function(v){c.push({data:v,meta:c.meta})}},s.compressWorker=function(c){return new d("Deflate",c)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,n,s){"use strict";var a=i("../utils"),o=i("../stream/GenericWorker"),l=i("../utf8"),u=i("../crc32"),f=i("../signature"),d=function(p,y){var T="",P;for(P=0;P<y;P++)T+=String.fromCharCode(p&255),p=p>>>8;return T},c=function(p,y){var T=p;return p||(T=y?16893:33204),(T&65535)<<16},v=function(p,y){return(p||0)&63},g=function(p,y,T,P,w,N){var C=p.file,M=p.compression,j=N!==l.utf8encode,q=a.transformTo("string",N(C.name)),G=a.transformTo("string",l.utf8encode(C.name)),H=C.comment,re=a.transformTo("string",N(H)),pe=a.transformTo("string",l.utf8encode(H)),ie=G.length!==C.name.length,de=pe.length!==H.length,fe,ae,be="",Re="",Te="",he=C.dir,Ce=C.date,Ee={crc32:0,compressedSize:0,uncompressedSize:0};(!y||T)&&(Ee.crc32=p.crc32,Ee.compressedSize=p.compressedSize,Ee.uncompressedSize=p.uncompressedSize);var Ge=0;y&&(Ge|=8),!j&&(ie||de)&&(Ge|=2048);var je=0,Me=0;he&&(je|=16),w==="UNIX"?(Me=798,je|=c(C.unixPermissions,he)):(Me=20,je|=v(C.dosPermissions,he)),fe=Ce.getUTCHours(),fe=fe<<6,fe=fe|Ce.getUTCMinutes(),fe=fe<<5,fe=fe|Ce.getUTCSeconds()/2,ae=Ce.getUTCFullYear()-1980,ae=ae<<4,ae=ae|Ce.getUTCMonth()+1,ae=ae<<5,ae=ae|Ce.getUTCDate(),ie&&(Re=d(1,1)+d(u(q),4)+G,be+="up"+d(Re.length,2)+Re),de&&(Te=d(1,1)+d(u(re),4)+pe,be+="uc"+d(Te.length,2)+Te);var _e="";_e+=`
\0`,_e+=d(Ge,2),_e+=M.magic,_e+=d(fe,2),_e+=d(ae,2),_e+=d(Ee.crc32,4),_e+=d(Ee.compressedSize,4),_e+=d(Ee.uncompressedSize,4),_e+=d(q.length,2),_e+=d(be.length,2);var Ze=f.LOCAL_FILE_HEADER+_e+q+be,Be=f.CENTRAL_FILE_HEADER+d(Me,2)+_e+d(re.length,2)+"\0\0\0\0"+d(je,4)+d(P,4)+q+be+re;return{fileRecord:Ze,dirRecord:Be}},O=function(p,y,T,P,w){var N="",C=a.transformTo("string",w(P));return N=f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(p,2)+d(p,2)+d(y,4)+d(T,4)+d(C.length,2)+C,N},k=function(p){var y="";return y=f.DATA_DESCRIPTOR+d(p.crc32,4)+d(p.compressedSize,4)+d(p.uncompressedSize,4),y};function _(p,y,T,P){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=T,this.encodeFileName=P,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(_,o),_.prototype.push=function(p){var y=p.meta.percent||0,T=this.entriesCount,P=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,o.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:T?(y+100*(T-P-1))/T:100}}))},_.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var y=this.streamFiles&&!p.file.dir;if(y){var T=g(p,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:T.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(p){this.accumulate=!1;var y=this.streamFiles&&!p.file.dir,T=g(p,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(T.dirRecord),y)this.push({data:k(p),meta:{percent:100}});else for(this.push({data:T.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var p=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var T=this.bytesWritten-p,P=O(this.dirRecords.length,T,p,this.zipComment,this.encodeFileName);this.push({data:P,meta:{percent:100}})},_.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},_.prototype.registerPrevious=function(p){this._sources.push(p);var y=this;return p.on("data",function(T){y.processChunk(T)}),p.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),p.on("error",function(T){y.error(T)}),this},_.prototype.resume=function(){if(!o.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},_.prototype.error=function(p){var y=this._sources;if(!o.prototype.error.call(this,p))return!1;for(var T=0;T<y.length;T++)try{y[T].error(p)}catch(P){}return!0},_.prototype.lock=function(){o.prototype.lock.call(this);for(var p=this._sources,y=0;y<p.length;y++)p[y].lock()},n.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,n,s){"use strict";var a=i("../compressions"),o=i("./ZipFileWorker"),l=function(u,f){var d=u||f,c=a[d];if(!c)throw new Error(d+" is not a valid compression method !");return c};s.generateWorker=function(u,f,d){var c=new o(f.streamFiles,d,f.platform,f.encodeFileName),v=0;try{u.forEach(function(g,O){v++;var k=l(O.options.compression,f.compression),_=O.options.compressionOptions||f.compressionOptions||{},p=O.dir,y=O.date;O._compressWorker(k,_).withStreamInfo("file",{name:g,dir:p,date:y,comment:O.comment||"",unixPermissions:O.unixPermissions,dosPermissions:O.dosPermissions}).pipe(c)}),c.entriesCount=v}catch(g){c.error(g)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,n,s){"use strict";function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new a;for(var l in this)typeof this[l]!="function"&&(o[l]=this[l]);return o}}a.prototype=i("./object"),a.prototype.loadAsync=i("./load"),a.support=i("./support"),a.defaults=i("./defaults"),a.version="3.9.1",a.loadAsync=function(o,l){return new a().loadAsync(o,l)},a.external=i("./external"),n.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,n,s){"use strict";var a=i("./utils"),o=i("./external"),l=i("./utf8"),u=i("./zipEntries"),f=i("./stream/Crc32Probe"),d=i("./nodejsUtils");function c(v){return new o.Promise(function(g,O){var k=v.decompressed.getContentWorker().pipe(new f);k.on("error",function(_){O(_)}).on("end",function(){k.streamInfo.crc32!==v.decompressed.crc32?O(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}n.exports=function(v,g){var O=this;return g=a.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:l.utf8decode}),d.isNode&&d.isStream(v)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",v,!0,g.optimizedBinaryString,g.base64).then(function(k){var _=new u(g);return _.load(k),_}).then(function(_){var p=[o.Promise.resolve(_)],y=_.files;if(g.checkCRC32)for(var T=0;T<y.length;T++)p.push(c(y[T]));return o.Promise.all(p)}).then(function(_){for(var p=_.shift(),y=p.files,T=0;T<y.length;T++){var P=y[T],w=P.fileNameStr,N=a.resolve(P.fileNameStr);O.file(N,P.decompressed,{binary:!0,optimizedBinaryString:!0,date:P.date,dir:P.dir,comment:P.fileCommentStr.length?P.fileCommentStr:null,unixPermissions:P.unixPermissions,dosPermissions:P.dosPermissions,createFolders:g.createFolders}),P.dir||(O.file(N).unsafeOriginalName=w)}return p.zipComment.length&&(O.comment=p.zipComment),O})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,n,s){"use strict";var a=i("../utils"),o=i("../stream/GenericWorker");function l(u,f){o.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(f)}a.inherits(l,o),l.prototype._bindStream=function(u){var f=this;this._stream=u,u.pause(),u.on("data",function(d){f.push({data:d,meta:{percent:0}})}).on("error",function(d){f.isPaused?this.generatedError=d:f.error(d)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},l.prototype.pause=function(){return o.prototype.pause.call(this)?(this._stream.pause(),!0):!1},l.prototype.resume=function(){return o.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},n.exports=l},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,n,s){"use strict";var a=i("readable-stream").Readable,o=i("../utils");o.inherits(l,a);function l(u,f,d){a.call(this,f),this._helper=u;var c=this;u.on("data",function(v,g){c.push(v)||c._helper.pause(),d&&d(g)}).on("error",function(v){c.emit("error",v)}).on("end",function(){c.push(null)})}l.prototype._read=function(){this._helper.resume()},n.exports=l},{"../utils":32,"readable-stream":16}],14:[function(i,n,s){"use strict";n.exports={isNode:typeof Buffer!="undefined",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(i,n,s){"use strict";var a=i("./utf8"),o=i("./utils"),l=i("./stream/GenericWorker"),u=i("./stream/StreamHelper"),f=i("./defaults"),d=i("./compressedObject"),c=i("./zipObject"),v=i("./generate"),g=i("./nodejsUtils"),O=i("./nodejs/NodejsStreamInputAdapter"),k=function(w,N,C){var M=o.getTypeOf(N),j,q=o.extend(C||{},f);q.date=q.date||new Date,q.compression!==null&&(q.compression=q.compression.toUpperCase()),typeof q.unixPermissions=="string"&&(q.unixPermissions=parseInt(q.unixPermissions,8)),q.unixPermissions&&q.unixPermissions&16384&&(q.dir=!0),q.dosPermissions&&q.dosPermissions&16&&(q.dir=!0),q.dir&&(w=p(w)),q.createFolders&&(j=_(w))&&y.call(this,j,!0);var G=M==="string"&&q.binary===!1&&q.base64===!1;(!C||typeof C.binary=="undefined")&&(q.binary=!G);var H=N instanceof d&&N.uncompressedSize===0;(H||q.dir||!N||N.length===0)&&(q.base64=!1,q.binary=!0,N="",q.compression="STORE",M="string");var re=null;N instanceof d||N instanceof l?re=N:g.isNode&&g.isStream(N)?re=new O(w,N):re=o.prepareContent(w,N,q.binary,q.optimizedBinaryString,q.base64);var pe=new c(w,re,q);this.files[w]=pe},_=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var N=w.lastIndexOf("/");return N>0?w.substring(0,N):""},p=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},y=function(w,N){return N=typeof N!="undefined"?N:f.createFolders,w=p(w),this.files[w]||k.call(this,w,null,{dir:!0,createFolders:N}),this.files[w]};function T(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var P={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var N,C,M;for(N in this.files)M=this.files[N],C=N.slice(this.root.length,N.length),C&&N.slice(0,this.root.length)===this.root&&w(C,M)},filter:function(w){var N=[];return this.forEach(function(C,M){w(C,M)&&N.push(M)}),N},file:function(w,N,C){if(arguments.length===1)if(T(w)){var M=w;return this.filter(function(q,G){return!G.dir&&M.test(q)})}else{var j=this.files[this.root+w];return j&&!j.dir?j:null}else w=this.root+w,k.call(this,w,N,C);return this},folder:function(w){if(!w)return this;if(T(w))return this.filter(function(j,q){return q.dir&&w.test(j)});var N=this.root+w,C=y.call(this,N),M=this.clone();return M.root=C.name,M},remove:function(w){w=this.root+w;var N=this.files[w];if(N||(w.slice(-1)!=="/"&&(w+="/"),N=this.files[w]),N&&!N.dir)delete this.files[w];else for(var C=this.filter(function(j,q){return q.name.slice(0,w.length)===w}),M=0;M<C.length;M++)delete this.files[C[M].name];return this},generate:function(w){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var N,C={};try{if(C=o.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode}),C.type=C.type.toLowerCase(),C.compression=C.compression.toUpperCase(),C.type==="binarystring"&&(C.type="string"),!C.type)throw new Error("No output type specified.");o.checkSupport(C.type),(C.platform==="darwin"||C.platform==="freebsd"||C.platform==="linux"||C.platform==="sunos")&&(C.platform="UNIX"),C.platform==="win32"&&(C.platform="DOS");var M=C.comment||this.comment||"";N=v.generateWorker(this,C,M)}catch(j){N=new l("error"),N.error(j)}return new u(N,C.type||"string",C.mimeType)},generateAsync:function(w,N){return this.generateInternalStream(w).accumulate(N)},generateNodeStream:function(w,N){return w=w||{},w.type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(N)}};n.exports=P},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,n,s){n.exports=i("stream")},{stream:void 0}],17:[function(i,n,s){"use strict";var a=i("./DataReader"),o=i("../utils");function l(u){a.call(this,u);for(var f=0;f<this.data.length;f++)u[f]=u[f]&255}o.inherits(l,a),l.prototype.byteAt=function(u){return this.data[this.zero+u]},l.prototype.lastIndexOfSignature=function(u){for(var f=u.charCodeAt(0),d=u.charCodeAt(1),c=u.charCodeAt(2),v=u.charCodeAt(3),g=this.length-4;g>=0;--g)if(this.data[g]===f&&this.data[g+1]===d&&this.data[g+2]===c&&this.data[g+3]===v)return g-this.zero;return-1},l.prototype.readAndCheckSignature=function(u){var f=u.charCodeAt(0),d=u.charCodeAt(1),c=u.charCodeAt(2),v=u.charCodeAt(3),g=this.readData(4);return f===g[0]&&d===g[1]&&c===g[2]&&v===g[3]},l.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var f=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,f},n.exports=l},{"../utils":32,"./DataReader":18}],18:[function(i,n,s){"use strict";var a=i("../utils");function o(l){this.data=l,this.length=l.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(l){this.checkIndex(this.index+l)},checkIndex:function(l){if(this.length<this.zero+l||l<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+l+"). Corrupted zip ?")},setIndex:function(l){this.checkIndex(l),this.index=l},skip:function(l){this.setIndex(this.index+l)},byteAt:function(l){},readInt:function(l){var u=0,f;for(this.checkOffset(l),f=this.index+l-1;f>=this.index;f--)u=(u<<8)+this.byteAt(f);return this.index+=l,u},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(l){},lastIndexOfSignature:function(l){},readAndCheckSignature:function(l){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC((l>>25&127)+1980,(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(l&31)<<1))}},n.exports=o},{"../utils":32}],19:[function(i,n,s){"use strict";var a=i("./Uint8ArrayReader"),o=i("../utils");function l(u){a.call(this,u)}o.inherits(l,a),l.prototype.readData=function(u){this.checkOffset(u);var f=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,f},n.exports=l},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,n,s){"use strict";var a=i("./DataReader"),o=i("../utils");function l(u){a.call(this,u)}o.inherits(l,a),l.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},l.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},l.prototype.readAndCheckSignature=function(u){var f=this.readData(4);return u===f},l.prototype.readData=function(u){this.checkOffset(u);var f=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,f},n.exports=l},{"../utils":32,"./DataReader":18}],21:[function(i,n,s){"use strict";var a=i("./ArrayReader"),o=i("../utils");function l(u){a.call(this,u)}o.inherits(l,a),l.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var f=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,f},n.exports=l},{"../utils":32,"./ArrayReader":17}],22:[function(i,n,s){"use strict";var a=i("../utils"),o=i("../support"),l=i("./ArrayReader"),u=i("./StringReader"),f=i("./NodeBufferReader"),d=i("./Uint8ArrayReader");n.exports=function(c){var v=a.getTypeOf(c);return a.checkSupport(v),v==="string"&&!o.uint8array?new u(c):v==="nodebuffer"?new f(c):o.uint8array?new d(a.transformTo("uint8array",c)):new l(a.transformTo("array",c))}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,n,s){"use strict";s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,n,s){"use strict";var a=i("./GenericWorker"),o=i("../utils");function l(u){a.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(l,a),l.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(i,n,s){"use strict";var a=i("./GenericWorker"),o=i("../crc32"),l=i("../utils");function u(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}l.inherits(u,a),u.prototype.processChunk=function(f){this.streamInfo.crc32=o(f.data,this.streamInfo.crc32||0),this.push(f)},n.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,n,s){"use strict";var a=i("../utils"),o=i("./GenericWorker");function l(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}a.inherits(l,o),l.prototype.processChunk=function(u){if(u){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+u.data.length}o.prototype.processChunk.call(this,u)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(i,n,s){"use strict";var a=i("../utils"),o=i("./GenericWorker"),l=16*1024;function u(f){o.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,f.then(function(c){d.dataIsReady=!0,d.data=c,d.max=c&&c.length||0,d.type=a.getTypeOf(c),d.isPaused||d._tickAndRepeat()},function(c){d.error(c)})}a.inherits(u,o),u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return o.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0):!1},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var f=l,d=null,c=Math.min(this.max,this.index+f);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,c);break;case"uint8array":d=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":d=this.data.slice(this.index,c);break}return this.index=c,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(i,n,s){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return this.isFinished?!1:(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var u=0;u<this._listeners[o].length;u++)this._listeners[o][u].call(this,l)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var l=this;return o.on("data",function(u){l.processChunk(u)}),o.on("end",function(){l.end()}),o.on("error",function(u){l.error(u)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var o=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,l){return this.extraStreamInfo[o]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)!this.extraStreamInfo.hasOwnProperty(o)||(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},n.exports=a},{}],29:[function(i,n,s){"use strict";var a=i("../utils"),o=i("./ConvertWorker"),l=i("./GenericWorker"),u=i("../base64"),f=i("../support"),d=i("../external"),c=null;if(f.nodestream)try{c=i("../nodejs/NodejsStreamOutputAdapter")}catch(_){}function v(_,p,y){switch(_){case"blob":return a.newBlob(a.transformTo("arraybuffer",p),y);case"base64":return u.encode(p);default:return a.transformTo(_,p)}}function g(_,p){var y,T=0,P=null,w=0;for(y=0;y<p.length;y++)w+=p[y].length;switch(_){case"string":return p.join("");case"array":return Array.prototype.concat.apply([],p);case"uint8array":for(P=new Uint8Array(w),y=0;y<p.length;y++)P.set(p[y],T),T+=p[y].length;return P;case"nodebuffer":return Buffer.concat(p);default:throw new Error("concat : unsupported type '"+_+"'")}}function O(_,p){return new d.Promise(function(y,T){var P=[],w=_._internalType,N=_._outputType,C=_._mimeType;_.on("data",function(M,j){P.push(M),p&&p(j)}).on("error",function(M){P=[],T(M)}).on("end",function(){try{var M=v(N,g(w,P),C);y(M)}catch(j){T(j)}P=[]}).resume()})}function k(_,p,y){var T=p;switch(p){case"blob":case"arraybuffer":T="uint8array";break;case"base64":T="string";break}try{this._internalType=T,this._outputType=p,this._mimeType=y,a.checkSupport(T),this._worker=_.pipe(new o(T)),_.lock()}catch(P){this._worker=new l("error"),this._worker.error(P)}}k.prototype={accumulate:function(_){return O(this,_)},on:function(_,p){var y=this;return _==="data"?this._worker.on(_,function(T){p.call(y,T.data,T.meta)}):this._worker.on(_,function(){a.delay(p,arguments,y)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:this._outputType!=="nodebuffer"},_)}},n.exports=k},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,n,s){"use strict";if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",s.nodebuffer=typeof Buffer!="undefined",s.uint8array=typeof Uint8Array!="undefined",typeof ArrayBuffer=="undefined")s.blob=!1;else{var a=new ArrayBuffer(0);try{s.blob=new Blob([a],{type:"application/zip"}).size===0}catch(u){try{var o=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,l=new o;l.append(a),s.blob=l.getBlob("application/zip").size===0}catch(f){s.blob=!1}}}try{s.nodestream=!!i("readable-stream").Readable}catch(u){s.nodestream=!1}},{"readable-stream":16}],31:[function(i,n,s){"use strict";for(var a=i("./utils"),o=i("./support"),l=i("./nodejsUtils"),u=i("./stream/GenericWorker"),f=new Array(256),d=0;d<256;d++)f[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;f[254]=f[254]=1;var c=function(_){var p,y,T,P,w,N=_.length,C=0;for(P=0;P<N;P++)y=_.charCodeAt(P),(y&64512)==55296&&P+1<N&&(T=_.charCodeAt(P+1),(T&64512)==56320&&(y=65536+(y-55296<<10)+(T-56320),P++)),C+=y<128?1:y<2048?2:y<65536?3:4;for(o.uint8array?p=new Uint8Array(C):p=new Array(C),w=0,P=0;w<C;P++)y=_.charCodeAt(P),(y&64512)==55296&&P+1<N&&(T=_.charCodeAt(P+1),(T&64512)==56320&&(y=65536+(y-55296<<10)+(T-56320),P++)),y<128?p[w++]=y:y<2048?(p[w++]=192|y>>>6,p[w++]=128|y&63):y<65536?(p[w++]=224|y>>>12,p[w++]=128|y>>>6&63,p[w++]=128|y&63):(p[w++]=240|y>>>18,p[w++]=128|y>>>12&63,p[w++]=128|y>>>6&63,p[w++]=128|y&63);return p},v=function(_,p){var y;for(p=p||_.length,p>_.length&&(p=_.length),y=p-1;y>=0&&(_[y]&192)==128;)y--;return y<0||y===0?p:y+f[_[y]]>p?y:p},g=function(_){var p,y,T,P,w,N=_.length,C=new Array(N*2);for(T=0,y=0;y<N;){if(P=_[y++],P<128){C[T++]=P;continue}if(w=f[P],w>4){C[T++]=65533,y+=w-1;continue}for(P&=w===2?31:w===3?15:7;w>1&&y<N;)P=P<<6|_[y++]&63,w--;if(w>1){C[T++]=65533;continue}P<65536?C[T++]=P:(P-=65536,C[T++]=55296|P>>10&1023,C[T++]=56320|P&1023)}return C.length!==T&&(C.subarray?C=C.subarray(0,T):C.length=T),a.applyFromCharCode(C)};s.utf8encode=function(p){return o.nodebuffer?l.newBufferFrom(p,"utf-8"):c(p)},s.utf8decode=function(p){return o.nodebuffer?a.transformTo("nodebuffer",p).toString("utf-8"):(p=a.transformTo(o.uint8array?"uint8array":"array",p),g(p))};function O(){u.call(this,"utf-8 decode"),this.leftOver=null}a.inherits(O,u),O.prototype.processChunk=function(_){var p=a.transformTo(o.uint8array?"uint8array":"array",_.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var y=p;p=new Uint8Array(y.length+this.leftOver.length),p.set(this.leftOver,0),p.set(y,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var T=v(p),P=p;T!==p.length&&(o.uint8array?(P=p.subarray(0,T),this.leftOver=p.subarray(T,p.length)):(P=p.slice(0,T),this.leftOver=p.slice(T,p.length))),this.push({data:s.utf8decode(P),meta:_.meta})},O.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=O;function k(){u.call(this,"utf-8 encode")}a.inherits(k,u),k.prototype.processChunk=function(_){this.push({data:s.utf8encode(_.data),meta:_.meta})},s.Utf8EncodeWorker=k},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,n,s){"use strict";var a=i("./support"),o=i("./base64"),l=i("./nodejsUtils"),u=i("set-immediate-shim"),f=i("./external");function d(p){var y=null;return a.uint8array?y=new Uint8Array(p.length):y=new Array(p.length),v(p,y)}s.newBlob=function(p,y){s.checkSupport("blob");try{return new Blob([p],{type:y})}catch(w){try{var T=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,P=new T;return P.append(p),P.getBlob(y)}catch(N){throw new Error("Bug : can't construct the Blob.")}}};function c(p){return p}function v(p,y){for(var T=0;T<p.length;++T)y[T]=p.charCodeAt(T)&255;return y}var g={stringifyByChunk:function(p,y,T){var P=[],w=0,N=p.length;if(N<=T)return String.fromCharCode.apply(null,p);for(;w<N;)y==="array"||y==="nodebuffer"?P.push(String.fromCharCode.apply(null,p.slice(w,Math.min(w+T,N)))):P.push(String.fromCharCode.apply(null,p.subarray(w,Math.min(w+T,N)))),w+=T;return P.join("")},stringifyByChar:function(p){for(var y="",T=0;T<p.length;T++)y+=String.fromCharCode(p[T]);return y},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch(p){return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,l.allocBuffer(1)).length===1}catch(p){return!1}}()}};function O(p){var y=65536,T=s.getTypeOf(p),P=!0;if(T==="uint8array"?P=g.applyCanBeUsed.uint8array:T==="nodebuffer"&&(P=g.applyCanBeUsed.nodebuffer),P)for(;y>1;)try{return g.stringifyByChunk(p,T,y)}catch(w){y=Math.floor(y/2)}return g.stringifyByChar(p)}s.applyFromCharCode=O;function k(p,y){for(var T=0;T<p.length;T++)y[T]=p[T];return y}var _={};_.string={string:c,array:function(p){return v(p,new Array(p.length))},arraybuffer:function(p){return _.string.uint8array(p).buffer},uint8array:function(p){return v(p,new Uint8Array(p.length))},nodebuffer:function(p){return v(p,l.allocBuffer(p.length))}},_.array={string:O,array:c,arraybuffer:function(p){return new Uint8Array(p).buffer},uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return l.newBufferFrom(p)}},_.arraybuffer={string:function(p){return O(new Uint8Array(p))},array:function(p){return k(new Uint8Array(p),new Array(p.byteLength))},arraybuffer:c,uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return l.newBufferFrom(new Uint8Array(p))}},_.uint8array={string:O,array:function(p){return k(p,new Array(p.length))},arraybuffer:function(p){return p.buffer},uint8array:c,nodebuffer:function(p){return l.newBufferFrom(p)}},_.nodebuffer={string:O,array:function(p){return k(p,new Array(p.length))},arraybuffer:function(p){return _.nodebuffer.uint8array(p).buffer},uint8array:function(p){return k(p,new Uint8Array(p.length))},nodebuffer:c},s.transformTo=function(p,y){if(y||(y=""),!p)return y;s.checkSupport(p);var T=s.getTypeOf(y),P=_[T][p](y);return P},s.resolve=function(p){for(var y=p.split("/"),T=[],P=0;P<y.length;P++){var w=y[P];w==="."||w===""&&P!==0&&P!==y.length-1||(w===".."?T.pop():T.push(w))}return T.join("/")},s.getTypeOf=function(p){if(typeof p=="string")return"string";if(Object.prototype.toString.call(p)==="[object Array]")return"array";if(a.nodebuffer&&l.isBuffer(p))return"nodebuffer";if(a.uint8array&&p instanceof Uint8Array)return"uint8array";if(a.arraybuffer&&p instanceof ArrayBuffer)return"arraybuffer"},s.checkSupport=function(p){var y=a[p.toLowerCase()];if(!y)throw new Error(p+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(p){var y="",T,P;for(P=0;P<(p||"").length;P++)T=p.charCodeAt(P),y+="\\x"+(T<16?"0":"")+T.toString(16).toUpperCase();return y},s.delay=function(p,y,T){u(function(){p.apply(T||null,y||[])})},s.inherits=function(p,y){var T=function(){};T.prototype=y.prototype,p.prototype=new T},s.extend=function(){var p={},y,T;for(y=0;y<arguments.length;y++)for(T in arguments[y])arguments[y].hasOwnProperty(T)&&typeof p[T]=="undefined"&&(p[T]=arguments[y][T]);return p},s.prepareContent=function(p,y,T,P,w){var N=f.Promise.resolve(y).then(function(C){var M=a.blob&&(C instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(C))!==-1);return M&&typeof FileReader!="undefined"?new f.Promise(function(j,q){var G=new FileReader;G.onload=function(H){j(H.target.result)},G.onerror=function(H){q(H.target.error)},G.readAsArrayBuffer(C)}):C});return N.then(function(C){var M=s.getTypeOf(C);return M?(M==="arraybuffer"?C=s.transformTo("uint8array",C):M==="string"&&(w?C=o.decode(C):T&&P!==!0&&(C=d(C))),C):f.Promise.reject(new Error("Can't read the data of '"+p+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(i,n,s){"use strict";var a=i("./reader/readerFor"),o=i("./utils"),l=i("./signature"),u=i("./zipEntry"),f=i("./utf8"),d=i("./support");function c(v){this.files=[],this.loadOptions=v}c.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var g=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(g)+", expected "+o.pretty(v)+")")}},isSignature:function(v,g){var O=this.reader.index;this.reader.setIndex(v);var k=this.reader.readString(4),_=k===g;return this.reader.setIndex(O),_},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var v=this.reader.readData(this.zipCommentLength),g=d.uint8array?"uint8array":"array",O=o.transformTo(g,v);this.zipComment=this.loadOptions.decodeFileName(O)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var v=this.zip64EndOfCentralSize-44,g=0,O,k,_;g<v;)O=this.reader.readInt(2),k=this.reader.readInt(4),_=this.reader.readData(k),this.zip64ExtensibleData[O]={id:O,length:k,value:_}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,g;for(v=0;v<this.files.length;v++)g=this.files[v],this.reader.setIndex(g.localHeaderOffset),this.checkSignature(l.LOCAL_FILE_HEADER),g.readLocalPart(this.reader),g.handleUTF8(),g.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(l.CENTRAL_FILE_HEADER);)v=new u({zip64:this.zip64},this.loadOptions),v.readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(l.CENTRAL_DIRECTORY_END);if(v<0){var g=!this.isSignature(0,l.LOCAL_FILE_HEADER);throw g?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(v);var O=v;if(this.checkSignature(l.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,v=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),v<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,l.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var k=this.centralDirOffset+this.centralDirSize;this.zip64&&(k+=20,k+=12+this.zip64EndOfCentralSize);var _=O-k;if(_>0)this.isSignature(O,l.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(v){this.reader=a(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(i,n,s){"use strict";var a=i("./reader/readerFor"),o=i("./utils"),l=i("./compressedObject"),u=i("./crc32"),f=i("./utf8"),d=i("./compressions"),c=i("./support"),v=0,g=3,O=function(_){for(var p in d)if(!!d.hasOwnProperty(p)&&d[p].magic===_)return d[p];return null};function k(_,p){this.options=_,this.loadOptions=p}k.prototype={isEncrypted:function(){return(this.bitFlag&1)==1},useUTF8:function(){return(this.bitFlag&2048)==2048},readLocalPart:function(_){var p,y;if(_.skip(22),this.fileNameLength=_.readInt(2),y=_.readInt(2),this.fileName=_.readData(this.fileNameLength),_.skip(y),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(p=O(this.compressionMethod),p===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new l(this.compressedSize,this.uncompressedSize,this.crc32,p,_.readData(this.compressedSize))},readCentralPart:function(_){this.versionMadeBy=_.readInt(2),_.skip(2),this.bitFlag=_.readInt(2),this.compressionMethod=_.readString(2),this.date=_.readDate(),this.crc32=_.readInt(4),this.compressedSize=_.readInt(4),this.uncompressedSize=_.readInt(4);var p=_.readInt(2);if(this.extraFieldsLength=_.readInt(2),this.fileCommentLength=_.readInt(2),this.diskNumberStart=_.readInt(2),this.internalFileAttributes=_.readInt(2),this.externalFileAttributes=_.readInt(4),this.localHeaderOffset=_.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");_.skip(p),this.readExtraFields(_),this.parseZIP64ExtraField(_),this.fileComment=_.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var _=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),_===v&&(this.dosPermissions=this.externalFileAttributes&63),_===g&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(_){if(!!this.extraFields[1]){var p=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(_){var p=_.index+this.extraFieldsLength,y,T,P;for(this.extraFields||(this.extraFields={});_.index+4<p;)y=_.readInt(2),T=_.readInt(2),P=_.readData(T),this.extraFields[y]={id:y,length:T,value:P};_.setIndex(p)},handleUTF8:function(){var _=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var y=o.transformTo(_,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(y)}var T=this.findExtraFieldUnicodeComment();if(T!==null)this.fileCommentStr=T;else{var P=o.transformTo(_,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(P)}}},findExtraFieldUnicodePath:function(){var _=this.extraFields[28789];if(_){var p=a(_.value);return p.readInt(1)!==1||u(this.fileName)!==p.readInt(4)?null:f.utf8decode(p.readData(_.length-5))}return null},findExtraFieldUnicodeComment:function(){var _=this.extraFields[25461];if(_){var p=a(_.value);return p.readInt(1)!==1||u(this.fileComment)!==p.readInt(4)?null:f.utf8decode(p.readData(_.length-5))}return null}},n.exports=k},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,n,s){"use strict";var a=i("./stream/StreamHelper"),o=i("./stream/DataWorker"),l=i("./utf8"),u=i("./compressedObject"),f=i("./stream/GenericWorker"),d=function(O,k,_){this.name=O,this.dir=_.dir,this.date=_.date,this.comment=_.comment,this.unixPermissions=_.unixPermissions,this.dosPermissions=_.dosPermissions,this._data=k,this._dataBinary=_.binary,this.options={compression:_.compression,compressionOptions:_.compressionOptions}};d.prototype={internalStream:function(O){var k=null,_="string";try{if(!O)throw new Error("No output type specified.");_=O.toLowerCase();var p=_==="string"||_==="text";(_==="binarystring"||_==="text")&&(_="string"),k=this._decompressWorker();var y=!this._dataBinary;y&&!p&&(k=k.pipe(new l.Utf8EncodeWorker)),!y&&p&&(k=k.pipe(new l.Utf8DecodeWorker))}catch(T){k=new f("error"),k.error(T)}return new a(k,_,"")},async:function(O,k){return this.internalStream(O).accumulate(k)},nodeStream:function(O,k){return this.internalStream(O||"nodebuffer").toNodejsStream(k)},_compressWorker:function(O,k){if(this._data instanceof u&&this._data.compression.magic===O.magic)return this._data.getCompressedWorker();var _=this._decompressWorker();return this._dataBinary||(_=_.pipe(new l.Utf8EncodeWorker)),u.createWorkerFrom(_,O,k)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof f?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<c.length;g++)d.prototype[c[g]]=v;n.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,n,s){(function(a){"use strict";var o=a.MutationObserver||a.WebKitMutationObserver,l;if(o){var u=0,f=new o(O),d=a.document.createTextNode("");f.observe(d,{characterData:!0}),l=function(){d.data=u=++u%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var c=new a.MessageChannel;c.port1.onmessage=O,l=function(){c.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=function(){var _=a.document.createElement("script");_.onreadystatechange=function(){O(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},a.document.documentElement.appendChild(_)}:l=function(){setTimeout(O,0)};var v,g=[];function O(){v=!0;for(var _,p,y=g.length;y;){for(p=g,g=[],_=-1;++_<y;)p[_]();y=g.length}v=!1}n.exports=k;function k(_){g.push(_)===1&&!v&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],37:[function(i,n,s){"use strict";var a=i("immediate");function o(){}var l={},u=["REJECTED"],f=["FULFILLED"],d=["PENDING"];n.exports=c;function c(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,w!==o&&k(this,w)}c.prototype.finally=function(w){if(typeof w!="function")return this;var N=this.constructor;return this.then(C,M);function C(j){function q(){return j}return N.resolve(w()).then(q)}function M(j){function q(){throw j}return N.resolve(w()).then(q)}},c.prototype.catch=function(w){return this.then(null,w)},c.prototype.then=function(w,N){if(typeof w!="function"&&this.state===f||typeof N!="function"&&this.state===u)return this;var C=new this.constructor(o);if(this.state!==d){var M=this.state===f?w:N;g(C,M,this.outcome)}else this.queue.push(new v(C,w,N));return C};function v(w,N,C){this.promise=w,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(w){l.resolve(this.promise,w)},v.prototype.otherCallFulfilled=function(w){g(this.promise,this.onFulfilled,w)},v.prototype.callRejected=function(w){l.reject(this.promise,w)},v.prototype.otherCallRejected=function(w){g(this.promise,this.onRejected,w)};function g(w,N,C){a(function(){var M;try{M=N(C)}catch(j){return l.reject(w,j)}M===w?l.reject(w,new TypeError("Cannot resolve promise with itself")):l.resolve(w,M)})}l.resolve=function(w,N){var C=_(O,N);if(C.status==="error")return l.reject(w,C.value);var M=C.value;if(M)k(w,M);else{w.state=f,w.outcome=N;for(var j=-1,q=w.queue.length;++j<q;)w.queue[j].callFulfilled(N)}return w},l.reject=function(w,N){w.state=u,w.outcome=N;for(var C=-1,M=w.queue.length;++C<M;)w.queue[C].callRejected(N);return w};function O(w){var N=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof N=="function")return function(){N.apply(w,arguments)}}function k(w,N){var C=!1;function M(H){C||(C=!0,l.reject(w,H))}function j(H){C||(C=!0,l.resolve(w,H))}function q(){N(j,M)}var G=_(q);G.status==="error"&&M(G.value)}function _(w,N){var C={};try{C.value=w(N),C.status="success"}catch(M){C.status="error",C.value=M}return C}c.resolve=p;function p(w){return w instanceof this?w:l.resolve(new this(o),w)}c.reject=y;function y(w){var N=new this(o);return l.reject(N,w)}c.all=T;function T(w){var N=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=w.length,M=!1;if(!C)return this.resolve([]);for(var j=new Array(C),q=0,G=-1,H=new this(o);++G<C;)re(w[G],G);return H;function re(pe,ie){N.resolve(pe).then(de,function(fe){M||(M=!0,l.reject(H,fe))});function de(fe){j[ie]=fe,++q===C&&!M&&(M=!0,l.resolve(H,j))}}}c.race=P;function P(w){var N=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=w.length,M=!1;if(!C)return this.resolve([]);for(var j=-1,q=new this(o);++j<C;)G(w[j]);return q;function G(H){N.resolve(H).then(function(re){M||(M=!0,l.resolve(q,re))},function(re){M||(M=!0,l.reject(q,re))})}}},{immediate:36}],38:[function(i,n,s){"use strict";var a=i("./lib/utils/common").assign,o=i("./lib/deflate"),l=i("./lib/inflate"),u=i("./lib/zlib/constants"),f={};a(f,o,l,u),n.exports=f},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,n,s){"use strict";var a=i("./zlib/deflate"),o=i("./utils/common"),l=i("./utils/strings"),u=i("./zlib/messages"),f=i("./zlib/zstream"),d=Object.prototype.toString,c=0,v=4,g=0,O=1,k=2,_=-1,p=0,y=8;function T(C){if(!(this instanceof T))return new T(C);this.options=o.assign({level:_,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},C||{});var M=this.options;M.raw&&M.windowBits>0?M.windowBits=-M.windowBits:M.gzip&&M.windowBits>0&&M.windowBits<16&&(M.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var j=a.deflateInit2(this.strm,M.level,M.method,M.windowBits,M.memLevel,M.strategy);if(j!==g)throw new Error(u[j]);if(M.header&&a.deflateSetHeader(this.strm,M.header),M.dictionary){var q;if(typeof M.dictionary=="string"?q=l.string2buf(M.dictionary):d.call(M.dictionary)==="[object ArrayBuffer]"?q=new Uint8Array(M.dictionary):q=M.dictionary,j=a.deflateSetDictionary(this.strm,q),j!==g)throw new Error(u[j]);this._dict_set=!0}}T.prototype.push=function(C,M){var j=this.strm,q=this.options.chunkSize,G,H;if(this.ended)return!1;H=M===~~M?M:M===!0?v:c,typeof C=="string"?j.input=l.string2buf(C):d.call(C)==="[object ArrayBuffer]"?j.input=new Uint8Array(C):j.input=C,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new o.Buf8(q),j.next_out=0,j.avail_out=q),G=a.deflate(j,H),G!==O&&G!==g)return this.onEnd(G),this.ended=!0,!1;(j.avail_out===0||j.avail_in===0&&(H===v||H===k))&&(this.options.to==="string"?this.onData(l.buf2binstring(o.shrinkBuf(j.output,j.next_out))):this.onData(o.shrinkBuf(j.output,j.next_out)))}while((j.avail_in>0||j.avail_out===0)&&G!==O);return H===v?(G=a.deflateEnd(this.strm),this.onEnd(G),this.ended=!0,G===g):(H===k&&(this.onEnd(g),j.avail_out=0),!0)},T.prototype.onData=function(C){this.chunks.push(C)},T.prototype.onEnd=function(C){C===g&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=C,this.msg=this.strm.msg};function P(C,M){var j=new T(M);if(j.push(C,!0),j.err)throw j.msg||u[j.err];return j.result}function w(C,M){return M=M||{},M.raw=!0,P(C,M)}function N(C,M){return M=M||{},M.gzip=!0,P(C,M)}s.Deflate=T,s.deflate=P,s.deflateRaw=w,s.gzip=N},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,n,s){"use strict";var a=i("./zlib/inflate"),o=i("./utils/common"),l=i("./utils/strings"),u=i("./zlib/constants"),f=i("./zlib/messages"),d=i("./zlib/zstream"),c=i("./zlib/gzheader"),v=Object.prototype.toString;function g(_){if(!(this instanceof g))return new g(_);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},_||{});var p=this.options;p.raw&&p.windowBits>=0&&p.windowBits<16&&(p.windowBits=-p.windowBits,p.windowBits===0&&(p.windowBits=-15)),p.windowBits>=0&&p.windowBits<16&&!(_&&_.windowBits)&&(p.windowBits+=32),p.windowBits>15&&p.windowBits<48&&(p.windowBits&15)==0&&(p.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var y=a.inflateInit2(this.strm,p.windowBits);if(y!==u.Z_OK)throw new Error(f[y]);this.header=new c,a.inflateGetHeader(this.strm,this.header)}g.prototype.push=function(_,p){var y=this.strm,T=this.options.chunkSize,P=this.options.dictionary,w,N,C,M,j,q,G=!1;if(this.ended)return!1;N=p===~~p?p:p===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof _=="string"?y.input=l.binstring2buf(_):v.call(_)==="[object ArrayBuffer]"?y.input=new Uint8Array(_):y.input=_,y.next_in=0,y.avail_in=y.input.length;do{if(y.avail_out===0&&(y.output=new o.Buf8(T),y.next_out=0,y.avail_out=T),w=a.inflate(y,u.Z_NO_FLUSH),w===u.Z_NEED_DICT&&P&&(typeof P=="string"?q=l.string2buf(P):v.call(P)==="[object ArrayBuffer]"?q=new Uint8Array(P):q=P,w=a.inflateSetDictionary(this.strm,q)),w===u.Z_BUF_ERROR&&G===!0&&(w=u.Z_OK,G=!1),w!==u.Z_STREAM_END&&w!==u.Z_OK)return this.onEnd(w),this.ended=!0,!1;y.next_out&&(y.avail_out===0||w===u.Z_STREAM_END||y.avail_in===0&&(N===u.Z_FINISH||N===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(C=l.utf8border(y.output,y.next_out),M=y.next_out-C,j=l.buf2string(y.output,C),y.next_out=M,y.avail_out=T-M,M&&o.arraySet(y.output,y.output,C,M,0),this.onData(j)):this.onData(o.shrinkBuf(y.output,y.next_out))),y.avail_in===0&&y.avail_out===0&&(G=!0)}while((y.avail_in>0||y.avail_out===0)&&w!==u.Z_STREAM_END);return w===u.Z_STREAM_END&&(N=u.Z_FINISH),N===u.Z_FINISH?(w=a.inflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===u.Z_OK):(N===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),y.avail_out=0),!0)},g.prototype.onData=function(_){this.chunks.push(_)},g.prototype.onEnd=function(_){_===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function O(_,p){var y=new g(p);if(y.push(_,!0),y.err)throw y.msg||f[y.err];return y.result}function k(_,p){return p=p||{},p.raw=!0,O(_,p)}s.Inflate=g,s.inflate=O,s.inflateRaw=k,s.ungzip=O},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,n,s){"use strict";var a=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";s.assign=function(u){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var d=f.shift();if(!!d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var c in d)d.hasOwnProperty(c)&&(u[c]=d[c])}}return u},s.shrinkBuf=function(u,f){return u.length===f?u:u.subarray?u.subarray(0,f):(u.length=f,u)};var o={arraySet:function(u,f,d,c,v){if(f.subarray&&u.subarray){u.set(f.subarray(d,d+c),v);return}for(var g=0;g<c;g++)u[v+g]=f[d+g]},flattenChunks:function(u){var f,d,c,v,g,O;for(c=0,f=0,d=u.length;f<d;f++)c+=u[f].length;for(O=new Uint8Array(c),v=0,f=0,d=u.length;f<d;f++)g=u[f],O.set(g,v),v+=g.length;return O}},l={arraySet:function(u,f,d,c,v){for(var g=0;g<c;g++)u[v+g]=f[d+g]},flattenChunks:function(u){return[].concat.apply([],u)}};s.setTyped=function(u){u?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,o)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,l))},s.setTyped(a)},{}],42:[function(i,n,s){"use strict";var a=i("./common"),o=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch(c){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(c){l=!1}for(var u=new a.Buf8(256),f=0;f<256;f++)u[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;u[254]=u[254]=1,s.string2buf=function(c){var v,g,O,k,_,p=c.length,y=0;for(k=0;k<p;k++)g=c.charCodeAt(k),(g&64512)==55296&&k+1<p&&(O=c.charCodeAt(k+1),(O&64512)==56320&&(g=65536+(g-55296<<10)+(O-56320),k++)),y+=g<128?1:g<2048?2:g<65536?3:4;for(v=new a.Buf8(y),_=0,k=0;_<y;k++)g=c.charCodeAt(k),(g&64512)==55296&&k+1<p&&(O=c.charCodeAt(k+1),(O&64512)==56320&&(g=65536+(g-55296<<10)+(O-56320),k++)),g<128?v[_++]=g:g<2048?(v[_++]=192|g>>>6,v[_++]=128|g&63):g<65536?(v[_++]=224|g>>>12,v[_++]=128|g>>>6&63,v[_++]=128|g&63):(v[_++]=240|g>>>18,v[_++]=128|g>>>12&63,v[_++]=128|g>>>6&63,v[_++]=128|g&63);return v};function d(c,v){if(v<65537&&(c.subarray&&l||!c.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(c,v));for(var g="",O=0;O<v;O++)g+=String.fromCharCode(c[O]);return g}s.buf2binstring=function(c){return d(c,c.length)},s.binstring2buf=function(c){for(var v=new a.Buf8(c.length),g=0,O=v.length;g<O;g++)v[g]=c.charCodeAt(g);return v},s.buf2string=function(c,v){var g,O,k,_,p=v||c.length,y=new Array(p*2);for(O=0,g=0;g<p;){if(k=c[g++],k<128){y[O++]=k;continue}if(_=u[k],_>4){y[O++]=65533,g+=_-1;continue}for(k&=_===2?31:_===3?15:7;_>1&&g<p;)k=k<<6|c[g++]&63,_--;if(_>1){y[O++]=65533;continue}k<65536?y[O++]=k:(k-=65536,y[O++]=55296|k>>10&1023,y[O++]=56320|k&1023)}return d(y,O)},s.utf8border=function(c,v){var g;for(v=v||c.length,v>c.length&&(v=c.length),g=v-1;g>=0&&(c[g]&192)==128;)g--;return g<0||g===0?v:g+u[c[g]]>v?g:v}},{"./common":41}],43:[function(i,n,s){"use strict";function a(o,l,u,f){for(var d=o&65535|0,c=o>>>16&65535|0,v=0;u!==0;){v=u>2e3?2e3:u,u-=v;do d=d+l[f++]|0,c=c+d|0;while(--v);d%=65521,c%=65521}return d|c<<16|0}n.exports=a},{}],44:[function(i,n,s){"use strict";n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(i,n,s){"use strict";function a(){for(var u,f=[],d=0;d<256;d++){u=d;for(var c=0;c<8;c++)u=u&1?3988292384^u>>>1:u>>>1;f[d]=u}return f}var o=a();function l(u,f,d,c){var v=o,g=c+d;u^=-1;for(var O=c;O<g;O++)u=u>>>8^v[(u^f[O])&255];return u^-1}n.exports=l},{}],46:[function(i,n,s){"use strict";var a=i("../utils/common"),o=i("./trees"),l=i("./adler32"),u=i("./crc32"),f=i("./messages"),d=0,c=1,v=3,g=4,O=5,k=0,_=1,p=-2,y=-3,T=-5,P=-1,w=1,N=2,C=3,M=4,j=0,q=2,G=8,H=9,re=15,pe=8,ie=29,de=256,fe=de+1+ie,ae=30,be=19,Re=2*fe+1,Te=15,he=3,Ce=258,Ee=Ce+he+1,Ge=32,je=42,Me=69,_e=73,Ze=91,Be=103,ke=113,Le=666,xe=1,$e=2,Fe=3,ft=4,Se=3;function Ve(h,U){return h.msg=f[U],U}function Dt(h){return(h<<1)-(h>4?9:0)}function rt(h){for(var U=h.length;--U>=0;)h[U]=0}function Qe(h){var U=h.state,F=U.pending;F>h.avail_out&&(F=h.avail_out),F!==0&&(a.arraySet(h.output,U.pending_buf,U.pending_out,F,h.next_out),h.next_out+=F,U.pending_out+=F,h.total_out+=F,h.avail_out-=F,U.pending-=F,U.pending===0&&(U.pending_out=0))}function Ae(h,U){o._tr_flush_block(h,h.block_start>=0?h.block_start:-1,h.strstart-h.block_start,U),h.block_start=h.strstart,Qe(h.strm)}function ge(h,U){h.pending_buf[h.pending++]=U}function lt(h,U){h.pending_buf[h.pending++]=U>>>8&255,h.pending_buf[h.pending++]=U&255}function Gt(h,U,F,b){var A=h.avail_in;return A>b&&(A=b),A===0?0:(h.avail_in-=A,a.arraySet(U,h.input,h.next_in,A,F),h.state.wrap===1?h.adler=l(h.adler,U,A,F):h.state.wrap===2&&(h.adler=u(h.adler,U,A,F)),h.next_in+=A,h.total_in+=A,A)}function Pt(h,U){var F=h.max_chain_length,b=h.strstart,A,B,oe=h.prev_length,te=h.nice_match,se=h.strstart>h.w_size-Ee?h.strstart-(h.w_size-Ee):0,ye=h.window,Mt=h.w_mask,ze=h.prev,we=h.strstart+Ce,qe=ye[b+oe-1],Ke=ye[b+oe];h.prev_length>=h.good_match&&(F>>=2),te>h.lookahead&&(te=h.lookahead);do if(A=U,!(ye[A+oe]!==Ke||ye[A+oe-1]!==qe||ye[A]!==ye[b]||ye[++A]!==ye[b+1])){b+=2,A++;do;while(ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&ye[++b]===ye[++A]&&b<we);if(B=Ce-(we-b),b=we-Ce,B>oe){if(h.match_start=U,oe=B,B>=te)break;qe=ye[b+oe-1],Ke=ye[b+oe]}}while((U=ze[U&Mt])>se&&--F!=0);return oe<=h.lookahead?oe:h.lookahead}function ut(h){var U=h.w_size,F,b,A,B,oe;do{if(B=h.window_size-h.lookahead-h.strstart,h.strstart>=U+(U-Ee)){a.arraySet(h.window,h.window,U,U,0),h.match_start-=U,h.strstart-=U,h.block_start-=U,b=h.hash_size,F=b;do A=h.head[--F],h.head[F]=A>=U?A-U:0;while(--b);b=U,F=b;do A=h.prev[--F],h.prev[F]=A>=U?A-U:0;while(--b);B+=U}if(h.strm.avail_in===0)break;if(b=Gt(h.strm,h.window,h.strstart+h.lookahead,B),h.lookahead+=b,h.lookahead+h.insert>=he)for(oe=h.strstart-h.insert,h.ins_h=h.window[oe],h.ins_h=(h.ins_h<<h.hash_shift^h.window[oe+1])&h.hash_mask;h.insert&&(h.ins_h=(h.ins_h<<h.hash_shift^h.window[oe+he-1])&h.hash_mask,h.prev[oe&h.w_mask]=h.head[h.ins_h],h.head[h.ins_h]=oe,oe++,h.insert--,!(h.lookahead+h.insert<he)););}while(h.lookahead<Ee&&h.strm.avail_in!==0)}function $t(h,U){var F=65535;for(F>h.pending_buf_size-5&&(F=h.pending_buf_size-5);;){if(h.lookahead<=1){if(ut(h),h.lookahead===0&&U===d)return xe;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var b=h.block_start+F;if((h.strstart===0||h.strstart>=b)&&(h.lookahead=h.strstart-b,h.strstart=b,Ae(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-Ee&&(Ae(h,!1),h.strm.avail_out===0))return xe}return h.insert=0,U===g?(Ae(h,!0),h.strm.avail_out===0?Fe:ft):(h.strstart>h.block_start&&(Ae(h,!1),h.strm.avail_out===0),xe)}function Lt(h,U){for(var F,b;;){if(h.lookahead<Ee){if(ut(h),h.lookahead<Ee&&U===d)return xe;if(h.lookahead===0)break}if(F=0,h.lookahead>=he&&(h.ins_h=(h.ins_h<<h.hash_shift^h.window[h.strstart+he-1])&h.hash_mask,F=h.prev[h.strstart&h.w_mask]=h.head[h.ins_h],h.head[h.ins_h]=h.strstart),F!==0&&h.strstart-F<=h.w_size-Ee&&(h.match_length=Pt(h,F)),h.match_length>=he)if(b=o._tr_tally(h,h.strstart-h.match_start,h.match_length-he),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=he){h.match_length--;do h.strstart++,h.ins_h=(h.ins_h<<h.hash_shift^h.window[h.strstart+he-1])&h.hash_mask,F=h.prev[h.strstart&h.w_mask]=h.head[h.ins_h],h.head[h.ins_h]=h.strstart;while(--h.match_length!=0);h.strstart++}else h.strstart+=h.match_length,h.match_length=0,h.ins_h=h.window[h.strstart],h.ins_h=(h.ins_h<<h.hash_shift^h.window[h.strstart+1])&h.hash_mask;else b=o._tr_tally(h,0,h.window[h.strstart]),h.lookahead--,h.strstart++;if(b&&(Ae(h,!1),h.strm.avail_out===0))return xe}return h.insert=h.strstart<he-1?h.strstart:he-1,U===g?(Ae(h,!0),h.strm.avail_out===0?Fe:ft):h.last_lit&&(Ae(h,!1),h.strm.avail_out===0)?xe:$e}function ct(h,U){for(var F,b,A;;){if(h.lookahead<Ee){if(ut(h),h.lookahead<Ee&&U===d)return xe;if(h.lookahead===0)break}if(F=0,h.lookahead>=he&&(h.ins_h=(h.ins_h<<h.hash_shift^h.window[h.strstart+he-1])&h.hash_mask,F=h.prev[h.strstart&h.w_mask]=h.head[h.ins_h],h.head[h.ins_h]=h.strstart),h.prev_length=h.match_length,h.prev_match=h.match_start,h.match_length=he-1,F!==0&&h.prev_length<h.max_lazy_match&&h.strstart-F<=h.w_size-Ee&&(h.match_length=Pt(h,F),h.match_length<=5&&(h.strategy===w||h.match_length===he&&h.strstart-h.match_start>4096)&&(h.match_length=he-1)),h.prev_length>=he&&h.match_length<=h.prev_length){A=h.strstart+h.lookahead-he,b=o._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-he),h.lookahead-=h.prev_length-1,h.prev_length-=2;do++h.strstart<=A&&(h.ins_h=(h.ins_h<<h.hash_shift^h.window[h.strstart+he-1])&h.hash_mask,F=h.prev[h.strstart&h.w_mask]=h.head[h.ins_h],h.head[h.ins_h]=h.strstart);while(--h.prev_length!=0);if(h.match_available=0,h.match_length=he-1,h.strstart++,b&&(Ae(h,!1),h.strm.avail_out===0))return xe}else if(h.match_available){if(b=o._tr_tally(h,0,h.window[h.strstart-1]),b&&Ae(h,!1),h.strstart++,h.lookahead--,h.strm.avail_out===0)return xe}else h.match_available=1,h.strstart++,h.lookahead--}return h.match_available&&(b=o._tr_tally(h,0,h.window[h.strstart-1]),h.match_available=0),h.insert=h.strstart<he-1?h.strstart:he-1,U===g?(Ae(h,!0),h.strm.avail_out===0?Fe:ft):h.last_lit&&(Ae(h,!1),h.strm.avail_out===0)?xe:$e}function Kt(h,U){for(var F,b,A,B,oe=h.window;;){if(h.lookahead<=Ce){if(ut(h),h.lookahead<=Ce&&U===d)return xe;if(h.lookahead===0)break}if(h.match_length=0,h.lookahead>=he&&h.strstart>0&&(A=h.strstart-1,b=oe[A],b===oe[++A]&&b===oe[++A]&&b===oe[++A])){B=h.strstart+Ce;do;while(b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&b===oe[++A]&&A<B);h.match_length=Ce-(B-A),h.match_length>h.lookahead&&(h.match_length=h.lookahead)}if(h.match_length>=he?(F=o._tr_tally(h,1,h.match_length-he),h.lookahead-=h.match_length,h.strstart+=h.match_length,h.match_length=0):(F=o._tr_tally(h,0,h.window[h.strstart]),h.lookahead--,h.strstart++),F&&(Ae(h,!1),h.strm.avail_out===0))return xe}return h.insert=0,U===g?(Ae(h,!0),h.strm.avail_out===0?Fe:ft):h.last_lit&&(Ae(h,!1),h.strm.avail_out===0)?xe:$e}function zt(h,U){for(var F;;){if(h.lookahead===0&&(ut(h),h.lookahead===0)){if(U===d)return xe;break}if(h.match_length=0,F=o._tr_tally(h,0,h.window[h.strstart]),h.lookahead--,h.strstart++,F&&(Ae(h,!1),h.strm.avail_out===0))return xe}return h.insert=0,U===g?(Ae(h,!0),h.strm.avail_out===0?Fe:ft):h.last_lit&&(Ae(h,!1),h.strm.avail_out===0)?xe:$e}function Xe(h,U,F,b,A){this.good_length=h,this.max_lazy=U,this.nice_length=F,this.max_chain=b,this.func=A}var dt;dt=[new Xe(0,0,0,0,$t),new Xe(4,4,8,4,Lt),new Xe(4,5,16,8,Lt),new Xe(4,6,32,32,Lt),new Xe(4,4,16,16,ct),new Xe(8,16,32,32,ct),new Xe(8,16,128,128,ct),new Xe(8,32,128,256,ct),new Xe(32,128,258,1024,ct),new Xe(32,258,258,4096,ct)];function ni(h){h.window_size=2*h.w_size,rt(h.head),h.max_lazy_match=dt[h.level].max_lazy,h.good_match=dt[h.level].good_length,h.nice_match=dt[h.level].nice_length,h.max_chain_length=dt[h.level].max_chain,h.strstart=0,h.block_start=0,h.lookahead=0,h.insert=0,h.match_length=h.prev_length=he-1,h.match_available=0,h.ins_h=0}function x(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=G,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(Re*2),this.dyn_dtree=new a.Buf16((2*ae+1)*2),this.bl_tree=new a.Buf16((2*be+1)*2),rt(this.dyn_ltree),rt(this.dyn_dtree),rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(Te+1),this.heap=new a.Buf16(2*fe+1),rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*fe+1),rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Z(h){var U;return!h||!h.state?Ve(h,p):(h.total_in=h.total_out=0,h.data_type=q,U=h.state,U.pending=0,U.pending_out=0,U.wrap<0&&(U.wrap=-U.wrap),U.status=U.wrap?je:ke,h.adler=U.wrap===2?0:1,U.last_flush=d,o._tr_init(U),k)}function K(h){var U=Z(h);return U===k&&ni(h.state),U}function ne(h,U){return!h||!h.state||h.state.wrap!==2?p:(h.state.gzhead=U,k)}function I(h,U,F,b,A,B){if(!h)return p;var oe=1;if(U===P&&(U=6),b<0?(oe=0,b=-b):b>15&&(oe=2,b-=16),A<1||A>H||F!==G||b<8||b>15||U<0||U>9||B<0||B>M)return Ve(h,p);b===8&&(b=9);var te=new x;return h.state=te,te.strm=h,te.wrap=oe,te.gzhead=null,te.w_bits=b,te.w_size=1<<te.w_bits,te.w_mask=te.w_size-1,te.hash_bits=A+7,te.hash_size=1<<te.hash_bits,te.hash_mask=te.hash_size-1,te.hash_shift=~~((te.hash_bits+he-1)/he),te.window=new a.Buf8(te.w_size*2),te.head=new a.Buf16(te.hash_size),te.prev=new a.Buf16(te.w_size),te.lit_bufsize=1<<A+6,te.pending_buf_size=te.lit_bufsize*4,te.pending_buf=new a.Buf8(te.pending_buf_size),te.d_buf=1*te.lit_bufsize,te.l_buf=(1+2)*te.lit_bufsize,te.level=U,te.strategy=B,te.method=F,K(h)}function W(h,U){return I(h,U,G,re,pe,j)}function m(h,U){var F,b,A,B;if(!h||!h.state||U>O||U<0)return h?Ve(h,p):p;if(b=h.state,!h.output||!h.input&&h.avail_in!==0||b.status===Le&&U!==g)return Ve(h,h.avail_out===0?T:p);if(b.strm=h,F=b.last_flush,b.last_flush=U,b.status===je)if(b.wrap===2)h.adler=0,ge(b,31),ge(b,139),ge(b,8),b.gzhead?(ge(b,(b.gzhead.text?1:0)+(b.gzhead.hcrc?2:0)+(b.gzhead.extra?4:0)+(b.gzhead.name?8:0)+(b.gzhead.comment?16:0)),ge(b,b.gzhead.time&255),ge(b,b.gzhead.time>>8&255),ge(b,b.gzhead.time>>16&255),ge(b,b.gzhead.time>>24&255),ge(b,b.level===9?2:b.strategy>=N||b.level<2?4:0),ge(b,b.gzhead.os&255),b.gzhead.extra&&b.gzhead.extra.length&&(ge(b,b.gzhead.extra.length&255),ge(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(h.adler=u(h.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=Me):(ge(b,0),ge(b,0),ge(b,0),ge(b,0),ge(b,0),ge(b,b.level===9?2:b.strategy>=N||b.level<2?4:0),ge(b,Se),b.status=ke);else{var oe=G+(b.w_bits-8<<4)<<8,te=-1;b.strategy>=N||b.level<2?te=0:b.level<6?te=1:b.level===6?te=2:te=3,oe|=te<<6,b.strstart!==0&&(oe|=Ge),oe+=31-oe%31,b.status=ke,lt(b,oe),b.strstart!==0&&(lt(b,h.adler>>>16),lt(b,h.adler&65535)),h.adler=1}if(b.status===Me)if(b.gzhead.extra){for(A=b.pending;b.gzindex<(b.gzhead.extra.length&65535)&&!(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),Qe(h),A=b.pending,b.pending===b.pending_buf_size));)ge(b,b.gzhead.extra[b.gzindex]&255),b.gzindex++;b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=_e)}else b.status=_e;if(b.status===_e)if(b.gzhead.name){A=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),Qe(h),A=b.pending,b.pending===b.pending_buf_size)){B=1;break}b.gzindex<b.gzhead.name.length?B=b.gzhead.name.charCodeAt(b.gzindex++)&255:B=0,ge(b,B)}while(B!==0);b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),B===0&&(b.gzindex=0,b.status=Ze)}else b.status=Ze;if(b.status===Ze)if(b.gzhead.comment){A=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),Qe(h),A=b.pending,b.pending===b.pending_buf_size)){B=1;break}b.gzindex<b.gzhead.comment.length?B=b.gzhead.comment.charCodeAt(b.gzindex++)&255:B=0,ge(b,B)}while(B!==0);b.gzhead.hcrc&&b.pending>A&&(h.adler=u(h.adler,b.pending_buf,b.pending-A,A)),B===0&&(b.status=Be)}else b.status=Be;if(b.status===Be&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&Qe(h),b.pending+2<=b.pending_buf_size&&(ge(b,h.adler&255),ge(b,h.adler>>8&255),h.adler=0,b.status=ke)):b.status=ke),b.pending!==0){if(Qe(h),h.avail_out===0)return b.last_flush=-1,k}else if(h.avail_in===0&&Dt(U)<=Dt(F)&&U!==g)return Ve(h,T);if(b.status===Le&&h.avail_in!==0)return Ve(h,T);if(h.avail_in!==0||b.lookahead!==0||U!==d&&b.status!==Le){var se=b.strategy===N?zt(b,U):b.strategy===C?Kt(b,U):dt[b.level].func(b,U);if((se===Fe||se===ft)&&(b.status=Le),se===xe||se===Fe)return h.avail_out===0&&(b.last_flush=-1),k;if(se===$e&&(U===c?o._tr_align(b):U!==O&&(o._tr_stored_block(b,0,0,!1),U===v&&(rt(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),Qe(h),h.avail_out===0))return b.last_flush=-1,k}return U!==g?k:b.wrap<=0?_:(b.wrap===2?(ge(b,h.adler&255),ge(b,h.adler>>8&255),ge(b,h.adler>>16&255),ge(b,h.adler>>24&255),ge(b,h.total_in&255),ge(b,h.total_in>>8&255),ge(b,h.total_in>>16&255),ge(b,h.total_in>>24&255)):(lt(b,h.adler>>>16),lt(b,h.adler&65535)),Qe(h),b.wrap>0&&(b.wrap=-b.wrap),b.pending!==0?k:_)}function X(h){var U;return!h||!h.state?p:(U=h.state.status,U!==je&&U!==Me&&U!==_e&&U!==Ze&&U!==Be&&U!==ke&&U!==Le?Ve(h,p):(h.state=null,U===ke?Ve(h,y):k))}function ce(h,U){var F=U.length,b,A,B,oe,te,se,ye,Mt;if(!h||!h.state||(b=h.state,oe=b.wrap,oe===2||oe===1&&b.status!==je||b.lookahead))return p;for(oe===1&&(h.adler=l(h.adler,U,F,0)),b.wrap=0,F>=b.w_size&&(oe===0&&(rt(b.head),b.strstart=0,b.block_start=0,b.insert=0),Mt=new a.Buf8(b.w_size),a.arraySet(Mt,U,F-b.w_size,b.w_size,0),U=Mt,F=b.w_size),te=h.avail_in,se=h.next_in,ye=h.input,h.avail_in=F,h.next_in=0,h.input=U,ut(b);b.lookahead>=he;){A=b.strstart,B=b.lookahead-(he-1);do b.ins_h=(b.ins_h<<b.hash_shift^b.window[A+he-1])&b.hash_mask,b.prev[A&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=A,A++;while(--B);b.strstart=A,b.lookahead=he-1,ut(b)}return b.strstart+=b.lookahead,b.block_start=b.strstart,b.insert=b.lookahead,b.lookahead=0,b.match_length=b.prev_length=he-1,b.match_available=0,h.next_in=se,h.input=ye,h.avail_in=te,b.wrap=oe,k}s.deflateInit=W,s.deflateInit2=I,s.deflateReset=K,s.deflateResetKeep=Z,s.deflateSetHeader=ne,s.deflate=m,s.deflateEnd=X,s.deflateSetDictionary=ce,s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,n,s){"use strict";function a(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}n.exports=a},{}],48:[function(i,n,s){"use strict";var a=30,o=12;n.exports=function(u,f){var d,c,v,g,O,k,_,p,y,T,P,w,N,C,M,j,q,G,H,re,pe,ie,de,fe,ae;d=u.state,c=u.next_in,fe=u.input,v=c+(u.avail_in-5),g=u.next_out,ae=u.output,O=g-(f-u.avail_out),k=g+(u.avail_out-257),_=d.dmax,p=d.wsize,y=d.whave,T=d.wnext,P=d.window,w=d.hold,N=d.bits,C=d.lencode,M=d.distcode,j=(1<<d.lenbits)-1,q=(1<<d.distbits)-1;e:do{N<15&&(w+=fe[c++]<<N,N+=8,w+=fe[c++]<<N,N+=8),G=C[w&j];t:for(;;){if(H=G>>>24,w>>>=H,N-=H,H=G>>>16&255,H===0)ae[g++]=G&65535;else if(H&16){re=G&65535,H&=15,H&&(N<H&&(w+=fe[c++]<<N,N+=8),re+=w&(1<<H)-1,w>>>=H,N-=H),N<15&&(w+=fe[c++]<<N,N+=8,w+=fe[c++]<<N,N+=8),G=M[w&q];i:for(;;){if(H=G>>>24,w>>>=H,N-=H,H=G>>>16&255,H&16){if(pe=G&65535,H&=15,N<H&&(w+=fe[c++]<<N,N+=8,N<H&&(w+=fe[c++]<<N,N+=8)),pe+=w&(1<<H)-1,pe>_){u.msg="invalid distance too far back",d.mode=a;break e}if(w>>>=H,N-=H,H=g-O,pe>H){if(H=pe-H,H>y&&d.sane){u.msg="invalid distance too far back",d.mode=a;break e}if(ie=0,de=P,T===0){if(ie+=p-H,H<re){re-=H;do ae[g++]=P[ie++];while(--H);ie=g-pe,de=ae}}else if(T<H){if(ie+=p+T-H,H-=T,H<re){re-=H;do ae[g++]=P[ie++];while(--H);if(ie=0,T<re){H=T,re-=H;do ae[g++]=P[ie++];while(--H);ie=g-pe,de=ae}}}else if(ie+=T-H,H<re){re-=H;do ae[g++]=P[ie++];while(--H);ie=g-pe,de=ae}for(;re>2;)ae[g++]=de[ie++],ae[g++]=de[ie++],ae[g++]=de[ie++],re-=3;re&&(ae[g++]=de[ie++],re>1&&(ae[g++]=de[ie++]))}else{ie=g-pe;do ae[g++]=ae[ie++],ae[g++]=ae[ie++],ae[g++]=ae[ie++],re-=3;while(re>2);re&&(ae[g++]=ae[ie++],re>1&&(ae[g++]=ae[ie++]))}}else if((H&64)==0){G=M[(G&65535)+(w&(1<<H)-1)];continue i}else{u.msg="invalid distance code",d.mode=a;break e}break}}else if((H&64)==0){G=C[(G&65535)+(w&(1<<H)-1)];continue t}else if(H&32){d.mode=o;break e}else{u.msg="invalid literal/length code",d.mode=a;break e}break}}while(c<v&&g<k);re=N>>3,c-=re,N-=re<<3,w&=(1<<N)-1,u.next_in=c,u.next_out=g,u.avail_in=c<v?5+(v-c):5-(c-v),u.avail_out=g<k?257+(k-g):257-(g-k),d.hold=w,d.bits=N}},{}],49:[function(i,n,s){"use strict";var a=i("../utils/common"),o=i("./adler32"),l=i("./crc32"),u=i("./inffast"),f=i("./inftrees"),d=0,c=1,v=2,g=4,O=5,k=6,_=0,p=1,y=2,T=-2,P=-3,w=-4,N=-5,C=8,M=1,j=2,q=3,G=4,H=5,re=6,pe=7,ie=8,de=9,fe=10,ae=11,be=12,Re=13,Te=14,he=15,Ce=16,Ee=17,Ge=18,je=19,Me=20,_e=21,Ze=22,Be=23,ke=24,Le=25,xe=26,$e=27,Fe=28,ft=29,Se=30,Ve=31,Dt=32,rt=852,Qe=592,Ae=15,ge=Ae;function lt(I){return(I>>>24&255)+(I>>>8&65280)+((I&65280)<<8)+((I&255)<<24)}function Gt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Pt(I){var W;return!I||!I.state?T:(W=I.state,I.total_in=I.total_out=W.total=0,I.msg="",W.wrap&&(I.adler=W.wrap&1),W.mode=M,W.last=0,W.havedict=0,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new a.Buf32(rt),W.distcode=W.distdyn=new a.Buf32(Qe),W.sane=1,W.back=-1,_)}function ut(I){var W;return!I||!I.state?T:(W=I.state,W.wsize=0,W.whave=0,W.wnext=0,Pt(I))}function $t(I,W){var m,X;return!I||!I.state||(X=I.state,W<0?(m=0,W=-W):(m=(W>>4)+1,W<48&&(W&=15)),W&&(W<8||W>15))?T:(X.window!==null&&X.wbits!==W&&(X.window=null),X.wrap=m,X.wbits=W,ut(I))}function Lt(I,W){var m,X;return I?(X=new Gt,I.state=X,X.window=null,m=$t(I,W),m!==_&&(I.state=null),m):T}function ct(I){return Lt(I,ge)}var Kt=!0,zt,Xe;function dt(I){if(Kt){var W;for(zt=new a.Buf32(512),Xe=new a.Buf32(32),W=0;W<144;)I.lens[W++]=8;for(;W<256;)I.lens[W++]=9;for(;W<280;)I.lens[W++]=7;for(;W<288;)I.lens[W++]=8;for(f(c,I.lens,0,288,zt,0,I.work,{bits:9}),W=0;W<32;)I.lens[W++]=5;f(v,I.lens,0,32,Xe,0,I.work,{bits:5}),Kt=!1}I.lencode=zt,I.lenbits=9,I.distcode=Xe,I.distbits=5}function ni(I,W,m,X){var ce,h=I.state;return h.window===null&&(h.wsize=1<<h.wbits,h.wnext=0,h.whave=0,h.window=new a.Buf8(h.wsize)),X>=h.wsize?(a.arraySet(h.window,W,m-h.wsize,h.wsize,0),h.wnext=0,h.whave=h.wsize):(ce=h.wsize-h.wnext,ce>X&&(ce=X),a.arraySet(h.window,W,m-X,ce,h.wnext),X-=ce,X?(a.arraySet(h.window,W,m-X,X,0),h.wnext=X,h.whave=h.wsize):(h.wnext+=ce,h.wnext===h.wsize&&(h.wnext=0),h.whave<h.wsize&&(h.whave+=ce))),0}function x(I,W){var m,X,ce,h,U,F,b,A,B,oe,te,se,ye,Mt,ze=0,we,qe,Ke,nt,Ci,Ni,Ue,pt,Ye=new a.Buf8(4),Bt,xt,Vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return T;m=I.state,m.mode===be&&(m.mode=Re),U=I.next_out,ce=I.output,b=I.avail_out,h=I.next_in,X=I.input,F=I.avail_in,A=m.hold,B=m.bits,oe=F,te=b,pt=_;e:for(;;)switch(m.mode){case M:if(m.wrap===0){m.mode=Re;break}for(;B<16;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(m.wrap&2&&A===35615){m.check=0,Ye[0]=A&255,Ye[1]=A>>>8&255,m.check=l(m.check,Ye,2,0),A=0,B=0,m.mode=j;break}if(m.flags=0,m.head&&(m.head.done=!1),!(m.wrap&1)||(((A&255)<<8)+(A>>8))%31){I.msg="incorrect header check",m.mode=Se;break}if((A&15)!==C){I.msg="unknown compression method",m.mode=Se;break}if(A>>>=4,B-=4,Ue=(A&15)+8,m.wbits===0)m.wbits=Ue;else if(Ue>m.wbits){I.msg="invalid window size",m.mode=Se;break}m.dmax=1<<Ue,I.adler=m.check=1,m.mode=A&512?fe:be,A=0,B=0;break;case j:for(;B<16;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(m.flags=A,(m.flags&255)!==C){I.msg="unknown compression method",m.mode=Se;break}if(m.flags&57344){I.msg="unknown header flags set",m.mode=Se;break}m.head&&(m.head.text=A>>8&1),m.flags&512&&(Ye[0]=A&255,Ye[1]=A>>>8&255,m.check=l(m.check,Ye,2,0)),A=0,B=0,m.mode=q;case q:for(;B<32;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.head&&(m.head.time=A),m.flags&512&&(Ye[0]=A&255,Ye[1]=A>>>8&255,Ye[2]=A>>>16&255,Ye[3]=A>>>24&255,m.check=l(m.check,Ye,4,0)),A=0,B=0,m.mode=G;case G:for(;B<16;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.head&&(m.head.xflags=A&255,m.head.os=A>>8),m.flags&512&&(Ye[0]=A&255,Ye[1]=A>>>8&255,m.check=l(m.check,Ye,2,0)),A=0,B=0,m.mode=H;case H:if(m.flags&1024){for(;B<16;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.length=A,m.head&&(m.head.extra_len=A),m.flags&512&&(Ye[0]=A&255,Ye[1]=A>>>8&255,m.check=l(m.check,Ye,2,0)),A=0,B=0}else m.head&&(m.head.extra=null);m.mode=re;case re:if(m.flags&1024&&(se=m.length,se>F&&(se=F),se&&(m.head&&(Ue=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),a.arraySet(m.head.extra,X,h,se,Ue)),m.flags&512&&(m.check=l(m.check,X,se,h)),F-=se,h+=se,m.length-=se),m.length))break e;m.length=0,m.mode=pe;case pe:if(m.flags&2048){if(F===0)break e;se=0;do Ue=X[h+se++],m.head&&Ue&&m.length<65536&&(m.head.name+=String.fromCharCode(Ue));while(Ue&&se<F);if(m.flags&512&&(m.check=l(m.check,X,se,h)),F-=se,h+=se,Ue)break e}else m.head&&(m.head.name=null);m.length=0,m.mode=ie;case ie:if(m.flags&4096){if(F===0)break e;se=0;do Ue=X[h+se++],m.head&&Ue&&m.length<65536&&(m.head.comment+=String.fromCharCode(Ue));while(Ue&&se<F);if(m.flags&512&&(m.check=l(m.check,X,se,h)),F-=se,h+=se,Ue)break e}else m.head&&(m.head.comment=null);m.mode=de;case de:if(m.flags&512){for(;B<16;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(A!==(m.check&65535)){I.msg="header crc mismatch",m.mode=Se;break}A=0,B=0}m.head&&(m.head.hcrc=m.flags>>9&1,m.head.done=!0),I.adler=m.check=0,m.mode=be;break;case fe:for(;B<32;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}I.adler=m.check=lt(A),A=0,B=0,m.mode=ae;case ae:if(m.havedict===0)return I.next_out=U,I.avail_out=b,I.next_in=h,I.avail_in=F,m.hold=A,m.bits=B,y;I.adler=m.check=1,m.mode=be;case be:if(W===O||W===k)break e;case Re:if(m.last){A>>>=B&7,B-=B&7,m.mode=$e;break}for(;B<3;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}switch(m.last=A&1,A>>>=1,B-=1,A&3){case 0:m.mode=Te;break;case 1:if(dt(m),m.mode=Me,W===k){A>>>=2,B-=2;break e}break;case 2:m.mode=Ee;break;case 3:I.msg="invalid block type",m.mode=Se}A>>>=2,B-=2;break;case Te:for(A>>>=B&7,B-=B&7;B<32;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if((A&65535)!=(A>>>16^65535)){I.msg="invalid stored block lengths",m.mode=Se;break}if(m.length=A&65535,A=0,B=0,m.mode=he,W===k)break e;case he:m.mode=Ce;case Ce:if(se=m.length,se){if(se>F&&(se=F),se>b&&(se=b),se===0)break e;a.arraySet(ce,X,h,se,U),F-=se,h+=se,b-=se,U+=se,m.length-=se;break}m.mode=be;break;case Ee:for(;B<14;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(m.nlen=(A&31)+257,A>>>=5,B-=5,m.ndist=(A&31)+1,A>>>=5,B-=5,m.ncode=(A&15)+4,A>>>=4,B-=4,m.nlen>286||m.ndist>30){I.msg="too many length or distance symbols",m.mode=Se;break}m.have=0,m.mode=Ge;case Ge:for(;m.have<m.ncode;){for(;B<3;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.lens[Vr[m.have++]]=A&7,A>>>=3,B-=3}for(;m.have<19;)m.lens[Vr[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,Bt={bits:m.lenbits},pt=f(d,m.lens,0,19,m.lencode,0,m.work,Bt),m.lenbits=Bt.bits,pt){I.msg="invalid code lengths set",m.mode=Se;break}m.have=0,m.mode=je;case je:for(;m.have<m.nlen+m.ndist;){for(;ze=m.lencode[A&(1<<m.lenbits)-1],we=ze>>>24,qe=ze>>>16&255,Ke=ze&65535,!(we<=B);){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(Ke<16)A>>>=we,B-=we,m.lens[m.have++]=Ke;else{if(Ke===16){for(xt=we+2;B<xt;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(A>>>=we,B-=we,m.have===0){I.msg="invalid bit length repeat",m.mode=Se;break}Ue=m.lens[m.have-1],se=3+(A&3),A>>>=2,B-=2}else if(Ke===17){for(xt=we+3;B<xt;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}A>>>=we,B-=we,Ue=0,se=3+(A&7),A>>>=3,B-=3}else{for(xt=we+7;B<xt;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}A>>>=we,B-=we,Ue=0,se=11+(A&127),A>>>=7,B-=7}if(m.have+se>m.nlen+m.ndist){I.msg="invalid bit length repeat",m.mode=Se;break}for(;se--;)m.lens[m.have++]=Ue}}if(m.mode===Se)break;if(m.lens[256]===0){I.msg="invalid code -- missing end-of-block",m.mode=Se;break}if(m.lenbits=9,Bt={bits:m.lenbits},pt=f(c,m.lens,0,m.nlen,m.lencode,0,m.work,Bt),m.lenbits=Bt.bits,pt){I.msg="invalid literal/lengths set",m.mode=Se;break}if(m.distbits=6,m.distcode=m.distdyn,Bt={bits:m.distbits},pt=f(v,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,Bt),m.distbits=Bt.bits,pt){I.msg="invalid distances set",m.mode=Se;break}if(m.mode=Me,W===k)break e;case Me:m.mode=_e;case _e:if(F>=6&&b>=258){I.next_out=U,I.avail_out=b,I.next_in=h,I.avail_in=F,m.hold=A,m.bits=B,u(I,te),U=I.next_out,ce=I.output,b=I.avail_out,h=I.next_in,X=I.input,F=I.avail_in,A=m.hold,B=m.bits,m.mode===be&&(m.back=-1);break}for(m.back=0;ze=m.lencode[A&(1<<m.lenbits)-1],we=ze>>>24,qe=ze>>>16&255,Ke=ze&65535,!(we<=B);){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(qe&&(qe&240)==0){for(nt=we,Ci=qe,Ni=Ke;ze=m.lencode[Ni+((A&(1<<nt+Ci)-1)>>nt)],we=ze>>>24,qe=ze>>>16&255,Ke=ze&65535,!(nt+we<=B);){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}A>>>=nt,B-=nt,m.back+=nt}if(A>>>=we,B-=we,m.back+=we,m.length=Ke,qe===0){m.mode=xe;break}if(qe&32){m.back=-1,m.mode=be;break}if(qe&64){I.msg="invalid literal/length code",m.mode=Se;break}m.extra=qe&15,m.mode=Ze;case Ze:if(m.extra){for(xt=m.extra;B<xt;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.length+=A&(1<<m.extra)-1,A>>>=m.extra,B-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=Be;case Be:for(;ze=m.distcode[A&(1<<m.distbits)-1],we=ze>>>24,qe=ze>>>16&255,Ke=ze&65535,!(we<=B);){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if((qe&240)==0){for(nt=we,Ci=qe,Ni=Ke;ze=m.distcode[Ni+((A&(1<<nt+Ci)-1)>>nt)],we=ze>>>24,qe=ze>>>16&255,Ke=ze&65535,!(nt+we<=B);){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}A>>>=nt,B-=nt,m.back+=nt}if(A>>>=we,B-=we,m.back+=we,qe&64){I.msg="invalid distance code",m.mode=Se;break}m.offset=Ke,m.extra=qe&15,m.mode=ke;case ke:if(m.extra){for(xt=m.extra;B<xt;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}m.offset+=A&(1<<m.extra)-1,A>>>=m.extra,B-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){I.msg="invalid distance too far back",m.mode=Se;break}m.mode=Le;case Le:if(b===0)break e;if(se=te-b,m.offset>se){if(se=m.offset-se,se>m.whave&&m.sane){I.msg="invalid distance too far back",m.mode=Se;break}se>m.wnext?(se-=m.wnext,ye=m.wsize-se):ye=m.wnext-se,se>m.length&&(se=m.length),Mt=m.window}else Mt=ce,ye=U-m.offset,se=m.length;se>b&&(se=b),b-=se,m.length-=se;do ce[U++]=Mt[ye++];while(--se);m.length===0&&(m.mode=_e);break;case xe:if(b===0)break e;ce[U++]=m.length,b--,m.mode=_e;break;case $e:if(m.wrap){for(;B<32;){if(F===0)break e;F--,A|=X[h++]<<B,B+=8}if(te-=b,I.total_out+=te,m.total+=te,te&&(I.adler=m.check=m.flags?l(m.check,ce,te,U-te):o(m.check,ce,te,U-te)),te=b,(m.flags?A:lt(A))!==m.check){I.msg="incorrect data check",m.mode=Se;break}A=0,B=0}m.mode=Fe;case Fe:if(m.wrap&&m.flags){for(;B<32;){if(F===0)break e;F--,A+=X[h++]<<B,B+=8}if(A!==(m.total&4294967295)){I.msg="incorrect length check",m.mode=Se;break}A=0,B=0}m.mode=ft;case ft:pt=p;break e;case Se:pt=P;break e;case Ve:return w;case Dt:default:return T}return I.next_out=U,I.avail_out=b,I.next_in=h,I.avail_in=F,m.hold=A,m.bits=B,(m.wsize||te!==I.avail_out&&m.mode<Se&&(m.mode<$e||W!==g))&&ni(I,I.output,I.next_out,te-I.avail_out)?(m.mode=Ve,w):(oe-=I.avail_in,te-=I.avail_out,I.total_in+=oe,I.total_out+=te,m.total+=te,m.wrap&&te&&(I.adler=m.check=m.flags?l(m.check,ce,te,I.next_out-te):o(m.check,ce,te,I.next_out-te)),I.data_type=m.bits+(m.last?64:0)+(m.mode===be?128:0)+(m.mode===Me||m.mode===he?256:0),(oe===0&&te===0||W===g)&&pt===_&&(pt=N),pt)}function Z(I){if(!I||!I.state)return T;var W=I.state;return W.window&&(W.window=null),I.state=null,_}function K(I,W){var m;return!I||!I.state||(m=I.state,(m.wrap&2)==0)?T:(m.head=W,W.done=!1,_)}function ne(I,W){var m=W.length,X,ce,h;return!I||!I.state||(X=I.state,X.wrap!==0&&X.mode!==ae)?T:X.mode===ae&&(ce=1,ce=o(ce,W,m,0),ce!==X.check)?P:(h=ni(I,W,m,m),h?(X.mode=Ve,w):(X.havedict=1,_))}s.inflateReset=ut,s.inflateReset2=$t,s.inflateResetKeep=Pt,s.inflateInit=ct,s.inflateInit2=Lt,s.inflate=x,s.inflateEnd=Z,s.inflateGetHeader=K,s.inflateSetDictionary=ne,s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,n,s){"use strict";var a=i("../utils/common"),o=15,l=852,u=592,f=0,d=1,c=2,v=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],O=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(p,y,T,P,w,N,C,M){var j=M.bits,q=0,G=0,H=0,re=0,pe=0,ie=0,de=0,fe=0,ae=0,be=0,Re,Te,he,Ce,Ee,Ge=null,je=0,Me,_e=new a.Buf16(o+1),Ze=new a.Buf16(o+1),Be=null,ke=0,Le,xe,$e;for(q=0;q<=o;q++)_e[q]=0;for(G=0;G<P;G++)_e[y[T+G]]++;for(pe=j,re=o;re>=1&&_e[re]===0;re--);if(pe>re&&(pe=re),re===0)return w[N++]=1<<24|64<<16|0,w[N++]=1<<24|64<<16|0,M.bits=1,0;for(H=1;H<re&&_e[H]===0;H++);for(pe<H&&(pe=H),fe=1,q=1;q<=o;q++)if(fe<<=1,fe-=_e[q],fe<0)return-1;if(fe>0&&(p===f||re!==1))return-1;for(Ze[1]=0,q=1;q<o;q++)Ze[q+1]=Ze[q]+_e[q];for(G=0;G<P;G++)y[T+G]!==0&&(C[Ze[y[T+G]]++]=G);if(p===f?(Ge=Be=C,Me=19):p===d?(Ge=v,je-=257,Be=g,ke-=257,Me=256):(Ge=O,Be=k,Me=-1),be=0,G=0,q=H,Ee=N,ie=pe,de=0,he=-1,ae=1<<pe,Ce=ae-1,p===d&&ae>l||p===c&&ae>u)return 1;for(;;){Le=q-de,C[G]<Me?(xe=0,$e=C[G]):C[G]>Me?(xe=Be[ke+C[G]],$e=Ge[je+C[G]]):(xe=32+64,$e=0),Re=1<<q-de,Te=1<<ie,H=Te;do Te-=Re,w[Ee+(be>>de)+Te]=Le<<24|xe<<16|$e|0;while(Te!==0);for(Re=1<<q-1;be&Re;)Re>>=1;if(Re!==0?(be&=Re-1,be+=Re):be=0,G++,--_e[q]==0){if(q===re)break;q=y[T+C[G]]}if(q>pe&&(be&Ce)!==he){for(de===0&&(de=pe),Ee+=H,ie=q-de,fe=1<<ie;ie+de<re&&(fe-=_e[ie+de],!(fe<=0));)ie++,fe<<=1;if(ae+=1<<ie,p===d&&ae>l||p===c&&ae>u)return 1;he=be&Ce,w[he]=pe<<24|ie<<16|Ee-N|0}}return be!==0&&(w[Ee+be]=q-de<<24|64<<16|0),M.bits=pe,0}},{"../utils/common":41}],51:[function(i,n,s){"use strict";n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(i,n,s){"use strict";var a=i("../utils/common"),o=4,l=0,u=1,f=2;function d(x){for(var Z=x.length;--Z>=0;)x[Z]=0}var c=0,v=1,g=2,O=3,k=258,_=29,p=256,y=p+1+_,T=30,P=19,w=2*y+1,N=15,C=16,M=7,j=256,q=16,G=17,H=18,re=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],pe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ie=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],de=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fe=512,ae=new Array((y+2)*2);d(ae);var be=new Array(T*2);d(be);var Re=new Array(fe);d(Re);var Te=new Array(k-O+1);d(Te);var he=new Array(_);d(he);var Ce=new Array(T);d(Ce);function Ee(x,Z,K,ne,I){this.static_tree=x,this.extra_bits=Z,this.extra_base=K,this.elems=ne,this.max_length=I,this.has_stree=x&&x.length}var Ge,je,Me;function _e(x,Z){this.dyn_tree=x,this.max_code=0,this.stat_desc=Z}function Ze(x){return x<256?Re[x]:Re[256+(x>>>7)]}function Be(x,Z){x.pending_buf[x.pending++]=Z&255,x.pending_buf[x.pending++]=Z>>>8&255}function ke(x,Z,K){x.bi_valid>C-K?(x.bi_buf|=Z<<x.bi_valid&65535,Be(x,x.bi_buf),x.bi_buf=Z>>C-x.bi_valid,x.bi_valid+=K-C):(x.bi_buf|=Z<<x.bi_valid&65535,x.bi_valid+=K)}function Le(x,Z,K){ke(x,K[Z*2],K[Z*2+1])}function xe(x,Z){var K=0;do K|=x&1,x>>>=1,K<<=1;while(--Z>0);return K>>>1}function $e(x){x.bi_valid===16?(Be(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):x.bi_valid>=8&&(x.pending_buf[x.pending++]=x.bi_buf&255,x.bi_buf>>=8,x.bi_valid-=8)}function Fe(x,Z){var K=Z.dyn_tree,ne=Z.max_code,I=Z.stat_desc.static_tree,W=Z.stat_desc.has_stree,m=Z.stat_desc.extra_bits,X=Z.stat_desc.extra_base,ce=Z.stat_desc.max_length,h,U,F,b,A,B,oe=0;for(b=0;b<=N;b++)x.bl_count[b]=0;for(K[x.heap[x.heap_max]*2+1]=0,h=x.heap_max+1;h<w;h++)U=x.heap[h],b=K[K[U*2+1]*2+1]+1,b>ce&&(b=ce,oe++),K[U*2+1]=b,!(U>ne)&&(x.bl_count[b]++,A=0,U>=X&&(A=m[U-X]),B=K[U*2],x.opt_len+=B*(b+A),W&&(x.static_len+=B*(I[U*2+1]+A)));if(oe!==0){do{for(b=ce-1;x.bl_count[b]===0;)b--;x.bl_count[b]--,x.bl_count[b+1]+=2,x.bl_count[ce]--,oe-=2}while(oe>0);for(b=ce;b!==0;b--)for(U=x.bl_count[b];U!==0;)F=x.heap[--h],!(F>ne)&&(K[F*2+1]!==b&&(x.opt_len+=(b-K[F*2+1])*K[F*2],K[F*2+1]=b),U--)}}function ft(x,Z,K){var ne=new Array(N+1),I=0,W,m;for(W=1;W<=N;W++)ne[W]=I=I+K[W-1]<<1;for(m=0;m<=Z;m++){var X=x[m*2+1];X!==0&&(x[m*2]=xe(ne[X]++,X))}}function Se(){var x,Z,K,ne,I,W=new Array(N+1);for(K=0,ne=0;ne<_-1;ne++)for(he[ne]=K,x=0;x<1<<re[ne];x++)Te[K++]=ne;for(Te[K-1]=ne,I=0,ne=0;ne<16;ne++)for(Ce[ne]=I,x=0;x<1<<pe[ne];x++)Re[I++]=ne;for(I>>=7;ne<T;ne++)for(Ce[ne]=I<<7,x=0;x<1<<pe[ne]-7;x++)Re[256+I++]=ne;for(Z=0;Z<=N;Z++)W[Z]=0;for(x=0;x<=143;)ae[x*2+1]=8,x++,W[8]++;for(;x<=255;)ae[x*2+1]=9,x++,W[9]++;for(;x<=279;)ae[x*2+1]=7,x++,W[7]++;for(;x<=287;)ae[x*2+1]=8,x++,W[8]++;for(ft(ae,y+1,W),x=0;x<T;x++)be[x*2+1]=5,be[x*2]=xe(x,5);Ge=new Ee(ae,re,p+1,y,N),je=new Ee(be,pe,0,T,N),Me=new Ee(new Array(0),ie,0,P,M)}function Ve(x){var Z;for(Z=0;Z<y;Z++)x.dyn_ltree[Z*2]=0;for(Z=0;Z<T;Z++)x.dyn_dtree[Z*2]=0;for(Z=0;Z<P;Z++)x.bl_tree[Z*2]=0;x.dyn_ltree[j*2]=1,x.opt_len=x.static_len=0,x.last_lit=x.matches=0}function Dt(x){x.bi_valid>8?Be(x,x.bi_buf):x.bi_valid>0&&(x.pending_buf[x.pending++]=x.bi_buf),x.bi_buf=0,x.bi_valid=0}function rt(x,Z,K,ne){Dt(x),ne&&(Be(x,K),Be(x,~K)),a.arraySet(x.pending_buf,x.window,Z,K,x.pending),x.pending+=K}function Qe(x,Z,K,ne){var I=Z*2,W=K*2;return x[I]<x[W]||x[I]===x[W]&&ne[Z]<=ne[K]}function Ae(x,Z,K){for(var ne=x.heap[K],I=K<<1;I<=x.heap_len&&(I<x.heap_len&&Qe(Z,x.heap[I+1],x.heap[I],x.depth)&&I++,!Qe(Z,ne,x.heap[I],x.depth));)x.heap[K]=x.heap[I],K=I,I<<=1;x.heap[K]=ne}function ge(x,Z,K){var ne,I,W=0,m,X;if(x.last_lit!==0)do ne=x.pending_buf[x.d_buf+W*2]<<8|x.pending_buf[x.d_buf+W*2+1],I=x.pending_buf[x.l_buf+W],W++,ne===0?Le(x,I,Z):(m=Te[I],Le(x,m+p+1,Z),X=re[m],X!==0&&(I-=he[m],ke(x,I,X)),ne--,m=Ze(ne),Le(x,m,K),X=pe[m],X!==0&&(ne-=Ce[m],ke(x,ne,X)));while(W<x.last_lit);Le(x,j,Z)}function lt(x,Z){var K=Z.dyn_tree,ne=Z.stat_desc.static_tree,I=Z.stat_desc.has_stree,W=Z.stat_desc.elems,m,X,ce=-1,h;for(x.heap_len=0,x.heap_max=w,m=0;m<W;m++)K[m*2]!==0?(x.heap[++x.heap_len]=ce=m,x.depth[m]=0):K[m*2+1]=0;for(;x.heap_len<2;)h=x.heap[++x.heap_len]=ce<2?++ce:0,K[h*2]=1,x.depth[h]=0,x.opt_len--,I&&(x.static_len-=ne[h*2+1]);for(Z.max_code=ce,m=x.heap_len>>1;m>=1;m--)Ae(x,K,m);h=W;do m=x.heap[1],x.heap[1]=x.heap[x.heap_len--],Ae(x,K,1),X=x.heap[1],x.heap[--x.heap_max]=m,x.heap[--x.heap_max]=X,K[h*2]=K[m*2]+K[X*2],x.depth[h]=(x.depth[m]>=x.depth[X]?x.depth[m]:x.depth[X])+1,K[m*2+1]=K[X*2+1]=h,x.heap[1]=h++,Ae(x,K,1);while(x.heap_len>=2);x.heap[--x.heap_max]=x.heap[1],Fe(x,Z),ft(K,ce,x.bl_count)}function Gt(x,Z,K){var ne,I=-1,W,m=Z[0*2+1],X=0,ce=7,h=4;for(m===0&&(ce=138,h=3),Z[(K+1)*2+1]=65535,ne=0;ne<=K;ne++)W=m,m=Z[(ne+1)*2+1],!(++X<ce&&W===m)&&(X<h?x.bl_tree[W*2]+=X:W!==0?(W!==I&&x.bl_tree[W*2]++,x.bl_tree[q*2]++):X<=10?x.bl_tree[G*2]++:x.bl_tree[H*2]++,X=0,I=W,m===0?(ce=138,h=3):W===m?(ce=6,h=3):(ce=7,h=4))}function Pt(x,Z,K){var ne,I=-1,W,m=Z[0*2+1],X=0,ce=7,h=4;for(m===0&&(ce=138,h=3),ne=0;ne<=K;ne++)if(W=m,m=Z[(ne+1)*2+1],!(++X<ce&&W===m)){if(X<h)do Le(x,W,x.bl_tree);while(--X!=0);else W!==0?(W!==I&&(Le(x,W,x.bl_tree),X--),Le(x,q,x.bl_tree),ke(x,X-3,2)):X<=10?(Le(x,G,x.bl_tree),ke(x,X-3,3)):(Le(x,H,x.bl_tree),ke(x,X-11,7));X=0,I=W,m===0?(ce=138,h=3):W===m?(ce=6,h=3):(ce=7,h=4)}}function ut(x){var Z;for(Gt(x,x.dyn_ltree,x.l_desc.max_code),Gt(x,x.dyn_dtree,x.d_desc.max_code),lt(x,x.bl_desc),Z=P-1;Z>=3&&x.bl_tree[de[Z]*2+1]===0;Z--);return x.opt_len+=3*(Z+1)+5+5+4,Z}function $t(x,Z,K,ne){var I;for(ke(x,Z-257,5),ke(x,K-1,5),ke(x,ne-4,4),I=0;I<ne;I++)ke(x,x.bl_tree[de[I]*2+1],3);Pt(x,x.dyn_ltree,Z-1),Pt(x,x.dyn_dtree,K-1)}function Lt(x){var Z=4093624447,K;for(K=0;K<=31;K++,Z>>>=1)if(Z&1&&x.dyn_ltree[K*2]!==0)return l;if(x.dyn_ltree[9*2]!==0||x.dyn_ltree[10*2]!==0||x.dyn_ltree[13*2]!==0)return u;for(K=32;K<p;K++)if(x.dyn_ltree[K*2]!==0)return u;return l}var ct=!1;function Kt(x){ct||(Se(),ct=!0),x.l_desc=new _e(x.dyn_ltree,Ge),x.d_desc=new _e(x.dyn_dtree,je),x.bl_desc=new _e(x.bl_tree,Me),x.bi_buf=0,x.bi_valid=0,Ve(x)}function zt(x,Z,K,ne){ke(x,(c<<1)+(ne?1:0),3),rt(x,Z,K,!0)}function Xe(x){ke(x,v<<1,3),Le(x,j,ae),$e(x)}function dt(x,Z,K,ne){var I,W,m=0;x.level>0?(x.strm.data_type===f&&(x.strm.data_type=Lt(x)),lt(x,x.l_desc),lt(x,x.d_desc),m=ut(x),I=x.opt_len+3+7>>>3,W=x.static_len+3+7>>>3,W<=I&&(I=W)):I=W=K+5,K+4<=I&&Z!==-1?zt(x,Z,K,ne):x.strategy===o||W===I?(ke(x,(v<<1)+(ne?1:0),3),ge(x,ae,be)):(ke(x,(g<<1)+(ne?1:0),3),$t(x,x.l_desc.max_code+1,x.d_desc.max_code+1,m+1),ge(x,x.dyn_ltree,x.dyn_dtree)),Ve(x),ne&&Dt(x)}function ni(x,Z,K){return x.pending_buf[x.d_buf+x.last_lit*2]=Z>>>8&255,x.pending_buf[x.d_buf+x.last_lit*2+1]=Z&255,x.pending_buf[x.l_buf+x.last_lit]=K&255,x.last_lit++,Z===0?x.dyn_ltree[K*2]++:(x.matches++,Z--,x.dyn_ltree[(Te[K]+p+1)*2]++,x.dyn_dtree[Ze(Z)*2]++),x.last_lit===x.lit_bufsize-1}s._tr_init=Kt,s._tr_stored_block=zt,s._tr_flush_block=dt,s._tr_tally=ni,s._tr_align=Xe},{"../utils/common":41}],53:[function(i,n,s){"use strict";function a(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}n.exports=a},{}],54:[function(i,n,s){"use strict";n.exports=typeof setImmediate=="function"?setImmediate:function(){var o=[].slice.apply(arguments);o.splice(1,0,0),setTimeout.apply(null,o)}},{}]},{},[10])(10)})});var gc=$(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.default=void 0;var Ji=Ie(),s_=us(Pr()),pc=us(Bn()),a_=us(oi()),o_=us(dc());function us(r){return r&&r.__esModule?r:{default:r}}var vc=class{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new o_.default}catch(e){throw new Error("JSZip lib not loaded")}}open(e,t){return this.zip.loadAsync(e,{base64:t})}openUrl(e,t){return(0,s_.default)(e,"binary").then(function(i){return this.zip.loadAsync(i,{base64:t})}.bind(this))}request(e,t){var i=new Ji.defer,n,s=new a_.default(e);return t||(t=s.extension),t=="blob"?n=this.getBlob(e):n=this.getText(e),n?n.then(function(a){let o=this.handleResponse(a,t);i.resolve(o)}.bind(this)):i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):(0,Ji.isXml)(t)?i=(0,Ji.parse)(e,"text/xml"):t=="xhtml"?i=(0,Ji.parse)(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=(0,Ji.parse)(e,"text/html"):i=e,i}getBlob(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return t=t||pc.default.lookup(n.name),n.async("uint8array").then(function(s){return new Blob([s],{type:t})})}getText(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return n.async("string").then(function(s){return s})}getBase64(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return t=t||pc.default.lookup(n.name),n.async("base64").then(function(s){return"data:"+t+";base64,"+s})}createUrl(e,t){var i=new Ji.defer,n=window.URL||window.webkitURL||window.mozURL,s,a,o=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(o?(a=this.getBase64(e),a&&a.then(function(l){this.urlCache[e]=l,i.resolve(l)}.bind(this))):(a=this.getBlob(e),a&&a.then(function(l){s=n.createObjectURL(l),this.urlCache[e]=s,i.resolve(s)}.bind(this))),a||i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.zip=void 0,this.urlCache={}}},l_=vc;hs.default=l_});var _c=$((mc,$a)=>{(function(r){if(typeof mc=="object"&&typeof $a!="undefined")$a.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=r()}})(function(){var r,e,t;return function i(n,s,a){function o(f,d){if(!s[f]){if(!n[f]){var c=typeof require=="function"&&require;if(!d&&c)return c(f,!0);if(l)return l(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var g=s[f]={exports:{}};n[f][0].call(g.exports,function(O){var k=n[f][1][O];return o(k||O)},g,g.exports,i,n,s,a)}return s[f].exports}for(var l=typeof require=="function"&&require,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(i,n,s){(function(a){"use strict";var o=a.MutationObserver||a.WebKitMutationObserver,l;if(o){var u=0,f=new o(O),d=a.document.createTextNode("");f.observe(d,{characterData:!0}),l=function(){d.data=u=++u%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var c=new a.MessageChannel;c.port1.onmessage=O,l=function(){c.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=function(){var _=a.document.createElement("script");_.onreadystatechange=function(){O(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},a.document.documentElement.appendChild(_)}:l=function(){setTimeout(O,0)};var v,g=[];function O(){v=!0;for(var _,p,y=g.length;y;){for(p=g,g=[],_=-1;++_<y;)p[_]();y=g.length}v=!1}n.exports=k;function k(_){g.push(_)===1&&!v&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(i,n,s){"use strict";var a=i(1);function o(){}var l={},u=["REJECTED"],f=["FULFILLED"],d=["PENDING"];n.exports=c;function c(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,w!==o&&k(this,w)}c.prototype.catch=function(w){return this.then(null,w)},c.prototype.then=function(w,N){if(typeof w!="function"&&this.state===f||typeof N!="function"&&this.state===u)return this;var C=new this.constructor(o);if(this.state!==d){var M=this.state===f?w:N;g(C,M,this.outcome)}else this.queue.push(new v(C,w,N));return C};function v(w,N,C){this.promise=w,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(w){l.resolve(this.promise,w)},v.prototype.otherCallFulfilled=function(w){g(this.promise,this.onFulfilled,w)},v.prototype.callRejected=function(w){l.reject(this.promise,w)},v.prototype.otherCallRejected=function(w){g(this.promise,this.onRejected,w)};function g(w,N,C){a(function(){var M;try{M=N(C)}catch(j){return l.reject(w,j)}M===w?l.reject(w,new TypeError("Cannot resolve promise with itself")):l.resolve(w,M)})}l.resolve=function(w,N){var C=_(O,N);if(C.status==="error")return l.reject(w,C.value);var M=C.value;if(M)k(w,M);else{w.state=f,w.outcome=N;for(var j=-1,q=w.queue.length;++j<q;)w.queue[j].callFulfilled(N)}return w},l.reject=function(w,N){w.state=u,w.outcome=N;for(var C=-1,M=w.queue.length;++C<M;)w.queue[C].callRejected(N);return w};function O(w){var N=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof N=="function")return function(){N.apply(w,arguments)}}function k(w,N){var C=!1;function M(H){C||(C=!0,l.reject(w,H))}function j(H){C||(C=!0,l.resolve(w,H))}function q(){N(j,M)}var G=_(q);G.status==="error"&&M(G.value)}function _(w,N){var C={};try{C.value=w(N),C.status="success"}catch(M){C.status="error",C.value=M}return C}c.resolve=p;function p(w){return w instanceof this?w:l.resolve(new this(o),w)}c.reject=y;function y(w){var N=new this(o);return l.reject(N,w)}c.all=T;function T(w){var N=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=w.length,M=!1;if(!C)return this.resolve([]);for(var j=new Array(C),q=0,G=-1,H=new this(o);++G<C;)re(w[G],G);return H;function re(pe,ie){N.resolve(pe).then(de,function(fe){M||(M=!0,l.reject(H,fe))});function de(fe){j[ie]=fe,++q===C&&!M&&(M=!0,l.resolve(H,j))}}}c.race=P;function P(w){var N=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=w.length,M=!1;if(!C)return this.resolve([]);for(var j=-1,q=new this(o);++j<C;)G(w[j]);return q;function G(H){N.resolve(H).then(function(re){M||(M=!0,l.resolve(q,re))},function(re){M||(M=!0,l.reject(q,re))})}}},{"1":1}],3:[function(i,n,s){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=i(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"2":2}],4:[function(i,n,s){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function o(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(E){return}}var u=l();function f(){try{if(!u||!u.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),R=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||R)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(S){return!1}}function d(E,R){E=E||[],R=R||{};try{return new Blob(E,R)}catch(D){if(D.name!=="TypeError")throw D;for(var S=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,L=new S,z=0;z<E.length;z+=1)L.append(E[z]);return L.getBlob(R.type)}}typeof Promise=="undefined"&&i(3);var c=Promise;function v(E,R){R&&E.then(function(S){R(null,S)},function(S){R(S)})}function g(E,R,S){typeof R=="function"&&E.then(R),typeof S=="function"&&E.catch(S)}function O(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function k(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var _="local-forage-detect-blob-support",p=void 0,y={},T=Object.prototype.toString,P="readonly",w="readwrite";function N(E){for(var R=E.length,S=new ArrayBuffer(R),L=new Uint8Array(S),z=0;z<R;z++)L[z]=E.charCodeAt(z);return S}function C(E){return new c(function(R){var S=E.transaction(_,w),L=d([""]);S.objectStore(_).put(L,"key"),S.onabort=function(z){z.preventDefault(),z.stopPropagation(),R(!1)},S.oncomplete=function(){var z=navigator.userAgent.match(/Chrome\/(\d+)/),D=navigator.userAgent.match(/Edge\//);R(D||!z||parseInt(z[1],10)>=43)}}).catch(function(){return!1})}function M(E){return typeof p=="boolean"?c.resolve(p):C(E).then(function(R){return p=R,p})}function j(E){var R=y[E.name],S={};S.promise=new c(function(L,z){S.resolve=L,S.reject=z}),R.deferredOperations.push(S),R.dbReady?R.dbReady=R.dbReady.then(function(){return S.promise}):R.dbReady=S.promise}function q(E){var R=y[E.name],S=R.deferredOperations.pop();if(S)return S.resolve(),S.promise}function G(E,R){var S=y[E.name],L=S.deferredOperations.pop();if(L)return L.reject(R),L.promise}function H(E,R){return new c(function(S,L){if(y[E.name]=y[E.name]||he(),E.db)if(R)j(E),E.db.close();else return S(E.db);var z=[E.name];R&&z.push(E.version);var D=u.open.apply(u,z);R&&(D.onupgradeneeded=function(V){var Y=D.result;try{Y.createObjectStore(E.storeName),V.oldVersion<=1&&Y.createObjectStore(_)}catch(J){if(J.name==="ConstraintError")console.warn('The database "'+E.name+'" has been upgraded from version '+V.oldVersion+" to version "+V.newVersion+', but the storage "'+E.storeName+'" already exists.');else throw J}}),D.onerror=function(V){V.preventDefault(),L(D.error)},D.onsuccess=function(){var V=D.result;V.onversionchange=function(Y){Y.target.close()},S(V),q(E)}})}function re(E){return H(E,!1)}function pe(E){return H(E,!0)}function ie(E,R){if(!E.db)return!0;var S=!E.db.objectStoreNames.contains(E.storeName),L=E.version<E.db.version,z=E.version>E.db.version;if(L&&(E.version!==R&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),z||S){if(S){var D=E.db.version+1;D>E.version&&(E.version=D)}return!0}return!1}function de(E){return new c(function(R,S){var L=new FileReader;L.onerror=S,L.onloadend=function(z){var D=btoa(z.target.result||"");R({__local_forage_encoded_blob:!0,data:D,type:E.type})},L.readAsBinaryString(E)})}function fe(E){var R=N(atob(E.data));return d([R],{type:E.type})}function ae(E){return E&&E.__local_forage_encoded_blob}function be(E){var R=this,S=R._initReady().then(function(){var L=y[R._dbInfo.name];if(L&&L.dbReady)return L.dbReady});return g(S,E,E),S}function Re(E){j(E);for(var R=y[E.name],S=R.forages,L=0;L<S.length;L++){var z=S[L];z._dbInfo.db&&(z._dbInfo.db.close(),z._dbInfo.db=null)}return E.db=null,re(E).then(function(D){return E.db=D,ie(E)?pe(E):D}).then(function(D){E.db=R.db=D;for(var V=0;V<S.length;V++)S[V]._dbInfo.db=D}).catch(function(D){throw G(E,D),D})}function Te(E,R,S,L){L===void 0&&(L=1);try{var z=E.db.transaction(E.storeName,R);S(null,z)}catch(D){if(L>0&&(!E.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return c.resolve().then(function(){if(!E.db||D.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),pe(E)}).then(function(){return Re(E).then(function(){Te(E,R,S,L-1)})}).catch(S);S(D)}}function he(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ce(E){var R=this,S={db:null};if(E)for(var L in E)S[L]=E[L];var z=y[S.name];z||(z=he(),y[S.name]=z),z.forages.push(R),R._initReady||(R._initReady=R.ready,R.ready=be);var D=[];function V(){return c.resolve()}for(var Y=0;Y<z.forages.length;Y++){var J=z.forages[Y];J!==R&&D.push(J._initReady().catch(V))}var Q=z.forages.slice(0);return c.all(D).then(function(){return S.db=z.db,re(S)}).then(function(ee){return S.db=ee,ie(S,R._defaultConfig.version)?pe(S):ee}).then(function(ee){S.db=z.db=ee,R._dbInfo=S;for(var le=0;le<Q.length;le++){var me=Q[le];me!==R&&(me._dbInfo.db=S.db,me._dbInfo.version=S.version)}})}function Ee(E,R){var S=this;E=O(E);var L=new c(function(z,D){S.ready().then(function(){Te(S._dbInfo,P,function(V,Y){if(V)return D(V);try{var J=Y.objectStore(S._dbInfo.storeName),Q=J.get(E);Q.onsuccess=function(){var ee=Q.result;ee===void 0&&(ee=null),ae(ee)&&(ee=fe(ee)),z(ee)},Q.onerror=function(){D(Q.error)}}catch(ee){D(ee)}})}).catch(D)});return v(L,R),L}function Ge(E,R){var S=this,L=new c(function(z,D){S.ready().then(function(){Te(S._dbInfo,P,function(V,Y){if(V)return D(V);try{var J=Y.objectStore(S._dbInfo.storeName),Q=J.openCursor(),ee=1;Q.onsuccess=function(){var le=Q.result;if(le){var me=le.value;ae(me)&&(me=fe(me));var Oe=E(me,le.key,ee++);Oe!==void 0?z(Oe):le.continue()}else z()},Q.onerror=function(){D(Q.error)}}catch(le){D(le)}})}).catch(D)});return v(L,R),L}function je(E,R,S){var L=this;E=O(E);var z=new c(function(D,V){var Y;L.ready().then(function(){return Y=L._dbInfo,T.call(R)==="[object Blob]"?M(Y.db).then(function(J){return J?R:de(R)}):R}).then(function(J){Te(L._dbInfo,w,function(Q,ee){if(Q)return V(Q);try{var le=ee.objectStore(L._dbInfo.storeName);J===null&&(J=void 0);var me=le.put(J,E);ee.oncomplete=function(){J===void 0&&(J=null),D(J)},ee.onabort=ee.onerror=function(){var Oe=me.error?me.error:me.transaction.error;V(Oe)}}catch(Oe){V(Oe)}})}).catch(V)});return v(z,S),z}function Me(E,R){var S=this;E=O(E);var L=new c(function(z,D){S.ready().then(function(){Te(S._dbInfo,w,function(V,Y){if(V)return D(V);try{var J=Y.objectStore(S._dbInfo.storeName),Q=J.delete(E);Y.oncomplete=function(){z()},Y.onerror=function(){D(Q.error)},Y.onabort=function(){var ee=Q.error?Q.error:Q.transaction.error;D(ee)}}catch(ee){D(ee)}})}).catch(D)});return v(L,R),L}function _e(E){var R=this,S=new c(function(L,z){R.ready().then(function(){Te(R._dbInfo,w,function(D,V){if(D)return z(D);try{var Y=V.objectStore(R._dbInfo.storeName),J=Y.clear();V.oncomplete=function(){L()},V.onabort=V.onerror=function(){var Q=J.error?J.error:J.transaction.error;z(Q)}}catch(Q){z(Q)}})}).catch(z)});return v(S,E),S}function Ze(E){var R=this,S=new c(function(L,z){R.ready().then(function(){Te(R._dbInfo,P,function(D,V){if(D)return z(D);try{var Y=V.objectStore(R._dbInfo.storeName),J=Y.count();J.onsuccess=function(){L(J.result)},J.onerror=function(){z(J.error)}}catch(Q){z(Q)}})}).catch(z)});return v(S,E),S}function Be(E,R){var S=this,L=new c(function(z,D){if(E<0){z(null);return}S.ready().then(function(){Te(S._dbInfo,P,function(V,Y){if(V)return D(V);try{var J=Y.objectStore(S._dbInfo.storeName),Q=!1,ee=J.openKeyCursor();ee.onsuccess=function(){var le=ee.result;if(!le){z(null);return}E===0||Q?z(le.key):(Q=!0,le.advance(E))},ee.onerror=function(){D(ee.error)}}catch(le){D(le)}})}).catch(D)});return v(L,R),L}function ke(E){var R=this,S=new c(function(L,z){R.ready().then(function(){Te(R._dbInfo,P,function(D,V){if(D)return z(D);try{var Y=V.objectStore(R._dbInfo.storeName),J=Y.openKeyCursor(),Q=[];J.onsuccess=function(){var ee=J.result;if(!ee){L(Q);return}Q.push(ee.key),ee.continue()},J.onerror=function(){z(J.error)}}catch(ee){z(ee)}})}).catch(z)});return v(S,E),S}function Le(E,R){R=k.apply(this,arguments);var S=this.config();E=typeof E!="function"&&E||{},E.name||(E.name=E.name||S.name,E.storeName=E.storeName||S.storeName);var L=this,z;if(!E.name)z=c.reject("Invalid arguments");else{var D=E.name===S.name&&L._dbInfo.db,V=D?c.resolve(L._dbInfo.db):re(E).then(function(Y){var J=y[E.name],Q=J.forages;J.db=Y;for(var ee=0;ee<Q.length;ee++)Q[ee]._dbInfo.db=Y;return Y});E.storeName?z=V.then(function(Y){if(!!Y.objectStoreNames.contains(E.storeName)){var J=Y.version+1;j(E);var Q=y[E.name],ee=Q.forages;Y.close();for(var le=0;le<ee.length;le++){var me=ee[le];me._dbInfo.db=null,me._dbInfo.version=J}var Oe=new c(function(Ne,He){var We=u.open(E.name,J);We.onerror=function(St){var sr=We.result;sr.close(),He(St)},We.onupgradeneeded=function(){var St=We.result;St.deleteObjectStore(E.storeName)},We.onsuccess=function(){var St=We.result;St.close(),Ne(St)}});return Oe.then(function(Ne){Q.db=Ne;for(var He=0;He<ee.length;He++){var We=ee[He];We._dbInfo.db=Ne,q(We._dbInfo)}}).catch(function(Ne){throw(G(E,Ne)||c.resolve()).catch(function(){}),Ne})}}):z=V.then(function(Y){j(E);var J=y[E.name],Q=J.forages;Y.close();for(var ee=0;ee<Q.length;ee++){var le=Q[ee];le._dbInfo.db=null}var me=new c(function(Oe,Ne){var He=u.deleteDatabase(E.name);He.onerror=function(){var We=He.result;We&&We.close(),Ne(He.error)},He.onblocked=function(){console.warn('dropInstance blocked for database "'+E.name+'" until all open connections are closed')},He.onsuccess=function(){var We=He.result;We&&We.close(),Oe(We)}});return me.then(function(Oe){J.db=Oe;for(var Ne=0;Ne<Q.length;Ne++){var He=Q[Ne];q(He._dbInfo)}}).catch(function(Oe){throw(G(E,Oe)||c.resolve()).catch(function(){}),Oe})})}return v(z,R),z}var xe={_driver:"asyncStorage",_initStorage:Ce,_support:f(),iterate:Ge,getItem:Ee,setItem:je,removeItem:Me,clear:_e,length:Ze,key:Be,keys:ke,dropInstance:Le};function $e(){return typeof openDatabase=="function"}var Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="~~local_forage_type~",Se=/^~~local_forage_type~([^~]+)~/,Ve="__lfsc__:",Dt=Ve.length,rt="arbf",Qe="blob",Ae="si08",ge="ui08",lt="uic8",Gt="si16",Pt="si32",ut="ur16",$t="ui32",Lt="fl32",ct="fl64",Kt=Dt+rt.length,zt=Object.prototype.toString;function Xe(E){var R=E.length*.75,S=E.length,L,z=0,D,V,Y,J;E[E.length-1]==="="&&(R--,E[E.length-2]==="="&&R--);var Q=new ArrayBuffer(R),ee=new Uint8Array(Q);for(L=0;L<S;L+=4)D=Fe.indexOf(E[L]),V=Fe.indexOf(E[L+1]),Y=Fe.indexOf(E[L+2]),J=Fe.indexOf(E[L+3]),ee[z++]=D<<2|V>>4,ee[z++]=(V&15)<<4|Y>>2,ee[z++]=(Y&3)<<6|J&63;return Q}function dt(E){var R=new Uint8Array(E),S="",L;for(L=0;L<R.length;L+=3)S+=Fe[R[L]>>2],S+=Fe[(R[L]&3)<<4|R[L+1]>>4],S+=Fe[(R[L+1]&15)<<2|R[L+2]>>6],S+=Fe[R[L+2]&63];return R.length%3==2?S=S.substring(0,S.length-1)+"=":R.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function ni(E,R){var S="";if(E&&(S=zt.call(E)),E&&(S==="[object ArrayBuffer]"||E.buffer&&zt.call(E.buffer)==="[object ArrayBuffer]")){var L,z=Ve;E instanceof ArrayBuffer?(L=E,z+=rt):(L=E.buffer,S==="[object Int8Array]"?z+=Ae:S==="[object Uint8Array]"?z+=ge:S==="[object Uint8ClampedArray]"?z+=lt:S==="[object Int16Array]"?z+=Gt:S==="[object Uint16Array]"?z+=ut:S==="[object Int32Array]"?z+=Pt:S==="[object Uint32Array]"?z+=$t:S==="[object Float32Array]"?z+=Lt:S==="[object Float64Array]"?z+=ct:R(new Error("Failed to get type for BinaryArray"))),R(z+dt(L))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var V=ft+E.type+"~"+dt(this.result);R(Ve+Qe+V)},D.readAsArrayBuffer(E)}else try{R(JSON.stringify(E))}catch(V){console.error("Couldn't convert value into a JSON string: ",E),R(null,V)}}function x(E){if(E.substring(0,Dt)!==Ve)return JSON.parse(E);var R=E.substring(Kt),S=E.substring(Dt,Kt),L;if(S===Qe&&Se.test(R)){var z=R.match(Se);L=z[1],R=R.substring(z[0].length)}var D=Xe(R);switch(S){case rt:return D;case Qe:return d([D],{type:L});case Ae:return new Int8Array(D);case ge:return new Uint8Array(D);case lt:return new Uint8ClampedArray(D);case Gt:return new Int16Array(D);case ut:return new Uint16Array(D);case Pt:return new Int32Array(D);case $t:return new Uint32Array(D);case Lt:return new Float32Array(D);case ct:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Z={serialize:ni,deserialize:x,stringToBuffer:Xe,bufferToString:dt};function K(E,R,S,L){E.executeSql("CREATE TABLE IF NOT EXISTS "+R.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,L)}function ne(E){var R=this,S={db:null};if(E)for(var L in E)S[L]=typeof E[L]!="string"?E[L].toString():E[L];var z=new c(function(D,V){try{S.db=openDatabase(S.name,String(S.version),S.description,S.size)}catch(Y){return V(Y)}S.db.transaction(function(Y){K(Y,S,function(){R._dbInfo=S,D()},function(J,Q){V(Q)})},V)});return S.serializer=Z,z}function I(E,R,S,L,z,D){E.executeSql(S,L,z,function(V,Y){Y.code===Y.SYNTAX_ERR?V.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[R.storeName],function(J,Q){Q.rows.length?D(J,Y):K(J,R,function(){J.executeSql(S,L,z,D)},D)},D):D(V,Y)},D)}function W(E,R){var S=this;E=O(E);var L=new c(function(z,D){S.ready().then(function(){var V=S._dbInfo;V.db.transaction(function(Y){I(Y,V,"SELECT * FROM "+V.storeName+" WHERE key = ? LIMIT 1",[E],function(J,Q){var ee=Q.rows.length?Q.rows.item(0).value:null;ee&&(ee=V.serializer.deserialize(ee)),z(ee)},function(J,Q){D(Q)})})}).catch(D)});return v(L,R),L}function m(E,R){var S=this,L=new c(function(z,D){S.ready().then(function(){var V=S._dbInfo;V.db.transaction(function(Y){I(Y,V,"SELECT * FROM "+V.storeName,[],function(J,Q){for(var ee=Q.rows,le=ee.length,me=0;me<le;me++){var Oe=ee.item(me),Ne=Oe.value;if(Ne&&(Ne=V.serializer.deserialize(Ne)),Ne=E(Ne,Oe.key,me+1),Ne!==void 0){z(Ne);return}}z()},function(J,Q){D(Q)})})}).catch(D)});return v(L,R),L}function X(E,R,S,L){var z=this;E=O(E);var D=new c(function(V,Y){z.ready().then(function(){R===void 0&&(R=null);var J=R,Q=z._dbInfo;Q.serializer.serialize(R,function(ee,le){le?Y(le):Q.db.transaction(function(me){I(me,Q,"INSERT OR REPLACE INTO "+Q.storeName+" (key, value) VALUES (?, ?)",[E,ee],function(){V(J)},function(Oe,Ne){Y(Ne)})},function(me){if(me.code===me.QUOTA_ERR){if(L>0){V(X.apply(z,[E,J,S,L-1]));return}Y(me)}})})}).catch(Y)});return v(D,S),D}function ce(E,R,S){return X.apply(this,[E,R,S,1])}function h(E,R){var S=this;E=O(E);var L=new c(function(z,D){S.ready().then(function(){var V=S._dbInfo;V.db.transaction(function(Y){I(Y,V,"DELETE FROM "+V.storeName+" WHERE key = ?",[E],function(){z()},function(J,Q){D(Q)})})}).catch(D)});return v(L,R),L}function U(E){var R=this,S=new c(function(L,z){R.ready().then(function(){var D=R._dbInfo;D.db.transaction(function(V){I(V,D,"DELETE FROM "+D.storeName,[],function(){L()},function(Y,J){z(J)})})}).catch(z)});return v(S,E),S}function F(E){var R=this,S=new c(function(L,z){R.ready().then(function(){var D=R._dbInfo;D.db.transaction(function(V){I(V,D,"SELECT COUNT(key) as c FROM "+D.storeName,[],function(Y,J){var Q=J.rows.item(0).c;L(Q)},function(Y,J){z(J)})})}).catch(z)});return v(S,E),S}function b(E,R){var S=this,L=new c(function(z,D){S.ready().then(function(){var V=S._dbInfo;V.db.transaction(function(Y){I(Y,V,"SELECT key FROM "+V.storeName+" WHERE id = ? LIMIT 1",[E+1],function(J,Q){var ee=Q.rows.length?Q.rows.item(0).key:null;z(ee)},function(J,Q){D(Q)})})}).catch(D)});return v(L,R),L}function A(E){var R=this,S=new c(function(L,z){R.ready().then(function(){var D=R._dbInfo;D.db.transaction(function(V){I(V,D,"SELECT key FROM "+D.storeName,[],function(Y,J){for(var Q=[],ee=0;ee<J.rows.length;ee++)Q.push(J.rows.item(ee).key);L(Q)},function(Y,J){z(J)})})}).catch(z)});return v(S,E),S}function B(E){return new c(function(R,S){E.transaction(function(L){L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(z,D){for(var V=[],Y=0;Y<D.rows.length;Y++)V.push(D.rows.item(Y).name);R({db:E,storeNames:V})},function(z,D){S(D)})},function(L){S(L)})})}function oe(E,R){R=k.apply(this,arguments);var S=this.config();E=typeof E!="function"&&E||{},E.name||(E.name=E.name||S.name,E.storeName=E.storeName||S.storeName);var L=this,z;return E.name?z=new c(function(D){var V;E.name===S.name?V=L._dbInfo.db:V=openDatabase(E.name,"","",0),E.storeName?D({db:V,storeNames:[E.storeName]}):D(B(V))}).then(function(D){return new c(function(V,Y){D.db.transaction(function(J){function Q(Oe){return new c(function(Ne,He){J.executeSql("DROP TABLE IF EXISTS "+Oe,[],function(){Ne()},function(We,St){He(St)})})}for(var ee=[],le=0,me=D.storeNames.length;le<me;le++)ee.push(Q(D.storeNames[le]));c.all(ee).then(function(){V()}).catch(function(Oe){Y(Oe)})},function(J){Y(J)})})}):z=c.reject("Invalid arguments"),v(z,R),z}var te={_driver:"webSQLStorage",_initStorage:ne,_support:$e(),iterate:m,getItem:W,setItem:ce,removeItem:h,clear:U,length:F,key:b,keys:A,dropInstance:oe};function se(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(E){return!1}}function ye(E,R){var S=E.name+"/";return E.storeName!==R.storeName&&(S+=E.storeName+"/"),S}function Mt(){var E="_localforage_support_test";try{return localStorage.setItem(E,!0),localStorage.removeItem(E),!1}catch(R){return!0}}function ze(){return!Mt()||localStorage.length>0}function we(E){var R=this,S={};if(E)for(var L in E)S[L]=E[L];return S.keyPrefix=ye(E,R._defaultConfig),ze()?(R._dbInfo=S,S.serializer=Z,c.resolve()):c.reject()}function qe(E){var R=this,S=R.ready().then(function(){for(var L=R._dbInfo.keyPrefix,z=localStorage.length-1;z>=0;z--){var D=localStorage.key(z);D.indexOf(L)===0&&localStorage.removeItem(D)}});return v(S,E),S}function Ke(E,R){var S=this;E=O(E);var L=S.ready().then(function(){var z=S._dbInfo,D=localStorage.getItem(z.keyPrefix+E);return D&&(D=z.serializer.deserialize(D)),D});return v(L,R),L}function nt(E,R){var S=this,L=S.ready().then(function(){for(var z=S._dbInfo,D=z.keyPrefix,V=D.length,Y=localStorage.length,J=1,Q=0;Q<Y;Q++){var ee=localStorage.key(Q);if(ee.indexOf(D)===0){var le=localStorage.getItem(ee);if(le&&(le=z.serializer.deserialize(le)),le=E(le,ee.substring(V),J++),le!==void 0)return le}}});return v(L,R),L}function Ci(E,R){var S=this,L=S.ready().then(function(){var z=S._dbInfo,D;try{D=localStorage.key(E)}catch(V){D=null}return D&&(D=D.substring(z.keyPrefix.length)),D});return v(L,R),L}function Ni(E){var R=this,S=R.ready().then(function(){for(var L=R._dbInfo,z=localStorage.length,D=[],V=0;V<z;V++){var Y=localStorage.key(V);Y.indexOf(L.keyPrefix)===0&&D.push(Y.substring(L.keyPrefix.length))}return D});return v(S,E),S}function Ue(E){var R=this,S=R.keys().then(function(L){return L.length});return v(S,E),S}function pt(E,R){var S=this;E=O(E);var L=S.ready().then(function(){var z=S._dbInfo;localStorage.removeItem(z.keyPrefix+E)});return v(L,R),L}function Ye(E,R,S){var L=this;E=O(E);var z=L.ready().then(function(){R===void 0&&(R=null);var D=R;return new c(function(V,Y){var J=L._dbInfo;J.serializer.serialize(R,function(Q,ee){if(ee)Y(ee);else try{localStorage.setItem(J.keyPrefix+E,Q),V(D)}catch(le){(le.name==="QuotaExceededError"||le.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Y(le),Y(le)}})})});return v(z,S),z}function Bt(E,R){if(R=k.apply(this,arguments),E=typeof E!="function"&&E||{},!E.name){var S=this.config();E.name=E.name||S.name,E.storeName=E.storeName||S.storeName}var L=this,z;return E.name?z=new c(function(D){E.storeName?D(ye(E,L._defaultConfig)):D(E.name+"/")}).then(function(D){for(var V=localStorage.length-1;V>=0;V--){var Y=localStorage.key(V);Y.indexOf(D)===0&&localStorage.removeItem(Y)}}):z=c.reject("Invalid arguments"),v(z,R),z}var xt={_driver:"localStorageWrapper",_initStorage:we,_support:se(),iterate:nt,getItem:Ke,setItem:Ye,removeItem:pt,clear:qe,length:Ue,key:Ci,keys:Ni,dropInstance:Bt},Vr=function(R,S){return R===S||typeof R=="number"&&typeof S=="number"&&isNaN(R)&&isNaN(S)},ad=function(R,S){for(var L=R.length,z=0;z<L;){if(Vr(R[z],S))return!0;z++}return!1},yo=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},nr={},bo={},Ri={INDEXEDDB:xe,WEBSQL:te,LOCALSTORAGE:xt},od=[Ri.INDEXEDDB._driver,Ri.WEBSQL._driver,Ri.LOCALSTORAGE._driver],Hr=["dropInstance"],Os=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Hr),ld={description:"",driver:od.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ud(E,R){E[R]=function(){var S=arguments;return E.ready().then(function(){return E[R].apply(E,S)})}}function Cs(){for(var E=1;E<arguments.length;E++){var R=arguments[E];if(R)for(var S in R)R.hasOwnProperty(S)&&(yo(R[S])?arguments[0][S]=R[S].slice():arguments[0][S]=R[S])}return arguments[0]}var hd=function(){function E(R){o(this,E);for(var S in Ri)if(Ri.hasOwnProperty(S)){var L=Ri[S],z=L._driver;this[S]=z,nr[z]||this.defineDriver(L)}this._defaultConfig=Cs({},ld),this._config=Cs({},this._defaultConfig,R),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(S){if((typeof S=="undefined"?"undefined":a(S))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var L in S){if(L==="storeName"&&(S[L]=S[L].replace(/\W/g,"_")),L==="version"&&typeof S[L]!="number")return new Error("Database version must be a number.");this._config[L]=S[L]}return"driver"in S&&S.driver?this.setDriver(this._config.driver):!0}else return typeof S=="string"?this._config[S]:this._config},E.prototype.defineDriver=function(S,L,z){var D=new c(function(V,Y){try{var J=S._driver,Q=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!S._driver){Y(Q);return}for(var ee=Os.concat("_initStorage"),le=0,me=ee.length;le<me;le++){var Oe=ee[le],Ne=!ad(Hr,Oe);if((Ne||S[Oe])&&typeof S[Oe]!="function"){Y(Q);return}}var He=function(){for(var sr=function(dd){return function(){var pd=new Error("Method "+dd+" is not implemented by the current driver"),wo=c.reject(pd);return v(wo,arguments[arguments.length-1]),wo}},Ns=0,cd=Hr.length;Ns<cd;Ns++){var Rs=Hr[Ns];S[Rs]||(S[Rs]=sr(Rs))}};He();var We=function(sr){nr[J]&&console.info("Redefining LocalForage driver: "+J),nr[J]=S,bo[J]=sr,V()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(We,Y):We(!!S._support):We(!0)}catch(St){Y(St)}});return g(D,L,z),D},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(S,L,z){var D=nr[S]?c.resolve(nr[S]):c.reject(new Error("Driver not found."));return g(D,L,z),D},E.prototype.getSerializer=function(S){var L=c.resolve(Z);return g(L,S),L},E.prototype.ready=function(S){var L=this,z=L._driverSet.then(function(){return L._ready===null&&(L._ready=L._initDriver()),L._ready});return g(z,S,S),z},E.prototype.setDriver=function(S,L,z){var D=this;yo(S)||(S=[S]);var V=this._getSupportedDrivers(S);function Y(){D._config.driver=D.driver()}function J(le){return D._extend(le),Y(),D._ready=D._initStorage(D._config),D._ready}function Q(le){return function(){var me=0;function Oe(){for(;me<le.length;){var Ne=le[me];return me++,D._dbInfo=null,D._ready=null,D.getDriver(Ne).then(J).catch(Oe)}Y();var He=new Error("No available storage method found.");return D._driverSet=c.reject(He),D._driverSet}return Oe()}}var ee=this._driverSet!==null?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=ee.then(function(){var le=V[0];return D._dbInfo=null,D._ready=null,D.getDriver(le).then(function(me){D._driver=me._driver,Y(),D._wrapLibraryMethodsWithReady(),D._initDriver=Q(V)})}).catch(function(){Y();var le=new Error("No available storage method found.");return D._driverSet=c.reject(le),D._driverSet}),g(this._driverSet,L,z),this._driverSet},E.prototype.supports=function(S){return!!bo[S]},E.prototype._extend=function(S){Cs(this,S)},E.prototype._getSupportedDrivers=function(S){for(var L=[],z=0,D=S.length;z<D;z++){var V=S[z];this.supports(V)&&L.push(V)}return L},E.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,L=Os.length;S<L;S++)ud(this,Os[S])},E.prototype.createInstance=function(S){return new E(S)},E}(),fd=new hd;n.exports=fd},{"3":3}]},{},[4])(4)})});var bc=$(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.default=void 0;var ii=Ie(),u_=Wr(Pr()),Ka=Wr(Bn()),h_=Wr(oi()),f_=Wr(Ft()),yc=Wr(_c());function Wr(r){return r&&r.__esModule?r:{default:r}}var Ja=class{constructor(e,t,i){this.urlCache={},this.storage=void 0,this.name=e,this.requester=t||u_.default,this.resolver=i,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;typeof yc.default=="undefined"&&(e=yc.default),this.storage=e.createInstance({name:this.name})}catch(e){throw new Error("localForage lib not loaded")}}addListeners(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)}removeListeners(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0}status(e){let t=navigator.onLine;this.online=t,t?this.emit("online",this):this.emit("offline",this)}add(e,t){let i=e.resources.map(n=>{let{href:s}=n,a=this.resolver(s),o=window.encodeURIComponent(a);return this.storage.getItem(o).then(l=>!l||t?this.requester(a,"binary").then(u=>this.storage.setItem(o,u)):l)});return Promise.all(i)}put(e,t,i){let n=window.encodeURIComponent(e);return this.storage.getItem(n).then(s=>s||this.requester(e,"binary",t,i).then(a=>this.storage.setItem(n,a)))}request(e,t,i,n){return this.online?this.requester(e,t,i,n).then(s=>(this.put(e),s)):this.retrieve(e,t)}retrieve(e,t){var i=new ii.defer,n,s=new h_.default(e);return t||(t=s.extension),t=="blob"?n=this.getBlob(e):n=this.getText(e),n.then(a=>{var o=new ii.defer,l;return a?(l=this.handleResponse(a,t),o.resolve(l)):o.reject({message:"File not found in storage: "+e,stack:new Error().stack}),o.promise})}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):(0,ii.isXml)(t)?i=(0,ii.parse)(e,"text/xml"):t=="xhtml"?i=(0,ii.parse)(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=(0,ii.parse)(e,"text/html"):i=e,i}getBlob(e,t){let i=window.encodeURIComponent(e);return this.storage.getItem(i).then(function(n){if(!!n)return t=t||Ka.default.lookup(e),new Blob([n],{type:t})})}getText(e,t){let i=window.encodeURIComponent(e);return t=t||Ka.default.lookup(e),this.storage.getItem(i).then(function(n){var s=new ii.defer,a=new FileReader,o;if(!!n)return o=new Blob([n],{type:t}),a.addEventListener("loadend",()=>{s.resolve(a.result)}),a.readAsText(o,t),s.promise})}getBase64(e,t){let i=window.encodeURIComponent(e);return t=t||Ka.default.lookup(e),this.storage.getItem(i).then(n=>{var s=new ii.defer,a=new FileReader,o;if(!!n)return o=new Blob([n],{type:t}),a.addEventListener("loadend",()=>{s.resolve(a.result)}),a.readAsDataURL(o,t),s.promise})}createUrl(e,t){var i=new ii.defer,n=window.URL||window.webkitURL||window.mozURL,s,a,o=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(o?(a=this.getBase64(e),a&&a.then(function(l){this.urlCache[e]=l,i.resolve(l)}.bind(this))):(a=this.getBlob(e),a&&a.then(function(l){s=n.createObjectURL(l),this.urlCache[e]=s,i.resolve(s)}.bind(this))),a||i.reject({message:"File not found in storage: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.urlCache={},this.removeListeners()}};(0,f_.default)(Ja.prototype);var c_=Ja;fs.default=c_});var xc=$(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.default=void 0;var wc=Ie(),Ec=class{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;let t=(0,wc.qs)(e,"display_options");return t?((0,wc.qsa)(t,"option").forEach(n=>{let s="";switch(n.childNodes.length&&(s=n.childNodes[0].nodeValue),n.attributes.name.value){case"interactive":this.interactive=s;break;case"fixed-layout":this.fixedLayout=s;break;case"open-to-spread":this.openToSpread=s;break;case"orientation-lock":this.orientationLock=s;break}}),this):this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}},d_=Ec;cs.default=d_});var ro=$(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.default=void 0;var p_=ot(Ft()),Vt=Ie(),ci=ot(Ir()),Sc=ot(oi()),v_=ot(zh()),g_=ot(Uh()),m_=ot(qh()),Tc=ot(jh()),Qa=ot(Hh()),__=ot(Gh()),eo=ot(Kh()),y_=ot(ls()),b_=ot(gc()),kc=ot(Pr()),w_=ot(_t()),E_=ot(bc()),to=ot(xc()),Oc=Ct();function ot(r){return r&&r.__esModule?r:{default:r}}var Cc="META-INF/container.xml",x_="META-INF/com.apple.ibooks.display-options.xml",Ht={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"},io=class{constructor(e,t){typeof t=="undefined"&&typeof e!="string"&&!(e instanceof Blob)&&!(e instanceof ArrayBuffer)&&(t=e,e=void 0),this.settings=(0,Vt.extend)(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:void 0,canonical:void 0,openAs:void 0,store:void 0}),(0,Vt.extend)(this.settings,t),this.opening=new Vt.defer,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new Vt.defer,spine:new Vt.defer,metadata:new Vt.defer,cover:new Vt.defer,navigation:new Vt.defer,pageList:new Vt.defer,resources:new Vt.defer,displayOptions:new Vt.defer},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise,displayOptions:this.loading.displayOptions.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources,this.loaded.displayOptions]),this.isRendered=!1,this.request=this.settings.requestMethod||kc.default,this.spine=new v_.default,this.locations=new g_.default(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(i=>{var n=new Error("Cannot load book at "+e);this.emit(Oc.EVENTS.BOOK.OPEN_FAILED,n)})}open(e,t){var i,n=t||this.determineType(e);return n===Ht.BINARY?(this.archived=!0,this.url=new ci.default("/",""),i=this.openEpub(e)):n===Ht.BASE64?(this.archived=!0,this.url=new ci.default("/",""),i=this.openEpub(e,n)):n===Ht.EPUB?(this.archived=!0,this.url=new ci.default("/",""),i=this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):n==Ht.OPF?(this.url=new ci.default(e),i=this.openPackaging(this.url.Path.toString())):n==Ht.MANIFEST?(this.url=new ci.default(e),i=this.openManifest(this.url.Path.toString())):(this.url=new ci.default(e),i=this.openContainer(Cc).then(this.openPackaging.bind(this))),i}openEpub(e,t){return this.unarchive(e,t||this.settings.encoding).then(()=>this.openContainer(Cc)).then(i=>this.openPackaging(i))}openContainer(e){return this.load(e).then(t=>(this.container=new m_.default(t),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new Sc.default(e),this.load(e).then(t=>(this.packaging=new Tc.default(t),this.unpack(this.packaging)))}openManifest(e){return this.path=new Sc.default(e),this.load(e).then(t=>(this.packaging=new Tc.default,this.packaging.load(t),this.unpack(this.packaging)))}load(e){var t=this.resolve(e);return this.archived?this.archive.request(t):this.request(t,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,t){if(!!e){var i=e,n=e.indexOf("://")>-1;return n?e:(this.path&&(i=this.path.resolve(e)),t!=!1&&this.url&&(i=this.url.resolve(i)),i)}}canonical(e){var t=e;return e?(this.settings.canonical?t=this.settings.canonical(e):t=this.resolve(e,!0),t):""}determineType(e){var t,i,n;if(this.settings.encoding==="base64")return Ht.BASE64;if(typeof e!="string")return Ht.BINARY;if(t=new ci.default(e),i=t.path(),n=i.extension,n&&(n=n.replace(/\?.*$/,"")),!n)return Ht.DIRECTORY;if(n==="epub")return Ht.EPUB;if(n==="opf")return Ht.OPF;if(n==="json")return Ht.MANIFEST}unpack(e){this.package=e,this.packaging.metadata.layout===""?this.load(this.url.resolve(x_)).then(t=>{this.displayOptions=new to.default(t),this.loading.displayOptions.resolve(this.displayOptions)}).catch(t=>{this.displayOptions=new to.default,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new to.default,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new __.default(this.packaging.manifest,{archive:this.archive,resolver:this.resolve.bind(this),request:this.request.bind(this),replacements:this.settings.replacements||(this.archived?"blobUrl":"base64")}),this.loadNavigation(this.packaging).then(()=>{this.loading.navigation.resolve(this.navigation)}),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&this.settings.replacements!="none"?this.replacements().then(()=>{this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}).catch(t=>{console.error(t)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(e){let t=e.navPath||e.ncxPath,i=e.toc;return i?new Promise((n,s)=>{this.navigation=new Qa.default(i),e.pageList&&(this.pageList=new eo.default(e.pageList)),n(this.navigation)}):t?this.load(t,"xml").then(n=>(this.navigation=new Qa.default(n),this.pageList=new eo.default(n),this.navigation)):new Promise((n,s)=>{this.navigation=new Qa.default,this.pageList=new eo.default,n(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,t){return this.rendition=new y_.default(this,t),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,t){return this.archive=new b_.default,this.archive.open(e,t)}store(e){let t=this.settings.replacements&&this.settings.replacements!=="none",i=this.url,n=this.settings.requestMethod||kc.default.bind(this);return this.storage=new E_.default(e,n,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then(()=>{this.archived&&(this.storage.requester=this.archive.request.bind(this.archive));let s=(a,o)=>{o.output=this.resources.substitute(a,o.url)};this.resources.settings.replacements=t||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new ci.default("/",""),this.spine.hooks.serialize.register(s)}),this.storage.on("online",()=>{this.url=i,this.spine.hooks.serialize.deregister(s)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,t)=>{t.output=this.resources.substitute(e,t.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var t=new w_.default(e),i=this.spine.get(t.spinePos),n=this.load.bind(this);return i?i.load(n).then(function(s){var a=t.toRange(i.document);return a}):new Promise((s,a)=>{a("CFI could not be found")})}key(e){var t=e||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${Oc.EPUBJS_VERSION}:${t}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}};(0,p_.default)(io.prototype);var S_=io;ds.default=S_});var Ic=$(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.default=void 0;var Nc=wi(ro()),T_=wi(ls()),k_=wi(_t()),O_=wi(Mr()),C_=N_(Ie()),Rc=Ct(),Pb=wi(Ua()),Lb=wi(ns()),zb=wi(Xa());function Ac(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Ac=function(i){return i?t:e})(r)}function N_(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=Ac(e);if(t&&t.has(r))return t.get(r);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var a=n?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=r[s]}return i.default=r,t&&t.set(r,i),i}function wi(r){return r&&r.__esModule?r:{default:r}}function Ei(r,e){return new Nc.default(r,e)}Ei.VERSION=Rc.EPUBJS_VERSION;typeof global!="undefined"&&(global.EPUBJS_VERSION=Rc.EPUBJS_VERSION);Ei.Book=Nc.default;Ei.Rendition=T_.default;Ei.Contents=O_.default;Ei.CFI=k_.default;Ei.utils=C_;var R_=Ei;ps.default=R_});var Dc=$(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});Object.defineProperty(ri,"Book",{enumerable:!0,get:function(){return A_.default}});Object.defineProperty(ri,"Contents",{enumerable:!0,get:function(){return P_.default}});Object.defineProperty(ri,"EpubCFI",{enumerable:!0,get:function(){return I_.default}});Object.defineProperty(ri,"Layout",{enumerable:!0,get:function(){return L_.default}});Object.defineProperty(ri,"Rendition",{enumerable:!0,get:function(){return D_.default}});ri.default=void 0;var A_=Qi(ro()),I_=Qi(_t()),D_=Qi(ls()),P_=Qi(Mr()),L_=Qi(Ia()),z_=Qi(Ic());function Qi(r){return r&&r.__esModule?r:{default:r}}var M_=z_.default;ri.default=M_});var no=$(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.default=void 0;var B_={viewHolder:{position:"relative",height:"100%",width:"100%"},view:{height:"100%"}},U_=B_;vs.default=U_});var Bc=$(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.default=void 0;var gs=W_(sn()),ht=so(Zs()),F_=so(Dc()),q_=so(no());function so(r){return r&&r.__esModule?r:{default:r}}function Pc(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Pc=function(n){return n?t:e})(r)}function W_(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||xi(r)!=="object"&&typeof r!="function")return{default:r};var t=Pc(e);if(t&&t.has(r))return t.get(r);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var a=n?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=r[s]}return i.default=r,t&&t.set(r,i),i}function xi(r){return xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xi(r)}function Lc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function j_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lc(Object(t),!0).forEach(function(i){lo(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lc(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function V_(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function zc(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,Mc(i.key),i)}}function H_(r,e,t){return e&&zc(r.prototype,e),t&&zc(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Z_(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ao(r,e)}function ao(r,e){return ao=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ao(r,e)}function X_(r){var e=G_();return function(){var i=ms(r),n;if(e){var s=ms(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return Y_(this,n)}}function Y_(r,e){if(e&&(xi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oo(r)}function oo(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function G_(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function ms(r){return ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ms(r)}function lo(r,e,t){return e=Mc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mc(r){var e=$_(r,"string");return xi(e)==="symbol"?e:String(e)}function $_(r,e){if(xi(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(xi(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var uo=function(r){Z_(t,r);var e=X_(t);function t(i){var n;return V_(this,t),n=e.call(this,i),lo(oo(n),"onLocationChange",function(s){var a=n.props,o=a.location,l=a.locationChanged,u=s&&s.start;o!==u&&(n.location=u,l&&l(u))}),lo(oo(n),"handleKeyPress",function(s){var a=s.key;a&&a==="ArrowRight"&&n.nextPage(),a&&a==="ArrowLeft"&&n.prevPage()}),n.state={isLoaded:!1,toc:[]},n.viewerRef=gs.default.createRef(),n.location=i.location,n.book=n.rendition=n.prevPage=n.nextPage=null,n}return H_(t,[{key:"componentDidMount",value:function(){this.initBook(!0),document.addEventListener("keyup",this.handleKeyPress,!1)}},{key:"initBook",value:function(){var n=this,s=this.props,a=s.url,o=s.tocChanged,l=s.epubInitOptions;this.book&&this.book.destroy(),this.book=new F_.default(a,l),this.book.loaded.navigation.then(function(u){var f=u.toc;n.setState({isLoaded:!0,toc:f},function(){o&&o(f),n.initReader()})})}},{key:"componentWillUnmount",value:function(){this.book&&this.book.destroy(),this.book=this.rendition=this.prevPage=this.nextPage=null,document.removeEventListener("keyup",this.handleKeyPress,!1)}},{key:"shouldComponentUpdate",value:function(n){return!this.state.isLoaded||n.location!==this.props.location||n.location!==this.props.location}},{key:"componentDidUpdate",value:function(n){n.location!==this.props.location&&this.location!==this.props.location&&this.rendition.display(this.props.location),n.url!==this.props.url&&this.initBook()}},{key:"initReader",value:function(){var n=this,s=this.state.toc,a=this.props,o=a.location,l=a.epubOptions,u=a.getRendition,f=this.viewerRef.current;this.rendition=this.book.renderTo(f,j_({contained:!0,width:"100%",height:"100%"},l)),this.prevPage=function(){n.rendition.prev()},this.nextPage=function(){n.rendition.next()},this.registerEvents(),u&&u(this.rendition),typeof o=="string"||typeof o=="number"?this.rendition.display(o):s.length>0&&s[0].href?this.rendition.display(s[0].href):this.rendition.display()}},{key:"registerEvents",value:function(){var n=this.props,s=n.handleKeyPress,a=n.handleTextSelected;this.rendition.on("locationChanged",this.onLocationChange),this.rendition.on("keyup",s||this.handleKeyPress),a&&this.rendition.on("selected",a)}},{key:"renderBook",value:function(){var n=this.props.epubViewStyles;return gs.default.createElement("div",{ref:this.viewerRef,style:n.view})}},{key:"render",value:function(){var n=this.state.isLoaded,s=this.props,a=s.loadingView,o=s.epubViewStyles;return gs.default.createElement("div",{style:o.viewHolder},n&&this.renderBook()||a)}}]),t}(gs.Component);uo.defaultProps={loadingView:null,locationChanged:null,tocChanged:null,epubViewStyles:q_.default,epubOptions:{},epubInitOptions:{}};uo.propTypes={url:ht.default.oneOfType([ht.default.string,ht.default.instanceOf(ArrayBuffer)]),loadingView:ht.default.element,location:ht.default.oneOfType([ht.default.string,ht.default.number]),locationChanged:ht.default.func,tocChanged:ht.default.func,epubViewStyles:ht.default.object,epubInitOptions:ht.default.object,epubOptions:ht.default.object,getRendition:ht.default.func,handleKeyPress:ht.default.func,handleTextSelected:ht.default.func};var K_=uo;_s.default=K_});var Zc=$(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var ys=sn(),Uc="Left",Fc="Right",qc="Up",Wc="Down",er={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},ho={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},jc="mousemove",Vc="mouseup",J_="touchend",Q_="touchmove",ey="touchstart";function ty(r,e,t,i){return r>e?t>0?Fc:Uc:i>0?Wc:qc}function Hc(r,e){if(e===0)return r;let t=Math.PI/180*e,i=r[0]*Math.cos(t)+r[1]*Math.sin(t),n=r[1]*Math.cos(t)-r[0]*Math.sin(t);return[i,n]}function iy(r,e){let t=f=>{let d="touches"in f;d&&f.touches.length>1||r((c,v)=>{v.trackMouse&&!d&&(document.addEventListener(jc,i),document.addEventListener(Vc,a));let{clientX:g,clientY:O}=d?f.touches[0]:f,k=Hc([g,O],v.rotationAngle);return v.onTouchStartOrOnMouseDown&&v.onTouchStartOrOnMouseDown({event:f}),Object.assign(Object.assign(Object.assign({},c),ho),{initial:k.slice(),xy:k,start:f.timeStamp||0})})},i=f=>{r((d,c)=>{let v="touches"in f;if(v&&f.touches.length>1)return d;if(f.timeStamp-d.start>c.swipeDuration)return d.swiping?Object.assign(Object.assign({},d),{swiping:!1}):d;let{clientX:g,clientY:O}=v?f.touches[0]:f,[k,_]=Hc([g,O],c.rotationAngle),p=k-d.xy[0],y=_-d.xy[1],T=Math.abs(p),P=Math.abs(y),w=(f.timeStamp||0)-d.start,N=Math.sqrt(T*T+P*P)/(w||1),C=[p/(w||1),y/(w||1)],M=ty(T,P,p,y),j=typeof c.delta=="number"?c.delta:c.delta[M.toLowerCase()]||er.delta;if(T<j&&P<j&&!d.swiping)return d;let q={absX:T,absY:P,deltaX:p,deltaY:y,dir:M,event:f,first:d.first,initial:d.initial,velocity:N,vxvy:C};q.first&&c.onSwipeStart&&c.onSwipeStart(q),c.onSwiping&&c.onSwiping(q);let G=!1;return(c.onSwiping||c.onSwiped||c[`onSwiped${M}`])&&(G=!0),G&&c.preventScrollOnSwipe&&c.trackTouch&&f.cancelable&&f.preventDefault(),Object.assign(Object.assign({},d),{first:!1,eventData:q,swiping:!0})})},n=f=>{r((d,c)=>{let v;if(d.swiping&&d.eventData){if(f.timeStamp-d.start<c.swipeDuration){v=Object.assign(Object.assign({},d.eventData),{event:f}),c.onSwiped&&c.onSwiped(v);let g=c[`onSwiped${v.dir}`];g&&g(v)}}else c.onTap&&c.onTap({event:f});return c.onTouchEndOrOnMouseUp&&c.onTouchEndOrOnMouseUp({event:f}),Object.assign(Object.assign(Object.assign({},d),ho),{eventData:v})})},s=()=>{document.removeEventListener(jc,i),document.removeEventListener(Vc,a)},a=f=>{s(),n(f)},o=(f,d)=>{let c=()=>{};if(f&&f.addEventListener){let v=Object.assign(Object.assign({},er.touchEventOptions),d.touchEventOptions),g=[[ey,t,v],[Q_,i,Object.assign(Object.assign({},v),d.preventScrollOnSwipe?{passive:!1}:{})],[J_,n,v]];g.forEach(([O,k,_])=>f.addEventListener(O,k,_)),c=()=>g.forEach(([O,k])=>f.removeEventListener(O,k))}return c},u={ref:f=>{f!==null&&r((d,c)=>{if(d.el===f)return d;let v={};return d.el&&d.el!==f&&d.cleanUpTouch&&(d.cleanUpTouch(),v.cleanUpTouch=void 0),c.trackTouch&&f&&(v.cleanUpTouch=o(f,c)),Object.assign(Object.assign(Object.assign({},d),{el:f}),v)})}};return e.trackMouse&&(u.onMouseDown=t),[u,o]}function ry(r,e,t,i){return!e.trackTouch||!r.el?(r.cleanUpTouch&&r.cleanUpTouch(),Object.assign(Object.assign({},r),{cleanUpTouch:void 0})):r.cleanUpTouch?e.preventScrollOnSwipe!==t.preventScrollOnSwipe||e.touchEventOptions.passive!==t.touchEventOptions.passive?(r.cleanUpTouch(),Object.assign(Object.assign({},r),{cleanUpTouch:i(r.el,e)})):r:Object.assign(Object.assign({},r),{cleanUpTouch:i(r.el,e)})}function ny(r){let{trackMouse:e}=r,t=ys.useRef(Object.assign({},ho)),i=ys.useRef(Object.assign({},er)),n=ys.useRef(Object.assign({},i.current));n.current=Object.assign({},i.current),i.current=Object.assign(Object.assign({},er),r);let s;for(s in er)i.current[s]===void 0&&(i.current[s]=er[s]);let[a,o]=ys.useMemo(()=>iy(l=>t.current=l(t.current,i.current),{trackMouse:e}),[e]);return t.current=ry(t.current,i.current,n.current,o),a}Si.DOWN=Wc;Si.LEFT=Uc;Si.RIGHT=Fc;Si.UP=qc;Si.useSwipeable=ny});var fo=$(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.default=void 0;var sy={container:{overflow:"hidden",position:"relative",height:"100%"},readerArea:{position:"relative",zIndex:1,height:"100%",width:"100%",backgroundColor:"#fff",transition:"all .3s ease"},containerExpanded:{transform:"translateX(256px)"},titleArea:{position:"absolute",top:20,left:50,right:50,textAlign:"center",color:"#999"},reader:{position:"absolute",top:50,left:50,bottom:20,right:50},swipeWrapper:{position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:200},prev:{left:1},next:{right:1},arrow:{outline:"none",border:"none",background:"none",position:"absolute",top:"50%",marginTop:-32,fontSize:64,padding:"0 10px",color:"#E2E2E2",fontFamily:"arial, sans-serif",cursor:"pointer",userSelect:"none",appearance:"none",fontWeight:"normal"},arrowHover:{color:"#777"},tocBackground:{position:"absolute",left:256,top:0,bottom:0,right:0,zIndex:1},tocArea:{position:"absolute",left:0,top:0,bottom:0,zIndex:0,width:256,overflowY:"auto",WebkitOverflowScrolling:"touch",background:"#f2f2f2",padding:"10px 0"},tocAreaButton:{userSelect:"none",appearance:"none",background:"none",border:"none",display:"block",fontFamily:"sans-serif",width:"100%",fontSize:".9em",textAlign:"left",padding:".9em 1em",borderBottom:"1px solid #ddd",color:"#aaa",boxSizing:"border-box",outline:"none",cursor:"pointer"},tocButton:{background:"none",border:"none",width:32,height:32,position:"absolute",top:10,left:10,borderRadius:2,outline:"none",cursor:"pointer"},tocButtonExpanded:{background:"#f2f2f2"},tocButtonBar:{position:"absolute",width:"60%",background:"#ccc",height:2,left:"50%",margin:"-1px -30%",top:"50%",transition:"all .5s ease"},tocButtonBarTop:{top:"35%"},tocButtonBottom:{top:"66%"},loadingView:{position:"absolute",top:"50%",left:"10%",right:"10%",color:"#ccc",textAlign:"center",margintop:"-.5em"}},ay=sy;bs.default=ay});var nd=$(Es=>{"use strict";function Ti(r){return Ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ti(r)}Object.defineProperty(Es,"__esModule",{value:!0});Es.default=void 0;var Pe=fy(sn()),It=Yc(Zs()),oy=Zc(),ly=vo(),Xc=Yc(fo()),uy=["children"],hy=["title","showToc","loadingView","readerStyles","locationChanged","swipeable","epubViewStyles"];function Yc(r){return r&&r.__esModule?r:{default:r}}function Gc(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Gc=function(n){return n?t:e})(r)}function fy(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||Ti(r)!=="object"&&typeof r!="function")return{default:r};var t=Gc(e);if(t&&t.has(r))return t.get(r);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var a=n?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=r[s]}return i.default=r,t&&t.set(r,i),i}function jr(){return jr=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},jr.apply(this,arguments)}function $c(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Kc(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,td(i.key),i)}}function Jc(r,e,t){return e&&Kc(r.prototype,e),t&&Kc(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Qc(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&co(r,e)}function co(r,e){return co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},co(r,e)}function ed(r){var e=dy();return function(){var i=ws(r),n;if(e){var s=ws(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return cy(this,n)}}function cy(r,e){if(e&&(Ti(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ki(r)}function ki(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function dy(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function ws(r){return ws=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ws(r)}function tr(r,e,t){return e=td(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function td(r){var e=py(r,"string");return Ti(e)==="symbol"?e:String(e)}function py(r,e){if(Ti(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Ti(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function id(r,e){if(r==null)return{};var t=vy(r,e),i,n;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n<s.length;n++)i=s[n],!(e.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,i)||(t[i]=r[i]))}return t}function vy(r,e){if(r==null)return{};var t={},i=Object.keys(r),n,s;for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&(t[n]=r[n]);return t}var gy=function(e){var t=e.children,i=id(e,uy),n=(0,oy.useSwipeable)(i);return Pe.default.createElement("div",n,t)},rd=function(r){Qc(t,r);var e=ed(t);function t(){var i;$c(this,t);for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),tr(ki(i),"setLocation",function(){i.props.setLocation(i.props.href)}),i}return Jc(t,[{key:"render",value:function(){var n=this,s=this.props,a=s.label,o=s.styles,l=s.subitems;return Pe.default.createElement("div",null,Pe.default.createElement("button",{onClick:this.setLocation,style:o},a),l&&l.length>0&&Pe.default.createElement("div",{style:{paddingLeft:10}},l.map(function(u,f){return Pe.default.createElement(t,jr({key:f},n.props,u))})))}}]),t}(Pe.PureComponent);rd.propTypes={label:It.default.string,href:It.default.string,setLocation:It.default.func,styles:It.default.object};var po=function(r){Qc(t,r);var e=ed(t);function t(i){var n;return $c(this,t),n=e.call(this,i),tr(ki(n),"toggleToc",function(){n.setState({expandedToc:!n.state.expandedToc})}),tr(ki(n),"next",function(){var s=n.readerRef.current;s.nextPage()}),tr(ki(n),"prev",function(){var s=n.readerRef.current;s.prevPage()}),tr(ki(n),"onTocChange",function(s){var a=n.props.tocChanged;n.setState({toc:s},function(){return a&&a(s)})}),tr(ki(n),"setLocation",function(s){var a=n.props.locationChanged;n.setState({expandedToc:!1},function(){return a&&a(s)})}),n.readerRef=Pe.default.createRef(),n.state={expandedToc:!1,toc:!1},n}return Jc(t,[{key:"renderToc",value:function(){var n=this,s=this.state,a=s.toc,o=s.expandedToc,l=this.props.readerStyles;return Pe.default.createElement("div",null,Pe.default.createElement("div",{style:l.tocArea},Pe.default.createElement("div",{style:l.toc},a.map(function(u,f){return Pe.default.createElement(rd,jr({},u,{key:f,setLocation:n.setLocation,styles:l.tocAreaButton}))}))),o&&Pe.default.createElement("div",{style:l.tocBackground,onClick:this.toggleToc}))}},{key:"renderTocToggle",value:function(){var n=this.state.expandedToc,s=this.props.readerStyles;return Pe.default.createElement("button",{style:Object.assign({},s.tocButton,n?s.tocButtonExpanded:{}),onClick:this.toggleToc},Pe.default.createElement("span",{style:Object.assign({},s.tocButtonBar,s.tocButtonBarTop)}),Pe.default.createElement("span",{style:Object.assign({},s.tocButtonBar,s.tocButtonBottom)}))}},{key:"render",value:function(){var n=this.props,s=n.title,a=n.showToc,o=n.loadingView,l=n.readerStyles,u=n.locationChanged,f=n.swipeable,d=n.epubViewStyles,c=id(n,hy),v=this.state,g=v.toc,O=v.expandedToc;return Pe.default.createElement("div",{style:l.container},Pe.default.createElement("div",{style:Object.assign({},l.readerArea,O?l.containerExpanded:{})},a&&this.renderTocToggle(),Pe.default.createElement("div",{style:l.titleArea},s),Pe.default.createElement(gy,{onSwipedRight:this.prev,onSwipedLeft:this.next,trackMouse:!0},Pe.default.createElement("div",{style:l.reader},Pe.default.createElement(ly.EpubView,jr({ref:this.readerRef,loadingView:o,epubViewStyles:d},c,{tocChanged:this.onTocChange,locationChanged:u})),f&&Pe.default.createElement("div",{style:l.swipeWrapper}))),Pe.default.createElement("button",{style:Object.assign({},l.arrow,l.prev),onClick:this.prev},"\u2039"),Pe.default.createElement("button",{style:Object.assign({},l.arrow,l.next),onClick:this.next},"\u203A")),a&&g&&this.renderToc())}}]),t}(Pe.PureComponent);po.defaultProps={loadingView:Pe.default.createElement("div",{style:Xc.default.loadingView},"Loading\u2026"),locationChanged:null,tocChanged:null,showToc:!0,readerStyles:Xc.default};po.propTypes={title:It.default.string,loadingView:It.default.element,showToc:It.default.bool,locationChanged:It.default.func,tocChanged:It.default.func,readerStyles:It.default.object,epubViewStyles:It.default.object,swipeable:It.default.bool};var my=po;Es.default=my});var vo=$(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});Object.defineProperty(ir,"EpubView",{enumerable:!0,get:function(){return _y.default}});Object.defineProperty(ir,"EpubViewStyle",{enumerable:!0,get:function(){return yy.default}});Object.defineProperty(ir,"ReactReader",{enumerable:!0,get:function(){return by.default}});Object.defineProperty(ir,"ReactReaderStyle",{enumerable:!0,get:function(){return wy.default}});var _y=xs(Bc()),yy=xs(no()),by=xs(nd()),wy=xs(fo());function xs(r){return r&&r.__esModule?r:{default:r}}});ko(exports,{default:()=>_o});var ks=Zr(require("obsidian"));var Ut=Zr(require("obsidian")),Oo={scrolledView:!1,notePath:"/",useSameFolder:!0,tags:"notes/booknotes"},Is=class extends Ut.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:"EPUB Settings"}),new Ut.Setting(e).setName("Scrolled View").setDesc("This enables seamless scrolling between pages.").addToggle(t=>t.setValue(this.plugin.settings.scrolledView).onChange(i=>Tt(this,null,function*(){this.plugin.settings.scrolledView=i,yield this.plugin.saveSettings()}))),new Ut.Setting(e).setName("Same Folder").setDesc("When toggle on, the epub note file will be created in the same folder.").addToggle(t=>t.setValue(this.plugin.settings.useSameFolder).onChange(i=>Tt(this,null,function*(){this.plugin.settings.useSameFolder=i,yield this.plugin.saveSettings()}))),new Ut.Setting(e).setName("Note Folder").setDesc("Choose the default epub note folder. When the Same Folder toggled on, this setting is ineffective.").addDropdown(t=>t.addOptions(xd(this.app)).setValue(this.plugin.settings.notePath).onChange(i=>Tt(this,null,function*(){this.plugin.settings.notePath=i,yield this.plugin.saveSettings()}))),new Ut.Setting(e).setName("Tags").setDesc("Tags added to new note metadata.").addText(t=>{t.inputEl.size=50,t.setValue(this.plugin.settings.tags).onChange(i=>Tt(this,null,function*(){this.plugin.settings.tags=i,yield this.plugin.saveSettings()}))})}};function xd(r){let e={};return Ut.Vault.recurseChildren(r.vault.getRoot(),t=>{t instanceof Ut.TFolder&&(e[t.path]=t.path)}),e}var rr=Zr(require("obsidian"));Mi();Mi();Mi();Mi();var Oi=Zr(vo()),sd=({contents:r,title:e,scrolled:t,tocOffset:i,tocBottomOffset:n,leaf:s})=>{let[a,o]=Li(null),l=dr(null),u=f=>o(f);return cr(()=>{s.view.app.workspace.on("resize",()=>{var c;let f=s.view.containerEl.querySelector("div.epub-container");if(f==null)return;let d=getComputedStyle(f.parentElement);(c=l.current)==null||c.resize(parseFloat(d.width),parseFloat(d.height))})},[s]),et("div",{style:{height:"100vh"}},et(Oi.ReactReader,{title:e,showToc:!0,location:a,locationChanged:u,swipeable:!1,url:r,getRendition:f=>l.current=f,epubOptions:t?{allowPopups:!0,flow:"scrolled",manager:"continuous"}:void 0,readerStyles:lr(or({},Oi.ReactReaderStyle),{arrow:lr(or({},Oi.ReactReaderStyle.arrow),{boxShadow:"none"}),tocArea:lr(or({},Oi.ReactReaderStyle.tocArea),{top:i.toString()+"px",bottom:n.toString()+"px",left:"auto",backgroundColor:"currentColor",height:"auto",whiteSpace:"unset"}),tocButtonExpanded:lr(or({},Oi.ReactReaderStyle.tocButtonExpanded),{backgroundColor:"currentColor"})})}))};var Ss="epub",Ts="epub",go="doc-epub",mo=class extends rr.FileView{constructor(e,t){super(e);this.settings=t}onMoreOptionsMenu(e){e.addItem(t=>{t.setTitle("Create new epub note").setIcon("document").onClick(()=>Tt(this,null,function*(){let i=this.getFileName(),n=this.app.vault.getAbstractFileByPath(i);(n==null||!(n instanceof rr.TFile))&&(n=yield this.app.vault.create(i,this.getFileContent())),this.app.workspace.createLeafBySplit(this.leaf).openFile(n,{active:!0})}))}),e.addSeparator(),super.onMoreOptionsMenu(e)}getFileName(){let e;return this.settings.useSameFolder?e=`${this.file.parent.path}/`:e=this.settings.notePath.endsWith("/")?this.settings.notePath:`${this.settings.notePath}/`,`${e}${this.file.basename}.md`}getFileContent(){return`---
Tags: ${this.settings.tags}
Date: ${(0,rr.moment)().toLocaleString()}
---
# ${this.file.basename}
`}onLoadFile(e){return Tt(this,null,function*(){gr(this.contentEl),this.contentEl.empty();let t=getComputedStyle(this.containerEl.parentElement.querySelector("div.view-header")),i=parseFloat(t.height),n=parseFloat(t.width),s=getComputedStyle(this.containerEl.parentElement.querySelector("div.view-content")),a=parseFloat(s.paddingBottom),o=parseFloat(s.paddingTop),l=(i<n?i:0)+o+1,u=a,f=yield this.app.vault.adapter.readBinary(e.path);nn(et(sd,{contents:f,title:e.basename,scrolled:this.settings.scrolledView,tocOffset:l,tocBottomOffset:u,leaf:this.leaf}),this.contentEl)})}onunload(){gr(this.contentEl)}getDisplayText(){return this.file?this.file.basename:"No File"}canAcceptExtension(e){return e==Ss}getViewType(){return Ts}getIcon(){return go}};var _o=class extends ks.Plugin{onload(){return Tt(this,null,function*(){yield this.loadSettings(),(0,ks.addIcon)(go,`
<path
fill="currentColor"
stroke="currentColor"
d="M 90.695312 47.296875 C 90.046875 46.589844 89.136719 46.1875 88.175781 46.1875 C 87.21875 46.1875 86.304688 46.589844 85.660156 47.296875 L 70.535156 63.277344 L 52.855469 81.933594 C 51.558594 83.339844 49.734375 84.144531 47.820312 84.144531 C 45.90625 84.144531 44.078125 83.339844 42.785156 81.933594 L 17.582031 55.292969 C 14.792969 52.292969 14.792969 47.648438 17.582031 44.648438 L 42.785156 18.023438 C 44.078125 16.617188 45.90625 15.816406 47.820312 15.816406 C 49.734375 15.816406 51.558594 16.617188 52.855469 18.023438 L 64.382812 30.207031 L 40.417969 55.5 C 39.730469 56.257812 39.730469 57.410156 40.417969 58.167969 L 42.945312 60.839844 C 43.652344 61.566406 44.761719 61.566406 45.472656 60.839844 L 73.222656 31.566406 C 73.90625 30.808594 73.90625 29.652344 73.222656 28.894531 L 70.691406 26.226562 L 70.511719 26.054688 L 57.886719 12.722656 C 55.28125 9.921875 51.628906 8.332031 47.804688 8.332031 C 43.980469 8.332031 40.332031 9.921875 37.726562 12.722656 L 12.503906 39.347656 C 6.941406 45.222656 6.941406 54.769531 12.503906 60.644531 L 37.703125 87.269531 C 40.308594 90.070312 43.960938 91.664062 47.789062 91.664062 C 51.613281 91.664062 55.265625 90.070312 57.871094 87.269531 L 83.070312 60.644531 L 90.632812 52.679688 C 92.007812 51.171875 92.007812 48.863281 90.632812 47.359375 L 90.695312 47.292969 Z M 90.695312 47.296875"
/>
`),this.registerView(Ts,e=>new mo(e,this.settings));try{this.registerExtensions([Ss],Ts)}catch(e){console.log(`Existing file extension ${Ss}`)}this.addSettingTab(new Is(this.app,this))})}onunload(){}loadSettings(){return Tt(this,null,function*(){this.settings=Object.assign({},Oo,yield this.loadData())})}saveSettings(){return Tt(this,null,function*(){yield this.saveData(this.settings)})}};
/*!
JSZip v3.9.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/
/*!
localForage -- Offline Storage, Improved
Version 1.10.0
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
/* nosourcemap */