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

41 lines
376 KiB
JavaScript
Raw Normal View History

2025-03-02 11:44:34 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var vd=Object.create;var ar=Object.defineProperty,gd=Object.defineProperties,md=Object.getOwnPropertyDescriptor,_d=Object.getOwnPropertyDescriptors,yd=Object.getOwnPropertyNames,Eo=Object.getOwnPropertySymbols,bd=Object.getPrototypeOf,xo=Object.prototype.hasOwnProperty,wd=Object.prototype.propertyIsEnumerable;var So=(r,e,t)=>e in r?ar(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,or=(r,e)=>{for(var t in e||(e={}))xo.call(e,t)&&So(r,t,e[t]);if(Eo)for(var t of Eo(e))wd.call(e,t)&&So(r,t,e[t]);return r},lr=(r,e)=>gd(r,_d(e)),To=r=>ar(r,"__esModule",{value:!0});var As=(r,e)=>()=>(r&&(e=r(r=0)),e);var $=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ko=(r,e)=>{To(r);for(var t in e)ar(r,t,{get:e[t],enumerable:!0})},Ed=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yd(e))!xo.call(r,i)&&i!=="default"&&ar(r,i,{get:()=>e[i],enumerable:!(t=md(e,i))||t.enumerable});return r},Zr=r=>Ed(To(ar(r!=null?vd(bd(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Tt=(r,e,t)=>new Promise((i,n)=>{var s=l=>{try{o(t.next(l))}catch(u){n(u)}},a=l=>{try{o(t.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,a);o((t=t.apply(r,e)).next())});function Jt(r,e){for(var t in e)r[t]=e[t];return r}function Do(r){var e=r.parentNode;e&&e.removeChild(r)}function et(r,e,t){var i,n,s,a={};for(s in e)s=="key"?i=e[s]:s=="ref"?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?ur.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(s in r.defaultProps)a[s]===void 0&&(a[s]=r.defaultProps[s]);return fr(r,a,i,n,null)}function fr(r,e,t,i,n){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:n==null?++Co:n};return n==null&&ue.vnode!=null&&ue.vnode(s),s}function Yr(){return{current:null}}function kt(r){return r.children}function mt(r,e){this.props=r,this.context=e}function Ai(r,e){if(e==null)return r.__?Ai(r.__,r.__.__k.indexOf(r)+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?Ai(r):null}function Po(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Po(r)}}function Ds(r){(!r.__d&&(r.__d=!0)&&hr.push(r)&&!Gr.__r++||Ro!==ue.debounceRendering)&&((Ro=ue.debounceRendering)||No)(Gr)}function Gr(){for(var r;Gr.__r=hr.length;)r=hr.sort(function(e,t){return e.__v.__b-t.__v.__b}),hr=[],r.some(function(e){var t,i,n,s,a,o;e.__d&&(a=(s=(t=e).__v).__e,(o=t.__P)&&(i=[],(n=Jt({},s)).__v=s.__v+1,Ps(o,s,n,t.__n,o.ownerSVGElement!==void 0,s.__h!=null?[a]:null,i,a==null?Ai(s):a,s.__h),qo(i,s),s.__e!=a&&Po(s)))})}function Lo(r,e,t,i,n,s,a,o,l,u){var f,d,c,v,g,O,k,_=i&&i.__k||Io,p=_.length;for(t.__k=[],f=0;f<e.length;f++)if((v=t.__k[f]=(v=e[f])==null||typeof v=="boolean"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"?fr(null,v,null,null,v):Array.isArray(v)?fr(kt,{children:v},null,null,null):v.__b>0?fr(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=t,v.__b=t.__b+1,(c=_[f])===null||c&&v.key==c.key&&v.type===c.type)_[f]=void 0;else for(d=0;d<p;d++){if((c=_[d])&&v.key==c.key&&v.type===c.type){_[d]=void 0;break}c=null}Ps(r,v,c=c||Xr,n,s,a,o,l,u),g=v.__e,(d=v.ref)&&c.ref!=d&&(k||(k=[]),c.ref&&k.push(c.ref,null,v),k.push(d,v.__c||g,v)),g!=null?(O==null&&(O=g),typeof v.type=="function"&&v.__k===c.__k?v.__d=l=zo(v,l,r):l=Mo(r,v,c,_,g,l),typeof t.type=="function"&&(t.__d=l)):l&&c.__e==l&&l.parentNode!=r&&(l=Ai(c))}for(t.__e=O,f=p;f--;)_[f]!=null&&(typeof t.type=="function"&&_[f].__e!=null&&_[f].__e==t.__d&&(t.__d=Ai(i,f+1)),jo(_[f],_[f]));if(k)for(f=0;f<k.length;f++)Wo(k[f],k[++f],k[++f])}function zo(r,e,t){for(var i,n=r.__k,s=0;n&&s<n.length;s++)(i=n[s])&&(i.__=r,e=typeof i.type=="function"?zo(i,e,t):Mo(t,i,i,n,i.__e,e));return e}function Zt(r,e){return e=e||[],r==null||typeof r=="boolean"||(Array.isArray(r)?r.some(function(t){Zt(t,e)}):e.push(r)),e}function
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function hh(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Nr.prototype[r]=function(){return null}});function _n(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}Rr.__DOMHandler=Nr;Rr.DOMParser=uh;Rr.DOMImplementation=ma.DOMImplementation;Rr.XMLSerializer=ma.XMLSerializer});var ya=$(yn=>{var ch=pa();yn.DOMImplementation=ch.DOMImplementation;yn.XMLSerializer=ch.XMLSerializer;yn.DOMParser=fh().DOMParser});var Ie=$(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.RangeObject=void 0;ve.blob2base64=lv;ve.borders=Yp;ve.bounds=Xp;ve.createBase64Url=iv;ve.createBlob=gh;ve.createBlobUrl=ev;ve.defaults=Vp;ve.defer=uv;ve.documentHeight=Fp;ve.extend=Hp;ve.filterChildren=cv;ve.findChildren=fv;ve.getParentByTagName=dv;ve.indexOfElementNode=Jp;ve.indexOfNode=wa;ve.indexOfSorted=ba;ve.indexOfTextNode=Kp;ve.insert=Zp;ve.isElement=qp;ve.isFloat=Wp;ve.isNumber=vh;ve.isXml=Qp;ve.locationOf=bn;ve.nodeBounds=Gp;ve.parents=xa;ve.parse=nv;ve.prefixed=jp;ve.qs=sv;ve.qsa=mh;ve.qsp=av;ve.querySelectorByType=hv;ve.requestAnimationFrame=void 0;ve.revokeBlobUrl=tv;ve.sprint=ov;ve.treeWalker=_h;ve.type=rv;ve.uuid=ph;ve.walk=Ea;ve.windowBounds=$p;var zp=ya(),Mp=typeof window!="undefined"?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1;ve.requestAnimationFrame=Mp;var Bp=1,Up=3,dh=typeof URL!="undefined"?URL:typeof window!="undefined"?window.URL||window.webkitURL||window.mozURL:void 0;function ph(){var r=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(t=="x"?i:i&7|8).toString(16)});return e}function Fp(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function qp(r){return!!(r&&r.nodeType==1)}function vh(r){return!isNaN(parseFloat(r))&&isFinite(r)}function Wp(r){let e=parseFloat(r);return vh(r)===!1?!1:typeof r=="string"&&r.indexOf(".")>-1?!0:Math.floor(e)!==e}function jp(r){var e=["Webkit","webkit","Moz","O","ms"],t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=r.toLowerCase(),n=e.length;if(typeof document=="undefined"||typeof document.body.style[i]!="undefined")return r;for(var s=0;s<n;s++)if(typeof document.body.style[t[s]+i]!="undefined")return t[s]+i;return r}function Vp(r){for(var e=1,t=arguments.length;e<t;e++){var i=arguments[e];for(var n in i)r[n]===void 0&&(r[n]=i[n])}return r}function Hp(r){var e=[].slice.call(arguments,1);return e.forEach(function(t){!t||Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}),r}function Zp(r,e,t){var i=bn(r,e,t);return e.splice(i,0,r),i}function bn(r,e,t,i,n){var s=i||0,a=n||e.length,o=parseInt(s+(a-s)/2),l;return t||(t=function(u,f){if(u>f)return 1;if(u<f)return-1;if(u==f)return 0}),a-s<=0?o:(l=t(e[o],r),a-s==1?l>=0?o:o+1:l===0?o:l===-1?bn(r,e,t,o,a):bn(r,e,t,s,o))}function ba(r,e,t,i,n){var s=i||0,a=n||e.length,o=parseInt(s+(a-s)/2),l;return t||(t=function(u,f){if(u>f)return 1;if(u<f)return-1;if(u==f)return 0}),a-s<=0?-1:(l=t(e[o],r),a-s==1?l===0?o:-1:l===0?o:l===-1?ba(r,e,t,o,a):ba(r,e,t,s,o))}function Xp(r){var e=window.getComputedStyle(r),t=["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],n=0,s=0;return t.forEach(function(a){n+=parseFloat(e[a])||0}),i.forEach(function(a){s+=parseFloat(e[a])||0}),{height:s,width:n}}function Yp(r){var e=window.getComputedStyle(r),t=["paddingRight","paddingLeft","marginRight","marginLeft","
`),e.split(" ").length}parseWords(e,t,i,n){var s=t.cfiBase,a=[],o=e.ownerDocument,l=(0,_i.qs)(o,"body"),u,f=i,d=n?n.spinePos!==t.index:!0,c;n&&t.index===n.spinePos&&(c=n.findNode(n.range?n.path.steps.concat(n.start.steps):n.path.steps,e.ownerDocument));var v=function(g){if(!d)if(g===c)d=!0;else return!1;if(g.textContent.length<10&&g.textContent.trim().length===0)return!1;var O=this.countWords(g.textContent),k,_=0;if(O===0)return!1;for(k=f-this._wordCounter,k>O&&(this._wordCounter+=O,_=O);_<O;)if(k=f-this._wordCounter,_+k>=O)this._wordCounter+=O-_,_=O;else{_+=k;let p=new fi.default(g,s);a.push({cfi:p.toString(),wordCount:this._wordCounter}),this._wordCounter=0}u=g};return(0,_i.sprint)(l,v.bind(this)),a}locationFromCfi(e){let t;return fi.default.prototype.isCfiString(e)&&(e=new fi.default(e)),this._locations.length===0?-1:(t=(0,_i.locationOf)(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(this._locations.length===0)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var t=-1;return typeof e!="number"&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(e>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let i=new fi.default(this._locations[this.total]);return i.collapse(),i.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return typeof e=="string"?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if(typeof e=="string")this._currentCfi=e;else if(typeof e=="number")this._current=e;else return;this._locations.length!==0&&(typeof e=="string"?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(Wv.EVENTS.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}};(0,jv.default)(Ra.prototype);var Vv=Ra;Dn.default=Vv});var qh=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.default=void 0;var Hv=Xv(Ar()),Zv=Ie();function Xv(r){return r&&r.__esModule?r:{default:r}}var Fh=class{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(t=(0,Zv.qs)(e,"rootfile"),!t)throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=Hv.default.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}},Yv=Fh;Pn.default=Yv});var jh=$(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.default=void 0;var Nt=Ie(),Wh=class{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,i,n;if(!e)throw new Error("Package File Not Found");if(t=(0,Nt.qs)(e,"metadata"),!t)throw new Error("No Metadata Found");if(i=(0,Nt.qs)(e,"manifest"),!i)throw new Error("No Manifest Found");if(n=(0,Nt.qs)(e,"spine"),!n)throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,n),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=(0,Nt.indexOfElementNode)(n),this.spine=this.parseSpine(n,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=n.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,nav
`}i.insertRule(l+"{"+u+"}",i.cssRules.length)}else Object.keys(e).forEach(v=>{let g=e[v];if(Array.isArray(g))g.forEach(O=>{let _=Object.keys(O).map(p=>`${p}:${O[p]}`).join(";");i.insertRule(`${v}{${_}}`,i.cssRules.length)});else{let k=Object.keys(g).map(_=>`${_}:${g[_]}`).join(";");i.insertRule(`${v}{${k}}`,i.cssRules.length)}})}addScript(e){return new Promise(function(t,i){var n,s=!1;if(!this.document){t(!1);return}n=this.document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){!s&&(!this.readyState||this.readyState=="complete")&&(s=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(n)}.bind(this))}addClass(e){var t;!this.document||(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;!this.document||(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){!this.document||(this._triggerEvent=this.triggerEvent.bind(this),ti.DOM_EVENTS.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){!this.document||(ti.DOM_EVENTS.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){!this.document||(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){!this.document||(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}.bind(this),250)}triggerSelectedEvent(e){var t,i;e&&e.rangeCount>0&&(t=e.getRangeAt(0),t.collapsed||(i=new Gi.default(t,this.cfiBase).toString(),this.emit(ti.EVENTS.CONTENTS.SELECTED,i),this.emit(ti.EVENTS.CONTENTS.SELECTED_RANGE,t)))}range(e,t){var i=new Gi.default(e);return i.toRange(this.document,t)}cfiFromRange(e,t){return new Gi.default(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new Gi.default(e,this.cfiBase,t).toString()}map(e){var t=new rf.default(e);return t.section()}size(e,t){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),i.width=e,this.css("padding","0 "+e/12+"px")),t>=0&&(this.height(t),i.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(e,t,i,n,s){let a=(0,Wt.prefixed)("column-axis"),o=(0,Wt.prefixed)("column-gap"),l=(0,Wt.prefixed)("column-width"),u=(0,Wt.prefixed)("column-fill"),d=this.writingMode().indexOf("vertical")===0?"vertical":"horizontal";this.layoutStyle("paginated"),s==="rtl"&&d==="horizontal"&&this.direction(s),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),d==="vertical"?(this.css("padding-top",n/2+"px",!0),this.css("padding-bottom",n/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(a,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",n/2+"px",!0),this.css("padding-right",n/2+"px",!0),this.css(a,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(u,"auto"),this.css(o,n+"px"),this.css(l,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,i){var n="scale("+e+")",s="";this.css("transform-origin","top left"),(t>=0||i>=0)&&(s=" translate("+(t||0)+"px, "+(i||0)+"px )"),this.css("transform",n+s)}fit(e,t,i){var n=this.viewport(),s=parseInt(n.width),a=parseInt(n.height),o=e/s,l=t/a,u=o<l?o:l;if(this.layoutStyle("paginated"),this.width(s),this.height(a),this.overflow("hidden"),this.scaler(u,0,0),this.css("background-size",s*u+"px "+a*u+"px"),this.css("background-color","transparent"),i&&i.properties.includes("page-spread-left")){var f=e-s*u;this.css("margin-left",f+"px")}}di
\0`,_e+=d(Ge,2),_e+=M.magic,_e+=d(fe,2),_e+=d(ae,2),_e+=d(Ee.crc32,4),_e+=d(Ee.compressedSize,4),_e+=d(Ee.uncompressedSize,4),_e+=d(q.length,2),_e+=d(be.length,2);var Ze=f.LOCAL_FILE_HEADER+_e+q+be,Be=f.CENTRAL_FILE_HEADER+d(Me,2)+_e+d(re.length,2)+"\0\0\0\0"+d(je,4)+d(P,4)+q+be+re;return{fileRecord:Ze,dirRecord:Be}},O=function(p,y,T,P,w){var N="",C=a.transformTo("string",w(P));return N=f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(p,2)+d(p,2)+d(y,4)+d(T,4)+d(C.length,2)+C,N},k=function(p){var y="";return y=f.DATA_DESCRIPTOR+d(p.crc32,4)+d(p.compressedSize,4)+d(p.uncompressedSize,4),y};function _(p,y,T,P){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=T,this.encodeFileName=P,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(_,o),_.prototype.push=function(p){var y=p.meta.percent||0,T=this.entriesCount,P=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,o.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:T?(y+100*(T-P-1))/T:100}}))},_.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var y=this.streamFiles&&!p.file.dir;if(y){var T=g(p,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:T.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(p){this.accumulate=!1;var y=this.streamFiles&&!p.file.dir,T=g(p,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(T.dirRecord),y)this.push({data:k(p),meta:{percent:100}});else for(this.push({data:T.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var p=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var T=this.bytesWritten-p,P=O(this.dirRecords.length,T,p,this.zipComment,this.encodeFileName);this.push({data:P,meta:{percent:100}})},_.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},_.prototype.registerPrevious=function(p){this._sources.push(p);var y=this;return p.on("data",function(T){y.processChunk(T)}),p.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),p.on("error",function(T){y.error(T)}),this},_.prototype.resume=function(){if(!o.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},_.prototype.error=function(p){var y=this._sources;if(!o.prototype.error.call(this,p))return!1;for(var T=0;T<y.length;T++)try{y[T].error(p)}catch(P){}return!0},_.prototype.lock=function(){o.prototype.lock.call(this);for(var p=this._sources,y=0;y<p.length;y++)p[y].lock()},n.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,n,s){"use strict";var a=i("../compressions"),o=i("./ZipFileWorker"),l=function(u,f){var d=u||f,c=a[d];if(!c)throw new Error(d+" is not a valid compression method !");return c};s.generateWorker=function(u,f,d){var c=new o(f.streamFiles,d,f.platform,f.encodeFileName),v=0;try{u.forEach(function(g,O){v++;var k=l(O.options.compression,f.compression),_=O.options.compressionOptions||f.compressionOptions||{},p=O.dir,y=O.date;O._compressWorker(k,_).withStreamInfo("file",{name:g,dir:p,date:y,comment:O.comment||"",unixPermissions:O.unixPermissions,dosPermissions:O.dosPermissions}).pipe(c)}),c.entriesCount=v}catch(g){c.error(g)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,n,s){"use strict";function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, p
Tags: ${this.settings.tags}
Date: ${(0,rr.moment)().toLocaleString()}
---
# ${this.file.basename}
`}onLoadFile(e){return Tt(this,null,function*(){gr(this.contentEl),this.contentEl.empty();let t=getComputedStyle(this.containerEl.parentElement.querySelector("div.view-header")),i=parseFloat(t.height),n=parseFloat(t.width),s=getComputedStyle(this.containerEl.parentElement.querySelector("div.view-content")),a=parseFloat(s.paddingBottom),o=parseFloat(s.paddingTop),l=(i<n?i:0)+o+1,u=a,f=yield this.app.vault.adapter.readBinary(e.path);nn(et(sd,{contents:f,title:e.basename,scrolled:this.settings.scrolledView,tocOffset:l,tocBottomOffset:u,leaf:this.leaf}),this.contentEl)})}onunload(){gr(this.contentEl)}getDisplayText(){return this.file?this.file.basename:"No File"}canAcceptExtension(e){return e==Ss}getViewType(){return Ts}getIcon(){return go}};var _o=class extends ks.Plugin{onload(){return Tt(this,null,function*(){yield this.loadSettings(),(0,ks.addIcon)(go,`
<path
fill="currentColor"
stroke="currentColor"
d="M 90.695312 47.296875 C 90.046875 46.589844 89.136719 46.1875 88.175781 46.1875 C 87.21875 46.1875 86.304688 46.589844 85.660156 47.296875 L 70.535156 63.277344 L 52.855469 81.933594 C 51.558594 83.339844 49.734375 84.144531 47.820312 84.144531 C 45.90625 84.144531 44.078125 83.339844 42.785156 81.933594 L 17.582031 55.292969 C 14.792969 52.292969 14.792969 47.648438 17.582031 44.648438 L 42.785156 18.023438 C 44.078125 16.617188 45.90625 15.816406 47.820312 15.816406 C 49.734375 15.816406 51.558594 16.617188 52.855469 18.023438 L 64.382812 30.207031 L 40.417969 55.5 C 39.730469 56.257812 39.730469 57.410156 40.417969 58.167969 L 42.945312 60.839844 C 43.652344 61.566406 44.761719 61.566406 45.472656 60.839844 L 73.222656 31.566406 C 73.90625 30.808594 73.90625 29.652344 73.222656 28.894531 L 70.691406 26.226562 L 70.511719 26.054688 L 57.886719 12.722656 C 55.28125 9.921875 51.628906 8.332031 47.804688 8.332031 C 43.980469 8.332031 40.332031 9.921875 37.726562 12.722656 L 12.503906 39.347656 C 6.941406 45.222656 6.941406 54.769531 12.503906 60.644531 L 37.703125 87.269531 C 40.308594 90.070312 43.960938 91.664062 47.789062 91.664062 C 51.613281 91.664062 55.265625 90.070312 57.871094 87.269531 L 83.070312 60.644531 L 90.632812 52.679688 C 92.007812 51.171875 92.007812 48.863281 90.632812 47.359375 L 90.695312 47.292969 Z M 90.695312 47.296875"
/>
`),this.registerView(Ts,e=>new mo(e,this.settings));try{this.registerExtensions([Ss],Ts)}catch(e){console.log(`Existing file extension ${Ss}`)}this.addSettingTab(new Is(this.app,this))})}onunload(){}loadSettings(){return Tt(this,null,function*(){this.settings=Object.assign({},Oo,yield this.loadData())})}saveSettings(){return Tt(this,null,function*(){yield this.saveData(this.settings)})}};
/*!
JSZip v3.9.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/
/*!
localForage -- Offline Storage, Improved
Version 1.10.0
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
/* nosourcemap */