From 72b40a58caf7362af6d239e4e547c0f860217a88 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 4 Dec 2021 16:11:56 +0300 Subject: fix line-height for headings --- css/reader_iframe.less | 1 + dist/app-libs.min.js | 6 +++--- dist/reader_iframe.min.css | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/css/reader_iframe.less b/css/reader_iframe.less index 9316384..33d91a7 100644 --- a/css/reader_iframe.less +++ b/css/reader_iframe.less @@ -25,6 +25,7 @@ h1, h2, h3 { text-align : center; + line-height : normal; } @import "themes.less"; diff --git a/dist/app-libs.min.js b/dist/app-libs.min.js index a9845ae..d46cab9 100644 --- a/dist/app-libs.min.js +++ b/dist/app-libs.min.js @@ -23,11 +23,11 @@ if(function(t,e){var i,n,r=t.document,o=t.location,s=t.jQuery,a=t.$,l={},c=[],h= * Released under the MIT license * http://sizzlejs.com/ */ -function(t,e){var i,n,r,o,s,a,l,c,h,u,d,f,p,g,m,y,b,w="sizzle"+-new Date,x=t.document,_={},k=0,E=0,S=tt(),T=tt(),C=tt(),O=[],A=O.pop,N=O.push,I=O.slice,R=O.indexOf||function(t){for(var e=0,i=this.length;e+~])"+j+"*"),q=new RegExp(P),U=new RegExp("^"+z+"$"),W={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),NAME:new RegExp("^\\[name=['\"]?("+L+")['\"]?\\]"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+D),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},$=/[\x20\t\r\n\f]*[+~]/,H=/^[^{]+\{\s*\[native code/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,Z=/'|\\/g,G=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,K=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,J=function(t,e){var i="0x"+e-65536;return i!=i?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)};try{I.call(x.documentElement.childNodes,0)[0].nodeType}catch(t){I=function(t){for(var e,i=[];e=this[t++];)i.push(e);return i}}function Q(t){return H.test(t+"")}function tt(){var t,e=[];return t=function(i,n){return e.push(i+=" ")>r.cacheLength&&delete t[e.shift()],t[i]=n}}function et(t){return t[w]=!0,t}function it(t){var e=u.createElement("div");try{return t(e)}catch(t){return!1}finally{e=null}}function nt(t,e,i,n){var o,s,l,c,d,g,m,v,b,k;if((e?e.ownerDocument||e:x)!==u&&h(e),i=i||[],!t||"string"!=typeof t)return i;if(1!==(c=(e=e||u).nodeType)&&9!==c)return[];if(!f&&!n){if(o=X.exec(t))if(l=o[1]){if(9===c){if(!(s=e.getElementById(l))||!s.parentNode)return i;if(s.id===l)return i.push(s),i}else if(e.ownerDocument&&(s=e.ownerDocument.getElementById(l))&&y(e,s)&&s.id===l)return i.push(s),i}else{if(o[2])return N.apply(i,I.call(e.getElementsByTagName(t),0)),i;if((l=o[3])&&_.getByClassName&&e.getElementsByClassName)return N.apply(i,I.call(e.getElementsByClassName(l),0)),i}if(_.qsa&&!p.test(t)){if(m=!0,v=w,b=e,k=9===c&&t,1===c&&"object"!==e.nodeName.toLowerCase()){for(g=lt(t),(m=e.getAttribute("id"))?v=m.replace(Z,"\\$&"):e.setAttribute("id",v),v="[id='"+v+"'] ",d=g.length;d--;)g[d]=v+ct(g[d]);b=$.test(t)&&e.parentNode||e,k=g.join(",")}if(k)try{return N.apply(i,I.call(b.querySelectorAll(k),0)),i}catch(t){}finally{m||e.removeAttribute("id")}}}return function(t,e,i,n){var o,s,l,c,h,u=lt(t);if(!n&&1===u.length){if((s=u[0]=u[0].slice(0)).length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&!f&&r.relative[s[1].type]){if(!(e=r.find.ID(l.matches[0].replace(K,J),e)[0]))return i;t=t.slice(s.shift().value.length)}for(o=W.needsContext.test(t)?0:s.length;o--&&(l=s[o],!r.relative[c=l.type]);)if((h=r.find[c])&&(n=h(l.matches[0].replace(K,J),$.test(s[0].type)&&e.parentNode||e))){if(s.splice(o,1),!(t=n.length&&ct(s)))return N.apply(i,I.call(n,0)),i;break}}return a(t,u)(n,e,f,i,$.test(t)),i}(t.replace(B,"$1"),e,i,n)}function rt(t,e){var i=e&&t,n=i&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function ot(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function st(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function at(t){return et((function(e){return e=+e,et((function(i,n){for(var r,o=t([],i.length,e),s=o.length;s--;)i[r=o[s]]&&(i[r]=!(n[r]=i[r]))}))}))}for(i in s=nt.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},h=nt.setDocument=function(t){var e=t?t.ownerDocument||t:x;return e!==u&&9===e.nodeType&&e.documentElement?(u=e,d=e.documentElement,f=s(e),_.tagNameNoComments=it((function(t){return t.appendChild(e.createComment("")),!t.getElementsByTagName("*").length})),_.attributes=it((function(t){t.innerHTML="";var e=typeof t.lastChild.getAttribute("multiple");return"boolean"!==e&&"string"!==e})),_.getByClassName=it((function(t){return t.innerHTML="",!(!t.getElementsByClassName||!t.getElementsByClassName("e").length)&&(t.lastChild.className="e",2===t.getElementsByClassName("e").length)})),_.getByName=it((function(t){t.id=w+0,t.innerHTML="
",d.insertBefore(t,d.firstChild);var i=e.getElementsByName&&e.getElementsByName(w).length===2+e.getElementsByName(w+0).length;return _.getIdNotName=!e.getElementById(w),d.removeChild(t),i})),r.attrHandle=it((function(t){return t.innerHTML="",t.firstChild&&void 0!==t.firstChild.getAttribute&&"#"===t.firstChild.getAttribute("href")}))?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},_.getIdNotName?(r.find.ID=function(t,e){if(void 0!==e.getElementById&&!f){var i=e.getElementById(t);return i&&i.parentNode?[i]:[]}},r.filter.ID=function(t){var e=t.replace(K,J);return function(t){return t.getAttribute("id")===e}}):(r.find.ID=function(t,e){if(void 0!==e.getElementById&&!f){var i=e.getElementById(t);return i?i.id===t||void 0!==i.getAttributeNode&&i.getAttributeNode("id").value===t?[i]:void 0:[]}},r.filter.ID=function(t){var e=t.replace(K,J);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}}),r.find.TAG=_.tagNameNoComments?function(t,e){if(void 0!==e.getElementsByTagName)return e.getElementsByTagName(t)}:function(t,e){var i,n=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;i=o[r++];)1===i.nodeType&&n.push(i);return n}return o},r.find.NAME=_.getByName&&function(t,e){if(void 0!==e.getElementsByName)return e.getElementsByName(name)},r.find.CLASS=_.getByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&!f)return e.getElementsByClassName(t)},g=[],p=[":focus"],(_.qsa=Q(e.querySelectorAll))&&(it((function(t){t.innerHTML="",t.querySelectorAll("[selected]").length||p.push("\\["+j+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||p.push(":checked")})),it((function(t){t.innerHTML="",t.querySelectorAll("[i^='']").length&&p.push("[*^$]="+j+"*(?:\"\"|'')"),t.querySelectorAll(":enabled").length||p.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),p.push(",.*:")}))),(_.matchesSelector=Q(m=d.matchesSelector||d.mozMatchesSelector||d.webkitMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&it((function(t){_.disconnectedMatch=m.call(t,"div"),m.call(t,"[s!='']:x"),g.push("!=",P)})),p=new RegExp(p.join("|")),g=new RegExp(g.join("|")),y=Q(d.contains)||d.compareDocumentPosition?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},b=d.compareDocumentPosition?function(t,i){var n;return t===i?(l=!0,0):(n=i.compareDocumentPosition&&t.compareDocumentPosition&&t.compareDocumentPosition(i))?1&n||t.parentNode&&11===t.parentNode.nodeType?t===e||y(x,t)?-1:i===e||y(x,i)?1:0:4&n?-1:1:t.compareDocumentPosition?-1:1}:function(t,i){var n,r=0,o=t.parentNode,s=i.parentNode,a=[t],c=[i];if(t===i)return l=!0,0;if(!o||!s)return t===e?-1:i===e?1:o?-1:s?1:0;if(o===s)return rt(t,i);for(n=t;n=n.parentNode;)a.unshift(n);for(n=i;n=n.parentNode;)c.unshift(n);for(;a[r]===c[r];)r++;return r?rt(a[r],c[r]):a[r]===x?-1:c[r]===x?1:0},l=!1,[0,0].sort(b),_.detectDuplicates=l,u):u},nt.matches=function(t,e){return nt(t,null,null,e)},nt.matchesSelector=function(t,e){if((t.ownerDocument||t)!==u&&h(t),e=e.replace(G,"='$1']"),_.matchesSelector&&!f&&(!g||!g.test(e))&&!p.test(e))try{var i=m.call(t,e);if(i||_.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return nt(e,u,null,[t]).length>0},nt.contains=function(t,e){return(t.ownerDocument||t)!==u&&h(t),y(t,e)},nt.attr=function(t,e){var i;return(t.ownerDocument||t)!==u&&h(t),f||(e=e.toLowerCase()),(i=r.attrHandle[e])?i(t):f||_.attributes?t.getAttribute(e):((i=t.getAttributeNode(e))||t.getAttribute(e))&&!0===t[e]?e:i&&i.specified?i.value:null},nt.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},nt.uniqueSort=function(t){var e,i=[],n=1,r=0;if(l=!_.detectDuplicates,t.sort(b),l){for(;e=t[n];n++)e===t[n-1]&&(r=i.push(n));for(;r--;)t.splice(i[r],1)}return t},o=nt.getText=function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=o(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[n];n++)i+=o(e);return i},r=nt.selectors={cacheLength:50,createPseudo:et,match:W,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(K,J),t[3]=(t[4]||t[5]||"").replace(K,J),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||nt.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&nt.error(t[0]),t},PSEUDO:function(t){var e,i=!t[5]&&t[2];return W.CHILD.test(t[0])?null:(t[4]?t[2]=t[4]:i&&q.test(i)&&(e=lt(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(K,J).toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+j+")"+t+"("+j+"|$)"))&&S(t,(function(t){return e.test(t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=nt.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var c,h,u,d,f,p,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a;if(m){if(o){for(;g;){for(u=e;u=u[g];)if(a?u.nodeName.toLowerCase()===v:1===u.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?m.firstChild:m.lastChild],s&&y){for(f=(c=(h=m[w]||(m[w]={}))[t]||[])[0]===k&&c[1],d=c[0]===k&&c[2],u=f&&m.childNodes[f];u=++f&&u&&u[g]||(d=f=0)||p.pop();)if(1===u.nodeType&&++d&&u===e){h[t]=[k,f,d];break}}else if(y&&(c=(e[w]||(e[w]={}))[t])&&c[0]===k)d=c[1];else for(;(u=++f&&u&&u[g]||(d=f=0)||p.pop())&&((a?u.nodeName.toLowerCase()!==v:1!==u.nodeType)||!++d||(y&&((u[w]||(u[w]={}))[t]=[k,d]),u!==e)););return(d-=r)===n||d%n==0&&d/n>=0}}},PSEUDO:function(t,e){var i,n=r.pseudos[t]||r.setFilters[t.toLowerCase()]||nt.error("unsupported pseudo: "+t);return n[w]?n(e):n.length>1?(i=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,i){for(var r,o=n(t,e),s=o.length;s--;)t[r=R.call(t,o[s])]=!(i[r]=o[s])})):function(t){return n(t,0,i)}):n}},pseudos:{not:et((function(t){var e=[],i=[],n=a(t.replace(B,"$1"));return n[w]?et((function(t,e,i,r){for(var o,s=n(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,r,o){return e[0]=t,n(e,null,o,i),!i.pop()}})),has:et((function(t){return function(e){return nt(t,e).length>0}})),contains:et((function(t){return function(e){return(e.textContent||e.innerText||o(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||nt.error("unsupported lang: "+t),t=t.replace(K,J).toLowerCase(),function(e){var i;do{if(i=f?e.getAttribute("xml:lang")||e.getAttribute("lang"):e.lang)return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===d},focus:function(t){return t===u.activeElement&&(!u.hasFocus||u.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeName>"@"||3===t.nodeType||4===t.nodeType)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return V.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||e.toLowerCase()===t.type)},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,i){return[i<0?i+e:i]})),even:at((function(t,e){for(var i=0;i=0;)t.push(n);return t})),gt:at((function(t,e,i){for(var n=i<0?i+e:i;++n1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function dt(t,e,i,n,r){for(var o,s=[],a=0,l=t.length,c=null!=e;a-1&&(o[c]=!(s[c]=u))}}else v=dt(v===s?v.splice(p,v.length):v),r?r(null,s,v,l):N.apply(s,v)}))}function pt(t){for(var e,i,n,o=t.length,s=r.relative[t[0].type],a=s||r.relative[" "],l=s?1:0,h=ht((function(t){return t===e}),a,!0),u=ht((function(t){return R.call(e,t)>-1}),a,!0),d=[function(t,i,n){return!s&&(n||i!==c)||((e=i).nodeType?h(t,i,n):u(t,i,n))}];l1&&ut(d),l>1&&ct(t.slice(0,l-1)).replace(B,"$1"),i,l0,s=t.length>0,a=function(a,l,h,d,f){var p,g,m,v=[],y=0,b="0",w=a&&[],x=null!=f,_=c,E=a||s&&r.find.TAG("*",f&&l.parentNode||l),S=k+=null==_?1:Math.random()||.1;for(x&&(c=l!==u&&l,n=i);null!=(p=E[b]);b++){if(s&&p){for(g=0;m=t[g++];)if(m(p,l,h)){d.push(p);break}x&&(k=S,n=++i)}o&&((p=!m&&p)&&y--,a&&w.push(p))}if(y+=b,o&&b!==y){for(g=0;m=e[g++];)m(w,v,l,h);if(a){if(y>0)for(;b--;)w[b]||v[b]||(v[b]=A.call(d));v=dt(v)}N.apply(d,v),x&&!a&&v.length>0&&y+e.length>1&&nt.uniqueSort(d)}return x&&(k=S,c=_),w};return o?et(a):a}(s,o))}return a},r.pseudos.nth=r.pseudos.eq,r.filters=gt.prototype=r.pseudos,r.setFilters=new gt,h(),nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(t);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,ot=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,at={children:!0,contents:!0,next:!0,prev:!0};function lt(t,e){do{t=t[e]}while(t&&1!==t.nodeType);return t}function ct(t,e,i){if(e=e||0,v.isFunction(e))return v.grep(t,(function(t,n){return!!e.call(t,n,t)===i}));if(e.nodeType)return v.grep(t,(function(t){return t===e===i}));if("string"==typeof e){var n=v.grep(t,(function(t){return 1===t.nodeType}));if(ot.test(e))return v.filter(e,n,!i);e=v.filter(e,n)}return v.grep(t,(function(t){return v.inArray(t,e)>=0===i}))}function ht(t){var e=ut.split("|"),i=t.createDocumentFragment();if(i.createElement)for(;e.length;)i.createElement(e.pop());return i}v.fn.extend({find:function(t){var e,i,n,r=this.length;if("string"!=typeof t)return n=this,this.pushStack(v(t).filter((function(){for(e=0;e1?v.unique(i):i)).selector=(this.selector?this.selector+" ":"")+t,i},has:function(t){var e,i=v(t,this),n=i.length;return this.filter((function(){for(e=0;e=0:v.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){for(var i,n=0,r=this.length,o=[],s=st.test(t)||"string"!=typeof t?v(t,e||this.context):0;n-1:v.find.matchesSelector(i,t)){o.push(i);break}i=i.parentNode}return this.pushStack(o.length>1?v.unique(o):o)},index:function(t){return t?"string"==typeof t?v.inArray(this[0],v(t)):v.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){var i="string"==typeof t?v(t,e):v.makeArray(t&&t.nodeType?[t]:t),n=v.merge(this.get(),i);return this.pushStack(v.unique(n))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return v.dir(t,"parentNode")},parentsUntil:function(t,e,i){return v.dir(t,"parentNode",i)},next:function(t){return lt(t,"nextSibling")},prev:function(t){return lt(t,"previousSibling")},nextAll:function(t){return v.dir(t,"nextSibling")},prevAll:function(t){return v.dir(t,"previousSibling")},nextUntil:function(t,e,i){return v.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return v.dir(t,"previousSibling",i)},siblings:function(t){return v.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return v.sibling(t.firstChild)},contents:function(t){return v.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:v.merge([],t.childNodes)}},(function(t,e){v.fn[t]=function(i,n){var r=v.map(this,e,i);return nt.test(t)||(n=i),n&&"string"==typeof n&&(r=v.filter(n,r)),r=this.length>1&&!at[t]?v.unique(r):r,this.length>1&&rt.test(t)&&(r=r.reverse()),this.pushStack(r)}})),v.extend({filter:function(t,e,i){return i&&(t=":not("+t+")"),1===e.length?v.find.matchesSelector(e[0],t)?[e[0]]:[]:v.find.matches(t,e)},dir:function(t,e,i){for(var n=[],r=t[e];r&&9!==r.nodeType&&(void 0===i||1!==r.nodeType||!v(r).is(i));)1===r.nodeType&&n.push(r),r=r[e];return n},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}});var ut="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",dt=/ jQuery\d+="(?:null|\d+)"/g,ft=new RegExp("<(?:"+ut+")[\\s/>]","i"),pt=/^\s+/,gt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,mt=/<([\w:]+)/,vt=/\s*$/g,St={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:v.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},Tt=ht(r).appendChild(r.createElement("div"));function Ct(t){var e=t.getAttributeNode("type");return t.type=(e&&e.specified)+"/"+t.type,t}function Ot(t){var e=kt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function At(t,e){for(var i,n=0;null!=(i=t[n]);n++)v._data(i,"globalEval",!e||v._data(e[n],"globalEval"))}function Nt(t,e){if(1===e.nodeType&&v.hasData(t)){var i,n,r,o=v._data(t),s=v._data(e,o),a=o.events;if(a)for(i in delete s.handle,s.events={},a)for(n=0,r=a[i].length;n0)&&(e||1!==i.nodeType||v.cleanData(Rt(i)),i.parentNode&&(e&&v.contains(i.ownerDocument,i)&&At(Rt(i,"script")),i.parentNode.removeChild(i)));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&v.cleanData(Rt(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&v.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return v.clone(this,t,e)}))},html:function(t){return v.access(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(dt,""):void 0;if("string"==typeof t&&!bt.test(t)&&(v.support.htmlSerialize||!ft.test(t))&&(v.support.leadingWhitespace||!pt.test(t))&&!St[(mt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(gt,"<$1>");try{for(;i")?o=t.cloneNode(!0):(Tt.innerHTML=t.outerHTML,Tt.removeChild(o=Tt.firstChild)),!(v.support.noCloneEvent&&v.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||v.isXMLDoc(t)))for(n=Rt(o),a=Rt(t),s=0;null!=(r=a[s]);++s)n[s]&&It(r,n[s]);if(e)if(i)for(a=a||Rt(t),n=n||Rt(o),s=0;null!=(r=a[s]);s++)Nt(r,n[s]);else Nt(t,o);return(n=Rt(o,"script")).length>0&&At(n,!l&&Rt(t,"script")),n=a=r=null,o},buildFragment:function(t,e,i,n){for(var r,o,s,a,l,c,h,u=t.length,d=ht(e),f=[],p=0;p")+h[2],r=h[0];r--;)a=a.lastChild;if(!v.support.leadingWhitespace&&pt.test(o)&&f.push(e.createTextNode(pt.exec(o)[0])),!v.support.tbody)for(r=(o="table"!==l||vt.test(o)?""!==h[1]||vt.test(o)?0:a:a.firstChild)&&o.childNodes.length;r--;)v.nodeName(c=o.childNodes[r],"tbody")&&!c.childNodes.length&&o.removeChild(c);for(v.merge(f,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=d.lastChild}else f.push(e.createTextNode(o));for(a&&d.removeChild(a),v.support.appendChecked||v.grep(Rt(f,"input"),jt),p=0;o=f[p++];)if((!n||-1===v.inArray(o,n))&&(s=v.contains(o.ownerDocument,o),a=Rt(d.appendChild(o),"script"),s&&At(a),i))for(r=0;o=a[r++];)_t.test(o.type||"")&&i.push(o);return a=null,d},cleanData:function(t,e){for(var i,n,r,o,s=0,a=v.expando,l=v.cache,h=v.support.deleteExpando,u=v.event.special;null!=(i=t[s]);s++)if((e||v.acceptData(i))&&(o=(r=i[a])&&l[r])){if(o.events)for(n in o.events)u[n]?v.event.remove(i,n):v.removeEvent(i,n,o.handle);l[r]&&(delete l[r],h?delete i[a]:void 0!==i.removeAttribute?i.removeAttribute(a):i[a]=null,c.push(r))}}});var Lt,zt,Dt,Pt=/alpha\([^)]*\)/i,Bt=/opacity\s*=\s*([^)]*)/,Mt=/^(top|right|bottom|left)$/,Ft=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Ut=new RegExp("^("+y+")(.*)$","i"),Wt=new RegExp("^("+y+")(?!px)[a-z%]+$","i"),$t=new RegExp("^([+-])=("+y+")","i"),Ht={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Vt=["Top","Right","Bottom","Left"],Zt=["Webkit","O","Moz","ms"];function Gt(t,e){if(e in t)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),n=e,r=Zt.length;r--;)if((e=Zt[r]+i)in t)return e;return n}function Kt(t,e){return t=e||t,"none"===v.css(t,"display")||!v.contains(t.ownerDocument,t)}function Jt(t,e){for(var i,n,r,o=[],s=0,a=t.length;s").css("cssText","display:block !important")).appendTo(e.documentElement))[0].contentWindow||Lt[0].contentDocument).document).write(""),e.close(),i=ne(t,e),Lt.detach()),Ht[t]=i),i}function ne(t,e){var i=v(e.createElement(t)).appendTo(e.body),n=v.css(i[0],"display");return i.remove(),n}v.fn.extend({css:function(t,e){return v.access(this,(function(t,e,i){var n,r,o={},s=0;if(v.isArray(e)){for(r=zt(t),n=e.length;s1)},show:function(){return Jt(this,!0)},hide:function(){return Jt(this)},toggle:function(t){var e="boolean"==typeof t;return this.each((function(){(e?t:Kt(this))?v(this).show():v(this).hide()}))}}),v.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Dt(t,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:v.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=v.camelCase(e),l=t.style;if(e=v.cssProps[a]||(v.cssProps[a]=Gt(l,a)),s=v.cssHooks[e]||v.cssHooks[a],void 0===i)return s&&"get"in s&&void 0!==(r=s.get(t,!1,n))?r:l[e];if(!("string"===(o=typeof i)&&(r=$t.exec(i))&&(i=(r[1]+1)*r[2]+parseFloat(v.css(t,e)),o="number"),null==i||"number"===o&&isNaN(i)||("number"!==o||v.cssNumber[a]||(i+="px"),v.support.clearCloneStyle||""!==i||0!==e.indexOf("background")||(l[e]="inherit"),s&&"set"in s&&void 0===(i=s.set(t,i,n)))))try{l[e]=i}catch(t){}}},css:function(t,e,i,n){var r,o,s,a=v.camelCase(e);return e=v.cssProps[a]||(v.cssProps[a]=Gt(t.style,a)),(s=v.cssHooks[e]||v.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,i)),void 0===o&&(o=Dt(t,e,n)),"normal"===o&&e in Yt&&(o=Yt[e]),""===i||i?(r=parseFloat(o),!0===i||v.isNumeric(r)?r||0:o):o},swap:function(t,e,i,n){var r,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];for(o in r=i.apply(t,n||[]),e)t.style[o]=s[o];return r}}),t.getComputedStyle?(zt=function(e){return t.getComputedStyle(e,null)},Dt=function(t,e,i){var n,r,o,s=i||zt(t),a=s?s.getPropertyValue(e)||s[e]:void 0,l=t.style;return s&&(""!==a||v.contains(t.ownerDocument,t)||(a=v.style(t,e)),Wt.test(a)&&qt.test(e)&&(n=l.width,r=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=s.width,l.width=n,l.minWidth=r,l.maxWidth=o)),a}):r.documentElement.currentStyle&&(zt=function(t){return t.currentStyle},Dt=function(t,e,i){var n,r,o,s=i||zt(t),a=s?s[e]:void 0,l=t.style;return null==a&&l&&l[e]&&(a=l[e]),Wt.test(a)&&!Mt.test(e)&&(n=l.left,(o=(r=t.runtimeStyle)&&r.left)&&(r.left=t.currentStyle.left),l.left="fontSize"===e?"1em":a,a=l.pixelLeft+"px",l.left=n,o&&(r.left=o)),""===a?"auto":a}),v.each(["height","width"],(function(t,e){v.cssHooks[e]={get:function(t,i,n){if(i)return 0===t.offsetWidth&&Ft.test(v.css(t,"display"))?v.swap(t,Xt,(function(){return ee(t,e,n)})):ee(t,e,n)},set:function(t,i,n){var r=n&&zt(t);return Qt(0,i,n?te(t,e,n,v.support.boxSizing&&"border-box"===v.css(t,"boxSizing",!1,r),r):0)}}})),v.support.opacity||(v.cssHooks.opacity={get:function(t,e){return Bt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var i=t.style,n=t.currentStyle,r=v.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=n&&n.filter||i.filter||"";i.zoom=1,(e>=1||""===e)&&""===v.trim(o.replace(Pt,""))&&i.removeAttribute&&(i.removeAttribute("filter"),""===e||n&&!n.filter)||(i.filter=Pt.test(o)?o.replace(Pt,r):o+" "+r)}}),v((function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(t,e){if(e)return v.swap(t,{display:"inline-block"},Dt,[t,"marginRight"])}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],(function(t,e){v.cssHooks[e]={get:function(t,i){if(i)return i=Dt(t,e),Wt.test(i)?v(t).position()[e]+"px":i}}}))})),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!v.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||v.css(t,"display"))},v.expr.filters.visible=function(t){return!v.expr.filters.hidden(t)}),v.each({margin:"",padding:"",border:"Width"},(function(t,e){v.cssHooks[t+e]={expand:function(i){for(var n=0,r={},o="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+Vt[n]+e]=o[n]||o[n-2]||o[0];return r}},qt.test(t)||(v.cssHooks[t+e].set=Qt)}));var re=/%20/g,oe=/\[\]$/,se=/\r?\n/g,ae=/^(?:submit|button|image|reset|file)$/i,le=/^(?:input|select|textarea|keygen)/i;function ce(t,e,i,n){var r;if(v.isArray(e))v.each(e,(function(e,r){i||oe.test(t)?n(t,r):ce(t+"["+("object"==typeof r?e:"")+"]",r,i,n)}));else if(i||"object"!==v.type(e))n(t,e);else for(r in e)ce(t+"["+r+"]",e[r],i,n)}v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=v.prop(this,"elements");return t?v.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!v(this).is(":disabled")&&le.test(this.nodeName)&&!ae.test(t)&&(this.checked||!wt.test(t))})).map((function(t,e){var i=v(this).val();return null==i?null:v.isArray(i)?v.map(i,(function(t){return{name:e.name,value:t.replace(se,"\r\n")}})):{name:e.name,value:i.replace(se,"\r\n")}})).get()}}),v.param=function(t,e){var i,n=[],r=function(t,e){e=v.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=v.ajaxSettings&&v.ajaxSettings.traditional),v.isArray(t)||t.jquery&&!v.isPlainObject(t))v.each(t,(function(){r(this.name,this.value)}));else for(i in t)ce(i,t[i],e,r);return n.join("&").replace(re,"+")},v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(t,e){v.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}})),v.fn.hover=function(t,e){return this.mouseenter(t).mouseleave(e||t)};var he,ue,de=v.now(),fe=/\?/,pe=/#.*$/,ge=/([?&])_=[^&]*/,me=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,ve=/^(?:GET|HEAD)$/,ye=/^\/\//,be=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,we=v.fn.load,xe={},_e={},ke="*/".concat("*");try{ue=o.href}catch(t){(ue=r.createElement("a")).href="",ue=ue.href}function Ee(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,o=e.toLowerCase().match(b)||[];if(v.isFunction(i))for(;n=o[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Se(t,e,i,n){var r={},o=t===_e;function s(a){var l;return r[a]=!0,v.each(t[a]||[],(function(t,a){var c=a(e,i,n);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)})),l}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Te(t,e){var i,n,r=v.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&v.extend(!0,t,i),t}he=be.exec(ue.toLowerCase())||[],v.fn.load=function(t,e,i){if("string"!=typeof t&&we)return we.apply(this,arguments);var n,r,o,s=this,a=t.indexOf(" ");return a>=0&&(n=t.slice(a,t.length),t=t.slice(0,a)),v.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&v.ajax({url:t,type:o,dataType:"html",data:e}).done((function(t){r=arguments,s.html(n?v("
").append(v.parseHTML(t)).find(n):t)})).complete(i&&function(t,e){s.each(i,r||[t.responseText,e,t])}),this},v.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){v.fn[e]=function(t){return this.on(e,t)}})),v.each(["get","post"],(function(t,e){v[e]=function(t,i,n,r){return v.isFunction(i)&&(r=r||n,n=i,i=void 0),v.ajax({url:t,type:e,dataType:r,data:i,success:n})}})),v.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ue,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(he[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ke,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Te(Te(t,v.ajaxSettings),e):Te(v.ajaxSettings,t)},ajaxPrefilter:Ee(xe),ajaxTransport:Ee(_e),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,o,s,a,l,c,h=v.ajaxSetup({},e),u=h.context||h,d=h.context&&(u.nodeType||u.jquery)?v(u):v.event,f=v.Deferred(),p=v.Callbacks("once memory"),g=h.statusCode||{},m={},y={},w=0,x="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(2===w){if(!c)for(c={};e=me.exec(o);)c[e[1].toLowerCase()]=e[2];e=c[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===w?o:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return w||(t=y[i]=y[i]||t,m[t]=e),this},overrideMimeType:function(t){return w||(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(w<2)for(e in t)g[e]=[g[e],t[e]];else _.always(t[_.status]);return this},abort:function(t){var e=t||x;return l&&l.abort(e),k(0,e),this}};if(f.promise(_).complete=p.add,_.success=_.done,_.error=_.fail,h.url=((t||h.url||ue)+"").replace(pe,"").replace(ye,he[1]+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=v.trim(h.dataType||"*").toLowerCase().match(b)||[""],null==h.crossDomain&&(i=be.exec(h.url.toLowerCase()),h.crossDomain=!(!i||i[1]===he[1]&&i[2]===he[2]&&(i[3]||("http:"===i[1]?80:443))==(he[3]||("http:"===he[1]?80:443)))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=v.param(h.data,h.traditional)),Se(xe,h,e,_),2===w)return _;for(n in(a=h.global)&&0==v.active++&&v.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!ve.test(h.type),r=h.url,h.hasContent||(h.data&&(r=h.url+=(fe.test(r)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=ge.test(r)?r.replace(ge,"$1_="+de++):r+(fe.test(r)?"&":"?")+"_="+de++)),h.ifModified&&(v.lastModified[r]&&_.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&_.setRequestHeader("If-None-Match",v.etag[r])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&_.setRequestHeader("Content-Type",h.contentType),_.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+ke+"; q=0.01":""):h.accepts["*"]),h.headers)_.setRequestHeader(n,h.headers[n]);if(h.beforeSend&&(!1===h.beforeSend.call(u,_,h)||2===w))return _.abort();for(n in x="abort",{success:1,error:1,complete:1})_[n](h[n]);if(l=Se(_e,h,e,_)){_.readyState=1,a&&d.trigger("ajaxSend",[_,h]),h.async&&h.timeout>0&&(s=setTimeout((function(){_.abort("timeout")}),h.timeout));try{w=1,l.send(m,k)}catch(t){if(!(w<2))throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,i,n){var c,m,y,b,x,k=e;2!==w&&(w=2,s&&clearTimeout(s),l=void 0,o=n||"",_.readyState=t>0?4:0,i&&(b=function(t,e,i){var n,r,o,s,a=t.contents,l=t.dataTypes,c=t.responseFields;for(s in c)s in i&&(e[c[s]]=i[s]);for(;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in a)if(a[s]&&a[s].test(r)){l.unshift(s);break}if(l[0]in i)o=l[0];else{for(s in i){if(!l[0]||t.converters[s+" "+l[0]]){o=s;break}n||(n=s)}o=o||n}if(o)return o!==l[0]&&l.unshift(o),i[o]}(h,_,i)),t>=200&&t<300||304===t?(h.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(v.lastModified[r]=x),(x=_.getResponseHeader("etag"))&&(v.etag[r]=x)),204===t?(c=!0,k="nocontent"):304===t?(c=!0,k="notmodified"):(k=(c=function(t,e){var i,n,r,o,s={},a=0,l=t.dataTypes.slice(),c=l[0];t.dataFilter&&(e=t.dataFilter(e,t.dataType));if(l[1])for(r in t.converters)s[r.toLowerCase()]=t.converters[r];for(;n=l[++a];)if("*"!==n){if("*"!==c&&c!==n){if(!(r=s[c+" "+n]||s["* "+n]))for(i in s)if((o=i.split(" "))[1]===n&&(r=s[c+" "+o[0]]||s["* "+o[0]])){!0===r?r=s[i]:!0!==s[i]&&(n=o[0],l.splice(a--,0,n));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(t){return{state:"parsererror",error:r?t:"No conversion from "+c+" to "+n}}}c=n}return{state:"success",data:e}}(h,b)).state,m=c.data,c=!(y=c.error))):(y=k,!t&&k||(k="error",t<0&&(t=0))),_.status=t,_.statusText=(e||k)+"",c?f.resolveWith(u,[m,k,_]):f.rejectWith(u,[_,k,y]),_.statusCode(g),g=void 0,a&&d.trigger(c?"ajaxSuccess":"ajaxError",[_,h,c?m:y]),p.fireWith(u,[_,k]),a&&(d.trigger("ajaxComplete",[_,h]),--v.active||v.event.trigger("ajaxStop")))}return _},getScript:function(t,e){return v.get(t,void 0,e,"script")},getJSON:function(t,e,i){return v.get(t,e,i,"json")}}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return v.globalEval(t),t}}}),v.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)})),v.ajaxTransport("script",(function(t){if(t.crossDomain){var e,i=r.head||v("head")[0]||r.documentElement;return{send:function(n,o){(e=r.createElement("script")).async=!0,t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,i){(i||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),e=null,i||o(200,"success"))},i.insertBefore(e,i.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}}));var Ce=[],Oe=/(=)\?(?=&|$)|\?\?/;v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ce.pop()||v.expando+"_"+de++;return this[t]=!0,t}}),v.ajaxPrefilter("json jsonp",(function(e,i,n){var r,o,s,a=!1!==e.jsonp&&(Oe.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Oe.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Oe,"$1"+r):!1!==e.jsonp&&(e.url+=(fe.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return s||v.error(r+" was not called"),s[0]},e.dataTypes[0]="json",o=t[r],t[r]=function(){s=arguments},n.always((function(){t[r]=o,e[r]&&(e.jsonpCallback=i.jsonpCallback,Ce.push(r)),s&&v.isFunction(o)&&o(s[0]),s=o=void 0})),"script"}));var Ae,Ne,Ie=0,Re=t.ActiveXObject&&function(){var t;for(t in Ae)Ae[t](void 0,!0)};function je(){try{return new t.XMLHttpRequest}catch(t){}}v.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&je()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:je,Ne=v.ajaxSettings.xhr(),v.support.cors=!!Ne&&"withCredentials"in Ne,(Ne=v.support.ajax=!!Ne)&&v.ajaxTransport((function(e){var i;if(!e.crossDomain||v.support.cors)return{send:function(n,r){var o,s,a=e.xhr();if(e.username?a.open(e.type,e.url,e.async,e.username,e.password):a.open(e.type,e.url,e.async),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");try{for(s in n)a.setRequestHeader(s,n[s])}catch(t){}a.send(e.hasContent&&e.data||null),i=function(t,n){var s,l,c,h;try{if(i&&(n||4===a.readyState))if(i=void 0,o&&(a.onreadystatechange=v.noop,Re&&delete Ae[o]),n)4!==a.readyState&&a.abort();else{h={},s=a.status,l=a.getAllResponseHeaders(),"string"==typeof a.responseText&&(h.text=a.responseText);try{c=a.statusText}catch(t){c=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=h.text?200:404}}catch(t){n||r(-1,t)}h&&r(s,c,h,l)},e.async?4===a.readyState?setTimeout(i):(o=++Ie,Re&&(Ae||(Ae={},v(t).unload(Re)),Ae[o]=i),a.onreadystatechange=i):i()},abort:function(){i&&i(void 0,!0)}}}));var Le,ze,De=/^(?:toggle|show|hide)$/,Pe=new RegExp("^(?:([+-])=|)("+y+")([a-z%]*)$","i"),Be=/queueHooks$/,Me=[function(t,e,i){var n,r,o,s,a,l,c,h,u,d=this,f=t.style,p={},g=[],m=t.nodeType&&Kt(t);i.queue||(null==(h=v._queueHooks(t,"fx")).unqueued&&(h.unqueued=0,u=h.empty.fire,h.empty.fire=function(){h.unqueued||u()}),h.unqueued++,d.always((function(){d.always((function(){h.unqueued--,v.queue(t,"fx").length||h.empty.fire()}))})));1===t.nodeType&&("height"in e||"width"in e)&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],"inline"===v.css(t,"display")&&"none"===v.css(t,"float")&&(v.support.inlineBlockNeedsLayout&&"inline"!==ie(t.nodeName)?f.zoom=1:f.display="inline-block"));i.overflow&&(f.overflow="hidden",v.support.shrinkWrapBlocks||d.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})));for(r in e)if(s=e[r],De.exec(s)){if(delete e[r],l=l||"toggle"===s,s===(m?"hide":"show"))continue;g.push(r)}if(o=g.length){"hidden"in(a=v._data(t,"fxshow")||v._data(t,"fxshow",{}))&&(m=a.hidden),l&&(a.hidden=!m),m?v(t).show():d.done((function(){v(t).hide()})),d.done((function(){var e;for(e in v._removeData(t,"fxshow"),p)v.style(t,e,p[e])}));for(r=0;r-1?(r=(u=s.position()).top,o=u.left):(r=parseFloat(l)||0,o=parseFloat(c)||0),v.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(h.top=e.top-a.top+r),null!=e.left&&(h.left=e.left-a.left+o),"using"in e?e.using.call(t,h):s.css(h)}},v.fn.extend({position:function(){if(this[0]){var t,e,i={top:0,left:0},n=this[0];return"fixed"===v.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),v.nodeName(t[0],"html")||(i=t.offset()),i.top+=v.css(t[0],"borderTopWidth",!0),i.left+=v.css(t[0],"borderLeftWidth",!0)),{top:e.top-i.top-v.css(n,"marginTop",!0),left:e.left-i.left-v.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent||r.documentElement;t&&!v.nodeName(t,"html")&&"static"===v.css(t,"position");)t=t.offsetParent;return t||r.documentElement}))}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var i=/Y/.test(e);v.fn[t]=function(n){return v.access(this,(function(t,n,r){var o=He(t);if(void 0===r)return o?e in o?o[e]:o.document.documentElement[n]:t[n];o?o.scrollTo(i?v(o).scrollLeft():r,i?r:v(o).scrollTop()):t[n]=r}),t,n,arguments.length,null)}})),v.each({Height:"height",Width:"width"},(function(t,e){v.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,n){v.fn[n]=function(n,r){var o=arguments.length&&(i||"boolean"!=typeof n),s=i||(!0===n||!0===r?"margin":"border");return v.access(this,(function(e,i,n){var r;return v.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?v.css(e,i,s):v.style(e,i,n,s)}),e,o?n:void 0,o,null)}}))})),t.jQuery=t.$=v,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],(function(){return v}))}(window),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(),function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",(function(){i=!0}));return setTimeout((function(){i||t(n).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})}))}(jQuery),function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.VERSION="3.3.5",i.TRANSITION_DURATION=150,i.prototype.close=function(e){function n(){s.detach().trigger("closed.bs.alert").remove()}var r=t(this),o=r.attr("data-target");o||(o=(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]*$)/,""));var s=t(o);e&&e.preventDefault(),s.length||(s=r.closest(".alert")),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",n).emulateTransitionEnd(i.TRANSITION_DURATION):n())};var n=t.fn.alert;t.fn.alert=function(e){return this.each((function(){var n=t(this),r=n.data("bs.alert");r||n.data("bs.alert",r=new i(this)),"string"==typeof e&&r[e].call(n)}))},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),function(t){"use strict";function e(e){return this.each((function(){var n=t(this),r=n.data("bs.button"),o="object"==typeof e&&e;r||n.data("bs.button",r=new i(this,o)),"toggle"==e?r.toggle():e&&r.setState(e)}))}var i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.isLoading=!1};i.VERSION="3.3.5",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",n=this.$element,r=n.is("input")?"val":"html",o=n.data();e+="Text",null==o.resetText&&n.data("resetText",n[r]()),setTimeout(t.proxy((function(){n[r](null==o[e]?this.options[e]:o[e]),"loadingText"==e?(this.isLoading=!0,n.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i))}),this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var n=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=n,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(i){var n=t(i.target);n.hasClass("btn")||(n=n.closest(".btn")),e.call(n,"toggle"),t(i.target).is('input[type="radio"]')||t(i.target).is('input[type="checkbox"]')||i.preventDefault()})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))}))}(jQuery),function(t){"use strict";function e(e){return this.each((function(){var n=t(this),r=n.data("bs.carousel"),o=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e),s="string"==typeof e?e:o.slide;r||n.data("bs.carousel",r=new i(this,o)),"number"==typeof e?r.to(e):s?r[s]():o.interval&&r.pause().cycle()}))}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.5",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var n=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(n)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",(function(){e.to(t)})):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,n){var r=this.$element.find(".item.active"),o=n||this.getItemForDirection(e,r),s=this.interval,a="next"==e?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var c=o[0],h=t.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,s&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var u=t(this.$indicators.children()[this.getItemIndex(o)]);u&&u.addClass("active")}var d=t.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return t.support.transition&&this.$element.hasClass("slide")?(o.addClass(e),o[0].offsetWidth,r.addClass(a),o.addClass(a),r.one("bsTransitionEnd",(function(){o.removeClass([e,a].join(" ")).addClass("active"),r.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(d)}),0)})).emulateTransitionEnd(i.TRANSITION_DURATION)):(r.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),s&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var r=function(i){var n,r=t(this),o=t(r.attr("data-target")||(n=r.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(o.hasClass("carousel")){var s=t.extend({},o.data(),r.data()),a=r.attr("data-slide-to");a&&(s.interval=!1),e.call(o,s),a&&o.data("bs.carousel").to(a),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r),t(window).on("load",(function(){t('[data-ride="carousel"]').each((function(){var i=t(this);e.call(i,i.data())}))}))}(jQuery),function(t){"use strict";function e(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(n)}function i(e){return this.each((function(){var i=t(this),r=i.data("bs.collapse"),o=t.extend({},n.DEFAULTS,i.data(),"object"==typeof e&&e);!r&&o.toggle&&/show|hide/.test(e)&&(o.toggle=!1),r||i.data("bs.collapse",r=new n(this,o)),"string"==typeof e&&r[e]()}))}var n=function(e,i){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.5",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(r&&r.length&&(e=r.data("bs.collapse"),e&&e.transitioning))){var o=t.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){r&&r.length&&(i.call(r,"hide"),e||r.data("bs.collapse",null));var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var l=t.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[s](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy((function(i,n){var r=t(n);this.addAriaAndCollapsedClass(e(r),r)}),this)).end()},n.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var r=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=n,t.fn.collapse.noConflict=function(){return t.fn.collapse=r,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(n){var r=t(this);r.attr("data-target")||n.preventDefault();var o=e(r),s=o.data("bs.collapse")?"toggle":r.data();i.call(o,s)}))}(jQuery),function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=(i=e.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n=i&&t(i);return n&&n.length?n:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(r).each((function(){var n=t(this),r=e(n),o={relatedTarget:this};r.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(r[0],i.target)||(r.trigger(i=t.Event("hide.bs.dropdown",o)),i.isDefaultPrevented()||(n.attr("aria-expanded","false"),r.removeClass("open").trigger("hidden.bs.dropdown",o))))})))}var n=".dropdown-backdrop",r='[data-toggle="dropdown"]',o=function(e){t(e).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.5",o.prototype.toggle=function(n){var r=t(this);if(!r.is(".disabled, :disabled")){var o=e(r),s=o.hasClass("open");if(i(),!s){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var a={relatedTarget:this};if(o.trigger(n=t.Event("show.bs.dropdown",a)),n.isDefaultPrevented())return;r.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger("shown.bs.dropdown",a)}return!1}},o.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var n=t(this);if(i.preventDefault(),i.stopPropagation(),!n.is(".disabled, :disabled")){var o=e(n),s=o.hasClass("open");if(!s&&27!=i.which||s&&27==i.which)return 27==i.which&&o.find(r).trigger("focus"),n.trigger("click");var a=o.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(i.target);38==i.which&&l>0&&l--,40==i.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},e.prototype.init=function(e,i,n){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),o=r.length;o--;){var s=r[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",l="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return(e=t.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,(function(t,n){i[t]!=n&&(e[t]=n)})),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout((function(){"in"==i.hoverState&&i.show()}),i.options.delay.show)):i.show())},e.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout((function(){"out"==i.hoverState&&i.hide()}),i.options.delay.hide)):i.hide())},e.prototype.show=function(){var i=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(i);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(i.isDefaultPrevented()||!n)return;var r=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(a);c&&(a=a.replace(l,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),u=o[0].offsetWidth,d=o[0].offsetHeight;if(c){var f=a,p=this.getPosition(this.$viewport);a="bottom"==a&&h.bottom+d>p.bottom?"top":"top"==a&&h.top-dp.width?"left":"left"==a&&h.left-us.top+s.height&&(r.top=s.top+s.height-l)}else{var c=e.left-o,h=e.left+o+i;cs.right&&(r.left=s.left+s.width-h)}return r},e.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},e.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},e.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=this;e&&((i=t(e.currentTarget).data("bs."+this.type))||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null}))};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each((function(){var n=t(this),r=n.data("bs.tooltip"),o="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||n.data("bs.tooltip",r=new e(this,o)),"string"==typeof i&&r[i]())}))},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(jQuery),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.3.5",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=t.fn.popover;t.fn.popover=function(i){return this.each((function(){var n=t(this),r=n.data("bs.popover"),o="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||n.data("bs.popover",r=new e(this,o)),"string"==typeof i&&r[i]())}))},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(jQuery),function(t){"use strict";function e(i,n){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,n),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each((function(){var n=t(this),r=n.data("bs.scrollspy"),o="object"==typeof i&&i;r||n.data("bs.scrollspy",r=new e(this,o)),"string"==typeof i&&r[i]()}))}e.VERSION="3.3.5",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var e=t(this),r=e.data("target")||e.attr("href"),o=/^#./.test(r)&&t(r);return o&&o.length&&o.is(":visible")&&[[o[i]().top+n,r]]||null})).sort((function(t,e){return t[0]-e[0]})).each((function(){e.offsets.push(this[0]),e.targets.push(this[1])}))},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),r=this.offsets,o=this.targets,s=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=n)return s!=(t=o[o.length-1])&&this.activate(t);if(s&&e=r[t]&&(void 0===r[t+1]||e .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),a?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}var s=n.find("> .active"),a=r&&t.support.transition&&(s.length&&s.hasClass("fade")||!!n.find("> .fade").length);s.length&&a?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),s.removeClass("in")};var n=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this};var r=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery),function(t){"use strict";function e(e){return this.each((function(){var n=t(this),r=n.data("bs.affix"),o="object"==typeof e&&e;r||n.data("bs.affix",r=new i(this,o)),"string"==typeof e&&r[e]()}))}var i=function(e,n){this.options=t.extend({},i.DEFAULTS,n),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.5",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,n){var r=this.$target.scrollTop(),o=this.$element.offset(),s=this.$target.height();if(null!=i&&"top"==this.affixed)return i>r&&"top";if("bottom"==this.affixed)return null!=i?!(r+this.unpin<=o.top)&&"bottom":!(t-n>=r+s)&&"bottom";var a=null==this.affixed,l=a?r:o.top;return null!=i&&i>=r?"top":null!=n&&l+(a?s:e)>=t-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),n=this.options.offset,r=n.top,o=n.bottom,s=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(o=r=n),"function"==typeof r&&(r=n.top(this.$element)),"function"==typeof o&&(o=n.bottom(this.$element));var a=this.getState(s,e,r,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-e-o})}};var n=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=n,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var i=t(this),n=i.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),e.call(i,n)}))}))}(jQuery),function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function t(e,i,n){function r(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};e[s][0].call(h.exports,(function(t){return r(e[s][1][t]||t)}),h,h.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s>2,a=(3&e)<<4|i>>4,l=1>6:64,c=2>4,i=(15&s)<<4|(a=o.indexOf(t.charAt(c++)))>>2,n=(3&a)<<6|(l=o.indexOf(t.charAt(c++))),u[h++]=e,64!==a&&(u[h++]=i),64!==l&&(u[h++]=n);return u}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var n=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function a(t,e,i,n,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=n,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new o).pipe(new s("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var n=t("./utils"),r=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,i){var n=r,o=0+i;t^=-1;for(var s=0;s>>8^n[255&(t^e[s])];return-1^t}(0|e,t,t.length):function(t,e,i){var n=r,o=0+i;t^=-1;for(var s=0;s>>8^n[255&(t^e.charCodeAt(s))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=t("pako"),o=t("./utils"),s=t("./stream/GenericWorker"),a=n?"uint8array":"array";function l(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",o.inherits(l,s),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},l.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function n(t,e){var i,n="";for(i=0;i>>=8;return n}function r(t,e,i,r,s,h){var u,d,f=t.file,p=t.compression,g=h!==a.utf8encode,m=o.transformTo("string",h(f.name)),v=o.transformTo("string",a.utf8encode(f.name)),y=f.comment,b=o.transformTo("string",h(y)),w=o.transformTo("string",a.utf8encode(y)),x=v.length!==f.name.length,_=w.length!==y.length,k="",E="",S="",T=f.dir,C=f.date,O={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var A=0;e&&(A|=8),g||!x&&!_||(A|=2048);var N,I=0,R=0;T&&(I|=16),"UNIX"===s?(R=798,I|=((N=f.unixPermissions)||(N=T?16893:33204),(65535&N)<<16)):(R=20,I|=63&(f.dosPermissions||0)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),x&&(k+="up"+n((E=n(1,1)+n(l(m),4)+v).length,2)+E),_&&(k+="uc"+n((S=n(1,1)+n(l(b),4)+w).length,2)+S);var j="";return j+="\n\0",j+=n(A,2),j+=p.magic,j+=n(u,2),j+=n(d,2),j+=n(O.crc32,4),j+=n(O.compressedSize,4),j+=n(O.uncompressedSize,4),j+=n(m.length,2),j+=n(k.length,2),{fileRecord:c.LOCAL_FILE_HEADER+j+m+k,dirRecord:c.CENTRAL_FILE_HEADER+n(R,2)+j+n(b.length,2)+"\0\0\0\0"+n(I,4)+n(r,4)+m+k+b}}var o=t("../utils"),s=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,i,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(h,s),h.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-n-1))/i:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=r(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e,i=this.streamFiles&&!t.file.dir,o=r(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(o.dirRecord),i)this.push({data:(e=t,c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:o.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,i){"use strict";var n=t("./Uint8ArrayReader");function r(t){n.call(this,t)}t("../utils").inherits(r,n),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var n=t("./DataReader");function r(t){n.call(this,t)}t("../utils").inherits(r,n),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var n=t("./ArrayReader");function r(t){n.call(this,t)}t("../utils").inherits(r,n),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),s=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new l(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var n=t("./GenericWorker"),r=t("../utils");function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var n=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var n=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function n(t){this.name=t||"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}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i "+t:t}},e.exports=n},{}],29:[function(t,e,i){"use strict";var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),s=t("../base64"),a=t("../support"),l=t("../external"),c=null;if(a.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,i){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=i,n.checkSupport(s),this._worker=t.pipe(new r(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return e=this,i=t,new l.Promise((function(t,r){var o=[],a=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",(function(t,e){o.push(t),i&&i(e)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var e=function(t,e,i){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),i);case"base64":return s.encode(e);default:return n.transformTo(t,e)}}(l,function(t,e){var i,n=0,r=null,o=0;for(i=0;i>>6:(i<65536?e[s++]=224|i>>>12:(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63),e[s++]=128|i>>>6&63),e[s++]=128|63&i);return e}(t)},i.utf8decode=function(t){return r.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,r,o,s=t.length,l=new Array(2*s);for(e=i=0;e>10&1023,l[i++]=56320|1023&r)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(t=n.transformTo(r.uint8array?"uint8array":"array",t))},n.inherits(c,s),c.prototype.processChunk=function(t){var e=n.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var s=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}(e),l=e;s!==e.length&&(r.uint8array?(l=e.subarray(0,s),this.leftOver=e.subarray(s,e.length)):(l=e.slice(0,s),this.leftOver=e.slice(s,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=c,n.inherits(h,s),h.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),s=t("set-immediate-shim"),a=t("./external");function l(t){return t}function c(t,e){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,n,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(i<65536?e[s++]=224|i>>>12:(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63),e[s++]=128|i>>>6&63),e[s++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,r=e.length;i>10&1023,c[n++]=56320|1023&r)}return l(c,n)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+s[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,n){for(var r=65535&t|0,o=t>>>16&65535|0,s=0;0!==i;){for(i-=s=2e3>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,r){var o=n,s=r+i;t^=-1;for(var a=r;a>>8^o[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,i){"use strict";var n,r=t("../utils/common"),o=t("./trees"),s=t("./adler32"),a=t("./crc32"),l=t("./messages"),c=-2,h=258,u=262,d=113;function f(t,e){return t.msg=l[e],e}function p(t){return(t<<1)-(4t.avail_out&&(i=t.avail_out),0!==i&&(r.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function v(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,m(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var i,n,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-u?t.strstart-(t.w_size-u):0,c=t.window,d=t.w_mask,f=t.prev,p=t.strstart+h,g=c[o+s-1],m=c[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(c[(i=e)+s]===m&&c[i+s-1]===g&&c[i]===c[o]&&c[++i]===c[o+1]){o+=2,i++;do{}while(c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&ol&&0!=--r);return s<=t.lookahead?s:t.lookahead}function x(t){var e,i,n,o,l,c,h,d,f,p,g=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=g+(g-u)){for(r.arraySet(t.window,t.window,g,g,0),t.match_start-=g,t.strstart-=g,t.block_start-=g,e=i=t.hash_size;n=t.head[--e],t.head[e]=g<=n?n-g:0,--i;);for(e=i=g;n=t.prev[--e],t.prev[e]=g<=n?n-g:0,--i;);o+=g}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,d=t.strstart+t.lookahead,p=void 0,(f=o)<(p=c.avail_in)&&(p=f),i=0===p?0:(c.avail_in-=p,r.arraySet(h,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=s(c.adler,h,p,d):2===c.state.wrap&&(c.adler=a(c.adler,h,p,d)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-u&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new E(4,4,8,4,_),new E(4,5,16,8,_),new E(4,6,32,32,_),new E(4,4,16,16,k),new E(8,16,32,32,k),new E(8,16,128,128,k),new E(8,32,128,256,k),new E(32,128,258,1024,k),new E(32,258,258,4096,k)],i.deflateInit=function(t,e){return O(t,e,8,15,8,0)},i.deflateInit2=O,i.deflateReset=C,i.deflateResetKeep=T,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?c:(t.state.gzhead=e,0):c},i.deflate=function(t,e){var i,r,s,l;if(!t||!t.state||5>8&255),y(r,r.gzhead.time>>16&255),y(r,r.gzhead.time>>24&255),y(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),y(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(y(r,255&r.gzhead.extra.length),y(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(y(r,0),y(r,0),y(r,0),y(r,0),y(r,0),y(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),y(r,3),r.status=d);else{var u=8+(r.w_bits-8<<4)<<8;u|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(u|=32),u+=31-u%31,r.status=d,b(r,u),0!==r.strstart&&(b(r,t.adler>>>16),b(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending!==r.pending_buf_size));)y(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&m(t),r.pending+2<=r.pending_buf_size&&(y(r,255&t.adler),y(r,t.adler>>8&255),t.adler=0,r.status=d)):r.status=d),0!==r.pending){if(m(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(i)&&4!==e)return f(t,-5);if(666===r.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var w=2===r.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var i,n,r,s,a=t.window;;){if(t.lookahead<=h){if(x(t),t.lookahead<=h&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(r,e):n[r.level].func(r,e);if(3!==w&&4!==w||(r.status=666),1===w||3===w)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===w&&(1===e?o._tr_align(r):5!==e&&(o._tr_stored_block(r,0,0,!1),3===e&&(g(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),m(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(y(r,255&t.adler),y(r,t.adler>>8&255),y(r,t.adler>>16&255),y(r,t.adler>>24&255),y(r,255&t.total_in),y(r,t.total_in>>8&255),y(r,t.total_in>>16&255),y(r,t.total_in>>24&255)):(b(r,t.adler>>>16),b(r,65535&t.adler)),m(t),0=i.w_size&&(0===a&&(g(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new r.Buf8(i.w_size),r.arraySet(d,e,f-i.w_size,i.w_size,0),e=d,f=i.w_size),l=t.avail_in,h=t.next_in,u=t.input,t.avail_in=f,t.next_in=0,t.input=e,x(i);i.lookahead>=3;){for(n=i.strstart,o=i.lookahead-2;i.ins_h=(i.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))T[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=g[(65535&b)+(f&(1<>>=w,p-=w),p<15&&(f+=S[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=m[(65535&b)+(f&(1<>>=w,p-=w,(w=o-s)<_){if(h<(w=_-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(E=d,(k=0)===u){if(k+=c-w,w>3,f&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):l}function f(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(n.arraySet(s.window,e,i-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r<(o=s.wsize-s.wnext)&&(o=r),n.arraySet(s.window,e,i-r,o,s.wnext),(r-=o)?(n.arraySet(s.window,e,i-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,i.check=o(i.check,D,2,0),v=m=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&m)<<8)+(m>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&m)){t.msg="unknown compression method",i.mode=30;break}if(v-=4,I=8+(15&(m>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(D[0]=255&m,D[1]=m>>>8&255,i.check=o(i.check,D,2,0)),v=m=0,i.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,m+=h[d++]<>>8&255,D[2]=m>>>16&255,D[3]=m>>>24&255,i.check=o(i.check,D,4,0)),v=m=0,i.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,m+=h[d++]<>8),512&i.flags&&(D[0]=255&m,D[1]=m>>>8&255,i.check=o(i.check,D,2,0)),v=m=0,i.mode=5;case 5:if(1024&i.flags){for(;v<16;){if(0===p)break t;p--,m+=h[d++]<>>8&255,i.check=o(i.check,D,2,0)),v=m=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(p<(_=i.length)&&(_=p),_&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,h,d,_,I)),512&i.flags&&(i.check=o(i.check,h,_,d)),p-=_,d+=_,i.length-=_),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===p)break t;for(_=0;I=h[d+_++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I)),I&&_>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,m+=h[d++]<>>=7&v,v-=7&v,i.mode=27;break}for(;v<3;){if(0===p)break t;p--,m+=h[d++]<>>=1)){case 0:i.mode=14;break;case 1:if(y(i),i.mode=20,6!==e)break;m>>>=2,v-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}m>>>=2,v-=2;break;case 14:for(m>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,m+=h[d++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&m,v=m=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(_=i.length){if(p<_&&(_=p),g<_&&(_=g),0===_)break t;n.arraySet(u,h,d,_,f),p-=_,d+=_,g-=_,f+=_,i.length-=_;break}i.mode=12;break;case 17:for(;v<14;){if(0===p)break t;p--,m+=h[d++]<>>=5,v-=5,i.ndist=1+(31&m),m>>>=5,v-=5,i.ncode=4+(15&m),m>>>=4,v-=4,286>>=3,v-=3}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,j={bits:i.lenbits},R=a(0,i.lens,0,19,i.lencode,0,i.work,j),i.lenbits=j.bits,R){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,C=65535&z,!((S=z>>>24)<=v);){if(0===p)break t;p--,m+=h[d++]<>>=S,v-=S,i.lens[i.have++]=C;else{if(16===C){for(L=S+2;v>>=S,v-=S,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],_=3+(3&m),m>>>=2,v-=2}else if(17===C){for(L=S+3;v>>=S)),m>>>=3,v-=3}else{for(L=S+7;v>>=S)),m>>>=7,v-=7}if(i.have+_>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;_--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,j={bits:i.lenbits},R=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,j),i.lenbits=j.bits,R){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,j={bits:i.distbits},R=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,j),i.distbits=j.bits,R){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=p&&258<=g){t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,i.hold=m,i.bits=v,s(t,x),f=t.next_out,u=t.output,g=t.avail_out,d=t.next_in,h=t.input,p=t.avail_in,m=i.hold,v=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;T=(z=i.lencode[m&(1<>>16&255,C=65535&z,!((S=z>>>24)<=v);){if(0===p)break t;p--,m+=h[d++]<>O)])>>>16&255,C=65535&z,!(O+(S=z>>>24)<=v);){if(0===p)break t;p--,m+=h[d++]<>>=O,v-=O,i.back+=O}if(m>>>=S,v-=S,i.back+=S,i.length=C,0===T){i.mode=26;break}if(32&T){i.back=-1,i.mode=12;break}if(64&T){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&T,i.mode=22;case 22:if(i.extra){for(L=i.extra;v>>=i.extra,v-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;T=(z=i.distcode[m&(1<>>16&255,C=65535&z,!((S=z>>>24)<=v);){if(0===p)break t;p--,m+=h[d++]<>O)])>>>16&255,C=65535&z,!(O+(S=z>>>24)<=v);){if(0===p)break t;p--,m+=h[d++]<>>=O,v-=O,i.back+=O}if(m>>>=S,v-=S,i.back+=S,64&T){t.msg="invalid distance code",i.mode=30;break}i.offset=C,i.extra=15&T,i.mode=24;case 24:if(i.extra){for(L=i.extra;v>>=i.extra,v-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===g)break t;if(_=x-g,i.offset>_){if((_=i.offset-_)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}k=_>i.wnext?(_-=i.wnext,i.wsize-_):i.wnext-_,_>i.length&&(_=i.length),E=i.window}else E=u,k=f-i.offset,_=i.length;for(g<_&&(_=g),g-=_,i.length-=_;u[f++]=E[k++],--_;);0===i.length&&(i.mode=21);break;case 26:if(0===g)break t;u[f++]=i.length,g--,i.mode=21;break;case 27:if(i.wrap){for(;v<32;){if(0===p)break t;p--,m|=h[d++]<y?(w=P[B+u[E]],j[L+u[E]]):(w=96,0),f=1<>A)+(p-=f)]=b<<24|w<<16|x|0,0!==p;);for(f=1<>=1;if(0!==f?(R&=f-1,R+=f):R=0,E++,0==--z[k]){if(k===T)break;k=e[i+u[E]]}if(C>>7)]}function _(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<>>=1,i<<=1,0<--e;);return i>>>1}function T(t,e,i){var n,r,s=new Array(16),a=0;for(n=1;n<=o;n++)s[n]=a=a+i[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=S(s[l]++,l))}}function C(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function O(t){8>1;1<=i;i--)N(t,s,i);for(r=c;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],N(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,s[2*r]=s[2*i]+s[2*n],t.depth[r]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,s[2*i+1]=s[2*n+1]=r,t.heap[1]=r++,N(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,n,r,s,a,l,c=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,g=e.stat_desc.max_length,m=0;for(s=0;s<=o;s++)t.bl_count[s]=0;for(c[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)g<(s=c[2*c[2*(n=t.heap[i])+1]+1]+1)&&(s=g,m++),c[2*n+1]=s,h>=7;n<30;n++)for(y[n]=r<<7,t=0;t<1<>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),R(t,t.l_desc),R(t,t.d_desc),s=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*c[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=r&&(r=o)):r=o=i+5,i+4<=r&&-1!==e?D(t,e,i,n):4===t.strategy||o===r?(k(t,2+(n?1:0),3),I(t,h,u)):(k(t,4+(n?1:0),3),function(t,e,i,n){var r;for(k(t,e-257,5),k(t,i-1,5),k(t,n-4,4),r=0;r>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(f[i]+256+1)]++,t.dyn_dtree[2*x(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){var e;k(t,2,3),E(t,256,h),16===(e=t).bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){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}},{}],54:[function(t,e,i){"use strict";e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("xmldom"),require("JSZip")):"function"==typeof define&&define.amd?define(["xmldom","JSZip"],e):"object"==typeof exports?exports.ePub=e(require("xmldom"),require("JSZip")):t.ePub=e(t.xmldom,t.JSZip)}(window,(function(t,e){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=86)}([function(t,e,i){"use strict";i.r(e),i.d(e,"requestAnimationFrame",(function(){return r})),i.d(e,"uuid",(function(){return s})),i.d(e,"documentHeight",(function(){return a})),i.d(e,"isElement",(function(){return l})),i.d(e,"isNumber",(function(){return c})),i.d(e,"isFloat",(function(){return h})),i.d(e,"prefixed",(function(){return u})),i.d(e,"defaults",(function(){return d})),i.d(e,"extend",(function(){return f})),i.d(e,"insert",(function(){return p})),i.d(e,"locationOf",(function(){return g})),i.d(e,"indexOfSorted",(function(){return m})),i.d(e,"bounds",(function(){return v})),i.d(e,"borders",(function(){return y})),i.d(e,"nodeBounds",(function(){return b})),i.d(e,"windowBounds",(function(){return w})),i.d(e,"indexOfNode",(function(){return x})),i.d(e,"indexOfTextNode",(function(){return _})),i.d(e,"indexOfElementNode",(function(){return k})),i.d(e,"isXml",(function(){return E})),i.d(e,"createBlob",(function(){return S})),i.d(e,"createBlobUrl",(function(){return T})),i.d(e,"revokeBlobUrl",(function(){return C})),i.d(e,"createBase64Url",(function(){return O})),i.d(e,"type",(function(){return A})),i.d(e,"parse",(function(){return N})),i.d(e,"qs",(function(){return I})),i.d(e,"qsa",(function(){return R})),i.d(e,"qsp",(function(){return j})),i.d(e,"sprint",(function(){return L})),i.d(e,"treeWalker",(function(){return z})),i.d(e,"walk",(function(){return D})),i.d(e,"blob2base64",(function(){return P})),i.d(e,"defer",(function(){return B})),i.d(e,"querySelectorByType",(function(){return M})),i.d(e,"findChildren",(function(){return F})),i.d(e,"parents",(function(){return q})),i.d(e,"filterChildren",(function(){return U})),i.d(e,"getParentByTagName",(function(){return W})),i.d(e,"RangeObject",(function(){return $}));i(24),i(14),i(20);var n=i(38);const r="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),o="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function s(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:7&i|8).toString(16)}))}function a(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function l(t){return!(!t||1!=t.nodeType)}function c(t){return!isNaN(parseFloat(t))&&isFinite(t)}function h(t){let e=parseFloat(t);return!1!==c(t)&&("string"==typeof t&&t.indexOf(".")>-1||Math.floor(e)!==e)}function u(t){var e=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=t.toLowerCase(),n=["Webkit","webkit","Moz","O","ms"].length;if("undefined"==typeof document||void 0!==document.body.style[i])return t;for(var r=0;re?1:t=0?l:l+1:0===o?l:-1===o?g(t,e,i,l,a):g(t,e,i,s,l))}function m(t,e,i,n,r){var o,s=n||0,a=r||e.length,l=parseInt(s+(a-s)/2);return i||(i=function(t,e){return t>e?1:t-1}function S(t,e){return new Blob([t],{type:e})}function T(t,e){var i=S(t,e);return o.createObjectURL(i)}function C(t){return o.revokeObjectURL(t)}function O(t,e){if("string"==typeof t)return"data:"+e+";base64,"+btoa(encodeURIComponent(t))}function A(t){return Object.prototype.toString.call(t).slice(8,-1)}function N(t,e,i){var r;return r="undefined"==typeof DOMParser||i?n.DOMParser:DOMParser,65279===t.charCodeAt(0)&&(t=t.slice(1)),(new r).parseFromString(t,e)}function I(t,e){var i;if(!t)throw new Error("No Element Provided");return void 0!==t.querySelector?t.querySelector(e):(i=t.getElementsByTagName(e)).length?i[0]:void 0}function R(t,e){return void 0!==t.querySelector?t.querySelectorAll(e):t.getElementsByTagName(e)}function j(t,e,i){var n,r;if(void 0!==t.querySelector){for(var o in e+="[",i)e+=o+"~='"+i[o]+"'";return e+="]",t.querySelector(e)}if(n=t.getElementsByTagName(e),r=Array.prototype.slice.call(n,0).filter((function(t){for(var e in i)if(t.getAttribute(e)===i[e])return!0;return!1})))return r[0]}function L(t,e){void 0!==(t.ownerDocument||t).createTreeWalker?z(t,e,NodeFilter.SHOW_TEXT):D(t,(function(t){t&&3===t.nodeType&&e(t)}))}function z(t,e,i){var n=document.createTreeWalker(t,i,null,!1);let r;for(;r=n.nextNode();)e(r)}function D(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(D(t,e))return!0;t=t.nextSibling}while(t)}function P(t){return new Promise((function(e,i){var n=new FileReader;n.readAsDataURL(t),n.onloadend=function(){e(n.result)}}))}function B(){this.resolve=null,this.reject=null,this.id=s(),this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e}),Object.freeze(this)}function M(t,e,i){var n;if(void 0!==t.querySelector&&(n=t.querySelector(`${e}[*|type="${i}"]`)),n&&0!==n.length)return n;n=R(t,e);for(var r=0;r1&&(e=n[1],i.terminal=this.parseTerminal(e)),""===r[0]&&r.shift(),i.steps=r.map(function(t){return this.parseStep(t)}.bind(this)),i}parseStep(t){var e,i,n,r,o;if((r=t.match(/\[(.*)\]/))&&r[1]&&(o=r[1]),i=parseInt(t),!isNaN(i))return i%2==0?(e="element",n=i/2-1):(e="text",n=(i-1)/2),{type:e,index:n,id:o||null}}parseTerminal(t){var e,i,r=t.match(/\[(.*)\]/);return r&&r[1]?(e=parseInt(t.split("[")[0]),i=r[1]):e=parseInt(t),Object(n.isNumber)(e)||(e=null),{offset:e,assertion:i}}getChapterComponent(t){return t.split("!")[0]}getPathComponent(t){var e=t.split("!");if(e[1]){return e[1].split(",")[0]}}getRange(t){var e=t.split(",");return 3===e.length&&[e[1],e[2]]}getCharecterOffsetComponent(t){return t.split(":")[1]||""}joinSteps(t){return t?t.map((function(t){var e="";return"element"===t.type&&(e+=2*(t.index+1)),"text"===t.type&&(e+=1+2*t.index),t.id&&(e+="["+t.id+"]"),e})).join("/"):""}segmentString(t){var e="/";return e+=this.joinSteps(t.steps),t.terminal&&null!=t.terminal.offset&&(e+=":"+t.terminal.offset),t.terminal&&null!=t.terminal.assertion&&(e+="["+t.terminal.assertion+"]"),e}toString(){var t="epubcfi(";return t+=this.segmentString(this.base),t+="!",t+=this.segmentString(this.path),this.range&&this.start&&(t+=",",t+=this.segmentString(this.start)),this.range&&this.end&&(t+=",",t+=this.segmentString(this.end)),t+=")"}compare(t,e){var i,n,o,s;if("string"==typeof t&&(t=new r(t)),"string"==typeof e&&(e=new r(e)),t.spinePos>e.spinePos)return 1;if(t.spinePosn[a].index)return 1;if(i[a].indexs.offset?1:o.offset=0&&(r.terminal.offset=e,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r}equalStep(t,e){return!(!t||!e)&&(t.index===e.index&&t.id===e.id&&t.type===e.type)}fromRange(t,e,i){var n={range:!1,base:{},path:{},start:null,end:null},r=t.startContainer,o=t.endContainer,s=t.startOffset,a=t.endOffset,l=!1;if(i&&(l=null!=r.ownerDocument.querySelector("."+i)),"string"==typeof e?(n.base=this.parseComponent(e),n.spinePos=n.base.steps[1].index):"object"==typeof e&&(n.base=e),t.collapsed)l&&(s=this.patchOffset(r,s,i)),n.path=this.pathTo(r,s,i);else{n.range=!0,l&&(s=this.patchOffset(r,s,i)),n.start=this.pathTo(r,s,i),l&&(a=this.patchOffset(o,a,i)),n.end=this.pathTo(o,a,i),n.path={steps:[],terminal:null};var c,h=n.start.steps.length;for(c=0;c0&&3===r&&3===o?s[n]=a:e===r&&(a+=1,s[n]=a),o=r;return s}position(t){var e,i;return 1===t.nodeType?((e=t.parentNode.children)||(e=Object(n.findChildren)(t.parentNode)),i=Array.prototype.indexOf.call(e,t)):i=(e=this.textNodes(t.parentNode)).indexOf(t),i}filteredPosition(t,e){var i,n;return 1===t.nodeType?(i=t.parentNode.children,n=this.normalizedMap(i,1,e)):(i=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(i=(t=t.parentNode).parentNode.childNodes),n=this.normalizedMap(i,3,e)),n[Array.prototype.indexOf.call(i,t)]}stepsToXpath(t){var e=[".","*"];return t.forEach((function(t){var i=t.index+1;t.id?e.push("*[position()="+i+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+i+"]"):e.push("*["+i+"]")})),e.join("/")}stepsToQuerySelector(t){var e=["html"];return t.forEach((function(t){var i=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+i+")")})),e.join(">")}textNodes(t,e){return Array.prototype.slice.call(t.childNodes).filter((function(t){return 3===t.nodeType||!(!e||!t.classList.contains(e))}))}walkToNode(t,e,i){var r,o,s=e||document,a=s.documentElement,l=t.length;for(o=0;o(o=(r=a[t]).textContent.length))){s=1===r.nodeType?r.childNodes[0]:r;break}e-=o}}return{container:s,offset:e}}toRange(t,e){var i,r,o,s,a,l,c,h,u=t||document,d=!!e&&null!=u.querySelector("."+e);if(i=void 0!==u.createRange?u.createRange():new n.RangeObject,this.range?(r=this.start,l=this.path.steps.concat(r.steps),s=this.findNode(l,u,d?e:null),o=this.end,c=this.path.steps.concat(o.steps),a=this.findNode(c,u,d?e:null)):(r=this.path,l=this.path.steps,s=this.findNode(this.path.steps,u,d?e:null)),!s)return console.log("No startContainer found for",this.toString()),null;try{null!=r.terminal.offset?i.setStart(s,r.terminal.offset):i.setStart(s,0)}catch(t){h=this.fixMiss(l,r.terminal.offset,u,d?e:null),i.setStart(h.container,h.offset)}if(a)try{null!=o.terminal.offset?i.setEnd(a,o.terminal.offset):i.setEnd(a,0)}catch(t){h=this.fixMiss(c,this.end.terminal.offset,u,d?e:null),i.setEnd(h.container,h.offset)}return i}isCfiString(t){return"string"==typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]}generateChapterComponent(t,e,i){var n="/"+2*(t+1)+"/";return n+=2*(parseInt(e)+1),i&&(n+="["+i+"]"),n}collapse(t){this.range&&(this.range=!1,t?(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))}}e.a=r},function(t,e,i){"use strict";var n,r,o,s,a,l,c,h=i(108),u=i(122),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var i,r;return u(e),r=this,n.call(this,t,i=function(){o.call(r,t,i),d.call(e,this,arguments)}),i.__eeOnceListener__=e,this},a={on:n=function(t,e){var i;return u(e),v.call(this,"__ee__")?i=this.__ee__:(i=y.value=p(null),g(this,"__ee__",y),y.value=null),i[t]?"object"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},once:r,off:o=function(t,e){var i,n,r,o;if(u(e),!v.call(this,"__ee__"))return this;if(!(i=this.__ee__)[t])return this;if("object"==typeof(n=i[t]))for(o=0;r=n[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},emit:s=function(t){var e,i,n,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(i=arguments.length,o=new Array(i-1),e=1;e-1&&(t=new URL(t).pathname),e=this.parse(t),this.path=t,this.isDirectory(t)?this.directory=t:this.directory=e.dir+"/",this.filename=e.base,this.extension=e.ext.slice(1)}parse(t){return r.a.parse(t)}isAbsolute(t){return r.a.isAbsolute(t||this.path)}isDirectory(t){return"/"===t.charAt(t.length-1)}resolve(t){return r.a.resolve(this.directory,t)}relative(t){return t&&t.indexOf("://")>-1?t:r.a.relative(this.directory,t)}splitPath(t){return this.splitPathRe.exec(t).slice(1)}toString(){return this.path}}},function(t,e,i){"use strict";i(14),i(20);var n=i(4),r=i(9),o=i.n(r);e.a=class{constructor(t,e){var i=t.indexOf("://")>-1,r=t;if(this.Url=void 0,this.href=t,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=e,!i&&!1!==e&&"string"!=typeof e&&window&&window.location&&(this.base=window.location.href),i||this.base)try{this.base?this.Url=new URL(t,this.base):this.Url=new URL(t),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,r=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(t){this.Url=void 0,this.base&&(r=new n.a(this.base).resolve(r))}this.Path=new n.a(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(t){var e;return t.indexOf("://")>-1?t:(e=o.a.resolve(this.directory,t),this.origin+e)}relative(t){return o.a.relative(t,this.directory)}toString(){return this.href}}},function(t,e,i){"use strict";i(14);e.a=class{constructor(t){this.context=t||this,this.hooks=[]}register(){for(var t=0;t2){for(var a=n.length-1,l=a;l>=0&&47!==n.charCodeAt(l);--l);if(l!==a){n=-1===l?"":n.slice(0,l),r=s,o=0;continue}}else if(2===n.length||1===n.length){n="",r=s,o=0;continue}e&&(n.length>0?n+="/..":n="..")}else n.length>0?n+="/"+t.slice(r+1,s):n=t.slice(r+1,s);r=s,o=0}else 46===i&&-1!==o?++o:o=-1}return n}var s={resolve:function(){for(var t,e="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),r(a),0!==a.length&&(e=a+"/"+e,i=47===a.charCodeAt(0))}return e=o(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var i=1;ic){if(47===e.charCodeAt(a+u))return e.slice(a+u+1);if(0===u)return e.slice(a+u)}else o>c&&(47===t.charCodeAt(i+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(i+u);if(d!==e.charCodeAt(a+u))break;47===d&&(h=u)}var f="";for(u=i+h+1;u<=n;++u)u!==n&&47!==t.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,n=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?i?"/":".":i&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var i,n=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(i=t.length-1;i>=0;--i){var c=t.charCodeAt(i);if(47===c){if(!s){n=i+1;break}}else-1===l&&(s=!1,l=i+1),a>=0&&(c===e.charCodeAt(a)?-1==--a&&(o=i):(a=-1,o=l))}return n===o?o=l:-1===o&&(o=t.length),t.slice(n,o)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":t.slice(n,o)},extname:function(t){r(t);for(var e=-1,i=0,n=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===n&&(o=!1,n=a+1),46===l?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){i=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===i+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,n=t.charCodeAt(0),o=47===n;o?(e.root="/",i=1):i=0;for(var s=-1,a=0,l=-1,c=!0,h=t.length-1,u=0;h>=i;--h)if(47!==(n=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===n?-1===s?s=h:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){a=h+1;break}return-1===s||-1===l||0===u||1===u&&s===l-1&&s===a+1?-1!==l&&(e.base=e.name=0===a&&o?t.slice(1,l):t.slice(a,l)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null};t.exports=s},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return s})),i.d(e,"d",(function(){return a})),i.d(e,"c",(function(){return l})),i.d(e,"e",(function(){return c}));i(24);var n=i(0),r=i(5);i(4);function o(t,e){var i,r,o=e.url,s=o.indexOf("://")>-1;t&&(r=Object(n.qs)(t,"head"),(i=Object(n.qs)(r,"base"))||(i=t.createElement("base"),r.insertBefore(i,r.firstChild)),!s&&window&&window.location&&(o=window.location.origin+o),i.setAttribute("href",o))}function s(t,e){var i,r,o=e.canonical;t&&(i=Object(n.qs)(t,"head"),(r=Object(n.qs)(i,"link[rel='canonical']"))?r.setAttribute("href",o):((r=t.createElement("link")).setAttribute("rel","canonical"),r.setAttribute("href",o),i.appendChild(r)))}function a(t,e){var i,r,o=e.idref;t&&(i=Object(n.qs)(t,"head"),(r=Object(n.qs)(i,"link[property='dc.identifier']"))?r.setAttribute("content",o):((r=t.createElement("meta")).setAttribute("name","dc.identifier"),r.setAttribute("content",o),i.appendChild(r)))}function l(t,e){var i=t.querySelectorAll("a[href]");if(i.length)for(var o=Object(n.qs)(t.ownerDocument,"base"),s=o?o.getAttribute("href"):void 0,a=function(t){var i=t.getAttribute("href");if(0!==i.indexOf("mailto:"))if(i.indexOf("://")>-1)t.setAttribute("target","_blank");else{var n;try{n=new r.a(i,s)}catch(t){}t.onclick=function(){return n&&n.hash?e(n.Path.path+n.hash):e(n?n.Path.path:i),!1}}}.bind(this),l=0;l4)return t;for(i=[],n=0;n1&&"0"==r.charAt(0)&&(o=A.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)s=0;else{if(!(10==o?I:8==o?N:R).test(r))return t;s=parseInt(r,o)}i.push(s)}for(n=0;n=S(256,5-e))return null}else if(s>255)return null;for(a=i.pop(),n=0;n6)return;for(n=0;d();){if(r=null,n>0){if(!("."==d()&&n<4))return;u++}if(!O.test(d()))return;for(;O.test(d());){if(o=parseInt(d(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;u++}l[c]=256*l[c]+r,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(s=c-h,c=7;0!=c&&s>0;)a=l[c],l[c--]=l[h+s-1],l[h+--s]=a;else if(8!=c)return;return l},F=function(t){var e,i,n,r;if("number"==typeof t){for(e=[],i=0;i<4;i++)e.unshift(t%256),t=E(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,i=1,n=null,r=0,o=0;o<8;o++)0!==t[o]?(r>i&&(e=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i&&(e=n,i=r),e}(t),i=0;i<8;i++)r&&0===t[i]||(r&&(r=!1),n===i?(e+=i?":":"::",r=!0):(e+=t[i].toString(16),i<7&&(e+=":")));return"["+e+"]"}return t},q={},U=d({},q,{" ":1,'"':1,"<":1,">":1,"`":1}),W=d({},U,{"#":1,"?":1,"{":1,"}":1}),$=d({},W,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),H=function(t,e){var i=p(t,0);return i>32&&i<127&&!u(e,t)?t:encodeURIComponent(t)},X={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Y=function(t){return u(X,t.scheme)},V=function(t){return""!=t.username||""!=t.password},Z=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},G=function(t,e){var i;return 2==t.length&&T.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},K=function(t){var e;return t.length>1&&G(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},J=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&G(e[0],!0)||e.pop()},Q=function(t){return"."===t||"%2e"===t.toLowerCase()},tt={},et={},it={},nt={},rt={},ot={},st={},at={},lt={},ct={},ht={},ut={},dt={},ft={},pt={},gt={},mt={},vt={},yt={},bt={},wt={},xt=function(t,e,i,r){var o,s,a,l,c,h=i||tt,d=0,p="",g=!1,m=!1,v=!1;for(i||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(z,"")),e=e.replace(D,""),o=f(e);d<=o.length;){switch(s=o[d],h){case tt:if(!s||!T.test(s)){if(i)return"Invalid scheme";h=it;continue}p+=s.toLowerCase(),h=et;break;case et:if(s&&(C.test(s)||"+"==s||"-"==s||"."==s))p+=s.toLowerCase();else{if(":"!=s){if(i)return"Invalid scheme";p="",h=it,d=0;continue}if(i&&(Y(t)!=u(X,p)||"file"==p&&(V(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=p,i)return void(Y(t)&&X[t.scheme]==t.port&&(t.port=null));p="","file"==t.scheme?h=ft:Y(t)&&r&&r.scheme==t.scheme?h=nt:Y(t)?h=at:"/"==o[d+1]?(h=rt,d++):(t.cannotBeABaseURL=!0,t.path.push(""),h=yt)}break;case it:if(!r||r.cannotBeABaseURL&&"#"!=s)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==s){t.scheme=r.scheme,t.path=r.path.slice(),t.query=r.query,t.fragment="",t.cannotBeABaseURL=!0,h=wt;break}h="file"==r.scheme?ft:ot;continue;case nt:if("/"!=s||"/"!=o[d+1]){h=ot;continue}h=lt,d++;break;case rt:if("/"==s){h=ct;break}h=vt;continue;case ot:if(t.scheme=r.scheme,s==n)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query;else if("/"==s||"\\"==s&&Y(t))h=st;else if("?"==s)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query="",h=bt;else{if("#"!=s){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.path.pop(),h=vt;continue}t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query,t.fragment="",h=wt}break;case st:if(!Y(t)||"/"!=s&&"\\"!=s){if("/"!=s){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,h=vt;continue}h=ct}else h=lt;break;case at:if(h=lt,"/"!=s||"/"!=p.charAt(d+1))continue;d++;break;case lt:if("/"!=s&&"\\"!=s){h=ct;continue}break;case ct:if("@"==s){g&&(p="%40"+p),g=!0,a=f(p);for(var y=0;y65535)return"Invalid port";t.port=Y(t)&&x===X[t.scheme]?null:x,p=""}if(i)return;h=mt;continue}return"Invalid port"}p+=s;break;case ft:if(t.scheme="file","/"==s||"\\"==s)h=pt;else{if(!r||"file"!=r.scheme){h=vt;continue}if(s==n)t.host=r.host,t.path=r.path.slice(),t.query=r.query;else if("?"==s)t.host=r.host,t.path=r.path.slice(),t.query="",h=bt;else{if("#"!=s){K(o.slice(d).join(""))||(t.host=r.host,t.path=r.path.slice(),J(t)),h=vt;continue}t.host=r.host,t.path=r.path.slice(),t.query=r.query,t.fragment="",h=wt}}break;case pt:if("/"==s||"\\"==s){h=gt;break}r&&"file"==r.scheme&&!K(o.slice(d).join(""))&&(G(r.path[0],!0)?t.path.push(r.path[0]):t.host=r.host),h=vt;continue;case gt:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!i&&G(p))h=vt;else if(""==p){if(t.host="",i)return;h=mt}else{if(l=P(t,p))return l;if("localhost"==t.host&&(t.host=""),i)return;p="",h=mt}continue}p+=s;break;case mt:if(Y(t)){if(h=vt,"/"!=s&&"\\"!=s)continue}else if(i||"?"!=s)if(i||"#"!=s){if(s!=n&&(h=vt,"/"!=s))continue}else t.fragment="",h=wt;else t.query="",h=bt;break;case vt:if(s==n||"/"==s||"\\"==s&&Y(t)||!i&&("?"==s||"#"==s)){if(".."===(c=(c=p).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(J(t),"/"==s||"\\"==s&&Y(t)||t.path.push("")):Q(p)?"/"==s||"\\"==s&&Y(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&G(p)&&(t.host&&(t.host=""),p=p.charAt(0)+":"),t.path.push(p)),p="","file"==t.scheme&&(s==n||"?"==s||"#"==s))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==s?(t.query="",h=bt):"#"==s&&(t.fragment="",h=wt)}else p+=H(s,W);break;case yt:"?"==s?(t.query="",h=bt):"#"==s?(t.fragment="",h=wt):s!=n&&(t.path[0]+=H(s,q));break;case bt:i||"#"!=s?s!=n&&("'"==s&&Y(t)?t.query+="%27":t.query+="#"==s?"%23":H(s,q)):(t.fragment="",h=wt);break;case wt:s!=n&&(t.fragment+=H(s,U))}d++}},_t=function(t){var e,i,n=h(this,_t,"URL"),r=arguments.length>1?arguments[1]:void 0,s=String(t),a=_(n,{type:"URL"});if(void 0!==r)if(r instanceof _t)e=k(r);else if(i=xt(e={},String(r)))throw TypeError(i);if(i=xt(a,s,null,e))throw TypeError(i);var l=a.searchParams=new w,c=x(l);c.updateSearchParams(a.query),c.updateURL=function(){a.query=String(l)||null},o||(n.href=Et.call(n),n.origin=St.call(n),n.protocol=Tt.call(n),n.username=Ct.call(n),n.password=Ot.call(n),n.host=At.call(n),n.hostname=Nt.call(n),n.port=It.call(n),n.pathname=Rt.call(n),n.search=jt.call(n),n.searchParams=Lt.call(n),n.hash=zt.call(n))},kt=_t.prototype,Et=function(){var t=k(this),e=t.scheme,i=t.username,n=t.password,r=t.host,o=t.port,s=t.path,a=t.query,l=t.fragment,c=e+":";return null!==r?(c+="//",V(t)&&(c+=i+(n?":"+n:"")+"@"),c+=F(r),null!==o&&(c+=":"+o)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},St=function(){var t=k(this),e=t.scheme,i=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&Y(t)?e+"://"+F(t.host)+(null!==i?":"+i:""):"null"},Tt=function(){return k(this).scheme+":"},Ct=function(){return k(this).username},Ot=function(){return k(this).password},At=function(){var t=k(this),e=t.host,i=t.port;return null===e?"":null===i?F(e):F(e)+":"+i},Nt=function(){var t=k(this).host;return null===t?"":F(t)},It=function(){var t=k(this).port;return null===t?"":String(t)},Rt=function(){var t=k(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},jt=function(){var t=k(this).query;return t?"?"+t:""},Lt=function(){return k(this).searchParams},zt=function(){var t=k(this).fragment;return t?"#"+t:""},Dt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&l(kt,{href:Dt(Et,(function(t){var e=k(this),i=String(t),n=xt(e,i);if(n)throw TypeError(n);x(e.searchParams).updateSearchParams(e.query)})),origin:Dt(St),protocol:Dt(Tt,(function(t){var e=k(this);xt(e,String(t)+":",tt)})),username:Dt(Ct,(function(t){var e=k(this),i=f(String(t));if(!Z(e)){e.username="";for(var n=0;n{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),1==this.paused&&(this.paused=!1),this.defered.promise}flush(){return this.running?this.running:this._q.length?(this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running):void 0}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}},function(t,e,i){"use strict";var n=i(3),r=i.n(n),o=i(0);function s(){var t="reverse",e=function(){var t=document.createElement("div");t.dir="rtl",t.style.position="fixed",t.style.width="1px",t.style.height="1px",t.style.top="0px",t.style.left="0px",t.style.overflow="hidden";var e=document.createElement("div");e.style.width="2px";var i=document.createElement("span");i.style.width="1px",i.style.display="inline-block";var n=document.createElement("span");return n.style.width="1px",n.style.display="inline-block",e.appendChild(i),e.appendChild(n),t.appendChild(e),t}();return document.body.appendChild(e),e.scrollLeft>0?t="default":"undefined"!=typeof Element&&Element.prototype.scrollIntoView?(e.children[0].children[1].scrollIntoView(),e.scrollLeft<0&&(t="negative")):(e.scrollLeft=1,0===e.scrollLeft&&(t="negative")),document.body.removeChild(e),t}var a=i(23),l=i(21),c=i(84),h=i.n(c);var u=class{constructor(t){this.settings=t||{},this.id="epubjs-container-"+Object(o.uuid)(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(t){let e=t.height,i=t.width,n=t.overflow||!1,r=t.axis||"vertical",s=t.direction;Object(o.extend)(this.settings,t),t.height&&Object(o.isNumber)(t.height)&&(e=t.height+"px"),t.width&&Object(o.isNumber)(t.width)&&(i=t.width+"px");let a=document.createElement("div");return a.id=this.id,a.classList.add("epub-container"),a.style.wordSpacing="0",a.style.lineHeight="0",a.style.verticalAlign="top",a.style.position="relative","horizontal"===r&&(a.style.display="flex",a.style.flexDirection="row",a.style.flexWrap="nowrap"),i&&(a.style.width=i),e&&(a.style.height=e),n&&("scroll"===n&&"vertical"===r?(a.style["overflow-y"]=n,a.style["overflow-x"]="hidden"):"scroll"===n&&"horizontal"===r?(a.style["overflow-y"]="hidden",a.style["overflow-x"]=n):a.style.overflow=n),s&&(a.dir=s,a.style.direction=s),s&&this.settings.fullsize&&(document.body.style.direction=s),a}wrap(t){var e=document.createElement("div");return e.style.visibility="hidden",e.style.overflow="hidden",e.style.width="0",e.style.height="0",e.appendChild(t),e}getElement(t){var e;if(Object(o.isElement)(t)?e=t:"string"==typeof t&&(e=document.getElementById(t)),!e)throw new Error("Not an Element");return e}attachTo(t){var e,i=this.getElement(t);if(i)return e=this.settings.hidden?this.wrapper:this.container,i.appendChild(e),this.element=i,i}getContainer(){return this.container}onResize(t){Object(o.isNumber)(this.settings.width)&&Object(o.isNumber)(this.settings.height)||(this.resizeFunc=h()(t,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(t){this.orientationChangeFunc=t,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(t,e){var i;let n=t||this.settings.width,r=e||this.settings.height;null===t?(i=this.element.getBoundingClientRect()).width&&(t=Math.floor(i.width),this.container.style.width=t+"px"):Object(o.isNumber)(t)?this.container.style.width=t+"px":this.container.style.width=t,null===e?(i=i||this.element.getBoundingClientRect()).height&&(e=i.height,this.container.style.height=e+"px"):Object(o.isNumber)(e)?this.container.style.height=e+"px":this.container.style.height=e,Object(o.isNumber)(t)||(t=this.container.clientWidth),Object(o.isNumber)(e)||(e=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 s=Object(o.windowBounds)(),a=window.getComputedStyle(document.body),l=parseFloat(a["padding-left"])||0,c=parseFloat(a["padding-right"])||0,h=parseFloat(a["padding-top"])||0,u=parseFloat(a["padding-bottom"])||0;return n||(t=s.width-l-c),(this.settings.fullsize&&!r||!r)&&(e=s.height-h-u),{width:t-this.containerPadding.left-this.containerPadding.right,height:e-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let t;return"visible"!==this.container.style.overflow&&(t=this.container&&this.container.getBoundingClientRect()),t&&t.width&&t.height?t:Object(o.windowBounds)()}getSheet(){var t=document.createElement("style");return t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet}addStyleRules(t,e){var i="#"+this.id+" ",n="";this.sheet||(this.sheet=this.getSheet()),e.forEach((function(t){for(var e in t)t.hasOwnProperty(e)&&(n+=e+":"+t[e]+";")})),this.sheet.insertRule(i+t+" {"+n+"}",0)}axis(t){"horizontal"===t?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=t}direction(t){this.container&&(this.container.dir=t,this.container.style.direction=t),this.settings.fullsize&&(document.body.style.direction=t),this.settings.dir=t}overflow(t){this.container&&("scroll"===t&&"vertical"===this.settings.axis?(this.container.style["overflow-y"]=t,this.container.style["overflow-x"]="hidden"):"scroll"===t&&"horizontal"===this.settings.axis?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=t):this.container.style.overflow=t),this.settings.overflow=t}destroy(){this.element&&(this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}};var d=class{constructor(t){this.container=t,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(t){return this._views.indexOf(t)}slice(){return this._views.slice.apply(this._views,arguments)}get(t){return this._views[t]}append(t){return this._views.push(t),this.container&&this.container.appendChild(t.element),this.length++,t}prepend(t){return this._views.unshift(t),this.container&&this.container.insertBefore(t.element,this.container.firstChild),this.length++,t}insert(t,e){return this._views.splice(e,0,t),this.container&&(e-1&&this._views.splice(e,1),this.destroy(t),this.length--}destroy(t){t.displayed&&t.destroy(),this.container&&this.container.removeChild(t.element),t=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var t,e=this.length;if(this.length){for(var i=0;i1){if(t||0===e.index)return;if(n=e.next(),n&&!n.properties.includes("page-spread-left"))return i.call(this,n)}}display(t,e){var i=new o.defer,n=i.promise;(e===t.href||Object(o.isNumber)(e))&&(e=void 0);var r=this.views.find(t);if(r&&t&&"pre-paginated"!==this.layout.name){let t=r.offset();if("ltr"===this.settings.direction)this.scrollTo(t.left,t.top,!0);else{let e=r.width();this.scrollTo(t.left+e,t.top,!0)}if(e){let t=r.locationOf(e),i=r.width();this.moveTo(t,i)}return i.resolve(),n}this.clear();let s=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&t.properties.includes("page-spread-right")&&(s=!0),this.add(t,s).then(function(t){if(e){let i=t.locationOf(e),n=t.width();this.moveTo(i,n)}}.bind(this),t=>{i.reject(t)}).then(function(){return this.handleNextPrePaginated(s,t,this.add)}.bind(this)).then(function(){this.views.show(),i.resolve()}.bind(this)),n}afterDisplayed(t){this.emit(f.c.MANAGERS.ADDED,t)}afterResized(t){this.emit(f.c.MANAGERS.RESIZE,t.section)}moveTo(t,e){var i=0,n=0;this.isPaginated?((i=Math.floor(t.left/this.layout.delta)*this.layout.delta)+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),(n=Math.floor(t.top/this.layout.delta)*this.layout.delta)+this.layout.delta>this.container.scrollHeight&&(n=this.container.scrollHeight-this.layout.delta)):n=t.top,"rtl"===this.settings.direction&&(i+=this.layout.delta,i-=e),this.scrollTo(i,n,!0)}add(t,e){var i=this.createView(t,e);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(f.c.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}append(t,e){var i=this.createView(t,e);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(f.c.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}prepend(t,e){var i=this.createView(t,e);return i.on(f.c.VIEWS.RESIZED,t=>{this.counter(t)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(f.c.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}counter(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)}next(){var t;let e=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||e&&"ltr"!==e)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===e)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?this.container.scrollLeft>0?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next():this.container.scrollLeft+-1*this.layout.delta>-1*this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next();else if(this.isPaginated&&"vertical"===this.settings.axis){this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeightt).then(function(){this.isPaginated||"horizontal"!==this.settings.axis||"rtl"!==this.settings.direction||"default"!==this.settings.rtlScrollType||this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}}prev(){var t;let e=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||e&&"ltr"!==e)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===e)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?this.container.scrollLeft+this.container.offsetWidth0?this.scrollBy(0,-this.layout.height,!0):t=this.views.first().section.prev()}else t=this.views.first().section.prev();else this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft>0?this.scrollBy(-this.layout.delta,0,!0):t=this.views.first().section.prev();if(t){this.clear(),this.updateLayout();let e=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&"object"!=typeof t.prev()&&(e=!0),this.prepend(t,e).then(function(){var e;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&(e=t.prev()))return this.prepend(e)}.bind(this),t=>t).then(function(){this.isPaginated&&"horizontal"===this.settings.axis&&("rtl"===this.settings.direction?"default"===this.settings.rtlScrollType?this.scrollTo(0,0,!0):this.scrollTo(-1*this.container.scrollWidth+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}}current(){var t=this.visible();return t.length?t[t.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&"horizontal"===this.settings.axis?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let t=this.visible(),e=this.container.getBoundingClientRect(),i=e.height{let s,a,l,c,{index:h,href:u}=t.section,d=t.position(),f=t.width(),p=t.height();r?(s=o+e.top-d.top+0,a=s+i-0,c=this.layout.count(p,i).pages,l=i):(s=o+e.left-d.left+0,a=s+n-0,c=this.layout.count(f,n).pages,l=n);let g=Math.ceil(s/l),m=[],v=Math.ceil(a/l);if("rtl"===this.settings.direction&&!r){let t=g;g=c-v,v=c-t}m=[];for(var y=g;y<=v;y++){let t=y+1;m.push(t)}return{index:h,href:u,pages:m,totalPages:c,mapping:this.mapping.page(t.contents,t.section.cfiBase,s,a)}})}paginatedLocation(){let t=this.visible(),e=this.container.getBoundingClientRect(),i=0,n=0;return this.settings.fullsize&&(i=window.scrollX),t.map(t=>{let r,o,s,a,{index:l,href:c}=t.section,h=t.position(),u=t.width();"rtl"===this.settings.direction?(r=e.right-i,a=Math.min(Math.abs(r-h.left),this.layout.width)-n,s=h.width-(h.right-r)-n,o=s-a):(r=e.left+i,a=Math.min(h.right-r,this.layout.width)-n,o=r-h.left+n,s=o+a),n+=a;let d=this.mapping.page(t.contents,t.section.cfiBase,o,s),f=this.layout.count(u).pages,p=Math.floor(o/this.layout.pageWidth),g=[],m=Math.floor(s/this.layout.pageWidth);if(p<0&&(p=0,m+=1),"rtl"===this.settings.direction){let t=p;p=f-m,m=f-t}for(var v=p+1;v<=m;v++){let t=v;g.push(t)}return{index:l,href:c,pages:g,totalPages:f,mapping:d}})}isVisible(t,e,i,n){var r=t.position(),o=n||this.bounds();return"horizontal"===this.settings.axis&&r.right>o.left-e&&r.lefto.top-e&&r.top0&&"pre-paginated"===this.layout.name&&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(t){this.viewSettings.layout=t,this.mapping=new a.a(t.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach((function(e){e&&e.setLayout(t)}))}updateWritingMode(t){this.writingMode=t}updateAxis(t,e){(e||t!==this.settings.axis)&&(this.settings.axis=t,this.stage&&this.stage.axis(t),this.viewSettings.axis=t,this.mapping&&(this.mapping=new a.a(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&("vertical"===t?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(t,e="auto"){let i="paginated"===t||"auto"===t;this.isPaginated=i,"scrolled-doc"===t||"scrolled-continuous"===t||"scrolled"===t?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=t,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":e,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var t=[];return this.views?(this.views.forEach((function(e){const i=e&&e.contents;i&&t.push(i)})),t):t}direction(t="ltr"){this.settings.direction=t,this.stage&&this.stage.direction(t),this.viewSettings.direction=t,this.updateLayout()}isRendered(){return this.rendered}}r()(p.prototype);e.a=p},function(t,e,i){"use strict";var n=i(2),r=i(0);e.a=class{constructor(t,e,i,n=!1){this.layout=t,this.horizontal="horizontal"===i,this.direction=e||"ltr",this._dev=n}section(t){var e=this.findRanges(t);return this.rangeListToCfiList(t.section.cfiBase,e)}page(t,e,i,r){var o,s=!(!t||!t.document)&&t.document.body;if(s){if(o=this.rangePairToCfiPair(e,{start:this.findStart(s,i,r),end:this.findEnd(s,i,r)}),!0===this._dev){let e=t.document,i=new n.a(o.start).toRange(e),r=new n.a(o.end).toRange(e),s=e.defaultView.getSelection(),a=e.createRange();s.removeAllRanges(),a.setStart(i.startContainer,i.startOffset),a.setEnd(r.endContainer,r.endOffset),s.addRange(a)}return o}}walk(t,e){if(!t||t.nodeType!==Node.TEXT_NODE){var i=function(t){return t.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},n=i;n.acceptNode=i;for(var r,o,s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,n,!1);(r=s.nextNode())&&!(o=e(r)););return o}}findRanges(t){for(var e,i,n=[],r=t.contents.scrollWidth(),o=Math.ceil(r/this.layout.spreadWidth)*this.layout.divisor,s=this.layout.columnWidth,a=this.layout.gap,l=0;l{var n,o,l,c,h;if(h=Object(r.nodeBounds)(t),this.horizontal&&"ltr"===this.direction){if(n=this.horizontal?h.left:h.top,o=this.horizontal?h.right:h.bottom,n>=e&&n<=i)return t;if(o>e)return t;a=t,s.push(t)}else if(this.horizontal&&"rtl"===this.direction){if(n=h.left,(o=h.right)<=i&&o>=e)return t;if(n=e&&l<=i)return t;if(c>e)return t;a=t,s.push(t)}}))return this.findTextStartRange(o,e,i);return this.findTextStartRange(a,e,i)}findEnd(t,e,i){for(var n,o,s=[t],a=t;s.length;)if(n=s.shift(),o=this.walk(n,t=>{var n,o,l,c,h;if(h=Object(r.nodeBounds)(t),this.horizontal&&"ltr"===this.direction){if(n=Math.round(h.left),o=Math.round(h.right),n>i&&a)return a;if(o>i)return t;a=t,s.push(t)}else if(this.horizontal&&"rtl"===this.direction){if(n=Math.round(this.horizontal?h.left:h.top),(o=Math.round(this.horizontal?h.right:h.bottom))i&&a)return a;if(c>i)return t;a=t,s.push(t)}}))return this.findTextEndRange(o,e,i);return this.findTextEndRange(a,e,i)}findTextStartRange(t,e,i){for(var n,r,o=this.splitTextNodeIntoRanges(t),s=0;s=e)return n}else if(this.horizontal&&"rtl"===this.direction){if(r.right<=i)return n}else if(r.top>=e)return n;return o[0]}findTextEndRange(t,e,i){for(var n,r,o,s,a,l,c,h=this.splitTextNodeIntoRanges(t),u=0;ui&&n)return n;if(a>i)return r}else if(this.horizontal&&"rtl"===this.direction){if(s=o.left,(a=o.right)i&&n)return n;if(c>i)return r}n=r}return h[h.length-1]}splitTextNodeIntoRanges(t,e){var i,n=[],r=(t.textContent||"").trim(),o=t.ownerDocument,s=e||" ",a=r.indexOf(s);if(-1===a||t.nodeType!=Node.TEXT_NODE)return(i=o.createRange()).selectNodeContents(t),[i];for((i=o.createRange()).setStart(t,0),i.setEnd(t,a),n.push(i),i=!1;-1!=a;)(a=r.indexOf(s,a+1))>0&&(i&&(i.setEnd(t,a),n.push(i)),(i=o.createRange()).setStart(t,a+1));return i&&(i.setEnd(t,r.length),n.push(i)),n}rangePairToCfiPair(t,e){var i=e.start,r=e.end;return i.collapse(!0),r.collapse(!1),{start:new n.a(i,t).toString(),end:new n.a(r,t).toString()}}rangeListToCfiList(t,e){for(var i,n=[],r=0;r]*>)/g,g=/\$([$&'`]|\d\d?)/g;n("replace",2,(function(t,e,i,n){var m=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,v=n.REPLACE_KEEPS_$0,y=m?"$":"$0";return[function(i,n){var r=l(this),o=null==i?void 0:i[t];return void 0!==o?o.call(i,r,n):e.call(String(r),i,n)},function(t,n){if(!m&&v||"string"==typeof n&&-1===n.indexOf(y)){var o=i(e,t,this,n);if(o.done)return o.value}var l=r(t),f=String(this),p="function"==typeof n;p||(n=String(n));var g=l.global;if(g){var w=l.unicode;l.lastIndex=0}for(var x=[];;){var _=h(l,f);if(null===_)break;if(x.push(_),!g)break;""===String(_[0])&&(l.lastIndex=c(f,s(l.lastIndex),w))}for(var k,E="",S=0,T=0;T=S&&(E+=f.slice(S,O)+j,S=O+C.length)}return E+f.slice(S)}];function b(t,i,n,r,s,a){var l=n+t.length,c=r.length,h=g;return void 0!==s&&(s=o(s),h=p),e.call(a,h,(function(e,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return i.slice(0,n);case"'":return i.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var h=+o;if(0===h)return e;if(h>c){var u=f(h/10);return 0===u?e:u<=c?void 0===r[u-1]?o.charAt(1):r[u-1]+o.charAt(1):e}a=r[h-1]}return void 0===a?"":a}))}}))},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var n,r,o,s=i(89),a=i(7),l=i(17),c=i(15),h=i(10),u=i(43),d=i(44),f=a.WeakMap;if(s){var p=new f,g=p.get,m=p.has,v=p.set;n=function(t,e){return v.call(p,t,e),e},r=function(t){return g.call(p,t)||{}},o=function(t){return m.call(p,t)}}else{var y=u("state");d[y]=!0,n=function(t,e){return c(t,y,e),e},r=function(t){return h(t,y)?t[y]:{}},o=function(t){return h(t,y)}}t.exports={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}}},function(t,e){t.exports={}},function(t,e,i){"use strict";var n=i(3),r=i.n(n),o=i(0),s=i(2),a=i(23),l=i(11),c=i(1);const h="undefined"!=typeof navigator,u=h&&/Chrome/.test(navigator.userAgent),d=h&&!u&&/AppleWebKit/.test(navigator.userAgent);class f{constructor(t,e,i,n){this.epubcfi=new s.a,this.document=t,this.documentElement=this.document.documentElement,this.content=e||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",c.b),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return c.a}width(t){var e=this.content;return t&&Object(o.isNumber)(t)&&(t+="px"),t&&(e.style.width=t),parseInt(this.window.getComputedStyle(e).width)}height(t){var e=this.content;return t&&Object(o.isNumber)(t)&&(t+="px"),t&&(e.style.height=t),parseInt(this.window.getComputedStyle(e).height)}contentWidth(t){var e=this.content||this.document.body;return t&&Object(o.isNumber)(t)&&(t+="px"),t&&(e.style.width=t),parseInt(this.window.getComputedStyle(e).width)}contentHeight(t){var e=this.content||this.document.body;return t&&Object(o.isNumber)(t)&&(t+="px"),t&&(e.style.height=t),parseInt(this.window.getComputedStyle(e).height)}textWidth(){let t,e,i=this.document.createRange(),n=this.content||this.document.body,r=Object(o.borders)(n);return i.selectNodeContents(n),t=i.getBoundingClientRect(),e=t.width,r&&r.width&&(e+=r.width),Math.round(e)}textHeight(){let t,e,i=this.document.createRange(),n=this.content||this.document.body;return i.selectNodeContents(n),t=i.getBoundingClientRect(),e=t.bottom,Math.round(e)}scrollWidth(){return this.documentElement.scrollWidth}scrollHeight(){return this.documentElement.scrollHeight}overflow(t){return t&&(this.documentElement.style.overflow=t),this.window.getComputedStyle(this.documentElement).overflow}overflowX(t){return t&&(this.documentElement.style.overflowX=t),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(t){return t&&(this.documentElement.style.overflowY=t),this.window.getComputedStyle(this.documentElement).overflowY}css(t,e,i){var n=this.content||this.document.body;return e?n.style.setProperty(t,e,i?"important":""):n.style.removeProperty(t),this.window.getComputedStyle(n)[t]}viewport(t){var e,i=this.document.querySelector("meta[name='viewport']"),n={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},r=[];if(i&&i.hasAttribute("content")){let t=i.getAttribute("content"),e=t.match(/width\s*=\s*([^,]*)/),r=t.match(/height\s*=\s*([^,]*)/),o=t.match(/initial-scale\s*=\s*([^,]*)/),s=t.match(/minimum-scale\s*=\s*([^,]*)/),a=t.match(/maximum-scale\s*=\s*([^,]*)/),l=t.match(/user-scalable\s*=\s*([^,]*)/);e&&e.length&&void 0!==e[1]&&(n.width=e[1]),r&&r.length&&void 0!==r[1]&&(n.height=r[1]),o&&o.length&&void 0!==o[1]&&(n.scale=o[1]),s&&s.length&&void 0!==s[1]&&(n.minimum=s[1]),a&&a.length&&void 0!==a[1]&&(n.maximum=a[1]),l&&l.length&&void 0!==l[1]&&(n.scalable=l[1])}return e=Object(o.defaults)(t||{},n),t&&(e.width&&r.push("width="+e.width),e.height&&r.push("height="+e.height),e.scale&&r.push("initial-scale="+e.scale),"no"===e.scalable?(r.push("minimum-scale="+e.scale),r.push("maximum-scale="+e.scale),r.push("user-scalable="+e.scalable)):(e.scalable&&r.push("user-scalable="+e.scalable),e.minimum&&r.push("minimum-scale="+e.minimum),e.maximum&&r.push("minimum-scale="+e.maximum)),i||((i=this.document.createElement("meta")).setAttribute("name","viewport"),this.document.querySelector("head").appendChild(i)),i.setAttribute("content",r.join(", ")),this.window.scrollTo(0,0)),e}expand(){this.emit(c.c.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),"undefined"==typeof ResizeObserver?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let t=this.textWidth(),e=this.textHeight();t==this._size.width&&e==this._size.height||(this._size={width:t,height:e},this.onResize&&this.onResize(this._size),this.emit(c.c.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&!1===this.active?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let t=this.content;t.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",t.style.transitionDuration="0.001ms",t.style.transitionTimingFunction="linear",t.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var t=this.document.styleSheets,e=function(t){t.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),i=0;i{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(t=>{this.resizeCheck()});this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}imageLoadListeners(){for(var t,e=this.document.querySelectorAll("img"),i=0;i0?(e.setStart(t,r.startOffset-2),e.setEnd(t,r.startOffset),i=e.getBoundingClientRect()):i=t.parentNode.getBoundingClientRect()}catch(t){console.error(t,t.stack)}}else i=r.getBoundingClientRect()}}else if("string"==typeof t&&t.indexOf("#")>-1){let e=t.substring(t.indexOf("#")+1),n=this.document.getElementById(e);if(n)if(d){let t=new Range;t.selectNode(n),i=t.getBoundingClientRect()}else i=n.getBoundingClientRect()}return i&&(n.left=i.left,n.top=i.top),n}addStylesheet(t){return new Promise(function(e,i){var n,r=!1;this.document?(n=this.document.querySelector("link[href='"+t+"']"))?e(!0):((n=this.document.createElement("link")).type="text/css",n.rel="stylesheet",n.href=t,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout(()=>{e(!0)},1))},this.document.head.appendChild(n)):e(!1)}.bind(this))}_getStylesheetNode(t){var e;return t="epubjs-inserted-css-"+(t||""),!!this.document&&((e=this.document.getElementById(t))||((e=this.document.createElement("style")).id=t,this.document.head.appendChild(e)),e)}addStylesheetCss(t,e){return!(!this.document||!t)&&(this._getStylesheetNode(e).innerHTML=t,!0)}addStylesheetRules(t,e){var i;if(this.document&&t&&0!==t.length)if(i=this._getStylesheetNode(e).sheet,"[object Array]"===Object.prototype.toString.call(t))for(var n=0,r=t.length;n{const n=t[e];if(Array.isArray(n))n.forEach(t=>{const n=Object.keys(t).map(e=>`${e}:${t[e]}`).join(";");i.insertRule(`${e}{${n}}`,i.cssRules.length)});else{const t=Object.keys(n).map(t=>`${t}:${n[t]}`).join(";");i.insertRule(`${e}{${t}}`,i.cssRules.length)}})}}addScript(t){return new Promise(function(e,i){var n,r=!1;this.document?((n=this.document.createElement("script")).type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout((function(){e(!0)}),1))},this.document.head.appendChild(n)):e(!1)}.bind(this))}addClass(t){var e;this.document&&(e=this.content||this.document.body)&&e.classList.add(t)}removeClass(t){var e;this.document&&(e=this.content||this.document.body)&&e.classList.remove(t)}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),c.a.forEach((function(t){this.document.addEventListener(t,this._triggerEvent,{passive:!0})}),this))}removeEventListeners(){this.document&&(c.a.forEach((function(t){this.document.removeEventListener(t,this._triggerEvent,{passive:!0})}),this),this._triggerEvent=void 0)}triggerEvent(t){this.emit(t.type,t)}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(t){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}.bind(this),250)}triggerSelectedEvent(t){var e,i;t&&t.rangeCount>0&&((e=t.getRangeAt(0)).collapsed||(i=new s.a(e,this.cfiBase).toString(),this.emit(c.c.CONTENTS.SELECTED,i),this.emit(c.c.CONTENTS.SELECTED_RANGE,e)))}range(t,e){return new s.a(t).toRange(this.document,e)}cfiFromRange(t,e){return new s.a(t,this.cfiBase,e).toString()}cfiFromNode(t,e){return new s.a(t,this.cfiBase,e).toString()}map(t){return new a.a(t).section()}size(t,e){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),t>=0&&(this.width(t),i.width=t,this.css("padding","0 "+t/12+"px")),e>=0&&(this.height(e),i.height=e),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(t,e,i,n,r){let s=Object(o.prefixed)("column-axis"),a=Object(o.prefixed)("column-gap"),l=Object(o.prefixed)("column-width"),c=Object(o.prefixed)("column-fill"),h=0===this.writingMode().indexOf("vertical")?"vertical":"horizontal";this.layoutStyle("paginated"),"rtl"===r&&"horizontal"===h&&this.direction(r),this.width(t),this.height(e),this.viewport({width:t,height:e,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),"vertical"===h?(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(s,"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(s,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(c,"auto"),this.css(a,n+"px"),this.css(l,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(t,e,i){var n="scale("+t+")",r="";this.css("transform-origin","top left"),(e>=0||i>=0)&&(r=" translate("+(e||0)+"px, "+(i||0)+"px )"),this.css("transform",n+r)}fit(t,e,i){var n=this.viewport(),r=parseInt(n.width),o=parseInt(n.height),s=t/r,a=e/o,l=s{this.emit(c.c.CONTENTS.LINK_CLICKED,t)})}writingMode(t){let e=Object(o.prefixed)("writing-mode");return t&&this.documentElement&&(this.documentElement.style[e]=t),this.window.getComputedStyle(this.documentElement)[e]||""}layoutStyle(t){return t&&(this._layoutStyle=t,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(t,e){return navigator.epubReadingSystem={name:t,version:e,layoutStyle:this.layoutStyle(),hasFeature:function(t){switch(t){case"dom-manipulation":case"layout-changes":case"touch-events":case"mouse-events":case"keyboard-events":return!0;case"spine-scripting":default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}}r()(f.prototype),e.a=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Underline=e.Highlight=e.Mark=e.Pane=void 0;var n=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:document.body;c(this,t),this.target=e,this.element=r.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),o.default.proxyMouse(this.target,this.marks),this.container=i,this.container.appendChild(this.element),this.render()}return n(t,[{key:"addMark",value:function(t){var e=r.default.createElement("g");return this.element.appendChild(e),t.bind(e,this.container),this.marks.push(t),t.render(),t}},{key:"removeMark",value:function(t){var e=this.marks.indexOf(t);if(-1!==e){var i=t.unbind();this.element.removeChild(i),this.marks.splice(e,1)}}},{key:"render",value:function(){var t,e,i,n;!function(t,e){t.style.setProperty("top",e.top+"px","important"),t.style.setProperty("left",e.left+"px","important"),t.style.setProperty("height",e.height+"px","important"),t.style.setProperty("width",e.width+"px","important")}(this.element,(t=this.target,e=this.container,i=e.getBoundingClientRect(),n=t.getBoundingClientRect(),{top:n.top-i.top,left:n.left-i.left,height:t.scrollHeight,width:t.scrollWidth}));var r=!0,o=!1,s=void 0;try{for(var a,l=this.marks[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){a.value.render()}}catch(t){o=!0,s=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw s}}}}]),t}();var h=e.Mark=function(){function t(){c(this,t),this.element=null}return n(t,[{key:"bind",value:function(t,e){this.element=t,this.container=e}},{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=[],e=this.element.firstChild;e;)t.push(e.getBoundingClientRect()),e=e.nextSibling;return t}},{key:"filteredRanges",value:function(){var t=Array.from(this.range.getClientRects());return t.filter((function(e){for(var i=0;i=n.left&&r.top>=n.top&&r.bottom<=n.bottom)return!1}var n,r;return!0}))}}]),t}(),u=e.Highlight=function(t){function e(t,i,n,r){c(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.range=t,o.className=i,o.data=n||{},o.attributes=r||{},o}return l(e,t),n(e,[{key:"bind",value:function(t,i){for(var n in function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(n):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"bind",this).call(this,t,i),this.data)this.data.hasOwnProperty(n)&&(this.element.dataset[n]=this.data[n]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&this.element.setAttribute(n,this.attributes[n]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var t=this.element.ownerDocument.createDocumentFragment(),e=this.filteredRanges(),i=this.element.getBoundingClientRect(),n=this.container.getBoundingClientRect(),o=0,s=e.length;o0?n:i)(t)}},function(t,e,i){var n=i(33);t.exports=function(t){return Object(n(t))}},function(t,e,i){var n=i(18).f,r=i(10),o=i(8)("toStringTag");t.exports=function(t,e,i){t&&!r(t=i?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(e,i){e.exports=t},function(t,e,i){"use strict";var n=i(3),r=i.n(n),o=i(0),s=i(6),a=i(2),l=i(21),c=i(1);class h{constructor(t){this.settings=t,this.name=t.layout||"reflowable",this._spread="none"!==t.spread,this._minSpreadWidth=t.minSpreadWidth||800,this._evenSpreads=t.evenSpreads||!1,"scrolled"===t.flow||"scrolled-continuous"===t.flow||"scrolled-doc"===t.flow?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(t){return void 0!==t&&(this._flow="scrolled"===t||"scrolled-continuous"===t||"scrolled-doc"===t?"scrolled":"paginated",this.update({flow:this._flow})),this._flow}spread(t,e){return t&&(this._spread="none"!==t,this.update({spread:this._spread})),e>=0&&(this._minSpreadWidth=e),this._spread}calculate(t,e,i){var n,r,o,s,a=1,l=i||0,c=t,h=e,u=Math.floor(c/12);a=this._spread&&c>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||i>=0||(l=u%2==0?u:u-1),"pre-paginated"===this.name&&(l=0),a>1?o=(n=c/a-l)+l:(n=c,o=c),"pre-paginated"===this.name&&a>1&&(c=n),r=n*a+l,s=c,this.width=c,this.height=h,this.spreadWidth=r,this.pageWidth=o,this.delta=s,this.columnWidth=n,this.gap=l,this.divisor=a,this.update({width:c,height:h,spreadWidth:r,pageWidth:o,delta:s,columnWidth:n,gap:l,divisor:a})}format(t,e,i){return"pre-paginated"===this.name?t.fit(this.columnWidth,this.height,e):"paginated"===this._flow?t.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&"horizontal"===i?t.size(null,this.height):t.size(this.width,null)}count(t,e){let i,n;return"pre-paginated"===this.name?(i=1,n=1):"paginated"===this._flow?(e=e||this.delta,i=Math.ceil(t/e),n=i*this.divisor):(e=e||this.height,i=Math.ceil(t/e),n=i),{spreads:i,pages:n}}update(t){if(Object.keys(t).forEach(e=>{this.props[e]===t[e]&&delete t[e]}),Object.keys(t).length>0){let e=Object(o.extend)(this.props,t);this.emit(c.c.LAYOUT.UPDATED,e,t)}}}r()(h.prototype);var u=h,d=i(5);var f=class{constructor(t){this.rendition=t,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(0!==arguments.length)return 1===arguments.length&&"object"==typeof arguments[0]?this.registerThemes(arguments[0]):1===arguments.length&&"string"==typeof arguments[0]?this.default(arguments[0]):2===arguments.length&&"string"==typeof arguments[1]?this.registerUrl(arguments[0],arguments[1]):2===arguments.length&&"object"==typeof arguments[1]?this.registerRules(arguments[0],arguments[1]):void 0}default(t){if(t)return"string"==typeof t?this.registerUrl("default",t):"object"==typeof t?this.registerRules("default",t):void 0}registerThemes(t){for(var e in t)t.hasOwnProperty(e)&&("string"==typeof t[e]?this.registerUrl(e,t[e]):this.registerRules(e,t[e]))}registerCss(t,e){this._themes[t]={serialized:e},(this._injected[t]||"default"==t)&&this.update(t)}registerUrl(t,e){var i=new d.a(e);this._themes[t]={url:i.toString()},(this._injected[t]||"default"==t)&&this.update(t)}registerRules(t,e){this._themes[t]={rules:e},(this._injected[t]||"default"==t)&&this.update(t)}select(t){var e=this._current;this._current=t,this.update(t),this.rendition.getContents().forEach(i=>{i.removeClass(e),i.addClass(t)})}update(t){this.rendition.getContents().forEach(e=>{this.add(t,e)})}inject(t){var e,i=[],n=this._themes;for(var r in n)!n.hasOwnProperty(r)||r!==this._current&&"default"!==r||(((e=n[r]).rules&&Object.keys(e.rules).length>0||e.url&&-1===i.indexOf(e.url))&&this.add(r,t),this._injected.push(r));"default"!=this._current&&t.addClass(this._current)}add(t,e){var i=this._themes[t];i&&e&&(i.url?e.addStylesheet(i.url):i.serialized?(e.addStylesheetCss(i.serialized,t),i.injected=!0):i.rules&&(e.addStylesheetRules(i.rules,t),i.injected=!0))}override(t,e,i){var n=this.rendition.getContents();this._overrides[t]={value:e,priority:!0===i},n.forEach(e=>{e.css(t,this._overrides[t].value,this._overrides[t].priority)})}removeOverride(t){var e=this.rendition.getContents();delete this._overrides[t],e.forEach(e=>{e.css(t)})}overrides(t){var e=this._overrides;for(var i in e)e.hasOwnProperty(i)&&t.css(i,e[i].value,e[i].priority)}fontSize(t){this.override("font-size",t)}font(t){this.override("font-family",t,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}};i(28);class p{constructor({type:t,cfiRange:e,data:i,sectionIndex:n,cb:r,className:o,styles:s}){this.type=t,this.cfiRange=e,this.data=i,this.sectionIndex=n,this.mark=void 0,this.cb=r,this.className=o,this.styles=s}update(t){this.data=t}attach(t){let e,{cfiRange:i,data:n,type:r,mark:o,cb:s,className:a,styles:l}=this;return"highlight"===r?e=t.highlight(i,n,s,a,l):"underline"===r?e=t.underline(i,n,s,a,l):"mark"===r&&(e=t.mark(i,n,s)),this.mark=e,this.emit(c.c.ANNOTATION.ATTACH,e),e}detach(t){let e,{cfiRange:i,type:n}=this;return t&&("highlight"===n?e=t.unhighlight(i):"underline"===n?e=t.ununderline(i):"mark"===n&&(e=t.unmark(i))),this.mark=void 0,this.emit(c.c.ANNOTATION.DETACH,e),e}text(){}}r()(p.prototype);var g=class{constructor(t){this.rendition=t,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(t,e,i,n,r,o){let s=encodeURI(e+t),l=new a.a(e).spinePos,c=new p({type:t,cfiRange:e,data:i,sectionIndex:l,cb:n,className:r,styles:o});return this._annotations[s]=c,l in this._annotationsBySectionIndex?this._annotationsBySectionIndex[l].push(s):this._annotationsBySectionIndex[l]=[s],this.rendition.views().forEach(t=>{c.sectionIndex===t.index&&c.attach(t)}),c}remove(t,e){let i=encodeURI(t+e);if(i in this._annotations){let t=this._annotations[i];if(e&&t.type!==e)return;this.rendition.views().forEach(e=>{this._removeFromAnnotationBySectionIndex(t.sectionIndex,i),t.sectionIndex===e.index&&t.detach(e)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(t,e){this._annotationsBySectionIndex[t]=this._annotationsAt(t).filter(t=>t!==e)}_annotationsAt(t){return this._annotationsBySectionIndex[t]}highlight(t,e,i,n,r){return this.add("highlight",t,e,i,n,r)}underline(t,e,i,n,r){return this.add("underline",t,e,i,n,r)}mark(t,e,i){return this.add("mark",t,e,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(t){let e=t.index;if(e in this._annotationsBySectionIndex){this._annotationsBySectionIndex[e].forEach(e=>{this._annotations[e].attach(t)})}}clear(t){let e=t.index;if(e in this._annotationsBySectionIndex){this._annotationsBySectionIndex[e].forEach(e=>{this._annotations[e].detach(t)})}}show(){}hide(){}},m=i(54),v=i(22),y=i(56);class b{constructor(t,e){this.settings=Object(o.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"}),Object(o.extend)(this.settings,e),"object"==typeof this.settings.manager&&(this.manager=this.settings.manager),this.book=t,this.hooks={},this.hooks.display=new s.a(this),this.hooks.serialize=new s.a(this),this.hooks.content=new s.a(this),this.hooks.unloaded=new s.a(this),this.hooks.layout=new s.a(this),this.hooks.render=new s.a(this),this.hooks.show=new s.a(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 f(this),this.annotations=new g(this),this.epubcfi=new a.a,this.q=new l.a(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new o.defer,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(t){this.manager=t}requireManager(t){return"string"==typeof t&&"default"===t?v.a:"string"==typeof t&&"continuous"===t?y.a:t}requireView(t){return"string"==typeof t&&"iframe"===t?m.a:t}start(){switch(this.settings.layout||"pre-paginated"!==this.book.package.metadata.layout&&"true"!==this.book.displayOptions.fixedLayout||(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0}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(c.c.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(c.c.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(c.c.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(c.c.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(c.c.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(c.c.RENDITION.STARTED),this.starting.resolve()}attachTo(t){return this.q.enqueue(function(){this.manager.render(t,{width:this.settings.width,height:this.settings.height}),this.emit(c.c.RENDITION.ATTACHED)}.bind(this))}display(t){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,t)}_display(t){if(this.book){this.epubcfi.isCfiString(t);var e,i=new o.defer,n=i.promise;return this.displaying=i,this.book.locations.length()&&Object(o.isFloat)(t)&&(t=this.book.locations.cfiFromPercentage(parseFloat(t))),(e=this.book.spine.get(t))?(this.manager.display(e,t).then(()=>{i.resolve(e),this.displaying=void 0,this.emit(c.c.RENDITION.DISPLAYED,e),this.reportLocation()},t=>{this.emit(c.c.RENDITION.DISPLAY_ERROR,t)}),n):(i.reject(new Error("No Section Found")),n)}}afterDisplayed(t){t.on(c.c.VIEWS.MARK_CLICKED,(e,i)=>this.triggerMarkEvent(e,i,t.contents)),this.hooks.render.trigger(t,this).then(()=>{t.contents?this.hooks.content.trigger(t.contents,this).then(()=>{this.emit(c.c.RENDITION.RENDERED,t.section,t)}):this.emit(c.c.RENDITION.RENDERED,t.section,t)})}afterRemoved(t){this.hooks.unloaded.trigger(t,this).then(()=>{this.emit(c.c.RENDITION.REMOVED,t.section,t)})}onResized(t,e){this.emit(c.c.RENDITION.RESIZED,{width:t.width,height:t.height},e),this.location&&this.location.start&&this.display(e||this.location.start.cfi)}onOrientationChange(t){this.emit(c.c.RENDITION.ORIENTATION_CHANGE,t)}moveTo(t){this.manager.moveTo(t)}resize(t,e,i){t&&(this.settings.width=t),e&&(this.settings.height=e),this.manager.resize(t,e,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(t){var e=this.settings.layout||t.layout||"reflowable",i=this.settings.spread||t.spread||"auto",n=this.settings.orientation||t.orientation||"auto",r=this.settings.flow||t.flow||"auto",o=t.viewport||"",s=this.settings.minSpreadWidth||t.minSpreadWidth||800,a=this.settings.direction||t.direction||"ltr";return(0===this.settings.width||this.settings.width>0)&&(0===this.settings.height||this.settings.height),{layout:e,spread:i,orientation:n,flow:r,viewport:o,minSpreadWidth:s,direction:a}}flow(t){var e=t;"scrolled"!==t&&"scrolled-doc"!==t&&"scrolled-continuous"!==t||(e="scrolled"),"auto"!==t&&"paginated"!==t||(e="paginated"),this.settings.flow=t,this._layout&&this._layout.flow(e),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(e),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(t){return t&&(this._layout=new u(t),this._layout.spread(t.spread,this.settings.minSpreadWidth),this._layout.on(c.c.LAYOUT.UPDATED,(t,e)=>{this.emit(c.c.RENDITION.LAYOUT,t,e)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(t,e){this.settings.spread=t,e&&(this.settings.minSpreadWidth=e),this._layout&&this._layout.spread(t,e),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(t){this.settings.direction=t||"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 t=this.manager.currentLocation();if(t&&t.then&&"function"==typeof t.then)t.then(function(t){let e=this.located(t);e&&e.start&&e.end&&(this.location=e,this.emit(c.c.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(c.c.RENDITION.RELOCATED,this.location))}.bind(this));else if(t){let e=this.located(t);if(!e||!e.start||!e.end)return;this.location=e,this.emit(c.c.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(c.c.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var t=this.manager.currentLocation();if(t&&t.then&&"function"==typeof t.then)t.then(function(t){return this.located(t)}.bind(this));else if(t){return this.located(t)}}located(t){if(!t.length)return{};let e=t[0],i=t[t.length-1],n={start:{index:e.index,href:e.href,cfi:e.mapping.start,displayed:{page:e.pages[0]||1,total:e.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},r=this.book.locations.locationFromCfi(e.mapping.start),o=this.book.locations.locationFromCfi(i.mapping.end);null!=r&&(n.start.location=r,n.start.percentage=this.book.locations.percentageFromLocation(r)),null!=o&&(n.end.location=o,n.end.percentage=this.book.locations.percentageFromLocation(o));let s=this.book.pageList.pageFromCfi(e.mapping.start),a=this.book.pageList.pageFromCfi(i.mapping.end);return-1!=s&&(n.start.page=s),-1!=a&&(n.end.page=a),i.index===this.book.spine.last().index&&n.end.displayed.page>=n.end.displayed.total&&(n.atEnd=!0),e.index===this.book.spine.first().index&&1===n.start.displayed.page&&(n.atStart=!0),n}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(t){c.a.forEach(e=>{t.on(e,e=>this.triggerViewEvent(e,t))}),t.on(c.c.CONTENTS.SELECTED,e=>this.triggerSelectedEvent(e,t))}triggerViewEvent(t,e){this.emit(t.type,t,e)}triggerSelectedEvent(t,e){this.emit(c.c.RENDITION.SELECTED,t,e)}triggerMarkEvent(t,e,i){this.emit(c.c.RENDITION.MARK_CLICKED,t,e,i)}getRange(t,e){var i=new a.a(t),n=this.manager.visible().filter((function(t){if(i.spinePos===t.index)return!0}));if(n.length)return n[0].contents.range(i,e)}adjustImages(t){if("pre-paginated"===this._layout.name)return new Promise((function(t){t()}));let e=t.window.getComputedStyle(t.content,null),i=.95*(t.content.offsetHeight-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom))),n=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.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(t,e){setTimeout((function(){t()}),1)}))}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(t){t&&t.on(c.c.CONTENTS.LINK_CLICKED,t=>{let e=this.book.path.relative(t);this.display(e)})}injectStylesheet(t,e){let i=t.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),t.getElementsByTagName("head")[0].appendChild(i)}injectScript(t,e){let i=t.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",t.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(t,e){let i=this.book.packaging.metadata.identifier,n=t.createElement("meta");n.setAttribute("name","dc.relation.ispartof"),i&&n.setAttribute("content",i),t.getElementsByTagName("head")[0].appendChild(n)}}r()(b.prototype);e.a=b},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var n=i(17);t.exports=function(t,e){if(!n(t))return t;var i,r;if(e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!n(r=i.call(t)))return r;if(!e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,i){var n=i(7),r=i(15);t.exports=function(t,e){try{r(n,t,e)}catch(i){n[t]=e}return e}},function(t,e,i){var n=i(66),r=i(67),o=n("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},function(t,e){t.exports={}},function(t,e,i){var n=i(92),r=i(7),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t])||o(r[t]):n[t]&&n[t][e]||r[t]&&r[t][e]}},function(t,e,i){var n=i(35),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,i){"use strict";var n,r,o=i(97),s=i(98),a=RegExp.prototype.exec,l=String.prototype.replace,c=a,h=(n=/a/,r=/b*/g,a.call(n,"a"),a.call(r,"a"),0!==n.lastIndex||0!==r.lastIndex),u=s.UNSUPPORTED_Y||s.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(h||d||u)&&(c=function(t){var e,i,n,r,s=this,c=u&&s.sticky,f=o.call(s),p=s.source,g=0,m=t;return c&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),m=String(t).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==t[s.lastIndex-1])&&(p="(?: "+p+")",m=" "+m,g++),i=new RegExp("^(?:"+p+")",f)),d&&(i=new RegExp("^"+p+"$(?!\\s)",f)),h&&(e=s.lastIndex),n=a.call(c?i:s,m),c?n?(n.input=n.input.slice(g),n[0]=n[0].slice(g),n.index=s.lastIndex,s.lastIndex+=n[0].length):s.lastIndex=0:h&&n&&(s.lastIndex=s.global?n.index+n[0].length:e),d&&n&&n.length>1&&l.call(n[0],i,(function(){for(r=1;r=c?t?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e,i){var n,r=i(13),o=i(72),s=i(47),a=i(44),l=i(104),c=i(63),h=i(43),u=h("IE_PROTO"),d=function(){},f=function(t){return"