epubjs
Version:
Parse and Render Epubs
1 lines • 326 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("JSZip")):"function"==typeof define&&define.amd?define(["JSZip"],e):"object"==typeof exports?exports.ePub=e(require("JSZip")):t.ePub=e(t.JSZip)}(window,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=169)}([function(t,e,n){"use strict";n.r(e),n.d(e,"requestAnimationFrame",(function(){return o})),n.d(e,"uuid",(function(){return a})),n.d(e,"documentHeight",(function(){return u})),n.d(e,"isElement",(function(){return c})),n.d(e,"isNumber",(function(){return l})),n.d(e,"isFloat",(function(){return h})),n.d(e,"prefixed",(function(){return f})),n.d(e,"defaults",(function(){return d})),n.d(e,"extend",(function(){return p})),n.d(e,"insert",(function(){return v})),n.d(e,"locationOf",(function(){return g})),n.d(e,"indexOfSorted",(function(){return m})),n.d(e,"bounds",(function(){return y})),n.d(e,"borders",(function(){return b})),n.d(e,"nodeBounds",(function(){return w})),n.d(e,"windowBounds",(function(){return x})),n.d(e,"indexOfNode",(function(){return k})),n.d(e,"indexOfTextNode",(function(){return E})),n.d(e,"indexOfElementNode",(function(){return S})),n.d(e,"isXml",(function(){return O})),n.d(e,"createBlob",(function(){return T})),n.d(e,"createBlobUrl",(function(){return _})),n.d(e,"revokeBlobUrl",(function(){return N})),n.d(e,"createBase64Url",(function(){return C})),n.d(e,"type",(function(){return R})),n.d(e,"parse",(function(){return I})),n.d(e,"qs",(function(){return A})),n.d(e,"qsa",(function(){return j})),n.d(e,"qsp",(function(){return L})),n.d(e,"sprint",(function(){return P})),n.d(e,"treeWalker",(function(){return D})),n.d(e,"walk",(function(){return M})),n.d(e,"blob2base64",(function(){return z})),n.d(e,"defer",(function(){return B})),n.d(e,"querySelectorByType",(function(){return q})),n.d(e,"findChildren",(function(){return U})),n.d(e,"parents",(function(){return F})),n.d(e,"filterChildren",(function(){return W})),n.d(e,"getParentByTagName",(function(){return H})),n.d(e,"RangeObject",(function(){return V}));n(14),n(10),n(18),n(22),n(53),n(44),n(15),n(62),n(34),n(35),n(11),n(212),n(154),n(95),n(66),n(27),n(213),n(63);var i=n(98);function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),s="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function a(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}))}function u(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function c(t){return!(!t||1!=t.nodeType)}function l(t){return!isNaN(parseFloat(t))&&isFinite(t)}function h(t){var e=parseFloat(t);return!1!==l(t)&&("string"==typeof t&&t.indexOf(".")>-1||Math.floor(e)!==e)}function f(t){var e=["-webkit-","-webkit-","-moz-","-o-","-ms-"],n=t.toLowerCase(),i=["Webkit","webkit","Moz","O","ms"].length;if("undefined"==typeof document||void 0!==document.body.style[n])return t;for(var r=0;r<i;r++)if(void 0!==document.body.style[e[r]+n])return e[r]+n;return t}function d(t){for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e];for(var r in i)void 0===t[r]&&(t[r]=i[r])}return t}function p(t){var e=[].slice.call(arguments,1);return e.forEach((function(e){e&&Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))})),t}function v(t,e,n){var i=g(t,e,n);return e.splice(i,0,t),i}function g(t,e,n,i,r){var o,s=i||0,a=r||e.length,u=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?u:(o=n(e[u],t),a-s==1?o>=0?u:u+1:0===o?u:-1===o?g(t,e,n,u,a):g(t,e,n,s,u))}function m(t,e,n,i,r){var o,s=i||0,a=r||e.length,u=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?-1:(o=n(e[u],t),a-s==1?0===o?u:-1:0===o?u:-1===o?m(t,e,n,u,a):m(t,e,n,s,u))}function y(t){var e=window.getComputedStyle(t),n=0,i=0;return["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function b(t){var e=window.getComputedStyle(t),n=0,i=0;return["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function w(t){var e,n=t.ownerDocument;if(t.nodeType==Node.TEXT_NODE){var i=n.createRange();i.selectNodeContents(t),e=i.getBoundingClientRect()}else e=t.getBoundingClientRect();return e}function x(){var t=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:t,bottom:e,width:t,height:e}}function k(t,e){for(var n,i=t.parentNode.childNodes,r=-1,o=0;o<i.length&&((n=i[o]).nodeType===e&&r++,n!=t);o++);return r}function E(t){return k(t,3)}function S(t){return k(t,1)}function O(t){return["xml","opf","ncx"].indexOf(t)>-1}function T(t,e){return new Blob([t],{type:e})}function _(t,e){var n=T(t,e);return s.createObjectURL(n)}function N(t){return s.revokeObjectURL(t)}function C(t,e){if("string"==typeof t)return"data:"+e+";base64,"+btoa(t)}function R(t){return Object.prototype.toString.call(t).slice(8,-1)}function I(t,e,n){var r;return r="undefined"==typeof DOMParser||n?i.DOMParser:DOMParser,65279===t.charCodeAt(0)&&(t=t.slice(1)),(new r).parseFromString(t,e)}function A(t,e){var n;if(!t)throw new Error("No Element Provided");return void 0!==t.querySelector?t.querySelector(e):(n=t.getElementsByTagName(e)).length?n[0]:void 0}function j(t,e){return void 0!==t.querySelector?t.querySelectorAll(e):t.getElementsByTagName(e)}function L(t,e,n){var i,r;if(void 0!==t.querySelector){for(var o in e+="[",n)e+=o+"~='"+n[o]+"'";return e+="]",t.querySelector(e)}if(i=t.getElementsByTagName(e),r=Array.prototype.slice.call(i,0).filter((function(t){for(var e in n)if(t.getAttribute(e)===n[e])return!0;return!1})))return r[0]}function P(t,e){void 0!==(t.ownerDocument||t).createTreeWalker?D(t,e,NodeFilter.SHOW_TEXT):M(t,(function(t){t&&3===t.nodeType&&e(t)}))}function D(t,e,n){for(var i,r=document.createTreeWalker(t,n,null,!1);i=r.nextNode();)e(i)}function M(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(M(t,e))return!0;t=t.nextSibling}while(t)}function z(t){return new Promise((function(e,n){var i=new FileReader;i.readAsDataURL(t),i.onloadend=function(){e(i.result)}}))}function B(){var t=this;this.resolve=null,this.reject=null,this.id=a(),this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n})),Object.freeze(this)}function q(t,e,n){var i;if(void 0!==t.querySelector&&(i=t.querySelector("".concat(e,'[*|type="').concat(n,'"]'))),i&&0!==i.length)return i;i=j(t,e);for(var r=0;r<i.length;r++)if(i[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===n||i[r].getAttribute("epub:type")===n)return i[r]}function U(t){for(var e=[],n=t.childNodes,i=0;i<n.length;i++){var r=n[i];1===r.nodeType&&e.push(r)}return e}function F(t){for(var e=[t];t;t=t.parentNode)e.unshift(t);return e}function W(t,e,n){for(var i=[],r=t.childNodes,o=0;o<r.length;o++){var s=r[o];if(1===s.nodeType&&s.nodeName.toLowerCase()===e){if(n)return s;i.push(s)}}if(!n)return i}function H(t,e){var n;if(null!==t&&""!==e)for(n=t.parentNode;1===n.nodeType;){if(n.tagName.toLowerCase()===e)return n;n=n.parentNode}}var V=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}var e,n,i;return e=t,(n=[{key:"setStart",value:function(t,e){this.startContainer=t,this.startOffset=e,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}},{key:"setEnd",value:function(t,e){this.endContainer=t,this.endOffset=e,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}},{key:"collapse",value:function(t){this.collapsed=!0,t?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}},{key:"selectNode",value:function(t){var e=t.parentNode,n=Array.prototype.indexOf.call(e.childNodes,t);this.setStart(e,n),this.setEnd(e,n+1)}},{key:"selectNodeContents",value:function(t){t.childNodes[t.childNodes-1];var e=3===t.nodeType?t.textContent.length:parent.childNodes.length;this.setStart(t,0),this.setEnd(t,e)}},{key:"_commonAncestorContainer",value:function(t,e){var n=F(t||this.startContainer),i=F(e||this.endContainer);if(n[0]==i[0])for(var r=0;r<n.length;r++)if(n[r]!=i[r])return n[r-1]}},{key:"_checkCollapsed",value:function(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}},{key:"toString",value:function(){}}])&&r(e.prototype,n),i&&r(e,i),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o}));var i="0.3",r=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"],o={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}}},function(t,e,n){"use strict";n(35),n(15),n(37),n(38),n(157),n(158),n(63),n(66),n(11),n(10),n(34),n(67),n(68),n(69),n(14),n(18),n(22);var i=n(0);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=function(){function t(e,n,o){var s;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof t))return new t(e,n,o);if("string"==typeof n?this.base=this.parseComponent(n):"object"===r(n)&&n.steps&&(this.base=n),"string"===(s=this.checkType(e)))return this.str=e,Object(i.extend)(this,this.parse(e));if("range"===s)return Object(i.extend)(this,this.fromRange(e,this.base,o));if("node"===s)return Object(i.extend)(this,this.fromNode(e,this.base,o));if("EpubCFI"===s&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}var e,n,s;return e=t,(n=[{key:"checkType",value:function(e){return this.isCfiString(e)?"string":!e||"object"!==r(e)||"Range"!==Object(i.type)(e)&&void 0===e.startContainer?e&&"object"===r(e)&&void 0!==e.nodeType?"node":!!(e&&"object"===r(e)&&e instanceof t)&&"EpubCFI":"range"}},{key:"parse",value:function(t){var e,n,i,r={spinePos:-1,range:!1,base:{},path:{},start:null,end:null};return"string"!=typeof t?{spinePos:-1}:(0===t.indexOf("epubcfi(")&&")"===t[t.length-1]&&(t=t.slice(8,t.length-1)),(e=this.getChapterComponent(t))?(r.base=this.parseComponent(e),n=this.getPathComponent(t),r.path=this.parseComponent(n),(i=this.getRange(t))&&(r.range=!0,r.start=this.parseComponent(i[0]),r.end=this.parseComponent(i[1])),r.spinePos=r.base.steps[1].index,r):{spinePos:-1})}},{key:"parseComponent",value:function(t){var e,n={steps:[],terminal:{offset:null,assertion:null}},i=t.split(":"),r=i[0].split("/");return i.length>1&&(e=i[1],n.terminal=this.parseTerminal(e)),""===r[0]&&r.shift(),n.steps=r.map(function(t){return this.parseStep(t)}.bind(this)),n}},{key:"parseStep",value:function(t){var e,n,i,r,o;if((r=t.match(/\[(.*)\]/))&&r[1]&&(o=r[1]),n=parseInt(t),!isNaN(n))return n%2==0?(e="element",i=n/2-1):(e="text",i=(n-1)/2),{type:e,index:i,id:o||null}}},{key:"parseTerminal",value:function(t){var e,n,r=t.match(/\[(.*)\]/);return r&&r[1]?(e=parseInt(t.split("[")[0]),n=r[1]):e=parseInt(t),Object(i.isNumber)(e)||(e=null),{offset:e,assertion:n}}},{key:"getChapterComponent",value:function(t){return t.split("!")[0]}},{key:"getPathComponent",value:function(t){var e=t.split("!");if(e[1])return e[1].split(",")[0]}},{key:"getRange",value:function(t){var e=t.split(",");return 3===e.length&&[e[1],e[2]]}},{key:"getCharecterOffsetComponent",value:function(t){return t.split(":")[1]||""}},{key:"joinSteps",value:function(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("/"):""}},{key:"segmentString",value:function(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}},{key:"toString",value:function(){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+=")"}},{key:"compare",value:function(e,n){var i,r,o,s;if("string"==typeof e&&(e=new t(e)),"string"==typeof n&&(n=new t(n)),e.spinePos>n.spinePos)return 1;if(e.spinePos<n.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),o=e.start.terminal):(i=e.path.steps,o=e.path.terminal),n.range?(r=n.path.steps.concat(n.start.steps),s=n.start.terminal):(r=n.path.steps,s=n.path.terminal);for(var a=0;a<i.length;a++){if(!i[a])return-1;if(!r[a])return 1;if(i[a].index>r[a].index)return 1;if(i[a].index<r[a].index)return-1}return i.length<r.length?-1:o.offset>s.offset?1:o.offset<s.offset?-1:0}},{key:"step",value:function(t){var e=3===t.nodeType?"text":"element";return{id:t.id,tagName:t.tagName,type:e,index:this.position(t)}}},{key:"filteredStep",value:function(t,e){var n,i=this.filter(t,e);if(i)return n=3===i.nodeType?"text":"element",{id:i.id,tagName:i.tagName,type:n,index:this.filteredPosition(i,e)}}},{key:"pathTo",value:function(t,e,n){for(var i,r={steps:[],terminal:{offset:null,assertion:null}},o=t;o&&o.parentNode&&9!=o.parentNode.nodeType;)(i=n?this.filteredStep(o,n):this.step(o))&&r.steps.unshift(i),o=o.parentNode;return null!=e&&e>=0&&(r.terminal.offset=e,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r}},{key:"equalStep",value:function(t,e){return!(!t||!e)&&t.index===e.index&&t.id===e.id&&t.type===e.type}},{key:"fromRange",value:function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null},o=t.startContainer,s=t.endContainer,a=t.startOffset,u=t.endOffset,c=!1;if(n&&(c=null!=o.ownerDocument.querySelector("."+n)),"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"===r(e)&&(i.base=e),t.collapsed)c&&(a=this.patchOffset(o,a,n)),i.path=this.pathTo(o,a,n);else{i.range=!0,c&&(a=this.patchOffset(o,a,n)),i.start=this.pathTo(o,a,n),c&&(u=this.patchOffset(s,u,n)),i.end=this.pathTo(s,u,n),i.path={steps:[],terminal:null};var l,h=i.start.steps.length;for(l=0;l<h&&this.equalStep(i.start.steps[l],i.end.steps[l]);l++)l===h-1?i.start.terminal===i.end.terminal&&(i.path.steps.push(i.start.steps[l]),i.range=!1):i.path.steps.push(i.start.steps[l]);i.start.steps=i.start.steps.slice(i.path.steps.length),i.end.steps=i.end.steps.slice(i.path.steps.length)}return i}},{key:"fromNode",value:function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null};return"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"===r(e)&&(i.base=e),i.path=this.pathTo(t,null,n),i}},{key:"filter",value:function(t,e){var n,i,r,o,s,a=!1;return 3===t.nodeType?(a=!0,r=t.parentNode,n=t.parentNode.classList.contains(e)):(a=!1,n=t.classList.contains(e)),n&&a?(o=r.previousSibling,s=r.nextSibling,o&&3===o.nodeType?i=o:s&&3===s.nodeType&&(i=s),i||t):!(n&&!a)&&t}},{key:"patchOffset",value:function(t,e,n){if(3!=t.nodeType)throw new Error("Anchor must be a text node");var i=t,r=e;for(t.parentNode.classList.contains(n)&&(i=t.parentNode);i.previousSibling;){if(1===i.previousSibling.nodeType){if(!i.previousSibling.classList.contains(n))break;r+=i.previousSibling.textContent.length}else r+=i.previousSibling.textContent.length;i=i.previousSibling}return r}},{key:"normalizedMap",value:function(t,e,n){var i,r,o,s={},a=-1,u=t.length;for(i=0;i<u;i++)1===(r=t[i].nodeType)&&t[i].classList.contains(n)&&(r=3),i>0&&3===r&&3===o?s[i]=a:e===r&&(a+=1,s[i]=a),o=r;return s}},{key:"position",value:function(t){var e,n;return 1===t.nodeType?((e=t.parentNode.children)||(e=Object(i.findChildren)(t.parentNode)),n=Array.prototype.indexOf.call(e,t)):n=(e=this.textNodes(t.parentNode)).indexOf(t),n}},{key:"filteredPosition",value:function(t,e){var n,i;return 1===t.nodeType?(n=t.parentNode.children,i=this.normalizedMap(n,1,e)):(n=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(n=(t=t.parentNode).parentNode.childNodes),i=this.normalizedMap(n,3,e)),i[Array.prototype.indexOf.call(n,t)]}},{key:"stepsToXpath",value:function(t){var e=[".","*"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("*[position()="+n+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+n+"]"):e.push("*["+n+"]")})),e.join("/")}},{key:"stepsToQuerySelector",value:function(t){var e=["html"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+n+")")})),e.join(">")}},{key:"textNodes",value:function(t,e){return Array.prototype.slice.call(t.childNodes).filter((function(t){return 3===t.nodeType||!(!e||!t.classList.contains(e))}))}},{key:"walkToNode",value:function(t,e,n){var r,o,s=e||document,a=s.documentElement,u=t.length;for(o=0;o<u&&("element"===(r=t[o]).type?a=r.id?s.getElementById(r.id):(a.children||Object(i.findChildren)(a))[r.index]:"text"===r.type&&(a=this.textNodes(a,n)[r.index]),a);o++);return a}},{key:"findNode",value:function(t,e,n){var i,r,o=e||document;return n||void 0===o.evaluate?i=n?this.walkToNode(t,o,n):this.walkToNode(t,o):(r=this.stepsToXpath(t),i=o.evaluate(r,o,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),i}},{key:"fixMiss",value:function(t,e,n,i){var r,o,s=this.findNode(t.slice(0,-1),n,i),a=s.childNodes,u=this.normalizedMap(a,3,i),c=t[t.length-1].index;for(var l in u){if(!u.hasOwnProperty(l))return;if(u[l]===c){if(!(e>(o=(r=a[l]).textContent.length))){s=1===r.nodeType?r.childNodes[0]:r;break}e-=o}}return{container:s,offset:e}}},{key:"toRange",value:function(t,e){var n,r,o,s,a,u,c,l,h=t||document,f=!!e&&null!=h.querySelector("."+e);if(n=void 0!==h.createRange?h.createRange():new i.RangeObject,this.range?(r=this.start,u=this.path.steps.concat(r.steps),s=this.findNode(u,h,f?e:null),o=this.end,c=this.path.steps.concat(o.steps),a=this.findNode(c,h,f?e:null)):(r=this.path,u=this.path.steps,s=this.findNode(this.path.steps,h,f?e:null)),!s)return console.log("No startContainer found for",this.toString()),null;try{null!=r.terminal.offset?n.setStart(s,r.terminal.offset):n.setStart(s,0)}catch(t){l=this.fixMiss(u,r.terminal.offset,h,f?e:null),n.setStart(l.container,l.offset)}if(a)try{null!=o.terminal.offset?n.setEnd(a,o.terminal.offset):n.setEnd(a,0)}catch(t){l=this.fixMiss(c,this.end.terminal.offset,h,f?e:null),n.setEnd(l.container,l.offset)}return n}},{key:"isCfiString",value:function(t){return"string"==typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]}},{key:"generateChapterComponent",value:function(t,e,n){var i="/"+2*(t+1)+"/";return i+=2*(parseInt(e)+1),n&&(i+="["+n+"]"),i}},{key:"collapse",value:function(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))}}])&&o(e.prototype,n),s&&o(e,s),t}();e.a=s},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(73))},function(t,e,n){var i=n(4),r=n(45).f,o=n(33),s=n(25),a=n(104),u=n(130),c=n(107);t.exports=function(t,e){var n,l,h,f,d,p=t.target,v=t.global,g=t.stat;if(n=v?i:g?i[p]||a(p,{}):(i[p]||{}).prototype)for(l in e){if(f=e[l],h=t.noTargetGet?(d=r(n,l))&&d.value:n[l],!c(v?l:p+(g?".":"#")+l,t.forced)&&void 0!==h){if(typeof f==typeof h)continue;u(f,h)}(t.sham||h&&h.sham)&&o(f,"sham",!0),s(n,l,f,t)}}},function(t,e,n){var i=n(4),r=n(78),o=n(13),s=n(79),a=n(102),u=n(127),c=r("wks"),l=i.Symbol,h=u?l:l&&l.withoutSetter||s;t.exports=function(t){return o(c,t)&&(a||"string"==typeof c[t])||(a&&o(l,t)?c[t]=l[t]:c[t]=h("Symbol."+t)),c[t]}},function(t,e){t.exports=function(t){return"function"==typeof t}},function(t,e,n){var i=n(9);t.exports=function(t){if(i(t))return t;throw TypeError(String(t)+" is not an object")}},function(t,e,n){var i=n(7);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},function(t,e,n){var i=n(110),r=n(25),o=n(180);i||r(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){var i=n(4),r=n(147),o=n(148),s=n(211),a=n(33),u=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var c in r)r[c]&&u(i[c]&&i[c].prototype);u(o)},function(t,e,n){"use strict";var i,r,o,s,a,u,c,l=n(193),h=n(207),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,v=Object.defineProperty,g=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n,r;return h(e),r=this,i.call(this,t,n=function(){o.call(r,t,n),f.call(e,this,arguments)}),n.__eeOnceListener__=e,this},a={on:i=function(t,e){var n;return h(e),m.call(this,"__ee__")?n=this.__ee__:(n=y.value=p(null),v(this,"__ee__",y),y.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,i,r,o;if(h(e),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(i=n[t]))for(o=0;r=i[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===i.length?n[t]=i[o?0:1]:i.splice(o,1));else i!==e&&i.__eeOnceListener__!==e||delete n[t];return this},emit:s=function(t){var e,n,i,r,o;if(m.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)f.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];f.call(r,this,o)}}},u={on:l(i),once:l(r),off:l(o),emit:l(s)},c=g({},u),t.exports=e=function(t){return null==t?p(c):g(Object(t),u)},e.methods=a},function(t,e,n){var i=n(24),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(i(t),e)}},function(t,e,n){"use strict";var i=n(31),r=n(86),o=n(60),s=n(30),a=n(137),u=s.set,c=s.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:i(t),index:0,kind:e})}),(function(){var t=c(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var i=n(5),r=n(90);i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},function(t,e,n){"use strict";n(14),n(10),n(18),n(22),n(53),n(44),n(35),n(15);var i=n(26),r=n.n(i);function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=function(){function t(e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e.indexOf("://")>-1&&(e=new URL(e).pathname),n=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=n.dir+"/",this.filename=n.base,this.extension=n.ext.slice(1)}var e,n,i;return e=t,(n=[{key:"parse",value:function(t){return r.a.parse(t)}},{key:"isAbsolute",value:function(t){return r.a.isAbsolute(t||this.path)}},{key:"isDirectory",value:function(t){return"/"===t.charAt(t.length-1)}},{key:"resolve",value:function(t){return r.a.resolve(this.directory,t)}},{key:"relative",value:function(t){return t&&t.indexOf("://")>-1?t:r.a.relative(this.directory,t)}},{key:"splitPath",value:function(t){return this.splitPathRe.exec(t).slice(1)}},{key:"toString",value:function(){return this.path}}])&&o(e.prototype,n),i&&o(e,i),t}();e.a=s},function(t,e,n){var i=n(3);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){"use strict";var i=n(113).charAt,r=n(21),o=n(30),s=n(137),a=o.set,u=o.getterFor("String Iterator");s(String,"String",(function(t){a(this,{type:"String Iterator",string:r(t),index:0})}),(function(){var t,e=u(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=i(n,r),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){"use strict";n(15),n(218),n(14),n(10),n(18),n(22),n(53),n(44);var i=n(16),r=n(26),o=n.n(r);function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.indexOf("://")>-1,o=e;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=n,!r&&!1!==n&&"string"!=typeof n&&window&&window.location&&(this.base=window.location.href),r||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,o=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(t){this.Url=void 0,this.base&&(o=new i.a(this.base).resolve(o))}this.Path=new i.a(o),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}var e,n,r;return e=t,(n=[{key:"path",value:function(){return this.Path}},{key:"resolve",value:function(t){var e;return t.indexOf("://")>-1?t:(e=o.a.resolve(this.directory,t),this.origin+e)}},{key:"relative",value:function(t){return o.a.relative(t,this.directory)}},{key:"toString",value:function(){return this.href}}])&&s(e.prototype,n),r&&s(e,r),t}();e.a=a},function(t,e,n){var i=n(17),r=n(129),o=n(8),s=n(75),a=Object.defineProperty;e.f=i?a:function(t,e,n){if(o(t),e=s(e),o(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(59);t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},function(t,e,n){var i=n(4),r=n(147),o=n(148),s=n(14),a=n(33),u=n(6),c=u("iterator"),l=u("toStringTag"),h=s.values,f=function(t,e){if(t){if(t[c]!==h)try{a(t,c,h)}catch(e){t[c]=h}if(t[l]||a(t,l,e),r[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var d in r)f(i[d]&&i[d].prototype,d);f(o,"DOMTokenList")},function(t,e,n){"use strict";n(95),n(11),n(14),n(10),n(27),n(18),n(22);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e||this,this.hooks=[]}var e,n,r;return e=t,(n=[{key:"register",value:function(){for(var t=0;t<arguments.length;++t)if("function"==typeof arguments[t])this.hooks.push(arguments[t]);else for(var e=0;e<arguments[t].length;++e)this.hooks.push(arguments[t][e])}},{key:"deregister",value:function(t){for(var e=0;e<this.hooks.length;e++)if(this.hooks[e]===t){this.hooks.splice(e,1);break}}},{key:"trigger",value:function(){var t=arguments,e=this.context,n=[];return this.hooks.forEach((function(i){try{var r=i.apply(e,t)}catch(t){console.log(t)}r&&"function"==typeof r.then&&n.push(r)})),Promise.all(n)}},{key:"list",value:function(){return this.hooks}},{key:"clear",value:function(){return this.hooks=[]}}])&&i(e.prototype,n),r&&i(e,r),t}();e.a=r},function(t,e,n){var i=n(32);t.exports=function(t){return Object(i(t))}},function(t,e,n){var i=n(4),r=n(7),o=n(13),s=n(33),a=n(104),u=n(81),c=n(30),l=n(50).CONFIGURABLE,h=c.get,f=c.enforce,d=String(String).split("String");(t.exports=function(t,e,n,u){var c,h=!!u&&!!u.unsafe,p=!!u&&!!u.enumerable,v=!!u&&!!u.noTargetGet,g=u&&void 0!==u.name?u.name:e;r(n)&&("Symbol("===String(g).slice(0,7)&&(g="["+String(g).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(n,"name")||l&&n.name!==g)&&s(n,"name",g),(c=f(n)).source||(c.source=d.join("string"==typeof g?g:""))),t!==i?(h?!v&&t[e]&&(p=!0):delete t[e],p?t[e]=n:s(t,e,n)):p?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return r(this)&&h(this).source||u(this)}))},function(t,e,n){"use strict";if(!i)var i={cwd:function(){return"/"}};function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+t)}function o(t,e){for(var n,i="",r=-1,o=0,s=0;s<=t.length;++s){if(s<t.length)n=t.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(r===s-1||1===o);else if(r!==s-1&&2===o){if(i.length<2||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){for(var a=i.length-1,u=a;u>=0&&47!==i.charCodeAt(u);--u);if(u!==a){i=-1===u?"":i.slice(0,u),r=s,o=0;continue}}else if(2===i.length||1===i.length){i="",r=s,o=0;continue}e&&(i.length>0?i+="/..":i="..")}else i.length>0?i+="/"+t.slice(r+1,s):i=t.slice(r+1,s);r=s,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var s={resolve:function(){for(var t,e="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=i.cwd()),a=t),r(a),0!==a.length&&(e=a+"/"+e,n=47===a.charCodeAt(0))}return e=o(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(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;e<arguments.length;++e){var n=arguments[e];r(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}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 n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,o=i-n,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var u=e.length-a,c=o<u?o:u,l=-1,h=0;h<=c;++h){if(h===c){if(u>c){if(47===e.charCodeAt(a+h))return e.slice(a+h+1);if(0===h)return e.slice(a+h)}else o>c&&(47===t.charCodeAt(n+h)?l=h:0===h&&(l=0));break}var f=t.charCodeAt(n+h);if(f!==e.charCodeAt(a+h))break;47===f&&(l=h)}var d="";for(h=n+l+1;h<=i;++h)h!==i&&47!==t.charCodeAt(h)||(0===d.length?d+="..":d+="/..");return d.length>0?d+e.slice(a+l):(a+=l,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),n=47===e,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,i=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,u=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(c===e.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){r(t);for(var e=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){n=a+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===n+1?"":t.slice(e,i)},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 n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),o=47===i;o?(e.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,c=!0,l=t.length-1,h=0;l>=n;--l)if(47!==(i=t.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!c){a=l+1;break}return-1===s||-1===u||0===h||1===h&&s===u-1&&s===a+1?-1!==u&&(e.base=e.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,u)):(e.name=t.slice(a,s),e.base=t.slice(a,u)),e.ext=t.slice(s,u)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null};t.exports=s},function(t,e,n){"use strict";var i,r,o,s,a=n(5),u=n(49),c=n(4),l=n(29),h=n(181),f=n(25),d=n(108),p=n(85),v=n(42),g=n(109),m=n(48),y=n(7),b=n(9),w=n(84),x=n(81),k=n(182),E=n(183),S=n(142),O=n(144).set,T=n(184),_=n(187),N=n(188),C=n(146),R=n(189),I=n(30),A=n(107),j=n(6),L=n(190),P=n(112),D=n(76),M=j("species"),z="Promise",B=I.get,q=I.set,U=I.getterFor(z),F=h&&h.prototype,W=h,H=F,V=c.TypeError,X=c.document,G=c.process,Y=C.f,$=Y,K=!!(X&&X.createEvent&&c.dispatchEvent),Z=y(c.PromiseRejectionEvent),J=!1,Q=A(z,(function(){var t=x(W),e=t!==String(W);if(!e&&66===D)return!0;if(u&&!H.finally)return!0;if(D>=51&&/native code/.test(t))return!1;var n=new W((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};return(n.constructor={})[M]=i,!(J=n.then((function(){}))instanceof i)||!e&&L&&!Z})),tt=Q||!E((function(t){W.all(t).catch((function(){}))})),et=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},nt=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;T((function(){for(var i=t.value,r=1==t.state,o=0;n.length>o;){var s,a,u,c=n[o++],l=r?c.ok:c.fail,h=c.resolve,f=c.reject,d=c.domain;try{l?(r||(2===t.rejection&&st(t),t.rejection=1),!0===l?s=i:(d&&d.enter(),s=l(i),d&&(d.exit(),u=!0)),s===c.promise?f(V("Promise-chain cycle")):(a=et(s))?a.call(s,h,f):h(s)):f(i)}catch(t){d&&!u&&d.exit(),f(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&rt(t)}))}},it=function(t,e,n){var i,r;K?((i=X.createEvent("Event")).promise=e,i.reason=n,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:n},!Z&&(r=c["on"+t])?r(i):"unhandledrejection"===t&&N("Unhandled promise rejection",n)},rt=function(t){O.call(c,(function(){var e,n=t.facade,i=t.value;if(ot(t)&&(e=R((function(){P?G.emit("unhandledRejection",i,n):it("unhandledrejection",n,i)})),t.rejection=P||ot(t)?2:1,e.error))throw e.value}))},ot=function(t){return 1!==t.rejection&&!t.parent},st=function(t){O.call(c,(function(){var e=t.facade;P?G.emit("rejectionHandled",e):it("rejectionhandled",e,t.value)}))},at=function(t,e,n){return function(i){t(e,i,n)}},ut=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,nt(t,!0))},ct=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw V("Promise can't be resolved itself");var i=et(e);i?T((function(){var n={done:!1};try{i.call(e,at(ct,n,t),at(ut,n,t))}catch(e){ut(n,e,t)}})):(t.value=e,t.state=1,nt(t,!1))}catch(e){ut({done:!1},e,t)}}};if(Q&&(H=(W=function(t){w(this,W,z),m(t),i.call(this);var e=B(this);try{t(at(ct,e),at(ut,e))}catch(t){ut(e,t)}}).prototype,(i=function(t){q(this,{type:z,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(H,{then:function(t,e){var n=U(this),i=Y(S(this,W));return i.ok=!y(t)||t,i.fail=y(e)&&e,i.domain=P?G.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&nt(n,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new i,e=B(t);this.promise=t,this.resolve=at(ct,e),this.reject=at(ut,e)},C.f=Y=function(t){return t===W||t===o?new r(t):$(t)},!u&&y(h)&&F!==Object.prototype)){s=F.then,J||(f(F,"then",(function(t,e){var n=this;return new W((function(t,e){s.call(n,t,e)})).then(t,e)}),{unsafe:!0}),f(F,"catch",H.catch,{unsafe:!0}));try{delete F.constructor}catch(t){}p&&p(F,H)}a({global:!0,wrap:!0,forced:Q},{Promise:W}),v(W,z,!1,!0),g(z),o=l(z),a({target:z,stat:!0,forced:Q},{reject:function(t){var e=Y(this);return e.reject.call(void 0,t),e.promise}}),a({target:z,stat:!0,forced:u||Q},{resolve:function(t){return _(u&&this===o?W:this,t)}}),a({target:z,stat:!0,forced:tt},{all:function(t){var e=this,n=Y(e),i=n.resolve,r=n.reject,o=R((function(){var n=m(e.resolve),o=[],s=0,a=1;k(t,(function(t){var u=s++,c=!1;o.push(void 0),a++,n.call(e,t).then((function(t){c||(c=!0,o[u]=t,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(t){var e=this,n=Y(e),i=n.reject,r=R((function(){var r=m(e.resolve);k(t,(function(t){r.call(e,t).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return c}));n(11),n(15),n(62),n(221),n(34);var i=n(0),r=n(19);n(16);function o(t,e){var n,r,o=e.url,s=o.indexOf("://")>-1;t&&(r=Object(i.qs)(t,"head"),(n=Object(i.qs)(r,"base"))||(n=t.createElement("base"),r.insertBefore(n,r.firstChild)),!s&&window&&window.location&&(o=window.location.origin+o),n.setAttribute("href",o))}function s(t,e){var n,r,o=e.canonical;t&&(n=Object(i.qs)(t,"head"),(r=Object(i.qs)(n,"link[rel='canonical']"))?r.setAttribute("href",o):((r=t.createElement("link")).setAttribute("rel","canonical"),r.setAttribute("href",o),n.appendChild(r)))}function a(t,e){var n,r,o=e.idref;t&&(n=Object(i.qs)(t,"head"),(r=Object(i.qs)(n,"link[property='dc.identifier']"))?r.setAttribute("content",o):((r=t.createElement("meta")).setAttribute("name","dc.identifier"),r.setAttribute("content",o),n.appendChild(r)))}function u(t,e){var n=t.querySelectorAll("a[href]");if(n.length)for(var o=Object(i.qs)(t.ownerDocument,"base"),s=o?o.getAttribute("href"):void 0,a=function(t){var n=t.getAttribute("href");if(0!==n.indexOf("mailto:"))if(n.indexOf("://")>-1)t.setAttribute("target","_blank");else{var i;try{i=new r.a(n,s)}catch(t){}t.onclick=function(){return i&&i.hash?e(i.Path.path+i.hash):e(i?i.Path.path:n),!1}}}.bind(this),u=0;u<n.length;u++)a(n[u])}function c(t,e,n){return e.forEach((function(e,i){e&&n[i]&&(e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),t=t.replace(new RegExp(e,"g"),n[i]))})),t}},function(t,e,n){var i=n(4),r=n(7),o=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t]):i[t]&&i[t][e]}},function(t,e,n){var i,r,o,s=n(173),a=n(4),u=n(9),c=n(33),l=n(13),h=n(103),f=n(82),d=n(57),p=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new p),g=v.get,m=v.has,y=v.set;i=function(t,e){if(m.call(v,t))throw new TypeError("Object already initialized");return e.facade=t,y.call(v,t,e),e},r=function(t){return g.call(v,t)||{}},o=function(t){return m.call(v,t)}}else{var b=f("state");d[b]=!0,i=function(t,e){if(l(t,b))throw new TypeError("Object already initialized");return e.facade=t,c(t,b,e),e},r=function(t){return l(t,b)?t[b]:{}},o=function(t){return l(t,b)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var i=n(74),r=n(32);t.exports=function(t){return i(r(t))}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(17),r=n(20),o=n(46);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var i=n(50).PROPER,r=n(25),o=n(8),s=n(21),a=n(3),u=n(114),c=RegExp.prototype,l=c.toString,h=a((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),f=i&&"toString"!=l.name;(h||f)&&r(RegExp.prototype,"toString",(function(){var t=o(this),e=s(t.source),n=t.flags;return"/"+e+"/"+s(void 0===n&&t instanceof RegExp&&!("flags"in c)?u.call(t):n)}),{unsafe:!0})},function(t,e,n){"use strict";var i=n(5),r=n(93),o=n(89),s=n(9),a=n(83),u=n(36),c=n(31),l=n(94),h=n(6),f=n(64)("slice"),d=h("species"),p=[].slice,v=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var n,i,h,f=c(this),g=u(f),m=a(t,g),y=a(void 0===e?g:e,g);if(r(f)&&(n=f.constructor,(o(n)&&(n===Array||r(n.prototype))||s(n)&&null===(n=n[d]))&&(n=void 0),n===Array||void 0===n))return p.call(f,m,y);for(i=new(void 0===n?Array:n)(v(y-m,0)),h=0;m<y;m++,h++)m in f&&l(i,h,f[m]);return i.length=h,i}})},function(t,e,n){var i=n(52);t.exports=function(t){return i(t.length)}},function(t,e,n){"use strict";var i=n(91),r=n(120),o=n(8),s=n(32),a=n(142),u=n(116),c=n(52),l=n(21),h=n(40),f=n(92),d=n(90),p=n(115),v=n(3),g=p.UNSUPPORTED_Y,m=[].push,y=Math.min;i("split",(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=l(s(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===t)return[i];if(!r(t))return e.call(i,t,o);for(var a,u,c,h=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,v=new RegExp(t.source,f+"g");(a=d.call(v,i))&&!((u=v.lastIndex)>p&&(h.push(i.slice(p,a.index)),a.length>1&&a.index<i.length&&m.apply(h,a.slice(1)),c=a[0].length,p=u,h.length>=o));)v.lastIndex===a.index&&v.lastIndex++;return p===i.length?!c&&v.test("")||h.push(""):h.push(i.slice(p)),h.length>o?h.slice(0,o):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=s(this),o=null==e?void 0:h(e,t);return o?o.call(e,r,n):i.call(l(r),e,n)},function(t,r){var s=o(this),h=l(t),d=n(i,s,h,r,i!==e);if(d.done)return d.value;var p=a(s,RegExp),v=s.unicode,m=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(g?"g":"y"),b=new p(g?"^(?:"+s.source+")":s,m),w=void 0===r?4294967295:r>>>0;if(0===w)return[];if(0===h.length)return null===f(b,h)?[h]:[];for(var x=0,k=0,E=[];k<h.length;){b.lastIndex=g?0:k;var S,O=f(b,g?h.slice(k):h);if(null===O||(S=y(c(b.lastIndex+(g?k:0)),h.length))===x)k=u(h,k,v);else{if(E.push(h.slice(x,k)),E.length===w)return E;for(var T=1;T<=O.length-1;T++)if(E.push(O[T]),E.length===w)return E;k=x=S}}return E.push(h.slice(x)),E}]}),!!v((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),g)},function(t,e,n){"use strict";var i=n(5),r=n(65).map;i({target:"Array",proto:!0,forced:!n(64)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(17),r=n(50).EXISTS,o=n(20).f,s=Function.prototype,a=s.toString,u=/^\s*function ([^ (]*)/;i&&!r&&o(s,"name",{configurable:!0,get:function(){try{return a.call(this).match(u)[1]}catch(t){return""}}})},function(t,e,n){var i=n(48);t.exports=function(t,e){var n=t[e];return null==n?void 0:i(n)}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){var e=+t;return e!=e||0===e?0:(e>0?i:n)(e)}},function(t,e,n){var i=n(20).f,r=n(13),o=n(6)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i,r=n(8),o=n(135),s=n(105),a=n(57),u=n(136),c=n(80),l=n(82),h=l("IE_PROTO"),f=function(){},d=function(t){return"<script>"+t+"<\/script>"},p=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&i?p(i):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):p(i);for(var n=s.length;n--;)delete v.prototype[s[n]];return v()};a[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f.prototype=r(t),n=new f,f.prototype=null,n[h]=t):n=v(),void 0===e?n:o(n,e)}},function(t,e,n){"use strict";n(14);var i=n(5),r=n(29),o=n(151),s=n(25),a=n(108),u=n(42),c=n(138),l=n(30),h=n(84),f=n(7),d=n(13),p=n(61),v=n(59),g=n(8),m=n(9),y=n(21),b=n(43),w=n(46),x=n(111),k=n(88),E=n(6),S=r("fetch"),O=r("Request"),T=O&&O.prototype,_=r("Headers"),N=E("iterator"),C=l.set,R=l.getterFor("URLSearchParams"),I=l.getterFor("URLSearchParamsIterator"),A=/\+/g,j=Array(4),L=function(t){return j[t-1]||(j[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},P=function(t){try{return decodeURIComponent(t)}catch(e){return t}},D=function(t){var e=t.replace(A," "),n=4;try{return decodeURIComponent(e)}catch(t){for(;n;)e=e.replace(L(n--),P);return e}},M=/[!'()~]|%20/g,z={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},B=function(t){return z[t]},q=function(t){return encodeURIComponent(t).replace(M,B)},U=function(t,e){if(e)for(var n,i,r=e.split("&"),o=0;o<r.length;)(n=r[o++]).length&&(i=n.split("="),t.push({key:D(i.shift()),value:D(i.join("="))}))},F=function(t){this.entries.length=0,U(this.entries,t)},W=function(t,e){if(t<e)throw TypeError("Not enough arguments")},H=c((function(t,e){C(this,{type:"URLSearchParamsIterator",iterator:x(R(t).entries),kind:e})}),"Iterator",(function(){var t=I(this),e=t.kind,n=t.iterator.next(),i=n.value;return n.done||(n.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]),n})),V=function(){h(this,V,"URLSearchParams");var t,e,n,i,r,o,s,a,u,c=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(C(l,{type:"URLSearchParams",entries:f,updateURL:function(){},updateSearchParams:F}),void 0!==c)if(m(c))if(t=k(c))for(n=(e=x(c,t)).next;!(i=n.call(e)).done;){if((s=(o=(r=x(g(i.value))).next).call(r)).done||(a=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");f.push({key:y(s.value),value:y(a.value)})}else for(u in c)d(c,u)&&f.push({key:u,value:y(c[u])});else U(f,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:y(c))},X=V.prototype;if(a(X,{append:function(t,e){W(arguments.length,2);var n=R(this);n.entries.push({key:y(t),value:y(e)}),n.updateURL()},delete:function(t){W(arguments.length,1);for(var e=R(this),n=e.entries,i=y(t),r=0;r<n.length;)n[r].key===i?n.splice(r,1):r++;e.updateURL()},get:function(t){W(arguments.length,1);for(var e=R(this).entries,n=y(t),i=0;i<e.length;i++)if(e[i].key===n)return e[i].value;return null},getAll:function(t){W(arguments.length,1);for(var e=R(this).entries,n=y(t),i=[],r=0;r<e.length;r++)e[r].key===n&&i.push(e[r].value);return i},has:function(t){W(arguments.length,1);for(var e=R(this).entries,n=y(t),i=0;i<e.length;)if(e[i++].key===n)return!0;return!1},set:function(t,e){W(arguments.length,1);for(var n,i=R(this),r=i.entries,o=!1,s=y(t),a=y(e),u=0;u<r.length;u++)(n=r[u]).key===s&&(o?r.splice(u--,1):(o=!0,n.value=a));o||r.push({key:s,value:a}),i.updateURL()},sort:function(){var t,e,n,i=R(this),r=i.entries,o=r.slice();for(r.length=0,n=0;n<o.length;n++){for(t=o[n],e=0;e<n;e++)if(r[e].key>t.key){r.splice(e,0,t);break}e===n&&r.push(t)}i.updateURL()},forEach:function(t){for(var e,n=R(this).entries,i=p(t,arguments.length>1?arguments[1]:void 0,3),r=0;r<n.length;)i((e=n[r++]